tower-studio 0.1.12 → 0.1.14

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 (168) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/cache/.previewinfo +1 -1
  4. package/.next/cache/.rscinfo +1 -1
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/diagnostics/route-bundle-stats.json +37 -37
  7. package/.next/fallback-build-manifest.json +3 -3
  8. package/.next/prerender-manifest.json +3 -3
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
  17. package/.next/server/app/_not-found/page/server-reference-manifest.json +25 -25
  18. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  19. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/_not-found.html +1 -1
  21. package/.next/server/app/_not-found.rsc +13 -13
  22. package/.next/server/app/_not-found.segments/_full.segment.rsc +13 -13
  23. package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  24. package/.next/server/app/_not-found.segments/_index.segment.rsc +8 -8
  25. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  26. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  27. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  28. package/.next/server/app/index.html +1 -1
  29. package/.next/server/app/index.rsc +13 -13
  30. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  31. package/.next/server/app/index.segments/_full.segment.rsc +13 -13
  32. package/.next/server/app/index.segments/_head.segment.rsc +4 -4
  33. package/.next/server/app/index.segments/_index.segment.rsc +8 -8
  34. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  35. package/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  36. package/.next/server/app/missions/page/server-reference-manifest.json +51 -51
  37. package/.next/server/app/missions/page.js.nft.json +1 -1
  38. package/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  40. package/.next/server/app/onboarding/page/server-reference-manifest.json +25 -25
  41. package/.next/server/app/onboarding/page.js.nft.json +1 -1
  42. package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  43. package/.next/server/app/onboarding.html +1 -1
  44. package/.next/server/app/onboarding.rsc +15 -15
  45. package/.next/server/app/onboarding.segments/_full.segment.rsc +15 -15
  46. package/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
  47. package/.next/server/app/onboarding.segments/_index.segment.rsc +8 -8
  48. package/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
  49. package/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  50. package/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
  51. package/.next/server/app/page/react-loadable-manifest.json +1 -1
  52. package/.next/server/app/page/server-reference-manifest.json +25 -25
  53. package/.next/server/app/page.js.nft.json +1 -1
  54. package/.next/server/app/page_client-reference-manifest.js +1 -1
  55. package/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  56. package/.next/server/app/settings/page/server-reference-manifest.json +34 -34
  57. package/.next/server/app/settings/page.js.nft.json +1 -1
  58. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  59. package/.next/server/app/settings.html +1 -1
  60. package/.next/server/app/settings.rsc +15 -15
  61. package/.next/server/app/settings.segments/_full.segment.rsc +15 -15
  62. package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  63. package/.next/server/app/settings.segments/_index.segment.rsc +8 -8
  64. package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  65. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  66. package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  67. package/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  68. package/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +75 -75
  69. package/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  70. package/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  71. package/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  72. package/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +66 -66
  73. package/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  74. package/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  75. package/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  76. package/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +55 -55
  77. package/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  78. package/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  79. package/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  80. package/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +53 -53
  81. package/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  82. package/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  83. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  84. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +25 -25
  85. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  86. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  87. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +1 -1
  88. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +54 -54
  89. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  90. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  91. package/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  92. package/.next/server/app/workspaces/page/server-reference-manifest.json +41 -41
  93. package/.next/server/app/workspaces/page.js.nft.json +1 -1
  94. package/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  95. package/.next/server/chunks/0uz~_next_dist_esm_build_templates_app-route_05yec2y.js +2 -2
  96. package/.next/server/chunks/[root-of-the-server]__0~33o~m._.js +2 -2
  97. package/.next/server/chunks/project_f_tower_0n1s3ym._.js +1 -1
  98. package/.next/server/chunks/project_f_tower_src_11e.cv5._.js +1 -1
  99. package/.next/server/chunks/ssr/04uy_src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_01.s1p0._.js +1 -1
  100. package/.next/server/chunks/ssr/0y0r_f_tower_src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0n4g3bn._.js +1 -1
  101. package/.next/server/chunks/ssr/[root-of-the-server]__0.4j53v._.js +3 -0
  102. package/.next/server/chunks/ssr/[root-of-the-server]__06qzctf._.js +1 -1
  103. package/.next/server/chunks/ssr/[root-of-the-server]__09bcer6._.js +3 -0
  104. package/.next/server/chunks/ssr/[root-of-the-server]__0ffdrwp._.js +1 -1
  105. package/.next/server/chunks/ssr/[root-of-the-server]__0fwuc5u._.js +1 -1
  106. package/.next/server/chunks/ssr/{[root-of-the-server]__0p~~40h._.js → [root-of-the-server]__0gpx.d~._.js} +2 -2
  107. package/.next/server/chunks/ssr/[root-of-the-server]__0i4rk9v._.js +3 -3
  108. package/.next/server/chunks/ssr/[root-of-the-server]__0nmyvwk._.js +1 -1
  109. package/.next/server/chunks/ssr/[root-of-the-server]__0w7gbe7._.js +1 -1
  110. package/.next/server/chunks/ssr/[root-of-the-server]__11j4k9o._.js +1 -1
  111. package/.next/server/chunks/ssr/[root-of-the-server]__13cjs8r._.js +1 -1
  112. package/.next/server/chunks/ssr/[root-of-the-server]__13eo85g._.js +1 -1
  113. package/.next/server/chunks/ssr/project_f_tower_0.txwd8._.js +1 -1
  114. package/.next/server/chunks/ssr/project_f_tower_01tnhbx._.js +3 -0
  115. package/.next/server/chunks/ssr/{project_f_tower_0.k8r5w._.js → project_f_tower_0760i8j._.js} +2 -2
  116. package/.next/server/chunks/ssr/{project_f_tower_0t0smg9._.js → project_f_tower_08mqp19._.js} +2 -2
  117. package/.next/server/chunks/ssr/{project_f_tower_0c6n7oo._.js → project_f_tower_0ddfsyt._.js} +2 -2
  118. package/.next/server/chunks/ssr/project_f_tower_0f0-wva._.js +1 -1
  119. package/.next/server/chunks/ssr/project_f_tower_0hgtev9._.js +1 -1
  120. package/.next/server/chunks/ssr/project_f_tower_0ivvjwd._.js +1 -1
  121. package/.next/server/chunks/ssr/project_f_tower_0jy~1uf._.js +1 -1
  122. package/.next/server/chunks/ssr/project_f_tower_0l6ssf8._.js +1 -1
  123. package/.next/server/chunks/ssr/project_f_tower_0o5.y1e._.js +1 -1
  124. package/.next/server/chunks/ssr/{project_f_tower_0ron~f-._.js → project_f_tower_0pf464l._.js} +2 -2
  125. package/.next/server/chunks/ssr/{project_f_tower_0ifpw8k._.js → project_f_tower_0sy7ynr._.js} +2 -2
  126. package/.next/server/chunks/ssr/project_f_tower_0ym-aea._.js +1 -1
  127. package/.next/server/chunks/ssr/{project_f_tower_src_0_g15e8._.js → project_f_tower_src_0bqbs-1._.js} +2 -2
  128. package/.next/server/chunks/ssr/project_f_tower_src_actions_agent-actions_ts_0.s4~m-._.js +2 -2
  129. package/.next/server/chunks/ssr/project_f_tower_src_actions_file-actions_ts_02i742t._.js +1 -1
  130. package/.next/server/chunks/ssr/project_f_tower_src_app_missions_missions-client_tsx_0ums4qx._.js +1 -1
  131. package/.next/server/chunks/ssr/project_f_tower_src_app_onboarding_page_tsx_0_9_yoq._.js +1 -1
  132. package/.next/server/chunks/ssr/project_f_tower_src_app_settings_page_tsx_0oo06~d._.js +1 -1
  133. package/.next/server/chunks/ssr/project_f_tower_src_app_workspaces_[workspaceId]_board-page-client_tsx_0jmj1xz._.js +1 -1
  134. package/.next/server/middleware-build-manifest.js +3 -3
  135. package/.next/server/pages/404.html +1 -1
  136. package/.next/server/pages/500.html +1 -1
  137. package/.next/server/server-reference-manifest.js +1 -1
  138. package/.next/server/server-reference-manifest.json +217 -217
  139. package/.next/static/chunks/{0im8~yii0.2mn.js → 08gl4lr7zkm6b.js} +1 -1
  140. package/.next/static/chunks/0brwcgj_cjdcc.js +1 -0
  141. package/.next/static/chunks/{0vs5vey5ni44t.js → 0q40u78uovc7y.js} +1 -1
  142. package/.next/static/chunks/{00atyrg-7i0hj.js → 0qnvx~5op5b9e.js} +1 -1
  143. package/.next/static/chunks/{0-plp~pgpcel9.js → 0w90t_ngr5_pj.js} +1 -1
  144. package/.next/static/chunks/{0d.3wv6u.2g~6.js → 0x-v4tzitjxub.js} +1 -1
  145. package/.next/static/chunks/{01mymnegugktp.js → 0z-6e_hc3z22b.js} +1 -1
  146. package/.next/static/chunks/{0c49o.5w_cw8_.js → 0z2rpkmoqlr-v.js} +1 -1
  147. package/.next/static/chunks/11gkyogd_hqv~.js +1 -0
  148. package/.next/static/chunks/{09hs9w6-77im2.js → 11y3rfp3d4n.0.js} +1 -1
  149. package/.next/static/chunks/12.91avyb6b7-.js +1 -0
  150. package/.next/static/chunks/12btaaeo1ik-t.js +1 -0
  151. package/.next/static/chunks/{0qp~1_kfjklfg.js → 14zxctn8~z26r.js} +1 -1
  152. package/.next/static/chunks/{09p7-kr_vidww.js → 1660q32oalq26.js} +2 -2
  153. package/.next/static/chunks/{0.do_z22ngnjd.js → 17ckwfwqtxcv7.js} +1 -1
  154. package/.next/trace +2 -2
  155. package/.next/trace-build +1 -1
  156. package/bin/tower.mjs +38 -1
  157. package/package.json +1 -1
  158. package/scripts/init-db.ts +17 -0
  159. package/.next/server/chunks/ssr/[root-of-the-server]__08meal1._.js +0 -3
  160. package/.next/server/chunks/ssr/[root-of-the-server]__0la.lch._.js +0 -3
  161. package/.next/server/chunks/ssr/project_f_tower_0dfyjgz._.js +0 -3
  162. package/.next/static/chunks/09hxu-k8oyivu.js +0 -1
  163. package/.next/static/chunks/0kbuf91gryyo2.js +0 -1
  164. package/.next/static/chunks/0p~3m91-t6p91.js +0 -1
  165. package/.next/static/chunks/15zclhqyib88_.js +0 -1
  166. /package/.next/static/{jMxcHfsOSldWKgvAjGnAv → VzTy7iJ2D58ZvnVnTJZJi}/_buildManifest.js +0 -0
  167. /package/.next/static/{jMxcHfsOSldWKgvAjGnAv → VzTy7iJ2D58ZvnVnTJZJi}/_clientMiddlewareManifest.js +0 -0
  168. /package/.next/static/{jMxcHfsOSldWKgvAjGnAv → VzTy7iJ2D58ZvnVnTJZJi}/_ssgManifest.js +0 -0
