tower-studio 0.1.15 → 0.1.16

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 (207) 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 +95 -95
  7. package/.next/fallback-build-manifest.json +3 -3
  8. package/.next/prerender-manifest.json +3 -3
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
  17. package/.next/server/app/_not-found/page/server-reference-manifest.json +25 -25
  18. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  19. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/_not-found.html +1 -1
  21. package/.next/server/app/_not-found.rsc +14 -14
  22. package/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  23. package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  24. package/.next/server/app/_not-found.segments/_index.segment.rsc +9 -9
  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 +2 -2
  28. package/.next/server/app/api/internal/assistant/route.js +1 -1
  29. package/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
  30. package/.next/server/app/api/internal/terminal/[taskId]/start/route.js +2 -2
  31. package/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  32. package/.next/server/app/index.html +1 -1
  33. package/.next/server/app/index.rsc +14 -14
  34. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  35. package/.next/server/app/index.segments/_full.segment.rsc +14 -14
  36. package/.next/server/app/index.segments/_head.segment.rsc +4 -4
  37. package/.next/server/app/index.segments/_index.segment.rsc +9 -9
  38. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  39. package/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  40. package/.next/server/app/missions/page/server-reference-manifest.json +55 -55
  41. package/.next/server/app/missions/page.js +1 -1
  42. package/.next/server/app/missions/page.js.nft.json +1 -1
  43. package/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  44. package/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  45. package/.next/server/app/onboarding/page/server-reference-manifest.json +25 -25
  46. package/.next/server/app/onboarding/page.js.nft.json +1 -1
  47. package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/onboarding.html +1 -1
  49. package/.next/server/app/onboarding.rsc +16 -16
  50. package/.next/server/app/onboarding.segments/_full.segment.rsc +16 -16
  51. package/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
  52. package/.next/server/app/onboarding.segments/_index.segment.rsc +9 -9
  53. package/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
  54. package/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  55. package/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
  56. package/.next/server/app/page/react-loadable-manifest.json +1 -1
  57. package/.next/server/app/page/server-reference-manifest.json +25 -25
  58. package/.next/server/app/page.js.nft.json +1 -1
  59. package/.next/server/app/page_client-reference-manifest.js +1 -1
  60. package/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  61. package/.next/server/app/settings/page/server-reference-manifest.json +58 -82
  62. package/.next/server/app/settings/page.js +1 -1
  63. package/.next/server/app/settings/page.js.nft.json +1 -1
  64. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  65. package/.next/server/app/settings.html +1 -1
  66. package/.next/server/app/settings.rsc +16 -16
  67. package/.next/server/app/settings.segments/_full.segment.rsc +16 -16
  68. package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  69. package/.next/server/app/settings.segments/_index.segment.rsc +9 -9
  70. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  71. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  72. package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  73. package/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  74. package/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +81 -81
  75. package/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  76. package/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  77. package/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  78. package/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +72 -72
  79. package/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  80. package/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  81. package/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  82. package/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +59 -59
  83. package/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  84. package/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  85. package/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  86. package/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +53 -53
  87. package/.next/server/app/workspaces/[workspaceId]/page.js +1 -1
  88. package/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  89. package/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  90. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  91. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +25 -25
  92. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  93. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  94. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +1 -1
  95. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +58 -58
  96. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +2 -2
  97. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  98. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  99. package/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  100. package/.next/server/app/workspaces/page/server-reference-manifest.json +43 -43
  101. package/.next/server/app/workspaces/page.js.nft.json +1 -1
  102. package/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  103. package/.next/server/chunks/0uz~_next_dist_esm_build_templates_app-route_05yec2y.js +2 -2
  104. package/.next/server/chunks/[root-of-the-server]__00~8_qz._.js +4 -0
  105. package/.next/server/chunks/[root-of-the-server]__05mc_xk._.js +1 -1
  106. package/.next/server/chunks/[root-of-the-server]__0p5iuez._.js +2 -2
  107. package/.next/server/chunks/[root-of-the-server]__0rb-ear._.js +4 -0
  108. package/.next/server/chunks/project_f_tower_0n1s3ym._.js +1 -1
  109. package/.next/server/chunks/project_f_tower_src_11e.cv5._.js +1 -1
  110. package/.next/server/chunks/ssr/04uy_src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_01.s1p0._.js +1 -1
  111. package/.next/server/chunks/ssr/0y0r_f_tower_src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0n4g3bn._.js +1 -1
  112. package/.next/server/chunks/ssr/[root-of-the-server]__00.lowc._.js +1 -1
  113. package/.next/server/chunks/ssr/[root-of-the-server]__007tg36._.js +1 -1
  114. package/.next/server/chunks/ssr/[root-of-the-server]__025.0xa._.js +1 -1
  115. package/.next/server/chunks/ssr/[root-of-the-server]__04u4kb4._.js +1 -1
  116. package/.next/server/chunks/ssr/[root-of-the-server]__05a17ca._.js +1 -1
  117. package/.next/server/chunks/ssr/[root-of-the-server]__06qzctf._.js +1 -1
  118. package/.next/server/chunks/ssr/{[root-of-the-server]__0wkjslq._.js → [root-of-the-server]__08-2pn1._.js} +1 -1
  119. package/.next/server/chunks/ssr/[root-of-the-server]__0_47k-j._.js +3 -0
  120. package/.next/server/chunks/ssr/[root-of-the-server]__0aidehy._.js +3 -0
  121. package/.next/server/chunks/ssr/[root-of-the-server]__0bqzhpe._.js +3 -0
  122. package/.next/server/chunks/ssr/[root-of-the-server]__0ex911v._.js +30 -0
  123. package/.next/server/chunks/ssr/[root-of-the-server]__0ffdrwp._.js +1 -1
  124. package/.next/server/chunks/ssr/{[root-of-the-server]__0fb0m0v._.js → [root-of-the-server]__0h38s6n._.js} +2 -2
  125. package/.next/server/chunks/ssr/[root-of-the-server]__0h8nl.m._.js +3 -0
  126. package/.next/server/chunks/ssr/[root-of-the-server]__0i4rk9v._.js +3 -3
  127. package/.next/server/chunks/ssr/[root-of-the-server]__0r6gkos._.js +1 -1
  128. package/.next/server/chunks/ssr/[root-of-the-server]__0u26l~e._.js +1 -1
  129. package/.next/server/chunks/ssr/[root-of-the-server]__0uca1bc._.js +1 -1
  130. package/.next/server/chunks/ssr/[root-of-the-server]__0w7gbe7._.js +1 -1
  131. package/.next/server/chunks/ssr/[root-of-the-server]__0xe-o3g._.js +1 -1
  132. package/.next/server/chunks/ssr/[root-of-the-server]__0zaw-fl._.js +3 -0
  133. package/.next/server/chunks/ssr/[root-of-the-server]__13eo85g._.js +1 -1
  134. package/.next/server/chunks/ssr/[root-of-the-server]__13x5mmo._.js +1 -1
  135. package/.next/server/chunks/ssr/project_f_tower_0.txwd8._.js +1 -1
  136. package/.next/server/chunks/ssr/project_f_tower_047pa2s._.js +3 -0
  137. package/.next/server/chunks/ssr/project_f_tower_0f0-wva._.js +1 -1
  138. package/.next/server/chunks/ssr/project_f_tower_0hgtev9._.js +1 -1
  139. package/.next/server/chunks/ssr/{project_f_tower_0qepwa~._.js → project_f_tower_0i96rjz._.js} +2 -2
  140. package/.next/server/chunks/ssr/project_f_tower_0ivvjwd._.js +1 -1
  141. package/.next/server/chunks/ssr/{project_f_tower_0ntkd-l._.js → project_f_tower_0jhlcus._.js} +2 -2
  142. package/.next/server/chunks/ssr/project_f_tower_0jy~1uf._.js +1 -1
  143. package/.next/server/chunks/ssr/project_f_tower_0l6ssf8._.js +1 -1
  144. package/.next/server/chunks/ssr/project_f_tower_0o5.y1e._.js +1 -1
  145. package/.next/server/chunks/ssr/project_f_tower_0ps2~v1._.js +3 -0
  146. package/.next/server/chunks/ssr/project_f_tower_0ssr2sl._.js +3 -0
  147. package/.next/server/chunks/ssr/{project_f_tower_0u8bo7w._.js → project_f_tower_0tlnklr._.js} +2 -2
  148. package/.next/server/chunks/ssr/project_f_tower_0w01kgd._.js +3 -0
  149. package/.next/server/chunks/ssr/project_f_tower_0ym-aea._.js +1 -1
  150. package/.next/server/chunks/ssr/project_f_tower_12oax__._.js +3 -0
  151. package/.next/server/chunks/ssr/project_f_tower_src_10.nkh7._.js +3 -0
  152. package/.next/server/chunks/ssr/project_f_tower_src_actions_agent-actions_ts_0.s4~m-._.js +2 -2
  153. package/.next/server/chunks/ssr/project_f_tower_src_actions_file-actions_ts_02i742t._.js +1 -1
  154. package/.next/server/chunks/ssr/project_f_tower_src_app_missions_missions-client_tsx_0ums4qx._.js +1 -1
  155. package/.next/server/chunks/ssr/project_f_tower_src_app_onboarding_page_tsx_0_9_yoq._.js +1 -1
  156. package/.next/server/chunks/ssr/project_f_tower_src_app_settings_page_tsx_0oo06~d._.js +1 -1
  157. package/.next/server/chunks/ssr/project_f_tower_src_app_workspaces_[workspaceId]_board-page-client_tsx_0jmj1xz._.js +1 -1
  158. package/.next/server/chunks/ssr/{project_f_tower_0u6dr5n._.js → project_f_tower_src_components_ui_input_tsx_02yu4ri._.js} +2 -2
  159. package/.next/server/middleware-build-manifest.js +3 -3
  160. package/.next/server/pages/404.html +1 -1
  161. package/.next/server/pages/500.html +1 -1
  162. package/.next/server/server-reference-manifest.js +1 -1
  163. package/.next/server/server-reference-manifest.json +253 -277
  164. package/.next/static/chunks/{0n3o6vvrc4ks4.js → 06~5p79536pfs.js} +1 -1
  165. package/.next/static/chunks/{0-ggl6l3h5syr.js → 076vhlm6g1m9n.js} +1 -1
  166. package/.next/static/chunks/{0_-rw81.wbmu..js → 08x0olwzpsczv.js} +2 -2
  167. package/.next/static/chunks/0amzt~927k5f5.js +1 -0
  168. package/.next/static/chunks/{0gpckquc5j5cx.js → 0gwxdr2ihtu8z.js} +1 -1
  169. package/.next/static/chunks/{0qz_w~ilkw07_.js → 0jef3e_wsh4mf.js} +1 -1
  170. package/.next/static/chunks/{0jz83jbb6_ldj.js → 0jfknbbi-cjcl.js} +1 -1
  171. package/.next/static/chunks/{0h0m-v8uoeq~u.js → 0l5tqul.pwfze.js} +1 -1
  172. package/.next/static/chunks/0pez9k2q~8lom.js +1 -0
  173. package/.next/static/chunks/0s4zpgzk~au6x.css +1 -0
  174. package/.next/static/chunks/{0qnz9q6uieuv8.js → 0sszltblb5pss.js} +1 -1
  175. package/.next/static/chunks/0uxf3e~tjkjuz.js +1 -0
  176. package/.next/static/chunks/1034h4copyi13.js +1 -0
  177. package/.next/static/chunks/11j_4bpiqb5on.js +1 -0
  178. package/.next/static/chunks/{12x6kubkc37zq.js → 12q1f_9u6eduf.js} +1 -1
  179. package/.next/static/chunks/{09wk17shlbfp6.js → 14xrab1qyw2yw.js} +1 -1
  180. package/.next/static/chunks/{0ynxf.i-o3-xn.js → 181v0f2l.x5_p.js} +1 -1
  181. package/.next/trace +2 -2
  182. package/.next/trace-build +1 -1
  183. package/package.json +1 -1
  184. package/scripts/init-db.ts +0 -17
  185. package/.next/server/chunks/[root-of-the-server]__02~bq0q._.js +0 -4
  186. package/.next/server/chunks/[root-of-the-server]__0~33o~m._.js +0 -4
  187. package/.next/server/chunks/ssr/[root-of-the-server]__0fp7reb._.js +0 -3
  188. package/.next/server/chunks/ssr/[root-of-the-server]__0fwuc5u._.js +0 -3
  189. package/.next/server/chunks/ssr/[root-of-the-server]__0nmyvwk._.js +0 -3
  190. package/.next/server/chunks/ssr/[root-of-the-server]__0y3o4rp._.js +0 -3
  191. package/.next/server/chunks/ssr/[root-of-the-server]__11j4k9o._.js +0 -3
  192. package/.next/server/chunks/ssr/[root-of-the-server]__13cjs8r._.js +0 -3
  193. package/.next/server/chunks/ssr/project_f_tower_04g3~44._.js +0 -30
  194. package/.next/server/chunks/ssr/project_f_tower_06z7x~2._.js +0 -3
  195. package/.next/server/chunks/ssr/project_f_tower_08d6__q._.js +0 -3
  196. package/.next/server/chunks/ssr/project_f_tower_0arf7nr._.js +0 -3
  197. package/.next/server/chunks/ssr/project_f_tower_135-_23._.js +0 -3
  198. package/.next/server/chunks/ssr/project_f_tower_src_0w26c.x._.js +0 -3
  199. package/.next/static/chunks/04pjsuj.mivbh.css +0 -1
  200. package/.next/static/chunks/05_0-v~c00b__.js +0 -1
  201. package/.next/static/chunks/05tpf5j-jft-k.js +0 -1
  202. package/.next/static/chunks/0_vexk9jnxj9q.js +0 -1
  203. package/.next/static/chunks/0nvuuwr.v3r4k.js +0 -1
  204. package/.next/static/chunks/0zio-v5989p.b.js +0 -1
  205. /package/.next/static/{QCWJhjbC4McTn-0CAT1Gx → UuR3rJNr0J0cwFZgsovkL}/_buildManifest.js +0 -0
  206. /package/.next/static/{QCWJhjbC4McTn-0CAT1Gx → UuR3rJNr0J0cwFZgsovkL}/_clientMiddlewareManifest.js +0 -0
  207. /package/.next/static/{QCWJhjbC4McTn-0CAT1Gx → UuR3rJNr0J0cwFZgsovkL}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,504466,306453,e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){var r,a;r=t,a=n[t],(r=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(r))in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e){return function t(){for(var r=this,n=arguments.length,a=Array(n),i=0;i<n;i++)a[i]=arguments[i];return a.length>=e.length?e.apply(this,a):function(){for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(r,[].concat(a,n))}}}function o(e){return({}).toString.call(e).includes("Object")}function c(e){return"function"==typeof e}var l,d,u=s(function(e,t){throw Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),f=function(e,t){return o(t)||u("changeType"),Object.keys(t).some(function(t){return!Object.prototype.hasOwnProperty.call(e,t)})&&u("changeField"),t},m=function(e){c(e)||u("selectorType")},h=function(e){c(e)||o(e)||u("handlerType"),o(e)&&Object.values(e).some(function(e){return!c(e)})&&u("handlersType")},x=function(e){e||u("initialIsRequired"),o(e)||u("initialType"),Object.keys(e).length||u("initialContent")};function g(e,t){return c(t)?t(e.current):t}function p(e,t){return e.current=i(i({},e.current),t),t}function v(e,t,r){return c(t)?t(e.current):Object.keys(r).forEach(function(r){var n;return null==(n=t[r])?void 0:n.call(t,e.current[r])}),r}var b={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},y=(l=function(e,t){throw Error(e[t]||e.default)},function e(){for(var t=this,r=arguments.length,n=Array(r),a=0;a<r;a++)n[a]=arguments[a];return n.length>=l.length?l.apply(this,n):function(){for(var r=arguments.length,a=Array(r),i=0;i<r;i++)a[i]=arguments[i];return e.apply(t,[].concat(n,a))}})(b),j=function(e){return(e||y("configIsRequired"),({}).toString.call(e).includes("Object")||y("configType"),e.urls)?(console.warn(b.deprecation),{paths:{vs:e.urls.monacoBase}}):e},w=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}},N={type:"cancelation",msg:"operation is manually canceled"};function k(e){var t=!1,r=new Promise(function(r,n){e.then(function(e){return t?n(N):r(e)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var S=["monaco"],M=function(e){if(Array.isArray(e))return e}(d=({create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x(e),h(t);var r={current:e},n=s(v)(r,t),a=s(p)(r),i=s(f)(e),o=s(g)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return m(e),e(r.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}})(n,a,i,o)(e)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,n,a,i,s=[],o=!0,c=!1;try{a=(t=t.call(e)).next,!1;for(;!(o=(r=a.call(t)).done)&&(s.push(r.value),2!==s.length);o=!0);}catch(e){c=!0,n=e}finally{try{if(!o&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw n}}return s}}(d)||function(e){if(e){if("string"==typeof e)return t(e,2);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,2):void 0}}(d)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),C=M[0],O=M[1];function R(e){return document.body.appendChild(e)}function E(e){var t,r,n=C(function(e){return{config:e.config,reject:e.reject}}),a=(t="".concat(n.config.paths.vs,"/loader.js"),r=document.createElement("script"),t&&(r.src=t),r);return a.onload=function(){return e()},a.onerror=n.reject,a}function P(){var e=C(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var r=t.m||t;L(r),e.resolve(r)},function(t){e.reject(t)})}function L(e){C().monaco||O({monaco:e})}var T=new Promise(function(e,t){return O({resolve:e,reject:t})}),D={config:function(e){var t=j(e),r=t.monaco,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,S);O(function(e){return{config:function e(t,r){return Object.keys(r).forEach(function(n){r[n]instanceof Object&&t[n]&&Object.assign(r[n],e(t[n],r[n]))}),n(n({},t),r)}(e.config,a),monaco:r}})},init:function(){var e=C(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(O({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),k(T);if(window.monaco&&window.monaco.editor)return L(window.monaco),e.resolve(window.monaco),k(T);w(R,E)(P)}return k(T)},__getMonacoInstance:function(){return C(function(e){return e.monaco})}};e.s(["default",0,D],306453);var A=e.i(85212),I={display:"flex",position:"relative",textAlign:"initial"},U={width:"100%"},F={display:"none"},z={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"},B=function({children:e}){return A.default.createElement("div",{style:z},e)},$=(0,A.memo)(function({width:e,height:t,isEditorReady:r,loading:n,_ref:a,className:i,wrapperProps:s}){return A.default.createElement("section",{style:{...I,width:e,height:t},...s},!r&&A.default.createElement(B,null,n),A.default.createElement("div",{ref:a,style:{...U,...!r&&F},className:i}))}),V=function(e){(0,A.useEffect)(e,[])},q=function(e,t,r=!0){let n=(0,A.useRef)(!0);(0,A.useEffect)(n.current||!r?()=>{n.current=!1}:e,t)};function G(){}function W(e,t,r,n){var a,i,s,o,c,l;return a=e,i=n,a.editor.getModel(_(a,i))||(s=e,o=t,c=r,l=n,s.editor.createModel(o,c,l?_(s,l):void 0))}function _(e,t){return e.Uri.parse(t)}var H=(0,A.memo)(function({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:a,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:o=!1,keepCurrentModifiedModel:c=!1,theme:l="light",loading:d="Loading...",options:u={},height:f="100%",width:m="100%",className:h,wrapperProps:x={},beforeMount:g=G,onMount:p=G}){let[v,b]=(0,A.useState)(!1),[y,j]=(0,A.useState)(!0),w=(0,A.useRef)(null),N=(0,A.useRef)(null),k=(0,A.useRef)(null),S=(0,A.useRef)(p),M=(0,A.useRef)(g),C=(0,A.useRef)(!1);V(()=>{let e=D.init();return e.then(e=>(N.current=e)&&j(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return w.current?(t=w.current?.getModel(),void(o||t?.original?.dispose(),c||t?.modified?.dispose(),w.current?.dispose())):e.cancel()}}),q(()=>{if(w.current&&N.current){let t=w.current.getOriginalEditor(),a=W(N.current,e||"",n||r||"text",i||"");a!==t.getModel()&&t.setModel(a)}},[i],v),q(()=>{if(w.current&&N.current){let e=w.current.getModifiedEditor(),n=W(N.current,t||"",a||r||"text",s||"");n!==e.getModel()&&e.setModel(n)}},[s],v),q(()=>{let e=w.current.getModifiedEditor();e.getOption(N.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),q(()=>{w.current?.getModel()?.original.setValue(e||"")},[e],v),q(()=>{let{original:e,modified:t}=w.current.getModel();N.current.editor.setModelLanguage(e,n||r||"text"),N.current.editor.setModelLanguage(t,a||r||"text")},[r,n,a],v),q(()=>{N.current?.editor.setTheme(l)},[l],v),q(()=>{w.current?.updateOptions(u)},[u],v);let O=(0,A.useCallback)(()=>{if(!N.current)return;M.current(N.current);let o=W(N.current,e||"",n||r||"text",i||""),c=W(N.current,t||"",a||r||"text",s||"");w.current?.setModel({original:o,modified:c})},[r,t,a,e,n,i,s]),R=(0,A.useCallback)(()=>{!C.current&&k.current&&(w.current=N.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...u}),O(),N.current?.editor.setTheme(l),b(!0),C.current=!0)},[u,l,O]);return(0,A.useEffect)(()=>{v&&S.current(w.current,N.current)},[v]),(0,A.useEffect)(()=>{y||v||R()},[y,v,R]),A.default.createElement($,{width:m,height:f,isEditorReady:v,loading:d,_ref:k,className:h,wrapperProps:x})}),J=function(e){let t=(0,A.useRef)();return(0,A.useEffect)(()=>{t.current=e},[e]),t.current},K=new Map,X=(0,A.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:a,path:i,theme:s="light",line:o,loading:c="Loading...",options:l={},overrideServices:d={},saveViewState:u=!0,keepCurrentModel:f=!1,width:m="100%",height:h="100%",className:x,wrapperProps:g={},beforeMount:p=G,onMount:v=G,onChange:b,onValidate:y=G}){let[j,w]=(0,A.useState)(!1),[N,k]=(0,A.useState)(!0),S=(0,A.useRef)(null),M=(0,A.useRef)(null),C=(0,A.useRef)(null),O=(0,A.useRef)(v),R=(0,A.useRef)(p),E=(0,A.useRef)(void 0),P=(0,A.useRef)(n),L=J(i),T=(0,A.useRef)(!1),I=(0,A.useRef)(!1);V(()=>{let e=D.init();return e.then(e=>(S.current=e)&&k(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>M.current?void(E.current?.dispose(),f?u&&K.set(i,M.current.saveViewState()):M.current.getModel()?.dispose(),M.current.dispose(),M.current=null,T.current=!1,w(!1)):e.cancel()}),q(()=>{let s=W(S.current,e||n||"",t||a||"",i||r||"");s!==M.current?.getModel()&&(u&&K.set(L,M.current?.saveViewState()),M.current?.setModel(s),u&&M.current?.restoreViewState(K.get(i)))},[i],j),q(()=>{M.current?.updateOptions(l)},[l],j),q(()=>{M.current&&void 0!==n&&(M.current.getOption(S.current.editor.EditorOption.readOnly)?M.current.setValue(n):n!==M.current.getValue()&&(I.current=!0,M.current.executeEdits("",[{range:M.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),M.current.pushUndoStop(),I.current=!1))},[n],j),q(()=>{let e=M.current?.getModel();j&&e&&a&&S.current?.editor.setModelLanguage(e,a)},[a,j],j),q(()=>{void 0!==o&&M.current?.revealLine(o)},[o],j),q(()=>{S.current?.editor.setTheme(s)},[s],j);let U=(0,A.useCallback)(()=>{if(!(!C.current||!S.current)&&!T.current){R.current(S.current);let c=i||r,f=W(S.current,n||e||"",t||a||"",c||"");M.current=S.current?.editor.create(C.current,{model:f,automaticLayout:!0,...l},d),u&&M.current.restoreViewState(K.get(c)),S.current.editor.setTheme(s),void 0!==o&&M.current.revealLine(o),w(!0),T.current=!0}},[e,t,r,n,a,i,l,d,u,s,o]);return(0,A.useEffect)(()=>{j&&O.current(M.current,S.current)},[j]),(0,A.useEffect)(()=>{N||j||U()},[N,j,U]),P.current=n,(0,A.useEffect)(()=>{j&&b&&(E.current?.dispose(),E.current=M.current?.onDidChangeModelContent(e=>{I.current||b(M.current.getValue(),e)}))},[j,b]),(0,A.useEffect)(()=>{if(j){let e=S.current.editor.onDidChangeMarkers(e=>{let t=M.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=S.current.editor.getModelMarkers({resource:t});y?.(e)}});return()=>{e?.dispose()}}return()=>{}},[j,y]),A.default.createElement($,{width:m,height:h,isEditorReady:j,loading:c,_ref:C,className:x,wrapperProps:g})});e.s(["DiffEditor",0,H,"Editor",0,X,"default",0,X,"useMonaco",0,function(){let[e,t]=(0,A.useState)(D.__getMonacoInstance());return V(()=>{let r;return e||(r=D.init()).then(e=>{t(e)}),()=>r?.cancel()}),e}],504466)},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 n=(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,n],351101)},332145,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("40d3bb361175ccf31fa1cbe570d51abec9e9a840a0",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,r])},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:n,description:a,action:i,className:s}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",s),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:n}),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)},154333,e=>{"use strict";let t=(0,e.i(863961).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],154333)},905821,957606,938064,88434,686011,443167,440735,608060,149111,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("60bc9aafe74370b9ffe2232b6166b7a09d2e6a4a47",t.callServer,void 0,t.findSourceMapURL,"listDirectory");e.s(["listDirectory",0,r],905821);let n=(0,t.createServerReference)("700ea83a213eccf080afc266fade70b13a733846ac",t.callServer,void 0,t.findSourceMapURL,"getGitStatus");e.s(["getGitStatus",0,n],957606);let a=(0,t.createServerReference)("6068d9aa0854818024cc4b7ca69201d68ea0850ccf",t.callServer,void 0,t.findSourceMapURL,"createFile");e.s(["createFile",0,a],938064);let i=(0,t.createServerReference)("60910913251745beffa465225fd9d526ef430578b4",t.callServer,void 0,t.findSourceMapURL,"createDirectory");e.s(["createDirectory",0,i],88434);let s=(0,t.createServerReference)("709ee9ffb2cf46a94b93a91ebfa10f3806fed83aed",t.callServer,void 0,t.findSourceMapURL,"renameEntry");e.s(["renameEntry",0,s],686011);let o=(0,t.createServerReference)("60ab539172e7ca850e18067c6ebc644977e532d7e5",t.callServer,void 0,t.findSourceMapURL,"deleteEntry");e.s(["deleteEntry",0,o],443167);let c=(0,t.createServerReference)("40580933dc3658e996e85eefaeb7c602bfbfd14975",t.callServer,void 0,t.findSourceMapURL,"listAllFiles");e.s(["listAllFiles",0,c],440735);let l=(0,t.createServerReference)("60e32b7efc40d8da23190cbe685686ad45164cbd53",t.callServer,void 0,t.findSourceMapURL,"readFileContent");e.s(["readFileContent",0,l],608060);let d=(0,t.createServerReference)("70d6f88807b3e79716df55ada35d3cbaaae47fab3a",t.callServer,void 0,t.findSourceMapURL,"writeFileContent");e.s(["writeFileContent",0,d],149111)},203529,e=>{"use strict";var t=e.i(337590),r=e.i(793988),n=e.i(164688),a=e.i(937756);let i=(0,n.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:n="default",render:s,...o}){var c;return c={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,a.cn)(i({variant:n}),e)},o),render:s,state:{slot:"badge",variant:n}},(0,r.useRenderElement)(c.defaultTagName??"div",c,c)}],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])},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)},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)},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)},330111,e=>{"use strict";var t=e.i(807733);e.s(["AlertTriangle",()=>t.default])},477795,486305,e=>{"use strict";var t=e.i(432377),r=e.i(85212),n=e.i(803041),a=e.i(458851),i=e.i(330111),s=e.i(442409),o=e.i(863961);let c=(0,o.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 l=e.i(711296),d=e.i(726111),u=e.i(203529),f=e.i(718837),m=e.i(540032),h=e.i(625054);e.s(["TaskDiffView",0,function({files:e,totalAdded:o,totalRemoved:x,hasConflicts:g,conflictFiles:p,onCommit:v,hasUncommitted:b}){let{t:y}=(0,h.useI18n)(),[j,w]=(0,r.useState)(new Set),[N,k]=(0,r.useState)(!1),[S,M]=(0,r.useState)(""),[C,O]=(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:["+",o]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",x]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:b&&v&&(0,t.jsxs)(l.Button,{variant:"outline",onClick:()=>k(!0),className:"gap-2",children:[(0,t.jsx)(c,{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:s.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)(l.Button,{variant:"ghost",type:"button",onClick:()=>{var t;return t=e.filename,void w(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)(n.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 n=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:n,children:e||" "},r)})})})]},e.filename)})})}),(0,t.jsx)(f.Dialog,{open:N,onOpenChange:k,children:(0,t.jsxs)(f.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(f.DialogHeader,{children:(0,t.jsx)(f.DialogTitle,{children:y("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(m.Textarea,{value:S,onChange:e=>M(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)(f.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"ghost",onClick:()=>k(!1),children:y("common.cancel")}),(0,t.jsx)(l.Button,{onClick:async()=>{if(S.trim()&&v){O(!0);try{await v(S.trim()),M(""),k(!1)}finally{O(!1)}}},disabled:!S.trim()||C,children:C?"...":y("diff.commit")})]})]})})]})}],477795);var x=e.i(309542);let g=(0,o.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:n,taskId:a,taskTitle:i,baseBranch:s,fileCount:o,commitCount:c,commitLog:d=[],onMergeComplete:u}){let m=(0,x.useRouter)(),[h,v]=(0,r.useState)(!1),[b,y]=(0,r.useState)(null),j=async()=>{v(!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){n(!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{v(!1)}};return(0,t.jsx)(f.Dialog,{open:e,onOpenChange:n,children:(0,t.jsxs)(f.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(f.DialogHeader,{children:(0,t.jsxs)(f.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:s})]}),(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:o})]}),(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:c})]})]}),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))})]}),b&&(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:b})})]}),(0,t.jsxs)(f.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>n(!1),disabled:h,children:"Cancel"}),(0,t.jsx)(l.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)},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)},909105,e=>{"use strict";var t=e.i(432377),r=e.i(85212),n=e.i(357334),a=e.i(458851),i=e.i(677436),s=e.i(893832),o=e.i(946960),c=e.i(718837),l=e.i(711296),d=e.i(831349),u=e.i(540032),f=e.i(625054);e.s(["CreateBranchDialog",0,function({open:e,onOpenChange:m,branches:h,currentBranch:x,localPath:g,onCreated:p,onError:v}){let{t:b}=(0,f.useI18n)(),[y,j]=(0,r.useState)(""),[w,N]=(0,r.useState)(x),[k,S]=(0,r.useState)(""),[M,C]=(0,r.useState)(!1),[O,R]=(0,r.useState)(""),[E,P]=(0,r.useState)(!1);(0,r.useEffect)(()=>{e&&(j(""),N(x),S(""),R(""))},[e,x]);let L=[...new Set(h)].filter(e=>e.toLowerCase().includes(O.toLowerCase())),T=async()=>{if(y.trim()){C(!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:w})});if(e.ok)m(!1),p();else{let t=await e.json();v(t.error||"Unknown error")}}catch{v("Network error")}finally{C(!1)}}};return(0,t.jsx)(c.Dialog,{open:e,onOpenChange:m,children:(0,t.jsxs)(c.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(c.DialogHeader,{children:(0,t.jsx)(c.DialogTitle,{children:b("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:b("git.branchName")}),(0,t.jsx)(d.Input,{value:y,onChange:e=>j(e.target.value),placeholder:b("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&T()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:b("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>P(!E),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)(n.GitBranch,{className:"h-3 w-3 text-emerald-400"}),(0,t.jsx)("span",{className:"font-mono text-xs text-foreground",children:w})]}),(0,t.jsx)(a.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${E?"rotate-180":""}`})]}),E&&(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:O,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:L.map(e=>(0,t.jsxs)("button",{onClick:()=>{N(e),P(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===w?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(n.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",children:e}),e===w&&(0,t.jsx)(s.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:b("git.branchDesc")}),(0,t.jsx)(u.Textarea,{value:k,onChange:e=>S(e.target.value),placeholder:b("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)(c.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>m(!1),children:b("common.cancel")}),(0,t.jsxs)(l.Button,{onClick:T,disabled:!y.trim()||M,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[M?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,b("common.create")]})]})]})})}])},657572,e=>{"use strict";async function t(e,r,n={}){let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:r,path:e,...n})});if(!a.ok)throw Error((await a.json()).error||`${r} failed`);return a.json()}e.s(["gitAction",0,t])},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])},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])},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])},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 n=(0,t.createServerReference)("407b9e94f9c79be134a77d9ce4c0b0a15b4261a88d",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,n],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)},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)},612758,e=>{"use strict";var t=e.i(432377),r=e.i(85212),n=e.i(458851),a=e.i(986044),i=e.i(750986),s=e.i(1156),o=e.i(946960),c=e.i(425059),l=e.i(616199),d=e.i(351101),u=e.i(287277);let f=(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),x=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)(s.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(o.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(c.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:i,onContinueLatest:s}){let{t:o,locale:c}=(0,x.useI18n)(),[p,v]=(0,r.useState)(null),[b,y]=(0,r.useState)(null);return 0===e.length?(0,t.jsx)(h.EmptyState,{icon:f,title:o("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:o("execution.history")}),e.map(r=>{let f=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 n=Math.floor(r/1e3);if(n<60)return`${n}s`;let a=Math.floor(n/60);if(a<60)return`${a}m ${n%60}s`;let i=Math.floor(a/60);return`${i}h ${a%60}m`}(r.startedAt??null,r.endedAt??null),x=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,o)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let r=new Date(e),n=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===n?i:1===n?"zh"===t?`昨天 ${i}`:`Yesterday ${i}`:n<7?"zh"===t?`${n}天前 ${i}`:`${n}d ago ${i}`:r.toLocaleDateString(a,{month:"2-digit",day:"2-digit"})+" "+i}(r.startedAt??null,c)}),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||o("execution.noSummary")}),f&&(f.commits||f.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[f.commits?(0,t.jsxs)("span",{children:[f.commits," ",o("execution.commits")]}):null,f.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[f.filesChanged," ",o("execution.files")]})]}):null,f.insertions||f.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),f.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",f.insertions]}):null,f.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",f.deletions]}):null]}):null]}),r.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>y(b===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:[o("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:r.insightNote.title}),b===r.id?(0,t.jsx)(a.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(n.ChevronDown,{className:"h-3 w-3"})]}),b===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)(l.PlayCircle,{className:"h-3.5 w-3.5"}),o("execution.resume")]}):!r.sessionId&&"FAILED"===r.status&&r.id===e[0]?.id&&s?(0,t.jsxs)(m.Button,{size:"sm",onClick:s,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"}),o("execution.tryRecover")]}):null,(0,t.jsxs)(m.Button,{variant:"ghost",size:"sm",onClick:()=>v(x?null:r.id),className:"bg-muted text-muted-foreground",children:[x?(0,t.jsx)(a.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(n.ChevronDown,{className:"h-3.5 w-3.5"}),x?o("execution.collapse"):o("execution.details")]})]})]}),x&&(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:o("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:o("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)},657115,e=>{e.v(t=>Promise.all(["static/chunks/1034h4copyi13.js"].map(t=>e.l(t))).then(()=>t(9961)))},454868,e=>{e.v(t=>Promise.all(["static/chunks/04rm7wn4pu3v9.js"].map(t=>e.l(t))).then(()=>t(92729)))},820374,e=>{e.v(t=>Promise.all(["static/chunks/10_azh3_hkhxj.js"].map(t=>e.l(t))).then(()=>t(797874)))}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,750986,1156,e=>{"use strict";var s=e.i(419613);e.s(["CheckCircle2",()=>s.default],750986);let t=(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,t],1156)},265826,e=>{"use strict";let s=(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,s],265826)},593835,e=>{"use strict";var s=e.i(432377),t=e.i(631325),a=e.i(309542),r=e.i(265826),l=e.i(555159),i=e.i(478430),n=e.i(565037),c=e.i(625054);let d=[{key:"notes",icon:l.FileText},{key:"assets",icon:i.FolderOpen},{key:"archive",icon:n.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:l}=(0,c.useI18n)(),i=(0,a.usePathname)(),n=d.find(e=>i.includes(`/${e.key}`))?.key;return(0,s.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4 py-2",children:[(0,s.jsxs)(t.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,s.jsx)(r.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:l("archive.backToBoard")})]}),(0,s.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),d.map(a=>{let r=a.icon,i=n===a.key;return(0,s.jsxs)(t.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 ${i?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,s.jsx)(r,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:l(`sidebar.${a.key}`)})]},a.key)})]})}])},732728,e=>{"use strict";var s=e.i(432377),t=e.i(85212),a=e.i(565037),r=e.i(750986),l=e.i(1156),i=e.i(946960),n=e.i(610874),c=e.i(625054),d=e.i(593835),o=e.i(543485);let x=(0,o.createServerReference)("40d005870d5c05474a4447139634a368c57c565b53",o.callServer,void 0,o.findSourceMapURL,"getArchivedTasks");function m(e){return new Date(e).toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function u({priority:e}){return(0,s.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${{LOW:"bg-slate-400",MEDIUM:"bg-amber-400",HIGH:"bg-orange-500",CRITICAL:"bg-rose-500"}[e]??"bg-slate-400"}`})}e.s(["ArchivePageClient",0,function({allWorkspaces:e,initialWorkspaceId:o,initialProjectId:h,initialTasks:p}){let f,{t:g}=(0,c.useI18n)(),[v,j]=(0,t.useTransition)(),[b,N]=(0,t.useState)(o),[y,k]=(0,t.useState)(h),[w,C]=(0,t.useState)(p),S=e.find(e=>e.id===b),A=S?.projects??[],$=(0,t.useCallback)(e=>{e?j(async()=>{C(await x(e))}):C([])},[j]);return(0,s.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,s.jsx)(d.SubPageNav,{workspaceId:b}),(0,s.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,s.jsxs)(n.Select,{value:b,onValueChange:s=>s&&(s=>{if(s===b)return;N(s);let t=e.find(e=>e.id===s),a=t?.projects[0]??null;k(a?.id??null),$(a?.id??null)})(s),children:[(0,s.jsx)(n.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,s.jsx)("span",{className:"truncate",children:S?.name??b})}),(0,s.jsx)(n.SelectContent,{children:e.map(e=>(0,s.jsx)(n.SelectItem,{value:e.id,children:e.name},e.id))})]}),A.length>0&&(0,s.jsxs)(n.Select,{value:y??"",onValueChange:e=>e&&void(e!==y&&(k(e),$(e))),children:[(0,s.jsx)(n.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,s.jsx)("span",{className:"truncate",children:(f=A.find(e=>e.id===y))?f.alias?`${f.name} (${f.alias})`:f.name:""})}),(0,s.jsx)(n.SelectContent,{children:A.map(e=>(0,s.jsxs)(n.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),(0,s.jsxs)("span",{className:"ml-auto rounded-full bg-muted px-2.5 py-0.5 text-[11px] text-muted-foreground",children:[w.length," ",g("archive.tasksCount")]})]}),(0,s.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,s.jsxs)("div",{className:`relative ${v?"opacity-40 pointer-events-none":""} transition-opacity`,children:[v&&(0,s.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,s.jsx)(i.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===w.length?(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,s.jsx)(a.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,s.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:g("archive.noTasks")}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground/60",children:g("archive.noTasksDesc")})]}):(0,s.jsx)("div",{className:"space-y-2",children:w.map(e=>{let t="DONE"===e.status,a=e.executions[0];return(0,s.jsx)("div",{className:"group rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:border-border/80 hover:bg-accent/30",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"mt-0.5 shrink-0",children:t?(0,s.jsx)(r.CheckCircle2,{className:"h-4 w-4 text-emerald-500"}):(0,s.jsx)(l.XCircle,{className:"h-4 w-4 text-rose-500"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(u,{priority:e.priority}),(0,s.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:e.title}),(0,s.jsx)("span",{className:`ml-1 shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium ${t?"bg-emerald-500/10 text-emerald-400 ring-1 ring-emerald-500/20":"bg-rose-500/10 text-rose-400 ring-1 ring-rose-500/20"}`,children:t?g("archive.status.done"):g("archive.status.cancelled")})]}),e.labels.length>0&&(0,s.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e.labels.map(e=>(0,s.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,outline:`1px solid ${e.label.color}40`},children:e.label.name},e.label.id))}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-[11px] text-muted-foreground",children:[(0,s.jsxs)("span",{children:[g("archive.createdAt"),": ",m(e.createdAt)]}),(0,s.jsxs)("span",{children:[t?g("archive.completedAt"):g("archive.cancelledAt"),": ",m(e.updatedAt)]}),a&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[g("archive.lastExecution"),":"," ",(0,s.jsx)("span",{className:`rounded px-1 py-0.5 font-mono text-[10px] ${"COMPLETED"===a.status?"bg-emerald-500/10 text-emerald-400":"FAILED"===a.status?"bg-rose-500/10 text-rose-400":"bg-amber-500/10 text-amber-400"}`,children:a.status})]})]})]})]})},e.id)})})]})})]})}],732728)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,750986,1156,e=>{"use strict";var s=e.i(419613);e.s(["CheckCircle2",()=>s.default],750986);let t=(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,t],1156)},265826,e=>{"use strict";let s=(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,s],265826)},593835,e=>{"use strict";var s=e.i(432377),t=e.i(631325),a=e.i(309542),r=e.i(265826),l=e.i(555159),i=e.i(478430),n=e.i(565037),c=e.i(625054);let d=[{key:"notes",icon:l.FileText},{key:"assets",icon:i.FolderOpen},{key:"archive",icon:n.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:l}=(0,c.useI18n)(),i=(0,a.usePathname)(),n=d.find(e=>i.includes(`/${e.key}`))?.key;return(0,s.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4 py-2",children:[(0,s.jsxs)(t.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,s.jsx)(r.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:l("archive.backToBoard")})]}),(0,s.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),d.map(a=>{let r=a.icon,i=n===a.key;return(0,s.jsxs)(t.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 ${i?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,s.jsx)(r,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:l(`sidebar.${a.key}`)})]},a.key)})]})}])},732728,e=>{"use strict";var s=e.i(432377),t=e.i(85212),a=e.i(565037),r=e.i(750986),l=e.i(1156),i=e.i(946960),n=e.i(610874),c=e.i(625054),d=e.i(593835),o=e.i(543485);let x=(0,o.createServerReference)("40636d1b44bc86e646dfe6b78f00fd18562649e806",o.callServer,void 0,o.findSourceMapURL,"getArchivedTasks");function m(e){return new Date(e).toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function u({priority:e}){return(0,s.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${{LOW:"bg-slate-400",MEDIUM:"bg-amber-400",HIGH:"bg-orange-500",CRITICAL:"bg-rose-500"}[e]??"bg-slate-400"}`})}e.s(["ArchivePageClient",0,function({allWorkspaces:e,initialWorkspaceId:o,initialProjectId:h,initialTasks:p}){let f,{t:g}=(0,c.useI18n)(),[v,j]=(0,t.useTransition)(),[b,N]=(0,t.useState)(o),[y,k]=(0,t.useState)(h),[w,C]=(0,t.useState)(p),S=e.find(e=>e.id===b),A=S?.projects??[],$=(0,t.useCallback)(e=>{e?j(async()=>{C(await x(e))}):C([])},[j]);return(0,s.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,s.jsx)(d.SubPageNav,{workspaceId:b}),(0,s.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,s.jsxs)(n.Select,{value:b,onValueChange:s=>s&&(s=>{if(s===b)return;N(s);let t=e.find(e=>e.id===s),a=t?.projects[0]??null;k(a?.id??null),$(a?.id??null)})(s),children:[(0,s.jsx)(n.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,s.jsx)("span",{className:"truncate",children:S?.name??b})}),(0,s.jsx)(n.SelectContent,{children:e.map(e=>(0,s.jsx)(n.SelectItem,{value:e.id,children:e.name},e.id))})]}),A.length>0&&(0,s.jsxs)(n.Select,{value:y??"",onValueChange:e=>e&&void(e!==y&&(k(e),$(e))),children:[(0,s.jsx)(n.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,s.jsx)("span",{className:"truncate",children:(f=A.find(e=>e.id===y))?f.alias?`${f.name} (${f.alias})`:f.name:""})}),(0,s.jsx)(n.SelectContent,{children:A.map(e=>(0,s.jsxs)(n.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),(0,s.jsxs)("span",{className:"ml-auto rounded-full bg-muted px-2.5 py-0.5 text-[11px] text-muted-foreground",children:[w.length," ",g("archive.tasksCount")]})]}),(0,s.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,s.jsxs)("div",{className:`relative ${v?"opacity-40 pointer-events-none":""} transition-opacity`,children:[v&&(0,s.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,s.jsx)(i.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===w.length?(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,s.jsx)(a.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,s.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:g("archive.noTasks")}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground/60",children:g("archive.noTasksDesc")})]}):(0,s.jsx)("div",{className:"space-y-2",children:w.map(e=>{let t="DONE"===e.status,a=e.executions[0];return(0,s.jsx)("div",{className:"group rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:border-border/80 hover:bg-accent/30",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"mt-0.5 shrink-0",children:t?(0,s.jsx)(r.CheckCircle2,{className:"h-4 w-4 text-emerald-500"}):(0,s.jsx)(l.XCircle,{className:"h-4 w-4 text-rose-500"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(u,{priority:e.priority}),(0,s.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:e.title}),(0,s.jsx)("span",{className:`ml-1 shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium ${t?"bg-emerald-500/10 text-emerald-400 ring-1 ring-emerald-500/20":"bg-rose-500/10 text-rose-400 ring-1 ring-rose-500/20"}`,children:t?g("archive.status.done"):g("archive.status.cancelled")})]}),e.labels.length>0&&(0,s.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e.labels.map(e=>(0,s.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,outline:`1px solid ${e.label.color}40`},children:e.label.name},e.label.id))}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-[11px] text-muted-foreground",children:[(0,s.jsxs)("span",{children:[g("archive.createdAt"),": ",m(e.createdAt)]}),(0,s.jsxs)("span",{children:[t?g("archive.completedAt"):g("archive.cancelledAt"),": ",m(e.updatedAt)]}),a&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[g("archive.lastExecution"),":"," ",(0,s.jsx)("span",{className:`rounded px-1 py-0.5 font-mono text-[10px] ${"COMPLETED"===a.status?"bg-emerald-500/10 text-emerald-400":"FAILED"===a.status?"bg-rose-500/10 text-rose-400":"bg-amber-500/10 text-amber-400"}`,children:a.status})]})]})]})]})},e.id)})})]})})]})}],732728)}]);
@@ -1,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,899561,(e,t,r)=>{var s;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/project/f/tower/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/os-browserify/"),(s={}).endianness=function(){return"LE"},s.hostname=function(){return"u">typeof location?location.hostname:""},s.loadavg=function(){return[]},s.uptime=function(){return 0},s.freemem=function(){return Number.MAX_VALUE},s.totalmem=function(){return Number.MAX_VALUE},s.cpus=function(){return[]},s.type=function(){return"Browser"},s.release=function(){return"u">typeof navigator?navigator.appVersion:""},s.networkInterfaces=s.getNetworkInterfaces=function(){return{}},s.arch=function(){return"javascript"},s.platform=function(){return"browser"},s.tmpdir=s.tmpDir=function(){return"/tmp"},s.EOL="\n",s.homedir=function(){return"/"},t.exports=s},171159,(e,t,r)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,s="",a=0,n=-1,o=0,i=0;i<=e.length;++i){if(i<e.length)r=e.charCodeAt(i);else if(47===r)break;else r=47;if(47===r){if(n===i-1||1===o);else if(n!==i-1&&2===o){if(s.length<2||2!==a||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){var l=s.lastIndexOf("/");if(l!==s.length-1){-1===l?(s="",a=0):a=(s=s.slice(0,l)).length-1-s.lastIndexOf("/"),n=i,o=0;continue}}else if(2===s.length||1===s.length){s="",a=0,n=i,o=0;continue}}t&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+e.slice(n+1,i):s=e.slice(n+1,i),a=i-n-1;n=i,o=0}else 46===r&&-1!==o?++o:o=-1}return s}var s={resolve:function(){for(var e,s,a="",n=!1,o=arguments.length-1;o>=-1&&!n;o--)o>=0?s=arguments[o]:(void 0===e&&(e=""),s=e),t(s),0!==s.length&&(a=s+"/"+a,n=47===s.charCodeAt(0));if(a=r(a,!n),n)if(a.length>0)return"/"+a;else return"/";return a.length>0?a:"."},normalize:function(e){if(t(e),0===e.length)return".";var s=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!s)).length||s||(e="."),e.length>0&&a&&(e+="/"),s)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var a=arguments[r];t(a),a.length>0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":s.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=s.resolve(e))===(r=s.resolve(r)))return"";for(var a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var n=e.length,o=n-a,i=1;i<r.length&&47===r.charCodeAt(i);++i);for(var l=r.length-i,c=o<l?o:l,d=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===r.charCodeAt(i+u))return r.slice(i+u+1);else if(0===u)return r.slice(i+u)}else o>c&&(47===e.charCodeAt(a+u)?d=u:0===u&&(d=0));break}var m=e.charCodeAt(a+u);if(m!==r.charCodeAt(i+u))break;47===m&&(d=u)}var x="";for(u=a+d+1;u<=n;++u)(u===n||47===e.charCodeAt(u))&&(0===x.length?x+="..":x+="/..");return x.length>0?x+r.slice(i+d):(i+=d,47===r.charCodeAt(i)&&++i,r.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),s=47===r,a=-1,n=!0,o=e.length-1;o>=1;--o)if(47===(r=e.charCodeAt(o))){if(!n){a=o;break}}else n=!1;return -1===a?s?"/":".":s&&1===a?"//":e.slice(0,a)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var s,a=0,n=-1,o=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var i=r.length-1,l=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47===c){if(!o){a=s+1;break}}else -1===l&&(o=!1,l=s+1),i>=0&&(c===r.charCodeAt(i)?-1==--i&&(n=s):(i=-1,n=l))}return a===n?n=l:-1===n&&(n=e.length),e.slice(a,n)}for(s=e.length-1;s>=0;--s)if(47===e.charCodeAt(s)){if(!o){a=s+1;break}}else -1===n&&(o=!1,n=s+1);return -1===n?"":e.slice(a,n)},extname:function(e){t(e);for(var r=-1,s=0,a=-1,n=!0,o=0,i=e.length-1;i>=0;--i){var l=e.charCodeAt(i);if(47===l){if(!n){s=i+1;break}continue}-1===a&&(n=!1,a=i+1),46===l?-1===r?r=i:1!==o&&(o=1):-1!==r&&(o=-1)}return -1===r||-1===a||0===o||1===o&&r===a-1&&r===s+1?"":e.slice(r,a)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,s={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return s;var a=e.charCodeAt(0),n=47===a;n?(s.root="/",r=1):r=0;for(var o=-1,i=0,l=-1,c=!0,d=e.length-1,u=0;d>=r;--d){if(47===(a=e.charCodeAt(d))){if(!c){i=d+1;break}continue}-1===l&&(c=!1,l=d+1),46===a?-1===o?o=d:1!==u&&(u=1):-1!==o&&(u=-1)}return -1===o||-1===l||0===u||1===u&&o===l-1&&o===i+1?-1!==l&&(0===i&&n?s.base=s.name=e.slice(1,l):s.base=s.name=e.slice(i,l)):(0===i&&n?(s.name=e.slice(1,o),s.base=e.slice(1,l)):(s.name=e.slice(i,o),s.base=e.slice(i,l)),s.ext=e.slice(o,l)),i>0?s.dir=e.slice(0,i-1):n&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s}},r={};function s(t){var a=r[t];if(void 0!==a)return a.exports;var n=r[t]={exports:{}},o=!0;try{e[t](n,n.exports,s),o=!1}finally{o&&delete r[t]}return n.exports}s.ab="/ROOT/project/f/tower/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/path-browserify/",t.exports=s(114)}()},400395,e=>{"use strict";let t=(0,e.i(863961).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",0,t])},178755,e=>{"use strict";var t=e.i(432377),r=e.i(85212),s=e.i(309542),a=e.i(631325),n=e.i(565037),o=e.i(780156),i=e.i(923344),l=e.i(909260),c=e.i(746357),d=e.i(863961);let u=(0,d.default)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]),m=(0,d.default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var x=e.i(555159),h=e.i(478430);let p=(0,d.default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var f=e.i(942252),g=e.i(142124),j=e.i(718837),b=e.i(11915),v=e.i(711296),w=e.i(831349),N=e.i(543485);let y=(0,N.createServerReference)("407b2af6329533534febb291b9b6995ca0c57ecfb6",N.callServer,void 0,N.findSourceMapURL,"createWorkspace"),k=(0,N.createServerReference)("60557d38533851a85e3b22aff36176ee7e8ce42871",N.callServer,void 0,N.findSourceMapURL,"updateWorkspace"),C=(0,N.createServerReference)("40d7736a6bd6d01f427300af149cbed5f8178fd0b7",N.callServer,void 0,N.findSourceMapURL,"deleteWorkspace"),S=(0,N.createServerReference)("403e569967f7e40ef9f95a932fd1402ccf721dc22e",N.callServer,void 0,N.findSourceMapURL,"getLabelsForWorkspace"),T=(0,N.createServerReference)("405fdc9c4d8b06477fa2fab70470ea3bcd09a3af4e",N.callServer,void 0,N.findSourceMapURL,"createLabel"),D=(0,N.createServerReference)("40f99af0c2ef3e8f82b39d8517d51f004fa12d9445",N.callServer,void 0,N.findSourceMapURL,"deleteLabel");var P=e.i(625054),R=e.i(286302);let M=["📋","🚀","🎯","💡","🔧","📦","🎨","📊","🔬","🌟","📝","🏗️"];function A({workspaces:e}){let d,j=(0,s.useRouter)(),w=(0,s.usePathname)(),{t:N}=(0,P.useI18n)(),[S,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&T(!0)},[]);let[D,z]=(0,r.useState)(!1),[L,O]=(0,r.useState)(!1),[I,B]=(0,r.useState)(!1),[F,_]=(0,r.useState)(null),[U,W]=(0,r.useState)(""),[H,K]=(0,r.useState)(M[0]),[V,q]=(0,r.useState)(null),X=w.split("/workspaces/")[1]?.split("/")[0],G=(0,r.useCallback)(()=>{T(e=>{let t=!e;return localStorage.setItem("sidebar-collapsed",String(t)),t})},[]),J=(0,r.useCallback)(async()=>{if(!U.trim())return;let e=await y({name:U.trim(),description:H});W(""),K(M[0]),z(!1),j.refresh(),j.push(`/workspaces/${e.id}`)},[U,H,j]),Y=(0,r.useCallback)(async()=>{U.trim()&&V&&(await k(V,{name:U.trim(),description:H}),W(""),O(!1),q(null),j.refresh())},[U,H,V,j]),Z=(0,r.useCallback)(e=>{q(e.id),W(e.name),K(e.description&&M.includes(e.description)?e.description:M[0]),O(!0)},[]),Q=(0,r.useCallback)(async(t,r)=>{if(e.length<=1)return void R.toast.error(N("sidebar.lastWorkspaceError"));if(confirm(N("sidebar.deleteConfirm",{name:r})))try{await C(t),j.refresh(),X===t&&j.push("/workspaces")}catch{R.toast.error(N("sidebar.lastWorkspaceError"))}},[X,j,N,e.length]),ee=(0,r.useCallback)(e=>{_(e),B(!0)},[]),et=e=>e.description&&M.includes(e.description)?e.description:e.name.charAt(0).toUpperCase();if(S){let r;return(0,t.jsxs)("aside",{className:"flex h-screen w-14 flex-col items-center border-r border-border bg-sidebar py-3",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:G,className:"mb-4 flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 ring-1 ring-primary/20 transition-transform hover:scale-105"}),children:(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-6 w-6 rounded"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.expand")})]}),(0,t.jsx)(g.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1 px-0.5 pt-1",children:[e.map(e=>{let r=X===e.id,s=et(e);return(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>{r||j.push(`/workspaces/${e.id}`)},className:`flex h-9 w-9 items-center justify-center rounded-lg transition-all ${r?"ring-1 ring-primary/20 text-foreground cursor-default":"text-muted-foreground hover:text-foreground cursor-pointer"}`}),children:(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:M.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold",children:s})})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:e.name})]},e.id)}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{"data-tour":"create-workspace",onClick:()=>z(!0),className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"}),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.newWorkspace")})]})]})}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(r=X||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/notes`),className:`rounded-lg p-2 transition-colors ${w.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(x.FileText,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.notes")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/assets`),className:`rounded-lg p-2 transition-colors ${w.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(h.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.assets")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/archive`),className:`rounded-lg p-2 transition-colors ${w.includes("/archive")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(n.Archive,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.archive")})]})]}):null,(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===w?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(p,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("missions.navLabel")})]})]}),(0,t.jsx)($,{open:D,onOpenChange:z,title:N("workspace.create"),name:U,onNameChange:W,icon:H,onIconChange:K,onSubmit:J,submitLabel:N("common.create"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")})]})}return(0,t.jsxs)("aside",{className:"noise relative flex h-screen w-56 flex-col border-r border-border bg-sidebar",children:[(0,t.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-4 py-4",children:[(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-9 w-9 rounded-lg"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Tower"}),(0,t.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground",children:"Studio"})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-xs",onClick:G,className:"text-muted-foreground",title:N("sidebar.collapse"),children:(0,t.jsx)(u,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-4 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:N("sidebar.workspace")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{W(""),K(M[0]),z(!0)},title:N("sidebar.newWorkspace"),children:(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)(g.ScrollArea,{className:"relative z-10 mt-2 flex-1 min-h-0",children:(0,t.jsx)("div",{className:"px-2 py-1",children:e.map(r=>{var s;let a,n,o,d=X===r.id,u=et(r);return(0,t.jsxs)("div",{className:`group relative flex items-center rounded-lg transition-all ${d?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,t.jsxs)("button",{onClick:()=>{d||j.push(`/workspaces/${r.id}`)},className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${d?"cursor-default":"cursor-pointer"}`,children:[(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:M.includes(u)?u:(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:u})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:`truncate text-sm font-medium ${d?"text-foreground":"text-secondary-foreground"}`,children:r.name}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(s=r.updatedAt,n=Math.floor((a=Date.now()-new Date(s).getTime())/6e4),o=Math.floor(a/36e5),n<60?`${n}m ago`:o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`)})]})]}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsx)(f.DropdownMenuTrigger,{render:(0,t.jsx)("button",{className:"mr-2 rounded-md p-1 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:e=>e.stopPropagation()}),children:(0,t.jsx)(c.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(f.DropdownMenuContent,{align:"start",side:"right",children:[(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>Z(r),children:[(0,t.jsx)(i.Pencil,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.rename")]}),(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>ee(r.id),children:[(0,t.jsx)(m,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.manageLabels")]}),(0,t.jsxs)(f.DropdownMenuItem,{className:e.length<=1?"text-muted-foreground opacity-50":"text-rose-400",disabled:e.length<=1,onClick:()=>Q(r.id,r.name),children:[(0,t.jsx)(l.Trash2,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.delete")]})]})]})]},r.id)})})}),(0,t.jsxs)(a.default,{href:"/missions",className:`relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] cursor-pointer transition-colors ${"/missions"===w?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(p,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("missions.navLabel")})]}),(d=X||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.default,{href:`/workspaces/${d}/notes`,className:"relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(x.FileText,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.notes")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${d}/assets`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.assets")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${d}/archive`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(n.Archive,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.archive")})]})]}):null,(0,t.jsx)($,{open:D,onOpenChange:z,title:N("workspace.create"),name:U,onNameChange:W,icon:H,onIconChange:K,onSubmit:J,submitLabel:N("common.create"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")}),(0,t.jsx)($,{open:L,onOpenChange:e=>{O(e),e||q(null)},title:N("workspace.edit"),name:U,onNameChange:W,icon:H,onIconChange:K,onSubmit:Y,submitLabel:N("common.save"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")}),F&&(0,t.jsx)(E,{open:I,onOpenChange:e=>{B(e),e||_(null)},workspaceId:F})]})}function $({open:e,onOpenChange:r,title:s,name:a,onNameChange:n,icon:o,onIconChange:i,onSubmit:l,submitLabel:c,nameLabel:d,iconLabel:u,namePlaceholder:m,cancelLabel:x}){return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:r,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:s})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d}),(0,t.jsx)(w.Input,{placeholder:m,value:a,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:u}),(0,t.jsx)("div",{className:"mt-1.5 grid grid-cols-6 gap-1.5",children:M.map(e=>(0,t.jsx)("button",{onClick:()=>i(e),className:`flex h-10 w-10 items-center justify-center rounded-lg text-lg transition-all ${o===e?"bg-primary/15 ring-2 ring-primary/30 scale-110":"bg-muted hover:bg-accent"}`,children:e},e))})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>r(!1),children:x}),(0,t.jsx)(v.Button,{onClick:l,disabled:!a.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:c})]})]})})}let z=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function E({open:e,onOpenChange:s,workspaceId:a}){let{t:n}=(0,P.useI18n)(),[o,i]=(0,r.useState)([]),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(z[0]);(0,r.useEffect)(()=>{e&&S(a).then(i)},[e,a]);let m=async()=>{l.trim()&&(await T({name:l.trim(),color:d,workspaceId:a}),i(await S(a)),c(""))},x=async e=>{await D(e),i(t=>t.filter(t=>t.id!==e))};return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:s,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("label.manage")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[o.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground",children:e.name}),e.isBuiltin?(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:n("label.builtin")}):(0,t.jsx)("button",{onClick:()=>x(e.id),className:"text-xs text-rose-400 hover:text-rose-300",children:n("common.delete")})]},e.id)),(0,t.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("label.name"),value:l,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"flex-1 h-8"}),(0,t.jsx)(v.Button,{size:"sm",onClick:m,disabled:!l.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:n("label.add")})]}),(0,t.jsx)("div",{className:"mt-2 flex gap-1.5",children:z.map(e=>(0,t.jsx)("button",{onClick:()=>u(e),className:`h-5 w-5 rounded-full transition-all ${d===e?"ring-2 ring-offset-2 ring-offset-background ring-foreground/30 scale-110":""}`,style:{backgroundColor:e}},e))})]})]})]})})}var L=e.i(275283),O=e.i(677436),I=e.i(103295);let B=(0,d.default)("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);var F=e.i(802461),_=e.i(867900),U=e.i(811424),W=e.i(809250);e.s([],732490),e.i(732490),e.i(129893);var H=e.i(793988),K=e.i(499875);let V=r.createContext(void 0);function q(){let e=r.useContext(V);if(void 0===e)throw Error((0,K.default)(13));return e}let X={imageLoadingStatus:()=>null},G=r.forwardRef(function(e,s){let{className:a,render:n,...o}=e,[i,l]=r.useState("idle"),c=r.useMemo(()=>({imageLoadingStatus:i,setImageLoadingStatus:l}),[i,l]),d=(0,H.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:s,props:o,stateAttributesMapping:X});return(0,t.jsx)(V.Provider,{value:c,children:d})});var J=e.i(357030),Y=e.i(284060),Z=e.i(412360),Q=e.i(144909),ee=e.i(883993),et=e.i(166508);let er={...X,...Q.transitionStatusMapping},es=r.forwardRef(function(e,t){let{className:s,render:a,onLoadingStatusChange:n,referrerPolicy:o,crossOrigin:i,...l}=e,c=q(),d=function(e,{referrerPolicy:t,crossOrigin:s}){let[a,n]=r.useState("idle");return(0,Y.useIsoLayoutEffect)(()=>{if(!e)return n("error"),et.NOOP;let r=!0,a=new window.Image,o=e=>()=>{r&&n(e)};return n("loading"),a.onload=o("loaded"),a.onerror=o("error"),t&&(a.referrerPolicy=t),a.crossOrigin=s??null,a.src=e,()=>{r=!1}},[e,s,t]),a}(e.src,{referrerPolicy:o,crossOrigin:i}),u="loaded"===d,{mounted:m,transitionStatus:x,setMounted:h}=(0,ee.useTransitionStatus)(u),p=r.useRef(null),f=(0,J.useStableCallback)(e=>{n?.(e),c.setImageLoadingStatus(e)});(0,Y.useIsoLayoutEffect)(()=>{"idle"!==d&&f(d)},[d,f]),(0,Z.useOpenChangeComplete)({open:u,ref:p,onComplete(){u||h(!1)}});let g=(0,H.useRenderElement)("img",e,{state:{imageLoadingStatus:d,transitionStatus:x},ref:[t,p],props:l,stateAttributesMapping:er,enabled:m});return m?g:null});var ea=e.i(617406);let en=r.forwardRef(function(e,t){let{className:s,render:a,delay:n,...o}=e,{imageLoadingStatus:i}=q(),[l,c]=r.useState(void 0===n),d=(0,ea.useTimeout)();return r.useEffect(()=>(void 0!==n&&d.start(n,()=>c(!0)),d.clear),[d,n]),(0,H.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:t,props:o,stateAttributesMapping:X,enabled:"loaded"!==i&&l})});e.s(["Fallback",0,en,"Image",0,es,"Root",0,G],50152);var eo=e.i(50152),eo=eo,ei=e.i(937756);function el({className:e,size:r="default",...s}){return(0,t.jsx)(eo.Root,{"data-slot":"avatar","data-size":r,className:(0,ei.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...s})}function ec({className:e,...r}){return(0,t.jsx)(eo.Fallback,{"data-slot":"avatar-fallback",className:(0,ei.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...r})}let ed=(0,d.default)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);var eu=e.i(357334);let em=(0,d.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]),ex=(0,d.default)("package-2",[["path",{d:"M12 3v6",key:"1holv5"}],["path",{d:"M16.76 3a2 2 0 0 1 1.8 1.1l2.23 4.479a2 2 0 0 1 .21.891V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9.472a2 2 0 0 1 .211-.894L5.45 4.1A2 2 0 0 1 7.24 3z",key:"187q7i"}],["path",{d:"M3.054 9.013h17.893",key:"grwhos"}]]);var eh=e.i(996032);let ep=(0,N.createServerReference)("608f69f95a3beba367f60aa9887945df91c205a5a8",N.callServer,void 0,N.findSourceMapURL,"globalSearch");var ef=e.i(632426);let eg=[{id:"all",key:"search.all",icon:O.Search},{id:"task",key:"search.task",icon:x.FileText},{id:"project",key:"search.project",icon:ed},{id:"repository",key:"search.repository",icon:eu.GitBranch},{id:"note",key:"search.note",icon:em},{id:"asset",key:"search.asset",icon:ex}],ej=["task","project","repository","note","asset"],eb={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function ev({result:e,onSelect:r}){let s=eg.find(t=>t.id===e.type)?.icon??x.FileText;return(0,t.jsxs)("button",{onClick:()=>r(e),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-3 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,t.jsx)("div",{className:"rounded-md bg-muted p-1.5",children:(0,t.jsx)(s,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:e.title}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.subtitle}),e.snippet&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground/70 truncate mt-0.5",children:e.snippet})]})]})}function ew({open:e,onOpenChange:a}){let n,{t:o}=(0,P.useI18n)(),i=(0,s.useRouter)(),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)("all"),[m,x]=(0,r.useState)([]),[h,p]=(0,r.useState)(!1),[f,b]=(0,r.useState)(250),w=(0,r.useRef)(null),N=(0,r.useRef)(null);(0,r.useEffect)(()=>{e&&((0,ef.getConfigValue)("search.debounceMs",250).then(b),setTimeout(()=>w.current?.focus(),100),c(""),x([]))},[e]),(0,r.useEffect)(()=>{if(N.current&&clearTimeout(N.current),!l.trim()){x([]),p(!1);return}p(!0);let e=!1;return N.current=setTimeout(async()=>{let t=await ep(l,d);e||(x(t),p(!1))},f),()=>{N.current&&clearTimeout(N.current),e=!0}},[l,d,f]);let y=(0,r.useCallback)(e=>{i.push(e.navigateTo),a(!1)},[i,a]);return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden !top-[10vh] !-translate-y-0",showCloseButton:!1,children:[(0,t.jsxs)("div",{className:"flex items-center border-b border-border px-4",children:[(0,t.jsx)(O.Search,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("input",{ref:w,value:l,onChange:e=>c(e.target.value),placeholder:o("search.placeholder"),className:"flex-1 bg-transparent px-3 py-3.5 text-sm text-foreground placeholder-muted-foreground outline-none"}),l&&(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",onClick:()=>{c(""),x([])},className:"text-muted-foreground",children:(0,t.jsx)(eh.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:eg.map(e=>{let r=e.icon;return(0,t.jsxs)("button",{onClick:()=>u(e.id),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-all ${d===e.id?"bg-primary/10 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3 w-3"}),o(e.key)]},e.id)})}),(0,t.jsxs)(g.ScrollArea,{className:"max-h-80",children:[!l.trim()&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.typeToSearch")}),l.trim()&&0===m.length&&!h&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.noResults")}),"all"===d&&m.length>0&&(n=m.reduce((e,t)=>((e[t.type]??=[]).push(t),e),{}),ej.filter(e=>n[e]?.length).map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:o(eb[e])}),n[e].map(e=>(0,t.jsx)(ev,{result:e,onSelect:y},`${e.type}-${e.id}`))]},e))),"all"!==d&&m.map(e=>(0,t.jsx)(ev,{result:e,onSelect:y},`${e.type}-${e.id}`))]})]})})}var eN=e.i(86982),ey=e.i(946960),ek=e.i(893832),eC=e.i(894296),eS=e.i(239358),eT=e.i(584685),eD=e.i(540032);function eP(e){return e.replace(/\.git\/?$/,"")}e.i(899561),e.i(171159);let eR=(0,N.createServerReference)("406f4c33d6ee0b57f32ef36912f062f165599174b0",N.callServer,void 0,N.findSourceMapURL,"resolveGitLocalPath");var eM=e.i(670074);function eA({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,P.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,h]=(0,r.useState)(""),[p,f]=(0,r.useState)(""),[g,N]=(0,r.useState)(!1),[y,k]=(0,r.useState)("FRONTEND"),[C,S]=(0,r.useState)("idle"),[T,D]=(0,r.useState)(""),[M,A]=(0,r.useState)(!1),$=()=>{l(""),d(""),m(""),h(""),f(""),N(!1),k("FRONTEND"),S("idle"),D(""),A(!1)},z=async()=>{if(p.trim()&&!M&&"success"===C){A(!0);try{let e=await (0,eM.analyzeProjectDirectory)(p.trim(),o);m(e)}catch{R.toast.error(n("project.analyzeError"))}finally{A(!1)}}},E=async e=>{h(e),S("idle"),D("");let t=function(e){let t,r=e.match(/^git@([^:]+):(.+)$/);if(r)return{host:r[1],pathSegments:eP(r[2]).split("/").filter(Boolean)};try{t=new URL(e)}catch{return null}return{host:t.hostname,pathSegments:eP(decodeURIComponent(t.pathname)).split("/").filter(Boolean)}}(e);t&&t.pathSegments.length>0&&l(t.pathSegments[t.pathSegments.length-1]),g||f(await eR(e))},L=async()=>{if(x.trim()&&p.trim()){S("cloning"),D("");try{let e=function(e){let t=e.trim();if(!t)return"";if(t.startsWith("git@")||t.startsWith("ssh://")||t.endsWith(".git"))return t;try{let e=new URL(t),r=e.hostname,s=decodeURIComponent(e.pathname).split("/").filter(Boolean);if("code.iflytek.com"===r){let e=[...s];"osc"===e[0]&&"_source"===e[1]&&(e=e.slice(2));let a=e.indexOf("-");if(a>0&&(e=e.slice(0,a)),0===e.length)return t;return`https://${r}/${e.join("/")}.git`}return`${e.origin}${e.pathname.replace(/\/$/,"")}.git`}catch{return t}}(x.trim()),t=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:e,path:p.trim()})}),r=await t.json();if(!t.ok){S("error"),D(r.error||"Clone failed");return}S("success")}catch{S("error"),D("Network error")}}},O=async()=>{i.trim()&&(await a?.({name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:x.trim()||void 0,localPath:p.trim()||void 0,projectType:y}),$(),s(!1))};return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||$()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.newProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.gitUrlHint")}),(0,t.jsx)(w.Input,{placeholder:n("project.gitPlaceholder"),value:x,onChange:e=>E(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.localPathHint")}),(0,t.jsx)(w.Input,{placeholder:n("project.localPathPlaceholder"),value:p,onChange:e=>{f(e.target.value),N(!0)},className:"mt-1.5 font-mono text-xs w-full"}),p.trim().startsWith("~")&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),n("project.tildeWarning")]}),x.trim()&&p.trim()&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{type:"button",disabled:"cloning"===C||"success"===C,onClick:L,className:"gap-1.5 text-xs bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/25 hover:bg-emerald-500/25 disabled:opacity-50",children:["cloning"===C?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===C?(0,t.jsx)(ek.Check,{className:"h-3 w-3"}):(0,t.jsx)(eu.GitBranch,{className:"h-3 w-3"}),"cloning"===C?n("git.cloning"):"success"===C?n("git.cloned"):n("git.clone")]}),"error"===C&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),T]}),"success"===C&&(0,t.jsx)("span",{className:"text-[11px] text-emerald-400",children:n("git.cloneSuccess")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eT.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:y,onChange:k})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:z,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!p.trim()||M?"opacity-50":""}`}),children:[M?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eS.Sparkles,{className:"h-3 w-3"}),M?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:p.trim()?"success"!==C?n("project.genDescNotCloned"):n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eD.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),$()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:O,disabled:!i.trim()||M,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:n("common.create")})]})]})})})}var e$=e.i(400395),e$=e$,ez=e.i(921280),eE=e.i(330521);let eL=(0,N.createServerReference)("60c9debab62ab636e3bb82d67fe9d032e6722bba52",N.callServer,void 0,N.findSourceMapURL,"migrateProjectPath"),eO=(0,N.createServerReference)("40d22d8522ddcd2962bee63eb58d49f34d0df34faf",N.callServer,void 0,N.findSourceMapURL,"checkMigrationSafety");function eI({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,P.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,p]=(0,r.useState)(""),[f,g]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("FRONTEND"),[S,T]=(0,r.useState)(!1),[D,M]=(0,r.useState)(!1),[A,$]=(0,r.useState)(""),[z,E]=(0,r.useState)(!1),[L,O]=(0,r.useState)(""),[I,B]=(0,r.useState)(""),[F,_]=(0,r.useState)(!1),[U,W]=(0,r.useState)(!1),H=()=>{l(""),d(""),m(""),p(""),g(""),C("FRONTEND"),T(!1),M(!1),$(""),E(!1),O(""),B(""),_(!1),W(!1)},K=async e=>{g(e),T(!1),M(!1),$(""),O(""),B(""),_(!1),l(e.split("/").filter(Boolean).pop()??"");try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();if(e.isGit&&e.remoteUrl){p(e.remoteUrl),T(!0);let t=e.remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);t&&l(t[1])}}}catch{}},V=(0,r.useCallback)(async e=>{if(M(e),O(""),B(""),_(!1),!e)return void $("");if(x)try{let e=await eR(x);e&&($(e),e===f&&_(!0))}catch{}if(f)try{let e=await fetch(`/api/git?path=${encodeURIComponent(f)}&checkWorktrees=true`);e.ok&&(await e.json()).hasWorktrees&&B(n("project.worktreeWarning"))}catch{}},[x,f]),q=async()=>{if(f&&!U){W(!0);try{let e=await (0,eM.analyzeProjectDirectory)(f.trim(),o);m(e)}catch{R.toast.error(n("project.analyzeError"))}finally{W(!1)}}},X=async()=>{if(!i.trim())return;let e={name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:x.trim()||void 0,localPath:f.trim()||void 0,projectType:k},t=await a?.(e);if(D&&A&&A!==f&&t&&"id"in t){E(!0),O("");let e=await eO(t.id);if(!e.safe){O(e.reason),E(!1);return}let r=await eL(t.id,A);if(E(!1),!r.success)return void O(r.error??n("project.migrateError"));R.toast.success(n("project.migrateSuccess"))}H(),s(!1)},G=!i.trim()||!f.trim()||z||U||D&&!!I;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||H()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.importProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.importHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{value:f,readOnly:!0,placeholder:n("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs bg-muted/30"}),(0,t.jsxs)(v.Button,{type:"button",variant:"outline",onClick:()=>y(!0),className:"shrink-0 gap-1.5",children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),n("folder.browse")]})]}),S&&(0,t.jsx)("p",{className:"mt-1.5 text-[11px] text-emerald-400",children:n("project.autoDetected")})]}),x&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)(w.Input,{value:x,onChange:e=>p(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),S&&f&&(0,t.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:n("project.migrate")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.migrateHint")})]}),(0,t.jsx)(eE.Switch,{checked:D,onCheckedChange:e=>V(e)})]}),D&&(0,t.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-medium text-muted-foreground",children:n("project.targetPath")}),(0,t.jsx)(w.Input,{value:A,onChange:e=>{$(e.target.value),_(e.target.value===f)},placeholder:"/path/to/canonical/location",className:"mt-1 font-mono text-xs"})]}),F&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-sky-400",children:[(0,t.jsx)(e$.default,{className:"h-3 w-3"}),n("project.samePathInfo")]}),I&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),I]}),L&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),L]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eT.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:k,onChange:C})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:q,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!f||U?"opacity-50":""}`}),children:[U?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eS.Sparkles,{className:"h-3 w-3"}),U?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:f?n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eD.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),H()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:X,disabled:G,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:z?n("project.migrating"):n("common.create")})]})]})}),(0,t.jsx)(ez.FolderBrowserDialog,{open:N,onOpenChange:y,onSelect:e=>K(e)})]})}function eB({onCreateProject:e,username:a}){let{t:n,locale:i,setLocale:l}=(0,P.useI18n)(),{isOpen:c,toggleAssistant:d}=(0,eN.useAssistant)(),{resolvedTheme:u,toggleTheme:m,triggerRef:x}=function(){let{resolvedTheme:e,setTheme:t}=(0,L.useTheme)(),s=(0,r.useRef)(null),a=(0,r.useCallback)(r=>{let s="dark"===e?"light":"dark";if("u">typeof document&&"startViewTransition"in document&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){let e=r?.clientX??window.innerWidth/2,a=r?.clientY??0,n=Math.hypot(Math.max(e,window.innerWidth-e),Math.max(a,window.innerHeight-a));document.startViewTransition(()=>{t(s)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${e}px ${a}px)`,`circle(${n}px at ${e}px ${a}px)`]},{duration:400,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})}else t(s)},[e,t]);return{resolvedTheme:e,toggleTheme:a,triggerRef:s}}(),p=(0,s.useRouter)(),[g,j]=(0,r.useState)(!1),[w,N]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),j(!0))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("header",{className:"flex h-12 items-center justify-between border-b border-border bg-background/80 px-5 backdrop-blur-sm",children:[(0,t.jsx)("div",{className:"w-40"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{variant:"outline",onClick:()=>j(!0),className:"h-8 w-[400px] justify-start gap-2 bg-muted/50 text-muted-foreground hover:bg-muted",children:[(0,t.jsx)(O.Search,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"flex-1 text-left",suppressHydrationWarning:!0,children:n("topbar.searchPlaceholder")}),(0,t.jsxs)("kbd",{className:"mr-1 flex items-center gap-0.5 rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-mono",children:[(0,t.jsx)(B,{className:"h-2.5 w-2.5"}),"K"]})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{delay:500,render:(0,t.jsx)("button",{"data-tour":"open-assistant",onClick:d,"aria-label":n("assistant.iconLabel"),className:["cursor-pointer rounded-lg p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",c?"bg-accent text-foreground":""].join(" ")}),children:(0,t.jsx)(_.Bot,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("assistant.iconLabel")})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{variant:"ghost",onClick:()=>l("zh"===i?"en":"zh"),className:"text-muted-foreground"}),children:[(0,t.jsx)(F.Globe,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[11px] font-semibold",children:"zh"===i?"EN":"中"})]}),(0,t.jsx)(b.TooltipContent,{children:n("settings.language")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{ref:x,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===u?(0,t.jsx)(U.Sun,{className:"h-4 w-4"}):(0,t.jsx)(W.Moon,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("settings.theme")})]}),(0,t.jsx)("div",{className:"h-4 w-px bg-border"}),(0,t.jsxs)(v.Button,{variant:"outline",className:"gap-1.5 ring-1 ring-border hover:bg-accent",onClick:()=>k(!0),children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),n("topbar.importProject")]}),(0,t.jsxs)(v.Button,{"data-tour":"create-project",className:"gap-1.5 bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",onClick:()=>N(!0),children:[(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"}),n("topbar.newProject")]}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsx)(f.DropdownMenuTrigger,{render:(0,t.jsxs)("button",{className:"ml-0.5 flex cursor-pointer items-center gap-1.5 rounded-lg px-2.5 py-1 transition-colors hover:bg-accent",children:[a&&(0,t.jsx)("span",{className:"max-w-[80px] truncate text-xs text-muted-foreground",children:a}),(0,t.jsx)(el,{className:"h-7 w-7 ring-1 ring-border",children:(0,t.jsx)(ec,{className:"bg-emerald-500/20 text-emerald-400 text-[10px] font-semibold",children:a?a.trim().split(/\s+/).filter(e=>e.length>0).slice(0,2).map(e=>e[0].toUpperCase()).join(""):"U"})})]})}),(0,t.jsx)(f.DropdownMenuContent,{align:"end",sideOffset:8,className:"w-40",children:(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>p.push("/settings"),children:[(0,t.jsx)(I.Settings,{className:"mr-2 h-3.5 w-3.5"}),n("settings.title")]})})]})]})]}),(0,t.jsx)(ew,{open:g,onOpenChange:j}),(0,t.jsx)(eA,{open:w,onOpenChange:N,onCreateProject:e}),(0,t.jsx)(eI,{open:y,onOpenChange:k,onCreateProject:e})]})}var eF=e.i(79769),e_=r,eU=e.i(126741);class eW extends e_.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("[ErrorBoundary]",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-8 w-8 text-destructive"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:this.state.error?.message??"An unexpected error occurred"})]}),(0,t.jsxs)(v.Button,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:[(0,t.jsx)(eU.RefreshCw,{className:"mr-2 h-3.5 w-3.5"}),"Retry"]})]}):this.props.children}}var eH=e.i(244501),eK=e.i(415411),eV=e.i(458851);let eq=(0,eK.default)(()=>e.A(97351).then(e=>({default:e.AssistantChat})),{loadableGenerated:{modules:[834880]},ssr:!1});function eX({mode:e}){let{isOpen:r,closeAssistant:s,sessions:a,activeSessionId:n,createNewSession:i,switchSession:c,removeSession:d}=(0,eN.useAssistant)(),{t:u}=(0,P.useI18n)(),m=a.find(e=>e.id===n),x=m?.title??u("assistant.newSession");return(0,t.jsxs)("div",{className:"sidebar"===e?"min-w-[320px] max-w-[480px] w-[30vw] shrink-0 border-r border-border flex flex-col bg-sidebar overflow-hidden":"flex flex-col h-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"header-sm flex items-center px-4 gap-2 bg-sidebar",children:[(0,t.jsx)(_.Bot,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground shrink-0",children:u("assistant.title")}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsxs)(f.DropdownMenuTrigger,{className:"flex items-center gap-1 h-8 px-2 rounded-md text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground max-w-[120px] truncate","aria-label":u("assistant.sessionList"),children:[(0,t.jsx)("span",{className:"truncate",children:x}),(0,t.jsx)(eV.ChevronDown,{className:"h-3 w-3 shrink-0"})]}),(0,t.jsxs)(f.DropdownMenuContent,{side:"bottom",align:"end",sideOffset:4,children:[0===a.length?(0,t.jsx)("div",{className:"px-2 py-4 text-xs text-muted-foreground text-center",children:u("assistant.noSessions")}):a.map(e=>(0,t.jsxs)(f.DropdownMenuItem,{className:"flex items-center justify-between gap-2 pr-1",onClick:()=>c(e.id),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0",children:[(0,t.jsx)("span",{className:"text-xs truncate max-w-[140px]",children:e.title}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let s=Math.floor(r/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}(e.updatedAt)})]}),(0,t.jsx)(v.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100 hover:text-destructive",onClick:t=>{t.stopPropagation(),d(e.id)},"aria-label":u("assistant.deleteSession"),children:(0,t.jsx)(l.Trash2,{className:"h-3 w-3"})})]},e.id)),a.length>0&&(0,t.jsx)(f.DropdownMenuSeparator,{}),(0,t.jsxs)(f.DropdownMenuItem,{onClick:i,children:[(0,t.jsx)(o.Plus,{className:"h-3 w-3 mr-1"}),(0,t.jsx)("span",{className:"text-xs",children:u("assistant.newSession")})]})]})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:i,"aria-label":u("assistant.newSession"),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:s,"aria-label":u("assistant.closeLabel"),children:(0,t.jsx)(eh.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:r?(0,t.jsx)(eq,{}):null})]})}var eG=e.i(316403);function eJ({onDismiss:e}){let{t:s}=(0,P.useI18n)(),[a,n]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"Notification"in window&&"default"===window.Notification.permission&&n(!0)},[]);let o=async()=>{"default"!==await window.Notification.requestPermission()&&(n(!1),e?.())};return a?(0,t.jsxs)("div",{className:"fixed top-3 left-1/2 -translate-x-1/2 z-[9999] w-auto max-w-lg bg-card border rounded-lg shadow-lg px-4 py-2.5 flex items-center gap-3 animate-in fade-in slide-in-from-top-4 duration-500",children:[(0,t.jsx)(eG.Bell,{className:"h-4 w-4 shrink-0 text-primary"}),(0,t.jsx)("span",{className:"flex-1 text-sm",children:s("notification.permissionPrompt")}),(0,t.jsx)(v.Button,{size:"default",onClick:o,children:s("notification.allow")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"default",onClick:()=>{n(!1),e?.()},children:s("notification.dismiss")})]}):null}var eY=e.i(370951),eZ=e.i(690175);let eQ=[{target:"create-workspace",titleKey:"tour.step1.title",descKey:"tour.step1.desc",placement:"right"},{target:"create-project",titleKey:"tour.step2.title",descKey:"tour.step2.desc",placement:"bottom",waitForTarget:!0},{target:"open-assistant",titleKey:"tour.step3.title",descKey:"tour.step3.desc",placement:"bottom"}];function e0({onComplete:e}){let{t:s}=(0,P.useI18n)(),[a,n]=(0,r.useState)(0),[o,i]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1),d=(0,r.useRef)(null),u=eQ[a],m=(0,r.useCallback)(async()=>{await (0,eZ.setConfigValue)("onboarding.tourCompleted",!0),e()},[e]),x=(0,r.useCallback)(()=>u?document.querySelector(`[data-tour="${u.target}"]`):null,[u]),h=(0,r.useCallback)(()=>{let e=x();e?(i(e.getBoundingClientRect()),c(!0)):c(!1)},[x]);(0,r.useEffect)(()=>{h();let e=null;!l&&u?.waitForTarget&&(d.current=new MutationObserver(()=>{let t=x();t&&(i(t.getBoundingClientRect()),c(!0),d.current?.disconnect(),e&&clearTimeout(e))}),d.current.observe(document.body,{childList:!0,subtree:!0}),e=setTimeout(()=>{!x()&&(n(e=>{let t=e+1;return t<eQ.length?t:e}),a>=eQ.length-1&&m())},5e3));let t=()=>h();return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{d.current?.disconnect(),e&&clearTimeout(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[a,u,x,h,l,m]),(0,r.useEffect)(()=>{let e=setInterval(h,1e3);return()=>clearInterval(e)},[h]);let p=(0,r.useCallback)(()=>{a<eQ.length-1?(n(e=>e+1),c(!1)):m()},[a]);return u?(0,t.jsx)(t.Fragment,{children:l&&o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[10000]",style:{background:`radial-gradient(
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,899561,(e,t,r)=>{var s;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/project/f/tower/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/os-browserify/"),(s={}).endianness=function(){return"LE"},s.hostname=function(){return"u">typeof location?location.hostname:""},s.loadavg=function(){return[]},s.uptime=function(){return 0},s.freemem=function(){return Number.MAX_VALUE},s.totalmem=function(){return Number.MAX_VALUE},s.cpus=function(){return[]},s.type=function(){return"Browser"},s.release=function(){return"u">typeof navigator?navigator.appVersion:""},s.networkInterfaces=s.getNetworkInterfaces=function(){return{}},s.arch=function(){return"javascript"},s.platform=function(){return"browser"},s.tmpdir=s.tmpDir=function(){return"/tmp"},s.EOL="\n",s.homedir=function(){return"/"},t.exports=s},171159,(e,t,r)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,s="",a=0,n=-1,o=0,i=0;i<=e.length;++i){if(i<e.length)r=e.charCodeAt(i);else if(47===r)break;else r=47;if(47===r){if(n===i-1||1===o);else if(n!==i-1&&2===o){if(s.length<2||2!==a||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){var l=s.lastIndexOf("/");if(l!==s.length-1){-1===l?(s="",a=0):a=(s=s.slice(0,l)).length-1-s.lastIndexOf("/"),n=i,o=0;continue}}else if(2===s.length||1===s.length){s="",a=0,n=i,o=0;continue}}t&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+e.slice(n+1,i):s=e.slice(n+1,i),a=i-n-1;n=i,o=0}else 46===r&&-1!==o?++o:o=-1}return s}var s={resolve:function(){for(var e,s,a="",n=!1,o=arguments.length-1;o>=-1&&!n;o--)o>=0?s=arguments[o]:(void 0===e&&(e=""),s=e),t(s),0!==s.length&&(a=s+"/"+a,n=47===s.charCodeAt(0));if(a=r(a,!n),n)if(a.length>0)return"/"+a;else return"/";return a.length>0?a:"."},normalize:function(e){if(t(e),0===e.length)return".";var s=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!s)).length||s||(e="."),e.length>0&&a&&(e+="/"),s)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var a=arguments[r];t(a),a.length>0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":s.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=s.resolve(e))===(r=s.resolve(r)))return"";for(var a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var n=e.length,o=n-a,i=1;i<r.length&&47===r.charCodeAt(i);++i);for(var l=r.length-i,c=o<l?o:l,d=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===r.charCodeAt(i+u))return r.slice(i+u+1);else if(0===u)return r.slice(i+u)}else o>c&&(47===e.charCodeAt(a+u)?d=u:0===u&&(d=0));break}var m=e.charCodeAt(a+u);if(m!==r.charCodeAt(i+u))break;47===m&&(d=u)}var x="";for(u=a+d+1;u<=n;++u)(u===n||47===e.charCodeAt(u))&&(0===x.length?x+="..":x+="/..");return x.length>0?x+r.slice(i+d):(i+=d,47===r.charCodeAt(i)&&++i,r.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),s=47===r,a=-1,n=!0,o=e.length-1;o>=1;--o)if(47===(r=e.charCodeAt(o))){if(!n){a=o;break}}else n=!1;return -1===a?s?"/":".":s&&1===a?"//":e.slice(0,a)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var s,a=0,n=-1,o=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var i=r.length-1,l=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47===c){if(!o){a=s+1;break}}else -1===l&&(o=!1,l=s+1),i>=0&&(c===r.charCodeAt(i)?-1==--i&&(n=s):(i=-1,n=l))}return a===n?n=l:-1===n&&(n=e.length),e.slice(a,n)}for(s=e.length-1;s>=0;--s)if(47===e.charCodeAt(s)){if(!o){a=s+1;break}}else -1===n&&(o=!1,n=s+1);return -1===n?"":e.slice(a,n)},extname:function(e){t(e);for(var r=-1,s=0,a=-1,n=!0,o=0,i=e.length-1;i>=0;--i){var l=e.charCodeAt(i);if(47===l){if(!n){s=i+1;break}continue}-1===a&&(n=!1,a=i+1),46===l?-1===r?r=i:1!==o&&(o=1):-1!==r&&(o=-1)}return -1===r||-1===a||0===o||1===o&&r===a-1&&r===s+1?"":e.slice(r,a)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,s={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return s;var a=e.charCodeAt(0),n=47===a;n?(s.root="/",r=1):r=0;for(var o=-1,i=0,l=-1,c=!0,d=e.length-1,u=0;d>=r;--d){if(47===(a=e.charCodeAt(d))){if(!c){i=d+1;break}continue}-1===l&&(c=!1,l=d+1),46===a?-1===o?o=d:1!==u&&(u=1):-1!==o&&(u=-1)}return -1===o||-1===l||0===u||1===u&&o===l-1&&o===i+1?-1!==l&&(0===i&&n?s.base=s.name=e.slice(1,l):s.base=s.name=e.slice(i,l)):(0===i&&n?(s.name=e.slice(1,o),s.base=e.slice(1,l)):(s.name=e.slice(i,o),s.base=e.slice(i,l)),s.ext=e.slice(o,l)),i>0?s.dir=e.slice(0,i-1):n&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s}},r={};function s(t){var a=r[t];if(void 0!==a)return a.exports;var n=r[t]={exports:{}},o=!0;try{e[t](n,n.exports,s),o=!1}finally{o&&delete r[t]}return n.exports}s.ab="/ROOT/project/f/tower/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/path-browserify/",t.exports=s(114)}()},400395,e=>{"use strict";let t=(0,e.i(863961).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",0,t])},178755,e=>{"use strict";var t=e.i(432377),r=e.i(85212),s=e.i(309542),a=e.i(631325),n=e.i(565037),o=e.i(780156),i=e.i(923344),l=e.i(909260),c=e.i(746357),d=e.i(863961);let u=(0,d.default)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]),m=(0,d.default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var x=e.i(555159),h=e.i(478430);let p=(0,d.default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var f=e.i(942252),g=e.i(142124),j=e.i(718837),b=e.i(11915),v=e.i(711296),w=e.i(831349),N=e.i(543485);let y=(0,N.createServerReference)("4045532c037c0bb58b6d84a61e959dafafe8698f2c",N.callServer,void 0,N.findSourceMapURL,"createWorkspace"),k=(0,N.createServerReference)("603d8220d9971e2817d51cf9f94f942f90de024db3",N.callServer,void 0,N.findSourceMapURL,"updateWorkspace"),C=(0,N.createServerReference)("4085ad95cf4a1880515947752df5ee54e1942e78da",N.callServer,void 0,N.findSourceMapURL,"deleteWorkspace"),S=(0,N.createServerReference)("407673f8e11f3964af64ab6713c0aec3929f5255ae",N.callServer,void 0,N.findSourceMapURL,"getLabelsForWorkspace"),T=(0,N.createServerReference)("40f24916a951e2e62a7142c175dc8d9a848498ecff",N.callServer,void 0,N.findSourceMapURL,"createLabel"),D=(0,N.createServerReference)("408964737d16a75d0dafd270f39e1758fb20ea91ab",N.callServer,void 0,N.findSourceMapURL,"deleteLabel");var P=e.i(625054),R=e.i(286302);let M=["📋","🚀","🎯","💡","🔧","📦","🎨","📊","🔬","🌟","📝","🏗️"];function A({workspaces:e}){let d,j=(0,s.useRouter)(),w=(0,s.usePathname)(),{t:N}=(0,P.useI18n)(),[S,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&T(!0)},[]);let[D,z]=(0,r.useState)(!1),[L,O]=(0,r.useState)(!1),[I,B]=(0,r.useState)(!1),[F,_]=(0,r.useState)(null),[U,W]=(0,r.useState)(""),[H,K]=(0,r.useState)(M[0]),[V,q]=(0,r.useState)(null),X=w.split("/workspaces/")[1]?.split("/")[0],G=(0,r.useCallback)(()=>{T(e=>{let t=!e;return localStorage.setItem("sidebar-collapsed",String(t)),t})},[]),J=(0,r.useCallback)(async()=>{if(!U.trim())return;let e=await y({name:U.trim(),description:H});W(""),K(M[0]),z(!1),j.refresh(),j.push(`/workspaces/${e.id}`)},[U,H,j]),Y=(0,r.useCallback)(async()=>{U.trim()&&V&&(await k(V,{name:U.trim(),description:H}),W(""),O(!1),q(null),j.refresh())},[U,H,V,j]),Z=(0,r.useCallback)(e=>{q(e.id),W(e.name),K(e.description&&M.includes(e.description)?e.description:M[0]),O(!0)},[]),Q=(0,r.useCallback)(async(t,r)=>{if(e.length<=1)return void R.toast.error(N("sidebar.lastWorkspaceError"));if(confirm(N("sidebar.deleteConfirm",{name:r})))try{await C(t),j.refresh(),X===t&&j.push("/workspaces")}catch{R.toast.error(N("sidebar.lastWorkspaceError"))}},[X,j,N,e.length]),ee=(0,r.useCallback)(e=>{_(e),B(!0)},[]),et=e=>e.description&&M.includes(e.description)?e.description:e.name.charAt(0).toUpperCase();if(S){let r;return(0,t.jsxs)("aside",{className:"flex h-screen w-14 flex-col items-center border-r border-border bg-sidebar py-3",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:G,className:"mb-4 flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 ring-1 ring-primary/20 transition-transform hover:scale-105"}),children:(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-6 w-6 rounded"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.expand")})]}),(0,t.jsx)(g.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1 px-0.5 pt-1",children:[e.map(e=>{let r=X===e.id,s=et(e);return(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>{r||j.push(`/workspaces/${e.id}`)},className:`flex h-9 w-9 items-center justify-center rounded-lg transition-all ${r?"ring-1 ring-primary/20 text-foreground cursor-default":"text-muted-foreground hover:text-foreground cursor-pointer"}`}),children:(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:M.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold",children:s})})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:e.name})]},e.id)}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{"data-tour":"create-workspace",onClick:()=>z(!0),className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"}),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.newWorkspace")})]})]})}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(r=X||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/notes`),className:`rounded-lg p-2 transition-colors ${w.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(x.FileText,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.notes")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/assets`),className:`rounded-lg p-2 transition-colors ${w.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(h.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.assets")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/archive`),className:`rounded-lg p-2 transition-colors ${w.includes("/archive")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(n.Archive,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.archive")})]})]}):null,(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===w?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(p,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("missions.navLabel")})]})]}),(0,t.jsx)($,{open:D,onOpenChange:z,title:N("workspace.create"),name:U,onNameChange:W,icon:H,onIconChange:K,onSubmit:J,submitLabel:N("common.create"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")})]})}return(0,t.jsxs)("aside",{className:"noise relative flex h-screen w-56 flex-col border-r border-border bg-sidebar",children:[(0,t.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-4 py-4",children:[(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-9 w-9 rounded-lg"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Tower"}),(0,t.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground",children:"Studio"})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-xs",onClick:G,className:"text-muted-foreground",title:N("sidebar.collapse"),children:(0,t.jsx)(u,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-4 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:N("sidebar.workspace")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{W(""),K(M[0]),z(!0)},title:N("sidebar.newWorkspace"),children:(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)(g.ScrollArea,{className:"relative z-10 mt-2 flex-1 min-h-0",children:(0,t.jsx)("div",{className:"px-2 py-1",children:e.map(r=>{var s;let a,n,o,d=X===r.id,u=et(r);return(0,t.jsxs)("div",{className:`group relative flex items-center rounded-lg transition-all ${d?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,t.jsxs)("button",{onClick:()=>{d||j.push(`/workspaces/${r.id}`)},className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${d?"cursor-default":"cursor-pointer"}`,children:[(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:M.includes(u)?u:(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:u})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:`truncate text-sm font-medium ${d?"text-foreground":"text-secondary-foreground"}`,children:r.name}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(s=r.updatedAt,n=Math.floor((a=Date.now()-new Date(s).getTime())/6e4),o=Math.floor(a/36e5),n<60?`${n}m ago`:o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`)})]})]}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsx)(f.DropdownMenuTrigger,{render:(0,t.jsx)("button",{className:"mr-2 rounded-md p-1 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:e=>e.stopPropagation()}),children:(0,t.jsx)(c.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(f.DropdownMenuContent,{align:"start",side:"right",children:[(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>Z(r),children:[(0,t.jsx)(i.Pencil,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.rename")]}),(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>ee(r.id),children:[(0,t.jsx)(m,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.manageLabels")]}),(0,t.jsxs)(f.DropdownMenuItem,{className:e.length<=1?"text-muted-foreground opacity-50":"text-rose-400",disabled:e.length<=1,onClick:()=>Q(r.id,r.name),children:[(0,t.jsx)(l.Trash2,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.delete")]})]})]})]},r.id)})})}),(0,t.jsxs)(a.default,{href:"/missions",className:`relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] cursor-pointer transition-colors ${"/missions"===w?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(p,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("missions.navLabel")})]}),(d=X||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.default,{href:`/workspaces/${d}/notes`,className:"relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(x.FileText,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.notes")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${d}/assets`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.assets")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${d}/archive`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(n.Archive,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.archive")})]})]}):null,(0,t.jsx)($,{open:D,onOpenChange:z,title:N("workspace.create"),name:U,onNameChange:W,icon:H,onIconChange:K,onSubmit:J,submitLabel:N("common.create"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")}),(0,t.jsx)($,{open:L,onOpenChange:e=>{O(e),e||q(null)},title:N("workspace.edit"),name:U,onNameChange:W,icon:H,onIconChange:K,onSubmit:Y,submitLabel:N("common.save"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")}),F&&(0,t.jsx)(E,{open:I,onOpenChange:e=>{B(e),e||_(null)},workspaceId:F})]})}function $({open:e,onOpenChange:r,title:s,name:a,onNameChange:n,icon:o,onIconChange:i,onSubmit:l,submitLabel:c,nameLabel:d,iconLabel:u,namePlaceholder:m,cancelLabel:x}){return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:r,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:s})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d}),(0,t.jsx)(w.Input,{placeholder:m,value:a,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:u}),(0,t.jsx)("div",{className:"mt-1.5 grid grid-cols-6 gap-1.5",children:M.map(e=>(0,t.jsx)("button",{onClick:()=>i(e),className:`flex h-10 w-10 items-center justify-center rounded-lg text-lg transition-all ${o===e?"bg-primary/15 ring-2 ring-primary/30 scale-110":"bg-muted hover:bg-accent"}`,children:e},e))})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>r(!1),children:x}),(0,t.jsx)(v.Button,{onClick:l,disabled:!a.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:c})]})]})})}let z=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function E({open:e,onOpenChange:s,workspaceId:a}){let{t:n}=(0,P.useI18n)(),[o,i]=(0,r.useState)([]),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(z[0]);(0,r.useEffect)(()=>{e&&S(a).then(i)},[e,a]);let m=async()=>{l.trim()&&(await T({name:l.trim(),color:d,workspaceId:a}),i(await S(a)),c(""))},x=async e=>{await D(e),i(t=>t.filter(t=>t.id!==e))};return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:s,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("label.manage")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[o.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground",children:e.name}),e.isBuiltin?(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:n("label.builtin")}):(0,t.jsx)("button",{onClick:()=>x(e.id),className:"text-xs text-rose-400 hover:text-rose-300",children:n("common.delete")})]},e.id)),(0,t.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("label.name"),value:l,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"flex-1 h-8"}),(0,t.jsx)(v.Button,{size:"sm",onClick:m,disabled:!l.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:n("label.add")})]}),(0,t.jsx)("div",{className:"mt-2 flex gap-1.5",children:z.map(e=>(0,t.jsx)("button",{onClick:()=>u(e),className:`h-5 w-5 rounded-full transition-all ${d===e?"ring-2 ring-offset-2 ring-offset-background ring-foreground/30 scale-110":""}`,style:{backgroundColor:e}},e))})]})]})]})})}var L=e.i(275283),O=e.i(677436),I=e.i(103295);let B=(0,d.default)("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);var F=e.i(802461),_=e.i(867900),U=e.i(811424),W=e.i(809250);e.s([],732490),e.i(732490),e.i(129893);var H=e.i(793988),K=e.i(499875);let V=r.createContext(void 0);function q(){let e=r.useContext(V);if(void 0===e)throw Error((0,K.default)(13));return e}let X={imageLoadingStatus:()=>null},G=r.forwardRef(function(e,s){let{className:a,render:n,...o}=e,[i,l]=r.useState("idle"),c=r.useMemo(()=>({imageLoadingStatus:i,setImageLoadingStatus:l}),[i,l]),d=(0,H.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:s,props:o,stateAttributesMapping:X});return(0,t.jsx)(V.Provider,{value:c,children:d})});var J=e.i(357030),Y=e.i(284060),Z=e.i(412360),Q=e.i(144909),ee=e.i(883993),et=e.i(166508);let er={...X,...Q.transitionStatusMapping},es=r.forwardRef(function(e,t){let{className:s,render:a,onLoadingStatusChange:n,referrerPolicy:o,crossOrigin:i,...l}=e,c=q(),d=function(e,{referrerPolicy:t,crossOrigin:s}){let[a,n]=r.useState("idle");return(0,Y.useIsoLayoutEffect)(()=>{if(!e)return n("error"),et.NOOP;let r=!0,a=new window.Image,o=e=>()=>{r&&n(e)};return n("loading"),a.onload=o("loaded"),a.onerror=o("error"),t&&(a.referrerPolicy=t),a.crossOrigin=s??null,a.src=e,()=>{r=!1}},[e,s,t]),a}(e.src,{referrerPolicy:o,crossOrigin:i}),u="loaded"===d,{mounted:m,transitionStatus:x,setMounted:h}=(0,ee.useTransitionStatus)(u),p=r.useRef(null),f=(0,J.useStableCallback)(e=>{n?.(e),c.setImageLoadingStatus(e)});(0,Y.useIsoLayoutEffect)(()=>{"idle"!==d&&f(d)},[d,f]),(0,Z.useOpenChangeComplete)({open:u,ref:p,onComplete(){u||h(!1)}});let g=(0,H.useRenderElement)("img",e,{state:{imageLoadingStatus:d,transitionStatus:x},ref:[t,p],props:l,stateAttributesMapping:er,enabled:m});return m?g:null});var ea=e.i(617406);let en=r.forwardRef(function(e,t){let{className:s,render:a,delay:n,...o}=e,{imageLoadingStatus:i}=q(),[l,c]=r.useState(void 0===n),d=(0,ea.useTimeout)();return r.useEffect(()=>(void 0!==n&&d.start(n,()=>c(!0)),d.clear),[d,n]),(0,H.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:t,props:o,stateAttributesMapping:X,enabled:"loaded"!==i&&l})});e.s(["Fallback",0,en,"Image",0,es,"Root",0,G],50152);var eo=e.i(50152),eo=eo,ei=e.i(937756);function el({className:e,size:r="default",...s}){return(0,t.jsx)(eo.Root,{"data-slot":"avatar","data-size":r,className:(0,ei.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...s})}function ec({className:e,...r}){return(0,t.jsx)(eo.Fallback,{"data-slot":"avatar-fallback",className:(0,ei.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...r})}let ed=(0,d.default)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);var eu=e.i(357334);let em=(0,d.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]),ex=(0,d.default)("package-2",[["path",{d:"M12 3v6",key:"1holv5"}],["path",{d:"M16.76 3a2 2 0 0 1 1.8 1.1l2.23 4.479a2 2 0 0 1 .21.891V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9.472a2 2 0 0 1 .211-.894L5.45 4.1A2 2 0 0 1 7.24 3z",key:"187q7i"}],["path",{d:"M3.054 9.013h17.893",key:"grwhos"}]]);var eh=e.i(996032);let ep=(0,N.createServerReference)("60798cfb96bf7cac09a22fc324d9bfa6f70a069090",N.callServer,void 0,N.findSourceMapURL,"globalSearch");var ef=e.i(659680);let eg=[{id:"all",key:"search.all",icon:O.Search},{id:"task",key:"search.task",icon:x.FileText},{id:"project",key:"search.project",icon:ed},{id:"repository",key:"search.repository",icon:eu.GitBranch},{id:"note",key:"search.note",icon:em},{id:"asset",key:"search.asset",icon:ex}],ej=["task","project","repository","note","asset"],eb={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function ev({result:e,onSelect:r}){let s=eg.find(t=>t.id===e.type)?.icon??x.FileText;return(0,t.jsxs)("button",{onClick:()=>r(e),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-3 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,t.jsx)("div",{className:"rounded-md bg-muted p-1.5",children:(0,t.jsx)(s,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:e.title}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.subtitle}),e.snippet&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground/70 truncate mt-0.5",children:e.snippet})]})]})}function ew({open:e,onOpenChange:a}){let n,{t:o}=(0,P.useI18n)(),i=(0,s.useRouter)(),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)("all"),[m,x]=(0,r.useState)([]),[h,p]=(0,r.useState)(!1),[f,b]=(0,r.useState)(250),w=(0,r.useRef)(null),N=(0,r.useRef)(null);(0,r.useEffect)(()=>{e&&((0,ef.getConfigValue)("search.debounceMs",250).then(b),setTimeout(()=>w.current?.focus(),100),c(""),x([]))},[e]),(0,r.useEffect)(()=>{if(N.current&&clearTimeout(N.current),!l.trim()){x([]),p(!1);return}p(!0);let e=!1;return N.current=setTimeout(async()=>{let t=await ep(l,d);e||(x(t),p(!1))},f),()=>{N.current&&clearTimeout(N.current),e=!0}},[l,d,f]);let y=(0,r.useCallback)(e=>{i.push(e.navigateTo),a(!1)},[i,a]);return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden !top-[10vh] !-translate-y-0",showCloseButton:!1,children:[(0,t.jsxs)("div",{className:"flex items-center border-b border-border px-4",children:[(0,t.jsx)(O.Search,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("input",{ref:w,value:l,onChange:e=>c(e.target.value),placeholder:o("search.placeholder"),className:"flex-1 bg-transparent px-3 py-3.5 text-sm text-foreground placeholder-muted-foreground outline-none"}),l&&(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",onClick:()=>{c(""),x([])},className:"text-muted-foreground",children:(0,t.jsx)(eh.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:eg.map(e=>{let r=e.icon;return(0,t.jsxs)("button",{onClick:()=>u(e.id),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-all ${d===e.id?"bg-primary/10 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3 w-3"}),o(e.key)]},e.id)})}),(0,t.jsxs)(g.ScrollArea,{className:"max-h-80",children:[!l.trim()&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.typeToSearch")}),l.trim()&&0===m.length&&!h&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.noResults")}),"all"===d&&m.length>0&&(n=m.reduce((e,t)=>((e[t.type]??=[]).push(t),e),{}),ej.filter(e=>n[e]?.length).map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:o(eb[e])}),n[e].map(e=>(0,t.jsx)(ev,{result:e,onSelect:y},`${e.type}-${e.id}`))]},e))),"all"!==d&&m.map(e=>(0,t.jsx)(ev,{result:e,onSelect:y},`${e.type}-${e.id}`))]})]})})}var eN=e.i(86982),ey=e.i(946960),ek=e.i(893832),eC=e.i(894296),eS=e.i(239358),eT=e.i(584685),eD=e.i(540032);function eP(e){return e.replace(/\.git\/?$/,"")}e.i(899561),e.i(171159);let eR=(0,N.createServerReference)("40f717adff2971d11320b6aa0d6ba72cc3dae7b53d",N.callServer,void 0,N.findSourceMapURL,"resolveGitLocalPath");var eM=e.i(597379);function eA({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,P.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,h]=(0,r.useState)(""),[p,f]=(0,r.useState)(""),[g,N]=(0,r.useState)(!1),[y,k]=(0,r.useState)("FRONTEND"),[C,S]=(0,r.useState)("idle"),[T,D]=(0,r.useState)(""),[M,A]=(0,r.useState)(!1),$=()=>{l(""),d(""),m(""),h(""),f(""),N(!1),k("FRONTEND"),S("idle"),D(""),A(!1)},z=async()=>{if(p.trim()&&!M&&"success"===C){A(!0);try{let e=await (0,eM.analyzeProjectDirectory)(p.trim(),o);m(e)}catch{R.toast.error(n("project.analyzeError"))}finally{A(!1)}}},E=async e=>{h(e),S("idle"),D("");let t=function(e){let t,r=e.match(/^git@([^:]+):(.+)$/);if(r)return{host:r[1],pathSegments:eP(r[2]).split("/").filter(Boolean)};try{t=new URL(e)}catch{return null}return{host:t.hostname,pathSegments:eP(decodeURIComponent(t.pathname)).split("/").filter(Boolean)}}(e);t&&t.pathSegments.length>0&&l(t.pathSegments[t.pathSegments.length-1]),g||f(await eR(e))},L=async()=>{if(x.trim()&&p.trim()){S("cloning"),D("");try{let e=function(e){let t=e.trim();if(!t)return"";if(t.startsWith("git@")||t.startsWith("ssh://")||t.endsWith(".git"))return t;try{let e=new URL(t),r=e.hostname,s=decodeURIComponent(e.pathname).split("/").filter(Boolean);if("code.iflytek.com"===r){let e=[...s];"osc"===e[0]&&"_source"===e[1]&&(e=e.slice(2));let a=e.indexOf("-");if(a>0&&(e=e.slice(0,a)),0===e.length)return t;return`https://${r}/${e.join("/")}.git`}return`${e.origin}${e.pathname.replace(/\/$/,"")}.git`}catch{return t}}(x.trim()),t=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:e,path:p.trim()})}),r=await t.json();if(!t.ok){S("error"),D(r.error||"Clone failed");return}S("success")}catch{S("error"),D("Network error")}}},O=async()=>{i.trim()&&(await a?.({name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:x.trim()||void 0,localPath:p.trim()||void 0,projectType:y}),$(),s(!1))};return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||$()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.newProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.gitUrlHint")}),(0,t.jsx)(w.Input,{placeholder:n("project.gitPlaceholder"),value:x,onChange:e=>E(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.localPathHint")}),(0,t.jsx)(w.Input,{placeholder:n("project.localPathPlaceholder"),value:p,onChange:e=>{f(e.target.value),N(!0)},className:"mt-1.5 font-mono text-xs w-full"}),p.trim().startsWith("~")&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),n("project.tildeWarning")]}),x.trim()&&p.trim()&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{type:"button",disabled:"cloning"===C||"success"===C,onClick:L,className:"gap-1.5 text-xs bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/25 hover:bg-emerald-500/25 disabled:opacity-50",children:["cloning"===C?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===C?(0,t.jsx)(ek.Check,{className:"h-3 w-3"}):(0,t.jsx)(eu.GitBranch,{className:"h-3 w-3"}),"cloning"===C?n("git.cloning"):"success"===C?n("git.cloned"):n("git.clone")]}),"error"===C&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),T]}),"success"===C&&(0,t.jsx)("span",{className:"text-[11px] text-emerald-400",children:n("git.cloneSuccess")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eT.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:y,onChange:k})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:z,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!p.trim()||M?"opacity-50":""}`}),children:[M?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eS.Sparkles,{className:"h-3 w-3"}),M?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:p.trim()?"success"!==C?n("project.genDescNotCloned"):n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eD.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),$()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:O,disabled:!i.trim()||M,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:n("common.create")})]})]})})})}var e$=e.i(400395),e$=e$,ez=e.i(921280),eE=e.i(330521);let eL=(0,N.createServerReference)("6084196ed91ce6b364ea04c8d3a457cec94f6f3ddb",N.callServer,void 0,N.findSourceMapURL,"migrateProjectPath"),eO=(0,N.createServerReference)("40d8d13e21f2d36893466011a1cf361785de56c009",N.callServer,void 0,N.findSourceMapURL,"checkMigrationSafety");function eI({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,P.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,p]=(0,r.useState)(""),[f,g]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("FRONTEND"),[S,T]=(0,r.useState)(!1),[D,M]=(0,r.useState)(!1),[A,$]=(0,r.useState)(""),[z,E]=(0,r.useState)(!1),[L,O]=(0,r.useState)(""),[I,B]=(0,r.useState)(""),[F,_]=(0,r.useState)(!1),[U,W]=(0,r.useState)(!1),H=()=>{l(""),d(""),m(""),p(""),g(""),C("FRONTEND"),T(!1),M(!1),$(""),E(!1),O(""),B(""),_(!1),W(!1)},K=async e=>{g(e),T(!1),M(!1),$(""),O(""),B(""),_(!1),l(e.split("/").filter(Boolean).pop()??"");try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();if(e.isGit&&e.remoteUrl){p(e.remoteUrl),T(!0);let t=e.remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);t&&l(t[1])}}}catch{}},V=(0,r.useCallback)(async e=>{if(M(e),O(""),B(""),_(!1),!e)return void $("");if(x)try{let e=await eR(x);e&&($(e),e===f&&_(!0))}catch{}if(f)try{let e=await fetch(`/api/git?path=${encodeURIComponent(f)}&checkWorktrees=true`);e.ok&&(await e.json()).hasWorktrees&&B(n("project.worktreeWarning"))}catch{}},[x,f]),q=async()=>{if(f&&!U){W(!0);try{let e=await (0,eM.analyzeProjectDirectory)(f.trim(),o);m(e)}catch{R.toast.error(n("project.analyzeError"))}finally{W(!1)}}},X=async()=>{if(!i.trim())return;let e={name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:x.trim()||void 0,localPath:f.trim()||void 0,projectType:k},t=await a?.(e);if(D&&A&&A!==f&&t&&"id"in t){E(!0),O("");let e=await eO(t.id);if(!e.safe){O(e.reason),E(!1);return}let r=await eL(t.id,A);if(E(!1),!r.success)return void O(r.error??n("project.migrateError"));R.toast.success(n("project.migrateSuccess"))}H(),s(!1)},G=!i.trim()||!f.trim()||z||U||D&&!!I;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||H()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.importProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.importHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{value:f,readOnly:!0,placeholder:n("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs bg-muted/30"}),(0,t.jsxs)(v.Button,{type:"button",variant:"outline",onClick:()=>y(!0),className:"shrink-0 gap-1.5",children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),n("folder.browse")]})]}),S&&(0,t.jsx)("p",{className:"mt-1.5 text-[11px] text-emerald-400",children:n("project.autoDetected")})]}),x&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)(w.Input,{value:x,onChange:e=>p(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),S&&f&&(0,t.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:n("project.migrate")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.migrateHint")})]}),(0,t.jsx)(eE.Switch,{checked:D,onCheckedChange:e=>V(e)})]}),D&&(0,t.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-medium text-muted-foreground",children:n("project.targetPath")}),(0,t.jsx)(w.Input,{value:A,onChange:e=>{$(e.target.value),_(e.target.value===f)},placeholder:"/path/to/canonical/location",className:"mt-1 font-mono text-xs"})]}),F&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-sky-400",children:[(0,t.jsx)(e$.default,{className:"h-3 w-3"}),n("project.samePathInfo")]}),I&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),I]}),L&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),L]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eT.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:k,onChange:C})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:q,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!f||U?"opacity-50":""}`}),children:[U?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eS.Sparkles,{className:"h-3 w-3"}),U?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:f?n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eD.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),H()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:X,disabled:G,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:z?n("project.migrating"):n("common.create")})]})]})}),(0,t.jsx)(ez.FolderBrowserDialog,{open:N,onOpenChange:y,onSelect:e=>K(e)})]})}function eB({onCreateProject:e,username:a}){let{t:n,locale:i,setLocale:l}=(0,P.useI18n)(),{isOpen:c,toggleAssistant:d}=(0,eN.useAssistant)(),{resolvedTheme:u,toggleTheme:m,triggerRef:x}=function(){let{resolvedTheme:e,setTheme:t}=(0,L.useTheme)(),s=(0,r.useRef)(null),a=(0,r.useCallback)(r=>{let s="dark"===e?"light":"dark";if("u">typeof document&&"startViewTransition"in document&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){let e=r?.clientX??window.innerWidth/2,a=r?.clientY??0,n=Math.hypot(Math.max(e,window.innerWidth-e),Math.max(a,window.innerHeight-a));document.startViewTransition(()=>{t(s)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${e}px ${a}px)`,`circle(${n}px at ${e}px ${a}px)`]},{duration:400,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})}else t(s)},[e,t]);return{resolvedTheme:e,toggleTheme:a,triggerRef:s}}(),p=(0,s.useRouter)(),[g,j]=(0,r.useState)(!1),[w,N]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),j(!0))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("header",{className:"flex h-12 items-center justify-between border-b border-border bg-background/80 px-5 backdrop-blur-sm",children:[(0,t.jsx)("div",{className:"w-40"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{variant:"outline",onClick:()=>j(!0),className:"h-8 w-[400px] justify-start gap-2 bg-muted/50 text-muted-foreground hover:bg-muted",children:[(0,t.jsx)(O.Search,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"flex-1 text-left",suppressHydrationWarning:!0,children:n("topbar.searchPlaceholder")}),(0,t.jsxs)("kbd",{className:"mr-1 flex items-center gap-0.5 rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-mono",children:[(0,t.jsx)(B,{className:"h-2.5 w-2.5"}),"K"]})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{delay:500,render:(0,t.jsx)("button",{"data-tour":"open-assistant",onClick:d,"aria-label":n("assistant.iconLabel"),className:["cursor-pointer rounded-lg p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",c?"bg-accent text-foreground":""].join(" ")}),children:(0,t.jsx)(_.Bot,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("assistant.iconLabel")})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{variant:"ghost",onClick:()=>l("zh"===i?"en":"zh"),className:"text-muted-foreground"}),children:[(0,t.jsx)(F.Globe,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[11px] font-semibold",children:"zh"===i?"EN":"中"})]}),(0,t.jsx)(b.TooltipContent,{children:n("settings.language")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{ref:x,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===u?(0,t.jsx)(U.Sun,{className:"h-4 w-4"}):(0,t.jsx)(W.Moon,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("settings.theme")})]}),(0,t.jsx)("div",{className:"h-4 w-px bg-border"}),(0,t.jsxs)(v.Button,{variant:"outline",className:"gap-1.5 ring-1 ring-border hover:bg-accent",onClick:()=>k(!0),children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),n("topbar.importProject")]}),(0,t.jsxs)(v.Button,{"data-tour":"create-project",className:"gap-1.5 bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",onClick:()=>N(!0),children:[(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"}),n("topbar.newProject")]}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsx)(f.DropdownMenuTrigger,{render:(0,t.jsxs)("button",{className:"ml-0.5 flex cursor-pointer items-center gap-1.5 rounded-lg px-2.5 py-1 transition-colors hover:bg-accent",children:[a&&(0,t.jsx)("span",{className:"max-w-[80px] truncate text-xs text-muted-foreground",children:a}),(0,t.jsx)(el,{className:"h-7 w-7 ring-1 ring-border",children:(0,t.jsx)(ec,{className:"bg-emerald-500/20 text-emerald-400 text-[10px] font-semibold",children:a?a.trim().split(/\s+/).filter(e=>e.length>0).slice(0,2).map(e=>e[0].toUpperCase()).join(""):"U"})})]})}),(0,t.jsx)(f.DropdownMenuContent,{align:"end",sideOffset:8,className:"w-40",children:(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>p.push("/settings"),children:[(0,t.jsx)(I.Settings,{className:"mr-2 h-3.5 w-3.5"}),n("settings.title")]})})]})]})]}),(0,t.jsx)(ew,{open:g,onOpenChange:j}),(0,t.jsx)(eA,{open:w,onOpenChange:N,onCreateProject:e}),(0,t.jsx)(eI,{open:y,onOpenChange:k,onCreateProject:e})]})}var eF=e.i(79769),e_=r,eU=e.i(126741);class eW extends e_.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("[ErrorBoundary]",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-8 w-8 text-destructive"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:this.state.error?.message??"An unexpected error occurred"})]}),(0,t.jsxs)(v.Button,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:[(0,t.jsx)(eU.RefreshCw,{className:"mr-2 h-3.5 w-3.5"}),"Retry"]})]}):this.props.children}}var eH=e.i(104075),eK=e.i(415411),eV=e.i(458851);let eq=(0,eK.default)(()=>e.A(97351).then(e=>({default:e.AssistantChat})),{loadableGenerated:{modules:[834880]},ssr:!1});function eX({mode:e}){let{isOpen:r,closeAssistant:s,sessions:a,activeSessionId:n,createNewSession:i,switchSession:c,removeSession:d}=(0,eN.useAssistant)(),{t:u}=(0,P.useI18n)(),m=a.find(e=>e.id===n),x=m?.title??u("assistant.newSession");return(0,t.jsxs)("div",{className:"sidebar"===e?"min-w-[320px] max-w-[480px] w-[30vw] shrink-0 border-r border-border flex flex-col bg-sidebar overflow-hidden":"flex flex-col h-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"header-sm flex items-center px-4 gap-2 bg-sidebar",children:[(0,t.jsx)(_.Bot,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground shrink-0",children:u("assistant.title")}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsxs)(f.DropdownMenuTrigger,{className:"flex items-center gap-1 h-8 px-2 rounded-md text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground max-w-[120px] truncate","aria-label":u("assistant.sessionList"),children:[(0,t.jsx)("span",{className:"truncate",children:x}),(0,t.jsx)(eV.ChevronDown,{className:"h-3 w-3 shrink-0"})]}),(0,t.jsxs)(f.DropdownMenuContent,{side:"bottom",align:"end",sideOffset:4,children:[0===a.length?(0,t.jsx)("div",{className:"px-2 py-4 text-xs text-muted-foreground text-center",children:u("assistant.noSessions")}):a.map(e=>(0,t.jsxs)(f.DropdownMenuItem,{className:"flex items-center justify-between gap-2 pr-1",onClick:()=>c(e.id),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0",children:[(0,t.jsx)("span",{className:"text-xs truncate max-w-[140px]",children:e.title}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let s=Math.floor(r/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}(e.updatedAt)})]}),(0,t.jsx)(v.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100 hover:text-destructive",onClick:t=>{t.stopPropagation(),d(e.id)},"aria-label":u("assistant.deleteSession"),children:(0,t.jsx)(l.Trash2,{className:"h-3 w-3"})})]},e.id)),a.length>0&&(0,t.jsx)(f.DropdownMenuSeparator,{}),(0,t.jsxs)(f.DropdownMenuItem,{onClick:i,children:[(0,t.jsx)(o.Plus,{className:"h-3 w-3 mr-1"}),(0,t.jsx)("span",{className:"text-xs",children:u("assistant.newSession")})]})]})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:i,"aria-label":u("assistant.newSession"),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:s,"aria-label":u("assistant.closeLabel"),children:(0,t.jsx)(eh.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:r?(0,t.jsx)(eq,{}):null})]})}var eG=e.i(316403);function eJ({onDismiss:e}){let{t:s}=(0,P.useI18n)(),[a,n]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"Notification"in window&&"default"===window.Notification.permission&&n(!0)},[]);let o=async()=>{"default"!==await window.Notification.requestPermission()&&(n(!1),e?.())};return a?(0,t.jsxs)("div",{className:"fixed top-3 left-1/2 -translate-x-1/2 z-[9999] w-auto max-w-lg bg-card border rounded-lg shadow-lg px-4 py-2.5 flex items-center gap-3 animate-in fade-in slide-in-from-top-4 duration-500",children:[(0,t.jsx)(eG.Bell,{className:"h-4 w-4 shrink-0 text-primary"}),(0,t.jsx)("span",{className:"flex-1 text-sm",children:s("notification.permissionPrompt")}),(0,t.jsx)(v.Button,{size:"default",onClick:o,children:s("notification.allow")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"default",onClick:()=>{n(!1),e?.()},children:s("notification.dismiss")})]}):null}var eY=e.i(740529),eZ=e.i(55364);let eQ=[{target:"create-workspace",titleKey:"tour.step1.title",descKey:"tour.step1.desc",placement:"right"},{target:"create-project",titleKey:"tour.step2.title",descKey:"tour.step2.desc",placement:"bottom",waitForTarget:!0},{target:"open-assistant",titleKey:"tour.step3.title",descKey:"tour.step3.desc",placement:"bottom"}];function e0({onComplete:e}){let{t:s}=(0,P.useI18n)(),[a,n]=(0,r.useState)(0),[o,i]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1),d=(0,r.useRef)(null),u=eQ[a],m=(0,r.useCallback)(async()=>{await (0,eZ.setConfigValue)("onboarding.tourCompleted",!0),e()},[e]),x=(0,r.useCallback)(()=>u?document.querySelector(`[data-tour="${u.target}"]`):null,[u]),h=(0,r.useCallback)(()=>{let e=x();e?(i(e.getBoundingClientRect()),c(!0)):c(!1)},[x]);(0,r.useEffect)(()=>{h();let e=null;!l&&u?.waitForTarget&&(d.current=new MutationObserver(()=>{let t=x();t&&(i(t.getBoundingClientRect()),c(!0),d.current?.disconnect(),e&&clearTimeout(e))}),d.current.observe(document.body,{childList:!0,subtree:!0}),e=setTimeout(()=>{!x()&&(n(e=>{let t=e+1;return t<eQ.length?t:e}),a>=eQ.length-1&&m())},5e3));let t=()=>h();return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{d.current?.disconnect(),e&&clearTimeout(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[a,u,x,h,l,m]),(0,r.useEffect)(()=>{let e=setInterval(h,1e3);return()=>clearInterval(e)},[h]);let p=(0,r.useCallback)(()=>{a<eQ.length-1?(n(e=>e+1),c(!1)):m()},[a]);return u?(0,t.jsx)(t.Fragment,{children:l&&o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[10000]",style:{background:`radial-gradient(
2
2
  ellipse at ${o.left+o.width/2}px ${o.top+o.height/2}px,
3
3
  transparent ${Math.max(o.width,o.height)}px,
4
4
  rgba(0,0,0,0.6) ${Math.max(o.width,o.height)+30}px
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,398045,e=>{"use strict";var r=e.i(543485);let t=(0,r.createServerReference)("4064da2431a3e58576cf3e90ba9bf4214769cf2121",r.callServer,void 0,r.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,t])},203529,e=>{"use strict";var r=e.i(337590),t=e.i(793988),a=e.i(164688),i=e.i(937756);let d=(0,a.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:a="default",render:n,...s}){var o;return o={defaultTagName:"span",props:(0,r.mergeProps)({className:(0,i.cn)(d({variant:a}),e)},s),render:n,state:{slot:"badge",variant:a}},(0,t.useRenderElement)(o.defaultTagName??"div",o,o)}],203529)},750986,1156,e=>{"use strict";var r=e.i(419613);e.s(["CheckCircle2",()=>r.default],750986);let t=(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,t],1156)},950211,e=>{"use strict";let r=(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,r],950211)},854860,e=>{"use strict";var r=e.i(543485);let t=(0,r.createServerReference)("40469f2202d21113210f7781acdbc73dad857aa680",r.callServer,void 0,r.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,t])},9433,e=>{"use strict";var r=e.i(432377),t=e.i(937756);e.s(["Label",0,function({className:e,...a}){return(0,r.jsx)("label",{"data-slot":"label",className:(0,t.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),...a})}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,702310,e=>{"use strict";var r=e.i(543485);let t=(0,r.createServerReference)("405c05edca6d848111ef9bf828871ea1a8a7c2e1ae",r.callServer,void 0,r.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,t])},203529,e=>{"use strict";var r=e.i(337590),t=e.i(793988),a=e.i(164688),i=e.i(937756);let d=(0,a.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:a="default",render:n,...s}){var o;return o={defaultTagName:"span",props:(0,r.mergeProps)({className:(0,i.cn)(d({variant:a}),e)},s),render:n,state:{slot:"badge",variant:a}},(0,t.useRenderElement)(o.defaultTagName??"div",o,o)}],203529)},750986,1156,e=>{"use strict";var r=e.i(419613);e.s(["CheckCircle2",()=>r.default],750986);let t=(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,t],1156)},155996,e=>{"use strict";var r=e.i(543485);let t=(0,r.createServerReference)("40dd2ab0c8b2fb4ecc971b049e181389621ccbe851",r.callServer,void 0,r.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,t])},9433,e=>{"use strict";var r=e.i(432377),t=e.i(937756);e.s(["Label",0,function({className:e,...a}){return(0,r.jsx)("label",{"data-slot":"label",className:(0,t.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),...a})}])}]);