closeclaw 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/agent-templates/AGENTS.md +61 -0
  2. package/dist/agent-templates/HEARTBEAT.md +6 -0
  3. package/dist/agent-templates/SOUL.md +15 -0
  4. package/dist/cli-loader.cjs +1 -0
  5. package/dist/cli.cjs +8223 -0
  6. package/dist/cli.jsc +0 -0
  7. package/dist/index-loader.cjs +1 -0
  8. package/dist/index.cjs +6903 -0
  9. package/dist/index.jsc +0 -0
  10. package/dist/packages/platform-tools/index.js +160 -0
  11. package/dist/packages/platform-tools/openclaw.plugin.json +11 -0
  12. package/dist/packages/platform-tools/package.json +25 -0
  13. package/dist/public/assets/AdminPage-TYchgkhe.js +6 -0
  14. package/dist/public/assets/AgentsPage-fanigo1Q.js +1 -0
  15. package/dist/public/assets/ApprovalsPage-B0jTfJY1.js +1 -0
  16. package/dist/public/assets/GatewayPage-C3mps8uI.js +1 -0
  17. package/dist/public/assets/InboxPage-DWoHZ9O7.js +6 -0
  18. package/dist/public/assets/LogsPage-B-sl_Z5l.js +1 -0
  19. package/dist/public/assets/OrgPage-CcSQejSc.js +1 -0
  20. package/dist/public/assets/OrgSettingsPage-6NAXJQ1k.js +11 -0
  21. package/dist/public/assets/ProjectBoardPage-DnBdfWxy.js +25 -0
  22. package/dist/public/assets/ProjectListPage-DGdYSZz9.js +6 -0
  23. package/dist/public/assets/ProjectSettingsPage-BPttlyAC.js +6 -0
  24. package/dist/public/assets/SystemPage-B9j8tKx6.js +1 -0
  25. package/dist/public/assets/TeamPage-esENElH4.js +1 -0
  26. package/dist/public/assets/chevron-right-BnCRLuSC.js +6 -0
  27. package/dist/public/assets/circle-x-DqOtgfMh.js +11 -0
  28. package/dist/public/assets/clock-k3OP3WGD.js +6 -0
  29. package/dist/public/assets/empty-state-fdFSKAF8.js +1 -0
  30. package/dist/public/assets/index-DXrrw_d3.js +284 -0
  31. package/dist/public/assets/index-Yi92esJb.css +1 -0
  32. package/dist/public/assets/label-chip-CncSPoUy.js +1 -0
  33. package/dist/public/assets/refresh-cw-DPxC49W6.js +6 -0
  34. package/dist/public/assets/trash-2-DG-hxPmD.js +6 -0
  35. package/dist/public/assets/use-tasks-BRmu1Iuc.js +106 -0
  36. package/dist/public/assets/user-plus-DPBDxgC3.js +6 -0
  37. package/dist/public/assets/users-DP3a-Wwz.js +6 -0
  38. package/dist/public/index.html +32 -0
  39. package/package.json +54 -0