@@ -1,5 +1,5 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,136924,e=>{"use strict";let t,r,n;var a,s,o,i,l,c,d,u,m,p,f=e.i(432377),h=e.i(85212),x=e.i(309542),g=e.i(466256),v=e.i(863961);let b=(0,v.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var y=e.i(287277),j=e.i(625054);function N({totalTasks:e,runningTasks:t}){let{t:r}=(0,j.useI18n)();return(0,f.jsxs)("div",{className:"grid grid-cols-3 gap-3 px-6 py-4",children:[(0,f.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("div",{className:"rounded-lg bg-sky-500/10 p-2 ring-1 ring-sky-500/20",children:(0,f.jsx)(g.ClipboardList,{className:"h-4 w-4 text-sky-400"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:r("board.overview")}),(0,f.jsx)("p",{className:"text-2xl font-bold font-mono tracking-tight text-foreground",children:e})]})]})}),(0,f.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("div",{className:"rounded-lg bg-primary/10 p-2 ring-1 ring-primary/20",children:(0,f.jsx)(b,{className:"h-4 w-4 text-primary"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:r("board.running")}),(0,f.jsx)("p",{className:"text-2xl font-bold font-mono tracking-tight text-foreground",children:t})]})]})}),(0,f.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("div",{className:"rounded-lg bg-emerald-500/10 p-2 ring-1 ring-emerald-500/20",children:(0,f.jsx)(y.Lightbulb,{className:"h-4 w-4 text-emerald-400"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:r("board.tip")}),(0,f.jsx)("p",{className:"text-xs font-medium text-foreground/80",children:r("board.tipText")})]})]})})]})}var w=e.i(780156),k=e.i(677436),C=e.i(711296);function S({searchQuery:e,onSearchChange:t,onCreateTask:r}){let{t:n}=(0,j.useI18n)();return(0,f.jsxs)("div",{className:"flex items-center gap-2 px-6 py-2",children:[(0,f.jsxs)("div",{className:"relative flex-1 max-w-xs",children:[(0,f.jsx)(k.Search,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,f.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),placeholder:n("board.searchPlaceholder"),className:"h-8 w-full rounded-lg border border-border bg-background pl-8 pr-3 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary"})]}),(0,f.jsxs)(C.Button,{"data-tour":"create-task",variant:"outline",className:"ml-auto gap-1.5 border-border text-xs text-muted-foreground hover:border-primary/30 hover:text-primary",onClick:r,children:[(0,f.jsx)(w.Plus,{className:"h-3.5 w-3.5"}),n("board.newTask")]})]})}var E=e.i(9235),R=e.i(893832),I=e.i(787207);function P({x:e,y:t,taskId:r,currentStatus:n,hasExecutions:a,workspaceId:s,onClose:o,onStatusChange:i,onLaunch:l}){let{t:c}=(0,j.useI18n)(),d=(0,x.useRouter)(),u=(0,h.useRef)(null);(0,h.useEffect)(()=>{let e=e=>{u.current&&!u.current.contains(e.target)&&o()},t=e=>{"Escape"===e.key&&o()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[o]);let m="flex items-center px-3 py-1.5 text-xs cursor-pointer hover:bg-accent rounded-sm w-full text-left",p=(0,f.jsxs)("div",{ref:u,style:{position:"fixed",top:t,left:e,zIndex:9999},className:"bg-popover border border-border rounded-md shadow-md py-1 min-w-[180px]",children:[(0,f.jsx)("div",{className:"px-3 py-1 text-[10px] text-muted-foreground uppercase tracking-wider",children:c("board.contextMenu.changeStatus")}),I.BOARD_COLUMNS.map(e=>(0,f.jsxs)("button",{type:"button",className:m,onClick:()=>{i(r,e.id),o()},children:[n===e.id?(0,f.jsx)(R.Check,{className:"h-3 w-3 mr-2 flex-shrink-0"}):(0,f.jsx)("span",{className:"w-5 flex-shrink-0"}),e.label]},e.id)),(0,f.jsx)("hr",{className:"my-1 border-border"}),(0,f.jsx)("button",{type:"button",className:`${m} ${a?"opacity-50 cursor-not-allowed":""}`,disabled:a,onClick:()=>{a||(l(r),o())},children:c("board.contextMenu.launch")}),"DONE"!==n&&"CANCELLED"!==n&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("hr",{className:"my-1 border-border"}),(0,f.jsx)("button",{type:"button",className:m,onClick:()=>{d.push(`/workspaces/${s}/tasks/${r}`),o()},children:c("board.contextMenu.goToDetail")})]})]});return"u"<typeof document?null:(0,E.createPortal)(p,document.body)}var T=e.i(139302),O=e.i(254059);let D=(0,v.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var M=e.i(280121),A=e.i(746357),L=e.i(923344),F=e.i(909260);let B=(0,v.default)("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);var $=e.i(203529),_=e.i(942252);function z({task:e,onClick:t,onEdit:r,onDelete:n,onTogglePin:a,onContextMenu:s}){let{t:o}=(0,j.useI18n)(),{attributes:i,listeners:l,setNodeRef:c,transform:d,transition:u,isDragging:m}=(0,O.useSortable)({id:e.id,data:{type:"task",task:e}}),p={transform:M.CSS.Transform.toString(d),transition:u,opacity:m?.4:1},h=I.PRIORITY_CONFIG[e.priority];return(0,f.jsxs)("div",{ref:c,style:p,...i,...l,className:"group cursor-grab rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50 active:cursor-grabbing",onClick:t,onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),s?.(e,t.clientX,t.clientY)},"data-testid":"task-card",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between",children:[(0,f.jsx)("h4",{className:"text-sm font-medium text-foreground",children:e.title}),(0,f.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",className:`transition-all ${e.pinned?"text-primary opacity-100":"text-muted-foreground opacity-0 group-hover:opacity-100"}`,onClick:t=>{t.stopPropagation(),a?.(e.id)},"aria-label":o(e.pinned?"board.unpin":"board.pin"),children:(0,f.jsx)(B,{className:`h-3.5 w-3.5 ${e.pinned?"-rotate-45":""}`})}),(0,f.jsxs)(_.DropdownMenu,{children:[(0,f.jsx)(_.DropdownMenuTrigger,{render:(0,f.jsx)("button",{className:"rounded-md p-0.5 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:e=>e.stopPropagation()}),children:(0,f.jsx)(A.MoreHorizontal,{className:"h-4 w-4"})}),(0,f.jsxs)(_.DropdownMenuContent,{align:"end",children:[(0,f.jsxs)(_.DropdownMenuItem,{onClick:t=>{t.stopPropagation(),r?.(e)},children:[(0,f.jsx)(L.Pencil,{className:"mr-2 h-3.5 w-3.5"}),o("common.edit")]}),(0,f.jsxs)(_.DropdownMenuItem,{className:"text-rose-400",onClick:t=>{t.stopPropagation(),n?.(e.id)},children:[(0,f.jsx)(F.Trash2,{className:"mr-2 h-3.5 w-3.5"}),o("common.delete")]})]})]})]})]}),e.description&&(0,f.jsx)("p",{className:"mt-1.5 line-clamp-3 text-xs leading-relaxed text-muted-foreground",children:e.description}),(0,f.jsx)("div",{className:"mt-2.5",children:(0,f.jsx)($.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${h.color}`,children:h.label})}),e.labels&&e.labels.length>0&&(0,f.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e.labels.map(e=>(0,f.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:e.label.color+"20",color:e.label.color},children:e.label.name},e.label.id))})]})}var U=e.i(718837),W=e.i(142124);function H({open:e,onOpenChange:t,columnLabel:r,columnColor:n,tasks:a,onTaskClick:s}){let{t:o}=(0,j.useI18n)();return(0,f.jsx)(U.Dialog,{open:e,onOpenChange:t,children:(0,f.jsxs)(U.DialogContent,{className:"max-w-4xl max-h-[80vh]",children:[(0,f.jsx)(U.DialogHeader,{children:(0,f.jsxs)(U.DialogTitle,{className:"flex items-center gap-2",children:[(0,f.jsx)("div",{className:`h-2.5 w-2.5 rounded-full ${n}`}),(0,f.jsx)("span",{children:r}),(0,f.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-mono font-medium text-muted-foreground",children:a.length})]})}),(0,f.jsx)(W.ScrollArea,{className:"max-h-[calc(80vh-80px)]",children:(0,f.jsxs)("div",{className:"grid grid-cols-3 gap-3 pr-3",children:[a.map(e=>{let r=I.PRIORITY_CONFIG[e.priority];return(0,f.jsxs)("div",{className:"cursor-pointer rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50",onClick:()=>{s?.(e),t(!1)},children:[(0,f.jsx)("h4",{className:"text-sm font-medium text-foreground line-clamp-2",children:e.title}),e.description&&(0,f.jsx)("p",{className:"mt-1.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:e.description}),(0,f.jsxs)("div",{className:"mt-2 flex items-center gap-1.5 flex-wrap",children:[(0,f.jsx)($.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${r.color}`,children:r.label}),e.labels?.map(e=>(0,f.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:e.label.color+"20",color:e.label.color},children:e.label.name},e.label.id))]})]},e.id)}),0===a.length&&(0,f.jsx)("div",{className:"col-span-3 py-8 text-center text-sm text-muted-foreground",children:o("board.noTasks")})]})})]})})}function G({id:e,label:t,color:r,tasks:n,onTaskClick:a,onEditTask:s,onAddTask:o,onDeleteTask:i,onTogglePin:l,onContextMenu:c}){let{setNodeRef:d,isOver:u}=(0,T.useDroppable)({id:e}),[m,p]=(0,h.useState)(!1),{t:x}=(0,j.useI18n)();return(0,f.jsxs)("div",{className:`flex w-0 min-w-[220px] flex-1 flex-col min-h-0 border-r border-border/50 last:border-r-0 transition-colors ${u?"bg-primary/[0.06]":""}`,children:[(0,f.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b border-border/30",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)("div",{className:`h-2 w-2 rounded-full ${r}`}),(0,f.jsx)("span",{className:"text-xs font-semibold tracking-wide text-secondary-foreground",children:t}),(0,f.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-mono font-medium text-muted-foreground",children:n.length})]}),(0,f.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:()=>p(!0),className:"text-muted-foreground","aria-label":x("board.viewAll"),children:(0,f.jsx)(D,{className:"h-3.5 w-3.5"})}),(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:o,className:"text-muted-foreground","aria-label":"add",children:(0,f.jsx)(w.Plus,{className:"h-3.5 w-3.5"})})]})]}),(0,f.jsx)(H,{open:m,onOpenChange:p,columnLabel:t,columnColor:r,tasks:n,onTaskClick:a}),(0,f.jsx)(W.ScrollArea,{className:"flex-1 min-h-0",children:(0,f.jsx)("div",{ref:d,className:"flex flex-col gap-2 p-2",children:(0,f.jsx)(O.SortableContext,{items:n.map(e=>e.id),strategy:O.verticalListSortingStrategy,children:n.map(e=>(0,f.jsx)(z,{task:e,onClick:()=>a?.(e),onEdit:s,onDelete:i,onTogglePin:l,onContextMenu:c},e.id))})})})]})}function V({initialTasks:e,onTaskMove:t,onTaskClick:r,onEditTask:n,onAddTask:a,onDeleteTask:s,onTogglePin:o,onContextMenuStatusChange:i,onContextMenuLaunch:l,workspaceId:c}){let[d,u]=(0,h.useState)(e),[m,p]=(0,h.useState)(null),[x,g]=(0,h.useState)(null);(0,h.useEffect)(()=>{u(e)},[e]);let v=(0,T.useSensors)((0,T.useSensor)(T.PointerSensor,{activationConstraint:{distance:8}})),b=(0,h.useCallback)((e,t,r)=>{g({task:e,x:t,y:r})},[]),y=(0,h.useCallback)(e=>{let t=d.find(t=>t.id===e.active.id);t&&p(t)},[d]),j=(0,h.useCallback)(e=>{let r,{active:n,over:a}=e;if(p(null),!a)return;let s=n.id,o=a.id;if(I.BOARD_COLUMNS.some(e=>e.id===o))r=o;else{let e=d.find(e=>e.id===o);r=e?.status}r&&(u(e=>e.map(e=>e.id===s?{...e,status:r}:e)),t?.(s,r))},[d,t]);return(0,f.jsxs)(T.DndContext,{id:"kanban-board",sensors:v,collisionDetection:T.closestCorners,onDragStart:y,onDragEnd:j,children:[(0,f.jsx)("div",{className:"mx-2 flex h-full overflow-x-auto rounded-xl border border-border bg-card/50",children:I.BOARD_COLUMNS.map(e=>(0,f.jsx)(G,{id:e.id,label:e.label,color:e.color,tasks:d.filter(t=>t.status===e.id),onTaskClick:r,onEditTask:n,onAddTask:()=>a?.(e.id),onDeleteTask:s,onTogglePin:o,onContextMenu:b},e.id))}),(0,f.jsx)(T.DragOverlay,{children:m?(0,f.jsx)("div",{className:"rotate-3 scale-105",children:(0,f.jsx)(z,{task:m})}):null}),x&&(0,f.jsx)(P,{x:x.x,y:x.y,taskId:x.task.id,currentStatus:x.task.status,hasExecutions:(x.task._count?.executions??0)>0,workspaceId:c??"",onClose:()=>g(null),onStatusChange:(e,t)=>{i?.(e,t),g(null)},onLaunch:e=>{l?.(e),g(null)}})]})}var K=e.i(831349),q=e.i(540032),Y=e.i(9433),X=e.i(357334);let Z=(0,v.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s([],493200),e.i(493200);var J=e.i(398285),Q=e.i(959713),ee=e.i(774963),et=e.i(487282),er=e.i(878755),en=e.i(315199),ea=e.i(420072);e.i(129893);var es=e.i(499875);let eo=h.createContext(void 0);function ei(e){let t=h.useContext(eo);if(void 0===t&&!e)throw Error((0,es.default)(47));return t}var el=e.i(978478),ec=e.i(962501),ed=e.i(617406),eu=e.i(524534),em=e.i(292547),ep=e.i(394772),ef=e.i(716310),eh=e.i(673852),ex=e.i(175183);let eg={...ef.popupStoreSelectors,disabled:(0,ec.createSelector)(e=>e.disabled),instantType:(0,ec.createSelector)(e=>e.instantType),openMethod:(0,ec.createSelector)(e=>e.openMethod),openChangeReason:(0,ec.createSelector)(e=>e.openChangeReason),modal:(0,ec.createSelector)(e=>e.modal),stickIfOpen:(0,ec.createSelector)(e=>e.stickIfOpen),titleElementId:(0,ec.createSelector)(e=>e.titleElementId),descriptionElementId:(0,ec.createSelector)(e=>e.descriptionElementId),openOnHover:(0,ec.createSelector)(e=>e.openOnHover),closeDelay:(0,ec.createSelector)(e=>e.closeDelay),hasViewport:(0,ec.createSelector)(e=>e.hasViewport)};class ev extends el.ReactStore{constructor(e){const t={...(0,ef.createInitialPopupStoreState)(),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,...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:h.createRef(),backdropRef:h.createRef(),internalBackdropRef:h.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:h.createRef(),beforeContentFocusGuardRef:h.createRef(),stickIfOpenTimeout:new ed.Timeout,triggerElements:new eh.PopupTriggerMap},eg)}setOpen=(e,t)=>{let r=t.reason===ep.REASONS.triggerHover,n=t.reason===ep.REASONS.triggerPress&&0===t.event.detail,a=!e&&(t.reason===ep.REASONS.escapeKey||null==t.reason);if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let s={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger},o=this.state.floatingRootContext.context.events;o?.emit("openchange",s);let i=()=>{let r={open:e,openChangeReason:t.reason},n=t.trigger?.id??null;(n||e)&&(r.activeTriggerId=n,r.activeTriggerElement=t.trigger??null),this.update(r)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(ex.PATIENT_CLICK_THRESHOLD,()=>{this.set("stickIfOpen",!1)}),E.flushSync(i)):i(),n||a?this.set("instantType",n?"click":"dismiss"):t.reason===ep.REASONS.focusOut?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(e,t){let r=(0,eu.useRefWithInit)(()=>new ev(t)).current,n=e??r;return(0,em.useOnMount)(r.disposeEffect),n}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}var eb=e.i(197167),ey=e.i(120520),ej=e.i(277095);function eN({props:e}){let{children:t,open:r,defaultOpen:n=!1,onOpenChange:a,onOpenChangeComplete:s,modal:o=!1,handle:i,triggerId:l,defaultTriggerId:c=null}=e,d=ev.useStore(i?.store,{modal:o,open:n,openProp:r,activeTriggerId:c,triggerIdProp:l});(0,Q.useOnFirstRender)(()=>{void 0===r&&!1===d.state.open&&!0===n&&d.update({open:!0,activeTriggerId:c})}),d.useControlledProp("openProp",r),d.useControlledProp("triggerIdProp",l);let u=d.useState("open"),m=d.useState("positionerElement"),p=d.useState("payload"),x=d.useState("openChangeReason");d.useContextCallback("onOpenChange",a),d.useContextCallback("onOpenChangeComplete",s);let{openMethod:g,triggerProps:v}=(0,ej.useOpenInteractionType)(u);(0,ey.useImplicitActiveTrigger)(d);let{forceUnmount:b}=(0,ey.useOpenStateTransitions)(u,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});(0,J.useScrollLock)(u&&!0===o&&x!==ep.REASONS.triggerHover&&"touch"!==g,m),h.useEffect(()=>{u||d.context.stickIfOpenTimeout.clear()},[d,u]);let y=h.useCallback(e=>{let t=(0,eb.createChangeEventDetails)(e);return t.preventUnmountOnClose=()=>{d.set("preventUnmountingOnClose",!0)},t},[d]),j=h.useCallback(()=>{d.setOpen(!1,y(ep.REASONS.imperativeAction))},[d,y]);h.useImperativeHandle(e.actionsRef,()=>({unmount:b,close:j}),[b,j]);let N=(0,ea.useSyncedFloatingRootContext)({popupStore:d,onOpenChange:d.setOpen}),w=(0,ee.useDismiss)(N,{outsidePressEvent:{mouse:"trap-focus"===o?"sloppy":"intentional",touch:"sloppy"}}),k=(0,er.useRole)(N),{getReferenceProps:C,getFloatingProps:S,getTriggerProps:E}=(0,et.useInteractions)([w,k]),R=h.useMemo(()=>C(v),[C,v]),I=h.useMemo(()=>E(v),[E,v]),P=h.useMemo(()=>S(),[S]);d.useSyncedValues({modal:o,openMethod:g,activeTriggerProps:R,inactiveTriggerProps:I,popupProps:P,floatingRootContext:N,nested:null!=(0,en.useFloatingParentNodeId)()});let T=h.useMemo(()=>({store:d}),[d]);return(0,f.jsx)(eo.Provider,{value:T,children:"function"==typeof t?t({payload:p}):t})}var ew=e.i(357030),ek=e.i(136391),eC=e.i(801363),eS=e.i(793988),eE=e.i(681866),eR=e.i(705448),eI=e.i(150224),eP=e.i(443667),eT=e.i(916285),eO=e.i(75408),eD=e.i(193905);let eM=h.forwardRef(function(e,t){let{render:r,className:n,disabled:a=!1,nativeButton:s=!0,handle:o,payload:i,openOnHover:l=!1,delay:c=300,closeDelay:d=0,id:u,...m}=e,p=ei(!0),x=o?.store??p?.store;if(!x)throw Error((0,es.default)(74));let g=(0,eP.useBaseUiId)(u),v=x.useState("isTriggerActive",g),b=x.useState("floatingRootContext"),y=x.useState("isOpenedByTrigger",g),j=h.useRef(null),{registerTrigger:N,isMountedByThisTrigger:w}=(0,ey.useTriggerDataForwarding)(g,j,x,{payload:i,disabled:a,openOnHover:l,closeDelay:d}),k=x.useState("openChangeReason"),C=x.useState("stickIfOpen"),S=x.useState("openMethod"),R=(0,eI.useHoverReferenceInteraction)(b,{enabled:null!=b&&l&&("touch"!==S||k!==ep.REASONS.triggerPress),mouseOnly:!0,move:!1,handleClose:(0,eE.safePolygon)(),restMs:c,delay:{close:d},triggerElementRef:j,isActiveTrigger:v}),I=(0,eR.useClick)(b,{enabled:null!=b,stickIfOpen:C}),P=(0,et.useInteractions)([I]),T=x.useState("triggerProps",w),{getButtonProps:O,buttonRef:D}=(0,ek.useButton)({disabled:a,native:s}),M=h.useMemo(()=>({open:e=>e&&k===ep.REASONS.triggerPress?eC.pressableTriggerOpenStateMapping.open(e):eC.triggerOpenStateMapping.open(e)}),[k]),A=(0,eS.useRenderElement)("button",e,{state:{disabled:a,open:y},ref:[D,t,N,j],props:[P.getReferenceProps(),R,T,{[ex.CLICK_TRIGGER_IDENTIFIER]:"",id:g},m,O],stateAttributesMapping:M}),L=h.useRef(null),F=(0,ew.useStableCallback)(e=>{E.flushSync(()=>{x.setOpen(!1,(0,eb.createChangeEventDetails)(ep.REASONS.focusOut,e.nativeEvent,e.currentTarget))});let t=(0,eD.getTabbableBeforeElement)(L.current);t?.focus()}),B=(0,ew.useStableCallback)(e=>{let t=x.select("positionerElement");if(t&&(0,eD.isOutsideEvent)(e,t))x.context.beforeContentFocusGuardRef.current?.focus();else{E.flushSync(()=>{x.setOpen(!1,(0,eb.createChangeEventDetails)(ep.REASONS.focusOut,e.nativeEvent,e.currentTarget))});let r=(0,eD.getTabbableAfterElement)(x.context.triggerFocusTargetRef.current||j.current);for(;null!==r&&(0,eO.contains)(t,r);){let e=r;if((r=(0,eD.getNextTabbable)(r))===e)break}r?.focus()}});return v?(0,f.jsxs)(h.Fragment,{children:[(0,f.jsx)(eT.FocusGuard,{ref:L,onFocus:F}),(0,f.jsx)(h.Fragment,{children:A},g),(0,f.jsx)(eT.FocusGuard,{ref:x.context.triggerFocusTargetRef,onFocus:B})]}):(0,f.jsx)(h.Fragment,{children:A},g)});var eA=e.i(543078);let eL=h.createContext(void 0),eF=h.forwardRef(function(e,t){let{keepMounted:r=!1,...n}=e,{store:a}=ei();return a.useState("mounted")||r?(0,f.jsx)(eL.Provider,{value:r,children:(0,f.jsx)(eA.FloatingPortal,{ref:t,...n})}):null});var eB=e.i(614855),e$=e.i(284060);let e_=h.createContext(void 0);function ez(){let e=h.useContext(e_);if(!e)throw Error((0,es.default)(46));return e}var eU=e.i(520132),eW=e.i(479372),eH=e.i(302062),eG=e.i(134381),eV=e.i(777548);let eK=h.forwardRef(function(e,t){let{render:r,className:n,anchor:a,positionMethod:s="absolute",side:o="bottom",align:i="center",sideOffset:l=0,alignOffset:c=0,collisionBoundary:d="clipping-ancestors",collisionPadding:u=5,arrowPadding:m=5,sticky:p=!1,disableAnchorTracking:x=!1,collisionAvoidance:g=ex.POPUP_COLLISION_AVOIDANCE,...v}=e,{store:b}=ei(),y=function(){let e=h.useContext(eL);if(void 0===e)throw Error((0,es.default)(45));return e}(),j=(0,en.useFloatingNodeId)(),N=b.useState("floatingRootContext"),w=b.useState("mounted"),k=b.useState("open"),C=b.useState("openChangeReason"),S=b.useState("activeTriggerElement"),E=b.useState("modal"),R=b.useState("positionerElement"),I=b.useState("instantType"),P=b.useState("transitionStatus"),T=b.useState("hasViewport"),O=h.useRef(null),D=(0,eH.useAnimationsFinished)(R,!1,!1),M=(0,eU.useAnchorPositioning)({anchor:a,floatingRootContext:N,positionMethod:s,mounted:w,side:o,sideOffset:l,align:i,alignOffset:c,arrowPadding:m,collisionBoundary:d,collisionPadding:u,sticky:p,disableAnchorTracking:x,keepMounted:y,nodeId:j,collisionAvoidance:g,adaptiveOrigin:T?eG.adaptiveOrigin:void 0}),A=h.useMemo(()=>{let e={};return k||(e.pointerEvents="none"),{role:"presentation",hidden:!w,style:{...M.positionerStyles,...e}}},[k,w,M.positionerStyles]),L=h.useMemo(()=>({props:A,...M}),[A,M]),F=N.useState("domReferenceElement");(0,e$.useIsoLayoutEffect)(()=>{let e=O.current;if(F&&(O.current=F),e&&F&&F!==e){b.set("instantType",void 0);let e=new AbortController;return D(()=>{b.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[F,D,b]);let B={open:k,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:I},$=h.useCallback(e=>{b.set("positionerElement",e)},[b]),_=(0,eS.useRenderElement)("div",e,{state:B,props:[L.props,(0,eV.getDisabledMountTransitionStyles)(P),v],ref:[t,$],stateAttributesMapping:eC.popupStateMapping});return(0,f.jsxs)(e_.Provider,{value:L,children:[w&&!0===E&&C!==ep.REASONS.triggerHover&&(0,f.jsx)(eW.InternalBackdrop,{ref:b.context.internalBackdropRef,inert:(0,eB.inertValue)(!k),cutout:S}),(0,f.jsx)(en.FloatingNode,{id:j,children:_})]})});var eq=e.i(447120),eY=e.i(831354),eX=e.i(482833),eZ=e.i(144909),eJ=e.i(412360),eQ=e.i(615111),e0=e.i(804420);let e1=h.createContext(void 0);function e2(e){let{value:t,children:r}=e;return(0,f.jsx)(e1.Provider,{value:t,children:r})}let e5={...eC.popupStateMapping,...eZ.transitionStatusMapping},e3=h.forwardRef(function(e,t){let{className:r,render:n,initialFocus:a,finalFocus:s,...o}=e,{store:i}=ei(),l=ez(),c=null!=(0,e0.useToolbarRootContext)(!0),{context:d,hasClosePart:u}=function(){let[e,t]=h.useState(0),r=(0,ew.useStableCallback)(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:h.useMemo(()=>({register:r}),[r]),hasClosePart:e>0}}(),m=i.useState("open"),p=i.useState("openMethod"),x=i.useState("instantType"),g=i.useState("transitionStatus"),v=i.useState("popupProps"),b=i.useState("titleElementId"),y=i.useState("descriptionElementId"),j=i.useState("modal"),N=i.useState("mounted"),w=i.useState("openChangeReason"),k=i.useState("activeTriggerElement"),C=i.useState("floatingRootContext");(0,eJ.useOpenChangeComplete)({open:m,ref:i.context.popupRef,onComplete(){m&&i.context.onOpenChangeComplete?.(!0)}});let S=i.useState("disabled"),E=i.useState("openOnHover"),R=i.useState("closeDelay");(0,eX.useHoverFloatingInteraction)(C,{enabled:E&&!S,closeDelay:R});let I=void 0===a?function(e){return"touch"!==e||i.context.popupRef.current}:a,P={open:m,side:l.side,align:l.align,instant:x,transitionStatus:g},T=h.useCallback(e=>{i.set("popupElement",e)},[i]),O=(0,eS.useRenderElement)("div",e,{state:P,ref:[t,i.context.popupRef,T],props:[v,{"aria-labelledby":b,"aria-describedby":y,onKeyDown(e){c&&eQ.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()}},(0,eV.getDisabledMountTransitionStyles)(g),o],stateAttributesMapping:e5});return(0,f.jsx)(eY.FloatingFocusManager,{context:C,openInteractionType:p,modal:!1!==j&&u,disabled:!N||w===ep.REASONS.triggerHover,initialFocus:I,returnFocus:s,restoreFocus:"popup",previousFocusableElement:(0,eq.isHTMLElement)(k)?k:void 0,nextFocusableElement:i.context.triggerFocusTargetRef,beforeContentFocusGuardRef:i.context.beforeContentFocusGuardRef,children:(0,f.jsx)(e2,{value:d,children:O})})}),e4=h.forwardRef(function(e,t){let{className:r,render:n,...a}=e,{store:s}=ei(),o=s.useState("open"),{arrowRef:i,side:l,align:c,arrowUncentered:d,arrowStyles:u}=ez();return(0,eS.useRenderElement)("div",e,{state:{open:o,side:l,align:c,uncentered:d},ref:[t,i],props:[{style:u,"aria-hidden":!0},a],stateAttributesMapping:eC.popupStateMapping})}),e8={...eC.popupStateMapping,...eZ.transitionStatusMapping},e9=h.forwardRef(function(e,t){let{className:r,render:n,...a}=e,{store:s}=ei(),o=s.useState("open"),i=s.useState("mounted"),l=s.useState("transitionStatus"),c=s.useState("openChangeReason");return(0,eS.useRenderElement)("div",e,{state:{open:o,transitionStatus:l},ref:[s.context.backdropRef,t],props:[{role:"presentation",hidden:!i,style:{pointerEvents:c===ep.REASONS.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},a],stateAttributesMapping:e8})}),e7=h.forwardRef(function(e,t){let{render:r,className:n,...a}=e,{store:s}=ei(),o=(0,eP.useBaseUiId)(a.id);return(0,e$.useIsoLayoutEffect)(()=>(s.set("titleElementId",o),()=>{s.set("titleElementId",void 0)}),[s,o]),(0,eS.useRenderElement)("h2",e,{ref:t,props:[{id:o},a]})}),e6=h.forwardRef(function(e,t){let{render:r,className:n,...a}=e,{store:s}=ei(),o=(0,eP.useBaseUiId)(a.id);return(0,e$.useIsoLayoutEffect)(()=>(s.set("descriptionElementId",o),()=>{s.set("descriptionElementId",void 0)}),[s,o]),(0,eS.useRenderElement)("p",e,{ref:t,props:[{id:o},a]})}),te=h.forwardRef(function(e,t){let r,{render:n,className:a,disabled:s=!1,nativeButton:o=!0,...i}=e,{buttonRef:l,getButtonProps:c}=(0,ek.useButton)({disabled:s,focusableWhenDisabled:!1,native:o}),{store:d}=ei();return r=h.useContext(e1),(0,e$.useIsoLayoutEffect)(()=>r?.register(),[r]),(0,eS.useRenderElement)("button",e,{ref:[t,l],props:[{onClick(e){d.setOpen(!1,(0,eb.createChangeEventDetails)(ep.REASONS.closePress,e.nativeEvent,e.currentTarget))}},i,c]})}),tt=((a={}).popupWidth="--popup-width",a.popupHeight="--popup-height",a);var tr=e.i(753099);let tn={activationDirection:e=>e?{"data-activation-direction":e}:null},ta=h.forwardRef(function(e,t){let{render:r,className:n,children:a,...s}=e,{store:o}=ei(),{side:i}=ez(),l=o.useState("instantType"),{children:c,state:d}=(0,tr.usePopupViewport)({store:o,side:i,cssVars:tt,children:a}),u={activationDirection:d.activationDirection,transitioning:d.transitioning,instant:l};return(0,eS.useRenderElement)("div",e,{state:u,ref:t,props:[s,{children:c}],stateAttributesMapping:tn})});class ts{constructor(){this.store=new ev}open(e){let t=e?this.store.context.triggerElements.getById(e)??void 0:void 0;if(e&&!t)throw Error((0,es.default)(80,e));this.store.setOpen(!0,(0,eb.createChangeEventDetails)(ep.REASONS.imperativeAction,void 0,t))}close(){this.store.setOpen(!1,(0,eb.createChangeEventDetails)(ep.REASONS.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}e.s(["Arrow",0,e4,"Backdrop",0,e9,"Close",0,te,"Description",0,e6,"Handle",0,ts,"Popup",0,e3,"Portal",0,eF,"Positioner",0,eK,"Root",0,function(e){return ei(!0)?(0,f.jsx)(eN,{props:e}):(0,f.jsx)(en.FloatingTree,{children:(0,f.jsx)(eN,{props:e})})},"Title",0,e7,"Trigger",0,eM,"Viewport",0,ta,"createHandle",0,function(){return new ts}],244217);var to=e.i(244217),to=to,ti=e.i(937756);function tl({...e}){return(0,f.jsx)(to.Root,{"data-slot":"popover",...e})}function tc({...e}){return(0,f.jsx)(to.Trigger,{"data-slot":"popover-trigger",...e})}function td({className:e,align:t="center",alignOffset:r=0,side:n="bottom",sideOffset:a=4,...s}){return(0,f.jsx)(to.Portal,{children:(0,f.jsx)(to.Positioner,{align:t,alignOffset:r,side:n,sideOffset:a,className:"isolate z-50",children:(0,f.jsx)(to.Popup,{"data-slot":"popover-content",className:(0,ti.cn)("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})})})}var tu=/[\\\/_+.#"@\[\(\{&]/,tm=/[\\\/_+.#"@\[\(\{&]/g,tp=/[\s-]/,tf=/[\s-]/g;function th(e){return e.toLowerCase().replace(tf," ")}function tx(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function tg(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function tv(...e){return t=>{let r=!1,n=e.map(e=>{let n=tg(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():tg(e[t],null)}}}}function tb(...e){return h.useCallback(tv(...e),e)}"u">typeof window&&window.document&&window.document.createElement;var ty=globalThis?.document?h.useLayoutEffect:()=>{},tj=h[" useId ".trim().toString()]||(()=>void 0),tN=0;function tw(e){let[t,r]=h.useState(tj());return ty(()=>{e||r(e=>e??String(tN++))},[e]),e||(t?`radix-${t}`:"")}h[" useEffectEvent ".trim().toString()],h[" useInsertionEffect ".trim().toString()];var tk=h[" useInsertionEffect ".trim().toString()]||ty;function tC(e){var t;let r,n=(t=e,(r=h.forwardRef((e,t)=>{let{children:r,...n}=e;if(h.isValidElement(r)){var a;let e,s,o=(a=r,(s=(e=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.ref:(s=(e=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.props.ref:a.props.ref||a.ref),i=function(e,t){let r={...t};for(let n in t){let a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{let t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==h.Fragment&&(i.ref=t?tv(t,o):o),h.cloneElement(r,i)}return h.Children.count(r)>1?h.Children.only(null):null})).displayName=`${t}.SlotClone`,r),a=h.forwardRef((e,t)=>{let{children:r,...a}=e,s=h.Children.toArray(r),o=s.find(tE);if(o){let e=o.props.children,r=s.map(t=>t!==o?t:h.Children.count(e)>1?h.Children.only(null):h.isValidElement(e)?e.props.children:null);return(0,f.jsx)(n,{...a,ref:t,children:h.isValidElement(e)?h.cloneElement(e,void 0,r):null})}return(0,f.jsx)(n,{...a,ref:t,children:r})});return a.displayName=`${e}.Slot`,a}Symbol("RADIX:SYNC_STATE");var tS=Symbol("radix.slottable");function tE(e){return h.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===tS}var tR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=tC(`Primitive.${t}`),n=h.forwardRef((e,n)=>{let{asChild:a,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,f.jsx)(a?r:t,{...s,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function tI(e){let t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...e)=>t.current?.(...e),[])}var tP="dismissableLayer.update",tT=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tO=h.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:o,onDismiss:i,...l}=e,c=h.useContext(tT),[d,u]=h.useState(null),p=d?.ownerDocument??globalThis?.document,[,x]=h.useState({}),g=tb(t,e=>u(e)),v=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(b),j=d?v.indexOf(d):-1,N=c.layersWithOutsidePointerEventsDisabled.size>0,w=j>=y,k=function(e,t=globalThis?.document){let r=tI(e),n=h.useRef(!1),a=h.useRef(()=>{});return h.useEffect(()=>{let e=e=>{if(e.target&&!n.current){let n=function(){tM("dismissableLayer.pointerDownOutside",r,s,{discrete:!0})},s={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=n,t.addEventListener("click",a.current,{once:!0})):n()}else t.removeEventListener("click",a.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{let t=e.target,r=[...c.branches].some(e=>e.contains(t));w&&!r&&(a?.(e),o?.(e),e.defaultPrevented||i?.())},p),C=function(e,t=globalThis?.document){let r=tI(e),n=h.useRef(!1);return h.useEffect(()=>{let e=e=>{e.target&&!n.current&&tM("dismissableLayer.focusOutside",r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{let t=e.target;![...c.branches].some(e=>e.contains(t))&&(s?.(e),o?.(e),e.defaultPrevented||i?.())},p);return!function(e,t=globalThis?.document){let r=tI(e);h.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{j===c.layers.size-1&&(n?.(e),!e.defaultPrevented&&i&&(e.preventDefault(),i()))},p),h.useEffect(()=>{if(d)return r&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(m=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),tD(),()=>{r&&1===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=m)}},[d,p,r,c]),h.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),tD())},[d,c]),h.useEffect(()=>{let e=()=>x({});return document.addEventListener(tP,e),()=>document.removeEventListener(tP,e)},[]),(0,f.jsx)(tR.div,{...l,ref:g,style:{pointerEvents:N?w?"auto":"none":void 0,...e.style},onFocusCapture:tx(e.onFocusCapture,C.onFocusCapture),onBlurCapture:tx(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:tx(e.onPointerDownCapture,k.onPointerDownCapture)})});function tD(){let e=new CustomEvent(tP);document.dispatchEvent(e)}function tM(e,t,r,{discrete:n}){let a=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});if(t&&a.addEventListener(e,t,{once:!0}),n)a&&E.flushSync(()=>a.dispatchEvent(s));else a.dispatchEvent(s)}tO.displayName="DismissableLayer",h.forwardRef((e,t)=>{let r=h.useContext(tT),n=h.useRef(null),a=tb(t,n);return h.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,f.jsx)(tR.div,{...e,ref:a})}).displayName="DismissableLayerBranch";var tA="focusScope.autoFocusOnMount",tL="focusScope.autoFocusOnUnmount",tF={bubbles:!1,cancelable:!0},tB=h.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...o}=e,[i,l]=h.useState(null),c=tI(a),d=tI(s),u=h.useRef(null),m=tb(t,e=>l(e)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(n){let e=function(e){if(p.paused||!i)return;let t=e.target;i.contains(t)?u.current=t:tz(u.current,{select:!0})},t=function(e){if(p.paused||!i)return;let t=e.relatedTarget;null!==t&&(i.contains(t)||tz(u.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&tz(i)});return i&&r.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[n,i,p.paused]),h.useEffect(()=>{if(i){tU.add(p);let e=document.activeElement;if(!i.contains(e)){let t=new CustomEvent(tA,tF);i.addEventListener(tA,c),i.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let r=document.activeElement;for(let n of e)if(tz(n,{select:t}),document.activeElement!==r)return}(t$(i).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&tz(i))}return()=>{i.removeEventListener(tA,c),setTimeout(()=>{let t=new CustomEvent(tL,tF);i.addEventListener(tL,d),i.dispatchEvent(t),t.defaultPrevented||tz(e??document.body,{select:!0}),i.removeEventListener(tL,d),tU.remove(p)},0)}}},[i,c,d,p]);let x=h.useCallback(e=>{if(!r&&!n||p.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){var s;let t,n=e.currentTarget,[o,i]=[t_(t=t$(s=n),s),t_(t.reverse(),s)];o&&i?e.shiftKey||a!==i?e.shiftKey&&a===o&&(e.preventDefault(),r&&tz(i,{select:!0})):(e.preventDefault(),r&&tz(o,{select:!0})):a===n&&e.preventDefault()}},[r,n,p.paused]);return(0,f.jsx)(tR.div,{tabIndex:-1,...o,ref:m,onKeyDown:x})});function t$(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function t_(e,t){for(let r of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function tz(e,{select:t=!1}={}){if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}tB.displayName="FocusScope";var tU=(n=[],{add(e){let t=n[0];e!==t&&t?.pause(),(n=tW(n,e)).unshift(e)},remove(e){n=tW(n,e),n[0]?.resume()}});function tW(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}var tH=h.forwardRef((e,t)=>{let{container:r,...n}=e,[a,s]=h.useState(!1);ty(()=>s(!0),[]);let o=r||a&&globalThis?.document?.body;return o?E.default.createPortal((0,f.jsx)(tR.div,{...n,ref:t}),o):null});tH.displayName="Portal";var tG=e=>{var t;let r,n,{present:a,children:s}=e,o=function(e){var t,r;let[n,a]=h.useState(),s=h.useRef(null),o=h.useRef(e),i=h.useRef("none"),[l,c]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},h.useReducer((e,t)=>r[e][t]??e,t));return h.useEffect(()=>{let e=tV(s.current);i.current="mounted"===l?e:"none"},[l]),ty(()=>{let t=s.current,r=o.current;if(r!==e){let n=i.current,a=tV(t);e?c("MOUNT"):"none"===a||t?.display==="none"?c("UNMOUNT"):r&&n!==a?c("ANIMATION_OUT"):c("UNMOUNT"),o.current=e}},[e,c]),ty(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=r=>{let a=tV(s.current).includes(CSS.escape(r.animationName));if(r.target===n&&a&&(c("ANIMATION_END"),!o.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},a=e=>{e.target===n&&(i.current=tV(s.current))};return n.addEventListener("animationstart",a),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",a),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(e=>{s.current=e?getComputedStyle(e):null,a(e)},[])}}(a),i="function"==typeof s?s({present:o.isPresent}):h.Children.only(s),l=tb(o.ref,(t=i,(n=(r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof s||o.isPresent?h.cloneElement(i,{ref:l}):null};function tV(e){return e?.animationName||"none"}tG.displayName="Presence";var tK=0;function tq(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var tY=function(){return(tY=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function tX(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)0>t.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}var tZ=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),tJ="width-before-scroll-bar";function tQ(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var t0="u">typeof window?h.useLayoutEffect:h.useEffect,t1=new WeakMap,t2=(void 0===s&&(s={}),(void 0===o&&(o=function(e){return e}),i=[],l=!1,c={read:function(){if(l)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:null},useMedium:function(e){var t=o(e,l);return i.push(t),function(){i=i.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(l=!0;i.length;){var t=i;i=[],t.forEach(e)}i={push:function(t){return e(t)},filter:function(){return i}}},assignMedium:function(e){l=!0;var t=[];if(i.length){var r=i;i=[],r.forEach(e),t=i}var n=function(){var r=t;t=[],r.forEach(e)},a=function(){return Promise.resolve().then(n)};a(),i={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),i}}}}).options=tY({async:!0,ssr:!1},s),c),t5=function(){},t3=h.forwardRef(function(e,t){var r,n,a,s,o=h.useRef(null),i=h.useState({onScrollCapture:t5,onWheelCapture:t5,onTouchMoveCapture:t5}),l=i[0],c=i[1],d=e.forwardProps,u=e.children,m=e.className,p=e.removeScrollBar,f=e.enabled,x=e.shards,g=e.sideCar,v=e.noRelative,b=e.noIsolation,y=e.inert,j=e.allowPinchZoom,N=e.as,w=e.gapMode,k=tX(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=(r=[o,t],n=function(e){return r.forEach(function(t){return tQ(t,e)})},(a=(0,h.useState)(function(){return{value:null,callback:n,facade:{get current(){return a.value},set current(value){var e=a.value;e!==value&&(a.value=value,a.callback(value,e))}}}})[0]).callback=n,s=a.facade,t0(function(){var e=t1.get(s);if(e){var t=new Set(e),n=new Set(r),a=s.current;t.forEach(function(e){n.has(e)||tQ(e,null)}),n.forEach(function(e){t.has(e)||tQ(e,a)})}t1.set(s,r)},[r]),s),S=tY(tY({},k),l);return h.createElement(h.Fragment,null,f&&h.createElement(g,{sideCar:t2,removeScrollBar:p,shards:x,noRelative:v,noIsolation:b,inert:y,setCallbacks:c,allowPinchZoom:!!j,lockRef:o,gapMode:w}),d?h.cloneElement(h.Children.only(u),tY(tY({},S),{ref:C})):h.createElement(void 0===N?"div":N,tY({},S,{className:m,ref:C}),u))});t3.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},t3.classNames={fullWidth:tJ,zeroRight:tZ};var t4=function(e){var t=e.sideCar,r=tX(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return h.createElement(n,tY({},r))};t4.isSideCarExport=!0;var t8=function(){var e=0,t=null;return{add:function(r){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=p||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var n,a;(n=t).styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r)),a=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(a)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},t9=function(){var e=t8();return function(t,r){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},t7=function(){var e=t9();return function(t){return e(t.styles,t.dynamic),null}},t6={left:0,top:0,right:0,gap:0},re=function(e){return parseInt(e||"",10)||0},rt=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[re(r),re(n),re(a)]},rr=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return t6;var t=rt(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},rn=t7(),ra="data-scroll-locked",rs=function(e,t,r,n){var a=e.left,s=e.top,o=e.right,i=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(i,"px ").concat(n,";\n }\n body[").concat(ra,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(s,"px;\n padding-right: ").concat(o,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(i,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(i,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(tZ," {\n right: ").concat(i,"px ").concat(n,";\n }\n \n .").concat(tJ," {\n margin-right: ").concat(i,"px ").concat(n,";\n }\n \n .").concat(tZ," .").concat(tZ," {\n right: 0 ").concat(n,";\n }\n \n .").concat(tJ," .").concat(tJ," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(ra,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(i,"px;\n }\n")},ro=function(){var e=parseInt(document.body.getAttribute(ra)||"0",10);return isFinite(e)?e:0},ri=function(){h.useEffect(function(){return document.body.setAttribute(ra,(ro()+1).toString()),function(){var e=ro()-1;e<=0?document.body.removeAttribute(ra):document.body.setAttribute(ra,e.toString())}},[])},rl=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=void 0===n?"margin":n;ri();var s=h.useMemo(function(){return rr(a)},[a]);return h.createElement(rn,{styles:rs(s,!t,a,r?"":"!important")})},rc=!1;if("u">typeof window)try{var rd=Object.defineProperty({},"passive",{get:function(){return rc=!0,!0}});window.addEventListener("test",rd,rd),window.removeEventListener("test",rd,rd)}catch(e){rc=!1}var ru=!!rc&&{passive:!1},rm=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&(r.overflowY!==r.overflowX||"TEXTAREA"===e.tagName||"visible"!==r[t])},rp=function(e,t){var r=t.ownerDocument,n=t;do{if("u">typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),rf(e,n)){var a=rh(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body)return!1},rf=function(e,t){return"v"===e?rm(t,"overflowY"):rm(t,"overflowX")},rh=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},rx=function(e,t,r,n,a){var s,o=(s=window.getComputedStyle(t).direction,"h"===e&&"rtl"===s?-1:1),i=o*n,l=r.target,c=t.contains(l),d=!1,u=i>0,m=0,p=0;do{if(!l)break;var f=rh(e,l),h=f[0],x=f[1]-f[2]-o*h;(h||x)&&rf(e,l)&&(m+=x,p+=h);var g=l.parentNode;l=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&l!==document.body||c&&(t.contains(l)||t===l))return u&&(a&&1>Math.abs(m)||!a&&i>m)?d=!0:!u&&(a&&1>Math.abs(p)||!a&&-i>p)&&(d=!0),d},rg=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rv=function(e){return[e.deltaX,e.deltaY]},rb=function(e){return e&&"current"in e?e.current:e},ry=0,rj=[];let rN=(d=function(e){var t=h.useRef([]),r=h.useRef([0,0]),n=h.useRef(),a=h.useState(ry++)[0],s=h.useState(t7)[0],o=h.useRef(e);h.useEffect(function(){o.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=(function(e,t,r){if(r||2==arguments.length)for(var n,a=0,s=t.length;a<s;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(rb),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var i=h.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var a,s=rg(e),i=r.current,l="deltaX"in e?e.deltaX:i[0]-s[0],c="deltaY"in e?e.deltaY:i[1]-s[1],d=e.target,u=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var m=window.getSelection(),p=m&&m.anchorNode;if(p&&(p===d||p.contains(d)))return!1;var f=rp(u,d);if(!f)return!0;if(f?a=u:(a="v"===u?"h":"v",f=rp(u,d)),!f)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=a),!a)return!0;var h=n.current||a;return rx(h,t,e,"h"===h?l:c,!0)},[]),l=h.useCallback(function(e){if(rj.length&&rj[rj.length-1]===s){var r="deltaY"in e?rv(e):rg(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta,n[0]===r[0]&&n[1]===r[1])})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var a=(o.current.shards||[]).map(rb).filter(Boolean).filter(function(t){return t.contains(e.target)});(a.length>0?i(e,a[0]):!o.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=h.useCallback(function(e,r,n,a){var s={name:e,delta:r,target:n,should:a,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(s),setTimeout(function(){t.current=t.current.filter(function(e){return e!==s})},1)},[]),d=h.useCallback(function(e){r.current=rg(e),n.current=void 0},[]),u=h.useCallback(function(t){c(t.type,rv(t),t.target,i(t,e.lockRef.current))},[]),m=h.useCallback(function(t){c(t.type,rg(t),t.target,i(t,e.lockRef.current))},[]);h.useEffect(function(){return rj.push(s),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:m}),document.addEventListener("wheel",l,ru),document.addEventListener("touchmove",l,ru),document.addEventListener("touchstart",d,ru),function(){rj=rj.filter(function(e){return e!==s}),document.removeEventListener("wheel",l,ru),document.removeEventListener("touchmove",l,ru),document.removeEventListener("touchstart",d,ru)}},[]);var p=e.removeScrollBar,f=e.inert;return h.createElement(h.Fragment,null,f?h.createElement(s,{styles:"\n .block-interactivity-".concat(a," {pointer-events: none;}\n .allow-interactivity-").concat(a," {pointer-events: all;}\n")}):null,p?h.createElement(rl,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},t2.useMedium(d),t4);var rw=h.forwardRef(function(e,t){return h.createElement(t3,tY({},e,{ref:t,sideCar:rN}))});rw.classNames=t3.classNames;var rk=new WeakMap,rC=new WeakMap,rS={},rE=0,rR=function(e){return e&&(e.host||rR(e.parentNode))},rI=function(e,t,r,n){var a=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var r=rR(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});rS[r]||(rS[r]=new WeakMap);var s=rS[r],o=[],i=new Set,l=new Set(a),c=function(e){!e||i.has(e)||(i.add(e),c(e.parentNode))};a.forEach(c);var d=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(i.has(e))d(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,l=(rk.get(e)||0)+1,c=(s.get(e)||0)+1;rk.set(e,l),s.set(e,c),o.push(e),1===l&&a&&rC.set(e,!0),1===c&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return d(t),i.clear(),rE++,function(){o.forEach(function(e){var t=rk.get(e)-1,a=s.get(e)-1;rk.set(e,t),s.set(e,a),t||(rC.has(e)||e.removeAttribute(n),rC.delete(e)),a||e.removeAttribute(r)}),--rE||(rk=new WeakMap,rk=new WeakMap,rC=new WeakMap,rS={})}},rP=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),rI(n,a,r,"aria-hidden")):function(){return null}},rT="Dialog",[rO,rD]=function(e,t=[]){let r=[],n=()=>{let t=r.map(e=>h.createContext(e));return function(r){let n=r?.[e]||t;return h.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return n.scopeName=e,[function(t,n){let a=h.createContext(n),s=r.length;r=[...r,n];let o=t=>{let{scope:r,children:n,...o}=t,i=r?.[e]?.[s]||a,l=h.useMemo(()=>o,Object.values(o));return(0,f.jsx)(i.Provider,{value:l,children:n})};return o.displayName=t+"Provider",[o,function(r,o){let i=o?.[e]?.[s]||a,l=h.useContext(i);if(l)return l;if(void 0!==n)return n;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let n=r.reduce((t,{useScope:r,scopeName:n})=>{let a=r(e)[`__scope${n}`];return{...t,...a}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}(n,...t)]}(rT),[rM,rA]=rO(rT),rL=e=>{let{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:s,modal:o=!0}=e,i=h.useRef(null),l=h.useRef(null),[c,d]=function({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[a,s,o]=function({defaultProp:e,onChange:t}){let[r,n]=h.useState(e),a=h.useRef(r),s=h.useRef(t);return tk(()=>{s.current=t},[t]),h.useEffect(()=>{a.current!==r&&(s.current?.(r),a.current=r)},[r,a]),[r,n,s]}({defaultProp:t,onChange:r}),i=void 0!==e,l=i?e:a;{let t=h.useRef(void 0!==e);h.useEffect(()=>{let e=t.current;if(e!==i){let t=i?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=i},[i,n])}return[l,h.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&o.current?.(r)}else s(t)},[i,e,s,o])]}({prop:n,defaultProp:a??!1,onChange:s,caller:rT});return(0,f.jsx)(rM,{scope:t,triggerRef:i,contentRef:l,contentId:tw(),titleId:tw(),descriptionId:tw(),open:c,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(e=>!e),[d]),modal:o,children:r})};rL.displayName=rT;var rF="DialogTrigger";h.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=rA(rF,r),s=tb(t,a.triggerRef);return(0,f.jsx)(tR.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":r0(a.open),...n,ref:s,onClick:tx(e.onClick,a.onOpenToggle)})}).displayName=rF;var rB="DialogPortal",[r$,r_]=rO(rB,{forceMount:void 0}),rz=e=>{let{__scopeDialog:t,forceMount:r,children:n,container:a}=e,s=rA(rB,t);return(0,f.jsx)(r$,{scope:t,forceMount:r,children:h.Children.map(n,e=>(0,f.jsx)(tG,{present:r||s.open,children:(0,f.jsx)(tH,{asChild:!0,container:a,children:e})}))})};rz.displayName=rB;var rU="DialogOverlay",rW=h.forwardRef((e,t)=>{let r=r_(rU,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,s=rA(rU,e.__scopeDialog);return s.modal?(0,f.jsx)(tG,{present:n||s.open,children:(0,f.jsx)(rG,{...a,ref:t})}):null});rW.displayName=rU;var rH=tC("DialogOverlay.RemoveScroll"),rG=h.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=rA(rU,r);return(0,f.jsx)(rw,{as:rH,allowPinchZoom:!0,shards:[a.contentRef],children:(0,f.jsx)(tR.div,{"data-state":r0(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),rV="DialogContent",rK=h.forwardRef((e,t)=>{let r=r_(rV,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,s=rA(rV,e.__scopeDialog);return(0,f.jsx)(tG,{present:n||s.open,children:s.modal?(0,f.jsx)(rq,{...a,ref:t}):(0,f.jsx)(rY,{...a,ref:t})})});rK.displayName=rV;var rq=h.forwardRef((e,t)=>{let r=rA(rV,e.__scopeDialog),n=h.useRef(null),a=tb(t,r.contentRef,n);return h.useEffect(()=>{let e=n.current;if(e)return rP(e)},[]),(0,f.jsx)(rX,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:tx(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:tx(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:tx(e.onFocusOutside,e=>e.preventDefault())})}),rY=h.forwardRef((e,t)=>{let r=rA(rV,e.__scopeDialog),n=h.useRef(!1),a=h.useRef(!1);return(0,f.jsx)(rX,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let s=t.target;r.triggerRef.current?.contains(s)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),rX=h.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:s,...o}=e,i=rA(rV,r),l=h.useRef(null),c=tb(t,l);return h.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tq()),document.body.insertAdjacentElement("beforeend",e[1]??tq()),tK++,()=>{1===tK&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),tK--}},[]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(tB,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:s,children:(0,f.jsx)(tO,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":r0(i.open),...o,ref:c,onDismiss:()=>i.onOpenChange(!1)})}),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(r3,{titleId:i.titleId}),(0,f.jsx)(r4,{contentRef:l,descriptionId:i.descriptionId})]})]})}),rZ="DialogTitle";h.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=rA(rZ,r);return(0,f.jsx)(tR.h2,{id:a.titleId,...n,ref:t})}).displayName=rZ;var rJ="DialogDescription";h.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=rA(rJ,r);return(0,f.jsx)(tR.p,{id:a.descriptionId,...n,ref:t})}).displayName=rJ;var rQ="DialogClose";function r0(e){return e?"open":"closed"}h.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=rA(rQ,r);return(0,f.jsx)(tR.button,{type:"button",...n,ref:t,onClick:tx(e.onClick,()=>a.onOpenChange(!1))})}).displayName=rQ;var r1="DialogTitleWarning",[r2,r5]=(u={contentName:rV,titleName:rZ,docsSlug:"dialog"},t=h.createContext(u),(r=e=>{let{children:r,...n}=e,a=h.useMemo(()=>n,Object.values(n));return(0,f.jsx)(t.Provider,{value:a,children:r})}).displayName=r1+"Provider",[r,function(e){let r=h.useContext(t);if(r)return r;if(void 0!==u)return u;throw Error(`\`${e}\` must be used within \`${r1}\``)}]),r3=({titleId:e})=>{let t=r5(r1),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,136924,e=>{"use strict";let t,r,n;var a,s,o,i,l,c,d,u,m,p,f=e.i(432377),h=e.i(85212),x=e.i(309542),g=e.i(466256),v=e.i(863961);let b=(0,v.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var y=e.i(287277),j=e.i(625054);function N({totalTasks:e,runningTasks:t}){let{t:r}=(0,j.useI18n)();return(0,f.jsxs)("div",{className:"grid grid-cols-3 gap-3 px-6 py-4",children:[(0,f.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("div",{className:"rounded-lg bg-sky-500/10 p-2 ring-1 ring-sky-500/20",children:(0,f.jsx)(g.ClipboardList,{className:"h-4 w-4 text-sky-400"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:r("board.overview")}),(0,f.jsx)("p",{className:"text-2xl font-bold font-mono tracking-tight text-foreground",children:e})]})]})}),(0,f.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("div",{className:"rounded-lg bg-primary/10 p-2 ring-1 ring-primary/20",children:(0,f.jsx)(b,{className:"h-4 w-4 text-primary"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:r("board.running")}),(0,f.jsx)("p",{className:"text-2xl font-bold font-mono tracking-tight text-foreground",children:t})]})]})}),(0,f.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("div",{className:"rounded-lg bg-emerald-500/10 p-2 ring-1 ring-emerald-500/20",children:(0,f.jsx)(y.Lightbulb,{className:"h-4 w-4 text-emerald-400"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:r("board.tip")}),(0,f.jsx)("p",{className:"text-xs font-medium text-foreground/80",children:r("board.tipText")})]})]})})]})}var w=e.i(780156),k=e.i(677436),C=e.i(711296);function S({searchQuery:e,onSearchChange:t,onCreateTask:r}){let{t:n}=(0,j.useI18n)();return(0,f.jsxs)("div",{className:"flex items-center gap-2 px-6 py-2",children:[(0,f.jsxs)("div",{className:"relative flex-1 max-w-xs",children:[(0,f.jsx)(k.Search,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,f.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),placeholder:n("board.searchPlaceholder"),className:"h-8 w-full rounded-lg border border-border bg-background pl-8 pr-3 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary"})]}),(0,f.jsxs)(C.Button,{"data-tour":"create-task",variant:"outline",className:"ml-auto gap-1.5 border-border text-xs text-muted-foreground hover:border-primary/30 hover:text-primary",onClick:r,children:[(0,f.jsx)(w.Plus,{className:"h-3.5 w-3.5"}),n("board.newTask")]})]})}var E=e.i(9235),R=e.i(893832),I=e.i(787207);function P({x:e,y:t,taskId:r,currentStatus:n,hasExecutions:a,workspaceId:s,onClose:o,onStatusChange:i,onLaunch:l}){let{t:c}=(0,j.useI18n)(),d=(0,x.useRouter)(),u=(0,h.useRef)(null);(0,h.useEffect)(()=>{let e=e=>{u.current&&!u.current.contains(e.target)&&o()},t=e=>{"Escape"===e.key&&o()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[o]);let m="flex items-center px-3 py-1.5 text-xs cursor-pointer hover:bg-accent rounded-sm w-full text-left",p=(0,f.jsxs)("div",{ref:u,style:{position:"fixed",top:t,left:e,zIndex:9999},className:"bg-popover border border-border rounded-md shadow-md py-1 min-w-[180px]",children:[(0,f.jsx)("div",{className:"px-3 py-1 text-[10px] text-muted-foreground uppercase tracking-wider",children:c("board.contextMenu.changeStatus")}),I.BOARD_COLUMNS.map(e=>(0,f.jsxs)("button",{type:"button",className:m,onClick:()=>{i(r,e.id),o()},children:[n===e.id?(0,f.jsx)(R.Check,{className:"h-3 w-3 mr-2 flex-shrink-0"}):(0,f.jsx)("span",{className:"w-5 flex-shrink-0"}),e.label]},e.id)),(0,f.jsx)("hr",{className:"my-1 border-border"}),(0,f.jsx)("button",{type:"button",className:`${m} ${a?"opacity-50 cursor-not-allowed":""}`,disabled:a,onClick:()=>{a||(l(r),o())},children:c("board.contextMenu.launch")}),"DONE"!==n&&"CANCELLED"!==n&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("hr",{className:"my-1 border-border"}),(0,f.jsx)("button",{type:"button",className:m,onClick:()=>{d.push(`/workspaces/${s}/tasks/${r}`),o()},children:c("board.contextMenu.goToDetail")})]})]});return"u"<typeof document?null:(0,E.createPortal)(p,document.body)}var T=e.i(139302),O=e.i(254059);let D=(0,v.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var M=e.i(280121),A=e.i(746357),L=e.i(923344),F=e.i(909260);let B=(0,v.default)("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);var $=e.i(203529),_=e.i(942252);function z({task:e,onClick:t,onEdit:r,onDelete:n,onTogglePin:a,onContextMenu:s}){let{t:o}=(0,j.useI18n)(),{attributes:i,listeners:l,setNodeRef:c,transform:d,transition:u,isDragging:m}=(0,O.useSortable)({id:e.id,data:{type:"task",task:e}}),p={transform:M.CSS.Transform.toString(d),transition:u,opacity:m?.4:1},h=I.PRIORITY_CONFIG[e.priority];return(0,f.jsxs)("div",{ref:c,style:p,...i,...l,className:"group cursor-grab rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50 active:cursor-grabbing",onClick:t,onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),s?.(e,t.clientX,t.clientY)},"data-testid":"task-card",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between",children:[(0,f.jsx)("h4",{className:"text-sm font-medium text-foreground",children:e.title}),(0,f.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",className:`transition-all ${e.pinned?"text-primary opacity-100":"text-muted-foreground opacity-0 group-hover:opacity-100"}`,onClick:t=>{t.stopPropagation(),a?.(e.id)},"aria-label":o(e.pinned?"board.unpin":"board.pin"),children:(0,f.jsx)(B,{className:`h-3.5 w-3.5 ${e.pinned?"-rotate-45":""}`})}),(0,f.jsxs)(_.DropdownMenu,{children:[(0,f.jsx)(_.DropdownMenuTrigger,{render:(0,f.jsx)("button",{className:"rounded-md p-0.5 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:e=>e.stopPropagation()}),children:(0,f.jsx)(A.MoreHorizontal,{className:"h-4 w-4"})}),(0,f.jsxs)(_.DropdownMenuContent,{align:"end",children:[(0,f.jsxs)(_.DropdownMenuItem,{onClick:t=>{t.stopPropagation(),r?.(e)},children:[(0,f.jsx)(L.Pencil,{className:"mr-2 h-3.5 w-3.5"}),o("common.edit")]}),(0,f.jsxs)(_.DropdownMenuItem,{className:"text-rose-400",onClick:t=>{t.stopPropagation(),n?.(e.id)},children:[(0,f.jsx)(F.Trash2,{className:"mr-2 h-3.5 w-3.5"}),o("common.delete")]})]})]})]})]}),e.description&&(0,f.jsx)("p",{className:"mt-1.5 line-clamp-3 text-xs leading-relaxed text-muted-foreground",children:e.description}),(0,f.jsx)("div",{className:"mt-2.5",children:(0,f.jsx)($.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${h.color}`,children:h.label})}),e.labels&&e.labels.length>0&&(0,f.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e.labels.map(e=>(0,f.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:e.label.color+"20",color:e.label.color},children:e.label.name},e.label.id))})]})}var U=e.i(718837),W=e.i(142124);function H({open:e,onOpenChange:t,columnLabel:r,columnColor:n,tasks:a,onTaskClick:s}){let{t:o}=(0,j.useI18n)();return(0,f.jsx)(U.Dialog,{open:e,onOpenChange:t,children:(0,f.jsxs)(U.DialogContent,{className:"max-w-4xl max-h-[80vh]",children:[(0,f.jsx)(U.DialogHeader,{children:(0,f.jsxs)(U.DialogTitle,{className:"flex items-center gap-2",children:[(0,f.jsx)("div",{className:`h-2.5 w-2.5 rounded-full ${n}`}),(0,f.jsx)("span",{children:r}),(0,f.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-mono font-medium text-muted-foreground",children:a.length})]})}),(0,f.jsx)(W.ScrollArea,{className:"max-h-[calc(80vh-80px)]",children:(0,f.jsxs)("div",{className:"grid grid-cols-3 gap-3 pr-3",children:[a.map(e=>{let r=I.PRIORITY_CONFIG[e.priority];return(0,f.jsxs)("div",{className:"cursor-pointer rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50",onClick:()=>{s?.(e),t(!1)},children:[(0,f.jsx)("h4",{className:"text-sm font-medium text-foreground line-clamp-2",children:e.title}),e.description&&(0,f.jsx)("p",{className:"mt-1.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:e.description}),(0,f.jsxs)("div",{className:"mt-2 flex items-center gap-1.5 flex-wrap",children:[(0,f.jsx)($.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${r.color}`,children:r.label}),e.labels?.map(e=>(0,f.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:e.label.color+"20",color:e.label.color},children:e.label.name},e.label.id))]})]},e.id)}),0===a.length&&(0,f.jsx)("div",{className:"col-span-3 py-8 text-center text-sm text-muted-foreground",children:o("board.noTasks")})]})})]})})}function G({id:e,label:t,color:r,tasks:n,onTaskClick:a,onEditTask:s,onAddTask:o,onDeleteTask:i,onTogglePin:l,onContextMenu:c}){let{setNodeRef:d,isOver:u}=(0,T.useDroppable)({id:e}),[m,p]=(0,h.useState)(!1),{t:x}=(0,j.useI18n)();return(0,f.jsxs)("div",{className:`flex w-0 min-w-[220px] flex-1 flex-col min-h-0 border-r border-border/50 last:border-r-0 transition-colors ${u?"bg-primary/[0.06]":""}`,children:[(0,f.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b border-border/30",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)("div",{className:`h-2 w-2 rounded-full ${r}`}),(0,f.jsx)("span",{className:"text-xs font-semibold tracking-wide text-secondary-foreground",children:t}),(0,f.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-mono font-medium text-muted-foreground",children:n.length})]}),(0,f.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:()=>p(!0),className:"text-muted-foreground","aria-label":x("board.viewAll"),children:(0,f.jsx)(D,{className:"h-3.5 w-3.5"})}),(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:o,className:"text-muted-foreground","aria-label":"add",children:(0,f.jsx)(w.Plus,{className:"h-3.5 w-3.5"})})]})]}),(0,f.jsx)(H,{open:m,onOpenChange:p,columnLabel:t,columnColor:r,tasks:n,onTaskClick:a}),(0,f.jsx)(W.ScrollArea,{className:"flex-1 min-h-0",children:(0,f.jsx)("div",{ref:d,className:"flex flex-col gap-2 p-2",children:(0,f.jsx)(O.SortableContext,{items:n.map(e=>e.id),strategy:O.verticalListSortingStrategy,children:n.map(e=>(0,f.jsx)(z,{task:e,onClick:()=>a?.(e),onEdit:s,onDelete:i,onTogglePin:l,onContextMenu:c},e.id))})})})]})}function V({initialTasks:e,onTaskMove:t,onTaskClick:r,onEditTask:n,onAddTask:a,onDeleteTask:s,onTogglePin:o,onContextMenuStatusChange:i,onContextMenuLaunch:l,workspaceId:c}){let[d,u]=(0,h.useState)(e),[m,p]=(0,h.useState)(null),[x,g]=(0,h.useState)(null);(0,h.useEffect)(()=>{u(e)},[e]);let v=(0,T.useSensors)((0,T.useSensor)(T.PointerSensor,{activationConstraint:{distance:8}})),b=(0,h.useCallback)((e,t,r)=>{g({task:e,x:t,y:r})},[]),y=(0,h.useCallback)(e=>{let t=d.find(t=>t.id===e.active.id);t&&p(t)},[d]),j=(0,h.useCallback)(e=>{let r,{active:n,over:a}=e;if(p(null),!a)return;let s=n.id,o=a.id;if(I.BOARD_COLUMNS.some(e=>e.id===o))r=o;else{let e=d.find(e=>e.id===o);r=e?.status}r&&(u(e=>e.map(e=>e.id===s?{...e,status:r}:e)),t?.(s,r))},[d,t]);return(0,f.jsxs)(T.DndContext,{id:"kanban-board",sensors:v,collisionDetection:T.closestCorners,onDragStart:y,onDragEnd:j,children:[(0,f.jsx)("div",{className:"mx-2 flex h-full overflow-x-auto rounded-xl border border-border bg-card/50",children:I.BOARD_COLUMNS.map(e=>(0,f.jsx)(G,{id:e.id,label:e.label,color:e.color,tasks:d.filter(t=>t.status===e.id),onTaskClick:r,onEditTask:n,onAddTask:()=>a?.(e.id),onDeleteTask:s,onTogglePin:o,onContextMenu:b},e.id))}),(0,f.jsx)(T.DragOverlay,{children:m?(0,f.jsx)("div",{className:"rotate-3 scale-105",children:(0,f.jsx)(z,{task:m})}):null}),x&&(0,f.jsx)(P,{x:x.x,y:x.y,taskId:x.task.id,currentStatus:x.task.status,hasExecutions:(x.task._count?.executions??0)>0,workspaceId:c??"",onClose:()=>g(null),onStatusChange:(e,t)=>{i?.(e,t),g(null)},onLaunch:e=>{l?.(e),g(null)}})]})}var K=e.i(831349),q=e.i(540032),Y=e.i(9433),X=e.i(357334);let Z=(0,v.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s([],493200),e.i(493200);var J=e.i(398285),Q=e.i(959713),ee=e.i(774963),et=e.i(487282),er=e.i(878755),en=e.i(315199),ea=e.i(420072);e.i(129893);var es=e.i(499875);let eo=h.createContext(void 0);function ei(e){let t=h.useContext(eo);if(void 0===t&&!e)throw Error((0,es.default)(47));return t}var el=e.i(978478),ec=e.i(962501),ed=e.i(617406),eu=e.i(524534),em=e.i(292547),ep=e.i(394772),ef=e.i(716310),eh=e.i(673852),ex=e.i(175183);let eg={...ef.popupStoreSelectors,disabled:(0,ec.createSelector)(e=>e.disabled),instantType:(0,ec.createSelector)(e=>e.instantType),openMethod:(0,ec.createSelector)(e=>e.openMethod),openChangeReason:(0,ec.createSelector)(e=>e.openChangeReason),modal:(0,ec.createSelector)(e=>e.modal),stickIfOpen:(0,ec.createSelector)(e=>e.stickIfOpen),titleElementId:(0,ec.createSelector)(e=>e.titleElementId),descriptionElementId:(0,ec.createSelector)(e=>e.descriptionElementId),openOnHover:(0,ec.createSelector)(e=>e.openOnHover),closeDelay:(0,ec.createSelector)(e=>e.closeDelay),hasViewport:(0,ec.createSelector)(e=>e.hasViewport)};class ev extends el.ReactStore{constructor(e){const t={...(0,ef.createInitialPopupStoreState)(),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,...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:h.createRef(),backdropRef:h.createRef(),internalBackdropRef:h.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:h.createRef(),beforeContentFocusGuardRef:h.createRef(),stickIfOpenTimeout:new ed.Timeout,triggerElements:new eh.PopupTriggerMap},eg)}setOpen=(e,t)=>{let r=t.reason===ep.REASONS.triggerHover,n=t.reason===ep.REASONS.triggerPress&&0===t.event.detail,a=!e&&(t.reason===ep.REASONS.escapeKey||null==t.reason);if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let s={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger},o=this.state.floatingRootContext.context.events;o?.emit("openchange",s);let i=()=>{let r={open:e,openChangeReason:t.reason},n=t.trigger?.id??null;(n||e)&&(r.activeTriggerId=n,r.activeTriggerElement=t.trigger??null),this.update(r)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(ex.PATIENT_CLICK_THRESHOLD,()=>{this.set("stickIfOpen",!1)}),E.flushSync(i)):i(),n||a?this.set("instantType",n?"click":"dismiss"):t.reason===ep.REASONS.focusOut?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(e,t){let r=(0,eu.useRefWithInit)(()=>new ev(t)).current,n=e??r;return(0,em.useOnMount)(r.disposeEffect),n}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}var eb=e.i(197167),ey=e.i(120520),ej=e.i(277095);function eN({props:e}){let{children:t,open:r,defaultOpen:n=!1,onOpenChange:a,onOpenChangeComplete:s,modal:o=!1,handle:i,triggerId:l,defaultTriggerId:c=null}=e,d=ev.useStore(i?.store,{modal:o,open:n,openProp:r,activeTriggerId:c,triggerIdProp:l});(0,Q.useOnFirstRender)(()=>{void 0===r&&!1===d.state.open&&!0===n&&d.update({open:!0,activeTriggerId:c})}),d.useControlledProp("openProp",r),d.useControlledProp("triggerIdProp",l);let u=d.useState("open"),m=d.useState("positionerElement"),p=d.useState("payload"),x=d.useState("openChangeReason");d.useContextCallback("onOpenChange",a),d.useContextCallback("onOpenChangeComplete",s);let{openMethod:g,triggerProps:v}=(0,ej.useOpenInteractionType)(u);(0,ey.useImplicitActiveTrigger)(d);let{forceUnmount:b}=(0,ey.useOpenStateTransitions)(u,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});(0,J.useScrollLock)(u&&!0===o&&x!==ep.REASONS.triggerHover&&"touch"!==g,m),h.useEffect(()=>{u||d.context.stickIfOpenTimeout.clear()},[d,u]);let y=h.useCallback(e=>{let t=(0,eb.createChangeEventDetails)(e);return t.preventUnmountOnClose=()=>{d.set("preventUnmountingOnClose",!0)},t},[d]),j=h.useCallback(()=>{d.setOpen(!1,y(ep.REASONS.imperativeAction))},[d,y]);h.useImperativeHandle(e.actionsRef,()=>({unmount:b,close:j}),[b,j]);let N=(0,ea.useSyncedFloatingRootContext)({popupStore:d,onOpenChange:d.setOpen}),w=(0,ee.useDismiss)(N,{outsidePressEvent:{mouse:"trap-focus"===o?"sloppy":"intentional",touch:"sloppy"}}),k=(0,er.useRole)(N),{getReferenceProps:C,getFloatingProps:S,getTriggerProps:E}=(0,et.useInteractions)([w,k]),R=h.useMemo(()=>C(v),[C,v]),I=h.useMemo(()=>E(v),[E,v]),P=h.useMemo(()=>S(),[S]);d.useSyncedValues({modal:o,openMethod:g,activeTriggerProps:R,inactiveTriggerProps:I,popupProps:P,floatingRootContext:N,nested:null!=(0,en.useFloatingParentNodeId)()});let T=h.useMemo(()=>({store:d}),[d]);return(0,f.jsx)(eo.Provider,{value:T,children:"function"==typeof t?t({payload:p}):t})}var ew=e.i(357030),ek=e.i(136391),eC=e.i(801363),eS=e.i(793988),eE=e.i(681866),eR=e.i(705448),eI=e.i(150224),eP=e.i(443667),eT=e.i(916285),eO=e.i(75408),eD=e.i(193905);let eM=h.forwardRef(function(e,t){let{render:r,className:n,disabled:a=!1,nativeButton:s=!0,handle:o,payload:i,openOnHover:l=!1,delay:c=300,closeDelay:d=0,id:u,...m}=e,p=ei(!0),x=o?.store??p?.store;if(!x)throw Error((0,es.default)(74));let g=(0,eP.useBaseUiId)(u),v=x.useState("isTriggerActive",g),b=x.useState("floatingRootContext"),y=x.useState("isOpenedByTrigger",g),j=h.useRef(null),{registerTrigger:N,isMountedByThisTrigger:w}=(0,ey.useTriggerDataForwarding)(g,j,x,{payload:i,disabled:a,openOnHover:l,closeDelay:d}),k=x.useState("openChangeReason"),C=x.useState("stickIfOpen"),S=x.useState("openMethod"),R=(0,eI.useHoverReferenceInteraction)(b,{enabled:null!=b&&l&&("touch"!==S||k!==ep.REASONS.triggerPress),mouseOnly:!0,move:!1,handleClose:(0,eE.safePolygon)(),restMs:c,delay:{close:d},triggerElementRef:j,isActiveTrigger:v}),I=(0,eR.useClick)(b,{enabled:null!=b,stickIfOpen:C}),P=(0,et.useInteractions)([I]),T=x.useState("triggerProps",w),{getButtonProps:O,buttonRef:D}=(0,ek.useButton)({disabled:a,native:s}),M=h.useMemo(()=>({open:e=>e&&k===ep.REASONS.triggerPress?eC.pressableTriggerOpenStateMapping.open(e):eC.triggerOpenStateMapping.open(e)}),[k]),A=(0,eS.useRenderElement)("button",e,{state:{disabled:a,open:y},ref:[D,t,N,j],props:[P.getReferenceProps(),R,T,{[ex.CLICK_TRIGGER_IDENTIFIER]:"",id:g},m,O],stateAttributesMapping:M}),L=h.useRef(null),F=(0,ew.useStableCallback)(e=>{E.flushSync(()=>{x.setOpen(!1,(0,eb.createChangeEventDetails)(ep.REASONS.focusOut,e.nativeEvent,e.currentTarget))});let t=(0,eD.getTabbableBeforeElement)(L.current);t?.focus()}),B=(0,ew.useStableCallback)(e=>{let t=x.select("positionerElement");if(t&&(0,eD.isOutsideEvent)(e,t))x.context.beforeContentFocusGuardRef.current?.focus();else{E.flushSync(()=>{x.setOpen(!1,(0,eb.createChangeEventDetails)(ep.REASONS.focusOut,e.nativeEvent,e.currentTarget))});let r=(0,eD.getTabbableAfterElement)(x.context.triggerFocusTargetRef.current||j.current);for(;null!==r&&(0,eO.contains)(t,r);){let e=r;if((r=(0,eD.getNextTabbable)(r))===e)break}r?.focus()}});return v?(0,f.jsxs)(h.Fragment,{children:[(0,f.jsx)(eT.FocusGuard,{ref:L,onFocus:F}),(0,f.jsx)(h.Fragment,{children:A},g),(0,f.jsx)(eT.FocusGuard,{ref:x.context.triggerFocusTargetRef,onFocus:B})]}):(0,f.jsx)(h.Fragment,{children:A},g)});var eA=e.i(543078);let eL=h.createContext(void 0),eF=h.forwardRef(function(e,t){let{keepMounted:r=!1,...n}=e,{store:a}=ei();return a.useState("mounted")||r?(0,f.jsx)(eL.Provider,{value:r,children:(0,f.jsx)(eA.FloatingPortal,{ref:t,...n})}):null});var eB=e.i(614855),e$=e.i(284060);let e_=h.createContext(void 0);function ez(){let e=h.useContext(e_);if(!e)throw Error((0,es.default)(46));return e}var eU=e.i(520132),eW=e.i(479372),eH=e.i(302062),eG=e.i(134381),eV=e.i(777548);let eK=h.forwardRef(function(e,t){let{render:r,className:n,anchor:a,positionMethod:s="absolute",side:o="bottom",align:i="center",sideOffset:l=0,alignOffset:c=0,collisionBoundary:d="clipping-ancestors",collisionPadding:u=5,arrowPadding:m=5,sticky:p=!1,disableAnchorTracking:x=!1,collisionAvoidance:g=ex.POPUP_COLLISION_AVOIDANCE,...v}=e,{store:b}=ei(),y=function(){let e=h.useContext(eL);if(void 0===e)throw Error((0,es.default)(45));return e}(),j=(0,en.useFloatingNodeId)(),N=b.useState("floatingRootContext"),w=b.useState("mounted"),k=b.useState("open"),C=b.useState("openChangeReason"),S=b.useState("activeTriggerElement"),E=b.useState("modal"),R=b.useState("positionerElement"),I=b.useState("instantType"),P=b.useState("transitionStatus"),T=b.useState("hasViewport"),O=h.useRef(null),D=(0,eH.useAnimationsFinished)(R,!1,!1),M=(0,eU.useAnchorPositioning)({anchor:a,floatingRootContext:N,positionMethod:s,mounted:w,side:o,sideOffset:l,align:i,alignOffset:c,arrowPadding:m,collisionBoundary:d,collisionPadding:u,sticky:p,disableAnchorTracking:x,keepMounted:y,nodeId:j,collisionAvoidance:g,adaptiveOrigin:T?eG.adaptiveOrigin:void 0}),A=h.useMemo(()=>{let e={};return k||(e.pointerEvents="none"),{role:"presentation",hidden:!w,style:{...M.positionerStyles,...e}}},[k,w,M.positionerStyles]),L=h.useMemo(()=>({props:A,...M}),[A,M]),F=N.useState("domReferenceElement");(0,e$.useIsoLayoutEffect)(()=>{let e=O.current;if(F&&(O.current=F),e&&F&&F!==e){b.set("instantType",void 0);let e=new AbortController;return D(()=>{b.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[F,D,b]);let B={open:k,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:I},$=h.useCallback(e=>{b.set("positionerElement",e)},[b]),_=(0,eS.useRenderElement)("div",e,{state:B,props:[L.props,(0,eV.getDisabledMountTransitionStyles)(P),v],ref:[t,$],stateAttributesMapping:eC.popupStateMapping});return(0,f.jsxs)(e_.Provider,{value:L,children:[w&&!0===E&&C!==ep.REASONS.triggerHover&&(0,f.jsx)(eW.InternalBackdrop,{ref:b.context.internalBackdropRef,inert:(0,eB.inertValue)(!k),cutout:S}),(0,f.jsx)(en.FloatingNode,{id:j,children:_})]})});var eq=e.i(447120),eY=e.i(831354),eX=e.i(482833),eZ=e.i(144909),eJ=e.i(412360),eQ=e.i(615111),e0=e.i(804420);let e1=h.createContext(void 0);function e2(e){let{value:t,children:r}=e;return(0,f.jsx)(e1.Provider,{value:t,children:r})}let e5={...eC.popupStateMapping,...eZ.transitionStatusMapping},e3=h.forwardRef(function(e,t){let{className:r,render:n,initialFocus:a,finalFocus:s,...o}=e,{store:i}=ei(),l=ez(),c=null!=(0,e0.useToolbarRootContext)(!0),{context:d,hasClosePart:u}=function(){let[e,t]=h.useState(0),r=(0,ew.useStableCallback)(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:h.useMemo(()=>({register:r}),[r]),hasClosePart:e>0}}(),m=i.useState("open"),p=i.useState("openMethod"),x=i.useState("instantType"),g=i.useState("transitionStatus"),v=i.useState("popupProps"),b=i.useState("titleElementId"),y=i.useState("descriptionElementId"),j=i.useState("modal"),N=i.useState("mounted"),w=i.useState("openChangeReason"),k=i.useState("activeTriggerElement"),C=i.useState("floatingRootContext");(0,eJ.useOpenChangeComplete)({open:m,ref:i.context.popupRef,onComplete(){m&&i.context.onOpenChangeComplete?.(!0)}});let S=i.useState("disabled"),E=i.useState("openOnHover"),R=i.useState("closeDelay");(0,eX.useHoverFloatingInteraction)(C,{enabled:E&&!S,closeDelay:R});let I=void 0===a?function(e){return"touch"!==e||i.context.popupRef.current}:a,P={open:m,side:l.side,align:l.align,instant:x,transitionStatus:g},T=h.useCallback(e=>{i.set("popupElement",e)},[i]),O=(0,eS.useRenderElement)("div",e,{state:P,ref:[t,i.context.popupRef,T],props:[v,{"aria-labelledby":b,"aria-describedby":y,onKeyDown(e){c&&eQ.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()}},(0,eV.getDisabledMountTransitionStyles)(g),o],stateAttributesMapping:e5});return(0,f.jsx)(eY.FloatingFocusManager,{context:C,openInteractionType:p,modal:!1!==j&&u,disabled:!N||w===ep.REASONS.triggerHover,initialFocus:I,returnFocus:s,restoreFocus:"popup",previousFocusableElement:(0,eq.isHTMLElement)(k)?k:void 0,nextFocusableElement:i.context.triggerFocusTargetRef,beforeContentFocusGuardRef:i.context.beforeContentFocusGuardRef,children:(0,f.jsx)(e2,{value:d,children:O})})}),e4=h.forwardRef(function(e,t){let{className:r,render:n,...a}=e,{store:s}=ei(),o=s.useState("open"),{arrowRef:i,side:l,align:c,arrowUncentered:d,arrowStyles:u}=ez();return(0,eS.useRenderElement)("div",e,{state:{open:o,side:l,align:c,uncentered:d},ref:[t,i],props:[{style:u,"aria-hidden":!0},a],stateAttributesMapping:eC.popupStateMapping})}),e9={...eC.popupStateMapping,...eZ.transitionStatusMapping},e8=h.forwardRef(function(e,t){let{className:r,render:n,...a}=e,{store:s}=ei(),o=s.useState("open"),i=s.useState("mounted"),l=s.useState("transitionStatus"),c=s.useState("openChangeReason");return(0,eS.useRenderElement)("div",e,{state:{open:o,transitionStatus:l},ref:[s.context.backdropRef,t],props:[{role:"presentation",hidden:!i,style:{pointerEvents:c===ep.REASONS.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},a],stateAttributesMapping:e9})}),e7=h.forwardRef(function(e,t){let{render:r,className:n,...a}=e,{store:s}=ei(),o=(0,eP.useBaseUiId)(a.id);return(0,e$.useIsoLayoutEffect)(()=>(s.set("titleElementId",o),()=>{s.set("titleElementId",void 0)}),[s,o]),(0,eS.useRenderElement)("h2",e,{ref:t,props:[{id:o},a]})}),e6=h.forwardRef(function(e,t){let{render:r,className:n,...a}=e,{store:s}=ei(),o=(0,eP.useBaseUiId)(a.id);return(0,e$.useIsoLayoutEffect)(()=>(s.set("descriptionElementId",o),()=>{s.set("descriptionElementId",void 0)}),[s,o]),(0,eS.useRenderElement)("p",e,{ref:t,props:[{id:o},a]})}),te=h.forwardRef(function(e,t){let r,{render:n,className:a,disabled:s=!1,nativeButton:o=!0,...i}=e,{buttonRef:l,getButtonProps:c}=(0,ek.useButton)({disabled:s,focusableWhenDisabled:!1,native:o}),{store:d}=ei();return r=h.useContext(e1),(0,e$.useIsoLayoutEffect)(()=>r?.register(),[r]),(0,eS.useRenderElement)("button",e,{ref:[t,l],props:[{onClick(e){d.setOpen(!1,(0,eb.createChangeEventDetails)(ep.REASONS.closePress,e.nativeEvent,e.currentTarget))}},i,c]})}),tt=((a={}).popupWidth="--popup-width",a.popupHeight="--popup-height",a);var tr=e.i(753099);let tn={activationDirection:e=>e?{"data-activation-direction":e}:null},ta=h.forwardRef(function(e,t){let{render:r,className:n,children:a,...s}=e,{store:o}=ei(),{side:i}=ez(),l=o.useState("instantType"),{children:c,state:d}=(0,tr.usePopupViewport)({store:o,side:i,cssVars:tt,children:a}),u={activationDirection:d.activationDirection,transitioning:d.transitioning,instant:l};return(0,eS.useRenderElement)("div",e,{state:u,ref:t,props:[s,{children:c}],stateAttributesMapping:tn})});class ts{constructor(){this.store=new ev}open(e){let t=e?this.store.context.triggerElements.getById(e)??void 0:void 0;if(e&&!t)throw Error((0,es.default)(80,e));this.store.setOpen(!0,(0,eb.createChangeEventDetails)(ep.REASONS.imperativeAction,void 0,t))}close(){this.store.setOpen(!1,(0,eb.createChangeEventDetails)(ep.REASONS.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}e.s(["Arrow",0,e4,"Backdrop",0,e8,"Close",0,te,"Description",0,e6,"Handle",0,ts,"Popup",0,e3,"Portal",0,eF,"Positioner",0,eK,"Root",0,function(e){return ei(!0)?(0,f.jsx)(eN,{props:e}):(0,f.jsx)(en.FloatingTree,{children:(0,f.jsx)(eN,{props:e})})},"Title",0,e7,"Trigger",0,eM,"Viewport",0,ta,"createHandle",0,function(){return new ts}],244217);var to=e.i(244217),to=to,ti=e.i(937756);function tl({...e}){return(0,f.jsx)(to.Root,{"data-slot":"popover",...e})}function tc({...e}){return(0,f.jsx)(to.Trigger,{"data-slot":"popover-trigger",...e})}function td({className:e,align:t="center",alignOffset:r=0,side:n="bottom",sideOffset:a=4,...s}){return(0,f.jsx)(to.Portal,{children:(0,f.jsx)(to.Positioner,{align:t,alignOffset:r,side:n,sideOffset:a,className:"isolate z-50",children:(0,f.jsx)(to.Popup,{"data-slot":"popover-content",className:(0,ti.cn)("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})})})}var tu=/[\\\/_+.#"@\[\(\{&]/,tm=/[\\\/_+.#"@\[\(\{&]/g,tp=/[\s-]/,tf=/[\s-]/g;function th(e){return e.toLowerCase().replace(tf," ")}function tx(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function tg(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function tv(...e){return t=>{let r=!1,n=e.map(e=>{let n=tg(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():tg(e[t],null)}}}}function tb(...e){return h.useCallback(tv(...e),e)}"u">typeof window&&window.document&&window.document.createElement;var ty=globalThis?.document?h.useLayoutEffect:()=>{},tj=h[" useId ".trim().toString()]||(()=>void 0),tN=0;function tw(e){let[t,r]=h.useState(tj());return ty(()=>{e||r(e=>e??String(tN++))},[e]),e||(t?`radix-${t}`:"")}h[" useEffectEvent ".trim().toString()],h[" useInsertionEffect ".trim().toString()];var tk=h[" useInsertionEffect ".trim().toString()]||ty;function tC(e){var t;let r,n=(t=e,(r=h.forwardRef((e,t)=>{let{children:r,...n}=e;if(h.isValidElement(r)){var a;let e,s,o=(a=r,(s=(e=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.ref:(s=(e=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.props.ref:a.props.ref||a.ref),i=function(e,t){let r={...t};for(let n in t){let a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{let t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==h.Fragment&&(i.ref=t?tv(t,o):o),h.cloneElement(r,i)}return h.Children.count(r)>1?h.Children.only(null):null})).displayName=`${t}.SlotClone`,r),a=h.forwardRef((e,t)=>{let{children:r,...a}=e,s=h.Children.toArray(r),o=s.find(tE);if(o){let e=o.props.children,r=s.map(t=>t!==o?t:h.Children.count(e)>1?h.Children.only(null):h.isValidElement(e)?e.props.children:null);return(0,f.jsx)(n,{...a,ref:t,children:h.isValidElement(e)?h.cloneElement(e,void 0,r):null})}return(0,f.jsx)(n,{...a,ref:t,children:r})});return a.displayName=`${e}.Slot`,a}Symbol("RADIX:SYNC_STATE");var tS=Symbol("radix.slottable");function tE(e){return h.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===tS}var tR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=tC(`Primitive.${t}`),n=h.forwardRef((e,n)=>{let{asChild:a,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,f.jsx)(a?r:t,{...s,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function tI(e){let t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...e)=>t.current?.(...e),[])}var tP="dismissableLayer.update",tT=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tO=h.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:o,onDismiss:i,...l}=e,c=h.useContext(tT),[d,u]=h.useState(null),p=d?.ownerDocument??globalThis?.document,[,x]=h.useState({}),g=tb(t,e=>u(e)),v=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(b),j=d?v.indexOf(d):-1,N=c.layersWithOutsidePointerEventsDisabled.size>0,w=j>=y,k=function(e,t=globalThis?.document){let r=tI(e),n=h.useRef(!1),a=h.useRef(()=>{});return h.useEffect(()=>{let e=e=>{if(e.target&&!n.current){let n=function(){tM("dismissableLayer.pointerDownOutside",r,s,{discrete:!0})},s={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=n,t.addEventListener("click",a.current,{once:!0})):n()}else t.removeEventListener("click",a.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{let t=e.target,r=[...c.branches].some(e=>e.contains(t));w&&!r&&(a?.(e),o?.(e),e.defaultPrevented||i?.())},p),C=function(e,t=globalThis?.document){let r=tI(e),n=h.useRef(!1);return h.useEffect(()=>{let e=e=>{e.target&&!n.current&&tM("dismissableLayer.focusOutside",r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{let t=e.target;![...c.branches].some(e=>e.contains(t))&&(s?.(e),o?.(e),e.defaultPrevented||i?.())},p);return!function(e,t=globalThis?.document){let r=tI(e);h.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{j===c.layers.size-1&&(n?.(e),!e.defaultPrevented&&i&&(e.preventDefault(),i()))},p),h.useEffect(()=>{if(d)return r&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(m=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),tD(),()=>{r&&1===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=m)}},[d,p,r,c]),h.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),tD())},[d,c]),h.useEffect(()=>{let e=()=>x({});return document.addEventListener(tP,e),()=>document.removeEventListener(tP,e)},[]),(0,f.jsx)(tR.div,{...l,ref:g,style:{pointerEvents:N?w?"auto":"none":void 0,...e.style},onFocusCapture:tx(e.onFocusCapture,C.onFocusCapture),onBlurCapture:tx(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:tx(e.onPointerDownCapture,k.onPointerDownCapture)})});function tD(){let e=new CustomEvent(tP);document.dispatchEvent(e)}function tM(e,t,r,{discrete:n}){let a=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});if(t&&a.addEventListener(e,t,{once:!0}),n)a&&E.flushSync(()=>a.dispatchEvent(s));else a.dispatchEvent(s)}tO.displayName="DismissableLayer",h.forwardRef((e,t)=>{let r=h.useContext(tT),n=h.useRef(null),a=tb(t,n);return h.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,f.jsx)(tR.div,{...e,ref:a})}).displayName="DismissableLayerBranch";var tA="focusScope.autoFocusOnMount",tL="focusScope.autoFocusOnUnmount",tF={bubbles:!1,cancelable:!0},tB=h.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...o}=e,[i,l]=h.useState(null),c=tI(a),d=tI(s),u=h.useRef(null),m=tb(t,e=>l(e)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(n){let e=function(e){if(p.paused||!i)return;let t=e.target;i.contains(t)?u.current=t:tz(u.current,{select:!0})},t=function(e){if(p.paused||!i)return;let t=e.relatedTarget;null!==t&&(i.contains(t)||tz(u.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&tz(i)});return i&&r.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[n,i,p.paused]),h.useEffect(()=>{if(i){tU.add(p);let e=document.activeElement;if(!i.contains(e)){let t=new CustomEvent(tA,tF);i.addEventListener(tA,c),i.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let r=document.activeElement;for(let n of e)if(tz(n,{select:t}),document.activeElement!==r)return}(t$(i).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&tz(i))}return()=>{i.removeEventListener(tA,c),setTimeout(()=>{let t=new CustomEvent(tL,tF);i.addEventListener(tL,d),i.dispatchEvent(t),t.defaultPrevented||tz(e??document.body,{select:!0}),i.removeEventListener(tL,d),tU.remove(p)},0)}}},[i,c,d,p]);let x=h.useCallback(e=>{if(!r&&!n||p.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){var s;let t,n=e.currentTarget,[o,i]=[t_(t=t$(s=n),s),t_(t.reverse(),s)];o&&i?e.shiftKey||a!==i?e.shiftKey&&a===o&&(e.preventDefault(),r&&tz(i,{select:!0})):(e.preventDefault(),r&&tz(o,{select:!0})):a===n&&e.preventDefault()}},[r,n,p.paused]);return(0,f.jsx)(tR.div,{tabIndex:-1,...o,ref:m,onKeyDown:x})});function t$(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function t_(e,t){for(let r of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function tz(e,{select:t=!1}={}){if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}tB.displayName="FocusScope";var tU=(n=[],{add(e){let t=n[0];e!==t&&t?.pause(),(n=tW(n,e)).unshift(e)},remove(e){n=tW(n,e),n[0]?.resume()}});function tW(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}var tH=h.forwardRef((e,t)=>{let{container:r,...n}=e,[a,s]=h.useState(!1);ty(()=>s(!0),[]);let o=r||a&&globalThis?.document?.body;return o?E.default.createPortal((0,f.jsx)(tR.div,{...n,ref:t}),o):null});tH.displayName="Portal";var tG=e=>{var t;let r,n,{present:a,children:s}=e,o=function(e){var t,r;let[n,a]=h.useState(),s=h.useRef(null),o=h.useRef(e),i=h.useRef("none"),[l,c]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},h.useReducer((e,t)=>r[e][t]??e,t));return h.useEffect(()=>{let e=tV(s.current);i.current="mounted"===l?e:"none"},[l]),ty(()=>{let t=s.current,r=o.current;if(r!==e){let n=i.current,a=tV(t);e?c("MOUNT"):"none"===a||t?.display==="none"?c("UNMOUNT"):r&&n!==a?c("ANIMATION_OUT"):c("UNMOUNT"),o.current=e}},[e,c]),ty(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=r=>{let a=tV(s.current).includes(CSS.escape(r.animationName));if(r.target===n&&a&&(c("ANIMATION_END"),!o.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},a=e=>{e.target===n&&(i.current=tV(s.current))};return n.addEventListener("animationstart",a),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",a),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(e=>{s.current=e?getComputedStyle(e):null,a(e)},[])}}(a),i="function"==typeof s?s({present:o.isPresent}):h.Children.only(s),l=tb(o.ref,(t=i,(n=(r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof s||o.isPresent?h.cloneElement(i,{ref:l}):null};function tV(e){return e?.animationName||"none"}tG.displayName="Presence";var tK=0;function tq(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var tY=function(){return(tY=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function tX(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)0>t.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}var tZ=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),tJ="width-before-scroll-bar";function tQ(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var t0="u">typeof window?h.useLayoutEffect:h.useEffect,t1=new WeakMap,t2=(void 0===s&&(s={}),(void 0===o&&(o=function(e){return e}),i=[],l=!1,c={read:function(){if(l)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:null},useMedium:function(e){var t=o(e,l);return i.push(t),function(){i=i.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(l=!0;i.length;){var t=i;i=[],t.forEach(e)}i={push:function(t){return e(t)},filter:function(){return i}}},assignMedium:function(e){l=!0;var t=[];if(i.length){var r=i;i=[],r.forEach(e),t=i}var n=function(){var r=t;t=[],r.forEach(e)},a=function(){return Promise.resolve().then(n)};a(),i={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),i}}}}).options=tY({async:!0,ssr:!1},s),c),t5=function(){},t3=h.forwardRef(function(e,t){var r,n,a,s,o=h.useRef(null),i=h.useState({onScrollCapture:t5,onWheelCapture:t5,onTouchMoveCapture:t5}),l=i[0],c=i[1],d=e.forwardProps,u=e.children,m=e.className,p=e.removeScrollBar,f=e.enabled,x=e.shards,g=e.sideCar,v=e.noRelative,b=e.noIsolation,y=e.inert,j=e.allowPinchZoom,N=e.as,w=e.gapMode,k=tX(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=(r=[o,t],n=function(e){return r.forEach(function(t){return tQ(t,e)})},(a=(0,h.useState)(function(){return{value:null,callback:n,facade:{get current(){return a.value},set current(value){var e=a.value;e!==value&&(a.value=value,a.callback(value,e))}}}})[0]).callback=n,s=a.facade,t0(function(){var e=t1.get(s);if(e){var t=new Set(e),n=new Set(r),a=s.current;t.forEach(function(e){n.has(e)||tQ(e,null)}),n.forEach(function(e){t.has(e)||tQ(e,a)})}t1.set(s,r)},[r]),s),S=tY(tY({},k),l);return h.createElement(h.Fragment,null,f&&h.createElement(g,{sideCar:t2,removeScrollBar:p,shards:x,noRelative:v,noIsolation:b,inert:y,setCallbacks:c,allowPinchZoom:!!j,lockRef:o,gapMode:w}),d?h.cloneElement(h.Children.only(u),tY(tY({},S),{ref:C})):h.createElement(void 0===N?"div":N,tY({},S,{className:m,ref:C}),u))});t3.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},t3.classNames={fullWidth:tJ,zeroRight:tZ};var t4=function(e){var t=e.sideCar,r=tX(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return h.createElement(n,tY({},r))};t4.isSideCarExport=!0;var t9=function(){var e=0,t=null;return{add:function(r){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=p||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var n,a;(n=t).styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r)),a=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(a)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},t8=function(){var e=t9();return function(t,r){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},t7=function(){var e=t8();return function(t){return e(t.styles,t.dynamic),null}},t6={left:0,top:0,right:0,gap:0},re=function(e){return parseInt(e||"",10)||0},rt=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[re(r),re(n),re(a)]},rr=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return t6;var t=rt(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},rn=t7(),ra="data-scroll-locked",rs=function(e,t,r,n){var a=e.left,s=e.top,o=e.right,i=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(i,"px ").concat(n,";\n }\n body[").concat(ra,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(s,"px;\n padding-right: ").concat(o,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(i,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(i,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(tZ," {\n right: ").concat(i,"px ").concat(n,";\n }\n \n .").concat(tJ," {\n margin-right: ").concat(i,"px ").concat(n,";\n }\n \n .").concat(tZ," .").concat(tZ," {\n right: 0 ").concat(n,";\n }\n \n .").concat(tJ," .").concat(tJ," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(ra,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(i,"px;\n }\n")},ro=function(){var e=parseInt(document.body.getAttribute(ra)||"0",10);return isFinite(e)?e:0},ri=function(){h.useEffect(function(){return document.body.setAttribute(ra,(ro()+1).toString()),function(){var e=ro()-1;e<=0?document.body.removeAttribute(ra):document.body.setAttribute(ra,e.toString())}},[])},rl=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=void 0===n?"margin":n;ri();var s=h.useMemo(function(){return rr(a)},[a]);return h.createElement(rn,{styles:rs(s,!t,a,r?"":"!important")})},rc=!1;if("u">typeof window)try{var rd=Object.defineProperty({},"passive",{get:function(){return rc=!0,!0}});window.addEventListener("test",rd,rd),window.removeEventListener("test",rd,rd)}catch(e){rc=!1}var ru=!!rc&&{passive:!1},rm=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&(r.overflowY!==r.overflowX||"TEXTAREA"===e.tagName||"visible"!==r[t])},rp=function(e,t){var r=t.ownerDocument,n=t;do{if("u">typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),rf(e,n)){var a=rh(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body)return!1},rf=function(e,t){return"v"===e?rm(t,"overflowY"):rm(t,"overflowX")},rh=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},rx=function(e,t,r,n,a){var s,o=(s=window.getComputedStyle(t).direction,"h"===e&&"rtl"===s?-1:1),i=o*n,l=r.target,c=t.contains(l),d=!1,u=i>0,m=0,p=0;do{if(!l)break;var f=rh(e,l),h=f[0],x=f[1]-f[2]-o*h;(h||x)&&rf(e,l)&&(m+=x,p+=h);var g=l.parentNode;l=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&l!==document.body||c&&(t.contains(l)||t===l))return u&&(a&&1>Math.abs(m)||!a&&i>m)?d=!0:!u&&(a&&1>Math.abs(p)||!a&&-i>p)&&(d=!0),d},rg=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rv=function(e){return[e.deltaX,e.deltaY]},rb=function(e){return e&&"current"in e?e.current:e},ry=0,rj=[];let rN=(d=function(e){var t=h.useRef([]),r=h.useRef([0,0]),n=h.useRef(),a=h.useState(ry++)[0],s=h.useState(t7)[0],o=h.useRef(e);h.useEffect(function(){o.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=(function(e,t,r){if(r||2==arguments.length)for(var n,a=0,s=t.length;a<s;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(rb),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var i=h.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var a,s=rg(e),i=r.current,l="deltaX"in e?e.deltaX:i[0]-s[0],c="deltaY"in e?e.deltaY:i[1]-s[1],d=e.target,u=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var m=window.getSelection(),p=m&&m.anchorNode;if(p&&(p===d||p.contains(d)))return!1;var f=rp(u,d);if(!f)return!0;if(f?a=u:(a="v"===u?"h":"v",f=rp(u,d)),!f)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=a),!a)return!0;var h=n.current||a;return rx(h,t,e,"h"===h?l:c,!0)},[]),l=h.useCallback(function(e){if(rj.length&&rj[rj.length-1]===s){var r="deltaY"in e?rv(e):rg(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta,n[0]===r[0]&&n[1]===r[1])})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var a=(o.current.shards||[]).map(rb).filter(Boolean).filter(function(t){return t.contains(e.target)});(a.length>0?i(e,a[0]):!o.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=h.useCallback(function(e,r,n,a){var s={name:e,delta:r,target:n,should:a,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(s),setTimeout(function(){t.current=t.current.filter(function(e){return e!==s})},1)},[]),d=h.useCallback(function(e){r.current=rg(e),n.current=void 0},[]),u=h.useCallback(function(t){c(t.type,rv(t),t.target,i(t,e.lockRef.current))},[]),m=h.useCallback(function(t){c(t.type,rg(t),t.target,i(t,e.lockRef.current))},[]);h.useEffect(function(){return rj.push(s),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:m}),document.addEventListener("wheel",l,ru),document.addEventListener("touchmove",l,ru),document.addEventListener("touchstart",d,ru),function(){rj=rj.filter(function(e){return e!==s}),document.removeEventListener("wheel",l,ru),document.removeEventListener("touchmove",l,ru),document.removeEventListener("touchstart",d,ru)}},[]);var p=e.removeScrollBar,f=e.inert;return h.createElement(h.Fragment,null,f?h.createElement(s,{styles:"\n .block-interactivity-".concat(a," {pointer-events: none;}\n .allow-interactivity-").concat(a," {pointer-events: all;}\n")}):null,p?h.createElement(rl,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},t2.useMedium(d),t4);var rw=h.forwardRef(function(e,t){return h.createElement(t3,tY({},e,{ref:t,sideCar:rN}))});rw.classNames=t3.classNames;var rk=new WeakMap,rC=new WeakMap,rS={},rE=0,rR=function(e){return e&&(e.host||rR(e.parentNode))},rI=function(e,t,r,n){var a=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var r=rR(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});rS[r]||(rS[r]=new WeakMap);var s=rS[r],o=[],i=new Set,l=new Set(a),c=function(e){!e||i.has(e)||(i.add(e),c(e.parentNode))};a.forEach(c);var d=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(i.has(e))d(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,l=(rk.get(e)||0)+1,c=(s.get(e)||0)+1;rk.set(e,l),s.set(e,c),o.push(e),1===l&&a&&rC.set(e,!0),1===c&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return d(t),i.clear(),rE++,function(){o.forEach(function(e){var t=rk.get(e)-1,a=s.get(e)-1;rk.set(e,t),s.set(e,a),t||(rC.has(e)||e.removeAttribute(n),rC.delete(e)),a||e.removeAttribute(r)}),--rE||(rk=new WeakMap,rk=new WeakMap,rC=new WeakMap,rS={})}},rP=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),rI(n,a,r,"aria-hidden")):function(){return null}},rT="Dialog",[rO,rD]=function(e,t=[]){let r=[],n=()=>{let t=r.map(e=>h.createContext(e));return function(r){let n=r?.[e]||t;return h.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return n.scopeName=e,[function(t,n){let a=h.createContext(n),s=r.length;r=[...r,n];let o=t=>{let{scope:r,children:n,...o}=t,i=r?.[e]?.[s]||a,l=h.useMemo(()=>o,Object.values(o));return(0,f.jsx)(i.Provider,{value:l,children:n})};return o.displayName=t+"Provider",[o,function(r,o){let i=o?.[e]?.[s]||a,l=h.useContext(i);if(l)return l;if(void 0!==n)return n;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let n=r.reduce((t,{useScope:r,scopeName:n})=>{let a=r(e)[`__scope${n}`];return{...t,...a}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}(n,...t)]}(rT),[rM,rA]=rO(rT),rL=e=>{let{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:s,modal:o=!0}=e,i=h.useRef(null),l=h.useRef(null),[c,d]=function({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[a,s,o]=function({defaultProp:e,onChange:t}){let[r,n]=h.useState(e),a=h.useRef(r),s=h.useRef(t);return tk(()=>{s.current=t},[t]),h.useEffect(()=>{a.current!==r&&(s.current?.(r),a.current=r)},[r,a]),[r,n,s]}({defaultProp:t,onChange:r}),i=void 0!==e,l=i?e:a;{let t=h.useRef(void 0!==e);h.useEffect(()=>{let e=t.current;if(e!==i){let t=i?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=i},[i,n])}return[l,h.useCallback(t=>{if(i){let r="function"==typeof t?t(e):t;r!==e&&o.current?.(r)}else s(t)},[i,e,s,o])]}({prop:n,defaultProp:a??!1,onChange:s,caller:rT});return(0,f.jsx)(rM,{scope:t,triggerRef:i,contentRef:l,contentId:tw(),titleId:tw(),descriptionId:tw(),open:c,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(e=>!e),[d]),modal:o,children:r})};rL.displayName=rT;var rF="DialogTrigger";h.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=rA(rF,r),s=tb(t,a.triggerRef);return(0,f.jsx)(tR.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":r0(a.open),...n,ref:s,onClick:tx(e.onClick,a.onOpenToggle)})}).displayName=rF;var rB="DialogPortal",[r$,r_]=rO(rB,{forceMount:void 0}),rz=e=>{let{__scopeDialog:t,forceMount:r,children:n,container:a}=e,s=rA(rB,t);return(0,f.jsx)(r$,{scope:t,forceMount:r,children:h.Children.map(n,e=>(0,f.jsx)(tG,{present:r||s.open,children:(0,f.jsx)(tH,{asChild:!0,container:a,children:e})}))})};rz.displayName=rB;var rU="DialogOverlay",rW=h.forwardRef((e,t)=>{let r=r_(rU,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,s=rA(rU,e.__scopeDialog);return s.modal?(0,f.jsx)(tG,{present:n||s.open,children:(0,f.jsx)(rG,{...a,ref:t})}):null});rW.displayName=rU;var rH=tC("DialogOverlay.RemoveScroll"),rG=h.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=rA(rU,r);return(0,f.jsx)(rw,{as:rH,allowPinchZoom:!0,shards:[a.contentRef],children:(0,f.jsx)(tR.div,{"data-state":r0(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),rV="DialogContent",rK=h.forwardRef((e,t)=>{let r=r_(rV,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,s=rA(rV,e.__scopeDialog);return(0,f.jsx)(tG,{present:n||s.open,children:s.modal?(0,f.jsx)(rq,{...a,ref:t}):(0,f.jsx)(rY,{...a,ref:t})})});rK.displayName=rV;var rq=h.forwardRef((e,t)=>{let r=rA(rV,e.__scopeDialog),n=h.useRef(null),a=tb(t,r.contentRef,n);return h.useEffect(()=>{let e=n.current;if(e)return rP(e)},[]),(0,f.jsx)(rX,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:tx(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:tx(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:tx(e.onFocusOutside,e=>e.preventDefault())})}),rY=h.forwardRef((e,t)=>{let r=rA(rV,e.__scopeDialog),n=h.useRef(!1),a=h.useRef(!1);return(0,f.jsx)(rX,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let s=t.target;r.triggerRef.current?.contains(s)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),rX=h.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:s,...o}=e,i=rA(rV,r),l=h.useRef(null),c=tb(t,l);return h.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tq()),document.body.insertAdjacentElement("beforeend",e[1]??tq()),tK++,()=>{1===tK&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),tK--}},[]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(tB,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:s,children:(0,f.jsx)(tO,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":r0(i.open),...o,ref:c,onDismiss:()=>i.onOpenChange(!1)})}),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(r3,{titleId:i.titleId}),(0,f.jsx)(r4,{contentRef:l,descriptionId:i.descriptionId})]})]})}),rZ="DialogTitle";h.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=rA(rZ,r);return(0,f.jsx)(tR.h2,{id:a.titleId,...n,ref:t})}).displayName=rZ;var rJ="DialogDescription";h.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=rA(rJ,r);return(0,f.jsx)(tR.p,{id:a.descriptionId,...n,ref:t})}).displayName=rJ;var rQ="DialogClose";function r0(e){return e?"open":"closed"}h.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=rA(rQ,r);return(0,f.jsx)(tR.button,{type:"button",...n,ref:t,onClick:tx(e.onClick,()=>a.onOpenChange(!1))})}).displayName=rQ;var r1="DialogTitleWarning",[r2,r5]=(u={contentName:rV,titleName:rZ,docsSlug:"dialog"},t=h.createContext(u),(r=e=>{let{children:r,...n}=e,a=h.useMemo(()=>n,Object.values(n));return(0,f.jsx)(t.Provider,{value:a,children:r})}).displayName=r1+"Provider",[r,function(e){let r=h.useContext(t);if(r)return r;if(void 0!==u)return u;throw Error(`\`${e}\` must be used within \`${r1}\``)}]),r3=({titleId:e})=>{let t=r5(r1),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
2
2
 
3
3
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
4
4
 
5
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},r4=({contentRef:e,descriptionId:t})=>{let r=r5("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return h.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},r8=Symbol.for("react.lazy"),r9=h[" use ".trim().toString()];function r7(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===r8&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var r6=Symbol("radix.slottable");function ne(e){return h.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===r6}var nt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{var r,n;let a,s,o,i=(n=r=`Primitive.${t}`,(a=h.forwardRef((e,t)=>{let{children:r,...n}=e;if(r7(r)&&"function"==typeof r9&&(r=r9(r._payload)),h.isValidElement(r)){var a;let e,s,o=(a=r,(s=(e=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.ref:(s=(e=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.props.ref:a.props.ref||a.ref),i=function(e,t){let r={...t};for(let n in t){let a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{let t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==h.Fragment&&(i.ref=t?tv(t,o):o),h.cloneElement(r,i)}return h.Children.count(r)>1?h.Children.only(null):null})).displayName=`${n}.SlotClone`,s=a,(o=h.forwardRef((e,t)=>{let{children:r,...n}=e;r7(r)&&"function"==typeof r9&&(r=r9(r._payload));let a=h.Children.toArray(r),o=a.find(ne);if(o){let e=o.props.children,r=a.map(t=>t!==o?t:h.Children.count(e)>1?h.Children.only(null):h.isValidElement(e)?e.props.children:null);return(0,f.jsx)(s,{...n,ref:t,children:h.isValidElement(e)?h.cloneElement(e,void 0,r):null})}return(0,f.jsx)(s,{...n,ref:t,children:r})})).displayName=`${r}.Slot`,o),l=h.forwardRef((e,r)=>{let{asChild:n,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,f.jsx)(n?i:t,{...a,ref:r})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{}),nr='[cmdk-group=""]',nn='[cmdk-group-items=""]',na='[cmdk-item=""]',ns=`${na}:not([aria-disabled="true"])`,no="cmdk-item-select",ni="data-value",nl=(e,t,r)=>{var n;return n=e,function e(t,r,n,a,s,o,i){if(o===r.length)return s===t.length?1:.99;var l=`${s},${o}`;if(void 0!==i[l])return i[l];for(var c,d,u,m,p=a.charAt(o),f=n.indexOf(p,s),h=0;f>=0;)(c=e(t,r,n,a,f+1,o+1,i))>h&&(f===s?c*=1:tu.test(t.charAt(f-1))?(c*=.8,(u=t.slice(s,f-1).match(tm))&&s>0&&(c*=Math.pow(.999,u.length))):tp.test(t.charAt(f-1))?(c*=.9,(m=t.slice(s,f-1).match(tf))&&s>0&&(c*=Math.pow(.999,m.length))):(c*=.17,s>0&&(c*=Math.pow(.999,f-s))),t.charAt(f)!==r.charAt(o)&&(c*=.9999)),(c<.1&&n.charAt(f-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(f-1)!==a.charAt(o))&&.1*(d=e(t,r,n,a,f+1,o+2,i))>c&&(c=.1*d),c>h&&(h=c),f=n.indexOf(p,f+1);return i[l]=h,h}(n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,t,th(n),th(t),0,0,{})},nc=h.createContext(void 0),nd=h.createContext(void 0),nu=h.createContext(void 0),nm=h.forwardRef((e,t)=>{let r=nN(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=nN(()=>new Set),a=nN(()=>new Map),s=nN(()=>new Map),o=nN(()=>new Set),i=ny(e),{label:l,children:c,value:d,onValueChange:u,filter:m,shouldFilter:p,loop:f,disablePointerSelection:x=!1,vimBindings:g=!0,...v}=e,b=tw(),y=tw(),j=tw(),N=h.useRef(null),w=nC();nj(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,k.emit()}},[d]),nj(()=>{w(6,P)},[]);let k=h.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,s,o,l;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)I(),E(),w(1,R);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(j);e?e.focus():null==(a=document.getElementById(b))||a.focus()}if(w(7,()=>{var e;r.current.selectedItemId=null==(e=T())?void 0:e.id,k.emit()}),n||w(5,P),(null==(s=i.current)?void 0:s.value)!==void 0){null==(l=(o=i.current).onValueChange)||l.call(o,null!=t?t:"");return}}k.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),C=h.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=s.current.get(e))?void 0:a.value)&&(s.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,S(t,n)),w(2,()=>{E(),k.emit()}))},item:(e,t)=>(n.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),w(3,()=>{I(),E(),r.current.value||R(),k.emit()}),()=>{s.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=T();w(4,()=>{I(),(null==t?void 0:t.getAttribute("id"))===e&&R(),k.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{s.current.delete(e),a.current.delete(e)}),filter:()=>i.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:b,inputId:j,labelId:y,listInnerRef:N}),[]);function S(e,t){var n,a;let s=null!=(a=null==(n=i.current)?void 0:n.filter)?a:nl;return e?s(e,r.current.search,t):0}function E(){if(!r.current.search||!1===i.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=a.current.get(r),s=0;n.forEach(t=>{s=Math.max(e.get(t),s)}),t.push([r,s])});let n=N.current;O().sort((t,r)=>{var n,a;let s=t.getAttribute("id"),o=r.getAttribute("id");return(null!=(n=e.get(o))?n:0)-(null!=(a=e.get(s))?a:0)}).forEach(e=>{let t=e.closest(nn);t?t.appendChild(e.parentElement===t?e:e.closest(`${nn} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${nn} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=N.current)?void 0:t.querySelector(`${nr}[${ni}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function R(){let e=O().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(ni);k.setState("value",t||void 0)}function I(){var e,t,o,l;if(!r.current.search||!1===i.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let c=0;for(let a of n.current){let n=S(null!=(t=null==(e=s.current.get(a))?void 0:e.value)?t:"",null!=(l=null==(o=s.current.get(a))?void 0:o.keywords)?l:[]);r.current.filtered.items.set(a,n),n>0&&c++}for(let[e,t]of a.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function P(){var e,t,r;let n=T();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(nr))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function T(){var e;return null==(e=N.current)?void 0:e.querySelector(`${na}[aria-selected="true"]`)}function O(){var e;return Array.from((null==(e=N.current)?void 0:e.querySelectorAll(ns))||[])}function D(e){let t=O()[e];t&&k.setState("value",t.getAttribute(ni))}function M(e){var t;let r=T(),n=O(),a=n.findIndex(e=>e===r),s=n[a+e];null!=(t=i.current)&&t.loop&&(s=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),s&&k.setState("value",s.getAttribute(ni))}function A(e){let t=T(),r=null==t?void 0:t.closest(nr),n;for(;r&&!n;)n=null==(r=e>0?function(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}(r,nr):function(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}(r,nr))?void 0:r.querySelector(ns);n?k.setState("value",n.getAttribute(ni)):M(e)}let L=()=>D(O().length-1),F=e=>{e.preventDefault(),e.metaKey?L():e.altKey?A(1):M(1)},B=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?A(-1):M(-1)};return h.createElement(nt.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=v.onKeyDown)||t.call(v,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":g&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":g&&e.ctrlKey&&B(e);break;case"ArrowUp":B(e);break;case"Home":e.preventDefault(),D(0);break;case"End":e.preventDefault(),L();break;case"Enter":{e.preventDefault();let t=T();if(t){let e=new Event(no);t.dispatchEvent(e)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:nE},l),nS(e,e=>h.createElement(nd.Provider,{value:k},h.createElement(nc.Provider,{value:C},e))))}),np=h.forwardRef((e,t)=>{var r,n;let a=tw(),s=h.useRef(null),o=h.useContext(nu),i=h.useContext(nc),l=ny(e),c=null!=(n=null==(r=l.current)?void 0:r.forceMount)?n:null==o?void 0:o.forceMount;nj(()=>{if(!c)return i.item(a,null==o?void 0:o.id)},[c]);let d=nk(a,s,[e.value,e.children,s],e.keywords),u=h.useContext(nd),m=nw(e=>e.value&&e.value===d.current),p=nw(e=>!!c||!1===i.filter()||!e.search||e.filtered.items.get(a)>0);function f(){var e,t;x(),null==(t=(e=l.current).onSelect)||t.call(e,d.current)}function x(){u.setState("value",d.current,!0)}if(h.useEffect(()=>{let t=s.current;if(!(!t||e.disabled))return t.addEventListener(no,f),()=>t.removeEventListener(no,f)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:g,value:v,onSelect:b,forceMount:y,keywords:j,...N}=e;return h.createElement(nt.div,{ref:tv(s,t),...N,id:a,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!m,"data-disabled":!!g,"data-selected":!!m,onPointerMove:g||i.getDisablePointerSelection()?void 0:x,onClick:g?void 0:f},e.children)}),nf=h.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:a,...s}=e,o=tw(),i=h.useRef(null),l=h.useRef(null),c=tw(),d=h.useContext(nc),u=nw(e=>!!a||!1===d.filter()||!e.search||e.filtered.groups.has(o));nj(()=>d.group(o),[]),nk(o,i,[e.value,e.heading,l]);let m=h.useMemo(()=>({id:o,forceMount:a}),[a]);return h.createElement(nt.div,{ref:tv(i,t),...s,"cmdk-group":"",role:"presentation",hidden:!u||void 0},r&&h.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},r),nS(e,e=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},h.createElement(nu.Provider,{value:m},e))))}),nh=h.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,a=h.useRef(null),s=nw(e=>!e.search);return r||s?h.createElement(nt.div,{ref:tv(a,t),...n,"cmdk-separator":"",role:"separator"}):null}),nx=h.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,a=null!=e.value,s=h.useContext(nd),o=nw(e=>e.search),i=nw(e=>e.selectedItemId),l=h.useContext(nc);return h.useEffect(()=>{null!=e.value&&s.setState("search",e.value)},[e.value]),h.createElement(nt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":i,id:l.inputId,type:"text",value:a?e.value:o,onChange:e=>{a||s.setState("search",e.target.value),null==r||r(e.target.value)}})}),ng=h.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,s=h.useRef(null),o=h.useRef(null),i=nw(e=>e.selectedItemId),l=h.useContext(nc);return h.useEffect(()=>{if(o.current&&s.current){let e=o.current,t=s.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;t.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),h.createElement(nt.div,{ref:tv(s,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":n,id:l.listId},nS(e,e=>h.createElement("div",{ref:tv(o,l.listInnerRef),"cmdk-list-sizer":""},e)))}),nv=h.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:s,container:o,...i}=e;return h.createElement(rL,{open:r,onOpenChange:n},h.createElement(rz,{container:o},h.createElement(rW,{"cmdk-overlay":"",className:a}),h.createElement(rK,{"aria-label":e.label,"cmdk-dialog":"",className:s},h.createElement(nm,{ref:t,...i}))))}),nb=Object.assign(nm,{List:ng,Item:np,Input:nx,Group:nf,Separator:nh,Dialog:nv,Empty:h.forwardRef((e,t)=>nw(e=>0===e.filtered.count)?h.createElement(nt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:h.forwardRef((e,t)=>{let{progress:r,children:n,label:a="Loading...",...s}=e;return h.createElement(nt.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},nS(e,e=>h.createElement("div",{"aria-hidden":!0},e)))})});function ny(e){let t=h.useRef(e);return nj(()=>{t.current=e}),t}var nj="u"<typeof window?h.useEffect:h.useLayoutEffect;function nN(e){let t=h.useRef();return void 0===t.current&&(t.current=e()),t}function nw(e){let t=h.useContext(nd),r=()=>e(t.snapshot());return h.useSyncExternalStore(t.subscribe,r,r)}function nk(e,t,r,n=[]){let a=h.useRef(),s=h.useContext(nc);return nj(()=>{var o;let i=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),l=n.map(e=>e.trim());s.value(e,i,l),null==(o=t.current)||o.setAttribute(ni,i),a.current=i}),a}var nC=()=>{let[e,t]=h.useState(),r=nN(()=>new Map);return nj(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function nS({asChild:e,children:t},r){let n;return e&&h.isValidElement(t)?h.cloneElement("function"==typeof(n=t.type)?n(t.props):"render"in n?n.render(t.props):t,{ref:t.ref},r(t.props.children)):r(t)}var nE={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},nR=e.i(164688);function nI({className:e,...t}){return(0,f.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,ti.cn)("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}let nP=(0,nR.cva)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function nT({className:e,align:t="inline-start",...r}){return(0,f.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:(0,ti.cn)(nP({align:t}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...r})}(0,nR.cva)("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});var nO=e.i(142296),nO=nO,nD=e.i(209760);function nM({className:e,...t}){return(0,f.jsx)(nb,{"data-slot":"command",className:(0,ti.cn)("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",e),...t})}function nA({className:e,...t}){return(0,f.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,f.jsxs)(nI,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[(0,f.jsx)(nb.Input,{"data-slot":"command-input",className:(0,ti.cn)("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t}),(0,f.jsx)(nT,{children:(0,f.jsx)(nO.default,{className:"size-4 shrink-0 opacity-50"})})]})})}function nL({className:e,...t}){return(0,f.jsx)(nb.List,{"data-slot":"command-list",className:(0,ti.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...t})}function nF({className:e,...t}){return(0,f.jsx)(nb.Empty,{"data-slot":"command-empty",className:(0,ti.cn)("py-6 text-center text-sm",e),...t})}function nB({className:e,...t}){return(0,f.jsx)(nb.Group,{"data-slot":"command-group",className:(0,ti.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...t})}function n$({className:e,children:t,...r}){return(0,f.jsxs)(nb.Item,{"data-slot":"command-item",className:(0,ti.cn)("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",e),...r,children:[t,(0,f.jsx)(nD.CheckIcon,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}var n_=e.i(543485);let nz=(0,n_.createServerReference)("40f524d6493153a89d590b16ee996054b3514860a3",n_.callServer,void 0,n_.findSourceMapURL,"getProjectBranches"),nU=(0,n_.createServerReference)("40a5f85730bae3711a1ed0a8c8898d5153719e0b91",n_.callServer,void 0,n_.findSourceMapURL,"fetchRemoteBranches"),nW=(0,n_.createServerReference)("400a68fcfd8e23d942b0e9b2d92885f07ea2c1d72c",n_.callServer,void 0,n_.findSourceMapURL,"getCurrentBranch");function nH({open:e,onOpenChange:t,onSubmit:r,onUpdate:n,defaultStatus:a="TODO",editTask:s,editTaskLabelIds:o,labels:i,projectType:l,projectLocalPath:c}){let[d,u]=(0,h.useState)(""),[m,p]=(0,h.useState)(""),[x,g]=(0,h.useState)("MEDIUM"),[v,b]=(0,h.useState)(""),[y,N]=(0,h.useState)([]),[w,k]=(0,h.useState)([]),[S,E]=(0,h.useState)(!1),[I,P]=(0,h.useState)(""),[T,O]=(0,h.useState)(!1),[D,M]=(0,h.useState)(!0),{t:A}=(0,j.useI18n)(),L=!!s,F=!!c;return(0,h.useEffect)(()=>{s?(u(s.title),p(s.description??""),g(s.priority),b(s.subPath??""),N(o??[])):(u(""),p(""),g("MEDIUM"),b(""),N([]))},[s,o]),(0,h.useEffect)(()=>{e||s||(u(""),p(""),g("MEDIUM"),b(""),N([]),k([]),P(""),O(!1))},[e,s]),(0,h.useEffect)(()=>{e&&F&&!s&&(E(!0),Promise.all([nz(c),nW(c)]).then(([e,t])=>{k(e),P(t&&e.includes(t)?t:e[0]??""),E(!1),nU(c).then(()=>{setTimeout(()=>{nz(c).then(e=>{k(e),P(t=>e.includes(t)?t:e[0]??"")}).catch(()=>{})},3e3)})}).catch(()=>{k([]),P(""),E(!1)}))},[e,F,c,s]),(0,f.jsx)(U.Dialog,{open:e,onOpenChange:t,disablePointerDismissal:!0,children:(0,f.jsxs)(U.DialogContent,{className:"sm:max-w-md",children:[(0,f.jsx)(U.DialogHeader,{children:(0,f.jsx)(U.DialogTitle,{children:L?A("task.edit"):A("task.create")})}),(0,f.jsxs)("div",{className:"space-y-4 py-2",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Y.Label,{htmlFor:"title",children:A("task.title")}),(0,f.jsx)(K.Input,{id:"title","data-testid":"task-title",placeholder:A("task.titlePlaceholder"),value:d,onChange:e=>u(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault()})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Y.Label,{htmlFor:"description",children:A("task.description")}),(0,f.jsx)(q.Textarea,{id:"description",placeholder:A("task.descPlaceholder"),rows:4,value:m,onChange:e=>p(e.target.value),className:"max-h-[200px] overflow-y-auto"})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Y.Label,{htmlFor:"subPath",children:A("task.subPath")}),(0,f.jsx)(K.Input,{id:"subPath",placeholder:A("task.subPathPlaceholder"),value:v,onChange:e=>b(e.target.value)}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:A("task.subPathHint")})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Y.Label,{children:A("task.priority")}),(0,f.jsx)("div",{className:"flex gap-1.5",children:["LOW","MEDIUM","HIGH","CRITICAL"].map(e=>{let t={LOW:{label:A("task.priorityLow"),style:"text-slate-300 border-slate-500/30 bg-slate-500/10"},MEDIUM:{label:A("task.priorityMedium"),style:"text-amber-300 border-amber-500/30 bg-amber-500/10"},HIGH:{label:A("task.priorityHigh"),style:"text-orange-300 border-orange-500/30 bg-orange-500/10"},CRITICAL:{label:A("task.priorityCritical"),style:"text-rose-300 border-rose-500/30 bg-rose-500/10"}}[e];return(0,f.jsx)("button",{type:"button",onClick:()=>g(e),className:`rounded-lg border px-3 py-1.5 text-xs font-medium transition-all ${x===e?`${t.style} ring-1 ring-current/20`:"border-border text-muted-foreground hover:bg-accent"}`,children:t.label},e)})})]}),F&&!L&&(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Y.Label,{children:A("task.baseBranch")}),S?(0,f.jsx)("div",{className:"text-sm text-muted-foreground",children:A("task.branchLoading")}):w.length>0?(0,f.jsxs)(tl,{open:T,onOpenChange:O,children:[(0,f.jsxs)(tc,{className:"flex w-full items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-mono transition-colors hover:bg-accent focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"branch-selector",children:[(0,f.jsx)(X.GitBranch,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,f.jsx)("span",{className:"flex-1 truncate text-left text-xs",children:I||A("task.branchNone")}),(0,f.jsx)(Z,{className:"h-3.5 w-3.5 shrink-0 opacity-50"})]}),(0,f.jsx)(td,{className:"p-0",align:"start",children:(0,f.jsxs)(nM,{children:[(0,f.jsx)(nA,{placeholder:A("task.branchSearch")}),(0,f.jsxs)(nL,{children:[(0,f.jsx)(nF,{children:A("task.branchNone")}),(0,f.jsx)(nB,{children:w.map(e=>(0,f.jsxs)(n$,{value:e,onSelect:()=>{P(e),O(!1)},children:[(0,f.jsx)(X.GitBranch,{className:"h-3 w-3 text-muted-foreground shrink-0 mr-2"}),(0,f.jsx)("span",{className:"flex-1 truncate font-mono",children:e}),e===I&&(0,f.jsx)(R.Check,{className:"h-3 w-3 text-primary shrink-0 ml-auto"})]},e))})]})]})})]}):(0,f.jsx)("div",{className:"text-sm text-muted-foreground",children:A("task.branchNone")}),(0,f.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,f.jsx)(Y.Label,{className:"text-xs text-muted-foreground",children:A("task.worktreeLabel")}),(0,f.jsx)("div",{className:"flex gap-1",children:[!0,!1].map(e=>(0,f.jsx)("button",{type:"button",onClick:()=>M(e),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${D===e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e?A("task.worktreeYes"):A("task.worktreeNo")},String(e)))})]})]}),i.length>0&&(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Y.Label,{children:A("task.labels")}),(0,f.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.map(e=>{let t=y.includes(e.id);return(0,f.jsx)("button",{type:"button",onClick:()=>{N(r=>t?r.filter(t=>t!==e.id):[...r,e.id])},className:`rounded-full px-2.5 py-1 text-xs font-medium transition-all ${t?"ring-1 ring-current/30":"opacity-50 hover:opacity-80"}`,style:{backgroundColor:e.color+"20",color:e.color,borderColor:t?e.color+"40":"transparent",borderWidth:"1px"},children:e.name},e.id)})})]})]}),(0,f.jsxs)(U.DialogFooter,{children:[(0,f.jsx)(C.Button,{variant:"outline",onClick:()=>t(!1),children:A("common.cancel")}),(0,f.jsx)(C.Button,{onClick:()=>{d.trim()&&(L&&n?n(s.id,{title:d,description:m,priority:x,labelIds:y,subPath:v.trim()||""}):r({title:d,description:m,priority:x,status:a,labelIds:y,...F&&D&&I?{baseBranch:I}:{},...v.trim()?{subPath:v.trim()}:{}}),u(""),p(""),g("MEDIUM"),b(""),N([]),k([]),P(""),M(!0),t(!1))},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:L?A("common.save"):A("common.create")})]})]})})}var nG=e.i(458851),nV=e.i(803041),nK=e.i(802461),nq=e.i(555159),nY=e.i(478430);let nX=(0,v.default)("git-commit-vertical",[["path",{d:"M12 3v6",key:"1holv5"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 15v6",key:"a9ows0"}]]);var nZ=e.i(894296),nJ=e.i(946960),nQ=e.i(239358),n0=e.i(126741),n1=e.i(866790),n2=e.i(967541);let n5=(0,n_.createServerReference)("40c3e283c4bc09dd0ddeac0fee2d5450add9aba2ef",n_.callServer,void 0,n_.findSourceMapURL,"deleteProject"),n3=(0,n_.createServerReference)("401227c576cd75dc12c7d7ef6c4acb53b48d853e45",n_.callServer,void 0,n_.findSourceMapURL,"getRecentLocalProjects"),n4=(0,n_.createServerReference)("40d6e8e588bda631b24c5a0e2c634b36786afb4521",n_.callServer,void 0,n_.findSourceMapURL,"getOrCreateTowerTaskId");var n8=e.i(552192),n9=e.i(286302),n7=e.i(921280),n6=e.i(584685),ae=e.i(909105),at=e.i(421845);function ar({commits:e}){let{t}=(0,j.useI18n)(),[r,n]=(0,h.useState)(!1);return 0===e.length?null:(0,f.jsxs)("div",{children:[(0,f.jsxs)("button",{onClick:()=>n(!r),className:"flex w-full items-center justify-between py-1",children:[(0,f.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:t("git.commitLog")}),r?(0,f.jsx)(nG.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,f.jsx)(nV.ChevronRight,{className:"h-3 w-3 text-muted-foreground"})]}),r&&(0,f.jsx)("div",{className:"mt-1.5 space-y-0.5 max-h-64 overflow-y-auto",children:e.map(e=>(0,f.jsxs)("div",{className:"group flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,f.jsx)(nX,{className:"h-3 w-3 shrink-0 text-muted-foreground mt-0.5"}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("p",{className:"text-xs text-foreground line-clamp-1",children:e.message}),(0,f.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,f.jsxs)("button",{onClick:()=>{navigator.clipboard.writeText(e.shortHash),n9.toast.success(`Copied ${e.shortHash}`)},className:"flex items-center gap-0.5 font-mono text-[10px] text-primary/70 hover:text-primary transition-colors",children:[e.shortHash,(0,f.jsx)(at.Copy,{className:"h-2.5 w-2.5 opacity-0 group-hover:opacity-100 transition-opacity"})]}),(0,f.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.author}),(0,f.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m`;let r=Math.floor(t/60);if(r<24)return`${r}h`;let n=Math.floor(r/24);return n<30?`${n}d`:`${Math.floor(n/30)}mo`}(e.date)})]})]})]},e.hash))})]})}var an=e.i(565037),aa=e.i(871183),as=e.i(657572);function ao({localPath:e,stashes:t,hasChanges:r,onRefresh:n}){let{t:a}=(0,j.useI18n)(),[s,o]=(0,h.useState)(!1),[i,l]=(0,h.useState)(!1),[c,d]=(0,h.useState)(""),[u,m]=(0,h.useState)(null),p=async()=>{l(!0);try{await (0,as.gitAction)(e,"stash-save",{message:c}),d(""),n9.toast.success(a("git.stashSaved")),await n()}catch(e){n9.toast.error(e instanceof Error?e.message:String(e))}finally{l(!1)}},x=async t=>{m(t);try{await (0,as.gitAction)(e,"stash-pop",{index:t}),n9.toast.success(a("git.stashApplied")),await n()}catch(e){n9.toast.error(e instanceof Error?e.message:String(e))}finally{m(null)}},g=async t=>{m(t);try{await (0,as.gitAction)(e,"stash-drop",{index:t}),n9.toast.success(a("git.stashDropped")),await n()}catch(e){n9.toast.error(e instanceof Error?e.message:String(e))}finally{m(null)}};return r||0!==t.length?(0,f.jsxs)("div",{children:[(0,f.jsxs)("button",{onClick:()=>o(!s),className:"flex w-full items-center justify-between py-1",children:[(0,f.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[a("git.stash")," ",t.length>0&&`(${t.length})`]}),s?(0,f.jsx)(nG.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,f.jsx)(nV.ChevronRight,{className:"h-3 w-3 text-muted-foreground"})]}),s&&(0,f.jsxs)("div",{className:"mt-1.5 space-y-2",children:[r&&(0,f.jsxs)("div",{className:"flex gap-1.5",children:[(0,f.jsx)(K.Input,{value:c,onChange:e=>d(e.target.value),placeholder:a("git.stashMsgPlaceholder"),className:"h-7 text-xs flex-1",onKeyDown:e=>"Enter"===e.key&&p()}),(0,f.jsx)(C.Button,{variant:"outline",size:"icon-sm",onClick:p,disabled:i,className:"shrink-0",children:i?(0,f.jsx)(nJ.Loader2,{className:"h-3 w-3 animate-spin"}):(0,f.jsx)(an.Archive,{className:"h-3 w-3"})})]}),t.length>0&&(0,f.jsx)("div",{className:"space-y-0.5",children:t.map(e=>(0,f.jsxs)("div",{className:"group flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,f.jsx)(an.Archive,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,f.jsx)("span",{className:"flex-1 min-w-0 truncate text-xs text-foreground",children:e.message||`stash@{${e.index}}`}),(0,f.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:()=>x(e.index),disabled:u===e.index,className:"text-muted-foreground","aria-label":a("git.stashApply"),children:u===e.index?(0,f.jsx)(nJ.Loader2,{className:"h-3 w-3 animate-spin"}):(0,f.jsx)(aa.ArrowUpFromLine,{className:"h-3 w-3"})}),(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:()=>g(e.index),disabled:u===e.index,className:"text-rose-400","aria-label":a("git.stashDrop"),children:(0,f.jsx)(F.Trash2,{className:"h-3 w-3"})})]})]},e.index))})]})]}):null}function ai({project:e,workspaceId:t}){let{t:r,locale:n}=(0,j.useI18n)(),a=(0,x.useRouter)(),[s,o]=(0,h.useState)(!0),[i,l]=(0,h.useState)(!0),[c,d]=(0,h.useState)(!1),[u,m]=(0,h.useState)(!1),[p,g]=(0,h.useState)(""),[v,b]=(0,h.useState)(!1),[y,N]=(0,h.useState)(!1),[w,k]=(0,h.useState)(!1),[S,E]=(0,h.useState)(e.name),[R,I]=(0,h.useState)(e.alias??""),[P,T]=(0,h.useState)(e.description??""),[O,D]=(0,h.useState)(e.localPath??""),[M,A]=(0,h.useState)(e.projectType??"FRONTEND"),[B,$]=(0,h.useState)([]);(0,h.useEffect)(()=>{n3(100).then($)},[]);let[_,z]=(0,h.useState)(!1),[W,H]=(0,h.useState)(""),[G,V]=(0,h.useState)(""),[Y,Z]=(0,h.useState)(""),[J,Q]=(0,h.useState)(""),[ee,et]=(0,h.useState)("FRONTEND"),[er,en]=(0,h.useState)(!1),[ea,es]=(0,h.useState)(!1),[eo,ei]=(0,h.useState)(null),[el,ec]=(0,h.useState)(!1),[ed,eu]=(0,h.useState)(!1),[em,ep]=(0,h.useState)(!1),ef=e=>{n9.toast.info(e)},eh=(0,h.useCallback)(async()=>{if(e.localPath){ec(!0);try{let t=await fetch(`/api/git?path=${encodeURIComponent(e.localPath)}`);t.ok&&ei(await t.json())}catch{}finally{ec(!1)}}},[e.localPath]);(0,h.useEffect)(()=>{eh()},[eh]);let ex=async()=>{if(e.localPath){eu(!0);try{(await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"init",path:e.localPath})})).ok?(ef(r("git.initSuccess")),await eh()):ef(r("git.initFailed"))}catch{ef(r("git.initFailed"))}finally{eu(!1)}}},eg=async t=>{if(e.localPath)try{let n=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"checkout",path:e.localPath,branch:t})});if(n.ok)ef(`${r("git.switchSuccess")} ${t}`),await eh();else{let e=await n.json();ef(`${r("git.switchFailed")}: ${e.error}`)}}catch{ef(r("git.switchFailed"))}},ev=(e,t)=>{a.push(`/workspaces/${e}?projectId=${t}`,{scroll:!1}),a.refresh()},eb=async()=>{if(G.trim()){en(!0);try{let e=await (0,n2.createProject)({name:G.trim(),alias:Y.trim()||void 0,description:J.trim()||void 0,localPath:W,projectType:ee,workspaceId:t});z(!1),ev(t,e.id)}catch(e){n9.toast.error(e instanceof Error?e.message:String(e))}finally{en(!1)}}},ey=async()=>{if(O&&!ea){es(!0);try{let e=await (0,n8.analyzeProjectDirectory)(O.trim(),n);T(e)}catch{n9.toast.error(r("project.analyzeError"))}finally{es(!1)}}},ej=async()=>{try{await (0,n1.updateProject)(e.id,{name:S.trim(),alias:R.trim()||void 0,description:P.trim()||void 0,localPath:O.trim()||void 0,projectType:M}),a.refresh(),d(!1)}catch(e){n9.toast.error(e instanceof Error?e.message:String(e))}};return(0,f.jsxs)("aside",{className:"relative w-72 flex-shrink-0 overflow-y-auto border-l border-border bg-sidebar",children:[(0,f.jsxs)("div",{className:"border-b border-border p-4",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between",children:[(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("h2",{className:"text-base font-semibold text-foreground",children:e.name}),e.alias&&(0,f.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.alias})]}),(0,f.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{E(e.name),I(e.alias??""),T(e.description??""),D(e.localPath??""),d(!0)},className:"text-muted-foreground",children:(0,f.jsx)(L.Pencil,{className:"h-3.5 w-3.5"})}),(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{g(""),m(!0)},className:"text-muted-foreground hover:text-rose-400",children:(0,f.jsx)(F.Trash2,{className:"h-3.5 w-3.5"})})]})]}),e.description&&(0,f.jsx)("p",{className:"mt-2 text-sm text-secondary-foreground leading-relaxed line-clamp-4",children:e.description}),(0,f.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:(0,f.jsx)("span",{className:`inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[11px] font-medium ${"GIT"===e.type?"bg-sky-500/15 text-sky-300 ring-1 ring-sky-500/20":"bg-muted text-muted-foreground ring-1 ring-border"}`,children:"GIT"===e.type?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(X.GitBranch,{className:"h-3 w-3"}),r("sidebar.right.gitType")]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(nq.FileText,{className:"h-3 w-3"}),r("sidebar.right.normalType")]})})}),e.localPath&&(0,f.jsxs)("div",{className:"mt-3 flex items-start gap-2 rounded-md bg-muted/50 px-2.5 py-2 text-xs",children:[(0,f.jsx)(nY.FolderOpen,{className:"mt-0.5 h-3 w-3 shrink-0 text-muted-foreground"}),(0,f.jsx)("span",{className:"break-all font-mono text-secondary-foreground",children:e.localPath})]}),e.gitUrl&&(0,f.jsxs)("div",{className:"mt-2 flex items-start gap-2 rounded-md bg-muted/50 px-2.5 py-2 text-xs",children:[(0,f.jsx)(nK.Globe,{className:"mt-0.5 h-3 w-3 shrink-0 text-muted-foreground"}),(0,f.jsx)("span",{className:"break-all text-secondary-foreground",children:e.gitUrl})]}),e.localPath&&(0,f.jsxs)(C.Button,{variant:"outline",className:"mt-3 w-full h-8 gap-1.5 text-xs",disabled:y,onClick:async()=>{N(!0);try{let r=await n4(e.id);a.push(`/workspaces/${t}/tasks/${r}`)}catch{n9.toast.error(r("git.openStudioFailed"))}finally{N(!1)}},children:[y?(0,f.jsx)(nJ.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,f.jsx)(nY.FolderOpen,{className:"h-3.5 w-3.5"}),r("git.openStudio")]})]}),(0,f.jsxs)("div",{className:"border-b border-border p-4",children:[(0,f.jsxs)(C.Button,{variant:"ghost",onClick:()=>o(!s),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,f.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("git.section")}),s?(0,f.jsx)(nG.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,f.jsx)(nV.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),s&&(0,f.jsx)("div",{className:"mt-3",children:e.localPath?el?(0,f.jsxs)("div",{className:"flex items-center justify-center py-4 text-muted-foreground",children:[(0,f.jsx)(nJ.Loader2,{className:"h-4 w-4 animate-spin"}),(0,f.jsx)("span",{className:"ml-2 text-xs",children:r("git.loading")})]}):eo&&!eo.isGit?(0,f.jsxs)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,f.jsx)(nZ.AlertCircle,{className:"h-3.5 w-3.5"}),(0,f.jsx)("p",{className:"text-xs",children:r("git.notInitialized")})]}),(0,f.jsxs)(C.Button,{className:"mt-3 h-7 w-full gap-1.5 bg-primary/10 text-xs text-primary ring-1 ring-primary/20 hover:bg-primary/15",onClick:ex,disabled:ed,children:[ed?(0,f.jsx)(nJ.Loader2,{className:"h-3 w-3 animate-spin"}):(0,f.jsx)(nX,{className:"h-3 w-3"}),r("git.initRepo")]})]}):eo?.isGit?(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsx)(al,{localBranches:eo.branches??[],remoteBranches:(eo.remoteBranches??[]).filter(e=>!eo.branches?.includes(e)),currentBranch:eo.currentBranch??"",onSwitch:eg,onFetch:async()=>{e.localPath&&(await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"fetch",path:e.localPath})}),await eh())},onCreateBranch:()=>ep(!0)}),(0,f.jsx)(ar,{commits:eo.commits??[]}),(0,f.jsx)(ao,{localPath:e.localPath,stashes:eo.stashes??[],hasChanges:(eo.changedFiles??[]).length>0,onRefresh:eh})]}):null:(0,f.jsx)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:(0,f.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,f.jsx)(nZ.AlertCircle,{className:"h-3.5 w-3.5"}),(0,f.jsx)("p",{className:"text-xs",children:r("git.noLocalPath")})]})})})]}),(0,f.jsxs)("div",{className:"p-4",children:[(0,f.jsxs)(C.Button,{variant:"ghost",onClick:()=>l(!i),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,f.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("sidebar.right.browseRepo")}),i?(0,f.jsx)(nG.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,f.jsx)(nV.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),i&&(0,f.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,f.jsxs)(C.Button,{variant:"outline",className:"w-full h-8 gap-1.5 text-xs",onClick:()=>k(!0),children:[(0,f.jsx)(nY.FolderOpen,{className:"h-3.5 w-3.5"}),r("sidebar.right.browseRepo")]}),B.length>0&&(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5 px-1",children:r("sidebar.right.recent")}),(0,f.jsx)("div",{className:"space-y-0.5",children:B.map(t=>(0,f.jsxs)("button",{onClick:()=>{t.id!==e.id&&ev(t.workspaceId,t.id)},className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors ${t.id===e.id?"bg-primary/10 text-primary cursor-default":"hover:bg-accent cursor-pointer"}`,children:["GIT"===t.type?(0,f.jsx)(X.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}):(0,f.jsx)(nY.FolderOpen,{className:"h-3 w-3 shrink-0 text-primary/70"}),(0,f.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,f.jsx)("p",{className:"truncate text-xs font-medium text-foreground",children:t.name}),t.localPath&&(0,f.jsx)("p",{className:"truncate text-[10px] font-mono text-muted-foreground",children:t.localPath})]})]},t.id))})]})]})]}),(0,f.jsx)(U.Dialog,{open:c,onOpenChange:d,children:(0,f.jsxs)(U.DialogContent,{style:{maxWidth:"32rem"},children:[(0,f.jsx)(U.DialogHeader,{children:(0,f.jsx)(U.DialogTitle,{children:r("project.edit")})}),(0,f.jsxs)("div",{className:"space-y-3 py-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.name")}),(0,f.jsx)(K.Input,{value:S,onChange:e=>E(e.target.value),className:"mt-1.5"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.type.label")}),(0,f.jsx)("div",{className:"mt-1.5",children:(0,f.jsx)(n6.SegmentedControl,{options:[{value:"FRONTEND",label:r("project.type.frontend")},{value:"BACKEND",label:r("project.type.backend")}],value:M,onChange:A})})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.alias")}),(0,f.jsx)(K.Input,{value:R,onChange:e=>I(e.target.value),className:"mt-1.5"})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.description")}),(0,f.jsxs)(C.Button,{type:"button",variant:"ghost",onClick:ey,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!O||ea?"opacity-50":""}`,children:[ea?(0,f.jsx)(nJ.Loader2,{className:"h-3 w-3 animate-spin"}):(0,f.jsx)(nQ.Sparkles,{className:"h-3 w-3"}),ea?r("project.analyzing"):r("project.genDesc")]})]}),(0,f.jsx)(q.Textarea,{value:P,onChange:e=>T(e.target.value),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.localPath")}),(0,f.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,f.jsx)(K.Input,{value:O,onChange:e=>D(e.target.value),placeholder:r("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs"}),(0,f.jsx)(C.Button,{variant:"outline",onClick:()=>k(!0),className:"h-8 shrink-0",children:r("folder.browse")})]})]})]}),(0,f.jsxs)(U.DialogFooter,{children:[(0,f.jsx)(C.Button,{variant:"outline",onClick:()=>d(!1),children:r("common.cancel")}),(0,f.jsx)(C.Button,{onClick:ej,disabled:!S.trim()||ea,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:r("common.save")})]})]})}),(0,f.jsx)(n7.FolderBrowserDialog,{open:w,onOpenChange:k,onSelect:e=>{c?D(e):(e=>{let t=B.find(t=>t.localPath===e);if(t)return ev(t.workspaceId,t.id);let r=e.split("/").filter(Boolean).pop()??"";H(e),V(r),Z(""),Q(""),z(!0)})(e)}}),(0,f.jsx)(U.Dialog,{open:_,onOpenChange:z,children:(0,f.jsxs)(U.DialogContent,{className:"sm:max-w-md",children:[(0,f.jsx)(U.DialogHeader,{children:(0,f.jsx)(U.DialogTitle,{children:r("topbar.newProject")})}),(0,f.jsxs)("div",{className:"space-y-3 py-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.localPath")}),(0,f.jsx)("div",{className:"mt-1.5 rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:W})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.name")}),(0,f.jsx)(K.Input,{value:G,onChange:e=>V(e.target.value),placeholder:r("project.namePlaceholder"),className:"mt-1.5"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.type.label")}),(0,f.jsx)("div",{className:"mt-1.5",children:(0,f.jsx)(n6.SegmentedControl,{options:[{value:"FRONTEND",label:r("project.type.frontend")},{value:"BACKEND",label:r("project.type.backend")}],value:ee,onChange:et})})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.alias")}),(0,f.jsx)(K.Input,{value:Y,onChange:e=>Z(e.target.value),placeholder:r("project.aliasPlaceholder"),className:"mt-1.5"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.description")}),(0,f.jsx)(q.Textarea,{value:J,onChange:e=>Q(e.target.value),placeholder:r("project.descPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,f.jsxs)(U.DialogFooter,{children:[(0,f.jsx)(C.Button,{variant:"outline",onClick:()=>z(!1),children:r("common.cancel")}),(0,f.jsxs)(C.Button,{onClick:eb,disabled:!G.trim()||er,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[er?(0,f.jsx)(nJ.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,r("common.create")]})]})]})}),eo?.isGit&&(0,f.jsx)(ae.CreateBranchDialog,{open:em,onOpenChange:ep,branches:eo.branches??[],currentBranch:eo.currentBranch??"",localPath:e.localPath,onCreated:async()=>{await eh(),ef(r("git.createSuccess"))},onError:e=>ef(`${r("git.createFailed")}: ${e}`)}),(0,f.jsx)(U.Dialog,{open:u,onOpenChange:e=>{m(e),e||g("")},children:(0,f.jsxs)(U.DialogContent,{className:"sm:max-w-md",children:[(0,f.jsx)(U.DialogHeader,{children:(0,f.jsx)(U.DialogTitle,{className:"text-rose-400",children:r("project.deleteTitle")})}),(0,f.jsxs)("div",{className:"space-y-3 py-2",children:[(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:r("project.deleteWarning",{name:e.name})}),(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:r("project.deleteIrreversible")}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.deleteConfirmLabel")}),(0,f.jsx)(K.Input,{value:p,onChange:e=>g(e.target.value),placeholder:r("project.deleteConfirmPlaceholder"),className:"mt-1.5",autoFocus:!0})]})]}),(0,f.jsxs)(U.DialogFooter,{children:[(0,f.jsx)(C.Button,{variant:"outline",onClick:()=>m(!1),children:r("common.cancel")}),(0,f.jsxs)(C.Button,{variant:"destructive",disabled:p!==r("project.deleteConfirmText")||v,onClick:async()=>{b(!0);try{await n5(e.id),n9.toast.success(r("project.deleteSuccess")),a.push(`/workspaces/${t}`)}catch{n9.toast.error(r("project.deleteFailed"))}finally{b(!1),m(!1)}},children:[v&&(0,f.jsx)(nJ.Loader2,{className:"h-3 w-3 animate-spin mr-1"}),r("project.deleteButton")]})]})]})})]})}function al({localBranches:e,remoteBranches:t,currentBranch:r,onSwitch:n,onFetch:a,onCreateBranch:s}){let{t:o}=(0,j.useI18n)(),[i,l]=(0,h.useState)(!1),[c,d]=(0,h.useState)(""),[u,m]=(0,h.useState)(!1),p=(0,h.useRef)(null);(0,h.useEffect)(()=>{if(i)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){p.current&&!p.current.contains(e.target)&&l(!1)}},[i]);let x=c.toLowerCase(),g=e.filter(e=>e.toLowerCase().includes(x)),v=t.filter(e=>e.toLowerCase().includes(x)),b=g.length>0||v.length>0,y=async()=>{m(!0);try{await a()}finally{m(!1)}};return(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,f.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:o("git.currentBranch")}),(0,f.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:y,disabled:u,className:"text-muted-foreground","aria-label":"Fetch",children:(0,f.jsx)(n0.RefreshCw,{className:`h-3 w-3 ${u?"animate-spin":""}`})}),(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:s,className:"text-muted-foreground","aria-label":o("git.createBranch"),children:(0,f.jsx)(w.Plus,{className:"h-3 w-3"})})]})]}),(0,f.jsxs)("div",{className:"relative",ref:p,children:[(0,f.jsxs)("button",{onClick:()=>{l(!i),d("")},className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,f.jsx)(X.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,f.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:r||"—"})]}),(0,f.jsx)(nG.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${i?"rotate-180":""}`})]}),i&&(0,f.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,f.jsx)("div",{className:"border-b border-border p-1.5",children:(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(k.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,f.jsx)("input",{value:c,onChange:e=>d(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,f.jsxs)("div",{className:"max-h-60 overflow-auto py-1",children:[!b&&(0,f.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"}),g.length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:"px-3 pt-1.5 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:o("git.localBranches")}),g.map(e=>{let t=e===r;return(0,f.jsxs)("button",{onClick:()=>{t||n(e),l(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${t?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,f.jsx)(X.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,f.jsx)("span",{className:"truncate font-mono text-xs",children:e}),t&&(0,f.jsx)(R.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${e}`)})]}),v.length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:"px-3 pt-2.5 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:o("git.remoteBranches")}),v.map(e=>(0,f.jsxs)("button",{onClick:()=>{n(e),l(!1)},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,f.jsx)(nK.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,f.jsx)("span",{className:"truncate font-mono text-xs",children:e})]},`remote-${e}`))]})]})]})]})]})}let ac=(0,v.default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var ad=e.i(950211),au=e.i(289208),am=e.i(750986),ap=e.i(610874),af=e.i(11915),ah=e.i(265826);function ax({title:e,description:t,branch:r,baseBranch:n,hasConversation:a,updatedAt:s,onBack:o}){let{t:i}=(0,j.useI18n)();return(0,f.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(nQ.Sparkles,{className:"h-3.5 w-3.5 text-primary"}),(0,f.jsx)("span",{className:"text-xs font-semibold text-primary",children:i("taskDetail.title")})]}),(0,f.jsxs)(C.Button,{variant:"ghost",onClick:o,className:"flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground h-auto px-2 py-1",children:[(0,f.jsx)(ah.ArrowLeft,{className:"h-3.5 w-3.5"}),i("taskDetail.back")]})]}),(0,f.jsx)("h2",{className:"mt-2.5 text-lg font-bold tracking-tight text-foreground",children:e}),t&&(0,f.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:t}),(0,f.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[n?(0,f.jsxs)($.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:[(0,f.jsx)(X.GitBranch,{className:"mr-1 h-3 w-3"}),n," · worktree"]}):r?(0,f.jsx)($.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:i("taskDetail.directMode")}):null,a&&(0,f.jsx)($.Badge,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-400 text-[10px] border border-emerald-500/20",children:i("taskDetail.hasConversation")}),(0,f.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[i("taskDetail.updatedAt")," ",(0,ti.formatRelativeTime)(s)]})]})]})}var ag=e.i(477795),av=e.i(486305),ab=e.i(79769),ay=e.i(896894),aj=e.i(409676),aN=e.i(697551),aw=e.i(190045),ak=e.i(797556),aC=e.i(924260),aS=e.i(558543),aE=e.i(884178),aR=e.i(117886),aI=e.i(612758),aP=e.i(215365);let aT=(0,v.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);var aO=e.i(996032),aD=e.i(724380);let aM=(0,n_.createServerReference)("40c2ab0119ffd4ced8f4a8114ec09a995edc21b272",n_.callServer,void 0,n_.findSourceMapURL,"getTaskNotes");var aA=e.i(747532);let aL=(0,n_.createServerReference)("400ea84e8a7836f87ab0e72d3b669f65e54ac05662",n_.callServer,void 0,n_.findSourceMapURL,"getTaskAssets");var aF=e.i(739730),aB=e.i(99649);function a$({taskId:e,projectId:t}){let{t:r}=(0,j.useI18n)(),n=(0,h.useRef)(null),[a,s]=(0,h.useState)([]),[o,i]=(0,h.useState)([]),[l,c]=(0,h.useState)(!1),[d,u]=(0,h.useState)(""),[m,p]=(0,h.useState)(""),[x,g]=(0,h.useState)(!1);async function v(){d.trim()&&(await (0,aD.createNote)({title:d.trim(),content:m.trim(),projectId:t,taskId:e,category:"task"}),u(""),p(""),c(!1),aM(e).then(s))}async function b(e){await (0,aA.deleteNote)(e),s(t=>t.filter(t=>t.id!==e))}async function y(r){let a=r.target.files?.[0];if(a){g(!0);try{let r=new FormData;r.set("file",a),r.set("projectId",t),r.set("taskId",e),await (0,aF.uploadAsset)(r),aL(e).then(i)}finally{g(!1),n.current&&(n.current.value="")}}}async function N(e){await (0,aB.deleteAsset)(e),i(t=>t.filter(t=>t.id!==e))}return(0,h.useEffect)(()=>{aM(e).then(s),aL(e).then(i)},[e]),(0,f.jsx)(W.ScrollArea,{className:"h-full",children:(0,f.jsxs)("div",{className:"flex flex-col",children:[(0,f.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,f.jsx)(nq.FileText,{className:"h-3.5 w-3.5"}),r("taskPage.notes")]}),(0,f.jsxs)(C.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>c(!l),children:[l?(0,f.jsx)(aO.X,{className:"h-3 w-3"}):(0,f.jsx)(w.Plus,{className:"h-3 w-3"}),l?"":r("taskPage.addNote")]})]}),l&&(0,f.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,f.jsx)("input",{type:"text",value:d,onChange:e=>u(e.target.value),placeholder:r("taskPage.noteTitle"),className:"h-8 w-full rounded-md border border-border bg-background px-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary",autoFocus:!0}),(0,f.jsx)("textarea",{value:m,onChange:e=>p(e.target.value),placeholder:r("taskPage.noteContent"),rows:3,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary resize-none"}),(0,f.jsx)(C.Button,{className:"text-xs",onClick:v,disabled:!d.trim(),children:r("taskPage.addNote")})]}),(0,f.jsxs)("div",{className:"mt-2 space-y-2",children:[0===a.length&&!l&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:r("taskPage.noNotes")}),a.map(e=>(0,f.jsx)("div",{className:"group rounded-md border border-border bg-card p-3",children:(0,f.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,f.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,f.jsx)("h4",{className:"text-sm font-medium truncate",children:e.title}),e.content&&(0,f.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-3 whitespace-pre-wrap",children:e.content}),(0,f.jsx)("p",{className:"mt-1 text-[10px] text-muted-foreground",children:new Date(e.createdAt).toLocaleString()})]}),(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:()=>b(e.id),className:"shrink-0 text-muted-foreground opacity-0 hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100",title:r("taskPage.deleteNote"),children:(0,f.jsx)(F.Trash2,{className:"h-3.5 w-3.5"})})]})},e.id))]})]}),(0,f.jsxs)("div",{className:"px-4 py-3",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,f.jsx)(aT,{className:"h-3.5 w-3.5"}),r("taskPage.attachments")]}),(0,f.jsxs)(C.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>n.current?.click(),disabled:x,children:[(0,f.jsx)(aP.Upload,{className:"h-3 w-3"}),r("taskPage.uploadFile")]}),(0,f.jsx)("input",{ref:n,type:"file",className:"hidden",onChange:y})]}),(0,f.jsxs)("div",{className:"mt-2 space-y-1.5",children:[0===o.length&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:r("taskPage.noAttachments")}),o.map(e=>{var t;return(0,f.jsxs)("div",{className:"group flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2",children:[(0,f.jsx)(aT,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,f.jsx)("span",{className:"flex-1 truncate text-sm",children:e.filename}),(0,f.jsx)("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:(t=e.size)?t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`:""}),(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:()=>N(e.id),className:"shrink-0 text-muted-foreground opacity-0 hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100",title:r("taskPage.deleteAttachment"),children:(0,f.jsx)(F.Trash2,{className:"h-3 w-3"})})]},e.id)})]})]})]})})}function a_({task:e,workspaceId:t,projectLocalPath:r,onClose:n}){let{t:a}=(0,j.useI18n)(),s=(0,x.useRouter)(),{removePortal:o}=(0,ab.useTerminalPortal)(),[i,l]=(0,h.useState)("terminal"),[c,d]=(0,h.useState)(null),[u,m]=(0,h.useState)(!1),[p,g]=(0,h.useState)(e.status);(0,h.useEffect)(()=>{g(e.status)},[e.status]);let[v,b]=(0,h.useState)(null),[y,N]=(0,h.useState)(!1),[w,k]=(0,h.useState)(!1),[S,E]=(0,h.useState)([]);(0,h.useEffect)(()=>{b(null),N(!1),k(!1),E([]),d(null),l("terminal")},[e.id]);let[R,I]=(0,h.useState)([]),[P,T]=(0,h.useState)(null);(0,h.useEffect)(()=>{let e=!1;return(0,aR.getPrompts)().then(t=>{if(e)return;I(t.map(e=>({id:e.id,name:e.name,isDefault:e.isDefault})));let r=t.find(e=>e.isDefault);r&&T(r.id)}),()=>{e=!0}},[]),(0,h.useEffect)(()=>{b(null),k(!1);let t=!1;return(0,ay.getTaskExecutions)(e.id).then(e=>{if(t)return;let n=e[0];if(n?.status==="RUNNING"){let e=n.worktreePath||r||null;e&&b(e)}E(e.filter(e=>"RUNNING"!==e.status)),k(!0)}),()=>{t=!0}},[e.id]),(0,h.useEffect)(()=>{if("changes"!==i||"TODO"===p||"CANCELLED"===p)return;let t=!1;return m(!0),fetch(`/api/tasks/${e.id}/diff`).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{t||d(e?.files||e?.branchDeleted?e:null)}).catch(()=>{t||d(null)}).finally(()=>{t||m(!1)}),()=>{t=!0}},[i,p,e.id]);let O=(0,h.useCallback)(async()=>{if(!y){N(!0);try{let{worktreePath:t}=await (0,aj.startPtyExecution)(e.id,"",P);b(t),g("IN_PROGRESS")}catch(e){N(!1),n9.toast.error(e instanceof Error?e.message:String(e))}}},[e.id,y,P]),D=(0,h.useCallback)(t=>{N(!1),b(null),o(e.id),0===t&&g("IN_REVIEW"),(0,ay.getTaskExecutions)(e.id).then(e=>{E(e.filter(e=>"RUNNING"!==e.status))}),s.refresh()},[s,e.id]),M=(0,h.useCallback)(async()=>{await (0,aN.stopPtyExecution)(e.id),N(!1),b(null),g("IN_REVIEW"),(0,ay.getTaskExecutions)(e.id).then(e=>{E(e.filter(e=>"RUNNING"!==e.status))}),s.refresh()},[e.id,s]),A=(0,h.useCallback)(async t=>{N(!0),o(e.id),b(null);try{let{worktreePath:r}=await (0,aw.resumePtyExecution)(e.id,t);b(r),g("IN_PROGRESS")}catch{N(!1)}},[e.id,o]),L=(0,h.useCallback)(async()=>{N(!0),o(e.id),b(null);try{let{worktreePath:t}=await (0,ak.continueLatestPtyExecution)(e.id);b(t),g("IN_PROGRESS")}catch(e){N(!1),n9.toast.error(e instanceof Error?e.message:String(e))}},[e.id,o]),[F,B]=(0,h.useState)(!1),[$,_]=(0,h.useState)([]),z=(0,h.useCallback)(async()=>{try{let t=await (0,aS.checkWorktreeClean)(e.id);if(t.hasWorktree&&!t.clean)return void n9.toast.error(a("taskPage.uncommittedChanges",{count:String(t.files.length)}));if(t.hasWorktree&&t.clean&&!t.hasCommits)return void n9.toast.error(a("taskPage.noChangesToComplete"));if(t.hasWorktree&&t.hasCommits){_(t.commitLog),B(!0);return}await (0,aC.updateTaskStatus)(e.id,"DONE"),g("DONE"),n9.toast.success(a("taskPage.taskCompleted")),s.refresh()}catch{n9.toast.error("Failed to complete task")}},[e.id,s,a]),U=(0,h.useCallback)(()=>{g("DONE"),B(!1),n9.toast.success(a("taskPage.taskCompleted")),s.refresh()},[s,a]),H=(0,h.useCallback)(async t=>{try{let{hash:r}=await (0,aE.commitWorktreeChanges)(e.id,t);n9.toast.success(a("diff.commitSuccess",{hash:r})),s.refresh();let n=await fetch(`/api/tasks/${e.id}/diff`);if(n.ok){let e=await n.json();d(e?.files?e:null)}}catch(e){n9.toast.error(e instanceof Error?e.message:"Commit failed")}},[e.id,s,a]);return(0,f.jsxs)("div",{className:"flex h-full w-[600px] flex-shrink-0 flex-col border-l border-border bg-sidebar","data-testid":"task-detail-panel",children:[(0,f.jsx)(ax,{title:e.title,description:a("taskDetail.panelDescription"),branch:`task/${e.id}`,baseBranch:e.baseBranch,hasConversation:!1,updatedAt:e.updatedAt,onBack:n}),(0,f.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-2",children:[(0,f.jsxs)("div",{className:"flex gap-1",children:[(0,f.jsxs)("button",{onClick:()=>l("terminal"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"terminal"===i?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,f.jsx)(ad.Terminal,{className:"h-3 w-3"}),a("terminal.execute")]}),(0,f.jsx)("button",{onClick:()=>l("changes"),className:`px-3 py-1 text-xs font-medium rounded-md ${"changes"===i?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:a("taskPage.changes")}),(0,f.jsxs)("button",{onClick:()=>l("notes"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"notes"===i?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,f.jsx)(nq.FileText,{className:"h-3 w-3"}),a("taskPage.notes")]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:["IN_REVIEW"===p&&(0,f.jsxs)(C.Button,{size:"sm",onClick:z,className:"bg-emerald-500/15 text-emerald-400 ring-1 ring-emerald-500/20 hover:bg-emerald-500/25",children:[(0,f.jsx)(am.CheckCircle2,{className:"h-3 w-3"}),a("taskPage.completeTask")]}),"DONE"!==p&&"CANCELLED"!==p&&(0,f.jsxs)(C.Button,{variant:"ghost",size:"sm",onClick:()=>s.push(`/workspaces/${t}/tasks/${e.id}`),className:"text-muted-foreground",children:[(0,f.jsx)(ac,{className:"h-3 w-3"}),a("taskPage.viewDetails")]})]})]}),"terminal"===i?(0,f.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:w?v?(0,f.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,f.jsxs)("div",{className:"shrink-0 flex items-center justify-between border-b border-neutral-800 px-3 py-2 bg-[#0f1419]",children:[(0,f.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400",children:[(0,f.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),a("execution.running")]}),(0,f.jsxs)(af.Tooltip,{children:[(0,f.jsxs)(af.TooltipTrigger,{onClick:M,className:"flex items-center gap-1.5 rounded-md bg-red-500/15 px-3 py-1 text-xs font-medium text-red-400 hover:bg-red-500/25 transition-colors",children:[(0,f.jsx)(au.Square,{className:"h-3 w-3"}),a("terminal.stopExecution")]}),(0,f.jsx)(af.TooltipContent,{side:"bottom",children:a("terminal.stopHint")})]})]}),(0,f.jsx)("div",{className:"flex-1 min-h-0",children:(0,f.jsx)(ab.TerminalOutlet,{taskId:e.id,worktreePath:v,onSessionEnd:D})})]}):"DONE"===p||"CANCELLED"===p?(0,f.jsx)("div",{className:"flex h-full flex-col overflow-hidden",children:(0,f.jsx)(W.ScrollArea,{className:"flex-1 min-h-0",children:(0,f.jsx)(aI.ExecutionTimeline,{executions:S})})}):(0,f.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,f.jsxs)("div",{className:"shrink-0 flex items-center gap-2 border-b border-border px-4 py-3",children:[R.length>0&&(0,f.jsxs)(ap.Select,{defaultValue:P??"none",onValueChange:e=>T("none"===e?null:e),children:[(0,f.jsx)(ap.SelectTrigger,{size:"sm",className:"min-w-[120px]",children:(0,f.jsx)("span",{className:"text-left truncate",children:P?R.find(e=>e.id===P)?.name??a("terminal.noPrompt"):a("terminal.noPrompt")})}),(0,f.jsxs)(ap.SelectContent,{className:"min-w-[200px]",children:[(0,f.jsx)(ap.SelectItem,{value:"none",children:a("terminal.noPrompt")}),R.map(e=>(0,f.jsxs)(ap.SelectItem,{value:e.id,children:[e.name,e.isDefault?" ★":""]},e.id))]})]},`prompt-${R.length}`),(0,f.jsxs)(C.Button,{onClick:O,disabled:y,size:"sm",className:"gap-2 px-4",children:[y?(0,f.jsx)(nJ.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,f.jsx)(ad.Terminal,{className:"h-3.5 w-3.5"}),y?a("terminal.executing"):a("terminal.launch")]})]}),(0,f.jsx)(W.ScrollArea,{className:"flex-1 min-h-0",children:(0,f.jsx)(aI.ExecutionTimeline,{executions:S,onResume:A,onContinueLatest:L})})]}):(0,f.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-[#0f1419]",children:[(0,f.jsx)(nJ.Loader2,{className:"size-5 animate-spin text-neutral-500"}),(0,f.jsx)("span",{className:"text-xs text-neutral-500",children:a("execution.loading")})]})}):"changes"===i?(0,f.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:u?(0,f.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:a("taskPage.loadingDiff")})}):c?.branchDeleted?(0,f.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:a("taskPage.branchDeleted")})}):c?(0,f.jsx)(ag.TaskDiffView,{files:c.files,totalAdded:c.totalAdded,totalRemoved:c.totalRemoved,hasConflicts:c.hasConflicts,conflictFiles:c.conflictFiles,onCommit:H,hasUncommitted:c.hasUncommitted}):(0,f.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:a("taskPage.noChanges")})})}):"notes"===i?(0,f.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,f.jsx)(a$,{taskId:e.id,projectId:e.projectId})}):null,(0,f.jsx)(av.TaskMergeConfirmDialog,{open:F,onOpenChange:B,taskId:e.id,taskTitle:e.title,baseBranch:e.baseBranch??"main",fileCount:c?.files?.length??0,commitCount:c?.commitCount??0,commitLog:$,onMergeComplete:U})]})}let az=(0,n_.createServerReference)("40622d25277e3c11015df1608e15d738bebaf6e879",n_.callServer,void 0,n_.findSourceMapURL,"createTask"),aU=(0,n_.createServerReference)("605b03fbb419cd1a1831e8464a8242d82cdae18ae6",n_.callServer,void 0,n_.findSourceMapURL,"updateTask"),aW=(0,n_.createServerReference)("4037a0d2f662d32e4dd9a4b1a619489e9fdf17d735",n_.callServer,void 0,n_.findSourceMapURL,"deleteTask"),aH=(0,n_.createServerReference)("40a7e4fdd6803b7d8447525be3097063e42fc480f2",n_.callServer,void 0,n_.findSourceMapURL,"toggleTaskPinned");var aG=e.i(864056);function aV({projects:e,activeProjectId:t,onSelect:r}){let n=(0,h.useRef)(null),[a,s]=(0,h.useState)(!1),[o,i]=(0,h.useState)(!1),l=()=>{let e=n.current;e&&(s(e.scrollLeft>0),i(e.scrollLeft<e.scrollWidth-e.clientWidth-1))};(0,h.useEffect)(()=>{l();let e=n.current;if(e){e.addEventListener("scroll",l);let t=new ResizeObserver(l);return t.observe(e),()=>{e.removeEventListener("scroll",l),t.disconnect()}}},[e]);let c=e=>{let t=n.current;t&&t.scrollBy({left:"left"===e?-150:150,behavior:"smooth"})};return(0,f.jsxs)("div",{className:"relative flex items-center",children:[a&&(0,f.jsx)("button",{onClick:()=>c("left"),className:"absolute left-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,f.jsx)(aG.ChevronLeft,{className:"h-4 w-4"})}),(0,f.jsx)("div",{ref:n,className:"flex items-center gap-1.5 overflow-x-auto scrollbar-none px-1 py-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map(e=>{let n=t===e.id;return(0,f.jsxs)("button",{onClick:()=>{n||r(e.id)},className:`shrink-0 rounded-lg border-b-2 px-4 py-2 text-sm font-medium transition-colors ${n?"border-primary bg-primary/10 text-primary ring-1 ring-primary/20 cursor-default":"border-transparent text-muted-foreground hover:bg-accent hover:text-foreground cursor-pointer"}`,children:[(0,f.jsx)("span",{children:e.name}),e.alias&&(0,f.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:e.alias})]},e.id)})}),o&&(0,f.jsx)("button",{onClick:()=>c("right"),className:"absolute right-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,f.jsx)(nV.ChevronRight,{className:"h-4 w-4"})})]})}e.s(["BoardPageClient",0,function({workspaceId:e,projectId:t,project:r,projects:n,initialTasks:a,labels:s,openTaskId:o}){let i=(0,x.useRouter)(),[,l]=(0,h.useTransition)(),[c,d]=(0,h.useState)(""),[u,m]=(0,h.useState)(!1),[p,g]=(0,h.useState)("TODO"),[v,b]=(0,h.useState)(o?a.find(e=>e.id===o)??null:null),[y,j]=(0,h.useState)(null),w=(0,h.useCallback)(()=>{l(()=>{i.refresh()})},[i]);(0,h.useEffect)(()=>{if(u)return;let e=setInterval(()=>{l(()=>{i.refresh()})},5e3);return()=>clearInterval(e)},[i,u]);let k=(0,h.useCallback)(e=>{d(e)},[]),C=(0,h.useCallback)(async(e,t)=>{await (0,aC.updateTaskStatus)(e,t),v?.id===e&&b({...v,status:t}),w()},[w,v]),E=(0,h.useCallback)(async e=>{await az({title:e.title,description:e.description,projectId:t,priority:e.priority,status:e.status,labelIds:e.labelIds,baseBranch:e.baseBranch,subPath:e.subPath}),w()},[t,w]),R=(0,h.useCallback)(async(e,t)=>{await aU(e,{...t,labelIds:t.labelIds}),j(null),w()},[w]),P=(0,h.useCallback)(async e=>{await aW(e),v?.id===e&&b(null),w()},[w,v]),T=(0,h.useCallback)(async e=>{await aH(e),w()},[w]),O=(0,h.useCallback)(async t=>{try{await (0,aj.startPtyExecution)(t,"")}catch(e){n9.toast.error(e instanceof Error?e.message:String(e))}i.push(`/workspaces/${e}/tasks/${t}`)},[i,e]),D=(0,h.useCallback)(async(e,t)=>{await (0,aC.updateTaskStatus)(e,t),v?.id===e&&b({...v,status:t}),w()},[w,v]),M=(0,h.useCallback)(e=>{g(e),j(null),m(!0)},[]),A=(0,h.useCallback)(e=>{j(e),m(!0)},[]),L=a.filter(e=>!e.labels?.some(e=>e.label.name===I.TOWER_LABEL_NAME&&e.label.isBuiltin)),F=c.trim()?L.filter(e=>{let t=c.toLowerCase();return e.title.toLowerCase().includes(t)||(e.description?.toLowerCase().includes(t)??!1)}):L;return(0,f.jsxs)("div",{className:"flex h-full",children:[(0,f.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,f.jsx)("div",{className:"px-6 pt-3 pb-1",children:(0,f.jsx)(aV,{projects:n,activeProjectId:t,onSelect:t=>i.push(`/workspaces/${e}?projectId=${t}`,{scroll:!1})})}),(0,f.jsx)(N,{totalTasks:L.length,runningTasks:L.filter(e=>"IN_PROGRESS"===e.status).length}),(0,f.jsx)(S,{searchQuery:c,onSearchChange:k,onCreateTask:()=>{j(null),m(!0)}}),(0,f.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden p-4",children:(0,f.jsx)(V,{initialTasks:F,onTaskMove:C,onTaskClick:e=>{b(e)},onEditTask:A,onAddTask:M,onDeleteTask:P,onTogglePin:T,workspaceId:e,onContextMenuStatusChange:D,onContextMenuLaunch:O})}),(0,f.jsx)(nH,{open:u,onOpenChange:e=>{m(e),e||j(null)},onSubmit:E,onUpdate:R,defaultStatus:p,editTask:y,editTaskLabelIds:y?.labels?y.labels.map(e=>e.labelId):[],labels:s.filter(e=>!(e.name===I.TOWER_LABEL_NAME&&e.isBuiltin)),projectType:r.type,projectLocalPath:r.localPath})]}),v?(0,f.jsx)(a_,{task:v,workspaceId:e,projectLocalPath:r.localPath,onClose:()=>b(null)}):(0,f.jsx)(ai,{project:r,workspaceId:e})]})}],136924)}]);
5
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},r4=({contentRef:e,descriptionId:t})=>{let r=r5("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return h.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},r9=Symbol.for("react.lazy"),r8=h[" use ".trim().toString()];function r7(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===r9&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var r6=Symbol("radix.slottable");function ne(e){return h.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===r6}var nt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{var r,n;let a,s,o,i=(n=r=`Primitive.${t}`,(a=h.forwardRef((e,t)=>{let{children:r,...n}=e;if(r7(r)&&"function"==typeof r8&&(r=r8(r._payload)),h.isValidElement(r)){var a;let e,s,o=(a=r,(s=(e=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.ref:(s=(e=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.props.ref:a.props.ref||a.ref),i=function(e,t){let r={...t};for(let n in t){let a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{let t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==h.Fragment&&(i.ref=t?tv(t,o):o),h.cloneElement(r,i)}return h.Children.count(r)>1?h.Children.only(null):null})).displayName=`${n}.SlotClone`,s=a,(o=h.forwardRef((e,t)=>{let{children:r,...n}=e;r7(r)&&"function"==typeof r8&&(r=r8(r._payload));let a=h.Children.toArray(r),o=a.find(ne);if(o){let e=o.props.children,r=a.map(t=>t!==o?t:h.Children.count(e)>1?h.Children.only(null):h.isValidElement(e)?e.props.children:null);return(0,f.jsx)(s,{...n,ref:t,children:h.isValidElement(e)?h.cloneElement(e,void 0,r):null})}return(0,f.jsx)(s,{...n,ref:t,children:r})})).displayName=`${r}.Slot`,o),l=h.forwardRef((e,r)=>{let{asChild:n,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,f.jsx)(n?i:t,{...a,ref:r})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{}),nr='[cmdk-group=""]',nn='[cmdk-group-items=""]',na='[cmdk-item=""]',ns=`${na}:not([aria-disabled="true"])`,no="cmdk-item-select",ni="data-value",nl=(e,t,r)=>{var n;return n=e,function e(t,r,n,a,s,o,i){if(o===r.length)return s===t.length?1:.99;var l=`${s},${o}`;if(void 0!==i[l])return i[l];for(var c,d,u,m,p=a.charAt(o),f=n.indexOf(p,s),h=0;f>=0;)(c=e(t,r,n,a,f+1,o+1,i))>h&&(f===s?c*=1:tu.test(t.charAt(f-1))?(c*=.8,(u=t.slice(s,f-1).match(tm))&&s>0&&(c*=Math.pow(.999,u.length))):tp.test(t.charAt(f-1))?(c*=.9,(m=t.slice(s,f-1).match(tf))&&s>0&&(c*=Math.pow(.999,m.length))):(c*=.17,s>0&&(c*=Math.pow(.999,f-s))),t.charAt(f)!==r.charAt(o)&&(c*=.9999)),(c<.1&&n.charAt(f-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(f-1)!==a.charAt(o))&&.1*(d=e(t,r,n,a,f+1,o+2,i))>c&&(c=.1*d),c>h&&(h=c),f=n.indexOf(p,f+1);return i[l]=h,h}(n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,t,th(n),th(t),0,0,{})},nc=h.createContext(void 0),nd=h.createContext(void 0),nu=h.createContext(void 0),nm=h.forwardRef((e,t)=>{let r=nN(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=nN(()=>new Set),a=nN(()=>new Map),s=nN(()=>new Map),o=nN(()=>new Set),i=ny(e),{label:l,children:c,value:d,onValueChange:u,filter:m,shouldFilter:p,loop:f,disablePointerSelection:x=!1,vimBindings:g=!0,...v}=e,b=tw(),y=tw(),j=tw(),N=h.useRef(null),w=nC();nj(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,k.emit()}},[d]),nj(()=>{w(6,P)},[]);let k=h.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,s,o,l;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)I(),E(),w(1,R);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(j);e?e.focus():null==(a=document.getElementById(b))||a.focus()}if(w(7,()=>{var e;r.current.selectedItemId=null==(e=T())?void 0:e.id,k.emit()}),n||w(5,P),(null==(s=i.current)?void 0:s.value)!==void 0){null==(l=(o=i.current).onValueChange)||l.call(o,null!=t?t:"");return}}k.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),C=h.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=s.current.get(e))?void 0:a.value)&&(s.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,S(t,n)),w(2,()=>{E(),k.emit()}))},item:(e,t)=>(n.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),w(3,()=>{I(),E(),r.current.value||R(),k.emit()}),()=>{s.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=T();w(4,()=>{I(),(null==t?void 0:t.getAttribute("id"))===e&&R(),k.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{s.current.delete(e),a.current.delete(e)}),filter:()=>i.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:b,inputId:j,labelId:y,listInnerRef:N}),[]);function S(e,t){var n,a;let s=null!=(a=null==(n=i.current)?void 0:n.filter)?a:nl;return e?s(e,r.current.search,t):0}function E(){if(!r.current.search||!1===i.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=a.current.get(r),s=0;n.forEach(t=>{s=Math.max(e.get(t),s)}),t.push([r,s])});let n=N.current;O().sort((t,r)=>{var n,a;let s=t.getAttribute("id"),o=r.getAttribute("id");return(null!=(n=e.get(o))?n:0)-(null!=(a=e.get(s))?a:0)}).forEach(e=>{let t=e.closest(nn);t?t.appendChild(e.parentElement===t?e:e.closest(`${nn} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${nn} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=N.current)?void 0:t.querySelector(`${nr}[${ni}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function R(){let e=O().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(ni);k.setState("value",t||void 0)}function I(){var e,t,o,l;if(!r.current.search||!1===i.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let c=0;for(let a of n.current){let n=S(null!=(t=null==(e=s.current.get(a))?void 0:e.value)?t:"",null!=(l=null==(o=s.current.get(a))?void 0:o.keywords)?l:[]);r.current.filtered.items.set(a,n),n>0&&c++}for(let[e,t]of a.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function P(){var e,t,r;let n=T();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(nr))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function T(){var e;return null==(e=N.current)?void 0:e.querySelector(`${na}[aria-selected="true"]`)}function O(){var e;return Array.from((null==(e=N.current)?void 0:e.querySelectorAll(ns))||[])}function D(e){let t=O()[e];t&&k.setState("value",t.getAttribute(ni))}function M(e){var t;let r=T(),n=O(),a=n.findIndex(e=>e===r),s=n[a+e];null!=(t=i.current)&&t.loop&&(s=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),s&&k.setState("value",s.getAttribute(ni))}function A(e){let t=T(),r=null==t?void 0:t.closest(nr),n;for(;r&&!n;)n=null==(r=e>0?function(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}(r,nr):function(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}(r,nr))?void 0:r.querySelector(ns);n?k.setState("value",n.getAttribute(ni)):M(e)}let L=()=>D(O().length-1),F=e=>{e.preventDefault(),e.metaKey?L():e.altKey?A(1):M(1)},B=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?A(-1):M(-1)};return h.createElement(nt.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=v.onKeyDown)||t.call(v,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":g&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":g&&e.ctrlKey&&B(e);break;case"ArrowUp":B(e);break;case"Home":e.preventDefault(),D(0);break;case"End":e.preventDefault(),L();break;case"Enter":{e.preventDefault();let t=T();if(t){let e=new Event(no);t.dispatchEvent(e)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:nE},l),nS(e,e=>h.createElement(nd.Provider,{value:k},h.createElement(nc.Provider,{value:C},e))))}),np=h.forwardRef((e,t)=>{var r,n;let a=tw(),s=h.useRef(null),o=h.useContext(nu),i=h.useContext(nc),l=ny(e),c=null!=(n=null==(r=l.current)?void 0:r.forceMount)?n:null==o?void 0:o.forceMount;nj(()=>{if(!c)return i.item(a,null==o?void 0:o.id)},[c]);let d=nk(a,s,[e.value,e.children,s],e.keywords),u=h.useContext(nd),m=nw(e=>e.value&&e.value===d.current),p=nw(e=>!!c||!1===i.filter()||!e.search||e.filtered.items.get(a)>0);function f(){var e,t;x(),null==(t=(e=l.current).onSelect)||t.call(e,d.current)}function x(){u.setState("value",d.current,!0)}if(h.useEffect(()=>{let t=s.current;if(!(!t||e.disabled))return t.addEventListener(no,f),()=>t.removeEventListener(no,f)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:g,value:v,onSelect:b,forceMount:y,keywords:j,...N}=e;return h.createElement(nt.div,{ref:tv(s,t),...N,id:a,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!m,"data-disabled":!!g,"data-selected":!!m,onPointerMove:g||i.getDisablePointerSelection()?void 0:x,onClick:g?void 0:f},e.children)}),nf=h.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:a,...s}=e,o=tw(),i=h.useRef(null),l=h.useRef(null),c=tw(),d=h.useContext(nc),u=nw(e=>!!a||!1===d.filter()||!e.search||e.filtered.groups.has(o));nj(()=>d.group(o),[]),nk(o,i,[e.value,e.heading,l]);let m=h.useMemo(()=>({id:o,forceMount:a}),[a]);return h.createElement(nt.div,{ref:tv(i,t),...s,"cmdk-group":"",role:"presentation",hidden:!u||void 0},r&&h.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},r),nS(e,e=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},h.createElement(nu.Provider,{value:m},e))))}),nh=h.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,a=h.useRef(null),s=nw(e=>!e.search);return r||s?h.createElement(nt.div,{ref:tv(a,t),...n,"cmdk-separator":"",role:"separator"}):null}),nx=h.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,a=null!=e.value,s=h.useContext(nd),o=nw(e=>e.search),i=nw(e=>e.selectedItemId),l=h.useContext(nc);return h.useEffect(()=>{null!=e.value&&s.setState("search",e.value)},[e.value]),h.createElement(nt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":i,id:l.inputId,type:"text",value:a?e.value:o,onChange:e=>{a||s.setState("search",e.target.value),null==r||r(e.target.value)}})}),ng=h.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,s=h.useRef(null),o=h.useRef(null),i=nw(e=>e.selectedItemId),l=h.useContext(nc);return h.useEffect(()=>{if(o.current&&s.current){let e=o.current,t=s.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;t.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),h.createElement(nt.div,{ref:tv(s,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":n,id:l.listId},nS(e,e=>h.createElement("div",{ref:tv(o,l.listInnerRef),"cmdk-list-sizer":""},e)))}),nv=h.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:s,container:o,...i}=e;return h.createElement(rL,{open:r,onOpenChange:n},h.createElement(rz,{container:o},h.createElement(rW,{"cmdk-overlay":"",className:a}),h.createElement(rK,{"aria-label":e.label,"cmdk-dialog":"",className:s},h.createElement(nm,{ref:t,...i}))))}),nb=Object.assign(nm,{List:ng,Item:np,Input:nx,Group:nf,Separator:nh,Dialog:nv,Empty:h.forwardRef((e,t)=>nw(e=>0===e.filtered.count)?h.createElement(nt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:h.forwardRef((e,t)=>{let{progress:r,children:n,label:a="Loading...",...s}=e;return h.createElement(nt.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},nS(e,e=>h.createElement("div",{"aria-hidden":!0},e)))})});function ny(e){let t=h.useRef(e);return nj(()=>{t.current=e}),t}var nj="u"<typeof window?h.useEffect:h.useLayoutEffect;function nN(e){let t=h.useRef();return void 0===t.current&&(t.current=e()),t}function nw(e){let t=h.useContext(nd),r=()=>e(t.snapshot());return h.useSyncExternalStore(t.subscribe,r,r)}function nk(e,t,r,n=[]){let a=h.useRef(),s=h.useContext(nc);return nj(()=>{var o;let i=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),l=n.map(e=>e.trim());s.value(e,i,l),null==(o=t.current)||o.setAttribute(ni,i),a.current=i}),a}var nC=()=>{let[e,t]=h.useState(),r=nN(()=>new Map);return nj(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function nS({asChild:e,children:t},r){let n;return e&&h.isValidElement(t)?h.cloneElement("function"==typeof(n=t.type)?n(t.props):"render"in n?n.render(t.props):t,{ref:t.ref},r(t.props.children)):r(t)}var nE={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},nR=e.i(164688);function nI({className:e,...t}){return(0,f.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,ti.cn)("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}let nP=(0,nR.cva)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function nT({className:e,align:t="inline-start",...r}){return(0,f.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:(0,ti.cn)(nP({align:t}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...r})}(0,nR.cva)("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});var nO=e.i(142296),nO=nO,nD=e.i(209760);function nM({className:e,...t}){return(0,f.jsx)(nb,{"data-slot":"command",className:(0,ti.cn)("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",e),...t})}function nA({className:e,...t}){return(0,f.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,f.jsxs)(nI,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[(0,f.jsx)(nb.Input,{"data-slot":"command-input",className:(0,ti.cn)("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t}),(0,f.jsx)(nT,{children:(0,f.jsx)(nO.default,{className:"size-4 shrink-0 opacity-50"})})]})})}function nL({className:e,...t}){return(0,f.jsx)(nb.List,{"data-slot":"command-list",className:(0,ti.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...t})}function nF({className:e,...t}){return(0,f.jsx)(nb.Empty,{"data-slot":"command-empty",className:(0,ti.cn)("py-6 text-center text-sm",e),...t})}function nB({className:e,...t}){return(0,f.jsx)(nb.Group,{"data-slot":"command-group",className:(0,ti.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...t})}function n$({className:e,children:t,...r}){return(0,f.jsxs)(nb.Item,{"data-slot":"command-item",className:(0,ti.cn)("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",e),...r,children:[t,(0,f.jsx)(nD.CheckIcon,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}var n_=e.i(543485);let nz=(0,n_.createServerReference)("4014ba9c54ad6a1c21619cdabfbe272a96517b3319",n_.callServer,void 0,n_.findSourceMapURL,"getProjectBranches"),nU=(0,n_.createServerReference)("40d73e44905481a0aebd424628ff7cf8a9c78de0df",n_.callServer,void 0,n_.findSourceMapURL,"fetchRemoteBranches"),nW=(0,n_.createServerReference)("4076a78d79fc639792e028377a4abbf4ad88c210a2",n_.callServer,void 0,n_.findSourceMapURL,"getCurrentBranch");function nH({open:e,onOpenChange:t,onSubmit:r,onUpdate:n,defaultStatus:a="TODO",editTask:s,editTaskLabelIds:o,labels:i,projectType:l,projectLocalPath:c}){let[d,u]=(0,h.useState)(""),[m,p]=(0,h.useState)(""),[x,g]=(0,h.useState)("MEDIUM"),[v,b]=(0,h.useState)(""),[y,N]=(0,h.useState)([]),[w,k]=(0,h.useState)([]),[S,E]=(0,h.useState)(!1),[I,P]=(0,h.useState)(""),[T,O]=(0,h.useState)(!1),[D,M]=(0,h.useState)(!0),{t:A}=(0,j.useI18n)(),L=!!s,F=!!c;return(0,h.useEffect)(()=>{s?(u(s.title),p(s.description??""),g(s.priority),b(s.subPath??""),N(o??[])):(u(""),p(""),g("MEDIUM"),b(""),N([]))},[s,o]),(0,h.useEffect)(()=>{e||s||(u(""),p(""),g("MEDIUM"),b(""),N([]),k([]),P(""),O(!1))},[e,s]),(0,h.useEffect)(()=>{e&&F&&!s&&(E(!0),Promise.all([nz(c),nW(c)]).then(([e,t])=>{k(e),P(t&&e.includes(t)?t:e[0]??""),E(!1),nU(c).then(()=>{setTimeout(()=>{nz(c).then(e=>{k(e),P(t=>e.includes(t)?t:e[0]??"")}).catch(()=>{})},3e3)})}).catch(()=>{k([]),P(""),E(!1)}))},[e,F,c,s]),(0,f.jsx)(U.Dialog,{open:e,onOpenChange:t,disablePointerDismissal:!0,children:(0,f.jsxs)(U.DialogContent,{className:"sm:max-w-md",children:[(0,f.jsx)(U.DialogHeader,{children:(0,f.jsx)(U.DialogTitle,{children:L?A("task.edit"):A("task.create")})}),(0,f.jsxs)("div",{className:"space-y-4 py-2",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Y.Label,{htmlFor:"title",children:A("task.title")}),(0,f.jsx)(K.Input,{id:"title","data-testid":"task-title",placeholder:A("task.titlePlaceholder"),value:d,onChange:e=>u(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault()})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Y.Label,{htmlFor:"description",children:A("task.description")}),(0,f.jsx)(q.Textarea,{id:"description",placeholder:A("task.descPlaceholder"),rows:4,value:m,onChange:e=>p(e.target.value),className:"max-h-[200px] overflow-y-auto"})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Y.Label,{htmlFor:"subPath",children:A("task.subPath")}),(0,f.jsx)(K.Input,{id:"subPath",placeholder:A("task.subPathPlaceholder"),value:v,onChange:e=>b(e.target.value)}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:A("task.subPathHint")})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Y.Label,{children:A("task.priority")}),(0,f.jsx)("div",{className:"flex gap-1.5",children:["LOW","MEDIUM","HIGH","CRITICAL"].map(e=>{let t={LOW:{label:A("task.priorityLow"),style:"text-slate-300 border-slate-500/30 bg-slate-500/10"},MEDIUM:{label:A("task.priorityMedium"),style:"text-amber-300 border-amber-500/30 bg-amber-500/10"},HIGH:{label:A("task.priorityHigh"),style:"text-orange-300 border-orange-500/30 bg-orange-500/10"},CRITICAL:{label:A("task.priorityCritical"),style:"text-rose-300 border-rose-500/30 bg-rose-500/10"}}[e];return(0,f.jsx)("button",{type:"button",onClick:()=>g(e),className:`rounded-lg border px-3 py-1.5 text-xs font-medium transition-all ${x===e?`${t.style} ring-1 ring-current/20`:"border-border text-muted-foreground hover:bg-accent"}`,children:t.label},e)})})]}),F&&!L&&(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Y.Label,{children:A("task.baseBranch")}),S?(0,f.jsx)("div",{className:"text-sm text-muted-foreground",children:A("task.branchLoading")}):w.length>0?(0,f.jsxs)(tl,{open:T,onOpenChange:O,children:[(0,f.jsxs)(tc,{className:"flex w-full items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-mono transition-colors hover:bg-accent focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"branch-selector",children:[(0,f.jsx)(X.GitBranch,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,f.jsx)("span",{className:"flex-1 truncate text-left text-xs",children:I||A("task.branchNone")}),(0,f.jsx)(Z,{className:"h-3.5 w-3.5 shrink-0 opacity-50"})]}),(0,f.jsx)(td,{className:"p-0",align:"start",children:(0,f.jsxs)(nM,{children:[(0,f.jsx)(nA,{placeholder:A("task.branchSearch")}),(0,f.jsxs)(nL,{children:[(0,f.jsx)(nF,{children:A("task.branchNone")}),(0,f.jsx)(nB,{children:w.map(e=>(0,f.jsxs)(n$,{value:e,onSelect:()=>{P(e),O(!1)},children:[(0,f.jsx)(X.GitBranch,{className:"h-3 w-3 text-muted-foreground shrink-0 mr-2"}),(0,f.jsx)("span",{className:"flex-1 truncate font-mono",children:e}),e===I&&(0,f.jsx)(R.Check,{className:"h-3 w-3 text-primary shrink-0 ml-auto"})]},e))})]})]})})]}):(0,f.jsx)("div",{className:"text-sm text-muted-foreground",children:A("task.branchNone")}),(0,f.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,f.jsx)(Y.Label,{className:"text-xs text-muted-foreground",children:A("task.worktreeLabel")}),(0,f.jsx)("div",{className:"flex gap-1",children:[!0,!1].map(e=>(0,f.jsx)("button",{type:"button",onClick:()=>M(e),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${D===e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e?A("task.worktreeYes"):A("task.worktreeNo")},String(e)))})]})]}),i.length>0&&(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Y.Label,{children:A("task.labels")}),(0,f.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.map(e=>{let t=y.includes(e.id);return(0,f.jsx)("button",{type:"button",onClick:()=>{N(r=>t?r.filter(t=>t!==e.id):[...r,e.id])},className:`rounded-full px-2.5 py-1 text-xs font-medium transition-all ${t?"ring-1 ring-current/30":"opacity-50 hover:opacity-80"}`,style:{backgroundColor:e.color+"20",color:e.color,borderColor:t?e.color+"40":"transparent",borderWidth:"1px"},children:e.name},e.id)})})]})]}),(0,f.jsxs)(U.DialogFooter,{children:[(0,f.jsx)(C.Button,{variant:"outline",onClick:()=>t(!1),children:A("common.cancel")}),(0,f.jsx)(C.Button,{onClick:()=>{d.trim()&&(L&&n?n(s.id,{title:d,description:m,priority:x,labelIds:y,subPath:v.trim()||""}):r({title:d,description:m,priority:x,status:a,labelIds:y,...F&&D&&I?{baseBranch:I}:{},...v.trim()?{subPath:v.trim()}:{}}),u(""),p(""),g("MEDIUM"),b(""),N([]),k([]),P(""),M(!0),t(!1))},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:L?A("common.save"):A("common.create")})]})]})})}var nG=e.i(458851),nV=e.i(803041),nK=e.i(802461),nq=e.i(555159),nY=e.i(478430);let nX=(0,v.default)("git-commit-vertical",[["path",{d:"M12 3v6",key:"1holv5"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 15v6",key:"a9ows0"}]]);var nZ=e.i(894296),nJ=e.i(946960),nQ=e.i(239358),n0=e.i(126741),n1=e.i(865592),n2=e.i(124612);let n5=(0,n_.createServerReference)("401a86ff2781c007191e772caa16e4b6e7441b15d0",n_.callServer,void 0,n_.findSourceMapURL,"deleteProject"),n3=(0,n_.createServerReference)("400261a6fb1c366a989585444549d8506d4ba9db8c",n_.callServer,void 0,n_.findSourceMapURL,"getRecentLocalProjects"),n4=(0,n_.createServerReference)("40f970bc0ca57ada0365f4088ef980b207fcf6a70c",n_.callServer,void 0,n_.findSourceMapURL,"getOrCreateTowerTaskId");var n9=e.i(499976),n8=e.i(286302),n7=e.i(921280),n6=e.i(584685),ae=e.i(909105),at=e.i(421845);function ar({commits:e}){let{t}=(0,j.useI18n)(),[r,n]=(0,h.useState)(!1);return 0===e.length?null:(0,f.jsxs)("div",{children:[(0,f.jsxs)("button",{onClick:()=>n(!r),className:"flex w-full items-center justify-between py-1",children:[(0,f.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:t("git.commitLog")}),r?(0,f.jsx)(nG.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,f.jsx)(nV.ChevronRight,{className:"h-3 w-3 text-muted-foreground"})]}),r&&(0,f.jsx)("div",{className:"mt-1.5 space-y-0.5 max-h-64 overflow-y-auto",children:e.map(e=>(0,f.jsxs)("div",{className:"group flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,f.jsx)(nX,{className:"h-3 w-3 shrink-0 text-muted-foreground mt-0.5"}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("p",{className:"text-xs text-foreground line-clamp-1",children:e.message}),(0,f.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,f.jsxs)("button",{onClick:()=>{navigator.clipboard.writeText(e.shortHash),n8.toast.success(`Copied ${e.shortHash}`)},className:"flex items-center gap-0.5 font-mono text-[10px] text-primary/70 hover:text-primary transition-colors",children:[e.shortHash,(0,f.jsx)(at.Copy,{className:"h-2.5 w-2.5 opacity-0 group-hover:opacity-100 transition-opacity"})]}),(0,f.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.author}),(0,f.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m`;let r=Math.floor(t/60);if(r<24)return`${r}h`;let n=Math.floor(r/24);return n<30?`${n}d`:`${Math.floor(n/30)}mo`}(e.date)})]})]})]},e.hash))})]})}var an=e.i(565037),aa=e.i(871183),as=e.i(657572);function ao({localPath:e,stashes:t,hasChanges:r,onRefresh:n}){let{t:a}=(0,j.useI18n)(),[s,o]=(0,h.useState)(!1),[i,l]=(0,h.useState)(!1),[c,d]=(0,h.useState)(""),[u,m]=(0,h.useState)(null),p=async()=>{l(!0);try{await (0,as.gitAction)(e,"stash-save",{message:c}),d(""),n8.toast.success(a("git.stashSaved")),await n()}catch(e){n8.toast.error(e instanceof Error?e.message:String(e))}finally{l(!1)}},x=async t=>{m(t);try{await (0,as.gitAction)(e,"stash-pop",{index:t}),n8.toast.success(a("git.stashApplied")),await n()}catch(e){n8.toast.error(e instanceof Error?e.message:String(e))}finally{m(null)}},g=async t=>{m(t);try{await (0,as.gitAction)(e,"stash-drop",{index:t}),n8.toast.success(a("git.stashDropped")),await n()}catch(e){n8.toast.error(e instanceof Error?e.message:String(e))}finally{m(null)}};return r||0!==t.length?(0,f.jsxs)("div",{children:[(0,f.jsxs)("button",{onClick:()=>o(!s),className:"flex w-full items-center justify-between py-1",children:[(0,f.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[a("git.stash")," ",t.length>0&&`(${t.length})`]}),s?(0,f.jsx)(nG.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,f.jsx)(nV.ChevronRight,{className:"h-3 w-3 text-muted-foreground"})]}),s&&(0,f.jsxs)("div",{className:"mt-1.5 space-y-2",children:[r&&(0,f.jsxs)("div",{className:"flex gap-1.5",children:[(0,f.jsx)(K.Input,{value:c,onChange:e=>d(e.target.value),placeholder:a("git.stashMsgPlaceholder"),className:"h-7 text-xs flex-1",onKeyDown:e=>"Enter"===e.key&&p()}),(0,f.jsx)(C.Button,{variant:"outline",size:"icon-sm",onClick:p,disabled:i,className:"shrink-0",children:i?(0,f.jsx)(nJ.Loader2,{className:"h-3 w-3 animate-spin"}):(0,f.jsx)(an.Archive,{className:"h-3 w-3"})})]}),t.length>0&&(0,f.jsx)("div",{className:"space-y-0.5",children:t.map(e=>(0,f.jsxs)("div",{className:"group flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,f.jsx)(an.Archive,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,f.jsx)("span",{className:"flex-1 min-w-0 truncate text-xs text-foreground",children:e.message||`stash@{${e.index}}`}),(0,f.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:()=>x(e.index),disabled:u===e.index,className:"text-muted-foreground","aria-label":a("git.stashApply"),children:u===e.index?(0,f.jsx)(nJ.Loader2,{className:"h-3 w-3 animate-spin"}):(0,f.jsx)(aa.ArrowUpFromLine,{className:"h-3 w-3"})}),(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:()=>g(e.index),disabled:u===e.index,className:"text-rose-400","aria-label":a("git.stashDrop"),children:(0,f.jsx)(F.Trash2,{className:"h-3 w-3"})})]})]},e.index))})]})]}):null}function ai({project:e,workspaceId:t}){let{t:r,locale:n}=(0,j.useI18n)(),a=(0,x.useRouter)(),[s,o]=(0,h.useState)(!0),[i,l]=(0,h.useState)(!0),[c,d]=(0,h.useState)(!1),[u,m]=(0,h.useState)(!1),[p,g]=(0,h.useState)(""),[v,b]=(0,h.useState)(!1),[y,N]=(0,h.useState)(!1),[w,k]=(0,h.useState)(!1),[S,E]=(0,h.useState)(e.name),[R,I]=(0,h.useState)(e.alias??""),[P,T]=(0,h.useState)(e.description??""),[O,D]=(0,h.useState)(e.localPath??""),[M,A]=(0,h.useState)(e.projectType??"FRONTEND"),[B,$]=(0,h.useState)([]);(0,h.useEffect)(()=>{n3(100).then($)},[]);let[_,z]=(0,h.useState)(!1),[W,H]=(0,h.useState)(""),[G,V]=(0,h.useState)(""),[Y,Z]=(0,h.useState)(""),[J,Q]=(0,h.useState)(""),[ee,et]=(0,h.useState)("FRONTEND"),[er,en]=(0,h.useState)(!1),[ea,es]=(0,h.useState)(!1),[eo,ei]=(0,h.useState)(null),[el,ec]=(0,h.useState)(!1),[ed,eu]=(0,h.useState)(!1),[em,ep]=(0,h.useState)(!1),ef=e=>{n8.toast.info(e)},eh=(0,h.useCallback)(async()=>{if(e.localPath){ec(!0);try{let t=await fetch(`/api/git?path=${encodeURIComponent(e.localPath)}`);t.ok&&ei(await t.json())}catch{}finally{ec(!1)}}},[e.localPath]);(0,h.useEffect)(()=>{eh()},[eh]);let ex=async()=>{if(e.localPath){eu(!0);try{(await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"init",path:e.localPath})})).ok?(ef(r("git.initSuccess")),await eh()):ef(r("git.initFailed"))}catch{ef(r("git.initFailed"))}finally{eu(!1)}}},eg=async t=>{if(e.localPath)try{let n=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"checkout",path:e.localPath,branch:t})});if(n.ok)ef(`${r("git.switchSuccess")} ${t}`),await eh();else{let e=await n.json();ef(`${r("git.switchFailed")}: ${e.error}`)}}catch{ef(r("git.switchFailed"))}},ev=(e,t)=>{a.push(`/workspaces/${e}?projectId=${t}`,{scroll:!1}),a.refresh()},eb=async()=>{if(G.trim()){en(!0);try{let e=await (0,n2.createProject)({name:G.trim(),alias:Y.trim()||void 0,description:J.trim()||void 0,localPath:W,projectType:ee,workspaceId:t});z(!1),ev(t,e.id)}catch(e){n8.toast.error(e instanceof Error?e.message:String(e))}finally{en(!1)}}},ey=async()=>{if(O&&!ea){es(!0);try{let e=await (0,n9.analyzeProjectDirectory)(O.trim(),n);T(e)}catch{n8.toast.error(r("project.analyzeError"))}finally{es(!1)}}},ej=async()=>{try{await (0,n1.updateProject)(e.id,{name:S.trim(),alias:R.trim()||void 0,description:P.trim()||void 0,localPath:O.trim()||void 0,projectType:M}),a.refresh(),d(!1)}catch(e){n8.toast.error(e instanceof Error?e.message:String(e))}};return(0,f.jsxs)("aside",{className:"relative w-72 flex-shrink-0 overflow-y-auto border-l border-border bg-sidebar",children:[(0,f.jsxs)("div",{className:"border-b border-border p-4",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between",children:[(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("h2",{className:"text-base font-semibold text-foreground",children:e.name}),e.alias&&(0,f.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.alias})]}),(0,f.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{E(e.name),I(e.alias??""),T(e.description??""),D(e.localPath??""),d(!0)},className:"text-muted-foreground",children:(0,f.jsx)(L.Pencil,{className:"h-3.5 w-3.5"})}),(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{g(""),m(!0)},className:"text-muted-foreground hover:text-rose-400",children:(0,f.jsx)(F.Trash2,{className:"h-3.5 w-3.5"})})]})]}),e.description&&(0,f.jsx)("p",{className:"mt-2 text-sm text-secondary-foreground leading-relaxed line-clamp-4",children:e.description}),(0,f.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:(0,f.jsx)("span",{className:`inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[11px] font-medium ${"GIT"===e.type?"bg-sky-500/15 text-sky-300 ring-1 ring-sky-500/20":"bg-muted text-muted-foreground ring-1 ring-border"}`,children:"GIT"===e.type?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(X.GitBranch,{className:"h-3 w-3"}),r("sidebar.right.gitType")]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(nq.FileText,{className:"h-3 w-3"}),r("sidebar.right.normalType")]})})}),e.localPath&&(0,f.jsxs)("div",{className:"mt-3 flex items-start gap-2 rounded-md bg-muted/50 px-2.5 py-2 text-xs",children:[(0,f.jsx)(nY.FolderOpen,{className:"mt-0.5 h-3 w-3 shrink-0 text-muted-foreground"}),(0,f.jsx)("span",{className:"break-all font-mono text-secondary-foreground",children:e.localPath})]}),e.gitUrl&&(0,f.jsxs)("div",{className:"mt-2 flex items-start gap-2 rounded-md bg-muted/50 px-2.5 py-2 text-xs",children:[(0,f.jsx)(nK.Globe,{className:"mt-0.5 h-3 w-3 shrink-0 text-muted-foreground"}),(0,f.jsx)("span",{className:"break-all text-secondary-foreground",children:e.gitUrl})]}),e.localPath&&(0,f.jsxs)(C.Button,{variant:"outline",className:"mt-3 w-full h-8 gap-1.5 text-xs",disabled:y,onClick:async()=>{N(!0);try{let r=await n4(e.id);a.push(`/workspaces/${t}/tasks/${r}`)}catch{n8.toast.error(r("git.openStudioFailed"))}finally{N(!1)}},children:[y?(0,f.jsx)(nJ.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,f.jsx)(nY.FolderOpen,{className:"h-3.5 w-3.5"}),r("git.openStudio")]})]}),(0,f.jsxs)("div",{className:"border-b border-border p-4",children:[(0,f.jsxs)(C.Button,{variant:"ghost",onClick:()=>o(!s),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,f.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("git.section")}),s?(0,f.jsx)(nG.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,f.jsx)(nV.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),s&&(0,f.jsx)("div",{className:"mt-3",children:e.localPath?el?(0,f.jsxs)("div",{className:"flex items-center justify-center py-4 text-muted-foreground",children:[(0,f.jsx)(nJ.Loader2,{className:"h-4 w-4 animate-spin"}),(0,f.jsx)("span",{className:"ml-2 text-xs",children:r("git.loading")})]}):eo&&!eo.isGit?(0,f.jsxs)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,f.jsx)(nZ.AlertCircle,{className:"h-3.5 w-3.5"}),(0,f.jsx)("p",{className:"text-xs",children:r("git.notInitialized")})]}),(0,f.jsxs)(C.Button,{className:"mt-3 h-7 w-full gap-1.5 bg-primary/10 text-xs text-primary ring-1 ring-primary/20 hover:bg-primary/15",onClick:ex,disabled:ed,children:[ed?(0,f.jsx)(nJ.Loader2,{className:"h-3 w-3 animate-spin"}):(0,f.jsx)(nX,{className:"h-3 w-3"}),r("git.initRepo")]})]}):eo?.isGit?(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsx)(al,{localBranches:eo.branches??[],remoteBranches:(eo.remoteBranches??[]).filter(e=>!eo.branches?.includes(e)),currentBranch:eo.currentBranch??"",onSwitch:eg,onFetch:async()=>{e.localPath&&(await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"fetch",path:e.localPath})}),await eh())},onCreateBranch:()=>ep(!0)}),(0,f.jsx)(ar,{commits:eo.commits??[]}),(0,f.jsx)(ao,{localPath:e.localPath,stashes:eo.stashes??[],hasChanges:(eo.changedFiles??[]).length>0,onRefresh:eh})]}):null:(0,f.jsx)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:(0,f.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,f.jsx)(nZ.AlertCircle,{className:"h-3.5 w-3.5"}),(0,f.jsx)("p",{className:"text-xs",children:r("git.noLocalPath")})]})})})]}),(0,f.jsxs)("div",{className:"p-4",children:[(0,f.jsxs)(C.Button,{variant:"ghost",onClick:()=>l(!i),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,f.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:r("sidebar.right.browseRepo")}),i?(0,f.jsx)(nG.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,f.jsx)(nV.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),i&&(0,f.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,f.jsxs)(C.Button,{variant:"outline",className:"w-full h-8 gap-1.5 text-xs",onClick:()=>k(!0),children:[(0,f.jsx)(nY.FolderOpen,{className:"h-3.5 w-3.5"}),r("sidebar.right.browseRepo")]}),B.length>0&&(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5 px-1",children:r("sidebar.right.recent")}),(0,f.jsx)("div",{className:"space-y-0.5",children:B.map(t=>(0,f.jsxs)("button",{onClick:()=>{t.id!==e.id&&ev(t.workspaceId,t.id)},className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors ${t.id===e.id?"bg-primary/10 text-primary cursor-default":"hover:bg-accent cursor-pointer"}`,children:["GIT"===t.type?(0,f.jsx)(X.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}):(0,f.jsx)(nY.FolderOpen,{className:"h-3 w-3 shrink-0 text-primary/70"}),(0,f.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,f.jsx)("p",{className:"truncate text-xs font-medium text-foreground",children:t.name}),t.localPath&&(0,f.jsx)("p",{className:"truncate text-[10px] font-mono text-muted-foreground",children:t.localPath})]})]},t.id))})]})]})]}),(0,f.jsx)(U.Dialog,{open:c,onOpenChange:d,children:(0,f.jsxs)(U.DialogContent,{style:{maxWidth:"32rem"},children:[(0,f.jsx)(U.DialogHeader,{children:(0,f.jsx)(U.DialogTitle,{children:r("project.edit")})}),(0,f.jsxs)("div",{className:"space-y-3 py-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.name")}),(0,f.jsx)(K.Input,{value:S,onChange:e=>E(e.target.value),className:"mt-1.5"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.type.label")}),(0,f.jsx)("div",{className:"mt-1.5",children:(0,f.jsx)(n6.SegmentedControl,{options:[{value:"FRONTEND",label:r("project.type.frontend")},{value:"BACKEND",label:r("project.type.backend")}],value:M,onChange:A})})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.alias")}),(0,f.jsx)(K.Input,{value:R,onChange:e=>I(e.target.value),className:"mt-1.5"})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.description")}),(0,f.jsxs)(C.Button,{type:"button",variant:"ghost",onClick:ey,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!O||ea?"opacity-50":""}`,children:[ea?(0,f.jsx)(nJ.Loader2,{className:"h-3 w-3 animate-spin"}):(0,f.jsx)(nQ.Sparkles,{className:"h-3 w-3"}),ea?r("project.analyzing"):r("project.genDesc")]})]}),(0,f.jsx)(q.Textarea,{value:P,onChange:e=>T(e.target.value),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.localPath")}),(0,f.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,f.jsx)(K.Input,{value:O,onChange:e=>D(e.target.value),placeholder:r("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs"}),(0,f.jsx)(C.Button,{variant:"outline",onClick:()=>k(!0),className:"h-8 shrink-0",children:r("folder.browse")})]})]})]}),(0,f.jsxs)(U.DialogFooter,{children:[(0,f.jsx)(C.Button,{variant:"outline",onClick:()=>d(!1),children:r("common.cancel")}),(0,f.jsx)(C.Button,{onClick:ej,disabled:!S.trim()||ea,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:r("common.save")})]})]})}),(0,f.jsx)(n7.FolderBrowserDialog,{open:w,onOpenChange:k,onSelect:e=>{c?D(e):(e=>{let t=B.find(t=>t.localPath===e);if(t)return ev(t.workspaceId,t.id);let r=e.split("/").filter(Boolean).pop()??"";H(e),V(r),Z(""),Q(""),z(!0)})(e)}}),(0,f.jsx)(U.Dialog,{open:_,onOpenChange:z,children:(0,f.jsxs)(U.DialogContent,{className:"sm:max-w-md",children:[(0,f.jsx)(U.DialogHeader,{children:(0,f.jsx)(U.DialogTitle,{children:r("topbar.newProject")})}),(0,f.jsxs)("div",{className:"space-y-3 py-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.localPath")}),(0,f.jsx)("div",{className:"mt-1.5 rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:W})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.name")}),(0,f.jsx)(K.Input,{value:G,onChange:e=>V(e.target.value),placeholder:r("project.namePlaceholder"),className:"mt-1.5"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.type.label")}),(0,f.jsx)("div",{className:"mt-1.5",children:(0,f.jsx)(n6.SegmentedControl,{options:[{value:"FRONTEND",label:r("project.type.frontend")},{value:"BACKEND",label:r("project.type.backend")}],value:ee,onChange:et})})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.alias")}),(0,f.jsx)(K.Input,{value:Y,onChange:e=>Z(e.target.value),placeholder:r("project.aliasPlaceholder"),className:"mt-1.5"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.description")}),(0,f.jsx)(q.Textarea,{value:J,onChange:e=>Q(e.target.value),placeholder:r("project.descPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,f.jsxs)(U.DialogFooter,{children:[(0,f.jsx)(C.Button,{variant:"outline",onClick:()=>z(!1),children:r("common.cancel")}),(0,f.jsxs)(C.Button,{onClick:eb,disabled:!G.trim()||er,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[er?(0,f.jsx)(nJ.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,r("common.create")]})]})]})}),eo?.isGit&&(0,f.jsx)(ae.CreateBranchDialog,{open:em,onOpenChange:ep,branches:eo.branches??[],currentBranch:eo.currentBranch??"",localPath:e.localPath,onCreated:async()=>{await eh(),ef(r("git.createSuccess"))},onError:e=>ef(`${r("git.createFailed")}: ${e}`)}),(0,f.jsx)(U.Dialog,{open:u,onOpenChange:e=>{m(e),e||g("")},children:(0,f.jsxs)(U.DialogContent,{className:"sm:max-w-md",children:[(0,f.jsx)(U.DialogHeader,{children:(0,f.jsx)(U.DialogTitle,{className:"text-rose-400",children:r("project.deleteTitle")})}),(0,f.jsxs)("div",{className:"space-y-3 py-2",children:[(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:r("project.deleteWarning",{name:e.name})}),(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:r("project.deleteIrreversible")}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:r("project.deleteConfirmLabel")}),(0,f.jsx)(K.Input,{value:p,onChange:e=>g(e.target.value),placeholder:r("project.deleteConfirmPlaceholder"),className:"mt-1.5",autoFocus:!0})]})]}),(0,f.jsxs)(U.DialogFooter,{children:[(0,f.jsx)(C.Button,{variant:"outline",onClick:()=>m(!1),children:r("common.cancel")}),(0,f.jsxs)(C.Button,{variant:"destructive",disabled:p!==r("project.deleteConfirmText")||v,onClick:async()=>{b(!0);try{await n5(e.id),n8.toast.success(r("project.deleteSuccess")),a.push(`/workspaces/${t}`)}catch{n8.toast.error(r("project.deleteFailed"))}finally{b(!1),m(!1)}},children:[v&&(0,f.jsx)(nJ.Loader2,{className:"h-3 w-3 animate-spin mr-1"}),r("project.deleteButton")]})]})]})})]})}function al({localBranches:e,remoteBranches:t,currentBranch:r,onSwitch:n,onFetch:a,onCreateBranch:s}){let{t:o}=(0,j.useI18n)(),[i,l]=(0,h.useState)(!1),[c,d]=(0,h.useState)(""),[u,m]=(0,h.useState)(!1),p=(0,h.useRef)(null);(0,h.useEffect)(()=>{if(i)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){p.current&&!p.current.contains(e.target)&&l(!1)}},[i]);let x=c.toLowerCase(),g=e.filter(e=>e.toLowerCase().includes(x)),v=t.filter(e=>e.toLowerCase().includes(x)),b=g.length>0||v.length>0,y=async()=>{m(!0);try{await a()}finally{m(!1)}};return(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,f.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:o("git.currentBranch")}),(0,f.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:y,disabled:u,className:"text-muted-foreground","aria-label":"Fetch",children:(0,f.jsx)(n0.RefreshCw,{className:`h-3 w-3 ${u?"animate-spin":""}`})}),(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:s,className:"text-muted-foreground","aria-label":o("git.createBranch"),children:(0,f.jsx)(w.Plus,{className:"h-3 w-3"})})]})]}),(0,f.jsxs)("div",{className:"relative",ref:p,children:[(0,f.jsxs)("button",{onClick:()=>{l(!i),d("")},className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,f.jsx)(X.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,f.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:r||"—"})]}),(0,f.jsx)(nG.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${i?"rotate-180":""}`})]}),i&&(0,f.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,f.jsx)("div",{className:"border-b border-border p-1.5",children:(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(k.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,f.jsx)("input",{value:c,onChange:e=>d(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,f.jsxs)("div",{className:"max-h-60 overflow-auto py-1",children:[!b&&(0,f.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"}),g.length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:"px-3 pt-1.5 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:o("git.localBranches")}),g.map(e=>{let t=e===r;return(0,f.jsxs)("button",{onClick:()=>{t||n(e),l(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${t?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,f.jsx)(X.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,f.jsx)("span",{className:"truncate font-mono text-xs",children:e}),t&&(0,f.jsx)(R.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${e}`)})]}),v.length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:"px-3 pt-2.5 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:o("git.remoteBranches")}),v.map(e=>(0,f.jsxs)("button",{onClick:()=>{n(e),l(!1)},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,f.jsx)(nK.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,f.jsx)("span",{className:"truncate font-mono text-xs",children:e})]},`remote-${e}`))]})]})]})]})]})}let ac=(0,v.default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var ad=e.i(950211),au=e.i(289208),am=e.i(750986),ap=e.i(610874),af=e.i(11915),ah=e.i(265826);function ax({title:e,description:t,branch:r,baseBranch:n,hasConversation:a,updatedAt:s,onBack:o}){let{t:i}=(0,j.useI18n)();return(0,f.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(nQ.Sparkles,{className:"h-3.5 w-3.5 text-primary"}),(0,f.jsx)("span",{className:"text-xs font-semibold text-primary",children:i("taskDetail.title")})]}),(0,f.jsxs)(C.Button,{variant:"ghost",onClick:o,className:"flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground h-auto px-2 py-1",children:[(0,f.jsx)(ah.ArrowLeft,{className:"h-3.5 w-3.5"}),i("taskDetail.back")]})]}),(0,f.jsx)("h2",{className:"mt-2.5 text-lg font-bold tracking-tight text-foreground",children:e}),t&&(0,f.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:t}),(0,f.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[n?(0,f.jsxs)($.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:[(0,f.jsx)(X.GitBranch,{className:"mr-1 h-3 w-3"}),n," · worktree"]}):r?(0,f.jsx)($.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:i("taskDetail.directMode")}):null,a&&(0,f.jsx)($.Badge,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-400 text-[10px] border border-emerald-500/20",children:i("taskDetail.hasConversation")}),(0,f.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[i("taskDetail.updatedAt")," ",(0,ti.formatRelativeTime)(s)]})]})]})}var ag=e.i(477795),av=e.i(486305),ab=e.i(79769),ay=e.i(48513),aj=e.i(321721),aN=e.i(512875),aw=e.i(322974),ak=e.i(767096),aC=e.i(439613),aS=e.i(404992),aE=e.i(506849),aR=e.i(703011),aI=e.i(612758),aP=e.i(215365);let aT=(0,v.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);var aO=e.i(996032),aD=e.i(637839);let aM=(0,n_.createServerReference)("400451039c091db41044fd8a496545041bc12e3909",n_.callServer,void 0,n_.findSourceMapURL,"getTaskNotes");var aA=e.i(762207);let aL=(0,n_.createServerReference)("40a8cc279e0ac90608e2af43dfb8227bf5cdd59d47",n_.callServer,void 0,n_.findSourceMapURL,"getTaskAssets");var aF=e.i(569265),aB=e.i(955252);function a$({taskId:e,projectId:t}){let{t:r}=(0,j.useI18n)(),n=(0,h.useRef)(null),[a,s]=(0,h.useState)([]),[o,i]=(0,h.useState)([]),[l,c]=(0,h.useState)(!1),[d,u]=(0,h.useState)(""),[m,p]=(0,h.useState)(""),[x,g]=(0,h.useState)(!1);async function v(){d.trim()&&(await (0,aD.createNote)({title:d.trim(),content:m.trim(),projectId:t,taskId:e,category:"task"}),u(""),p(""),c(!1),aM(e).then(s))}async function b(e){await (0,aA.deleteNote)(e),s(t=>t.filter(t=>t.id!==e))}async function y(r){let a=r.target.files?.[0];if(a){g(!0);try{let r=new FormData;r.set("file",a),r.set("projectId",t),r.set("taskId",e),await (0,aF.uploadAsset)(r),aL(e).then(i)}finally{g(!1),n.current&&(n.current.value="")}}}async function N(e){await (0,aB.deleteAsset)(e),i(t=>t.filter(t=>t.id!==e))}return(0,h.useEffect)(()=>{aM(e).then(s),aL(e).then(i)},[e]),(0,f.jsx)(W.ScrollArea,{className:"h-full",children:(0,f.jsxs)("div",{className:"flex flex-col",children:[(0,f.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,f.jsx)(nq.FileText,{className:"h-3.5 w-3.5"}),r("taskPage.notes")]}),(0,f.jsxs)(C.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>c(!l),children:[l?(0,f.jsx)(aO.X,{className:"h-3 w-3"}):(0,f.jsx)(w.Plus,{className:"h-3 w-3"}),l?"":r("taskPage.addNote")]})]}),l&&(0,f.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,f.jsx)("input",{type:"text",value:d,onChange:e=>u(e.target.value),placeholder:r("taskPage.noteTitle"),className:"h-8 w-full rounded-md border border-border bg-background px-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary",autoFocus:!0}),(0,f.jsx)("textarea",{value:m,onChange:e=>p(e.target.value),placeholder:r("taskPage.noteContent"),rows:3,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary resize-none"}),(0,f.jsx)(C.Button,{className:"text-xs",onClick:v,disabled:!d.trim(),children:r("taskPage.addNote")})]}),(0,f.jsxs)("div",{className:"mt-2 space-y-2",children:[0===a.length&&!l&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:r("taskPage.noNotes")}),a.map(e=>(0,f.jsx)("div",{className:"group rounded-md border border-border bg-card p-3",children:(0,f.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,f.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,f.jsx)("h4",{className:"text-sm font-medium truncate",children:e.title}),e.content&&(0,f.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-3 whitespace-pre-wrap",children:e.content}),(0,f.jsx)("p",{className:"mt-1 text-[10px] text-muted-foreground",children:new Date(e.createdAt).toLocaleString()})]}),(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:()=>b(e.id),className:"shrink-0 text-muted-foreground opacity-0 hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100",title:r("taskPage.deleteNote"),children:(0,f.jsx)(F.Trash2,{className:"h-3.5 w-3.5"})})]})},e.id))]})]}),(0,f.jsxs)("div",{className:"px-4 py-3",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,f.jsx)(aT,{className:"h-3.5 w-3.5"}),r("taskPage.attachments")]}),(0,f.jsxs)(C.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>n.current?.click(),disabled:x,children:[(0,f.jsx)(aP.Upload,{className:"h-3 w-3"}),r("taskPage.uploadFile")]}),(0,f.jsx)("input",{ref:n,type:"file",className:"hidden",onChange:y})]}),(0,f.jsxs)("div",{className:"mt-2 space-y-1.5",children:[0===o.length&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:r("taskPage.noAttachments")}),o.map(e=>{var t;return(0,f.jsxs)("div",{className:"group flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2",children:[(0,f.jsx)(aT,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,f.jsx)("span",{className:"flex-1 truncate text-sm",children:e.filename}),(0,f.jsx)("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:(t=e.size)?t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`:""}),(0,f.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:()=>N(e.id),className:"shrink-0 text-muted-foreground opacity-0 hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100",title:r("taskPage.deleteAttachment"),children:(0,f.jsx)(F.Trash2,{className:"h-3 w-3"})})]},e.id)})]})]})]})})}function a_({task:e,workspaceId:t,projectLocalPath:r,onClose:n}){let{t:a}=(0,j.useI18n)(),s=(0,x.useRouter)(),{removePortal:o}=(0,ab.useTerminalPortal)(),[i,l]=(0,h.useState)("terminal"),[c,d]=(0,h.useState)(null),[u,m]=(0,h.useState)(!1),[p,g]=(0,h.useState)(e.status);(0,h.useEffect)(()=>{g(e.status)},[e.status]);let[v,b]=(0,h.useState)(null),[y,N]=(0,h.useState)(!1),[w,k]=(0,h.useState)(!1),[S,E]=(0,h.useState)([]);(0,h.useEffect)(()=>{b(null),N(!1),k(!1),E([]),d(null),l("terminal")},[e.id]);let[R,I]=(0,h.useState)([]),[P,T]=(0,h.useState)(null);(0,h.useEffect)(()=>{let e=!1;return(0,aR.getPrompts)().then(t=>{if(e)return;I(t.map(e=>({id:e.id,name:e.name,isDefault:e.isDefault})));let r=t.find(e=>e.isDefault);r&&T(r.id)}),()=>{e=!0}},[]),(0,h.useEffect)(()=>{b(null),k(!1);let t=!1;return(0,ay.getTaskExecutions)(e.id).then(e=>{if(t)return;let n=e[0];if(n?.status==="RUNNING"){let e=n.worktreePath||r||null;e&&b(e)}E(e.filter(e=>"RUNNING"!==e.status)),k(!0)}),()=>{t=!0}},[e.id]),(0,h.useEffect)(()=>{if("changes"!==i||"TODO"===p||"CANCELLED"===p)return;let t=!1;return m(!0),fetch(`/api/tasks/${e.id}/diff`).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{t||d(e?.files||e?.branchDeleted?e:null)}).catch(()=>{t||d(null)}).finally(()=>{t||m(!1)}),()=>{t=!0}},[i,p,e.id]);let O=(0,h.useCallback)(async()=>{if(!y){N(!0);try{let{worktreePath:t}=await (0,aj.startPtyExecution)(e.id,"",P);b(t),g("IN_PROGRESS")}catch(e){N(!1),n8.toast.error(e instanceof Error?e.message:String(e))}}},[e.id,y,P]),D=(0,h.useCallback)(t=>{N(!1),b(null),o(e.id),0===t&&g("IN_REVIEW"),(0,ay.getTaskExecutions)(e.id).then(e=>{E(e.filter(e=>"RUNNING"!==e.status))}),s.refresh()},[s,e.id]),M=(0,h.useCallback)(async()=>{await (0,aN.stopPtyExecution)(e.id),N(!1),b(null),g("IN_REVIEW"),(0,ay.getTaskExecutions)(e.id).then(e=>{E(e.filter(e=>"RUNNING"!==e.status))}),s.refresh()},[e.id,s]),A=(0,h.useCallback)(async t=>{N(!0),o(e.id),b(null);try{let{worktreePath:r}=await (0,aw.resumePtyExecution)(e.id,t);b(r),g("IN_PROGRESS")}catch{N(!1)}},[e.id,o]),L=(0,h.useCallback)(async()=>{N(!0),o(e.id),b(null);try{let{worktreePath:t}=await (0,ak.continueLatestPtyExecution)(e.id);b(t),g("IN_PROGRESS")}catch(e){N(!1),n8.toast.error(e instanceof Error?e.message:String(e))}},[e.id,o]),[F,B]=(0,h.useState)(!1),[$,_]=(0,h.useState)([]),z=(0,h.useCallback)(async()=>{try{let t=await (0,aS.checkWorktreeClean)(e.id);if(t.hasWorktree&&!t.clean)return void n8.toast.error(a("taskPage.uncommittedChanges",{count:String(t.files.length)}));if(t.hasWorktree&&t.clean&&!t.hasCommits)return void n8.toast.error(a("taskPage.noChangesToComplete"));if(t.hasWorktree&&t.hasCommits){_(t.commitLog),B(!0);return}await (0,aC.updateTaskStatus)(e.id,"DONE"),g("DONE"),n8.toast.success(a("taskPage.taskCompleted")),s.refresh()}catch{n8.toast.error("Failed to complete task")}},[e.id,s,a]),U=(0,h.useCallback)(()=>{g("DONE"),B(!1),n8.toast.success(a("taskPage.taskCompleted")),s.refresh()},[s,a]),H=(0,h.useCallback)(async t=>{try{let{hash:r}=await (0,aE.commitWorktreeChanges)(e.id,t);n8.toast.success(a("diff.commitSuccess",{hash:r})),s.refresh();let n=await fetch(`/api/tasks/${e.id}/diff`);if(n.ok){let e=await n.json();d(e?.files?e:null)}}catch(e){n8.toast.error(e instanceof Error?e.message:"Commit failed")}},[e.id,s,a]);return(0,f.jsxs)("div",{className:"flex h-full w-[600px] flex-shrink-0 flex-col border-l border-border bg-sidebar","data-testid":"task-detail-panel",children:[(0,f.jsx)(ax,{title:e.title,description:a("taskDetail.panelDescription"),branch:`task/${e.id}`,baseBranch:e.baseBranch,hasConversation:!1,updatedAt:e.updatedAt,onBack:n}),(0,f.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-2",children:[(0,f.jsxs)("div",{className:"flex gap-1",children:[(0,f.jsxs)("button",{onClick:()=>l("terminal"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"terminal"===i?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,f.jsx)(ad.Terminal,{className:"h-3 w-3"}),a("terminal.execute")]}),(0,f.jsx)("button",{onClick:()=>l("changes"),className:`px-3 py-1 text-xs font-medium rounded-md ${"changes"===i?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:a("taskPage.changes")}),(0,f.jsxs)("button",{onClick:()=>l("notes"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"notes"===i?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,f.jsx)(nq.FileText,{className:"h-3 w-3"}),a("taskPage.notes")]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:["IN_REVIEW"===p&&(0,f.jsxs)(C.Button,{size:"sm",onClick:z,className:"bg-emerald-500/15 text-emerald-400 ring-1 ring-emerald-500/20 hover:bg-emerald-500/25",children:[(0,f.jsx)(am.CheckCircle2,{className:"h-3 w-3"}),a("taskPage.completeTask")]}),"DONE"!==p&&"CANCELLED"!==p&&(0,f.jsxs)(C.Button,{variant:"ghost",size:"sm",onClick:()=>s.push(`/workspaces/${t}/tasks/${e.id}`),className:"text-muted-foreground",children:[(0,f.jsx)(ac,{className:"h-3 w-3"}),a("taskPage.viewDetails")]})]})]}),"terminal"===i?(0,f.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:w?v?(0,f.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,f.jsxs)("div",{className:"shrink-0 flex items-center justify-between border-b border-neutral-800 px-3 py-2 bg-[#0f1419]",children:[(0,f.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400",children:[(0,f.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),a("execution.running")]}),(0,f.jsxs)(af.Tooltip,{children:[(0,f.jsxs)(af.TooltipTrigger,{onClick:M,className:"flex items-center gap-1.5 rounded-md bg-red-500/15 px-3 py-1 text-xs font-medium text-red-400 hover:bg-red-500/25 transition-colors",children:[(0,f.jsx)(au.Square,{className:"h-3 w-3"}),a("terminal.stopExecution")]}),(0,f.jsx)(af.TooltipContent,{side:"bottom",children:a("terminal.stopHint")})]})]}),(0,f.jsx)("div",{className:"flex-1 min-h-0",children:(0,f.jsx)(ab.TerminalOutlet,{taskId:e.id,worktreePath:v,onSessionEnd:D})})]}):"DONE"===p||"CANCELLED"===p?(0,f.jsx)("div",{className:"flex h-full flex-col overflow-hidden",children:(0,f.jsx)(W.ScrollArea,{className:"flex-1 min-h-0",children:(0,f.jsx)(aI.ExecutionTimeline,{executions:S})})}):(0,f.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,f.jsxs)("div",{className:"shrink-0 flex items-center gap-2 border-b border-border px-4 py-3",children:[R.length>0&&(0,f.jsxs)(ap.Select,{defaultValue:P??"none",onValueChange:e=>T("none"===e?null:e),children:[(0,f.jsx)(ap.SelectTrigger,{size:"sm",className:"min-w-[120px]",children:(0,f.jsx)("span",{className:"text-left truncate",children:P?R.find(e=>e.id===P)?.name??a("terminal.noPrompt"):a("terminal.noPrompt")})}),(0,f.jsxs)(ap.SelectContent,{className:"min-w-[200px]",children:[(0,f.jsx)(ap.SelectItem,{value:"none",children:a("terminal.noPrompt")}),R.map(e=>(0,f.jsxs)(ap.SelectItem,{value:e.id,children:[e.name,e.isDefault?" ★":""]},e.id))]})]},`prompt-${R.length}`),(0,f.jsxs)(C.Button,{onClick:O,disabled:y,size:"sm",className:"gap-2 px-4",children:[y?(0,f.jsx)(nJ.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,f.jsx)(ad.Terminal,{className:"h-3.5 w-3.5"}),y?a("terminal.executing"):a("terminal.launch")]})]}),(0,f.jsx)(W.ScrollArea,{className:"flex-1 min-h-0",children:(0,f.jsx)(aI.ExecutionTimeline,{executions:S,onResume:A,onContinueLatest:L})})]}):(0,f.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-[#0f1419]",children:[(0,f.jsx)(nJ.Loader2,{className:"size-5 animate-spin text-neutral-500"}),(0,f.jsx)("span",{className:"text-xs text-neutral-500",children:a("execution.loading")})]})}):"changes"===i?(0,f.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:u?(0,f.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:a("taskPage.loadingDiff")})}):c?.branchDeleted?(0,f.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:a("taskPage.branchDeleted")})}):c?(0,f.jsx)(ag.TaskDiffView,{files:c.files,totalAdded:c.totalAdded,totalRemoved:c.totalRemoved,hasConflicts:c.hasConflicts,conflictFiles:c.conflictFiles,onCommit:H,hasUncommitted:c.hasUncommitted}):(0,f.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:a("taskPage.noChanges")})})}):"notes"===i?(0,f.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,f.jsx)(a$,{taskId:e.id,projectId:e.projectId})}):null,(0,f.jsx)(av.TaskMergeConfirmDialog,{open:F,onOpenChange:B,taskId:e.id,taskTitle:e.title,baseBranch:e.baseBranch??"main",fileCount:c?.files?.length??0,commitCount:c?.commitCount??0,commitLog:$,onMergeComplete:U})]})}let az=(0,n_.createServerReference)("405c7cdaed8a744b4636209fcc52ee74370aeac41f",n_.callServer,void 0,n_.findSourceMapURL,"createTask"),aU=(0,n_.createServerReference)("60d789f18aebc022055dd1b9f3af1addb5fb991a80",n_.callServer,void 0,n_.findSourceMapURL,"updateTask"),aW=(0,n_.createServerReference)("40922d01c2b3509a6c7e52b1991eb999c18d91681d",n_.callServer,void 0,n_.findSourceMapURL,"deleteTask"),aH=(0,n_.createServerReference)("4076220a9a6176a45c796b35db195a40b577da3ff6",n_.callServer,void 0,n_.findSourceMapURL,"toggleTaskPinned");var aG=e.i(864056);function aV({projects:e,activeProjectId:t,onSelect:r}){let n=(0,h.useRef)(null),[a,s]=(0,h.useState)(!1),[o,i]=(0,h.useState)(!1),l=()=>{let e=n.current;e&&(s(e.scrollLeft>0),i(e.scrollLeft<e.scrollWidth-e.clientWidth-1))};(0,h.useEffect)(()=>{l();let e=n.current;if(e){e.addEventListener("scroll",l);let t=new ResizeObserver(l);return t.observe(e),()=>{e.removeEventListener("scroll",l),t.disconnect()}}},[e]);let c=e=>{let t=n.current;t&&t.scrollBy({left:"left"===e?-150:150,behavior:"smooth"})};return(0,f.jsxs)("div",{className:"relative flex items-center",children:[a&&(0,f.jsx)("button",{onClick:()=>c("left"),className:"absolute left-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,f.jsx)(aG.ChevronLeft,{className:"h-4 w-4"})}),(0,f.jsx)("div",{ref:n,className:"flex items-center gap-1.5 overflow-x-auto scrollbar-none px-1 py-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map(e=>{let n=t===e.id;return(0,f.jsxs)("button",{onClick:()=>{n||r(e.id)},className:`shrink-0 rounded-lg border-b-2 px-4 py-2 text-sm font-medium transition-colors ${n?"border-primary bg-primary/10 text-primary ring-1 ring-primary/20 cursor-default":"border-transparent text-muted-foreground hover:bg-accent hover:text-foreground cursor-pointer"}`,children:[(0,f.jsx)("span",{children:e.name}),e.alias&&(0,f.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:e.alias})]},e.id)})}),o&&(0,f.jsx)("button",{onClick:()=>c("right"),className:"absolute right-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,f.jsx)(nV.ChevronRight,{className:"h-4 w-4"})})]})}e.s(["BoardPageClient",0,function({workspaceId:e,projectId:t,project:r,projects:n,initialTasks:a,labels:s,openTaskId:o}){let i=(0,x.useRouter)(),[,l]=(0,h.useTransition)(),[c,d]=(0,h.useState)(""),[u,m]=(0,h.useState)(!1),[p,g]=(0,h.useState)("TODO"),[v,b]=(0,h.useState)(o?a.find(e=>e.id===o)??null:null),[y,j]=(0,h.useState)(null),w=(0,h.useCallback)(()=>{l(()=>{i.refresh()})},[i]);(0,h.useEffect)(()=>{if(u)return;let e=setInterval(()=>{l(()=>{i.refresh()})},5e3);return()=>clearInterval(e)},[i,u]);let k=(0,h.useCallback)(e=>{d(e)},[]),C=(0,h.useCallback)(async(e,t)=>{await (0,aC.updateTaskStatus)(e,t),v?.id===e&&b({...v,status:t}),w()},[w,v]),E=(0,h.useCallback)(async e=>{await az({title:e.title,description:e.description,projectId:t,priority:e.priority,status:e.status,labelIds:e.labelIds,baseBranch:e.baseBranch,subPath:e.subPath}),w()},[t,w]),R=(0,h.useCallback)(async(e,t)=>{await aU(e,{...t,labelIds:t.labelIds}),j(null),w()},[w]),P=(0,h.useCallback)(async e=>{await aW(e),v?.id===e&&b(null),w()},[w,v]),T=(0,h.useCallback)(async e=>{await aH(e),w()},[w]),O=(0,h.useCallback)(async t=>{try{await (0,aj.startPtyExecution)(t,"")}catch(e){n8.toast.error(e instanceof Error?e.message:String(e))}i.push(`/workspaces/${e}/tasks/${t}`)},[i,e]),D=(0,h.useCallback)(async(e,t)=>{await (0,aC.updateTaskStatus)(e,t),v?.id===e&&b({...v,status:t}),w()},[w,v]),M=(0,h.useCallback)(e=>{g(e),j(null),m(!0)},[]),A=(0,h.useCallback)(e=>{j(e),m(!0)},[]),L=a.filter(e=>!e.labels?.some(e=>e.label.name===I.TOWER_LABEL_NAME&&e.label.isBuiltin)),F=c.trim()?L.filter(e=>{let t=c.toLowerCase();return e.title.toLowerCase().includes(t)||(e.description?.toLowerCase().includes(t)??!1)}):L;return(0,f.jsxs)("div",{className:"flex h-full",children:[(0,f.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,f.jsx)("div",{className:"px-6 pt-3 pb-1",children:(0,f.jsx)(aV,{projects:n,activeProjectId:t,onSelect:t=>i.push(`/workspaces/${e}?projectId=${t}`,{scroll:!1})})}),(0,f.jsx)(N,{totalTasks:L.length,runningTasks:L.filter(e=>"IN_PROGRESS"===e.status).length}),(0,f.jsx)(S,{searchQuery:c,onSearchChange:k,onCreateTask:()=>{j(null),m(!0)}}),(0,f.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden p-4",children:(0,f.jsx)(V,{initialTasks:F,onTaskMove:C,onTaskClick:e=>{b(e)},onEditTask:A,onAddTask:M,onDeleteTask:P,onTogglePin:T,workspaceId:e,onContextMenuStatusChange:D,onContextMenuLaunch:O})}),(0,f.jsx)(nH,{open:u,onOpenChange:e=>{m(e),e||j(null)},onSubmit:E,onUpdate:R,defaultStatus:p,editTask:y,editTaskLabelIds:y?.labels?y.labels.map(e=>e.labelId):[],labels:s.filter(e=>!(e.name===I.TOWER_LABEL_NAME&&e.isBuiltin)),projectType:r.type,projectLocalPath:r.localPath})]}),v?(0,f.jsx)(a_,{task:v,workspaceId:e,projectLocalPath:r.localPath,onClose:()=>b(null)}):(0,f.jsx)(ai,{project:r,workspaceId:e})]})}],136924)}]);