orc-ai 0.1.49 → 0.1.50

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 (260) hide show
  1. package/dist/index.js +514 -485
  2. package/dist/skills/orc-platform/SKILL.md +2 -1
  3. package/dist/skills/orc-platform/references/scratchpads.md +140 -0
  4. package/dist/skills/orc-sdlc/references/planning.md +2 -0
  5. package/dist/web/assets/{Agents-C8dJX8px.js → Agents-DT7Kw4C9.js} +1 -1
  6. package/dist/web/assets/Assistant-Bold-gm-uSS1B.woff2 +0 -0
  7. package/dist/web/assets/Assistant-Medium-DrcxCXg3.woff2 +0 -0
  8. package/dist/web/assets/Assistant-Regular-DVxZuzxb.woff2 +0 -0
  9. package/dist/web/assets/Assistant-SemiBold-SCI4bEL9.woff2 +0 -0
  10. package/dist/web/assets/{Attention-BHYo8Lwr.js → Attention-Bibod5n4.js} +1 -1
  11. package/dist/web/assets/{Audit-CS_DZkbJ.js → Audit-DtPRrWXW.js} +1 -1
  12. package/dist/web/assets/{ConfirmDialog-CrSa87VF.js → ConfirmDialog-C_exU7Ga.js} +1 -1
  13. package/dist/web/assets/Dashboard-CUI_9Hz5.js +1 -0
  14. package/dist/web/assets/{DocumentWorkspace-CNyVQTjg.js → DocumentWorkspace-1MKzrR1V.js} +1 -1
  15. package/dist/web/assets/{EmptyState-Ctm7L70B.js → EmptyState-BVLws_BR.js} +1 -1
  16. package/dist/web/assets/{ErrorState-BPTepwiG.js → ErrorState-CwOWC9Qy.js} +1 -1
  17. package/dist/web/assets/{FileEditor-Dh29_xCL.js → FileEditor-Da165c-z.js} +1 -1
  18. package/dist/web/assets/{JobWebhooks-TvAY8p1V.js → JobWebhooks-hQGYLoqm.js} +1 -1
  19. package/dist/web/assets/{Jobs-C5ggSs2T.js → Jobs-8NrwRdn6.js} +3 -3
  20. package/dist/web/assets/Knowledge-HYfSkIC7.js +28 -0
  21. package/dist/web/assets/{PackageCatalog-B1U3vfhW.js → PackageCatalog-136z9RG3.js} +5 -5
  22. package/dist/web/assets/{Pager-ClYYU9et.js → Pager-BNTTeR5A.js} +1 -1
  23. package/dist/web/assets/{PriorityBadge-BW-A50LE.js → PriorityBadge-DHoaJR_M.js} +1 -1
  24. package/dist/web/assets/Projects-k8zYVv6p.js +3 -0
  25. package/dist/web/assets/ResumeActions-RtezaXDE.js +1 -0
  26. package/dist/web/assets/{Rules-DGKsAbTf.js → Rules-DhBnNVaL.js} +1 -1
  27. package/dist/web/assets/Scratchpads-ayvsVZxj.js +20 -0
  28. package/dist/web/assets/Sessions-69xt5f84.js +5 -0
  29. package/dist/web/assets/{Settings-yW1S2q4F.js → Settings-CQgEWLgI.js} +6 -6
  30. package/dist/web/assets/{Skills-BwdXE5nT.js → Skills-DBDN8e6r.js} +3 -3
  31. package/dist/web/assets/{SourceEditor-ft02z20v.js → SourceEditor-YTDMGFWW.js} +1 -1
  32. package/dist/web/assets/{StatusBadge-C5G1fdZh.js → StatusBadge-Cq2xO_SU.js} +1 -1
  33. package/dist/web/assets/TagInput-DDhc6WTI.js +1 -0
  34. package/dist/web/assets/{TaskDetailSheet-fUSHPFB-.js → TaskDetailSheet-BfRXcm8m.js} +2 -2
  35. package/dist/web/assets/{Tasks-uRqvmLz7.js → Tasks-DNk7-wgj.js} +5 -5
  36. package/dist/web/assets/{Terminals-W5nszLI1.js → Terminals-DjEvs39w.js} +7 -7
  37. package/dist/web/assets/{ViewHeader-DXR0ZaMO.js → ViewHeader-B9EgQxZk.js} +1 -1
  38. package/dist/web/assets/{Webhooks-lXLoKWdt.js → Webhooks-BvLKR0jj.js} +1 -1
  39. package/dist/web/assets/abnfDiagram-VCTEODGH-BuQM5S1v.js +1 -0
  40. package/dist/web/assets/ar-SA-G6X2FPQ2-BjnbTjeM.js +10 -0
  41. package/dist/web/assets/arc-DFP6bOTS.js +1 -0
  42. package/dist/web/assets/architectureDiagram-5GKGNRK7-BFJa9U2j.js +36 -0
  43. package/dist/web/assets/arrow-left-BTl_37z8.js +6 -0
  44. package/dist/web/assets/az-AZ-76LH7QW2-B8PZ0GKj.js +1 -0
  45. package/dist/web/assets/bg-BG-XCXSNQG7-DI7GiV-4.js +5 -0
  46. package/dist/web/assets/{blockDiagram-I7D4REHJ-DMrufypV.js → blockDiagram-I7D4REHJ-Cizo9Hl8.js} +3 -3
  47. package/dist/web/assets/bn-BD-2XOGV67Q-Dr7ktQFH.js +5 -0
  48. package/dist/web/assets/{c4Diagram-7LVT6UL2-BUUxjwvU.js → c4Diagram-7LVT6UL2-D8DiqXy4.js} +2 -2
  49. package/dist/web/assets/ca-ES-6MX7JW3Y-DqmXjVpI.js +8 -0
  50. package/dist/web/assets/channel-DbXZPmMe.js +1 -0
  51. package/dist/web/assets/chunk-2Q5K7J3B-JhTVpDn1.js +1 -0
  52. package/dist/web/assets/{chunk-5VM5RSS4-B6lAVcgQ.js → chunk-5VM5RSS4-BZ8K5AGw.js} +1 -1
  53. package/dist/web/assets/chunk-F27PBJKO-_mlKDDbq.js +1 -0
  54. package/dist/web/assets/{chunk-IMKFNOWR-CwyogA-y.js → chunk-IMKFNOWR-BnFGiWsy.js} +1 -1
  55. package/dist/web/assets/chunk-JWPE2WC7-bbN-huXf.js +1 -0
  56. package/dist/web/assets/chunk-POPQ4Y6H-wnVtHn_O.js +1 -0
  57. package/dist/web/assets/{chunk-SVP7TREG-CmiQdvOH.js → chunk-SVP7TREG-B1kaWVdh.js} +4 -4
  58. package/dist/web/assets/{chunk-TICWLB2K-CieIpfOy.js → chunk-TICWLB2K-BQ8K51Oc.js} +1 -1
  59. package/dist/web/assets/chunk-XXDRQBXY-CCJyOiYl.js +1 -0
  60. package/dist/web/assets/classDiagram-ZZMXUADV-BQ5ONiWc.js +1 -0
  61. package/dist/web/assets/classDiagram-v2-VYDZK3BY-BQ5ONiWc.js +1 -0
  62. package/dist/web/assets/copy-DsS5X55x.js +6 -0
  63. package/dist/web/assets/cose-bilkent-JH36ORCC-BKztu1Kn.js +1 -0
  64. package/dist/web/assets/cs-CZ-2BRQDIVT-qn9_RBqW.js +11 -0
  65. package/dist/web/assets/{cynefin-OW5HDTMX-vMXgcpgg.js → cynefin-OW5HDTMX-YAbh6GHR.js} +1 -1
  66. package/dist/web/assets/cynefinDiagram-5FMLGOSQ-CWidjPb8.js +62 -0
  67. package/dist/web/assets/da-DK-5WZEPLOC-DpER4jvL.js +5 -0
  68. package/dist/web/assets/{dagre-GXQ25YYZ-xmoviGlr.js → dagre-GXQ25YYZ-BuzvSdX0.js} +2 -2
  69. package/dist/web/assets/de-DE-XR44H4JA-CtleMrwo.js +8 -0
  70. package/dist/web/assets/{diagram-S7CK7UJ4-CguQzzXs.js → diagram-S7CK7UJ4-Ch-rAjmB.js} +5 -5
  71. package/dist/web/assets/diagram-UQ7AKVKN-DhixRZev.js +41 -0
  72. package/dist/web/assets/{diagram-VSXAHHWV-cuhv3Fvj.js → diagram-VSXAHHWV-4FwHTQjS.js} +3 -3
  73. package/dist/web/assets/diagram-VX7I27RA-BE_c4-lI.js +24 -0
  74. package/dist/web/assets/diagram-Z3DM3KII-j49FiH9W.js +24 -0
  75. package/dist/web/assets/directory-open-01563666-DWU9wJ6I.js +1 -0
  76. package/dist/web/assets/directory-open-4ed118d0-CunoC1EB.js +1 -0
  77. package/dist/web/assets/{download-UgMvjBjR.js → download-DCNlFjgq.js} +1 -1
  78. package/dist/web/assets/ebnfDiagram-PWID7BFC-DJd8fyb-.js +1 -0
  79. package/dist/web/assets/el-GR-BZB4AONW-DOGQ2uKF.js +10 -0
  80. package/dist/web/assets/erDiagram-RLTQ6QDP-CIzsltIW.js +99 -0
  81. package/dist/web/assets/es-ES-U4NZUMDT-BV7Xnx76.js +9 -0
  82. package/dist/web/assets/eu-ES-A7QVB2H4-Cy6tNdQP.js +11 -0
  83. package/dist/web/assets/excalidraw/fonts/Assistant/Assistant-Bold.woff2 +0 -0
  84. package/dist/web/assets/excalidraw/fonts/Assistant/Assistant-Medium.woff2 +0 -0
  85. package/dist/web/assets/excalidraw/fonts/Assistant/Assistant-Regular.woff2 +0 -0
  86. package/dist/web/assets/excalidraw/fonts/Assistant/Assistant-SemiBold.woff2 +0 -0
  87. package/dist/web/assets/excalidraw/fonts/Cascadia/CascadiaCode-Regular.woff2 +0 -0
  88. package/dist/web/assets/excalidraw/fonts/ComicShanns/ComicShanns-Regular-279a7b317d12eb88de06167bd672b4b4.woff2 +0 -0
  89. package/dist/web/assets/excalidraw/fonts/ComicShanns/ComicShanns-Regular-6e066e8de2ac57ea9283adb9c24d7f0c.woff2 +0 -0
  90. package/dist/web/assets/excalidraw/fonts/ComicShanns/ComicShanns-Regular-dc6a8806fa96795d7b3be5026f989a17.woff2 +0 -0
  91. package/dist/web/assets/excalidraw/fonts/ComicShanns/ComicShanns-Regular-fcb0fc02dcbee4c9846b3e2508668039.woff2 +0 -0
  92. package/dist/web/assets/excalidraw/fonts/Excalifont/Excalifont-Regular-349fac6ca4700ffec595a7150a0d1e1d.woff2 +0 -0
  93. package/dist/web/assets/excalidraw/fonts/Excalifont/Excalifont-Regular-3f2c5db56cc93c5a6873b1361d730c16.woff2 +0 -0
  94. package/dist/web/assets/excalidraw/fonts/Excalifont/Excalifont-Regular-41b173a47b57366892116a575a43e2b6.woff2 +0 -0
  95. package/dist/web/assets/excalidraw/fonts/Excalifont/Excalifont-Regular-623ccf21b21ef6b3a0d87738f77eb071.woff2 +0 -0
  96. package/dist/web/assets/excalidraw/fonts/Excalifont/Excalifont-Regular-a88b72a24fb54c9f94e3b5fdaa7481c9.woff2 +0 -0
  97. package/dist/web/assets/excalidraw/fonts/Excalifont/Excalifont-Regular-b9dcf9d2e50a1eaf42fc664b50a3fd0d.woff2 +0 -0
  98. package/dist/web/assets/excalidraw/fonts/Excalifont/Excalifont-Regular-be310b9bcd4f1a43f571c46df7809174.woff2 +0 -0
  99. package/dist/web/assets/excalidraw/fonts/Liberation/LiberationSans-Regular.woff2 +0 -0
  100. package/dist/web/assets/excalidraw/fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYE98RXi4EwSsbg.woff2 +0 -0
  101. package/dist/web/assets/excalidraw/fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYEF8RXi4EwQ.woff2 +0 -0
  102. package/dist/web/assets/excalidraw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTA3j6zbXWjgevT5.woff2 +0 -0
  103. package/dist/web/assets/excalidraw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTQ3j6zbXWjgeg.woff2 +0 -0
  104. package/dist/web/assets/excalidraw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTk3j6zbXWjgevT5.woff2 +0 -0
  105. package/dist/web/assets/excalidraw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTo3j6zbXWjgevT5.woff2 +0 -0
  106. package/dist/web/assets/excalidraw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTs3j6zbXWjgevT5.woff2 +0 -0
  107. package/dist/web/assets/excalidraw/fonts/Virgil/Virgil-Regular.woff2 +0 -0
  108. package/dist/web/assets/fa-IR-HGAKTJCU-CbOnhX3T.js +8 -0
  109. package/dist/web/assets/fi-FI-Z5N7JZ37-qra5-Mob.js +6 -0
  110. package/dist/web/assets/file-open-002ab408-DIuFHtCF.js +1 -0
  111. package/dist/web/assets/file-open-7c801643-684qeFg4.js +1 -0
  112. package/dist/web/assets/file-save-3189631c-C1wFhQhH.js +1 -0
  113. package/dist/web/assets/file-save-745eba88-Bb9F9Kg7.js +1 -0
  114. package/dist/web/assets/{flowDiagram-HODETNUW-DueO0Ju6.js → flowDiagram-HODETNUW-AX8L-l_p.js} +5 -5
  115. package/dist/web/assets/folder-open-DAIhPqFI.js +11 -0
  116. package/dist/web/assets/fr-FR-RHASNOE6-DN9byp9Y.js +9 -0
  117. package/dist/web/assets/ganttDiagram-EL5Y4UJY-CETcz11y.js +292 -0
  118. package/dist/web/assets/gitGraphDiagram-WWUBYQGX-DrDRWd07.js +106 -0
  119. package/dist/web/assets/gl-ES-HMX3MZ6V-BylDWANB.js +10 -0
  120. package/dist/web/assets/he-IL-6SHJWFNN-BIl3mWuh.js +10 -0
  121. package/dist/web/assets/hi-IN-IWLTKZ5I-DeQ5X6EO.js +4 -0
  122. package/dist/web/assets/highlighted-body-KPVGNVTW-CKHMZ0iS.js +1 -0
  123. package/dist/web/assets/hu-HU-A5ZG7DT2-0hYCWJJc.js +7 -0
  124. package/dist/web/assets/id-ID-SAP4L64H-Dhbb7S2T.js +10 -0
  125. package/dist/web/assets/image-blob-reduce.esm-D6s-rqMO.js +7 -0
  126. package/dist/web/assets/index-3slyF2Z-.js +19 -0
  127. package/dist/web/assets/index-CY60J5zm.css +1 -0
  128. package/dist/web/assets/{index-C_jtMgr7.js → index-Ckq9CvHb.js} +89 -89
  129. package/dist/web/assets/infoDiagram-27XIBGKW-ST1zQCsj.js +2 -0
  130. package/dist/web/assets/{ishikawaDiagram-5VMMS53U-ccIPCUs4.js → ishikawaDiagram-5VMMS53U-B3SJTPoL.js} +5 -5
  131. package/dist/web/assets/it-IT-JPQ66NNP-BhOQg5cl.js +11 -0
  132. package/dist/web/assets/ja-JP-DBVTYXUO-BPw0tly-.js +8 -0
  133. package/dist/web/assets/{journeyDiagram-3NMN7TZE-rRe3uTLu.js → journeyDiagram-3NMN7TZE-B5lzDs3v.js} +2 -2
  134. package/dist/web/assets/kaa-6HZHGXH3-C5_ZIpfZ.js +1 -0
  135. package/dist/web/assets/kab-KAB-ZGHBKWFO-iqn4ZTub.js +8 -0
  136. package/dist/web/assets/{kanban-definition-UXKFOSKX-tAKCWntJ.js → kanban-definition-UXKFOSKX-BwPssY6F.js} +6 -6
  137. package/dist/web/assets/kk-KZ-P5N5QNE5-jAgtA3a3.js +1 -0
  138. package/dist/web/assets/km-KH-HSX4SM5Z-BE4HhYBv.js +11 -0
  139. package/dist/web/assets/ko-KR-MTYHY66A-BeajeVaX.js +9 -0
  140. package/dist/web/assets/ku-TR-6OUDTVRD-AogZs9l4.js +9 -0
  141. package/dist/web/assets/layout-CrpljNKI.js +1 -0
  142. package/dist/web/assets/linear-Bo2HXNnf.js +1 -0
  143. package/dist/web/assets/{list-BL4eRkIg.js → list-W5PAwY_1.js} +1 -1
  144. package/dist/web/assets/live-sessions-C4qBcPbR.js +6 -0
  145. package/dist/web/assets/lt-LT-XHIRWOB4-VJAq27RW.js +3 -0
  146. package/dist/web/assets/lv-LV-5QDEKY6T-DhV43c3O.js +7 -0
  147. package/dist/web/assets/mermaid-HWGCJPDP-CSzVGSXu.js +299 -0
  148. package/dist/web/assets/mermaid.core-BYL6TaO8.js +312 -0
  149. package/dist/web/assets/{mindmap-definition-YA3MSWOX-Cj5-j6a7.js → mindmap-definition-YA3MSWOX-EvJgLjwn.js} +4 -4
  150. package/dist/web/assets/mr-IN-CRQNXWMA-DSWzmLM0.js +13 -0
  151. package/dist/web/assets/my-MM-5M5IBNSE-gJ2ISU-G.js +1 -0
  152. package/dist/web/assets/nb-NO-T6EIAALU-DAwLq2T7.js +10 -0
  153. package/dist/web/assets/nl-NL-IS3SIHDZ-CjE7CpT4.js +8 -0
  154. package/dist/web/assets/nn-NO-6E72VCQL-CTVNnELU.js +8 -0
  155. package/dist/web/assets/oc-FR-POXYY2M6-vcMaQvFU.js +8 -0
  156. package/dist/web/assets/pa-IN-N4M65BXN-DJg1bUGg.js +4 -0
  157. package/dist/web/assets/pegDiagram-XKGWAZYB-TqqcNwRV.js +1 -0
  158. package/dist/web/assets/{pencil-gxvh59uO.js → pencil-CxDR8VFb.js} +1 -1
  159. package/dist/web/assets/percentages-BXMCSKIN-CnGxO6II.js +180 -0
  160. package/dist/web/assets/percentages-BXMCSKIN-DGBKIvAv.css +1 -0
  161. package/dist/web/assets/pica-DVsMi-pt.js +7 -0
  162. package/dist/web/assets/pieDiagram-E7YTZNPT-CjwbCJae.js +39 -0
  163. package/dist/web/assets/pl-PL-T2D74RX3-B499NViP.js +9 -0
  164. package/dist/web/assets/pt-BR-5N22H2LF-C99TatKy.js +9 -0
  165. package/dist/web/assets/pt-PT-UZXXM6DQ-DywHBJAr.js +9 -0
  166. package/dist/web/assets/{quadrantDiagram-AXDQQJYC-DKTP6jS5.js → quadrantDiagram-AXDQQJYC-C8k5-2L4.js} +1 -1
  167. package/dist/web/assets/railroadDiagram-O6MQD6OU-DN6DTUJL.js +1 -0
  168. package/dist/web/assets/{refresh-cw-BQRdbjy6.js → refresh-cw-C429XUIu.js} +1 -1
  169. package/dist/web/assets/{requirementDiagram-BXWQKSXE-B9hH69zu.js → requirementDiagram-BXWQKSXE-Yx4CbxBQ.js} +2 -2
  170. package/dist/web/assets/ro-RO-JPDTUUEW-BrIt0gdu.js +11 -0
  171. package/dist/web/assets/roundRect-0PYZxl1G.js +1 -0
  172. package/dist/web/assets/ru-RU-B4JR7IUQ-DikO_eDS.js +9 -0
  173. package/dist/web/assets/sankeyDiagram-P5KCCOFB-ChZBsAuF.js +40 -0
  174. package/dist/web/assets/{save-CYoz3QKB.js → save-Ca2pCtPv.js} +1 -1
  175. package/dist/web/assets/save-file-B_ZN6-id.js +1 -0
  176. package/dist/web/assets/scratchpad-routes-Cf4VNpSR.js +11 -0
  177. package/dist/web/assets/scroll-area-CUm8aggx.js +1 -0
  178. package/dist/web/assets/{sequenceDiagram-WJ2MYXX4-BF77J63J.js → sequenceDiagram-WJ2MYXX4-BJDwmaZp.js} +2 -2
  179. package/dist/web/assets/si-LK-N5RQ5JYF-BGOkewnb.js +1 -0
  180. package/dist/web/assets/sizeCapture-INFHLROL-DCT6mGJl.js +1 -0
  181. package/dist/web/assets/sk-SK-C5VTKIMK-Ci61SpsN.js +6 -0
  182. package/dist/web/assets/sl-SI-NN7IZMDC--KoF29T9.js +6 -0
  183. package/dist/web/assets/stateDiagram-D77RDMKH-DCAGD_ib.js +1 -0
  184. package/dist/web/assets/stateDiagram-v2-MP3YSRHH-BMQGBnFo.js +1 -0
  185. package/dist/web/assets/subset-shared.chunk-BwhnPDcu.js +84 -0
  186. package/dist/web/assets/subset-worker.chunk-Cnt_77Lu.js +1 -0
  187. package/dist/web/assets/sv-SE-XGPEYMSR-C0StL-sk.js +10 -0
  188. package/dist/web/assets/swimlanes-42K2YHIH-DPwHOZ8T.js +1 -0
  189. package/dist/web/assets/swimlanesDiagram-VR7AAH4N-DGqsbuuX.js +8 -0
  190. package/dist/web/assets/ta-IN-2NMHFXQM-D7MMI2_6.js +9 -0
  191. package/dist/web/assets/{table-D3N_5Wee.js → table-DTKUFFYV.js} +1 -1
  192. package/dist/web/assets/tabs-DcYod54F.js +1 -0
  193. package/dist/web/assets/th-TH-HPSO5L25-hlqKs6HJ.js +2 -0
  194. package/dist/web/assets/{timeline-definition-24CTP7MA-owGoHn8z.js → timeline-definition-24CTP7MA-7K6IPjAN.js} +8 -8
  195. package/dist/web/assets/tr-TR-DEFEU3FU-lJQToQnP.js +7 -0
  196. package/dist/web/assets/{trash-2-D3Ey4I09.js → trash-2-BOe9xa7a.js} +1 -1
  197. package/dist/web/assets/uk-UA-QMV73CPH-HdtjtiKv.js +6 -0
  198. package/dist/web/assets/{upload-DhVOCWST.js → upload-ZufDR-3q.js} +1 -1
  199. package/dist/web/assets/{useDetailRoute-j9nlwack.js → useDetailRoute-BvTqyOr1.js} +1 -1
  200. package/dist/web/assets/{useJobs-Dcl-Vim3.js → useJobs-rLcb_CgS.js} +1 -1
  201. package/dist/web/assets/{useKnowledge-gIjk0_I1.js → useKnowledge-DcZD9AcU.js} +1 -1
  202. package/dist/web/assets/{useListSelection-CSQd_Hmx.js → useListSelection-CyPVxpFj.js} +1 -1
  203. package/dist/web/assets/{useMemories-B8Zpz0Qz.js → useMemories-7v8TIl7-.js} +1 -1
  204. package/dist/web/assets/useProjectScope-C3iwCwG_.js +1 -0
  205. package/dist/web/assets/{useSessions-BrdK-12R.js → useSessions-BL5wWTxP.js} +1 -1
  206. package/dist/web/assets/vennDiagram-4TSXK5OY-Dfm3Tyo8.js +34 -0
  207. package/dist/web/assets/vi-VN-M7AON7JQ-Dj3F3Qzf.js +5 -0
  208. package/dist/web/assets/{view-params-Bm1Qf6KC.js → view-params-BeBdfQW5.js} +1 -1
  209. package/dist/web/assets/{wardleyDiagram-VM6X3IG4-D9GbTBKy.js → wardleyDiagram-VM6X3IG4-B6O-_Buj.js} +2 -2
  210. package/dist/web/assets/{xychartDiagram-S5SC5T6Z-BFqPF2Hl.js → xychartDiagram-S5SC5T6Z-BSRb_uOW.js} +4 -4
  211. package/dist/web/assets/zh-CN-LNUGB5OW-DAzBdZtp.js +10 -0
  212. package/dist/web/assets/zh-HK-E62DVLB3-C_VeJG0z.js +1 -0
  213. package/dist/web/assets/zh-TW-RAJ6MFWO-DRZgKpha.js +9 -0
  214. package/dist/web/index.html +2 -2
  215. package/package.json +1 -1
  216. package/dist/web/assets/Dashboard-V813oIhq.js +0 -1
  217. package/dist/web/assets/Knowledge-BpiN3iVE.js +0 -28
  218. package/dist/web/assets/Projects-DRao5Qpk.js +0 -3
  219. package/dist/web/assets/ResumeActions-DHTOr6GQ.js +0 -11
  220. package/dist/web/assets/Sessions-CWHU6sYy.js +0 -5
  221. package/dist/web/assets/abnfDiagram-VCTEODGH-K8P_VxLi.js +0 -1
  222. package/dist/web/assets/arc-BOl9BKfD.js +0 -1
  223. package/dist/web/assets/architectureDiagram-5GKGNRK7-DIZ15fO5.js +0 -36
  224. package/dist/web/assets/channel-CQFNQIhG.js +0 -1
  225. package/dist/web/assets/chunk-2Q5K7J3B-wRIxA2_q.js +0 -1
  226. package/dist/web/assets/chunk-F27PBJKO-DVuei-Pl.js +0 -1
  227. package/dist/web/assets/chunk-JWPE2WC7-zdsOarNZ.js +0 -1
  228. package/dist/web/assets/chunk-POPQ4Y6H-D3ieeKih.js +0 -1
  229. package/dist/web/assets/chunk-XXDRQBXY-BoTHwisB.js +0 -1
  230. package/dist/web/assets/classDiagram-ZZMXUADV-B5yD90Df.js +0 -1
  231. package/dist/web/assets/classDiagram-v2-VYDZK3BY-B5yD90Df.js +0 -1
  232. package/dist/web/assets/cose-bilkent-JH36ORCC-CtGsuuTW.js +0 -1
  233. package/dist/web/assets/cynefinDiagram-5FMLGOSQ-kMbm5D7e.js +0 -62
  234. package/dist/web/assets/diagram-UQ7AKVKN-CMX0u7Gf.js +0 -41
  235. package/dist/web/assets/diagram-VX7I27RA-Bp_JbX0e.js +0 -24
  236. package/dist/web/assets/diagram-Z3DM3KII-oZ6jRSCd.js +0 -24
  237. package/dist/web/assets/ebnfDiagram-PWID7BFC-DbxnEjb0.js +0 -1
  238. package/dist/web/assets/erDiagram-RLTQ6QDP-Cl5kXPho.js +0 -99
  239. package/dist/web/assets/folder-open-DojCP5NP.js +0 -16
  240. package/dist/web/assets/ganttDiagram-EL5Y4UJY-DNjT4iVH.js +0 -292
  241. package/dist/web/assets/gitGraphDiagram-WWUBYQGX-B4aUQ9gY.js +0 -106
  242. package/dist/web/assets/highlighted-body-KPVGNVTW-gt1u8RcC.js +0 -1
  243. package/dist/web/assets/index-CyjfnRiI.css +0 -1
  244. package/dist/web/assets/infoDiagram-27XIBGKW-CWcOvNAB.js +0 -2
  245. package/dist/web/assets/layout-7xCiQ5Mn.js +0 -1
  246. package/dist/web/assets/linear-WCNhc07o.js +0 -1
  247. package/dist/web/assets/mermaid-HWGCJPDP-C8QwWdo5.js +0 -609
  248. package/dist/web/assets/pegDiagram-XKGWAZYB-BYB3oVZ_.js +0 -1
  249. package/dist/web/assets/pieDiagram-E7YTZNPT-CSbpzXas.js +0 -39
  250. package/dist/web/assets/railroadDiagram-O6MQD6OU-Ct8aPeLX.js +0 -1
  251. package/dist/web/assets/sankeyDiagram-P5KCCOFB-CDqNONxU.js +0 -40
  252. package/dist/web/assets/scroll-area-CU4DGUBA.js +0 -1
  253. package/dist/web/assets/sizeCapture-INFHLROL-Dpubco_U.js +0 -1
  254. package/dist/web/assets/stateDiagram-D77RDMKH-CzslKEYw.js +0 -1
  255. package/dist/web/assets/stateDiagram-v2-MP3YSRHH-DKbNjyV-.js +0 -1
  256. package/dist/web/assets/swimlanes-42K2YHIH-bD_tUjo6.js +0 -1
  257. package/dist/web/assets/swimlanesDiagram-VR7AAH4N-0wAluWQF.js +0 -8
  258. package/dist/web/assets/tabs-CSlEXoxD.js +0 -1
  259. package/dist/web/assets/useProjectScope-Dk0mjyHf.js +0 -1
  260. package/dist/web/assets/vennDiagram-4TSXK5OY-D0_6bldW.js +0 -34
