tower-studio 0.1.16 → 0.1.18

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 (172) 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 +47 -47
  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 +23 -23
  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 +47 -47
  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 +23 -23
  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 +23 -23
  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 +30 -30
  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 +73 -73
  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 +68 -68
  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 +57 -57
  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 +51 -51
  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 +23 -23
  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 +56 -56
  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 +43 -43
  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 +1 -1
  96. package/.next/server/chunks/[root-of-the-server]__00~8_qz._.js +1 -1
  97. package/.next/server/chunks/[root-of-the-server]__0bvqbq0._.js +1 -1
  98. package/.next/server/chunks/[root-of-the-server]__0rb-ear._.js +2 -2
  99. package/.next/server/chunks/[root-of-the-server]__0ze75mm._.js +1 -1
  100. package/.next/server/chunks/project_f_tower_0n1s3ym._.js +1 -1
  101. package/.next/server/chunks/project_f_tower_src_11e.cv5._.js +1 -1
  102. package/.next/server/chunks/project_f_tower_src_lib_10p8sue._.js +1 -1
  103. package/.next/server/chunks/ssr/04uy_src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_01.s1p0._.js +1 -1
  104. package/.next/server/chunks/ssr/0y0r_f_tower_src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0n4g3bn._.js +1 -1
  105. package/.next/server/chunks/ssr/[root-of-the-server]__0.yn90z._.js +3 -0
  106. package/.next/server/chunks/ssr/{[root-of-the-server]__0h8nl.m._.js → [root-of-the-server]__00_.ri0._.js} +2 -2
  107. package/.next/server/chunks/ssr/[root-of-the-server]__06qzctf._.js +1 -1
  108. package/.next/server/chunks/ssr/[root-of-the-server]__0_47k-j._.js +1 -1
  109. package/.next/server/chunks/ssr/[root-of-the-server]__0aidehy._.js +1 -1
  110. package/.next/server/chunks/ssr/[root-of-the-server]__0ffdrwp._.js +1 -1
  111. package/.next/server/chunks/ssr/[root-of-the-server]__0hiekzn._.js +1 -1
  112. package/.next/server/chunks/ssr/[root-of-the-server]__0i4rk9v._.js +3 -3
  113. package/.next/server/chunks/ssr/[root-of-the-server]__0jpbiq_._.js +3 -0
  114. package/.next/server/chunks/ssr/[root-of-the-server]__0w7gbe7._.js +1 -1
  115. package/.next/server/chunks/ssr/[root-of-the-server]__0zaw-fl._.js +1 -1
  116. package/.next/server/chunks/ssr/[root-of-the-server]__13eo85g._.js +1 -1
  117. package/.next/server/chunks/ssr/project_f_tower_0.txwd8._.js +1 -1
  118. package/.next/server/chunks/ssr/{project_f_tower_0tlnklr._.js → project_f_tower_006ysi2._.js} +2 -2
  119. package/.next/server/chunks/ssr/project_f_tower_09re1~6._.js +3 -0
  120. package/.next/server/chunks/ssr/project_f_tower_0d9_kxc._.js +3 -0
  121. package/.next/server/chunks/ssr/project_f_tower_0f0-wva._.js +1 -1
  122. package/.next/server/chunks/ssr/project_f_tower_0hgtev9._.js +1 -1
  123. package/.next/server/chunks/ssr/project_f_tower_0ivvjwd._.js +1 -1
  124. package/.next/server/chunks/ssr/project_f_tower_0jy~1uf._.js +1 -1
  125. package/.next/server/chunks/ssr/project_f_tower_0l6ssf8._.js +1 -1
  126. package/.next/server/chunks/ssr/{project_f_tower_0ps2~v1._.js → project_f_tower_0m76uwh._.js} +2 -2
  127. package/.next/server/chunks/ssr/project_f_tower_0o5.y1e._.js +1 -1
  128. package/.next/server/chunks/ssr/{project_f_tower_12oax__._.js → project_f_tower_0vfw8sn._.js} +2 -2
  129. package/.next/server/chunks/ssr/project_f_tower_0w01kgd._.js +1 -1
  130. package/.next/server/chunks/ssr/project_f_tower_0ym-aea._.js +1 -1
  131. package/.next/server/chunks/ssr/{project_f_tower_0i96rjz._.js → project_f_tower_13hdtgf._.js} +2 -2
  132. package/.next/server/chunks/ssr/project_f_tower_src_13jw2_q._.js +3 -0
  133. package/.next/server/chunks/ssr/project_f_tower_src_actions_agent-actions_ts_0.s4~m-._.js +1 -1
  134. package/.next/server/chunks/ssr/project_f_tower_src_actions_file-actions_ts_02i742t._.js +1 -1
  135. package/.next/server/chunks/ssr/project_f_tower_src_app_missions_missions-client_tsx_0ums4qx._.js +1 -1
  136. package/.next/server/chunks/ssr/project_f_tower_src_app_onboarding_page_tsx_0_9_yoq._.js +1 -1
  137. package/.next/server/chunks/ssr/project_f_tower_src_app_settings_page_tsx_0oo06~d._.js +1 -1
  138. package/.next/server/chunks/ssr/project_f_tower_src_app_workspaces_[workspaceId]_board-page-client_tsx_0jmj1xz._.js +1 -1
  139. package/.next/server/middleware-build-manifest.js +3 -3
  140. package/.next/server/pages/404.html +1 -1
  141. package/.next/server/pages/500.html +1 -1
  142. package/.next/server/server-reference-manifest.js +1 -1
  143. package/.next/server/server-reference-manifest.json +187 -187
  144. package/.next/static/chunks/{0amzt~927k5f5.js → 09mbyvk8z.wx2.js} +1 -1
  145. package/.next/static/chunks/{0uxf3e~tjkjuz.js → 0a93fdjk-37r7.js} +1 -1
  146. package/.next/static/chunks/{0jfknbbi-cjcl.js → 0ejd72g7tekop.js} +1 -1
  147. package/.next/static/chunks/{08x0olwzpsczv.js → 0j3ixh~tlr2~~.js} +2 -2
  148. package/.next/static/chunks/{076vhlm6g1m9n.js → 0jm.d2tvttdcy.js} +1 -1
  149. package/.next/static/chunks/0kjm.xm_~nzz0.js +1 -0
  150. package/.next/static/chunks/{0l5tqul.pwfze.js → 0mf6fqi52ca~q.js} +1 -1
  151. package/.next/static/chunks/{181v0f2l.x5_p.js → 0vhwphmq69i0d.js} +1 -1
  152. package/.next/static/chunks/{0jef3e_wsh4mf.js → 0x2z0sza~9erw.js} +1 -1
  153. package/.next/static/chunks/{12q1f_9u6eduf.js → 0x9x7bxnrbi1..js} +1 -1
  154. package/.next/static/chunks/{14xrab1qyw2yw.js → 0~wu849la7jq2.js} +1 -1
  155. package/.next/static/chunks/{06~5p79536pfs.js → 1068kwso1r._u.js} +1 -1
  156. package/.next/static/chunks/14ul.txcdkz4n.js +1 -0
  157. package/.next/static/chunks/{0gwxdr2ihtu8z.js → 163-h-672vjtc.js} +1 -1
  158. package/.next/static/chunks/17b4edxd7wg5~.js +1 -0
  159. package/.next/trace +2 -2
  160. package/.next/trace-build +1 -1
  161. package/package.json +4 -2
  162. package/.next/server/chunks/ssr/[root-of-the-server]__0bqzhpe._.js +0 -3
  163. package/.next/server/chunks/ssr/[root-of-the-server]__0h38s6n._.js +0 -3
  164. package/.next/server/chunks/ssr/project_f_tower_047pa2s._.js +0 -3
  165. package/.next/server/chunks/ssr/project_f_tower_0ssr2sl._.js +0 -3
  166. package/.next/server/chunks/ssr/project_f_tower_src_10.nkh7._.js +0 -3
  167. package/.next/static/chunks/0pez9k2q~8lom.js +0 -1
  168. package/.next/static/chunks/1034h4copyi13.js +0 -1
  169. package/.next/static/chunks/11j_4bpiqb5on.js +0 -1
  170. /package/.next/static/{UuR3rJNr0J0cwFZgsovkL → EMk0oZpCVYuq8amkRB5za}/_buildManifest.js +0 -0
  171. /package/.next/static/{UuR3rJNr0J0cwFZgsovkL → EMk0oZpCVYuq8amkRB5za}/_clientMiddlewareManifest.js +0 -0
  172. /package/.next/static/{UuR3rJNr0J0cwFZgsovkL → EMk0oZpCVYuq8amkRB5za}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,593835,e=>{"use strict";var t=e.i(432377),r=e.i(631325),a=e.i(309542),s=e.i(265826),l=e.i(555159),n=e.i(478430),i=e.i(565037),o=e.i(625054);let c=[{key:"notes",icon:l.FileText},{key:"assets",icon:n.FolderOpen},{key:"archive",icon:i.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:l}=(0,o.useI18n)(),n=(0,a.usePathname)(),i=c.find(e=>n.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4 py-2",children:[(0,t.jsxs)(r.default,{href:`/workspaces/${e}`,className:"mr-2 flex items-center gap-1.5 rounded-md px-2 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(s.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l("archive.backToBoard")})]}),(0,t.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),c.map(a=>{let s=a.icon,n=i===a.key;return(0,t.jsxs)(r.default,{href:`/workspaces/${e}/${a.key}`,className:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${n?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l(`sidebar.${a.key}`)})]},a.key)})]})}])},265826,e=>{"use strict";let t=(0,e.i(863961).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],265826)},726111,e=>{"use strict";var t=e.i(432377),r=e.i(937756);e.s(["EmptyState",0,function({icon:e,title:a,description:s,action:l,className:n}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",n),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:a}),s&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:s}),l&&(0,t.jsx)("div",{className:"mt-2",children:l})]})}])},787207,e=>{"use strict";e.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},304819,460936,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("401e0a9869a5de47816fc5772798d8fbf90ccba4c8",t.callServer,void 0,t.findSourceMapURL,"createNote");e.s(["createNote",0,r],304819);let a=(0,t.createServerReference)("40c81367514764e4557b8b667389f90d913162570e",t.callServer,void 0,t.findSourceMapURL,"deleteNote");e.s(["deleteNote",0,a],460936)},950354,e=>{"use strict";var t=e.i(432377),r=e.i(85212),a=e.i(780156),s=e.i(946960),l=e.i(593835),n=e.i(625054),i=e.i(787207),o=e.i(304819),c=e.i(543485);let d=(0,c.createServerReference)("604c0d074d587be27bf90a4698e7732b0819e7da8b",c.callServer,void 0,c.findSourceMapURL,"updateNote");var x=e.i(460936);let m=(0,c.createServerReference)("6088e652571adcb0eac97e06feac8b60f1a9f18feb",c.callServer,void 0,c.findSourceMapURL,"getProjectNotes");var u=e.i(937756);function p({active:e,onSelect:r}){let{t:a}=(0,n.useI18n)();return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)("button",{onClick:()=>r("all"),className:(0,u.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors","all"===e?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:a("notes.allCategories")}),i.NOTE_CATEGORIES_PRESET.map(a=>(0,t.jsx)("button",{onClick:()=>r(a),className:(0,u.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors",e===a?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:a},a))]})}var h=e.i(711296),g=e.i(610874),f=e.i(555159),j=e.i(726111),b=e.i(923344),v=e.i(909260),N=e.i(788475),y=e.i(67006);function S({note:e,onEdit:r,onDelete:a}){let{t:s}=(0,n.useI18n)(),l=e.content.slice(0,300);return(0,t.jsxs)("div",{className:"group relative rounded-lg border border-border bg-card p-4 transition-colors hover:border-border/80 hover:bg-accent/20",children:[(0,t.jsxs)("div",{className:"absolute right-3 top-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>r(e),className:"text-muted-foreground","aria-label":s("notes.edit"),children:(0,t.jsx)(b.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>a(e.id),className:"text-muted-foreground hover:text-rose-400","aria-label":s("notes.delete"),children:(0,t.jsx)(v.Trash2,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"mb-2 pr-16",children:(0,t.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:e.title})}),(0,t.jsx)("span",{className:"mb-3 inline-block rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:e.category}),(0,t.jsx)("div",{className:"prose prose-sm dark:prose-invert max-h-24 overflow-hidden text-muted-foreground",children:(0,t.jsx)(N.default,{remarkPlugins:[y.default],children:l})})]})}function w({notes:e,onEdit:r,onDelete:a}){let{t:s}=(0,n.useI18n)();return 0===e.length?(0,t.jsx)(j.EmptyState,{icon:f.FileText,title:s("notes.empty"),description:s("notes.emptyHint")}):(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>(0,t.jsx)(S,{note:e,onEdit:r,onDelete:a},e.id))})}var E=e.i(540032);function C({value:e,onChange:r}){return(0,t.jsxs)("div",{className:"relative grid grid-cols-2 gap-4 flex-1 min-h-64",children:[(0,t.jsx)(E.Textarea,{value:e,onChange:e=>r(e.target.value),className:"absolute inset-0 w-1/2 pr-2 resize-none font-mono text-sm border rounded-md p-3 bg-background text-foreground border-border focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Write Markdown here..."}),(0,t.jsx)("div",{className:"absolute inset-0 left-1/2 pl-2",children:(0,t.jsx)("div",{className:"h-full overflow-y-auto border rounded-md p-3 border-border prose prose-sm dark:prose-invert max-w-none",children:(0,t.jsx)(N.default,{remarkPlugins:[y.default],children:e})})})]})}e.s(["NotesPageClient",0,function({allWorkspaces:e,initialWorkspaceId:c,initialProjectId:u,initialNotes:f}){let j,b,{t:v}=(0,n.useI18n)(),[N,y]=(0,r.useTransition)(),[S,E]=(0,r.useState)(c),[T,k]=(0,r.useState)(u),[I,R]=(0,r.useState)(f),[O,P]=(0,r.useState)("all"),[A,_]=(0,r.useState)(null),[L,$]=(0,r.useState)(!1),[D,B]=(0,r.useState)(""),[M,G]=(0,r.useState)(""),[U,z]=(0,r.useState)(i.NOTE_CATEGORIES_PRESET[3]),[V,H]=(0,r.useState)(c),[F,W]=(0,r.useState)(u),K=e.find(e=>e.id===S),Y=K?.projects??[],q=e.find(e=>e.id===V),J=q?.projects??[],Q=(0,r.useCallback)(e=>{e?y(async()=>{R(await m(e))}):R([])},[y]),X=async()=>{F&&D.trim()&&(await (0,o.createNote)({title:D.trim(),content:M,category:U,projectId:F}),$(!1),F===T&&Q(T))},Z=async()=>{A&&D.trim()&&(await d(A.id,{title:D.trim(),content:M,category:U}),_(null),Q(T))},ee=async e=>{let t=I.find(t=>t.id===e);!t||confirm(v("notes.deleteConfirm",{title:t.title}))&&(await (0,x.deleteNote)(e),Q(T))},et="all"===O?I.map(e=>({...e,updatedAt:new Date(e.updatedAt)})):I.filter(e=>e.category===O).map(e=>({...e,updatedAt:new Date(e.updatedAt)})),er=L||null!==A;return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(l.SubPageNav,{workspaceId:S}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(g.Select,{value:S,onValueChange:t=>t&&(t=>{if(t===S)return;E(t);let r=e.find(e=>e.id===t),a=r?.projects[0]??null;k(a?.id??null),P("all"),Q(a?.id??null)})(t),children:[(0,t.jsx)(g.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===S)?.name??S})}),(0,t.jsx)(g.SelectContent,{children:e.map(e=>(0,t.jsx)(g.SelectItem,{value:e.id,children:e.name},e.id))})]}),Y.length>0&&(0,t.jsxs)(g.Select,{value:T??"",onValueChange:e=>e&&void(e!==T&&(k(e),P("all"),Q(e))),children:[(0,t.jsx)(g.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(j=Y.find(e=>e.id===T))?j.alias?`${j.name} (${j.alias})`:j.name:""})}),(0,t.jsx)(g.SelectContent,{children:Y.map(e=>(0,t.jsxs)(g.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),!er&&(0,t.jsxs)(h.Button,{onClick:()=>{B(""),G(""),z(i.NOTE_CATEGORIES_PRESET[3]),H(S),W(T),_(null),$(!0)},className:"ml-auto bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(a.Plus,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:v("notes.newNote")})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden px-6 py-4 flex flex-col",children:er?(0,t.jsxs)("div",{className:"flex flex-col gap-4 flex-1 min-h-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[!A&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.workspace")}),(0,t.jsxs)(g.Select,{value:V,onValueChange:t=>t&&(t=>{if(t===V)return;H(t);let r=e.find(e=>e.id===t),a=r?.projects[0]??null;W(a?.id??null)})(t),children:[(0,t.jsx)(g.SelectTrigger,{className:"min-w-[140px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===V)?.name??V})}),(0,t.jsx)(g.SelectContent,{children:e.map(e=>(0,t.jsx)(g.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),!A&&J.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.project")}),(0,t.jsxs)(g.Select,{value:F??"",onValueChange:e=>e&&W(e),children:[(0,t.jsx)(g.SelectTrigger,{className:"min-w-[160px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:(b=J.find(e=>e.id===F))?b.alias?`${b.name} (${b.alias})`:b.name:""})}),(0,t.jsx)(g.SelectContent,{children:J.map(e=>(0,t.jsxs)(g.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.categoryLabel")}),(0,t.jsxs)(g.Select,{value:U,onValueChange:e=>e&&z(e),children:[(0,t.jsx)(g.SelectTrigger,{className:"min-w-[120px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:U})}),(0,t.jsx)(g.SelectContent,{children:i.NOTE_CATEGORIES_PRESET.map(e=>(0,t.jsx)(g.SelectItem,{value:e,children:e},e))})]})]})]}),(0,t.jsx)("input",{type:"text",value:D,onChange:e=>B(e.target.value),placeholder:v("notes.titlePlaceholder"),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,t.jsx)(C,{value:M,onChange:G}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>{$(!1),_(null)},children:v("notes.cancel")}),(0,t.jsx)(h.Button,{onClick:A?Z:X,disabled:!D.trim()||!A&&!F,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:v("notes.save")})]})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(p,{active:O,onSelect:P}),(0,t.jsxs)("div",{className:`relative ${N?"opacity-40 pointer-events-none":""} transition-opacity`,children:[N&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)(s.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===Y.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:v("notes.noProject")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:v("notes.noProjectHint")})]}):(0,t.jsx)(w,{notes:et,onEdit:e=>{B(e.title),G(e.content),z(e.category),_(e),$(!1)},onDelete:ee})]})]})})]})}],950354)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,593835,e=>{"use strict";var t=e.i(432377),r=e.i(631325),a=e.i(309542),s=e.i(265826),l=e.i(555159),n=e.i(478430),i=e.i(565037),o=e.i(625054);let c=[{key:"notes",icon:l.FileText},{key:"assets",icon:n.FolderOpen},{key:"archive",icon:i.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:l}=(0,o.useI18n)(),n=(0,a.usePathname)(),i=c.find(e=>n.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4 py-2",children:[(0,t.jsxs)(r.default,{href:`/workspaces/${e}`,className:"mr-2 flex items-center gap-1.5 rounded-md px-2 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(s.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l("archive.backToBoard")})]}),(0,t.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),c.map(a=>{let s=a.icon,n=i===a.key;return(0,t.jsxs)(r.default,{href:`/workspaces/${e}/${a.key}`,className:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${n?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l(`sidebar.${a.key}`)})]},a.key)})]})}])},265826,e=>{"use strict";let t=(0,e.i(863961).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],265826)},726111,e=>{"use strict";var t=e.i(432377),r=e.i(937756);e.s(["EmptyState",0,function({icon:e,title:a,description:s,action:l,className:n}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",n),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:a}),s&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:s}),l&&(0,t.jsx)("div",{className:"mt-2",children:l})]})}])},787207,e=>{"use strict";e.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},414588,671705,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("402017afc57d09f77c586036e5a209c6440b02e3ea",t.callServer,void 0,t.findSourceMapURL,"createNote");e.s(["createNote",0,r],414588);let a=(0,t.createServerReference)("40a6c78693aa8ed7d908abda7866e675fa23c4120d",t.callServer,void 0,t.findSourceMapURL,"deleteNote");e.s(["deleteNote",0,a],671705)},950354,e=>{"use strict";var t=e.i(432377),r=e.i(85212),a=e.i(780156),s=e.i(946960),l=e.i(593835),n=e.i(625054),i=e.i(787207),o=e.i(414588),c=e.i(543485);let d=(0,c.createServerReference)("608bf387e36d9578316455ead1e0d39f46de1e8bd3",c.callServer,void 0,c.findSourceMapURL,"updateNote");var x=e.i(671705);let m=(0,c.createServerReference)("608d975ebb45d4bc41ace948b2e88321248d58373e",c.callServer,void 0,c.findSourceMapURL,"getProjectNotes");var u=e.i(937756);function p({active:e,onSelect:r}){let{t:a}=(0,n.useI18n)();return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)("button",{onClick:()=>r("all"),className:(0,u.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors","all"===e?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:a("notes.allCategories")}),i.NOTE_CATEGORIES_PRESET.map(a=>(0,t.jsx)("button",{onClick:()=>r(a),className:(0,u.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors",e===a?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:a},a))]})}var h=e.i(711296),g=e.i(610874),f=e.i(555159),j=e.i(726111),b=e.i(923344),v=e.i(909260),N=e.i(788475),y=e.i(67006);function S({note:e,onEdit:r,onDelete:a}){let{t:s}=(0,n.useI18n)(),l=e.content.slice(0,300);return(0,t.jsxs)("div",{className:"group relative rounded-lg border border-border bg-card p-4 transition-colors hover:border-border/80 hover:bg-accent/20",children:[(0,t.jsxs)("div",{className:"absolute right-3 top-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>r(e),className:"text-muted-foreground","aria-label":s("notes.edit"),children:(0,t.jsx)(b.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>a(e.id),className:"text-muted-foreground hover:text-rose-400","aria-label":s("notes.delete"),children:(0,t.jsx)(v.Trash2,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"mb-2 pr-16",children:(0,t.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:e.title})}),(0,t.jsx)("span",{className:"mb-3 inline-block rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:e.category}),(0,t.jsx)("div",{className:"prose prose-sm dark:prose-invert max-h-24 overflow-hidden text-muted-foreground",children:(0,t.jsx)(N.default,{remarkPlugins:[y.default],children:l})})]})}function w({notes:e,onEdit:r,onDelete:a}){let{t:s}=(0,n.useI18n)();return 0===e.length?(0,t.jsx)(j.EmptyState,{icon:f.FileText,title:s("notes.empty"),description:s("notes.emptyHint")}):(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>(0,t.jsx)(S,{note:e,onEdit:r,onDelete:a},e.id))})}var E=e.i(540032);function C({value:e,onChange:r}){return(0,t.jsxs)("div",{className:"relative grid grid-cols-2 gap-4 flex-1 min-h-64",children:[(0,t.jsx)(E.Textarea,{value:e,onChange:e=>r(e.target.value),className:"absolute inset-0 w-1/2 pr-2 resize-none font-mono text-sm border rounded-md p-3 bg-background text-foreground border-border focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Write Markdown here..."}),(0,t.jsx)("div",{className:"absolute inset-0 left-1/2 pl-2",children:(0,t.jsx)("div",{className:"h-full overflow-y-auto border rounded-md p-3 border-border prose prose-sm dark:prose-invert max-w-none",children:(0,t.jsx)(N.default,{remarkPlugins:[y.default],children:e})})})]})}e.s(["NotesPageClient",0,function({allWorkspaces:e,initialWorkspaceId:c,initialProjectId:u,initialNotes:f}){let j,b,{t:v}=(0,n.useI18n)(),[N,y]=(0,r.useTransition)(),[S,E]=(0,r.useState)(c),[T,k]=(0,r.useState)(u),[I,R]=(0,r.useState)(f),[O,P]=(0,r.useState)("all"),[A,_]=(0,r.useState)(null),[L,$]=(0,r.useState)(!1),[D,B]=(0,r.useState)(""),[M,G]=(0,r.useState)(""),[U,z]=(0,r.useState)(i.NOTE_CATEGORIES_PRESET[3]),[V,H]=(0,r.useState)(c),[F,W]=(0,r.useState)(u),K=e.find(e=>e.id===S),Y=K?.projects??[],q=e.find(e=>e.id===V),J=q?.projects??[],Q=(0,r.useCallback)(e=>{e?y(async()=>{R(await m(e))}):R([])},[y]),X=async()=>{F&&D.trim()&&(await (0,o.createNote)({title:D.trim(),content:M,category:U,projectId:F}),$(!1),F===T&&Q(T))},Z=async()=>{A&&D.trim()&&(await d(A.id,{title:D.trim(),content:M,category:U}),_(null),Q(T))},ee=async e=>{let t=I.find(t=>t.id===e);!t||confirm(v("notes.deleteConfirm",{title:t.title}))&&(await (0,x.deleteNote)(e),Q(T))},et="all"===O?I.map(e=>({...e,updatedAt:new Date(e.updatedAt)})):I.filter(e=>e.category===O).map(e=>({...e,updatedAt:new Date(e.updatedAt)})),er=L||null!==A;return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(l.SubPageNav,{workspaceId:S}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(g.Select,{value:S,onValueChange:t=>t&&(t=>{if(t===S)return;E(t);let r=e.find(e=>e.id===t),a=r?.projects[0]??null;k(a?.id??null),P("all"),Q(a?.id??null)})(t),children:[(0,t.jsx)(g.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===S)?.name??S})}),(0,t.jsx)(g.SelectContent,{children:e.map(e=>(0,t.jsx)(g.SelectItem,{value:e.id,children:e.name},e.id))})]}),Y.length>0&&(0,t.jsxs)(g.Select,{value:T??"",onValueChange:e=>e&&void(e!==T&&(k(e),P("all"),Q(e))),children:[(0,t.jsx)(g.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(j=Y.find(e=>e.id===T))?j.alias?`${j.name} (${j.alias})`:j.name:""})}),(0,t.jsx)(g.SelectContent,{children:Y.map(e=>(0,t.jsxs)(g.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),!er&&(0,t.jsxs)(h.Button,{onClick:()=>{B(""),G(""),z(i.NOTE_CATEGORIES_PRESET[3]),H(S),W(T),_(null),$(!0)},className:"ml-auto bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(a.Plus,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:v("notes.newNote")})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden px-6 py-4 flex flex-col",children:er?(0,t.jsxs)("div",{className:"flex flex-col gap-4 flex-1 min-h-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[!A&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.workspace")}),(0,t.jsxs)(g.Select,{value:V,onValueChange:t=>t&&(t=>{if(t===V)return;H(t);let r=e.find(e=>e.id===t),a=r?.projects[0]??null;W(a?.id??null)})(t),children:[(0,t.jsx)(g.SelectTrigger,{className:"min-w-[140px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===V)?.name??V})}),(0,t.jsx)(g.SelectContent,{children:e.map(e=>(0,t.jsx)(g.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),!A&&J.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.project")}),(0,t.jsxs)(g.Select,{value:F??"",onValueChange:e=>e&&W(e),children:[(0,t.jsx)(g.SelectTrigger,{className:"min-w-[160px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:(b=J.find(e=>e.id===F))?b.alias?`${b.name} (${b.alias})`:b.name:""})}),(0,t.jsx)(g.SelectContent,{children:J.map(e=>(0,t.jsxs)(g.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.categoryLabel")}),(0,t.jsxs)(g.Select,{value:U,onValueChange:e=>e&&z(e),children:[(0,t.jsx)(g.SelectTrigger,{className:"min-w-[120px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:U})}),(0,t.jsx)(g.SelectContent,{children:i.NOTE_CATEGORIES_PRESET.map(e=>(0,t.jsx)(g.SelectItem,{value:e,children:e},e))})]})]})]}),(0,t.jsx)("input",{type:"text",value:D,onChange:e=>B(e.target.value),placeholder:v("notes.titlePlaceholder"),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,t.jsx)(C,{value:M,onChange:G}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>{$(!1),_(null)},children:v("notes.cancel")}),(0,t.jsx)(h.Button,{onClick:A?Z:X,disabled:!D.trim()||!A&&!F,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:v("notes.save")})]})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(p,{active:O,onSelect:P}),(0,t.jsxs)("div",{className:`relative ${N?"opacity-40 pointer-events-none":""} transition-opacity`,children:[N&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)(s.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===Y.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:v("notes.noProject")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:v("notes.noProjectHint")})]}):(0,t.jsx)(w,{notes:et,onEdit:e=>{B(e.title),G(e.content),z(e.category),_(e),$(!1)},onDelete:ee})]})]})})]})}],950354)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,255779,e=>{"use strict";var t=e.i(432377),s=e.i(85212),a=e.i(309542),i=e.i(275283),n=e.i(625054),l=e.i(711296),r=e.i(831349),o=e.i(540032),c=e.i(9433),d=e.i(203529),m=e.i(330521),g=e.i(718837),u=e.i(937756),x=e.i(103295),h=e.i(863961);let p=(0,h.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var f=e.i(555159);let b=(0,h.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var j=e.i(316403),v=e.i(996032),N=e.i(780156);let y=(0,h.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var w=e.i(909260);let C=(0,h.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),k=(0,h.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var M=e.i(946960),S=e.i(750986),T=e.i(1156),P=e.i(730489),B=e.i(312687),R=e.i(330092),D=e.i(543485);let L=(0,D.createServerReference)("004f1a77e55d8bdf466af93a84f85dd6153e1efab6",D.callServer,void 0,D.findSourceMapURL,"getAvailableTerminalApps");var I=e.i(646917);let V=(0,D.createServerReference)("40bfb3cb79883e2768cea9b1a18d89a01e7b1f8d67",D.callServer,void 0,D.findSourceMapURL,"createPrompt"),H=(0,D.createServerReference)("6025a527a57d3023dac08fb0af1aa2c5520ddf6df5",D.callServer,void 0,D.findSourceMapURL,"updatePrompt"),U=(0,D.createServerReference)("406ebc5ada1c7d97d94766f447fdccc90b49179f6b",D.callServer,void 0,D.findSourceMapURL,"deletePrompt"),z=(0,D.createServerReference)("60535812c2ccdabf1dd33129c66bec4c80008c59d8",D.callServer,void 0,D.findSourceMapURL,"setDefaultPrompt");function E({options:e,value:s,onChange:a}){return(0,t.jsx)("div",{className:"inline-flex rounded-lg border border-border/50 bg-muted/30 p-1 gap-0.5",children:e.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>a(e.value),className:(0,u.cn)("rounded-md px-3.5 py-1.5 text-sm font-medium transition-all duration-200 cursor-pointer",s===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))})}function K({label:e,description:s,children:a,className:i}){return(0,t.jsxs)("div",{className:(0,u.cn)("flex items-center justify-between py-4 border-b border-border/50 last:border-0",i),children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:e}),s&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:s})]}),(0,t.jsx)("div",{className:"shrink-0",children:a})]})}let $=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:x.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:p,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:f.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:b,accent:"amber"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:j.Bell,accent:"rose"}],F={blue:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},emerald:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},violet:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},amber:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},cyan:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},rose:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"}},q="ai-manager:default-cli-adapter",O=[{type:"claude_local",label:"Claude Code",source:"builtin"}],A={host:"",ownerMatch:"*",localPathTemplate:"",priority:0};function G(){let e=(0,a.useRouter)(),{t:x}=(0,n.useI18n)(),{theme:h,setTheme:p}=(0,i.useTheme)(),{locale:f,setLocale:b}=(0,n.useI18n)(),[j,D]=(0,s.useState)("general"),G=(0,s.useRef)(null),[_,X]=(0,s.useState)({left:0,width:0}),[J,Q]=(0,s.useState)(!1),[W,Y]=(0,s.useState)("Terminal"),[Z,ee]=(0,s.useState)([]),[et,es]=(0,s.useState)(180),[ea,ei]=(0,s.useState)("claude_local"),[en,el]=(0,s.useState)(null),[er,eo]=(0,s.useState)({}),[ec,ed]=(0,s.useState)([]),[em,eg]=(0,s.useState)(!1),[eu,ex]=(0,s.useState)(null),[eh,ep]=(0,s.useState)(null),[ef,eb]=(0,s.useState)(""),[ej,ev]=(0,s.useState)(""),[eN,ey]=(0,s.useState)(""),[ew,eC]=(0,s.useState)([]),[ek,eM]=(0,s.useState)(null),[eS,eT]=(0,s.useState)({...A}),[eP,eB]=(0,s.useState)(!1),[eR,eD]=(0,s.useState)({...A}),[eL,eI]=(0,s.useState)(!1),[eV,eH]=(0,s.useState)(0),[eU,ez]=(0,s.useState)(null),[eE,eK]=(0,s.useState)({maxUploadMb:50,maxConcurrent:3}),[e$,eF]=(0,s.useState)({timeoutSec:30}),[eq,eO]=(0,s.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80}),[eA,eG]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[e_,eX]=(0,s.useState)(null),[eJ,eQ]=(0,s.useState)(!1),[eW,eY]=(0,s.useState)(""),[eZ,e0]=(0,s.useState)(!0);(0,s.useEffect)(()=>Q(!0),[]),(0,s.useEffect)(()=>{(0,P.getConfigValue)("terminal.app","Terminal").then(Y),(0,P.getConfigValue)("terminal.idleTimeoutSec",180).then(es),L().then(ee)},[]),(0,s.useEffect)(()=>{let e=localStorage.getItem(q);e&&ei(e)},[]),(0,s.useEffect)(()=>{(0,I.getPrompts)().then(ed)},[]);let e1=async()=>{try{let e=await fetch("/api/internal/hooks/install");if(e.ok){let t=await e.json();eX(t)}}catch{}};async function e2(){await (0,B.setConfigValue)("terminal.app",W)}async function e5(){let e=Math.max(180,et);es(e),await (0,B.setConfigValue)("terminal.idleTimeoutSec",e)}async function e3(e){if(!en){el(e),eo(t=>{let s={...t};return delete s[e],s});try{let t=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapterType:e})}),s=await t.json();eo(t=>({...t,[e]:s}))}catch{eo(t=>({...t,[e]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{el(null)}}}(0,s.useEffect)(()=>{(0,P.getConfigValue)("git.pathMappingRules",[]).then(eC),(0,P.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(e=>{eY(e.join(", "))}),e1(),(0,R.getConfigValues)(["system.maxUploadBytes","system.maxConcurrentExecutions","git.timeoutSec","search.resultLimit","search.allModeCap","search.debounceMs","search.snippetLength","missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{eK({maxUploadMb:Math.round((e["system.maxUploadBytes"]??0x3200000)/1024/1024),maxConcurrent:e["system.maxConcurrentExecutions"]??3}),eF({timeoutSec:e["git.timeoutSec"]??30}),eO({resultLimit:e["search.resultLimit"]??20,allModeCap:e["search.allModeCap"]??5,debounceMs:e["search.debounceMs"]??250,snippetLength:e["search.snippetLength"]??80}),eG({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{(0,P.getConfigValue)("notification.enabled",!0).then(e0)},[]);let e4=(0,s.useCallback)(()=>{ex(null),eb(""),ev(""),ey(""),eg(!0)},[]),e8=(0,s.useCallback)(e=>{ex(e),eb(e.name),ev(e.description??""),ey(e.content),eg(!0)},[]),e7=(0,s.useCallback)(async()=>{ef.trim()&&eN.trim()&&(eu?await H(eu.id,{name:ef.trim(),description:ej.trim()||void 0,content:eN.trim()}):await V({name:ef.trim(),description:ej.trim()||void 0,content:eN.trim()}),eg(!1),ed(await (0,I.getPrompts)()),e.refresh())},[ef,ej,eN,eu,e]),e6=(0,s.useCallback)(async()=>{eh&&(await U(eh),ep(null),ed(await (0,I.getPrompts)()),e.refresh())},[eh,e]),e9=(0,s.useCallback)(async t=>{await z(t),ed(await (0,I.getPrompts)()),e.refresh()},[e]),te=async()=>{await (0,B.setConfigValue)("system.maxUploadBytes",1024*eE.maxUploadMb*1024),await (0,B.setConfigValue)("system.maxConcurrentExecutions",eE.maxConcurrent)},tt=async()=>{await (0,B.setConfigValue)("git.timeoutSec",e$.timeoutSec)},ts=async()=>{await (0,B.setConfigValue)("search.resultLimit",eq.resultLimit),await (0,B.setConfigValue)("search.allModeCap",eq.allModeCap),await (0,B.setConfigValue)("search.debounceMs",eq.debounceMs),await (0,B.setConfigValue)("search.snippetLength",eq.snippetLength)},ta=async()=>{let e=Math.min(eA.minCols,eA.maxCols),t=Math.max(eA.minCols,eA.maxCols),s=Math.min(eA.minRows,eA.maxRows),a=Math.max(eA.minRows,eA.maxRows);eG({minCols:e,maxCols:t,minRows:s,maxRows:a}),await (0,B.setConfigValue)("missions.grid.minCols",e),await (0,B.setConfigValue)("missions.grid.maxCols",t),await (0,B.setConfigValue)("missions.grid.minRows",s),await (0,B.setConfigValue)("missions.grid.maxRows",a)},ti=async()=>{let e=eW.split(",").map(e=>e.trim()).filter(Boolean);await (0,B.setConfigValue)("hooks.autoUploadTypes",e)},tn=async()=>{if(e_){eQ(!0);try{let e=e_.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:e}),await e1()}finally{eQ(!1)}}},tl=async()=>{if(!eR.host.trim()||!eR.localPathTemplate.trim())return;let e=eR.localPathTemplate.trim().replace(/\/+$/,""),t=eL?`${e}/{path}`:e,s=[...ew,{id:crypto.randomUUID(),host:eR.host.trim(),ownerMatch:eR.ownerMatch.trim()||"*",localPathTemplate:t,priority:eR.priority}];await (0,B.setConfigValue)("git.pathMappingRules",s),eC(s),eD({...A}),eI(!1),eB(!1)},tr=async e=>{if(!eS.host.trim()||!eS.localPathTemplate.trim())return;let t=ew.map(t=>t.id===e?{...t,host:eS.host.trim(),ownerMatch:eS.ownerMatch.trim()||"*",localPathTemplate:eS.localPathTemplate.trim(),priority:eS.priority}:t);await (0,B.setConfigValue)("git.pathMappingRules",t),eC(t),eM(null)},to=async e=>{let t=ew.filter(t=>t.id!==e);await (0,B.setConfigValue)("git.pathMappingRules",t),eC(t),ez(null)};async function tc(){let e=!eZ;e0(e),await (0,B.setConfigValue)("notification.enabled",e)}let td=(0,s.useCallback)(()=>{e.back()},[e]);(0,s.useEffect)(()=>{let e=G.current;if(!e)return;let t=e.querySelector(`[data-section="${j}"]`);if(!t)return;let s=e.getBoundingClientRect(),a=t.getBoundingClientRect();X({left:a.left-s.left,width:a.width})},[j]);let tm=$.find(e=>e.id===j),tg=tm?F[tm.accent]:F.blue;return(0,t.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,t.jsx)("div",{className:"flex-shrink-0 border-b bg-card/50 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"mx-auto max-w-5xl px-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between pb-3 pt-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:x("settings.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:x("settings.configDesc")})]}),(0,t.jsxs)(l.Button,{variant:"outline",onClick:td,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,t.jsx)(v.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,t.jsxs)("div",{ref:G,className:"relative flex gap-1 overflow-x-auto",children:[$.map(e=>{let s=e.icon,a=j===e.id,i=F[e.accent];return(0,t.jsxs)("button",{"data-section":e.id,onClick:()=>D(e.id),className:(0,u.cn)("relative flex items-center gap-2 rounded-t-lg px-4 py-2.5","text-sm font-medium whitespace-nowrap cursor-pointer","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a?`${i.text} bg-background`:"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[(0,t.jsx)("span",{className:(0,u.cn)("flex h-6 w-6 items-center justify-center rounded-md","transition-colors duration-200",a?i.bg:"bg-transparent"),children:(0,t.jsx)(s,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("span",{children:x(e.labelKey)})]},e.id)}),(0,t.jsx)("div",{className:(0,u.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",tg.indicator),style:{left:_.left,width:_.width}})]})]})}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsxs)("div",{className:"mx-auto max-w-4xl px-6 py-8",children:[tm&&(0,t.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,t.jsx)("div",{className:(0,u.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",tg.bg,tg.text,tg.ring),children:(0,t.jsx)(tm.icon,{className:"h-5 w-5"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:x(tm.labelKey)}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:x(tm.descKey)})]})]}),(0,t.jsx)("div",{className:"mb-6 border-t"}),function(){switch(j){case"general":let e;return e=[{value:"light",label:x("settings.themeLight")},{value:"dark",label:x("settings.themeDark")},{value:"system",label:x("settings.themeSystem")}],(0,t.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,t.jsx)(K,{label:x("settings.theme"),description:x("settings.themeDesc"),children:J?(0,t.jsx)(E,{options:e,value:h??"system",onChange:e=>p(e)}):(0,t.jsx)("div",{className:"inline-flex h-9 rounded-lg border border-border/50 bg-muted/30 p-1 w-[200px]"})}),(0,t.jsx)(K,{label:x("settings.language"),description:x("settings.languageDesc"),children:(0,t.jsx)(E,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:f,onChange:e=>b(e)})}),(0,t.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:x("settings.terminal.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:x("settings.terminal.desc")})]})}),(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-2",children:[Z.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Z.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{Y(e.value),(0,B.setConfigValue)("terminal.app",e.value)},className:(0,u.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200 cursor-pointer",W===e.value?"border-foreground bg-accent text-foreground font-medium":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:e.name},e.value))}),(0,t.jsx)("input",{type:"text",value:W,onChange:e=>Y(e.target.value),onBlur:e2,placeholder:x("settings.terminal.placeholder"),className:"h-9 w-64 rounded-lg border border-border/50 bg-muted/30 px-3 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/30"})]})]}),(0,t.jsx)(K,{label:x("settings.terminal.idleTimeout"),description:x("settings.terminal.idleTimeoutDesc"),children:(0,t.jsx)("input",{type:"number",value:et,onChange:e=>es(Number(e.target.value)),onBlur:e5,min:180,className:"h-9 w-28 rounded-lg border border-border/50 bg-muted/30 px-3 text-sm text-right focus:outline-none focus:ring-2 focus:ring-blue-500/30"})})]});case"ai-tools":return(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:O.map(e=>{let s=ea===e.type,a=en===e.type,i=er[e.type];return(0,t.jsx)("li",{children:(0,t.jsxs)("div",{className:"px-5 py-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:e.label}),(0,t.jsx)(d.Badge,{variant:"outline",children:x("label.builtin")}),s&&(0,t.jsxs)(d.Badge,{variant:"secondary",className:"shrink-0",children:[(0,t.jsx)(y,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),x("settings.prompts.default")]}),i&&(0,t.jsx)(d.Badge,{variant:i.ok?"secondary":"destructive",className:(0,u.cn)("shrink-0",i.ok&&"bg-green-600 text-white hover:bg-green-700"),children:i.ok?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S.CheckCircle2,{className:"h-3 w-3 mr-1"}),x("settings.aiTools.testPassed")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(T.XCircle,{className:"h-3 w-3 mr-1"}),x("settings.aiTools.testFailed")]})})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.type})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[!s&&(0,t.jsxs)(l.Button,{variant:"outline",size:"sm",onClick:()=>{var t;ei(t=e.type),localStorage.setItem(q,t)},children:[(0,t.jsx)(y,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),x("settings.prompts.setDefault")]}),(0,t.jsx)(l.Button,{variant:"outline",size:"sm",onClick:()=>e3(e.type),disabled:a,children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),x("settings.aiTools.testing")]}):x("settings.aiTools.testConnection")}),"external"===e.source&&(0,t.jsx)(l.Button,{variant:"outline",size:"icon-sm",className:"h-8 w-8 text-destructive hover:text-destructive",title:x("common.delete"),children:(0,t.jsx)(w.Trash2,{className:"h-4 w-4"})})]})]}),i&&(0,t.jsx)("div",{className:"mt-3 rounded-md border border-border bg-muted/30 px-4 py-3",children:(0,t.jsx)("div",{className:"space-y-1.5",children:i.checks.map(s=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:(0,u.cn)("w-1.5 h-1.5 rounded-full shrink-0",s.passed?"bg-green-500":"bg-red-500")}),(0,t.jsx)("span",{className:(0,u.cn)(s.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:s.message})]},`${e.type}-${s.name}`))})})]})},e.type)})});case"prompts":return J?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(l.Button,{onClick:e4,variant:"default",children:[(0,t.jsx)(N.Plus,{className:"h-4 w-4 mr-2"}),x("settings.prompts.newPrompt")]})}),0===ec.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center rounded-lg border border-dashed border-border/50",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:x("settings.prompts.empty")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:x("settings.prompts.emptyHint")})]}):(0,t.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:ec.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-medium truncate",children:e.name}),e.isDefault&&(0,t.jsxs)(d.Badge,{variant:"secondary",className:"shrink-0 rounded-full text-xs",children:[(0,t.jsx)(y,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),x("settings.prompts.default")]})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:e.description})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>e9(e.id),title:x("settings.prompts.setDefault"),children:(0,t.jsx)(y,{className:(0,u.cn)("h-4 w-4",e.isDefault?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>e8(e),title:x("settings.prompts.editPrompt"),children:(0,t.jsx)(C,{className:"h-4 w-4"})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>ep(e.id),className:"text-destructive",title:x("settings.prompts.delete"),children:(0,t.jsx)(w.Trash2,{className:"h-4 w-4"})})]})]},e.id))}),(0,t.jsx)(g.Dialog,{open:em,onOpenChange:eg,children:(0,t.jsxs)(g.DialogContent,{children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:eu?x("settings.prompts.editPrompt"):x("settings.prompts.newPrompt")}),(0,t.jsx)(g.DialogDescription,{children:eu?x("settings.prompts.editPrompt"):x("settings.prompts.newPrompt")})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-name",children:x("settings.prompts.promptName")}),(0,t.jsx)(r.Input,{id:"prompt-name",value:ef,onChange:e=>eb(e.target.value),placeholder:x("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-description",children:x("settings.prompts.promptDescription")}),(0,t.jsx)(r.Input,{id:"prompt-description",value:ej,onChange:e=>ev(e.target.value),placeholder:x("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-content",children:x("settings.prompts.promptContent")}),(0,t.jsx)(o.Textarea,{id:"prompt-content",value:eN,onChange:e=>ey(e.target.value),placeholder:x("settings.prompts.promptContentPlaceholder"),rows:8,className:"mt-1.5 font-mono text-sm"})]})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>eg(!1),children:x("settings.prompts.cancel")}),(0,t.jsx)(l.Button,{onClick:e7,disabled:!ef.trim()||!eN.trim(),children:x("settings.prompts.save")})]})]})}),(0,t.jsx)(g.Dialog,{open:!!eh,onOpenChange:e=>!e&&ep(null),children:(0,t.jsxs)(g.DialogContent,{children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:x("settings.prompts.deleteConfirmTitle")}),(0,t.jsx)(g.DialogDescription,{children:x("settings.prompts.deleteConfirmMessage")})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>ep(null),children:x("settings.prompts.cancel")}),(0,t.jsx)(l.Button,{variant:"destructive",onClick:e6,children:x("settings.prompts.delete")})]})]})})]}):(0,t.jsx)("div",{className:"h-32 rounded-lg bg-muted animate-pulse"});case"config":let s,a,i;return(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.git.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.git.desc")})]}),(0,t.jsxs)(l.Button,{onClick:()=>{eD({...A}),eB(!0)},children:[(0,t.jsx)(N.Plus,{className:"mr-2 h-4 w-4"}),x("settings.config.git.addRule")]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[0!==ew.length||eP?(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:ew.map(e=>ek===e.id?(0,t.jsxs)("li",{className:"px-5 py-4 bg-muted/20",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:x("settings.config.git.host")}),(0,t.jsx)(r.Input,{value:eS.host,onChange:e=>eT(t=>({...t,host:e.target.value})),placeholder:x("settings.config.git.hostPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:x("settings.config.git.ownerMatch")}),(0,t.jsx)(r.Input,{value:eS.ownerMatch,onChange:e=>eT(t=>({...t,ownerMatch:e.target.value})),placeholder:x("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1 col-span-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:x("settings.config.git.localPathTemplate")}),(0,t.jsx)(r.Input,{value:eS.localPathTemplate,onChange:e=>eT(t=>({...t,localPathTemplate:e.target.value})),placeholder:x("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:x("settings.config.git.priority")}),(0,t.jsx)(r.Input,{type:"number",value:eS.priority,onChange:e=>eT(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"sm",onClick:()=>eM(null),children:x("settings.config.git.cancel")}),(0,t.jsx)(l.Button,{size:"sm",onClick:()=>tr(e.id),children:x("settings.config.git.save")})]})]},e.id):(0,t.jsx)("li",{className:"group px-5 py-4 hover:bg-muted/20 transition-colors",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium text-sm",children:e.host}),"*"!==e.ownerMatch&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",e.ownerMatch]}),(0,t.jsxs)(d.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[x("settings.config.git.priority")," ",e.priority]})]}),(0,t.jsx)("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground truncate",children:e.localPathTemplate})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{eM(e.id),eT({host:e.host,ownerMatch:e.ownerMatch,localPathTemplate:e.localPathTemplate,priority:e.priority})},title:x("settings.config.git.edit"),children:(0,t.jsx)(C,{className:"h-4 w-4"})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>ez(e.id),className:"text-destructive",title:x("settings.config.git.delete"),children:(0,t.jsx)(w.Trash2,{className:"h-4 w-4"})})]})]})},e.id))}):(0,t.jsx)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:x("settings.config.git.noRules")})}),eP&&(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/20 p-5 space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:x("settings.config.git.host")}),(0,t.jsx)(r.Input,{value:eR.host,onChange:e=>eD(t=>({...t,host:e.target.value})),placeholder:x("settings.config.git.hostPlaceholder"),className:"text-sm",autoFocus:!0})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:x("settings.config.git.ownerMatch")}),(0,t.jsx)(r.Input,{value:eR.ownerMatch,onChange:e=>eD(t=>({...t,ownerMatch:e.target.value})),placeholder:x("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:x("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Input,{value:eR.localPathTemplate,onChange:e=>eD(t=>({...t,localPathTemplate:e.target.value})),placeholder:x("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsx)("button",{type:"button",onClick:()=>eI(e=>!e),className:(0,u.cn)("shrink-0 rounded-full px-2.5 py-1 text-[11px] font-mono font-medium transition-colors cursor-pointer",eL?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:"{path}"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:eL?x("onboarding.step3.pathHintFull"):x("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:x("settings.config.git.priority")}),(0,t.jsx)(r.Input,{type:"number",value:eR.priority,onChange:e=>eD(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]}),eR.localPathTemplate&&(s=eR.localPathTemplate.trim().replace(/\/+$/,""),a=eL?`${s}/{path}`:s,i=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,t.jsxs)("div",{className:"rounded-lg bg-muted/40 border border-border px-4 py-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:x("onboarding.step3.previewLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:i.map((e,s)=>(0,t.jsx)("button",{type:"button",onClick:()=>eH(s),className:(0,u.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",eV===s?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:e.label},s))})]}),(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:i[eV].url}),(0,t.jsxs)("p",{className:"font-mono text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,t.jsx)("span",{className:"text-foreground font-medium",children:function(e,t){if(!e||!t)return"";let s=t.trim(),a=[],i=s.match(/^git@[^:]+:(.+)$/);if(i)a=i[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let e=new URL(s);a=decodeURIComponent(e.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!a.length)return"";let n=a[0],l=a[a.length-1],r=a.join("/");if(e.includes("{path}"))return e.replace("{path}",r).replace("{owner}",n).replace("{repo}",l).replace(/\/+$/,"");let o=e.replace("{owner}",n).replace("{repo}","").replace(/\/+$/,"");return`${o}/${l}`}(a,i[eV].url)})]})]})]})),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"sm",onClick:()=>eB(!1),children:x("settings.config.git.cancel")}),(0,t.jsxs)(l.Button,{size:"sm",onClick:tl,disabled:!eR.host.trim()||!eR.localPathTemplate.trim(),children:[(0,t.jsx)(k,{className:"h-3.5 w-3.5 mr-1.5"}),x("settings.config.git.save")]})]})]})]})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.system.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.system.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.system.maxUpload")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.system.maxUploadHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Input,{type:"number",min:1,max:500,value:eE.maxUploadMb,onChange:e=>eK(t=>({...t,maxUploadMb:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.system.maxConcurrent")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.system.maxConcurrentHint")})]}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eE.maxConcurrent,onChange:e=>eK(t=>({...t,maxConcurrent:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,t.jsx)(l.Button,{onClick:te,className:"rounded-lg",children:x("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.gitParams.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.gitParams.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.gitParams.timeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.gitParams.timeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Input,{type:"number",min:5,max:300,value:e$.timeoutSec,onChange:e=>eF(t=>({...t,timeoutSec:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]}),(0,t.jsx)(l.Button,{onClick:tt,className:"rounded-lg",children:x("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.search.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.search.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.search.resultLimit")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.search.resultLimitHint")})]}),(0,t.jsx)(r.Input,{type:"number",min:5,max:100,value:eq.resultLimit,onChange:e=>eO(t=>({...t,resultLimit:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.search.allModeCap")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.search.allModeCapHint")})]}),(0,t.jsx)(r.Input,{type:"number",min:1,max:20,value:eq.allModeCap,onChange:e=>eO(t=>({...t,allModeCap:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.search.debounceMs")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.search.debounceMsHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Input,{type:"number",min:50,max:1e3,value:eq.debounceMs,onChange:e=>eO(t=>({...t,debounceMs:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"ms"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.search.snippetLength")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.search.snippetLengthHint")})]}),(0,t.jsx)(r.Input,{type:"number",min:20,max:500,value:eq.snippetLength,onChange:e=>eO(t=>({...t,snippetLength:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,t.jsx)(l.Button,{onClick:ts,className:"rounded-lg",children:x("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.missions.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.missions.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:x("settings.config.missions.minCols")}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eA.minCols,onChange:e=>eG(t=>({...t,minCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:x("settings.config.missions.maxCols")}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eA.maxCols,onChange:e=>eG(t=>({...t,maxCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:x("settings.config.missions.minRows")}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eA.minRows,onChange:e=>eG(t=>({...t,minRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:x("settings.config.missions.maxRows")}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eA.maxRows,onChange:e=>eG(t=>({...t,maxRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,t.jsx)(l.Button,{onClick:ta,className:"rounded-lg",children:x("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.hooks.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.hooks.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.hooks.autoUploadTypes")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.hooks.autoUploadTypesHint")})]}),(0,t.jsx)(r.Input,{value:eW,onChange:e=>eY(e.target.value),placeholder:"png, jpg, jpeg, gif, webp, svg, pdf",className:"w-80 rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsx)(l.Button,{onClick:ti,className:"rounded-lg",children:x("common.save")}),(0,t.jsxs)("div",{className:"flex items-center gap-4 pt-4 border-t border-border/50",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:e_?.installed?x("settings.config.hooks.installed"):x("settings.config.hooks.notInstalled")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.hooks.installHint")})]}),(0,t.jsx)(l.Button,{variant:e_?.installed?"destructive":"default",onClick:tn,disabled:eJ||!e_,className:"rounded-lg",children:e_?.installed?x("settings.config.hooks.uninstall"):x("settings.config.hooks.install")})]})]}),(0,t.jsx)(g.Dialog,{open:!!eU,onOpenChange:e=>!e&&ez(null),children:(0,t.jsxs)(g.DialogContent,{children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:x("settings.config.git.deleteConfirm")}),(0,t.jsx)(g.DialogDescription,{children:x("settings.config.git.deleteConfirmMessage")})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>ez(null),children:x("settings.config.git.cancel")}),(0,t.jsx)(l.Button,{variant:"destructive",onClick:()=>eU&&to(eU),children:x("settings.config.git.delete")})]})]})})]});case"notifications":return(0,t.jsx)("div",{className:"divide-y divide-border/50",children:(0,t.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:x("settings.notifications.enable")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:x("settings.notifications.enableDesc")})]}),(0,t.jsx)(m.Switch,{checked:eZ,onCheckedChange:tc})]})})}}()]})})]})}e.s(["default",0,function(){return(0,t.jsx)(G,{})}],255779)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,803041,e=>{"use strict";var t=e.i(422364);e.s(["ChevronRight",()=>t.default])},950211,e=>{"use strict";let t=(0,e.i(863961).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],950211)},864056,e=>{"use strict";let t=(0,e.i(863961).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],864056)},289208,e=>{"use strict";let t=(0,e.i(863961).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,t],289208)},466256,421845,e=>{"use strict";var t=e.i(863961);let r=(0,t.default)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);e.s(["ClipboardList",0,r],466256);let s=(0,t.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,s],421845)},787207,e=>{"use strict";e.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},304819,460936,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("401e0a9869a5de47816fc5772798d8fbf90ccba4c8",t.callServer,void 0,t.findSourceMapURL,"createNote");e.s(["createNote",0,r],304819);let s=(0,t.createServerReference)("40c81367514764e4557b8b667389f90d913162570e",t.callServer,void 0,t.findSourceMapURL,"deleteNote");e.s(["deleteNote",0,s],460936)},265826,e=>{"use strict";let t=(0,e.i(863961).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],265826)},726111,e=>{"use strict";var t=e.i(432377),r=e.i(937756);e.s(["EmptyState",0,function({icon:e,title:s,description:a,action:i,className:n}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",n),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:s}),a&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:a}),i&&(0,t.jsx)("div",{className:"mt-2",children:i})]})}])},616199,e=>{"use strict";let t=(0,e.i(863961).default)("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["PlayCircle",0,t],616199)},215365,411559,e=>{"use strict";let t=(0,e.i(863961).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],215365);var r=e.i(543485);let s=(0,r.createServerReference)("40a84b7d129899b8581625c0a80107cb2b16c62f6a",r.callServer,void 0,r.findSourceMapURL,"uploadAsset");e.s(["uploadAsset",0,s],411559)},539566,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("400a3d7f248c3c29008609be900f6ec07affb2cb13",t.callServer,void 0,t.findSourceMapURL,"deleteAsset");e.s(["deleteAsset",0,r])},203529,e=>{"use strict";var t=e.i(337590),r=e.i(793988),s=e.i(164688),a=e.i(937756);let i=(0,s.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:s="default",render:n,...l}){var o;return o={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,a.cn)(i({variant:s}),e)},l),render:n,state:{slot:"badge",variant:s}},(0,r.useRenderElement)(o.defaultTagName??"div",o,o)}],203529)},750986,1156,e=>{"use strict";var t=e.i(419613);e.s(["CheckCircle2",()=>t.default],750986);let r=(0,e.i(863961).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,r],1156)},155996,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("40dd2ab0c8b2fb4ecc971b049e181389621ccbe851",t.callServer,void 0,t.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,r])},9433,e=>{"use strict";var t=e.i(432377),r=e.i(937756);e.s(["Label",0,function({className:e,...s}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,r.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...s})}])},110121,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("78af7cd15573edb9bbe7295c42ae438e98dc783b26",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,r])},612516,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("40497fcd3ab1c5238a08d4cb0ce3e98c8dbde9dfbd",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,r])},969569,351101,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("602709e7f331707daade8f9ffa826382f472cea8df",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,r],969569);let s=(0,e.i(863961).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,s],351101)},287277,e=>{"use strict";let t=(0,e.i(863961).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,t],287277)},225870,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("60a4ba34f60e290ae4231c1a5d2200c6665025e6b0",t.callServer,void 0,t.findSourceMapURL,"updateProject");e.s(["updateProject",0,r])},909105,e=>{"use strict";var t=e.i(432377),r=e.i(85212),s=e.i(357334),a=e.i(458851),i=e.i(677436),n=e.i(893832),l=e.i(946960),o=e.i(718837),c=e.i(711296),d=e.i(831349),u=e.i(540032),x=e.i(625054);e.s(["CreateBranchDialog",0,function({open:e,onOpenChange:m,branches:h,currentBranch:f,localPath:g,onCreated:p,onError:b}){let{t:v}=(0,x.useI18n)(),[y,j]=(0,r.useState)(""),[N,w]=(0,r.useState)(f),[k,C]=(0,r.useState)(""),[S,M]=(0,r.useState)(!1),[L,R]=(0,r.useState)(""),[D,E]=(0,r.useState)(!1);(0,r.useEffect)(()=>{e&&(j(""),w(f),C(""),R(""))},[e,f]);let T=[...new Set(h)].filter(e=>e.toLowerCase().includes(L.toLowerCase())),P=async()=>{if(y.trim()){M(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:g,branch:y.trim(),baseBranch:N})});if(e.ok)m(!1),p();else{let t=await e.json();b(t.error||"Unknown error")}}catch{b("Network error")}finally{M(!1)}}};return(0,t.jsx)(o.Dialog,{open:e,onOpenChange:m,children:(0,t.jsxs)(o.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(o.DialogHeader,{children:(0,t.jsx)(o.DialogTitle,{children:v("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:v("git.branchName")}),(0,t.jsx)(d.Input,{value:y,onChange:e=>j(e.target.value),placeholder:v("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&P()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:v("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>E(!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,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.GitBranch,{className:"h-3 w-3 text-emerald-400"}),(0,t.jsx)("span",{className:"font-mono text-xs text-foreground",children:N})]}),(0,t.jsx)(a.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${D?"rotate-180":""}`})]}),D&&(0,t.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,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(i.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:L,onChange:e=>R(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,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:T.map(e=>(0,t.jsxs)("button",{onClick:()=>{w(e),E(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===N?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(s.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",children:e}),e===N&&(0,t.jsx)(n.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:v("git.branchDesc")}),(0,t.jsx)(u.Textarea,{value:k,onChange:e=>C(e.target.value),placeholder:v("git.branchDescPlaceholder"),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,t.jsxs)(o.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>m(!1),children:v("common.cancel")}),(0,t.jsxs)(c.Button,{onClick:P,disabled:!y.trim()||S,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[S?(0,t.jsx)(l.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,v("common.create")]})]})]})})}])},871183,e=>{"use strict";let t=(0,e.i(863961).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],871183)},657572,e=>{"use strict";async function t(e,r,s={}){let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:r,path:e,...s})});if(!a.ok)throw Error((await a.json()).error||`${r} failed`);return a.json()}e.s(["gitAction",0,t])},330111,e=>{"use strict";var t=e.i(807733);e.s(["AlertTriangle",()=>t.default])},442409,e=>{"use strict";let t=(0,e.i(863961).default)("git-compare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);e.s(["GitCompare",0,t],442409)},477795,486305,e=>{"use strict";var t=e.i(432377),r=e.i(85212),s=e.i(803041),a=e.i(458851),i=e.i(330111),n=e.i(442409),l=e.i(863961);let o=(0,l.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);var c=e.i(711296),d=e.i(726111),u=e.i(203529),x=e.i(718837),m=e.i(540032),h=e.i(625054);e.s(["TaskDiffView",0,function({files:e,totalAdded:l,totalRemoved:f,hasConflicts:g,conflictFiles:p,onCommit:b,hasUncommitted:v}){let{t:y}=(0,h.useI18n)(),[j,N]=(0,r.useState)(new Set),[w,k]=(0,r.useState)(!1),[C,S]=(0,r.useState)(""),[M,L]=(0,r.useState)(!1);return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[e.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",l]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",f]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:v&&b&&(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>k(!0),className:"gap-2",children:[(0,t.jsx)(o,{className:"h-4 w-4"}),y("diff.commit")]})})]}),g&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(i.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",p.length," conflicting file",1!==p.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:p.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===e.length?(0,t.jsx)(d.EmptyState,{icon:n.GitCompare,title:y("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:e.map(e=>{let r=j.has(e.filename);return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",type:"button",onClick:()=>{var t;return t=e.filename,void N(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[r?(0,t.jsx)(a.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(s.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(u.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:"Binary"}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),r&&e.patch&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:e.patch.split("\n").map((e,r)=>{let s=e.startsWith("+")&&!e.startsWith("+++")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")&&!e.startsWith("---")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:s,children:e||" "},r)})})})]},e.filename)})})}),(0,t.jsx)(x.Dialog,{open:w,onOpenChange:k,children:(0,t.jsxs)(x.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(x.DialogHeader,{children:(0,t.jsx)(x.DialogTitle,{children:y("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(m.Textarea,{value:C,onChange:e=>S(e.target.value),placeholder:y("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"ghost",onClick:()=>k(!1),children:y("common.cancel")}),(0,t.jsx)(c.Button,{onClick:async()=>{if(C.trim()&&b){L(!0);try{await b(C.trim()),S(""),k(!1)}finally{L(!1)}}},disabled:!C.trim()||M,children:M?"...":y("diff.commit")})]})]})})]})}],477795);var f=e.i(309542);let g=(0,l.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var p=e.i(946960);e.s(["TaskMergeConfirmDialog",0,function({open:e,onOpenChange:s,taskId:a,taskTitle:i,baseBranch:n,fileCount:l,commitCount:o,commitLog:d=[],onMergeComplete:u}){let m=(0,f.useRouter)(),[h,b]=(0,r.useState)(!1),[v,y]=(0,r.useState)(null),j=async()=>{b(!0),y(null);try{let e=await fetch(`/api/tasks/${a}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){s(!1),u(),m.refresh();return}let t=await e.json().catch(()=>({error:"Merge failed"}));409===e.status?y(`Merge conflicts detected: ${Array.isArray(t.conflictFiles)?t.conflictFiles.join(", "):"unknown files"}`):y(t.error??"Merge failed")}catch{y("Network error — merge failed")}finally{b(!1)}};return(0,t.jsx)(x.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(x.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(x.DialogHeader,{children:(0,t.jsxs)(x.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(g,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,t.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:n})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:l})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:o})]})]}),d.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,t.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:d.map((e,r)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},r))})]}),v&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs text-red-400",children:v})})]}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>s(!1),disabled:h,children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:j,disabled:h,className:"gap-2",children:h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],486305)},716206,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("4063918367cd563e2058c622e701bbbe48352b8284",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,r])},15594,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("4096ff3c2eb9b14c7722d91462a22aa3eddc0efb50",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r])},691240,489112,634796,425059,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("603e8da543b13fd18b235538edb812db23819cc7a1",t.callServer,void 0,t.findSourceMapURL,"updateTaskStatus");e.s(["updateTaskStatus",0,r],691240);let s=(0,t.createServerReference)("407b9e94f9c79be134a77d9ce4c0b0a15b4261a88d",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,s],489112);let a=(0,t.createServerReference)("60acc3d390a48cd5616f27d78cf43022df7960feba",t.callServer,void 0,t.findSourceMapURL,"commitWorktreeChanges");e.s(["commitWorktreeChanges",0,a],634796);let i=(0,e.i(863961).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,i],425059)},612758,e=>{"use strict";var t=e.i(432377),r=e.i(85212),s=e.i(458851),a=e.i(986044),i=e.i(750986),n=e.i(1156),l=e.i(946960),o=e.i(425059),c=e.i(616199),d=e.i(351101),u=e.i(287277);let x=(0,e.i(863961).default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var m=e.i(711296),h=e.i(726111),f=e.i(625054);function g({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(i.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(n.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(l.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(o.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:i,onContinueLatest:n}){let{t:l,locale:o}=(0,f.useI18n)(),[p,b]=(0,r.useState)(null),[v,y]=(0,r.useState)(null);return 0===e.length?(0,t.jsx)(h.EmptyState,{icon:x,title:l("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:l("execution.history")}),e.map(r=>{let x=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(r.gitStats??null),h=function(e,t){if(!e||!t)return"";let r=new Date(t).getTime()-new Date(e).getTime();if(r<0)return"";let s=Math.floor(r/1e3);if(s<60)return`${s}s`;let a=Math.floor(s/60);if(a<60)return`${a}m ${s%60}s`;let i=Math.floor(a/60);return`${i}h ${a%60}m`}(r.startedAt??null,r.endedAt??null),f=p===r.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(g,{status:r.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(r.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(r.status,l)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let r=new Date(e),s=Math.floor((new Date().getTime()-r.getTime())/864e5),a="zh"===t?"zh-CN":"en-US",i=r.toLocaleTimeString(a,{hour:"2-digit",minute:"2-digit"});return 0===s?i:1===s?"zh"===t?`昨天 ${i}`:`Yesterday ${i}`:s<7?"zh"===t?`${s}天前 ${i}`:`${s}d ago ${i}`:r.toLocaleDateString(a,{month:"2-digit",day:"2-digit"})+" "+i}(r.startedAt??null,o)}),h&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",h,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:r.summary||l("execution.noSummary")}),x&&(x.commits||x.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[x.commits?(0,t.jsxs)("span",{children:[x.commits," ",l("execution.commits")]}):null,x.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[x.filesChanged," ",l("execution.files")]})]}):null,x.insertions||x.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),x.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",x.insertions]}):null,x.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",x.deletions]}):null]}):null]}),r.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>y(v===r.id?null:r.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(u.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[l("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:r.insightNote.title}),v===r.id?(0,t.jsx)(a.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(s.ChevronDown,{className:"h-3 w-3"})]}),v===r.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:r.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[r.sessionId&&i?(0,t.jsxs)(m.Button,{size:"sm",onClick:()=>i(r.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(c.PlayCircle,{className:"h-3.5 w-3.5"}),l("execution.resume")]}):!r.sessionId&&"FAILED"===r.status&&r.id===e[0]?.id&&n?(0,t.jsxs)(m.Button,{size:"sm",onClick:n,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(d.RotateCcw,{className:"h-3.5 w-3.5"}),l("execution.tryRecover")]}):null,(0,t.jsxs)(m.Button,{variant:"ghost",size:"sm",onClick:()=>b(f?null:r.id),className:"bg-muted text-muted-foreground",children:[f?(0,t.jsx)(a.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(s.ChevronDown,{className:"h-3.5 w-3.5"}),f?l("execution.collapse"):l("execution.details")]})]})]}),f&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[r.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:r.gitLog.split("\n").slice(0,3).join("\n")})]}),r.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:r.terminalLog})]}),"FAILED"===r.status&&null!=r.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",r.exitCode]})]})]},r.id)})]})}],612758)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,803041,e=>{"use strict";var t=e.i(422364);e.s(["ChevronRight",()=>t.default])},950211,e=>{"use strict";let t=(0,e.i(863961).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],950211)},864056,e=>{"use strict";let t=(0,e.i(863961).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],864056)},289208,e=>{"use strict";let t=(0,e.i(863961).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,t],289208)},466256,421845,e=>{"use strict";var t=e.i(863961);let r=(0,t.default)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);e.s(["ClipboardList",0,r],466256);let s=(0,t.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,s],421845)},787207,e=>{"use strict";e.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},414588,671705,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("402017afc57d09f77c586036e5a209c6440b02e3ea",t.callServer,void 0,t.findSourceMapURL,"createNote");e.s(["createNote",0,r],414588);let s=(0,t.createServerReference)("40a6c78693aa8ed7d908abda7866e675fa23c4120d",t.callServer,void 0,t.findSourceMapURL,"deleteNote");e.s(["deleteNote",0,s],671705)},265826,e=>{"use strict";let t=(0,e.i(863961).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],265826)},726111,e=>{"use strict";var t=e.i(432377),r=e.i(937756);e.s(["EmptyState",0,function({icon:e,title:s,description:a,action:i,className:n}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",n),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:s}),a&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:a}),i&&(0,t.jsx)("div",{className:"mt-2",children:i})]})}])},616199,e=>{"use strict";let t=(0,e.i(863961).default)("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["PlayCircle",0,t],616199)},215365,572698,e=>{"use strict";let t=(0,e.i(863961).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],215365);var r=e.i(543485);let s=(0,r.createServerReference)("40b9738e6597fb9a126f5b952c27544c08d42b273c",r.callServer,void 0,r.findSourceMapURL,"uploadAsset");e.s(["uploadAsset",0,s],572698)},783382,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("40f2e04c89b9addd932b158350a08db217fa4acea5",t.callServer,void 0,t.findSourceMapURL,"deleteAsset");e.s(["deleteAsset",0,r])},203529,e=>{"use strict";var t=e.i(337590),r=e.i(793988),s=e.i(164688),a=e.i(937756);let i=(0,s.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:s="default",render:n,...l}){var o;return o={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,a.cn)(i({variant:s}),e)},l),render:n,state:{slot:"badge",variant:s}},(0,r.useRenderElement)(o.defaultTagName??"div",o,o)}],203529)},750986,1156,e=>{"use strict";var t=e.i(419613);e.s(["CheckCircle2",()=>t.default],750986);let r=(0,e.i(863961).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,r],1156)},646917,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("409ae7e7e89ea2e0f5f1e50c1ace524ab68774c79c",t.callServer,void 0,t.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,r])},9433,e=>{"use strict";var t=e.i(432377),r=e.i(937756);e.s(["Label",0,function({className:e,...s}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,r.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...s})}])},885121,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("78312646a8f7042ca8f29d708f48116d41bfb2306e",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,r])},520444,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("40a647acdd2e46f1d20023385b48729907d6fe2887",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,r])},271277,351101,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("6036b9e4fc9edfdd691292f2f6aab94b838e535ef5",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,r],271277);let s=(0,e.i(863961).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,s],351101)},287277,e=>{"use strict";let t=(0,e.i(863961).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,t],287277)},238639,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("6001c2db587ae9837c01852b0a264ee014f9f96ea4",t.callServer,void 0,t.findSourceMapURL,"updateProject");e.s(["updateProject",0,r])},909105,e=>{"use strict";var t=e.i(432377),r=e.i(85212),s=e.i(357334),a=e.i(458851),i=e.i(677436),n=e.i(893832),l=e.i(946960),o=e.i(718837),c=e.i(711296),d=e.i(831349),u=e.i(540032),x=e.i(625054);e.s(["CreateBranchDialog",0,function({open:e,onOpenChange:m,branches:h,currentBranch:f,localPath:g,onCreated:p,onError:b}){let{t:v}=(0,x.useI18n)(),[y,j]=(0,r.useState)(""),[N,w]=(0,r.useState)(f),[k,C]=(0,r.useState)(""),[S,M]=(0,r.useState)(!1),[L,R]=(0,r.useState)(""),[D,E]=(0,r.useState)(!1);(0,r.useEffect)(()=>{e&&(j(""),w(f),C(""),R(""))},[e,f]);let T=[...new Set(h)].filter(e=>e.toLowerCase().includes(L.toLowerCase())),P=async()=>{if(y.trim()){M(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:g,branch:y.trim(),baseBranch:N})});if(e.ok)m(!1),p();else{let t=await e.json();b(t.error||"Unknown error")}}catch{b("Network error")}finally{M(!1)}}};return(0,t.jsx)(o.Dialog,{open:e,onOpenChange:m,children:(0,t.jsxs)(o.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(o.DialogHeader,{children:(0,t.jsx)(o.DialogTitle,{children:v("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:v("git.branchName")}),(0,t.jsx)(d.Input,{value:y,onChange:e=>j(e.target.value),placeholder:v("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&P()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:v("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>E(!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,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.GitBranch,{className:"h-3 w-3 text-emerald-400"}),(0,t.jsx)("span",{className:"font-mono text-xs text-foreground",children:N})]}),(0,t.jsx)(a.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${D?"rotate-180":""}`})]}),D&&(0,t.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,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(i.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:L,onChange:e=>R(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,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:T.map(e=>(0,t.jsxs)("button",{onClick:()=>{w(e),E(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===N?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(s.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",children:e}),e===N&&(0,t.jsx)(n.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:v("git.branchDesc")}),(0,t.jsx)(u.Textarea,{value:k,onChange:e=>C(e.target.value),placeholder:v("git.branchDescPlaceholder"),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,t.jsxs)(o.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>m(!1),children:v("common.cancel")}),(0,t.jsxs)(c.Button,{onClick:P,disabled:!y.trim()||S,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[S?(0,t.jsx)(l.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,v("common.create")]})]})]})})}])},871183,e=>{"use strict";let t=(0,e.i(863961).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],871183)},657572,e=>{"use strict";async function t(e,r,s={}){let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:r,path:e,...s})});if(!a.ok)throw Error((await a.json()).error||`${r} failed`);return a.json()}e.s(["gitAction",0,t])},330111,e=>{"use strict";var t=e.i(807733);e.s(["AlertTriangle",()=>t.default])},442409,e=>{"use strict";let t=(0,e.i(863961).default)("git-compare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);e.s(["GitCompare",0,t],442409)},477795,486305,e=>{"use strict";var t=e.i(432377),r=e.i(85212),s=e.i(803041),a=e.i(458851),i=e.i(330111),n=e.i(442409),l=e.i(863961);let o=(0,l.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);var c=e.i(711296),d=e.i(726111),u=e.i(203529),x=e.i(718837),m=e.i(540032),h=e.i(625054);e.s(["TaskDiffView",0,function({files:e,totalAdded:l,totalRemoved:f,hasConflicts:g,conflictFiles:p,onCommit:b,hasUncommitted:v}){let{t:y}=(0,h.useI18n)(),[j,N]=(0,r.useState)(new Set),[w,k]=(0,r.useState)(!1),[C,S]=(0,r.useState)(""),[M,L]=(0,r.useState)(!1);return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[e.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",l]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",f]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:v&&b&&(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>k(!0),className:"gap-2",children:[(0,t.jsx)(o,{className:"h-4 w-4"}),y("diff.commit")]})})]}),g&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(i.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",p.length," conflicting file",1!==p.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:p.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===e.length?(0,t.jsx)(d.EmptyState,{icon:n.GitCompare,title:y("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:e.map(e=>{let r=j.has(e.filename);return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",type:"button",onClick:()=>{var t;return t=e.filename,void N(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[r?(0,t.jsx)(a.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(s.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(u.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:"Binary"}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),r&&e.patch&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:e.patch.split("\n").map((e,r)=>{let s=e.startsWith("+")&&!e.startsWith("+++")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")&&!e.startsWith("---")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:s,children:e||" "},r)})})})]},e.filename)})})}),(0,t.jsx)(x.Dialog,{open:w,onOpenChange:k,children:(0,t.jsxs)(x.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(x.DialogHeader,{children:(0,t.jsx)(x.DialogTitle,{children:y("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(m.Textarea,{value:C,onChange:e=>S(e.target.value),placeholder:y("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"ghost",onClick:()=>k(!1),children:y("common.cancel")}),(0,t.jsx)(c.Button,{onClick:async()=>{if(C.trim()&&b){L(!0);try{await b(C.trim()),S(""),k(!1)}finally{L(!1)}}},disabled:!C.trim()||M,children:M?"...":y("diff.commit")})]})]})})]})}],477795);var f=e.i(309542);let g=(0,l.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var p=e.i(946960);e.s(["TaskMergeConfirmDialog",0,function({open:e,onOpenChange:s,taskId:a,taskTitle:i,baseBranch:n,fileCount:l,commitCount:o,commitLog:d=[],onMergeComplete:u}){let m=(0,f.useRouter)(),[h,b]=(0,r.useState)(!1),[v,y]=(0,r.useState)(null),j=async()=>{b(!0),y(null);try{let e=await fetch(`/api/tasks/${a}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){s(!1),u(),m.refresh();return}let t=await e.json().catch(()=>({error:"Merge failed"}));409===e.status?y(`Merge conflicts detected: ${Array.isArray(t.conflictFiles)?t.conflictFiles.join(", "):"unknown files"}`):y(t.error??"Merge failed")}catch{y("Network error — merge failed")}finally{b(!1)}};return(0,t.jsx)(x.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(x.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(x.DialogHeader,{children:(0,t.jsxs)(x.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(g,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,t.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:n})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:l})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:o})]})]}),d.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,t.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:d.map((e,r)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},r))})]}),v&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs text-red-400",children:v})})]}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>s(!1),disabled:h,children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:j,disabled:h,className:"gap-2",children:h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],486305)},336324,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("405800d4267c5b028ffdb01aef8512f3fa1a2d6d99",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,r])},571287,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("40bf60c774e66b2bb48a9716aeaa207deb762b0a7b",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r])},587830,99015,580644,425059,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("602d79bb6af0a9cd6edb1759776d8dfeb1b0b958b7",t.callServer,void 0,t.findSourceMapURL,"updateTaskStatus");e.s(["updateTaskStatus",0,r],587830);let s=(0,t.createServerReference)("400840a4148c075cf61f4f65faf3465628532c3c9e",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,s],99015);let a=(0,t.createServerReference)("60569a6af1a9da72231ee81243df47abfc51f92540",t.callServer,void 0,t.findSourceMapURL,"commitWorktreeChanges");e.s(["commitWorktreeChanges",0,a],580644);let i=(0,e.i(863961).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,i],425059)},612758,e=>{"use strict";var t=e.i(432377),r=e.i(85212),s=e.i(458851),a=e.i(986044),i=e.i(750986),n=e.i(1156),l=e.i(946960),o=e.i(425059),c=e.i(616199),d=e.i(351101),u=e.i(287277);let x=(0,e.i(863961).default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var m=e.i(711296),h=e.i(726111),f=e.i(625054);function g({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(i.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(n.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(l.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(o.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:i,onContinueLatest:n}){let{t:l,locale:o}=(0,f.useI18n)(),[p,b]=(0,r.useState)(null),[v,y]=(0,r.useState)(null);return 0===e.length?(0,t.jsx)(h.EmptyState,{icon:x,title:l("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:l("execution.history")}),e.map(r=>{let x=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(r.gitStats??null),h=function(e,t){if(!e||!t)return"";let r=new Date(t).getTime()-new Date(e).getTime();if(r<0)return"";let s=Math.floor(r/1e3);if(s<60)return`${s}s`;let a=Math.floor(s/60);if(a<60)return`${a}m ${s%60}s`;let i=Math.floor(a/60);return`${i}h ${a%60}m`}(r.startedAt??null,r.endedAt??null),f=p===r.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(g,{status:r.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(r.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(r.status,l)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let r=new Date(e),s=Math.floor((new Date().getTime()-r.getTime())/864e5),a="zh"===t?"zh-CN":"en-US",i=r.toLocaleTimeString(a,{hour:"2-digit",minute:"2-digit"});return 0===s?i:1===s?"zh"===t?`昨天 ${i}`:`Yesterday ${i}`:s<7?"zh"===t?`${s}天前 ${i}`:`${s}d ago ${i}`:r.toLocaleDateString(a,{month:"2-digit",day:"2-digit"})+" "+i}(r.startedAt??null,o)}),h&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",h,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:r.summary||l("execution.noSummary")}),x&&(x.commits||x.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[x.commits?(0,t.jsxs)("span",{children:[x.commits," ",l("execution.commits")]}):null,x.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[x.filesChanged," ",l("execution.files")]})]}):null,x.insertions||x.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),x.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",x.insertions]}):null,x.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",x.deletions]}):null]}):null]}),r.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>y(v===r.id?null:r.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(u.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[l("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:r.insightNote.title}),v===r.id?(0,t.jsx)(a.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(s.ChevronDown,{className:"h-3 w-3"})]}),v===r.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:r.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[r.sessionId&&i?(0,t.jsxs)(m.Button,{size:"sm",onClick:()=>i(r.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(c.PlayCircle,{className:"h-3.5 w-3.5"}),l("execution.resume")]}):!r.sessionId&&"FAILED"===r.status&&r.id===e[0]?.id&&n?(0,t.jsxs)(m.Button,{size:"sm",onClick:n,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(d.RotateCcw,{className:"h-3.5 w-3.5"}),l("execution.tryRecover")]}):null,(0,t.jsxs)(m.Button,{variant:"ghost",size:"sm",onClick:()=>b(f?null:r.id),className:"bg-muted text-muted-foreground",children:[f?(0,t.jsx)(a.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(s.ChevronDown,{className:"h-3.5 w-3.5"}),f?l("execution.collapse"):l("execution.details")]})]})]}),f&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[r.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:r.gitLog.split("\n").slice(0,3).join("\n")})]}),r.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:r.terminalLog})]}),"FAILED"===r.status&&null!=r.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",r.exitCode]})]})]},r.id)})]})}],612758)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,702310,e=>{"use strict";var t=e.i(543485);let s=(0,t.createServerReference)("405c05edca6d848111ef9bf828871ea1a8a7c2e1ae",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,s])},726111,e=>{"use strict";var t=e.i(432377),s=e.i(937756);e.s(["EmptyState",0,function({icon:e,title:r,description:a,action:i,className:n}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",n),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:r}),a&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:a}),i&&(0,t.jsx)("div",{className:"mt-2",children:i})]})}])},203529,e=>{"use strict";var t=e.i(337590),s=e.i(793988),r=e.i(164688),a=e.i(937756);let i=(0,r.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r="default",render:n,...l}){var o;return o={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,a.cn)(i({variant:r}),e)},l),render:n,state:{slot:"badge",variant:r}},(0,s.useRenderElement)(o.defaultTagName??"div",o,o)}],203529)},612516,e=>{"use strict";var t=e.i(543485);let s=(0,t.createServerReference)("40497fcd3ab1c5238a08d4cb0ce3e98c8dbde9dfbd",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,s])},110121,e=>{"use strict";var t=e.i(543485);let s=(0,t.createServerReference)("78af7cd15573edb9bbe7295c42ae438e98dc783b26",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,s])},969569,351101,e=>{"use strict";var t=e.i(543485);let s=(0,t.createServerReference)("602709e7f331707daade8f9ffa826382f472cea8df",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,s],969569);let r=(0,e.i(863961).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,r],351101)},332145,e=>{"use strict";var t=e.i(543485);let s=(0,t.createServerReference)("40d3bb361175ccf31fa1cbe570d51abec9e9a840a0",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,s])},877938,e=>{"use strict";var t=e.i(432377),s=e.i(85212),r=e.i(625054),a=e.i(543485);let i=(0,a.createServerReference)("00a268f3cf0427d3f86f445d5c4724f55507814b04",a.callServer,void 0,a.findSourceMapURL,"getActiveExecutionsAcrossWorkspaces");var n=e.i(612516);let l=[{id:"1x1",label:"1×1",cols:1,rows:1,minHeight:"480px",desc:"Focus mode"},{id:"2x1",label:"2×1",cols:2,rows:1,minHeight:"480px",desc:"Side by side"},{id:"3x2",label:"3×2",cols:3,rows:2,minHeight:"300px",desc:"Default"},{id:"2x2",label:"2×2",cols:2,rows:2,minHeight:"300px",desc:"Balanced"},{id:"4x2",label:"4×2",cols:4,rows:2,minHeight:"240px",desc:"Wide monitor"},{id:"3x3",label:"3×3",cols:3,rows:3,minHeight:"240px",desc:"Max overview"}];var o=e.i(610874),c=e.i(711296),d=e.i(726111),u=e.i(863961);let m=(0,u.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);var x=e.i(702310);function h({cols:e,rows:s,active:r}){let a=Array.from({length:e*s});return(0,t.jsx)("div",{className:`grid gap-[1px] w-7 h-5 p-[3px] rounded-sm border shrink-0 ${r?"border-primary bg-primary/10":"border-border bg-muted"}`,style:{gridTemplateColumns:`repeat(${e}, 1fr)`,gridTemplateRows:`repeat(${s}, 1fr)`},children:a.map((e,s)=>(0,t.jsx)("div",{className:`rounded-[1px] min-w-0 min-h-0 ${r?"bg-primary":"bg-muted-foreground/40"}`},s))})}let f="custom";function p({value:e,customValue:a,onChange:i}){let{t:n}=(0,r.useI18n)(),[o,d]=(0,s.useState)(!1),u=(0,s.useRef)(null),m=e===f,g=m?null:l.find(t=>t.id===e)??l[2],[v,b]=(0,s.useState)(a?.cols??2),[j,w]=(0,s.useState)(a?.rows??2),[y,k]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5});(0,s.useEffect)(()=>{(0,x.getConfigValues)(["missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{k({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{a&&(b(a.cols),w(a.rows))},[a?.cols,a?.rows]),(0,s.useEffect)(()=>{if(o)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){u.current&&!u.current.contains(e.target)&&d(!1)}},[o]);let N=(e,t,s)=>Math.max(t,Math.min(s,e)),S=m?v:g?.cols??2,I=m?j:g?.rows??2,C=m?`${v}\xd7${j}`:g?.label??"";return(0,t.jsxs)("div",{ref:u,className:"relative",children:[(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>d(e=>!e),className:"gap-2",children:[(0,t.jsx)(h,{cols:S,rows:I,active:!1}),(0,t.jsx)("span",{children:C}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"▼"})]}),o&&(0,t.jsxs)("div",{className:"absolute right-0 z-50 mt-1 w-72 rounded-lg border border-border bg-popover shadow-xl p-3",children:[(0,t.jsx)("h5",{className:"text-sm font-semibold text-foreground mb-3",children:n("missions.gridPreset")}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[l.map(s=>{let r=s.id===e;return(0,t.jsxs)("button",{onClick:()=>{i(s.id),d(!1)},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors ${r?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(h,{cols:s.cols,rows:s.rows,active:r}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${r?"text-primary":"text-foreground"}`,children:s.label}),(0,t.jsx)("span",{className:`text-xs ${r?"text-primary/60":"text-muted-foreground"}`,children:s.desc})]},s.id)}),(0,t.jsxs)("div",{className:"mt-1 border-t border-border pt-2",children:[(0,t.jsxs)("button",{onClick:()=>{m||i(f,{cols:v,rows:j})},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors w-full ${m?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(h,{cols:v,rows:j,active:m}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${m?"text-primary":"text-foreground"}`,children:n("missions.gridCustom")}),(0,t.jsxs)("span",{className:`text-xs ${m?"text-primary/60":"text-muted-foreground"}`,children:[v,"×",j]})]}),m&&(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:n("missions.gridCols")}),(0,t.jsx)("input",{type:"number",min:y.minCols,max:y.maxCols,value:v,onChange:e=>{let t;b(t=N(Number(e.target.value),y.minCols,y.maxCols)),i(f,{cols:t,rows:j})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"×"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:n("missions.gridRows")}),(0,t.jsx)("input",{type:"number",min:y.minRows,max:y.maxRows,value:j,onChange:e=>{let t;w(t=N(Number(e.target.value),y.minRows,y.maxRows)),i(f,{cols:v,rows:t})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]})]})]})]})]})]})}var g=e.i(139302),v=e.i(254059),b=e.i(415411),j=e.i(309542),w=e.i(280121);let y=(0,u.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),k=(0,u.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var N=e.i(996032);let S=(0,u.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var I=e.i(11915),C=e.i(203529),R=e.i(332145),T=e.i(286302);let E=(0,b.default)(()=>e.A(172854).then(e=>e.TaskTerminal),{loadableGenerated:{modules:[467005]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"h-full w-full bg-[#0a0a0a] animate-pulse"})});function M({execution:e,isRemoving:a,removeReason:i,onStop:n,onSessionEnd:l}){let{t:o}=(0,r.useI18n)(),d=(0,j.useRouter)(),{attributes:u,listeners:m,setNodeRef:x,transform:h,transition:f}=(0,v.useSortable)({id:e.executionId}),p={transform:w.CSS.Transform.toString(h),transition:f,opacity:+!a},[g,b]=(0,s.useState)(()=>e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0);(0,s.useEffect)(()=>{if(a)return;let t=setInterval(()=>{b(e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0)},1e3);return()=>clearInterval(t)},[e.startedAt,a]);let L=Math.floor(g/60),P=`${L}m ${g%60}s`;async function A(){if(e.projectLocalPath)try{await (0,R.openInTerminal)(e.projectLocalPath)}catch{T.toast.error(o("preview.terminalError"))}}return(0,t.jsxs)("div",{ref:x,style:p,className:"border border-border rounded-lg overflow-hidden flex flex-col transition-opacity duration-300",...u,children:[(0,t.jsxs)("div",{className:"h-10 px-3 flex items-center gap-1 border-b border-border bg-card shrink-0",children:[(0,t.jsx)("button",{...m,"aria-label":o("missions.dragHandle"),"aria-roledescription":"sortable",className:"cursor-grab text-muted-foreground hover:text-foreground mr-1",children:(0,t.jsx)(y,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground truncate flex-1",children:[e.workspaceName," ›"," ",e.projectAlias||e.projectName," ›"," ",(0,t.jsx)("span",{className:"text-foreground font-semibold",children:e.taskTitle})]}),a?(0,t.jsx)(C.Badge,{variant:"outline",className:"text-[11px] text-muted-foreground bg-muted ml-1 shrink-0",children:"stopped"===i?o("missions.statusStopped"):o("missions.statusCompleted")}):(0,t.jsx)(C.Badge,{variant:"outline",className:"text-[11px] text-primary border-primary/30 bg-primary/10 ml-1 shrink-0",children:o("missions.statusRunning")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground ml-1 shrink-0",children:P}),e.projectLocalPath&&(0,t.jsxs)(I.Tooltip,{children:[(0,t.jsx)(I.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:A}),children:(0,t.jsx)(S,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(I.TooltipContent,{children:o("missions.openInTerminal")})]}),(0,t.jsxs)(I.Tooltip,{children:[(0,t.jsx)(I.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:()=>d.push(`/workspaces/${e.workspaceId}/tasks/${e.taskId}`)}),children:(0,t.jsx)(k,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(I.TooltipContent,{children:o("missions.openFullView")})]}),(0,t.jsxs)(I.Tooltip,{children:[(0,t.jsx)(I.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"destructive",size:"icon",className:"ml-1 shrink-0",onClick:()=>n(e.taskId),disabled:a}),children:(0,t.jsx)(N.X,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(I.TooltipContent,{children:o("missions.stopTask")})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,t.jsx)(E,{taskId:e.taskId,worktreePath:e.worktreePath??e.projectLocalPath,onSessionEnd:t=>l?.(e.taskId,t),useCanvasRenderer:!0})})]})}let L=(0,a.createServerReference)("409aeed388fbd0822fd35851a45232ef5f14ca8323",a.callServer,void 0,a.findSourceMapURL,"getWorkspacesWithRecentTasks"),P=(0,a.createServerReference)("4085db19f9504cf12d79ee12d86913ca1d182f58cb",a.callServer,void 0,a.findSourceMapURL,"getProjectTasks");var A=e.i(110121),O=e.i(969569),$=e.i(718837);let D=(0,u.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var B=e.i(351101),H=e.i(142124);let z={TODO:"TODO",IN_PROGRESS:"Running",IN_REVIEW:"Review"},V={LOW:"Low",MEDIUM:"Med",HIGH:"High",CRITICAL:"Crit"};function U({status:e}){return(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${{TODO:"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",IN_PROGRESS:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",IN_REVIEW:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400"}[e]??"bg-slate-100 text-slate-600"}`,children:z[e]??e})}function F({task:e,isRunning:s,launchingId:r,onLaunchNew:a,onResume:i,t:n}){let l=e.executions?.[0]?.sessionId,o=r===e.id;return(0,t.jsxs)("div",{className:"group/task flex items-center gap-2 px-3 py-1.5 hover:bg-accent/50 cursor-default",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:`text-sm truncate ${s?"italic text-muted-foreground":""}`,children:e.title}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,t.jsx)(U,{status:e.status}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:V[e.priority]??e.priority})]})]}),s?(0,t.jsx)("span",{className:"text-[10px] italic text-muted-foreground shrink-0",children:n("missions.alreadyMonitored")}):(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/task:opacity-100 transition-opacity shrink-0",children:[l&&(0,t.jsxs)(c.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>i(e.id,l),disabled:o,title:n("missions.continueSession"),children:[(0,t.jsx)(B.RotateCcw,{className:"h-3 w-3 mr-1"}),n("missions.continueLabel")]}),(0,t.jsxs)(c.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>a(e.id),disabled:o,title:n("missions.launchNew"),children:[(0,t.jsx)(D,{className:"h-3 w-3 mr-1"}),o?"...":n("missions.launchNewLabel")]})]})]})}function W({open:e,onOpenChange:a,onLaunchNew:i,onResume:n,runningTaskIds:l,launchingId:c}){let{t:d}=(0,r.useI18n)(),[u,m]=(0,s.useState)([]),[x,h]=(0,s.useState)(""),[f,p]=(0,s.useState)(""),[g,v]=(0,s.useState)([]);(0,s.useEffect)(()=>{e&&(h(""),p(""),v([]),L(100).then(m).catch(()=>T.toast.error(d("missions.error.launchFailed"))))},[e,d]),(0,s.useEffect)(()=>{f?P(f).then(e=>{v(e.filter(e=>"TODO"===e.status||"IN_PROGRESS"===e.status||"IN_REVIEW"===e.status))}).catch(()=>T.toast.error(d("missions.error.launchFailed"))):v([])},[f,d]);let b=u.find(e=>e.id===x),j=b?.projects??[];return(0,t.jsx)($.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)($.DialogContent,{className:"max-w-lg max-h-[70vh] flex flex-col",children:[(0,t.jsx)($.DialogHeader,{children:(0,t.jsx)($.DialogTitle,{children:d("missions.fullPickerTitle")})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,t.jsxs)(o.Select,{value:x,onValueChange:e=>{h(e??""),p("")},children:[(0,t.jsx)(o.SelectTrigger,{id:"full-picker-ws",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:u.find(e=>e.id===x)?.name??d("missions.launcher.selectWorkspace")})}),(0,t.jsx)(o.SelectContent,{children:u.map(e=>(0,t.jsx)(o.SelectItem,{value:e.id,children:e.name},e.id))})]}),(0,t.jsxs)(o.Select,{value:f,onValueChange:e=>p(e??""),disabled:!x,children:[(0,t.jsx)(o.SelectTrigger,{id:"full-picker-proj",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:j.find(e=>e.id===f)?.name??d("missions.launcher.selectProject")})}),(0,t.jsx)(o.SelectContent,{children:j.map(e=>(0,t.jsx)(o.SelectItem,{value:e.id,children:e.alias??e.name},e.id))})]})]}),(0,t.jsx)(H.ScrollArea,{className:"flex-1 min-h-0 -mx-2",children:0===g.length&&f?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.launcher.noTasks")}):0===g.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.fullPickerHint")}):g.map(e=>(0,t.jsx)(F,{task:e,isRunning:l.has(e.id),launchingId:c,onLaunchNew:i,onResume:n,t:d},e.id))})]})})}function _({open:e,onOpenChange:a,onLaunched:i,runningTaskIds:n=new Set,anchorRef:l}){let{t:o}=(0,r.useI18n)(),d=(0,s.useRef)(null),[u,m]=(0,s.useState)([]),[x,h]=(0,s.useState)(!1),[f,p]=(0,s.useState)(null),[g,v]=(0,s.useState)(!1);(0,s.useEffect)(()=>{e&&(h(!0),L(3).then(m).catch(()=>T.toast.error(o("missions.error.launchFailed"))).finally(()=>h(!1)))},[e,o]),(0,s.useEffect)(()=>{if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t);function t(e){let t=e.target;if(d.current&&!d.current.contains(t)){if(l?.current&&l.current.contains(t))return;a(!1)}}},[e,a,l]);let b=(0,s.useCallback)(async e=>{try{p(e),await (0,A.startPtyExecution)(e,""),i(e),a(!1),v(!1)}catch{T.toast.error(o("missions.error.launchFailed"))}finally{p(null)}},[i,a,o]),j=(0,s.useCallback)(async(e,t)=>{try{p(e),await (0,O.resumePtyExecution)(e,t),i(e),a(!1),v(!1)}catch{T.toast.error(o("missions.error.launchFailed"))}finally{p(null)}},[i,a,o]),w=(0,s.useCallback)(()=>{a(!1),v(!0)},[a]);return e||g?(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsxs)("div",{ref:d,className:"absolute right-0 z-50 mt-1 w-96 rounded-lg border border-border bg-popover shadow-xl flex flex-col overflow-hidden",style:{maxHeight:"480px"},children:[(0,t.jsx)("div",{className:"px-3 py-2 border-b border-border shrink-0",children:(0,t.jsx)("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:o("missions.pickerTitle")})}),(0,t.jsx)(H.ScrollArea,{className:"flex-1 min-h-0",children:x?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}):0===u.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("missions.noAvailableTasks")}):u.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"sticky top-0 z-10 px-3 py-1.5 bg-popover border-b border-border/50",children:(0,t.jsx)("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:e.name})}),e.projects.map(e=>0===e._count.tasks?null:(0,t.jsxs)("div",{className:"mb-1",children:[(0,t.jsx)("div",{className:"px-3 pt-2 pb-0.5",children:(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:e.alias??e.name})}),e.tasks.map(e=>(0,t.jsx)(F,{task:e,isRunning:n.has(e.id),launchingId:f,onLaunchNew:b,onResume:j,t:o},e.id))]},e.id))]},e.id))}),(0,t.jsx)("div",{className:"shrink-0 border-t border-border",children:(0,t.jsx)(c.Button,{variant:"ghost",className:"w-full rounded-none text-xs text-primary font-medium",onClick:w,children:o("missions.showMoreTasks")})})]}),(0,t.jsx)(W,{open:g,onOpenChange:v,onLaunchNew:b,onResume:j,runningTaskIds:n,launchingId:f})]}):null}e.s(["MissionsClient",0,function({initialExecutions:e}){let{t:a}=(0,r.useI18n)(),[u,x]=(0,s.useState)(e),[h,f]=(0,s.useState)(()=>localStorage.getItem("missions-grid-preset")??"3x2"),[b,j]=(0,s.useState)(()=>{try{let e=localStorage.getItem("missions-grid-custom");if(e){let t=JSON.parse(e);if("number"==typeof t?.cols&&"number"==typeof t?.rows)return{cols:Math.max(1,Math.min(10,t.cols)),rows:Math.max(1,Math.min(10,t.rows))}}}catch{}return{cols:2,rows:2}}),[w,y]=(0,s.useState)(!1),[k,N]=(0,s.useState)(""),S=(0,s.useRef)(null),[I,C]=(0,s.useState)(new Map),R=(0,s.useRef)(I);(0,s.useEffect)(()=>{R.current=I},[I]);let E=(0,s.useRef)(new Map),L=l.find(e=>e.id===h)??l[2],P="custom"===h?b.cols:L.cols,A="custom"===h?b.rows:L.rows,O=(0,s.useRef)(null),[$,D]=(0,s.useState)("480px");(0,s.useEffect)(()=>{let e=O.current;if(!e)return;let t=()=>{let t=(e.clientHeight-32-16*(A-1))/A;D(`${Math.max(t,200)}px`)};t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[A]);let B=(0,s.useCallback)((e,t)=>{e&&(f(e),localStorage.setItem("missions-grid-preset",e),"custom"===e&&t&&(j(t),localStorage.setItem("missions-grid-custom",JSON.stringify(t))))},[]),H=(0,g.useSensors)((0,g.useSensor)(g.PointerSensor,{activationConstraint:{distance:8}})),z=(0,s.useCallback)(e=>{let{active:t,over:s}=e;s&&t.id!==s.id&&x(e=>{let r=e.findIndex(e=>e.executionId===t.id),a=e.findIndex(e=>e.executionId===s.id);return(0,v.arrayMove)(e,r,a)})},[]),V=(0,s.useCallback)((e,t)=>{if(R.current.has(e))return;C(s=>new Map([...s,[e,t]]));let s=setTimeout(()=>{x(t=>t.filter(t=>t.executionId!==e)),C(t=>{let s=new Map(t);return s.delete(e),s}),E.current.delete(e)},500);E.current.set(e,s)},[]);(0,s.useEffect)(()=>{let e=setInterval(async()=>{try{let e=await i();x(t=>{let s=R.current,{merged:r,goneIds:a}=function({prev:e,fresh:t,removingIds:s}){let r=new Set(t.map(e=>e.executionId)),a=[];e.forEach(e=>{r.has(e.executionId)||s.has(e.executionId)||a.push(e.executionId)});let i=e.filter(e=>r.has(e.executionId)||s.has(e.executionId)),n=new Set(e.map(e=>e.executionId));return{merged:[...i,...t.filter(e=>!n.has(e.executionId))],goneIds:a}}({prev:t,fresh:e,removingIds:new Set(s.keys())});return a.forEach(e=>V(e,"completed")),r})}catch{}},4e3);return()=>clearInterval(e)},[V]),(0,s.useEffect)(()=>{let e=E.current;return()=>{e.forEach(e=>clearTimeout(e))}},[]);let U=(0,s.useCallback)(async e=>{try{await (0,n.stopPtyExecution)(e),x(t=>{let s=t.find(t=>t.taskId===e);return s&&V(s.executionId,"stopped"),t})}catch{T.toast.error(a("missions.error.stopFailed"))}},[V,a]),F=(0,s.useCallback)((e,t)=>{x(t=>{let s=t.find(t=>t.taskId===e);return s&&V(s.executionId,"completed"),t})},[V]),W=(0,s.useCallback)(e=>{i().then(e=>{x(t=>{let s=new Set(t.map(e=>e.executionId));return[...t,...e.filter(e=>!s.has(e.executionId))]})}).catch(()=>{})},[]),G=Array.from(new Map(u.map(e=>[e.workspaceId,e.workspaceName])).entries()).map(([e,t])=>({id:e,name:t})),q=k?u.filter(e=>e.workspaceId===k):u,J=new Set(u.map(e=>e.taskId));return(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"header-sm shrink-0 px-4 flex items-center gap-3",children:[(0,t.jsx)("h1",{className:"text-base font-semibold",children:a("missions.pageTitle")}),(0,t.jsxs)(o.Select,{value:k,onValueChange:e=>N(e??""),children:[(0,t.jsx)(o.SelectTrigger,{className:"w-36 h-8",children:(0,t.jsx)("span",{className:"truncate",children:k?G.find(e=>e.id===k)?.name??a("missions.filterAll"):a("missions.filterAll")})}),(0,t.jsxs)(o.SelectContent,{children:[(0,t.jsx)(o.SelectItem,{value:"",children:a("missions.filterAll")}),G.map(e=>(0,t.jsx)(o.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsx)(p,{value:h,customValue:b,onChange:B}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(c.Button,{ref:S,onClick:()=>y(e=>!e),children:a("missions.launchTask")}),(0,t.jsx)(_,{open:w,onOpenChange:y,onLaunched:W,runningTaskIds:J,anchorRef:S})]})]}),(0,t.jsx)("div",{ref:O,className:"flex-1 overflow-auto min-h-0 p-4",children:0===q.length&&0===I.size?(0,t.jsx)(d.EmptyState,{icon:m,title:a("missions.emptyTitle"),description:a("missions.emptyDesc"),className:"h-full",action:(0,t.jsx)(c.Button,{onClick:()=>y(!0),children:a("missions.launchTask")})}):(0,t.jsx)(g.DndContext,{id:"missions-dnd",sensors:H,collisionDetection:g.closestCenter,onDragEnd:z,children:(0,t.jsx)(v.SortableContext,{items:q.map(e=>e.executionId),strategy:v.rectSortingStrategy,children:(0,t.jsx)("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${P}, 1fr)`,gridAutoRows:$},children:q.map(e=>(0,t.jsx)(M,{execution:e,isRemoving:I.has(e.executionId),removeReason:I.get(e.executionId),onStop:U,onSessionEnd:F},e.executionId))})})})})]})}],877938)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,330092,e=>{"use strict";var t=e.i(543485);let s=(0,t.createServerReference)("4076c6a97cc508bca550a0436e846fd61b54c1d6d8",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,s])},726111,e=>{"use strict";var t=e.i(432377),s=e.i(937756);e.s(["EmptyState",0,function({icon:e,title:r,description:a,action:i,className:n}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",n),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:r}),a&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:a}),i&&(0,t.jsx)("div",{className:"mt-2",children:i})]})}])},203529,e=>{"use strict";var t=e.i(337590),s=e.i(793988),r=e.i(164688),a=e.i(937756);let i=(0,r.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r="default",render:n,...l}){var o;return o={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,a.cn)(i({variant:r}),e)},l),render:n,state:{slot:"badge",variant:r}},(0,s.useRenderElement)(o.defaultTagName??"div",o,o)}],203529)},520444,e=>{"use strict";var t=e.i(543485);let s=(0,t.createServerReference)("40a647acdd2e46f1d20023385b48729907d6fe2887",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,s])},885121,e=>{"use strict";var t=e.i(543485);let s=(0,t.createServerReference)("78312646a8f7042ca8f29d708f48116d41bfb2306e",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,s])},271277,351101,e=>{"use strict";var t=e.i(543485);let s=(0,t.createServerReference)("6036b9e4fc9edfdd691292f2f6aab94b838e535ef5",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,s],271277);let r=(0,e.i(863961).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,r],351101)},403975,e=>{"use strict";var t=e.i(543485);let s=(0,t.createServerReference)("408893e70b6aa2c0f63a9e5ad8957e7ecac34cb742",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,s])},877938,e=>{"use strict";var t=e.i(432377),s=e.i(85212),r=e.i(625054),a=e.i(543485);let i=(0,a.createServerReference)("009071c5a825fbf14a6e4b68ead4943a00e803d1c8",a.callServer,void 0,a.findSourceMapURL,"getActiveExecutionsAcrossWorkspaces");var n=e.i(520444);let l=[{id:"1x1",label:"1×1",cols:1,rows:1,minHeight:"480px",desc:"Focus mode"},{id:"2x1",label:"2×1",cols:2,rows:1,minHeight:"480px",desc:"Side by side"},{id:"3x2",label:"3×2",cols:3,rows:2,minHeight:"300px",desc:"Default"},{id:"2x2",label:"2×2",cols:2,rows:2,minHeight:"300px",desc:"Balanced"},{id:"4x2",label:"4×2",cols:4,rows:2,minHeight:"240px",desc:"Wide monitor"},{id:"3x3",label:"3×3",cols:3,rows:3,minHeight:"240px",desc:"Max overview"}];var o=e.i(610874),c=e.i(711296),d=e.i(726111),u=e.i(863961);let m=(0,u.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);var x=e.i(330092);function h({cols:e,rows:s,active:r}){let a=Array.from({length:e*s});return(0,t.jsx)("div",{className:`grid gap-[1px] w-7 h-5 p-[3px] rounded-sm border shrink-0 ${r?"border-primary bg-primary/10":"border-border bg-muted"}`,style:{gridTemplateColumns:`repeat(${e}, 1fr)`,gridTemplateRows:`repeat(${s}, 1fr)`},children:a.map((e,s)=>(0,t.jsx)("div",{className:`rounded-[1px] min-w-0 min-h-0 ${r?"bg-primary":"bg-muted-foreground/40"}`},s))})}let p="custom";function f({value:e,customValue:a,onChange:i}){let{t:n}=(0,r.useI18n)(),[o,d]=(0,s.useState)(!1),u=(0,s.useRef)(null),m=e===p,g=m?null:l.find(t=>t.id===e)??l[2],[v,b]=(0,s.useState)(a?.cols??2),[j,w]=(0,s.useState)(a?.rows??2),[y,k]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5});(0,s.useEffect)(()=>{(0,x.getConfigValues)(["missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{k({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{a&&(b(a.cols),w(a.rows))},[a?.cols,a?.rows]),(0,s.useEffect)(()=>{if(o)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){u.current&&!u.current.contains(e.target)&&d(!1)}},[o]);let N=(e,t,s)=>Math.max(t,Math.min(s,e)),S=m?v:g?.cols??2,I=m?j:g?.rows??2,C=m?`${v}\xd7${j}`:g?.label??"";return(0,t.jsxs)("div",{ref:u,className:"relative",children:[(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>d(e=>!e),className:"gap-2",children:[(0,t.jsx)(h,{cols:S,rows:I,active:!1}),(0,t.jsx)("span",{children:C}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"▼"})]}),o&&(0,t.jsxs)("div",{className:"absolute right-0 z-50 mt-1 w-72 rounded-lg border border-border bg-popover shadow-xl p-3",children:[(0,t.jsx)("h5",{className:"text-sm font-semibold text-foreground mb-3",children:n("missions.gridPreset")}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[l.map(s=>{let r=s.id===e;return(0,t.jsxs)("button",{onClick:()=>{i(s.id),d(!1)},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors ${r?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(h,{cols:s.cols,rows:s.rows,active:r}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${r?"text-primary":"text-foreground"}`,children:s.label}),(0,t.jsx)("span",{className:`text-xs ${r?"text-primary/60":"text-muted-foreground"}`,children:s.desc})]},s.id)}),(0,t.jsxs)("div",{className:"mt-1 border-t border-border pt-2",children:[(0,t.jsxs)("button",{onClick:()=>{m||i(p,{cols:v,rows:j})},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors w-full ${m?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(h,{cols:v,rows:j,active:m}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${m?"text-primary":"text-foreground"}`,children:n("missions.gridCustom")}),(0,t.jsxs)("span",{className:`text-xs ${m?"text-primary/60":"text-muted-foreground"}`,children:[v,"×",j]})]}),m&&(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:n("missions.gridCols")}),(0,t.jsx)("input",{type:"number",min:y.minCols,max:y.maxCols,value:v,onChange:e=>{let t;b(t=N(Number(e.target.value),y.minCols,y.maxCols)),i(p,{cols:t,rows:j})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"×"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:n("missions.gridRows")}),(0,t.jsx)("input",{type:"number",min:y.minRows,max:y.maxRows,value:j,onChange:e=>{let t;w(t=N(Number(e.target.value),y.minRows,y.maxRows)),i(p,{cols:v,rows:t})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]})]})]})]})]})]})}var g=e.i(139302),v=e.i(254059),b=e.i(415411),j=e.i(309542),w=e.i(280121);let y=(0,u.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),k=(0,u.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var N=e.i(996032);let S=(0,u.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var I=e.i(11915),C=e.i(203529),R=e.i(403975),T=e.i(286302);let E=(0,b.default)(()=>e.A(172854).then(e=>e.TaskTerminal),{loadableGenerated:{modules:[467005]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"h-full w-full bg-[#0a0a0a] animate-pulse"})});function M({execution:e,isRemoving:a,removeReason:i,onStop:n,onSessionEnd:l}){let{t:o}=(0,r.useI18n)(),d=(0,j.useRouter)(),{attributes:u,listeners:m,setNodeRef:x,transform:h,transition:p}=(0,v.useSortable)({id:e.executionId}),f={transform:w.CSS.Transform.toString(h),transition:p,opacity:+!a},[g,b]=(0,s.useState)(()=>e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0);(0,s.useEffect)(()=>{if(a)return;let t=setInterval(()=>{b(e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0)},1e3);return()=>clearInterval(t)},[e.startedAt,a]);let L=Math.floor(g/60),P=`${L}m ${g%60}s`;async function A(){if(e.projectLocalPath)try{await (0,R.openInTerminal)(e.projectLocalPath)}catch{T.toast.error(o("preview.terminalError"))}}return(0,t.jsxs)("div",{ref:x,style:f,className:"border border-border rounded-lg overflow-hidden flex flex-col transition-opacity duration-300",...u,children:[(0,t.jsxs)("div",{className:"h-10 px-3 flex items-center gap-1 border-b border-border bg-card shrink-0",children:[(0,t.jsx)("button",{...m,"aria-label":o("missions.dragHandle"),"aria-roledescription":"sortable",className:"cursor-grab text-muted-foreground hover:text-foreground mr-1",children:(0,t.jsx)(y,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground truncate flex-1",children:[e.workspaceName," ›"," ",e.projectAlias||e.projectName," ›"," ",(0,t.jsx)("span",{className:"text-foreground font-semibold",children:e.taskTitle})]}),a?(0,t.jsx)(C.Badge,{variant:"outline",className:"text-[11px] text-muted-foreground bg-muted ml-1 shrink-0",children:"stopped"===i?o("missions.statusStopped"):o("missions.statusCompleted")}):(0,t.jsx)(C.Badge,{variant:"outline",className:"text-[11px] text-primary border-primary/30 bg-primary/10 ml-1 shrink-0",children:o("missions.statusRunning")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground ml-1 shrink-0",children:P}),e.projectLocalPath&&(0,t.jsxs)(I.Tooltip,{children:[(0,t.jsx)(I.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:A}),children:(0,t.jsx)(S,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(I.TooltipContent,{children:o("missions.openInTerminal")})]}),(0,t.jsxs)(I.Tooltip,{children:[(0,t.jsx)(I.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:()=>d.push(`/workspaces/${e.workspaceId}/tasks/${e.taskId}`)}),children:(0,t.jsx)(k,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(I.TooltipContent,{children:o("missions.openFullView")})]}),(0,t.jsxs)(I.Tooltip,{children:[(0,t.jsx)(I.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"destructive",size:"icon",className:"ml-1 shrink-0",onClick:()=>n(e.taskId),disabled:a}),children:(0,t.jsx)(N.X,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(I.TooltipContent,{children:o("missions.stopTask")})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,t.jsx)(E,{taskId:e.taskId,worktreePath:e.worktreePath??e.projectLocalPath,onSessionEnd:t=>l?.(e.taskId,t),useCanvasRenderer:!0})})]})}let L=(0,a.createServerReference)("40f256c6b3398ca41cb34fd000213fefa60d75e767",a.callServer,void 0,a.findSourceMapURL,"getWorkspacesWithRecentTasks"),P=(0,a.createServerReference)("40261d942dbaaffdbe2427efd3209155c635e6506a",a.callServer,void 0,a.findSourceMapURL,"getProjectTasks");var A=e.i(885121),O=e.i(271277),$=e.i(718837);let D=(0,u.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var B=e.i(351101),H=e.i(142124);let z={TODO:"TODO",IN_PROGRESS:"Running",IN_REVIEW:"Review"},V={LOW:"Low",MEDIUM:"Med",HIGH:"High",CRITICAL:"Crit"};function U({status:e}){return(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${{TODO:"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",IN_PROGRESS:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",IN_REVIEW:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400"}[e]??"bg-slate-100 text-slate-600"}`,children:z[e]??e})}function F({task:e,isRunning:s,launchingId:r,onLaunchNew:a,onResume:i,t:n}){let l=e.executions?.[0]?.sessionId,o=r===e.id;return(0,t.jsxs)("div",{className:"group/task flex items-center gap-2 px-3 py-1.5 hover:bg-accent/50 cursor-default",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:`text-sm truncate ${s?"italic text-muted-foreground":""}`,children:e.title}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,t.jsx)(U,{status:e.status}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:V[e.priority]??e.priority})]})]}),s?(0,t.jsx)("span",{className:"text-[10px] italic text-muted-foreground shrink-0",children:n("missions.alreadyMonitored")}):(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/task:opacity-100 transition-opacity shrink-0",children:[l&&(0,t.jsxs)(c.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>i(e.id,l),disabled:o,title:n("missions.continueSession"),children:[(0,t.jsx)(B.RotateCcw,{className:"h-3 w-3 mr-1"}),n("missions.continueLabel")]}),(0,t.jsxs)(c.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>a(e.id),disabled:o,title:n("missions.launchNew"),children:[(0,t.jsx)(D,{className:"h-3 w-3 mr-1"}),o?"...":n("missions.launchNewLabel")]})]})]})}function W({open:e,onOpenChange:a,onLaunchNew:i,onResume:n,runningTaskIds:l,launchingId:c}){let{t:d}=(0,r.useI18n)(),[u,m]=(0,s.useState)([]),[x,h]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[g,v]=(0,s.useState)([]);(0,s.useEffect)(()=>{e&&(h(""),f(""),v([]),L(100).then(m).catch(()=>T.toast.error(d("missions.error.launchFailed"))))},[e,d]),(0,s.useEffect)(()=>{p?P(p).then(e=>{v(e.filter(e=>"TODO"===e.status||"IN_PROGRESS"===e.status||"IN_REVIEW"===e.status))}).catch(()=>T.toast.error(d("missions.error.launchFailed"))):v([])},[p,d]);let b=u.find(e=>e.id===x),j=b?.projects??[];return(0,t.jsx)($.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)($.DialogContent,{className:"max-w-lg max-h-[70vh] flex flex-col",children:[(0,t.jsx)($.DialogHeader,{children:(0,t.jsx)($.DialogTitle,{children:d("missions.fullPickerTitle")})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,t.jsxs)(o.Select,{value:x,onValueChange:e=>{h(e??""),f("")},children:[(0,t.jsx)(o.SelectTrigger,{id:"full-picker-ws",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:u.find(e=>e.id===x)?.name??d("missions.launcher.selectWorkspace")})}),(0,t.jsx)(o.SelectContent,{children:u.map(e=>(0,t.jsx)(o.SelectItem,{value:e.id,children:e.name},e.id))})]}),(0,t.jsxs)(o.Select,{value:p,onValueChange:e=>f(e??""),disabled:!x,children:[(0,t.jsx)(o.SelectTrigger,{id:"full-picker-proj",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:j.find(e=>e.id===p)?.name??d("missions.launcher.selectProject")})}),(0,t.jsx)(o.SelectContent,{children:j.map(e=>(0,t.jsx)(o.SelectItem,{value:e.id,children:e.alias??e.name},e.id))})]})]}),(0,t.jsx)(H.ScrollArea,{className:"flex-1 min-h-0 -mx-2",children:0===g.length&&p?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.launcher.noTasks")}):0===g.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.fullPickerHint")}):g.map(e=>(0,t.jsx)(F,{task:e,isRunning:l.has(e.id),launchingId:c,onLaunchNew:i,onResume:n,t:d},e.id))})]})})}function _({open:e,onOpenChange:a,onLaunched:i,runningTaskIds:n=new Set,anchorRef:l}){let{t:o}=(0,r.useI18n)(),d=(0,s.useRef)(null),[u,m]=(0,s.useState)([]),[x,h]=(0,s.useState)(!1),[p,f]=(0,s.useState)(null),[g,v]=(0,s.useState)(!1);(0,s.useEffect)(()=>{e&&(h(!0),L(3).then(m).catch(()=>T.toast.error(o("missions.error.launchFailed"))).finally(()=>h(!1)))},[e,o]),(0,s.useEffect)(()=>{if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t);function t(e){let t=e.target;if(d.current&&!d.current.contains(t)){if(l?.current&&l.current.contains(t))return;a(!1)}}},[e,a,l]);let b=(0,s.useCallback)(async e=>{try{f(e),await (0,A.startPtyExecution)(e,""),i(e),a(!1),v(!1)}catch{T.toast.error(o("missions.error.launchFailed"))}finally{f(null)}},[i,a,o]),j=(0,s.useCallback)(async(e,t)=>{try{f(e),await (0,O.resumePtyExecution)(e,t),i(e),a(!1),v(!1)}catch{T.toast.error(o("missions.error.launchFailed"))}finally{f(null)}},[i,a,o]),w=(0,s.useCallback)(()=>{a(!1),v(!0)},[a]);return e||g?(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsxs)("div",{ref:d,className:"absolute right-0 z-50 mt-1 w-96 rounded-lg border border-border bg-popover shadow-xl flex flex-col overflow-hidden",style:{maxHeight:"480px"},children:[(0,t.jsx)("div",{className:"px-3 py-2 border-b border-border shrink-0",children:(0,t.jsx)("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:o("missions.pickerTitle")})}),(0,t.jsx)(H.ScrollArea,{className:"flex-1 min-h-0",children:x?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}):0===u.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("missions.noAvailableTasks")}):u.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"sticky top-0 z-10 px-3 py-1.5 bg-popover border-b border-border/50",children:(0,t.jsx)("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:e.name})}),e.projects.map(e=>0===e._count.tasks?null:(0,t.jsxs)("div",{className:"mb-1",children:[(0,t.jsx)("div",{className:"px-3 pt-2 pb-0.5",children:(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:e.alias??e.name})}),e.tasks.map(e=>(0,t.jsx)(F,{task:e,isRunning:n.has(e.id),launchingId:p,onLaunchNew:b,onResume:j,t:o},e.id))]},e.id))]},e.id))}),(0,t.jsx)("div",{className:"shrink-0 border-t border-border",children:(0,t.jsx)(c.Button,{variant:"ghost",className:"w-full rounded-none text-xs text-primary font-medium",onClick:w,children:o("missions.showMoreTasks")})})]}),(0,t.jsx)(W,{open:g,onOpenChange:v,onLaunchNew:b,onResume:j,runningTaskIds:n,launchingId:p})]}):null}e.s(["MissionsClient",0,function({initialExecutions:e}){let{t:a}=(0,r.useI18n)(),[u,x]=(0,s.useState)(e),[h,p]=(0,s.useState)(()=>localStorage.getItem("missions-grid-preset")??"3x2"),[b,j]=(0,s.useState)(()=>{try{let e=localStorage.getItem("missions-grid-custom");if(e){let t=JSON.parse(e);if("number"==typeof t?.cols&&"number"==typeof t?.rows)return{cols:Math.max(1,Math.min(10,t.cols)),rows:Math.max(1,Math.min(10,t.rows))}}}catch{}return{cols:2,rows:2}}),[w,y]=(0,s.useState)(!1),[k,N]=(0,s.useState)(""),S=(0,s.useRef)(null),[I,C]=(0,s.useState)(new Map),R=(0,s.useRef)(I);(0,s.useEffect)(()=>{R.current=I},[I]);let E=(0,s.useRef)(new Map),L=l.find(e=>e.id===h)??l[2],P="custom"===h?b.cols:L.cols,A="custom"===h?b.rows:L.rows,O=(0,s.useRef)(null),[$,D]=(0,s.useState)("480px");(0,s.useEffect)(()=>{let e=O.current;if(!e)return;let t=()=>{let t=(e.clientHeight-32-16*(A-1))/A;D(`${Math.max(t,200)}px`)};t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[A]);let B=(0,s.useCallback)((e,t)=>{e&&(p(e),localStorage.setItem("missions-grid-preset",e),"custom"===e&&t&&(j(t),localStorage.setItem("missions-grid-custom",JSON.stringify(t))))},[]),H=(0,g.useSensors)((0,g.useSensor)(g.PointerSensor,{activationConstraint:{distance:8}})),z=(0,s.useCallback)(e=>{let{active:t,over:s}=e;s&&t.id!==s.id&&x(e=>{let r=e.findIndex(e=>e.executionId===t.id),a=e.findIndex(e=>e.executionId===s.id);return(0,v.arrayMove)(e,r,a)})},[]),V=(0,s.useCallback)((e,t)=>{if(R.current.has(e))return;C(s=>new Map([...s,[e,t]]));let s=setTimeout(()=>{x(t=>t.filter(t=>t.executionId!==e)),C(t=>{let s=new Map(t);return s.delete(e),s}),E.current.delete(e)},500);E.current.set(e,s)},[]);(0,s.useEffect)(()=>{let e=setInterval(async()=>{try{let e=await i();x(t=>{let s=R.current,{merged:r,goneIds:a}=function({prev:e,fresh:t,removingIds:s}){let r=new Set(t.map(e=>e.executionId)),a=[];e.forEach(e=>{r.has(e.executionId)||s.has(e.executionId)||a.push(e.executionId)});let i=e.filter(e=>r.has(e.executionId)||s.has(e.executionId)),n=new Set(e.map(e=>e.executionId));return{merged:[...i,...t.filter(e=>!n.has(e.executionId))],goneIds:a}}({prev:t,fresh:e,removingIds:new Set(s.keys())});return a.forEach(e=>V(e,"completed")),r})}catch{}},4e3);return()=>clearInterval(e)},[V]),(0,s.useEffect)(()=>{let e=E.current;return()=>{e.forEach(e=>clearTimeout(e))}},[]);let U=(0,s.useCallback)(async e=>{try{await (0,n.stopPtyExecution)(e),x(t=>{let s=t.find(t=>t.taskId===e);return s&&V(s.executionId,"stopped"),t})}catch{T.toast.error(a("missions.error.stopFailed"))}},[V,a]),F=(0,s.useCallback)((e,t)=>{x(t=>{let s=t.find(t=>t.taskId===e);return s&&V(s.executionId,"completed"),t})},[V]),W=(0,s.useCallback)(e=>{i().then(e=>{x(t=>{let s=new Set(t.map(e=>e.executionId));return[...t,...e.filter(e=>!s.has(e.executionId))]})}).catch(()=>{})},[]),G=Array.from(new Map(u.map(e=>[e.workspaceId,e.workspaceName])).entries()).map(([e,t])=>({id:e,name:t})),q=k?u.filter(e=>e.workspaceId===k):u,J=new Set(u.map(e=>e.taskId));return(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"header-sm shrink-0 px-4 flex items-center gap-3",children:[(0,t.jsx)("h1",{className:"text-base font-semibold",children:a("missions.pageTitle")}),(0,t.jsxs)(o.Select,{value:k,onValueChange:e=>N(e??""),children:[(0,t.jsx)(o.SelectTrigger,{className:"w-36 h-8",children:(0,t.jsx)("span",{className:"truncate",children:k?G.find(e=>e.id===k)?.name??a("missions.filterAll"):a("missions.filterAll")})}),(0,t.jsxs)(o.SelectContent,{children:[(0,t.jsx)(o.SelectItem,{value:"",children:a("missions.filterAll")}),G.map(e=>(0,t.jsx)(o.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsx)(f,{value:h,customValue:b,onChange:B}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(c.Button,{ref:S,onClick:()=>y(e=>!e),children:a("missions.launchTask")}),(0,t.jsx)(_,{open:w,onOpenChange:y,onLaunched:W,runningTaskIds:J,anchorRef:S})]})]}),(0,t.jsx)("div",{ref:O,className:"flex-1 overflow-auto min-h-0 p-4",children:0===q.length&&0===I.size?(0,t.jsx)(d.EmptyState,{icon:m,title:a("missions.emptyTitle"),description:a("missions.emptyDesc"),className:"h-full",action:(0,t.jsx)(c.Button,{onClick:()=>y(!0),children:a("missions.launchTask")})}):(0,t.jsx)(g.DndContext,{id:"missions-dnd",sensors:H,collisionDetection:g.closestCenter,onDragEnd:z,children:(0,t.jsx)(v.SortableContext,{items:q.map(e=>e.executionId),strategy:v.rectSortingStrategy,children:(0,t.jsx)("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${P}, 1fr)`,gridAutoRows:$},children:q.map(e=>(0,t.jsx)(M,{execution:e,isRemoving:I.has(e.executionId),removeReason:I.get(e.executionId),onStop:U,onSessionEnd:F},e.executionId))})})})})]})}],877938)}]);