@agent-spaces/server 0.3.64 → 0.3.67

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 (332) hide show
  1. package/dist/adapters/agent-runtime.js +4 -0
  2. package/dist/adapters/claude-code-runtime/index.js +68 -2
  3. package/dist/adapters/claude-code-runtime/message-format.js +26 -0
  4. package/dist/adapters/claude-code-runtime/sdk-config.js +12 -0
  5. package/dist/adapters/codex-function-tool-bridge.js +144 -0
  6. package/dist/adapters/codex-runtime.js +23 -4
  7. package/dist/adapters/git.js +25 -7
  8. package/dist/adapters/hermes-runtime.js +210 -0
  9. package/dist/agents/agent-message-parts.js +1 -1
  10. package/dist/agents/commit-agent.js +4 -2
  11. package/dist/agents/issue-task-controller.js +75 -4
  12. package/dist/agents/pull-request-agent.js +115 -0
  13. package/dist/agents/scheduler-agent.js +1 -1
  14. package/dist/app.js +12 -70
  15. package/dist/middleware/auth.js +1 -1
  16. package/dist/package.json +2 -1
  17. package/dist/routes/agent-sse.js +2 -0
  18. package/dist/routes/agent.js +3 -0
  19. package/dist/routes/database.js +1 -0
  20. package/dist/routes/git.js +197 -317
  21. package/dist/routes/issue.js +1 -1
  22. package/dist/routes/notification.js +10 -0
  23. package/dist/routes/robot-account.js +68 -0
  24. package/dist/routes/version.js +94 -0
  25. package/dist/routes/worktree.js +93 -0
  26. package/dist/services/agent.js +37 -3
  27. package/dist/services/builtin-tools/kanban-tools.js +4 -0
  28. package/dist/services/git-operation-log.js +40 -0
  29. package/dist/services/global-wechat-qr.js +72 -0
  30. package/dist/services/hook-engine.js +175 -17
  31. package/dist/services/notification-center.js +9 -0
  32. package/dist/services/notification-hub/bot-agent.js +3 -1
  33. package/dist/services/notification-hub/service.js +12 -2
  34. package/dist/services/robot-account.js +34 -0
  35. package/dist/services/version.js +59 -0
  36. package/dist/services/workflow-command-runner.js +23 -0
  37. package/dist/services/workflow.js +25 -8
  38. package/dist/services/workspace.js +25 -1
  39. package/dist/services/worktree.js +207 -0
  40. package/dist/storage/robot-account-store.js +39 -0
  41. package/dist/storage/worktree-store.js +33 -0
  42. package/dist/web/404.html +1 -1
  43. package/dist/web/__next.__PAGE__.txt +4 -4
  44. package/dist/web/__next._full.txt +23 -25
  45. package/dist/web/__next._head.txt +4 -4
  46. package/dist/web/__next._index.txt +13 -13
  47. package/dist/web/__next._tree.txt +2 -2
  48. package/dist/web/_next/static/chunks/{0n6_4so_afuwk.js → 0-92u-tiuy40a.js} +4 -4
  49. package/dist/web/_next/static/chunks/{0vbqaynjq8ga..js → 0-yizd8osmas2.js} +1 -1
  50. package/dist/web/_next/static/chunks/0.ln~3mnv8.69.js +1 -0
  51. package/dist/web/_next/static/chunks/{0iuf30t0rjsjv.js → 01y3e9pemva7b.js} +10 -10
  52. package/dist/web/_next/static/chunks/02802taez976w.js +67 -0
  53. package/dist/web/_next/static/chunks/02l~tmzrgny.~.js +1 -0
  54. package/dist/web/_next/static/chunks/033.awk90g6eh.js +1 -0
  55. package/dist/web/_next/static/chunks/03f1bwuynjdmk.js +1 -0
  56. package/dist/web/_next/static/chunks/04cb4kc9r2pd1.js +1 -0
  57. package/dist/web/_next/static/chunks/04de6ha5_e3pp.js +1 -0
  58. package/dist/web/_next/static/chunks/06.kdsa9rr2h1.js +1 -0
  59. package/dist/web/_next/static/chunks/09he0p79ov1rn.js +1 -0
  60. package/dist/web/_next/static/chunks/09vpocs4zuc8h.js +1 -0
  61. package/dist/web/_next/static/chunks/0_o2exgr0e_nh.js +1 -0
  62. package/dist/web/_next/static/chunks/{0xbaakj0dfc0..js → 0_y9nskc-xt2k.js} +1 -1
  63. package/dist/web/_next/static/chunks/0clnj-1fi6u8j.js +3 -0
  64. package/dist/web/_next/static/chunks/0gv40by0zzxs_.js +1 -0
  65. package/dist/web/_next/static/chunks/0iusr8y88.kjg.js +1 -0
  66. package/dist/web/_next/static/chunks/{04a4vsq2wknm4.js → 0j-8418fxvkd1.js} +1 -1
  67. package/dist/web/_next/static/chunks/0j-l7l_k9jt45.js +1 -0
  68. package/dist/web/_next/static/chunks/0j.wxxyoclma5.js +1 -0
  69. package/dist/web/_next/static/chunks/0jq.16sozqik..js +3 -0
  70. package/dist/web/_next/static/chunks/0jw8xdk_fpnp0.css +1 -0
  71. package/dist/web/_next/static/chunks/0l1lkd-wcotma.js +1 -0
  72. package/dist/web/_next/static/chunks/0ncxf_zr4n839.js +1 -0
  73. package/dist/web/_next/static/chunks/0ndo7um~v7vco.js +1 -0
  74. package/dist/web/_next/static/chunks/0ngk.~kan8wq_.js +1 -0
  75. package/dist/web/_next/static/chunks/0p3h-h3zj5ujg.js +30 -0
  76. package/dist/web/_next/static/chunks/0pm-un~-sy3rl.js +1 -0
  77. package/dist/web/_next/static/chunks/0rt9bofnn6qvn.js +1 -0
  78. package/dist/web/_next/static/chunks/0t64.9jd00hio.js +3 -0
  79. package/dist/web/_next/static/chunks/0taui9--5n6-5.js +1 -0
  80. package/dist/web/_next/static/chunks/0ty39169lh~z3.js +1 -0
  81. package/dist/web/_next/static/chunks/0uxzi~9b~k4mn.js +31 -0
  82. package/dist/web/_next/static/chunks/0v8nof~waedlu.js +1 -0
  83. package/dist/web/_next/static/chunks/{0ctg5qmw7uu.1.js → 0vcfoagnpf.aw.js} +3 -3
  84. package/dist/web/_next/static/chunks/{08ckpwmmwlors.js → 0wwwq.gyyz0vg.js} +3 -3
  85. package/dist/web/_next/static/chunks/0x5lak8yz7pm7.js +1 -0
  86. package/dist/web/_next/static/chunks/0xon_.4-o0_zq.js +7 -0
  87. package/dist/web/_next/static/chunks/0zjnrbt7inime.js +1 -0
  88. package/dist/web/_next/static/chunks/0zncg76rgtbm-.js +1 -0
  89. package/dist/web/_next/static/chunks/0zwebpitvpuv1.js +1 -0
  90. package/dist/web/_next/static/chunks/0~02o4g-o6n~m.js +1 -0
  91. package/dist/web/_next/static/chunks/{10l-9myrdo3x9.js → 0~fjezp.k4qk3.js} +1 -1
  92. package/dist/web/_next/static/chunks/0~sh93re1-_rp.js +1 -0
  93. package/dist/web/_next/static/chunks/10_niiq0k6o-p.js +5 -0
  94. package/dist/web/_next/static/chunks/12tjr0_2ccrtq.js +2 -0
  95. package/dist/web/_next/static/chunks/12x5.go_x9mfk.js +1 -0
  96. package/dist/web/_next/static/chunks/{1442stwa0gbxe.js → 12~5dk9i9d16t.js} +2 -2
  97. package/dist/web/_next/static/chunks/13iye4rv5p31b.js +1 -0
  98. package/dist/web/_next/static/chunks/{01~quun6sefgl.js → 13~y-b.b9rrw4.js} +1 -1
  99. package/dist/web/_next/static/chunks/151wzhb5q0lo5.js +1 -0
  100. package/dist/web/_next/static/chunks/18c7g84y01mj0.js +1 -0
  101. package/dist/web/_next/static/chunks/{turbopack-0ndm2zc_pdptk.js → turbopack-11qjwlynmfc-n.js} +1 -1
  102. package/dist/web/_not-found/__next._full.txt +30 -29
  103. package/dist/web/_not-found/__next._head.txt +4 -4
  104. package/dist/web/_not-found/__next._index.txt +13 -13
  105. package/dist/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
  106. package/dist/web/_not-found/__next._not-found.txt +3 -3
  107. package/dist/web/_not-found/__next._tree.txt +2 -2
  108. package/dist/web/_not-found.html +1 -1
  109. package/dist/web/_not-found.txt +30 -29
  110. package/dist/web/index.html +1 -1
  111. package/dist/web/index.txt +23 -25
  112. package/dist/web/login/__next._full.txt +28 -28
  113. package/dist/web/login/__next._head.txt +4 -4
  114. package/dist/web/login/__next._index.txt +13 -13
  115. package/dist/web/login/__next._tree.txt +2 -2
  116. package/dist/web/login/__next.login.__PAGE__.txt +4 -4
  117. package/dist/web/login/__next.login.txt +3 -3
  118. package/dist/web/login.html +1 -1
  119. package/dist/web/login.txt +28 -28
  120. package/dist/web/settings/__next._full.txt +33 -32
  121. package/dist/web/settings/__next._head.txt +4 -4
  122. package/dist/web/settings/__next._index.txt +13 -13
  123. package/dist/web/settings/__next._tree.txt +2 -2
  124. package/dist/web/settings/__next.settings.__PAGE__.txt +4 -4
  125. package/dist/web/settings/__next.settings.txt +5 -5
  126. package/dist/web/settings/agents/__next._full.txt +24 -24
  127. package/dist/web/settings/agents/__next._head.txt +4 -4
  128. package/dist/web/settings/agents/__next._index.txt +13 -13
  129. package/dist/web/settings/agents/__next._tree.txt +2 -2
  130. package/dist/web/settings/agents/__next.settings.agents.__PAGE__.txt +4 -4
  131. package/dist/web/settings/agents/__next.settings.agents.txt +3 -3
  132. package/dist/web/settings/agents/__next.settings.txt +5 -5
  133. package/dist/web/settings/agents.html +1 -1
  134. package/dist/web/settings/agents.txt +24 -24
  135. package/dist/web/settings/mcps/__next._full.txt +24 -24
  136. package/dist/web/settings/mcps/__next._head.txt +4 -4
  137. package/dist/web/settings/mcps/__next._index.txt +13 -13
  138. package/dist/web/settings/mcps/__next._tree.txt +2 -2
  139. package/dist/web/settings/mcps/__next.settings.mcps.__PAGE__.txt +4 -4
  140. package/dist/web/settings/mcps/__next.settings.mcps.txt +3 -3
  141. package/dist/web/settings/mcps/__next.settings.txt +5 -5
  142. package/dist/web/settings/mcps.html +1 -1
  143. package/dist/web/settings/mcps.txt +24 -24
  144. package/dist/web/settings/models/__next._full.txt +24 -24
  145. package/dist/web/settings/models/__next._head.txt +4 -4
  146. package/dist/web/settings/models/__next._index.txt +13 -13
  147. package/dist/web/settings/models/__next._tree.txt +2 -2
  148. package/dist/web/settings/models/__next.settings.models.__PAGE__.txt +4 -4
  149. package/dist/web/settings/models/__next.settings.models.txt +3 -3
  150. package/dist/web/settings/models/__next.settings.txt +5 -5
  151. package/dist/web/settings/models.html +1 -1
  152. package/dist/web/settings/models.txt +24 -24
  153. package/dist/web/settings/output-styles/__next._full.txt +24 -24
  154. package/dist/web/settings/output-styles/__next._head.txt +4 -4
  155. package/dist/web/settings/output-styles/__next._index.txt +13 -13
  156. package/dist/web/settings/output-styles/__next._tree.txt +2 -2
  157. package/dist/web/settings/output-styles/__next.settings.output-styles.__PAGE__.txt +4 -4
  158. package/dist/web/settings/output-styles/__next.settings.output-styles.txt +3 -3
  159. package/dist/web/settings/output-styles/__next.settings.txt +5 -5
  160. package/dist/web/settings/output-styles.html +1 -1
  161. package/dist/web/settings/output-styles.txt +24 -24
  162. package/dist/web/settings/prompts/__next._full.txt +24 -24
  163. package/dist/web/settings/prompts/__next._head.txt +4 -4
  164. package/dist/web/settings/prompts/__next._index.txt +13 -13
  165. package/dist/web/settings/prompts/__next._tree.txt +2 -2
  166. package/dist/web/settings/prompts/__next.settings.prompts.__PAGE__.txt +4 -4
  167. package/dist/web/settings/prompts/__next.settings.prompts.txt +3 -3
  168. package/dist/web/settings/prompts/__next.settings.txt +5 -5
  169. package/dist/web/settings/prompts.html +1 -1
  170. package/dist/web/settings/prompts.txt +24 -24
  171. package/dist/web/settings/providers/__next._full.txt +24 -24
  172. package/dist/web/settings/providers/__next._head.txt +4 -4
  173. package/dist/web/settings/providers/__next._index.txt +13 -13
  174. package/dist/web/settings/providers/__next._tree.txt +2 -2
  175. package/dist/web/settings/providers/__next.settings.providers.__PAGE__.txt +4 -4
  176. package/dist/web/settings/providers/__next.settings.providers.txt +3 -3
  177. package/dist/web/settings/providers/__next.settings.txt +5 -5
  178. package/dist/web/settings/providers.html +1 -1
  179. package/dist/web/settings/providers.txt +24 -24
  180. package/dist/web/settings/skills/__next._full.txt +24 -24
  181. package/dist/web/settings/skills/__next._head.txt +4 -4
  182. package/dist/web/settings/skills/__next._index.txt +13 -13
  183. package/dist/web/settings/skills/__next._tree.txt +2 -2
  184. package/dist/web/settings/skills/__next.settings.skills.__PAGE__.txt +4 -4
  185. package/dist/web/settings/skills/__next.settings.skills.txt +3 -3
  186. package/dist/web/settings/skills/__next.settings.txt +5 -5
  187. package/dist/web/settings/skills.html +1 -1
  188. package/dist/web/settings/skills.txt +24 -24
  189. package/dist/web/settings/tools/__next._full.txt +24 -24
  190. package/dist/web/settings/tools/__next._head.txt +4 -4
  191. package/dist/web/settings/tools/__next._index.txt +13 -13
  192. package/dist/web/settings/tools/__next._tree.txt +2 -2
  193. package/dist/web/settings/tools/__next.settings.tools.__PAGE__.txt +4 -4
  194. package/dist/web/settings/tools/__next.settings.tools.txt +3 -3
  195. package/dist/web/settings/tools/__next.settings.txt +5 -5
  196. package/dist/web/settings/tools.html +1 -1
  197. package/dist/web/settings/tools.txt +24 -24
  198. package/dist/web/settings.html +1 -1
  199. package/dist/web/settings.txt +33 -32
  200. package/dist/web/workflows/__next._full.txt +31 -33
  201. package/dist/web/workflows/__next._head.txt +4 -4
  202. package/dist/web/workflows/__next._index.txt +13 -13
  203. package/dist/web/workflows/__next._tree.txt +2 -2
  204. package/dist/web/workflows/__next.workflows.__PAGE__.txt +4 -4
  205. package/dist/web/workflows/__next.workflows.txt +3 -3
  206. package/dist/web/workflows.html +1 -1
  207. package/dist/web/workflows.txt +31 -33
  208. package/dist/web/workspace/_/__next._full.txt +28 -29
  209. package/dist/web/workspace/_/__next._head.txt +4 -4
  210. package/dist/web/workspace/_/__next._index.txt +13 -13
  211. package/dist/web/workspace/_/__next._tree.txt +2 -2
  212. package/dist/web/workspace/_/__next.workspace.$d$id.__PAGE__.txt +3 -3
  213. package/dist/web/workspace/_/__next.workspace.$d$id.txt +3 -3
  214. package/dist/web/workspace/_/__next.workspace.txt +3 -3
  215. package/dist/web/workspace/_.html +1 -1
  216. package/dist/web/workspace/_.txt +28 -29
  217. package/dist/web/workspaces/__next._full.txt +29 -31
  218. package/dist/web/workspaces/__next._head.txt +4 -4
  219. package/dist/web/workspaces/__next._index.txt +13 -13
  220. package/dist/web/workspaces/__next._tree.txt +2 -2
  221. package/dist/web/workspaces/__next.workspaces.__PAGE__.txt +4 -4
  222. package/dist/web/workspaces/__next.workspaces.txt +3 -3
  223. package/dist/web/workspaces.html +1 -1
  224. package/dist/web/workspaces.txt +29 -31
  225. package/dist/ws/agent-prompt.js +32 -3
  226. package/dist/ws/agent-runner.js +83 -6
  227. package/package.json +11 -11
  228. package/dist/web/_next/static/chunks/0-9194nbxy_6d.js +0 -1
  229. package/dist/web/_next/static/chunks/0.n~yfwf4~6w-.js +0 -1
  230. package/dist/web/_next/static/chunks/02mf61htij8g0.js +0 -31
  231. package/dist/web/_next/static/chunks/04dg4l4hv11q2.js +0 -3
  232. package/dist/web/_next/static/chunks/04fxddw-y20~-.js +0 -7
  233. package/dist/web/_next/static/chunks/04w7~5ooz_pwm.js +0 -1
  234. package/dist/web/_next/static/chunks/05oc21sj24wtq.js +0 -1
  235. package/dist/web/_next/static/chunks/08kfx8on9oty~.js +0 -1
  236. package/dist/web/_next/static/chunks/08k~meqbd8d6v.js +0 -1
  237. package/dist/web/_next/static/chunks/099h96wjsdb25.js +0 -2
  238. package/dist/web/_next/static/chunks/09h23logvq65m.js +0 -1
  239. package/dist/web/_next/static/chunks/0a5y-vhf4i5id.js +0 -3
  240. package/dist/web/_next/static/chunks/0ake2f3x2uan4.js +0 -24
  241. package/dist/web/_next/static/chunks/0ck8dw_9-1cdx.js +0 -1
  242. package/dist/web/_next/static/chunks/0ewceguykiut5.js +0 -1
  243. package/dist/web/_next/static/chunks/0f7cb9li~3jra.js +0 -67
  244. package/dist/web/_next/static/chunks/0ghs9on7wodrm.js +0 -1
  245. package/dist/web/_next/static/chunks/0ghx3j_.-gdyd.js +0 -1
  246. package/dist/web/_next/static/chunks/0h9cu-k6z5o08.js +0 -1
  247. package/dist/web/_next/static/chunks/0jb4~3qqkw2ps.js +0 -1
  248. package/dist/web/_next/static/chunks/0nb8.iteznuvx.js +0 -1
  249. package/dist/web/_next/static/chunks/0os58q93stt7j.js +0 -3
  250. package/dist/web/_next/static/chunks/0s9lmk8iauou3.js +0 -1
  251. package/dist/web/_next/static/chunks/0sp_zbx~w0am7.js +0 -1
  252. package/dist/web/_next/static/chunks/0tel~zsv4z8l_.js +0 -1
  253. package/dist/web/_next/static/chunks/0twamv4wr_dbv.js +0 -1
  254. package/dist/web/_next/static/chunks/0uhol5wafdbl~.js +0 -1
  255. package/dist/web/_next/static/chunks/0v3a_x4vt42kx.js +0 -5
  256. package/dist/web/_next/static/chunks/0v7q4mys.mnm..css +0 -1
  257. package/dist/web/_next/static/chunks/0xt-8wk21gs7g.js +0 -1
  258. package/dist/web/_next/static/chunks/0z~vqzbm_q371.js +0 -1
  259. package/dist/web/_next/static/chunks/0~3xm80~j9ddg.js +0 -1
  260. package/dist/web/_next/static/chunks/14s37n6h0_q3x.js +0 -16
  261. package/dist/web/_next/static/chunks/161ik5kfyuwtd.js +0 -1
  262. package/dist/web/_next/static/chunks/17k~zbv0_4rep.js +0 -1
  263. package/public/output-styles/carmack-mode.md +0 -381
  264. package/public/output-styles/codex-rigor-mode.md +0 -114
  265. package/public/output-styles/dhh-mode.md +0 -265
  266. package/public/output-styles/evan-you-mode.md +0 -539
  267. package/public/output-styles/index.json +0 -37
  268. package/public/output-styles/jobs-mode.md +0 -369
  269. package/public/output-styles/linus-mode.md +0 -135
  270. package/public/output-styles/uncle-bob-mode.md +0 -221
  271. package/public/prompt/andrej-karpathy-skills.md +0 -65
  272. package/public/prompt/claude-token-efficient-coding.md +0 -35
  273. package/public/prompt/index.json +0 -12
  274. package/public/skills/index.json +0 -92
  275. package/public/skills/planning-with-files/planning-with-files-zh/SKILL.md +0 -243
  276. package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.ps1 +0 -44
  277. package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.sh +0 -46
  278. package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.ps1 +0 -124
  279. package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.sh +0 -124
  280. package/public/skills/planning-with-files/planning-with-files-zh/scripts/session-catchup.py +0 -438
  281. package/public/skills/planning-with-files/planning-with-files-zh/templates/findings.md +0 -29
  282. package/public/skills/planning-with-files/planning-with-files-zh/templates/progress.md +0 -40
  283. package/public/skills/planning-with-files/planning-with-files-zh/templates/task_plan.md +0 -58
  284. package/public/skills/superpowers/brainstorming/SKILL.md +0 -164
  285. package/public/skills/superpowers/brainstorming/scripts/frame-template.html +0 -214
  286. package/public/skills/superpowers/brainstorming/scripts/helper.js +0 -88
  287. package/public/skills/superpowers/brainstorming/scripts/server.cjs +0 -354
  288. package/public/skills/superpowers/brainstorming/scripts/start-server.sh +0 -148
  289. package/public/skills/superpowers/brainstorming/scripts/stop-server.sh +0 -56
  290. package/public/skills/superpowers/brainstorming/spec-document-reviewer-prompt.md +0 -49
  291. package/public/skills/superpowers/brainstorming/visual-companion.md +0 -287
  292. package/public/skills/superpowers/dispatching-parallel-agents/SKILL.md +0 -182
  293. package/public/skills/superpowers/executing-plans/SKILL.md +0 -70
  294. package/public/skills/superpowers/finishing-a-development-branch/SKILL.md +0 -251
  295. package/public/skills/superpowers/receiving-code-review/SKILL.md +0 -213
  296. package/public/skills/superpowers/requesting-code-review/SKILL.md +0 -103
  297. package/public/skills/superpowers/requesting-code-review/code-reviewer.md +0 -168
  298. package/public/skills/superpowers/subagent-driven-development/SKILL.md +0 -279
  299. package/public/skills/superpowers/subagent-driven-development/code-quality-reviewer-prompt.md +0 -25
  300. package/public/skills/superpowers/subagent-driven-development/implementer-prompt.md +0 -113
  301. package/public/skills/superpowers/subagent-driven-development/spec-reviewer-prompt.md +0 -61
  302. package/public/skills/superpowers/systematic-debugging/CREATION-LOG.md +0 -119
  303. package/public/skills/superpowers/systematic-debugging/SKILL.md +0 -296
  304. package/public/skills/superpowers/systematic-debugging/condition-based-waiting-example.ts +0 -158
  305. package/public/skills/superpowers/systematic-debugging/condition-based-waiting.md +0 -115
  306. package/public/skills/superpowers/systematic-debugging/defense-in-depth.md +0 -122
  307. package/public/skills/superpowers/systematic-debugging/find-polluter.sh +0 -63
  308. package/public/skills/superpowers/systematic-debugging/root-cause-tracing.md +0 -169
  309. package/public/skills/superpowers/systematic-debugging/test-academic.md +0 -14
  310. package/public/skills/superpowers/systematic-debugging/test-pressure-1.md +0 -58
  311. package/public/skills/superpowers/systematic-debugging/test-pressure-2.md +0 -68
  312. package/public/skills/superpowers/systematic-debugging/test-pressure-3.md +0 -69
  313. package/public/skills/superpowers/test-driven-development/SKILL.md +0 -371
  314. package/public/skills/superpowers/test-driven-development/testing-anti-patterns.md +0 -299
  315. package/public/skills/superpowers/using-git-worktrees/SKILL.md +0 -215
  316. package/public/skills/superpowers/using-superpowers/SKILL.md +0 -117
  317. package/public/skills/superpowers/using-superpowers/references/codex-tools.md +0 -59
  318. package/public/skills/superpowers/using-superpowers/references/copilot-tools.md +0 -42
  319. package/public/skills/superpowers/using-superpowers/references/gemini-tools.md +0 -51
  320. package/public/skills/superpowers/verification-before-completion/SKILL.md +0 -139
  321. package/public/skills/superpowers/writing-plans/SKILL.md +0 -152
  322. package/public/skills/superpowers/writing-plans/plan-document-reviewer-prompt.md +0 -49
  323. package/public/skills/superpowers/writing-skills/SKILL.md +0 -655
  324. package/public/skills/superpowers/writing-skills/anthropic-best-practices.md +0 -1150
  325. package/public/skills/superpowers/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -189
  326. package/public/skills/superpowers/writing-skills/graphviz-conventions.dot +0 -172
  327. package/public/skills/superpowers/writing-skills/persuasion-principles.md +0 -187
  328. package/public/skills/superpowers/writing-skills/render-graphs.js +0 -168
  329. package/public/skills/superpowers/writing-skills/testing-skills-with-subagents.md +0 -384
  330. /package/dist/web/_next/static/{e8w3vd9Eov_LDYWj_0zsE → rGXyAK8rgod1NjF3bLZAY}/_buildManifest.js +0 -0
  331. /package/dist/web/_next/static/{e8w3vd9Eov_LDYWj_0zsE → rGXyAK8rgod1NjF3bLZAY}/_clientMiddlewareManifest.js +0 -0
  332. /package/dist/web/_next/static/{e8w3vd9Eov_LDYWj_0zsE → rGXyAK8rgod1NjF3bLZAY}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,816709,e=>{"use strict";var t=e.i(764556);let r=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,a={setState:n,getState:i,getInitialState:()=>l,subscribe:e=>(r.add(e),()=>r.delete(e))},l=t=e(n,i,a);return a},n=e=>{let n=e?r(e):r,i=e=>(function(e,r=e=>e){let n=t.default.useSyncExternalStore(e.subscribe,t.default.useCallback(()=>r(e.getState()),[e,r]),t.default.useCallback(()=>r(e.getInitialState()),[e,r]));return t.default.useDebugValue(n),n})(n,e);return Object.assign(i,n),i};e.s(["create",0,e=>e?n(e):n],816709)},433721,e=>{"use strict";var t=e.i(764556);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),n=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,t.createContext)({}),l=(0,t.forwardRef)(({color:e,size:n,strokeWidth:l,absoluteStrokeWidth:o,className:s="",children:u,iconNode:d,...c},f)=>{let{size:v=24,strokeWidth:p=2,absoluteStrokeWidth:b=!1,color:m="currentColor",className:g=""}=(0,t.useContext)(a)??{},y=o??b?24*Number(l??p)/Number(n??v):l??p;return(0,t.createElement)("svg",{ref:f,...i,width:n??v??i.width,height:n??v??i.height,stroke:e??m,strokeWidth:y,className:r("lucide",g,s),...!u&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(c)&&{"aria-hidden":"true"},...c},[...d.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(u)?u:[u]])});e.s(["default",0,(e,i)=>{let a=(0,t.forwardRef)(({className:a,...o},s)=>(0,t.createElement)(l,{ref:s,iconNode:i,className:r(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,a),...o}));return a.displayName=n(e),a}],433721)},250226,e=>{"use strict";let t=(0,e.i(816709).create)(e=>({activePanel:"channel-list",setActivePanel:t=>e({activePanel:t}),overlays:[],registerOverlay:(t,r,n)=>e(e=>{if(n?.ignoreBack)return e;let i=e.overlays.findIndex(e=>e.id===t);if(-1===i)return{overlays:[...e.overlays,{id:t,close:r}]};let a=[...e.overlays];return a[i]={id:t,close:r},{overlays:a}}),unregisterOverlay:t=>e(e=>({overlays:e.overlays.filter(e=>e.id!==t)})),handleBackAction:()=>{let{overlays:r,activePanel:n}=t.getState(),i=r[r.length-1];return i?(i.close(),!0):"issue-detail"===n?(e({activePanel:"issue-list"}),!0):"chat"===n&&(e({activePanel:"channel-list"}),!0)}}));e.s(["useMobilePanelStore",0,t])},46752,e=>{"use strict";e.s(["mergeObjects",0,function(e,t){return e&&!t?e:!e&&t?t:e||t?{...e,...t}:void 0}])},370383,e=>{"use strict";var t=e.i(46752);let r={};function n(e){return l(e)?{...o(e,r)}:function(e){let t={...e};for(let e in t){let r=t[e];a(e,r)&&(t[e]=s(r))}return t}(e)}function i(e,r){return l(r)?o(r,e):function(e,r){if(!r)return e;for(let n in r){let i=r[n];switch(n){case"style":e[n]=(0,t.mergeObjects)(e.style,i);break;case"className":e[n]=d(e.className,i);break;default:a(n,i)?e[n]=function(e,t){return t?e?(...r)=>{let n=r[0];if(c(n)){u(n);let i=t(...r);return n.baseUIHandlerPrevented||e?.(...r),i}let i=t(...r);return e?.(...r),i}:s(t):e}(e[n],i):e[n]=i}}return e}(e,r)}function a(e,t){let r=e.charCodeAt(0),n=e.charCodeAt(1),i=e.charCodeAt(2);return 111===r&&110===n&&i>=65&&i<=90&&("function"==typeof t||void 0===t)}function l(e){return"function"==typeof e}function o(e,t){return l(e)?e(t):e??r}function s(e){return e?(...t)=>{let r=t[0];return c(r)&&u(r),e(...t)}:e}function u(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function d(e,t){return t?e?t+" "+e:t:e}function c(e){return null!=e&&"object"==typeof e&&"nativeEvent"in e}e.s(["makeEventPreventable",0,u,"mergeClassNames",0,d,"mergeProps",0,function(e,t,r,a,l){if(!r&&!a&&!l&&!e)return n(t);let o=n(e);return t&&(o=i(o,t)),r&&(o=i(o,r)),a&&(o=i(o,a)),l&&(o=i(o,l)),o},"mergePropsN",0,function(e){if(0===e.length)return r;if(1===e.length)return n(e[0]);let t=n(e[0]);for(let r=1;r<e.length;r+=1)t=i(t,e[r]);return t}])},267805,e=>{"use strict";let t=function(e,...t){let r=new URL("https://base-ui.com/production-error");return r.searchParams.set("code",e.toString()),t.forEach(e=>r.searchParams.append("args[]",e)),`Base UI error #${e}; visit ${r} for the full message.`};e.s(["default",0,t])},549154,e=>{"use strict";var t=e.i(764556);let r={};e.s(["useRefWithInit",0,function(e,n){let i=t.useRef(r);return i.current===r&&(i.current=e(n)),i}])},204133,557576,287997,e=>{"use strict";var t=e.i(549154);function r(){return{callback:null,cleanup:null,refs:[]}}function n(e,t){if(e.refs=t,t.every(e=>null==e)){e.callback=null;return}e.callback=r=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),null!=r){let n=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(null!=i)switch(typeof i){case"function":{let t=i(r);"function"==typeof t&&(n[e]=t);break}case"object":i.current=r}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let r=t[e];if(null!=r)switch(typeof r){case"function":{let t=n[e];"function"==typeof t?t():r(null);break}case"object":r.current=null}}}}}}e.s(["useMergedRefs",0,function(e,i,a,l){var o,s,u,d,c;let f=(0,t.useRefWithInit)(r).current;return o=f,s=e,u=i,d=a,c=l,(o.refs[0]!==s||o.refs[1]!==u||o.refs[2]!==d||o.refs[3]!==c)&&n(f,[e,i,a,l]),f.callback},"useMergedRefsN",0,function(e){var i,a;let l=(0,t.useRefWithInit)(r).current;return i=l,a=e,(i.refs.length!==a.length||i.refs.some((e,t)=>e!==a[t]))&&n(l,e),l.callback}],204133);var i=e.i(764556);let a=parseInt(i.version,10);function l(e){return a>=e}e.s(["isReactVersionAtLeast",0,l],557576),e.s(["getReactElementRef",0,function(e){if(!i.isValidElement(e))return null;let t=e.props;return(l(19)?t?.ref:e.ref)??null}],287997)},873535,e=>{"use strict";e.s(["warn",0,function(){}])},863728,e=>{"use strict";let t=Object.freeze([]),r=Object.freeze({});e.s(["EMPTY_ARRAY",0,t,"EMPTY_OBJECT",0,r,"NOOP",0,function(){}])},662614,807719,880566,e=>{"use strict";e.s(["getStateAttributesProps",0,function(e,t){let r={};for(let n in e){let i=e[n];if(t?.hasOwnProperty(n)){let e=t[n](i);null!=e&&Object.assign(r,e);continue}!0===i?r[`data-${n.toLowerCase()}`]="":i&&(r[`data-${n.toLowerCase()}`]=i.toString())}return r}],662614),e.s(["resolveClassName",0,function(e,t){return"function"==typeof e?e(t):e}],807719),e.s(["resolveStyle",0,function(e,t){return"function"==typeof e?e(t):e}],880566)},969490,e=>{"use strict";var t=e.i(267805),r=e.i(764556),n=e.i(204133),i=e.i(287997),a=e.i(46752);e.i(873535);var l=e.i(863728),o=e.i(662614),s=e.i(807719),u=e.i(880566),d=e.i(370383);let c=Symbol.for("react.lazy");e.s(["useRenderElement",0,function(e,f,v={}){let p=f.render,b=function(e,t={}){var r;let{className:c,style:f,render:v}=e,{state:p=l.EMPTY_OBJECT,ref:b,props:m,stateAttributesMapping:g,enabled:y=!0}=t,h=y?(0,s.resolveClassName)(c,p):void 0,C=y?(0,u.resolveStyle)(f,p):void 0,E=y?(0,o.getStateAttributesProps)(p,g):l.EMPTY_OBJECT,x=y&&m?Array.isArray(r=m)?(0,d.mergePropsN)(r):(0,d.mergeProps)(void 0,r):void 0,R=y?(0,a.mergeObjects)(E,x)??{}:l.EMPTY_OBJECT;return("u">typeof document&&(y?Array.isArray(b)?R.ref=(0,n.useMergedRefsN)([R.ref,(0,i.getReactElementRef)(v),...b]):R.ref=(0,n.useMergedRefs)(R.ref,(0,i.getReactElementRef)(v),b):(0,n.useMergedRefs)(null,null)),y)?(void 0!==h&&(R.className=(0,d.mergeClassNames)(R.className,h)),void 0!==C&&(R.style=(0,a.mergeObjects)(R.style,C)),R):l.EMPTY_OBJECT}(f,v);return!1===v.enabled?null:function(e,n,i,a){if(n){if("function"==typeof n)return n(i,a);let e=(0,d.mergeProps)(i,n.props);e.ref=i.ref;let t=n;return t?.$$typeof===c&&(t=r.Children.toArray(n)[0]),r.cloneElement(t,e)}if(e&&"string"==typeof e){var l,o;return l=e,o=i,"button"===l?(0,r.createElement)("button",{type:"button",...o,key:o.key}):"img"===l?(0,r.createElement)("img",{alt:"",...o,key:o.key}):r.createElement(l,o)}throw Error((0,t.default)(8))}(e,p,b,v.state??l.EMPTY_OBJECT)}])},294237,e=>{"use strict";var t=e.i(7284);let r=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=t.clsx;e.s(["cva",0,(e,t)=>i=>{var a;if((null==t?void 0:t.variants)==null)return n(e,null==i?void 0:i.class,null==i?void 0:i.className);let{variants:l,defaultVariants:o}=t,s=Object.keys(l).map(e=>{let t=null==i?void 0:i[e],n=null==o?void 0:o[e];if(null===t)return null;let a=r(t)||r(n);return l[e][a]}),u=i&&Object.entries(i).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return n(e,s,null==t||null==(a=t.compoundVariants)?void 0:a.reduce((e,t)=>{let{class:r,className:n,...i}=t;return Object.entries(i).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...o,...u}[t]):({...o,...u})[t]===r})?[...e,r,n]:e},[]),null==i?void 0:i.class,null==i?void 0:i.className)}])},92615,e=>{"use strict";let t;function r(){return"u">typeof window}function n(e){return l(e)?(e.nodeName||"").toLowerCase():"#document"}function i(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function a(e){var t;return null==(t=(l(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function l(e){return!!r()&&(e instanceof Node||e instanceof i(e).Node)}function o(e){return!!r()&&(e instanceof Element||e instanceof i(e).Element)}function s(e){return!!r()&&(e instanceof HTMLElement||e instanceof i(e).HTMLElement)}function u(e){return!(!r()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof i(e).ShadowRoot)}function d(e){let{overflow:t,overflowX:r,overflowY:n,display:i}=y(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&"inline"!==i&&"contents"!==i}function c(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let f=/transform|translate|scale|rotate|perspective|filter/,v=/paint|layout|strict|content/,p=e=>!!e&&"none"!==e;function b(e){let t=o(e)?y(e):e;return p(t.transform)||p(t.translate)||p(t.scale)||p(t.rotate)||p(t.perspective)||!m()&&(p(t.backdropFilter)||p(t.filter))||f.test(t.willChange||"")||v.test(t.contain||"")}function m(){return null==t&&(t="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),t}function g(e){return/^(html|body|#document)$/.test(n(e))}function y(e){return i(e).getComputedStyle(e)}function h(e){if("html"===n(e))return e;let t=e.assignedSlot||e.parentNode||u(e)&&e.host||a(e);return u(t)?t.host:t}function C(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}e.s(["getComputedStyle",0,y,"getContainingBlock",0,function(e){let t=h(e);for(;s(t)&&!g(t);){if(b(t))return t;if(c(t))break;t=h(t)}return null},"getDocumentElement",0,a,"getFrameElement",0,C,"getNodeName",0,n,"getNodeScroll",0,function(e){return o(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}},"getOverflowAncestors",0,function e(t,r,n){var a;void 0===r&&(r=[]),void 0===n&&(n=!0);let l=function e(t){let r=h(t);return g(r)?t.ownerDocument?t.ownerDocument.body:t.body:s(r)&&d(r)?r:e(r)}(t),o=l===(null==(a=t.ownerDocument)?void 0:a.body),u=i(l);if(!o)return r.concat(l,e(l,[],n));{let t=C(u);return r.concat(u,u.visualViewport||[],d(l)?l:[],t&&n?e(t):[])}},"getParentNode",0,h,"getWindow",0,i,"isContainingBlock",0,b,"isElement",0,o,"isHTMLElement",0,s,"isLastTraversableNode",0,g,"isNode",0,l,"isOverflowElement",0,d,"isShadowRoot",0,u,"isTableElement",0,function(e){return/^(table|td|th)$/.test(n(e))},"isTopLayer",0,c,"isWebKit",0,m])},29905,e=>{"use strict";var t=e.i(764556),r=e.i(549154);let n=t[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],i=n&&n!==t.useLayoutEffect?n:e=>e();function a(){let e={next:void 0,callback:l,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function l(){}e.s(["useStableCallback",0,function(e){let t=(0,r.useRefWithInit)(a).current;return t.next=e,i(t.effect),t.trampoline}])},277642,e=>{"use strict";var t=e.i(764556);let r="u">typeof document?t.useLayoutEffect:()=>{};e.s(["useIsoLayoutEffect",0,r])},931709,352360,e=>{"use strict";e.i(8890);var t=e.i(764556),r=e.i(92615),n=e.i(29905),i=e.i(277642),a=e.i(370383),l=e.i(267805);let o=t.createContext(void 0);function s(e=!1){let r=t.useContext(o);if(void 0===r&&!e)throw Error((0,l.default)(16));return r}function u(e){return(0,r.isHTMLElement)(e)&&"BUTTON"===e.tagName}e.s(["CompositeRootContext",0,o,"useCompositeRootContext",0,s],352360),e.s(["useButton",0,function(e={}){let{disabled:r=!1,focusableWhenDisabled:l,tabIndex:o=0,native:d=!0,composite:c}=e,f=t.useRef(null),v=s(!0),p=c??void 0!==v,{props:b}=function(e){let{focusableWhenDisabled:r,disabled:n,composite:i=!1,tabIndex:a=0,isNativeButton:l}=e,o=i&&!1!==r,s=i&&!1===r;return{props:t.useMemo(()=>{let e={onKeyDown(e){n&&r&&"Tab"!==e.key&&e.preventDefault()}};return i||(e.tabIndex=a,!l&&n&&(e.tabIndex=r?a:-1)),(l&&(r||o)||!l&&n)&&(e["aria-disabled"]=n),l&&(!r||s)&&(e.disabled=n),e},[i,n,r,o,s,l,a])}}({focusableWhenDisabled:l,disabled:r,composite:p,tabIndex:o,isNativeButton:d}),m=t.useCallback(()=>{let e=f.current;u(e)&&p&&r&&void 0===b.disabled&&e.disabled&&(e.disabled=!1)},[r,b.disabled,p]);return(0,i.useIsoLayoutEffect)(m,[m]),{getButtonProps:t.useCallback((e={})=>{let{onClick:t,onMouseDown:n,onKeyUp:i,onKeyDown:l,onPointerDown:o,...s}=e,c=d?"button":void 0;return(0,a.mergeProps)({type:c,onClick(e){r?e.preventDefault():t?.(e)},onMouseDown(e){r||n?.(e)},onKeyDown(e){var n;if(r||((0,a.makeEventPreventable)(e),l?.(e),e.baseUIHandlerPrevented))return;let i=e.target===e.currentTarget,o=e.currentTarget,s=u(o),c=!d&&(n=o,!!(n?.tagName==="A"&&n?.href)),f=i&&(d?s:!c),v="Enter"===e.key,b=" "===e.key,m=o.getAttribute("role"),g=m?.startsWith("menuitem")||"option"===m||"gridcell"===m;if(i&&p&&b){if(e.defaultPrevented&&g)return;e.preventDefault(),c||d&&s?(o.click(),e.preventBaseUIHandler()):f&&(t?.(e),e.preventBaseUIHandler());return}f&&(!d&&(b||v)&&e.preventDefault(),!d&&v&&t?.(e))},onKeyUp(e){r||(((0,a.makeEventPreventable)(e),i?.(e),e.target===e.currentTarget&&d&&p&&u(e.currentTarget)&&" "===e.key)?e.preventDefault():!e.baseUIHandlerPrevented&&(e.target!==e.currentTarget||d||p||" "!==e.key||t?.(e)))},onPointerDown(e){r?e.preventDefault():o?.(e)}},d?void 0:{role:"button"},b,s)},[r,b,p,d]),buttonRef:(0,n.useStableCallback)(e=>{f.current=e,m()})}}],931709)},674548,e=>{"use strict";var t=e.i(764556),r=e.i(931709),n=e.i(969490);let i=t.forwardRef(function(e,t){let{render:i,className:a,disabled:l=!1,focusableWhenDisabled:o=!1,nativeButton:s=!0,style:u,...d}=e,{getButtonProps:c,buttonRef:f}=(0,r.useButton)({disabled:l,focusableWhenDisabled:o,native:s});return(0,n.useRenderElement)("button",e,{state:{disabled:l},ref:[t,f],props:[d,c]})});e.s(["Button",0,i])},260218,e=>{"use strict";var t=e.i(344180),r=e.i(674548),n=e.i(294237),i=e.i(465458);let a=(0,n.cva)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});e.s(["Button",0,function({className:e,variant:n="default",size:l="default",...o}){return(0,t.jsx)(r.Button,{"data-slot":"button",className:(0,i.cn)(a({variant:n,size:l,className:e})),...o})},"buttonVariants",0,a])},394822,e=>{"use strict";var t=e.i(764556);let r={...t},n=0,i=r.useId;e.s(["useId",0,function(e,r){if(void 0!==i){let t=i();return e??(r?`${r}-${t}`:t)}return function(e,r="mui"){let[i,a]=t.useState(e),l=e||i;return t.useEffect(()=>{null==i&&(n+=1,a(`${r}-${n}`))},[i,r]),l}(e,r)}],394822)},139236,e=>{"use strict";var t=e.i(394822);e.s(["useBaseUiId",0,function(e){return(0,t.useId)(e,"base-ui")}])},130522,e=>{"use strict";var t=e.i(764556);let r=[];e.s(["useOnMount",0,function(e){t.useEffect(e,r)}])},232449,e=>{"use strict";var t=e.i(549154),r=e.i(130522);class n{static create(){return new n}currentId=0;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,t()},e)}isStarted(){return 0!==this.currentId}clear=()=>{0!==this.currentId&&(clearTimeout(this.currentId),this.currentId=0)};disposeEffect=()=>this.clear}e.s(["Timeout",0,n,"useTimeout",0,function(){let e=(0,t.useRefWithInit)(n.create).current;return(0,r.useOnMount)(e.disposeEffect),e}])},410421,e=>{"use strict";var t=e.i(92615);e.s(["activeElement",0,function(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t},"contains",0,function(e,r){if(!e||!r)return!1;let n=r.getRootNode?.();if(e.contains(r))return!0;if(n&&(0,t.isShadowRoot)(n)){let t=r;for(;t;){if(e===t)return!0;t=t.parentNode||t.host}}return!1},"getTarget",0,function(e){return"composedPath"in e?e.composedPath()[0]:e.target}])},422561,e=>{"use strict";e.s(["addEventListener",0,function(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}])},454889,e=>{"use strict";let t="u">typeof navigator,r=function(){if(!t)return{platform:"",maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}(),n=function(){if(!t)return"";let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}(),i=function(){if(!t)return"";let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(" "):navigator.userAgent}(),a="u">typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter:none"),l="MacIntel"===r.platform&&r.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(r.platform);t&&/firefox/i.test(i);let o=t&&/apple/i.test(navigator.vendor);t&&/Edg/i.test(i);let s=t&&/android/i.test(n)||/android/i.test(i),u=t&&n.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,d=i.includes("jsdom/");e.s(["isAndroid",0,s,"isIOS",0,l,"isJSDOM",0,d,"isMac",0,u,"isSafari",0,o,"isWebKit",0,a])},636707,e=>{"use strict";e.s([])},125231,438904,e=>{"use strict";e.i(8890);var t,r=e.i(267805),n=e.i(764556),i=e.i(863728);let a=((t={}).disabled="data-disabled",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t),l={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},o={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},s={disabled:!1,...o};e.s(["DEFAULT_FIELD_ROOT_STATE",0,s,"DEFAULT_FIELD_STATE_ATTRIBUTES",0,o,"DEFAULT_VALIDITY_STATE",0,l,"fieldValidityMapping",0,{valid:e=>null===e?null:e?{[a.valid]:""}:{[a.invalid]:""}}],438904);let u=n.createContext({invalid:void 0,name:void 0,validityData:{state:l,errors:[],error:"",value:"",initialValue:null},setValidityData:i.NOOP,disabled:void 0,touched:o.touched,setTouched:i.NOOP,dirty:o.dirty,setDirty:i.NOOP,filled:o.filled,setFilled:i.NOOP,focused:o.focused,setFocused:i.NOOP,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:s,markedDirtyRef:{current:!1},registerFieldControl:i.NOOP,validation:{getValidationProps:(e=i.EMPTY_OBJECT)=>e,getInputValidationProps:(e=i.EMPTY_OBJECT)=>e,inputRef:{current:null},commit:async()=>{}}});e.s(["FieldRootContext",0,u,"useFieldRootContext",0,function(e=!0){let t=n.useContext(u);if(t.setValidityData===i.NOOP&&!e)throw Error((0,r.default)(28));return t}],125231)},50891,e=>{"use strict";var t=e.i(267805),r=e.i(764556);let n=r.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});e.s(["useFieldsetRootContext",0,function(e=!1){let i=r.useContext(n);if(!i&&!e)throw Error((0,t.default)(86));return i}])},380414,443124,e=>{"use strict";e.i(8890);var t=e.i(764556),r=e.i(863728);let n=t.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:r.NOOP,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});e.s(["useFormContext",0,function(){return t.useContext(n)}],380414);let i=t.createContext({controlId:void 0,registerControlId:r.NOOP,labelId:void 0,setLabelId:r.NOOP,messageIds:[],setMessageIds:r.NOOP,getDescriptionProps:e=>e});e.s(["LabelableContext",0,i,"useLabelableContext",0,function(){return t.useContext(i)}],443124)},84987,593947,2602,e=>{"use strict";e.i(8890);var t=e.i(764556),r=e.i(29905),n=e.i(125231),i=e.i(438904),a=e.i(50891),l=e.i(380414),o=e.i(549154),s=e.i(370383),u=e.i(139236),d=e.i(443124),c=e.i(344180);let f=function(e){let n=(0,u.useBaseUiId)(),i=void 0===e.controlId?n:e.controlId,[a,l]=t.useState(i),[f,v]=t.useState(e.labelId),[p,b]=t.useState([]),m=(0,o.useRefWithInit)(()=>new Map),{messageIds:g}=(0,d.useLabelableContext)(),y=(0,r.useStableCallback)((e,t)=>{let r=m.current;void 0===t?r.delete(e):(r.set(e,t),l(e=>{let t;if(0!==r.size){for(let n of r.values()){if(void 0!==e&&n===e)return e;void 0===t&&(t=n)}return t}}))}),h=t.useCallback(e=>(0,s.mergeProps)({"aria-describedby":g.concat(p).join(" ")||void 0},e),[g,p]),C=t.useMemo(()=>({controlId:a,registerControlId:y,labelId:f,setLabelId:v,messageIds:p,setMessageIds:b,getDescriptionProps:h}),[a,y,f,v,p,b,h]);return(0,c.jsx)(d.LabelableContext.Provider,{value:C,children:e.children})};e.s(["LabelableProvider",0,f],593947);var v=e.i(969490),p=e.i(863728),b=e.i(232449);function m(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}e.s(["getCombinedFieldValidityData",0,m],2602);let g=Object.keys(i.DEFAULT_VALIDITY_STATE);var y=e.i(106206),h=e.i(277642);let C=t.forwardRef(function(e,o){let{errors:u,validationMode:f,submitAttemptedRef:C}=(0,l.useFormContext)(),{render:E,className:x,validate:R,validationDebounceTime:T=0,validationMode:k=f,name:I,disabled:S=!1,invalid:w,dirty:P,touched:O,actionsRef:L,style:M,...A}=e,{disabled:D}=(0,a.useFieldsetRootContext)(),N=(0,r.useStableCallback)(R||(()=>null)),F=D||S,[V,j]=t.useState(!1),[B,_]=t.useState(!1),[U,z]=t.useState(!1),[$,W]=t.useState(!1),Y=P??B,H=O??V,J=t.useRef(!1),K=(0,r.useStableCallback)(e=>{void 0===P&&(e&&(J.current=!0),_(e))}),Z=(0,r.useStableCallback)(e=>{void 0===O&&j(e)}),X=(0,r.useStableCallback)(()=>"onChange"===k||"onSubmit"===k&&C.current),q=!!I&&Object.hasOwn(u,I)&&void 0!==u[I],G=!0===w||q,[Q,ee]=t.useState({state:i.DEFAULT_VALIDITY_STATE,error:"",errors:[],value:null,initialValue:null}),et=!G&&Q.state.valid,er=t.useMemo(()=>({disabled:F,touched:H,dirty:Y,valid:et,filled:U,focused:$}),[F,H,Y,et,U,$]),en=function(e){let{formRef:n,clearErrors:a}=(0,l.useFormContext)(),{setValidityData:o,validate:u,validityData:c,validationDebounceTime:f,invalid:v,markedDirtyRef:y,state:h,name:C,shouldValidateOnChange:E}=e,{controlId:x,getDescriptionProps:R}=(0,d.useLabelableContext)(),T=(0,b.useTimeout)(),k=t.useRef(null),I=(0,r.useStableCallback)(async(e,t=!1)=>{let r,a=k.current;if(!a)return;if(t){if(!1!==h.valid)return;let t=a.validity;if(!t.valueMissing){let t={value:e,state:{...i.DEFAULT_VALIDITY_STATE,valid:!0},error:"",errors:[],initialValue:c.initialValue};if(a.setCustomValidity(""),x){let e=n.current.fields.get(x);e&&n.current.fields.set(x,{...e,...m(t,!1)})}o(t);return}let r=g.reduce((e,r)=>(e[r]=t[r],e),{});if(!r.valid&&!function(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(let r of g)"valid"!==r&&("valueMissing"===r&&(t=e[r]),e[r]&&(t=!1));return t}(r))return}T.clear();let l=null,s=[],d=function(e){let t=g.reduce((t,r)=>(t[r]=e.validity[r],t),{}),r=!1;for(let e of g)if("valid"!==e){if("valueMissing"===e&&t[e])r=!0;else if(t[e])return t}return r&&!y.current&&(t.valid=!0,t.valueMissing=!1),t}(a),f=E();if(a.validationMessage&&!f)r=a.validationMessage,s=[a.validationMessage];else{let t=u(e,Array.from(n.current.fields.values()).reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}));null!==(l="object"==typeof t&&null!==t&&"then"in t?await t:t)?(d.valid=!1,d.customError=!0,Array.isArray(l)?(s=l,a.setCustomValidity(l.join("\n"))):l&&(s=[l],a.setCustomValidity(l))):f&&(a.setCustomValidity(""),d.customError=!1,a.validationMessage?(r=a.validationMessage,s=[a.validationMessage]):a.validity.valid&&!d.valid&&(d.valid=!0))}let p={value:e,state:d,error:r??(Array.isArray(l)?l[0]:l??""),errors:s,initialValue:c.initialValue};if(x){let e=n.current.fields.get(x);e&&n.current.fields.set(x,{...e,...m(p,v)})}o(p)}),S=t.useCallback((e={})=>(0,s.mergeProps)(R,!1===h.valid?{"aria-invalid":!0}:p.EMPTY_OBJECT,e),[R,h.valid]),w=t.useCallback((e={})=>(0,s.mergeProps)({onChange(e){if(e.nativeEvent.defaultPrevented)return;if(a(C),!E())return void I(e.currentTarget.value,!0);let t=e.currentTarget;""===t.value?I(t.value):(T.clear(),f?T.start(f,()=>{I(t.value)}):I(t.value))}},S(e)),[S,a,C,T,I,f,E]);return t.useMemo(()=>({getValidationProps:S,getInputValidationProps:w,inputRef:k,commit:I}),[S,w,I])}({setValidityData:ee,validate:N,validityData:Q,validationDebounceTime:T,invalid:G,markedDirtyRef:J,state:er,name:I,shouldValidateOnChange:X}),ei=t.useCallback(()=>{J.current=!0,en.commit(Q.value)},[en,Q]),ea=function(e){let{commit:n,invalid:i,markedDirtyRef:a,name:o,setValidityData:s,validityData:u}=e,{formRef:d}=(0,l.useFormContext)(),c=t.useRef(null),f=t.useRef(null),v=t.useRef(null),p=(0,r.useStableCallback)(()=>{let e=f.current;if(e)return e.getValue?e.getValue():e.value}),b=(0,r.useStableCallback)((e=!0)=>{let t=f.current;if(!t)return;let r=t.value;void 0===r&&(r=p()),a.current=!0,e?y.flushSync(()=>n(r)):n(r)});function g(e=f.current?.id){e&&d.current.fields.delete(e)}return(0,h.useIsoLayoutEffect)(()=>{let e=f.current;e&&e.id&&d.current.fields.set(e.id,{getValue:p,name:o,controlRef:e.controlRef??v,validityData:m(u,i),validate:b})},[d,p,i,o,b,u]),(0,h.useIsoLayoutEffect)(()=>{let e=d.current.fields;return()=>{let t=f.current?.id;t&&e.delete(t)}},[d]),(0,r.useStableCallback)((e,t)=>{let r;if(!t){c.current===e&&(c.current=null,g(),f.current=null);return}let n=f.current?.id;c.current=e,f.current=t,n&&n!==t.id&&g(n),function(){let e=f.current;if(!e)return;let t=e.value;void 0===t&&(t=p()),null===u.initialValue&&null!==t&&s(e=>({...e,initialValue:t}))}(),(r=f.current)&&r.id&&d.current.fields.set(r.id,{getValue:p,name:o,controlRef:r.controlRef??v,validityData:m(u,i),validate:b})})}({commit:en.commit,invalid:G,markedDirtyRef:J,name:I,setValidityData:ee,validityData:Q});t.useImperativeHandle(L,()=>({validate:ei}),[ei]);let el=t.useMemo(()=>({invalid:G,name:I,validityData:Q,setValidityData:ee,disabled:F,touched:H,setTouched:Z,dirty:Y,setDirty:K,filled:U,setFilled:z,focused:$,setFocused:W,validate:N,validationMode:k,validationDebounceTime:T,shouldValidateOnChange:X,state:er,markedDirtyRef:J,registerFieldControl:ea,validation:en}),[G,I,Q,F,H,Z,Y,K,U,z,$,W,N,k,T,X,er,ea,en]),eo=(0,v.useRenderElement)("div",e,{ref:o,state:er,props:A,stateAttributesMapping:i.fieldValidityMapping});return(0,c.jsx)(n.FieldRootContext.Provider,{value:el,children:eo})}),E=t.forwardRef(function(e,t){return(0,c.jsx)(f,{children:(0,c.jsx)(C,{...e,ref:t})})});e.s(["FieldRoot",0,E],84987)},559713,e=>{"use strict";var t=e.i(277642),r=e.i(139236);e.s(["useRegisteredLabelId",0,function(e,n){let i=(0,r.useBaseUiId)(e);return(0,t.useIsoLayoutEffect)(()=>(n(i),()=>{n(void 0)}),[i,n]),i}])},262407,213700,987854,781406,e=>{"use strict";e.i(8890);var t=e.i(764556),r=e.i(125231),n=e.i(438904),i=e.i(969490),a=e.i(443124),l=e.i(92615),o=e.i(526850),s=e.i(29905),u=e.i(410421),d=e.i(559713);function c(e={}){let{id:t,fallbackControlId:r,native:n=!1,setLabelId:i,focusControl:v}=e,{controlId:p,setLabelId:b}=(0,a.useLabelableContext)(),m=(0,s.useStableCallback)(e=>{b(e),i?.(e)}),g=(0,d.useRegisteredLabelId)(t,m),y=p??r;function h(e){let t=(0,u.getTarget)(e.nativeEvent);t?.closest("button,input,select,textarea")||(!e.defaultPrevented&&e.detail>1&&e.preventDefault(),n||function(e){if(v)return v(e,y);if(!y)return;let t=(0,o.ownerDocument)(e.currentTarget).getElementById(y);(0,l.isHTMLElement)(t)&&f(t)}(e))}return n?{id:g,htmlFor:y??void 0,onMouseDown:h}:{id:g,onClick:h,onPointerDown(e){e.preventDefault()}}}function f(e){e.focus({focusVisible:!0})}e.s(["focusElementWithVisible",0,f,"useLabel",0,c],213700);let v=t.forwardRef(function(e,l){let{render:o,className:s,style:u,id:d,nativeLabel:f=!0,...v}=e,p=(0,r.useFieldRootContext)(!1),{labelId:b}=(0,a.useLabelableContext)(),m=t.useRef(null),g=c({id:b??d,native:f});return(0,i.useRenderElement)("label",e,{ref:[l,m],state:p.state,props:[g,v],stateAttributesMapping:n.fieldValidityMapping})});e.s(["FieldLabel",0,v],262407);var p=e.i(277642),b=e.i(380414),m=e.i(139236),g=e.i(273598),y=e.i(282458),h=e.i(254891),C=e.i(344180);let E={...n.fieldValidityMapping,...y.transitionStatusMapping},x=t.forwardRef(function(e,n){let{render:l,id:o,className:s,match:u,style:d,...c}=e,f=(0,m.useBaseUiId)(o),{validityData:v,state:y,name:x}=(0,r.useFieldRootContext)(!1),{setMessageIds:R}=(0,a.useLabelableContext)(),{errors:T}=(0,b.useFormContext)(),k=x?T[x]:null,I="string"==typeof u,S=!1;S=!0===u||(I?!!v.state[u]:!!k||!1===v.state.valid);let{mounted:w,transitionStatus:P,setMounted:O}=(0,h.useTransitionStatus)(S);(0,p.useIsoLayoutEffect)(()=>{if(S&&f)return R(e=>e.concat(f)),()=>{R(e=>e.filter(e=>e!==f))}},[S,f,R]);let L=t.useRef(null),[M,A]=t.useState(null),[D,N]=t.useState(null),F=v.errors.length>1?(0,C.jsx)("ul",{children:v.errors.map(e=>(0,C.jsx)("li",{children:e},e))}):v.error,V=I?F:k||F,j=v.error;null!=k?j=Array.isArray(k)?JSON.stringify(k):k:v.errors.length>1&&(j=JSON.stringify(v.errors)),S&&j!==D&&(N(j),A(V)),(0,g.useOpenChangeComplete)({open:S,ref:L,onComplete(){S||O(!1)}});let B={...y,transitionStatus:P},_=(0,i.useRenderElement)("div",e,{ref:[n,L],state:B,props:[{id:f,children:S?V:M},c],stateAttributesMapping:E,enabled:w});return w?_:null});e.s(["FieldError",0,x],987854);let R=t.forwardRef(function(e,t){let{render:l,id:o,className:s,style:u,...d}=e,c=(0,m.useBaseUiId)(o),f=(0,r.useFieldRootContext)(!1),{setMessageIds:v}=(0,a.useLabelableContext)();return(0,p.useIsoLayoutEffect)(()=>{if(c)return v(e=>e.concat(c)),()=>{v(e=>e.filter(e=>e!==c))}},[c,v]),(0,i.useRenderElement)("p",e,{ref:t,state:f.state,props:[{id:c},d],stateAttributesMapping:n.fieldValidityMapping})});e.s(["FieldDescription",0,R],781406)},975698,e=>{"use strict";var t=e.i(764556),r=e.i(277642),n=e.i(125231);e.s(["useRegisterFieldControl",0,function(e,i){let{enabled:a=!0,getValue:l,id:o,value:s}=i,{registerFieldControl:u}=(0,n.useFieldRootContext)(),d=t.useRef(null);d.current||(d.current=Symbol()),(0,r.useIsoLayoutEffect)(()=>{let t=d.current;if(t&&a)return u(t,{controlRef:e,getValue:l,id:o,value:s}),()=>{u(t,void 0)}},[e,a,l,o,u,s])}])},575665,e=>{"use strict";var t=e.i(764556),r=e.i(277642),n=e.i(29905),i=e.i(549154),a=e.i(92615),l=e.i(863728),o=e.i(139236),s=e.i(443124);e.s(["useLabelableId",0,function(e={}){let{id:u,implicit:d=!1,controlRef:c}=e,{controlId:f,registerControlId:v}=(0,s.useLabelableContext)(),p=(0,o.useBaseUiId)(u),b=d?f:void 0,m=(0,i.useRefWithInit)(()=>Symbol("labelable-control")),g=t.useRef(!1),y=t.useRef(null!=u),h=(0,n.useStableCallback)(()=>{g.current&&v!==l.NOOP&&(g.current=!1,v(m.current,void 0))});return(0,r.useIsoLayoutEffect)(()=>{let e;if(v!==l.NOOP){if(d){let t=c?.current;e=(0,a.isElement)(t)&&null!=t.closest("label")?u??null:b??p}else if(null!=u)y.current=!0,e=u;else{if(!y.current)return void h();e=p}if(void 0===e)return void h();g.current=!0,v(m.current,e)}},[u,c,b,v,d,p,m,h]),t.useEffect(()=>h,[h]),f??p}])},681622,e=>{"use strict";var t=e.i(344180),r=e.i(764556);e.i(8890),e.i(636707);var n=e.i(84987),i=e.i(262407),a=e.i(987854),l=e.i(781406),o=e.i(535270),s=e.i(277642),u=e.i(526850),d=e.i(29905),c=e.i(125231),f=e.i(975698),v=e.i(443124),p=e.i(575665),b=e.i(438904),m=e.i(969490),g=e.i(602453),y=e.i(742665),h=e.i(410421);let C=r.forwardRef(function(e,t){let{render:n,className:i,id:a,name:l,value:C,disabled:E=!1,onValueChange:x,defaultValue:R,autoFocus:T=!1,style:k,...I}=e,{state:S,name:w,disabled:P,setTouched:O,setDirty:L,validityData:M,setFocused:A,setFilled:D,validationMode:N,validation:F}=(0,c.useFieldRootContext)(),V=P||E,j={...S,disabled:V},{labelId:B}=(0,v.useLabelableContext)(),_=(0,p.useLabelableId)({id:a});(0,s.useIsoLayoutEffect)(()=>{let e=null!=C;F.inputRef.current?.value||e&&""!==C?D(!0):e&&""===C&&D(!1)},[F.inputRef,D,C]);let U=r.useRef(null);(0,s.useIsoLayoutEffect)(()=>{T&&U.current===(0,h.activeElement)((0,u.ownerDocument)(U.current))&&A(!0)},[T,A]);let[z]=(0,o.useControlled)({controlled:C,default:R,name:"FieldControl",state:"value"}),$=void 0!==C,W=$?z:void 0,Y=(0,d.useStableCallback)(()=>F.inputRef.current?.value);return(0,f.useRegisterFieldControl)(F.inputRef,{id:_,value:W,getValue:Y}),(0,m.useRenderElement)("input",e,{ref:[t,U],state:j,props:[{id:_,disabled:V,name:w??l,ref:F.inputRef,"aria-labelledby":B,autoFocus:T,...$?{value:W}:{defaultValue:R},onChange(e){let t=e.currentTarget.value;x?.(t,(0,g.createChangeEventDetails)(y.REASONS.none,e.nativeEvent)),L(t!==M.initialValue),D(""!==t)},onFocus(){A(!0)},onBlur(e){O(!0),A(!1),"onBlur"===N&&F.commit(e.currentTarget.value)},onKeyDown(e){"INPUT"===e.currentTarget.tagName&&"Enter"===e.key&&(O(!0),F.commit(e.currentTarget.value))}},F.getInputValidationProps(),I],stateAttributesMapping:b.fieldValidityMapping})});var E=e.i(2602),x=e.i(254891);let R=r.createContext({disabled:!1});var T=e.i(593947),k=e.i(267805);let I=r.createContext(void 0),S=r.forwardRef(function(e,n){let{render:i,className:a,style:l,disabled:o=!1,...s}=e,{state:u,disabled:d}=(0,c.useFieldRootContext)(!1),f=d||o,v=function(e=!0){let t=r.useContext(I);if(void 0===t&&!e)throw Error((0,k.default)(3));return t}(),p=v?.parent.id,g=v?.allValues!==void 0,y=r.useMemo(()=>({disabled:f}),[f]),h=(0,m.useRenderElement)("div",e,{ref:n,state:u,props:s,stateAttributesMapping:b.fieldValidityMapping});return(0,t.jsx)(T.LabelableProvider,{controlId:g?p:void 0,children:(0,t.jsx)(R.Provider,{value:y,children:h})})});e.s(["Control",0,C,"Description",()=>l.FieldDescription,"Error",()=>a.FieldError,"Item",0,S,"Label",()=>i.FieldLabel,"Root",()=>n.FieldRoot,"Validity",0,function(e){let{children:n}=e,{validityData:i,invalid:a}=(0,c.useFieldRootContext)(!1),l=r.useMemo(()=>(0,E.getCombinedFieldValidityData)(i,a),[i,a]),o=!1===l.state.valid,{transitionStatus:s}=(0,x.useTransitionStatus)(o),u=r.useMemo(()=>({...l,validity:l.state,transitionStatus:s}),[l,s]);return(0,t.jsx)(r.Fragment,{children:n(u)})}],906646);var w=e.i(906646),w=w;let P=r.forwardRef(function(e,r){return(0,t.jsx)(w.Control,{ref:r,...e})});var O=e.i(465458);e.s(["Input",0,function({className:e,type:n,onKeyDown:i,...a}){let l=r.useRef(!1),o=r.useCallback(()=>{l.current=!0},[]),s=r.useCallback(()=>{l.current=!1},[]),u=r.useCallback(e=>{if("Enter"===e.key&&l.current){e.preventDefault(),e.stopPropagation();return}i?.(e)},[i]);return(0,t.jsx)(P,{type:n,"data-slot":"input",className:(0,O.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),onCompositionStart:o,onCompositionEnd:s,onKeyDown:u,...a})}],681622)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,144988,e=>{"use strict";let t=(0,e.i(433721).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["default",0,t])},193251,e=>{"use strict";let t=(0,e.i(433721).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["Download",0,t],193251)},984178,e=>{"use strict";var t=e.i(144988);e.s(["FileIcon",()=>t.default])},460578,e=>{"use strict";var t=e.i(344180),n=e.i(764556),i=e.i(898822),r=e.i(129981),a=e.i(972846),l=e.i(984178),o=e.i(465458);let s=0;e.s(["FileUpload",0,function({value:e=[],onChange:u,accept:c,maxFiles:d=0,maxSize:f,disabled:p=!1,className:b,placeholder:g}){let[h,v]=(0,n.useState)(null),m=(0,n.useCallback)((t,n)=>{if(v(null),n.length>0){let e=n[0].errors[0]?.message;e&&v(e)}if(0===t.length)return;let i=t.map(e=>{let t={id:`upload-${++s}`,file:e};return e.type.startsWith("image/")&&(t.preview=URL.createObjectURL(e)),t}),r=d>0?[...e,...i].slice(0,d):[...e,...i];u?.(r)},[e,u,d]),x=(0,n.useCallback)(t=>{let n=e.find(e=>e.id===t);n?.preview&&URL.revokeObjectURL(n.preview),u?.(e.filter(e=>e.id!==t))},[e,u]),{getRootProps:y,getInputProps:C,isDragActive:R}=(0,i.useDropzone)({onDrop:m,accept:c,maxFiles:d||void 0,maxSize:f,disabled:p,noClick:!1});return(0,t.jsxs)("div",{className:(0,o.cn)("space-y-3",b),children:[(0,t.jsxs)("div",{...y(),className:(0,o.cn)("relative flex flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed px-6 py-8 transition-colors cursor-pointer",R?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-accent/50",p&&"pointer-events-none opacity-50"),children:[(0,t.jsx)("input",{...C()}),(0,t.jsx)(r.Upload,{className:"size-8 text-muted-foreground"}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:g??(R?"松开即可上传":"拖拽文件到此处,或点击选择")}),!R&&(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:["支持多文件",f?`,单文件最大 ${(f/1024/1024).toFixed(0)}MB`:""]})]})]}),h&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:h}),e.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>{var n;return(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-background px-3 py-2 overflow-hidden",children:[e.preview?(0,t.jsx)("img",{src:e.preview,alt:"",className:"size-10 rounded-md object-cover"}):(0,t.jsx)("div",{className:"flex size-10 items-center justify-center rounded-md bg-muted",children:(0,t.jsx)(l.FileIcon,{className:"size-5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate text-sm",children:e.file.name}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:(n=e.file.size)<1024?`${n} B`:n<1048576?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`})]}),(0,t.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),x(e.id)},className:"flex size-7 items-center justify-center rounded-md hover:bg-accent transition-colors",children:(0,t.jsx)(a.X,{className:"size-4 text-muted-foreground"})})]},e.id)})})]})}])},790766,e=>{"use strict";e.s([])},257295,619279,415279,439485,e=>{"use strict";var t,n,i=e.i(764556),r=e.i(535270),a=e.i(277642),l=e.i(29905),o=e.i(139236),s=e.i(602453),u=e.i(742665),c=e.i(427708),d=e.i(254891);e.s(["useCollapsibleRoot",0,function(e){let{open:t,defaultOpen:n,onOpenChange:f,disabled:p}=e,b=void 0!==t,[g,h]=(0,r.useControlled)({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:v,setMounted:m,transitionStatus:x}=(0,d.useTransitionStatus)(g,!0,!0),[y,C]=i.useState(g),[{height:R,width:S},E]=i.useState({height:void 0,width:void 0}),A=(0,o.useBaseUiId)(),[I,M]=i.useState(),T=I??A,[w,O]=i.useState(!1),[k,D]=i.useState(!1),N=i.useRef(null),L=i.useRef(null),P=i.useRef(null),j=i.useRef(null),W=(0,c.useAnimationsFinished)(j,!1),_=(0,l.useStableCallback)(e=>{let t=!g,n=(0,s.createChangeEventDetails)(u.REASONS.triggerPress,e.nativeEvent);if(f(t,n),n.isCanceled)return;let i=j.current;"css-animation"===L.current&&null!=i&&i.style.removeProperty("animation-name"),w||k||(null!=L.current&&"css-animation"!==L.current&&!v&&t&&m(!0),"css-animation"===L.current&&(!y&&t&&C(!0),!v&&t&&m(!0))),h(t),"none"===L.current&&v&&!t&&m(!1)});return(0,a.useIsoLayoutEffect)(()=>{b&&"none"===L.current&&!g&&m(!1)},[b,g,t,m]),i.useMemo(()=>({abortControllerRef:N,animationTypeRef:L,disabled:p,handleTrigger:_,height:R,mounted:v,open:g,panelId:T,panelRef:j,runOnceAnimationsFinish:W,setDimensions:E,setHiddenUntilFound:O,setKeepMounted:D,setMounted:m,setOpen:h,setPanelIdState:M,setVisible:C,transitionDimensionRef:P,transitionStatus:x,visible:y,width:S}),[N,L,p,_,R,v,g,T,j,W,E,O,D,m,h,C,P,x,y,S])}],257295),e.i(8890);var f=e.i(267805);let p=i.createContext(void 0);e.s(["CollapsibleRootContext",0,p,"useCollapsibleRootContext",0,function(){let e=i.useContext(p);if(void 0===e)throw Error((0,f.default)(15));return e}],619279);var b=e.i(282458);let g=((t={}).open="data-open",t.closed="data-closed",t[t.startingStyle=b.TransitionStatusDataAttributes.startingStyle]="startingStyle",t[t.endingStyle=b.TransitionStatusDataAttributes.endingStyle]="endingStyle",t);e.s(["CollapsiblePanelDataAttributes",0,g],415279);let h=((n={}).panelOpen="data-panel-open",n),v={[g.open]:""},m={[g.closed]:""};e.s(["collapsibleOpenStateMapping",0,{open:e=>e?v:m},"triggerOpenStateMapping",0,{open:e=>e?{[h.panelOpen]:""}:null}],439485)},998723,406899,134319,e=>{"use strict";e.i(8890);var t=e.i(764556),n=e.i(29905),i=e.i(969490),r=e.i(257295),a=e.i(619279),l=e.i(439485),o=e.i(282458);let s={...l.collapsibleOpenStateMapping,...o.transitionStatusMapping};e.s(["collapsibleStateAttributesMapping",0,s],406899);var u=e.i(344180);let c=t.forwardRef(function(e,l){let{render:o,className:c,defaultOpen:d=!1,disabled:f=!1,onOpenChange:p,open:b,style:g,...h}=e,v=(0,n.useStableCallback)(p),m=(0,r.useCollapsibleRoot)({open:b,defaultOpen:d,onOpenChange:v,disabled:f}),x=t.useMemo(()=>({open:m.open,disabled:m.disabled,transitionStatus:m.transitionStatus}),[m.open,m.disabled,m.transitionStatus]),y=t.useMemo(()=>({...m,onOpenChange:v,state:x}),[m,v,x]),C=(0,i.useRenderElement)("div",e,{state:x,ref:l,props:h,stateAttributesMapping:s});return(0,u.jsx)(a.CollapsibleRootContext.Provider,{value:y,children:C})});e.s(["CollapsibleRoot",0,c],998723);var d=e.i(931709);let f={...l.triggerOpenStateMapping,...o.transitionStatusMapping},p=t.forwardRef(function(e,n){let{panelId:r,open:l,handleTrigger:o,state:s,disabled:u}=(0,a.useCollapsibleRootContext)(),{className:c,disabled:p=u,id:b,render:g,nativeButton:h=!0,style:v,...m}=e,{getButtonProps:x,buttonRef:y}=(0,d.useButton)({disabled:p,focusableWhenDisabled:!0,native:h}),C=t.useMemo(()=>({"aria-controls":l?r:void 0,"aria-expanded":l,onClick:o}),[r,l,o]);return(0,i.useRenderElement)("button",e,{state:s,ref:[n,y],props:[C,m,x],stateAttributesMapping:f})});e.s(["CollapsibleTrigger",0,p],134319)},18158,e=>{"use strict";e.i(8890);var t,n=e.i(764556),i=e.i(422561),r=e.i(277642),a=e.i(29905),l=e.i(204133),o=e.i(130522),s=e.i(859092),u=e.i(602453),c=e.i(742665),d=e.i(415279);let f=((t={}).disabled="data-disabled",t.orientation="data-orientation",t);e.s(["useCollapsiblePanel",0,function(e){let{abortControllerRef:t,animationTypeRef:p,externalRef:b,height:g,hiddenUntilFound:h,keepMounted:v,id:m,mounted:x,onOpenChange:y,open:C,panelRef:R,runOnceAnimationsFinish:S,setDimensions:E,setMounted:A,setOpen:I,setVisible:M,transitionDimensionRef:T,visible:w,width:O}=e,k=n.useRef(!1),D=n.useRef(null),N=n.useRef(C),L=n.useRef(C),P=(0,s.useAnimationFrame)(),j=n.useMemo(()=>"css-animation"===p.current?!w:!C&&!x,[C,x,w,p]),W=(0,a.useStableCallback)(e=>{if(!e)return;if(null==p.current||null==T.current){let t=getComputedStyle(e),n="none"!==t.animationName&&""!==t.animationName,i="0s"!==t.transitionDuration&&""!==t.transitionDuration;n&&i||("none"===t.animationName&&"0s"!==t.transitionDuration?p.current="css-transition":"none"!==t.animationName&&"0s"===t.transitionDuration?p.current="css-animation":p.current="none"),"horizontal"===e.getAttribute(f.orientation)||t.transitionProperty.indexOf("width")>-1?T.current="width":T.current="height"}if("css-transition"!==p.current)return;(void 0===g||void 0===O)&&(E({height:e.scrollHeight,width:e.scrollWidth}),L.current&&e.style.setProperty("transition-duration","0s"));let t=-1,n=-1;return t=s.AnimationFrame.request(()=>{L.current=!1,n=s.AnimationFrame.request(()=>{setTimeout(()=>{e.style.removeProperty("transition-duration")})})}),()=>{s.AnimationFrame.cancel(t),s.AnimationFrame.cancel(n)}}),_=(0,l.useMergedRefs)(b,R,W);return(0,r.useIsoLayoutEffect)(()=>{if("css-transition"!==p.current)return;let e=R.current;if(!e)return;let n=-1;if(null!=t.current&&(t.current.abort(),t.current=null),C){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,"initial","important")}),L.current||v||e.setAttribute(d.CollapsiblePanelDataAttributes.startingStyle,""),E({height:e.scrollHeight,width:e.scrollWidth}),n=s.AnimationFrame.request(()=>{Object.entries(t).forEach(([t,n])=>{""===n?e.style.removeProperty(t):e.style.setProperty(t,n)})})}else{if(0===e.scrollHeight&&0===e.scrollWidth)return;E({height:e.scrollHeight,width:e.scrollWidth});let n=new AbortController;t.current=n;let i=n.signal,r=null,a=d.CollapsiblePanelDataAttributes.endingStyle;return(r=new MutationObserver(l=>{l.some(e=>"attributes"===e.type&&e.attributeName===a)&&(r?.disconnect(),r=null,S(()=>{E({height:0,width:0}),e.style.removeProperty("content-visibility"),A(!1),t.current===n&&(t.current=null)},i))})).observe(e,{attributes:!0,attributeFilter:[a]}),()=>{r?.disconnect(),P.cancel(),t.current===n&&(n.abort(),t.current=null)}}return()=>{s.AnimationFrame.cancel(n)}},[t,p,P,h,v,x,C,R,S,E,A]),(0,r.useIsoLayoutEffect)(()=>{if("css-animation"!==p.current)return;let e=R.current;e&&(D.current=e.style.animationName||D.current,e.style.setProperty("animation-name","none"),E({height:e.scrollHeight,width:e.scrollWidth}),N.current||k.current||e.style.removeProperty("animation-name"),C?(null!=t.current&&(t.current.abort(),t.current=null),A(!0),M(!0)):(t.current=new AbortController,S(()=>{A(!1),M(!1),t.current=null},t.current.signal)))},[t,p,C,R,S,E,A,M,w]),(0,o.useOnMount)(()=>{let e=s.AnimationFrame.request(()=>{N.current=!1});return()=>s.AnimationFrame.cancel(e)}),(0,r.useIsoLayoutEffect)(()=>{if(!h)return;let e=R.current;if(!e)return;let t=-1,n=-1;return C&&k.current&&(e.style.transitionDuration="0s",E({height:e.scrollHeight,width:e.scrollWidth}),t=s.AnimationFrame.request(()=>{k.current=!1,n=s.AnimationFrame.request(()=>{setTimeout(()=>{e.style.removeProperty("transition-duration")})})})),()=>{s.AnimationFrame.cancel(t),s.AnimationFrame.cancel(n)}},[h,C,R,E]),(0,r.useIsoLayoutEffect)(()=>{let e=R.current;e&&h&&j&&(e.setAttribute("hidden","until-found"),"css-transition"===p.current&&e.setAttribute(d.CollapsiblePanelDataAttributes.startingStyle,""))},[h,j,p,R]),n.useEffect(function(){let e=R.current;if(e)return(0,i.addEventListener)(e,"beforematch",function(e){k.current=!0,I(!0),y(!0,(0,u.createChangeEventDetails)(c.REASONS.none,e))})},[y,R,I]),n.useMemo(()=>({props:{hidden:j,id:m,ref:_}}),[j,m,_])}],18158)},256186,e=>{"use strict";var t,n=e.i(344180);e.i(790766);var i=e.i(998723),r=e.i(134319);e.i(8890);var a=e.i(764556),l=e.i(277642),o=e.i(969490),s=e.i(619279),u=e.i(406899),c=e.i(18158);let d=((t={}).collapsiblePanelHeight="--collapsible-panel-height",t.collapsiblePanelWidth="--collapsible-panel-width",t);var f=e.i(273598);let p=a.forwardRef(function(e,t){let{className:n,hiddenUntilFound:i,keepMounted:r,render:p,id:b,style:g,...h}=e,{abortControllerRef:v,animationTypeRef:m,height:x,mounted:y,onOpenChange:C,open:R,panelId:S,panelRef:E,runOnceAnimationsFinish:A,setDimensions:I,setHiddenUntilFound:M,setKeepMounted:T,setMounted:w,setPanelIdState:O,setOpen:k,setVisible:D,state:N,transitionDimensionRef:L,visible:P,width:j,transitionStatus:W}=(0,s.useCollapsibleRootContext)(),_=i??!1,z=r??!1;(0,l.useIsoLayoutEffect)(()=>{if(b)return O(b),()=>{O(void 0)}},[b,O]),(0,l.useIsoLayoutEffect)(()=>{M(_)},[M,_]),(0,l.useIsoLayoutEffect)(()=>{T(z)},[T,z]);let{props:F}=(0,c.useCollapsiblePanel)({abortControllerRef:v,animationTypeRef:m,externalRef:t,height:x,hiddenUntilFound:_,id:S,keepMounted:z,mounted:y,onOpenChange:C,open:R,panelRef:E,runOnceAnimationsFinish:A,setDimensions:I,setMounted:w,setOpen:k,setVisible:D,transitionDimensionRef:L,visible:P,width:j});(0,f.useOpenChangeComplete)({open:R&&"idle"===W,ref:E,onComplete(){R&&I({height:void 0,width:void 0})}});let H=a.useMemo(()=>({...N,transitionStatus:W}),[N,W]),B=(0,o.useRenderElement)("div",e,{state:H,ref:[t,E],props:[F,{style:{[d.collapsiblePanelHeight]:void 0===x?"auto":`${x}px`,[d.collapsiblePanelWidth]:void 0===j?"auto":`${j}px`}},h],stateAttributesMapping:u.collapsibleStateAttributesMapping});return z||_||y?B:null});e.s(["Panel",0,p,"Root",()=>i.CollapsibleRoot,"Trigger",()=>r.CollapsibleTrigger],917853);var b=e.i(917853),b=b;e.s(["Collapsible",0,function({...e}){return(0,n.jsx)(b.Root,{"data-slot":"collapsible",...e})},"CollapsibleContent",0,function({...e}){return(0,n.jsx)(b.Panel,{"data-slot":"collapsible-content",...e})},"CollapsibleTrigger",0,function({...e}){return(0,n.jsx)(b.Trigger,{"data-slot":"collapsible-trigger",...e})}],256186)},383171,415955,e=>{"use strict";var t=e.i(220336);e.s(["FolderIcon",()=>t.default],383171);var n=e.i(680422);e.s(["FolderOpenIcon",()=>n.default],415955)},517432,e=>{"use strict";var t=e.i(56032),n=e.i(863728);function i(){return n.NOOP}function r(){return!1}function a(){return!0}e.s(["useIsHydrating",0,function(){return(0,t.useSyncExternalStore)(i,r,a)}])},9174,e=>{"use strict";e.s(["ACTIVE_COMPOSITE_ITEM",0,"data-composite-item-active"])},568769,e=>{"use strict";e.s(["isElementDisabled",0,function(e){return null==e||e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled")}])},972308,e=>{"use strict";var t=e.i(764556),n=e.i(863728),i=e.i(756432),r=e.i(568769),a=e.i(29905),l=e.i(204133),o=e.i(100229),s=e.i(877580),u=e.i(9174),c=e.i(410421);let d=[];var f=e.i(352360),p=e.i(969490),b=e.i(189131),g=e.i(344180);e.s(["CompositeRoot",0,function(e){let{render:h,className:v,style:m,refs:x=n.EMPTY_ARRAY,props:y=n.EMPTY_ARRAY,state:C=n.EMPTY_OBJECT,stateAttributesMapping:R,highlightedIndex:S,onHighlightedIndexChange:E,orientation:A,dense:I,itemSizes:M,loopFocus:T,onLoop:w,cols:O,enableHomeAndEndKeys:k,onMapChange:D,stopEventPropagation:N=!0,rootRef:L,disabledIndices:P,modifierKeys:j,highlightItemOnHover:W=!1,tag:_="div",...z}=e,{props:F,highlightedIndex:H,onHighlightedIndexChange:B,elementsRef:K,onMapChange:V,relayKeyboardEvent:Y}=function(e){let{itemSizes:n,cols:i=1,loopFocus:f=!0,onLoop:p,dense:b=!1,orientation:g="both",direction:h,highlightedIndex:v,onHighlightedIndexChange:m,rootRef:x,enableHomeAndEndKeys:y=!1,stopEventPropagation:C=!1,disabledIndices:R,modifierKeys:S=d}=e,[E,A]=t.useState(0),I=i>1,M=t.useRef(null),T=(0,l.useMergedRefs)(M,x),w=t.useRef([]),O=t.useRef(!1),k=v??E,D=(0,a.useStableCallback)((e,t=!1)=>{if((m??A)(e),t){let t=w.current[e];(0,o.scrollIntoViewIfNeeded)(M.current,t,h,g)}}),N=(0,a.useStableCallback)(e=>{if(0===e.size||O.current)return;O.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(u.ACTIVE_COMPOSITE_ITEM))??null,i=n?t.indexOf(n):-1;-1!==i&&D(i),(0,o.scrollIntoViewIfNeeded)(M.current,n,h,g)}),L=(0,a.useStableCallback)((e,t,n)=>p?p?.(e,t,n,w):n),P=t.useMemo(()=>({"aria-orientation":"both"===g?void 0:g,ref:T,onFocus(e){let t=M.current,n=(0,c.getTarget)(e.nativeEvent);t&&null!=n&&(0,o.isNativeInput)(n)&&n.setSelectionRange(0,n.value.length??0)},onKeyDown(e){let t=y?o.ALL_KEYS:o.ARROW_KEYS;if(!t.has(e.key)||function(e,t){for(let n of o.MODIFIER_KEYS.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}(e,S)||!M.current)return;let a="rtl"===h,l=a?o.ARROW_LEFT:o.ARROW_RIGHT,u={horizontal:l,vertical:o.ARROW_DOWN,both:l}[g],d=a?o.ARROW_RIGHT:o.ARROW_LEFT,v={horizontal:d,vertical:o.ARROW_UP,both:d}[g],m=(0,c.getTarget)(e.nativeEvent);if(null!=m&&(0,o.isNativeInput)(m)&&!(0,r.isElementDisabled)(m)){let t=m.selectionStart,n=m.selectionEnd,i=m.value??"";if(null==t||e.shiftKey||t!==n||e.key!==v&&t<i.length||e.key!==u&&t>0)return}let x=k,E=(0,s.getMinListIndex)(w,R),A=(0,s.getMaxListIndex)(w,R);if(I){let t=n||Array.from({length:w.current.length},()=>({width:1,height:1})),r=(0,s.createGridCellMap)(t,i,b),l=r.findIndex(e=>null!=e&&!(0,s.isListIndexDisabled)(w.current,e,R)),u=r.reduce((e,t,n)=>null==t||(0,s.isListIndexDisabled)(w.current,t,R)?e:n,-1);x=r[(0,s.getGridNavigatedIndex)(r.map(e=>null!=e?w.current[e]:null),{event:e,orientation:g,loopFocus:f,onLoop:L,cols:i,disabledIndices:(0,s.getGridCellIndices)([...R||w.current.map((e,t)=>(0,s.isListIndexDisabled)(w.current,t)?t:void 0),void 0],r),minIndex:l,maxIndex:u,prevIndex:(0,s.getGridCellIndexOfCorner)(k>A?E:k,t,r,i,e.key===o.ARROW_DOWN?"bl":e.key===o.ARROW_RIGHT?"tr":"tl"),rtl:a})]}let T={horizontal:[l],vertical:[o.ARROW_DOWN],both:[l,o.ARROW_DOWN]}[g],O={horizontal:[d],vertical:[o.ARROW_UP],both:[d,o.ARROW_UP]}[g],N=I?t:({horizontal:y?o.HORIZONTAL_KEYS_WITH_EXTRA_KEYS:o.HORIZONTAL_KEYS,vertical:y?o.VERTICAL_KEYS_WITH_EXTRA_KEYS:o.VERTICAL_KEYS,both:t})[g];y&&(e.key===o.HOME?x=E:e.key===o.END&&(x=A)),x===k&&(T.includes(e.key)||O.includes(e.key))&&(f&&x===A&&T.includes(e.key)?(x=E,p&&(x=p(e,k,x,w))):f&&x===E&&O.includes(e.key)?(x=A,p&&(x=p(e,k,x,w))):x=(0,s.findNonDisabledListIndex)(w.current,{startingIndex:x,decrement:O.includes(e.key),disabledIndices:R})),x===k||(0,s.isIndexOutOfListBounds)(w.current,x)||(C&&e.stopPropagation(),N.has(e.key)&&e.preventDefault(),D(x,!0),queueMicrotask(()=>{w.current[x]?.focus()}))}}),[i,b,h,R,w,y,k,I,n,f,p,L,T,S,D,g,C]);return t.useMemo(()=>({props:P,highlightedIndex:k,onHighlightedIndexChange:D,elementsRef:w,disabledIndices:R,onMapChange:N,relayKeyboardEvent:P.onKeyDown}),[P,k,D,w,R,N])}({itemSizes:M,cols:O,loopFocus:T,onLoop:w,dense:I,orientation:A,highlightedIndex:S,onHighlightedIndexChange:E,rootRef:L,stopEventPropagation:N,enableHomeAndEndKeys:k,direction:(0,b.useDirection)(),disabledIndices:P,modifierKeys:j}),U=(0,p.useRenderElement)(_,e,{state:C,ref:x,props:[F,...y,z],stateAttributesMapping:R}),$=t.useMemo(()=>({highlightedIndex:H,onHighlightedIndexChange:B,highlightItemOnHover:W,relayKeyboardEvent:Y}),[H,B,W,Y]);return(0,g.jsx)(f.CompositeRootContext.Provider,{value:$,children:(0,g.jsx)(i.CompositeList,{elementsRef:K,onMapChange:e=>{D?.(e),V(e)},children:U})})}],972308)},812057,e=>{"use strict";var t,n,i,r=e.i(344180);e.s([],236634),e.i(236634),e.i(8890);var a=e.i(764556),l=e.i(535270),o=e.i(277642),s=e.i(29905),u=e.i(969490),c=e.i(756432),d=e.i(267805);let f=a.createContext(void 0);function p(){let e=a.useContext(f);if(void 0===e)throw Error((0,d.default)(64));return e}let b=((t={}).activationDirection="data-activation-direction",t.orientation="data-orientation",t),g={tabActivationDirection:e=>({[b.activationDirection]:e})},h=a.forwardRef(function(e,t){let{className:n,defaultValue:i=0,onValueChange:d,orientation:p="horizontal",render:b,value:h,style:m,...x}=e,y=Object.hasOwn(e,"defaultValue"),C=a.useRef([]),[R,S]=a.useState(()=>new Map),[E,A]=(0,l.useControlled)({controlled:h,default:i,name:"Tabs",state:"value"}),I=void 0!==h,[M,T]=a.useState(()=>new Map),w=a.useCallback(e=>{if(void 0===e)return null;for(let[t,n]of M.entries())if(null!=n&&e===(n.value??n.index))return t;return null},[M]),[O,k]=a.useState(()=>({previousValue:E,tabActivationDirection:"none"})),{previousValue:D,tabActivationDirection:N}=O,L=N,P=!1;D!==E&&(L=v(D,E,p,M),P=null!=D&&null!=E&&null==w(E));let j=P?D:E,W=D!==j||N!==L;(0,o.useIsoLayoutEffect)(()=>{W&&k({previousValue:j,tabActivationDirection:L})},[j,W,L]);let _=(0,s.useStableCallback)((e,t)=>{t.activationDirection=v(E,e,p,M),d?.(e,t),t.isCanceled||A(e)}),z=(0,s.useStableCallback)((e,t)=>{S(n=>{if(n.get(e)===t)return n;let i=new Map(n);return i.set(e,t),i})}),F=(0,s.useStableCallback)((e,t)=>{S(n=>{if(!n.has(e)||n.get(e)!==t)return n;let i=new Map(n);return i.delete(e),i})}),H=a.useCallback(e=>R.get(e),[R]),B=a.useCallback(e=>{for(let t of M.values())if(e===t?.value)return t?.id},[M]),K=a.useMemo(()=>({getTabElementBySelectedValue:w,getTabIdByPanelValue:B,getTabPanelIdByValue:H,onValueChange:_,orientation:p,registerMountedTabPanel:z,setTabMap:T,unregisterMountedTabPanel:F,tabActivationDirection:L,value:E}),[w,B,H,_,p,z,T,F,L,E]),V=a.useMemo(()=>{for(let e of M.values())if(null!=e&&e.value===E)return e},[M,E]),Y=a.useMemo(()=>{for(let e of M.values())if(null!=e&&!e.disabled)return e.value},[M]);(0,o.useIsoLayoutEffect)(()=>{if(I||0===M.size)return;let e=V?.disabled,t=null==V&&null!==E;if(y&&e&&E===i||!e&&!t)return;let n=Y??null;E!==n&&(A(n),k(e=>"none"===e.tabActivationDirection?e:{...e,tabActivationDirection:"none"}))},[i,Y,y,I,V,A,M,E]);let U={orientation:p,tabActivationDirection:L},$=(0,u.useRenderElement)("div",e,{state:U,ref:t,props:x,stateAttributesMapping:g});return(0,r.jsx)(f.Provider,{value:K,children:(0,r.jsx)(c.CompositeList,{elementsRef:C,children:$})})});function v(e,t,n,i){if(null==e||null==t)return"none";let r=null,a=null;for(let[n,l]of i.entries()){if(null==l)continue;let i=l.value??l.index;if(e===i&&(r=n),t===i&&(a=n),null!=r&&null!=a)break}if(null==r||null==a)return r!==a&&("number"==typeof e||"string"==typeof e)&&typeof e==typeof t?"horizontal"===n?t>e?"right":"left":t>e?"down":"up":"none";let l=r.getBoundingClientRect(),o=a.getBoundingClientRect();if("horizontal"===n){if(o.left<l.left)return"left";if(o.left>l.left)return"right"}else{if(o.top<l.top)return"up";if(o.top>l.top)return"down"}return"none"}var m=e.i(526850),x=e.i(139236),y=e.i(931709),C=e.i(9174),R=e.i(530909);let S=a.createContext(void 0);function E(){let e=a.useContext(S);if(void 0===e)throw Error((0,d.default)(65));return e}var A=e.i(602453),I=e.i(742665),M=e.i(410421);let T=a.forwardRef(function(e,t){let{className:n,disabled:i=!1,render:r,value:l,id:s,nativeButton:c=!0,style:d,...f}=e,{value:b,getTabPanelIdByValue:g,orientation:h}=p(),{activateOnFocus:v,highlightedTabIndex:S,onTabActivation:T,registerTabResizeObserverElement:w,setHighlightedTabIndex:O,tabsListElement:k}=E(),D=(0,x.useBaseUiId)(s),N=a.useMemo(()=>({disabled:i,id:D,value:l}),[i,D,l]),{compositeProps:L,compositeRef:P,index:j}=(0,R.useCompositeItem)({metadata:N}),W=l===b,_=a.useRef(!1),z=a.useRef(null);a.useEffect(()=>{let e=z.current;if(e)return w(e)},[w]),(0,o.useIsoLayoutEffect)(()=>{if(_.current){_.current=!1;return}if(W&&j>-1&&S!==j){if(null!=k){let e=(0,M.activeElement)((0,m.ownerDocument)(k));if(e&&(0,M.contains)(k,e))return}i||O(j)}},[W,j,S,O,i,k]);let{getButtonProps:F,buttonRef:H}=(0,y.useButton)({disabled:i,native:c,focusableWhenDisabled:!0}),B=g(l),K=a.useRef(!1),V=a.useRef(!1);return(0,u.useRenderElement)("button",e,{state:{disabled:i,active:W,orientation:h},ref:[t,H,P,z],props:[L,{role:"tab","aria-controls":B,"aria-selected":W,id:D,onClick:function(e){W||i||T(l,(0,A.createChangeEventDetails)(I.REASONS.none,e.nativeEvent,void 0,{activationDirection:"none"}))},onFocus:function(e){W||(j>-1&&!i&&O(j),!i&&v&&(!K.current||K.current&&V.current)&&T(l,(0,A.createChangeEventDetails)(I.REASONS.none,e.nativeEvent,void 0,{activationDirection:"none"})))},onPointerDown:function(e){W||i||(K.current=!0,e.button&&0!==e.button||(V.current=!0,(0,m.ownerDocument)(e.currentTarget).addEventListener("pointerup",function(){K.current=!1,V.current=!1},{once:!0})))},[C.ACTIVE_COMPOSITE_ITEM]:W?"":void 0,onKeyDownCapture(){_.current=!0}},f,F]})});var w=e.i(730774),O=e.i(517432);let k=((n={}).activeTabLeft="--active-tab-left",n.activeTabRight="--active-tab-right",n.activeTabTop="--active-tab-top",n.activeTabBottom="--active-tab-bottom",n.activeTabWidth="--active-tab-width",n.activeTabHeight="--active-tab-height",n);var D=e.i(394394);let N={...g,activeTabPosition:()=>null,activeTabSize:()=>null},L=a.forwardRef(function(e,t){let{className:n,render:i,renderBeforeHydration:l=!1,style:o,...s}=e,{nonce:c}=(0,D.useCSPContext)(),{getTabElementBySelectedValue:d,orientation:f,tabActivationDirection:b,value:g}=p(),{tabsListElement:h,registerIndicatorUpdateListener:v}=E(),m=(0,O.useIsHydrating)(),x=function(){let[,e]=a.useState({});return a.useCallback(()=>{e({})},[])}();a.useEffect(()=>v(x),[v,x]);let y=0,C=0,R=0,S=0,A=0,I=0,M=!1;if(null!=g&&null!=h){let e=d(g);if(M=!0,null!=e){let{width:t,height:n}=(0,w.getCssDimensions)(e),{width:i,height:r}=(0,w.getCssDimensions)(h),a=e.getBoundingClientRect(),l=h.getBoundingClientRect(),o=i>0?l.width/i:1,s=r>0?l.height/r:1;if(Math.abs(o)>Number.EPSILON&&Math.abs(s)>Number.EPSILON){let e=a.left-l.left,t=a.top-l.top;y=e/o+h.scrollLeft-h.clientLeft,R=t/s+h.scrollTop-h.clientTop}else y=e.offsetLeft,R=e.offsetTop;A=t,I=n,C=h.scrollWidth-y-A,S=h.scrollHeight-R-I}}let T=a.useMemo(()=>M?{left:y,right:C,top:R,bottom:S}:null,[y,C,R,S,M]),L=a.useMemo(()=>M?{width:A,height:I}:null,[A,I,M]),P=a.useMemo(()=>{if(M)return{[k.activeTabLeft]:`${y}px`,[k.activeTabRight]:`${C}px`,[k.activeTabTop]:`${R}px`,[k.activeTabBottom]:`${S}px`,[k.activeTabWidth]:`${A}px`,[k.activeTabHeight]:`${I}px`}},[y,C,R,S,A,I,M]),j=M&&A>0&&I>0,W=(0,u.useRenderElement)("span",e,{state:{orientation:f,activeTabPosition:T,activeTabSize:L,tabActivationDirection:b},ref:t,props:[{role:"presentation",style:P,hidden:!j},s,{suppressHydrationWarning:!0}],stateAttributesMapping:N});return null==g?null:(0,r.jsxs)(a.Fragment,{children:[W,m&&l&&(0,r.jsx)("script",{nonce:c,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();'},suppressHydrationWarning:!0})]})});var P=e.i(677822),j=e.i(282458),W=e.i(273598),_=e.i(254891),z=e.i(296615);let F=((i={}).index="data-index",i.activationDirection="data-activation-direction",i.orientation="data-orientation",i.hidden="data-hidden",i[i.startingStyle=j.TransitionStatusDataAttributes.startingStyle]="startingStyle",i[i.endingStyle=j.TransitionStatusDataAttributes.endingStyle]="endingStyle",i),H={...g,...j.transitionStatusMapping},B=a.forwardRef(function(e,t){let{className:n,value:i,render:r,keepMounted:l=!1,style:s,...c}=e,{value:d,getTabIdByPanelValue:f,orientation:b,tabActivationDirection:g,registerMountedTabPanel:h,unregisterMountedTabPanel:v}=p(),m=(0,x.useBaseUiId)(),y=a.useMemo(()=>({id:m,value:i}),[m,i]),{ref:C,index:R}=(0,z.useCompositeListItem)({metadata:y}),S=i===d,{mounted:E,transitionStatus:A,setMounted:I}=(0,_.useTransitionStatus)(S),M=!E,T=f(i),w=a.useRef(null),O=(0,u.useRenderElement)("div",e,{state:{hidden:M,orientation:b,tabActivationDirection:g,transitionStatus:A},ref:[t,C,w],props:[{"aria-labelledby":T,hidden:M,id:m,role:"tabpanel",tabIndex:S?0:-1,inert:(0,P.inertValue)(!S),[F.index]:R},c],stateAttributesMapping:H});return((0,W.useOpenChangeComplete)({open:S,ref:w,onComplete(){S||I(!1)}}),(0,o.useIsoLayoutEffect)(()=>{if((!M||l)&&null!=m)return h(i,m),()=>{v(i,m)}},[M,l,i,m,h,v]),l||E)?O:null});var K=e.i(863728),V=e.i(972308);let Y=a.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:i,loopFocus:l=!0,render:o,style:u,...c}=e,{onValueChange:d,orientation:f,value:b,setTabMap:h,tabActivationDirection:v}=p(),[m,x]=a.useState(0),[y,C]=a.useState(null),R=a.useRef(new Set),E=a.useRef(new Set),A=a.useRef(null),I=(0,s.useStableCallback)(()=>{R.current.forEach(e=>{e()})});a.useEffect(()=>{if("u"<typeof ResizeObserver)return;let e=new ResizeObserver(()=>{R.current.size&&I()});return A.current=e,y&&e.observe(y),E.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),A.current=null}},[y,I]);let M=(0,s.useStableCallback)(e=>(R.current.add(e),()=>{R.current.delete(e)})),T=(0,s.useStableCallback)(e=>(E.current.add(e),A.current?.observe(e),()=>{E.current.delete(e),A.current?.unobserve(e)})),w=(0,s.useStableCallback)((e,t)=>{e!==b&&d(e,t)}),O=a.useMemo(()=>({activateOnFocus:n,highlightedTabIndex:m,registerIndicatorUpdateListener:M,registerTabResizeObserverElement:T,onTabActivation:w,setHighlightedTabIndex:x,tabsListElement:y}),[n,m,M,T,w,x,y]);return(0,r.jsx)(S.Provider,{value:O,children:(0,r.jsx)(V.CompositeRoot,{render:o,className:i,style:u,state:{orientation:f,tabActivationDirection:v},refs:[t,C],props:[{"aria-orientation":"vertical"===f?"vertical":void 0,role:"tablist"},c],stateAttributesMapping:g,highlightedIndex:m,enableHomeAndEndKeys:!0,loopFocus:l,orientation:f,onHighlightedIndexChange:x,onMapChange:h,disabledIndices:K.EMPTY_ARRAY})})});e.s(["Indicator",0,L,"List",0,Y,"Panel",0,B,"Root",0,h,"Tab",0,T],227146);var U=e.i(227146),U=U,$=e.i(294237),q=e.i(465458);let G=(0,$.cva)("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});e.s(["Tabs",0,function({className:e,orientation:t="horizontal",...n}){return(0,r.jsx)(U.Root,{"data-slot":"tabs","data-orientation":t,className:(0,q.cn)("group/tabs flex gap-2 data-horizontal:flex-col",e),...n})},"TabsContent",0,function({className:e,...t}){return(0,r.jsx)(U.Panel,{"data-slot":"tabs-content",className:(0,q.cn)("flex-1 text-sm outline-none",e),...t})},"TabsList",0,function({className:e,variant:t="default",...n}){return(0,r.jsx)(U.List,{"data-slot":"tabs-list","data-variant":t,className:(0,q.cn)(G({variant:t}),e),...n})},"TabsTrigger",0,function({className:e,...t}){return(0,r.jsx)(U.Tab,{"data-slot":"tabs-trigger",className:(0,q.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}],812057)},551157,e=>{"use strict";let t=(0,e.i(433721).default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);e.s(["default",0,t])},882469,e=>{"use strict";var t=e.i(551157);e.s(["Globe",()=>t.default])}]);
@@ -1,16 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,600304,759309,e=>{"use strict";let t=(0,e.i(433721).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["default",0,t],759309),e.s(["Send",0,t],600304)},583705,e=>{"use strict";let t=(0,e.i(433721).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(["Info",0,t],583705)},244996,444741,e=>{"use strict";let t=(0,e.i(433721).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",0,t],444741),e.s(["CheckCircle2",0,t],244996)},294543,e=>{"use strict";let t=(0,e.i(433721).default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},896841,e=>{"use strict";var t=e.i(344180),s=e.i(764556),a=e.i(244073),i=e.i(191118),n=e.i(31807),r=e.i(327964),o=e.i(355819),c=e.i(361031),l=e.i(588591),d=e.i(62669),m=e.i(515104),p=e.i(226624),u=e.i(817854),h=e.i(451534),x=e.i(227634),f=e.i(191441);function g({icon:e,label:s,value:a}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0",children:s}),(0,t.jsx)("span",{className:"truncate text-foreground ml-auto",title:a,children:a})]})}function j({workspace:e,channelCount:i,issueCount:n}){let r=(0,a.useTranslations)("projectSettings"),[o,c]=(0,s.useState)(!1!==e.autoProcessIssues),[l,m]=(0,s.useState)(!1!==e.hooksEnabled),[v,w]=(0,s.useState)(!1),N=async t=>{if(!v){w(!0);try{let s=await fetch(`/api/workspaces/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({autoProcessIssues:t})}),a=await s.json();c(!1!==a.autoProcessIssues)}finally{w(!1)}}},y=async t=>{if(!v){w(!0);try{let s=await fetch(`/api/workspaces/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({hooksEnabled:t})}),a=await s.json();m(!1!==a.hooksEnabled)}finally{w(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:r("info.title")}),(0,t.jsx)(g,{icon:(0,t.jsx)(h.FolderOpen,{size:14}),label:r("info.path"),value:e.boundDirs[0]??"-"}),(0,t.jsx)(g,{icon:(0,t.jsx)(x.Hash,{size:14}),label:r("info.channels"),value:String(i)}),(0,t.jsx)(g,{icon:(0,t.jsx)(f.ListChecks,{size:14}),label:r("info.issues"),value:String(n)})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:r("automation.title")}),(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-md border px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"space-y-0.5 pr-4",children:[(0,t.jsx)(u.Label,{htmlFor:"auto-process",className:"text-sm font-medium",children:r("automation.autoProcess")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r("automation.autoProcessDescription")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[v&&(0,t.jsx)(d.Loader2,{className:"h-3 w-3 animate-spin text-muted-foreground"}),(0,t.jsx)(p.Switch,{id:"auto-process",checked:o,onCheckedChange:N,disabled:v})]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Hooks"}),(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-md border px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"space-y-0.5 pr-4",children:[(0,t.jsx)(u.Label,{htmlFor:"hooks-enabled",className:"text-sm font-medium",children:"Enable Hooks"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Enable per-tool-call hooks for this workspace"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[v&&(0,t.jsx)(d.Loader2,{className:"h-3 w-3 animate-spin text-muted-foreground"}),(0,t.jsx)(p.Switch,{id:"hooks-enabled",checked:l,onCheckedChange:y,disabled:v})]})]})]})]})}var v=e.i(260218),w=e.i(681622),N=e.i(812057),y=e.i(209988),k=e.i(36539),k=k,b=e.i(325443),S=e.i(244996),C=e.i(294543),C=C,T=e.i(92457);let I=(0,e.i(433721).default)("qr-code",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);var P=e.i(601039),F=e.i(600304),E=e.i(360112);let O=[{value:"issue_started",labelKey:"events.issueStarted"},{value:"issue_completed",labelKey:"events.issueCompleted"},{value:"issue_task_completed",labelKey:"events.taskCompleted"},{value:"channel_agent_completed",labelKey:"events.channelAgentCompleted"}];function D(){return{enabled:!1,provider:"lark",events:["issue_started","issue_completed","issue_task_completed"],lark:{},wechat:{}}}let L=`{
2
- "scopes": {
3
- "tenant": [
4
- "contact:contact.base:readonly",
5
- "im:chat:readonly",
6
- "im:chat.members:read",
7
- "im:message",
8
- "im:message.group_at_msg:readonly",
9
- "im:message.group_msg",
10
- "im:message.p2p_msg:readonly",
11
- "im:message:send_as_bot",
12
- "im:resource"
13
- ],
14
- "user": []
15
- }
16
- }`;function z(){let[e,a]=(0,s.useState)(!1);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(v.Button,{type:"button",size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(L).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},children:[e?(0,t.jsx)(S.CheckCircle2,{className:"mr-1.5 h-3.5 w-3.5 text-emerald-600"}):null,e?"已复制":"复制批量权限配置"]}),(0,t.jsxs)("details",{className:"group",children:[(0,t.jsx)("summary",{className:"cursor-pointer text-xs text-muted-foreground hover:text-foreground",children:"展开查看权限详情"}),(0,t.jsx)("pre",{className:"mt-1.5 overflow-x-auto rounded-md bg-muted p-2 text-xs",children:L})]})]})}function _({workspaceId:e,workspace:i,notificationDraft:n,setNotificationDraft:r,setWorkspace:o,botAgents:l,agentDialogOpen:h,setAgentDialogOpen:x}){var f;let g=(0,a.useTranslations)("projectSettings"),j=(0,a.useTranslations)("common"),[L,q]=(0,s.useState)(!1),[A,R]=(0,s.useState)(!1),[B,$]=(0,s.useState)(!1),[M,U]=(0,s.useState)(!1),[W,G]=(0,s.useState)({status:"idle"}),K=(0,s.useRef)(!1),[J,Q]=(0,s.useState)("default"),[H,V]=(0,s.useState)(!1),[X,Y]=(0,s.useState)(!1),Z=!!(n.wechat?.token&&n.wechat?.accountId),ee=(0,c.useWorkspaceStore)(e=>e.upsertWorkspace);(0,s.useEffect)(()=>{if(!n.enabled||"wechat"!==n.provider||!["wait","scaned"].includes(W.status))return;let t=window.setInterval(()=>{K.current||(K.current=!0,fetch(`/api/workspaces/${e}/notifications/wechat/qr?poll=1`,{method:"POST"}).then(async e=>{let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error||"Failed to poll WeChat QR status");G({status:t.status??"wait",qrcodeImgContent:t.qrcodeImgContent??W.qrcodeImgContent,accountId:t.accountId,baseUrl:t.baseUrl}),t.workspace&&(o(t.workspace),r(t.workspace.notificationSettings??D()),E.toast.success(g("wechat.connectedToast")))}).catch(e=>{E.toast.error(g("wechat.pollFailed"),{description:e instanceof Error?e.message:void 0})}).finally(()=>{K.current=!1}))},2e3);return()=>window.clearInterval(t)},[n.enabled,n.provider,r,o,g,W.qrcodeImgContent,W.status,e]),(0,s.useEffect)(()=>{V((0,m.isNativeAndroidEnvironment)()),(0,m.getNotificationPermission)().then(Q)},[]);let et=async t=>{if(!i||L)return null;q(!0);try{let s=await fetch(`/api/workspaces/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({notificationSettings:t})});if(!s.ok){let e=await s.json().catch(()=>null);throw Error(e?.error||"Failed to save notification settings")}let a=await s.json();return o(a),ee(a),r(a.notificationSettings??D()),a}catch(e){return E.toast.error(g("notifications.saveFailed"),{description:e instanceof Error?e.message:void 0}),null}finally{q(!1)}},es=e=>{let t={...n,...e,lark:{...n.lark,...e.lark},wechat:{...n.wechat,...e.wechat},native:{...n.native,...e.native}};r(t),et(t)},ea=async()=>{if(!A){R(!0);try{if(!await et(n))throw Error("Failed to save notification settings");let t=await fetch(`/api/workspaces/${e}/notifications/start`,{method:"POST"});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error||"Failed to start notification service")}let s=await t.json();s.workspace?(o(s.workspace),r(s.workspace.notificationSettings??D())):r({...n,serviceRunning:!0}),E.toast.success(g("notifications.startSuccess"))}catch(e){E.toast.error(g("notifications.startFailed"),{description:e instanceof Error?e.message:void 0})}finally{R(!1)}}},ei=async()=>{if(!A){R(!0);try{let t=await fetch(`/api/workspaces/${e}/notifications/stop`,{method:"POST"});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error||"Failed to stop notification service")}let s=await t.json();s.workspace?(o(s.workspace),r(s.workspace.notificationSettings??D())):r({...n,serviceRunning:!1}),E.toast.success(g("notifications.stopSuccess"))}catch(e){E.toast.error(g("notifications.stopFailed"),{description:e instanceof Error?e.message:void 0})}finally{R(!1)}}},en=async()=>{if(!B){$(!0);try{let t=await fetch(`/api/workspaces/${e}/notifications/test`,{method:"POST"}),s=await t.json().catch(()=>null);if(!t.ok)throw Error(s?.reason||s?.error||"Failed to send test notification");E.toast.success(g("notifications.testSuccess"))}catch(e){E.toast.error(g("notifications.testFailed"),{description:e instanceof Error?e.message:void 0})}finally{$(!1)}}},er=async()=>{if(!M){U(!0);try{if(!await et({...n,provider:"wechat"}))throw Error("Failed to save notification settings");let t=await fetch(`/api/workspaces/${e}/notifications/wechat/qr${Z?"?refresh=1":""}`,{method:"POST"}),s=await t.json().catch(()=>null);if(!t.ok)throw Error(s?.error||"Failed to get WeChat QR code");G({status:s.status??"wait",qrcodeImgContent:s.qrcodeImgContent,accountId:s.accountId,baseUrl:s.baseUrl}),s.workspace&&(o(s.workspace),r(s.workspace.notificationSettings??D()))}catch(e){E.toast.error(g("wechat.getQrFailed"),{description:e instanceof Error?e.message:void 0})}finally{U(!1)}}};return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:g("notifications.title")}),(0,t.jsxs)("div",{className:"space-y-4 rounded-md border px-3 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5 pr-4",children:[(0,t.jsx)(u.Label,{htmlFor:"message-notifications",className:"text-sm font-medium",children:g("notifications.messageNotifications")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("notifications.messageNotificationsDescription")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[L&&(0,t.jsx)(d.Loader2,{className:"h-3 w-3 animate-spin text-muted-foreground"}),(0,t.jsx)(p.Switch,{id:"message-notifications",checked:n.enabled,onCheckedChange:e=>es({enabled:e}),disabled:L})]})]}),n.enabled&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)(N.Tabs,{value:n.provider,onValueChange:e=>es({provider:e}),className:"flex flex-col",children:[(0,t.jsxs)(N.TabsList,{className:"grid w-full grid-cols-3",children:[(0,t.jsx)(N.TabsTrigger,{value:"lark",children:g("notifications.lark")}),(0,t.jsx)(N.TabsTrigger,{value:"wechat",children:g("notifications.wechat")}),(0,t.jsx)(N.TabsTrigger,{value:"native",children:g("notifications.native")})]}),(0,t.jsxs)(N.TabsContent,{value:"lark",className:"space-y-3 pt-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"飞书 Bot 配置"}),(0,t.jsxs)(v.Button,{type:"button",variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>Y(!0),children:[(0,t.jsx)(C.default,{className:"h-3.5 w-3.5"}),"部署教程"]})]}),(0,t.jsxs)("div",{className:"grid gap-2",children:[(0,t.jsx)(u.Label,{htmlFor:"lark-app-id",className:"text-xs text-muted-foreground",children:g("notifications.appId")}),(0,t.jsx)(w.Input,{id:"lark-app-id",value:n.lark?.appId??"",onChange:e=>r({...n,lark:{...n.lark,appId:e.target.value}}),placeholder:"cli_xxx",disabled:A})]}),(0,t.jsxs)("div",{className:"grid gap-2",children:[(0,t.jsx)(u.Label,{htmlFor:"lark-app-secret",className:"text-xs text-muted-foreground",children:g("notifications.appSecret")}),(0,t.jsx)(w.Input,{id:"lark-app-secret",type:"password",value:n.lark?.appSecret??"",onChange:e=>r({...n,lark:{...n.lark,appSecret:e.target.value}}),placeholder:"app secret",disabled:A})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(v.Button,{type:"button",size:"sm",variant:n.serviceRunning?"outline":"default",onClick:n.serviceRunning?ei:ea,disabled:A||L||!n.lark?.appId||!n.lark?.appSecret,children:[A?(0,t.jsx)(d.Loader2,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(F.Send,{className:"mr-2 h-3.5 w-3.5"}),n.serviceRunning?g("notifications.stopService"):g("notifications.startService")]}),(0,t.jsxs)(v.Button,{type:"button",size:"sm",variant:"outline",onClick:en,disabled:B||L||!n.serviceRunning,children:[B&&(0,t.jsx)(d.Loader2,{className:"mr-2 h-3.5 w-3.5 animate-spin"}),g("notifications.testSend")]})]})]}),(0,t.jsxs)(N.TabsContent,{value:"wechat",className:"space-y-3 pt-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[Z?(0,t.jsx)(S.CheckCircle2,{className:"h-4 w-4 text-emerald-600"}):(0,t.jsx)(I,{className:"h-4 w-4"}),g("wechat.robot")]}),(0,t.jsx)("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:Z?g("wechat.connected",{accountId:n.wechat?.accountId??""}):"scaned"===W.status?g("wechat.scanned"):"expired"===W.status?g("wechat.expired"):g("wechat.scanQr")})]}),(0,t.jsxs)(v.Button,{type:"button",size:"sm",variant:"outline",onClick:er,disabled:M||L||A,children:[M?(0,t.jsx)(d.Loader2,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(P.RefreshCw,{className:"mr-2 h-3.5 w-3.5"}),Z?g("wechat.refreshLogin"):g("wechat.getQr")]})]}),W.qrcodeImgContent&&!Z&&(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-md border border-dashed px-3 py-3",children:[(0,t.jsx)("img",{src:(f=W.qrcodeImgContent,`https://api.qrserver.com/v1/create-qr-code/?size=180x180&margin=8&data=${encodeURIComponent(f)}`),alt:"WeChat robot login QR code",className:"h-36 w-36 shrink-0 rounded border bg-white p-2"}),(0,t.jsxs)("div",{className:"min-w-0 space-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("p",{children:g("wechat.status",{status:"scaned"===W.status?"scanned":W.status})}),(0,t.jsx)("p",{className:"break-all",children:g("wechat.loginUrl",{url:W.qrcodeImgContent})})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(v.Button,{type:"button",size:"sm",variant:n.serviceRunning?"outline":"default",onClick:n.serviceRunning?ei:ea,disabled:A||L||!Z,children:[A?(0,t.jsx)(d.Loader2,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(F.Send,{className:"mr-2 h-3.5 w-3.5"}),n.serviceRunning?g("notifications.stopService"):g("notifications.startService")]}),(0,t.jsxs)(v.Button,{type:"button",size:"sm",variant:"outline",onClick:en,disabled:B||L||!n.serviceRunning,children:[B&&(0,t.jsx)(d.Loader2,{className:"mr-2 h-3.5 w-3.5 animate-spin"}),g("notifications.testSend")]})]})]}),(0,t.jsxs)(N.TabsContent,{value:"native",className:"space-y-3 pt-2",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("notifications.nativeDescription")}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(T.Monitor,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsxs)("span",{className:"font-medium",children:["granted"===J&&(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(S.CheckCircle2,{className:"h-4 w-4 text-emerald-600"}),g("notifications.nativePermissionGranted")]}),"denied"===J&&g("notifications.nativePermissionDenied"),"default"===J&&g("notifications.nativePermissionDefault"),"unsupported"===J&&g("notifications.nativePermissionUnsupported")]})]}),"unsupported"!==J&&"granted"!==J&&(0,t.jsx)(v.Button,{type:"button",size:"sm",variant:"outline",onClick:async()=>{let e=await (0,m.requestNotificationPermission)();Q(e),"granted"===e?(es({native:{permissionGranted:!0}}),E.toast.success(g("notifications.nativePermissionGrantedToast"))):"denied"===e&&E.toast.error(g("notifications.nativePermissionDeniedToast"))},disabled:"denied"===J,children:g("notifications.nativeRequestPermission")})]}),H&&(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"space-y-0.5 pr-4",children:[(0,t.jsx)(u.Label,{htmlFor:"android-ongoing-task-notification",className:"text-sm font-medium",children:g("notifications.androidOngoingTaskNotification")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("notifications.androidOngoingTaskNotificationDescription")})]}),(0,t.jsx)(p.Switch,{id:"android-ongoing-task-notification",checked:n.native?.androidOngoingTaskNotification??!1,onCheckedChange:e=>es({native:{permissionGranted:n.native?.permissionGranted,androidOngoingTaskNotification:e}}),disabled:L||"granted"!==J})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:(0,t.jsx)(v.Button,{type:"button",size:"sm",variant:"outline",onClick:async()=>{try{await (0,m.sendNativeNotification)("Agent Spaces",g("notifications.nativeTestSuccess")),E.toast.success(g("notifications.nativeTestSent"),{duration:5e3})}catch(e){E.toast.error(`${g("notifications.nativeTestFailed")}: ${e instanceof Error?e.message:e}`,{duration:5e3})}},disabled:"granted"!==J,children:g("notifications.testSend")})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[(0,t.jsx)(b.Bot,{className:"h-3.5 w-3.5"}),g("botAgent.title")]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("select",{value:n.botAgentId??"",onChange:e=>{es({botAgentId:e.target.value||void 0})},disabled:L,className:"h-8 min-w-0 flex-1 rounded-lg border border-input bg-transparent px-2.5 text-sm outline-none focus-visible:border-ring dark:bg-input/30",children:[(0,t.jsx)("option",{value:"",children:g("botAgent.selectAgent")}),l.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,t.jsx)(v.Button,{type:"button",size:"sm",variant:"outline",onClick:()=>x(!0),children:j("manage")})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[(0,t.jsx)(k.default,{className:"h-3.5 w-3.5"}),g("events.title")]}),(0,t.jsx)("div",{className:"grid gap-2",children:O.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:[(0,t.jsx)("input",{type:"checkbox",className:"h-4 w-4 accent-primary",checked:n.events.includes(e.value),onChange:t=>{var s,a;let i;return s=e.value,a=t.target.checked,i=new Set(n.events),void(a?i.add(s):i.delete(s),es({events:Array.from(i)}))},disabled:L}),(0,t.jsx)("span",{children:g(e.labelKey)})]},e.value))})]})]})]}),(0,t.jsx)(y.Dialog,{open:X,onOpenChange:Y,children:(0,t.jsxs)(y.DialogContent,{className:"sm:max-w-lg",children:[(0,t.jsxs)(y.DialogHeader,{children:[(0,t.jsx)(y.DialogTitle,{children:"创建飞书 Bot"}),(0,t.jsx)(y.DialogDescription,{children:"首次使用?按以下步骤在飞书开放平台创建机器人应用"})]}),(0,t.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"font-medium",children:"1. 创建自建应用"}),(0,t.jsxs)("p",{className:"text-muted-foreground",children:["前往"," ",(0,t.jsx)("a",{href:"https://open.feishu.cn/app",target:"_blank",rel:"noreferrer",className:"underline underline-offset-3 hover:text-foreground",children:"飞书开放平台"})," ","(海外版:"," ",(0,t.jsx)("a",{href:"https://open.larksuite.com/app",target:"_blank",rel:"noreferrer",className:"underline underline-offset-3 hover:text-foreground",children:"Lark 开放平台"}),"),点击「创建自建应用」并填写名称描述。"]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"font-medium",children:"2. 获取凭证"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"进入详情页,在「凭证与基础信息」中找到 App ID 和 App Secret,复制到上方的配置表单。"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"font-medium",children:"3. 启用机器人能力"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"进入「添加应用能力」页面,启用「机器人」能力。这样应用才能接收和发送飞书消息。"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"font-medium",children:"4. 配置权限"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"进入「权限管理」页面,点击下方按钮复制权限配置 JSON,然后在飞书开放平台通过「批量开通」粘贴即可一键添加所有权限:"}),(0,t.jsx)(z,{})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"font-medium",children:"5. 配置事件订阅(关键步骤)"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"进入「事件与回调」页面:"}),(0,t.jsxs)("ul",{className:"list-disc space-y-1 pl-4 text-muted-foreground",children:[(0,t.jsx)("li",{children:"事件订阅方式选择「使用长连接接收事件」(而非 Webhook,无需公网 IP)"}),(0,t.jsxs)("li",{children:["添加事件 ",(0,t.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"im.message.receive_v1"}),"(接收消息)"]})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"font-medium",children:"6. 发布应用"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"进入「版本管理与发布」→ 创建版本 → 提交审核。需要企业管理员在管理后台审核通过后,机器人才能正常使用。"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"版本审核通过并发布后,在飞书中搜索机器人名称添加到聊天,即可通过飞书向 Proma Agent 发送指令。"})]})]})]})})]})}var q=e.i(788010),A=e.i(583705),R=e.i(638322);function B({workspaceId:e,initialPrompt:i}){let n=(0,a.useTranslations)("projectSettings"),[r,o]=(0,s.useState)(i),[c,l]=(0,s.useState)(i),[m,p]=(0,s.useState)(!1),h=r!==c,x=async()=>{if(!m){p(!0);try{let t=await fetch(`/api/workspaces/${e}/prompt`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:r})});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error||"Failed to save workspace prompt")}let s=await t.json();o(s.prompt),l(s.prompt),E.toast.success(n("prompt.saveSuccess"))}catch(e){E.toast.error(n("prompt.saveFailed"),{description:e instanceof Error?e.message:void 0})}finally{p(!1)}}};return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:n("prompt.title")}),(0,t.jsxs)("div",{className:"space-y-3 rounded-md border px-3 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(u.Label,{htmlFor:"workspace-prompt",className:"text-sm font-medium",children:n("prompt.workspacePrompt")}),(0,t.jsx)(R.TooltipProvider,{delay:200,children:(0,t.jsxs)(R.Tooltip,{children:[(0,t.jsx)(R.TooltipTrigger,{className:"inline-flex",children:(0,t.jsx)(A.Info,{className:"h-3.5 w-3.5 text-muted-foreground cursor-help"})}),(0,t.jsx)(R.TooltipContent,{side:"top",className:"max-w-xs",children:(0,t.jsx)("p",{children:n("prompt.description")})})]})})]}),(0,t.jsx)(q.Textarea,{id:"workspace-prompt",value:r,onChange:e=>o(e.target.value),className:"min-h-36 resize-y text-sm"}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(v.Button,{type:"button",size:"sm",onClick:x,disabled:m||!h,children:[m&&(0,t.jsx)(d.Loader2,{className:"mr-2 h-3.5 w-3.5 animate-spin"}),n("prompt.savePrompt")]})})]})]})}e.s(["ProjectSettingsPanel",0,function({workspaceId:e}){let p=(0,a.useTranslations)("projectSettings"),[u,h]=(0,s.useState)(null),[x,f]=(0,s.useState)(""),[g,v]=(0,s.useState)(!0),[w,N]=(0,s.useState)(!1),[y,k]=(0,s.useState)(D()),b=(0,n.useChannelStore)(e=>e.channels),S=(0,r.useIssueStore)(e=>e.issues),C=(0,o.useAgentStore)(e=>e.agents).filter(e=>"bot"===e.role&&!1!==e.enabled),T=(0,c.useWorkspaceStore)(e=>e.upsertWorkspace);return((0,s.useEffect)(()=>{Promise.all([fetch(`/api/workspaces/${e}`).then(e=>e.json()),fetch(`/api/workspaces/${e}/prompt`).then(e=>e.json())]).then(([t,s])=>{h(t),T(t),f(s.prompt??"");let a=t.notificationSettings??D();k(a),v(!1),(0,m.getNotificationPermission)().then(t=>{if("granted"===t&&"native"===a.provider&&!a.native?.permissionGranted){let t={...a,native:{...a.native,permissionGranted:!0}};k(t),fetch(`/api/workspaces/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({notificationSettings:t})}).then(e=>e.json()).then(e=>{h(e),T(e)})}})}).catch(()=>v(!1))},[e,T]),g)?(0,t.jsxs)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:[(0,t.jsx)(d.Loader2,{className:"h-4 w-4 animate-spin mr-2"}),p("loading")]}):u?(0,t.jsxs)(i.ScrollArea,{className:"h-full",children:[(0,t.jsx)("div",{className:"flex items-center px-2 py-1.5 border-b text-xs font-medium text-muted-foreground",children:(0,t.jsx)("span",{children:p("title")})}),(0,t.jsxs)("div",{className:"p-4 space-y-6",children:[(0,t.jsx)(j,{workspace:u,channelCount:b.length,issueCount:S.length}),(0,t.jsx)(_,{workspaceId:e,workspace:u,notificationDraft:y,setNotificationDraft:k,setWorkspace:h,botAgents:C,agentDialogOpen:w,setAgentDialogOpen:N}),(0,t.jsx)(B,{workspaceId:e,initialPrompt:x})]}),(0,t.jsx)(l.AgentDialog,{open:w,onOpenChange:N,roleFilter:"bot"})]}):(0,t.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:p("workspaceNotFound")})}],896841)},985646,e=>{e.n(e.i(896841))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,625873,e=>{"use strict";var t=e.i(344180),s=e.i(764556),n=e.i(244073),a=e.i(209988),i=e.i(260218),l=e.i(191118),r=e.i(513501),o=e.i(989484),c=e.i(193251),d=e.i(973370),m=e.i(887354),p=e.i(681622),h=e.i(917955),u=e.i(611176),x=e.i(255742),f=e.i(973767),g=e.i(129981),j=e.i(601039),y=e.i(977694),v=e.i(137340),N=e.i(401058),k=e.i(451534);let w=(0,e.i(433721).default)("file-archive",[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]]);var b=e.i(327962),C=e.i(62669),S=e.i(465458),z=e.i(256186),T=e.i(650654),D=e.i(992764);function I({items:e,onItemsChange:a,onConfirm:r,onCancel:o,defaultGroup:c}){let d=(0,n.useTranslations)("skills"),[m,h]=(0,s.useState)(""),[u,x]=(0,s.useState)(new Set),f=(t,s)=>{a(e.map(e=>e.id===t?{...e,...s}:e))},g=e.filter(e=>e.selected).length;return(0,t.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 pt-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:d("importPreviewTitle")}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)(i.Button,{variant:"ghost",size:"sm",onClick:()=>{a(e.map(e=>({...e,selected:!0})))},children:d("importPreviewSelectAll")}),(0,t.jsx)(i.Button,{variant:"ghost",size:"sm",onClick:()=>{a(e.map(e=>({...e,selected:!1})))},children:d("importPreviewDeselectAll")})]}),(0,t.jsx)(p.Input,{value:m,onChange:e=>h(e.target.value),placeholder:c||d("importPreviewGroupPlaceholder"),className:"h-7 text-sm w-32"})]}),0===e.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-muted-foreground text-sm",children:d("importPreviewEmpty")}):(0,t.jsx)(l.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsx)("div",{className:"space-y-2 pr-2",children:e.map(s=>{let n=u.has(s.id);return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"checkbox",checked:s.selected,onChange:()=>{var t;f(t=s.id,{selected:!e.find(e=>e.id===t).selected})},className:"mt-0.5 size-3.5 accent-primary shrink-0"}),(0,t.jsx)(p.Input,{value:s.name,onChange:e=>f(s.id,{name:e.target.value}),placeholder:d("importPreviewNamePlaceholder"),className:"h-7 text-sm flex-1"}),(0,t.jsx)(p.Input,{value:s.group,onChange:e=>f(s.id,{group:e.target.value}),placeholder:d("importPreviewGroupPlaceholder"),className:"h-7 text-sm w-32"}),(0,t.jsx)("button",{type:"button",onClick:()=>{var e;return e=s.id,void x(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},className:"p-1 rounded hover:bg-accent shrink-0 cursor-pointer",children:n?(0,t.jsx)(T.ChevronDown,{className:"size-3.5 text-muted-foreground"}):(0,t.jsx)(D.ChevronRight,{className:"size-3.5 text-muted-foreground"})})]}),(0,t.jsx)(z.Collapsible,{open:n,children:(0,t.jsx)(z.CollapsibleContent,{children:(0,t.jsxs)("pre",{className:"mt-2 p-2 bg-muted rounded text-xs overflow-auto max-h-48 whitespace-pre-wrap",children:[s.content.slice(0,2e3),s.content.length>2e3?"\n...":""]})})})]},s.id)})})}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-2 mt-2 border-t",children:[(0,t.jsx)(i.Button,{variant:"outline",size:"sm",onClick:o,children:d("importPreviewCancel")}),(0,t.jsx)(i.Button,{size:"sm",onClick:()=>{let t=e.filter(e=>e.selected).map(e=>({...e,group:e.group||m}));0!==t.length&&r(t)},disabled:0===g,children:d("importPreviewConfirm",{selected:g,total:e.length})})]})]})}function A({skills:r,agents:c,loading:z,syncLoading:T,onToggleFavorite:D,onDelete:$,onEdit:F,onBind:B,onImportBatch:P,onImportFromGit:L,onSyncCheck:M,onBindAll:O}){let U=(0,n.useTranslations)("skills"),R=(0,n.useTranslations)("common"),[_,E]=(0,s.useState)(""),[G,J]=(0,s.useState)("all"),[H,K]=(0,s.useState)(""),[W,q]=(0,s.useState)(""),V=(0,s.useRef)(null),Z=(0,s.useRef)(null),Q=(0,s.useRef)(null),[X,Y]=(0,s.useState)([]),[ee,et]=(0,s.useState)(!1),[es,en]=(0,s.useState)(""),[ea,ei]=(0,s.useState)(""),[el,er]=(0,s.useState)(!1),[eo,ec]=(0,s.useState)(!1),ed=Array.from(new Set(r.map(e=>e.group).filter(Boolean))),em=r.filter(e=>{if(_){let t=_.toLowerCase();if(!e.name.toLowerCase().includes(t)&&!e.content.toLowerCase().includes(t))return!1}if("favorites"===G&&!e.favorited||"agent"===G&&H&&!e.boundAgents.some(e=>e.id===H))return!1;if(W){if("__none__"===W){if(e.group)return!1}else if(e.group!==W)return!1}return!0}),ep=async e=>{let t=e.target.files;if(!t||0===t.length)return;let s=[];for(let e of Array.from(t)){let t=await e.text(),n=e.name.replace(/\.md$/i,"");s.push({id:`md-${n}-${Math.random().toString(36).slice(2,8)}`,name:n,group:"",content:t,selected:!0,sourceName:e.name})}Y(s),en(""),et(!0),e.target.value=""},eh=async e=>{let t=e.target.files;if(!t||0===t.length)return;let s=new Map;for(let e of Array.from(t)){let t=e.webkitRelativePath.split("/")[0];s.has(t)||s.set(t,[]),s.get(t).push(e)}let n=[];for(let[e,t]of s){let s=t.find(e=>"SKILL.md"===e.name);if(s||(s=t.find(e=>e.name.endsWith(".md"))),!s)continue;let a=await s.text();n.push({id:`folder-${e}-${Math.random().toString(36).slice(2,8)}`,name:e,group:"",content:a,selected:!0,sourceName:e})}Y(n),en(""),et(!0),e.target.value=""},eu=async t=>{let s=t.target.files?.[0];if(s){try{let t=(await e.A(980476)).default,n=await t.loadAsync(s),a=s.name.replace(/\.zip$/i,""),i=new Map;n.forEach((e,t)=>{if(t.dir)return;let s=e.split("/").pop()||"",n=e.substring(0,e.lastIndexOf("/"));if(!n){if(s.endsWith(".md")&&"SKILL.md"!==s){let t=s.replace(/\.md$/i,"");i.has(t)||i.set(t,[]),i.get(t).push({file:s,path:e})}return}let a=n.split("/")[0];i.has(a)||i.set(a,[]),i.get(a).push({file:s,path:e})});let l=[];for(let[e,t]of i){let s=t.find(e=>"SKILL.md"===e.file);if(s||(s=t.find(e=>e.file.endsWith(".md"))),!s)continue;let a=await n.file(s.path).async("string");l.push({id:`zip-${e}-${Math.random().toString(36).slice(2,8)}`,name:e,group:"",content:a,selected:!0,sourceName:e})}Y(l),en(a),et(!0)}catch(e){console.error("Failed to extract ZIP:",e)}t.target.value=""}},ex=async()=>{let e=ea.trim();if(!e)return;er(!0);let t=await L(e);if(er(!1),t&&t.length>0){let s=e.split("/").pop()?.replace(/\.git$/i,"")||"";Y(t),en(s),et(!0),ec(!1)}ei("")};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:V,type:"file",accept:".md",multiple:!0,className:"hidden",onChange:ep}),(0,t.jsx)("input",{ref:Z,type:"file",className:"hidden",onChange:eh,webkitdirectory:"",directory:""}),(0,t.jsx)("input",{ref:Q,type:"file",accept:".zip",className:"hidden",onChange:eu}),(0,t.jsxs)("div",{className:"flex items-center gap-2 ml-auto shrink-0 pt-2",children:[(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",onClick:M,disabled:T,children:[(0,t.jsx)(j.RefreshCw,{className:(0,S.cn)("size-3.5 mr-1",T&&"animate-spin")}),U("syncToAgents")]}),(0,t.jsxs)(h.DropdownMenu,{children:[(0,t.jsx)(h.DropdownMenuTrigger,{render:(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",children:[(0,t.jsx)(g.Upload,{className:"size-3.5 mr-1"}),U("import")]})}),(0,t.jsxs)(h.DropdownMenuContent,{align:"end",children:[(0,t.jsxs)(h.DropdownMenuItem,{onClick:()=>V.current?.click(),children:[(0,t.jsx)(o.FileText,{className:"size-3.5 mr-1.5"}),U("importFromMd")]}),(0,t.jsxs)(h.DropdownMenuItem,{onClick:()=>Z.current?.click(),children:[(0,t.jsx)(k.FolderOpen,{className:"size-3.5 mr-1.5"}),U("importFromFolder")]}),(0,t.jsxs)(h.DropdownMenuItem,{onClick:()=>Q.current?.click(),children:[(0,t.jsx)(w,{className:"size-3.5 mr-1.5"}),U("importFromZip")]}),(0,t.jsxs)(h.DropdownMenuItem,{onClick:()=>ec(!0),disabled:el,children:[(0,t.jsx)(b.GitBranch,{className:"size-3.5 mr-1.5"}),U("importFromGit")]})]})]})]}),ee?(0,t.jsx)(I,{items:X,onItemsChange:Y,onConfirm:e=>{P(e),et(!1),Y([])},onCancel:()=>{et(!1),Y([])},defaultGroup:es}):(0,t.jsxs)("div",{className:"flex flex-1 min-h-0 gap-4 pt-2",children:[(0,t.jsx)(l.ScrollArea,{className:"hidden md:block w-44 shrink-0",children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 pr-2",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)(i.Button,{variant:"all"!==G||W?"ghost":"secondary",size:"sm",className:"w-full justify-start",onClick:()=>{J("all"),K(""),q("")},children:[(0,t.jsx)(o.FileText,{className:"size-3.5 mr-1.5"}),U("filterAll")]}),(0,t.jsxs)(i.Button,{variant:"favorites"===G?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>{J("favorites"),K(""),q("")},children:[(0,t.jsx)(x.Star,{className:"size-3.5 mr-1.5"}),U("filterFavorites")]})]}),c.length>0&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground px-2",children:U("filterByAgent")}),c.map(e=>(0,t.jsxs)(i.Button,{variant:"agent"===G&&H===e.id?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>{J("agent"),K(e.id),q("")},children:[(0,t.jsx)(u.AgentIcon,{agentId:e.id,name:e.name,avatarUrl:e.avatarUrl,className:"size-4 mr-1.5 rounded-full"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]},e.id))]}),ed.length>0&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground px-2",children:U("filterGroups")}),ed.map(e=>(0,t.jsxs)(i.Button,{variant:W===e?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>{q(W===e?"":e),J("all"),K("")},children:[(0,t.jsx)(d.Folder,{className:"size-3.5 mr-1.5"}),(0,t.jsx)("span",{className:"truncate",children:e})]},e)),r.some(e=>!e.group)&&(0,t.jsxs)(i.Button,{variant:"__none__"===W?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>{q("__none__"===W?"":"__none__"),J("all"),K("")},children:[(0,t.jsx)(o.FileText,{className:"size-3.5 mr-1.5"}),U("filterNoGroup")]})]})]})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col gap-3 min-h-0",children:[(0,t.jsxs)("div",{className:"flex md:hidden flex-col gap-2",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(m.Search,{className:"size-3.5 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(p.Input,{value:_,onChange:e=>E(e.target.value),placeholder:U("search"),className:"pl-8"})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsxs)("div",{className:"flex rounded-lg border border-input p-0.5",children:[(0,t.jsx)("button",{type:"button",className:(0,S.cn)("px-2.5 py-1 rounded-md text-xs font-medium transition-colors","all"!==G||W?"text-muted-foreground hover:text-foreground":"bg-muted"),onClick:()=>{J("all"),K(""),q("")},children:U("filterAll")}),(0,t.jsxs)("button",{type:"button",className:(0,S.cn)("px-2.5 py-1 rounded-md text-xs font-medium transition-colors","favorites"===G?"bg-muted":"text-muted-foreground hover:text-foreground"),onClick:()=>{J("favorites"),K(""),q("")},children:[(0,t.jsx)(x.Star,{className:"size-3 inline-block mr-0.5 -mt-px"}),U("filterFavorites")]})]})})]}),(0,t.jsxs)("div",{className:"hidden md:block relative",children:[(0,t.jsx)(m.Search,{className:"size-3.5 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(p.Input,{value:_,onChange:e=>E(e.target.value),placeholder:U("search"),className:"pl-8"})]}),(0,t.jsx)(l.ScrollArea,{className:"flex-1 min-h-0",children:z?(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:R("loading")}):0===em.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:U("empty")}):(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 pr-2",children:em.map(e=>(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-background p-4 hover:bg-accent/30 transition-colors cursor-pointer",onClick:()=>F(e),children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"font-medium text-sm",children:e.name}),e.group&&(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium",children:e.group}),(0,t.jsx)("button",{type:"button",className:"flex items-center justify-center size-5 rounded hover:bg-accent cursor-pointer",onClick:t=>{t.stopPropagation(),D(e)},children:e.favorited?(0,t.jsx)(x.Star,{className:"size-3.5 text-yellow-500 fill-yellow-500"}):(0,t.jsx)(f.StarOff,{className:"size-3.5 text-muted-foreground"})})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.description||e.content.slice(0,120).replace(/^#\s+/,"")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",onClick:()=>B(e),children:[(0,t.jsx)(y.Rocket,{className:"size-3.5 mr-1"}),U("apply")]}),(0,t.jsxs)(h.DropdownMenu,{children:[(0,t.jsx)(h.DropdownMenuTrigger,{render:(0,t.jsx)(i.Button,{variant:"ghost",size:"icon",className:"size-7"}),children:(0,t.jsx)(N.MoreVertical,{className:"size-3.5"})}),(0,t.jsxs)(h.DropdownMenuContent,{align:"end",children:[(0,t.jsxs)(h.DropdownMenuItem,{onClick:()=>fetch(`/api/skills/${encodeURIComponent(e.name)}/reveal`,{method:"POST"}),children:[(0,t.jsx)(k.FolderOpen,{className:"size-3.5 mr-1.5"}),U("revealFolder")]}),(0,t.jsxs)(h.DropdownMenuItem,{className:"text-destructive focus:text-destructive",onClick:()=>$(e),children:[(0,t.jsx)(v.Trash2,{className:"size-3.5 mr-1.5"}),U("delete")]})]})]})]})]}),e.boundAgents.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-2.5 pt-2.5 border-t border-border/50",children:[e.boundAgents.map(e=>(0,t.jsx)(u.AgentIcon,{agentId:e.id,name:e.name,avatarUrl:e.avatarUrl,className:"size-5 rounded-full"},e.id)),(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-1",children:e.boundAgents.length})]})]},e.name))})}),(0,t.jsx)("div",{className:"hidden md:flex items-center justify-end gap-3 pt-2 border-t shrink-0",children:(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",onClick:O,disabled:0===em.length,children:[(0,t.jsx)(y.Rocket,{className:"size-3.5 mr-1"}),U("applyAllToAgent")]})})]})]}),(0,t.jsx)(a.Dialog,{open:eo,onOpenChange:ec,children:(0,t.jsxs)(a.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsxs)(a.DialogHeader,{children:[(0,t.jsx)(a.DialogTitle,{children:U("importFromGit")}),(0,t.jsx)(a.DialogDescription,{children:U("importFromGitDesc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(p.Input,{value:ea,onChange:e=>ei(e.target.value),placeholder:"https://github.com/user/skills-repo.git",onKeyDown:e=>{"Enter"===e.key&&ex()},disabled:el,autoFocus:!0}),(0,t.jsx)(i.Button,{onClick:ex,disabled:el||!ea.trim(),children:el?(0,t.jsx)(C.Loader2,{className:"size-4 animate-spin"}):U("import")})]})]})})]})}var $=e.i(887836),F=e.i(984178),B=e.i(383171),P=e.i(415955),L=e.i(932031),M=e.i(111343),O=e.i(564822);e.i(462506);let U=(0,$.default)(()=>e.A(863812).then(e=>e.default),{loadableGenerated:{modules:[158480]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Loading editor..."})});function R({node:e,depth:s,selectedPath:n,onSelect:a,expandedPaths:i,toggleExpand:l}){let r=i.has(e.path),o=n===e.path;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:(0,S.cn)("flex items-center gap-1 rounded px-2 py-1 cursor-pointer hover:bg-muted/50 text-sm",o&&"bg-muted"),style:{paddingLeft:`${12*s+8}px`},onClick:()=>{e.isDirectory?l(e.path):a(e)},children:[e.isDirectory&&(0,t.jsx)(L.ChevronRightIcon,{className:(0,S.cn)("size-3.5 shrink-0 text-muted-foreground transition-transform",r&&"rotate-90")}),!e.isDirectory&&(0,t.jsx)("span",{className:"size-3.5 shrink-0"}),e.isDirectory?r?(0,t.jsx)(P.FolderOpenIcon,{className:"size-4 text-blue-500 shrink-0"}):(0,t.jsx)(B.FolderIcon,{className:"size-4 text-blue-500 shrink-0"}):(0,t.jsx)(F.FileIcon,{className:"size-4 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]}),e.isDirectory&&r&&e.children.map(e=>(0,t.jsx)(R,{node:e,depth:s+1,selectedPath:n,onSelect:a,expandedPaths:i,toggleExpand:l},e.path))]})}function _({skill:e,content:l,onContentChange:r,onClose:o,onSave:c}){let d=(0,n.useTranslations)("skills"),m=(0,n.useTranslations)("common"),p=(0,O.useIsMobile)(),[h,u]=(0,s.useState)([]),[x,f]=(0,s.useState)(null),[g,j]=(0,s.useState)({}),[y,v]=(0,s.useState)(new Set),[N,k]=(0,s.useState)(!1),[w,b]=(0,s.useState)(new Set),z=(0,s.useRef)(new Set);(0,s.useEffect)(()=>{if(!e)return;f(null),j({}),b(new Set),v(new Set),u([]),z.current=new Set,k(!0);let t=e.name;fetch(`/api/skills/${encodeURIComponent(t)}/files`).then(e=>e.ok?e.json():[]).then(e=>{u(e),v(new Set(e.filter(e=>e.isDirectory&&!e.path.includes("/")).map(e=>e.path)));let s=e.find(e=>"SKILL.md"===e.path&&!e.isDirectory)||e.find(e=>!e.isDirectory);if(!s)return void k(!1);f(s.path);let n=s.path.split("/").map(encodeURIComponent).join("/");fetch(`/api/skills/${encodeURIComponent(t)}/files/${n}`).then(e=>e.ok?e.json():null).then(e=>{e&&(j({[s.path]:e.content}),z.current.add(s.path))}).catch(()=>{}).finally(()=>k(!1))}).catch(()=>{u([]),k(!1)})},[e]);let T=(0,s.useCallback)((e,t)=>{if(z.current.has(t))return;z.current.add(t),k(!0);let s=t.split("/").map(encodeURIComponent).join("/");fetch(`/api/skills/${encodeURIComponent(e)}/files/${s}`).then(e=>e.ok?e.json():null).then(e=>{e&&j(s=>({...s,[t]:e.content}))}).catch(()=>{}).finally(()=>k(!1))},[]),D=(0,s.useMemo)(()=>(function(e){let t=[],s=new Map;for(let n of e){let e=n.path.split("/"),a=t;for(let t=0;t<e.length;t++){let i=e.slice(0,t+1).join("/"),l=t<e.length-1||n.isDirectory,r=a.find(s=>s.name===e[t]);if(r)a=r.children;else{let n={name:e[t],path:i,isDirectory:l,children:[]};a.push(n),l&&s.set(i,n),a=n.children}}}return t})(h),[h]),I=t=>{!t.isDirectory&&(f(t.path),e&&T(e.name,t.path))},A=e=>{v(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},$=x?g[x]??"":"",F=x?({md:"markdown",markdown:"markdown",json:"json",js:"javascript",ts:"typescript",tsx:"typescript",jsx:"javascript",py:"python",sh:"shell",bash:"shell",yaml:"yaml",yml:"yaml",xml:"xml",html:"html",css:"css",sql:"sql"})[x.split(".").pop()?.toLowerCase()||""]||"plaintext":"markdown",B=e=>{if(!x)return;let t=e||"";j(e=>({...e,[x]:t})),b(e=>new Set(e).add(x)),r(t)},P=async()=>{if(!e||!x)return;let t=g[x];if(void 0===t)return;let s=x.split("/").map(encodeURIComponent).join("/");(await fetch(`/api/skills/${encodeURIComponent(e.name)}/files/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t})})).ok&&(b(e=>{let t=new Set(e);return t.delete(x),t}),c())},L=(0,s.useMemo)(()=>h.filter(e=>!e.isDirectory),[h]);return(0,t.jsx)(a.Dialog,{open:!!e,onOpenChange:e=>{e||o()},children:(0,t.jsxs)(a.DialogContent,{className:"!w-[85vw] !max-w-[85vw] !h-[85vh] flex flex-col",children:[(0,t.jsx)(a.DialogHeader,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between pr-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(a.DialogTitle,{children:d("editTitle",{name:e?.name||""})}),(0,t.jsx)(a.DialogDescription,{children:d("editDescription")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[w.size>0&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[w.size," unsaved"]}),(0,t.jsxs)(i.Button,{size:"sm",onClick:P,disabled:!x||!w.has(x??""),children:[(0,t.jsx)(M.Save,{className:"size-3.5 mr-1"}),m("save")]})]})]})}),p?(0,t.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col pt-2",children:[(0,t.jsx)("div",{className:"flex overflow-x-auto border-b gap-0.5 px-1 shrink-0",children:L.map(e=>(0,t.jsx)("button",{className:(0,S.cn)("shrink-0 px-3 py-1.5 text-xs rounded-t transition-colors whitespace-nowrap",x===e.path?"bg-muted font-medium":"text-muted-foreground hover:text-foreground",w.has(e.path)&&'after:content-[""] after:inline-block after:size-1.5 after:bg-orange-500 after:rounded-full after:ml-1'),onClick:()=>I({name:e.name,path:e.path,isDirectory:!1,children:[]}),children:e.name},e.path))}),(0,t.jsx)("div",{className:"flex-1 min-h-0",children:N?(0,t.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,t.jsx)(C.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):(0,t.jsx)(U,{height:"100%",language:F,value:$,onChange:B,theme:"vs-dark",options:{fontSize:13,minimap:{enabled:!1},scrollBeyondLastLine:!1,padding:{top:8},renderLineHighlight:"gutter",wordWrap:"on"}})})]}):(0,t.jsxs)("div",{className:"flex-1 min-h-0 flex gap-0 pt-2 border rounded-md overflow-hidden",children:[(0,t.jsxs)("div",{className:"w-48 shrink-0 border-r bg-muted/20 overflow-y-auto py-1",children:[D.map(e=>(0,t.jsx)(R,{node:e,depth:0,selectedPath:x??"",onSelect:I,expandedPaths:y,toggleExpand:A},e.path)),0===h.length&&(0,t.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No files"})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0",children:N?(0,t.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,t.jsx)(C.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):(0,t.jsx)(U,{height:"100%",language:F,value:$,onChange:B,theme:"vs-dark",options:{fontSize:13,minimap:{enabled:!1},scrollBeyondLastLine:!1,padding:{top:8},renderLineHighlight:"gutter",wordWrap:"on"}})})]})]})})}var E=e.i(239340);function G({skill:e,titleOverride:s,descriptionOverride:a,agents:i,selected:l,onToggle:r,onClose:o,onConfirm:c}){let d=(0,n.useTranslations)("skills"),m=(0,n.useTranslations)("common");return(0,t.jsx)(E.AgentPickerDialog,{open:!!e,onClose:o,onConfirm:c,title:s||d("bindTitle",{name:e?.name||""}),description:a||d("bindDescription"),agents:i,selected:l,onToggle:r,cancelText:m("cancel"),confirmText:m("confirm")})}function J({open:e,onOpenChange:s,items:r,selected:o,onToggle:c,onConfirm:d}){let m=(0,n.useTranslations)("skills"),p=(0,n.useTranslations)("common");return(0,t.jsx)(a.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(a.DialogContent,{className:"sm:max-w-lg",children:[(0,t.jsxs)(a.DialogHeader,{children:[(0,t.jsx)(a.DialogTitle,{children:m("syncTitle")}),(0,t.jsx)(a.DialogDescription,{children:m("syncDescription")})]}),(0,t.jsxs)("div",{className:"space-y-3 pt-2",children:[0===r.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-muted-foreground text-sm",children:m("syncEmpty")}):(0,t.jsx)(l.ScrollArea,{className:"max-h-72",children:(0,t.jsx)("div",{className:"space-y-1",children:r.map(e=>{let s=`${e.agentId}::${e.skillName}`;return(0,t.jsxs)("button",{type:"button",onClick:()=>c(e.agentId,e.skillName),className:"flex items-center gap-3 w-full px-2 py-1.5 rounded-md hover:bg-muted text-left text-sm transition-colors",children:[(0,t.jsx)("div",{className:(0,S.cn)("flex items-center justify-center size-4 rounded border shrink-0",o.has(s)?"bg-primary border-primary text-primary-foreground":"border-input")}),(0,t.jsx)(u.AgentIcon,{agentId:e.agentId,name:e.agentName,className:"size-5 rounded-full"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.agentName}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs shrink-0",children:[e.skillName,".md"]})]},s)})})}),r.length>0&&(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,t.jsx)(i.Button,{variant:"outline",onClick:()=>s(!1),children:p("cancel")}),(0,t.jsx)(i.Button,{onClick:d,disabled:0===o.size,children:m("syncConfirm")})]})]})]})})}e.s(["SkillsDialog",0,function({open:e,onOpenChange:h,standalone:u}){let x=(0,n.useTranslations)("skills"),f=(0,n.useTranslations)("common"),[g,j]=(0,s.useState)("local"),{skills:y,setSkills:v,agents:N,loading:k,fetchSkills:w,storeSkills:b,storeLoading:C,importingPaths:S,importFromStore:z}=function(e,t){let[n,a]=(0,s.useState)([]),[i,l]=(0,s.useState)([]),[r,o]=(0,s.useState)(!1),[c,d]=(0,s.useState)([]),[m,p]=(0,s.useState)(!1),[h,u]=(0,s.useState)(new Set),x=(0,s.useCallback)(async()=>{o(!0);try{let e=await fetch("/api/skills");e.ok&&a(await e.json())}catch{}o(!1)},[]),f=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/agents/presets");if(e.ok){let t=await e.json();l(t.map(e=>({id:e.id,name:e.name,avatarUrl:e.avatarUrl,description:e.description})))}}catch{}},[]),g=(0,s.useCallback)(async()=>{p(!0);try{let e=await fetch("/public/skills/index.json");e.ok&&d(await e.json())}catch{}p(!1)},[]);(0,s.useEffect)(()=>{(e||t)&&(x(),f(),g())},[e,t,x,f,g]);let j=new Set(n.map(e=>e.name)),y=async e=>{if(j.has(e.id)||h.has(e.path))return!1;u(t=>new Set(t).add(e.path));try{if((await fetch("/api/skills/import-store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e.path,group:e.group})})).ok)return await x(),!0}catch{}return u(t=>{let s=new Set(t);return s.delete(e.path),s}),!1};return{skills:n,setSkills:a,agents:i,loading:r,fetchSkills:x,storeSkills:c,storeLoading:m,importingPaths:h,importFromStore:y}}(e,u),T={toggleFavorite:async e=>{try{let t=await fetch(`/api/skills/${encodeURIComponent(e.name)}/favorite`,{method:"POST"});if(t.ok){let{favorited:s}=await t.json();v(t=>t.map(t=>t.name===e.name?{...t,favorited:s}:t))}}catch{}},deleteSkill:async e=>{try{(await fetch(`/api/skills/${encodeURIComponent(e.name)}`,{method:"DELETE"})).ok&&v(t=>t.filter(t=>t.name!==e.name))}catch{}},saveEdit:async(e,t)=>{try{if((await fetch(`/api/skills/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t})})).ok)return v(s=>s.map(s=>s.name===e?{...s,content:t}:s)),!0}catch{}return!1},importBatch:async e=>{let t=e.map(e=>({name:e.name,content:e.content,group:e.group}));try{(await fetch("/api/skills/import-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:t})})).ok&&w()}catch{}},importFromGit:async e=>{try{let t=await fetch("/api/skills/import-git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})});if(!t.ok)return null;return(await t.json()).map(e=>({id:`git-${e.name}-${Math.random().toString(36).slice(2,8)}`,name:e.name,group:"",content:e.content,selected:!0,sourceName:e.name}))}catch{}return null},bindConfirm:async(e,t,s)=>{for(let n of s){let s=e.boundAgents.some(e=>e.id===n.id),a=t.includes(n.id);if(s&&!a){let t=await fetch(`/api/agents/presets/${n.id}`);if(!t.ok)continue;let s=await t.json(),a=(s.skills||[]).filter(t=>t.replace(/\.md$/i,"")!==e.name);await fetch(`/api/agents/presets/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,skills:a})})}else if(!s&&a){let t=await fetch(`/api/agents/presets/${n.id}`);if(!t.ok)continue;let s=await t.json();if(!(s.skills||[]).map(e=>e.replace(/\.md$/i,"")).includes(e.name)){let t=[...s.skills||[],e.name];await fetch(`/api/agents/presets/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,skills:t})})}}}w()},applyAllToAgent:async(e,t)=>{try{let s=await fetch(`/api/agents/presets/${e}`);if(!s.ok)return;let n=await s.json(),a=new Set((n.skills||[]).map(e=>e.replace(/\.md$/i,""))),i=[...n.skills||[]];for(let e of t)a.has(e)||i.push(e);await fetch(`/api/agents/presets/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,skills:i})}),w()}catch{}},syncCheck:async()=>{let e=await fetch("/api/skills/sync-check");return e.ok?e.json():[]},syncConfirm:async e=>{let t=await fetch("/api/skills/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:e.map(e=>({agentId:e.agentId,skillName:e.skillName}))})});return t.ok&&w(),t.ok}},[D,I]=(0,s.useState)(null),[$,F]=(0,s.useState)(""),[B,P]=(0,s.useState)(null),[L,M]=(0,s.useState)([]),[O,U]=(0,s.useState)([]),[R,E]=(0,s.useState)(new Set),[H,K]=(0,s.useState)(!1),[W,q]=(0,s.useState)(!1),[V,Z]=(0,s.useState)(""),[Q,X]=(0,s.useState)(""),Y="__bind_all__",ee=B?.name===Y,et=async()=>{!D||await T.saveEdit(D.name,$)&&I(null)},es=async()=>{if(B){if(ee){let e=y.map(e=>e.name);for(let t of L)await T.applyAllToAgent(t,e)}else await T.bindConfirm(B,L,N);P(null)}},en=async()=>{q(!0);let e=await T.syncCheck();e.length>0&&(U(e),E(new Set(e.map(e=>`${e.agentId}::${e.skillName}`))),K(!0)),q(!1)},ea=async()=>{let e=O.filter(e=>R.has(`${e.agentId}::${e.skillName}`));0===e.length||await T.syncConfirm(e)&&K(!1)},ei=(u||e)&&!B&&!D,el=Array.from(new Set(b.map(e=>e.group).filter(Boolean))),er=new Set(y.map(e=>e.name)),eo=b.filter(e=>{if(V&&e.group!==V)return!1;if(Q){let t=Q.toLowerCase();if(!e.name.toLowerCase().includes(t)&&!e.id.toLowerCase().includes(t)&&!e.group.toLowerCase().includes(t))return!1}return!0}),ec=async e=>{await z(e)},ed=(0,t.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-1",children:[["local",o.FileText,x("tabLocal")],["store",r.Store,x("tabStore")]].map(([e,s,n])=>(0,t.jsxs)("button",{onClick:()=>j(e),className:`flex items-center gap-1.5 px-3 py-2 text-sm font-medium border-b-2 transition-colors ${g===e?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(s,{className:"size-3.5"}),n]},e))}),em=(0,t.jsxs)("div",{className:"flex flex-1 min-h-0 gap-4 pt-2",children:[el.length>0&&(0,t.jsx)(l.ScrollArea,{className:"hidden md:block w-44 shrink-0",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 pr-2",children:[(0,t.jsxs)(i.Button,{variant:V?"ghost":"secondary",size:"sm",className:"w-full justify-start",onClick:()=>Z(""),children:[(0,t.jsx)(o.FileText,{className:"size-3.5 mr-1.5"}),x("filterAll")]}),el.map(e=>(0,t.jsxs)(i.Button,{variant:V===e?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>Z(V===e?"":e),children:[(0,t.jsx)(d.Folder,{className:"size-3.5 mr-1.5"}),(0,t.jsx)("span",{className:"truncate",children:e})]},e))]})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col min-h-0",children:[(0,t.jsxs)("div",{className:"relative mb-3",children:[(0,t.jsx)(m.Search,{className:"size-3.5 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(p.Input,{value:Q,onChange:e=>X(e.target.value),placeholder:x("search"),className:"pl-8"})]}),(0,t.jsx)(l.ScrollArea,{className:"flex-1",children:C?(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:f("loading")}):0===eo.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:x("storeEmpty")}):(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 pr-2",children:eo.map(e=>{let s=er.has(e.id),n=S.has(e.path);return(0,t.jsx)("div",{className:"rounded-xl border border-border bg-background p-4 hover:bg-accent/30 transition-colors",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(r.Store,{className:"size-3.5 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"font-medium text-sm",children:e.name}),(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium",children:e.group})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:e.id})]}),(0,t.jsx)(i.Button,{variant:s?"ghost":"outline",size:"sm",className:"shrink-0",disabled:s||n,onClick:()=>ec(e),children:s?x("imported"):n?x("importing"):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.Download,{className:"size-3.5 mr-1"}),x("importTo")]})})]})},e.path)})})})]})]}),ep=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.DialogHeader,{children:(0,t.jsxs)("div",{className:"hidden md:block",children:[u?(0,t.jsx)("h2",{className:"text-base font-semibold",children:x("title")}):(0,t.jsx)(a.DialogTitle,{children:x("title")}),u?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("description")}):(0,t.jsx)(a.DialogDescription,{children:x("description")})]})}),ed,(0,t.jsx)("div",{className:"flex flex-1 min-h-0 flex-col",children:"local"===g?(0,t.jsx)(A,{skills:y,agents:N,loading:k,syncLoading:W,onToggleFavorite:T.toggleFavorite,onDelete:T.deleteSkill,onEdit:e=>{I(e),F(e.content)},onBind:e=>{P(e),M(e.boundAgents.map(e=>e.id))},onImportBatch:T.importBatch,onImportFromGit:T.importFromGit,onSyncCheck:en,onBindAll:()=>{P({name:Y,description:"",filename:"",content:"",favorited:!1,group:"",boundAgents:[]}),M([])}}):em})]});return(0,t.jsxs)(t.Fragment,{children:[u&&ei&&(0,t.jsx)("div",{className:"h-full flex flex-col",children:ep}),!u&&(0,t.jsx)(a.Dialog,{open:ei,onOpenChange:h,children:(0,t.jsx)(a.DialogContent,{className:"!w-[80vw] !max-w-[80vw] !h-[80vh] flex flex-col overflow-hidden",children:ep})}),(0,t.jsx)(_,{skill:D,content:$,onContentChange:F,onClose:()=>I(null),onSave:et}),(0,t.jsx)(G,{skill:B,titleOverride:ee?x("applyAllToAgent"):void 0,descriptionOverride:ee?x("applyAllToAgentDescription"):void 0,agents:N,selected:L,onToggle:e=>M(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),onClose:()=>P(null),onConfirm:es}),(0,t.jsx)(J,{open:H,onOpenChange:K,items:O,selected:R,onToggle:(e,t)=>{let s=`${e}::${t}`;E(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},onConfirm:ea})]})}],625873)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,386041,e=>{"use strict";let t=(0,e.i(433721).default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);e.s(["Code2",0,t],386041)},194228,e=>{"use strict";let t=(0,e.i(433721).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"}]]);e.s(["GitCommitHorizontal",0,t],194228)},363156,e=>{"use strict";var t=e.i(816709);let r=/not a git repository/i;function i(e){return e instanceof Error&&r.test(e.message)}let s=(0,t.create)(e=>({status:null,diffs:[],selectedFile:null,log:[],branches:[],loading:!1,error:null,notGitRepo:!1,commitMsg:"",loadStatus:async t=>{try{let r=await fetch(`/api/workspaces/${t}/git/status`);if(!r.ok)throw Error(await r.text());let i=await r.json();e({status:i,notGitRepo:!1})}catch(t){e({error:t instanceof Error?t.message:String(t),notGitRepo:i(t)})}},loadDiffs:async(t,r)=>{e({loading:!0});try{let i=r?`/api/workspaces/${t}/git/diff?path=${encodeURIComponent(r)}`:`/api/workspaces/${t}/git/diff`,s=await fetch(i);if(!s.ok)throw Error(await s.text());let a=await s.json();e({diffs:a,loading:!1,notGitRepo:!1})}catch(t){e({error:t instanceof Error?t.message:String(t),loading:!1,notGitRepo:i(t)})}},loadLog:async t=>{try{let r=await fetch(`/api/workspaces/${t}/git/log`);if(!r.ok)throw Error(await r.text());let i=await r.json();e({log:i,notGitRepo:!1})}catch(t){e({error:t instanceof Error?t.message:String(t),notGitRepo:i(t)})}},loadBranches:async t=>{try{let r=await fetch(`/api/workspaces/${t}/git/branches`);if(!r.ok)throw Error(await r.text());let i=await r.json();e({branches:i,notGitRepo:!1})}catch(t){e({error:t instanceof Error?t.message:String(t),notGitRepo:i(t)})}},initRepo:async t=>{try{let r=await fetch(`/api/workspaces/${t}/git/init`,{method:"POST"});if(!r.ok)throw Error(await r.text());e({error:null,notGitRepo:!1})}catch(t){e({error:t instanceof Error?t.message:String(t)})}},commit:async(t,r)=>{try{let e=await fetch(`/api/workspaces/${t}/git/commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:r})});if(!e.ok)throw Error(await e.text())}catch(t){e({error:t instanceof Error?t.message:String(t)})}},discard:async(t,r)=>{try{let e=await fetch(`/api/workspaces/${t}/git/discard`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:r})});if(!e.ok)throw Error(await e.text())}catch(t){e({error:t instanceof Error?t.message:String(t)})}},discardAll:async t=>{try{let e=await fetch(`/api/workspaces/${t}/git/discard-all`,{method:"POST"});if(!e.ok)throw Error(await e.text())}catch(t){e({error:t instanceof Error?t.message:String(t)})}},stage:async(t,r)=>{try{let e=await fetch(`/api/workspaces/${t}/git/stage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:r})});if(!e.ok)throw Error(await e.text())}catch(t){e({error:t instanceof Error?t.message:String(t)})}},unstage:async(t,r)=>{try{let e=await fetch(`/api/workspaces/${t}/git/unstage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:r})});if(!e.ok)throw Error(await e.text())}catch(t){e({error:t instanceof Error?t.message:String(t)})}},resolveFile:async(e,t,r,i=!0)=>{let s=await fetch(`/api/workspaces/${e}/git/resolve-file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t,content:r,stage:i})});if(!s.ok)throw Error(await s.text())},checkout:async(t,r)=>{try{let e=await fetch(`/api/workspaces/${t}/git/checkout`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:r})});if(!e.ok)throw Error(await e.text())}catch(t){e({error:t instanceof Error?t.message:String(t)})}},push:async e=>{let t=await fetch(`/api/workspaces/${e}/git/push`,{method:"POST"});if(!t.ok)throw Error((await t.json().catch(()=>({error:"Push failed"}))).error)},pull:async e=>{let t=await fetch(`/api/workspaces/${e}/git/pull`,{method:"POST"});if(!t.ok)throw Error((await t.json().catch(()=>({error:"Pull failed"}))).error)},fetchRemote:async e=>{let t=await fetch(`/api/workspaces/${e}/git/fetch`,{method:"POST"});if(!t.ok)throw Error((await t.json().catch(()=>({error:"Fetch failed"}))).error)},getRemotes:async e=>{let t=await fetch(`/api/workspaces/${e}/git/remotes`);if(!t.ok)throw Error(await t.text());return t.json()},addRemote:async(e,t,r)=>{let i=await fetch(`/api/workspaces/${e}/git/remotes`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,url:r})});if(!i.ok)throw Error((await i.json().catch(()=>({error:"Failed to add remote"}))).error)},selectFile:t=>e({selectedFile:t}),setCommitMsg:t=>e({commitMsg:t}),checkoutDetached:async(e,t)=>{let r=await fetch(`/api/workspaces/${e}/git/checkout-detached`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commitHash:t})});if(!r.ok)throw Error((await r.json().catch(()=>({}))).error)},cherryPick:async(e,t)=>{let r=await fetch(`/api/workspaces/${e}/git/cherry-pick`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commitHash:t})});if(!r.ok)throw Error((await r.json().catch(()=>({}))).error)},createBranch:async(e,t,r)=>{let i=await fetch(`/api/workspaces/${e}/git/create-branch`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,startPoint:r})});if(!i.ok)throw Error((await i.json().catch(()=>({}))).error)},deleteBranch:async(e,t,r)=>{let i=await fetch(`/api/workspaces/${e}/git/delete-branch`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,force:r})});if(!i.ok)throw Error((await i.json().catch(()=>({}))).error)},createTag:async(e,t,r)=>{let i=await fetch(`/api/workspaces/${e}/git/create-tag`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,commitHash:r})});if(!i.ok)throw Error((await i.json().catch(()=>({}))).error)},getCommitDiff:async(e,t)=>{let r=await fetch(`/api/workspaces/${e}/git/commit-diff?hash=${encodeURIComponent(t)}`);if(!r.ok)throw Error((await r.json().catch(()=>({}))).error);return r.json()},getRemoteUrl:async e=>{let t=await fetch(`/api/workspaces/${e}/git/remote-url`);if(!t.ok)throw Error((await t.json().catch(()=>({}))).error);return(await t.json()).url},getMergeBase:async e=>{let t=await fetch(`/api/workspaces/${e}/git/merge-base`);if(!t.ok)throw Error((await t.json().catch(()=>({}))).error);return(await t.json()).hash}}));e.s(["useGitStore",0,s])},253307,e=>{"use strict";let t=(0,e.i(433721).default)("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);e.s(["FileDiff",0,t],253307)},524360,e=>{"use strict";var t=e.i(816709),r=e.i(360112);let i=new Map,s=(0,t.create)((e,t)=>({sessions:[],activeId:null,ws:null,workspaceId:null,_initialized:!1,_restored:!1,init:(s,a)=>{let o=t();if(o._initialized&&o.ws===s)return;let n=o.workspaceId!==s.workspaceId;n&&i.clear(),e({ws:s,workspaceId:s.workspaceId,sessions:n?[]:o.sessions,activeId:n?null:o.activeId,_initialized:!0,_restored:!1}),s.on("terminal.created",t=>{let{sessionId:r,cwd:i,shell:s}=t;e(e=>e.sessions.some(e=>e.id===r)?e:{sessions:[...e.sessions,{id:r,cwd:i,shell:s}],activeId:r})}),s.on("terminal.error",e=>{let{error:t}=e;r.toast.error(t)}),s.on("terminal.closed",t=>{let{sessionId:r}=t;e(e=>{let t=e.sessions.filter(e=>e.id!==r),i=e.activeId===r?t[0]?.id??null:e.activeId;return{sessions:t,activeId:i}})}),s.on("terminal.sessions",t=>{let{sessions:r}=t;e(e=>{let t=new Map(e.sessions.map(e=>[e.id,e])),s=r.map(e=>{let r=t.get(e.sessionId);return e.buffer&&i.set(e.sessionId,e.buffer),{...r,id:e.sessionId,cwd:e.cwd,shell:e.shell??r?.shell}}),a=!!e.activeId&&s.some(t=>t.id===e.activeId);for(let e of r)e.buffer||i.delete(e.sessionId);return{sessions:s,activeId:a?e.activeId:s[0]?.id??null,_restored:!0}}),a?.()})},createSession:(e,r)=>{let{ws:i}=t();i?.send("terminal.create",{sessionId:crypto.randomUUID?.()??crypto.getRandomValues(new Uint8Array(16)).reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),shell:e,cwd:r})},setActive:t=>e({activeId:t}),setSessionName:(t,r)=>e(e=>({sessions:e.sessions.map(e=>e.id===t?{...e,name:r}:e)})),removeSession:r=>{let{ws:i,sessions:s,activeId:a}=t();i?.send("terminal.close",{sessionId:r});let o=s.filter(e=>e.id!==r),n=a===r?o[0]?.id??null:a;e({sessions:o,activeId:n})},sendInput:(e,r)=>{t().ws?.send("terminal.input",{sessionId:e,data:r})},resize:(e,r,i)=>{t().ws?.send("terminal.resize",{sessionId:e,cols:r,rows:i})}}));e.s(["consumeSessionBuffer",0,function(e){let t=i.get(e);return i.delete(e),t},"useTerminalStore",0,s])},191441,e=>{"use strict";let t=(0,e.i(433721).default)("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]);e.s(["ListChecks",0,t],191441)},404175,e=>{"use strict";var t=e.i(344180),r=e.i(227634),i=e.i(191441),s=e.i(451534),a=e.i(386041),o=e.i(426022),n=e.i(989484),c=e.i(433721);let l=(0,c.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var d=e.i(253307),h=e.i(194228),p=e.i(210),f=e.i(255742),g=e.i(943997);let u=(0,c.default)("kanban",[["path",{d:"M5 3v14",key:"9nsxs2"}],["path",{d:"M12 3v8",key:"1h2ygw"}],["path",{d:"M19 3v18",key:"1sk56x"}]]),m=[{id:"channel-list",icon:r.Hash,group:"channel"},{id:"chat",icon:o.MessageSquare,group:"channel"},{id:"issue-list",icon:i.ListChecks,group:"issue"},{id:"issue-detail",icon:d.FileDiff,group:"issue"},{id:"workfolder",icon:s.FolderOpen,group:"workfolder"},{id:"code-editor",icon:a.Code2,group:"workfolder"},{id:"terminal",icon:l,group:"tools"},{id:"git-commits",icon:h.GitCommitHorizontal,group:"git"},{id:"project-settings",icon:p.Settings2,group:"settings"},{id:"code-favorites",icon:f.Star,group:"workfolder"},{id:"database",icon:g.Database,group:"workfolder"},{id:"kanban",icon:u,group:"workfolder"}],w={"channel-list":(0,t.jsx)(r.Hash,{size:16}),"issue-list":(0,t.jsx)(i.ListChecks,{size:16}),workfolder:(0,t.jsx)(s.FolderOpen,{size:16}),"code-editor":(0,t.jsx)(a.Code2,{size:16}),chat:(0,t.jsx)(o.MessageSquare,{size:16}),"issue-detail":(0,t.jsx)(n.FileText,{size:16}),terminal:(0,t.jsx)(l,{size:16}),"git-commits":(0,t.jsx)(h.GitCommitHorizontal,{size:16}),"project-settings":(0,t.jsx)(p.Settings2,{size:16}),"code-favorites":(0,t.jsx)(f.Star,{size:16}),database:(0,t.jsx)(g.Database,{size:16}),kanban:(0,t.jsx)(u,{size:16}),...{}};function y(e,r,i,s,a){if("git-commits"===e&&r&&!r.clean){let e=r.insertions>0||r.deletions>0,i=(0,t.jsx)("span",{className:"ml-1 text-[10px] font-medium leading-none flex items-center gap-0.5",children:e?(0,t.jsxs)(t.Fragment,{children:[r.insertions>0&&(0,t.jsxs)("span",{className:"text-green-600",children:["+",r.insertions]}),r.deletions>0&&(0,t.jsxs)("span",{className:"text-red-500",children:["-",r.deletions]})]}):(0,t.jsx)("span",{className:"text-orange-500",children:r.files.length})}),s=r.files.length;return{trailing:i,badge:s>0?(0,t.jsx)("span",{className:"absolute -top-1 -right-1.5 min-w-[14px] h-[14px] rounded-full bg-blue-500 text-white text-[9px] font-medium leading-none flex items-center justify-center px-0.5",children:s}):null}}if("terminal"===e&&i.length>0)return{trailing:null,badge:(0,t.jsx)("span",{className:"absolute -top-1 -right-1.5 min-w-[14px] h-[14px] rounded-full bg-green-500 text-white text-[9px] font-medium leading-none flex items-center justify-center px-0.5",children:i.length})};let o=(0,t.jsxs)("span",{className:"absolute -top-1 -right-1 flex h-2 w-2",children:[(0,t.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"})]});return"channel-list"===e&&Object.values(s).some(e=>e.some(e=>"streaming"===e.status||"pending"===e.status))||"issue-detail"===e&&a.some(e=>"pending"===e.status||"running"===e.status||"retrying"===e.status||"waiting_review"===e.status)?{trailing:null,badge:o}:{trailing:null,badge:null}}e.s(["RIGHT_TO_LEFT_TAB_MAP",0,{"code-editor":"workfolder",chat:"channel-list","issue-detail":"issue-list",database:"workfolder"},"TAB_ITEMS",0,m,"getTabBadge",0,y,"renderTabIcon",0,function(e,r,i,s,a,o){let n=w[e];if(!n)return null;let{trailing:c,badge:l}=y(e,i,s,a,o);return(0,t.jsxs)("span",{title:r,className:"flex items-center justify-center",children:[(0,t.jsxs)("span",{className:"relative",children:[n,l]}),c]})}],404175)},217061,e=>{"use strict";var t=e.i(344180),r=e.i(250226),i=e.i(363156),s=e.i(524360),a=e.i(31807),o=e.i(873111),n=e.i(465458),c=e.i(404175);e.s(["MobileTabBar",0,function(){let{activePanel:e,setActivePanel:l}=(0,r.useMobilePanelStore)(),d=(0,i.useGitStore)(e=>e.status),h=(0,s.useTerminalStore)(e=>e.sessions),p=(0,a.useChannelStore)(e=>e.messages),f=(0,o.useTaskStore)(e=>e.tasks);return(0,t.jsx)("div",{className:"relative shrink-0 bg-background",children:(0,t.jsx)("div",{className:"flex items-center h-10 border-b px-1 gap-2 shrink-0 overflow-x-auto overflow-y-visible md:hidden",children:c.TAB_ITEMS.map((r,i)=>{let s=r.icon,a=i>0?c.TAB_ITEMS[i-1].group:null,o=null!==a&&a!==r.group,{trailing:g,badge:u}=(0,c.getTabBadge)(r.id,d,h,p,f);return(0,t.jsxs)("div",{className:"flex items-center shrink-0 overflow-visible",children:[o&&(0,t.jsx)("div",{className:"w-px h-4 bg-border mx-0.5"}),(0,t.jsxs)("button",{onClick:()=>{var e;l(e=r.id),c.RIGHT_TO_LEFT_TAB_MAP[e]},className:(0,n.cn)("relative flex items-center justify-center h-8 min-w-8 px-1 rounded-md transition-colors",e===r.id?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50"),children:[(0,t.jsxs)("span",{className:"relative",children:[(0,t.jsx)(s,{size:16}),u]}),g]})]},r.id)})})})}])},404069,e=>{e.n(e.i(217061))}]);