@@ -1,4 +1,4 @@
1
- import{c as ne,j as e,av as me,aw as ue,r as x,ax as he,ay as fe,az as be,aA as ge,B as _,aB as pe,aC as je,aD as ie,aE as X,aF as ve,aG as ye,aH as Ne,p as b,q as O,s as z,t as H,v as U,w as D,I as w,T as Y,aI as we,aJ as _e,L as oe,aK as ce,G as ke,aL as Se,aM as Ce,aN as Te,aO as Le,e as de,aP as De,aQ as Pe,aR as Ee,aS as Fe,aT as Ae,a8 as Be,a9 as Oe,aa as ze,S as Z,ab as ee,ac as He,y as p,P as Ue,at as $e,al as qe,aU as se,aV as te,D as Ie,m as Me,n as Ge,o as Ve,aW as Re,aX as We,x as Ke}from"./index-C_jtMgr7.js";import{E as xe}from"./ErrorState-BPTepwiG.js";import{C as Je}from"./ConfirmDialog-CrSa87VF.js";import{P as Ye}from"./PriorityBadge-BW-A50LE.js";import{S as Qe}from"./StatusBadge-C5G1fdZh.js";import{a as Xe,f as ae,S as re,s as Ze,b as es,R as ss,L as ts}from"./ResumeActions-DHTOr6GQ.js";import{c as as}from"./useSessions-BrdK-12R.js";import{T as rs}from"./trash-2-D3Ey4I09.js";/**
1
+ import{c as ne,j as e,ay as me,az as ue,r as x,aA as he,aB as fe,aC as be,aD as ge,B as _,aE as pe,aF as je,aG as ie,aH as X,aI as ve,aJ as ye,aK as Ne,p as b,q as O,s as z,t as H,v as U,w as D,I as w,T as J,aL as we,aM as _e,L as oe,aN as ce,H as ke,aO as Se,aP as Ce,aQ as Te,aR as Le,e as de,aS as De,aT as Pe,aU as Ee,aV as Fe,aW as Ae,aj as Be,ak as Oe,al as ze,S as Z,am as ee,an as He,y as p,P as Ue,ag as $e,aw as qe,aX as se,aY as te,D as Ie,m as Me,n as Ve,o as Ge,aZ as Re,a_ as We,x as Ke}from"./index-Ckq9CvHb.js";import{E as xe}from"./ErrorState-CwOWC9Qy.js";import{C as Ye}from"./ConfirmDialog-C_exU7Ga.js";import{P as Je}from"./PriorityBadge-DHoaJR_M.js";import{S as Qe}from"./StatusBadge-Cq2xO_SU.js";import{R as Xe}from"./ResumeActions-RtezaXDE.js";import{c as Ze}from"./useSessions-BL5wWTxP.js";import{b as es,f as ae,S as re,s as ss,c as ts,L as as}from"./live-sessions-C4qBcPbR.js";import{T as rs}from"./trash-2-BOe9xa7a.js";/**
2
2
  * @license lucide-react v1.27.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{c as ne,j as e,av as me,aw as ue,r as x,ax as he,ay as fe,az as be,aA as
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const is=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],os=ne("user-check",is),cs=new Set(["task_id","task_title","project_id","skill_name","required_review","max_review_rounds"]),ds={running:"bg-primary/15 text-primary border-primary/40",completed:"bg-secondary/15 text-secondary border-secondary/40",halted:"bg-error/15 text-error border-error/40",cancelled:"bg-surface-highest text-outline border-outline-variant"},xs={pending:"text-primary",running:"text-primary",awaiting_human:"text-tertiary",succeeded:"text-secondary",failed:"text-error",cancelled:"text-outline",skipped:"text-outline"};function v({children:t,className:d}){return e.jsx("span",{className:`inline-flex px-2 py-0.5 font-label text-xs rounded-md border ${d??"bg-surface-highest border-surface-highest text-on-surface-variant"}`,children:t})}function ms({taskId:t}){const{data:d,isLoading:a}=ue(t),[s,l]=x.useState(null);return a?e.jsx("div",{className:"font-body text-sm text-outline",children:"Loading flow…"}):d?e.jsx(us,{run:d,taskId:t,selectedNodeId:s,onSelectNode:o=>l(r=>r===o?null:o)}):e.jsx("div",{className:"font-body text-sm text-outline","data-testid":"flow-run-empty",children:"No flow has run on this task yet."})}function us({run:t,taskId:d,selectedNodeId:a,onSelectNode:s}){const l=x.useMemo(()=>he(t.definition),[t.definition]),o=x.useMemo(()=>fe(t),[t]),r=x.useMemo(()=>be(t),[t]),m=ge(),[h,c]=x.useState(!1),[f,g]=x.useState(!1),j=Object.entries(t.vars).filter(([u])=>!cs.has(u));return e.jsxs("div",{className:"space-y-4","data-testid":"flow-run-panel","data-flow-status":t.status,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.flow_source==="task"?e.jsx("span",{className:"font-body text-sm text-on-surface truncate","data-testid":"flow-run-name",children:t.flow_name}):e.jsx("button",{type:"button",onClick:()=>g(!0),className:"font-body text-sm text-primary hover:underline truncate","data-testid":"flow-run-name",children:t.flow_name}),e.jsx(v,{children:t.flow_source}),e.jsx(v,{className:ds[t.status],children:t.status})]}),t.status==="running"&&e.jsxs(_,{"data-testid":"flow-halt-button",size:"sm",onClick:()=>c(!0),className:"font-label text-xs bg-error/10 text-error border border-error/30 hover:bg-error/20 min-h-11 sm:min-h-9 px-3",children:[e.jsx(ns,{size:11,className:"mr-1"}),"Halt"]})]}),t.halt_reason&&e.jsxs("div",{className:"p-2 rounded-lg border border-border bg-transparent space-y-0.5","data-testid":"flow-halt-reason","data-halt-reason":t.halt_reason,children:[e.jsxs("div",{className:"font-label text-xs font-medium text-error",children:["Halted: ",t.halt_reason.replace(/_/g," ")]}),t.halt_description&&e.jsx("div",{className:"font-body text-sm text-on-surface-variant",children:t.halt_description})]}),l?e.jsxs("div",{children:[e.jsx(pe,{definition:l,states:o,selectedNodeId:a,onSelectNode:s}),e.jsx(je,{})]}):e.jsx("div",{className:"font-body text-sm text-outline",children:"This run did not record a readable definition, so its graph cannot be drawn."}),r&&e.jsx(hs,{taskId:d,nodeRun:r,definition:l,isHalting:m.isPending}),l&&a&&e.jsx(fs,{definition:l,nodeId:a}),e.jsx(bs,{run:t,selectedNodeId:a,onSelectNode:s}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1",children:[e.jsxs(G,{label:"Executions",children:[t.node_executions,l!=null&&l.limits.max_node_executions?` / ${l.limits.max_node_executions}`:""]}),e.jsx(G,{label:"Elapsed",children:ie(t.started_at,t.ended_at)}),e.jsx(G,{label:"Started",children:X(t.started_at)}),e.jsx(G,{label:"Ended",children:X(t.ended_at)})]}),j.length>0&&e.jsxs("div",{className:"space-y-1","data-testid":"flow-run-vars",children:[e.jsx("div",{className:"font-label text-xs font-medium text-outline",children:"Run vars"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:j.map(([u,S])=>e.jsxs(v,{children:[u,"=",JSON.stringify(S)]},u))})]}),e.jsx(ve,{flowName:f?t.flow_name:null,open:f,onClose:()=>g(!1)}),e.jsx(Je,{open:h,title:"Halt Flow",description:`Stop flow "${t.flow_name}" and kill any live agent sessions for this task? The task keeps its current status.`,confirmLabel:"Halt",variant:"destructive",isPending:m.isPending,onConfirm:()=>m.mutate({taskId:d,reason:"halted from the web dashboard"},{onSuccess:()=>c(!1)}),onCancel:()=>c(!1)})]})}function G({label:t,children:d}){return e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("div",{className:"font-label text-[10px] font-medium text-outline",children:t}),e.jsx("div",{className:"font-body text-sm text-on-surface-variant",children:d})]})}function hs({taskId:t,nodeRun:d,definition:a,isHalting:s}){var g,j;const l=x.useMemo(()=>a?ye(a,d.node_id):[],[a,d.node_id]),o=Ne(),[r,m]=x.useState(l[0]??""),[h,c]=x.useState(""),f=r.trim();return e.jsxs("div",{className:"p-3 rounded-lg border border-border bg-transparent space-y-3","data-testid":"flow-gate-form","data-gate-node":d.node_id,children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-label text-xs font-medium text-tertiary",children:[e.jsx(os,{size:12}),"Waiting for you at “",d.node_id,"”"]}),((g=a==null?void 0:a.nodeById[d.node_id])==null?void 0:g.prompt)&&e.jsx("div",{className:"font-body text-sm text-on-surface whitespace-pre-wrap",children:(j=a.nodeById[d.node_id])==null?void 0:j.prompt}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Outcome"}),l.length>0?e.jsxs(O,{value:r,onValueChange:m,children:[e.jsx(z,{"aria-label":"Outcome","data-testid":"flow-gate-outcome",className:"bg-background border-control-border text-on-surface font-label text-sm min-h-11 sm:min-h-9",children:e.jsx(H,{placeholder:"Pick an outcome"})}),e.jsx(U,{className:"bg-surface-highest border-surface-highest",children:l.map(u=>e.jsx(D,{value:u,className:"font-label text-xs",children:u},u))})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{"aria-label":"Outcome","data-testid":"flow-gate-outcome-input",value:r,onChange:u=>m(u.target.value),placeholder:"e.g. approved",className:"bg-background border-control-border text-on-surface font-body text-sm min-h-11 sm:min-h-9"}),e.jsx("p",{className:"font-body text-sm text-outline",children:"This node routes everything through a catch-all edge, so any outcome continues the flow."})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Comment (posted on the task)"}),e.jsx(Y,{"aria-label":"Comment posted on the task","data-testid":"flow-gate-comment",value:h,onChange:u=>c(u.target.value),placeholder:"Why this outcome…",className:"bg-background border-control-border text-on-surface font-body text-sm resize-none",rows:2})]}),o.error&&e.jsx("div",{className:"font-body text-sm text-error","data-testid":"flow-gate-error",children:o.error.message}),e.jsx("div",{className:"flex justify-end",children:e.jsx(_,{"data-testid":"flow-gate-submit",size:"sm",disabled:o.isPending||s||f.length===0,onClick:()=>o.mutate({taskId:t,outcome:f,...h.trim()?{summary:h.trim()}:{},author:"human"},{onSuccess:()=>c("")}),className:"font-label text-sm bg-primary text-primary-foreground hover:bg-primary/90 min-h-11 sm:min-h-9 px-3",children:o.isPending?"Resuming…":"Resume flow"})})]})}function fs({definition:t,nodeId:d}){const a=t.nodeById[d];if(!a)return null;const s=t.edges.map((l,o)=>({edge:l,index:o})).filter(({edge:l})=>l.from===d);return e.jsxs("div",{className:"p-2 rounded-lg border border-surface-highest bg-surface-highest/30 space-y-2","data-testid":"flow-node-detail","data-node-id":d,children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-body text-sm font-medium text-on-surface",children:a.id}),e.jsx(v,{children:a.kind}),a.skill&&e.jsxs(v,{children:["skill ",a.skill]}),a.role&&e.jsx(v,{children:a.role}),a.task_status&&e.jsxs(v,{children:["sets ",a.task_status]}),a.max_visits!==void 0&&e.jsxs(v,{children:["max ",a.max_visits," visits"]}),a.routing==="all"&&e.jsx(v,{children:"fan out"}),a.join&&e.jsxs(v,{children:["join ",a.join.mode," of ",a.join.from.join(", ")]}),a.on_error&&e.jsxs(v,{children:["on error → ",a.on_error]})]}),a.description&&e.jsx("div",{className:"font-body text-sm text-on-surface-variant",children:a.description}),s.length>0&&e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("div",{className:"font-label text-[10px] font-medium text-outline",children:"Outgoing edges (first match wins)"}),s.map(({edge:l,index:o},r)=>e.jsxs("div",{className:"font-mono text-xs text-on-surface-variant","data-testid":"flow-node-detail-edge",children:[r+1,". → ",l.to," ",e.jsxs("span",{className:"text-outline",children:["when ",we(l.when)]}),l.label&&e.jsxs("span",{className:"text-outline",children:[" (",l.label,")"]})]},o))]})]})}function bs({run:t,selectedNodeId:d,onSelectNode:a}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"font-label text-xs font-medium text-outline",children:["Ledger (",t.nodes.length," ",t.nodes.length===1?"visit":"visits",")"]}),t.nodes.length===0?e.jsx("div",{className:"font-body text-sm text-outline",children:"Nothing has run yet."}):e.jsx("div",{className:"space-y-1",children:t.nodes.map((s,l)=>e.jsxs("div",{onClick:()=>a(s.node_id),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&a(s.node_id)},"data-testid":"flow-ledger-row","data-node-id":s.node_id,"data-node-status":s.status,"data-node-outcome":s.outcome??"",className:`w-full text-left p-2 rounded-lg border transition-colors cursor-pointer ${d===s.node_id?"border-primary/40 bg-primary/5":"border-surface-highest bg-surface-highest/40 hover:bg-surface-highest/70"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-label text-[10px] text-outline",children:l+1}),e.jsx("span",{className:"font-body text-sm text-on-surface",children:s.node_id}),e.jsxs("span",{className:"font-label text-[10px] text-outline",children:["visit ",s.attempt,s.retry>0?` · retry ${s.retry}`:""]}),e.jsx("span",{className:`font-label text-[10px] ${xs[s.status]??"text-outline"}`,children:s.status.replace(/_/g," ")}),s.outcome&&e.jsxs("span",{className:"font-label text-[10px] text-primary",children:["→ ",s.outcome]}),e.jsxs("span",{className:"font-label text-[10px] text-outline ml-auto",children:[ie(s.started_at??s.created_at,s.ended_at),s.started_at===null&&_e(s.status)?" waiting":""]})]}),s.summary&&e.jsx("div",{className:"font-body text-sm text-on-surface-variant mt-1 whitespace-pre-wrap",children:s.summary}),s.error&&e.jsx("div",{className:"font-body text-sm text-error mt-1 whitespace-pre-wrap",children:s.error}),s.gateway_session_id&&e.jsxs(oe,{to:`/sessions/${s.gateway_session_id}`,onClick:o=>o.stopPropagation(),className:"font-mono text-xs text-primary hover:underline mt-1 inline-block","data-testid":"flow-ledger-session-link",children:["session ",s.gateway_session_id.slice(-8)]})]},`${s.node_id}-${s.attempt}-${s.retry}`))})]})}function gs({children:t}){return e.jsxs("div",{className:"flex items-center gap-1.5 font-label text-xs font-medium text-outline",children:[e.jsx(me,{size:12}),"Flow",t]})}const L=["git_repo","git_branch","git_worktree","github_issue","github_pr"],le={git_repo:"Repository folder",git_branch:"Branch",git_worktree:"Worktree folder",github_issue:"GitHub issue URL",github_pr:"GitHub PR URL"};function ps({task:t}){const[d,a]=x.useState(!1),[s,l]=x.useState(()=>Object.fromEntries(L.map(r=>[r,t[r]??""]))),o=ce();return e.jsxs("section",{"data-testid":"task-git-links",className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("strong",{children:"Git / GitHub"}),e.jsx("button",{type:"button","data-testid":"task-git-edit",onClick:()=>{l(Object.fromEntries(L.map(r=>[r,t[r]??""]))),a(!d)},children:"Edit links"})]}),d?e.jsxs("form",{onSubmit:r=>{r.preventDefault(),o.mutate({id:t.id,...Object.fromEntries(L.map(m=>[m,s[m].trim()||null]))},{onSuccess:()=>a(!1)})},className:"space-y-2",children:[L.map(r=>e.jsxs("label",{className:"block",children:[le[r],e.jsx("input",{"data-testid":`task-link-${r}`,className:"w-full bg-surface-highest p-2",value:s[r],onChange:m=>l({...s,[r]:m.target.value})})]},r)),e.jsx("button",{type:"submit","data-testid":"task-git-save",disabled:o.isPending,className:"text-primary",children:"Save links"}),o.error&&e.jsx("p",{role:"alert",children:o.error.message})]}):e.jsxs("div",{className:"space-y-1",children:[L.map(r=>t[r]?e.jsxs("p",{className:"break-all",children:[le[r],":"," ",r.startsWith("github_")?e.jsx("a",{href:t[r]??"",target:"_blank",rel:"noreferrer",className:"text-primary",children:t[r]}):t[r]]},r):null),!L.some(r=>t[r])&&e.jsx("p",{className:"text-outline",children:"No links yet. Link a checkout from its terminal Git panel, or edit here."})]})]})}function js({taskId:t}){const[d]=ke(),{data:a,isLoading:s,error:l,refetch:o}=as(t),r=(a??[]).filter(c=>c.tokens_used!=null),m=r.reduce((c,f)=>c+(f.tokens_used??0),0),h=(a??[]).map(c=>c.last_activity_at??"").sort().pop();return e.jsxs("div",{className:"border-t border-surface-highest pt-4 space-y-3","data-testid":"task-sessions",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-label text-xs text-outline",children:[e.jsx(Se,{size:12}),"Agent sessions",a&&a.length>0&&e.jsxs("span",{className:"font-body text-xs normal-case tracking-normal text-on-surface-variant",children:[" ","· ",a.length," ·"," ",Xe(m,r.some(c=>c.tokens_estimated))," ","tokens · last active ",ae(h??null)]})]}),l?e.jsx(xe,{message:l.message,onRetry:()=>o()}):s?e.jsx("p",{role:"status",className:"text-sm text-outline",children:"Loading agent sessions…"}):!a||a.length===0?e.jsx("div",{className:"font-body text-xs text-outline",children:"No session yet. Add a session: line with the session id to the task body, or pick the task on the Sessions page."}):e.jsx("div",{className:"space-y-1",children:a.map(c=>e.jsxs("div",{"data-testid":"task-session-row",className:"flex flex-wrap items-center gap-3 px-2 py-2 rounded-lg",children:[e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${re[c.status].dot}`,title:re[c.status].label}),e.jsx("span",{className:"font-label text-xs text-primary w-14 shrink-0",children:c.agent}),e.jsx(oe,{to:Ze(`/sessions?session=${encodeURIComponent(c.id)}`,d.get("project")??c.project_id),"data-testid":"task-session-link",className:"flex-1 min-w-0 truncate font-body text-xs text-on-surface hover:text-primary",title:c.name??void 0,children:c.name??c.session_id}),e.jsx("span",{className:"font-label text-xs text-outline shrink-0",children:es(c)}),e.jsx("span",{className:"font-label text-xs text-outline shrink-0",children:ae(c.last_activity_at)}),e.jsx(ss,{session:c})]},c.id))})]})}const vs=["todo","doing","review","blocked","done"],ys=["low","normal","high","critical"],Ns=["blocks","blocked_by","relates_to","duplicates","clones","subtask_of","parent_of"];function Es({taskId:t,open:d,onOpenChange:a}){var Q;const{data:s,isLoading:l,error:o,refetch:r}=Ce(t),{data:m}=Te(t),{data:h}=Le(t),{data:c}=de(),f=De(),g=Pe(),j=Ee(),[u,S]=x.useState(""),[P,V]=x.useState("human"),[$,E]=x.useState(!1),[k,F]=x.useState(""),[C,R]=x.useState("relates_to"),[A,q]=x.useState(!1),I=()=>{!t||!u.trim()||f.mutate({id:t,content:u.trim(),author:P||"human"},{onSuccess:()=>{S("")}})},W=()=>{!t||!k.trim()||g.mutate({id:t,to_task_id:k.trim(),link_type:C},{onSuccess:()=>{F(""),E(!1)}})},B=x.useMemo(()=>h?h.reduce((i,N)=>{const y=N.link_type;return i[y]||(i[y]=[]),i[y].push(N),i},{}):{},[h]),K=Fe(s??{}),M=Ae(s??{}),n=x.useMemo(()=>{var i;return!(s!=null&&s.project_id)||!c?null:((i=c.find(N=>N.id===s.project_id))==null?void 0:i.name)??s.project_id.slice(-6)},[s==null?void 0:s.project_id,c]),T=i=>i?new Date(i).toLocaleString():"-",J=i=>i?new Date(i)<new Date:!1;return e.jsxs(e.Fragment,{children:[e.jsx(Be,{open:d,onOpenChange:a,children:e.jsxs(Oe,{"data-testid":"task-detail-sheet",className:"w-[620px] max-w-[92vw]",children:[e.jsx(ze,{children:l?e.jsx(Z,{className:"h-5 w-48 bg-surface-highest"}):s?e.jsxs("div",{className:"space-y-2 pr-6",children:[e.jsx(ee,{children:s.title}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qe,{status:s.status}),e.jsx(Ye,{priority:s.priority})]})]}):e.jsx(ee,{children:"Task not found"})}),e.jsxs(He,{children:[(f.error||g.error||j.error)&&e.jsx("p",{role:"alert",className:"mb-4 text-sm text-error",children:(Q=f.error??g.error??j.error)==null?void 0:Q.message}),o?e.jsx(xe,{message:o.message,onRetry:()=>r()}):l?e.jsx("div",{className:"space-y-4",children:Array.from({length:6}).map((i,N)=>e.jsx(Z,{className:"h-8 w-full bg-surface-highest"},N))}):s?e.jsxs("div",{className:"space-y-6",children:[e.jsx(ps,{task:s},s.id),s.body&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"font-label text-xs font-medium text-outline",children:"Body"}),e.jsx("div",{className:"font-body text-sm text-on-surface whitespace-pre-wrap break-words bg-transparent p-3 rounded-lg border border-border",children:s.body})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(p,{label:"ID",children:e.jsx("span",{className:"font-mono text-xs break-all",children:s.id})}),e.jsx(p,{label:"Author",children:s.author}),e.jsx(p,{label:"Claimed By",children:s.claimed_by??"-"}),e.jsx(p,{label:"Project",children:n??"-"}),e.jsx(p,{label:"Skill",children:s.skill_name??"-"}),e.jsxs(p,{label:"Agent Backend",children:[e.jsx("span",{"data-testid":"task-backend-name",children:M.label}),M.available===!1&&e.jsxs("span",{className:"text-error",title:"This backend is not usable right now",children:[" ","○"]})]}),e.jsx(p,{label:"Flow",children:e.jsx("span",{"data-testid":"task-flow-name",children:K.label})}),e.jsx(p,{label:"Required Review",children:s.required_review?"Yes":"No"}),e.jsx(p,{label:"Max Review Rounds",children:s.max_review_rounds}),e.jsx(p,{label:"Due",children:e.jsx("span",{className:J(s.due_at)&&s.status!=="done"?"text-error":"",children:T(s.due_at)})}),e.jsx(p,{label:"Created",children:T(s.created_at)}),e.jsx(p,{label:"Updated",children:T(s.updated_at)})]}),s.progress>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"font-label text-xs font-medium text-outline",children:"Progress"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-2 bg-surface-highest rounded-lg overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary rounded-lg transition-all",style:{width:`${Math.min(100,s.progress)}%`}})}),e.jsxs("span",{className:"font-label text-xs text-outline",children:[s.progress,"%"]})]})]}),s.tags&&s.tags.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"font-label text-xs font-medium text-outline",children:"Tags"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:s.tags.map(i=>e.jsx("span",{className:"px-2 py-0.5 text-xs font-label bg-primary/10 text-primary border border-primary/20 rounded-lg",children:i},i))})]}),e.jsx(js,{taskId:s.id}),e.jsxs("div",{className:"border-t border-surface-highest pt-4 space-y-3",children:[e.jsx(gs,{}),e.jsx(ms,{taskId:s.id})]}),e.jsxs("div",{className:"border-t border-surface-highest pt-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-label text-xs font-medium text-outline",children:[e.jsx(ts,{size:12}),"Links"]}),e.jsx("button",{type:"button",onClick:()=>E(!0),className:"text-primary hover:text-primary/80 transition-colors",children:e.jsx(Ue,{size:14})})]}),h&&h.length>0?e.jsx("div",{className:"space-y-2",children:Object.entries(B).map(([i,N])=>e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"font-label text-[10px] font-medium text-outline",children:i.replace(/_/g," ")}),N.map(y=>e.jsxs("div",{className:"flex items-center justify-between px-2 py-1 bg-surface-highest/50 rounded-lg",children:[e.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:y.from_task_id===t?y.to_task_id.slice(-6):y.from_task_id.slice(-6)}),e.jsx("button",{type:"button",onClick:()=>j.mutate({taskId:t,linkId:y.id}),className:"text-outline hover:text-error transition-colors p-0.5",children:e.jsx(rs,{size:10})})]},y.id))]},i))}):e.jsx("div",{className:"font-body text-sm text-outline",children:"No links"}),$&&e.jsxs("div",{className:"space-y-2 p-2 bg-surface-highest/30 rounded-lg border border-surface-highest",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Link Type"}),e.jsxs(O,{value:C,onValueChange:i=>R(i),children:[e.jsx(z,{className:"bg-background border-control-border text-on-surface font-label text-xs h-7",children:e.jsx(H,{})}),e.jsx(U,{className:"bg-surface-highest border-surface-highest",children:Ns.map(i=>e.jsx(D,{value:i,className:"font-label text-xs",children:i.replace(/_/g," ")},i))})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Target Task ID"}),e.jsx(w,{value:k,onChange:i=>F(i.target.value),placeholder:"Task ID...",className:"bg-background border-control-border text-on-surface font-body text-sm h-7"})]})]}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx(_,{type:"button",variant:"ghost",size:"sm",onClick:()=>{E(!1),F("")},className:"font-label text-xs text-outline h-6 px-2",children:"Cancel"}),e.jsx(_,{size:"sm",onClick:W,disabled:g.isPending||!k.trim(),className:"font-label text-xs bg-primary text-primary-foreground hover:bg-primary/90 h-6 px-2",children:"Add"})]})]})]}),e.jsxs("div",{className:"border-t border-surface-highest pt-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-label text-xs font-medium text-outline",children:[e.jsx($e,{size:12}),"Comments (",(m==null?void 0:m.length)??0,")"]}),m&&m.length>0&&e.jsx("div",{className:"space-y-2",children:m.map(i=>e.jsxs("div",{className:"py-2 border-b border-border space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-label text-xs text-primary",children:i.author}),e.jsx("span",{className:"font-label text-[10px] text-outline",children:new Date(i.created_at).toLocaleString()})]}),e.jsx("div",{className:"font-body text-sm text-on-surface whitespace-pre-wrap break-words",children:i.content})]},i.id))}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(w,{"aria-label":"Comment author",value:P,onChange:i=>V(i.target.value),placeholder:"Author",className:"bg-background border-control-border text-on-surface font-body text-sm h-7 w-24"}),e.jsx(Y,{value:u,onChange:i=>S(i.target.value),placeholder:"Add a comment...",className:"bg-background border-control-border text-on-surface font-body text-sm resize-none flex-1",rows:2})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(_,{"data-testid":"task-comment-submit",size:"sm",onClick:I,disabled:f.isPending||!u.trim(),className:"font-label text-xs bg-primary text-primary-foreground hover:bg-primary/90 h-6 px-2",children:f.isPending?"...":"Comment"})})]})]})]}):e.jsx("div",{className:"text-outline font-label text-xs font-medium text-center py-8",children:"Task not found"})]}),s&&e.jsx(qe,{children:e.jsx(_,{size:"sm",onClick:()=>q(!0),className:"font-label text-xs font-medium bg-transparent text-on-surface border border-control-border hover:bg-surface",children:"Edit task"})})]})}),s&&A&&e.jsx(ws,{task:s,open:A,onClose:()=>q(!1)})]})}function ws({task:t,open:d,onClose:a}){const{data:s}=de(),l=ce(),[o,r]=x.useState(t.title),[m,h]=x.useState(t.body??""),[c,f]=x.useState(t.status),[g,j]=x.useState(t.priority),[u,S]=x.useState(t.due_at??""),[P,V]=x.useState((t.tags??[]).join(", ")),[$,E]=x.useState(t.project_id??""),[k,F]=x.useState(t.skill_name??""),[C,R]=x.useState(t.agent_backend??se),[A,q]=x.useState(t.required_review),[I,W]=x.useState(String(t.max_review_rounds)),[B,K]=x.useState(t.flow_name??te),M=n=>{if(n.preventDefault(),!o.trim())return;const T=P.split(",").map(J=>J.trim()).filter(Boolean);l.mutate({id:t.id,title:o.trim(),body:m.trim()||null,status:c,priority:g,due_at:u||null,tags:T.length>0?T:null,project_id:$||null,skill_name:k||null,agent_backend:C===se?null:C,required_review:A,max_review_rounds:Number(I)||3,...t.flow_override?{}:{flow_name:B===te?null:B}},{onSuccess:()=>a()})};return e.jsx(Ie,{open:d,onOpenChange:n=>!n&&a(),children:e.jsxs(Me,{"data-testid":"edit-task-dialog",className:"bg-surface-high border-border max-w-lg max-h-[85vh] overflow-y-auto",children:[e.jsx(Ge,{children:e.jsx(Ve,{className:"font-headline text-sm font-medium text-on-surface",children:"Edit task"})}),e.jsxs("form",{onSubmit:M,className:"space-y-4 mt-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Title *"}),e.jsx(w,{"aria-label":"Title","data-testid":"edit-task-title",value:o,onChange:n=>r(n.target.value),className:"bg-background border-control-border text-on-surface font-body text-sm"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Body"}),e.jsx(Y,{"aria-label":"Body",value:m,onChange:n=>h(n.target.value),className:"bg-background border-control-border text-on-surface font-body text-sm resize-none",rows:4})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Status"}),e.jsxs(O,{value:c,onValueChange:n=>f(n),children:[e.jsx(z,{"aria-label":"Status",className:"bg-background border-control-border text-on-surface font-label text-xs",children:e.jsx(H,{})}),e.jsx(U,{className:"bg-surface-highest border-surface-highest",children:vs.map(n=>e.jsx(D,{value:n,className:"font-label text-xs",children:n.replace(/_/g," ")},n))})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Priority"}),e.jsxs(O,{value:g,onValueChange:n=>j(n),children:[e.jsx(z,{"aria-label":"Priority",className:"bg-background border-control-border text-on-surface font-label text-xs",children:e.jsx(H,{})}),e.jsx(U,{className:"bg-surface-highest border-surface-highest",children:ys.map(n=>e.jsx(D,{value:n,className:"font-label text-xs",children:n},n))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Due date"}),e.jsx(w,{type:"datetime-local",value:u?u.slice(0,16):"",onChange:n=>S(n.target.value?new Date(n.target.value).toISOString():""),className:"bg-background border-control-border text-on-surface font-body text-sm"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Project"}),e.jsxs(O,{value:$||"__none__",onValueChange:n=>E(n==="__none__"?"":n),children:[e.jsx(z,{"aria-label":"Project",className:"bg-background border-control-border text-on-surface font-label text-xs",children:e.jsx(H,{})}),e.jsxs(U,{className:"bg-surface-highest border-surface-highest",children:[e.jsx(D,{value:"__none__",className:"font-label text-xs",children:"None"}),s==null?void 0:s.map(n=>e.jsx(D,{value:n.id,className:"font-label text-xs",children:n.name},n.id))]})]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Tags (comma-separated)"}),e.jsx(w,{"aria-label":"Tags",value:P,onChange:n=>V(n.target.value),placeholder:"tag1, tag2",className:"bg-background border-control-border text-on-surface font-body text-sm"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Skill Name"}),e.jsx(w,{"aria-label":"Skill override",value:k,onChange:n=>F(n.target.value),placeholder:"e.g. code-review",className:"bg-background border-control-border text-on-surface font-body text-sm"})]}),e.jsx(Re,{value:C,onChange:R,testId:"edit-task-backend"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5 flex items-center gap-2 pt-4",children:[e.jsx("input",{type:"checkbox",id:"edit-required-review",checked:A,onChange:n=>q(n.target.checked),className:"accent-primary"}),e.jsx(b,{htmlFor:"edit-required-review",className:"font-label text-xs font-medium text-outline cursor-pointer",children:"Required Review"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Max Review Rounds"}),e.jsx(w,{type:"number",value:I,onChange:n=>W(n.target.value),min:1,className:"bg-background border-control-border text-on-surface font-body text-sm"})]})]}),t.flow_override?e.jsxs("p",{className:"font-body text-sm text-outline","data-testid":"task-flow-override-note",children:["This task carries an inline flow definition (flow_override), which beats any named flow. Detach it with ",e.jsx("code",{children:"orc flow attach"})," to use a named flow instead."]}):e.jsx(We,{value:B,onChange:K,testId:"edit-task-flow"}),e.jsxs(Ke,{children:[e.jsx(_,{type:"button",variant:"ghost",size:"sm",onClick:a,className:"font-label text-xs text-outline",children:"Cancel"}),e.jsx(_,{"data-testid":"edit-task-submit",type:"submit",size:"sm",disabled:l.isPending||!o.trim(),className:"font-label text-xs bg-primary text-primary-foreground hover:bg-primary/90",children:l.isPending?"Saving...":"Save"})]})]})]})})}export{Es as T};
11
+ */const is=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],os=ne("user-check",is),cs=new Set(["task_id","task_title","project_id","skill_name","required_review","max_review_rounds"]),ds={running:"bg-primary/15 text-primary border-primary/40",completed:"bg-secondary/15 text-secondary border-secondary/40",halted:"bg-error/15 text-error border-error/40",cancelled:"bg-surface-highest text-outline border-outline-variant"},xs={pending:"text-primary",running:"text-primary",awaiting_human:"text-tertiary",succeeded:"text-secondary",failed:"text-error",cancelled:"text-outline",skipped:"text-outline"};function v({children:t,className:d}){return e.jsx("span",{className:`inline-flex px-2 py-0.5 font-label text-xs rounded-md border ${d??"bg-surface-highest border-surface-highest text-on-surface-variant"}`,children:t})}function ms({taskId:t}){const{data:d,isLoading:a}=ue(t),[s,l]=x.useState(null);return a?e.jsx("div",{className:"font-body text-sm text-outline",children:"Loading flow…"}):d?e.jsx(us,{run:d,taskId:t,selectedNodeId:s,onSelectNode:o=>l(r=>r===o?null:o)}):e.jsx("div",{className:"font-body text-sm text-outline","data-testid":"flow-run-empty",children:"No flow has run on this task yet."})}function us({run:t,taskId:d,selectedNodeId:a,onSelectNode:s}){const l=x.useMemo(()=>he(t.definition),[t.definition]),o=x.useMemo(()=>fe(t),[t]),r=x.useMemo(()=>be(t),[t]),m=ge(),[h,c]=x.useState(!1),[f,g]=x.useState(!1),j=Object.entries(t.vars).filter(([u])=>!cs.has(u));return e.jsxs("div",{className:"space-y-4","data-testid":"flow-run-panel","data-flow-status":t.status,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.flow_source==="task"?e.jsx("span",{className:"font-body text-sm text-on-surface truncate","data-testid":"flow-run-name",children:t.flow_name}):e.jsx("button",{type:"button",onClick:()=>g(!0),className:"font-body text-sm text-primary hover:underline truncate","data-testid":"flow-run-name",children:t.flow_name}),e.jsx(v,{children:t.flow_source}),e.jsx(v,{className:ds[t.status],children:t.status})]}),t.status==="running"&&e.jsxs(_,{"data-testid":"flow-halt-button",size:"sm",onClick:()=>c(!0),className:"font-label text-xs bg-error/10 text-error border border-error/30 hover:bg-error/20 min-h-11 sm:min-h-9 px-3",children:[e.jsx(ns,{size:11,className:"mr-1"}),"Halt"]})]}),t.halt_reason&&e.jsxs("div",{className:"p-2 rounded-lg border border-border bg-transparent space-y-0.5","data-testid":"flow-halt-reason","data-halt-reason":t.halt_reason,children:[e.jsxs("div",{className:"font-label text-xs font-medium text-error",children:["Halted: ",t.halt_reason.replace(/_/g," ")]}),t.halt_description&&e.jsx("div",{className:"font-body text-sm text-on-surface-variant",children:t.halt_description})]}),l?e.jsxs("div",{children:[e.jsx(pe,{definition:l,states:o,selectedNodeId:a,onSelectNode:s}),e.jsx(je,{})]}):e.jsx("div",{className:"font-body text-sm text-outline",children:"This run did not record a readable definition, so its graph cannot be drawn."}),r&&e.jsx(hs,{taskId:d,nodeRun:r,definition:l,isHalting:m.isPending}),l&&a&&e.jsx(fs,{definition:l,nodeId:a}),e.jsx(bs,{run:t,selectedNodeId:a,onSelectNode:s}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1",children:[e.jsxs(V,{label:"Executions",children:[t.node_executions,l!=null&&l.limits.max_node_executions?` / ${l.limits.max_node_executions}`:""]}),e.jsx(V,{label:"Elapsed",children:ie(t.started_at,t.ended_at)}),e.jsx(V,{label:"Started",children:X(t.started_at)}),e.jsx(V,{label:"Ended",children:X(t.ended_at)})]}),j.length>0&&e.jsxs("div",{className:"space-y-1","data-testid":"flow-run-vars",children:[e.jsx("div",{className:"font-label text-xs font-medium text-outline",children:"Run vars"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:j.map(([u,S])=>e.jsxs(v,{children:[u,"=",JSON.stringify(S)]},u))})]}),e.jsx(ve,{flowName:f?t.flow_name:null,open:f,onClose:()=>g(!1)}),e.jsx(Ye,{open:h,title:"Halt Flow",description:`Stop flow "${t.flow_name}" and kill any live agent sessions for this task? The task keeps its current status.`,confirmLabel:"Halt",variant:"destructive",isPending:m.isPending,onConfirm:()=>m.mutate({taskId:d,reason:"halted from the web dashboard"},{onSuccess:()=>c(!1)}),onCancel:()=>c(!1)})]})}function V({label:t,children:d}){return e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("div",{className:"font-label text-[10px] font-medium text-outline",children:t}),e.jsx("div",{className:"font-body text-sm text-on-surface-variant",children:d})]})}function hs({taskId:t,nodeRun:d,definition:a,isHalting:s}){var g,j;const l=x.useMemo(()=>a?ye(a,d.node_id):[],[a,d.node_id]),o=Ne(),[r,m]=x.useState(l[0]??""),[h,c]=x.useState(""),f=r.trim();return e.jsxs("div",{className:"p-3 rounded-lg border border-border bg-transparent space-y-3","data-testid":"flow-gate-form","data-gate-node":d.node_id,children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-label text-xs font-medium text-tertiary",children:[e.jsx(os,{size:12}),"Waiting for you at “",d.node_id,"”"]}),((g=a==null?void 0:a.nodeById[d.node_id])==null?void 0:g.prompt)&&e.jsx("div",{className:"font-body text-sm text-on-surface whitespace-pre-wrap",children:(j=a.nodeById[d.node_id])==null?void 0:j.prompt}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Outcome"}),l.length>0?e.jsxs(O,{value:r,onValueChange:m,children:[e.jsx(z,{"aria-label":"Outcome","data-testid":"flow-gate-outcome",className:"bg-background border-control-border text-on-surface font-label text-sm min-h-11 sm:min-h-9",children:e.jsx(H,{placeholder:"Pick an outcome"})}),e.jsx(U,{className:"bg-surface-highest border-surface-highest",children:l.map(u=>e.jsx(D,{value:u,className:"font-label text-xs",children:u},u))})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{"aria-label":"Outcome","data-testid":"flow-gate-outcome-input",value:r,onChange:u=>m(u.target.value),placeholder:"e.g. approved",className:"bg-background border-control-border text-on-surface font-body text-sm min-h-11 sm:min-h-9"}),e.jsx("p",{className:"font-body text-sm text-outline",children:"This node routes everything through a catch-all edge, so any outcome continues the flow."})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Comment (posted on the task)"}),e.jsx(J,{"aria-label":"Comment posted on the task","data-testid":"flow-gate-comment",value:h,onChange:u=>c(u.target.value),placeholder:"Why this outcome…",className:"bg-background border-control-border text-on-surface font-body text-sm resize-none",rows:2})]}),o.error&&e.jsx("div",{className:"font-body text-sm text-error","data-testid":"flow-gate-error",children:o.error.message}),e.jsx("div",{className:"flex justify-end",children:e.jsx(_,{"data-testid":"flow-gate-submit",size:"sm",disabled:o.isPending||s||f.length===0,onClick:()=>o.mutate({taskId:t,outcome:f,...h.trim()?{summary:h.trim()}:{},author:"human"},{onSuccess:()=>c("")}),className:"font-label text-sm bg-primary text-primary-foreground hover:bg-primary/90 min-h-11 sm:min-h-9 px-3",children:o.isPending?"Resuming…":"Resume flow"})})]})}function fs({definition:t,nodeId:d}){const a=t.nodeById[d];if(!a)return null;const s=t.edges.map((l,o)=>({edge:l,index:o})).filter(({edge:l})=>l.from===d);return e.jsxs("div",{className:"p-2 rounded-lg border border-surface-highest bg-surface-highest/30 space-y-2","data-testid":"flow-node-detail","data-node-id":d,children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-body text-sm font-medium text-on-surface",children:a.id}),e.jsx(v,{children:a.kind}),a.skill&&e.jsxs(v,{children:["skill ",a.skill]}),a.role&&e.jsx(v,{children:a.role}),a.task_status&&e.jsxs(v,{children:["sets ",a.task_status]}),a.max_visits!==void 0&&e.jsxs(v,{children:["max ",a.max_visits," visits"]}),a.routing==="all"&&e.jsx(v,{children:"fan out"}),a.join&&e.jsxs(v,{children:["join ",a.join.mode," of ",a.join.from.join(", ")]}),a.on_error&&e.jsxs(v,{children:["on error → ",a.on_error]})]}),a.description&&e.jsx("div",{className:"font-body text-sm text-on-surface-variant",children:a.description}),s.length>0&&e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("div",{className:"font-label text-[10px] font-medium text-outline",children:"Outgoing edges (first match wins)"}),s.map(({edge:l,index:o},r)=>e.jsxs("div",{className:"font-mono text-xs text-on-surface-variant","data-testid":"flow-node-detail-edge",children:[r+1,". → ",l.to," ",e.jsxs("span",{className:"text-outline",children:["when ",we(l.when)]}),l.label&&e.jsxs("span",{className:"text-outline",children:[" (",l.label,")"]})]},o))]})]})}function bs({run:t,selectedNodeId:d,onSelectNode:a}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"font-label text-xs font-medium text-outline",children:["Ledger (",t.nodes.length," ",t.nodes.length===1?"visit":"visits",")"]}),t.nodes.length===0?e.jsx("div",{className:"font-body text-sm text-outline",children:"Nothing has run yet."}):e.jsx("div",{className:"space-y-1",children:t.nodes.map((s,l)=>e.jsxs("div",{onClick:()=>a(s.node_id),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&a(s.node_id)},"data-testid":"flow-ledger-row","data-node-id":s.node_id,"data-node-status":s.status,"data-node-outcome":s.outcome??"",className:`w-full text-left p-2 rounded-lg border transition-colors cursor-pointer ${d===s.node_id?"border-primary/40 bg-primary/5":"border-surface-highest bg-surface-highest/40 hover:bg-surface-highest/70"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-label text-[10px] text-outline",children:l+1}),e.jsx("span",{className:"font-body text-sm text-on-surface",children:s.node_id}),e.jsxs("span",{className:"font-label text-[10px] text-outline",children:["visit ",s.attempt,s.retry>0?` · retry ${s.retry}`:""]}),e.jsx("span",{className:`font-label text-[10px] ${xs[s.status]??"text-outline"}`,children:s.status.replace(/_/g," ")}),s.outcome&&e.jsxs("span",{className:"font-label text-[10px] text-primary",children:["→ ",s.outcome]}),e.jsxs("span",{className:"font-label text-[10px] text-outline ml-auto",children:[ie(s.started_at??s.created_at,s.ended_at),s.started_at===null&&_e(s.status)?" waiting":""]})]}),s.summary&&e.jsx("div",{className:"font-body text-sm text-on-surface-variant mt-1 whitespace-pre-wrap",children:s.summary}),s.error&&e.jsx("div",{className:"font-body text-sm text-error mt-1 whitespace-pre-wrap",children:s.error}),s.gateway_session_id&&e.jsxs(oe,{to:`/sessions/${s.gateway_session_id}`,onClick:o=>o.stopPropagation(),className:"font-mono text-xs text-primary hover:underline mt-1 inline-block","data-testid":"flow-ledger-session-link",children:["session ",s.gateway_session_id.slice(-8)]})]},`${s.node_id}-${s.attempt}-${s.retry}`))})]})}function gs({children:t}){return e.jsxs("div",{className:"flex items-center gap-1.5 font-label text-xs font-medium text-outline",children:[e.jsx(me,{size:12}),"Flow",t]})}const L=["git_repo","git_branch","git_worktree","github_issue","github_pr"],le={git_repo:"Repository folder",git_branch:"Branch",git_worktree:"Worktree folder",github_issue:"GitHub issue URL",github_pr:"GitHub PR URL"};function ps({task:t}){const[d,a]=x.useState(!1),[s,l]=x.useState(()=>Object.fromEntries(L.map(r=>[r,t[r]??""]))),o=ce();return e.jsxs("section",{"data-testid":"task-git-links",className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("strong",{children:"Git / GitHub"}),e.jsx("button",{type:"button","data-testid":"task-git-edit",onClick:()=>{l(Object.fromEntries(L.map(r=>[r,t[r]??""]))),a(!d)},children:"Edit links"})]}),d?e.jsxs("form",{onSubmit:r=>{r.preventDefault(),o.mutate({id:t.id,...Object.fromEntries(L.map(m=>[m,s[m].trim()||null]))},{onSuccess:()=>a(!1)})},className:"space-y-2",children:[L.map(r=>e.jsxs("label",{className:"block",children:[le[r],e.jsx("input",{"data-testid":`task-link-${r}`,className:"w-full bg-surface-highest p-2",value:s[r],onChange:m=>l({...s,[r]:m.target.value})})]},r)),e.jsx("button",{type:"submit","data-testid":"task-git-save",disabled:o.isPending,className:"text-primary",children:"Save links"}),o.error&&e.jsx("p",{role:"alert",children:o.error.message})]}):e.jsxs("div",{className:"space-y-1",children:[L.map(r=>t[r]?e.jsxs("p",{className:"break-all",children:[le[r],":"," ",r.startsWith("github_")?e.jsx("a",{href:t[r]??"",target:"_blank",rel:"noreferrer",className:"text-primary",children:t[r]}):t[r]]},r):null),!L.some(r=>t[r])&&e.jsx("p",{className:"text-outline",children:"No links yet. Link a checkout from its terminal Git panel, or edit here."})]})]})}function js({taskId:t}){const[d]=ke(),{data:a,isLoading:s,error:l,refetch:o}=Ze(t),r=(a??[]).filter(c=>c.tokens_used!=null),m=r.reduce((c,f)=>c+(f.tokens_used??0),0),h=(a??[]).map(c=>c.last_activity_at??"").sort().pop();return e.jsxs("div",{className:"border-t border-surface-highest pt-4 space-y-3","data-testid":"task-sessions",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-label text-xs text-outline",children:[e.jsx(Se,{size:12}),"Agent sessions",a&&a.length>0&&e.jsxs("span",{className:"font-body text-xs normal-case tracking-normal text-on-surface-variant",children:[" ","· ",a.length," ·"," ",es(m,r.some(c=>c.tokens_estimated))," ","tokens · last active ",ae(h??null)]})]}),l?e.jsx(xe,{message:l.message,onRetry:()=>o()}):s?e.jsx("p",{role:"status",className:"text-sm text-outline",children:"Loading agent sessions…"}):!a||a.length===0?e.jsx("div",{className:"font-body text-xs text-outline",children:"No session yet. Add a session: line with the session id to the task body, or pick the task on the Sessions page."}):e.jsx("div",{className:"space-y-1",children:a.map(c=>e.jsxs("div",{"data-testid":"task-session-row",className:"flex flex-wrap items-center gap-3 px-2 py-2 rounded-lg",children:[e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${re[c.status].dot}`,title:re[c.status].label}),e.jsx("span",{className:"font-label text-xs text-primary w-14 shrink-0",children:c.agent}),e.jsx(oe,{to:ss(`/sessions?session=${encodeURIComponent(c.id)}`,d.get("project")??c.project_id),"data-testid":"task-session-link",className:"flex-1 min-w-0 truncate font-body text-xs text-on-surface hover:text-primary",title:c.name??void 0,children:c.name??c.session_id}),e.jsx("span",{className:"font-label text-xs text-outline shrink-0",children:ts(c)}),e.jsx("span",{className:"font-label text-xs text-outline shrink-0",children:ae(c.last_activity_at)}),e.jsx(Xe,{session:c})]},c.id))})]})}const vs=["todo","doing","review","blocked","done"],ys=["low","normal","high","critical"],Ns=["blocks","blocked_by","relates_to","duplicates","clones","subtask_of","parent_of"];function Fs({taskId:t,open:d,onOpenChange:a}){var Q;const{data:s,isLoading:l,error:o,refetch:r}=Ce(t),{data:m}=Te(t),{data:h}=Le(t),{data:c}=de(),f=De(),g=Pe(),j=Ee(),[u,S]=x.useState(""),[P,G]=x.useState("human"),[$,E]=x.useState(!1),[k,F]=x.useState(""),[C,R]=x.useState("relates_to"),[A,q]=x.useState(!1),I=()=>{!t||!u.trim()||f.mutate({id:t,content:u.trim(),author:P||"human"},{onSuccess:()=>{S("")}})},W=()=>{!t||!k.trim()||g.mutate({id:t,to_task_id:k.trim(),link_type:C},{onSuccess:()=>{F(""),E(!1)}})},B=x.useMemo(()=>h?h.reduce((i,N)=>{const y=N.link_type;return i[y]||(i[y]=[]),i[y].push(N),i},{}):{},[h]),K=Fe(s??{}),M=Ae(s??{}),n=x.useMemo(()=>{var i;return!(s!=null&&s.project_id)||!c?null:((i=c.find(N=>N.id===s.project_id))==null?void 0:i.name)??s.project_id.slice(-6)},[s==null?void 0:s.project_id,c]),T=i=>i?new Date(i).toLocaleString():"-",Y=i=>i?new Date(i)<new Date:!1;return e.jsxs(e.Fragment,{children:[e.jsx(Be,{open:d,onOpenChange:a,children:e.jsxs(Oe,{"data-testid":"task-detail-sheet",className:"w-[620px] max-w-[92vw]",children:[e.jsx(ze,{children:l?e.jsx(Z,{className:"h-5 w-48 bg-surface-highest"}):s?e.jsxs("div",{className:"space-y-2 pr-6",children:[e.jsx(ee,{children:s.title}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qe,{status:s.status}),e.jsx(Je,{priority:s.priority})]})]}):e.jsx(ee,{children:"Task not found"})}),e.jsxs(He,{children:[(f.error||g.error||j.error)&&e.jsx("p",{role:"alert",className:"mb-4 text-sm text-error",children:(Q=f.error??g.error??j.error)==null?void 0:Q.message}),o?e.jsx(xe,{message:o.message,onRetry:()=>r()}):l?e.jsx("div",{className:"space-y-4",children:Array.from({length:6}).map((i,N)=>e.jsx(Z,{className:"h-8 w-full bg-surface-highest"},N))}):s?e.jsxs("div",{className:"space-y-6",children:[e.jsx(ps,{task:s},s.id),s.body&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"font-label text-xs font-medium text-outline",children:"Body"}),e.jsx("div",{className:"font-body text-sm text-on-surface whitespace-pre-wrap break-words bg-transparent p-3 rounded-lg border border-border",children:s.body})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(p,{label:"ID",children:e.jsx("span",{className:"font-mono text-xs break-all",children:s.id})}),e.jsx(p,{label:"Author",children:s.author}),e.jsx(p,{label:"Claimed By",children:s.claimed_by??"-"}),e.jsx(p,{label:"Project",children:n??"-"}),e.jsx(p,{label:"Skill",children:s.skill_name??"-"}),e.jsxs(p,{label:"Agent Backend",children:[e.jsx("span",{"data-testid":"task-backend-name",children:M.label}),M.available===!1&&e.jsxs("span",{className:"text-error",title:"This backend is not usable right now",children:[" ","○"]})]}),e.jsx(p,{label:"Flow",children:e.jsx("span",{"data-testid":"task-flow-name",children:K.label})}),e.jsx(p,{label:"Required Review",children:s.required_review?"Yes":"No"}),e.jsx(p,{label:"Max Review Rounds",children:s.max_review_rounds}),e.jsx(p,{label:"Due",children:e.jsx("span",{className:Y(s.due_at)&&s.status!=="done"?"text-error":"",children:T(s.due_at)})}),e.jsx(p,{label:"Created",children:T(s.created_at)}),e.jsx(p,{label:"Updated",children:T(s.updated_at)})]}),s.progress>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"font-label text-xs font-medium text-outline",children:"Progress"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-2 bg-surface-highest rounded-lg overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary rounded-lg transition-all",style:{width:`${Math.min(100,s.progress)}%`}})}),e.jsxs("span",{className:"font-label text-xs text-outline",children:[s.progress,"%"]})]})]}),s.tags&&s.tags.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"font-label text-xs font-medium text-outline",children:"Tags"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:s.tags.map(i=>e.jsx("span",{className:"px-2 py-0.5 text-xs font-label bg-primary/10 text-primary border border-primary/20 rounded-lg",children:i},i))})]}),e.jsx(js,{taskId:s.id}),e.jsxs("div",{className:"border-t border-surface-highest pt-4 space-y-3",children:[e.jsx(gs,{}),e.jsx(ms,{taskId:s.id})]}),e.jsxs("div",{className:"border-t border-surface-highest pt-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-label text-xs font-medium text-outline",children:[e.jsx(as,{size:12}),"Links"]}),e.jsx("button",{type:"button",onClick:()=>E(!0),className:"text-primary hover:text-primary/80 transition-colors",children:e.jsx(Ue,{size:14})})]}),h&&h.length>0?e.jsx("div",{className:"space-y-2",children:Object.entries(B).map(([i,N])=>e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"font-label text-[10px] font-medium text-outline",children:i.replace(/_/g," ")}),N.map(y=>e.jsxs("div",{className:"flex items-center justify-between px-2 py-1 bg-surface-highest/50 rounded-lg",children:[e.jsx("span",{className:"font-mono text-xs text-on-surface-variant",children:y.from_task_id===t?y.to_task_id.slice(-6):y.from_task_id.slice(-6)}),e.jsx("button",{type:"button",onClick:()=>j.mutate({taskId:t,linkId:y.id}),className:"text-outline hover:text-error transition-colors p-0.5",children:e.jsx(rs,{size:10})})]},y.id))]},i))}):e.jsx("div",{className:"font-body text-sm text-outline",children:"No links"}),$&&e.jsxs("div",{className:"space-y-2 p-2 bg-surface-highest/30 rounded-lg border border-surface-highest",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Link Type"}),e.jsxs(O,{value:C,onValueChange:i=>R(i),children:[e.jsx(z,{className:"bg-background border-control-border text-on-surface font-label text-xs h-7",children:e.jsx(H,{})}),e.jsx(U,{className:"bg-surface-highest border-surface-highest",children:Ns.map(i=>e.jsx(D,{value:i,className:"font-label text-xs",children:i.replace(/_/g," ")},i))})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Target Task ID"}),e.jsx(w,{value:k,onChange:i=>F(i.target.value),placeholder:"Task ID...",className:"bg-background border-control-border text-on-surface font-body text-sm h-7"})]})]}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx(_,{type:"button",variant:"ghost",size:"sm",onClick:()=>{E(!1),F("")},className:"font-label text-xs text-outline h-6 px-2",children:"Cancel"}),e.jsx(_,{size:"sm",onClick:W,disabled:g.isPending||!k.trim(),className:"font-label text-xs bg-primary text-primary-foreground hover:bg-primary/90 h-6 px-2",children:"Add"})]})]})]}),e.jsxs("div",{className:"border-t border-surface-highest pt-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-label text-xs font-medium text-outline",children:[e.jsx($e,{size:12}),"Comments (",(m==null?void 0:m.length)??0,")"]}),m&&m.length>0&&e.jsx("div",{className:"space-y-2",children:m.map(i=>e.jsxs("div",{className:"py-2 border-b border-border space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-label text-xs text-primary",children:i.author}),e.jsx("span",{className:"font-label text-[10px] text-outline",children:new Date(i.created_at).toLocaleString()})]}),e.jsx("div",{className:"font-body text-sm text-on-surface whitespace-pre-wrap break-words",children:i.content})]},i.id))}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(w,{"aria-label":"Comment author",value:P,onChange:i=>G(i.target.value),placeholder:"Author",className:"bg-background border-control-border text-on-surface font-body text-sm h-7 w-24"}),e.jsx(J,{value:u,onChange:i=>S(i.target.value),placeholder:"Add a comment...",className:"bg-background border-control-border text-on-surface font-body text-sm resize-none flex-1",rows:2})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(_,{"data-testid":"task-comment-submit",size:"sm",onClick:I,disabled:f.isPending||!u.trim(),className:"font-label text-xs bg-primary text-primary-foreground hover:bg-primary/90 h-6 px-2",children:f.isPending?"...":"Comment"})})]})]})]}):e.jsx("div",{className:"text-outline font-label text-xs font-medium text-center py-8",children:"Task not found"})]}),s&&e.jsx(qe,{children:e.jsx(_,{size:"sm",onClick:()=>q(!0),className:"font-label text-xs font-medium bg-transparent text-on-surface border border-control-border hover:bg-surface",children:"Edit task"})})]})}),s&&A&&e.jsx(ws,{task:s,open:A,onClose:()=>q(!1)})]})}function ws({task:t,open:d,onClose:a}){const{data:s}=de(),l=ce(),[o,r]=x.useState(t.title),[m,h]=x.useState(t.body??""),[c,f]=x.useState(t.status),[g,j]=x.useState(t.priority),[u,S]=x.useState(t.due_at??""),[P,G]=x.useState((t.tags??[]).join(", ")),[$,E]=x.useState(t.project_id??""),[k,F]=x.useState(t.skill_name??""),[C,R]=x.useState(t.agent_backend??se),[A,q]=x.useState(t.required_review),[I,W]=x.useState(String(t.max_review_rounds)),[B,K]=x.useState(t.flow_name??te),M=n=>{if(n.preventDefault(),!o.trim())return;const T=P.split(",").map(Y=>Y.trim()).filter(Boolean);l.mutate({id:t.id,title:o.trim(),body:m.trim()||null,status:c,priority:g,due_at:u||null,tags:T.length>0?T:null,project_id:$||null,skill_name:k||null,agent_backend:C===se?null:C,required_review:A,max_review_rounds:Number(I)||3,...t.flow_override?{}:{flow_name:B===te?null:B}},{onSuccess:()=>a()})};return e.jsx(Ie,{open:d,onOpenChange:n=>!n&&a(),children:e.jsxs(Me,{"data-testid":"edit-task-dialog",className:"bg-surface-high border-border max-w-lg max-h-[85vh] overflow-y-auto",children:[e.jsx(Ve,{children:e.jsx(Ge,{className:"font-headline text-sm font-medium text-on-surface",children:"Edit task"})}),e.jsxs("form",{onSubmit:M,className:"space-y-4 mt-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Title *"}),e.jsx(w,{"aria-label":"Title","data-testid":"edit-task-title",value:o,onChange:n=>r(n.target.value),className:"bg-background border-control-border text-on-surface font-body text-sm"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Body"}),e.jsx(J,{"aria-label":"Body",value:m,onChange:n=>h(n.target.value),className:"bg-background border-control-border text-on-surface font-body text-sm resize-none",rows:4})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Status"}),e.jsxs(O,{value:c,onValueChange:n=>f(n),children:[e.jsx(z,{"aria-label":"Status",className:"bg-background border-control-border text-on-surface font-label text-xs",children:e.jsx(H,{})}),e.jsx(U,{className:"bg-surface-highest border-surface-highest",children:vs.map(n=>e.jsx(D,{value:n,className:"font-label text-xs",children:n.replace(/_/g," ")},n))})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Priority"}),e.jsxs(O,{value:g,onValueChange:n=>j(n),children:[e.jsx(z,{"aria-label":"Priority",className:"bg-background border-control-border text-on-surface font-label text-xs",children:e.jsx(H,{})}),e.jsx(U,{className:"bg-surface-highest border-surface-highest",children:ys.map(n=>e.jsx(D,{value:n,className:"font-label text-xs",children:n},n))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Due date"}),e.jsx(w,{type:"datetime-local",value:u?u.slice(0,16):"",onChange:n=>S(n.target.value?new Date(n.target.value).toISOString():""),className:"bg-background border-control-border text-on-surface font-body text-sm"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Project"}),e.jsxs(O,{value:$||"__none__",onValueChange:n=>E(n==="__none__"?"":n),children:[e.jsx(z,{"aria-label":"Project",className:"bg-background border-control-border text-on-surface font-label text-xs",children:e.jsx(H,{})}),e.jsxs(U,{className:"bg-surface-highest border-surface-highest",children:[e.jsx(D,{value:"__none__",className:"font-label text-xs",children:"None"}),s==null?void 0:s.map(n=>e.jsx(D,{value:n.id,className:"font-label text-xs",children:n.name},n.id))]})]})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Tags (comma-separated)"}),e.jsx(w,{"aria-label":"Tags",value:P,onChange:n=>G(n.target.value),placeholder:"tag1, tag2",className:"bg-background border-control-border text-on-surface font-body text-sm"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Skill Name"}),e.jsx(w,{"aria-label":"Skill override",value:k,onChange:n=>F(n.target.value),placeholder:"e.g. code-review",className:"bg-background border-control-border text-on-surface font-body text-sm"})]}),e.jsx(Re,{value:C,onChange:R,testId:"edit-task-backend"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5 flex items-center gap-2 pt-4",children:[e.jsx("input",{type:"checkbox",id:"edit-required-review",checked:A,onChange:n=>q(n.target.checked),className:"accent-primary"}),e.jsx(b,{htmlFor:"edit-required-review",className:"font-label text-xs font-medium text-outline cursor-pointer",children:"Required Review"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(b,{className:"font-label text-xs font-medium text-outline",children:"Max Review Rounds"}),e.jsx(w,{type:"number",value:I,onChange:n=>W(n.target.value),min:1,className:"bg-background border-control-border text-on-surface font-body text-sm"})]})]}),t.flow_override?e.jsxs("p",{className:"font-body text-sm text-outline","data-testid":"task-flow-override-note",children:["This task carries an inline flow definition (flow_override), which beats any named flow. Detach it with ",e.jsx("code",{children:"orc flow attach"})," to use a named flow instead."]}):e.jsx(We,{value:B,onChange:K,testId:"edit-task-flow"}),e.jsxs(Ke,{children:[e.jsx(_,{type:"button",variant:"ghost",size:"sm",onClick:a,className:"font-label text-xs text-outline",children:"Cancel"}),e.jsx(_,{"data-testid":"edit-task-submit",type:"submit",size:"sm",disabled:l.isPending||!o.trim(),className:"font-label text-xs bg-primary text-primary-foreground hover:bg-primary/90",children:l.isPending?"Saving...":"Save"})]})]})]})})}export{Fs as T};
@@ -1,4 +1,4 @@
1
- import{c as an,r as u,bv as M,bw as Te,j as a,at as ft,u as Bn,a as $n,Y as ln,b as Fn,d as ht,L as Kn,G as Un,aK as Xn,bx as Yn,B as qn,P as Vn,a_ as Hn,I as Wn,q as Bt,s as $t,t as Ft,v as Kt,w as at,S as Ut,i as Gn}from"./index-C_jtMgr7.js";import{P as cn}from"./PriorityBadge-BW-A50LE.js";import{T as un}from"./trash-2-D3Ey4I09.js";import{C as Jn}from"./ConfirmDialog-CrSa87VF.js";import{E as Qn}from"./EmptyState-Ctm7L70B.js";import{E as Zn}from"./ErrorState-BPTepwiG.js";import{S as er}from"./StatusBadge-C5G1fdZh.js";import{T as tr}from"./TaskDetailSheet-fUSHPFB-.js";import{T as nr,a as rr,b as Xt,c as te,d as sr,e as ne}from"./table-D3N_5Wee.js";import{T as or,a as ar,b as ir,c as lr}from"./tabs-CSlEXoxD.js";import{V as Yt}from"./ViewHeader-DXR0ZaMO.js";import{u as cr}from"./useDetailRoute-j9nlwack.js";import{u as ur}from"./useProjectScope-Dk0mjyHf.js";import{L as dr}from"./list-BL4eRkIg.js";import"./ResumeActions-DHTOr6GQ.js";import"./useSessions-BrdK-12R.js";/**
1
+ import{c as an,r as u,bE as M,bF as Te,j as a,ag as ft,u as Bn,a as $n,Z as ln,b as Fn,d as ht,L as Un,H as Kn,aN as Xn,bG as Yn,B as qn,P as Hn,be as Vn,I as Wn,q as Bt,s as $t,t as Ft,v as Ut,w as at,S as Kt,i as Gn}from"./index-Ckq9CvHb.js";import{P as cn}from"./PriorityBadge-DHoaJR_M.js";import{T as un}from"./trash-2-BOe9xa7a.js";import{C as Jn}from"./ConfirmDialog-C_exU7Ga.js";import{E as Qn}from"./EmptyState-BVLws_BR.js";import{E as Zn}from"./ErrorState-CwOWC9Qy.js";import{S as er}from"./StatusBadge-Cq2xO_SU.js";import{T as tr}from"./TaskDetailSheet-BfRXcm8m.js";import{T as nr,a as rr,b as Xt,c as te,d as sr,e as ne}from"./table-DTKUFFYV.js";import{T as or,a as ar,b as ir,c as lr}from"./tabs-DcYod54F.js";import{V as Yt}from"./ViewHeader-B9EgQxZk.js";import{u as cr}from"./useDetailRoute-BvTqyOr1.js";import{u as ur}from"./useProjectScope-C3iwCwG_.js";import{L as dr}from"./list-W5PAwY_1.js";import"./ResumeActions-RtezaXDE.js";import"./live-sessions-C4qBcPbR.js";import"./copy-DsS5X55x.js";import"./useSessions-BL5wWTxP.js";/**
2
2
  * @license lucide-react v1.27.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -8,11 +8,11 @@ import{c as an,r as u,bv as M,bw as Te,j as a,at as ft,u as Bn,a as $n,Y as ln,b
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const gr=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],pr=an("layout-grid",gr),Je=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ce(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function vt(e){return"nodeType"in e}function _(e){var t,n;return e?Ce(e)?e:vt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function mt(e){const{Document:t}=_(e);return e instanceof t}function Ie(e){return Ce(e)?!1:e instanceof _(e).HTMLElement}function dn(e){return e instanceof _(e).SVGElement}function De(e){return e?Ce(e)?e.document:vt(e)?mt(e)?e:Ie(e)||dn(e)?e.ownerDocument:document:document:document}const ae=Je?u.useLayoutEffect:u.useEffect;function Qe(e){const t=u.useRef(e);return ae(()=>{t.current=e}),u.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function br(){const e=u.useRef(null),t=u.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=u.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Pe(e,t){t===void 0&&(t=[e]);const n=u.useRef(e);return ae(()=>{n.current!==e&&(n.current=e)},t),n}function ze(e,t){const n=u.useRef();return u.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ye(e){const t=Qe(e),n=u.useRef(null),r=u.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function qe(e){const t=u.useRef();return u.useEffect(()=>{t.current=e},[e]),t.current}let it={};function Ze(e,t){return u.useMemo(()=>{if(t)return t;const n=it[e]==null?0:it[e]+1;return it[e]=n,e+"-"+n},[e,t])}function fn(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,i)=>{const l=Object.entries(i);for(const[c,d]of l){const g=s[c];g!=null&&(s[c]=g+e*d)}return s},{...t})}}const we=fn(1),Ve=fn(-1);function vr(e){return"clientX"in e&&"clientY"in e}function xt(e){if(!e)return!1;const{KeyboardEvent:t}=_(e.target);return t&&e instanceof t}function mr(e){if(!e)return!1;const{TouchEvent:t}=_(e.target);return t&&e instanceof t}function He(e){if(mr(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return vr(e)?{x:e.clientX,y:e.clientY}:null}const Se=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Se.Translate.toString(e),Se.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),qt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function xr(e){return e.matches(qt)?e:e.querySelector(qt)}const yr={display:"none"};function wr(e){let{id:t,value:n}=e;return M.createElement("div",{id:t,style:yr},n)}function Sr(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return M.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Cr(){const[e,t]=u.useState("");return{announce:u.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const hn=u.createContext(null);function Dr(e){const t=u.useContext(hn);u.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function jr(){const[e]=u.useState(()=>new Set),t=u.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[u.useCallback(r=>{let{type:o,event:s}=r;e.forEach(i=>{var l;return(l=i[o])==null?void 0:l.call(i,s)})},[e]),t]}const Nr={draggable:`
11
+ */const gr=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],pr=an("layout-grid",gr),Je=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ce(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function vt(e){return"nodeType"in e}function _(e){var t,n;return e?Ce(e)?e:vt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function mt(e){const{Document:t}=_(e);return e instanceof t}function Ie(e){return Ce(e)?!1:e instanceof _(e).HTMLElement}function dn(e){return e instanceof _(e).SVGElement}function De(e){return e?Ce(e)?e.document:vt(e)?mt(e)?e:Ie(e)||dn(e)?e.ownerDocument:document:document:document}const ae=Je?u.useLayoutEffect:u.useEffect;function Qe(e){const t=u.useRef(e);return ae(()=>{t.current=e}),u.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function br(){const e=u.useRef(null),t=u.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=u.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Pe(e,t){t===void 0&&(t=[e]);const n=u.useRef(e);return ae(()=>{n.current!==e&&(n.current=e)},t),n}function ze(e,t){const n=u.useRef();return u.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ye(e){const t=Qe(e),n=u.useRef(null),r=u.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function qe(e){const t=u.useRef();return u.useEffect(()=>{t.current=e},[e]),t.current}let it={};function Ze(e,t){return u.useMemo(()=>{if(t)return t;const n=it[e]==null?0:it[e]+1;return it[e]=n,e+"-"+n},[e,t])}function fn(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,i)=>{const l=Object.entries(i);for(const[c,d]of l){const g=s[c];g!=null&&(s[c]=g+e*d)}return s},{...t})}}const we=fn(1),He=fn(-1);function vr(e){return"clientX"in e&&"clientY"in e}function xt(e){if(!e)return!1;const{KeyboardEvent:t}=_(e.target);return t&&e instanceof t}function mr(e){if(!e)return!1;const{TouchEvent:t}=_(e.target);return t&&e instanceof t}function Ve(e){if(mr(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return vr(e)?{x:e.clientX,y:e.clientY}:null}const Se=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Se.Translate.toString(e),Se.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),qt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function xr(e){return e.matches(qt)?e:e.querySelector(qt)}const yr={display:"none"};function wr(e){let{id:t,value:n}=e;return M.createElement("div",{id:t,style:yr},n)}function Sr(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return M.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Cr(){const[e,t]=u.useState("");return{announce:u.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const hn=u.createContext(null);function Dr(e){const t=u.useContext(hn);u.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function jr(){const[e]=u.useState(()=>new Set),t=u.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[u.useCallback(r=>{let{type:o,event:s}=r;e.forEach(i=>{var l;return(l=i[o])==null?void 0:l.call(i,s)})},[e]),t]}const Nr={draggable:`
12
12
  To pick up a draggable item, press the space bar.
13
13
  While dragging, use the arrow keys to move the item.
14
14
  Press space again to drop the item in its new position, or press escape to cancel.
15
- `},Rr={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Er(e){let{announcements:t=Rr,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Nr}=e;const{announce:s,announcement:i}=Cr(),l=Ze("DndLiveRegion"),[c,d]=u.useState(!1);if(u.useEffect(()=>{d(!0)},[]),Dr(u.useMemo(()=>({onDragStart(f){let{active:b}=f;s(t.onDragStart({active:b}))},onDragMove(f){let{active:b,over:p}=f;t.onDragMove&&s(t.onDragMove({active:b,over:p}))},onDragOver(f){let{active:b,over:p}=f;s(t.onDragOver({active:b,over:p}))},onDragEnd(f){let{active:b,over:p}=f;s(t.onDragEnd({active:b,over:p}))},onDragCancel(f){let{active:b,over:p}=f;s(t.onDragCancel({active:b,over:p}))}}),[s,t])),!c)return null;const g=M.createElement(M.Fragment,null,M.createElement(wr,{id:r,value:o.draggable}),M.createElement(Sr,{id:l,announcement:i}));return n?Te.createPortal(g,n):g}var P;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(P||(P={}));function We(){}function Vt(e,t){return u.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Tr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return u.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const J=Object.freeze({x:0,y:0});function kr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ar(e,t){const n=He(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Mr(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Or(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Ht(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function Pr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}const Lr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Ht(t),s=[];for(const i of r){const{id:l}=i,c=n.get(l);if(c){const d=Ht(c),g=o.reduce((b,p,w)=>b+kr(d[w],p),0),f=Number((g/4).toFixed(4));s.push({id:l,data:{droppableContainer:i,value:f}})}}return s.sort(Mr)};function Ir(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),i=o-r,l=s-n;if(r<o&&n<s){const c=t.width*t.height,d=e.width*e.height,g=i*l,f=g/(c+d-g);return Number(f.toFixed(4))}return 0}const zr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:i}=s,l=n.get(i);if(l){const c=Ir(l,t);c>0&&o.push({id:i,data:{droppableContainer:s,value:c}})}}return o.sort(Or)};function _r(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function gn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:J}function Br(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((i,l)=>({...i,top:i.top+e*l.y,bottom:i.bottom+e*l.y,left:i.left+e*l.x,right:i.right+e*l.x}),{...n})}}const $r=Br(1);function pn(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Fr(e,t,n){const r=pn(t);if(!r)return e;const{scaleX:o,scaleY:s,x:i,y:l}=r,c=e.left-i-(1-o)*parseFloat(n),d=e.top-l-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),g=o?e.width/o:e.width,f=s?e.height/s:e.height;return{width:g,height:f,top:d,right:c+g,bottom:d+f,left:c}}const Kr={ignoreTransform:!1};function _e(e,t){t===void 0&&(t=Kr);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:g}=_(e).getComputedStyle(e);d&&(n=Fr(n,d,g))}const{top:r,left:o,width:s,height:i,bottom:l,right:c}=n;return{top:r,left:o,width:s,height:i,bottom:l,right:c}}function Wt(e){return _e(e,{ignoreTransform:!0})}function Ur(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Xr(e,t){return t===void 0&&(t=_(e).getComputedStyle(e)),t.position==="fixed"}function Yr(e,t){t===void 0&&(t=_(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function yt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(mt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Ie(o)||dn(o)||n.includes(o))return n;const s=_(e).getComputedStyle(o);return o!==e&&Yr(o,s)&&n.push(o),Xr(o,s)?n:r(o.parentNode)}return e?r(e):n}function bn(e){const[t]=yt(e,1);return t??null}function lt(e){return!Je||!e?null:Ce(e)?e:vt(e)?mt(e)||e===De(e).scrollingElement?window:Ie(e)?e:null:null}function vn(e){return Ce(e)?e.scrollX:e.scrollLeft}function mn(e){return Ce(e)?e.scrollY:e.scrollTop}function gt(e){return{x:vn(e),y:mn(e)}}var L;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(L||(L={}));function xn(e){return!Je||!e?!1:e===document.scrollingElement}function yn(e){const t={x:0,y:0},n=xn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,i=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:l,maxScroll:r,minScroll:t}}const qr={x:.2,y:.2};function Vr(e,t,n,r,o){let{top:s,left:i,right:l,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=qr);const{isTop:d,isBottom:g,isLeft:f,isRight:b}=yn(e),p={x:0,y:0},w={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!d&&s<=t.top+v.height?(p.y=L.Backward,w.y=r*Math.abs((t.top+v.height-s)/v.height)):!g&&c>=t.bottom-v.height&&(p.y=L.Forward,w.y=r*Math.abs((t.bottom-v.height-c)/v.height)),!b&&l>=t.right-v.width?(p.x=L.Forward,w.x=r*Math.abs((t.right-v.width-l)/v.width)):!f&&i<=t.left+v.width&&(p.x=L.Backward,w.x=r*Math.abs((t.left+v.width-i)/v.width)),{direction:p,speed:w}}function Hr(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:i}=window;return{top:0,left:0,right:s,bottom:i,width:s,height:i}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function wn(e){return e.reduce((t,n)=>we(t,gt(n)),J)}function Wr(e){return e.reduce((t,n)=>t+vn(n),0)}function Gr(e){return e.reduce((t,n)=>t+mn(n),0)}function Sn(e,t){if(t===void 0&&(t=_e),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);bn(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Jr=[["x",["left","right"],Wr],["y",["top","bottom"],Gr]];class wt{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=yt(n),o=wn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,l]of Jr)for(const c of i)Object.defineProperty(this,c,{get:()=>{const d=l(r),g=o[s]-d;return this.rect[c]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ae{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Qr(e){const{EventTarget:t}=_(e);return e instanceof t?e:De(e)}function ct(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var V;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(V||(V={}));function Gt(e){e.preventDefault()}function Zr(e){e.stopPropagation()}var T;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(T||(T={}));const Cn={start:[T.Space,T.Enter],cancel:[T.Esc],end:[T.Space,T.Enter,T.Tab]},es=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case T.Right:return{...n,x:n.x+25};case T.Left:return{...n,x:n.x-25};case T.Down:return{...n,y:n.y+25};case T.Up:return{...n,y:n.y-25}}};class St{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ae(De(n)),this.windowListeners=new Ae(_(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(V.Resize,this.handleCancel),this.windowListeners.add(V.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(V.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Sn(r),n(J)}handleKeyDown(t){if(xt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=Cn,coordinateGetter:i=es,scrollBehavior:l="smooth"}=o,{code:c}=t;if(s.end.includes(c)){this.handleEnd(t);return}if(s.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:d}=r.current,g=d?{x:d.left,y:d.top}:J;this.referenceCoordinates||(this.referenceCoordinates=g);const f=i(t,{active:n,context:r.current,currentCoordinates:g});if(f){const b=Ve(f,g),p={x:0,y:0},{scrollableAncestors:w}=r.current;for(const v of w){const y=t.code,{isTop:S,isRight:C,isLeft:m,isBottom:E,maxScroll:N,minScroll:R}=yn(v),D=Hr(v),j={x:Math.min(y===T.Right?D.right-D.width/2:D.right,Math.max(y===T.Right?D.left:D.left+D.width/2,f.x)),y:Math.min(y===T.Down?D.bottom-D.height/2:D.bottom,Math.max(y===T.Down?D.top:D.top+D.height/2,f.y))},k=y===T.Right&&!C||y===T.Left&&!m,O=y===T.Down&&!E||y===T.Up&&!S;if(k&&j.x!==f.x){const A=v.scrollLeft+b.x,H=y===T.Right&&A<=N.x||y===T.Left&&A>=R.x;if(H&&!b.y){v.scrollTo({left:A,behavior:l});return}H?p.x=v.scrollLeft-A:p.x=y===T.Right?v.scrollLeft-N.x:v.scrollLeft-R.x,p.x&&v.scrollBy({left:-p.x,behavior:l});break}else if(O&&j.y!==f.y){const A=v.scrollTop+b.y,H=y===T.Down&&A<=N.y||y===T.Up&&A>=R.y;if(H&&!b.x){v.scrollTo({top:A,behavior:l});return}H?p.y=v.scrollTop-A:p.y=y===T.Down?v.scrollTop-N.y:v.scrollTop-R.y,p.y&&v.scrollBy({top:-p.y,behavior:l});break}}this.handleMove(t,we(Ve(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}St.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Cn,onActivation:o}=t,{active:s}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const l=s.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Jt(e){return!!(e&&"distance"in e)}function Qt(e){return!!(e&&"delay"in e)}class Ct{constructor(t,n,r){var o;r===void 0&&(r=Qr(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:i}=s;this.props=t,this.events=n,this.document=De(i),this.documentListeners=new Ae(this.document),this.listeners=new Ae(r),this.windowListeners=new Ae(_(i)),this.initialCoordinates=(o=He(s))!=null?o:J,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(V.Resize,this.handleCancel),this.windowListeners.add(V.DragStart,Gt),this.windowListeners.add(V.VisibilityChange,this.handleCancel),this.windowListeners.add(V.ContextMenu,Gt),this.documentListeners.add(V.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Qt(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Jt(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(V.Click,Zr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(V.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:l}}=s;if(!o)return;const c=(n=He(t))!=null?n:J,d=Ve(o,c);if(!r&&l){if(Jt(l)){if(l.tolerance!=null&&ct(d,l.tolerance))return this.handleCancel();if(ct(d,l.distance))return this.handleStart()}if(Qt(l)&&ct(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}t.cancelable&&t.preventDefault(),i(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===T.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const ts={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Dt extends Ct{constructor(t){const{event:n}=t,r=De(n.target);super(t,ts,r)}}Dt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const ns={move:{name:"mousemove"},end:{name:"mouseup"}};var pt;(function(e){e[e.RightClick=2]="RightClick"})(pt||(pt={}));class rs extends Ct{constructor(t){super(t,ns,De(t.event.target))}}rs.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===pt.RightClick?!1:(r==null||r({event:n}),!0)}}];const ut={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ss extends Ct{constructor(t){super(t,ut)}static setup(){return window.addEventListener(ut.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ut.move.name,t)};function t(){}}}ss.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Me;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Me||(Me={}));var Ge;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ge||(Ge={}));function os(e){let{acceleration:t,activator:n=Me.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:l=Ge.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:g,delta:f,threshold:b}=e;const p=is({delta:f,disabled:!s}),[w,v]=br(),y=u.useRef({x:0,y:0}),S=u.useRef({x:0,y:0}),C=u.useMemo(()=>{switch(n){case Me.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Me.DraggableRect:return o}},[n,o,c]),m=u.useRef(null),E=u.useCallback(()=>{const R=m.current;if(!R)return;const D=y.current.x*S.current.x,j=y.current.y*S.current.y;R.scrollBy(D,j)},[]),N=u.useMemo(()=>l===Ge.TreeOrder?[...d].reverse():d,[l,d]);u.useEffect(()=>{if(!s||!d.length||!C){v();return}for(const R of N){if((r==null?void 0:r(R))===!1)continue;const D=d.indexOf(R),j=g[D];if(!j)continue;const{direction:k,speed:O}=Vr(R,j,C,t,b);for(const A of["x","y"])p[A][k[A]]||(O[A]=0,k[A]=0);if(O.x>0||O.y>0){v(),m.current=R,w(E,i),y.current=O,S.current=k;return}}y.current={x:0,y:0},S.current={x:0,y:0},v()},[t,E,r,v,s,i,JSON.stringify(C),JSON.stringify(p),w,d,N,g,JSON.stringify(b)])}const as={x:{[L.Backward]:!1,[L.Forward]:!1},y:{[L.Backward]:!1,[L.Forward]:!1}};function is(e){let{delta:t,disabled:n}=e;const r=qe(t);return ze(o=>{if(n||!r||!o)return as;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[L.Backward]:o.x[L.Backward]||s.x===-1,[L.Forward]:o.x[L.Forward]||s.x===1},y:{[L.Backward]:o.y[L.Backward]||s.y===-1,[L.Forward]:o.y[L.Forward]||s.y===1}}},[n,t,r])}function ls(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return ze(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function cs(e,t){return u.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,r)}));return[...n,...s]},[]),[e,t])}var Le;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Le||(Le={}));var bt;(function(e){e.Optimized="optimized"})(bt||(bt={}));const Zt=new Map;function us(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,i]=u.useState(null),{frequency:l,measure:c,strategy:d}=o,g=u.useRef(e),f=y(),b=Pe(f),p=u.useCallback(function(S){S===void 0&&(S=[]),!b.current&&i(C=>C===null?S:C.concat(S.filter(m=>!C.includes(m))))},[b]),w=u.useRef(null),v=ze(S=>{if(f&&!n)return Zt;if(!S||S===Zt||g.current!==e||s!=null){const C=new Map;for(let m of e){if(!m)continue;if(s&&s.length>0&&!s.includes(m.id)&&m.rect.current){C.set(m.id,m.rect.current);continue}const E=m.node.current,N=E?new wt(c(E),E):null;m.rect.current=N,N&&C.set(m.id,N)}return C}return S},[e,s,n,f,c]);return u.useEffect(()=>{g.current=e},[e]),u.useEffect(()=>{f||p()},[n,f]),u.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),u.useEffect(()=>{f||typeof l!="number"||w.current!==null||(w.current=setTimeout(()=>{p(),w.current=null},l))},[l,f,p,...r]),{droppableRects:v,measureDroppableContainers:p,measuringScheduled:s!=null};function y(){switch(d){case Le.Always:return!1;case Le.BeforeDragging:return n;default:return!n}}}function jt(e,t){return ze(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function ds(e,t){return jt(e,t)}function fs(e){let{callback:t,disabled:n}=e;const r=Qe(t),o=u.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return u.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function et(e){let{callback:t,disabled:n}=e;const r=Qe(t),o=u.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return u.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function hs(e){return new wt(_e(e),e)}function en(e,t,n){t===void 0&&(t=hs);const[r,o]=u.useState(null);function s(){o(c=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=c??n)!=null?d:null}const g=t(e);return JSON.stringify(c)===JSON.stringify(g)?c:g})}const i=fs({callback(c){if(e)for(const d of c){const{type:g,target:f}=d;if(g==="childList"&&f instanceof HTMLElement&&f.contains(e)){s();break}}}}),l=et({callback:s});return ae(()=>{s(),e?(l==null||l.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),i==null||i.disconnect())},[e]),r}function gs(e){const t=jt(e);return gn(e,t)}const tn=[];function ps(e){const t=u.useRef(e),n=ze(r=>e?r&&r!==tn&&e&&t.current&&e.parentNode===t.current.parentNode?r:yt(e):tn,[e]);return u.useEffect(()=>{t.current=e},[e]),n}function bs(e){const[t,n]=u.useState(null),r=u.useRef(e),o=u.useCallback(s=>{const i=lt(s.target);i&&n(l=>l?(l.set(i,gt(i)),new Map(l)):null)},[]);return u.useEffect(()=>{const s=r.current;if(e!==s){i(s);const l=e.map(c=>{const d=lt(c);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,gt(d)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=e}return()=>{i(e),i(s)};function i(l){l.forEach(c=>{const d=lt(c);d==null||d.removeEventListener("scroll",o)})}},[o,e]),u.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>we(s,i),J):wn(e):J,[e,t])}function nn(e,t){t===void 0&&(t=[]);const n=u.useRef(null);return u.useEffect(()=>{n.current=null},t),u.useEffect(()=>{const r=e!==J;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Ve(e,n.current):J}function vs(e){u.useEffect(()=>{if(!Je)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function ms(e,t){return u.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,t)},n},{}),[e,t])}function Dn(e){return u.useMemo(()=>e?Ur(e):null,[e])}const rn=[];function xs(e,t){t===void 0&&(t=_e);const[n]=e,r=Dn(n?_(n):null),[o,s]=u.useState(rn);function i(){s(()=>e.length?e.map(c=>xn(c)?r:new wt(t(c),c)):rn)}const l=et({callback:i});return ae(()=>{l==null||l.disconnect(),i(),e.forEach(c=>l==null?void 0:l.observe(c))},[e]),o}function jn(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ie(t)?t:e}function ys(e){let{measure:t}=e;const[n,r]=u.useState(null),o=u.useCallback(d=>{for(const{target:g}of d)if(Ie(g)){r(f=>{const b=t(g);return f?{...f,width:b.width,height:b.height}:b});break}},[t]),s=et({callback:o}),i=u.useCallback(d=>{const g=jn(d);s==null||s.disconnect(),g&&(s==null||s.observe(g)),r(g?t(g):null)},[t,s]),[l,c]=Ye(i);return u.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const ws=[{sensor:Dt,options:{}},{sensor:St,options:{}}],Ss={current:{}},Xe={draggable:{measure:Wt},droppable:{measure:Wt,strategy:Le.WhileDragging,frequency:bt.Optimized},dragOverlay:{measure:_e}};class Oe extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Cs={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Oe,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:We},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Xe,measureDroppableContainers:We,windowRect:null,measuringScheduled:!1},Nn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:We,draggableNodes:new Map,over:null,measureDroppableContainers:We},Be=u.createContext(Nn),Rn=u.createContext(Cs);function Ds(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Oe}}}function js(e,t){switch(t.type){case P.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case P.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case P.DragEnd:case P.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case P.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Oe(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case P.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new Oe(e.droppable.containers);return i.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case P.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new Oe(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Ns(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=u.useContext(Be),s=qe(r),i=qe(n==null?void 0:n.id);return u.useEffect(()=>{if(!t&&!r&&s&&i!=null){if(!xt(s)||document.activeElement===s.target)return;const l=o.get(i);if(!l)return;const{activatorNode:c,node:d}=l;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const g of[c.current,d.current]){if(!g)continue;const f=xr(g);if(f){f.focus();break}}})}},[r,t,o,i,s]),null}function En(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function Rs(e){return u.useMemo(()=>({draggable:{...Xe.draggable,...e==null?void 0:e.draggable},droppable:{...Xe.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Xe.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Es(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=u.useRef(!1),{x:i,y:l}=typeof o=="boolean"?{x:o,y:o}:o;ae(()=>{if(!i&&!l||!t){s.current=!1;return}if(s.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const g=n(d),f=gn(g,r);if(i||(f.x=0),l||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const b=bn(d);b&&b.scrollBy({top:f.y,left:f.x})}},[t,i,l,r,n])}const tt=u.createContext({...J,scaleX:1,scaleY:1});var fe;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(fe||(fe={}));const Ts=u.memo(function(t){var n,r,o,s;let{id:i,accessibility:l,autoScroll:c=!0,children:d,sensors:g=ws,collisionDetection:f=zr,measuring:b,modifiers:p,...w}=t;const v=u.useReducer(js,void 0,Ds),[y,S]=v,[C,m]=jr(),[E,N]=u.useState(fe.Uninitialized),R=E===fe.Initialized,{draggable:{active:D,nodes:j,translate:k},droppable:{containers:O}}=y,A=D!=null?j.get(D):null,H=u.useRef({initial:null,translated:null}),B=u.useMemo(()=>{var z;return D!=null?{id:D,data:(z=A==null?void 0:A.data)!=null?z:Ss,rect:H}:null},[D,A]),$=u.useRef(null),[re,pe]=u.useState(null),[X,$e]=u.useState(null),se=Pe(w,Object.values(w)),be=Ze("DndDescribedBy",i),h=u.useMemo(()=>O.getEnabled(),[O]),x=Rs(b),{droppableRects:Y,measureDroppableContainers:Q,measuringScheduled:Nt}=us(h,{dragging:R,dependencies:[k.x,k.y],config:x.droppable}),W=ls(j,D),Rt=u.useMemo(()=>X?He(X):null,[X]),Et=_n(),Tt=ds(W,x.draggable.measure);Es({activeNode:D!=null?j.get(D):null,config:Et.layoutShiftCompensation,initialRect:Tt,measure:x.draggable.measure});const G=en(W,x.draggable.measure,Tt),nt=en(W?W.parentElement:null),he=u.useRef({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),kt=O.getNodeFor((n=he.current.over)==null?void 0:n.id),ge=ys({measure:x.dragOverlay.measure}),Fe=(r=ge.nodeRef.current)!=null?r:W,ve=R?(o=ge.rect)!=null?o:G:null,At=!!(ge.nodeRef.current&&ge.rect),Mt=gs(At?null:G),rt=Dn(Fe?_(Fe):null),ie=ps(R?kt??W:null),Ke=xs(ie),Ue=En(p,{transform:{x:k.x-Mt.x,y:k.y-Mt.y,scaleX:1,scaleY:1},activatorEvent:X,active:B,activeNodeRect:G,containerNodeRect:nt,draggingNodeRect:ve,over:he.current.over,overlayNodeRect:ge.rect,scrollableAncestors:ie,scrollableAncestorRects:Ke,windowRect:rt}),Ot=Rt?we(Rt,k):null,Pt=bs(ie),An=nn(Pt),Mn=nn(Pt,[G]),me=we(Ue,An),xe=ve?$r(ve,Ue):null,je=B&&xe?f({active:B,collisionRect:xe,droppableRects:Y,droppableContainers:h,pointerCoordinates:Ot}):null,Lt=Pr(je,"id"),[le,It]=u.useState(null),On=At?Ue:we(Ue,Mn),Pn=_r(On,(s=le==null?void 0:le.rect)!=null?s:null,G),st=u.useRef(null),zt=u.useCallback((z,F)=>{let{sensor:K,options:ce}=F;if($.current==null)return;const q=j.get($.current);if(!q)return;const U=z.nativeEvent,Z=new K({active:$.current,activeNode:q,event:U,options:ce,context:he,onAbort(I){if(!j.get(I))return;const{onDragAbort:ee}=se.current,oe={id:I};ee==null||ee(oe),C({type:"onDragAbort",event:oe})},onPending(I,ue,ee,oe){if(!j.get(I))return;const{onDragPending:Re}=se.current,de={id:I,constraint:ue,initialCoordinates:ee,offset:oe};Re==null||Re(de),C({type:"onDragPending",event:de})},onStart(I){const ue=$.current;if(ue==null)return;const ee=j.get(ue);if(!ee)return;const{onDragStart:oe}=se.current,Ne={activatorEvent:U,active:{id:ue,data:ee.data,rect:H}};Te.unstable_batchedUpdates(()=>{oe==null||oe(Ne),N(fe.Initializing),S({type:P.DragStart,initialCoordinates:I,active:ue}),C({type:"onDragStart",event:Ne}),pe(st.current),$e(U)})},onMove(I){S({type:P.DragMove,coordinates:I})},onEnd:ye(P.DragEnd),onCancel:ye(P.DragCancel)});st.current=Z;function ye(I){return async function(){const{active:ee,collisions:oe,over:Ne,scrollAdjustedTranslate:Re}=he.current;let de=null;if(ee&&Re){const{cancelDrop:Ee}=se.current;de={activatorEvent:U,active:ee,collisions:oe,delta:Re,over:Ne},I===P.DragEnd&&typeof Ee=="function"&&await Promise.resolve(Ee(de))&&(I=P.DragCancel)}$.current=null,Te.unstable_batchedUpdates(()=>{S({type:I}),N(fe.Uninitialized),It(null),pe(null),$e(null),st.current=null;const Ee=I===P.DragEnd?"onDragEnd":"onDragCancel";if(de){const ot=se.current[Ee];ot==null||ot(de),C({type:Ee,event:de})}})}}},[j]),Ln=u.useCallback((z,F)=>(K,ce)=>{const q=K.nativeEvent,U=j.get(ce);if($.current!==null||!U||q.dndKit||q.defaultPrevented)return;const Z={active:U};z(K,F.options,Z)===!0&&(q.dndKit={capturedBy:F.sensor},$.current=ce,zt(K,F))},[j,zt]),_t=cs(g,Ln);vs(g),ae(()=>{G&&E===fe.Initializing&&N(fe.Initialized)},[G,E]),u.useEffect(()=>{const{onDragMove:z}=se.current,{active:F,activatorEvent:K,collisions:ce,over:q}=he.current;if(!F||!K)return;const U={active:F,activatorEvent:K,collisions:ce,delta:{x:me.x,y:me.y},over:q};Te.unstable_batchedUpdates(()=>{z==null||z(U),C({type:"onDragMove",event:U})})},[me.x,me.y]),u.useEffect(()=>{const{active:z,activatorEvent:F,collisions:K,droppableContainers:ce,scrollAdjustedTranslate:q}=he.current;if(!z||$.current==null||!F||!q)return;const{onDragOver:U}=se.current,Z=ce.get(Lt),ye=Z&&Z.rect.current?{id:Z.id,rect:Z.rect.current,data:Z.data,disabled:Z.disabled}:null,I={active:z,activatorEvent:F,collisions:K,delta:{x:q.x,y:q.y},over:ye};Te.unstable_batchedUpdates(()=>{It(ye),U==null||U(I),C({type:"onDragOver",event:I})})},[Lt]),ae(()=>{he.current={activatorEvent:X,active:B,activeNode:W,collisionRect:xe,collisions:je,droppableRects:Y,draggableNodes:j,draggingNode:Fe,draggingNodeRect:ve,droppableContainers:O,over:le,scrollableAncestors:ie,scrollAdjustedTranslate:me},H.current={initial:ve,translated:xe}},[B,W,je,xe,j,Fe,ve,Y,O,le,ie,me]),os({...Et,delta:k,draggingRect:xe,pointerCoordinates:Ot,scrollableAncestors:ie,scrollableAncestorRects:Ke});const In=u.useMemo(()=>({active:B,activeNode:W,activeNodeRect:G,activatorEvent:X,collisions:je,containerNodeRect:nt,dragOverlay:ge,draggableNodes:j,droppableContainers:O,droppableRects:Y,over:le,measureDroppableContainers:Q,scrollableAncestors:ie,scrollableAncestorRects:Ke,measuringConfiguration:x,measuringScheduled:Nt,windowRect:rt}),[B,W,G,X,je,nt,ge,j,O,Y,le,Q,ie,Ke,x,Nt,rt]),zn=u.useMemo(()=>({activatorEvent:X,activators:_t,active:B,activeNodeRect:G,ariaDescribedById:{draggable:be},dispatch:S,draggableNodes:j,over:le,measureDroppableContainers:Q}),[X,_t,B,G,S,be,j,le,Q]);return M.createElement(hn.Provider,{value:m},M.createElement(Be.Provider,{value:zn},M.createElement(Rn.Provider,{value:In},M.createElement(tt.Provider,{value:Pn},d)),M.createElement(Ns,{disabled:(l==null?void 0:l.restoreFocus)===!1})),M.createElement(Er,{...l,hiddenTextDescribedById:be}));function _n(){const z=(re==null?void 0:re.autoScrollEnabled)===!1,F=typeof c=="object"?c.enabled===!1:c===!1,K=R&&!z&&!F;return typeof c=="object"?{...c,enabled:K}:{enabled:K}}}),ks=u.createContext(null),sn="button",As="Draggable";function Ms(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=Ze(As),{activators:i,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:g,draggableNodes:f,over:b}=u.useContext(Be),{role:p=sn,roleDescription:w="draggable",tabIndex:v=0}=o??{},y=(c==null?void 0:c.id)===t,S=u.useContext(y?tt:ks),[C,m]=Ye(),[E,N]=Ye(),R=ms(i,t),D=Pe(n);ae(()=>(f.set(t,{id:t,key:s,node:C,activatorNode:E,data:D}),()=>{const k=f.get(t);k&&k.key===s&&f.delete(t)}),[f,t]);const j=u.useMemo(()=>({role:p,tabIndex:v,"aria-disabled":r,"aria-pressed":y&&p===sn?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[r,p,v,y,w,g.draggable]);return{active:c,activatorEvent:l,activeNodeRect:d,attributes:j,isDragging:y,listeners:r?void 0:R,node:C,over:b,setNodeRef:m,setActivatorNodeRef:N,transform:S}}function Os(){return u.useContext(Rn)}const Ps="Droppable",Ls={timeout:25};function Is(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=Ze(Ps),{active:i,dispatch:l,over:c,measureDroppableContainers:d}=u.useContext(Be),g=u.useRef({disabled:n}),f=u.useRef(!1),b=u.useRef(null),p=u.useRef(null),{disabled:w,updateMeasurementsFor:v,timeout:y}={...Ls,...o},S=Pe(v??r),C=u.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(S.current)?S.current:[S.current]),p.current=null},y)},[y]),m=et({callback:C,disabled:w||!i}),E=u.useCallback((j,k)=>{m&&(k&&(m.unobserve(k),f.current=!1),j&&m.observe(j))},[m]),[N,R]=Ye(E),D=Pe(t);return u.useEffect(()=>{!m||!N.current||(m.disconnect(),f.current=!1,m.observe(N.current))},[N,m]),u.useEffect(()=>(l({type:P.RegisterDroppable,element:{id:r,key:s,disabled:n,node:N,rect:b,data:D}}),()=>l({type:P.UnregisterDroppable,key:s,id:r})),[r]),u.useEffect(()=>{n!==g.current.disabled&&(l({type:P.SetDroppableDisabled,id:r,key:s,disabled:n}),g.current.disabled=n)},[r,s,n,l]),{active:i,rect:b,isOver:(c==null?void 0:c.id)===r,node:N,over:c,setNodeRef:R}}function zs(e){let{animation:t,children:n}=e;const[r,o]=u.useState(null),[s,i]=u.useState(null),l=qe(n);return!n&&!r&&l&&o(l),ae(()=>{if(!s)return;const c=r==null?void 0:r.key,d=r==null?void 0:r.props.id;if(c==null||d==null){o(null);return}Promise.resolve(t(d,s)).then(()=>{o(null)})},[t,r,s]),M.createElement(M.Fragment,null,n,r?u.cloneElement(r,{ref:i}):null)}const _s={x:0,y:0,scaleX:1,scaleY:1};function Bs(e){let{children:t}=e;return M.createElement(Be.Provider,{value:Nn},M.createElement(tt.Provider,{value:_s},t))}const $s={position:"fixed",touchAction:"none"},Fs=e=>xt(e)?"transform 250ms ease":void 0,Ks=u.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:i,rect:l,style:c,transform:d,transition:g=Fs}=e;if(!l)return null;const f=o?d:{...d,scaleX:1,scaleY:1},b={...$s,width:l.width,height:l.height,top:l.top,left:l.left,transform:Se.Transform.toString(f),transformOrigin:o&&r?Ar(r,l):void 0,transition:typeof g=="function"?g(r):g,...c};return M.createElement(n,{className:i,style:b,ref:t},s)}),Us=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:s,className:i}=e;if(s!=null&&s.active)for(const[l,c]of Object.entries(s.active))c!==void 0&&(o[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,c));if(s!=null&&s.dragOverlay)for(const[l,c]of Object.entries(s.dragOverlay))c!==void 0&&r.node.style.setProperty(l,c);return i!=null&&i.active&&n.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[c,d]of Object.entries(o))n.node.style.setProperty(c,d);i!=null&&i.active&&n.node.classList.remove(i.active)}},Xs=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Se.Transform.toString(t)},{transform:Se.Transform.toString(n)}]},Ys={duration:250,easing:"ease",keyframes:Xs,sideEffects:Us({styles:{active:{opacity:"0"}}})};function qs(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Qe((s,i)=>{if(t===null)return;const l=n.get(s);if(!l)return;const c=l.node.current;if(!c)return;const d=jn(i);if(!d)return;const{transform:g}=_(i).getComputedStyle(i),f=pn(g);if(!f)return;const b=typeof t=="function"?t:Vs(t);return Sn(c,o.draggable.measure),b({active:{id:s,data:l.data,node:c,rect:o.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:o,transform:f})})}function Vs(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Ys,...e};return s=>{let{active:i,dragOverlay:l,transform:c,...d}=s;if(!t)return;const g={x:l.rect.left-i.rect.left,y:l.rect.top-i.rect.top},f={scaleX:c.scaleX!==1?i.rect.width*c.scaleX/l.rect.width:1,scaleY:c.scaleY!==1?i.rect.height*c.scaleY/l.rect.height:1},b={x:c.x-g.x,y:c.y-g.y,...f},p=o({...d,active:i,dragOverlay:l,transform:{initial:c,final:b}}),[w]=p,v=p[p.length-1];if(JSON.stringify(w)===JSON.stringify(v))return;const y=r==null?void 0:r({active:i,dragOverlay:l,...d}),S=l.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(C=>{S.onfinish=()=>{y==null||y(),C()}})}}let on=0;function Hs(e){return u.useMemo(()=>{if(e!=null)return on++,on},[e])}const Ws=M.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:i,wrapperElement:l="div",className:c,zIndex:d=999}=e;const{activatorEvent:g,active:f,activeNodeRect:b,containerNodeRect:p,draggableNodes:w,droppableContainers:v,dragOverlay:y,over:S,measuringConfiguration:C,scrollableAncestors:m,scrollableAncestorRects:E,windowRect:N}=Os(),R=u.useContext(tt),D=Hs(f==null?void 0:f.id),j=En(i,{activatorEvent:g,active:f,activeNodeRect:b,containerNodeRect:p,draggingNodeRect:y.rect,over:S,overlayNodeRect:y.rect,scrollableAncestors:m,scrollableAncestorRects:E,transform:R,windowRect:N}),k=jt(b),O=qs({config:r,draggableNodes:w,droppableContainers:v,measuringConfiguration:C}),A=k?y.setRef:void 0;return M.createElement(Bs,null,M.createElement(zs,{animation:O},f&&D?M.createElement(Ks,{key:D,id:f.id,ref:A,as:l,activatorEvent:g,adjustScale:t,className:c,transition:s,rect:k,style:{zIndex:d,...o},transform:j},n):null))}),Tn=[{status:"todo",label:"Todo",color:"rgb(var(--muted-foreground))"},{status:"doing",label:"In Progress",color:"rgb(var(--progress))"},{status:"review",label:"Review",color:"rgb(var(--warning))"},{status:"blocked",label:"Blocked",color:"rgb(var(--error))"},{status:"done",label:"Done",color:"rgb(var(--success))"}];Tn.map(e=>e.status);function ke(e){switch(e){case"todo":case"doing":case"review":case"blocked":case"done":return e;case"queued":return"todo";case"changes_requested":return"review";case"paused":return"blocked";case"cancelled":return null;default:return null}}function Gs(e){const t=ke(e);return t===null||t===e?null:e.replace(/_/g," ")}function kn({task:e,onDelete:t,onClick:n,isDragOverlay:r}){var S,C;const{attributes:o,listeners:s,setNodeRef:i,setActivatorNodeRef:l,transform:c,isDragging:d}=Ms({id:e.id,data:{type:"task",task:e}}),g=u.useRef(null),f={transform:Se.Translate.toString(c),opacity:d?.3:1},b=Gs(e.status),p=s==null?void 0:s.onPointerDown,w=m=>{g.current={x:m.clientX,y:m.clientY},p==null||p(m)},v=m=>{if(!n||!g.current)return;const E=Math.abs(m.clientX-g.current.x),N=Math.abs(m.clientY-g.current.y);g.current=null,E<5&&N<5&&n(e)},y=r?{}:{onPointerDown:w};return a.jsx("div",{ref:r?void 0:i,style:r?void 0:f,"data-testid":"kanban-card","data-task-id":e.id,"data-task-status":e.status,...y,onPointerUp:r?void 0:v,className:`
15
+ `},Rr={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Er(e){let{announcements:t=Rr,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Nr}=e;const{announce:s,announcement:i}=Cr(),l=Ze("DndLiveRegion"),[c,d]=u.useState(!1);if(u.useEffect(()=>{d(!0)},[]),Dr(u.useMemo(()=>({onDragStart(f){let{active:b}=f;s(t.onDragStart({active:b}))},onDragMove(f){let{active:b,over:p}=f;t.onDragMove&&s(t.onDragMove({active:b,over:p}))},onDragOver(f){let{active:b,over:p}=f;s(t.onDragOver({active:b,over:p}))},onDragEnd(f){let{active:b,over:p}=f;s(t.onDragEnd({active:b,over:p}))},onDragCancel(f){let{active:b,over:p}=f;s(t.onDragCancel({active:b,over:p}))}}),[s,t])),!c)return null;const g=M.createElement(M.Fragment,null,M.createElement(wr,{id:r,value:o.draggable}),M.createElement(Sr,{id:l,announcement:i}));return n?Te.createPortal(g,n):g}var P;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(P||(P={}));function We(){}function Ht(e,t){return u.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Tr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return u.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const J=Object.freeze({x:0,y:0});function kr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ar(e,t){const n=Ve(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Mr(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Or(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Vt(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function Pr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}const Lr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Vt(t),s=[];for(const i of r){const{id:l}=i,c=n.get(l);if(c){const d=Vt(c),g=o.reduce((b,p,w)=>b+kr(d[w],p),0),f=Number((g/4).toFixed(4));s.push({id:l,data:{droppableContainer:i,value:f}})}}return s.sort(Mr)};function Ir(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),i=o-r,l=s-n;if(r<o&&n<s){const c=t.width*t.height,d=e.width*e.height,g=i*l,f=g/(c+d-g);return Number(f.toFixed(4))}return 0}const zr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:i}=s,l=n.get(i);if(l){const c=Ir(l,t);c>0&&o.push({id:i,data:{droppableContainer:s,value:c}})}}return o.sort(Or)};function _r(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function gn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:J}function Br(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((i,l)=>({...i,top:i.top+e*l.y,bottom:i.bottom+e*l.y,left:i.left+e*l.x,right:i.right+e*l.x}),{...n})}}const $r=Br(1);function pn(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Fr(e,t,n){const r=pn(t);if(!r)return e;const{scaleX:o,scaleY:s,x:i,y:l}=r,c=e.left-i-(1-o)*parseFloat(n),d=e.top-l-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),g=o?e.width/o:e.width,f=s?e.height/s:e.height;return{width:g,height:f,top:d,right:c+g,bottom:d+f,left:c}}const Ur={ignoreTransform:!1};function _e(e,t){t===void 0&&(t=Ur);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:g}=_(e).getComputedStyle(e);d&&(n=Fr(n,d,g))}const{top:r,left:o,width:s,height:i,bottom:l,right:c}=n;return{top:r,left:o,width:s,height:i,bottom:l,right:c}}function Wt(e){return _e(e,{ignoreTransform:!0})}function Kr(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Xr(e,t){return t===void 0&&(t=_(e).getComputedStyle(e)),t.position==="fixed"}function Yr(e,t){t===void 0&&(t=_(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function yt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(mt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Ie(o)||dn(o)||n.includes(o))return n;const s=_(e).getComputedStyle(o);return o!==e&&Yr(o,s)&&n.push(o),Xr(o,s)?n:r(o.parentNode)}return e?r(e):n}function bn(e){const[t]=yt(e,1);return t??null}function lt(e){return!Je||!e?null:Ce(e)?e:vt(e)?mt(e)||e===De(e).scrollingElement?window:Ie(e)?e:null:null}function vn(e){return Ce(e)?e.scrollX:e.scrollLeft}function mn(e){return Ce(e)?e.scrollY:e.scrollTop}function gt(e){return{x:vn(e),y:mn(e)}}var L;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(L||(L={}));function xn(e){return!Je||!e?!1:e===document.scrollingElement}function yn(e){const t={x:0,y:0},n=xn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,i=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:l,maxScroll:r,minScroll:t}}const qr={x:.2,y:.2};function Hr(e,t,n,r,o){let{top:s,left:i,right:l,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=qr);const{isTop:d,isBottom:g,isLeft:f,isRight:b}=yn(e),p={x:0,y:0},w={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!d&&s<=t.top+v.height?(p.y=L.Backward,w.y=r*Math.abs((t.top+v.height-s)/v.height)):!g&&c>=t.bottom-v.height&&(p.y=L.Forward,w.y=r*Math.abs((t.bottom-v.height-c)/v.height)),!b&&l>=t.right-v.width?(p.x=L.Forward,w.x=r*Math.abs((t.right-v.width-l)/v.width)):!f&&i<=t.left+v.width&&(p.x=L.Backward,w.x=r*Math.abs((t.left+v.width-i)/v.width)),{direction:p,speed:w}}function Vr(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:i}=window;return{top:0,left:0,right:s,bottom:i,width:s,height:i}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function wn(e){return e.reduce((t,n)=>we(t,gt(n)),J)}function Wr(e){return e.reduce((t,n)=>t+vn(n),0)}function Gr(e){return e.reduce((t,n)=>t+mn(n),0)}function Sn(e,t){if(t===void 0&&(t=_e),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);bn(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Jr=[["x",["left","right"],Wr],["y",["top","bottom"],Gr]];class wt{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=yt(n),o=wn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,l]of Jr)for(const c of i)Object.defineProperty(this,c,{get:()=>{const d=l(r),g=o[s]-d;return this.rect[c]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ae{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Qr(e){const{EventTarget:t}=_(e);return e instanceof t?e:De(e)}function ct(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var H;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(H||(H={}));function Gt(e){e.preventDefault()}function Zr(e){e.stopPropagation()}var T;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(T||(T={}));const Cn={start:[T.Space,T.Enter],cancel:[T.Esc],end:[T.Space,T.Enter,T.Tab]},es=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case T.Right:return{...n,x:n.x+25};case T.Left:return{...n,x:n.x-25};case T.Down:return{...n,y:n.y+25};case T.Up:return{...n,y:n.y-25}}};class St{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ae(De(n)),this.windowListeners=new Ae(_(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(H.Resize,this.handleCancel),this.windowListeners.add(H.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(H.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Sn(r),n(J)}handleKeyDown(t){if(xt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=Cn,coordinateGetter:i=es,scrollBehavior:l="smooth"}=o,{code:c}=t;if(s.end.includes(c)){this.handleEnd(t);return}if(s.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:d}=r.current,g=d?{x:d.left,y:d.top}:J;this.referenceCoordinates||(this.referenceCoordinates=g);const f=i(t,{active:n,context:r.current,currentCoordinates:g});if(f){const b=He(f,g),p={x:0,y:0},{scrollableAncestors:w}=r.current;for(const v of w){const y=t.code,{isTop:S,isRight:C,isLeft:m,isBottom:E,maxScroll:N,minScroll:R}=yn(v),D=Vr(v),j={x:Math.min(y===T.Right?D.right-D.width/2:D.right,Math.max(y===T.Right?D.left:D.left+D.width/2,f.x)),y:Math.min(y===T.Down?D.bottom-D.height/2:D.bottom,Math.max(y===T.Down?D.top:D.top+D.height/2,f.y))},k=y===T.Right&&!C||y===T.Left&&!m,O=y===T.Down&&!E||y===T.Up&&!S;if(k&&j.x!==f.x){const A=v.scrollLeft+b.x,V=y===T.Right&&A<=N.x||y===T.Left&&A>=R.x;if(V&&!b.y){v.scrollTo({left:A,behavior:l});return}V?p.x=v.scrollLeft-A:p.x=y===T.Right?v.scrollLeft-N.x:v.scrollLeft-R.x,p.x&&v.scrollBy({left:-p.x,behavior:l});break}else if(O&&j.y!==f.y){const A=v.scrollTop+b.y,V=y===T.Down&&A<=N.y||y===T.Up&&A>=R.y;if(V&&!b.x){v.scrollTo({top:A,behavior:l});return}V?p.y=v.scrollTop-A:p.y=y===T.Down?v.scrollTop-N.y:v.scrollTop-R.y,p.y&&v.scrollBy({top:-p.y,behavior:l});break}}this.handleMove(t,we(He(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}St.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Cn,onActivation:o}=t,{active:s}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const l=s.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Jt(e){return!!(e&&"distance"in e)}function Qt(e){return!!(e&&"delay"in e)}class Ct{constructor(t,n,r){var o;r===void 0&&(r=Qr(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:i}=s;this.props=t,this.events=n,this.document=De(i),this.documentListeners=new Ae(this.document),this.listeners=new Ae(r),this.windowListeners=new Ae(_(i)),this.initialCoordinates=(o=Ve(s))!=null?o:J,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(H.Resize,this.handleCancel),this.windowListeners.add(H.DragStart,Gt),this.windowListeners.add(H.VisibilityChange,this.handleCancel),this.windowListeners.add(H.ContextMenu,Gt),this.documentListeners.add(H.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Qt(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Jt(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(H.Click,Zr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(H.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:l}}=s;if(!o)return;const c=(n=Ve(t))!=null?n:J,d=He(o,c);if(!r&&l){if(Jt(l)){if(l.tolerance!=null&&ct(d,l.tolerance))return this.handleCancel();if(ct(d,l.distance))return this.handleStart()}if(Qt(l)&&ct(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}t.cancelable&&t.preventDefault(),i(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===T.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const ts={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Dt extends Ct{constructor(t){const{event:n}=t,r=De(n.target);super(t,ts,r)}}Dt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const ns={move:{name:"mousemove"},end:{name:"mouseup"}};var pt;(function(e){e[e.RightClick=2]="RightClick"})(pt||(pt={}));class rs extends Ct{constructor(t){super(t,ns,De(t.event.target))}}rs.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===pt.RightClick?!1:(r==null||r({event:n}),!0)}}];const ut={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ss extends Ct{constructor(t){super(t,ut)}static setup(){return window.addEventListener(ut.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ut.move.name,t)};function t(){}}}ss.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Me;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Me||(Me={}));var Ge;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ge||(Ge={}));function os(e){let{acceleration:t,activator:n=Me.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:l=Ge.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:g,delta:f,threshold:b}=e;const p=is({delta:f,disabled:!s}),[w,v]=br(),y=u.useRef({x:0,y:0}),S=u.useRef({x:0,y:0}),C=u.useMemo(()=>{switch(n){case Me.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Me.DraggableRect:return o}},[n,o,c]),m=u.useRef(null),E=u.useCallback(()=>{const R=m.current;if(!R)return;const D=y.current.x*S.current.x,j=y.current.y*S.current.y;R.scrollBy(D,j)},[]),N=u.useMemo(()=>l===Ge.TreeOrder?[...d].reverse():d,[l,d]);u.useEffect(()=>{if(!s||!d.length||!C){v();return}for(const R of N){if((r==null?void 0:r(R))===!1)continue;const D=d.indexOf(R),j=g[D];if(!j)continue;const{direction:k,speed:O}=Hr(R,j,C,t,b);for(const A of["x","y"])p[A][k[A]]||(O[A]=0,k[A]=0);if(O.x>0||O.y>0){v(),m.current=R,w(E,i),y.current=O,S.current=k;return}}y.current={x:0,y:0},S.current={x:0,y:0},v()},[t,E,r,v,s,i,JSON.stringify(C),JSON.stringify(p),w,d,N,g,JSON.stringify(b)])}const as={x:{[L.Backward]:!1,[L.Forward]:!1},y:{[L.Backward]:!1,[L.Forward]:!1}};function is(e){let{delta:t,disabled:n}=e;const r=qe(t);return ze(o=>{if(n||!r||!o)return as;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[L.Backward]:o.x[L.Backward]||s.x===-1,[L.Forward]:o.x[L.Forward]||s.x===1},y:{[L.Backward]:o.y[L.Backward]||s.y===-1,[L.Forward]:o.y[L.Forward]||s.y===1}}},[n,t,r])}function ls(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return ze(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function cs(e,t){return u.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,r)}));return[...n,...s]},[]),[e,t])}var Le;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Le||(Le={}));var bt;(function(e){e.Optimized="optimized"})(bt||(bt={}));const Zt=new Map;function us(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,i]=u.useState(null),{frequency:l,measure:c,strategy:d}=o,g=u.useRef(e),f=y(),b=Pe(f),p=u.useCallback(function(S){S===void 0&&(S=[]),!b.current&&i(C=>C===null?S:C.concat(S.filter(m=>!C.includes(m))))},[b]),w=u.useRef(null),v=ze(S=>{if(f&&!n)return Zt;if(!S||S===Zt||g.current!==e||s!=null){const C=new Map;for(let m of e){if(!m)continue;if(s&&s.length>0&&!s.includes(m.id)&&m.rect.current){C.set(m.id,m.rect.current);continue}const E=m.node.current,N=E?new wt(c(E),E):null;m.rect.current=N,N&&C.set(m.id,N)}return C}return S},[e,s,n,f,c]);return u.useEffect(()=>{g.current=e},[e]),u.useEffect(()=>{f||p()},[n,f]),u.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),u.useEffect(()=>{f||typeof l!="number"||w.current!==null||(w.current=setTimeout(()=>{p(),w.current=null},l))},[l,f,p,...r]),{droppableRects:v,measureDroppableContainers:p,measuringScheduled:s!=null};function y(){switch(d){case Le.Always:return!1;case Le.BeforeDragging:return n;default:return!n}}}function jt(e,t){return ze(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function ds(e,t){return jt(e,t)}function fs(e){let{callback:t,disabled:n}=e;const r=Qe(t),o=u.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return u.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function et(e){let{callback:t,disabled:n}=e;const r=Qe(t),o=u.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return u.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function hs(e){return new wt(_e(e),e)}function en(e,t,n){t===void 0&&(t=hs);const[r,o]=u.useState(null);function s(){o(c=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=c??n)!=null?d:null}const g=t(e);return JSON.stringify(c)===JSON.stringify(g)?c:g})}const i=fs({callback(c){if(e)for(const d of c){const{type:g,target:f}=d;if(g==="childList"&&f instanceof HTMLElement&&f.contains(e)){s();break}}}}),l=et({callback:s});return ae(()=>{s(),e?(l==null||l.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),i==null||i.disconnect())},[e]),r}function gs(e){const t=jt(e);return gn(e,t)}const tn=[];function ps(e){const t=u.useRef(e),n=ze(r=>e?r&&r!==tn&&e&&t.current&&e.parentNode===t.current.parentNode?r:yt(e):tn,[e]);return u.useEffect(()=>{t.current=e},[e]),n}function bs(e){const[t,n]=u.useState(null),r=u.useRef(e),o=u.useCallback(s=>{const i=lt(s.target);i&&n(l=>l?(l.set(i,gt(i)),new Map(l)):null)},[]);return u.useEffect(()=>{const s=r.current;if(e!==s){i(s);const l=e.map(c=>{const d=lt(c);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,gt(d)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=e}return()=>{i(e),i(s)};function i(l){l.forEach(c=>{const d=lt(c);d==null||d.removeEventListener("scroll",o)})}},[o,e]),u.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>we(s,i),J):wn(e):J,[e,t])}function nn(e,t){t===void 0&&(t=[]);const n=u.useRef(null);return u.useEffect(()=>{n.current=null},t),u.useEffect(()=>{const r=e!==J;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?He(e,n.current):J}function vs(e){u.useEffect(()=>{if(!Je)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function ms(e,t){return u.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,t)},n},{}),[e,t])}function Dn(e){return u.useMemo(()=>e?Kr(e):null,[e])}const rn=[];function xs(e,t){t===void 0&&(t=_e);const[n]=e,r=Dn(n?_(n):null),[o,s]=u.useState(rn);function i(){s(()=>e.length?e.map(c=>xn(c)?r:new wt(t(c),c)):rn)}const l=et({callback:i});return ae(()=>{l==null||l.disconnect(),i(),e.forEach(c=>l==null?void 0:l.observe(c))},[e]),o}function jn(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ie(t)?t:e}function ys(e){let{measure:t}=e;const[n,r]=u.useState(null),o=u.useCallback(d=>{for(const{target:g}of d)if(Ie(g)){r(f=>{const b=t(g);return f?{...f,width:b.width,height:b.height}:b});break}},[t]),s=et({callback:o}),i=u.useCallback(d=>{const g=jn(d);s==null||s.disconnect(),g&&(s==null||s.observe(g)),r(g?t(g):null)},[t,s]),[l,c]=Ye(i);return u.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const ws=[{sensor:Dt,options:{}},{sensor:St,options:{}}],Ss={current:{}},Xe={draggable:{measure:Wt},droppable:{measure:Wt,strategy:Le.WhileDragging,frequency:bt.Optimized},dragOverlay:{measure:_e}};class Oe extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Cs={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Oe,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:We},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Xe,measureDroppableContainers:We,windowRect:null,measuringScheduled:!1},Nn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:We,draggableNodes:new Map,over:null,measureDroppableContainers:We},Be=u.createContext(Nn),Rn=u.createContext(Cs);function Ds(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Oe}}}function js(e,t){switch(t.type){case P.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case P.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case P.DragEnd:case P.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case P.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Oe(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case P.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new Oe(e.droppable.containers);return i.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case P.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new Oe(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Ns(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=u.useContext(Be),s=qe(r),i=qe(n==null?void 0:n.id);return u.useEffect(()=>{if(!t&&!r&&s&&i!=null){if(!xt(s)||document.activeElement===s.target)return;const l=o.get(i);if(!l)return;const{activatorNode:c,node:d}=l;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const g of[c.current,d.current]){if(!g)continue;const f=xr(g);if(f){f.focus();break}}})}},[r,t,o,i,s]),null}function En(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function Rs(e){return u.useMemo(()=>({draggable:{...Xe.draggable,...e==null?void 0:e.draggable},droppable:{...Xe.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Xe.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Es(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=u.useRef(!1),{x:i,y:l}=typeof o=="boolean"?{x:o,y:o}:o;ae(()=>{if(!i&&!l||!t){s.current=!1;return}if(s.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const g=n(d),f=gn(g,r);if(i||(f.x=0),l||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const b=bn(d);b&&b.scrollBy({top:f.y,left:f.x})}},[t,i,l,r,n])}const tt=u.createContext({...J,scaleX:1,scaleY:1});var fe;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(fe||(fe={}));const Ts=u.memo(function(t){var n,r,o,s;let{id:i,accessibility:l,autoScroll:c=!0,children:d,sensors:g=ws,collisionDetection:f=zr,measuring:b,modifiers:p,...w}=t;const v=u.useReducer(js,void 0,Ds),[y,S]=v,[C,m]=jr(),[E,N]=u.useState(fe.Uninitialized),R=E===fe.Initialized,{draggable:{active:D,nodes:j,translate:k},droppable:{containers:O}}=y,A=D!=null?j.get(D):null,V=u.useRef({initial:null,translated:null}),B=u.useMemo(()=>{var z;return D!=null?{id:D,data:(z=A==null?void 0:A.data)!=null?z:Ss,rect:V}:null},[D,A]),$=u.useRef(null),[re,pe]=u.useState(null),[X,$e]=u.useState(null),se=Pe(w,Object.values(w)),be=Ze("DndDescribedBy",i),h=u.useMemo(()=>O.getEnabled(),[O]),x=Rs(b),{droppableRects:Y,measureDroppableContainers:Q,measuringScheduled:Nt}=us(h,{dragging:R,dependencies:[k.x,k.y],config:x.droppable}),W=ls(j,D),Rt=u.useMemo(()=>X?Ve(X):null,[X]),Et=_n(),Tt=ds(W,x.draggable.measure);Es({activeNode:D!=null?j.get(D):null,config:Et.layoutShiftCompensation,initialRect:Tt,measure:x.draggable.measure});const G=en(W,x.draggable.measure,Tt),nt=en(W?W.parentElement:null),he=u.useRef({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),kt=O.getNodeFor((n=he.current.over)==null?void 0:n.id),ge=ys({measure:x.dragOverlay.measure}),Fe=(r=ge.nodeRef.current)!=null?r:W,ve=R?(o=ge.rect)!=null?o:G:null,At=!!(ge.nodeRef.current&&ge.rect),Mt=gs(At?null:G),rt=Dn(Fe?_(Fe):null),ie=ps(R?kt??W:null),Ue=xs(ie),Ke=En(p,{transform:{x:k.x-Mt.x,y:k.y-Mt.y,scaleX:1,scaleY:1},activatorEvent:X,active:B,activeNodeRect:G,containerNodeRect:nt,draggingNodeRect:ve,over:he.current.over,overlayNodeRect:ge.rect,scrollableAncestors:ie,scrollableAncestorRects:Ue,windowRect:rt}),Ot=Rt?we(Rt,k):null,Pt=bs(ie),An=nn(Pt),Mn=nn(Pt,[G]),me=we(Ke,An),xe=ve?$r(ve,Ke):null,je=B&&xe?f({active:B,collisionRect:xe,droppableRects:Y,droppableContainers:h,pointerCoordinates:Ot}):null,Lt=Pr(je,"id"),[le,It]=u.useState(null),On=At?Ke:we(Ke,Mn),Pn=_r(On,(s=le==null?void 0:le.rect)!=null?s:null,G),st=u.useRef(null),zt=u.useCallback((z,F)=>{let{sensor:U,options:ce}=F;if($.current==null)return;const q=j.get($.current);if(!q)return;const K=z.nativeEvent,Z=new U({active:$.current,activeNode:q,event:K,options:ce,context:he,onAbort(I){if(!j.get(I))return;const{onDragAbort:ee}=se.current,oe={id:I};ee==null||ee(oe),C({type:"onDragAbort",event:oe})},onPending(I,ue,ee,oe){if(!j.get(I))return;const{onDragPending:Re}=se.current,de={id:I,constraint:ue,initialCoordinates:ee,offset:oe};Re==null||Re(de),C({type:"onDragPending",event:de})},onStart(I){const ue=$.current;if(ue==null)return;const ee=j.get(ue);if(!ee)return;const{onDragStart:oe}=se.current,Ne={activatorEvent:K,active:{id:ue,data:ee.data,rect:V}};Te.unstable_batchedUpdates(()=>{oe==null||oe(Ne),N(fe.Initializing),S({type:P.DragStart,initialCoordinates:I,active:ue}),C({type:"onDragStart",event:Ne}),pe(st.current),$e(K)})},onMove(I){S({type:P.DragMove,coordinates:I})},onEnd:ye(P.DragEnd),onCancel:ye(P.DragCancel)});st.current=Z;function ye(I){return async function(){const{active:ee,collisions:oe,over:Ne,scrollAdjustedTranslate:Re}=he.current;let de=null;if(ee&&Re){const{cancelDrop:Ee}=se.current;de={activatorEvent:K,active:ee,collisions:oe,delta:Re,over:Ne},I===P.DragEnd&&typeof Ee=="function"&&await Promise.resolve(Ee(de))&&(I=P.DragCancel)}$.current=null,Te.unstable_batchedUpdates(()=>{S({type:I}),N(fe.Uninitialized),It(null),pe(null),$e(null),st.current=null;const Ee=I===P.DragEnd?"onDragEnd":"onDragCancel";if(de){const ot=se.current[Ee];ot==null||ot(de),C({type:Ee,event:de})}})}}},[j]),Ln=u.useCallback((z,F)=>(U,ce)=>{const q=U.nativeEvent,K=j.get(ce);if($.current!==null||!K||q.dndKit||q.defaultPrevented)return;const Z={active:K};z(U,F.options,Z)===!0&&(q.dndKit={capturedBy:F.sensor},$.current=ce,zt(U,F))},[j,zt]),_t=cs(g,Ln);vs(g),ae(()=>{G&&E===fe.Initializing&&N(fe.Initialized)},[G,E]),u.useEffect(()=>{const{onDragMove:z}=se.current,{active:F,activatorEvent:U,collisions:ce,over:q}=he.current;if(!F||!U)return;const K={active:F,activatorEvent:U,collisions:ce,delta:{x:me.x,y:me.y},over:q};Te.unstable_batchedUpdates(()=>{z==null||z(K),C({type:"onDragMove",event:K})})},[me.x,me.y]),u.useEffect(()=>{const{active:z,activatorEvent:F,collisions:U,droppableContainers:ce,scrollAdjustedTranslate:q}=he.current;if(!z||$.current==null||!F||!q)return;const{onDragOver:K}=se.current,Z=ce.get(Lt),ye=Z&&Z.rect.current?{id:Z.id,rect:Z.rect.current,data:Z.data,disabled:Z.disabled}:null,I={active:z,activatorEvent:F,collisions:U,delta:{x:q.x,y:q.y},over:ye};Te.unstable_batchedUpdates(()=>{It(ye),K==null||K(I),C({type:"onDragOver",event:I})})},[Lt]),ae(()=>{he.current={activatorEvent:X,active:B,activeNode:W,collisionRect:xe,collisions:je,droppableRects:Y,draggableNodes:j,draggingNode:Fe,draggingNodeRect:ve,droppableContainers:O,over:le,scrollableAncestors:ie,scrollAdjustedTranslate:me},V.current={initial:ve,translated:xe}},[B,W,je,xe,j,Fe,ve,Y,O,le,ie,me]),os({...Et,delta:k,draggingRect:xe,pointerCoordinates:Ot,scrollableAncestors:ie,scrollableAncestorRects:Ue});const In=u.useMemo(()=>({active:B,activeNode:W,activeNodeRect:G,activatorEvent:X,collisions:je,containerNodeRect:nt,dragOverlay:ge,draggableNodes:j,droppableContainers:O,droppableRects:Y,over:le,measureDroppableContainers:Q,scrollableAncestors:ie,scrollableAncestorRects:Ue,measuringConfiguration:x,measuringScheduled:Nt,windowRect:rt}),[B,W,G,X,je,nt,ge,j,O,Y,le,Q,ie,Ue,x,Nt,rt]),zn=u.useMemo(()=>({activatorEvent:X,activators:_t,active:B,activeNodeRect:G,ariaDescribedById:{draggable:be},dispatch:S,draggableNodes:j,over:le,measureDroppableContainers:Q}),[X,_t,B,G,S,be,j,le,Q]);return M.createElement(hn.Provider,{value:m},M.createElement(Be.Provider,{value:zn},M.createElement(Rn.Provider,{value:In},M.createElement(tt.Provider,{value:Pn},d)),M.createElement(Ns,{disabled:(l==null?void 0:l.restoreFocus)===!1})),M.createElement(Er,{...l,hiddenTextDescribedById:be}));function _n(){const z=(re==null?void 0:re.autoScrollEnabled)===!1,F=typeof c=="object"?c.enabled===!1:c===!1,U=R&&!z&&!F;return typeof c=="object"?{...c,enabled:U}:{enabled:U}}}),ks=u.createContext(null),sn="button",As="Draggable";function Ms(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=Ze(As),{activators:i,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:g,draggableNodes:f,over:b}=u.useContext(Be),{role:p=sn,roleDescription:w="draggable",tabIndex:v=0}=o??{},y=(c==null?void 0:c.id)===t,S=u.useContext(y?tt:ks),[C,m]=Ye(),[E,N]=Ye(),R=ms(i,t),D=Pe(n);ae(()=>(f.set(t,{id:t,key:s,node:C,activatorNode:E,data:D}),()=>{const k=f.get(t);k&&k.key===s&&f.delete(t)}),[f,t]);const j=u.useMemo(()=>({role:p,tabIndex:v,"aria-disabled":r,"aria-pressed":y&&p===sn?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[r,p,v,y,w,g.draggable]);return{active:c,activatorEvent:l,activeNodeRect:d,attributes:j,isDragging:y,listeners:r?void 0:R,node:C,over:b,setNodeRef:m,setActivatorNodeRef:N,transform:S}}function Os(){return u.useContext(Rn)}const Ps="Droppable",Ls={timeout:25};function Is(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=Ze(Ps),{active:i,dispatch:l,over:c,measureDroppableContainers:d}=u.useContext(Be),g=u.useRef({disabled:n}),f=u.useRef(!1),b=u.useRef(null),p=u.useRef(null),{disabled:w,updateMeasurementsFor:v,timeout:y}={...Ls,...o},S=Pe(v??r),C=u.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(S.current)?S.current:[S.current]),p.current=null},y)},[y]),m=et({callback:C,disabled:w||!i}),E=u.useCallback((j,k)=>{m&&(k&&(m.unobserve(k),f.current=!1),j&&m.observe(j))},[m]),[N,R]=Ye(E),D=Pe(t);return u.useEffect(()=>{!m||!N.current||(m.disconnect(),f.current=!1,m.observe(N.current))},[N,m]),u.useEffect(()=>(l({type:P.RegisterDroppable,element:{id:r,key:s,disabled:n,node:N,rect:b,data:D}}),()=>l({type:P.UnregisterDroppable,key:s,id:r})),[r]),u.useEffect(()=>{n!==g.current.disabled&&(l({type:P.SetDroppableDisabled,id:r,key:s,disabled:n}),g.current.disabled=n)},[r,s,n,l]),{active:i,rect:b,isOver:(c==null?void 0:c.id)===r,node:N,over:c,setNodeRef:R}}function zs(e){let{animation:t,children:n}=e;const[r,o]=u.useState(null),[s,i]=u.useState(null),l=qe(n);return!n&&!r&&l&&o(l),ae(()=>{if(!s)return;const c=r==null?void 0:r.key,d=r==null?void 0:r.props.id;if(c==null||d==null){o(null);return}Promise.resolve(t(d,s)).then(()=>{o(null)})},[t,r,s]),M.createElement(M.Fragment,null,n,r?u.cloneElement(r,{ref:i}):null)}const _s={x:0,y:0,scaleX:1,scaleY:1};function Bs(e){let{children:t}=e;return M.createElement(Be.Provider,{value:Nn},M.createElement(tt.Provider,{value:_s},t))}const $s={position:"fixed",touchAction:"none"},Fs=e=>xt(e)?"transform 250ms ease":void 0,Us=u.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:i,rect:l,style:c,transform:d,transition:g=Fs}=e;if(!l)return null;const f=o?d:{...d,scaleX:1,scaleY:1},b={...$s,width:l.width,height:l.height,top:l.top,left:l.left,transform:Se.Transform.toString(f),transformOrigin:o&&r?Ar(r,l):void 0,transition:typeof g=="function"?g(r):g,...c};return M.createElement(n,{className:i,style:b,ref:t},s)}),Ks=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:s,className:i}=e;if(s!=null&&s.active)for(const[l,c]of Object.entries(s.active))c!==void 0&&(o[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,c));if(s!=null&&s.dragOverlay)for(const[l,c]of Object.entries(s.dragOverlay))c!==void 0&&r.node.style.setProperty(l,c);return i!=null&&i.active&&n.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[c,d]of Object.entries(o))n.node.style.setProperty(c,d);i!=null&&i.active&&n.node.classList.remove(i.active)}},Xs=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Se.Transform.toString(t)},{transform:Se.Transform.toString(n)}]},Ys={duration:250,easing:"ease",keyframes:Xs,sideEffects:Ks({styles:{active:{opacity:"0"}}})};function qs(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Qe((s,i)=>{if(t===null)return;const l=n.get(s);if(!l)return;const c=l.node.current;if(!c)return;const d=jn(i);if(!d)return;const{transform:g}=_(i).getComputedStyle(i),f=pn(g);if(!f)return;const b=typeof t=="function"?t:Hs(t);return Sn(c,o.draggable.measure),b({active:{id:s,data:l.data,node:c,rect:o.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:o,transform:f})})}function Hs(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Ys,...e};return s=>{let{active:i,dragOverlay:l,transform:c,...d}=s;if(!t)return;const g={x:l.rect.left-i.rect.left,y:l.rect.top-i.rect.top},f={scaleX:c.scaleX!==1?i.rect.width*c.scaleX/l.rect.width:1,scaleY:c.scaleY!==1?i.rect.height*c.scaleY/l.rect.height:1},b={x:c.x-g.x,y:c.y-g.y,...f},p=o({...d,active:i,dragOverlay:l,transform:{initial:c,final:b}}),[w]=p,v=p[p.length-1];if(JSON.stringify(w)===JSON.stringify(v))return;const y=r==null?void 0:r({active:i,dragOverlay:l,...d}),S=l.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(C=>{S.onfinish=()=>{y==null||y(),C()}})}}let on=0;function Vs(e){return u.useMemo(()=>{if(e!=null)return on++,on},[e])}const Ws=M.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:i,wrapperElement:l="div",className:c,zIndex:d=999}=e;const{activatorEvent:g,active:f,activeNodeRect:b,containerNodeRect:p,draggableNodes:w,droppableContainers:v,dragOverlay:y,over:S,measuringConfiguration:C,scrollableAncestors:m,scrollableAncestorRects:E,windowRect:N}=Os(),R=u.useContext(tt),D=Vs(f==null?void 0:f.id),j=En(i,{activatorEvent:g,active:f,activeNodeRect:b,containerNodeRect:p,draggingNodeRect:y.rect,over:S,overlayNodeRect:y.rect,scrollableAncestors:m,scrollableAncestorRects:E,transform:R,windowRect:N}),k=jt(b),O=qs({config:r,draggableNodes:w,droppableContainers:v,measuringConfiguration:C}),A=k?y.setRef:void 0;return M.createElement(Bs,null,M.createElement(zs,{animation:O},f&&D?M.createElement(Us,{key:D,id:f.id,ref:A,as:l,activatorEvent:g,adjustScale:t,className:c,transition:s,rect:k,style:{zIndex:d,...o},transform:j},n):null))}),Tn=[{status:"todo",label:"Todo",color:"rgb(var(--muted-foreground))"},{status:"doing",label:"In Progress",color:"rgb(var(--progress))"},{status:"review",label:"Review",color:"rgb(var(--warning))"},{status:"blocked",label:"Blocked",color:"rgb(var(--error))"},{status:"done",label:"Done",color:"rgb(var(--success))"}];Tn.map(e=>e.status);function ke(e){switch(e){case"todo":case"doing":case"review":case"blocked":case"done":return e;case"queued":return"todo";case"changes_requested":return"review";case"paused":return"blocked";case"cancelled":return null;default:return null}}function Gs(e){const t=ke(e);return t===null||t===e?null:e.replace(/_/g," ")}function kn({task:e,onDelete:t,onClick:n,isDragOverlay:r}){var S,C;const{attributes:o,listeners:s,setNodeRef:i,setActivatorNodeRef:l,transform:c,isDragging:d}=Ms({id:e.id,data:{type:"task",task:e}}),g=u.useRef(null),f={transform:Se.Translate.toString(c),opacity:d?.3:1},b=Gs(e.status),p=s==null?void 0:s.onPointerDown,w=m=>{g.current={x:m.clientX,y:m.clientY},p==null||p(m)},v=m=>{if(!n||!g.current)return;const E=Math.abs(m.clientX-g.current.x),N=Math.abs(m.clientY-g.current.y);g.current=null,E<5&&N<5&&n(e)},y=r?{}:{onPointerDown:w};return a.jsx("div",{ref:r?void 0:i,style:r?void 0:f,"data-testid":"kanban-card","data-task-id":e.id,"data-task-status":e.status,...y,onPointerUp:r?void 0:v,className:`
16
16
  group relative bg-background border-b border-border/65 rounded-md
17
17
  cursor-grab active:cursor-grabbing
18
18
  hover:bg-surface-high
@@ -29,6 +29,6 @@ import{c as an,r as u,bv as M,bw as Te,j as a,at as ft,u as Bn,a as $n,Y as ln,b
29
29
  transition-all duration-200
30
30
  ${d}
31
31
  `,children:[a.jsx("div",{className:"flex-shrink-0 px-3 py-2.5 border-b border-border",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{backgroundColor:n}}),a.jsx("span",{className:"font-label text-sm font-medium text-on-surface-variant",children:t})]}),a.jsx("span",{className:`text-[11px] font-label px-1.5 py-0.5 rounded-sm
32
- text-outline`,children:r.length})]})}),a.jsxs("div",{ref:l,"data-testid":"kanban-column","data-column-status":e,"data-drop-target":c,className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[100px]",children:[r.map(g=>a.jsx(kn,{task:g,onDelete:o,onClick:s},g.id)),r.length===0&&a.jsx("div",{className:"flex items-center justify-center h-16 text-outline text-sm font-label",children:"Empty"})]})]})}function eo({tasks:e,onUpdateStatus:t,onDeleteTask:n,onCardClick:r}){const[o,s]=u.useState(null),i=Tr(Vt(Dt,{activationConstraint:{distance:5}}),Vt(St)),l=u.useMemo(()=>{const f={todo:[],doing:[],review:[],blocked:[],done:[]};for(const b of e){const p=ke(b.status);p&&f[p].push(b)}return f},[e]);function c(f){var p;const b=(p=f.active.data.current)==null?void 0:p.task;b&&s(b)}function d(f){var y,S,C;const{active:b,over:p}=f;if(s(null),!p)return;const w=(y=b.data.current)==null?void 0:y.task;if(!w)return;let v;if(((S=p.data.current)==null?void 0:S.type)==="column")v=p.data.current.status;else if(((C=p.data.current)==null?void 0:C.type)==="task"){const m=p.data.current.task,E=ke(m.status);E&&(v=E)}v&&ke(w.status)!==v&&t(w.id,v)}function g(f){return!o||ke(o.status)===f?null:!0}return a.jsxs(Ts,{sensors:i,collisionDetection:Lr,onDragStart:c,onDragEnd:d,children:[a.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-4 pb-4 md:flex-row md:overflow-x-auto",children:Tn.map(f=>a.jsx(Zs,{status:f.status,label:f.label,color:f.color,tasks:l[f.status],onDeleteTask:n,onCardClick:r,isValidDrop:g(f.status)},f.status))}),a.jsx(Qs,{activeTask:o})]})}function to({projectId:e}){var i,l,c,d,g,f,b;const[t,n]=u.useState("relevant"),[r,o]=u.useState(!1),s=Bn({queryKey:["github",e,t],queryFn:()=>ht.git.githubItems(t,e),enabled:r,staleTime:3e4,retry:!1});return a.jsxs("section",{className:"border-b border-surface-highest p-3 text-xs space-y-2",children:[a.jsx("button",{type:"button","data-testid":"github-board-toggle",onClick:()=>o(!r),className:"text-primary",children:r?"Hide GitHub":"GitHub issues / PRs"}),r&&a.jsxs("div",{"data-testid":"github-board",className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap gap-3 items-center",children:[a.jsxs("label",{children:["Show"," ",a.jsxs("select",{"data-testid":"github-filter",value:t,onChange:p=>n(p.target.value),className:"bg-surface-highest p-1",children:[a.jsx("option",{value:"relevant",children:"My work (branches + assignee + linked)"}),a.jsx("option",{value:"branches",children:"Current branches / worktrees + linked"}),a.jsx("option",{value:"assigned",children:"Assigned to me"}),a.jsx("option",{value:"all",children:"All open items in known repositories"})]})]}),a.jsx("button",{type:"button","data-testid":"github-refresh",onClick:()=>void s.refetch(),children:"Refresh"}),((i=s.data)==null?void 0:i.login)&&a.jsxs("span",{"data-testid":"github-auth",children:[s.data.login," · ",s.data.auth]})]}),s.isFetching&&a.jsx("p",{children:"Loading GitHub…"}),s.error&&a.jsx("p",{role:"alert",children:s.error.message}),((l=s.data)==null?void 0:l.auth)==="none"&&a.jsx("p",{"data-testid":"github-no-auth",children:"Sign in with gh auth login, or configure github.token / ORC_GITHUB_TOKEN on the API machine."}),((c=s.data)==null?void 0:c.auth)!=="none"&&((d=s.data)==null?void 0:d.items.length)===0&&a.jsx("p",{"data-testid":"github-empty",children:"No matching open issues or PRs. Add a project repository folder, launch a terminal there, or choose a broader filter."}),((g=s.data)==null?void 0:g.truncated)&&a.jsx("p",{role:"alert",children:"Results limited by repository, pagination or request time budget. Narrow the project scope."}),(f=s.data)==null?void 0:f.errors.map(p=>a.jsxs("p",{role:"alert",children:[p.repo,": ",p.error]},p.repo)),a.jsx("div",{className:"grid gap-2 md:grid-cols-2 xl:grid-cols-3 max-h-80 overflow-auto",children:(b=s.data)==null?void 0:b.items.map(p=>a.jsx(no,{item:p,projectId:e},p.url))})]})]})}function no({item:e,projectId:t}){var l;const[n,r]=u.useState(""),o=$n(),s=ln(t?{project_id:t}:void 0),i=Fn({mutationFn:async c=>{const d={[e.kind==="issue"?"github_issue":"github_pr"]:e.url,...e.branch?{git_branch:e.branch}:{}};return c?ht.tasks.create({title:e.title,project_id:t,body:`${e.kind==="pr"?"PR":"Issue"} #${e.number}: ${e.url}`,...d}):ht.tasks.update(n,d)},onSuccess:()=>{o.invalidateQueries({queryKey:["tasks"]}),o.invalidateQueries({queryKey:["task"]}),o.invalidateQueries({queryKey:["github"]})}});return a.jsxs("article",{"data-testid":"github-item","data-url":e.url,className:"bg-surface-high p-3 border border-surface-highest rounded-lg space-y-2",children:[a.jsxs("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"text-primary",children:[e.kind==="pr"?"PR":"Issue"," #",e.number," · ",e.repo]}),a.jsx("p",{children:e.title}),e.branch&&a.jsx("p",{children:e.branch}),a.jsx("div",{className:"flex gap-2",children:e.task_ids.map(c=>a.jsx(Kn,{"data-testid":"github-linked-task",to:`/tasks/${c}`,className:"text-primary",children:"Open task"},c))}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs("select",{"data-testid":"github-link-task","aria-label":`Link ${e.kind} ${e.number} to task`,value:n,onChange:c=>r(c.target.value),className:"bg-surface-highest p-1 max-w-44",children:[a.jsx("option",{value:"",children:"Choose task"}),(l=s.data)==null?void 0:l.map(c=>a.jsx("option",{value:c.id,children:c.title},c.id))]}),a.jsx("button",{type:"button","data-testid":"github-link-save",disabled:!n||i.isPending,onClick:()=>i.mutate(!1),children:"Link task"}),!e.task_ids.length&&a.jsx("button",{type:"button","data-testid":"github-create-task",disabled:i.isPending,onClick:()=>i.mutate(!0),className:"text-primary",children:"Create task"})]}),i.error&&a.jsx("p",{role:"alert",children:i.error.message})]})}const ro=["low","normal","high","critical"],dt=[{value:"all",label:"All"},{value:"todo",label:"Todo"},{value:"doing",label:"Doing"},{value:"review",label:"Review"},{value:"blocked",label:"Blocked"},{value:"done",label:"Done"}],so=["todo","doing","review","blocked","done"],oo=new Set(["all","todo","queued","doing","review","changes_requested","blocked","done","cancelled","paused"]),ao=new Set(["all","low","normal","high","critical"]);function Do({projectId:e}){var be;const t=ur(e),[n,r]=Un(),o=u.useRef(n);o.current=n;const{selectedId:s,openDetail:i,closeDetail:l}=cr("/tasks","taskId"),c=n.get("status"),d=c&&oo.has(c)?c:"all",g=dt.some(({value:h})=>h===d)?dt:[...dt,{value:d,label:d.charAt(0).toUpperCase()+d.slice(1).replace(/_/g," ")}],f=n.get("priority"),b=f&&ao.has(f)?f:"all",p=n.get("q")??"",w=n.get("view")==="table"?"table":"board",v=u.useCallback((h,x,Y)=>{const Q=new URLSearchParams(o.current);x===null||x===""||x===Y?Q.delete(h):Q.set(h,x),Q.toString()!==o.current.toString()&&(o.current=Q,r(Q,{replace:h==="q"}))},[r]),y=h=>v("status",h,"all"),S=h=>v("priority",h,"all"),C=h=>v("q",h||null),m=h=>v("view",h,"board"),[E,N]=u.useState(!1),[R,D]=u.useState(null),j=t==="all"||t==="unassigned"?void 0:t,{data:k,isLoading:O,error:A,refetch:H}=ln(j?{project_id:j}:void 0),B=Xn(),$=Yn(),re=u.useMemo(()=>{const h=k??[];return t==="unassigned"?h.filter(x=>!x.project_id):h},[k,t]),pe=u.useMemo(()=>{let h=re;if(d!=="all"&&(h=h.filter(x=>x.status===d)),b!=="all"&&(h=h.filter(x=>x.priority===b)),p.trim()){const x=p.trim().toLowerCase();h=h.filter(Y=>Y.title.toLowerCase().includes(x))}return h},[re,d,b,p]),X=u.useMemo(()=>re.reduce((h,x)=>(h[x.status]=(h[x.status]??0)+1,h),{}),[re]),$e=()=>{R&&$.mutate(R.id,{onSuccess:()=>D(null)})},se=(h,x)=>!h||x==="done"||x==="cancelled"?!1:new Date(h)<new Date;return A?a.jsxs("div",{children:[a.jsx(Yt,{title:"Tasks"}),a.jsx(Zn,{message:A.message,onRetry:()=>H()})]}):a.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[a.jsx(Yt,{title:"Tasks",meta:`${re.length} total`,action:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex rounded-md overflow-hidden",children:[a.jsx("button",{type:"button","data-testid":"tasks-view-board",title:"Board view","aria-label":"Board view","aria-pressed":w==="board",onClick:()=>m("board"),className:`p-3 transition-colors ${w==="board"?"bg-surface-highest text-on-surface":"text-outline hover:text-on-surface-variant"}`,children:a.jsx(pr,{size:14})}),a.jsx("button",{type:"button","data-testid":"tasks-view-table",title:"Table view","aria-label":"Table view","aria-pressed":w==="table",onClick:()=>m("table"),className:`p-3 transition-colors ${w==="table"?"bg-surface-highest text-on-surface":"text-outline hover:text-on-surface-variant"}`,children:a.jsx(dr,{size:14})})]}),a.jsxs(qn,{"data-testid":"new-task-button",size:"sm",onClick:()=>N(!0),className:"font-label text-xs bg-primary text-primary-foreground hover:bg-primary/90",children:[a.jsx(Vn,{size:14,className:"mr-1"}),"New task"]})]})}),a.jsx(to,{projectId:j}),(B.error||$.error)&&a.jsx("p",{role:"alert",className:"mb-4 text-sm text-error",children:(be=B.error??$.error)==null?void 0:be.message}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:[a.jsxs("div",{className:"relative flex-1 max-w-xs",children:[a.jsx(Hn,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-outline"}),a.jsx(Wn,{"aria-label":"Search tasks",value:p,onChange:h=>C(h.target.value),placeholder:"Search tasks...",className:"bg-background border-control-border text-on-surface font-body text-xs pl-8 min-h-11"})]}),a.jsxs(Bt,{value:b,onValueChange:h=>S(h),children:[a.jsx($t,{"aria-label":"Filter by priority",className:"bg-background border-control-border text-on-surface font-label text-xs w-36 min-h-11",children:a.jsx(Ft,{placeholder:"Priority"})}),a.jsxs(Kt,{className:"bg-surface border-border",children:[a.jsx(at,{value:"all",className:"font-label text-xs",children:"All Priorities"}),ro.map(h=>a.jsx(at,{value:h,className:"font-label text-xs",children:h},h))]})]})]}),w==="board"?O?a.jsx("div",{role:"status","aria-label":"Loading tasks",className:"space-y-2",children:Array.from({length:5}).map((h,x)=>a.jsx(Ut,{className:"h-10 w-full bg-surface-highest"},x))}):a.jsx(eo,{tasks:pe,onUpdateStatus:(h,x)=>B.mutate({id:h,status:x}),onDeleteTask:h=>{const x=(k??[]).find(Y=>Y.id===h);x&&D(x)},onCardClick:h=>i(h.id)}):a.jsxs(or,{value:d,onValueChange:h=>y(h),className:"mb-4",children:[a.jsx(ar,{className:"bg-background gap-1 h-auto p-0 flex-wrap justify-start",children:g.map(({value:h,label:x})=>a.jsxs(ir,{value:h,className:`font-label text-sm px-4 py-2 rounded-md
32
+ text-outline`,children:r.length})]})}),a.jsxs("div",{ref:l,"data-testid":"kanban-column","data-column-status":e,"data-drop-target":c,className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[100px]",children:[r.map(g=>a.jsx(kn,{task:g,onDelete:o,onClick:s},g.id)),r.length===0&&a.jsx("div",{className:"flex items-center justify-center h-16 text-outline text-sm font-label",children:"Empty"})]})]})}function eo({tasks:e,onUpdateStatus:t,onDeleteTask:n,onCardClick:r}){const[o,s]=u.useState(null),i=Tr(Ht(Dt,{activationConstraint:{distance:5}}),Ht(St)),l=u.useMemo(()=>{const f={todo:[],doing:[],review:[],blocked:[],done:[]};for(const b of e){const p=ke(b.status);p&&f[p].push(b)}return f},[e]);function c(f){var p;const b=(p=f.active.data.current)==null?void 0:p.task;b&&s(b)}function d(f){var y,S,C;const{active:b,over:p}=f;if(s(null),!p)return;const w=(y=b.data.current)==null?void 0:y.task;if(!w)return;let v;if(((S=p.data.current)==null?void 0:S.type)==="column")v=p.data.current.status;else if(((C=p.data.current)==null?void 0:C.type)==="task"){const m=p.data.current.task,E=ke(m.status);E&&(v=E)}v&&ke(w.status)!==v&&t(w.id,v)}function g(f){return!o||ke(o.status)===f?null:!0}return a.jsxs(Ts,{sensors:i,collisionDetection:Lr,onDragStart:c,onDragEnd:d,children:[a.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-4 pb-4 md:flex-row md:overflow-x-auto",children:Tn.map(f=>a.jsx(Zs,{status:f.status,label:f.label,color:f.color,tasks:l[f.status],onDeleteTask:n,onCardClick:r,isValidDrop:g(f.status)},f.status))}),a.jsx(Qs,{activeTask:o})]})}function to({projectId:e}){var i,l,c,d,g,f,b;const[t,n]=u.useState("relevant"),[r,o]=u.useState(!1),s=Bn({queryKey:["github",e,t],queryFn:()=>ht.git.githubItems(t,e),enabled:r,staleTime:3e4,retry:!1});return a.jsxs("section",{className:"border-b border-surface-highest p-3 text-xs space-y-2",children:[a.jsx("button",{type:"button","data-testid":"github-board-toggle",onClick:()=>o(!r),className:"text-primary",children:r?"Hide GitHub":"GitHub issues / PRs"}),r&&a.jsxs("div",{"data-testid":"github-board",className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap gap-3 items-center",children:[a.jsxs("label",{children:["Show"," ",a.jsxs("select",{"data-testid":"github-filter",value:t,onChange:p=>n(p.target.value),className:"bg-surface-highest p-1",children:[a.jsx("option",{value:"relevant",children:"My work (branches + assignee + linked)"}),a.jsx("option",{value:"branches",children:"Current branches / worktrees + linked"}),a.jsx("option",{value:"assigned",children:"Assigned to me"}),a.jsx("option",{value:"all",children:"All open items in known repositories"})]})]}),a.jsx("button",{type:"button","data-testid":"github-refresh",onClick:()=>void s.refetch(),children:"Refresh"}),((i=s.data)==null?void 0:i.login)&&a.jsxs("span",{"data-testid":"github-auth",children:[s.data.login," · ",s.data.auth]})]}),s.isFetching&&a.jsx("p",{children:"Loading GitHub…"}),s.error&&a.jsx("p",{role:"alert",children:s.error.message}),((l=s.data)==null?void 0:l.auth)==="none"&&a.jsx("p",{"data-testid":"github-no-auth",children:"Sign in with gh auth login, or configure github.token / ORC_GITHUB_TOKEN on the API machine."}),((c=s.data)==null?void 0:c.auth)!=="none"&&((d=s.data)==null?void 0:d.items.length)===0&&a.jsx("p",{"data-testid":"github-empty",children:"No matching open issues or PRs. Add a project repository folder, launch a terminal there, or choose a broader filter."}),((g=s.data)==null?void 0:g.truncated)&&a.jsx("p",{role:"alert",children:"Results limited by repository, pagination or request time budget. Narrow the project scope."}),(f=s.data)==null?void 0:f.errors.map(p=>a.jsxs("p",{role:"alert",children:[p.repo,": ",p.error]},p.repo)),a.jsx("div",{className:"grid gap-2 md:grid-cols-2 xl:grid-cols-3 max-h-80 overflow-auto",children:(b=s.data)==null?void 0:b.items.map(p=>a.jsx(no,{item:p,projectId:e},p.url))})]})]})}function no({item:e,projectId:t}){var l;const[n,r]=u.useState(""),o=$n(),s=ln(t?{project_id:t}:void 0),i=Fn({mutationFn:async c=>{const d={[e.kind==="issue"?"github_issue":"github_pr"]:e.url,...e.branch?{git_branch:e.branch}:{}};return c?ht.tasks.create({title:e.title,project_id:t,body:`${e.kind==="pr"?"PR":"Issue"} #${e.number}: ${e.url}`,...d}):ht.tasks.update(n,d)},onSuccess:()=>{o.invalidateQueries({queryKey:["tasks"]}),o.invalidateQueries({queryKey:["task"]}),o.invalidateQueries({queryKey:["github"]})}});return a.jsxs("article",{"data-testid":"github-item","data-url":e.url,className:"bg-surface-high p-3 border border-surface-highest rounded-lg space-y-2",children:[a.jsxs("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"text-primary",children:[e.kind==="pr"?"PR":"Issue"," #",e.number," · ",e.repo]}),a.jsx("p",{children:e.title}),e.branch&&a.jsx("p",{children:e.branch}),a.jsx("div",{className:"flex gap-2",children:e.task_ids.map(c=>a.jsx(Un,{"data-testid":"github-linked-task",to:`/tasks/${c}`,className:"text-primary",children:"Open task"},c))}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs("select",{"data-testid":"github-link-task","aria-label":`Link ${e.kind} ${e.number} to task`,value:n,onChange:c=>r(c.target.value),className:"bg-surface-highest p-1 max-w-44",children:[a.jsx("option",{value:"",children:"Choose task"}),(l=s.data)==null?void 0:l.map(c=>a.jsx("option",{value:c.id,children:c.title},c.id))]}),a.jsx("button",{type:"button","data-testid":"github-link-save",disabled:!n||i.isPending,onClick:()=>i.mutate(!1),children:"Link task"}),!e.task_ids.length&&a.jsx("button",{type:"button","data-testid":"github-create-task",disabled:i.isPending,onClick:()=>i.mutate(!0),className:"text-primary",children:"Create task"})]}),i.error&&a.jsx("p",{role:"alert",children:i.error.message})]})}const ro=["low","normal","high","critical"],dt=[{value:"all",label:"All"},{value:"todo",label:"Todo"},{value:"doing",label:"Doing"},{value:"review",label:"Review"},{value:"blocked",label:"Blocked"},{value:"done",label:"Done"}],so=["todo","doing","review","blocked","done"],oo=new Set(["all","todo","queued","doing","review","changes_requested","blocked","done","cancelled","paused"]),ao=new Set(["all","low","normal","high","critical"]);function No({projectId:e}){var be;const t=ur(e),[n,r]=Kn(),o=u.useRef(n);o.current=n;const{selectedId:s,openDetail:i,closeDetail:l}=cr("/tasks","taskId"),c=n.get("status"),d=c&&oo.has(c)?c:"all",g=dt.some(({value:h})=>h===d)?dt:[...dt,{value:d,label:d.charAt(0).toUpperCase()+d.slice(1).replace(/_/g," ")}],f=n.get("priority"),b=f&&ao.has(f)?f:"all",p=n.get("q")??"",w=n.get("view")==="table"?"table":"board",v=u.useCallback((h,x,Y)=>{const Q=new URLSearchParams(o.current);x===null||x===""||x===Y?Q.delete(h):Q.set(h,x),Q.toString()!==o.current.toString()&&(o.current=Q,r(Q,{replace:h==="q"}))},[r]),y=h=>v("status",h,"all"),S=h=>v("priority",h,"all"),C=h=>v("q",h||null),m=h=>v("view",h,"board"),[E,N]=u.useState(!1),[R,D]=u.useState(null),j=t==="all"||t==="unassigned"?void 0:t,{data:k,isLoading:O,error:A,refetch:V}=ln(j?{project_id:j}:void 0),B=Xn(),$=Yn(),re=u.useMemo(()=>{const h=k??[];return t==="unassigned"?h.filter(x=>!x.project_id):h},[k,t]),pe=u.useMemo(()=>{let h=re;if(d!=="all"&&(h=h.filter(x=>x.status===d)),b!=="all"&&(h=h.filter(x=>x.priority===b)),p.trim()){const x=p.trim().toLowerCase();h=h.filter(Y=>Y.title.toLowerCase().includes(x))}return h},[re,d,b,p]),X=u.useMemo(()=>re.reduce((h,x)=>(h[x.status]=(h[x.status]??0)+1,h),{}),[re]),$e=()=>{R&&$.mutate(R.id,{onSuccess:()=>D(null)})},se=(h,x)=>!h||x==="done"||x==="cancelled"?!1:new Date(h)<new Date;return A?a.jsxs("div",{children:[a.jsx(Yt,{title:"Tasks"}),a.jsx(Zn,{message:A.message,onRetry:()=>V()})]}):a.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[a.jsx(Yt,{title:"Tasks",meta:`${re.length} total`,action:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex rounded-md overflow-hidden",children:[a.jsx("button",{type:"button","data-testid":"tasks-view-board",title:"Board view","aria-label":"Board view","aria-pressed":w==="board",onClick:()=>m("board"),className:`p-3 transition-colors ${w==="board"?"bg-surface-highest text-on-surface":"text-outline hover:text-on-surface-variant"}`,children:a.jsx(pr,{size:14})}),a.jsx("button",{type:"button","data-testid":"tasks-view-table",title:"Table view","aria-label":"Table view","aria-pressed":w==="table",onClick:()=>m("table"),className:`p-3 transition-colors ${w==="table"?"bg-surface-highest text-on-surface":"text-outline hover:text-on-surface-variant"}`,children:a.jsx(dr,{size:14})})]}),a.jsxs(qn,{"data-testid":"new-task-button",size:"sm",onClick:()=>N(!0),className:"font-label text-xs bg-primary text-primary-foreground hover:bg-primary/90",children:[a.jsx(Hn,{size:14,className:"mr-1"}),"New task"]})]})}),a.jsx(to,{projectId:j}),(B.error||$.error)&&a.jsx("p",{role:"alert",className:"mb-4 text-sm text-error",children:(be=B.error??$.error)==null?void 0:be.message}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:[a.jsxs("div",{className:"relative flex-1 max-w-xs",children:[a.jsx(Vn,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-outline"}),a.jsx(Wn,{"aria-label":"Search tasks",value:p,onChange:h=>C(h.target.value),placeholder:"Search tasks...",className:"bg-background border-control-border text-on-surface font-body text-xs pl-8 min-h-11"})]}),a.jsxs(Bt,{value:b,onValueChange:h=>S(h),children:[a.jsx($t,{"aria-label":"Filter by priority",className:"bg-background border-control-border text-on-surface font-label text-xs w-36 min-h-11",children:a.jsx(Ft,{placeholder:"Priority"})}),a.jsxs(Ut,{className:"bg-surface border-border",children:[a.jsx(at,{value:"all",className:"font-label text-xs",children:"All Priorities"}),ro.map(h=>a.jsx(at,{value:h,className:"font-label text-xs",children:h},h))]})]})]}),w==="board"?O?a.jsx("div",{role:"status","aria-label":"Loading tasks",className:"space-y-2",children:Array.from({length:5}).map((h,x)=>a.jsx(Kt,{className:"h-10 w-full bg-surface-highest"},x))}):a.jsx(eo,{tasks:pe,onUpdateStatus:(h,x)=>B.mutate({id:h,status:x}),onDeleteTask:h=>{const x=(k??[]).find(Y=>Y.id===h);x&&D(x)},onCardClick:h=>i(h.id)}):a.jsxs(or,{value:d,onValueChange:h=>y(h),className:"mb-4",children:[a.jsx(ar,{className:"bg-background gap-1 h-auto p-0 flex-wrap justify-start",children:g.map(({value:h,label:x})=>a.jsxs(ir,{value:h,className:`font-label text-sm px-4 py-2 rounded-md
33
33
  data-[state=active]:bg-surface-highest data-[state=active]:text-on-surface data-[state=active]:shadow-none
34
- text-outline hover:text-on-surface-variant`,children:[x,h!=="all"&&X[h]!=null&&a.jsx("span",{className:"ml-1.5 text-xs text-outline px-1.5 py-0.5",children:X[h]}),h==="all"&&a.jsx("span",{className:"ml-1.5 text-xs text-outline px-1.5 py-0.5",children:re.length})]},h))}),a.jsx(lr,{value:d,children:O?a.jsx("div",{role:"status","aria-label":"Loading tasks",className:"space-y-2",children:Array.from({length:5}).map((h,x)=>a.jsx(Ut,{className:"h-10 w-full bg-surface-highest"},x))}):pe.length===0?a.jsx(Qn,{message:"No tasks"}):a.jsx("div",{className:"overflow-hidden",children:a.jsxs(nr,{children:[a.jsx(rr,{children:a.jsxs(Xt,{className:"border-b border-border hover:bg-transparent",children:[a.jsx(te,{className:"font-label text-xs text-outline w-16",children:"ID"}),a.jsx(te,{className:"font-label text-xs text-outline",children:"Title"}),a.jsx(te,{className:"font-label text-xs text-outline w-40",children:"Status"}),a.jsx(te,{className:"font-label text-xs text-outline w-28",children:"Priority"}),a.jsx(te,{className:"font-label text-xs text-outline w-24",children:"Tags"}),a.jsx(te,{className:"font-label text-xs text-outline w-16",title:"Comments",children:a.jsx(ft,{size:12,className:"inline"})}),a.jsx(te,{className:"font-label text-xs text-outline w-24",children:"Due"}),a.jsx(te,{className:"font-label text-xs text-outline w-24",children:"Author"}),a.jsx(te,{className:"font-label text-xs text-outline w-24",children:"Updated"}),a.jsx(te,{className:"w-10"})]})}),a.jsx(sr,{children:pe.map(h=>a.jsxs(Xt,{"data-testid":"task-row","data-task-id":h.id,"data-task-title":h.title,className:"border-b border-border/65 hover:bg-surface-high cursor-pointer",onClick:()=>i(h.id),children:[a.jsx(ne,{className:"font-label text-xs text-outline",children:h.id.slice(-6)}),a.jsx(ne,{className:"font-body text-xs text-on-surface max-w-xs truncate",children:a.jsx("button",{type:"button",className:"text-left font-medium hover:text-primary",onClick:x=>{x.stopPropagation(),i(h.id)},children:h.title})}),a.jsx(ne,{children:a.jsx("div",{onClick:x=>x.stopPropagation(),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&x.stopPropagation()},children:a.jsxs(Bt,{value:h.status,onValueChange:x=>B.mutate({id:h.id,status:x}),children:[a.jsx($t,{"aria-label":`Status for ${h.title}`,className:"min-h-10 w-auto border-0 bg-transparent p-1 gap-1",children:a.jsx(Ft,{children:a.jsx(er,{status:h.status})})}),a.jsx(Kt,{className:"bg-surface border-border",children:so.map(x=>a.jsx(at,{value:x,className:"font-label text-xs",children:x.replace(/_/g," ")},x))})]})})}),a.jsx(ne,{children:a.jsx(cn,{priority:h.priority})}),a.jsx(ne,{children:a.jsxs("div",{className:"flex flex-wrap gap-0.5",children:[h.tags&&h.tags.length>0?h.tags.slice(0,2).map(x=>a.jsx("span",{className:"px-1.5 py-0.5 text-xs font-label text-outline",children:x},x)):a.jsx("span",{className:"text-outline text-xs",children:"-"}),h.tags&&h.tags.length>2&&a.jsxs("span",{className:"text-outline text-xs",children:["+",h.tags.length-2]})]})}),a.jsx(ne,{className:"font-label text-xs text-outline","data-testid":"task-comments-count",children:h.comments_count&&h.comments_count>0?a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx(ft,{size:10}),h.comments_count]}):a.jsx("span",{className:"text-outline",children:"-"})}),a.jsx(ne,{className:`font-label text-xs ${se(h.due_at,h.status)?"text-error":"text-outline"}`,children:h.due_at?new Date(h.due_at).toLocaleDateString():"-"}),a.jsx(ne,{className:"font-label text-xs text-outline",children:h.author}),a.jsx(ne,{className:"font-label text-xs text-outline",children:new Date(h.updated_at).toLocaleDateString()}),a.jsx(ne,{children:a.jsx("button",{type:"button","data-testid":"task-delete","aria-label":`Delete ${h.title}`,onClick:x=>{x.stopPropagation(),D(h)},className:"inline-flex min-h-11 min-w-11 items-center justify-center rounded-md text-outline hover:text-error hover:bg-error/10 transition-colors p-2",children:a.jsx(un,{size:12})})})]},h.id))})]})})})]}),E&&a.jsx(Gn,{open:E,onClose:()=>N(!1),onCreated:i,defaultProjectId:t!=="all"&&t!=="unassigned"?t:void 0}),a.jsx(Jn,{open:R!==null,title:"Delete Task",description:`Are you sure you want to delete "${(R==null?void 0:R.title)??""}"? This action cannot be undone.`,confirmLabel:"Delete",variant:"destructive",isPending:$.isPending,onConfirm:$e,onCancel:()=>D(null)}),a.jsx(tr,{taskId:s,open:s!==null,onOpenChange:h=>{h||l()}})]})}export{Do as default};
34
+ text-outline hover:text-on-surface-variant`,children:[x,h!=="all"&&X[h]!=null&&a.jsx("span",{className:"ml-1.5 text-xs text-outline px-1.5 py-0.5",children:X[h]}),h==="all"&&a.jsx("span",{className:"ml-1.5 text-xs text-outline px-1.5 py-0.5",children:re.length})]},h))}),a.jsx(lr,{value:d,children:O?a.jsx("div",{role:"status","aria-label":"Loading tasks",className:"space-y-2",children:Array.from({length:5}).map((h,x)=>a.jsx(Kt,{className:"h-10 w-full bg-surface-highest"},x))}):pe.length===0?a.jsx(Qn,{message:"No tasks"}):a.jsx("div",{className:"overflow-hidden",children:a.jsxs(nr,{children:[a.jsx(rr,{children:a.jsxs(Xt,{className:"border-b border-border hover:bg-transparent",children:[a.jsx(te,{className:"font-label text-xs text-outline w-16",children:"ID"}),a.jsx(te,{className:"font-label text-xs text-outline",children:"Title"}),a.jsx(te,{className:"font-label text-xs text-outline w-40",children:"Status"}),a.jsx(te,{className:"font-label text-xs text-outline w-28",children:"Priority"}),a.jsx(te,{className:"font-label text-xs text-outline w-24",children:"Tags"}),a.jsx(te,{className:"font-label text-xs text-outline w-16",title:"Comments",children:a.jsx(ft,{size:12,className:"inline"})}),a.jsx(te,{className:"font-label text-xs text-outline w-24",children:"Due"}),a.jsx(te,{className:"font-label text-xs text-outline w-24",children:"Author"}),a.jsx(te,{className:"font-label text-xs text-outline w-24",children:"Updated"}),a.jsx(te,{className:"w-10"})]})}),a.jsx(sr,{children:pe.map(h=>a.jsxs(Xt,{"data-testid":"task-row","data-task-id":h.id,"data-task-title":h.title,className:"border-b border-border/65 hover:bg-surface-high cursor-pointer",onClick:()=>i(h.id),children:[a.jsx(ne,{className:"font-label text-xs text-outline",children:h.id.slice(-6)}),a.jsx(ne,{className:"font-body text-xs text-on-surface max-w-xs truncate",children:a.jsx("button",{type:"button",className:"text-left font-medium hover:text-primary",onClick:x=>{x.stopPropagation(),i(h.id)},children:h.title})}),a.jsx(ne,{children:a.jsx("div",{onClick:x=>x.stopPropagation(),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&x.stopPropagation()},children:a.jsxs(Bt,{value:h.status,onValueChange:x=>B.mutate({id:h.id,status:x}),children:[a.jsx($t,{"aria-label":`Status for ${h.title}`,className:"min-h-10 w-auto border-0 bg-transparent p-1 gap-1",children:a.jsx(Ft,{children:a.jsx(er,{status:h.status})})}),a.jsx(Ut,{className:"bg-surface border-border",children:so.map(x=>a.jsx(at,{value:x,className:"font-label text-xs",children:x.replace(/_/g," ")},x))})]})})}),a.jsx(ne,{children:a.jsx(cn,{priority:h.priority})}),a.jsx(ne,{children:a.jsxs("div",{className:"flex flex-wrap gap-0.5",children:[h.tags&&h.tags.length>0?h.tags.slice(0,2).map(x=>a.jsx("span",{className:"px-1.5 py-0.5 text-xs font-label text-outline",children:x},x)):a.jsx("span",{className:"text-outline text-xs",children:"-"}),h.tags&&h.tags.length>2&&a.jsxs("span",{className:"text-outline text-xs",children:["+",h.tags.length-2]})]})}),a.jsx(ne,{className:"font-label text-xs text-outline","data-testid":"task-comments-count",children:h.comments_count&&h.comments_count>0?a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx(ft,{size:10}),h.comments_count]}):a.jsx("span",{className:"text-outline",children:"-"})}),a.jsx(ne,{className:`font-label text-xs ${se(h.due_at,h.status)?"text-error":"text-outline"}`,children:h.due_at?new Date(h.due_at).toLocaleDateString():"-"}),a.jsx(ne,{className:"font-label text-xs text-outline",children:h.author}),a.jsx(ne,{className:"font-label text-xs text-outline",children:new Date(h.updated_at).toLocaleDateString()}),a.jsx(ne,{children:a.jsx("button",{type:"button","data-testid":"task-delete","aria-label":`Delete ${h.title}`,onClick:x=>{x.stopPropagation(),D(h)},className:"inline-flex min-h-11 min-w-11 items-center justify-center rounded-md text-outline hover:text-error hover:bg-error/10 transition-colors p-2",children:a.jsx(un,{size:12})})})]},h.id))})]})})})]}),E&&a.jsx(Gn,{open:E,onClose:()=>N(!1),onCreated:i,defaultProjectId:t!=="all"&&t!=="unassigned"?t:void 0}),a.jsx(Jn,{open:R!==null,title:"Delete Task",description:`Are you sure you want to delete "${(R==null?void 0:R.title)??""}"? This action cannot be undone.`,confirmLabel:"Delete",variant:"destructive",isPending:$.isPending,onConfirm:$e,onCancel:()=>D(null)}),a.jsx(tr,{taskId:s,open:s!==null,onOpenChange:h=>{h||l()}})]})}export{No as default};