@@ -0,0 +1,25 @@
1
+ var es=Object.defineProperty;var ts=(e,t,n)=>t in e?es(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Rt=(e,t,n)=>ts(e,typeof t!="symbol"?t+"":t,n);import{c as vn,i as Dt,t as nn,r as d,u as ns,a as Xr,b as rs,d as ve,e as os,E as Yr,g as Nn,f as oe,h as Xe,k as Ge,l as fr,m as Ve,n as Qe,o as Ur,p as $n,q as At,s as rn,v as ss,w as qr,x as is,y as Hn,z as Vn,A as xn,B as Fe,C as as,D as Wn,F as Xn,G as ls,P as Kr,I as He,J as Yn,K as Gr,T as cs,L as on,M as xe,N as Jr,O as Qr,Q as Pt,R as Oe,S as In,U as st,V as Ke,W as J,j as g,X as It,Y as us,Z as Zr,_ as ct,$ as ds,a0 as ut,a1 as bn,a2 as fs,a3 as ps,a4 as gs,a5 as hs,a6 as jn,a7 as ms,a8 as Ae,a9 as vs,aa as xs,ab as bs,ac as ys,ad as ws,ae as Cs,af as Rs,ag as Ss,ah as Es,ai as Ts,aj as eo,ak as Os,al as Ds,am as As,an as Ps,ao as Ms,ap as Un,aq as ks,ar as pr,as as Ns,at as Is,au as js,av as Ls,aw as Fs,ax as _s,ay as zs,az as Bs,aA as $s,aB as Hs,aC as Vs,aD as Ws,aE as to,aF as Xs,aG as Ys,aH as Us,aI as qs,aJ as no,aK as Ks,aL as ro,aM as Gs,aN as Js,aO as Qs,H as gr}from"./index-DXrrw_d3.js";import{S as Mt,a as sn,P as qn,G as hr,T as mr,b as Zs,L as ei,R as ti,C as oo,D as ni,A as ri,c as oi,U as so,d as io,e as si,u as ii,f as ai,g as li}from"./use-tasks-BRmu1Iuc.js";import{L as ci}from"./label-chip-CncSPoUy.js";import{C as ui,a as di}from"./circle-x-DqOtgfMh.js";import{E as vr}from"./empty-state-fdFSKAF8.js";import{T as fi}from"./trash-2-DG-hxPmD.js";import"./clock-k3OP3WGD.js";const pi=["top","right","bottom","left"],pt=Math.min,Ce=Math.max,an=Math.round,Xt=Math.floor,_e=e=>({x:e,y:e}),gi={left:"right",right:"left",bottom:"top",top:"bottom"};function Ln(e,t,n){return Ce(e,pt(t,n))}function We(e,t){return typeof e=="function"?e(t):e}function be(e){return e.split("-")[0]}function Ze(e){return e.split("-")[1]}function Kn(e){return e==="x"?"y":"x"}function Gn(e){return e==="y"?"height":"width"}function De(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Jn(e){return Kn(De(e))}function hi(e,t,n){n===void 0&&(n=!1);const r=Ze(e),o=Jn(e),s=Gn(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ln(i)),[i,ln(i)]}function mi(e){const t=ln(e);return[Fn(e),t,Fn(t)]}function Fn(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const xr=["left","right"],br=["right","left"],vi=["top","bottom"],xi=["bottom","top"];function bi(e,t,n){switch(e){case"top":case"bottom":return n?t?br:xr:t?xr:br;case"left":case"right":return t?vi:xi;default:return[]}}function yi(e,t,n,r){const o=Ze(e);let s=bi(be(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Fn)))),s}function ln(e){const t=be(e);return gi[t]+e.slice(t.length)}function wi(e){return{top:0,right:0,bottom:0,left:0,...e}}function ao(e){return typeof e!="number"?wi(e):{top:e,right:e,bottom:e,left:e}}function cn(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Ci=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ri=vn("arrow-right",Ci);/**
7
+ * @license lucide-react v0.577.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Si=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],Ei=vn("circle-dot",Si);/**
12
+ * @license lucide-react v0.577.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Ti=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],lo=vn("flag",Ti);/**
17
+ * @license lucide-react v0.577.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Oi=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Di=vn("funnel",Oi);function Ai(e,t){return t!=null&&!Dt(t)?0:typeof e=="function"?e():e}function Qt(e,t,n){const r=Ai(e,n);return typeof r=="number"?r:r==null?void 0:r[t]}function yr(e){return typeof e=="function"?e():e}function co(e,t){return t||e==="click"||e==="mousedown"}function Pi(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:s="click",toggle:i=!0,ignoreMouse:l=!1,stickIfOpen:u=!0,touchOpenDelay:a=0,reason:c=nn}=t,f=d.useRef(void 0),p=ns(),h=Xr(),w=d.useMemo(()=>({onPointerDown(v){f.current=v.pointerType},onMouseDown(v){const m=f.current,x=v.nativeEvent,R=n.select("open");if(v.button!==0||s==="click"||Dt(m,!0)&&l)return;const b=r.current.openEvent,C=b==null?void 0:b.type,E=n.select("domReferenceElement")!==v.currentTarget,S=R&&E||!(R&&i&&(!(b&&u)||C==="click"||C==="mousedown"));if(os(x.target)){const D=ve(c,x,x.target);S&&m==="touch"&&a>0?h.start(a,()=>{n.setOpen(!0,D)}):n.setOpen(S,D);return}const y=v.currentTarget;p.request(()=>{const D=ve(c,x,y);S&&m==="touch"&&a>0?h.start(a,()=>{n.setOpen(!0,D)}):n.setOpen(S,D)})},onClick(v){if(s==="mousedown-only")return;const m=f.current;if(s==="mousedown"&&m){f.current=void 0;return}if(Dt(m,!0)&&l)return;const x=n.select("open"),R=r.current.openEvent,b=n.select("domReferenceElement")!==v.currentTarget,C=x&&b||!(x&&i&&(!(R&&u)||rs(R))),E=ve(c,v.nativeEvent,v.currentTarget);C&&m==="touch"&&a>0?h.start(a,()=>{n.setOpen(!0,E)}):n.setOpen(C,E)},onKeyDown(){f.current=void 0}}),[r,s,l,n,u,i,p,h,a,c]);return d.useMemo(()=>o?{reference:w}:Yr,[o,w])}function wr(e,t,n){let{reference:r,floating:o}=e;const s=De(t),i=Jn(t),l=Gn(i),u=be(t),a=s==="y",c=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[l]/2-o[l]/2;let h;switch(u){case"top":h={x:c,y:r.y-o.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Ze(t)){case"start":h[i]-=p*(n&&a?-1:1);break;case"end":h[i]+=p*(n&&a?-1:1);break}return h}async function Mi(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:l,strategy:u}=e,{boundary:a="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=We(t,e),w=ao(h),m=l[p?f==="floating"?"reference":"floating":f],x=cn(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:a,rootBoundary:c,strategy:u})),R=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),C=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},E=cn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:R,offsetParent:b,strategy:u}):R);return{top:(x.top-E.top+w.top)/C.y,bottom:(E.bottom-x.bottom+w.bottom)/C.y,left:(x.left-E.left+w.left)/C.x,right:(E.right-x.right+w.right)/C.x}}const ki=50,Ni=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:Mi},u=await(i.isRTL==null?void 0:i.isRTL(t));let a=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:f}=wr(a,r,u),p=r,h=0;const w={};for(let v=0;v<s.length;v++){const m=s[v];if(!m)continue;const{name:x,fn:R}=m,{x:b,y:C,data:E,reset:S}=await R({x:c,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:w,rects:a,platform:l,elements:{reference:e,floating:t}});c=b??c,f=C??f,w[x]={...w[x],...E},S&&h<ki&&(h++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(a=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:c,y:f}=wr(a,p,u)),v=-1)}return{x:c,y:f,placement:p,strategy:o,middlewareData:w}},Ii=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:l,platform:u,elements:a}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:v=!0,...m}=We(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=be(o),R=De(l),b=be(l)===l,C=await(u.isRTL==null?void 0:u.isRTL(a.floating)),E=p||(b||!v?[ln(l)]:mi(l)),S=w!=="none";!p&&S&&E.push(...yi(l,v,w,C));const y=[l,...E],D=await u.detectOverflow(t,m),k=[];let N=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&k.push(D[x]),f){const I=hi(o,i,C);k.push(D[I[0]],D[I[1]])}if(N=[...N,{placement:o,overflows:k}],!k.every(I=>I<=0)){var O,A;const I=(((O=s.flip)==null?void 0:O.index)||0)+1,T=y[I];if(T&&(!(f==="alignment"?R!==De(T):!1)||N.every(P=>De(P.placement)===R?P.overflows[0]>0:!0)))return{data:{index:I,overflows:N},reset:{placement:T}};let F=(A=N.filter(L=>L.overflows[0]<=0).sort((L,P)=>L.overflows[1]-P.overflows[1])[0])==null?void 0:A.placement;if(!F)switch(h){case"bestFit":{var M;const L=(M=N.filter(P=>{if(S){const j=De(P.placement);return j===R||j==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(j=>j>0).reduce((j,B)=>j+B,0)]).sort((P,j)=>P[1]-j[1])[0])==null?void 0:M[0];L&&(F=L);break}case"initialPlacement":F=l;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function Cr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Rr(e){return pi.some(t=>e[t]>=0)}const ji=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=We(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),l=Cr(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Rr(l)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),l=Cr(i,n.floating);return{data:{escapedOffsets:l,escaped:Rr(l)}}}default:return{}}}}},uo=new Set(["left","top"]);async function Li(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=be(n),l=Ze(n),u=De(n)==="y",a=uo.has(i)?-1:1,c=s&&u?-1:1,f=We(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:w}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof w=="number"&&(h=l==="end"?w*-1:w),u?{x:h*c,y:p*a}:{x:p*a,y:h*c}}const Fi=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:l}=t,u=await Li(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},_i=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:x=>{let{x:R,y:b}=x;return{x:R,y:b}}},...a}=We(e,t),c={x:n,y:r},f=await s.detectOverflow(t,a),p=De(be(o)),h=Kn(p);let w=c[h],v=c[p];if(i){const x=h==="y"?"top":"left",R=h==="y"?"bottom":"right",b=w+f[x],C=w-f[R];w=Ln(b,w,C)}if(l){const x=p==="y"?"top":"left",R=p==="y"?"bottom":"right",b=v+f[x],C=v-f[R];v=Ln(b,v,C)}const m=u.fn({...t,[h]:w,[p]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:i,[p]:l}}}}}},zi=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:u=!0,crossAxis:a=!0}=We(e,t),c={x:n,y:r},f=De(o),p=Kn(f);let h=c[p],w=c[f];const v=We(l,t),m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const b=p==="y"?"height":"width",C=s.reference[p]-s.floating[b]+m.mainAxis,E=s.reference[p]+s.reference[b]-m.mainAxis;h<C?h=C:h>E&&(h=E)}if(a){var x,R;const b=p==="y"?"width":"height",C=uo.has(be(o)),E=s.reference[f]-s.floating[b]+(C&&((x=i.offset)==null?void 0:x[f])||0)+(C?0:m.crossAxis),S=s.reference[f]+s.reference[b]+(C?0:((R=i.offset)==null?void 0:R[f])||0)-(C?m.crossAxis:0);w<E?w=E:w>S&&(w=S)}return{[p]:h,[f]:w}}}},Bi=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:l}=t,{apply:u=()=>{},...a}=We(e,t),c=await i.detectOverflow(t,a),f=be(o),p=Ze(o),h=De(o)==="y",{width:w,height:v}=s.floating;let m,x;f==="top"||f==="bottom"?(m=f,x=p===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(x=f,m=p==="end"?"top":"bottom");const R=v-c.top-c.bottom,b=w-c.left-c.right,C=pt(v-c[m],R),E=pt(w-c[x],b),S=!t.middlewareData.shift;let y=C,D=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(y=R),S&&!p){const N=Ce(c.left,0),O=Ce(c.right,0),A=Ce(c.top,0),M=Ce(c.bottom,0);h?D=w-2*(N!==0||O!==0?N+O:Ce(c.left,c.right)):y=v-2*(A!==0||M!==0?A+M:Ce(c.top,c.bottom))}await u({...t,availableWidth:D,availableHeight:y});const k=await i.getDimensions(l.floating);return w!==k.width||v!==k.height?{reset:{rects:!0}}:{}}}};function fo(e){const t=Ve(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Qe(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=an(n)!==s||an(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function Qn(e){return oe(e)?e:e.contextElement}function dt(e){const t=Qn(e);if(!Qe(t))return _e(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=fo(t);let i=(s?an(n.width):n.width)/r,l=(s?an(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const $i=_e(0);function po(e){const t=Ge(e);return!Ur()||!t.visualViewport?$i:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Hi(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ge(e)?!1:t}function it(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Qn(e);let i=_e(1);t&&(r?oe(r)&&(i=dt(r)):i=dt(e));const l=Hi(s,n,r)?po(s):_e(0);let u=(o.left+l.x)/i.x,a=(o.top+l.y)/i.y,c=o.width/i.x,f=o.height/i.y;if(s){const p=Ge(s),h=r&&oe(r)?Ge(r):r;let w=p,v=fr(w);for(;v&&r&&h!==w;){const m=dt(v),x=v.getBoundingClientRect(),R=Ve(v),b=x.left+(v.clientLeft+parseFloat(R.paddingLeft))*m.x,C=x.top+(v.clientTop+parseFloat(R.paddingTop))*m.y;u*=m.x,a*=m.y,c*=m.x,f*=m.y,u+=b,a+=C,w=Ge(v),v=fr(w)}}return cn({width:c,height:f,x:u,y:a})}function yn(e,t){const n=xn(e).scrollLeft;return t?t.left+n:it(Xe(e)).left+n}function go(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-yn(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Vi(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Xe(r),l=t?$n(t.floating):!1;if(r===i||l&&s)return n;let u={scrollLeft:0,scrollTop:0},a=_e(1);const c=_e(0),f=Qe(r);if((f||!f&&!s)&&((Hn(r)!=="body"||Vn(i))&&(u=xn(r)),f)){const h=it(r);a=dt(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const p=i&&!f&&!s?go(i,u):_e(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-u.scrollLeft*a.x+c.x+p.x,y:n.y*a.y-u.scrollTop*a.y+c.y+p.y}}function Wi(e){return Array.from(e.getClientRects())}function Xi(e){const t=Xe(e),n=xn(e),r=e.ownerDocument.body,o=Ce(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ce(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+yn(e);const l=-n.scrollTop;return Ve(r).direction==="rtl"&&(i+=Ce(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:l}}const Sr=25;function Yi(e,t){const n=Ge(e),r=Xe(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,u=0;if(o){s=o.width,i=o.height;const c=Ur();(!c||c&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}const a=yn(r);if(a<=0){const c=r.ownerDocument,f=c.body,p=getComputedStyle(f),h=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-f.clientWidth-h);w<=Sr&&(s-=w)}else a<=Sr&&(s+=a);return{width:s,height:i,x:l,y:u}}function Ui(e,t){const n=it(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Qe(e)?dt(e):_e(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,u=o*s.x,a=r*s.y;return{width:i,height:l,x:u,y:a}}function Er(e,t,n){let r;if(t==="viewport")r=Yi(e,n);else if(t==="document")r=Xi(Xe(e));else if(oe(t))r=Ui(t,n);else{const o=po(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return cn(r)}function ho(e,t){const n=At(e);return n===t||!oe(n)||rn(n)?!1:Ve(n).position==="fixed"||ho(n,t)}function qi(e,t){const n=t.get(e);if(n)return n;let r=Nn(e,[],!1).filter(l=>oe(l)&&Hn(l)!=="body"),o=null;const s=Ve(e).position==="fixed";let i=s?At(e):e;for(;oe(i)&&!rn(i);){const l=Ve(i),u=qr(i);!u&&l.position==="fixed"&&(o=null),(s?!u&&!o:!u&&l.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Vn(i)&&!u&&ho(e,i))?r=r.filter(c=>c!==i):o=l,i=At(i)}return t.set(e,r),r}function Ki(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?$n(t)?[]:qi(t,this._c):[].concat(n),r],l=Er(t,i[0],o);let u=l.top,a=l.right,c=l.bottom,f=l.left;for(let p=1;p<i.length;p++){const h=Er(t,i[p],o);u=Ce(h.top,u),a=pt(h.right,a),c=pt(h.bottom,c),f=Ce(h.left,f)}return{width:a-f,height:c-u,x:f,y:u}}function Gi(e){const{width:t,height:n}=fo(e);return{width:t,height:n}}function Ji(e,t,n){const r=Qe(t),o=Xe(t),s=n==="fixed",i=it(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=_e(0);function a(){u.x=yn(o)}if(r||!r&&!s)if((Hn(t)!=="body"||Vn(o))&&(l=xn(t)),r){const h=it(t,!0,s,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else o&&a();s&&!r&&o&&a();const c=o&&!r&&!s?go(o,l):_e(0),f=i.left+l.scrollLeft-u.x-c.x,p=i.top+l.scrollTop-u.y-c.y;return{x:f,y:p,width:i.width,height:i.height}}function Tn(e){return Ve(e).position==="static"}function Tr(e,t){if(!Qe(e)||Ve(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Xe(e)===n&&(n=n.ownerDocument.body),n}function mo(e,t){const n=Ge(e);if($n(e))return n;if(!Qe(e)){let o=At(e);for(;o&&!rn(o);){if(oe(o)&&!Tn(o))return o;o=At(o)}return n}let r=Tr(e,t);for(;r&&ss(r)&&Tn(r);)r=Tr(r,t);return r&&rn(r)&&Tn(r)&&!qr(r)?n:r||is(e)||n}const Qi=async function(e){const t=this.getOffsetParent||mo,n=this.getDimensions,r=await n(e.floating);return{reference:Ji(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Zi(e){return Ve(e).direction==="rtl"}const ea={convertOffsetParentRelativeRectToViewportRelativeRect:Vi,getDocumentElement:Xe,getClippingRect:Ki,getOffsetParent:mo,getElementRects:Qi,getClientRects:Wi,getDimensions:Gi,getScale:dt,isElement:oe,isRTL:Zi};function vo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ta(e,t){let n=null,r;const o=Xe(e);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function i(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const a=e.getBoundingClientRect(),{left:c,top:f,width:p,height:h}=a;if(l||t(),!p||!h)return;const w=Xt(f),v=Xt(o.clientWidth-(c+p)),m=Xt(o.clientHeight-(f+h)),x=Xt(c),b={rootMargin:-w+"px "+-v+"px "+-m+"px "+-x+"px",threshold:Ce(0,pt(1,u))||1};let C=!0;function E(S){const y=S[0].intersectionRatio;if(y!==u){if(!C)return i();y?i(!1,y):r=setTimeout(()=>{i(!1,1e-7)},1e3)}y===1&&!vo(a,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(E,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return i(!0),s}function Or(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,a=Qn(e),c=o||s?[...a?Nn(a):[],...t?Nn(t):[]]:[];c.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=a&&l?ta(a,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(x=>{let[R]=x;R&&R.target===a&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),a&&!u&&h.observe(a),t&&h.observe(t));let w,v=u?it(e):null;u&&m();function m(){const x=it(e);v&&!vo(v,x)&&n(),v=x,w=requestAnimationFrame(m)}return n(),()=>{var x;c.forEach(R=>{o&&R.removeEventListener("scroll",n),s&&R.removeEventListener("resize",n)}),f==null||f(),(x=h)==null||x.disconnect(),h=null,u&&cancelAnimationFrame(w)}}const na=Fi,ra=_i,oa=Ii,sa=Bi,ia=ji,aa=zi,la=(e,t,n)=>{const r=new Map,o={platform:ea,...n},s={...o.platform,_c:r};return Ni(e,t,{...o,platform:s})};var ca=typeof document<"u",ua=function(){},Zt=ca?d.useLayoutEffect:ua;function un(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!un(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!un(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function xo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Dr(e,t){const n=xo(e);return Math.round(t*n)/n}function On(e){const t=d.useRef(e);return Zt(()=>{t.current=e}),t}function da(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:u,open:a}=e,[c,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=d.useState(r);un(p,r)||h(r);const[w,v]=d.useState(null),[m,x]=d.useState(null),R=d.useCallback(P=>{P!==S.current&&(S.current=P,v(P))},[]),b=d.useCallback(P=>{P!==y.current&&(y.current=P,x(P))},[]),C=s||w,E=i||m,S=d.useRef(null),y=d.useRef(null),D=d.useRef(c),k=u!=null,N=On(u),O=On(o),A=On(a),M=d.useCallback(()=>{if(!S.current||!y.current)return;const P={placement:t,strategy:n,middleware:p};O.current&&(P.platform=O.current),la(S.current,y.current,P).then(j=>{const B={...j,isPositioned:A.current!==!1};I.current&&!un(D.current,B)&&(D.current=B,Fe.flushSync(()=>{f(B)}))})},[p,t,n,O,A]);Zt(()=>{a===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[a]);const I=d.useRef(!1);Zt(()=>(I.current=!0,()=>{I.current=!1}),[]),Zt(()=>{if(C&&(S.current=C),E&&(y.current=E),C&&E){if(N.current)return N.current(C,E,M);M()}},[C,E,M,N,k]);const T=d.useMemo(()=>({reference:S,floating:y,setReference:R,setFloating:b}),[R,b]),F=d.useMemo(()=>({reference:C,floating:E}),[C,E]),L=d.useMemo(()=>{const P={position:n,left:0,top:0};if(!F.floating)return P;const j=Dr(F.floating,c.x),B=Dr(F.floating,c.y);return l?{...P,transform:"translate("+j+"px, "+B+"px)",...xo(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:B}},[n,l,F.floating,c.x,c.y]);return d.useMemo(()=>({...c,update:M,refs:T,elements:F,floatingStyles:L}),[c,M,T,F,L])}const fa=(e,t)=>{const n=na(e);return{name:n.name,fn:n.fn,options:[e,t]}},pa=(e,t)=>{const n=ra(e);return{name:n.name,fn:n.fn,options:[e,t]}},ga=(e,t)=>({fn:aa(e).fn,options:[e,t]}),ha=(e,t)=>{const n=oa(e);return{name:n.name,fn:n.fn,options:[e,t]}},ma=(e,t)=>{const n=sa(e);return{name:n.name,fn:n.fn,options:[e,t]}},va=(e,t)=>{const n=ia(e);return{name:n.name,fn:n.fn,options:[e,t]}};function xa(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=as(),s=Wn()!=null,i=Xn(()=>new ls({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Kr,floatingId:o,nested:s,noEmit:!1})).current;return He(()=>{const l={open:t,floatingId:o};r.reference!==void 0&&(l.referenceElement=r.reference,l.domReferenceElement=oe(r.reference)?r.reference:null),r.floating!==void 0&&(l.floatingElement=r.floating),i.update(l)},[t,o,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=!1,i}function ba(e={}){const{nodeId:t,externalTree:n}=e,r=xa(e),o=e.rootContext||r,s={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[i,l]=d.useState(null),u=d.useRef(null),a=Yn(n);He(()=>{s.domReference&&(u.current=s.domReference)},[s.domReference]);const c=da({...e,elements:{...s,...i&&{reference:i}}}),f=d.useCallback(y=>{const D=oe(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),getClientRects:()=>y.getClientRects(),contextElement:y}:y;l(D),c.refs.setReference(D)},[c.refs]),[p,h]=d.useState(null),[w,v]=d.useState(null);o.useSyncedValue("referenceElement",p),o.useSyncedValue("domReferenceElement",oe(p)?p:null),o.useSyncedValue("floatingElement",w);const m=d.useCallback(y=>{(oe(y)||y===null)&&(u.current=y,h(y)),(oe(c.refs.reference.current)||c.refs.reference.current===null||y!==null&&!oe(y))&&c.refs.setReference(y)},[c.refs,h]),x=d.useCallback(y=>{v(y),c.refs.setFloating(y)},[c.refs]),R=d.useMemo(()=>({...c.refs,setReference:m,setFloating:x,setPositionReference:f,domReference:u}),[c.refs,m,x,f]),b=d.useMemo(()=>({...c.elements,domReference:s.domReference}),[c.elements,s.domReference]),C=o.useState("open"),E=o.useState("floatingId"),S=d.useMemo(()=>({...c,dataRef:o.context.dataRef,open:C,onOpenChange:o.setOpen,events:o.context.events,floatingId:E,refs:R,elements:b,nodeId:t,rootStore:o}),[c,R,b,t,o,C,E]);return He(()=>{o.context.dataRef.current.floatingContext=S;const y=a==null?void 0:a.nodesRef.current.find(D=>D.id===t);y&&(y.context=S)}),d.useMemo(()=>({...c,context:S,refs:R,elements:b,rootStore:o}),[c,R,b,S,o])}const ya=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${cs}`;function wa(e){return e?!!e.closest(ya):!1}class Zn{constructor(){Rt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Rt(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new on,this.restTimeout=new on,this.handleCloseOptions=void 0}static create(){return new Zn}}function er(e){var t,n,r;e.performedPointerEventsMutation&&((t=e.pointerEventsScopeElement)==null||t.style.removeProperty("pointer-events"),(n=e.pointerEventsReferenceElement)==null||n.style.removeProperty("pointer-events"),(r=e.pointerEventsFloatingElement)==null||r.style.removeProperty("pointer-events"),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null)}function Ca(e,t){const{scopeElement:n,referenceElement:r,floatingElement:o}=t;er(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=o,n.style.pointerEvents="none",r.style.pointerEvents="auto",o.style.pointerEvents="auto"}function bo(e){const t=Xn(Zn.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),Gr(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function Ra(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:l=!0,closeDelay:u=0}=t,a=bo(n),c=Yn(),f=Wn(),p=xe(()=>{var b;return co((b=i.current.openEvent)==null?void 0:b.type,a.interactedInside)}),h=xe(()=>{var C;const b=(C=i.current.openEvent)==null?void 0:C.type;return(b==null?void 0:b.includes("mouse"))&&b!=="mousedown"}),w=xe(b=>Jr(b,n.context.triggerElements)),v=d.useCallback(b=>{const C=Qt(u,"close",a.pointerType),E=()=>{n.setOpen(!1,ve(Oe,b)),c==null||c.events.emit("floating.closed",b)};C?a.openChangeTimeout.start(C,E):(a.openChangeTimeout.clear(),E())},[u,n,a,c]),m=xe(()=>{er(a)}),x=xe(b=>{const C=Qr(b);if(!wa(C)){a.interactedInside=!1;return}a.interactedInside=(C==null?void 0:C.closest("[aria-haspopup]"))!=null});He(()=>{r||(a.pointerType=void 0,a.restTimeoutPending=!1,a.interactedInside=!1,m())},[r,a,m]),d.useEffect(()=>m,[m]),He(()=>{var b,C,E,S,y;if(l&&r&&(b=a.handleCloseOptions)!=null&&b.blockPointerEvents&&h()&&oe(s)&&o){const D=s,k=o,N=Pt(o),O=(E=(C=c==null?void 0:c.nodesRef.current.find(M=>M.id===f))==null?void 0:C.context)==null?void 0:E.elements.floating;O&&(O.style.pointerEvents="");const A=((y=(S=a.handleCloseOptions)==null?void 0:S.getScope)==null?void 0:y.call(S))??a.pointerEventsScopeElement??O??D.closest("[data-rootownerid]")??N.body;return Ca(a,{scopeElement:A,referenceElement:D,floatingElement:k}),()=>{m()}}},[l,r,s,o,a,h,c,f,m]);const R=Xr();d.useEffect(()=>{if(!l)return;function b(){a.openChangeTimeout.clear(),R.clear(),c==null||c.events.off("floating.closed",E),m()}function C(y){if(c&&f&&In(c.nodesRef.current,f).length>0){c.events.on("floating.closed",E);return}if(!w(y.relatedTarget)){if(a.handler){a.handler(y);return}m(),p()||v(y)}}function E(y){!c||!f||In(c.nodesRef.current,f).length>0||R.start(0,()=>{c.events.off("floating.closed",E),n.setOpen(!1,ve(Oe,y)),c.events.emit("floating.closed",y)})}const S=o;return S&&(S.addEventListener("mouseenter",b),S.addEventListener("mouseleave",C),S.addEventListener("pointerdown",x,!0)),()=>{S&&(S.removeEventListener("mouseenter",b),S.removeEventListener("mouseleave",C),S.removeEventListener("pointerdown",x,!0)),c==null||c.events.off("floating.closed",E)}},[l,o,n,i,p,w,v,m,x,a,c,f,R])}const Sa={current:null};function Ea(e,t={}){var O;const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:o}=n.context,{enabled:s=!0,delay:i=0,handleClose:l=null,mouseOnly:u=!1,restMs:a=0,move:c=!0,triggerElementRef:f=Sa,externalTree:p,isActiveTrigger:h=!0,getHandleCloseContext:w}=t,v=Yn(p),m=bo(n),x=st(l),R=st(i),b=st(a),C=st(s);h&&(m.handleCloseOptions=(O=x.current)==null?void 0:O.__options);const E=xe(()=>{var A;return co((A=r.current.openEvent)==null?void 0:A.type,m.interactedInside)}),S=xe(A=>Jr(A,n.context.triggerElements)),y=xe((A,M,I)=>{const T=n.context.triggerElements;if(T.hasElement(M))return!A||!Ke(A,M);if(!oe(I))return!1;const F=I;return T.hasMatchingElement(L=>Ke(L,F))&&(!A||!Ke(A,F))}),D=d.useCallback((A,M=!0)=>{const I=Qt(R.current,"close",m.pointerType);I?m.openChangeTimeout.start(I,()=>{n.setOpen(!1,ve(Oe,A)),v==null||v.events.emit("floating.closed",A)}):M&&(m.openChangeTimeout.clear(),n.setOpen(!1,ve(Oe,A)),v==null||v.events.emit("floating.closed",A))},[R,n,m,v]),k=xe(()=>{if(!m.handler)return;Pt(n.select("domReferenceElement")).removeEventListener("mousemove",m.handler),m.handler=void 0});d.useEffect(()=>k,[k]);const N=xe(()=>{er(m)});return d.useEffect(()=>{if(!s)return;function A(M){M.open||(k(),m.openChangeTimeout.clear(),m.restTimeout.clear(),m.blockMouseMove=!0,m.restTimeoutPending=!1)}return o.on("openchange",A),()=>{o.off("openchange",A)}},[s,o,m,k]),d.useEffect(()=>{if(!s)return;const A=f.current??(h?n.select("domReferenceElement"):null);if(!oe(A))return;function M(T){if(m.openChangeTimeout.clear(),m.blockMouseMove=!1,u&&!Dt(m.pointerType)||yr(b.current)>0&&!Qt(R.current,"open"))return;const L=Qt(R.current,"open",m.pointerType),P=T.currentTarget??null,j=n.select("domReferenceElement"),B=P==null?!1:y(j,P,T.target),ee=n.select("open"),$=!ee||B;B&&ee?n.setOpen(!0,ve(Oe,T,P)):L?m.openChangeTimeout.start(L,()=>{$&&n.setOpen(!0,ve(Oe,T,P))}):$&&n.setOpen(!0,ve(Oe,T,P))}function I(T){if(E()){N();return}k();const F=n.select("domReferenceElement"),L=Pt(F);m.restTimeout.clear(),m.restTimeoutPending=!1;const P=r.current.floatingContext??(w==null?void 0:w());if(S(T.relatedTarget))return;if(x.current&&P){n.select("open")||m.openChangeTimeout.clear();const ee=f.current;m.handler=x.current({...P,tree:v,x:T.clientX,y:T.clientY,onClose(){N(),k(),C.current&&!E()&&ee===n.select("domReferenceElement")&&D(T,!0)}}),L.addEventListener("mousemove",m.handler),m.handler(T);return}(m.pointerType==="touch"?!Ke(n.select("floatingElement"),T.relatedTarget):!0)&&D(T)}return c&&A.addEventListener("mousemove",M,{once:!0}),A.addEventListener("mouseenter",M),A.addEventListener("mouseleave",I),()=>{c&&A.removeEventListener("mousemove",M),A.removeEventListener("mouseenter",M),A.removeEventListener("mouseleave",I)}},[k,N,r,R,D,n,s,x,m,h,y,E,S,u,c,b,f,v,C,w]),d.useMemo(()=>{if(!s)return;function A(M){m.pointerType=M.pointerType}return{onPointerDown:A,onPointerEnter:A,onMouseMove(M){const{nativeEvent:I}=M,T=M.currentTarget,F=n.select("domReferenceElement"),L=n.select("open"),P=y(F,T,M.target);if(u&&!Dt(m.pointerType))return;const j=yr(b.current);if(L&&!P||j===0||!P&&m.restTimeoutPending&&M.movementX**2+M.movementY**2<2)return;m.restTimeout.clear();function B(){if(m.restTimeoutPending=!1,E())return;const ee=n.select("open");!m.blockMouseMove&&(!ee||P)&&n.setOpen(!0,ve(Oe,I,T))}m.pointerType==="touch"?Fe.flushSync(()=>{B()}):P&&L?B():(m.restTimeoutPending=!0,m.restTimeout.start(j,B))}}},[s,m,E,y,u,n,b])}const Ar=.1,Ta=Ar*Ar,U=.5;function Yt(e,t,n,r,o,s){return r>=t!=s>=t&&e<=(o-n)*(t-r)/(s-r)+n}function Ut(e,t,n,r,o,s,i,l,u,a){let c=!1;return Yt(e,t,n,r,o,s)&&(c=!c),Yt(e,t,o,s,i,l)&&(c=!c),Yt(e,t,i,l,u,a)&&(c=!c),Yt(e,t,u,a,n,r)&&(c=!c),c}function Oa(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function qt(e,t,n,r,o,s){const i=Math.min(n,o),l=Math.max(n,o),u=Math.min(r,s),a=Math.max(r,s);return e>=i&&e<=l&&t>=u&&t<=a}function Da(e={}){const{blockPointerEvents:t=!1}=e,n=new on,r=({x:o,y:s,placement:i,elements:l,onClose:u,nodeId:a,tree:c})=>{const f=i==null?void 0:i.split("-")[0];let p=!1,h=null,w=null,v=typeof performance<"u"?performance.now():0;function m(R,b){const C=performance.now(),E=C-v;if(h===null||w===null||E===0)return h=R,w=b,v=C,!1;const S=R-h,y=b-w,D=S*S+y*y,k=E*E*Ta;return h=R,w=b,v=C,D<k}function x(){n.clear(),u()}return function(b){n.clear();const C=l.domReference,E=l.floating;if(!C||!E||f==null||o==null||s==null)return;const{clientX:S,clientY:y}=b,D=Qr(b),k=b.type==="mouseleave",N=Ke(E,D),O=Ke(C,D);if(N&&(p=!0,!k))return;if(O&&(p=!1,!k)){p=!0;return}if(k&&oe(b.relatedTarget)&&Ke(E,b.relatedTarget))return;function A(){return!!(c&&In(c.nodesRef.current,a).length>0)}function M(){A()||x()}if(A())return;const I=C.getBoundingClientRect(),T=E.getBoundingClientRect(),F=o>T.right-T.width/2,L=s>T.bottom-T.height/2,P=T.width>I.width,j=T.height>I.height,B=(P?I:T).left,ee=(P?I:T).right,$=(j?I:T).top,q=(j?I:T).bottom;if(f==="top"&&s>=I.bottom-1||f==="bottom"&&s<=I.top+1||f==="left"&&o>=I.right-1||f==="right"&&o<=I.left+1){M();return}let H=!1;switch(f){case"top":H=qt(S,y,B,I.top+1,ee,T.bottom-1);break;case"bottom":H=qt(S,y,B,T.top+1,ee,I.bottom-1);break;case"left":H=qt(S,y,T.right-1,q,I.left+1,$);break;case"right":H=qt(S,y,I.right-1,q,T.left+1,$);break}if(H)return;if(p&&!Oa(S,y,I)){M();return}if(!k&&m(S,y)){M();return}let V=!1;switch(f){case"top":{const _=P?U/2:U*4,le=P||F?o+_:o-_,ae=P?o-_:F?o+_:o-_,Q=s+U+1,z=F||P?T.bottom-U:T.top,ce=F?P?T.bottom-U:T.top:T.bottom-U;V=Ut(S,y,le,Q,ae,Q,T.left,z,T.right,ce);break}case"bottom":{const _=P?U/2:U*4,le=P||F?o+_:o-_,ae=P?o-_:F?o+_:o-_,Q=s-U,z=F||P?T.top+U:T.bottom,ce=F?P?T.top+U:T.bottom:T.top+U;V=Ut(S,y,le,Q,ae,Q,T.left,z,T.right,ce);break}case"left":{const _=j?U/2:U*4,le=j||L?s+_:s-_,ae=j?s-_:L?s+_:s-_,Q=o+U+1,z=L||j?T.right-U:T.left,ce=L?j?T.right-U:T.left:T.right-U;V=Ut(S,y,z,T.top,ce,T.bottom,Q,le,Q,ae);break}case"right":{const _=j?U/2:U*4,le=j||L?s+_:s-_,ae=j?s-_:L?s+_:s-_,Q=o-U,z=L||j?T.left+U:T.right,ce=L?j?T.left+U:T.right:T.left+U;V=Ut(S,y,Q,le,Q,ae,z,T.top,ce,T.bottom);break}}V?p||n.start(40,M):M()}};return r.__options={blockPointerEvents:t},r}function Aa(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const wn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function tr(e){return"nodeType"in e}function fe(e){var t,n;return e?gt(e)?e:tr(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function nr(e){const{Document:t}=fe(e);return e instanceof t}function jt(e){return gt(e)?!1:e instanceof fe(e).HTMLElement}function yo(e){return e instanceof fe(e).SVGElement}function ht(e){return e?gt(e)?e.document:tr(e)?nr(e)?e:jt(e)||yo(e)?e.ownerDocument:document:document:document}const Pe=wn?d.useLayoutEffect:d.useEffect;function Cn(e){const t=d.useRef(e);return Pe(()=>{t.current=e}),d.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Pa(){const e=d.useRef(null),t=d.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=d.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function kt(e,t){t===void 0&&(t=[e]);const n=d.useRef(e);return Pe(()=>{n.current!==e&&(n.current=e)},t),n}function Lt(e,t){const n=d.useRef();return d.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function dn(e){const t=Cn(e),n=d.useRef(null),r=d.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function fn(e){const t=d.useRef();return d.useEffect(()=>{t.current=e},[e]),t.current}let Dn={};function Ft(e,t){return d.useMemo(()=>{if(t)return t;const n=Dn[e]==null?0:Dn[e]+1;return Dn[e]=n,e+"-"+n},[e,t])}function wo(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,i)=>{const l=Object.entries(i);for(const[u,a]of l){const c=s[u];c!=null&&(s[u]=c+e*a)}return s},{...t})}}const ft=wo(1),pn=wo(-1);function Ma(e){return"clientX"in e&&"clientY"in e}function Rn(e){if(!e)return!1;const{KeyboardEvent:t}=fe(e.target);return t&&e instanceof t}function ka(e){if(!e)return!1;const{TouchEvent:t}=fe(e.target);return t&&e instanceof t}function gn(e){if(ka(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Ma(e)?{x:e.clientX,y:e.clientY}:null}const Je=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Je.Translate.toString(e),Je.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Pr="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Na(e){return e.matches(Pr)?e:e.querySelector(Pr)}const Ia={display:"none"};function ja(e){let{id:t,value:n}=e;return J.createElement("div",{id:t,style:Ia},n)}function La(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return J.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Fa(){const[e,t]=d.useState("");return{announce:d.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Co=d.createContext(null);function _a(e){const t=d.useContext(Co);d.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function za(){const[e]=d.useState(()=>new Set),t=d.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[d.useCallback(r=>{let{type:o,event:s}=r;e.forEach(i=>{var l;return(l=i[o])==null?void 0:l.call(i,s)})},[e]),t]}const Ba={draggable:`
22
+ To pick up a draggable item, press the space bar.
23
+ While dragging, use the arrow keys to move the item.
24
+ Press space again to drop the item in its new position, or press escape to cancel.
25
+ `},$a={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Ha(e){let{announcements:t=$a,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Ba}=e;const{announce:s,announcement:i}=Fa(),l=Ft("DndLiveRegion"),[u,a]=d.useState(!1);if(d.useEffect(()=>{a(!0)},[]),_a(d.useMemo(()=>({onDragStart(f){let{active:p}=f;s(t.onDragStart({active:p}))},onDragMove(f){let{active:p,over:h}=f;t.onDragMove&&s(t.onDragMove({active:p,over:h}))},onDragOver(f){let{active:p,over:h}=f;s(t.onDragOver({active:p,over:h}))},onDragEnd(f){let{active:p,over:h}=f;s(t.onDragEnd({active:p,over:h}))},onDragCancel(f){let{active:p,over:h}=f;s(t.onDragCancel({active:p,over:h}))}}),[s,t])),!u)return null;const c=J.createElement(J.Fragment,null,J.createElement(ja,{id:r,value:o.draggable}),J.createElement(La,{id:l,announcement:i}));return n?Fe.createPortal(c,n):c}var re;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(re||(re={}));function hn(){}function Va(e,t){return d.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Wa(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Me=Object.freeze({x:0,y:0});function Xa(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ya(e,t){const n=gn(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Ua(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function qa(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Ka(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function Ga(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Ja(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),i=o-r,l=s-n;if(r<o&&n<s){const u=t.width*t.height,a=e.width*e.height,c=i*l,f=c/(u+a-c);return Number(f.toFixed(4))}return 0}const Ro=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:i}=s,l=n.get(i);if(l){const u=Ja(l,t);u>0&&o.push({id:i,data:{droppableContainer:s,value:u}})}}return o.sort(qa)};function Qa(e,t){const{top:n,left:r,bottom:o,right:s}=t;return n<=e.y&&e.y<=o&&r<=e.x&&e.x<=s}const Za=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const o=[];for(const s of t){const{id:i}=s,l=n.get(i);if(l&&Qa(r,l)){const a=Ka(l).reduce((f,p)=>f+Xa(r,p),0),c=Number((a/4).toFixed(4));o.push({id:i,data:{droppableContainer:s,value:c}})}}return o.sort(Ua)};function el(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function So(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Me}function tl(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((i,l)=>({...i,top:i.top+e*l.y,bottom:i.bottom+e*l.y,left:i.left+e*l.x,right:i.right+e*l.x}),{...n})}}const nl=tl(1);function Eo(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function rl(e,t,n){const r=Eo(t);if(!r)return e;const{scaleX:o,scaleY:s,x:i,y:l}=r,u=e.left-i-(1-o)*parseFloat(n),a=e.top-l-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width/o:e.width,f=s?e.height/s:e.height;return{width:c,height:f,top:a,right:u+c,bottom:a+f,left:u}}const ol={ignoreTransform:!1};function mt(e,t){t===void 0&&(t=ol);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:a,transformOrigin:c}=fe(e).getComputedStyle(e);a&&(n=rl(n,a,c))}const{top:r,left:o,width:s,height:i,bottom:l,right:u}=n;return{top:r,left:o,width:s,height:i,bottom:l,right:u}}function Mr(e){return mt(e,{ignoreTransform:!0})}function sl(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function il(e,t){return t===void 0&&(t=fe(e).getComputedStyle(e)),t.position==="fixed"}function al(e,t){t===void 0&&(t=fe(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function rr(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(nr(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!jt(o)||yo(o)||n.includes(o))return n;const s=fe(e).getComputedStyle(o);return o!==e&&al(o,s)&&n.push(o),il(o,s)?n:r(o.parentNode)}return e?r(e):n}function To(e){const[t]=rr(e,1);return t??null}function An(e){return!wn||!e?null:gt(e)?e:tr(e)?nr(e)||e===ht(e).scrollingElement?window:jt(e)?e:null:null}function Oo(e){return gt(e)?e.scrollX:e.scrollLeft}function Do(e){return gt(e)?e.scrollY:e.scrollTop}function _n(e){return{x:Oo(e),y:Do(e)}}var ie;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ie||(ie={}));function Ao(e){return!wn||!e?!1:e===document.scrollingElement}function Po(e){const t={x:0,y:0},n=Ao(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,i=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:l,maxScroll:r,minScroll:t}}const ll={x:.2,y:.2};function cl(e,t,n,r,o){let{top:s,left:i,right:l,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=ll);const{isTop:a,isBottom:c,isLeft:f,isRight:p}=Po(e),h={x:0,y:0},w={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!a&&s<=t.top+v.height?(h.y=ie.Backward,w.y=r*Math.abs((t.top+v.height-s)/v.height)):!c&&u>=t.bottom-v.height&&(h.y=ie.Forward,w.y=r*Math.abs((t.bottom-v.height-u)/v.height)),!p&&l>=t.right-v.width?(h.x=ie.Forward,w.x=r*Math.abs((t.right-v.width-l)/v.width)):!f&&i<=t.left+v.width&&(h.x=ie.Backward,w.x=r*Math.abs((t.left+v.width-i)/v.width)),{direction:h,speed:w}}function ul(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:i}=window;return{top:0,left:0,right:s,bottom:i,width:s,height:i}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Mo(e){return e.reduce((t,n)=>ft(t,_n(n)),Me)}function dl(e){return e.reduce((t,n)=>t+Oo(n),0)}function fl(e){return e.reduce((t,n)=>t+Do(n),0)}function ko(e,t){if(t===void 0&&(t=mt),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);To(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const pl=[["x",["left","right"],dl],["y",["top","bottom"],fl]];class or{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=rr(n),o=Mo(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,l]of pl)for(const u of i)Object.defineProperty(this,u,{get:()=>{const a=l(r),c=o[s]-a;return this.rect[u]+c},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Et{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function gl(e){const{EventTarget:t}=fe(e);return e instanceof t?e:ht(e)}function Pn(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Te;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Te||(Te={}));function kr(e){e.preventDefault()}function hl(e){e.stopPropagation()}var W;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(W||(W={}));const No={start:[W.Space,W.Enter],cancel:[W.Esc],end:[W.Space,W.Enter,W.Tab]},ml=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case W.Right:return{...n,x:n.x+25};case W.Left:return{...n,x:n.x-25};case W.Down:return{...n,y:n.y+25};case W.Up:return{...n,y:n.y-25}}};class Io{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Et(ht(n)),this.windowListeners=new Et(fe(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Te.Resize,this.handleCancel),this.windowListeners.add(Te.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Te.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&ko(r),n(Me)}handleKeyDown(t){if(Rn(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=No,coordinateGetter:i=ml,scrollBehavior:l="smooth"}=o,{code:u}=t;if(s.end.includes(u)){this.handleEnd(t);return}if(s.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:a}=r.current,c=a?{x:a.left,y:a.top}:Me;this.referenceCoordinates||(this.referenceCoordinates=c);const f=i(t,{active:n,context:r.current,currentCoordinates:c});if(f){const p=pn(f,c),h={x:0,y:0},{scrollableAncestors:w}=r.current;for(const v of w){const m=t.code,{isTop:x,isRight:R,isLeft:b,isBottom:C,maxScroll:E,minScroll:S}=Po(v),y=ul(v),D={x:Math.min(m===W.Right?y.right-y.width/2:y.right,Math.max(m===W.Right?y.left:y.left+y.width/2,f.x)),y:Math.min(m===W.Down?y.bottom-y.height/2:y.bottom,Math.max(m===W.Down?y.top:y.top+y.height/2,f.y))},k=m===W.Right&&!R||m===W.Left&&!b,N=m===W.Down&&!C||m===W.Up&&!x;if(k&&D.x!==f.x){const O=v.scrollLeft+p.x,A=m===W.Right&&O<=E.x||m===W.Left&&O>=S.x;if(A&&!p.y){v.scrollTo({left:O,behavior:l});return}A?h.x=v.scrollLeft-O:h.x=m===W.Right?v.scrollLeft-E.x:v.scrollLeft-S.x,h.x&&v.scrollBy({left:-h.x,behavior:l});break}else if(N&&D.y!==f.y){const O=v.scrollTop+p.y,A=m===W.Down&&O<=E.y||m===W.Up&&O>=S.y;if(A&&!p.x){v.scrollTo({top:O,behavior:l});return}A?h.y=v.scrollTop-O:h.y=m===W.Down?v.scrollTop-E.y:v.scrollTop-S.y,h.y&&v.scrollBy({top:-h.y,behavior:l});break}}this.handleMove(t,ft(pn(f,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Io.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=No,onActivation:o}=t,{active:s}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const l=s.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Nr(e){return!!(e&&"distance"in e)}function Ir(e){return!!(e&&"delay"in e)}class sr{constructor(t,n,r){var o;r===void 0&&(r=gl(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:i}=s;this.props=t,this.events=n,this.document=ht(i),this.documentListeners=new Et(this.document),this.listeners=new Et(r),this.windowListeners=new Et(fe(i)),this.initialCoordinates=(o=gn(s))!=null?o:Me,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Te.Resize,this.handleCancel),this.windowListeners.add(Te.DragStart,kr),this.windowListeners.add(Te.VisibilityChange,this.handleCancel),this.windowListeners.add(Te.ContextMenu,kr),this.documentListeners.add(Te.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ir(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Nr(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Te.Click,hl,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Te.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:l}}=s;if(!o)return;const u=(n=gn(t))!=null?n:Me,a=pn(o,u);if(!r&&l){if(Nr(l)){if(l.tolerance!=null&&Pn(a,l.tolerance))return this.handleCancel();if(Pn(a,l.distance))return this.handleStart()}if(Ir(l)&&Pn(a,l.tolerance))return this.handleCancel();this.handlePending(l,a);return}t.cancelable&&t.preventDefault(),i(u)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===W.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const vl={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ir extends sr{constructor(t){const{event:n}=t,r=ht(n.target);super(t,vl,r)}}ir.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const xl={move:{name:"mousemove"},end:{name:"mouseup"}};var zn;(function(e){e[e.RightClick=2]="RightClick"})(zn||(zn={}));class bl extends sr{constructor(t){super(t,xl,ht(t.event.target))}}bl.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===zn.RightClick?!1:(r==null||r({event:n}),!0)}}];const Mn={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class yl extends sr{constructor(t){super(t,Mn)}static setup(){return window.addEventListener(Mn.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Mn.move.name,t)};function t(){}}}yl.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Tt;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Tt||(Tt={}));var mn;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(mn||(mn={}));function wl(e){let{acceleration:t,activator:n=Tt.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:l=mn.TreeOrder,pointerCoordinates:u,scrollableAncestors:a,scrollableAncestorRects:c,delta:f,threshold:p}=e;const h=Rl({delta:f,disabled:!s}),[w,v]=Pa(),m=d.useRef({x:0,y:0}),x=d.useRef({x:0,y:0}),R=d.useMemo(()=>{switch(n){case Tt.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Tt.DraggableRect:return o}},[n,o,u]),b=d.useRef(null),C=d.useCallback(()=>{const S=b.current;if(!S)return;const y=m.current.x*x.current.x,D=m.current.y*x.current.y;S.scrollBy(y,D)},[]),E=d.useMemo(()=>l===mn.TreeOrder?[...a].reverse():a,[l,a]);d.useEffect(()=>{if(!s||!a.length||!R){v();return}for(const S of E){if((r==null?void 0:r(S))===!1)continue;const y=a.indexOf(S),D=c[y];if(!D)continue;const{direction:k,speed:N}=cl(S,D,R,t,p);for(const O of["x","y"])h[O][k[O]]||(N[O]=0,k[O]=0);if(N.x>0||N.y>0){v(),b.current=S,w(C,i),m.current=N,x.current=k;return}}m.current={x:0,y:0},x.current={x:0,y:0},v()},[t,C,r,v,s,i,JSON.stringify(R),JSON.stringify(h),w,a,E,c,JSON.stringify(p)])}const Cl={x:{[ie.Backward]:!1,[ie.Forward]:!1},y:{[ie.Backward]:!1,[ie.Forward]:!1}};function Rl(e){let{delta:t,disabled:n}=e;const r=fn(t);return Lt(o=>{if(n||!r||!o)return Cl;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ie.Backward]:o.x[ie.Backward]||s.x===-1,[ie.Forward]:o.x[ie.Forward]||s.x===1},y:{[ie.Backward]:o.y[ie.Backward]||s.y===-1,[ie.Forward]:o.y[ie.Forward]||s.y===1}}},[n,t,r])}function Sl(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Lt(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function El(e,t){return d.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,r)}));return[...n,...s]},[]),[e,t])}var Nt;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Nt||(Nt={}));var Bn;(function(e){e.Optimized="optimized"})(Bn||(Bn={}));const jr=new Map;function Tl(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,i]=d.useState(null),{frequency:l,measure:u,strategy:a}=o,c=d.useRef(e),f=m(),p=kt(f),h=d.useCallback(function(x){x===void 0&&(x=[]),!p.current&&i(R=>R===null?x:R.concat(x.filter(b=>!R.includes(b))))},[p]),w=d.useRef(null),v=Lt(x=>{if(f&&!n)return jr;if(!x||x===jr||c.current!==e||s!=null){const R=new Map;for(let b of e){if(!b)continue;if(s&&s.length>0&&!s.includes(b.id)&&b.rect.current){R.set(b.id,b.rect.current);continue}const C=b.node.current,E=C?new or(u(C),C):null;b.rect.current=E,E&&R.set(b.id,E)}return R}return x},[e,s,n,f,u]);return d.useEffect(()=>{c.current=e},[e]),d.useEffect(()=>{f||h()},[n,f]),d.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),d.useEffect(()=>{f||typeof l!="number"||w.current!==null||(w.current=setTimeout(()=>{h(),w.current=null},l))},[l,f,h,...r]),{droppableRects:v,measureDroppableContainers:h,measuringScheduled:s!=null};function m(){switch(a){case Nt.Always:return!1;case Nt.BeforeDragging:return n;default:return!n}}}function ar(e,t){return Lt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Ol(e,t){return ar(e,t)}function Dl(e){let{callback:t,disabled:n}=e;const r=Cn(t),o=d.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return d.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Sn(e){let{callback:t,disabled:n}=e;const r=Cn(t),o=d.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return d.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Al(e){return new or(mt(e),e)}function Lr(e,t,n){t===void 0&&(t=Al);const[r,o]=d.useState(null);function s(){o(u=>{if(!e)return null;if(e.isConnected===!1){var a;return(a=u??n)!=null?a:null}const c=t(e);return JSON.stringify(u)===JSON.stringify(c)?u:c})}const i=Dl({callback(u){if(e)for(const a of u){const{type:c,target:f}=a;if(c==="childList"&&f instanceof HTMLElement&&f.contains(e)){s();break}}}}),l=Sn({callback:s});return Pe(()=>{s(),e?(l==null||l.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),i==null||i.disconnect())},[e]),r}function Pl(e){const t=ar(e);return So(e,t)}const Fr=[];function Ml(e){const t=d.useRef(e),n=Lt(r=>e?r&&r!==Fr&&e&&t.current&&e.parentNode===t.current.parentNode?r:rr(e):Fr,[e]);return d.useEffect(()=>{t.current=e},[e]),n}function kl(e){const[t,n]=d.useState(null),r=d.useRef(e),o=d.useCallback(s=>{const i=An(s.target);i&&n(l=>l?(l.set(i,_n(i)),new Map(l)):null)},[]);return d.useEffect(()=>{const s=r.current;if(e!==s){i(s);const l=e.map(u=>{const a=An(u);return a?(a.addEventListener("scroll",o,{passive:!0}),[a,_n(a)]):null}).filter(u=>u!=null);n(l.length?new Map(l):null),r.current=e}return()=>{i(e),i(s)};function i(l){l.forEach(u=>{const a=An(u);a==null||a.removeEventListener("scroll",o)})}},[o,e]),d.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>ft(s,i),Me):Mo(e):Me,[e,t])}function _r(e,t){t===void 0&&(t=[]);const n=d.useRef(null);return d.useEffect(()=>{n.current=null},t),d.useEffect(()=>{const r=e!==Me;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?pn(e,n.current):Me}function Nl(e){d.useEffect(()=>{if(!wn)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Il(e,t){return d.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,t)},n},{}),[e,t])}function jo(e){return d.useMemo(()=>e?sl(e):null,[e])}const zr=[];function jl(e,t){t===void 0&&(t=mt);const[n]=e,r=jo(n?fe(n):null),[o,s]=d.useState(zr);function i(){s(()=>e.length?e.map(u=>Ao(u)?r:new or(t(u),u)):zr)}const l=Sn({callback:i});return Pe(()=>{l==null||l.disconnect(),i(),e.forEach(u=>l==null?void 0:l.observe(u))},[e]),o}function Lo(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return jt(t)?t:e}function Ll(e){let{measure:t}=e;const[n,r]=d.useState(null),o=d.useCallback(a=>{for(const{target:c}of a)if(jt(c)){r(f=>{const p=t(c);return f?{...f,width:p.width,height:p.height}:p});break}},[t]),s=Sn({callback:o}),i=d.useCallback(a=>{const c=Lo(a);s==null||s.disconnect(),c&&(s==null||s.observe(c)),r(c?t(c):null)},[t,s]),[l,u]=dn(i);return d.useMemo(()=>({nodeRef:l,rect:n,setRef:u}),[n,l,u])}const Fl=[{sensor:ir,options:{}},{sensor:Io,options:{}}],_l={current:{}},en={draggable:{measure:Mr},droppable:{measure:Mr,strategy:Nt.WhileDragging,frequency:Bn.Optimized},dragOverlay:{measure:mt}};class Ot extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const zl={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ot,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:hn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:en,measureDroppableContainers:hn,windowRect:null,measuringScheduled:!1},Fo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:hn,draggableNodes:new Map,over:null,measureDroppableContainers:hn},_t=d.createContext(Fo),_o=d.createContext(zl);function Bl(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ot}}}function $l(e,t){switch(t.type){case re.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case re.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case re.DragEnd:case re.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case re.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ot(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case re.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new Ot(e.droppable.containers);return i.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case re.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new Ot(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Hl(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=d.useContext(_t),s=fn(r),i=fn(n==null?void 0:n.id);return d.useEffect(()=>{if(!t&&!r&&s&&i!=null){if(!Rn(s)||document.activeElement===s.target)return;const l=o.get(i);if(!l)return;const{activatorNode:u,node:a}=l;if(!u.current&&!a.current)return;requestAnimationFrame(()=>{for(const c of[u.current,a.current]){if(!c)continue;const f=Na(c);if(f){f.focus();break}}})}},[r,t,o,i,s]),null}function zo(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function Vl(e){return d.useMemo(()=>({draggable:{...en.draggable,...e==null?void 0:e.draggable},droppable:{...en.droppable,...e==null?void 0:e.droppable},dragOverlay:{...en.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Wl(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=d.useRef(!1),{x:i,y:l}=typeof o=="boolean"?{x:o,y:o}:o;Pe(()=>{if(!i&&!l||!t){s.current=!1;return}if(s.current||!r)return;const a=t==null?void 0:t.node.current;if(!a||a.isConnected===!1)return;const c=n(a),f=So(c,r);if(i||(f.x=0),l||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const p=To(a);p&&p.scrollBy({top:f.y,left:f.x})}},[t,i,l,r,n])}const En=d.createContext({...Me,scaleX:1,scaleY:1});var qe;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(qe||(qe={}));const Xl=d.memo(function(t){var n,r,o,s;let{id:i,accessibility:l,autoScroll:u=!0,children:a,sensors:c=Fl,collisionDetection:f=Ro,measuring:p,modifiers:h,...w}=t;const v=d.useReducer($l,void 0,Bl),[m,x]=v,[R,b]=za(),[C,E]=d.useState(qe.Uninitialized),S=C===qe.Initialized,{draggable:{active:y,nodes:D,translate:k},droppable:{containers:N}}=m,O=y!=null?D.get(y):null,A=d.useRef({initial:null,translated:null}),M=d.useMemo(()=>{var X;return y!=null?{id:y,data:(X=O==null?void 0:O.data)!=null?X:_l,rect:A}:null},[y,O]),I=d.useRef(null),[T,F]=d.useState(null),[L,P]=d.useState(null),j=kt(w,Object.values(w)),B=Ft("DndDescribedBy",i),ee=d.useMemo(()=>N.getEnabled(),[N]),$=Vl(p),{droppableRects:q,measureDroppableContainers:H,measuringScheduled:V}=Tl(ee,{dragging:S,dependencies:[k.x,k.y],config:$.droppable}),_=Sl(D,y),le=d.useMemo(()=>L?gn(L):null,[L]),ae=Se(),Q=Ol(_,$.draggable.measure);Wl({activeNode:y!=null?D.get(y):null,config:ae.layoutShiftCompensation,initialRect:Q,measure:$.draggable.measure});const z=Lr(_,$.draggable.measure,Q),ce=Lr(_?_.parentElement:null),ye=d.useRef({activatorEvent:null,active:null,activeNode:_,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ze=N.getNodeFor((n=ye.current.over)==null?void 0:n.id),Re=Ll({measure:$.dragOverlay.measure}),ke=(r=Re.nodeRef.current)!=null?r:_,we=S?(o=Re.rect)!=null?o:z:null,Ye=!!(Re.nodeRef.current&&Re.rect),vt=Pl(Ye?null:z),at=jo(ke?fe(ke):null),de=Ml(S?ze??_:null),Be=jl(de),et=zo(h,{transform:{x:k.x-vt.x,y:k.y-vt.y,scaleX:1,scaleY:1},activatorEvent:L,active:M,activeNodeRect:z,containerNodeRect:ce,draggingNodeRect:we,over:ye.current.over,overlayNodeRect:Re.rect,scrollableAncestors:de,scrollableAncestorRects:Be,windowRect:at}),xt=le?ft(le,k):null,Ne=kl(de),Bt=_r(Ne),$t=_r(Ne,[z]),$e=ft(et,Bt),Ie=we?nl(we,et):null,Ue=M&&Ie?f({active:M,collisionRect:Ie,droppableRects:q,droppableContainers:ee,pointerCoordinates:xt}):null,tt=Ga(Ue,"id"),[pe,bt]=d.useState(null),Ht=Ye?et:ft(et,$t),Vt=el(Ht,(s=pe==null?void 0:pe.rect)!=null?s:null,z),lt=d.useRef(null),yt=d.useCallback((X,G)=>{let{sensor:K,options:ue}=G;if(I.current==null)return;const ne=D.get(I.current);if(!ne)return;const Z=X.nativeEvent,ge=new K({active:I.current,activeNode:ne,event:Z,options:ue,context:ye,onAbort(te){if(!D.get(te))return;const{onDragAbort:he}=j.current,Ee={id:te};he==null||he(Ee),R({type:"onDragAbort",event:Ee})},onPending(te,Le,he,Ee){if(!D.get(te))return;const{onDragPending:rt}=j.current,me={id:te,constraint:Le,initialCoordinates:he,offset:Ee};rt==null||rt(me),R({type:"onDragPending",event:me})},onStart(te){const Le=I.current;if(Le==null)return;const he=D.get(Le);if(!he)return;const{onDragStart:Ee}=j.current,nt={activatorEvent:Z,active:{id:Le,data:he.data,rect:A}};Fe.unstable_batchedUpdates(()=>{Ee==null||Ee(nt),E(qe.Initializing),x({type:re.DragStart,initialCoordinates:te,active:Le}),R({type:"onDragStart",event:nt}),F(lt.current),P(Z)})},onMove(te){x({type:re.DragMove,coordinates:te})},onEnd:je(re.DragEnd),onCancel:je(re.DragCancel)});lt.current=ge;function je(te){return async function(){const{active:he,collisions:Ee,over:nt,scrollAdjustedTranslate:rt}=ye.current;let me=null;if(he&&rt){const{cancelDrop:ot}=j.current;me={activatorEvent:Z,active:he,collisions:Ee,delta:rt,over:nt},te===re.DragEnd&&typeof ot=="function"&&await Promise.resolve(ot(me))&&(te=re.DragCancel)}I.current=null,Fe.unstable_batchedUpdates(()=>{x({type:te}),E(qe.Uninitialized),bt(null),F(null),P(null),lt.current=null;const ot=te===re.DragEnd?"onDragEnd":"onDragCancel";if(me){const Ct=j.current[ot];Ct==null||Ct(me),R({type:ot,event:me})}})}}},[D]),Wt=d.useCallback((X,G)=>(K,ue)=>{const ne=K.nativeEvent,Z=D.get(ue);if(I.current!==null||!Z||ne.dndKit||ne.defaultPrevented)return;const ge={active:Z};X(K,G.options,ge)===!0&&(ne.dndKit={capturedBy:G.sensor},I.current=ue,yt(K,G))},[D,yt]),wt=El(c,Wt);Nl(c),Pe(()=>{z&&C===qe.Initializing&&E(qe.Initialized)},[z,C]),d.useEffect(()=>{const{onDragMove:X}=j.current,{active:G,activatorEvent:K,collisions:ue,over:ne}=ye.current;if(!G||!K)return;const Z={active:G,activatorEvent:K,collisions:ue,delta:{x:$e.x,y:$e.y},over:ne};Fe.unstable_batchedUpdates(()=>{X==null||X(Z),R({type:"onDragMove",event:Z})})},[$e.x,$e.y]),d.useEffect(()=>{const{active:X,activatorEvent:G,collisions:K,droppableContainers:ue,scrollAdjustedTranslate:ne}=ye.current;if(!X||I.current==null||!G||!ne)return;const{onDragOver:Z}=j.current,ge=ue.get(tt),je=ge&&ge.rect.current?{id:ge.id,rect:ge.rect.current,data:ge.data,disabled:ge.disabled}:null,te={active:X,activatorEvent:G,collisions:K,delta:{x:ne.x,y:ne.y},over:je};Fe.unstable_batchedUpdates(()=>{bt(je),Z==null||Z(te),R({type:"onDragOver",event:te})})},[tt]),Pe(()=>{ye.current={activatorEvent:L,active:M,activeNode:_,collisionRect:Ie,collisions:Ue,droppableRects:q,draggableNodes:D,draggingNode:ke,draggingNodeRect:we,droppableContainers:N,over:pe,scrollableAncestors:de,scrollAdjustedTranslate:$e},A.current={initial:we,translated:Ie}},[M,_,Ue,Ie,D,ke,we,q,N,pe,de,$e]),wl({...ae,delta:k,draggingRect:Ie,pointerCoordinates:xt,scrollableAncestors:de,scrollableAncestorRects:Be});const Y=d.useMemo(()=>({active:M,activeNode:_,activeNodeRect:z,activatorEvent:L,collisions:Ue,containerNodeRect:ce,dragOverlay:Re,draggableNodes:D,droppableContainers:N,droppableRects:q,over:pe,measureDroppableContainers:H,scrollableAncestors:de,scrollableAncestorRects:Be,measuringConfiguration:$,measuringScheduled:V,windowRect:at}),[M,_,z,L,Ue,ce,Re,D,N,q,pe,H,de,Be,$,V,at]),se=d.useMemo(()=>({activatorEvent:L,activators:wt,active:M,activeNodeRect:z,ariaDescribedById:{draggable:B},dispatch:x,draggableNodes:D,over:pe,measureDroppableContainers:H}),[L,wt,M,z,x,B,D,pe,H]);return J.createElement(Co.Provider,{value:b},J.createElement(_t.Provider,{value:se},J.createElement(_o.Provider,{value:Y},J.createElement(En.Provider,{value:Vt},a)),J.createElement(Hl,{disabled:(l==null?void 0:l.restoreFocus)===!1})),J.createElement(Ha,{...l,hiddenTextDescribedById:B}));function Se(){const X=(T==null?void 0:T.autoScrollEnabled)===!1,G=typeof u=="object"?u.enabled===!1:u===!1,K=S&&!X&&!G;return typeof u=="object"?{...u,enabled:K}:{enabled:K}}}),Yl=d.createContext(null),Br="button",Ul="Draggable";function ql(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=Ft(Ul),{activators:i,activatorEvent:l,active:u,activeNodeRect:a,ariaDescribedById:c,draggableNodes:f,over:p}=d.useContext(_t),{role:h=Br,roleDescription:w="draggable",tabIndex:v=0}=o??{},m=(u==null?void 0:u.id)===t,x=d.useContext(m?En:Yl),[R,b]=dn(),[C,E]=dn(),S=Il(i,t),y=kt(n);Pe(()=>(f.set(t,{id:t,key:s,node:R,activatorNode:C,data:y}),()=>{const k=f.get(t);k&&k.key===s&&f.delete(t)}),[f,t]);const D=d.useMemo(()=>({role:h,tabIndex:v,"aria-disabled":r,"aria-pressed":m&&h===Br?!0:void 0,"aria-roledescription":w,"aria-describedby":c.draggable}),[r,h,v,m,w,c.draggable]);return{active:u,activatorEvent:l,activeNodeRect:a,attributes:D,isDragging:m,listeners:r?void 0:S,node:R,over:p,setNodeRef:b,setActivatorNodeRef:E,transform:x}}function Bo(){return d.useContext(_o)}const Kl="Droppable",Gl={timeout:25};function $o(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=Ft(Kl),{active:i,dispatch:l,over:u,measureDroppableContainers:a}=d.useContext(_t),c=d.useRef({disabled:n}),f=d.useRef(!1),p=d.useRef(null),h=d.useRef(null),{disabled:w,updateMeasurementsFor:v,timeout:m}={...Gl,...o},x=kt(v??r),R=d.useCallback(()=>{if(!f.current){f.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{a(Array.isArray(x.current)?x.current:[x.current]),h.current=null},m)},[m]),b=Sn({callback:R,disabled:w||!i}),C=d.useCallback((D,k)=>{b&&(k&&(b.unobserve(k),f.current=!1),D&&b.observe(D))},[b]),[E,S]=dn(C),y=kt(t);return d.useEffect(()=>{!b||!E.current||(b.disconnect(),f.current=!1,b.observe(E.current))},[E,b]),d.useEffect(()=>(l({type:re.RegisterDroppable,element:{id:r,key:s,disabled:n,node:E,rect:p,data:y}}),()=>l({type:re.UnregisterDroppable,key:s,id:r})),[r]),d.useEffect(()=>{n!==c.current.disabled&&(l({type:re.SetDroppableDisabled,id:r,key:s,disabled:n}),c.current.disabled=n)},[r,s,n,l]),{active:i,rect:p,isOver:(u==null?void 0:u.id)===r,node:E,over:u,setNodeRef:S}}function Jl(e){let{animation:t,children:n}=e;const[r,o]=d.useState(null),[s,i]=d.useState(null),l=fn(n);return!n&&!r&&l&&o(l),Pe(()=>{if(!s)return;const u=r==null?void 0:r.key,a=r==null?void 0:r.props.id;if(u==null||a==null){o(null);return}Promise.resolve(t(a,s)).then(()=>{o(null)})},[t,r,s]),J.createElement(J.Fragment,null,n,r?d.cloneElement(r,{ref:i}):null)}const Ql={x:0,y:0,scaleX:1,scaleY:1};function Zl(e){let{children:t}=e;return J.createElement(_t.Provider,{value:Fo},J.createElement(En.Provider,{value:Ql},t))}const ec={position:"fixed",touchAction:"none"},tc=e=>Rn(e)?"transform 250ms ease":void 0,nc=d.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:i,rect:l,style:u,transform:a,transition:c=tc}=e;if(!l)return null;const f=o?a:{...a,scaleX:1,scaleY:1},p={...ec,width:l.width,height:l.height,top:l.top,left:l.left,transform:Je.Transform.toString(f),transformOrigin:o&&r?Ya(r,l):void 0,transition:typeof c=="function"?c(r):c,...u};return J.createElement(n,{className:i,style:p,ref:t},s)}),rc=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:s,className:i}=e;if(s!=null&&s.active)for(const[l,u]of Object.entries(s.active))u!==void 0&&(o[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,u));if(s!=null&&s.dragOverlay)for(const[l,u]of Object.entries(s.dragOverlay))u!==void 0&&r.node.style.setProperty(l,u);return i!=null&&i.active&&n.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[u,a]of Object.entries(o))n.node.style.setProperty(u,a);i!=null&&i.active&&n.node.classList.remove(i.active)}},oc=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Je.Transform.toString(t)},{transform:Je.Transform.toString(n)}]},sc={duration:250,easing:"ease",keyframes:oc,sideEffects:rc({styles:{active:{opacity:"0"}}})};function ic(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Cn((s,i)=>{if(t===null)return;const l=n.get(s);if(!l)return;const u=l.node.current;if(!u)return;const a=Lo(i);if(!a)return;const{transform:c}=fe(i).getComputedStyle(i),f=Eo(c);if(!f)return;const p=typeof t=="function"?t:ac(t);return ko(u,o.draggable.measure),p({active:{id:s,data:l.data,node:u,rect:o.draggable.measure(u)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(a)},droppableContainers:r,measuringConfiguration:o,transform:f})})}function ac(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...sc,...e};return s=>{let{active:i,dragOverlay:l,transform:u,...a}=s;if(!t)return;const c={x:l.rect.left-i.rect.left,y:l.rect.top-i.rect.top},f={scaleX:u.scaleX!==1?i.rect.width*u.scaleX/l.rect.width:1,scaleY:u.scaleY!==1?i.rect.height*u.scaleY/l.rect.height:1},p={x:u.x-c.x,y:u.y-c.y,...f},h=o({...a,active:i,dragOverlay:l,transform:{initial:u,final:p}}),[w]=h,v=h[h.length-1];if(JSON.stringify(w)===JSON.stringify(v))return;const m=r==null?void 0:r({active:i,dragOverlay:l,...a}),x=l.node.animate(h,{duration:t,easing:n,fill:"forwards"});return new Promise(R=>{x.onfinish=()=>{m==null||m(),R()}})}}let $r=0;function lc(e){return d.useMemo(()=>{if(e!=null)return $r++,$r},[e])}const cc=J.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:i,wrapperElement:l="div",className:u,zIndex:a=999}=e;const{activatorEvent:c,active:f,activeNodeRect:p,containerNodeRect:h,draggableNodes:w,droppableContainers:v,dragOverlay:m,over:x,measuringConfiguration:R,scrollableAncestors:b,scrollableAncestorRects:C,windowRect:E}=Bo(),S=d.useContext(En),y=lc(f==null?void 0:f.id),D=zo(i,{activatorEvent:c,active:f,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:x,overlayNodeRect:m.rect,scrollableAncestors:b,scrollableAncestorRects:C,transform:S,windowRect:E}),k=ar(p),N=ic({config:r,draggableNodes:w,droppableContainers:v,measuringConfiguration:R}),O=k?m.setRef:void 0;return J.createElement(Zl,null,J.createElement(Jl,{animation:N},f&&y?J.createElement(nc,{key:y,id:f.id,ref:O,as:l,activatorEvent:c,adjustScale:t,className:u,transition:s,rect:k,style:{zIndex:a,...o},transform:D},n):null))});function Ho(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function uc(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function Kt(e){return e!==null&&e>=0}function dc(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function fc(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Vo=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=Ho(t,r,n),i=t[o],l=s[o];return!l||!i?null:{x:l.left-i.left,y:l.top-i.top,scaleX:l.width/i.width,scaleY:l.height/i.height}},Gt={scaleX:1,scaleY:1},pc=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:i}=e;const l=(t=s[n])!=null?t:r;if(!l)return null;if(o===n){const a=s[i];return a?{x:0,y:n<i?a.top+a.height-(l.top+l.height):a.top-l.top,...Gt}:null}const u=gc(s,o,n);return o>n&&o<=i?{x:0,y:-l.height-u,...Gt}:o<n&&o>=i?{x:0,y:l.height+u,...Gt}:{x:0,y:0,...Gt}};function gc(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return r?n<t?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const Wo="Sortable",Xo=J.createContext({activeIndex:-1,containerId:Wo,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Vo,disabled:{draggable:!1,droppable:!1}});function hc(e){let{children:t,id:n,items:r,strategy:o=Vo,disabled:s=!1}=e;const{active:i,dragOverlay:l,droppableRects:u,over:a,measureDroppableContainers:c}=Bo(),f=Ft(Wo,n),p=l.rect!==null,h=d.useMemo(()=>r.map(S=>typeof S=="object"&&"id"in S?S.id:S),[r]),w=i!=null,v=i?h.indexOf(i.id):-1,m=a?h.indexOf(a.id):-1,x=d.useRef(h),R=!dc(h,x.current),b=m!==-1&&v===-1||R,C=fc(s);Pe(()=>{R&&w&&c(h)},[R,h,w,c]),d.useEffect(()=>{x.current=h},[h]);const E=d.useMemo(()=>({activeIndex:v,containerId:f,disabled:C,disableTransforms:b,items:h,overIndex:m,useDragOverlay:p,sortedRects:uc(h,u),strategy:o}),[v,f,C.draggable,C.droppable,b,h,m,u,p,o]);return J.createElement(Xo.Provider,{value:E},t)}const mc=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Ho(n,r,o).indexOf(t)},vc=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:i,previousItems:l,previousContainerId:u,transition:a}=e;return!a||!r||l!==s&&o===i?!1:n?!0:i!==o&&t===u},xc={duration:200,easing:"ease"},Yo="transform",bc=Je.Transition.toString({property:Yo,duration:0,easing:"linear"}),yc={roleDescription:"sortable"};function wc(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,i]=d.useState(null),l=d.useRef(n);return Pe(()=>{if(!t&&n!==l.current&&r.current){const u=o.current;if(u){const a=mt(r.current,{ignoreTransform:!0}),c={x:u.left-a.left,y:u.top-a.top,scaleX:u.width/a.width,scaleY:u.height/a.height};(c.x||c.y)&&i(c)}}n!==l.current&&(l.current=n)},[t,n,r,o]),d.useEffect(()=>{s&&i(null)},[s]),s}function Cc(e){let{animateLayoutChanges:t=vc,attributes:n,disabled:r,data:o,getNewIndex:s=mc,id:i,strategy:l,resizeObserverConfig:u,transition:a=xc}=e;const{items:c,containerId:f,activeIndex:p,disabled:h,disableTransforms:w,sortedRects:v,overIndex:m,useDragOverlay:x,strategy:R}=d.useContext(Xo),b=Rc(r,h),C=c.indexOf(i),E=d.useMemo(()=>({sortable:{containerId:f,index:C,items:c},...o}),[f,o,C,c]),S=d.useMemo(()=>c.slice(c.indexOf(i)),[c,i]),{rect:y,node:D,isOver:k,setNodeRef:N}=$o({id:i,data:E,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...u}}),{active:O,activatorEvent:A,activeNodeRect:M,attributes:I,setNodeRef:T,listeners:F,isDragging:L,over:P,setActivatorNodeRef:j,transform:B}=ql({id:i,data:E,attributes:{...yc,...n},disabled:b.draggable}),ee=Aa(N,T),$=!!O,q=$&&!w&&Kt(p)&&Kt(m),H=!x&&L,V=H&&q?B:null,le=q?V??(l??R)({rects:v,activeNodeRect:M,activeIndex:p,overIndex:m,index:C}):null,ae=Kt(p)&&Kt(m)?s({id:i,items:c,activeIndex:p,overIndex:m}):C,Q=O==null?void 0:O.id,z=d.useRef({activeId:Q,items:c,newIndex:ae,containerId:f}),ce=c!==z.current.items,ye=t({active:O,containerId:f,isDragging:L,isSorting:$,id:i,index:C,items:c,newIndex:z.current.newIndex,previousItems:z.current.items,previousContainerId:z.current.containerId,transition:a,wasDragging:z.current.activeId!=null}),ze=wc({disabled:!ye,index:C,node:D,rect:y});return d.useEffect(()=>{$&&z.current.newIndex!==ae&&(z.current.newIndex=ae),f!==z.current.containerId&&(z.current.containerId=f),c!==z.current.items&&(z.current.items=c)},[$,ae,f,c]),d.useEffect(()=>{if(Q===z.current.activeId)return;if(Q!=null&&z.current.activeId==null){z.current.activeId=Q;return}const ke=setTimeout(()=>{z.current.activeId=Q},50);return()=>clearTimeout(ke)},[Q]),{active:O,activeIndex:p,attributes:I,data:E,rect:y,index:C,newIndex:ae,items:c,isOver:k,isSorting:$,isDragging:L,listeners:F,node:D,overIndex:m,over:P,setNodeRef:ee,setActivatorNodeRef:j,setDroppableNodeRef:N,setDraggableNodeRef:T,transform:ze??le,transition:Re()};function Re(){if(ze||ce&&z.current.newIndex===C)return bc;if(!(H&&!Rn(A)||!a)&&($||ye))return Je.Transition.toString({...a,property:Yo})}}function Rc(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}W.Down,W.Right,W.Up,W.Left;function Sc({status:e,className:t}){var o;const n=((o=Mt.find(s=>s.value===e))==null?void 0:o.label)||e,r=sn[e]||"var(--text-tertiary)";return g.jsxs("span",{className:It("inline-flex items-center gap-1.5 rounded px-1.5 py-0.5 text-xs font-medium",t),style:{color:r},children:[g.jsx("span",{className:"size-1.5 rounded-full",style:{backgroundColor:r}}),n]})}function Uo({task:e,onClick:t,projectPrefix:n}){var w,v,m;const{attributes:r,listeners:o,setNodeRef:s,transform:i,transition:l,isDragging:u}=Cc({id:e.id,data:{task:e}}),a={transform:Je.Transform.toString(i),transition:l},c=e.assignees||[],f=e.labels||[],p=e.side==="ai",h=p&&((w=e.status)==null?void 0:w.startsWith("ai_"))&&e.status!=="ai_done";return g.jsxs("div",{ref:s,...r,...o,onClick:t,className:It("group cursor-pointer rounded-lg border p-3 transition-colors duration-150",u?"pointer-events-none":"shadow-sm hover:shadow-md hover:border-[var(--border-hover)]"),style:{...a,backgroundColor:u?"var(--bg-surface)":h?"var(--ai-surface)":"var(--bg-surface)",borderColor:u?"var(--border-default)":h?"var(--ai-border)":"var(--border-default)",borderStyle:u?"dashed":"solid",opacity:u?.35:1,filter:u?"blur(1px)":void 0},role:"button",tabIndex:0,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),t())},children:[g.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[g.jsx("div",{className:"flex items-center gap-1.5",children:n&&g.jsxs("span",{className:"font-mono text-[10px] font-medium",style:{color:"var(--text-tertiary)"},children:[n,"-",e.task_number]})}),g.jsxs("div",{className:"flex items-center gap-1.5",children:[h&&g.jsxs("span",{className:"flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide",style:{backgroundColor:"rgba(139, 123, 245, 0.15)",color:"var(--ai-indicator)"},children:[g.jsxs("span",{className:"relative flex size-1.5",children:[g.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full opacity-60",style:{backgroundColor:"var(--ai-indicator)"}}),g.jsx("span",{className:"relative inline-flex size-1.5 rounded-full",style:{backgroundColor:"var(--ai-indicator)"}})]}),"AI"]}),p&&e.status==="ai_done"&&g.jsxs("span",{className:"flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[9px] font-semibold",style:{backgroundColor:"rgba(70, 167, 88, 0.12)",color:"var(--status-done)"},children:[g.jsx(us,{className:"size-2.5"}),"Done"]}),g.jsx(qn,{priority:e.priority||"none"})]})]}),g.jsx("p",{className:"text-[13px] font-medium leading-snug",style:{color:"var(--text-primary)"},children:e.title}),f.length>0&&g.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:f.map(x=>g.jsx(ci,{name:x.name,color:x.color},x.id||x.label_id))}),e.task_branches&&e.task_branches.length>0&&g.jsx("div",{className:"mt-2 flex flex-col gap-1",children:e.task_branches.map(x=>{var S,y,D,k;const R=x.commit_count>0,b=(S=x.project_repos)==null?void 0:S.repo_owner,C=(y=x.project_repos)==null?void 0:y.repo_name,E=b&&C?`https://github.com/${b}/${C}/tree/${encodeURIComponent(x.branch_name)}`:null;return g.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[R&&E?g.jsxs("a",{href:E,target:"_blank",rel:"noopener noreferrer",onClick:N=>N.stopPropagation(),className:"flex items-center gap-1 rounded px-1.5 py-0.5 font-mono text-[10px] hover:underline",style:{backgroundColor:"var(--bg-elevated)",color:"var(--accent-brand)"},children:[g.jsx(hr,{className:"size-2.5"}),((D=x.project_repos)==null?void 0:D.label)&&g.jsxs("span",{className:"font-sans text-[9px] font-medium",style:{color:"var(--text-secondary)"},children:[x.project_repos.label,":"]}),x.branch_name.length>25?x.branch_name.substring(0,23)+"...":x.branch_name]}):g.jsxs("span",{className:"flex items-center gap-1 rounded px-1.5 py-0.5 font-mono text-[10px]",style:{backgroundColor:"var(--bg-elevated)",color:"var(--text-tertiary)",opacity:.6},children:[g.jsx(hr,{className:"size-2.5"}),((k=x.project_repos)==null?void 0:k.label)&&g.jsxs("span",{className:"font-sans text-[9px] font-medium",style:{color:"var(--text-quaternary)"},children:[x.project_repos.label,":"]}),x.branch_name.length>25?x.branch_name.substring(0,23)+"...":x.branch_name]}),R&&g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:[x.commit_count,"c"]}),(x.additions>0||x.deletions>0)&&g.jsxs("span",{className:"text-[10px]",children:[g.jsxs("span",{style:{color:"var(--status-done)"},children:["+",x.additions]}),g.jsx("span",{style:{color:"var(--text-quaternary)"},children:"/"}),g.jsxs("span",{style:{color:"var(--priority-urgent)"},children:["-",x.deletions]})]}),x.first_commit_at&&g.jsx("span",{className:"text-[10px]",style:{color:"var(--text-quaternary)"},children:(()=>{const N=Date.now()-new Date(x.first_commit_at).getTime(),O=Math.floor(N/6e4);return O<60?`${O}m`:`${Math.floor(O/60)}h ${O%60}m`})()}),x.force_push_detected&&g.jsx(mr,{className:"size-3",style:{color:"var(--priority-high)"}})]})]},x.id)})}),((v=e.task_branches)==null?void 0:v.some(x=>x.pr_number))&&(()=>{const x=e.task_branches||[],R=x.filter(O=>O.pr_number),b=x.flatMap(O=>O.ci_checks||[]),C=b.length>0&&b.every(O=>O.conclusion==="success"||O.conclusion==="neutral"||O.conclusion==="skipped"),E=b.some(O=>O.conclusion==="failure"||O.conclusion==="timed_out"),S=b.some(O=>!O.conclusion||O.status==="in_progress"),y=x.reduce((O,A)=>({...O,...A.review_statuses||{}}),{}),D=Object.values(y).some(O=>O.state==="APPROVED"&&!O.stale),k=Object.values(y).some(O=>O.state==="CHANGES_REQUESTED"),N=x.some(O=>{var A,M;return((A=O.merge_readiness)==null?void 0:A.ci_passed)&&((M=O.merge_readiness)==null?void 0:M.approved)});return g.jsxs("div",{className:"mt-1.5 flex items-center gap-2 flex-wrap",children:[R.map(O=>g.jsxs("a",{href:O.pr_url,target:"_blank",rel:"noopener noreferrer",onClick:A=>A.stopPropagation(),className:"flex items-center gap-1 text-[10px] hover:underline",style:{color:O.pr_is_draft?"var(--text-tertiary)":"var(--accent-brand)"},children:[g.jsx(Zs,{className:"size-3"}),"#",O.pr_number,O.pr_is_draft&&g.jsx("span",{className:"text-[9px]",style:{color:"var(--text-quaternary)"},children:"draft"})]},O.id)),b.length>0&&(C?g.jsx(ui,{className:"size-3",style:{color:"var(--status-done)"}}):E?g.jsx(di,{className:"size-3",style:{color:"var(--priority-urgent)"}}):S?g.jsx(ei,{className:"size-3 animate-spin",style:{color:"var(--text-tertiary)"}}):null),D&&g.jsx("span",{className:"text-[9px] font-medium",style:{color:"var(--status-done)"},children:"Approved"}),k&&g.jsx("span",{className:"text-[9px] font-medium",style:{color:"var(--priority-high)"},children:"Changes Requested"}),N&&g.jsx("span",{className:"rounded-full px-1.5 py-0.5 text-[9px] font-semibold",style:{backgroundColor:"rgba(70, 167, 88, 0.12)",color:"var(--status-done)"},children:"Ready to Merge"}),x.some(O=>O.deploy_status&&O.deploy_status!=="none")&&(()=>{const O=x.find(M=>M.deploy_status&&M.deploy_status!=="none");if(!O)return null;const A=O.deploy_status;return g.jsxs("span",{className:"flex items-center gap-1 text-[10px]",style:{color:A==="success"?"var(--status-done)":A==="failure"||A==="error"?"var(--priority-urgent)":"var(--text-tertiary)"},children:[g.jsx(ti,{className:"size-3"}),O.deploy_environment||"deploy",": ",A,O.deploy_url&&g.jsx("a",{href:O.deploy_url,target:"_blank",rel:"noopener noreferrer",onClick:M=>M.stopPropagation(),className:"hover:underline",style:{color:"var(--accent-brand)"},children:"preview"})]})})()]})})(),e.conflict_warning&&g.jsxs("div",{className:"mt-1.5 flex items-center gap-1 text-[10px]",style:{color:"var(--priority-high)"},children:[g.jsx(mr,{className:"size-3"}),"Base updated — ",e.conflict_warning.behind_by," behind"]}),g.jsxs("div",{className:"mt-2.5 flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2.5",children:[e.column_entered_at&&g.jsx("span",{className:"text-[10px]",style:{color:"var(--text-quaternary)"},children:(()=>{const x=Date.now()-new Date(e.column_entered_at).getTime(),R=Math.floor(x/6e4);return R<60?`${R}m`:`${Math.floor(R/60)}h${R%60>0?` ${R%60}m`:""}`})()}),e.due_date&&g.jsxs("span",{className:"flex items-center gap-1 text-[10px]",style:{color:new Date(e.due_date)<new Date?"var(--priority-urgent)":"var(--text-tertiary)"},children:[g.jsx(oo,{className:"size-2.5"}),new Date(e.due_date).toLocaleDateString("en-IN",{day:"numeric",month:"short"})]}),e.story_points!=null&&e.story_points>0&&g.jsx("span",{className:"flex items-center justify-center rounded px-1 py-0.5 font-mono text-[10px] font-medium",style:{backgroundColor:"var(--bg-active)",color:"var(--text-tertiary)"},children:e.story_points}),p&&((m=e.status)==null?void 0:m.startsWith("ai_"))&&e.status!=="ai_done"&&g.jsx(Sc,{status:e.status}),e.ai_plan_status==="pending"&&g.jsx("span",{className:"rounded-full px-1.5 py-0.5 text-[9px] font-semibold",style:{backgroundColor:"rgba(139, 123, 245, 0.12)",color:"var(--ai-indicator)"},children:"Plan Review"})]}),c.length>0&&g.jsxs("div",{className:"flex -space-x-1.5",children:[c.slice(0,3).map(x=>g.jsx(Zr,{name:x.full_name||x.email,avatarUrl:x.avatar_url,size:"xs"},x.user_id||x.id)),c.length>3&&g.jsxs("span",{className:"flex size-5 items-center justify-center rounded-full text-[9px] font-medium ring-1 ring-[var(--bg-surface)]",style:{backgroundColor:"var(--bg-active)",color:"var(--text-tertiary)"},children:["+",c.length-3]})]})]})]})}function Ec({id:e,label:t,color:n,tasks:r,projectPrefix:o,onTaskClick:s,onAddTask:i,isAI:l}){const{setNodeRef:u,isOver:a}=$o({id:e});return g.jsxs("div",{ref:u,className:"flex w-[280px] shrink-0 flex-col rounded-xl transition-all duration-150",style:{backgroundColor:l?"var(--ai-surface)":"var(--bg-elevated)",border:a?"1px solid var(--accent-brand)":l?"1px solid var(--ai-border)":"1px solid var(--border-subtle)",boxShadow:a?"0 0 0 1px var(--accent-brand), 0 0 20px rgba(61, 214, 181, 0.1)":void 0},children:[g.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5",style:{borderBottom:`1px solid ${l?"var(--ai-border)":"var(--border-subtle)"}`},children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"size-2.5 rounded-full",style:{backgroundColor:n}}),g.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--text-secondary)"},children:t}),g.jsx("span",{className:"flex size-4.5 items-center justify-center rounded-full text-[10px] font-medium tabular-nums",style:{backgroundColor:r.length>0?"var(--bg-active)":"transparent",color:"var(--text-tertiary)"},children:r.length})]}),g.jsx(ct,{variant:"ghost",size:"icon-xs",onClick:()=>i(e),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:g.jsx(ds,{className:"size-3.5",style:{color:"var(--text-tertiary)"}})})]}),g.jsxs("div",{className:"flex flex-1 flex-col gap-1.5 overflow-y-auto p-1.5",style:{borderRadius:"0 0 12px 12px",minHeight:80},children:[g.jsx(hc,{items:r.map(c=>c.id),strategy:pc,children:r.map(c=>g.jsx(Uo,{task:c,projectPrefix:o,onClick:()=>s(c.id)},c.id))}),r.length===0&&!a&&g.jsx("div",{className:"flex flex-1 items-center justify-center rounded-lg border border-dashed py-8",style:{borderColor:l?"var(--ai-border)":"var(--border-subtle)",color:"var(--text-ghost)"},children:g.jsx("span",{className:"text-xs",children:"No tasks"})})]})]})}function Tc({tasks:e,projectId:t,projectPrefix:n,deployEnabled:r=!1,onTaskClick:o,onAddTask:s,mutateTasks:i}){const[l,u]=d.useState(null),[a,c]=d.useState(null),f=d.useRef(!1);d.useEffect(()=>{!l&&!f.current&&c(null)},[e,l]);const p=a??e,h=d.useCallback(b=>{const C=Za(b);return C.length>0?C:Ro(b)},[]),w=Wa(Va(ir,{activationConstraint:{distance:5}})),v=d.useMemo(()=>{const C=(r?Mt:Mt.filter(S=>!ni.includes(S.value))).map(S=>({id:S.value,label:S.label,color:sn[S.value]||"var(--text-tertiary)",isAI:!1,tasks:p.filter(y=>y.status===S.value).sort((y,D)=>y.position-D.position)})),E=ri.map(S=>({id:S.value,label:S.label,color:sn[S.value]||"var(--ai-indicator)",isAI:!0,tasks:p.filter(y=>y.status===S.value).sort((y,D)=>y.position-D.position)}));return[...C,...E]},[p]),m=d.useCallback(b=>{const C=e.find(E=>E.id===b.active.id);u(C||null),c([...e])},[e]),x=d.useCallback(b=>{const{active:C,over:E}=b;if(!E)return;const S=C.id,y=E.id;c(D=>{if(!D)return D;const k=D.find(M=>M.id===S);if(!k)return D;const N=oi.some(M=>M.value===y),O=D.find(M=>M.id===y);let A=k.status;return N?A=y:O&&(A=O.status),A===k.status?D:D.map(M=>M.id===S?{...M,status:A}:M)})},[]),R=d.useCallback(async b=>{var I;const{active:C,over:E}=b;if(u(null),!E||!a){c(null);return}const S=C.id,y=E.id,D=a.find(T=>T.id===S);if(!D){c(null);return}const k=D.status,N=a.filter(T=>T.status===k&&T.id!==S).sort((T,F)=>T.position-F.position),O=a.find(T=>T.id===y&&T.id!==S);let A;if(O&&O.status===k){const T=N.findIndex(F=>F.id===y);T<=0?A=(((I=N[0])==null?void 0:I.position)??1e3)/2:T>=N.length-1?A=N[N.length-1].position+1e3:A=(N[T-1].position+N[T].position)/2}else A=N.length>0?N[N.length-1].position+1e3:1e3;const M=a.map(T=>T.id===S?{...T,status:k,position:A}:T);c(M),f.current=!0;try{await ut.request("updateTaskPosition",{projectId:t,taskId:S,status:k,position:A})}catch{}await i(),f.current=!1,c(null)},[a,t,i]);return g.jsxs(Xl,{sensors:w,collisionDetection:h,onDragStart:m,onDragOver:x,onDragEnd:R,children:[g.jsx("div",{className:"flex flex-1 gap-3 overflow-x-auto p-4",children:v.map((b,C)=>{const E=b.isAI&&C>0&&!v[C-1].isAI;return g.jsxs("div",{className:"flex",children:[E&&g.jsxs("div",{className:"mr-3 flex flex-col items-center gap-2 py-2",children:[g.jsx("div",{className:"flex-1 w-px",style:{backgroundColor:"var(--ai-border)"}}),g.jsx("span",{className:"flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[9px] font-bold uppercase tracking-widest whitespace-nowrap",style:{backgroundColor:"rgba(139, 123, 245, 0.1)",color:"var(--ai-indicator)",border:"1px solid var(--ai-border)"},children:"✦ AI Side"}),g.jsx("div",{className:"flex-1 w-px",style:{backgroundColor:"var(--ai-border)"}})]}),g.jsx(Ec,{id:b.id,label:b.label,color:b.color,tasks:b.tasks,projectPrefix:n,onTaskClick:o,onAddTask:s,isAI:b.isAI})]},b.id)})}),g.jsx(cc,{dropAnimation:null,children:l&&g.jsx("div",{className:"rounded-lg p-3",style:{backgroundColor:"var(--bg-elevated)",border:"1px solid var(--accent-brand)",boxShadow:"0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px var(--accent-brand)",width:280,opacity:.95},children:g.jsx(Uo,{task:l,projectPrefix:n,onClick:()=>{}})})})]})}const qo=d.createContext(void 0);function zt(e){const t=d.useContext(qo);if(t===void 0&&!e)throw new Error(bn(47));return t}function Oc(){return{...ms(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const Dc={...ps,disabled:Ae(e=>e.disabled),instantType:Ae(e=>e.instantType),openMethod:Ae(e=>e.openMethod),openChangeReason:Ae(e=>e.openChangeReason),modal:Ae(e=>e.modal),stickIfOpen:Ae(e=>e.stickIfOpen),titleElementId:Ae(e=>e.titleElementId),descriptionElementId:Ae(e=>e.descriptionElementId),openOnHover:Ae(e=>e.openOnHover),closeDelay:Ae(e=>e.closeDelay),hasViewport:Ae(e=>e.hasViewport)};class lr extends fs{constructor(n){const r={...Oc(),...n};r.open&&(n==null?void 0:n.mounted)===void 0&&(r.mounted=!0);super(r,{popupRef:d.createRef(),backdropRef:d.createRef(),internalBackdropRef:d.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:d.createRef(),beforeContentFocusGuardRef:d.createRef(),stickIfOpenTimeout:new on,triggerElements:new Kr},Dc);Rt(this,"setOpen",(n,r)=>{var c,f;const o=r.reason===Oe,s=r.reason===nn&&r.event.detail===0,i=!n&&(r.reason===gs||r.reason==null);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(f=(c=this.context).onOpenChange)==null||f.call(c,n,r),r.isCanceled)return;const l={open:n,nativeEvent:r.event,reason:r.reason,nested:this.state.nested,triggerElement:r.trigger},u=this.state.floatingRootContext.context.events;u==null||u.emit("openchange",l);const a=()=>{var w;const p={open:n,openChangeReason:r.reason},h=((w=r.trigger)==null?void 0:w.id)??null;(h||n)&&(p.activeTriggerId=h,p.activeTriggerElement=r.trigger??null),this.update(p)};o?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(hs,()=>{this.set("stickIfOpen",!1)}),Fe.flushSync(a)):a(),s||i?this.set("instantType",s?"click":"dismiss"):r.reason===jn?this.set("instantType","focus"):this.set("instantType",void 0)});Rt(this,"disposeEffect",()=>this.context.stickIfOpenTimeout.disposeEffect())}static useStore(n,r){const o=Xn(()=>new lr(r)).current,s=n??o;return Gr(o.disposeEffect),s}}function Hr({props:e}){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,modal:i=!1,handle:l,triggerId:u,defaultTriggerId:a=null}=e,c=lr.useStore(l==null?void 0:l.store,{modal:i,open:r,openProp:n,activeTriggerId:a,triggerIdProp:u});xs(()=>{n===void 0&&c.state.open===!1&&r===!0&&c.update({open:!0,activeTriggerId:a})}),c.useControlledProp("openProp",n),c.useControlledProp("triggerIdProp",u);const f=c.useState("open"),p=c.useState("positionerElement"),h=c.useState("payload"),w=c.useState("openChangeReason");c.useContextCallback("onOpenChange",o),c.useContextCallback("onOpenChangeComplete",s);const{openMethod:v,triggerProps:m}=bs(f);ys(c);const{forceUnmount:x}=ws(f,c,()=>{c.update({stickIfOpen:!0,openChangeReason:null})});Cs(f&&i===!0&&w!==Oe&&v!=="touch",p),d.useEffect(()=>{f||c.context.stickIfOpenTimeout.clear()},[c,f]);const R=d.useCallback(I=>{const T=ve(I);return T.preventUnmountOnClose=()=>{c.set("preventUnmountingOnClose",!0)},T},[c]),b=d.useCallback(()=>{c.setOpen(!1,R(Rs))},[c,R]);d.useImperativeHandle(e.actionsRef,()=>({unmount:x,close:b}),[x,b]);const C=Ss({popupStore:c,onOpenChange:c.setOpen}),E=Es(C,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),S=Ts(C),{getReferenceProps:y,getFloatingProps:D,getTriggerProps:k}=eo([E,S]),N=d.useMemo(()=>y(m),[y,m]),O=d.useMemo(()=>k(m),[k,m]),A=d.useMemo(()=>D(),[D]);c.useSyncedValues({modal:i,openMethod:v,activeTriggerProps:N,inactiveTriggerProps:O,popupProps:A,floatingRootContext:C,nested:Wn()!=null});const M=d.useMemo(()=>({store:c}),[c]);return g.jsx(qo.Provider,{value:M,children:typeof t=="function"?t({payload:h}):t})}function Ac(e){return zt(!0)?g.jsx(Hr,{props:e}):g.jsx(vs,{children:g.jsx(Hr,{props:e})})}const Pc=300,Mc=d.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,handle:l,payload:u,openOnHover:a=!1,delay:c=Pc,closeDelay:f=0,id:p,...h}=t,w=zt(!0),v=(l==null?void 0:l.store)??(w==null?void 0:w.store);if(!v)throw new Error(bn(74));const m=Os(p),x=v.useState("isTriggerActive",m),R=v.useState("floatingRootContext"),b=v.useState("isOpenedByTrigger",m),C=d.useRef(null),{registerTrigger:E,isMountedByThisTrigger:S}=Ds(m,C,v,{payload:u,disabled:s,openOnHover:a,closeDelay:f}),y=v.useState("openChangeReason"),D=v.useState("stickIfOpen"),k=v.useState("openMethod"),N=Ea(R,{enabled:R!=null&&a&&(k!=="touch"||y!==nn),mouseOnly:!0,move:!1,handleClose:Da(),restMs:c,delay:{close:f},triggerElementRef:C,isActiveTrigger:x}),O=Pi(R,{enabled:R!=null,stickIfOpen:D}),A=eo([O]),M=v.useState("triggerProps",S),I={disabled:s,open:b},{getButtonProps:T,buttonRef:F}=As({disabled:s,native:i}),L=d.useMemo(()=>({open($){return $&&y===nn?Ps.open($):Ms.open($)}}),[y]),P=Un("button",t,{state:I,ref:[F,n,E,C],props:[A.getReferenceProps(),N,M,{[ks]:"",id:m},h,T],stateAttributesMapping:L}),j=d.useRef(null),B=xe($=>{Fe.flushSync(()=>{v.setOpen(!1,ve(jn,$.nativeEvent,$.currentTarget))});const q=Ns(j.current);q==null||q.focus()}),ee=xe($=>{var H;const q=v.select("positionerElement");if(q&&Is($,q))(H=v.context.beforeContentFocusGuardRef.current)==null||H.focus();else{Fe.flushSync(()=>{v.setOpen(!1,ve(jn,$.nativeEvent,$.currentTarget))});let V=js(v.context.triggerFocusTargetRef.current||C.current);for(;V!==null&&Ke(q,V);){const _=V;if(V=Ls(V),V===_)break}V==null||V.focus()}});return x?g.jsxs(d.Fragment,{children:[g.jsx(pr,{ref:j,onFocus:B}),g.jsx(d.Fragment,{children:P},m),g.jsx(pr,{ref:v.context.triggerFocusTargetRef,onFocus:ee})]}):g.jsx(d.Fragment,{children:P},m)}),Ko=d.createContext(void 0);function kc(){const e=d.useContext(Ko);if(e===void 0)throw new Error(bn(45));return e}const Nc=d.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=zt();return s.useState("mounted")||r?g.jsx(Ko.Provider,{value:r,children:g.jsx(Fs,{ref:n,...o})}):null}),Go=d.createContext(void 0);function Ic(){const e=d.useContext(Go);if(!e)throw new Error(bn(46));return e}const jc=d.createContext(void 0);function Lc(){const e=d.useContext(jc);return(e==null?void 0:e.direction)??"ltr"}const Fc=e=>({name:"arrow",options:e,async fn(t){var j,B;const{x:n,y:r,placement:o,rects:s,platform:i,elements:l,middlewareData:u}=t,{element:a,padding:c=0,offsetParent:f="real"}=We(e,t)||{};if(a==null)return{};const p=ao(c),h={x:n,y:r},w=Jn(o),v=Gn(w),m=await i.getDimensions(a),x=w==="y",R=x?"top":"left",b=x?"bottom":"right",C=x?"clientHeight":"clientWidth",E=s.reference[v]+s.reference[w]-h[w]-s.floating[v],S=h[w]-s.reference[w],y=f==="real"?await((j=i.getOffsetParent)==null?void 0:j.call(i,a)):l.floating;let D=l.floating[C]||s.floating[v];(!D||!await((B=i.isElement)==null?void 0:B.call(i,y)))&&(D=l.floating[C]||s.floating[v]);const k=E/2-S/2,N=D/2-m[v]/2-1,O=Math.min(p[R],N),A=Math.min(p[b],N),M=O,I=D-m[v]-A,T=D/2-m[v]/2+k,F=Ln(M,T,I),L=!u.arrow&&Ze(o)!=null&&T!==F&&s.reference[v]/2-(T<M?O:A)-m[v]/2<0,P=L?T<M?T-M:T-I:0;return{[w]:h[w]+P,data:{[w]:F,centerOffset:T-F-P,...L&&{alignmentOffset:P}},reset:L}}}),_c=(e,t)=>({...Fc(e),options:[e,t]}),zc={name:"hide",async fn(e){var l;const{width:t,height:n,x:r,y:o}=e.rects.reference,s=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:((l=(await va().fn(e)).data)==null?void 0:l.referenceHidden)||s}}}},tn={sideX:"left",sideY:"top"},Bc={name:"adaptiveOrigin",async fn(e){var R,b;const{x:t,y:n,rects:{floating:r},elements:{floating:o},platform:s,strategy:i,placement:l}=e,u=Ge(o),a=u.getComputedStyle(o);if(!(a.transitionDuration!=="0s"&&a.transitionDuration!==""))return{x:t,y:n,data:tn};const f=await((R=s.getOffsetParent)==null?void 0:R.call(s,o));let p={width:0,height:0};if(i==="fixed"&&(u!=null&&u.visualViewport))p={width:u.visualViewport.width,height:u.visualViewport.height};else if(f===u){const C=Pt(o);p={width:C.documentElement.clientWidth,height:C.documentElement.clientHeight}}else await((b=s.isElement)==null?void 0:b.call(s,f))&&(p=await s.getDimensions(f));const h=be(l);let w=t,v=n;h==="left"&&(w=p.width-(t+r.width)),h==="top"&&(v=p.height-(n+r.height));const m=h==="left"?"right":tn.sideX,x=h==="top"?"bottom":tn.sideY;return{x:w,y:v,data:{sideX:m,sideY:x}}}};function Jo(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function Vr(e,t,n){const{rects:r,placement:o}=e;return{side:Jo(t,be(o),n),align:Ze(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function $c(e){var Wt,wt;const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,collisionBoundary:l,collisionPadding:u=5,sticky:a=!1,arrowPadding:c=5,disableAnchorTracking:f=!1,keepMounted:p=!1,floatingRootContext:h,mounted:w,collisionAvoidance:v,shiftCrossAxis:m=!1,nodeId:x,adaptiveOrigin:R,lazyFlip:b=!1,externalTree:C}=e,[E,S]=d.useState(null);!w&&E!==null&&S(null);const y=v.side||"flip",D=v.align||"flip",k=v.fallbackAxisSide||"end",N=typeof t=="function"?t:void 0,O=xe(N),A=N?O:t,M=st(t),T=Lc()==="rtl",F=E||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":T?"left":"right","inline-start":T?"right":"left"}[r],L=s==="center"?F:`${F}-${s}`;let P=u;const j=1,B=r==="bottom"?j:0,ee=r==="top"?j:0,$=r==="right"?j:0,q=r==="left"?j:0;typeof P=="number"?P={top:P+B,right:P+q,bottom:P+ee,left:P+$}:P&&(P={top:(P.top||0)+B,right:(P.right||0)+q,bottom:(P.bottom||0)+ee,left:(P.left||0)+$});const H={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:P},V=d.useRef(null),_=st(o),le=st(i),z=[fa(Y=>{const se=Vr(Y,r,T),Se=typeof _.current=="function"?_.current(se):_.current,X=typeof le.current=="function"?le.current(se):le.current;return{mainAxis:Se,crossAxis:X,alignmentAxis:X}},[typeof o!="function"?o:0,typeof i!="function"?i:0,T,r])],ce=D==="none"&&y!=="shift",ye=!ce&&(a||m||y==="shift"),ze=y==="none"?null:ha({...H,padding:{top:P.top+j,right:P.right+j,bottom:P.bottom+j,left:P.left+j},mainAxis:!m&&y==="flip",crossAxis:D==="flip"?"alignment":!1,fallbackAxisSideDirection:k}),Re=ce?null:pa(Y=>{const se=Pt(Y.elements.floating).documentElement;return{...H,rootBoundary:m?{x:0,y:0,width:se.clientWidth,height:se.clientHeight}:void 0,mainAxis:D!=="none",crossAxis:ye,limiter:a||m?void 0:ga(Se=>{if(!V.current)return{};const{width:X,height:G}=V.current.getBoundingClientRect(),K=De(be(Se.placement)),ue=K==="y"?X:G,ne=K==="y"?P.left+P.right:P.top+P.bottom;return{offset:ue/2+ne/2}})}},[H,a,m,P,D]);y==="shift"||D==="shift"||s==="center"?z.push(Re,ze):z.push(ze,Re),z.push(ma({...H,apply({elements:{floating:Y},availableWidth:se,availableHeight:Se,rects:X}){const G=Y.style;G.setProperty("--available-width",`${se}px`),G.setProperty("--available-height",`${Se}px`);const K=window.devicePixelRatio||1,{x:ue,y:ne,width:Z,height:ge}=X.reference,je=(Math.round((ue+Z)*K)-Math.round(ue*K))/K,te=(Math.round((ne+ge)*K)-Math.round(ne*K))/K;G.setProperty("--anchor-width",`${je}px`),G.setProperty("--anchor-height",`${te}px`)}}),_c(()=>({element:V.current||document.createElement("div"),padding:c,offsetParent:"floating"}),[c]),{name:"transformOrigin",fn(Y){var cr,ur,dr;const{elements:se,middlewareData:Se,placement:X,rects:G,y:K}=Y,ue=be(X),ne=De(ue),Z=V.current,ge=((cr=Se.arrow)==null?void 0:cr.x)||0,je=((ur=Se.arrow)==null?void 0:ur.y)||0,te=(Z==null?void 0:Z.clientWidth)||0,Le=(Z==null?void 0:Z.clientHeight)||0,he=ge+te/2,Ee=je+Le/2,nt=Math.abs(((dr=Se.shift)==null?void 0:dr.y)||0),rt=G.reference.height/2,me=typeof o=="function"?o(Vr(Y,r,T)):o,ot=nt>me,Ct={top:`${he}px calc(100% + ${me}px)`,bottom:`${he}px ${-me}px`,left:`calc(100% + ${me}px) ${Ee}px`,right:`${-me}px ${Ee}px`}[ue],Zo=`${he}px ${G.reference.y+rt-K}px`;return se.floating.style.setProperty("--transform-origin",ye&&ne==="y"&&ot?Zo:Ct),{}}},zc,R),He(()=>{!w&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[w,h]);const ke=d.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:we,elements:Ye,x:vt,y:at,middlewareData:de,update:Be,placement:et,context:xt,isPositioned:Ne,floatingStyles:Bt}=ba({rootContext:h,placement:L,middleware:z,strategy:n,whileElementsMounted:p?void 0:(...Y)=>Or(...Y,ke),nodeId:x,externalTree:C}),{sideX:$t,sideY:$e}=de.adaptiveOrigin||tn,Ie=Ne?n:"fixed",Ue=d.useMemo(()=>{const Y=R?{position:Ie,[$t]:vt,[$e]:at}:{position:Ie,...Bt};return Ne||(Y.opacity=0),Y},[R,Ie,$t,vt,$e,at,Bt,Ne]),tt=d.useRef(null);He(()=>{if(!w)return;const Y=M.current,se=typeof Y=="function"?Y():Y,X=(Wr(se)?se.current:se)||null||null;X!==tt.current&&(we.setPositionReference(X),tt.current=X)},[w,we,A,M]),d.useEffect(()=>{if(!w)return;const Y=M.current;typeof Y!="function"&&Wr(Y)&&Y.current!==tt.current&&(we.setPositionReference(Y.current),tt.current=Y.current)},[w,we,A,M]),d.useEffect(()=>{if(p&&w&&Ye.domReference&&Ye.floating)return Or(Ye.domReference,Ye.floating,Be,ke)},[p,w,Ye,Be,ke]);const pe=be(et),bt=Jo(r,pe,T),Ht=Ze(et)||"center",Vt=!!((Wt=de.hide)!=null&&Wt.referenceHidden);He(()=>{b&&w&&Ne&&S(pe)},[b,w,Ne,pe]);const lt=d.useMemo(()=>{var Y,se;return{position:"absolute",top:(Y=de.arrow)==null?void 0:Y.y,left:(se=de.arrow)==null?void 0:se.x}},[de.arrow]),yt=((wt=de.arrow)==null?void 0:wt.centerOffset)!==0;return d.useMemo(()=>({positionerStyles:Ue,arrowStyles:lt,arrowRef:V,arrowUncentered:yt,side:bt,align:Ht,physicalSide:pe,anchorHidden:Vt,refs:we,context:xt,isPositioned:Ne,update:Be}),[Ue,lt,V,yt,bt,Ht,pe,Vt,we,xt,Ne,Be])}function Wr(e){return e!=null&&"current"in e}function Qo(e){return e==="starting"?_s:Yr}const Hc=d.forwardRef(function(t,n){const{render:r,className:o,anchor:s,positionMethod:i="absolute",side:l="bottom",align:u="center",sideOffset:a=0,alignOffset:c=0,collisionBoundary:f="clipping-ancestors",collisionPadding:p=5,arrowPadding:h=5,sticky:w=!1,disableAnchorTracking:v=!1,collisionAvoidance:m=zs,...x}=t,{store:R}=zt(),b=kc(),C=Bs(),E=R.useState("floatingRootContext"),S=R.useState("mounted"),y=R.useState("open"),D=R.useState("openChangeReason"),k=R.useState("activeTriggerElement"),N=R.useState("modal"),O=R.useState("positionerElement"),A=R.useState("instantType"),M=R.useState("transitionStatus"),I=R.useState("hasViewport"),T=d.useRef(null),F=$s(O,!1,!1),L=$c({anchor:s,floatingRootContext:E,positionMethod:i,mounted:S,side:l,sideOffset:a,align:u,alignOffset:c,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:w,disableAnchorTracking:v,keepMounted:b,nodeId:C,collisionAvoidance:m,adaptiveOrigin:I?Bc:void 0}),P=d.useMemo(()=>{const H={};return y||(H.pointerEvents="none"),{role:"presentation",hidden:!S,style:{...L.positionerStyles,...H}}},[y,S,L.positionerStyles]),j=d.useMemo(()=>({props:P,...L}),[P,L]),B=E.useState("domReferenceElement");He(()=>{const H=B,V=T.current;if(H&&(T.current=H),V&&H&&H!==V){R.set("instantType",void 0);const _=new AbortController;return F(()=>{R.set("instantType","trigger-change")},_.signal),()=>{_.abort()}}},[B,F,R]);const ee={open:y,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:A},$=d.useCallback(H=>{R.set("positionerElement",H)},[R]),q=Un("div",t,{state:ee,props:[j.props,Qo(M),x],ref:[n,$],stateAttributesMapping:to});return g.jsxs(Go.Provider,{value:j,children:[S&&N===!0&&D!==Oe&&g.jsx(Hs,{ref:R.context.internalBackdropRef,inert:Vs(!y),cutout:k}),g.jsx(Ws,{id:C,children:q})]})}),Vc=d.createContext(void 0);function Wc(e){return d.useContext(Vc)}const Xc=d.createContext(void 0);function Yc(){const[e,t]=d.useState(0),n=xe(()=>(t(o=>o+1),()=>{t(o=>Math.max(0,o-1))}));return{context:d.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function Uc(e){const{value:t,children:n}=e;return g.jsx(Xc.Provider,{value:t,children:n})}const qc={...to,...Us},Kc=d.forwardRef(function(t,n){const{className:r,render:o,initialFocus:s,finalFocus:i,...l}=t,{store:u}=zt(),a=Ic(),c=Wc()!=null,{context:f,hasClosePart:p}=Yc(),h=u.useState("open"),w=u.useState("openMethod"),v=u.useState("instantType"),m=u.useState("transitionStatus"),x=u.useState("popupProps"),R=u.useState("titleElementId"),b=u.useState("descriptionElementId"),C=u.useState("modal"),E=u.useState("mounted"),S=u.useState("openChangeReason"),y=u.useState("activeTriggerElement"),D=u.useState("floatingRootContext");Xs({open:h,ref:u.context.popupRef,onComplete(){var P,j;h&&((j=(P=u.context).onOpenChangeComplete)==null||j.call(P,!0))}});const k=u.useState("disabled"),N=u.useState("openOnHover"),O=u.useState("closeDelay");Ra(D,{enabled:N&&!k,closeDelay:O});function A(P){return P==="touch"?u.context.popupRef.current:!0}const M=s===void 0?A:s,I={open:h,side:a.side,align:a.align,instant:v,transitionStatus:m},T=C!==!1&&p,F=d.useCallback(P=>{u.set("popupElement",P)},[u]),L=Un("div",t,{state:I,ref:[n,u.context.popupRef,F],props:[x,{"aria-labelledby":R,"aria-describedby":b,onKeyDown(P){c&&qs.has(P.key)&&P.stopPropagation()}},Qo(m),l],stateAttributesMapping:qc});return g.jsx(Ys,{context:D,openInteractionType:w,modal:T,disabled:!E||S===Oe,initialFocus:M,returnFocus:i,restoreFocus:"popup",previousFocusableElement:Qe(y)?y:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:g.jsx(Uc,{value:f,children:L})})});function Gc({...e}){return g.jsx(Ac,{"data-slot":"popover",...e})}function Jc({...e}){return g.jsx(Mc,{"data-slot":"popover-trigger",...e})}function Qc({className:e,align:t="center",alignOffset:n=0,side:r="bottom",sideOffset:o=4,...s}){return g.jsx(Nc,{children:g.jsx(Hc,{align:t,alignOffset:n,side:r,sideOffset:o,className:"isolate z-50",children:g.jsx(Kc,{"data-slot":"popover-content",className:It("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...s})})})}function St({icon:e,label:t,active:n,dot:r,children:o,align:s="start"}){return g.jsxs(Gc,{children:[g.jsxs(Jc,{className:It("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-[11px] font-medium transition-all duration-150 cursor-pointer","border",n?"border-[var(--accent-brand)]/30 text-[var(--accent-brand)]":"border-[var(--border-default)] text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--border-hover)] hover:bg-[var(--bg-hover)]"),style:{backgroundColor:n?"var(--accent-muted)":"transparent"},children:[g.jsx(e,{className:"size-3 opacity-70"}),t,n&&g.jsx("span",{className:"size-1.5 rounded-full",style:{backgroundColor:"var(--accent-brand)"}})]}),g.jsx(Qc,{align:s,className:"w-52 !p-1.5 !rounded-lg",style:{backgroundColor:"var(--bg-elevated)",borderColor:"var(--border-default)",boxShadow:"0 8px 30px rgba(0,0,0,0.4)"},children:o})]})}function Jt({onClick:e,selected:t,children:n}){return g.jsxs("button",{type:"button",className:It("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-[12px] transition-colors duration-100",t?"bg-[var(--accent-muted)] text-[var(--text-primary)]":"text-[var(--text-secondary)] hover:bg-[var(--bg-hover)] hover:text-[var(--text-primary)]"),onClick:e,children:[n,t&&g.jsx(Ks,{className:"ml-auto size-3 shrink-0",style:{color:"var(--accent-brand)"}})]})}function Zc({members:e,labels:t,onFiltersChange:n,filters:r}){const o=d.useMemo(()=>{let a=0;return r.assignee&&a++,r.priority&&a++,r.label&&a++,r.status&&a++,(r.dueDateFrom||r.dueDateTo)&&a++,a},[r]),s=o>0;function i(a,c){const f={...r,[a]:c};c||delete f[a],n(f)}function l(a,c){i(a,r[a]===c?void 0:c)}function u(){n({})}return g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsxs("div",{className:"relative mr-1 flex items-center px-1",children:[g.jsx(Di,{className:"size-3.5",style:{color:s?"var(--accent-brand)":"var(--text-tertiary)"}}),s&&g.jsx("span",{className:"absolute -right-0.5 -top-1 flex size-3.5 items-center justify-center rounded-full text-[8px] font-bold leading-none",style:{backgroundColor:"var(--accent-brand)",color:"#0F0F11"},children:o})]}),g.jsx(St,{icon:so,label:"Assignee",active:!!r.assignee,children:e.length===0?g.jsx("div",{className:"px-2 py-3 text-center text-xs",style:{color:"var(--text-tertiary)"},children:"No members"}):e.map(a=>g.jsxs(Jt,{onClick:()=>l("assignee",a.id),selected:r.assignee===a.id,children:[g.jsx(Zr,{name:a.name,avatarUrl:a.avatar_url,size:"xs"}),g.jsx("span",{className:"flex-1 truncate text-left",children:a.name})]},a.id))}),g.jsx(St,{icon:lo,label:"Priority",active:!!r.priority,children:io.map(a=>g.jsxs(Jt,{onClick:()=>l("priority",a.value),selected:r.priority===a.value,children:[g.jsx(qn,{priority:a.value}),g.jsx("span",{className:"flex-1 text-left",children:a.label})]},a.value))}),g.jsx(St,{icon:si,label:"Label",active:!!r.label,children:t.length===0?g.jsx("div",{className:"px-2 py-3 text-center text-xs",style:{color:"var(--text-tertiary)"},children:"No labels"}):t.map(a=>g.jsxs(Jt,{onClick:()=>l("label",a.id),selected:r.label===a.id,children:[g.jsx("span",{className:"size-2.5 shrink-0 rounded-full",style:{backgroundColor:a.color}}),g.jsx("span",{className:"flex-1 truncate text-left",children:a.name})]},a.id))}),g.jsx(St,{icon:Ei,label:"Status",active:!!r.status,children:Mt.map(a=>g.jsxs(Jt,{onClick:()=>l("status",a.value),selected:r.status===a.value,children:[g.jsx("span",{className:"size-2.5 shrink-0 rounded-full",style:{backgroundColor:sn[a.value]||"var(--text-tertiary)"}}),g.jsx("span",{className:"flex-1 text-left",children:a.label})]},a.value))}),g.jsx(St,{icon:oo,label:"Due Date",active:!!(r.dueDateFrom||r.dueDateTo),children:g.jsxs("div",{className:"flex flex-col gap-2 p-1",children:[g.jsxs("label",{className:"flex flex-col gap-1",children:[g.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--text-tertiary)"},children:"From"}),g.jsx("input",{type:"date",value:r.dueDateFrom||"",onChange:a=>i("dueDateFrom",a.target.value||void 0),className:"rounded-md border px-2 py-1.5 text-xs outline-none transition-colors focus:border-[var(--accent-brand)]",style:{backgroundColor:"var(--bg-surface)",borderColor:"var(--border-default)",color:"var(--text-primary)",colorScheme:"dark"}})]}),g.jsxs("label",{className:"flex flex-col gap-1",children:[g.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--text-tertiary)"},children:"To"}),g.jsx("input",{type:"date",value:r.dueDateTo||"",onChange:a=>i("dueDateTo",a.target.value||void 0),className:"rounded-md border px-2 py-1.5 text-xs outline-none transition-colors focus:border-[var(--accent-brand)]",style:{backgroundColor:"var(--bg-surface)",borderColor:"var(--border-default)",color:"var(--text-primary)",colorScheme:"dark"}})]}),(r.dueDateFrom||r.dueDateTo)&&g.jsx("button",{type:"button",className:"mt-0.5 self-start rounded-md px-2 py-1 text-[10px] font-medium transition-colors",style:{color:"var(--text-tertiary)"},onClick:()=>{const a={...r};delete a.dueDateFrom,delete a.dueDateTo,n(a)},children:"Clear dates"})]})}),s&&g.jsxs("button",{type:"button",className:"ml-1 inline-flex items-center gap-1 rounded-md px-2 py-1.5 text-[11px] font-medium transition-all duration-150 hover:bg-[var(--bg-hover)]",style:{color:"var(--text-tertiary)"},onClick:u,children:[g.jsx(no,{className:"size-3"}),"Clear"]})]})}function eu({projectId:e,members:t,onUpdate:n}){const{selectedTaskIds:r,clearSelection:o}=ro(),[s,i]=d.useState(null),[l,u]=d.useState(!1),a=r.length;if(a===0)return null;const c=async p=>{u(!0);try{await ut.request("bulkUpdateTasks",{projectId:e,taskIds:r,updates:p}),n(),o()}catch(h){console.error(h)}finally{u(!1),i(null)}},f=async()=>{if(confirm(`Delete ${a} tasks?`)){u(!0);try{await ut.request("bulkDeleteTasks",{projectId:e,taskIds:r}),n(),o()}catch(p){console.error(p)}finally{u(!1)}}};return g.jsx(Gs,{children:g.jsxs(Js.div,{initial:{y:80,opacity:0},animate:{y:0,opacity:1},exit:{y:80,opacity:0},transition:{duration:.15,ease:"easeOut"},className:"fixed bottom-6 left-1/2 z-50 flex -translate-x-1/2 items-center gap-2 rounded-lg border px-4 py-2.5",style:{backgroundColor:"var(--bg-elevated)",borderColor:"var(--border-default)",boxShadow:"0 8px 30px rgba(0,0,0,0.4)"},children:[g.jsxs("span",{className:"mr-2 text-xs font-medium",style:{color:"var(--text-primary)"},children:[a," selected"]}),g.jsxs("div",{className:"relative",children:[g.jsxs(ct,{variant:"ghost",size:"sm",onClick:()=>i(s==="status"?null:"status"),disabled:l,children:[g.jsx(Ri,{className:"mr-1 size-3.5"}),"Status"]}),s==="status"&&g.jsx(kn,{items:Mt.map(p=>({key:p.value,label:p.label})),onSelect:p=>c({status:p}),onClose:()=>i(null)})]}),g.jsxs("div",{className:"relative",children:[g.jsxs(ct,{variant:"ghost",size:"sm",onClick:()=>i(s==="priority"?null:"priority"),disabled:l,children:[g.jsx(lo,{className:"mr-1 size-3.5"}),"Priority"]}),s==="priority"&&g.jsx(kn,{items:io.map(p=>({key:p.value,label:p.label,icon:g.jsx(qn,{priority:p.value})})),onSelect:p=>c({priority:p}),onClose:()=>i(null)})]}),g.jsxs("div",{className:"relative",children:[g.jsxs(ct,{variant:"ghost",size:"sm",onClick:()=>i(s==="assign"?null:"assign"),disabled:l,children:[g.jsx(so,{className:"mr-1 size-3.5"}),"Assign"]}),s==="assign"&&g.jsx(kn,{items:t.map(p=>{var h,w,v;return{key:p.user_id||((h=p.profiles)==null?void 0:h.id),label:((w=p.profiles)==null?void 0:w.full_name)||((v=p.profiles)==null?void 0:v.email)||"Unknown"}}),onSelect:p=>c({assignee_ids:[p]}),onClose:()=>i(null)})]}),g.jsxs(ct,{variant:"ghost",size:"sm",onClick:f,disabled:l,className:"text-[var(--priority-urgent)] hover:text-[var(--priority-urgent)]",children:[g.jsx(fi,{className:"mr-1 size-3.5"}),"Delete"]}),g.jsx(ct,{variant:"ghost",size:"icon-sm",onClick:o,className:"ml-1",children:g.jsx(no,{className:"size-4",style:{color:"var(--text-secondary)"}})})]})})}function kn({items:e,onSelect:t,onClose:n}){return g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"fixed inset-0 z-40",onClick:n}),g.jsx("div",{className:"absolute bottom-full left-0 z-50 mb-1 min-w-[160px] overflow-hidden rounded-md border py-1",style:{backgroundColor:"var(--bg-elevated)",borderColor:"var(--border-default)",boxShadow:"0 4px 12px rgba(0,0,0,0.3)"},children:e.map(r=>g.jsxs("button",{onClick:()=>t(r.key),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs transition-colors duration-100 hover:bg-[var(--bg-hover)]",style:{color:"var(--text-secondary)"},children:[r.icon,r.label]},r.key))})]})}function cu(){const{orgSlug:e,projectSlug:t}=Qs(),{currentOrgId:n,selectedTaskId:r,setSelectedTask:o,setCurrentProject:s,setViewMode:i,filters:l,setFilters:u}=ro(),[a,c]=d.useState(null),[f,p]=d.useState(!0),[h,w]=d.useState(!1),[v,m]=d.useState("todo"),[x,R]=d.useState([]),[b,C]=d.useState([]);d.useEffect(()=>{i("board")},[i]),d.useEffect(()=>{n&&(p(!0),ut.request("getProjects",{orgId:n}).then(O=>{const A=O.find(M=>M.slug===t);A&&(c(A),s(A.id))}).catch(console.error).finally(()=>p(!1)))},[n,t,s]),d.useEffect(()=>{n&&ut.request("getOrgMembers",{orgId:n}).then(R).catch(()=>{})},[n]),d.useEffect(()=>{a!=null&&a.id&&ut.request("getLabels",{projectId:a.id}).then(C).catch(()=>{})},[a==null?void 0:a.id]);const{tasks:E,isLoading:S,mutate:y}=ii((a==null?void 0:a.id)||null),D=d.useMemo(()=>{let O=E;return l.status&&(O=O.filter(A=>A.status===l.status)),l.priority&&(O=O.filter(A=>A.priority===l.priority)),l.assignee&&(O=O.filter(A=>{var M;return(M=A.assignees)==null?void 0:M.some(I=>(I.user_id||I.id)===l.assignee)})),l.label&&(O=O.filter(A=>{var M;return(M=A.labels)==null?void 0:M.some(I=>(I.label_id||I.id)===l.label)})),O},[E,l]),k=O=>{m(O),w(!0)},N=Object.values(l).some(Boolean);return f?g.jsx("div",{className:"flex flex-1 items-center justify-center",style:{background:"var(--bg-base)"},children:g.jsx("div",{className:"h-5 w-5 rounded-full border-2 border-[var(--accent-brand)] border-t-transparent animate-spin"})}):a?g.jsxs(g.Fragment,{children:[g.jsx(gr,{projectName:a.name,projectPrefix:a.prefix,orgSlug:e,projectSlug:t,onCreateTask:()=>{m("todo"),w(!0)}}),g.jsx(Zc,{members:x,labels:b,filters:l,onFiltersChange:u}),S?g.jsx("div",{className:"flex flex-1 items-center justify-center",children:g.jsx("div",{className:"h-5 w-5 rounded-full border-2 border-[var(--accent-brand)] border-t-transparent animate-spin"})}):D.length===0&&!N?g.jsx("div",{className:"flex flex-1 items-center justify-center",children:g.jsx(vr,{message:"No tasks yet. Create your first task.",actionLabel:"Create Task",onAction:()=>{m("todo"),w(!0)}})}):g.jsx(Tc,{tasks:D,projectId:a.id,projectPrefix:a.prefix,deployEnabled:a.github_deploy_enabled||!1,onTaskClick:o,onAddTask:k,mutateTasks:y}),g.jsx(eu,{projectId:a.id,members:x,onUpdate:y}),g.jsx(ai,{taskId:r,projectId:(a==null?void 0:a.id)||"",projectPrefix:(a==null?void 0:a.prefix)||"",onClose:()=>o(null),onUpdate:y}),g.jsx(li,{open:h,onOpenChange:w,projectId:(a==null?void 0:a.id)||"",projectPrefix:(a==null?void 0:a.prefix)||"",projectAgentId:a==null?void 0:a.agent_id,defaultStatus:v,onCreated:y})]}):g.jsxs(g.Fragment,{children:[g.jsx(gr,{orgSlug:e}),g.jsx("div",{className:"flex flex-1 items-center justify-center",children:g.jsx(vr,{message:"Project not found."})})]})}export{cu as default};
@@ -0,0 +1,6 @@
1
+ import{c as B,aO as G,aL as I,r as o,a0 as _,j as e,H as L,Z as J,X as F,aP as K}from"./index-DXrrw_d3.js";import{u as Q,f as V,g as W,S as D,a as E,d as R,P as z}from"./use-tasks-BRmu1Iuc.js";import{E as O}from"./empty-state-fdFSKAF8.js";import{L as $}from"./label-chip-CncSPoUy.js";import"./trash-2-DG-hxPmD.js";import"./circle-x-DqOtgfMh.js";import"./clock-k3OP3WGD.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const ee=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],te=B("chevron-up",ee),A={urgent:0,high:1,medium:2,low:3,none:4},U={backlog:0,todo:1,in_progress:2,in_review:3,done:4};function q({items:u,onSelect:x,onClose:p,anchorRef:f}){const l=o.useRef(null);return o.useEffect(()=>{function r(t){l.current&&!l.current.contains(t.target)&&f.current&&!f.current.contains(t.target)&&p()}function n(t){t.key==="Escape"&&p()}return document.addEventListener("mousedown",r),document.addEventListener("keydown",n),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",n)}},[p,f]),e.jsx("div",{ref:l,className:"absolute z-50 mt-1 min-w-[160px] rounded-md border py-1",style:{backgroundColor:"var(--bg-elevated)",borderColor:"var(--border-default)"},children:u.map(r=>e.jsx("button",{className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors duration-100 hover:bg-[var(--bg-hover)]",style:{color:"var(--text-primary)"},onClick:n=>{n.stopPropagation(),x(r.value)},children:r.node??e.jsxs(e.Fragment,{children:[r.color&&e.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:r.color}}),r.label]})},r.value))})}function se({task:u,projectId:x,mutateTasks:p}){var c;const[f,l]=o.useState(!1),r=o.useRef(null),n=u.status||"todo",t=((c=D.find(d=>d.value===n))==null?void 0:c.label)||n,j=E[n]||"var(--text-tertiary)",g=o.useCallback(async d=>{l(!1);try{await _.request("updateTask",{projectId:x,taskId:u.id,status:d}),p()}catch(v){console.error(v)}},[x,u.id,p]);return e.jsxs("div",{className:"relative",children:[e.jsxs("button",{ref:r,onClick:d=>{d.stopPropagation(),l(v=>!v)},className:"inline-flex items-center gap-1.5 rounded px-1.5 py-0.5 text-xs font-medium transition-colors duration-100 hover:bg-[var(--bg-hover)]",style:{color:j},children:[e.jsx("span",{className:"size-1.5 rounded-full",style:{backgroundColor:j}}),t]}),f&&e.jsx(q,{anchorRef:r,onClose:()=>l(!1),onSelect:g,items:D.map(d=>({value:d.value,label:d.label,color:E[d.value]}))})]})}function re({task:u,projectId:x,mutateTasks:p}){var g;const[f,l]=o.useState(!1),r=o.useRef(null),n=u.priority||"none",t=((g=R.find(c=>c.value===n))==null?void 0:g.label)||n,j=o.useCallback(async c=>{l(!1);try{await _.request("updateTask",{projectId:x,taskId:u.id,priority:c}),p()}catch(d){console.error(d)}},[x,u.id,p]);return e.jsxs("div",{className:"relative",children:[e.jsxs("button",{ref:r,onClick:c=>{c.stopPropagation(),l(d=>!d)},className:"inline-flex items-center gap-1.5 rounded px-1.5 py-0.5 text-xs font-medium transition-colors duration-100 hover:bg-[var(--bg-hover)]",style:{color:"var(--text-secondary)"},children:[e.jsx(z,{priority:n}),t]}),f&&e.jsx(q,{anchorRef:r,onClose:()=>l(!1),onSelect:j,items:R.map(c=>({value:c.value,label:c.label,node:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{priority:c.value}),e.jsx("span",{children:c.label})]})}))})]})}function S({label:u,field:x,sortField:p,sortDirection:f,onSort:l,className:r}){const n=p===x;return e.jsx("th",{className:F("cursor-pointer select-none whitespace-nowrap px-3 py-2 text-left text-[11px] font-medium uppercase tracking-wider transition-colors duration-100 hover:bg-[var(--bg-hover)]",r),style:{color:n?"var(--text-primary)":"var(--text-tertiary)"},onClick:()=>l(x),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[u,n&&(f==="asc"?e.jsx(te,{className:"size-3"}):e.jsx(K,{className:"size-3"}))]})})}function ue(){const{projectSlug:u}=G(),{currentOrgId:x,selectedTaskId:p,setSelectedTask:f,setCurrentProject:l,selectedTaskIds:r,toggleTaskSelection:n}=I(),[t,j]=o.useState(null),[g,c]=o.useState(!0),[d,v]=o.useState(!1),[H,T]=o.useState("todo"),[h,M]=o.useState("task_number"),[b,P]=o.useState("desc");o.useEffect(()=>{x&&(c(!0),_.request("getProjects",{orgId:x}).then(s=>{const a=s.find(m=>m.slug===u);a&&(j(a),l(a.id))}).catch(console.error).finally(()=>c(!1)))},[x,u,l]);const{tasks:y,isLoading:X,mutate:k}=Q((t==null?void 0:t.id)||null),N=o.useCallback(s=>{h===s?P(a=>a==="asc"?"desc":"asc"):(M(s),P("asc"))},[h]),Y=[...y].sort((s,a)=>{const m=b==="asc"?1:-1;switch(h){case"task_number":return((s.task_number||0)-(a.task_number||0))*m;case"title":return(s.title||"").localeCompare(a.title||"")*m;case"status":return((U[s.status]??99)-(U[a.status]??99))*m;case"priority":return((A[s.priority||"none"]??99)-(A[a.priority||"none"]??99))*m;case"due_date":{const w=s.due_date?new Date(s.due_date).getTime():1/0,i=a.due_date?new Date(a.due_date).getTime():1/0;return(w-i)*m}case"story_points":return((s.story_points||0)-(a.story_points||0))*m;default:return 0}}),C=y.length>0&&y.every(s=>r.includes(s.id)),Z=o.useCallback(()=>{const{setSelectedTaskIds:s,clearSelection:a}=I.getState();C?a():s(y.map(m=>m.id))},[C,y]);return g?e.jsx("div",{className:"flex flex-1 items-center justify-center",style:{background:"var(--bg-base)"},children:e.jsx("div",{className:"h-5 w-5 rounded-full border-2 border-[var(--accent-brand)] border-t-transparent animate-spin"})}):t?e.jsxs(e.Fragment,{children:[e.jsx(L,{projectName:t.name,projectPrefix:t.prefix,onCreateTask:()=>{T("todo"),v(!0)}}),X?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsx("div",{className:"h-5 w-5 rounded-full border-2 border-[var(--accent-brand)] border-t-transparent animate-spin"})}):y.length===0?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsx(O,{message:"No tasks yet. Create your first task.",actionLabel:"Create Task",onAction:()=>{T("todo"),v(!0)}})}):e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",style:{background:"var(--bg-base)"},children:[e.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b px-4 py-2",style:{borderColor:"var(--border-subtle)"},children:e.jsxs("span",{className:"text-xs font-medium",style:{color:"var(--text-tertiary)"},children:[y.length," ",y.length===1?"task":"tasks"]})}),e.jsx("div",{className:"flex-1 overflow-x-auto overflow-y-auto",children:e.jsxs("table",{className:"w-full min-w-[900px] border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"sticky top-0 z-10 border-b",style:{backgroundColor:"var(--bg-base)",borderColor:"var(--border-subtle)"},children:[e.jsx("th",{className:"w-10 px-3 py-2",children:e.jsx("input",{type:"checkbox",checked:C,onChange:Z,className:"size-3.5 cursor-pointer rounded accent-[var(--accent-brand)]"})}),e.jsx(S,{label:"ID",field:"task_number",sortField:h,sortDirection:b,onSort:N,className:"w-20"}),e.jsx(S,{label:"Title",field:"title",sortField:h,sortDirection:b,onSort:N}),e.jsx(S,{label:"Status",field:"status",sortField:h,sortDirection:b,onSort:N,className:"w-32"}),e.jsx(S,{label:"Priority",field:"priority",sortField:h,sortDirection:b,onSort:N,className:"w-28"}),e.jsx("th",{className:"whitespace-nowrap px-3 py-2 text-left text-[11px] font-medium uppercase tracking-wider",style:{color:"var(--text-tertiary)",width:100},children:"Assignee"}),e.jsx(S,{label:"Due Date",field:"due_date",sortField:h,sortDirection:b,onSort:N,className:"w-28"}),e.jsx("th",{className:"whitespace-nowrap px-3 py-2 text-left text-[11px] font-medium uppercase tracking-wider",style:{color:"var(--text-tertiary)",width:120},children:"Labels"}),e.jsx(S,{label:"Points",field:"story_points",sortField:h,sortDirection:b,onSort:N,className:"w-20"})]})}),e.jsx("tbody",{children:Y.map(s=>{const a=s.assignees||[],m=s.labels||[],w=r.includes(s.id);return e.jsxs("tr",{onClick:()=>f(s.id),className:F("cursor-pointer border-b transition-colors duration-100",w?"bg-[var(--bg-active)]":"hover:bg-[var(--bg-hover)]"),style:{borderColor:"var(--border-subtle)"},children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("input",{type:"checkbox",checked:w,onChange:i=>{i.stopPropagation(),n(s.id)},onClick:i=>i.stopPropagation(),className:"size-3.5 cursor-pointer rounded accent-[var(--accent-brand)]"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs("span",{className:"font-mono text-xs",style:{color:"var(--text-tertiary)"},children:[t.prefix,"-",s.task_number]})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("span",{className:"text-sm leading-snug",style:{color:"var(--text-primary)"},children:s.title})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(se,{task:s,projectId:t.id,mutateTasks:k})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(re,{task:s,projectId:t.id,mutateTasks:k})}),e.jsx("td",{className:"px-3 py-2",children:a.length>0?e.jsxs("div",{className:"flex -space-x-1",children:[a.slice(0,3).map(i=>e.jsx(J,{name:i.full_name||i.email,avatarUrl:i.avatar_url,size:"xs"},i.user_id||i.id)),a.length>3&&e.jsxs("span",{className:"flex size-5 items-center justify-center rounded-full text-[9px] font-medium",style:{backgroundColor:"var(--bg-active)",color:"var(--text-tertiary)"},children:["+",a.length-3]})]}):e.jsx("span",{className:"text-xs",style:{color:"var(--text-tertiary)"},children:"--"})}),e.jsx("td",{className:"px-3 py-2",children:s.due_date?e.jsx("span",{className:"text-xs",style:{color:"var(--text-secondary)"},children:new Date(s.due_date).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}):e.jsx("span",{className:"text-xs",style:{color:"var(--text-tertiary)"},children:"--"})}),e.jsx("td",{className:"px-3 py-2",children:m.length>0?e.jsx("div",{className:"flex flex-wrap gap-1",children:m.map(i=>e.jsx($,{name:i.name,color:i.color},i.label_id||i.id))}):e.jsx("span",{className:"text-xs",style:{color:"var(--text-tertiary)"},children:"--"})}),e.jsx("td",{className:"px-3 py-2 text-center",children:s.story_points!=null?e.jsx("span",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:s.story_points}):e.jsx("span",{className:"text-xs",style:{color:"var(--text-tertiary)"},children:"--"})})]},s.id)})})]})})]}),e.jsx(V,{taskId:p,projectId:(t==null?void 0:t.id)||"",projectPrefix:(t==null?void 0:t.prefix)||"",onClose:()=>f(null),onUpdate:k}),e.jsx(W,{open:d,onOpenChange:v,projectId:(t==null?void 0:t.id)||"",projectPrefix:(t==null?void 0:t.prefix)||"",projectAgentId:t==null?void 0:t.agent_id,defaultStatus:H,onCreated:k})]}):e.jsxs(e.Fragment,{children:[e.jsx(L,{}),e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsx(O,{message:"Project not found."})})]})}export{ue as default};
@@ -0,0 +1,6 @@
1
+ import{c as be,aO as fe,aL as ye,r as t,aU as je,a0 as n,j as e,H as te,aQ as x,aT as se,X as Ne,_ as m,Y as re,$ as le,Z as Ce}from"./index-DXrrw_d3.js";import{L as we}from"./label-chip-CncSPoUy.js";import{T}from"./trash-2-DG-hxPmD.js";import{U as ke}from"./users-DP3a-Wwz.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Se=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],_e=be("github",Se),Ae=["#E5484D","#E5884D","#E5C94D","#46A758","#3DD6B5","#4D8FE5","#8B7BF5","#E54DA0","#5C5C63"];function Re(){const{orgSlug:d,projectSlug:u}=fe(),{currentOrgId:c}=ye(),[l,N]=t.useState(null),[C,w]=t.useState(!0),[k,f]=t.useState(""),[y,p]=t.useState(""),[S,L]=t.useState(""),[_,s]=t.useState(""),[o,i]=t.useState(""),[g,A]=t.useState(""),[D,z]=t.useState(""),[B,E]=t.useState([]),[P,U]=t.useState(""),[O,oe]=t.useState("#4D8FE5"),[R,ne]=t.useState(""),[F,M]=t.useState(""),[v,b]=t.useState(!1),[h,ce]=t.useState("general"),[ie,de]=t.useState([]),[j,q]=t.useState(null),[H,$]=t.useState("default"),[K,Q]=t.useState(!1),[I,X]=t.useState(!1),[Y,Z]=t.useState("dev"),[J,V]=t.useState("main"),[W,ee]=t.useState(!0),{isAdmin:xe,can:me}=je();t.useEffect(()=>{c&&(w(!0),n.request("getProjects",{orgId:c}).then(a=>{const r=a.find(G=>G.slug===u);r&&(N(r),f(r.name),p(r.description||""),L(r.prefix),s(r.color||""),i(r.github_repo_url||""),A(r.github_repo_owner||""),z(r.github_repo_name||""),ne(r.agent_id||""),M(r.agent_instructions||""),X(r.github_deploy_enabled||!1),Z(r.github_dev_branch||"dev"),V(r.github_prod_branch||"main"),ee(r.github_auto_delete_branches??!0),n.request("getLabels",{projectId:r.id}).then(E).catch(()=>{}),n.request("getGithubStatus",{projectId:r.id}).then(q).catch(()=>{}))}).catch(()=>{}).finally(()=>w(!1)))},[c,u]);const ue=async()=>{if(!(!c||!l)){b(!0);try{await n.request("updateProject",{orgId:c,projectId:l.id,name:k.trim(),description:y.trim()||null,color:_||null})}catch{}b(!1)}},he=a=>{i(a);const r=a.match(/github\.com\/([^/]+)\/([^/]+)/);r&&(A(r[1]),z(r[2].replace(/\.git$/,"")))},ae=async()=>{if(!(!l||!P.trim()))try{const a=await n.request("createLabel",{projectId:l.id,name:P.trim(),color:O});E(r=>[...r,a]),U("")}catch{}},pe=async a=>{try{await n.request("deleteLabel",{labelId:a}),E(r=>r.filter(G=>G.id!==a))}catch{}};if(C)return e.jsxs(e.Fragment,{children:[e.jsx(te,{}),e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsx("div",{className:"h-5 w-5 rounded-full border-2 border-[var(--accent-brand)] border-t-transparent animate-spin"})})]});const ge=async()=>{if(!(!c||!l)){b(!0);try{await n.request("updateProject",{orgId:c,projectId:l.id,agent_id:R||null,agent_instructions:F.trim()||null})}catch{}b(!1)}},ve=[{key:"general",label:"General"},...xe?[{key:"agent",label:"AI Agent"}]:[],{key:"labels",label:"Labels"},{key:"github",label:"GitHub"},...me.manageProjectMembers?[{key:"members",label:"Members"}]:[]];return e.jsxs(e.Fragment,{children:[e.jsx(te,{projectName:`${l==null?void 0:l.name} Settings`}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",style:{backgroundColor:"var(--bg-base)"},children:[e.jsx("div",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r p-3",style:{borderColor:"var(--border-subtle)"},children:ve.map(a=>e.jsx("button",{onClick:()=>ce(a.key),className:"rounded-md px-3 py-1.5 text-left text-sm transition-colors duration-100",style:{backgroundColor:h===a.key?"var(--bg-active)":void 0,color:h===a.key?"var(--text-primary)":"var(--text-secondary)"},children:a.label},a.key))}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[h==="general"&&e.jsxs("div",{className:"max-w-lg",children:[e.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:"Project Settings"}),e.jsxs("div",{className:"mt-6 flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Name"}),e.jsx(x,{value:k,onChange:a=>f(a.target.value)})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Description"}),e.jsx(se,{value:y,onChange:a=>p(a.target.value),rows:3,className:"resize-none"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Prefix"}),e.jsx(x,{value:S,disabled:!0,className:"w-24 font-mono opacity-60"}),e.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"Task prefix cannot be changed after creation."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Color"}),e.jsx("div",{className:"flex gap-1.5",children:Ae.map(a=>e.jsx("button",{onClick:()=>s(a),className:Ne("size-6 rounded-md transition-all duration-100",_===a&&"ring-2 ring-[var(--accent-brand)] ring-offset-1 ring-offset-[var(--bg-base)]"),style:{backgroundColor:a}},a))})]}),e.jsx(m,{size:"sm",onClick:ue,disabled:v,className:"self-start",children:v?"Saving...":"Save Changes"})]})]}),h==="agent"&&e.jsxs("div",{className:"max-w-lg",children:[e.jsxs("h2",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:[e.jsx(re,{className:"mr-2 inline size-5"}),"AI Agent"]}),e.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--text-tertiary)"},children:"This project's dedicated AI agent. Created automatically when the project was set up."}),e.jsxs("div",{className:"mt-6 flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Agent"}),R?e.jsxs("div",{className:"flex items-center gap-2 rounded-md border px-3 py-2",style:{borderColor:"var(--ai-border)",backgroundColor:"var(--ai-surface)"},children:[e.jsx(re,{className:"size-4",style:{color:"var(--ai-indicator)"}}),e.jsx("span",{className:"font-mono text-sm",style:{color:"var(--ai-indicator)"},children:R})]}):e.jsx("p",{className:"text-xs",style:{color:"var(--text-tertiary)"},children:"No agent assigned. Create a new project with AI enabled to get a dedicated agent."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Standing Orders (AGENTS.md)"}),e.jsx(se,{value:F,onChange:a=>M(a.target.value),placeholder:"Define the agent's workflow, boundaries, coding standards, tech stack details...",rows:8,className:"resize-none font-mono text-xs"}),e.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"The agent's standing orders. Defines workflow, approval gates, boundaries, and project context. Changes are written to the agent's AGENTS.md file via OpenClaw."})]}),e.jsx(m,{size:"sm",onClick:ge,disabled:v,className:"self-start",children:v?"Saving...":"Save Agent Settings"})]})]}),h==="labels"&&e.jsxs("div",{className:"max-w-lg",children:[e.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:"Labels"}),e.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--text-tertiary)"},children:"Manage project labels for categorizing tasks."}),e.jsxs("div",{className:"mt-6 flex gap-2",children:[e.jsx("div",{className:"flex size-9 items-center justify-center rounded-md border",style:{borderColor:"var(--border-default)"},children:e.jsx("input",{type:"color",value:O,onChange:a=>oe(a.target.value),className:"size-5 cursor-pointer rounded border-none bg-transparent"})}),e.jsx(x,{value:P,onChange:a=>U(a.target.value),placeholder:"Label name",className:"flex-1",onKeyDown:a=>a.key==="Enter"&&ae()}),e.jsxs(m,{size:"sm",onClick:ae,children:[e.jsx(le,{className:"mr-1 size-3.5"}),"Add"]})]}),e.jsxs("div",{className:"mt-4 flex flex-col gap-1",children:[B.map(a=>e.jsxs("div",{className:"flex items-center gap-3 rounded-md px-3 py-2 transition-colors duration-100 hover:bg-[var(--bg-hover)]",children:[e.jsx(we,{name:a.name,color:a.color}),e.jsx("span",{className:"flex-1 text-xs",style:{color:"var(--text-secondary)"},children:a.name}),e.jsx(m,{variant:"ghost",size:"icon-xs",onClick:()=>pe(a.id),children:e.jsx(T,{className:"size-3.5",style:{color:"var(--text-tertiary)"}})})]},a.id)),B.length===0&&e.jsx("p",{className:"py-4 text-xs",style:{color:"var(--text-tertiary)"},children:"No labels yet."})]})]}),h==="github"&&e.jsxs("div",{className:"max-w-lg",children:[e.jsxs("h2",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:[e.jsx(_e,{className:"mr-2 inline size-5"}),"GitHub Repositories"]}),e.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--text-tertiary)"},children:"Connect one or more GitHub repositories. Tasks can create branches across multiple repos."}),(j==null?void 0:j.repos)&&j.repos.length>0&&e.jsx("div",{className:"mt-4 flex flex-col gap-2",children:j.repos.map(a=>e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",style:{borderColor:a.installation_id?"var(--status-done)":"var(--border-default)",backgroundColor:a.installation_id?"color-mix(in srgb, var(--status-done) 5%, transparent)":"var(--bg-surface)"},children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"size-2 rounded-full",style:{backgroundColor:a.installation_id?"var(--status-done)":"var(--text-tertiary)"}}),e.jsxs("span",{className:"text-xs font-medium",style:{color:"var(--text-primary)"},children:[a.repo_owner,"/",a.repo_name]}),e.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:"var(--bg-elevated)",color:"var(--text-secondary)"},children:a.label})]}),e.jsxs("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:["Default branch: ",e.jsx("span",{className:"font-mono",children:a.default_branch}),!a.installation_id&&" · App not installed"]})]}),e.jsx(m,{variant:"ghost",size:"icon-xs",onClick:async()=>{try{await n.request("removeProjectRepo",{projectId:l.id,projectRepoId:a.id}),n.request("getGithubStatus",{projectId:l.id}).then(q).catch(()=>{})}catch{}},children:e.jsx(T,{className:"size-3.5",style:{color:"var(--text-tertiary)"}})})]},a.id))}),e.jsxs("div",{className:"mt-6 flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Repository URL"}),e.jsx(x,{value:o,onChange:a=>he(a.target.value),placeholder:"https://github.com/owner/repo"})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"flex flex-1 flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Owner"}),e.jsx(x,{value:g,onChange:a=>A(a.target.value)})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Repository"}),e.jsx(x,{value:D,onChange:a=>z(a.target.value)})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Label"}),e.jsx(x,{value:H,onChange:a=>$(a.target.value),placeholder:"e.g., api, web, shared"}),e.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"A short label to identify this repo (shown on task cards)."})]}),e.jsxs(m,{size:"sm",onClick:async()=>{if(!(!l||!g||!D)){Q(!0);try{await n.request("addProjectRepo",{projectId:l.id,repoUrl:o,repoOwner:g,repoName:D,label:H.trim()||"default"}),n.request("getGithubStatus",{projectId:l.id}).then(q).catch(()=>{}),i(""),A(""),z(""),$("default")}catch{}Q(!1)}},disabled:K||!g||!D,className:"self-start",children:[e.jsx(le,{className:"mr-1.5 size-3.5"}),K?"Adding...":"Add Repository"]})]}),e.jsxs("div",{className:"mt-6 border-t pt-6",style:{borderColor:"var(--border-subtle)"},children:[e.jsx("h3",{className:"text-sm font-semibold",style:{color:"var(--text-primary)"},children:"Deployment"}),e.jsx("p",{className:"mt-1 text-[11px]",style:{color:"var(--text-tertiary)"},children:"Enable deploy columns on the board. Dragging a task to Deploy to Dev merges its branch into your dev branch. Deploy to Prod merges into your prod branch."}),e.jsxs("div",{className:"mt-4 flex flex-col gap-4",children:[e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:I,onChange:a=>X(a.target.checked),className:"size-4 rounded border accent-[var(--accent-brand)]"}),e.jsx("span",{className:"text-xs",style:{color:"var(--text-primary)"},children:"Enable Deploy to Dev / Deploy to Prod columns"})]}),I&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"flex flex-1 flex-col gap-1.5",children:[e.jsx("label",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"Dev Branch"}),e.jsx(x,{value:Y,onChange:a=>Z(a.target.value),placeholder:"dev",className:"font-mono"})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-1.5",children:[e.jsx("label",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"Prod Branch"}),e.jsx(x,{value:J,onChange:a=>V(a.target.value),placeholder:"main",className:"font-mono"})]})]}),e.jsx("p",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:"Task branches will be merged into these branches when dragged to the deploy columns."}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:W,onChange:a=>ee(a.target.checked),className:"size-4 rounded border accent-[var(--accent-brand)]"}),e.jsx("span",{className:"text-xs",style:{color:"var(--text-primary)"},children:"Auto-delete task branch after prod deploy"})]})]}),e.jsx(m,{size:"sm",onClick:async()=>{if(!(!c||!l)){b(!0);try{await n.request("updateProject",{orgId:c,projectId:l.id,github_deploy_enabled:I,github_dev_branch:Y.trim()||null,github_prod_branch:J.trim()||null,github_auto_delete_branches:W})}catch{}b(!1)}},disabled:v,className:"self-start",children:v?"Saving...":"Save Deploy Settings"})]})]})]}),h==="members"&&e.jsx(De,{projectId:l==null?void 0:l.id,projectMembers:ie,setProjectMembers:de})]})]})]})}function De({projectId:d,projectMembers:u,setProjectMembers:c}){const[l,N]=t.useState(""),[C,w]=t.useState("member"),[k,f]=t.useState(!1),[y,p]=t.useState("");t.useEffect(()=>{d&&n.request("getProjectMembers",{projectId:d}).then(c).catch(()=>{})},[d,c]);const S=async()=>{if(!(!d||!l.trim())){f(!0),p("");try{const s=await n.request("addProjectMember",{projectId:d,email:l.trim(),role:C});c([...u,s]),N("")}catch(s){p(s.message||"Failed to add member")}f(!1)}},L=async s=>{if(!(!d||!confirm("Remove this member from the project?")))try{await n.request("removeProjectMember",{projectId:d,userId:s}),c(u.filter(o=>o.user_id!==s))}catch(o){alert(o.message||"Failed to remove")}},_=async(s,o)=>{if(d)try{await n.request("updateProjectMemberRole",{projectId:d,userId:s,role:o}),c(u.map(i=>i.user_id===s?{...i,role:o}:i))}catch(i){alert(i.message||"Failed to update role")}};return e.jsxs("div",{className:"max-w-lg",children:[e.jsxs("h2",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:[e.jsx(ke,{className:"mr-2 inline size-5"}),"Project Members"]}),e.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--text-tertiary)"},children:"Manage who has access to this project and their roles."}),e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{value:l,onChange:s=>{N(s.target.value),p("")},placeholder:"Email address",type:"email",className:"flex-1",onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),S())}}),e.jsxs("select",{value:C,onChange:s=>w(s.target.value),className:"rounded-md border px-2 text-sm",style:{backgroundColor:"var(--bg-input, var(--bg-surface))",borderColor:"var(--border-default)",color:"var(--text-primary)"},children:[e.jsx("option",{value:"member",children:"Member"}),e.jsx("option",{value:"project_lead",children:"Lead"})]}),e.jsx(m,{size:"sm",onClick:S,disabled:k||!l.trim(),children:"Add"})]}),y&&e.jsx("p",{className:"mt-1.5 text-xs",style:{color:"var(--priority-urgent)"},children:y}),e.jsx("p",{className:"mt-1 text-[11px]",style:{color:"var(--text-tertiary)"},children:"Auto-adds to workspace if not already a member."})]}),e.jsxs("div",{className:"mt-4 flex flex-col gap-1",children:[u.map(s=>{const o=s.profiles||{},i=s.role==="project_lead"||s.role==="lead";return e.jsxs("div",{className:"flex items-center gap-3 rounded-md px-3 py-2 transition-colors duration-100 hover:bg-[var(--bg-hover)]",children:[e.jsx(Ce,{name:o.full_name||o.email,avatarUrl:o.avatar_url,size:"sm"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"truncate text-sm",style:{color:"var(--text-primary)"},children:o.full_name||o.email||"Unknown"}),e.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:o.email})]}),e.jsxs("select",{value:s.role,onChange:g=>_(s.user_id,g.target.value),className:"rounded border px-2 py-0.5 text-[10px] font-medium uppercase",style:{backgroundColor:i?"color-mix(in srgb, var(--accent-brand) 10%, transparent)":"var(--bg-active)",borderColor:i?"var(--accent-brand)":"var(--border-default)",color:i?"var(--accent-brand)":"var(--text-secondary)"},children:[e.jsx("option",{value:"member",children:"Member"}),e.jsx("option",{value:"project_lead",children:"Lead"})]}),e.jsx(m,{variant:"ghost",size:"icon-xs",onClick:()=>L(s.user_id),children:e.jsx(T,{className:"size-3.5",style:{color:"var(--text-tertiary)"}})})]},s.id||s.user_id)}),u.length===0&&e.jsx("p",{className:"py-4 text-xs",style:{color:"var(--text-tertiary)"},children:"No members yet. Add people by email."})]})]})}export{Re as default};
@@ -0,0 +1 @@
1
+ import{aL as x,b3 as u,r as l,j as e,_ as p,a0 as h}from"./index-DXrrw_d3.js";import{R as f}from"./refresh-cw-DPxC49W6.js";function v(){const{currentOrgId:s}=x(),o=u(t=>t.openclawConnected),a=u(t=>t.status),[n,c]=l.useState(null),[y,d]=l.useState(!0),i=()=>{s&&(d(!0),h.request("adminHealth",{orgId:s}).then(c).catch(()=>c(null)).finally(()=>d(!1)))};l.useEffect(()=>{i()},[s]);const m=[{label:"Backend WebSocket",status:a==="connected"?"healthy":"degraded",detail:a==="connected"?"Connected":a},{label:"OpenClaw Gateway",status:o?"healthy":"down",detail:o?"Connected (ws://127.0.0.1:18789)":"Disconnected"},{label:"Supabase",status:"healthy",detail:"Connected (service role)"}],r=t=>t==="healthy"?"var(--status-done)":t==="degraded"?"var(--priority-medium)":"var(--priority-urgent)";return e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold",style:{color:"var(--text-primary)"},children:"System Health"}),e.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--text-tertiary)"},children:"Monitor infrastructure components."})]}),e.jsxs(p,{variant:"ghost",size:"sm",onClick:i,className:"gap-1.5",children:[e.jsx(f,{className:"size-3.5"})," Refresh"]})]}),e.jsx("div",{className:"mt-6 flex flex-col gap-3",children:m.map(t=>e.jsxs("div",{className:"flex items-center gap-4 rounded-lg border p-4",style:{borderColor:"var(--border-default)",backgroundColor:"var(--bg-surface)"},children:[e.jsx("span",{className:"size-2.5 rounded-full",style:{backgroundColor:r(t.status)}}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-primary)"},children:t.label}),e.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:t.detail})]}),e.jsx("span",{className:"rounded-full px-2 py-0.5 text-[10px] font-medium uppercase",style:{backgroundColor:`color-mix(in srgb, ${r(t.status)} 12%, transparent)`,color:r(t.status)},children:t.status})]},t.label))}),n&&e.jsxs("div",{className:"mt-8",children:[e.jsx("h2",{className:"text-sm font-semibold",style:{color:"var(--text-primary)"},children:"Gateway Details"}),e.jsx("pre",{className:"mt-3 max-h-[300px] overflow-auto rounded-lg border p-4 font-mono text-xs leading-relaxed",style:{borderColor:"var(--border-default)",backgroundColor:"var(--bg-surface)",color:"var(--text-secondary)"},children:JSON.stringify(n,null,2)})]})]})}export{v as default};
@@ -0,0 +1 @@
1
+ import{aL as F,b3 as L,r as l,a0 as o,j as e,b4 as O,aV as T,Y as B,_ as f,aQ as K,Z as H}from"./index-DXrrw_d3.js";import{U as Q}from"./users-DP3a-Wwz.js";import{C as V}from"./chevron-right-BnCRLuSC.js";import{T as w}from"./trash-2-DG-hxPmD.js";import{U as Y}from"./user-plus-DPBDxgC3.js";function I(){const{currentOrgId:n}=F();L(r=>r.openclawConnected);const[b,p]=l.useState([]),[Z,_]=l.useState([]),[z,y]=l.useState(!0),[u,h]=l.useState(null),[j,i]=l.useState({}),[m,v]=l.useState(""),[N,M]=l.useState("member"),[S,C]=l.useState(!1),[P,x]=l.useState("");l.useEffect(()=>{if(!n)return;y(!0);const r=o.request("getProjects",{orgId:n}).then(s=>{p(s||[])}).catch(s=>{console.error("[admin/projects] getProjects failed:",s)}),a=o.request("getOrgMembers",{orgId:n}).then(s=>{_(s||[])}).catch(s=>{console.error("[admin/projects] getOrgMembers failed:",s)});Promise.all([r,a]).finally(()=>y(!1))},[n]);const A=async r=>{try{const a=await o.request("getProjectMembers",{projectId:r});i(s=>({...s,[r]:a||[]}))}catch{i(a=>({...a,[r]:[]}))}},E=r=>{u===r?h(null):(h(r),j[r]||A(r)),v(""),M("member"),x("")},R=async(r,a)=>{if(n&&confirm(`Delete project "${a}"? This cannot be undone.`))try{await o.request("deleteProject",{orgId:n,projectId:r}),p(b.filter(s=>s.id!==r)),u===r&&h(null)}catch(s){alert(s.message||"Failed to delete project")}},k=async r=>{if(m.trim()){C(!0),x("");try{const a=await o.request("addProjectMember",{projectId:r,email:m.trim(),role:N});i(s=>({...s,[r]:[...s[r]||[],a]})),v("")}catch(a){x(a.message||"Failed to add member")}C(!1)}},q=async(r,a)=>{if(confirm("Remove this member from the project?"))try{await o.request("removeProjectMember",{projectId:r,userId:a}),i(s=>({...s,[r]:(s[r]||[]).filter(t=>t.user_id!==a)}))}catch(s){alert(s.message||"Failed to remove member")}},U=async(r,a,s)=>{try{await o.request("updateProjectMemberRole",{projectId:r,userId:a,role:s}),i(t=>({...t,[r]:(t[r]||[]).map(c=>c.user_id===a?{...c,role:s}:c)}))}catch(t){alert(t.message||"Failed to change role")}};return z?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsx("div",{className:"size-5 rounded-full border-2 border-[var(--accent-brand)] border-t-transparent animate-spin"})}):e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold",style:{color:"var(--text-primary)"},children:"Projects"}),e.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--text-tertiary)"},children:"Manage projects, their teams, and AI agent assignments."})]})}),e.jsx("div",{className:"mt-6 flex flex-col gap-3",children:b.length===0?e.jsxs("div",{className:"rounded-lg border p-8 text-center",style:{borderColor:"var(--border-default)"},children:[e.jsx(O,{className:"mx-auto size-10",style:{color:"var(--text-tertiary)"}}),e.jsx("p",{className:"mt-3 text-sm",style:{color:"var(--text-secondary)"},children:"No projects yet"})]}):b.map(r=>{const a=u===r.id,s=j[r.id]||[];return e.jsxs("div",{className:"rounded-lg border transition-colors",style:{borderColor:a?"var(--accent-brand)":"var(--border-default)",backgroundColor:"var(--bg-surface)"},children:[e.jsxs("div",{className:"flex items-center gap-3 p-4",children:[e.jsxs("button",{onClick:()=>E(r.id),className:"flex flex-1 items-center gap-3 text-left",children:[e.jsx(T,{className:"size-4 shrink-0",style:{color:r.color||"var(--text-tertiary)"}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-primary)"},children:r.name}),e.jsx("span",{className:"rounded px-1.5 py-0.5 font-mono text-[10px]",style:{backgroundColor:"var(--bg-active)",color:"var(--text-tertiary)"},children:r.prefix})]}),e.jsxs("div",{className:"mt-0.5 flex items-center gap-3 text-[11px]",style:{color:"var(--text-tertiary)"},children:[r.agent_id&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(B,{className:"size-3",style:{color:"var(--ai-indicator)"}}),r.agent_id]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Q,{className:"size-3"}),s.length||"..."," members"]})]})]}),e.jsx(V,{className:"size-4 shrink-0 transition-transform duration-150",style:{color:"var(--text-tertiary)",transform:a?"rotate(90deg)":"rotate(0deg)"}})]}),e.jsx(f,{variant:"ghost",size:"icon-xs",onClick:()=>R(r.id,r.name),title:"Delete project",children:e.jsx(w,{className:"size-3.5",style:{color:"var(--priority-urgent)"}})})]}),a&&e.jsxs("div",{className:"border-t px-4 py-4",style:{borderColor:"var(--border-subtle)"},children:[e.jsx("div",{className:"flex items-center justify-between mb-3",children:e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Team Members"})}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(K,{value:m,onChange:t=>{v(t.target.value),x("")},placeholder:"Email address",type:"email",className:"flex-1",onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),k(r.id))}}),e.jsxs("select",{value:N,onChange:t=>M(t.target.value),className:"rounded-md border px-2 text-xs",style:{backgroundColor:"var(--bg-input, var(--bg-base))",borderColor:"var(--border-default)",color:"var(--text-primary)"},children:[e.jsx("option",{value:"member",children:"Member"}),e.jsx("option",{value:"project_lead",children:"Lead"})]}),e.jsxs(f,{size:"sm",onClick:()=>k(r.id),disabled:S||!m.trim(),className:"gap-1",children:[e.jsx(Y,{className:"size-3"})," Add"]})]}),P&&e.jsx("p",{className:"mt-1.5 text-xs",style:{color:"var(--priority-urgent)"},children:P}),e.jsx("p",{className:"mt-1 text-[11px]",style:{color:"var(--text-tertiary)"},children:"Auto-adds to workspace if not already a member."})]}),s.length===0?e.jsx("p",{className:"py-3 text-xs",style:{color:"var(--text-tertiary)"},children:"No members assigned. Add workspace members to this project."}):e.jsx("div",{className:"rounded-md border",style:{borderColor:"var(--border-subtle)"},children:s.map((t,c)=>{const d=t.profiles||{},g=t.role==="project_lead"||t.role==="lead";return e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 transition-colors hover:bg-[var(--bg-hover)]",style:{borderBottom:c<s.length-1?"1px solid var(--border-subtle)":void 0},children:[e.jsx(H,{name:d.full_name||d.email,avatarUrl:d.avatar_url,size:"sm"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("p",{className:"truncate text-sm",style:{color:"var(--text-primary)"},children:d.full_name||d.email||"Unknown"})}),e.jsxs("select",{value:t.role,onChange:D=>U(r.id,t.user_id,D.target.value),className:"rounded border px-2 py-0.5 text-[10px] font-medium uppercase",style:{backgroundColor:g?"color-mix(in srgb, var(--accent-brand) 10%, transparent)":"var(--bg-active)",borderColor:g?"var(--accent-brand)":"var(--border-default)",color:g?"var(--accent-brand)":"var(--text-secondary)"},children:[e.jsx("option",{value:"member",children:"Member"}),e.jsx("option",{value:"project_lead",children:"Lead"})]}),e.jsx(f,{variant:"ghost",size:"icon-xs",onClick:()=>q(r.id,t.user_id),children:e.jsx(w,{className:"size-3",style:{color:"var(--text-tertiary)"}})})]},t.id||t.user_id)})})]})]},r.id)})})]})}export{I as default};
@@ -0,0 +1,6 @@
1
+ import{c as o}from"./index-DXrrw_d3.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const t=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],e=o("chevron-right",t);export{e as C};
@@ -0,0 +1,11 @@
1
+ import{c}from"./index-DXrrw_d3.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],i=c("circle-check",e);/**
7
+ * @license lucide-react v0.577.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const r=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],a=c("circle-x",r);export{i as C,a};
@@ -0,0 +1,6 @@
1
+ import{c}from"./index-DXrrw_d3.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const o=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],r=c("clock",o);export{r as C};
@@ -0,0 +1 @@
1
+ import{j as t,_ as i}from"./index-DXrrw_d3.js";function l({message:r,actionLabel:e,onAction:s}){return t.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-16",children:[t.jsx("p",{style:{color:"var(--text-tertiary)"},className:"text-sm",children:r}),e&&s&&t.jsx(i,{variant:"outline",size:"sm",onClick:s,children:e})]})}export{l as E};