@nervekit/desktop 0.23.0 → 0.24.1

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 (351) hide show
  1. package/dist/main.js +23 -0
  2. package/dist/main.js.map +1 -1
  3. package/dist/performance/performance-monitor.d.ts +35 -0
  4. package/dist/performance/performance-monitor.d.ts.map +1 -0
  5. package/dist/performance/performance-monitor.js +65 -0
  6. package/dist/performance/performance-monitor.js.map +1 -0
  7. package/dist/window/navigation-guards.d.ts +3 -0
  8. package/dist/window/navigation-guards.d.ts.map +1 -1
  9. package/dist/window/navigation-guards.js +36 -27
  10. package/dist/window/navigation-guards.js.map +1 -1
  11. package/node_modules/@nervekit/contracts/dist/domains/agents/agent.operations.schema.d.ts +1 -0
  12. package/node_modules/@nervekit/contracts/dist/domains/agents/agent.operations.schema.d.ts.map +1 -1
  13. package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation.schema.d.ts +20 -2
  14. package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation.schema.d.ts.map +1 -1
  15. package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation.schema.js +9 -2
  16. package/node_modules/@nervekit/contracts/dist/domains/conversations/conversation.schema.js.map +1 -1
  17. package/node_modules/@nervekit/contracts/dist/domains/git/git.operations.schema.d.ts +82 -0
  18. package/node_modules/@nervekit/contracts/dist/domains/git/git.operations.schema.d.ts.map +1 -1
  19. package/node_modules/@nervekit/contracts/dist/domains/git/git.operations.schema.js +6 -1
  20. package/node_modules/@nervekit/contracts/dist/domains/git/git.operations.schema.js.map +1 -1
  21. package/node_modules/@nervekit/contracts/dist/domains/git/git.schema.d.ts +35 -0
  22. package/node_modules/@nervekit/contracts/dist/domains/git/git.schema.d.ts.map +1 -1
  23. package/node_modules/@nervekit/contracts/dist/domains/git/git.schema.js +19 -0
  24. package/node_modules/@nervekit/contracts/dist/domains/git/git.schema.js.map +1 -1
  25. package/node_modules/@nervekit/contracts/dist/domains/protocol/http.schema.d.ts +12 -0
  26. package/node_modules/@nervekit/contracts/dist/domains/protocol/http.schema.d.ts.map +1 -1
  27. package/node_modules/@nervekit/contracts/dist/domains/protocol/messages.schema.d.ts +6 -0
  28. package/node_modules/@nervekit/contracts/dist/domains/protocol/messages.schema.d.ts.map +1 -1
  29. package/node_modules/@nervekit/contracts/dist/domains/protocol/operation-catalog.schema.d.ts +138 -0
  30. package/node_modules/@nervekit/contracts/dist/domains/protocol/operation-catalog.schema.d.ts.map +1 -1
  31. package/node_modules/@nervekit/contracts/dist/domains/protocol/snapshot.schema.d.ts +2 -0
  32. package/node_modules/@nervekit/contracts/dist/domains/protocol/snapshot.schema.d.ts.map +1 -1
  33. package/node_modules/@nervekit/contracts/dist/domains/settings/settings.operations.schema.d.ts +48 -0
  34. package/node_modules/@nervekit/contracts/dist/domains/settings/settings.operations.schema.d.ts.map +1 -1
  35. package/node_modules/@nervekit/contracts/dist/domains/settings/settings.schema.d.ts +32 -0
  36. package/node_modules/@nervekit/contracts/dist/domains/settings/settings.schema.d.ts.map +1 -1
  37. package/node_modules/@nervekit/contracts/dist/domains/settings/settings.schema.js +18 -3
  38. package/node_modules/@nervekit/contracts/dist/domains/settings/settings.schema.js.map +1 -1
  39. package/node_modules/@nervekit/contracts/dist/domains/snapshots/snapshot.operations.schema.d.ts +2 -0
  40. package/node_modules/@nervekit/contracts/dist/domains/snapshots/snapshot.operations.schema.d.ts.map +1 -1
  41. package/node_modules/@nervekit/contracts/dist/domains/tools/records.schema.d.ts +7 -0
  42. package/node_modules/@nervekit/contracts/dist/domains/tools/records.schema.d.ts.map +1 -1
  43. package/node_modules/@nervekit/contracts/dist/domains/tools/records.schema.js +3 -0
  44. package/node_modules/@nervekit/contracts/dist/domains/tools/records.schema.js.map +1 -1
  45. package/node_modules/@nervekit/contracts/dist/domains/tools/tool-results.schema.d.ts +11 -0
  46. package/node_modules/@nervekit/contracts/dist/domains/tools/tool-results.schema.d.ts.map +1 -1
  47. package/node_modules/@nervekit/contracts/dist/domains/tools/tool-results.schema.js +8 -1
  48. package/node_modules/@nervekit/contracts/dist/domains/tools/tool-results.schema.js.map +1 -1
  49. package/node_modules/@nervekit/contracts/dist/domains/tools/tool.operations.schema.d.ts +2 -0
  50. package/node_modules/@nervekit/contracts/dist/domains/tools/tool.operations.schema.d.ts.map +1 -1
  51. package/node_modules/@nervekit/contracts/package.json +1 -1
  52. package/node_modules/@nervekit/harness/dist/index.d.ts +1 -0
  53. package/node_modules/@nervekit/harness/dist/index.d.ts.map +1 -1
  54. package/node_modules/@nervekit/harness/dist/index.js +1 -0
  55. package/node_modules/@nervekit/harness/dist/index.js.map +1 -1
  56. package/node_modules/@nervekit/harness/dist/models/image-explanation.d.ts +21 -0
  57. package/node_modules/@nervekit/harness/dist/models/image-explanation.d.ts.map +1 -0
  58. package/node_modules/@nervekit/harness/dist/models/image-explanation.js +60 -0
  59. package/node_modules/@nervekit/harness/dist/models/image-explanation.js.map +1 -0
  60. package/node_modules/@nervekit/harness/package.json +2 -2
  61. package/node_modules/@nervekit/protocol/package.json +2 -2
  62. package/node_modules/@nervekit/tools/dist/catalog/core/vision.tools.d.ts +20 -0
  63. package/node_modules/@nervekit/tools/dist/catalog/core/vision.tools.d.ts.map +1 -0
  64. package/node_modules/@nervekit/tools/dist/catalog/core/vision.tools.js +31 -0
  65. package/node_modules/@nervekit/tools/dist/catalog/core/vision.tools.js.map +1 -0
  66. package/node_modules/@nervekit/tools/dist/catalog/manifest.d.ts.map +1 -1
  67. package/node_modules/@nervekit/tools/dist/catalog/manifest.js +2 -0
  68. package/node_modules/@nervekit/tools/dist/catalog/manifest.js.map +1 -1
  69. package/node_modules/@nervekit/tools/dist/execution/filesystem/read.d.ts +1 -0
  70. package/node_modules/@nervekit/tools/dist/execution/filesystem/read.d.ts.map +1 -1
  71. package/node_modules/@nervekit/tools/dist/execution/filesystem/read.js +1 -1
  72. package/node_modules/@nervekit/tools/dist/execution/filesystem/read.js.map +1 -1
  73. package/node_modules/@nervekit/tools/dist/execution/vision/explain-image.d.ts +4 -0
  74. package/node_modules/@nervekit/tools/dist/execution/vision/explain-image.d.ts.map +1 -0
  75. package/node_modules/@nervekit/tools/dist/execution/vision/explain-image.js +68 -0
  76. package/node_modules/@nervekit/tools/dist/execution/vision/explain-image.js.map +1 -0
  77. package/node_modules/@nervekit/tools/dist/git/git-overview.d.ts.map +1 -1
  78. package/node_modules/@nervekit/tools/dist/git/git-overview.js +4 -1
  79. package/node_modules/@nervekit/tools/dist/git/git-overview.js.map +1 -1
  80. package/node_modules/@nervekit/tools/dist/git/git-service.d.ts +4 -1
  81. package/node_modules/@nervekit/tools/dist/git/git-service.d.ts.map +1 -1
  82. package/node_modules/@nervekit/tools/dist/git/git-service.js +24 -0
  83. package/node_modules/@nervekit/tools/dist/git/git-service.js.map +1 -1
  84. package/node_modules/@nervekit/tools/dist/git/git-stash.d.ts +9 -0
  85. package/node_modules/@nervekit/tools/dist/git/git-stash.d.ts.map +1 -0
  86. package/node_modules/@nervekit/tools/dist/git/git-stash.js +130 -0
  87. package/node_modules/@nervekit/tools/dist/git/git-stash.js.map +1 -0
  88. package/node_modules/@nervekit/tools/dist/types.d.ts +21 -2
  89. package/node_modules/@nervekit/tools/dist/types.d.ts.map +1 -1
  90. package/node_modules/@nervekit/tools/package.json +2 -2
  91. package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/explore-tool-summary.d.ts.map +1 -1
  92. package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/explore-tool-summary.js +2 -0
  93. package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/explore-tool-summary.js.map +1 -1
  94. package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/workbench-agent-mechanics.d.ts.map +1 -1
  95. package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/workbench-agent-mechanics.js +17 -1
  96. package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/workbench-agent-mechanics.js.map +1 -1
  97. package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/workbench-harness-execution.d.ts.map +1 -1
  98. package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/workbench-harness-execution.js +2 -7
  99. package/node_modules/@nervekit/workbench-server/dist/domains/agents/run/workbench-harness-execution.js.map +1 -1
  100. package/node_modules/@nervekit/workbench-server/dist/domains/runs/runtime/conversation-runtime.d.ts +2 -2
  101. package/node_modules/@nervekit/workbench-server/dist/domains/runs/runtime/conversation-runtime.d.ts.map +1 -1
  102. package/node_modules/@nervekit/workbench-server/dist/domains/runs/runtime/conversation-runtime.js.map +1 -1
  103. package/node_modules/@nervekit/workbench-server/dist/domains/tasks/task-service.d.ts +2 -5
  104. package/node_modules/@nervekit/workbench-server/dist/domains/tasks/task-service.d.ts.map +1 -1
  105. package/node_modules/@nervekit/workbench-server/dist/domains/tasks/task-service.js +1 -1
  106. package/node_modules/@nervekit/workbench-server/dist/domains/tasks/task-service.js.map +1 -1
  107. package/node_modules/@nervekit/workbench-server/dist/domains/tools/agent-tool-adapter.d.ts +2 -0
  108. package/node_modules/@nervekit/workbench-server/dist/domains/tools/agent-tool-adapter.d.ts.map +1 -1
  109. package/node_modules/@nervekit/workbench-server/dist/domains/tools/agent-tool-adapter.js +4 -0
  110. package/node_modules/@nervekit/workbench-server/dist/domains/tools/agent-tool-adapter.js.map +1 -1
  111. package/node_modules/@nervekit/workbench-server/dist/domains/tools/git-mutation-publisher.d.ts +3 -0
  112. package/node_modules/@nervekit/workbench-server/dist/domains/tools/git-mutation-publisher.d.ts.map +1 -1
  113. package/node_modules/@nervekit/workbench-server/dist/domains/tools/git-mutation-publisher.js +3 -0
  114. package/node_modules/@nervekit/workbench-server/dist/domains/tools/git-mutation-publisher.js.map +1 -1
  115. package/node_modules/@nervekit/workbench-server/dist/domains/tools/orchestration-tool-dispatcher.d.ts +2 -1
  116. package/node_modules/@nervekit/workbench-server/dist/domains/tools/orchestration-tool-dispatcher.d.ts.map +1 -1
  117. package/node_modules/@nervekit/workbench-server/dist/domains/tools/orchestration-tool-dispatcher.js +1 -0
  118. package/node_modules/@nervekit/workbench-server/dist/domains/tools/orchestration-tool-dispatcher.js.map +1 -1
  119. package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-call-transcript-preview.d.ts.map +1 -1
  120. package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-call-transcript-preview.js +16 -0
  121. package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-call-transcript-preview.js.map +1 -1
  122. package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-service.d.ts +5 -3
  123. package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-service.d.ts.map +1 -1
  124. package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-service.js +5 -2
  125. package/node_modules/@nervekit/workbench-server/dist/domains/tools/tool-service.js.map +1 -1
  126. package/node_modules/@nervekit/workbench-server/dist/infrastructure/diagnostics/index.d.ts +1 -0
  127. package/node_modules/@nervekit/workbench-server/dist/infrastructure/diagnostics/index.d.ts.map +1 -1
  128. package/node_modules/@nervekit/workbench-server/dist/infrastructure/diagnostics/index.js +1 -0
  129. package/node_modules/@nervekit/workbench-server/dist/infrastructure/diagnostics/index.js.map +1 -1
  130. package/node_modules/@nervekit/workbench-server/dist/infrastructure/diagnostics/performance-monitor.d.ts +35 -0
  131. package/node_modules/@nervekit/workbench-server/dist/infrastructure/diagnostics/performance-monitor.d.ts.map +1 -0
  132. package/node_modules/@nervekit/workbench-server/dist/infrastructure/diagnostics/performance-monitor.js +90 -0
  133. package/node_modules/@nervekit/workbench-server/dist/infrastructure/diagnostics/performance-monitor.js.map +1 -0
  134. package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/initialize.d.ts.map +1 -1
  135. package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/initialize.js +47 -1
  136. package/node_modules/@nervekit/workbench-server/dist/infrastructure/storage/initialize.js.map +1 -1
  137. package/node_modules/@nervekit/workbench-server/dist/main.js +22 -1
  138. package/node_modules/@nervekit/workbench-server/dist/main.js.map +1 -1
  139. package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/conversation-agent-method-handlers.d.ts +1 -1
  140. package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/git-method-handlers.d.ts +82 -0
  141. package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/git-method-handlers.d.ts.map +1 -1
  142. package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/git-method-handlers.js +3 -0
  143. package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/git-method-handlers.js.map +1 -1
  144. package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/interaction-method-handlers.d.ts +2 -2
  145. package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/platform-method-handlers.d.ts +24 -3
  146. package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers/platform-method-handlers.d.ts.map +1 -1
  147. package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers.d.ts +1 -1
  148. package/node_modules/@nervekit/workbench-server/dist/protocol/method-handlers.d.ts.map +1 -1
  149. package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-composition.d.ts.map +1 -1
  150. package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-composition.js +42 -2
  151. package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-composition.js.map +1 -1
  152. package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-registry.d.ts +29 -0
  153. package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-registry.d.ts.map +1 -1
  154. package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-registry.js +62 -14
  155. package/node_modules/@nervekit/workbench-server/dist/runtime/runtime-registry.js.map +1 -1
  156. package/node_modules/@nervekit/workbench-server/dist/web/assets/AuthShell-DQ0hMGwj.js +7 -0
  157. package/node_modules/@nervekit/workbench-server/dist/web/assets/DiffShell-CqmO4vGZ.js +1 -0
  158. package/node_modules/@nervekit/workbench-server/dist/web/assets/FileShell-IoZpRMGK.js +1 -0
  159. package/node_modules/@nervekit/workbench-server/dist/web/assets/FilesPanelView-qj3mD-xV.js +1 -0
  160. package/node_modules/@nervekit/workbench-server/dist/web/assets/GitPullRequestsPanelView-BPsVFZqE.js +1 -0
  161. package/node_modules/@nervekit/workbench-server/dist/web/assets/LogsShell-DTl2N1lp.js +3 -0
  162. package/node_modules/@nervekit/workbench-server/dist/web/assets/PrShell-uDFVzI8o.js +1 -0
  163. package/node_modules/@nervekit/workbench-server/dist/web/assets/SettingsShell-DCGjLfUV.js +5 -0
  164. package/node_modules/@nervekit/workbench-server/dist/web/assets/TaskOutputPane-N6bO8djB.js +4 -0
  165. package/node_modules/@nervekit/workbench-server/dist/web/assets/TaskShell-DgPs4Wxb.js +1 -0
  166. package/node_modules/@nervekit/workbench-server/dist/web/assets/TasksPanelView-B4pdRdLa.js +1 -0
  167. package/node_modules/@nervekit/workbench-server/dist/web/assets/{abnfDiagram-N423BO3Z-D_hWhAcq.js → abnfDiagram-N423BO3Z-CG6Ziw1v.js} +1 -1
  168. package/node_modules/@nervekit/workbench-server/dist/web/assets/api-E8TD3Pr0.js +1 -0
  169. package/node_modules/@nervekit/workbench-server/dist/web/assets/{architectureDiagram-T3A2C74G-CxY90Oec.js → architectureDiagram-T3A2C74G-BVMn9kbo.js} +1 -1
  170. package/node_modules/@nervekit/workbench-server/dist/web/assets/{blockDiagram-VBNYF7ZC-CLIL9DLE.js → blockDiagram-VBNYF7ZC-Cv_b9H1X.js} +1 -1
  171. package/node_modules/@nervekit/workbench-server/dist/web/assets/{c4Diagram-5PPSVZJV-tbEjli1O.js → c4Diagram-5PPSVZJV-C5Y7OA-n.js} +1 -1
  172. package/node_modules/@nervekit/workbench-server/dist/web/assets/channel-7088nV0s.js +1 -0
  173. package/node_modules/@nervekit/workbench-server/dist/web/assets/check-nK4WdGI8.js +1 -0
  174. package/node_modules/@nervekit/workbench-server/dist/web/assets/checkbox-Bx6Hkh-C.js +1 -0
  175. package/node_modules/@nervekit/workbench-server/dist/web/assets/chevron-down-CgH42MYI.js +1 -0
  176. package/node_modules/@nervekit/workbench-server/dist/web/assets/chevron-up-ChlUpR1m.js +10 -0
  177. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-2GRJ4B5K-C9rVgQoY.js → chunk-2GRJ4B5K-YKO-4XTb.js} +1 -1
  178. package/node_modules/@nervekit/workbench-server/dist/web/assets/chunk-3NCLNEKW-BCweQE7D.js +1 -0
  179. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-4I5QYGJK-BPTCKvEl.js → chunk-4I5QYGJK-BpoRaM9T.js} +1 -1
  180. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-5RXB4S5H-BFkZe3w7.js → chunk-5RXB4S5H-DzjnJRLH.js} +1 -1
  181. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-6Q2QTUOP-Cbxnd_rm.js → chunk-6Q2QTUOP-DuD5UX18.js} +1 -1
  182. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-7Z6QIM7H-BQZtz9rb.js → chunk-7Z6QIM7H-Dx0x6rDh.js} +1 -1
  183. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-GF5L2VYU-CA61ww5L.js → chunk-GF5L2VYU-DjS_Zkc0.js} +1 -1
  184. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-I66GZJ75-BoWypIh9.js → chunk-I66GZJ75-CP0ySO9o.js} +1 -1
  185. package/node_modules/@nervekit/workbench-server/dist/web/assets/chunk-J7OUQ5F2-DIk0f35j.js +2 -0
  186. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-JQJVKLGR-BVxJfe4w.js → chunk-JQJVKLGR-BlST7gHy.js} +1 -1
  187. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-KBJHAD2P-B7S50seK.js → chunk-KBJHAD2P-CJCgpXY-.js} +1 -1
  188. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-NSK5VX7P-YZFIso__.js → chunk-NSK5VX7P-CXOVlQor.js} +1 -1
  189. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-QR6OTTB3-DyTnqZsr.js → chunk-QR6OTTB3-DtG6FyUs.js} +1 -1
  190. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-RYQCIY6F-CopinFcf.js → chunk-RYQCIY6F-vne1fXqr.js} +1 -1
  191. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-UBXNYLIW-C1emy36W.js → chunk-UBXNYLIW-NWyRITFv.js} +1 -1
  192. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-W5SLKNZC-BnKQ6wYv.js → chunk-W5SLKNZC-KUadl49J.js} +1 -1
  193. package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-WRU74C26-cfekww3v.js → chunk-WRU74C26-XGqrwLHB.js} +1 -1
  194. package/node_modules/@nervekit/workbench-server/dist/web/assets/chunk-XXDRQBXY-f9g04BTf.js +1 -0
  195. package/node_modules/@nervekit/workbench-server/dist/web/assets/circle-check-DusoDOT4.js +1 -0
  196. package/node_modules/@nervekit/workbench-server/dist/web/assets/classDiagram-JCYQIIEL-BdQ83wbG.js +1 -0
  197. package/node_modules/@nervekit/workbench-server/dist/web/assets/classDiagram-v2-OCEON4UE-BdQ83wbG.js +1 -0
  198. package/node_modules/@nervekit/workbench-server/dist/web/assets/code-CusSnYxH.js +2 -0
  199. package/node_modules/@nervekit/workbench-server/dist/web/assets/confirm-dialog-DfZpMVnO.js +5 -0
  200. package/node_modules/@nervekit/workbench-server/dist/web/assets/{cose-bilkent-JH36ORCC-BnRg9jNe.js → cose-bilkent-JH36ORCC-DCMlCf7B.js} +1 -1
  201. package/node_modules/@nervekit/workbench-server/dist/web/assets/credential-crypto-DlftQRvy.js +1 -0
  202. package/node_modules/@nervekit/workbench-server/dist/web/assets/{cynefinDiagram-MW4NZA55-IzU41stp.js → cynefinDiagram-MW4NZA55-5r6VpiXd.js} +1 -1
  203. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dagre-VZM6K2ZE-BeAq1sUz.js → dagre-VZM6K2ZE-DKpYAvrf.js} +1 -1
  204. package/node_modules/@nervekit/workbench-server/dist/web/assets/{diagram-7IWD3JNH-Bv6pyOTt.js → diagram-7IWD3JNH-Cf-sTPuY.js} +1 -1
  205. package/node_modules/@nervekit/workbench-server/dist/web/assets/{diagram-B4RE2ZJO-Dkq-jhUq.js → diagram-B4RE2ZJO-FMWLG3FT.js} +1 -1
  206. package/node_modules/@nervekit/workbench-server/dist/web/assets/{diagram-LBJQPF4R-C5rxqfvC.js → diagram-LBJQPF4R-B4C4per-.js} +1 -1
  207. package/node_modules/@nervekit/workbench-server/dist/web/assets/{diagram-Q27KOJAE-DVK1ojPJ.js → diagram-Q27KOJAE-B0HfBNcd.js} +1 -1
  208. package/node_modules/@nervekit/workbench-server/dist/web/assets/{diagram-UB23O5K3-BneMibzq.js → diagram-UB23O5K3-BsJFwacy.js} +1 -1
  209. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-Degb3sTJ.js → dist-BBPrPB1o.js} +1 -1
  210. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-DrXYFU-o2.js → dist-BGMZ-nBc2.js} +1 -1
  211. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-BHi4xLsC.js → dist-BKVTA46Y.js} +1 -1
  212. package/node_modules/@nervekit/workbench-server/dist/web/assets/dist-BQqwJSTk.js +1 -0
  213. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-CvfFyCMJ.js → dist-BQxyzU-x.js} +1 -1
  214. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-BaUAMSAA2.js → dist-Bid3h55n2.js} +2 -2
  215. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-DAGTjV-T.js → dist-Bkkb15-R.js} +1 -1
  216. package/node_modules/@nervekit/workbench-server/dist/web/assets/dist-BkwwX4BQ.js +1 -0
  217. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-Dw2ZEoq-.js → dist-BpDRddpn2.js} +1 -1
  218. package/node_modules/@nervekit/workbench-server/dist/web/assets/dist-C5wcZU0c.js +23 -0
  219. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-D3fhDulr.js → dist-C6bFCxhl.js} +1 -1
  220. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-C74hLwN_.js → dist-CHZbsPcP.js} +2 -2
  221. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-wNEOExNR.js → dist-CeILsIvL.js} +1 -1
  222. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-Bg8jM3vB.js → dist-Ch4aicY6.js} +1 -1
  223. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-CWpGuYJC2.js → dist-D2Vjfdv72.js} +1 -1
  224. package/node_modules/@nervekit/workbench-server/dist/web/assets/dist-D3XG9UJv.js +1 -0
  225. package/node_modules/@nervekit/workbench-server/dist/web/assets/dist-D8fWqgH9.js +13 -0
  226. package/node_modules/@nervekit/workbench-server/dist/web/assets/dist-E3IhdptO.js +6 -0
  227. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-BlJiQQLu.js → dist-RXE1Txn3.js} +1 -1
  228. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-Go0hY8Nc2.js → dist-aNzlVmy22.js} +1 -1
  229. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-DoE1YLtA2.js → dist-hah_bfma2.js} +1 -1
  230. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-DYAlPOZA.js → dist-tsNqh9-L.js} +1 -1
  231. package/node_modules/@nervekit/workbench-server/dist/web/assets/{dist-BNb8NB8T2.js → dist-wJtHwCZW2.js} +2 -2
  232. package/node_modules/@nervekit/workbench-server/dist/web/assets/{ebnfDiagram-BXEA7PRR-Dyia633q.js → ebnfDiagram-BXEA7PRR-1eX29DtV.js} +1 -1
  233. package/node_modules/@nervekit/workbench-server/dist/web/assets/{erDiagram-JOGREHBK-Dn7oyqoC.js → erDiagram-JOGREHBK-Di2OWYNm.js} +1 -1
  234. package/node_modules/@nervekit/workbench-server/dist/web/assets/flowDiagram-UKHOOZJN-BcNwS8tl.js +1 -0
  235. package/node_modules/@nervekit/workbench-server/dist/web/assets/{ganttDiagram-PKOTCBZU-45_2NisB.js → ganttDiagram-PKOTCBZU-BG9eJ1Lf.js} +1 -1
  236. package/node_modules/@nervekit/workbench-server/dist/web/assets/git-sB2gtjD1.js +5 -0
  237. package/node_modules/@nervekit/workbench-server/dist/web/assets/git.api-Zbx9STdG.js +1 -0
  238. package/node_modules/@nervekit/workbench-server/dist/web/assets/{gitGraphDiagram-DS77QQ5N-BIj2rZt5.js → gitGraphDiagram-DS77QQ5N-D3Z-bJ6k.js} +1 -1
  239. package/node_modules/@nervekit/workbench-server/dist/web/assets/index-BEF70Tuw.js +159 -0
  240. package/node_modules/@nervekit/workbench-server/dist/web/assets/index-BVUOm8e2.css +1 -0
  241. package/node_modules/@nervekit/workbench-server/dist/web/assets/{infoDiagram-6WML65LV-BitxSh5S.js → infoDiagram-6WML65LV-CD61xYF1.js} +1 -1
  242. package/node_modules/@nervekit/workbench-server/dist/web/assets/{ishikawaDiagram-WSZJBQD7-BbcMCsDB.js → ishikawaDiagram-WSZJBQD7-BnKj_N6p.js} +1 -1
  243. package/node_modules/@nervekit/workbench-server/dist/web/assets/{journeyDiagram-NVQOT4AX-WeNcR_i1.js → journeyDiagram-NVQOT4AX-Dc1JOvF-.js} +1 -1
  244. package/node_modules/@nervekit/workbench-server/dist/web/assets/{kanban-definition-27J2QSJJ-DTVs4K26.js → kanban-definition-27J2QSJJ-vbXjtYWt.js} +1 -1
  245. package/node_modules/@nervekit/workbench-server/dist/web/assets/{line-CotFvITj.js → line-C5TdchTr.js} +1 -1
  246. package/node_modules/@nervekit/workbench-server/dist/web/assets/{linear-B5o1HJum.js → linear-Chy6Fpss.js} +1 -1
  247. package/node_modules/@nervekit/workbench-server/dist/web/assets/logs.api-OD7D_B_W.js +1 -0
  248. package/node_modules/@nervekit/workbench-server/dist/web/assets/{mermaid.core-oRWj6taj.js → mermaid.core-Cs7U-INI.js} +3 -3
  249. package/node_modules/@nervekit/workbench-server/dist/web/assets/{mindmap-definition-FAOFIHXS-CJNa1EIY.js → mindmap-definition-FAOFIHXS-Cj9ICJq9.js} +1 -1
  250. package/node_modules/@nervekit/workbench-server/dist/web/assets/model-D02-v0Nz.js +1 -0
  251. package/node_modules/@nervekit/workbench-server/dist/web/assets/notify.svelte-DbdY6PpH.js +1 -0
  252. package/node_modules/@nervekit/workbench-server/dist/web/assets/panel-BobuDiLE.js +1 -0
  253. package/node_modules/@nervekit/workbench-server/dist/web/assets/panel-C-PkZf6z.css +1 -0
  254. package/node_modules/@nervekit/workbench-server/dist/web/assets/{pegDiagram-VL7TDLO6-TC1fCPkO.js → pegDiagram-VL7TDLO6-BlBPqjPz.js} +1 -1
  255. package/node_modules/@nervekit/workbench-server/dist/web/assets/{pieDiagram-7S7Q4E2Y-RMErWNi_.js → pieDiagram-7S7Q4E2Y-Co53elm4.js} +1 -1
  256. package/node_modules/@nervekit/workbench-server/dist/web/assets/popper-layer-force-mount-Ckmt2G7d.js +1 -0
  257. package/node_modules/@nervekit/workbench-server/dist/web/assets/{quadrantDiagram-CIZ2JOQS-Dn7Qg8zF.js → quadrantDiagram-CIZ2JOQS-cBYinNeB.js} +1 -1
  258. package/node_modules/@nervekit/workbench-server/dist/web/assets/query-BrHM4D58.js +1 -0
  259. package/node_modules/@nervekit/workbench-server/dist/web/assets/{railroadDiagram-AXF67PYL-CZgz_LXR.js → railroadDiagram-AXF67PYL-D3yJgKi9.js} +1 -1
  260. package/node_modules/@nervekit/workbench-server/dist/web/assets/{requirementDiagram-LRYGKXZP-BFVYIaJT.js → requirementDiagram-LRYGKXZP-FY5q-icc.js} +1 -1
  261. package/node_modules/@nervekit/workbench-server/dist/web/assets/rotate-ccw-VSJDk4Ba.js +1 -0
  262. package/node_modules/@nervekit/workbench-server/dist/web/assets/{sankeyDiagram-W5VNT64P-SPAGMzSX.js → sankeyDiagram-W5VNT64P-CmP_Oqyl.js} +1 -1
  263. package/node_modules/@nervekit/workbench-server/dist/web/assets/scratch-notes-D6o9Ve8B.js +1 -0
  264. package/node_modules/@nervekit/workbench-server/dist/web/assets/scratch-notes.api-DQl22WFv.js +1 -0
  265. package/node_modules/@nervekit/workbench-server/dist/web/assets/scroll-area-Em26RFPQ.js +1 -0
  266. package/node_modules/@nervekit/workbench-server/dist/web/assets/select-field-CDzQEkaT.js +1 -0
  267. package/node_modules/@nervekit/workbench-server/dist/web/assets/selection.svelte-DmTibeJC.js +1 -0
  268. package/node_modules/@nervekit/workbench-server/dist/web/assets/{sequenceDiagram-SI44F4Z6-y-07t8Cc.js → sequenceDiagram-SI44F4Z6-CBQafbB6.js} +1 -1
  269. package/node_modules/@nervekit/workbench-server/dist/web/assets/settings-actions.svelte-9p6XxupQ.js +9 -0
  270. package/node_modules/@nervekit/workbench-server/dist/web/assets/spinner-zQsaHVfA.js +26 -0
  271. package/node_modules/@nervekit/workbench-server/dist/web/assets/{src-BNlArFnY.js → src-oJicGV6x.js} +1 -1
  272. package/node_modules/@nervekit/workbench-server/dist/web/assets/{stateDiagram-OKZ733FA-BGRv83TA.js → stateDiagram-OKZ733FA-Bd7HtoOl.js} +1 -1
  273. package/node_modules/@nervekit/workbench-server/dist/web/assets/stateDiagram-v2-UEYNNEHI-JY8MXxAn.js +1 -0
  274. package/node_modules/@nervekit/workbench-server/dist/web/assets/status-dot-CmCt2vaG.js +1 -0
  275. package/node_modules/@nervekit/workbench-server/dist/web/assets/{swimlanes-SLNWSIFB-wzOkZXex.js → swimlanes-SLNWSIFB-B2vmFcGM.js} +1 -1
  276. package/node_modules/@nervekit/workbench-server/dist/web/assets/swimlanesDiagram-ULZ7WXOC-oMzS8Q1s.js +8 -0
  277. package/node_modules/@nervekit/workbench-server/dist/web/assets/{text-preview-BB9zMOPI.js → text-preview-6NL_bcyB.js} +2 -2
  278. package/node_modules/@nervekit/workbench-server/dist/web/assets/{timeline-definition-Z64GVDOM-qiE89aw7.js → timeline-definition-Z64GVDOM-r0lc-pd-.js} +1 -1
  279. package/node_modules/@nervekit/workbench-server/dist/web/assets/{toast-state.svelte-xRrQk15E.js → toast-state.svelte-7eXf88AZ.js} +1 -1
  280. package/node_modules/@nervekit/workbench-server/dist/web/assets/trash-2-C9_6EtwI.js +1 -0
  281. package/node_modules/@nervekit/workbench-server/dist/web/assets/{vennDiagram-T6HMQDX7-DBGe1CHe.js → vennDiagram-T6HMQDX7-B0a7WCso.js} +1 -1
  282. package/node_modules/@nervekit/workbench-server/dist/web/assets/virtual-list-B8pv8HQW.js +1 -0
  283. package/node_modules/@nervekit/workbench-server/dist/web/assets/virtual-list-CxEY1R3u.css +1 -0
  284. package/node_modules/@nervekit/workbench-server/dist/web/assets/{wardleyDiagram-T6FBY63Y-BpkRBNnM.js → wardleyDiagram-T6FBY63Y-DMOAVLJ1.js} +1 -1
  285. package/node_modules/@nervekit/workbench-server/dist/web/assets/workspace-actions.svelte-jRk6Eaf3.js +3 -0
  286. package/node_modules/@nervekit/workbench-server/dist/web/assets/x-D9X8AXEI.js +1 -0
  287. package/node_modules/@nervekit/workbench-server/dist/web/assets/{xychartDiagram-ELKLHX3M-PU2_XpYt.js → xychartDiagram-ELKLHX3M-SI_Da8H2.js} +1 -1
  288. package/node_modules/@nervekit/workbench-server/dist/web/index.html +57 -49
  289. package/node_modules/@nervekit/workbench-server/dist/web/sw.js +1 -1
  290. package/node_modules/@nervekit/workbench-server/package.json +5 -5
  291. package/package.json +6 -6
  292. package/node_modules/@nervekit/workbench-server/dist/web/assets/AuthShell-GogBMM7S.js +0 -7
  293. package/node_modules/@nervekit/workbench-server/dist/web/assets/DiffShell-DJOeYrRj.js +0 -1
  294. package/node_modules/@nervekit/workbench-server/dist/web/assets/FileShell-51rdTc2O.js +0 -1
  295. package/node_modules/@nervekit/workbench-server/dist/web/assets/FilesPanelView-CRi7ktm1.js +0 -1
  296. package/node_modules/@nervekit/workbench-server/dist/web/assets/GitPullRequestsPanelView-piJz3lXy.js +0 -1
  297. package/node_modules/@nervekit/workbench-server/dist/web/assets/LogsShell-CtA5DDqm.js +0 -3
  298. package/node_modules/@nervekit/workbench-server/dist/web/assets/PrShell-D0xu74Xe.js +0 -1
  299. package/node_modules/@nervekit/workbench-server/dist/web/assets/SettingsShell-3yiDBypm.js +0 -4
  300. package/node_modules/@nervekit/workbench-server/dist/web/assets/TaskOutputPane-D278A8_j.js +0 -4
  301. package/node_modules/@nervekit/workbench-server/dist/web/assets/TaskShell-6yD46EEs.js +0 -1
  302. package/node_modules/@nervekit/workbench-server/dist/web/assets/TasksPanelView-Bpimx72m.js +0 -1
  303. package/node_modules/@nervekit/workbench-server/dist/web/assets/api-B4t7L3Vi.js +0 -1
  304. package/node_modules/@nervekit/workbench-server/dist/web/assets/channel-DjPccr-e.js +0 -1
  305. package/node_modules/@nervekit/workbench-server/dist/web/assets/check-DoPBuCxK.js +0 -1
  306. package/node_modules/@nervekit/workbench-server/dist/web/assets/checkbox-BIKfbY36.js +0 -1
  307. package/node_modules/@nervekit/workbench-server/dist/web/assets/chevron-down-PAPkYMv8.js +0 -1
  308. package/node_modules/@nervekit/workbench-server/dist/web/assets/chevron-up-By6xmI8s.js +0 -1
  309. package/node_modules/@nervekit/workbench-server/dist/web/assets/chunk-3NCLNEKW-D4_YVfD7.js +0 -1
  310. package/node_modules/@nervekit/workbench-server/dist/web/assets/chunk-J7OUQ5F2-CSauaRMe.js +0 -2
  311. package/node_modules/@nervekit/workbench-server/dist/web/assets/chunk-XXDRQBXY-DlmHFBEL.js +0 -1
  312. package/node_modules/@nervekit/workbench-server/dist/web/assets/circle-check-BZN2Yiy8.js +0 -1
  313. package/node_modules/@nervekit/workbench-server/dist/web/assets/classDiagram-JCYQIIEL-C8Pw9eC_.js +0 -1
  314. package/node_modules/@nervekit/workbench-server/dist/web/assets/classDiagram-v2-OCEON4UE-C8Pw9eC_.js +0 -1
  315. package/node_modules/@nervekit/workbench-server/dist/web/assets/code-BBTFHMHm.js +0 -2
  316. package/node_modules/@nervekit/workbench-server/dist/web/assets/confirm-dialog-BIwgdBR1.js +0 -25
  317. package/node_modules/@nervekit/workbench-server/dist/web/assets/credential-crypto-Dh0i163n.js +0 -1
  318. package/node_modules/@nervekit/workbench-server/dist/web/assets/dialog-description-CtQUBFDt.js +0 -5
  319. package/node_modules/@nervekit/workbench-server/dist/web/assets/dist-B-6VYEsK.js +0 -1
  320. package/node_modules/@nervekit/workbench-server/dist/web/assets/dist-CuX9uX_B.js +0 -13
  321. package/node_modules/@nervekit/workbench-server/dist/web/assets/dist-CwypHBC-.js +0 -23
  322. package/node_modules/@nervekit/workbench-server/dist/web/assets/dist-DKZNABaU2.js +0 -1
  323. package/node_modules/@nervekit/workbench-server/dist/web/assets/dist-Ji_a5TTJ.js +0 -6
  324. package/node_modules/@nervekit/workbench-server/dist/web/assets/file-state.svelte-B5pdWaCW.js +0 -1
  325. package/node_modules/@nervekit/workbench-server/dist/web/assets/flowDiagram-UKHOOZJN-ygLGZULZ.js +0 -1
  326. package/node_modules/@nervekit/workbench-server/dist/web/assets/git-B-Ea_lVe.js +0 -5
  327. package/node_modules/@nervekit/workbench-server/dist/web/assets/git.api-CVPZVH69.js +0 -1
  328. package/node_modules/@nervekit/workbench-server/dist/web/assets/index-CT_EqKhl.js +0 -156
  329. package/node_modules/@nervekit/workbench-server/dist/web/assets/index-gQ7szeLR.css +0 -1
  330. package/node_modules/@nervekit/workbench-server/dist/web/assets/logs.api-H6CPKT0t.js +0 -1
  331. package/node_modules/@nervekit/workbench-server/dist/web/assets/notify.svelte-DzzVV73k.js +0 -1
  332. package/node_modules/@nervekit/workbench-server/dist/web/assets/panel-Du8LwaMN.js +0 -1
  333. package/node_modules/@nervekit/workbench-server/dist/web/assets/panel-pO-d12Zt.css +0 -1
  334. package/node_modules/@nervekit/workbench-server/dist/web/assets/popper-layer-force-mount-BJxHYiEI.js +0 -1
  335. package/node_modules/@nervekit/workbench-server/dist/web/assets/rotate-ccw-C7To98zz.js +0 -1
  336. package/node_modules/@nervekit/workbench-server/dist/web/assets/scratch-notes-Cxtj6KmK.js +0 -1
  337. package/node_modules/@nervekit/workbench-server/dist/web/assets/scratch-notes.api-HLM2PdFq.js +0 -1
  338. package/node_modules/@nervekit/workbench-server/dist/web/assets/scroll-area-KDadRCXu.js +0 -1
  339. package/node_modules/@nervekit/workbench-server/dist/web/assets/select-field-Ci7rKvBU.js +0 -1
  340. package/node_modules/@nervekit/workbench-server/dist/web/assets/settings-actions.svelte-qpLxl9Wc.js +0 -9
  341. package/node_modules/@nervekit/workbench-server/dist/web/assets/spinner-4Ehx2P3o.js +0 -2
  342. package/node_modules/@nervekit/workbench-server/dist/web/assets/state-CzQbNY28.js +0 -10
  343. package/node_modules/@nervekit/workbench-server/dist/web/assets/stateDiagram-v2-UEYNNEHI-BqurxSO4.js +0 -1
  344. package/node_modules/@nervekit/workbench-server/dist/web/assets/status-dot-CNXeV1P6.js +0 -1
  345. package/node_modules/@nervekit/workbench-server/dist/web/assets/swimlanesDiagram-ULZ7WXOC-DI7cWfWq.js +0 -8
  346. package/node_modules/@nervekit/workbench-server/dist/web/assets/toggle-group-DDKj7Oao.js +0 -1
  347. package/node_modules/@nervekit/workbench-server/dist/web/assets/trash-2-CCYVhwm2.js +0 -1
  348. package/node_modules/@nervekit/workbench-server/dist/web/assets/virtual-list-BmmRz0Tb.css +0 -1
  349. package/node_modules/@nervekit/workbench-server/dist/web/assets/virtual-list-DPBJTpm6.js +0 -1
  350. package/node_modules/@nervekit/workbench-server/dist/web/assets/workspace-actions.svelte-fmfCaU70.js +0 -3
  351. package/node_modules/@nervekit/workbench-server/dist/web/assets/x-BHsG-mGK.js +0 -1
@@ -1,156 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/bash-B7CDPTg5.js","assets/shellscript-CLZ0U2zV.js","assets/html-BY76lXLH.js","assets/css-BsVw1vtW.js","assets/javascript-BgS3c2Ky.js","assets/svelte-Uaf2W_lJ.js","assets/typescript-bsJCZSQ-.js","assets/mermaid.core-oRWj6taj.js","assets/preload-helper-zJ_50EbN.js","assets/chunk-4I5QYGJK-BPTCKvEl.js","assets/src-BNlArFnY.js","assets/chunk-QTnfLwEv.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/chunk-I66GZJ75-BoWypIh9.js","assets/purify.es-Bs0Imjnk.js","assets/chunk-NSK5VX7P-YZFIso__.js","assets/dist-lRkD-JPF.js","assets/chunk-WRU74C26-cfekww3v.js","assets/chunk-3NCLNEKW-D4_YVfD7.js","assets/chunk-7BUUIJ7U-Bb538aSH.js","assets/chunk-7Z6QIM7H-BQZtz9rb.js","assets/line-CotFvITj.js","assets/path-BWPyau1x.js","assets/array-BifhSqXX.js","assets/chunk-QR6OTTB3-DyTnqZsr.js","assets/chunk-UBXNYLIW-C1emy36W.js","assets/chunk-W5SLKNZC-BnKQ6wYv.js","assets/rough.esm-CSKSodPl.js","assets/chunk-J7OUQ5F2-CSauaRMe.js","assets/chunk-ZIRB5QZD-H-kepumB.js","assets/workspace-actions.svelte-fmfCaU70.js","assets/spinner-4Ehx2P3o.js","assets/TaskOutputPane-D278A8_j.js","assets/check-DoPBuCxK.js","assets/chevron-down-PAPkYMv8.js","assets/chevron-up-By6xmI8s.js","assets/circle-check-BZN2Yiy8.js","assets/rotate-ccw-C7To98zz.js","assets/trash-2-CCYVhwm2.js","assets/virtual-list-DPBJTpm6.js","assets/lru-cache-RFDR4GSx.js","assets/virtual-list-BmmRz0Tb.css","assets/confirm-dialog-BIwgdBR1.js","assets/dialog-description-CtQUBFDt.js","assets/TaskOutputPane-BwdNMYln.css","assets/settings-actions.svelte-qpLxl9Wc.js","assets/state-CzQbNY28.js","assets/text-preview-BB9zMOPI.js","assets/api-B4t7L3Vi.js","assets/logs.api-H6CPKT0t.js","assets/git.api-CVPZVH69.js","assets/file-state.svelte-B5pdWaCW.js","assets/notify.svelte-DzzVV73k.js","assets/toast-state.svelte-xRrQk15E.js","assets/scratch-notes.api-HLM2PdFq.js","assets/TaskShell-6yD46EEs.js","assets/FileShell-51rdTc2O.js","assets/scroll-area-KDadRCXu.js","assets/code-BBTFHMHm.js","assets/dist-CuX9uX_B.js","assets/FileShell-Dp-BAGcK.css","assets/PrShell-D0xu74Xe.js","assets/git-B-Ea_lVe.js","assets/panel-Du8LwaMN.js","assets/popper-layer-force-mount-BJxHYiEI.js","assets/status-dot-CNXeV1P6.js","assets/panel-pO-d12Zt.css","assets/x-BHsG-mGK.js","assets/github-pr-checks-BWC_pfMO.js","assets/DiffShell-DJOeYrRj.js","assets/SettingsShell-3yiDBypm.js","assets/checkbox-BIKfbY36.js","assets/select-field-Ci7rKvBU.js","assets/select-field-CV-KWLNP.css","assets/credential-crypto-Dh0i163n.js","assets/credential-crypto-BDCyIX5i.css","assets/toggle-group-DDKj7Oao.js","assets/AuthShell-GogBMM7S.js","assets/AuthShell-CI3W44sI.css","assets/LogsShell-CtA5DDqm.js","assets/FilesPanelView-CRi7ktm1.js","assets/TasksPanelView-Bpimx72m.js","assets/scratch-notes-Cxtj6KmK.js","assets/GitPullRequestsPanelView-piJz3lXy.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./chunk-QTnfLwEv.js";import{$ as r,A as i,At as a,B as o,Bt as s,C as c,Ct as l,D as u,F as d,G as f,H as p,Ht as m,I as h,It as g,J as _,L as v,Lt as y,M as b,Mt as x,N as S,Nt as C,O as w,P as T,Pt as E,Q as D,R as O,S as k,St as ee,T as A,U as j,V as M,Vt as N,W as te,X as ne,Y as P,Z as re,_ as ie,_t as F,a as I,at as L,b as ae,bt as R,c as oe,ct as se,d as ce,dt as z,et as le,f as ue,ft as de,g as fe,gt as B,h as V,ht as pe,i as me,it as he,j as ge,jt as H,k as _e,kt as ve,l as ye,lt as be,m as U,mt as xe,n as W,nt as Se,o as G,ot as Ce,p as K,pt as we,q,r as Te,rt as Ee,s as De,st as Oe,t as ke,tt as Ae,u as je,ut as J,v as Me,vt as Y,wt as Ne,x as Pe,xt as X,y as Fe,yt as Ie,z as Le,zt as Re}from"./spinner-4Ehx2P3o.js";import{n as ze,r as Be,t as Ve}from"./select-field-Ci7rKvBU.js";import{_ as He,b as Ue,c as We,d as Ge,f as Ke,g as qe,h as Je,i as eee,l as Ye,m as Xe,n as Ze,o as Qe,p as $e,s as tee,t as et,u as tt,v as nt,x as rt,y as it}from"./TaskOutputPane-D278A8_j.js";import{C as at,S as ot,_ as st,b as ct,c as lt,d as nee,h as ut,i as dt,l as ree,m as ft,n as pt,o as mt,r as ht,t as gt,u as _t,v as vt,w as yt,x as bt,y as xt}from"./settings-actions.svelte-qpLxl9Wc.js";import{B as St,Dt as Ct,Et as wt,F as Tt,H as Et,I as Dt,L as Ot,M as kt,Mt as At,Nt as jt,R as Mt,St as iee,Tt as Nt,U as aee,V as Pt,_t as Ft,a as oee,c as see,ct as It,d as cee,dt as Lt,f as Rt,ft as zt,g as Bt,gt as Vt,ht as Ht,i as Ut,j as Wt,jt as Z,k as Gt,mt as Kt,n as qt,o as Jt,pt as Yt,q as Xt,r as Zt,s as Qt,st as $t,t as en,ut as tn,v as nn,vt as rn,z as an}from"./dialog-description-CtQUBFDt.js";import{A as on,C as sn,D as cn,E as ln,F as un,I as dn,L as fn,M as pn,N as mn,O as hn,S as gn,T as _n,_ as vn,a as yn,b as bn,c as xn,d as Sn,f as Cn,g as lee,h as wn,i as uee,k as dee,l as fee,m as pee,n as Tn,o as mee,p as En,r as hee,s as gee,t as _ee,u as vee,v as Dn,w as On,x as kn,y as An}from"./state-CzQbNY28.js";import{$ as yee,A as jn,B as Mn,F as Nn,G as Pn,H as Fn,I as In,K as Ln,L as Rn,M as zn,N as Bn,O as Vn,P as Hn,Q as Un,R as Wn,St as Gn,Tt as Kn,U as qn,V as Jn,W as Yn,X as Xn,Z as Zn,_t as Qn,a as $n,at as er,bt as tr,c as nr,ct as rr,d as ir,dt as ar,et as or,ft as sr,g as cr,gt as lr,h as ur,ht as dr,i as fr,it as pr,j as mr,k as hr,m as gr,mt as _r,n as vr,nt as yr,o as br,pt as xr,r as Sr,rt as Cr,st as wr,t as Tr,tt as Er,vt as Dr,wt as Or,yt as kr,z as Ar}from"./confirm-dialog-BIwgdBR1.js";import{a as jr,i as Mr,n as Nr,o as Pr,r as Fr,t as Ir}from"./popper-layer-force-mount-BJxHYiEI.js";import{C as Lr,D as Rr,E as zr,O as Br,T as Vr,a as Hr,c as Ur,d as Wr,f as Gr,h as Kr,i as qr,l as Jr,m as Yr,n as Xr,o as Zr,p as Qr,r as $r,s as ei,t as ti,u as ni,w as ri}from"./panel-Du8LwaMN.js";import{n as ii,t as ai}from"./toggle-group-DDKj7Oao.js";import{t as oi}from"./check-DoPBuCxK.js";import{n as si,t as ci}from"./status-dot-CNXeV1P6.js";import{t as li}from"./x-BHsG-mGK.js";import{a as ui,i as di,n as fi,r as pi,t as mi}from"./toast-state.svelte-xRrQk15E.js";import{a as hi,c as gi,i as _i,n as vi,o as yi,r as bi,s as xi,t as Si}from"./notify.svelte-DzzVV73k.js";import{$ as Ci,A as wi,B as Ti,C as Ei,D as Di,E as Oi,F as ki,H as Ai,I as ji,L as bee,N as Mi,O as xee,P as Ni,Q as Pi,S as See,T as Cee,V as Fi,Z as Ii,_t as Li,a as wee,at as Ri,c as Tee,ct as zi,d as Eee,et as Bi,f as Dee,ft as Oee,g as kee,gt as Aee,h as jee,ht as Vi,i as Hi,it as Mee,k as Ui,l as Nee,m as Pee,mt as Fee,n as Iee,nt as Wi,o as Lee,ot as Gi,p as Ree,pt as Ki,r as zee,rt as qi,s as Bee,st as Ji,tt as Yi,u as Vee,ut as Hee,v as Uee,w as Wee,x as Gee,y as Kee,z as qee}from"./git.api-CVPZVH69.js";import{a as Xi,c as Zi,i as Qi,l as Q,n as $i,o as ea,r as ta,s as na,t as ra}from"./file-state.svelte-B5pdWaCW.js";import{a as ia,i as aa,n as oa,r as sa,t as ca}from"./text-preview-BB9zMOPI.js";import{Ct as la,F as ua,H as da,K as fa,O as pa,Q as ma,S as ha,St as ga,T as _a,U as va,W as ya,_ as ba,_t as xa,at as Sa,ct as Ca,dt as wa,gt as Ta,ht as Ea,it as Da,lt as Oa,n as ka,ot as Aa,rt as ja,st as Ma,tt as Na,v as Pa,vt as Fa,x as Ia,xt as La}from"./dist-CuX9uX_B.js";import{i as Ra,l as za,n as Ba,o as Va,r as Ha,s as Ua,u as Wa}from"./dist-B-6VYEsK.js";import{n as Ga}from"./dist-Ji_a5TTJ.js";import{t as Ka}from"./virtual-list-DPBJTpm6.js";import{t as qa}from"./lru-cache-RFDR4GSx.js";import{t as Ja}from"./circle-check-BZN2Yiy8.js";import{t as Ya}from"./trash-2-CCYVhwm2.js";import{t as Xa}from"./preload-helper-zJ_50EbN.js";import{t as Za}from"./chevron-down-PAPkYMv8.js";import{t as Qa}from"./chevron-up-By6xmI8s.js";import"./logs.api-H6CPKT0t.js";import{B as $a,D as eo,E as to,H as no,J as ro,K as io,O as ao,T as oo,b as so,et as co,ft as lo,h as uo,m as fo,u as po,v as mo,w as ho,y as go,z as _o}from"./api-B4t7L3Vi.js";import{$ as vo,A as yo,B as bo,C as xo,D as So,E as Co,F as wo,G as To,H as Eo,I as Do,J as Oo,K as ko,L as Ao,M as jo,N as Mo,O as No,P as Po,Q as Fo,R as Io,T as Lo,U as Ro,V as zo,W as Bo,X as Vo,Y as Ho,Z as Uo,_ as Wo,a as Go,at as Ko,b as qo,c as Jo,ct as Yo,d as Xo,dt as Zo,et as Qo,f as $o,ft as es,h as ts,i as ns,it as rs,j as is,k as as,l as os,lt as ss,m as cs,n as ls,nt as us,o as ds,ot as fs,p as ps,pt as ms,q as hs,r as gs,rt as _s,s as vs,st as ys,t as bs,tt as xs,u as Ss,ut as Cs,v as ws,w as Ts,x as Es,y as Ds,z as Os}from"./workspace-actions.svelte-fmfCaU70.js";import{t as ks}from"./rotate-ccw-C7To98zz.js";import{t as As}from"./scroll-area-KDadRCXu.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var js=Symbol(`QueryClient`),Ms=e=>{C(js,e)};function Ns(e,t){x(t,!0);let n=K(t,`client`,19,()=>new rt);ue(()=>{n().mount()}),Ms(n()),ce(()=>{n().unmount()});var r=_();h(F(r),()=>t.children),q(e,r),H()}var Ps=[`left`,`right`,`bottom`],Fs={left:`Left Panel`,right:`Right Panel`,bottom:`Bottom Panel`},Is=P(`<div aria-hidden="true"><span class="dock-drop-label svelte-p8iqem"> </span></div>`);function Ls(e,t){x(t,!0);let n=K(t,`hovered`,3,!1);var r=Is();let i;var a=B(r),o=B(a);y(a),y(r),J(()=>{i=w(r,1,`dock-drop-indicator svelte-p8iqem`,null,i,{hovered:n()}),f(o,`Move to ${Fs[t.dock]??``}`)}),q(e,r),H()}var Rs=new Set([`$$slots`,`$$events`,`$$legacy`]);function zs(e,t){let n=U(t,Rs),r=[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}],[`path`,{d:`m2 2 20 20`}]];G(e,V({name:`eye-off`},()=>n,{get iconNode(){return r}}))}var Bs=new Set([`$$slots`,`$$events`,`$$legacy`]);function Vs(e,t){let n=U(t,Bs),r=[[`path`,{d:`M6 8L2 12L6 16`}],[`path`,{d:`M2 12H22`}]];G(e,V({name:`move-left`},()=>n,{get iconNode(){return r}}))}var Hs=new Set([`$$slots`,`$$events`,`$$legacy`]);function Us(e,t){let n=U(t,Hs),r=[[`path`,{d:`M18 8L22 12L18 16`}],[`path`,{d:`M2 12H22`}]];G(e,V({name:`move-right`},()=>n,{get iconNode(){return r}}))}var Ws=new Set([`$$slots`,`$$events`,`$$legacy`]);function Gs(e,t){let n=U(t,Ws),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M3 15h18`}]];G(e,V({name:`panel-bottom`},()=>n,{get iconNode(){return r}}))}var Ks=new Set([`$$slots`,`$$events`,`$$legacy`]);function qs(e,t){let n=U(t,Ks),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}]];G(e,V({name:`panel-left`},()=>n,{get iconNode(){return r}}))}var Js=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ys(e,t){let n=U(t,Js),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M15 3v18`}]];G(e,V({name:`panel-right`},()=>n,{get iconNode(){return r}}))}var Xs=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`width`,`height`]),Zs=ne(`<svg viewBox="0 0 30 10" preserveAspectRatio="none" data-arrow=""><polygon points="0,0 30,0 15,10" fill="currentColor"></polygon></svg>`),Qs=P(`<span><!></span>`);function $s(e,t){x(t,!0);let n=K(t,`id`,19,Ut),r=K(t,`width`,3,10),i=K(t,`height`,3,5),a=U(t,Xs),o=l(()=>Ct(a,{id:n()}));var s=_(),u=F(s),d=e=>{var n=_();h(F(n),()=>t.child,()=>({props:L(o)})),q(e,n)},f=e=>{var n=Qs();c(n,()=>({...L(o)}));var a=B(n),s=e=>{var n=_();h(F(n),()=>t.children??N),q(e,n)},l=e=>{var t=Zs();J(()=>{A(t,`width`,r()),A(t,`height`,i())}),q(e,t)};p(a,e=>{t.children?e(s):e(l,-1)}),y(n),q(e,n)};p(u,e=>{t.child?e(d):e(f,-1)}),q(e,s),H()}var ec=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`]);function tc(e,t){x(t,!0);let n=K(t,`id`,19,Ut),r=K(t,`ref`,15,null),i=U(t,ec),a=jr.create({id:Z(()=>n()),ref:Z(()=>r(),e=>r(e))}),o=l(()=>Ct(i,a.props));$s(e,V(()=>L(o))),H()}function nc(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]??[0,0],[c,l]=t[o]??[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function rc(e,t){return e[0]>=t.left&&e[0]<=t.right&&e[1]>=t.top&&e[1]<=t.bottom}function ic(e,t){let n=e.left+e.width/2,r=e.top+e.height/2,i=t.left+t.width/2,a=t.top+t.height/2,o=i-n,s=a-r;return Math.abs(o)>Math.abs(s)?o>0?`right`:`left`:s>0?`bottom`:`top`}var ac=class{#e;#t;#n;#r=null;#i=null;#a=[];#o=null;#s=null;#c=null;#l(){this.#s!==null&&(cancelAnimationFrame(this.#s),this.#s=null)}#u(){this.#l(),this.#s=requestAnimationFrame(()=>{this.#s=null,!(!this.#r||!this.#i)&&(this.#m(),this.#e.onPointerExit())})}#d(){this.#c!==null&&(clearTimeout(this.#c),this.#c=null)}#f(){this.#n!==null&&(this.#d(),this.#c=window.setTimeout(()=>{this.#c=null,!(!this.#r||!this.#i)&&(this.#m(),this.#e.onPointerExit())},this.#n))}constructor(e){this.#e=e,this.#t=e.buffer??1;let t=e.transitIntentTimeout;this.#n=typeof t==`number`&&t>0?t:null,Nt([e.triggerNode,e.contentNode,e.enabled],([e,t,n])=>{if(!e||!t||!n){this.#o=null,this.#m();return}return this.#o&&this.#o!==e&&this.#m(),this.#o=e,[Se(rn(e),`pointermove`,n=>{this.#p([n.clientX,n.clientY],e,t)}),Se(e,`pointerleave`,e=>{let n=e.relatedTarget;if(Et(n)&&t.contains(n))return;let r=this.#e.ignoredTargets?.()??[];Et(n)&&r.some(e=>e===n||e.contains(n))||(this.#a=Et(n)&&r.length>0?r.filter(e=>n.contains(e)):[],this.#r=[e.clientX,e.clientY],this.#i=`content`,this.#u())}),Se(e,`pointerenter`,()=>{this.#m()}),Se(t,`pointerenter`,()=>{this.#m()}),Se(t,`pointerleave`,t=>{let n=t.relatedTarget;Et(n)&&e.contains(n)||(this.#r=[t.clientX,t.clientY],this.#i=`trigger`,this.#u())})].reduce((e,t)=>()=>{e(),t()},()=>{})})}#p(e,t,n){if(!this.#r||!this.#i)return;this.#l(),this.#f();let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();if(this.#i===`content`&&rc(e,i)){this.#m();return}if(this.#i===`trigger`&&rc(e,r)){this.#m();return}if(this.#i===`content`&&this.#a.length>0)for(let t of this.#a){let n=t.getBoundingClientRect();if(rc(e,n))return;let i=ic(r,n),a=this.#h(r,n,i);if(a&&nc(e,a))return}let a=ic(r,i),o=this.#h(r,i,a);if(o&&nc(e,o))return;let s=this.#i===`content`?i:r;nc(e,this.#g(this.#r,s,a,this.#i))||(this.#m(),this.#e.onPointerExit())}#m(){this.#r=null,this.#i=null,this.#a=[],this.#l(),this.#d()}#h(e,t,n){let r=this.#t;switch(n){case`top`:return[[Math.min(e.left,t.left)-r,e.top],[Math.min(e.left,t.left)-r,t.bottom],[Math.max(e.right,t.right)+r,t.bottom],[Math.max(e.right,t.right)+r,e.top]];case`bottom`:return[[Math.min(e.left,t.left)-r,e.bottom],[Math.min(e.left,t.left)-r,t.top],[Math.max(e.right,t.right)+r,t.top],[Math.max(e.right,t.right)+r,e.bottom]];case`left`:return[[e.left,Math.min(e.top,t.top)-r],[t.right,Math.min(e.top,t.top)-r],[t.right,Math.max(e.bottom,t.bottom)+r],[e.left,Math.max(e.bottom,t.bottom)+r]];case`right`:return[[e.right,Math.min(e.top,t.top)-r],[t.left,Math.min(e.top,t.top)-r],[t.left,Math.max(e.bottom,t.bottom)+r],[e.right,Math.max(e.bottom,t.bottom)+r]]}}#g(e,t,n,r){let i=this.#t*4,[a,o]=e;switch(r===`trigger`?this.#_(n):n){case`top`:return[[a-i,o+i],[a+i,o+i],[t.right+i,t.bottom],[t.right+i,t.top],[t.left-i,t.top],[t.left-i,t.bottom]];case`bottom`:return[[a-i,o-i],[a+i,o-i],[t.right+i,t.top],[t.right+i,t.bottom],[t.left-i,t.bottom],[t.left-i,t.top]];case`left`:return[[a+i,o-i],[a+i,o+i],[t.right,t.bottom+i],[t.left,t.bottom+i],[t.left,t.top-i],[t.right,t.top-i]];case`right`:return[[a-i,o-i],[a-i,o+i],[t.left,t.bottom+i],[t.right,t.bottom+i],[t.right,t.top-i],[t.left,t.top-i]]}}#_(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`}}},oc=Lt({component:`popover`,parts:[`root`,`trigger`,`content`,`close`,`overlay`]}),sc=new wt(`Popover.Root`),cc=class e{static create(t){return sc.set(new e(t))}opts;#e=X(null);get contentNode(){return L(this.#e)}set contentNode(e){R(this.#e,e,!0)}contentPresence;#t=X(null);get triggerNode(){return L(this.#t)}set triggerNode(e){R(this.#t,e,!0)}#n=X(null);get overlayNode(){return L(this.#n)}set overlayNode(e){R(this.#n,e,!0)}overlayPresence;#r=X(!1);get openedViaHover(){return L(this.#r)}set openedViaHover(e){R(this.#r,e,!0)}#i=X(!1);get hasInteractedWithContent(){return L(this.#i)}set hasInteractedWithContent(e){R(this.#i,e,!0)}#a=X(!1);get hoverCooldown(){return L(this.#a)}set hoverCooldown(e){R(this.#a,e,!0)}#o=X(0);get closeDelay(){return L(this.#o)}set closeDelay(e){R(this.#o,e,!0)}#s=null;#c=null;constructor(e){this.opts=e,this.contentPresence=new St({ref:Z(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new St({ref:Z(()=>this.overlayNode),open:this.opts.open}),Nt(()=>this.opts.open.current,e=>{e||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,this.#l())})}setDomContext(e){this.#c=e}#l(){this.#s!==null&&this.#c&&(this.#c.clearTimeout(this.#s),this.#s=null)}toggleOpen(){this.#l(),this.opts.open.current=!this.opts.open.current}handleClose(){this.#l(),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){this.#l(),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(this.#l(),this.closeDelay<=0?this.opts.open.current=!1:this.#c&&(this.#s=this.#c.setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),this.#s=null},this.closeDelay))))}cancelDelayedClose(){this.#l()}markInteraction(){this.hasInteractedWithContent=!0,this.#l()}},lc=class e{static create(t){return new e(t,sc.get())}opts;root;attachment;domContext;#e=null;#t=null;#n=X(!1);constructor(e,t){this.opts=e,this.root=t,this.attachment=Vt(this.opts.ref,e=>this.root.triggerNode=e),this.domContext=new Ft(e.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),Nt(()=>this.opts.closeDelay.current,e=>{this.root.closeDelay=e})}#r(){this.#e!==null&&(this.domContext.clearTimeout(this.#e),this.#e=null)}#i(){this.#t!==null&&(this.domContext.clearTimeout(this.#t),this.#t=null)}#a(){this.#r(),this.#i()}onpointerenter(e){if(this.opts.disabled.current||!this.opts.openOnHover.current||Xt(e)||(R(this.#n,!0),this.#i(),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;let t=this.opts.openDelay.current;t<=0?this.root.handleHoverOpen():this.#e=this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),this.#e=null},t)}onpointerleave(e){this.opts.disabled.current||this.opts.openOnHover.current&&(Xt(e)||(R(this.#n,!1),this.#r(),this.root.hoverCooldown=!1))}onclick(e){if(!this.opts.disabled.current&&e.button===0){if(this.#a(),L(this.#n)&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}L(this.#n)&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(e){this.opts.disabled.current||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.#a(),this.root.toggleOpen())}#o(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id}#s=l(()=>({id:this.opts.id.current,"aria-haspopup":`dialog`,"aria-expanded":It(this.root.opts.open.current),"data-state":Kt(this.root.opts.open.current),"aria-controls":this.#o(),[oc.trigger]:``,disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return L(this.#s)}set props(e){R(this.#s,e)}},uc=class e{static create(t){return new e(t,sc.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Vt(this.opts.ref,e=>this.root.contentNode=e),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new ac({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}onpointerdown(e){this.root.markInteraction()}onfocusin(e){let t=e.target;Et(t)&&Gt(t)&&this.root.markInteraction()}onpointerenter(e){Xt(e)||this.root.cancelDelayedClose()}onpointerleave(e){Xt(e)}onInteractOutside=e=>{if(this.opts.onInteractOutside.current(e),e.defaultPrevented||!Et(e.target))return;let t=e.target.closest(oc.selector(`trigger`));if(!(t&&t===this.root.triggerNode)){if(this.opts.customAnchor.current){if(Et(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(e.target))return}else if(typeof this.opts.customAnchor.current==`string`){let t=document.querySelector(this.opts.customAnchor.current);if(t&&t.contains(e.target))return}}this.root.handleClose()}};onEscapeKeydown=e=>{this.opts.onEscapeKeydown.current(e),!e.defaultPrevented&&this.root.handleClose()};get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}#e=l(()=>({open:this.root.opts.open.current}));get snippetProps(){return L(this.#e)}set snippetProps(e){R(this.#e,e)}#t=l(()=>({id:this.opts.id.current,tabindex:-1,"data-state":Kt(this.root.opts.open.current),...Ht(this.root.contentPresence.transitionStatus),[oc.content]:``,style:{pointerEvents:`auto`,contain:`layout style`},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return L(this.#t)}set props(e){R(this.#t,e)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}},dc=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`forceMount`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onEscapeKeydown`,`onInteractOutside`,`trapFocus`,`preventScroll`,`customAnchor`,`style`]),fc=P(`<div><div><!></div></div>`);function pc(e,t){let n=re();x(t,!0);let r=K(t,`ref`,15,null),i=K(t,`id`,19,()=>Mt(n)),a=K(t,`forceMount`,3,!1),o=K(t,`onOpenAutoFocus`,3,an),s=K(t,`onCloseAutoFocus`,3,an),u=K(t,`onEscapeKeydown`,3,an),d=K(t,`onInteractOutside`,3,an),f=K(t,`trapFocus`,3,!0),m=K(t,`preventScroll`,3,!1),g=K(t,`customAnchor`,3,null),v=U(t,dc),b=uc.create({id:Z(()=>i()),ref:Z(()=>r(),e=>r(e)),onInteractOutside:Z(()=>d()),onEscapeKeydown:Z(()=>u()),customAnchor:Z(()=>g())}),S=l(()=>Ct(v,b.props)),C=l(()=>f()&&b.shouldTrapFocus);function w(e){b.shouldTrapFocus||e.preventDefault(),o()(e)}var T=_(),E=F(T),D=e=>{Ir(e,V(()=>L(S),()=>b.popperProps,{get ref(){return b.opts.ref},get enabled(){return b.root.opts.open.current},get id(){return i()},get trapFocus(){return L(C)},get preventScroll(){return m()},loop:!0,forceMount:!0,get customAnchor(){return g()},onOpenAutoFocus:w,get onCloseAutoFocus(){return s()},get shouldRender(){return b.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=l(()=>Ct(r(),{style:Pr(`popover`)},{style:t.style}));var o=_(),s=F(o),u=e=>{var n=_(),r=F(n);{let e=l(()=>({props:L(a),wrapperProps:i(),...b.snippetProps}));h(r,()=>t.child,()=>L(e))}q(e,n)},d=e=>{var n=fc();c(n,()=>({...i()}));var r=B(n);c(r,()=>({...L(a)})),h(B(r),()=>t.children??N),y(r),y(n),q(e,n)};p(s,e=>{t.child?e(u):e(d,-1)}),q(e,o)},$$slots:{popper:!0}}))},O=e=>{Nr(e,V(()=>L(S),()=>b.popperProps,{get ref(){return b.opts.ref},get open(){return b.root.opts.open.current},get id(){return i()},get trapFocus(){return L(C)},get preventScroll(){return m()},loop:!0,forceMount:!1,get customAnchor(){return g()},onOpenAutoFocus:w,get onCloseAutoFocus(){return s()},get shouldRender(){return b.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=l(()=>Ct(r(),{style:Pr(`popover`)},{style:t.style}));var o=_(),s=F(o),u=e=>{var n=_(),r=F(n);{let e=l(()=>({props:L(a),wrapperProps:i(),...b.snippetProps}));h(r,()=>t.child,()=>L(e))}q(e,n)},d=e=>{var n=fc();c(n,()=>({...i()}));var r=B(n);c(r,()=>({...L(a)})),h(B(r),()=>t.children??N),y(r),y(n),q(e,n)};p(s,e=>{t.child?e(u):e(d,-1)}),q(e,o)},$$slots:{popper:!0}}))};p(E,e=>{a()?e(D):a()||e(O,1)}),q(e,T),H()}var mc=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`type`,`disabled`,`openOnHover`,`openDelay`,`closeDelay`]),hc=P(`<button><!></button>`);function gc(e,t){let n=re();x(t,!0);let r=K(t,`id`,19,()=>Mt(n)),i=K(t,`ref`,15,null),a=K(t,`type`,3,`button`),o=K(t,`disabled`,3,!1),s=K(t,`openOnHover`,3,!1),u=K(t,`openDelay`,3,700),d=K(t,`closeDelay`,3,300),f=U(t,mc),m=lc.create({id:Z(()=>r()),ref:Z(()=>i(),e=>i(e)),disabled:Z(()=>!!o()),openOnHover:Z(()=>s()),openDelay:Z(()=>u()),closeDelay:Z(()=>d())}),g=l(()=>Ct(f,m.props,{type:a()}));Fr(e,{get id(){return r()},get ref(){return m.opts.ref},children:(e,n)=>{var r=_(),i=F(r),a=e=>{var n=_();h(F(n),()=>t.child,()=>({props:L(g)})),q(e,n)},o=e=>{var n=hc();c(n,()=>({...L(g)})),h(B(n),()=>t.children??N),y(n),q(e,n)};p(i,e=>{t.child?e(a):e(o,-1)}),q(e,r)},$$slots:{default:!0}}),H()}var _c=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function vc(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=U(t,_c);tc(e,V(()=>r,{"data-popover-arrow":``,get ref(){return n()},set ref(e){n(e)}})),H()}function yc(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=K(t,`onOpenChange`,3,an),i=K(t,`onOpenChangeComplete`,3,an);Ot.create({variant:Z(()=>`dialog`),open:Z(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:Z(()=>i())});var a=_();h(F(a),()=>t.children??N),q(e,a),H()}var bc=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`disabled`]),xc=P(`<button><!></button>`);function Sc(e,t){let n=re();x(t,!0);let r=K(t,`id`,19,()=>Mt(n)),i=K(t,`ref`,15,null),a=K(t,`disabled`,3,!1),o=U(t,bc),s=Tt.create({variant:Z(()=>`close`),id:Z(()=>r()),ref:Z(()=>i(),e=>i(e)),disabled:Z(()=>!!a())}),u=l(()=>Ct(o,s.props));var d=_(),f=F(d),m=e=>{var n=_();h(F(n),()=>t.child,()=>({props:L(u)})),q(e,n)},g=e=>{var n=xc();c(n,()=>({...L(u)})),h(B(n),()=>t.children??N),y(n),q(e,n)};p(f,e=>{t.child?e(m):e(g,-1)}),q(e,d),H()}var Cc=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`,`forceMount`,`onCloseAutoFocus`,`onOpenAutoFocus`,`onEscapeKeydown`,`onInteractOutside`,`trapFocus`,`preventScroll`,`restoreScrollDelay`]),wc=P(`<!> <!>`,1),Tc=P(`<!> <div><!></div>`,1);function Ec(e,t){let n=re();x(t,!0);let r=K(t,`id`,19,()=>Mt(n)),i=K(t,`ref`,15,null),a=K(t,`forceMount`,3,!1),o=K(t,`onCloseAutoFocus`,3,an),s=K(t,`onOpenAutoFocus`,3,an),u=K(t,`onEscapeKeydown`,3,an),d=K(t,`onInteractOutside`,3,an),f=K(t,`trapFocus`,3,!0),m=K(t,`preventScroll`,3,!0),g=K(t,`restoreScrollDelay`,3,null),v=U(t,Cc),b=Dt.create({id:Z(()=>r()),ref:Z(()=>i(),e=>i(e))}),S=l(()=>Ct(v,b.props));var C=_(),w=F(C),T=e=>{Jt(e,{get ref(){return b.opts.ref},loop:!0,get trapFocus(){return f()},get enabled(){return b.root.opts.open.current},get onOpenAutoFocus(){return s()},get onCloseAutoFocus(){return o()},focusScope:(e,n)=>{let r=()=>n?.().props;Qt(e,V(()=>L(S),{get enabled(){return b.root.opts.open.current},get ref(){return b.opts.ref},onEscapeKeydown:e=>{u()(e),!e.defaultPrevented&&b.root.handleClose()},children:(e,n)=>{see(e,V(()=>L(S),{get ref(){return b.opts.ref},get enabled(){return b.root.opts.open.current},onInteractOutside:e=>{d()(e),!e.defaultPrevented&&b.root.handleClose()},children:(e,n)=>{oee(e,V(()=>L(S),{get ref(){return b.opts.ref},get enabled(){return b.root.opts.open.current},children:(e,n)=>{var i=_(),a=F(i),o=e=>{var n=wc(),i=F(n),a=e=>{Zt(e,{get preventScroll(){return m()},get restoreScrollDelay(){return g()}})};p(i,e=>{b.root.opts.open.current&&e(a)});var o=Y(i,2);{let e=l(()=>({props:Ct(L(S),r()),...b.snippetProps}));h(o,()=>t.child,()=>L(e))}q(e,n)},s=e=>{var n=Tc(),i=F(n);Zt(i,{get preventScroll(){return m()}});var a=Y(i,2);c(a,e=>({...e}),[()=>Ct(L(S),r())]),h(B(a),()=>t.children??N),y(a),q(e,n)};p(a,e=>{t.child?e(o):e(s,-1)}),q(e,i)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};p(w,e=>{(b.shouldRender||a())&&e(T)}),q(e,C),H()}function Dc(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=K(t,`dir`,3,`ltr`),i=K(t,`onOpenChange`,3,an),a=K(t,`onOpenChangeComplete`,3,an),o=K(t,`_internal_variant`,3,`dropdown-menu`),s=K(t,`_internal_should_skip_exit_animation`,3,void 0),c=nn.create({variant:Z(()=>o()),dir:Z(()=>r()),onClose:()=>{n(!1),i()(!1)},shouldSkipExitAnimation:()=>s()?.()??!1});Bt.create({open:Z(()=>n(),e=>{n(e),i()(e)}),onOpenChangeComplete:Z(()=>a())},c),Mr(e,{children:(e,n)=>{var r=_();h(F(r),()=>t.children??N),q(e,r)},$$slots:{default:!0}}),H()}var Oc=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`child`,`children`,`ref`,`loop`,`onInteractOutside`,`onEscapeKeydown`,`onCloseAutoFocus`,`forceMount`,`trapFocus`,`style`]),kc=P(`<div><div><!></div></div>`);function Ac(e,t){let n=re();x(t,!0);let r=K(t,`id`,19,()=>Mt(n)),i=K(t,`ref`,15,null),a=K(t,`loop`,3,!0),o=K(t,`onInteractOutside`,3,an),s=K(t,`onEscapeKeydown`,3,an),u=K(t,`onCloseAutoFocus`,3,an),d=K(t,`forceMount`,3,!1),f=K(t,`trapFocus`,3,!1),m=U(t,Oc),g=Rt.create({id:Z(()=>r()),loop:Z(()=>a()),ref:Z(()=>i(),e=>i(e)),onCloseAutoFocus:Z(()=>u())}),v=l(()=>Ct(m,g.props));function b(e){if(g.handleInteractOutside(e),!e.defaultPrevented&&(o()(e),!e.defaultPrevented)){if(e.target&&e.target instanceof Element){let t=`[${g.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t))return}g.parentMenu.onClose()}}function S(e){s()(e),!e.defaultPrevented&&g.parentMenu.onClose()}var C=_(),w=F(C),T=e=>{Ir(e,V(()=>L(v),()=>g.popperProps,{get ref(){return g.opts.ref},get enabled(){return g.parentMenu.opts.open.current},onInteractOutside:b,onEscapeKeydown:S,get trapFocus(){return f()},get loop(){return a()},forceMount:!0,get id(){return r()},get shouldRender(){return g.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=l(()=>Ct(r(),{style:Pr(`dropdown-menu`)},{style:t.style}));var o=_(),s=F(o),u=e=>{var n=_(),r=F(n);{let e=l(()=>({props:L(a),wrapperProps:i(),...g.snippetProps}));h(r,()=>t.child,()=>L(e))}q(e,n)},d=e=>{var n=kc();c(n,()=>({...i()}));var r=B(n);c(r,()=>({...L(a)})),h(B(r),()=>t.children??N),y(r),y(n),q(e,n)};p(s,e=>{t.child?e(u):e(d,-1)}),q(e,o)},$$slots:{popper:!0}}))},E=e=>{Nr(e,V(()=>L(v),()=>g.popperProps,{get ref(){return g.opts.ref},get open(){return g.parentMenu.opts.open.current},onInteractOutside:b,onEscapeKeydown:S,get trapFocus(){return f()},get loop(){return a()},forceMount:!1,get id(){return r()},get shouldRender(){return g.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=l(()=>Ct(r(),{style:Pr(`dropdown-menu`)},{style:t.style}));var o=_(),s=F(o),u=e=>{var n=_(),r=F(n);{let e=l(()=>({props:L(a),wrapperProps:i(),...g.snippetProps}));h(r,()=>t.child,()=>L(e))}q(e,n)},d=e=>{var n=kc();c(n,()=>({...i()}));var r=B(n);c(r,()=>({...L(a)})),h(B(r),()=>t.children??N),y(r),y(n),q(e,n)};p(s,e=>{t.child?e(u):e(d,-1)}),q(e,o)},$$slots:{popper:!0}}))};p(w,e=>{d()?e(T):d()||e(E,1)}),q(e,C),H()}var jc=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`disabled`,`type`]),Mc=P(`<button><!></button>`);function Nc(e,t){let n=re();x(t,!0);let r=K(t,`id`,19,()=>Mt(n)),i=K(t,`ref`,15,null),a=K(t,`disabled`,3,!1),o=K(t,`type`,3,`button`),s=U(t,jc),u=cee.create({id:Z(()=>r()),disabled:Z(()=>a()??!1),ref:Z(()=>i(),e=>i(e))}),d=l(()=>Ct(s,u.props,{type:o()}));Fr(e,{get id(){return r()},get ref(){return u.opts.ref},children:(e,n)=>{var r=_(),i=F(r),a=e=>{var n=_();h(F(n),()=>t.child,()=>({props:L(d)})),q(e,n)},o=e=>{var n=Mc();c(n,()=>({...L(d)})),h(B(n),()=>t.children??N),y(n),q(e,n)};p(i,e=>{t.child?e(a):e(o,-1)}),q(e,r)},$$slots:{default:!0}}),H()}var Pc=Lt({component:`label`,parts:[`root`]}),Fc=class e{static create(t){return new e(t)}opts;attachment;constructor(e){this.opts=e,this.attachment=Vt(this.opts.ref),this.onmousedown=this.onmousedown.bind(this)}onmousedown(e){e.detail>1&&e.preventDefault()}#e=l(()=>({id:this.opts.id.current,[Pc.root]:``,onmousedown:this.onmousedown,...this.attachment}));get props(){return L(this.#e)}set props(e){R(this.#e,e)}},Ic=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`for`]),Lc=P(`<label><!></label>`);function Rc(e,t){let n=re();x(t,!0);let r=K(t,`id`,19,()=>Mt(n)),i=K(t,`ref`,15,null),a=U(t,Ic),o=Fc.create({id:Z(()=>r()),ref:Z(()=>i(),e=>i(e))}),s=l(()=>Ct(a,o.props,{for:t.for}));var u=_(),d=F(u),f=e=>{var n=_();h(F(n),()=>t.child,()=>({props:L(s)})),q(e,n)},m=e=>{var n=Lc();c(n,()=>({...L(s),for:t.for})),h(B(n),()=>t.children??N),y(n),q(e,n)};p(d,e=>{t.child?e(f):e(m,-1)}),q(e,u),H()}function zc(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=K(t,`onOpenChange`,3,an),i=K(t,`onOpenChangeComplete`,3,an);cc.create({open:Z(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:Z(()=>i())}),Mr(e,{children:(e,n)=>{var r=_();h(F(r),()=>t.children??N),q(e,r)},$$slots:{default:!0}}),H()}var Bc=Lt({component:`progress`,parts:[`root`]}),Vc=class e{static create(t){return new e(t)}opts;attachment;constructor(e){this.opts=e,this.attachment=Vt(this.opts.ref)}#e=l(()=>({role:`progressbar`,value:this.opts.value.current,"aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":this.opts.value.current===null?void 0:this.opts.value.current,"data-value":this.opts.value.current===null?void 0:this.opts.value.current,"data-state":Hc(this.opts.value.current,this.opts.max.current),"data-max":this.opts.max.current,"data-min":this.opts.min.current,"data-indeterminate":this.opts.value.current===null?``:void 0,[Bc.root]:``,...this.attachment}));get props(){return L(this.#e)}set props(e){R(this.#e,e)}};function Hc(e,t){return e===null?`indeterminate`:e===t?`loaded`:`loading`}var Uc=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`value`,`max`,`min`,`id`,`ref`]),Wc=P(`<div><!></div>`);function Gc(e,t){let n=re();x(t,!0);let r=K(t,`value`,3,0),i=K(t,`max`,3,100),a=K(t,`min`,3,0),o=K(t,`id`,19,()=>Mt(n)),s=K(t,`ref`,15,null),u=U(t,Uc),d=Vc.create({value:Z(()=>r()),max:Z(()=>i()),min:Z(()=>a()),id:Z(()=>o()),ref:Z(()=>s(),e=>s(e))}),f=l(()=>Ct(u,d.props));var m=_(),g=F(m),v=e=>{var n=_();h(F(n),()=>t.child,()=>({props:L(f)})),q(e,n)},b=e=>{var n=Wc();c(n,()=>({...L(f)})),h(B(n),()=>t.children??N),y(n),q(e,n)};p(g,e=>{t.child?e(v):e(b,-1)}),q(e,m),H()}var Kc=Lt({component:`radio-group`,parts:[`root`,`item`]}),qc=new wt(`RadioGroup.Root`),Jc=class e{static create(t){return qc.set(new e(t))}opts;#e=l(()=>this.opts.value.current!==``);get hasValue(){return L(this.#e)}set hasValue(e){R(this.#e,e)}rovingFocusGroup;attachment;constructor(e){this.opts=e,this.attachment=Vt(this.opts.ref),this.rovingFocusGroup=new Pt({rootNode:this.opts.ref,candidateAttr:Kc.item,loop:this.opts.loop,orientation:this.opts.orientation})}isChecked(e){return this.opts.value.current===e}setValue(e){this.opts.value.current=e}#t=l(()=>({id:this.opts.id.current,role:`radiogroup`,"aria-required":It(this.opts.required.current),"aria-disabled":It(this.opts.disabled.current),"aria-readonly":this.opts.readonly.current?`true`:void 0,"data-disabled":$t(this.opts.disabled.current),"data-readonly":$t(this.opts.readonly.current),"data-orientation":this.opts.orientation.current,[Kc.root]:``,...this.attachment}));get props(){return L(this.#t)}set props(e){R(this.#t,e)}},Yc=class e{static create(t){return new e(t,qc.get())}opts;root;attachment;#e=l(()=>this.root.opts.value.current===this.opts.value.current);get checked(){return L(this.#e)}set checked(e){R(this.#e,e)}#t=l(()=>this.opts.disabled.current||this.root.opts.disabled.current);#n=l(()=>this.root.opts.readonly.current);#r=l(()=>this.root.isChecked(this.opts.value.current));#i=X(-1);constructor(e,t){this.opts=e,this.root=t,this.attachment=Vt(this.opts.ref),this.opts.value.current===this.root.opts.value.current?(this.root.rovingFocusGroup.setCurrentTabStopId(this.opts.id.current),R(this.#i,0)):this.root.opts.value.current||R(this.#i,0),z(()=>{R(this.#i,this.root.rovingFocusGroup.getTabIndex(this.opts.ref.current),!0)}),Nt([()=>this.opts.value.current,()=>this.root.opts.value.current],()=>{this.opts.value.current===this.root.opts.value.current&&(this.root.rovingFocusGroup.setCurrentTabStopId(this.opts.id.current),R(this.#i,0))}),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onfocus=this.onfocus.bind(this)}onclick(e){this.opts.disabled.current||L(this.#n)||this.root.setValue(this.opts.value.current)}onfocus(e){!this.root.hasValue||L(this.#n)||this.root.setValue(this.opts.value.current)}onkeydown(e){if(!L(this.#t)){if(e.key===` `){e.preventDefault(),L(this.#n)||this.root.setValue(this.opts.value.current);return}this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e,!0)}}#a=l(()=>({checked:L(this.#r)}));get snippetProps(){return L(this.#a)}set snippetProps(e){R(this.#a,e)}#o=l(()=>({id:this.opts.id.current,disabled:L(this.#t)?!0:void 0,"data-value":this.opts.value.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":$t(L(this.#t)),"data-readonly":$t(L(this.#n)),"data-state":L(this.#r)?`checked`:`unchecked`,"aria-checked":zt(L(this.#r),!1),[Kc.item]:``,type:`button`,role:`radio`,tabindex:L(this.#i),onkeydown:this.onkeydown,onfocus:this.onfocus,onclick:this.onclick,...this.attachment}));get props(){return L(this.#o)}set props(e){R(this.#o,e)}},Xc=class e{static create(){return new e(qc.get())}root;#e=l(()=>this.root.opts.name.current!==void 0);get shouldRender(){return L(this.#e)}set shouldRender(e){R(this.#e,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){this.root.rovingFocusGroup.focusCurrentTabStop()}#t=l(()=>({name:this.root.opts.name.current,value:this.root.opts.value.current,required:this.root.opts.required.current,disabled:this.root.opts.disabled.current,onfocus:this.onfocus}));get props(){return L(this.#t)}set props(e){R(this.#t,e)}};function Zc(e,t){x(t,!1);let n=Xc.create();fe();var r=_(),i=F(r),a=e=>{ze(e,V(()=>n.props))};p(i,e=>{n.shouldRender&&e(a)}),q(e,r),H()}var Qc=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`children`,`child`,`value`,`ref`,`orientation`,`loop`,`name`,`required`,`readonly`,`id`,`onValueChange`]),$c=P(`<div><!></div>`),el=P(`<!> <!>`,1);function tl(e,t){let n=re();x(t,!0);let r=K(t,`disabled`,3,!1),i=K(t,`value`,15,``),a=K(t,`ref`,15,null),o=K(t,`orientation`,3,`vertical`),s=K(t,`loop`,3,!0),u=K(t,`name`,3,void 0),d=K(t,`required`,3,!1),f=K(t,`readonly`,3,!1),m=K(t,`id`,19,()=>Mt(n)),g=K(t,`onValueChange`,3,an),v=U(t,Qc),b=Jc.create({orientation:Z(()=>o()),disabled:Z(()=>r()),loop:Z(()=>s()),name:Z(()=>u()),required:Z(()=>d()),readonly:Z(()=>f()),id:Z(()=>m()),value:Z(()=>i(),e=>{e!==i()&&(i(e),g()?.(e))}),ref:Z(()=>a(),e=>a(e))}),S=l(()=>Ct(v,b.props));var C=el(),w=F(C),T=e=>{var n=_();h(F(n),()=>t.child,()=>({props:L(S)})),q(e,n)},E=e=>{var n=$c();c(n,()=>({...L(S)})),h(B(n),()=>t.children??N),y(n),q(e,n)};p(w,e=>{t.child?e(T):e(E,-1)}),Zc(Y(w,2),{}),q(e,C),H()}var nl=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`value`,`disabled`,`ref`]),rl=P(`<button><!></button>`);function il(e,t){let n=re();x(t,!0);let r=K(t,`id`,19,()=>Mt(n)),i=K(t,`disabled`,3,!1),a=K(t,`ref`,15,null),o=U(t,nl),s=Yc.create({value:Z(()=>t.value),disabled:Z(()=>i()??!1),id:Z(()=>r()),ref:Z(()=>a(),e=>a(e))}),u=l(()=>Ct(o,s.props));var d=_(),f=F(d),m=e=>{var n=_(),r=F(n);{let e=l(()=>({props:L(u),...s.snippetProps}));h(r,()=>t.child,()=>L(e))}q(e,n)},g=e=>{var n=rl();c(n,()=>({...L(u)})),h(B(n),()=>t.children??N,()=>s.snippetProps),y(n),q(e,n)};p(f,e=>{t.child?e(m):e(g,-1)}),q(e,d),H()}var al=Lt({component:`switch`,parts:[`root`,`thumb`]}),ol=new wt(`Switch.Root`),sl=class e{static create(t){return ol.set(new e(t))}opts;attachment;constructor(e){this.opts=e,this.attachment=Vt(e.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this)}#e(){this.opts.checked.current=!this.opts.checked.current}onkeydown(e){!(e.key===`Enter`||e.key===` `)||this.opts.disabled.current||(e.preventDefault(),this.#e())}onclick(e){this.opts.disabled.current||this.#e()}#t=l(()=>({"data-disabled":$t(this.opts.disabled.current),"data-state":Yt(this.opts.checked.current),"data-required":$t(this.opts.required.current)}));get sharedProps(){return L(this.#t)}set sharedProps(e){R(this.#t,e)}#n=l(()=>({checked:this.opts.checked.current}));get snippetProps(){return L(this.#n)}set snippetProps(e){R(this.#n,e)}#r=l(()=>({...this.sharedProps,id:this.opts.id.current,role:`switch`,disabled:tn(this.opts.disabled.current),"aria-checked":zt(this.opts.checked.current,!1),"aria-required":It(this.opts.required.current),[al.root]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return L(this.#r)}set props(e){R(this.#r,e)}},cl=class e{static create(){return new e(ol.get())}root;#e=l(()=>this.root.opts.name.current!==void 0);get shouldRender(){return L(this.#e)}set shouldRender(e){R(this.#e,e)}constructor(e){this.root=e}#t=l(()=>({type:`checkbox`,name:this.root.opts.name.current,value:this.root.opts.value.current,checked:this.root.opts.checked.current,disabled:this.root.opts.disabled.current,required:this.root.opts.required.current}));get props(){return L(this.#t)}set props(e){R(this.#t,e)}},ll=class e{static create(t){return new e(t,ol.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Vt(e.ref)}#e=l(()=>({checked:this.root.opts.checked.current}));get snippetProps(){return L(this.#e)}set snippetProps(e){R(this.#e,e)}#t=l(()=>({...this.root.sharedProps,id:this.opts.id.current,[al.thumb]:``,...this.attachment}));get props(){return L(this.#t)}set props(e){R(this.#t,e)}};function ul(e,t){x(t,!1);let n=cl.create();fe();var r=_(),i=F(r),a=e=>{ze(e,V(()=>n.props))};p(i,e=>{n.shouldRender&&e(a)}),q(e,r),H()}var dl=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`disabled`,`required`,`checked`,`value`,`name`,`type`,`onCheckedChange`]),fl=P(`<button><!></button>`),pl=P(`<!> <!>`,1);function ml(e,t){let n=re();x(t,!0);let r=K(t,`ref`,15,null),i=K(t,`id`,19,()=>Mt(n)),a=K(t,`disabled`,3,!1),o=K(t,`required`,3,!1),s=K(t,`checked`,15,!1),u=K(t,`value`,3,`on`),d=K(t,`name`,3,void 0),f=K(t,`type`,3,`button`),m=K(t,`onCheckedChange`,3,an),g=U(t,dl),v=sl.create({checked:Z(()=>s(),e=>{s(e),m()?.(e)}),disabled:Z(()=>a()??!1),required:Z(()=>o()),value:Z(()=>u()),name:Z(()=>d()),id:Z(()=>i()),ref:Z(()=>r(),e=>r(e))}),b=l(()=>Ct(g,v.props,{type:f()}));var S=pl(),C=F(S),w=e=>{var n=_(),r=F(n);{let e=l(()=>({props:L(b),...v.snippetProps}));h(r,()=>t.child,()=>L(e))}q(e,n)},T=e=>{var n=fl();c(n,()=>({...L(b)})),h(B(n),()=>t.children??N,()=>v.snippetProps),y(n),q(e,n)};p(C,e=>{t.child?e(w):e(T,-1)}),ul(Y(C,2),{}),q(e,S),H()}var hl=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`]),gl=P(`<span><!></span>`);function _l(e,t){let n=re();x(t,!0);let r=K(t,`ref`,15,null),i=K(t,`id`,19,()=>Mt(n)),a=U(t,hl),o=ll.create({id:Z(()=>i()),ref:Z(()=>r(),e=>r(e))}),s=l(()=>Ct(a,o.props));var u=_(),d=F(u),f=e=>{var n=_(),r=F(n);{let e=l(()=>({props:L(s),...o.snippetProps}));h(r,()=>t.child,()=>L(e))}q(e,n)},m=e=>{var n=gl();c(n,()=>({...L(s)})),h(B(n),()=>t.children??N,()=>o.snippetProps),y(n),q(e,n)};p(d,e=>{t.child?e(f):e(m,-1)}),q(e,u),H()}var vl=Lt({component:`toolbar`,parts:[`root`,`item`,`group`,`group-item`,`link`,`button`]}),yl=new wt(`Toolbar.Root`);new wt(`Toolbar.Group`);var bl=class e{static create(t){return yl.set(new e(t))}opts;rovingFocusGroup;attachment;constructor(e){this.opts=e,this.attachment=Vt(this.opts.ref),this.rovingFocusGroup=new Pt({orientation:this.opts.orientation,loop:this.opts.loop,rootNode:this.opts.ref,candidateAttr:vl.item})}#e=l(()=>({id:this.opts.id.current,role:`toolbar`,"data-orientation":this.opts.orientation.current,[vl.root]:``,...this.attachment}));get props(){return L(this.#e)}set props(e){R(this.#e,e)}},xl=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`orientation`,`loop`,`child`,`children`]),Sl=P(`<div><!></div>`);function Cl(e,t){let n=re();x(t,!0);let r=K(t,`ref`,15,null),i=K(t,`id`,19,()=>Mt(n)),a=K(t,`orientation`,3,`horizontal`),o=K(t,`loop`,3,!0),s=U(t,xl),u=bl.create({id:Z(()=>i()),orientation:Z(()=>a()),loop:Z(()=>o()),ref:Z(()=>r(),e=>r(e))}),d=l(()=>Ct(s,u.props));var f=_(),m=F(f),g=e=>{var n=_();h(F(n),()=>t.child,()=>({props:L(d)})),q(e,n)},v=e=>{var n=Sl();c(n,()=>({...L(d)})),h(B(n),()=>t.children??N),y(n),q(e,n)};p(m,e=>{t.child?e(g):e(v,-1)}),q(e,f),H()}var wl=class{#e;#t;#n=null;constructor(e,t){this.#t=e,this.#e=t,this.stop=this.stop.bind(this),this.start=this.start.bind(this),iee(this.stop)}#r(){this.#n!==null&&(window.clearTimeout(this.#n),this.#n=null)}stop(){this.#r()}start(...e){this.#r(),this.#n=window.setTimeout(()=>{this.#n=null,this.#t(...e)},this.#e)}},Tl=Lt({component:`tooltip`,parts:[`content`,`trigger`]}),El=new wt(`Tooltip.Provider`),Dl=new wt(`Tooltip.Root`),Ol=class{#e=X(Ie(new Map));get triggers(){return L(this.#e)}set triggers(e){R(this.#e,e,!0)}#t=X(null);get activeTriggerId(){return L(this.#t)}set activeTriggerId(e){R(this.#t,e,!0)}#n=l(()=>{let e=this.activeTriggerId;return e===null?null:this.triggers.get(e)?.node??null});get activeTriggerNode(){return L(this.#n)}set activeTriggerNode(e){R(this.#n,e)}#r=l(()=>{let e=this.activeTriggerId;return e===null?null:this.triggers.get(e)?.payload??null});get activePayload(){return L(this.#r)}set activePayload(e){R(this.#r,e)}register=e=>{let t=new Map(this.triggers);t.set(e.id,e),this.triggers=t,this.#i()};update=e=>{let t=new Map(this.triggers);t.set(e.id,e),this.triggers=t,this.#i()};unregister=e=>{if(!this.triggers.has(e))return;let t=new Map(this.triggers);t.delete(e),this.triggers=t,this.activeTriggerId===e&&(this.activeTriggerId=null)};setActiveTrigger=e=>{if(e===null){this.activeTriggerId=null;return}if(!this.triggers.has(e)){this.activeTriggerId=null;return}this.activeTriggerId=e};get=e=>this.triggers.get(e);has=e=>this.triggers.has(e);getFirstTriggerId=()=>{let e=this.triggers.entries().next();return e.done?null:e.value[0]};#i=()=>{let e=this.activeTriggerId;e!==null&&(this.triggers.has(e)||(this.activeTriggerId=null))}},kl=class e{static create(t){return El.set(new e(t))}opts;#e=X(!0);get isOpenDelayed(){return L(this.#e)}set isOpenDelayed(e){R(this.#e,e,!0)}isPointerInTransit=At(!1);#t;#n=X(null);constructor(e){this.opts=e,this.#t=new wl(()=>{this.isOpenDelayed=!0},this.opts.skipDelayDuration.current),Be(()=>Se(window,`scroll`,e=>{let t=L(this.#n);if(!t)return;let n=t.triggerNode;if(!n)return;let r=e.target;(r instanceof Element||r instanceof Document)&&r.contains(n)&&t.handleClose()}))}#r=()=>{if(this.opts.skipDelayDuration.current===0){this.isOpenDelayed=!0;return}else this.#t.start()};#i=()=>{this.#t.stop()};onOpen=e=>{L(this.#n)&&L(this.#n)!==e&&L(this.#n).handleClose(),this.#i(),this.isOpenDelayed=!1,R(this.#n,e,!0)};onClose=e=>{L(this.#n)===e&&(R(this.#n,null),this.#r())};isTooltipOpen=e=>L(this.#n)===e},Al=class e{static create(t){return Dl.set(new e(t,El.get()))}opts;provider;#e=l(()=>this.opts.delayDuration.current??this.provider.opts.delayDuration.current);get delayDuration(){return L(this.#e)}set delayDuration(e){R(this.#e,e)}#t=l(()=>this.opts.disableHoverableContent.current??this.provider.opts.disableHoverableContent.current);get disableHoverableContent(){return L(this.#t)}set disableHoverableContent(e){R(this.#t,e)}#n=l(()=>this.opts.disableCloseOnTriggerClick.current??this.provider.opts.disableCloseOnTriggerClick.current);get disableCloseOnTriggerClick(){return L(this.#n)}set disableCloseOnTriggerClick(e){R(this.#n,e)}#r=l(()=>this.opts.disabled.current??this.provider.opts.disabled.current);get disabled(){return L(this.#r)}set disabled(e){R(this.#r,e)}#i=l(()=>this.opts.ignoreNonKeyboardFocus.current??this.provider.opts.ignoreNonKeyboardFocus.current);get ignoreNonKeyboardFocus(){return L(this.#i)}set ignoreNonKeyboardFocus(e){R(this.#i,e)}registry;tether;#a=X(null);get contentNode(){return L(this.#a)}set contentNode(e){R(this.#a,e,!0)}contentPresence;#o=X(!1);#s;#c=l(()=>this.opts.open.current?L(this.#o)?`delayed-open`:`instant-open`:`closed`);get stateAttr(){return L(this.#c)}set stateAttr(e){R(this.#c,e)}constructor(e,t){this.opts=e,this.provider=t,this.tether=e.tether.current?.state??null,this.registry=this.tether?.registry??new Ol,this.#s=new wl(()=>{R(this.#o,!0),this.opts.open.current=!0},this.delayDuration??0),this.tether&&(this.tether.root=this,Be(()=>()=>{this.tether?.root===this&&(this.tether.root=null)})),this.contentPresence=new St({open:this.opts.open,ref:Z(()=>this.contentNode),onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),Nt(()=>this.delayDuration,()=>{this.delayDuration!==void 0&&(this.#s=new wl(()=>{R(this.#o,!0),this.opts.open.current=!0},this.delayDuration))}),Nt(()=>this.opts.open.current,e=>{e?(this.ensureActiveTrigger(),this.provider.onOpen(this)):this.provider.onClose(this)},{lazy:!0}),Nt(()=>this.opts.triggerId.current,e=>{e!==this.registry.activeTriggerId&&this.registry.setActiveTrigger(e)}),Nt(()=>this.registry.activeTriggerId,e=>{this.opts.triggerId.current!==e&&(this.opts.triggerId.current=e)})}handleOpen=()=>{this.#s.stop(),R(this.#o,!1),this.ensureActiveTrigger(),this.opts.open.current=!0};handleClose=()=>{this.#s.stop(),this.opts.open.current=!1};#l=()=>{this.#s.stop();let e=!this.provider.isOpenDelayed,t=this.delayDuration??0;e||t===0?(R(this.#o,!1),this.opts.open.current=!0):this.#s.start()};onTriggerEnter=e=>{this.setActiveTrigger(e),this.#l()};onTriggerLeave=()=>{this.disableHoverableContent?this.handleClose():this.#s.stop()};ensureActiveTrigger=()=>{if(this.registry.activeTriggerId!==null&&this.registry.has(this.registry.activeTriggerId))return;if(this.opts.triggerId.current!==null&&this.registry.has(this.opts.triggerId.current)){this.registry.setActiveTrigger(this.opts.triggerId.current);return}let e=this.registry.getFirstTriggerId();this.registry.setActiveTrigger(e)};setActiveTrigger=e=>{this.registry.setActiveTrigger(e)};registerTrigger=e=>{this.registry.register(e),e.disabled&&this.registry.activeTriggerId===e.id&&this.opts.open.current&&this.handleClose()};updateTrigger=e=>{this.registry.update(e),e.disabled&&this.registry.activeTriggerId===e.id&&this.opts.open.current&&this.handleClose()};unregisterTrigger=e=>{let t=this.registry.activeTriggerId===e;this.registry.unregister(e),t&&this.opts.open.current&&this.handleClose()};isActiveTrigger=e=>this.registry.activeTriggerId===e;get triggerNode(){return this.registry.activeTriggerNode}get activePayload(){return this.registry.activePayload}get activeTriggerId(){return this.registry.activeTriggerId}},jl=class e{static create(t){return t.tether.current?new e(t,null,t.tether.current.state):new e(t,Dl.get(),null)}opts;root;tether;attachment;#e=At(!1);#t=X(!1);domContext;#n=null;#r=!1;#i=null;constructor(e,t,n){this.opts=e,this.root=t,this.tether=n,this.domContext=new Ft(e.ref),this.attachment=Vt(this.opts.ref,e=>this.#s(e)),Nt(()=>this.opts.id.current,()=>{this.#s(this.opts.ref.current)}),Nt(()=>this.opts.payload.current,()=>{this.#s(this.opts.ref.current)}),Nt(()=>this.opts.disabled.current,()=>{this.#s(this.opts.ref.current)}),Be(()=>(this.#r=!0,this.#s(this.opts.ref.current),()=>{let e=this.#a(),t=this.#i;t&&(this.tether?this.tether.registry.unregister(t):e?.unregisterTrigger(t)),this.#i=null,this.#r=!1}))}#a=()=>this.tether?.root??this.root;#o=()=>{let e=this.#a();return this.opts.disabled.current||!!e?.disabled};#s=e=>{if(!this.#r)return;let t=this.opts.id.current,n=this.opts.payload.current,r=this.opts.disabled.current;if(this.#i&&this.#i!==t){let e=this.#a();this.tether?this.tether.registry.unregister(this.#i):e?.unregisterTrigger(this.#i)}let i={id:t,node:e,payload:n,disabled:r},a=this.#a();this.tether?(this.tether.registry.has(t)?this.tether.registry.update(i):this.tether.registry.register(i),r&&this.tether.registry.activeTriggerId===t&&a?.opts.open.current&&a.handleClose()):a?.registry.has(t)?a.updateTrigger(i):a?.registerTrigger(i),this.#i=t};#c=()=>{this.#n!==null&&(clearTimeout(this.#n),this.#n=null)};handlePointerUp=()=>{this.#e.current=!1};#l=()=>{this.#o()||(this.#e.current=!1)};#u=()=>{this.#o()||(this.#e.current=!0,this.domContext.getDocument().addEventListener(`pointerup`,()=>{this.handlePointerUp()},{once:!0}))};#d=e=>{let t=this.#a();if(t){if(this.#o()){t.opts.open.current&&t.handleClose();return}if(e.pointerType!==`touch`){if(t.provider.isPointerInTransit.current){this.#c(),this.#n=window.setTimeout(()=>{t.provider.isPointerInTransit.current&&(t.provider.isPointerInTransit.current=!1,t.onTriggerEnter(this.opts.id.current),R(this.#t,!0))},250);return}t.onTriggerEnter(this.opts.id.current),R(this.#t,!0)}}};#f=e=>{let t=this.#a();if(t){if(this.#o()){t.opts.open.current&&t.handleClose();return}e.pointerType!==`touch`&&(L(this.#t)||(this.#c(),t.provider.isPointerInTransit.current=!1,t.onTriggerEnter(this.opts.id.current),R(this.#t,!0)))}};#p=e=>{let t=this.#a();if(!t||this.#o())return;if(this.#c(),!t.isActiveTrigger(this.opts.id.current)){R(this.#t,!1);return}let n=e.relatedTarget;if(Et(n)){for(let e of t.registry.triggers.values())if(e.node===n){if(t.provider.opts.skipDelayDuration.current>0){R(this.#t,!1);return}t.handleClose(),R(this.#t,!1);return}}t.onTriggerLeave(),R(this.#t,!1)};#m=e=>{let t=this.#a();if(t&&!this.#e.current){if(this.#o()){t.opts.open.current&&t.handleClose();return}t.ignoreNonKeyboardFocus&&!aee(e.currentTarget)||(t.setActiveTrigger(this.opts.id.current),t.handleOpen())}};#h=()=>{let e=this.#a();!e||this.#o()||e.handleClose()};#g=()=>{let e=this.#a();!e||e.disableCloseOnTriggerClick||this.#o()||e.handleClose()};#_=l(()=>{let e=this.#a(),t=!!(e?.opts.open.current&&e.isActiveTrigger(this.opts.id.current)),n=this.#o();return{id:this.opts.id.current,"aria-describedby":t?e?.contentNode?.id:void 0,"data-state":t?e?.stateAttr:`closed`,"data-disabled":$t(n),"data-delay-duration":`${e?.delayDuration??0}`,[Tl.trigger]:``,tabindex:n?void 0:this.opts.tabindex.current,disabled:this.opts.disabled.current,onpointerup:this.#l,onpointerdown:this.#u,onpointerenter:this.#d,onpointermove:this.#f,onpointerleave:this.#p,onfocus:this.#m,onblur:this.#h,onclick:this.#g,...this.attachment}});get props(){return L(this.#_)}set props(e){R(this.#_,e)}},Ml=class e{static create(t){return new e(t,Dl.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Vt(this.opts.ref,e=>this.root.contentNode=e),new ac({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&!this.root.disableHoverableContent,transitIntentTimeout:180,ignoredTargets:()=>{if(this.root.provider.opts.skipDelayDuration.current===0)return[];let e=[],t=this.root.triggerNode;for(let n of this.root.registry.triggers.values())n.node&&n.node!==t&&e.push(n.node);return e},onPointerExit:()=>{this.root.provider.isTooltipOpen(this.root)&&this.root.handleClose()}})}onInteractOutside=e=>{if(Et(e.target)&&this.root.triggerNode?.contains(e.target)&&this.root.disableCloseOnTriggerClick){e.preventDefault();return}this.opts.onInteractOutside.current(e),!e.defaultPrevented&&this.root.handleClose()};onEscapeKeydown=e=>{this.opts.onEscapeKeydown.current?.(e),!e.defaultPrevented&&this.root.handleClose()};onOpenAutoFocus=e=>{e.preventDefault()};onCloseAutoFocus=e=>{e.preventDefault()};get shouldRender(){return this.root.contentPresence.shouldRender}#e=l(()=>({open:this.root.opts.open.current}));get snippetProps(){return L(this.#e)}set snippetProps(e){R(this.#e,e)}#t=l(()=>({id:this.opts.id.current,"data-state":this.root.stateAttr,"data-disabled":$t(this.root.disabled),...Ht(this.root.contentPresence.transitionStatus),style:{outline:`none`},[Tl.content]:``,...this.attachment}));get props(){return L(this.#t)}set props(e){R(this.#t,e)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown,onOpenAutoFocus:this.onOpenAutoFocus,onCloseAutoFocus:this.onCloseAutoFocus}};function Nl(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=K(t,`triggerId`,15,null),i=K(t,`onOpenChange`,3,an),a=K(t,`onOpenChangeComplete`,3,an),o=Al.create({open:Z(()=>n(),e=>{n(e),i()(e)}),triggerId:Z(()=>r(),e=>{r(e)}),delayDuration:Z(()=>t.delayDuration),disableCloseOnTriggerClick:Z(()=>t.disableCloseOnTriggerClick),disableHoverableContent:Z(()=>t.disableHoverableContent),ignoreNonKeyboardFocus:Z(()=>t.ignoreNonKeyboardFocus),disabled:Z(()=>t.disabled),onOpenChangeComplete:Z(()=>a()),tether:Z(()=>t.tether)});Mr(e,{tooltip:!0,children:(e,n)=>{var r=_();h(F(r),()=>t.children??N,()=>({open:o.opts.open.current,triggerId:o.activeTriggerId,payload:o.activePayload})),q(e,r)},$$slots:{default:!0}}),H()}var Pl=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`side`,`sideOffset`,`align`,`avoidCollisions`,`arrowPadding`,`sticky`,`strategy`,`hideWhenDetached`,`customAnchor`,`collisionPadding`,`onInteractOutside`,`onEscapeKeydown`,`forceMount`,`style`]),Fl=P(`<div><div><!></div></div>`);function Jee(e,t){let n=re();x(t,!0);let r=K(t,`id`,19,()=>Mt(n)),i=K(t,`ref`,15,null),a=K(t,`side`,3,`top`),o=K(t,`sideOffset`,3,0),s=K(t,`align`,3,`center`),u=K(t,`avoidCollisions`,3,!0),d=K(t,`arrowPadding`,3,0),f=K(t,`sticky`,3,`partial`),m=K(t,`hideWhenDetached`,3,!1),g=K(t,`collisionPadding`,3,0),v=K(t,`onInteractOutside`,3,an),b=K(t,`onEscapeKeydown`,3,an),S=K(t,`forceMount`,3,!1),C=U(t,Pl),w=Ml.create({id:Z(()=>r()),ref:Z(()=>i(),e=>i(e)),onInteractOutside:Z(()=>v()),onEscapeKeydown:Z(()=>b())}),T=l(()=>({side:a(),sideOffset:o(),align:s(),avoidCollisions:u(),arrowPadding:d(),sticky:f(),hideWhenDetached:m(),collisionPadding:g(),strategy:t.strategy,customAnchor:t.customAnchor??w.root.triggerNode})),E=l(()=>Ct(C,L(T),w.props));var D=_(),O=F(D),k=e=>{{let n=(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=l(()=>Ct(i(),{style:{pointerEvents:w.root.disableHoverableContent?`none`:void 0}})),o=l(()=>Ct(r(),{style:Pr(`tooltip`)},{style:t.style}));var s=_(),u=F(s),d=e=>{var n=_(),r=F(n);{let e=l(()=>({props:L(o),wrapperProps:L(a),...w.snippetProps}));h(r,()=>t.child,()=>L(e))}q(e,n)},f=e=>{var n=Fl();c(n,()=>({...L(a)}));var r=B(n);c(r,()=>({...L(o)})),h(B(r),()=>t.children??N),y(r),y(n),q(e,n)};p(u,e=>{t.child?e(d):e(f,-1)}),q(e,s)},i=l(()=>w.root.disableHoverableContent?`none`:`auto`);Ir(e,V(()=>L(E),()=>w.popperProps,{get enabled(){return w.root.opts.open.current},get id(){return r()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!0,get ref(){return w.opts.ref},tooltip:!0,get shouldRender(){return w.shouldRender},get contentPointerEvents(){return L(i)},popper:n,$$slots:{popper:!0}}))}},ee=e=>{{let n=(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=l(()=>Ct(i(),{style:{pointerEvents:w.root.disableHoverableContent?`none`:void 0}})),o=l(()=>Ct(r(),{style:Pr(`tooltip`)},{style:t.style}));var s=_(),u=F(s),d=e=>{var n=_(),r=F(n);{let e=l(()=>({props:L(o),wrapperProps:L(a),...w.snippetProps}));h(r,()=>t.child,()=>L(e))}q(e,n)},f=e=>{var n=Fl();c(n,()=>({...L(a)}));var r=B(n);c(r,()=>({...L(o)})),h(B(r),()=>t.children??N),y(r),y(n),q(e,n)};p(u,e=>{t.child?e(d):e(f,-1)}),q(e,s)},i=l(()=>w.root.disableHoverableContent?`none`:`auto`);Nr(e,V(()=>L(E),()=>w.popperProps,{get open(){return w.root.opts.open.current},get id(){return r()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!1,get ref(){return w.opts.ref},tooltip:!0,get shouldRender(){return w.shouldRender},get contentPointerEvents(){return L(i)},popper:n,$$slots:{popper:!0}}))}};p(O,e=>{S()?e(k):S()||e(ee,1)}),q(e,D),H()}var Yee=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`disabled`,`payload`,`tether`,`type`,`tabindex`,`ref`]),Xee=P(`<button><!></button>`);function Zee(e,t){let n=re();x(t,!0);let r=K(t,`id`,19,()=>Mt(n)),i=K(t,`disabled`,3,!1),a=K(t,`type`,3,`button`),o=K(t,`tabindex`,3,0),s=K(t,`ref`,15,null),u=U(t,Yee),d=jl.create({id:Z(()=>r()),disabled:Z(()=>i()??!1),tabindex:Z(()=>o()??0),payload:Z(()=>t.payload),tether:Z(()=>t.tether),ref:Z(()=>s(),e=>s(e))}),f=l(()=>Ct(u,d.props,{type:a()}));var m=_(),g=F(m),v=e=>{var n=_();h(F(n),()=>t.child,()=>({props:L(f)})),q(e,n)},b=e=>{var n=Xee();c(n,()=>({...L(f)})),h(B(n),()=>t.children??N),y(n),q(e,n)};p(g,e=>{t.child?e(v):e(b,-1)}),q(e,m),H()}var Qee=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function $ee(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=U(t,Qee);tc(e,V(()=>r,{get ref(){return n()},set ref(e){n(e)}})),H()}function ete(e,t){x(t,!0);let n=K(t,`delayDuration`,3,700),r=K(t,`disableCloseOnTriggerClick`,3,!1),i=K(t,`disableHoverableContent`,3,!1),a=K(t,`disabled`,3,!1),o=K(t,`ignoreNonKeyboardFocus`,3,!1),s=K(t,`skipDelayDuration`,3,300);kl.create({delayDuration:Z(()=>n()),disableCloseOnTriggerClick:Z(()=>r()),disableHoverableContent:Z(()=>i()),disabled:Z(()=>a()),ignoreNonKeyboardFocus:Z(()=>o()),skipDelayDuration:Z(()=>s())});var c=_();h(F(c),()=>t.children??N),q(e,c),H()}var tte=`application/x-nerve-panel-view`,Il=Ie({});function nte(e){Il.viewId=e,Il.hoverDock=void 0,Il.hoverIndex=void 0}function Ll(e,t){Il.hoverDock=e,Il.hoverIndex=t}function Rl(e){Il.hoverDock===e&&(Il.hoverDock=void 0,Il.hoverIndex=void 0)}function zl(){Il.viewId=void 0,Il.hoverDock=void 0,Il.hoverIndex=void 0}var rte=P(`<button type="button" role="tab"><!></button>`),ite=P(`<span class="dock-tab-drop-end svelte-l43sst" aria-hidden="true"></span>`),ate=P(`<div role="presentation"><div class="dock-tabs svelte-l43sst" role="tablist"><!> <!></div> <span class="sr-only" aria-live="polite"> </span></div>`);function Bl(e,t){x(t,!0);let n=K(t,`registry`,19,()=>t.views),r=K(t,`draggable`,3,!0),i=X(null),a=X(``),o={left:qs,right:Ys,bottom:Gs},s=l(()=>!!(r()&&Il.viewId)),c=l(()=>Il.hoverDock===t.dock?Il.hoverIndex:void 0);function u(e){if(!L(i))return t.views.length;let n=[...L(i).querySelectorAll(`[data-view-id]`)];for(let[t,r]of n.entries()){let n=r.getBoundingClientRect();if(e.clientX<n.left+n.width/2)return t}return n.length}function m(e,r){t.onMove?.(e,r);let i=n().find(t=>t.id===e)?.title??`Panel`,o=Fs[r.dock].toLowerCase();R(a,r.dock===t.dock?`${i} moved to ${o}, position ${r.index+1}`:`${i} moved to ${o}`,!0)}function h(e){L(s)&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),Ll(t.dock,u(e)))}function g(e){if(!L(s))return;e.preventDefault();let n=Il.viewId??e.dataTransfer?.getData(`application/x-nerve-panel-view`),r=u(e);zl(),n&&m(n,{dock:t.dock,index:r})}function _(e,n){let r=Ps.map(r=>({label:`Move to ${Fs[r]}`,icon:o[r],disabled:r===t.dock||!t.onMove,onSelect:()=>m(e.id,{dock:r,index:r===t.dock?n:2**53-1})}));return r.push({type:`separator`},{label:`Move Left`,icon:Vs,disabled:n===0||!t.onMove,onSelect:()=>m(e.id,{dock:t.dock,index:n-1})},{label:`Move Right`,icon:Us,disabled:n>=t.views.length-1||!t.onMove,onSelect:()=>m(e.id,{dock:t.dock,index:n+1})}),e.hideable!==!1&&t.onHide&&r.push({type:`separator`},{label:`Hide "${e.title}"`,icon:zs,onSelect:()=>t.onHide(e.id)}),r}function v(e,n){let r=_(e,n);return t.buildMenuItems?.({view:e,dock:t.dock,index:n,views:t.views,defaultItems:r})??r}let b={conversations:`conversations-tab`,files:`files-panel`,tasks:`tasks-panel`,notes:`scratch-notes-panel`,git:`git-workflow`,"pull-requests":`pull-request-workflow`,context:`context-panel`};var S=ate();let C;var T=B(S),E=B(T);O(E,19,()=>t.views,e=>e.id,(e,n,i)=>{let a=l(()=>L(n).icon);{let o=l(()=>v(L(n),L(i)));zr(e,{get items(){return L(o)},triggerClass:`contents`,children:(e,o)=>{var s=rte();let l;d(B(s),()=>L(a),(e,t)=>{t(e,{size:14,strokeWidth:2.1,"aria-hidden":`true`})}),y(s),J(e=>{l=w(s,1,`dock-tab svelte-l43sst`,null,l,{active:L(n).id===t.activeViewId,dragging:Il.viewId===L(n).id,"drop-before":L(c)===L(i)}),A(s,`data-view-id`,L(n).id),A(s,`data-tour-id`,b[L(n).id]),A(s,`aria-selected`,L(n).id===t.activeViewId),A(s,`aria-label`,L(n).title),A(s,`title`,L(n).title),A(s,`draggable`,e)},[()=>r()&&!!t.onMove]),Ae(`dragstart`,s,e=>{t.onMove&&(nte(L(n).id),e.dataTransfer?.setData(tte,L(n).id),e.dataTransfer?.setData(`text/plain`,L(n).title),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`))}),Ae(`dragend`,s,function(...e){zl?.apply(this,e)}),le(`click`,s,()=>t.onSelect?.(L(n).id)),q(e,s)},$$slots:{default:!0}})}});var D=Y(E,2),k=e=>{q(e,ite())};p(D,e=>{L(s)&&L(c)!==void 0&&L(c)>=t.views.length&&e(k)}),y(T);var ee=Y(T,2),j=B(ee,!0);y(ee),y(S),ie(S,e=>R(i,e),()=>L(i)),J(()=>{C=w(S,1,`dock-tab-strip svelte-l43sst`,null,C,{"drag-active":L(s)}),A(S,`data-tour-id`,t.dock===`left`?`panel-layout`:void 0),A(T,`aria-label`,`${Fs[t.dock]} views`),f(j,L(a))}),Ae(`dragover`,S,h),Ae(`dragleave`,S,()=>Rl(t.dock)),Ae(`drop`,S,g),q(e,S),H()}r([`click`]);var ote=P(`<section class="dock-panel"><!> <div class="dock-body" role="presentation"><!> <!></div></section>`);function Vl(e,t){x(t,!0);let n=K(t,`registry`,19,()=>t.views),r=K(t,`draggable`,3,!0),i=l(()=>!!(r()&&Il.viewId&&t.onMove));function a(e){L(i)&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),Ll(t.dock,t.views.length))}function o(e){if(!L(i))return;e.preventDefault();let n=Il.viewId??e.dataTransfer?.getData(`application/x-nerve-panel-view`);zl(),n&&t.onMove?.(n,{dock:t.dock,index:t.views.length})}var s=ote(),c=B(s);Bl(c,{get dock(){return t.dock},get views(){return t.views},get registry(){return n()},get activeViewId(){return t.activeViewId},get draggable(){return r()},get buildMenuItems(){return t.buildMenuItems},get onSelect(){return t.onSelect},get onMove(){return t.onMove},get onHide(){return t.onHide}});var u=Y(c,2),d=B(u),f=e=>{var n=_();h(F(n),()=>t.panelView,()=>t.activeViewId),q(e,n)};p(d,e=>{t.activeViewId&&e(f)});var m=Y(d,2),g=e=>{{let n=l(()=>Il.hoverDock===t.dock);Ls(e,{get dock(){return t.dock},get hovered(){return L(n)}})}};p(m,e=>{L(i)&&e(g)}),y(u),y(s),J(()=>{A(s,`data-dock`,t.dock),A(s,`aria-label`,Fs[t.dock])}),Ae(`dragover`,u,a),Ae(`dragleave`,u,()=>Rl(t.dock)),Ae(`drop`,u,o),q(e,s),H()}var ste=new Set([`$$slots`,`$$events`,`$$legacy`]);function Hl(e,t){let n=U(t,ste),r=[[`path`,{d:`m15 18-6-6 6-6`}]];G(e,V({name:`chevron-left`},()=>n,{get iconNode(){return r}}))}var cte=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ul(e,t){let n=U(t,cte),r=[[`path`,{d:`M5 12h14`}],[`path`,{d:`M12 5v14`}]];G(e,V({name:`plus`},()=>n,{get iconNode(){return r}}))}var lte=new Set([`$$slots`,`$$events`,`$$legacy`]);function Wl(e,t){let n=U(t,lte),r=[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}],[`path`,{d:`M21 3v5h-5`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}],[`path`,{d:`M8 16H3v5`}]];G(e,V({name:`refresh-cw`},()=>n,{get iconNode(){return r}}))}var ute=P(`<button type="button" class="tab-file-toggle svelte-cucb0v"><!></button>`),dte=P(`<span class="tab-status svelte-cucb0v" aria-hidden="true"></span>`),Gl=P(`<span class="tab-kind-icon flex-none svelte-cucb0v"><!></span>`),fte=P(`<span class="draft-dot svelte-cucb0v" title="Draft" aria-label="Draft"></span>`),pte=P(`<div class="editor-tab group relative inline-grid h-8 w-full grid-cols-[auto_minmax(0,1fr)_auto] border-r border-r-border/62 bg-card text-muted-foreground data-[active]:bg-background data-[active]:text-foreground data-[dragging]:opacity-55 not-data-[active]:hover:bg-accent/60 not-data-[active]:hover:text-foreground svelte-cucb0v" role="presentation"><div class="inline-grid h-8 w-5.5 place-items-center pl-1.5"><!></div> <button type="button" class="inline-flex h-8 min-w-0 cursor-pointer items-center gap-1.5 border-0 bg-transparent px-1 text-left text-xs text-inherit focus-visible:z-1 focus-visible:-outline-offset-1 focus-visible:outline-1 focus-visible:outline-ring" role="tab"><!> <span class="min-w-0 overflow-hidden text-ellipsis whitespace-nowrap"> </span> <!></button> <button type="button" class="inline-grid w-5.5 cursor-pointer place-items-center rounded-none border-0 bg-transparent text-inherit opacity-62 hover:bg-destructive/12 hover:text-destructive hover:opacity-100 focus-visible:z-1 focus-visible:-outline-offset-1 focus-visible:outline-1 focus-visible:outline-ring" title="Close tab"><!></button></div>`),mte=P(`<div class="flex items-center border-l border-l-border/62 px-1"><!></div>`),hte=P(`<nav class="flex min-h-8 min-w-0 border-b border-border bg-card" aria-label="Open editor tabs"><!> <div class="tab-scroller flex min-w-0 flex-1 overflow-x-auto overflow-y-hidden svelte-cucb0v"></div> <!> <!> <span class="sr-only" aria-live="polite"> </span></nav>`);function Kl(e,t){x(t,!0);let n=K(t,`tabs`,19,()=>[]),r=K(t,`newLabel`,3,`New chat`),i=X(null),a=X(!1),o=X(!1),s=X(void 0),c=X(void 0),u=X(``);function m(){L(i)&&(R(a,L(i).scrollLeft>1),R(o,L(i).scrollLeft+L(i).clientWidth<L(i).scrollWidth-1))}function h(e){L(i)?.scrollBy({left:e*Math.max(160,L(i).clientWidth*.75),behavior:`smooth`})}function g(e,n){t.onReorder&&(R(s,b(n),!0),e.dataTransfer?.setData(`text/plain`,L(s)),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`))}function _(e,r){e.preventDefault();let i=L(s)??e.dataTransfer?.getData(`text/plain`),a=n().find(e=>b(e)===i);a&&(t.onReorder?.(v(a),r),R(u,`${a.label} moved to position ${r+1}`)),R(s,void 0),R(c,void 0)}z(()=>{if(!L(i))return;let e=new ResizeObserver(m);return e.observe(L(i)),m(),()=>e.disconnect()}),z(()=>{let e=n().find(e=>e.active);requestAnimationFrame(()=>{m(),e&&L(i)&&[...L(i).querySelectorAll(`[data-tab-key]`)].find(t=>t.dataset.tabKey===b(e))?.scrollIntoView({block:`nearest`,inline:`nearest`})})});function v(e){return{kind:e.kind,id:e.id}}function b(e){return e.key??`${e.kind}:${e.id}`}function S(e,r){let i=v(e),a=r>0,o=r>=0&&r<n().length-1,s=[{label:`Refresh`,icon:Wl,shortcut:t.refreshShortcut,disabled:!t.onRefresh,onSelect:()=>t.onRefresh?.(i)}];return t.onReorder&&s.push({type:`separator`},{label:`Move Left`,icon:Vs,disabled:!a,onSelect:()=>t.onReorder(i,r-1)},{label:`Move Right`,icon:Us,disabled:!o,onSelect:()=>t.onReorder(i,r+1)}),s.push({type:`separator`},{label:`Close Pane`,icon:li,shortcut:t.closeShortcut,disabled:e.closeable===!1||!t.onClose,onSelect:()=>t.onClose?.(i)},{label:`Close Other Panes`,icon:li,shortcut:t.closeOthersShortcut,disabled:n().length<=1||!t.onCloseOther,onSelect:()=>t.onCloseOther?.(i)},{label:`Close Panes on Right`,icon:li,disabled:!o||!t.onCloseRight,onSelect:()=>t.onCloseRight?.(i)},{label:`Close Panes on Left`,icon:li,disabled:!a||!t.onCloseLeft,onSelect:()=>t.onCloseLeft?.(i)}),s}function C(e,r){return t.buildMenuItems?.({tab:e,tabs:n(),index:r})??S(e,r)}var w=hte(),T=B(w),E=e=>{{let t=l(()=>!L(a));W(e,{variant:`ghost`,size:`icon-sm`,class:`rounded-none border-r-border/62`,ariaLabel:`Scroll tabs left`,get disabled(){return L(t)},onclick:()=>h(-1),children:(e,t)=>{Hl(e,{size:14,strokeWidth:2.2})},$$slots:{default:!0}})}};p(T,e=>{(L(a)||L(o))&&e(E)});var D=Y(T,2);O(D,23,n,e=>b(e),(e,n,r)=>{let i=l(()=>L(n).icon),a=l(()=>L(n).selectIcon),o=l(()=>L(n).toggle?.icon);{let u=l(()=>C(L(n),L(r))),m=l(()=>`h-8 min-w-0 flex-none ${L(n).wide?`w-54 basis-54`:`w-50 basis-50`}`);zr(e,{get items(){return L(u)},get triggerClass(){return L(m)},children:(e,l)=>{var u=pte(),m=B(u),h=B(m),x=e=>{var t=ute();d(B(t),()=>L(o),(e,t)=>{t(e,{size:12,strokeWidth:2.2,"aria-hidden":`true`})}),y(t),J(()=>{A(t,`aria-label`,L(n).toggle.label),A(t,`title`,L(n).toggle.title??L(n).toggle.label),t.disabled=L(n).toggle.disabled}),le(`click`,t,e=>{e.stopPropagation(),L(n).toggle?.onClick?.(e)}),q(e,t)},S=e=>{ci(e,{get tone(){return L(n).status.tone},get pulse(){return L(n).status.pulse},get label(){return L(n).status.label}})},C=e=>{var t=dte();J(()=>A(t,`title`,L(n).status?.label)),q(e,t)},w=e=>{var t=Gl();d(B(t),()=>L(i),(e,t)=>{t(e,{size:12,strokeWidth:2.2,"aria-hidden":`true`})}),y(t),q(e,t)};p(h,e=>{L(n).toggle&&L(o)?e(x):L(n).status?.tone?e(S,1):L(n).status||L(n).running||L(n).error?e(C,2):L(i)&&e(w,3)}),y(m);var T=Y(m,2),E=B(T),D=e=>{var t=Gl();d(B(t),()=>L(a),(e,t)=>{t(e,{size:12,strokeWidth:2.2,"aria-hidden":`true`})}),y(t),q(e,t)};p(E,e=>{L(a)&&e(D)});var O=Y(E,2),k=B(O,!0);y(O);var ee=Y(O,2),j=e=>{q(e,fte())};p(ee,e=>{L(n).draft&&e(j)}),y(T);var M=Y(T,2);li(B(M),{size:13,strokeWidth:2.2}),y(M),y(u),J((e,t,r,i)=>{A(u,`data-active`,L(n).active?``:void 0),A(u,`data-running`,L(n).running?``:void 0),A(u,`data-errored`,L(n).error?``:void 0),A(u,`data-dragging`,e),A(u,`data-drop-target`,t),A(u,`data-tab-key`,r),A(u,`draggable`,i),A(T,`aria-selected`,L(n).active),A(T,`title`,L(n).title??L(n).label),f(k,L(n).label),A(M,`aria-label`,`Close ${L(n).label}`),M.disabled=L(n).closeable===!1},[()=>L(s)===b(L(n))?``:void 0,()=>L(c)===L(r)&&L(s)!==b(L(n))?``:void 0,()=>b(L(n)),()=>!!t.onReorder]),Ae(`dragstart`,u,e=>g(e,L(n))),Ae(`dragover`,u,e=>{t.onReorder&&(e.preventDefault(),R(c,L(r),!0))}),Ae(`drop`,u,e=>_(e,L(r))),Ae(`dragend`,u,()=>{R(s,void 0),R(c,void 0)}),le(`click`,T,()=>t.onSelect?.(v(L(n)))),le(`click`,M,()=>t.onClose?.(v(L(n)))),q(e,u)},$$slots:{default:!0}})}}),y(D),ie(D,e=>R(i,e),()=>L(i));var k=Y(D,2),ee=e=>{{let t=l(()=>!L(o));W(e,{variant:`ghost`,size:`icon-sm`,class:`rounded-none border-l-border/62`,ariaLabel:`Scroll tabs right`,get disabled(){return L(t)},onclick:()=>h(1),children:(e,t)=>{si(e,{size:14,strokeWidth:2.2})},$$slots:{default:!0}})}};p(k,e=>{(L(a)||L(o))&&e(ee)});var j=Y(k,2),M=e=>{var n=mte(),i=B(n);{let e=l(()=>t.newShortcut?`${r()} (${t.newShortcut})`:r());W(i,{variant:`ghost`,size:`icon-sm`,get ariaLabel(){return r()},get"aria-keyshortcuts"(){return t.newShortcutAria},"data-tour-id":`tab-new-conversation`,get title(){return L(e)},get onclick(){return t.onNew},children:(e,t)=>{Ul(e,{size:13,strokeWidth:2.25})},$$slots:{default:!0}})}y(n),q(e,n)};p(j,e=>{t.onNew&&e(M)});var N=Y(j,2),te=B(N,!0);y(N),y(w),J(()=>f(te,L(u))),Ae(`scroll`,D,m),q(e,w),H()}r([`click`]);var gte=P(`<div class="grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)]"><!> <div class="grid min-h-0 min-w-0 grid-rows-[minmax(0,1fr)]"><!></div></div>`);function _te(e,t){x(t,!0);let n=K(t,`tabs`,19,()=>[]);var r=gte(),i=B(r),a=e=>{var n=_();h(F(n),()=>t.tabStrip),q(e,n)},o=e=>{Kl(e,{get tabs(){return n()},get buildMenuItems(){return t.buildMenuItems},get onSelect(){return t.onSelect},get onClose(){return t.onClose},get onRefresh(){return t.onRefresh},get onCloseOther(){return t.onCloseOther},get onCloseRight(){return t.onCloseRight},get onCloseLeft(){return t.onCloseLeft},get onNew(){return t.onNew},get onReorder(){return t.onReorder}})};p(i,e=>{t.tabStrip?e(a):e(o,-1)});var s=Y(i,2),c=B(s),l=e=>{var n=_();h(F(n),()=>t.content),q(e,n)},u=e=>{var n=_();h(F(n),()=>t.empty),q(e,n)};p(c,e=>{t.contentVisible??n().length>0?e(l):t.empty&&e(u,1)}),y(s),y(r),q(e,r),H()}var ql={left:{min:14,max:34},right:{min:16,max:40},bottom:{min:12,max:70}},Jl={left:19,right:24,bottom:30};function Yl(e,t){let n=ql[e];return typeof t!=`number`||!Number.isFinite(t)?Jl[e]:Math.min(n.max,Math.max(n.min,t))}function vte(e){return Ps.includes(e)}function Xl(e){return{version:1,docks:{left:{...e.docks.left,views:[...e.docks.left.views]},right:{...e.docks.right,views:[...e.docks.right.views]},bottom:{...e.docks.bottom,views:[...e.docks.bottom.views]}},hidden:[...e.hidden]}}function yte(e,t,n){let r=t.views.filter(e=>!n.includes(e)),i=t.activeViewId&&r.includes(t.activeViewId)?t.activeViewId:r[0];return{views:t.views,activeViewId:i,size:Yl(e,t.size),collapsed:r.length===0?!0:t.collapsed}}function Zl(e){let t=Xl(e);for(let e of Ps)t.docks[e]=yte(e,t.docks[e],t.hidden);return t}function bte(e,t={}){let n={};for(let r of Ps){let i=e.filter(e=>e.defaultDock===r).sort((e,t)=>e.defaultOrder-t.defaultOrder).map(e=>e.id);n[r]={views:i,activeViewId:i[0],size:Yl(r,t.sizes?.[r]??Jl[r]),collapsed:t.collapsed?.includes(r)??!1}}return Zl({version:1,docks:n,hidden:[]})}function Ql(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function $l(e,t,n={}){let r=bte(t,n);if(!e||typeof e!=`object`||Array.isArray(e))return r;let i=e,a=i.docks&&typeof i.docks==`object`?i.docks:void 0;if(!a)return r;let o=new Set(t.map(e=>e.id)),s=new Set,c={};for(let e of Ps){let t=a[e],n=t&&typeof t==`object`?t:{};c[e]={views:Ql(n.views).filter(e=>!o.has(e)||s.has(e)?!1:(s.add(e),!0)),activeViewId:typeof n.activeViewId==`string`?n.activeViewId:void 0,size:Yl(e,n.size??r.docks[e].size),collapsed:n.collapsed===!0}}for(let e of[...t].sort((e,t)=>e.defaultOrder-t.defaultOrder))s.has(e.id)||(s.add(e.id),c[e.defaultDock].views.push(e.id));let l=Ql(i.hidden).filter(e=>o.has(e));return Zl({version:1,docks:c,hidden:[...new Set(l)]})}function eu(e,t){return Ps.find(n=>e.docks[n].views.includes(t))}function xte(e,t,n){if(!vte(n.dock))return e;let r=eu(e,t);if(!r)return e;let i=Xl(e),a=i.docks[r],o=a.views.indexOf(t);a.views.splice(o,1);let s=i.docks[n.dock],c=Math.min(Math.max(n.index,0),s.views.length);return s.views.splice(c,0,t),i.hidden=i.hidden.filter(e=>e!==t),s.activeViewId=t,s.collapsed=!1,Zl(i)}function Ste(e,t){let n=eu(e,t);if(!n)return e;let r=Xl(e);return r.hidden=r.hidden.filter(e=>e!==t),r.docks[n].activeViewId=t,r.docks[n].collapsed=!1,Zl(r)}function Cte(e,t){if(!eu(e,t)||e.hidden.includes(t))return e;let n=Xl(e);return n.hidden.push(t),Zl(n)}function wte(e,t){let n=eu(e,t);if(!n)return e;let r=Xl(e);return r.hidden=r.hidden.filter(e=>e!==t),r.docks[n].activeViewId=t,r.docks[n].collapsed=!1,Zl(r)}function Tte(e,t){let n=Xl(e);return n.docks[t].collapsed=!n.docks[t].collapsed,Zl(n)}function Ete(e,t,n){let r=Yl(t,n);if(e.docks[t].size===r)return e;let i=Xl(e);return i.docks[t].size=r,i}function tu(e,t,n){let r=new Map(n.map(e=>[e.id,e]));return e.docks[t].views.filter(t=>!e.hidden.includes(t)).map(e=>r.get(e)).filter(e=>e!==void 0)}function nu(e,t){return e.docks[t].collapsed?!1:e.docks[t].views.some(t=>!e.hidden.includes(t))}var Dte=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ote(e,t){let n=U(t,Dte),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M3 15h18`}],[`path`,{d:`m15 8-3 3-3-3`}]];G(e,V({name:`panel-bottom-close`},()=>n,{get iconNode(){return r}}))}var kte=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ate(e,t){let n=U(t,kte),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}],[`path`,{d:`m16 15-3-3 3-3`}]];G(e,V({name:`panel-left-close`},()=>n,{get iconNode(){return r}}))}var jte=new Set([`$$slots`,`$$events`,`$$legacy`]);function Mte(e,t){let n=U(t,jte),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M15 3v18`}],[`path`,{d:`m8 9 3 3-3 3`}]];G(e,V({name:`panel-right-close`},()=>n,{get iconNode(){return r}}))}var Nte=P(`<footer class="flex h-full min-w-0 items-center justify-between gap-3 border-t border-border bg-card px-1.5 text-xs text-muted-foreground select-none max-sm:pb-[env(safe-area-inset-bottom)]"><div class="flex min-w-0 flex-auto items-center gap-0.5 overflow-hidden"><!> <!></div> <div class="flex min-w-0 flex-none items-center gap-0.5"><!> <!></div></footer>`);function Pte(e,t){x(t,!0);let n=(e,t=N)=>{let n=l(()=>t().open?i[t().dock].open:i[t().dock].closed);{let r=l(()=>`Toggle ${t().label}`),i=l(()=>t().open?`Hide ${t().label}`:`Show ${t().label}`);W(e,{variant:`ghost`,size:`icon-sm`,class:`size-5.5 rounded-sm max-sm:size-9`,get ariaLabel(){return L(r)},get title(){return L(i)},get pressed(){return t().open},get onclick(){return t().onToggle},children:(e,t)=>{var r=_();d(F(r),()=>L(n),(e,t)=>{t(e,{size:13,strokeWidth:2.1,"aria-hidden":`true`})}),q(e,r)},$$slots:{default:!0}})}},r=K(t,`toggles`,19,()=>[]),i={left:{open:Ate,closed:qs},right:{open:Mte,closed:Ys},bottom:{open:Ote,closed:Gs}},a=l(()=>r().filter(e=>e.dock===`left`)),o=l(()=>r().filter(e=>e.dock!==`left`));var s=Nte(),c=B(s),u=B(c);O(u,17,()=>L(a),e=>e.dock,(e,t)=>{n(e,()=>L(t))});var f=Y(u,2),m=e=>{var n=_();h(F(n),()=>t.left),q(e,n)};p(f,e=>{t.left&&e(m)}),y(c);var g=Y(c,2),v=B(g),b=e=>{var n=_();h(F(n),()=>t.right),q(e,n)};p(v,e=>{t.right&&e(b)}),O(Y(v,2),17,()=>L(o),e=>e.dock,(e,t)=>{n(e,()=>L(t))}),y(g),y(s),q(e,s),H()}var Fte=P(`<header><div class="flex min-w-0 flex-1 items-center gap-2.5 overflow-hidden"><!> <!></div> <!></header>`);function Ite(e,t){let n=K(t,`desktop`,3,!1);var r=Fte(),i=B(r),a=B(i),o=e=>{var n=_();h(F(n),()=>t.leadingControls),q(e,n)};p(a,e=>{t.leadingControls&&e(o)}),h(Y(a,2),()=>t.left),y(i);var s=Y(i,2),c=e=>{var n=_();h(F(n),()=>t.actions),q(e,n)};p(s,e=>{t.actions&&e(c)}),y(r),J(()=>w(r,1,`flex h-full min-w-0 items-center justify-between gap-4 border-b border-border bg-card px-3 pt-[env(safe-area-inset-top)] select-none ${n()?`[-webkit-app-region:drag]`:``}`)),q(e,r)}var Lte=P(`<main class="app-frame svelte-qbdwib"><!> <!> <!></main>`);function Rte(e,t){var n=Lte(),r=B(n);h(r,()=>t.titlebar);var i=Y(r,2);h(i,()=>t.workspace),h(Y(i,2),()=>t.footer),y(n),q(e,n)}function zte(e){return typeof e==`function`}function ru(e){return typeof e==`object`&&!!e}var Bte=[`string`,`number`,`bigint`,`boolean`];function iu(e){return e==null||Bte.includes(typeof e)?!0:Array.isArray(e)?e.every(e=>iu(e)):typeof e==`object`?Object.getPrototypeOf(e)===Object.prototype:!1}var au=Symbol(`box`),ou=Symbol(`is-writable`);function Vte(e){return ru(e)&&au in e}function Hte(e){return su.isBox(e)&&ou in e}function su(e){let t=X(Ie(e));return{[au]:!0,[ou]:!0,get current(){return L(t)},set current(e){R(t,e,!0)}}}function Ute(e,t){let n=l(e);return t?{[au]:!0,[ou]:!0,get current(){return L(n)},set current(e){t(e)}}:{[au]:!0,get current(){return e()}}}function Wte(e){return su.isBox(e)?e:zte(e)?su.with(e):su(e)}function Gte(e){return Object.entries(e).reduce((e,[t,n])=>su.isBox(n)?(su.isWritableBox(n)?Object.defineProperty(e,t,{get(){return n.current},set(e){n.current=e}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function Kte(e){return su.isWritableBox(e)?{[au]:!0,get current(){return e.current}}:e}su.from=Wte,su.with=Ute,su.flatten=Gte,su.readonly=Kte,su.isBox=Vte,su.isWritableBox=Hte;function qte(...e){return function(t){for(let n of e)if(n){if(t.defaultPrevented)return;typeof n==`function`?n.call(this,t):n.current?.call(this,t)}}}var Jte=/\d/,Yte=[`-`,`_`,`/`,`.`];function Xte(e=``){if(!Jte.test(e))return e!==e.toLowerCase()}function Zte(e){let t=[],n=``,r,i;for(let a of e){let e=Yte.includes(a);if(e===!0){t.push(n),n=``,r=void 0;continue}let o=Xte(a);if(i===!1){if(r===!1&&o===!0){t.push(n),n=a,r=o;continue}if(r===!0&&o===!1&&n.length>1){let e=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=e+a,r=o;continue}}n+=a,r=o,i=e}return t.push(n),t}function cu(e){return e?Zte(e).map(e=>$te(e)).join(``):``}function Qte(e){return ene(cu(e||``))}function $te(e){return e?e[0].toUpperCase()+e.slice(1):``}function ene(e){return e?e[0].toLowerCase()+e.slice(1):``}function lu(e){if(!e)return{};let t={};function n(e,n){if(e.startsWith(`-moz-`)||e.startsWith(`-webkit-`)||e.startsWith(`-ms-`)||e.startsWith(`-o-`)){t[cu(e)]=n;return}if(e.startsWith(`--`)){t[e]=n;return}t[Qte(e)]=n}return jt(e,n),t}function uu(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function tne(e,t,n,r){let i=Array.isArray(t)?t:[t];return i.forEach(t=>e.addEventListener(t,n,r)),()=>{i.forEach(t=>e.removeEventListener(t,n,r))}}function nne(e,t){let n=RegExp(e,`g`);return e=>{if(typeof e!=`string`)throw TypeError(`expected an argument of type string, but got ${typeof e}`);return e.match(n)?e.replace(n,t):e}}var rne=nne(/[A-Z]/,e=>`-${e.toLowerCase()}`);function ine(e){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${rne(t)}: ${e[t]};`).join(`
3
- `)}function du(e={}){return ine(e).replace(`
4
- `,` `)}du({position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,transform:`translateX(-100%)`});var ane=new Set(`onabort.onanimationcancel.onanimationend.onanimationiteration.onanimationstart.onauxclick.onbeforeinput.onbeforetoggle.onblur.oncancel.oncanplay.oncanplaythrough.onchange.onclick.onclose.oncompositionend.oncompositionstart.oncompositionupdate.oncontextlost.oncontextmenu.oncontextrestored.oncopy.oncuechange.oncut.ondblclick.ondrag.ondragend.ondragenter.ondragleave.ondragover.ondragstart.ondrop.ondurationchange.onemptied.onended.onerror.onfocus.onfocusin.onfocusout.onformdata.ongotpointercapture.oninput.oninvalid.onkeydown.onkeypress.onkeyup.onload.onloadeddata.onloadedmetadata.onloadstart.onlostpointercapture.onmousedown.onmouseenter.onmouseleave.onmousemove.onmouseout.onmouseover.onmouseup.onpaste.onpause.onplay.onplaying.onpointercancel.onpointerdown.onpointerenter.onpointerleave.onpointermove.onpointerout.onpointerover.onpointerup.onprogress.onratechange.onreset.onresize.onscroll.onscrollend.onsecuritypolicyviolation.onseeked.onseeking.onselect.onselectionchange.onselectstart.onslotchange.onstalled.onsubmit.onsuspend.ontimeupdate.ontoggle.ontouchcancel.ontouchend.ontouchmove.ontouchstart.ontransitioncancel.ontransitionend.ontransitionrun.ontransitionstart.onvolumechange.onwaiting.onwebkitanimationend.onwebkitanimationiteration.onwebkitanimationstart.onwebkittransitionend.onwheel`.split(`.`));function one(e){return ane.has(e)}function fu(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];if(r){for(let e of Object.keys(r)){let n=t[e],a=r[e],o=typeof n==`function`,s=typeof a==`function`;if(o&&typeof s&&one(e))t[e]=qte(n,a);else if(o&&s)t[e]=uu(n,a);else if(e===`class`){let r=iu(n),o=iu(a);r&&o?t[e]=i(n,a):r?t[e]=i(n):o&&(t[e]=i(a))}else if(e===`style`){let r=typeof n==`object`,i=typeof a==`object`,o=typeof n==`string`,s=typeof a==`string`;if(r&&i)t[e]={...n,...a};else if(r&&s){let r=lu(a);t[e]={...n,...r}}else if(o&&i)t[e]={...lu(n),...a};else if(o&&s){let r=lu(n),i=lu(a);t[e]={...r,...i}}else r?t[e]=n:i?t[e]=a:o?t[e]=n:s&&(t[e]=a)}else t[e]=a===void 0?n:a}for(let e of Object.getOwnPropertySymbols(r)){let n=t[e],i=r[e];t[e]=i===void 0?n:i}}}return typeof t.style==`object`&&(t.style=du(t.style).replaceAll(`
5
- `,` `)),t.hidden!==!0&&(t.hidden=void 0,delete t.hidden),t.disabled!==!0&&(t.disabled=void 0,delete t.disabled),t}var sne=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function cne(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}new class{#e;#t;constructor(e={}){let{window:t=sne,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Ne(e=>{let n=Se(t,`focusin`,e),r=Se(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?cne(this.#e):null}};function lne(e,t){switch(e){case`post`:z(t);break;case`pre`:de(t);break}}function pu(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;lne(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=Oe(()=>n(t,o));return o=t,r})}function mu(e,t,n){let r=be(()=>{let i=!1;pu(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});z(()=>r)}function hu(e,t,n){pu(e,`post`,t,n)}function une(e,t,n){pu(e,`pre`,t,n)}hu.pre=une;function dne(e,t){mu(e,`post`,t)}function fne(e,t){mu(e,`pre`,t)}dne.pre=fne;function pne(e,t){let n,r=null;return(...i)=>new Promise(a=>{r&&r(void 0),r=a,clearTimeout(n),n=setTimeout(async()=>{let t=await e(...i);r&&=(r(t),null)},t)})}function mne(e,t){let n=0,r=null;return(...i)=>{let a=Date.now();return n&&a-n<t?r??Promise.resolve(void 0):(n=a,r=e(...i),r)}}function gu(e,t,n={},r){let{lazy:i=!1,once:a=!1,initialValue:o,debounce:s,throttle:c}=n,l=X(Ie(o)),u=X(!1),d=X(void 0),f=X(Ie([])),p=()=>{L(f).forEach(e=>e()),R(f,[],!0)},m=e=>{R(f,[...L(f),e],!0)},h=async(e,n,r=!1)=>{try{R(u,!0),R(d,void 0),p();let i=new AbortController;m(()=>i.abort());let a=await t(e,n,{data:L(l),refetching:r,onCleanup:m,signal:i.signal});return R(l,a,!0),a}catch(e){e instanceof DOMException&&e.name===`AbortError`||R(d,e,!0);return}finally{R(u,!1)}},g=s?pne(h,s):c?mne(h,c):h,_=Array.isArray(e)?e:[e],v;return r((t,n)=>{a&&v||(v=t,g(Array.isArray(e)?t:t[0],Array.isArray(e)?n:n?.[0]))},{lazy:i}),{get current(){return L(l)},get loading(){return L(u)},get error(){return L(d)},mutate:e=>{R(l,e,!0)},refetch:t=>{let n=_.map(e=>e());return g(Array.isArray(e)?n:n[0],Array.isArray(e)?n:n[0],t??!0)}}}function hne(e,t,n){return gu(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];hu(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}function gne(e,t,n){return gu(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];hu.pre(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}hne.pre=gne;function _ne(e){Ce().then(e)}var vne=9;function yne(e){return ru(e)&&e.nodeType===vne}function bne(e){return ru(e)&&e.constructor?.name===`VisualViewport`}function xne(e){return yne(e)?e:bne(e)?e.document:e?.ownerDocument??document}function Sne(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var _u=class{element;#e=l(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return L(this.#e)}set root(e){R(this.#e,e)}constructor(e){typeof e==`function`?this.element=su.with(e):this.element=e}getDocument=()=>xne(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>Sne(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)};function vu(e,t){return{[he()]:n=>su.isBox(e)?(e.current=n,Oe(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),Oe(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e(null),t?.(null))})}}function Cne({layout:e,panesArray:t,pivotIndices:n}){let r=0,i=100,a=0,o=0,s=n[0];for(let e=0;e<t.length;e++){let{maxSize:n=100,minSize:c=0}=t[e].constraints;e===s?(r=c,i=n):(a+=c,o+=n)}return{valueMax:Math.min(i,100-a),valueMin:Math.max(r,100-o),valueNow:e[s]}}function yu(e,t=`Assertion failed!`){if(!e)throw console.error(t),Error(t)}function bu(e,t,n=10){return xu(e,t,n)===0}function xu(e,t,n=10){let r=Cu(e,n),i=Cu(t,n);return Math.sign(r-i)}function Su(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Cu(e,t){return Number.parseFloat(e.toFixed(t))}var wu=typeof document<`u`;function wne(e){return e instanceof HTMLElement}function Tu(e){return e.type===`keydown`}function Eu(e){return e.type.startsWith(`mouse`)}function Du(e){return e.type.startsWith(`touch`)}function Ou({paneConstraints:e,paneIndex:t,initialSize:n}){let r=e[t];yu(r!=null,`Pane constraints should not be null.`);let{collapsedSize:i=0,collapsible:a,maxSize:o=100,minSize:s=0}=r,c=n;return xu(c,s)<0&&(c=Tne(c,a,i,s)),c=Math.min(o,c),Number.parseFloat(c.toFixed(10))}function Tne(e,t,n,r){return t&&xu(e,(n+r)/2)<0?n:r}function ku(){}function Au({groupId:e,layout:t,panesArray:n,domContext:r}){let i=ju(e,r);for(let e=0;e<n.length-1;e++){let{valueMax:r,valueMin:a,valueNow:o}=Cne({layout:t,panesArray:n,pivotIndices:[e,e+1]}),s=i[e];if(wne(s)){let t=n[e];s.setAttribute(`aria-controls`,t.opts.id.current),s.setAttribute(`aria-valuemax`,`${Math.round(r)}`),s.setAttribute(`aria-valuemin`,`${Math.round(a)}`),s.setAttribute(`aria-valuenow`,o==null?``:`${Math.round(o)}`)}}return()=>{for(let e of i)e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-valuemax`),e.removeAttribute(`aria-valuemin`),e.removeAttribute(`aria-valuenow`)}}function ju(e,t){return wu?Array.from(t.querySelectorAll(`[data-pane-resizer-id][data-pane-group-id="${e}"]`)):[]}function Mu({groupId:e,id:t,domContext:n}){return wu?ju(e,n).findIndex(e=>e.getAttribute(`data-pane-resizer-id`)===t)??null:null}function Nu({groupId:e,dragHandleId:t,domContext:n}){let r=Mu({groupId:e,id:t,domContext:n});return r==null?[-1,-1]:[r,r+1]}function Pu(e,t,n){let r=e.map(e=>e.constraints),i=Fu(e,t),a=r[i],o=i===e.length-1?[i-1,i]:[i,i+1],s=n[i];return{...a,paneSize:s,pivotIndices:o}}function Fu(e,t){return e.findIndex(e=>e.opts.id.current===t.opts.id.current)}function Iu(e,t,n){for(let r=0;r<t.length;r++){let i=t[r],a=e[r];yu(a);let{collapsedSize:o=0,collapsible:s}=a.constraints,c=n[a.opts.id.current];if(!(c==null||i!==c))continue;n[a.opts.id.current]=i;let{onCollapse:l,onExpand:u,onResize:d}=a.callbacks;d?.(i,c),s&&(l||u)&&(u&&(c==null||c===o)&&i!==o&&u(),l&&(c==null||c!==o)&&i===o&&l())}}function Lu({panesArray:e}){let t=Array(e.length),n=e.map(e=>e.constraints),r=0,i=100;for(let a=0;a<e.length;a++){let e=n[a];yu(e);let{defaultSize:o}=e;o!=null&&(r++,t[a]=o,i-=o)}for(let a=0;a<e.length;a++){let o=n[a];yu(o);let{defaultSize:s}=o;if(s!=null)continue;let c=e.length-r,l=i/c;r++,t[a]=l,i-=l}return t}function Ru({layout:e,paneConstraints:t}){let n=[...e],r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} pane layout: ${n.map(e=>`${e}%`).join(`, `)}`);if(!bu(r,100))for(let e=0;e<t.length;e++){let t=n[e];yu(t!=null),n[e]=100/r*t}let i=0;for(let e=0;e<t.length;e++){let r=n[e];yu(r!=null);let a=Ou({paneConstraints:t,paneIndex:e,initialSize:r});r!==a&&(i+=r-a,n[e]=a)}if(!bu(i,0))for(let e=0;e<t.length;e++){let r=n[e];yu(r!=null);let a=r+i,o=Ou({paneConstraints:t,paneIndex:e,initialSize:a});if(r!==o&&(i-=o-r,n[e]=o,bu(i,0)))break}return n}function zu(e,t){return wu&&t.querySelector(`[data-pane-group][data-pane-group-id="${e}"]`)||null}function Bu(e,t){return wu&&t.querySelector(`[data-pane-resizer-id="${e}"]`)||null}function Vu({event:e,dragHandleId:t,dir:n,initialDragState:r,domContext:i}){let a=n===`horizontal`,o=Bu(t,i);yu(o);let s=o.getAttribute(`data-pane-group-id`);yu(s);let{initialCursorPosition:c}=r,l=Uu(n,e),u=zu(s,i);yu(u);let d=u.getBoundingClientRect(),f=a?d.width:d.height;return(l-c)/f*100}function Hu({event:e,dragHandleId:t,dir:n,initialDragState:r,keyboardResizeBy:i,domContext:a}){if(Tu(e)){let t=n===`horizontal`,r=0;r=e.shiftKey?100:i??10;let a=0;switch(e.key){case`ArrowDown`:a=t?0:r;break;case`ArrowLeft`:a=t?-r:0;break;case`ArrowRight`:a=t?r:0;break;case`ArrowUp`:a=t?0:-r;break;case`End`:a=100;break;case`Home`:a=-100;break}return a}else return r==null?0:Vu({event:e,dragHandleId:t,dir:n,initialDragState:r,domContext:a})}function Uu(e,t){let n=e===`horizontal`;if(Eu(t))return n?t.clientX:t.clientY;if(Du(t)){let e=t.touches[0];return yu(e),n?e.screenX:e.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function Wu({groupId:e,handleId:t,panesArray:n,domContext:r}){let i=Bu(t,r),a=ju(e,r),o=i?a.indexOf(i):-1;return[n[o]?.opts.id.current??null,n[o+1]?.opts.id.current??null]}function Gu({delta:e,layout:t,paneConstraints:n,pivotIndices:r,trigger:i}){if(bu(e,0))return t;let a=[...t],[o,s]=r,c=0;if(i===`keyboard`){{let r=e<0?s:o,i=n[r];if(yu(i),i.collapsible){let i=t[r];yu(i!=null);let a=n[r];yu(a);let{collapsedSize:o=0,minSize:s=0}=a;if(bu(i,o)){let t=s-i;xu(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let r=e<0?o:s,i=n[r];yu(i);let{collapsible:a}=i;if(a){let i=t[r];yu(i!=null);let a=n[r];yu(a);let{collapsedSize:o=0,minSize:s=0}=a;if(bu(i,s)){let t=i-o;xu(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let r=e<0?1:-1,i=e<0?s:o,a=0;for(;;){let e=t[i];yu(e!=null);let o=Ou({paneConstraints:n,paneIndex:i,initialSize:100})-e;if(a+=o,i+=r,i<0||i>=n.length)break}let c=Math.min(Math.abs(e),Math.abs(a));e=e<0?0-c:c}{let r=e<0?o:s;for(;r>=0&&r<n.length;){let i=Math.abs(e)-Math.abs(c),o=t[r];yu(o!=null);let s=o-i,l=Ou({paneConstraints:n,paneIndex:r,initialSize:s});if(!bu(o,l)&&(c+=o-l,a[r]=l,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?r--:r++}}if(bu(c,0))return t;{let r=e<0?s:o,i=t[r];yu(i!=null);let l=i+c,u=Ou({paneConstraints:n,paneIndex:r,initialSize:l});if(a[r]=u,!bu(u,l)){let t=l-u,r=e<0?s:o;for(;r>=0&&r<n.length;){let i=a[r];yu(i!=null);let o=i+t,s=Ou({paneConstraints:n,paneIndex:r,initialSize:o});if(bu(i,s)||(t-=s-i,a[r]=s),bu(t,0))break;e>0?r--:r++}}}return bu(a.reduce((e,t)=>t+e,0),100)?a:t}var Ku=null,qu=null;function Ju(e){switch(e){case`horizontal`:return`ew-resize`;case`horizontal-max`:return`w-resize`;case`horizontal-min`:return`e-resize`;case`vertical`:return`ns-resize`;case`vertical-max`:return`n-resize`;case`vertical-min`:return`s-resize`}}function Yu(){qu!==null&&(document.head.removeChild(qu),Ku=null,qu=null)}function Xu(e,t){if(Ku===e)return;Ku=e;let n=Ju(e);qu===null&&(qu=t.createElement(`style`),t.head.appendChild(qu)),qu.innerHTML=`*{cursor: ${n}!important;}`}function Zu({defaultSize:e,dragState:t,layout:n,panesArray:r,paneIndex:i,precision:a=3}){let o=n[i],s;return s=o==null?e??`1`:r.length===1?`1`:o.toPrecision(a),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:`hidden`,pointerEvents:t===null?void 0:`none`}}function Qu(e){try{if(typeof localStorage>`u`)throw TypeError(`localStorage is not supported in this environment`);e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>localStorage.setItem(e,t)}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function $u(e){return`paneforge:${e}`}function ed(e){return e.map(e=>e.opts.order.current?`${e.opts.order.current}:${JSON.stringify(e.constraints)}`:JSON.stringify(e.constraints)).sort().join(`,`)}function td(e,t){try{let n=$u(e),r=t.getItem(n),i=JSON.parse(r||``);if(typeof i==`object`&&i)return i}catch{}return null}function nd(e,t,n){return(td(e,n)||{})[ed(t)]||null}function rd(e,t,n,r,i){let a=$u(e),o=ed(t),s=td(e,i)||{};s[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(a,JSON.stringify(s))}catch(e){console.error(e)}}var id={};function ad(e,t=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function od({autoSaveId:e,layout:t,storage:n,panesArray:r,paneSizeBeforeCollapse:i}){if(t.length===0||t.length!==r.length)return;let a=id[e];a??(a=ad(rd,100),id[e]=a);let o=[...r],s=new Map(i);a(e,o,s,t,n)}var sd={getItem:e=>(Qu(sd),sd.getItem(e)),setItem:(e,t)=>{Qu(sd),sd.setItem(e,t)}},cd=new dn(`PaneGroup`),ld=class e{static create(t){return cd.set(new e(t))}opts;attachment;domContext;#e=X(null);get dragState(){return L(this.#e)}set dragState(e){R(this.#e,e)}#t=X([]);get layout(){return L(this.#t)}set layout(e){R(this.#t,e)}#n=X([]);get panesArray(){return L(this.#n)}set panesArray(e){R(this.#n,e)}#r=X(!1);get panesArrayChanged(){return L(this.#r)}set panesArrayChanged(e){R(this.#r,e,!0)}#i=X(Ie({}));get paneIdToLastNotifiedSizeMap(){return L(this.#i)}set paneIdToLastNotifiedSizeMap(e){R(this.#i,e,!0)}paneSizeBeforeCollapseMap=new Map;prevDelta=0;constructor(e){this.opts=e,this.attachment=vu(this.opts.ref),this.domContext=new _u(this.opts.ref),fn([()=>this.opts.id.current,()=>this.layout,()=>this.panesArray],()=>Au({groupId:this.opts.id.current,layout:this.layout,panesArray:this.panesArray,domContext:this.domContext})),z(()=>Oe(()=>this.#a())),fn([()=>this.opts.autoSaveId.current,()=>this.layout,()=>this.opts.storage.current],()=>{this.opts.autoSaveId.current&&od({autoSaveId:this.opts.autoSaveId.current,layout:this.layout,storage:this.opts.storage.current,panesArray:this.panesArray,paneSizeBeforeCollapse:this.paneSizeBeforeCollapseMap})}),fn(()=>this.panesArrayChanged,()=>{if(!this.panesArrayChanged)return;this.panesArrayChanged=!1;let e=this.layout,t=null;if(this.opts.autoSaveId.current){let e=nd(this.opts.autoSaveId.current,this.panesArray,this.opts.storage.current);e&&(this.paneSizeBeforeCollapseMap=new Map(Object.entries(e.expandToSizes)),t=e.layout)}t??=Lu({panesArray:this.panesArray});let n=Ru({layout:t,paneConstraints:this.panesArray.map(e=>e.constraints)});Su(e,n)||(this.layout=n,this.opts.onLayout.current?.(n),Iu(this.panesArray,n,this.paneIdToLastNotifiedSizeMap))})}setLayout=e=>{this.layout=e};registerResizeHandle=e=>t=>{t.preventDefault();let n=this.opts.direction.current,r=this.dragState,i=this.opts.id.current,a=this.opts.keyboardResizeBy.current,o=this.layout,s=this.panesArray,{initialLayout:c}=r??{},l=this.domContext.getDocument(),u=Nu({groupId:i,dragHandleId:e,domContext:this.domContext}),d=Hu({event:t,dragHandleId:e,dir:n,initialDragState:r,keyboardResizeBy:a,domContext:this.domContext});if(d===0)return;let f=n===`horizontal`;l.dir===`rtl`&&f&&(d=-d);let p=s.map(e=>e.constraints),m=Gu({delta:d,layout:c??o,paneConstraints:p,pivotIndices:u,trigger:Tu(t)?`keyboard`:`mouse-or-touch`}),h=!Su(o,m);(Eu(t)||Du(t))&&this.prevDelta!==d&&(this.prevDelta=d,Xu(h?f?`horizontal`:`vertical`:f?d<0?`horizontal-min`:`horizontal-max`:d<0?`vertical-min`:`vertical-max`,l)),h&&(this.setLayout(m),this.opts.onLayout.current?.(m),Iu(s,m,this.paneIdToLastNotifiedSizeMap))};resizePane=(e,t)=>{let n=this.layout,r=this.panesArray,i=r.map(e=>e.constraints),{paneSize:a,pivotIndices:o}=Pu(r,e,n);yu(a!=null);let s=Gu({delta:Fu(r,e)===r.length-1?a-t:t-a,layout:n,paneConstraints:i,pivotIndices:o,trigger:`imperative-api`});Su(n,s)||(this.setLayout(s),this.opts.onLayout.current?.(s),Iu(r,s,this.paneIdToLastNotifiedSizeMap))};startDragging=(e,t)=>{let n=this.opts.direction.current,r=this.layout,i=Bu(e,this.domContext);yu(i);let a=Uu(n,t);this.dragState={dragHandleId:e,dragHandleRect:i.getBoundingClientRect(),initialCursorPosition:a,initialLayout:r}};stopDragging=()=>{Yu(),this.dragState=null};isPaneCollapsed=e=>{let t=this.panesArray,n=this.layout,{collapsedSize:r=0,collapsible:i,paneSize:a}=Pu(t,e,n);return typeof a!=`number`||typeof r!=`number`?!1:i===!0&&bu(a,r)};expandPane=e=>{let t=this.layout,n=this.panesArray;if(!e.constraints.collapsible)return;let r=n.map(e=>e.constraints),{collapsedSize:i=0,paneSize:a,minSize:o=0,pivotIndices:s}=Pu(n,e,t);if(a!==i)return;let c=this.paneSizeBeforeCollapseMap.get(e.opts.id.current),l=c!=null&&c>=o?c:o,u=Gu({delta:Fu(n,e)===n.length-1?a-l:l-a,layout:t,paneConstraints:r,pivotIndices:s,trigger:`imperative-api`});Su(t,u)||(this.setLayout(u),this.opts.onLayout.current?.(u),Iu(n,u,this.paneIdToLastNotifiedSizeMap))};collapsePane=e=>{let t=this.layout,n=this.panesArray;if(!e.constraints.collapsible)return;let r=n.map(e=>e.constraints),{collapsedSize:i=0,paneSize:a,pivotIndices:o}=Pu(n,e,t);if(yu(a!=null),a===i)return;this.paneSizeBeforeCollapseMap.set(e.opts.id.current,a);let s=Gu({delta:Fu(n,e)===n.length-1?a-i:i-a,layout:t,paneConstraints:r,pivotIndices:o,trigger:`imperative-api`});Su(t,s)||(this.layout=s,this.opts.onLayout.current?.(s),Iu(n,s,this.paneIdToLastNotifiedSizeMap))};getPaneSize=e=>Pu(this.panesArray,e,this.layout).paneSize;getPaneStyle=(e,t)=>{let n=this.panesArray,r=this.layout,i=this.dragState;return Zu({defaultSize:t,dragState:i,layout:r,panesArray:n,paneIndex:Fu(n,e)})};isPaneExpanded=e=>{let{collapsedSize:t=0,collapsible:n,paneSize:r}=Pu(this.panesArray,e,this.layout);return!n||r>t};registerPane=e=>{let t=[...this.panesArray,e];return t.sort((e,t)=>{let n=e.opts.order.current,r=t.opts.order.current;return n==null&&r==null?0:n==null?-1:r==null?1:n-r}),this.panesArray=t,this.panesArrayChanged=!0,()=>{let t=[...this.panesArray],n=Fu(this.panesArray,e);n<0||(t.splice(n,1),this.panesArray=t,delete this.paneIdToLastNotifiedSizeMap[e.opts.id.current],this.panesArrayChanged=!0)}};#a=()=>{let e=this.opts.id.current,t=ju(e,this.domContext),n=this.panesArray,r=t.map(t=>{let r=t.getAttribute(`data-pane-resizer-id`);if(!r)return ku;let[i,a]=Wu({groupId:e,handleId:r,panesArray:n,domContext:this.domContext});if(i==null||a==null)return ku;let o=tne(t,`keydown`,t=>{if(t.defaultPrevented||t.key!==`Enter`)return;t.preventDefault();let n=this.panesArray,a=n.findIndex(e=>e.opts.id.current===i);if(a<0)return;let o=n[a];yu(o);let s=this.layout,c=s[a],{collapsedSize:l=0,collapsible:u,minSize:d=0}=o.constraints;if(!(c!=null&&u))return;let f=Gu({delta:bu(c,l)?d-c:l-c,layout:s,paneConstraints:n.map(e=>e.constraints),pivotIndices:Nu({groupId:e,dragHandleId:r,domContext:this.domContext}),trigger:`keyboard`});s!==f&&(this.layout=f)});return()=>{o()}});return()=>{for(let e of r)e()}};#o=l(()=>({id:this.opts.id.current,"data-pane-group":``,"data-direction":this.opts.direction.current,"data-pane-group-id":this.opts.id.current,style:{display:`flex`,flexDirection:this.opts.direction.current===`horizontal`?`row`:`column`,height:`100%`,overflow:`hidden`,width:`100%`},...this.attachment}));get props(){return L(this.#o)}set props(e){R(this.#o,e)}},ud=[`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`],dd=class e{static create(t){return new e(t,cd.get())}opts;#e;attachment;domContext;#t=l(()=>this.#e.dragState?.dragHandleId===this.opts.id.current);#n=X(!1);resizeHandler=null;constructor(e,t){this.opts=e,this.#e=t,this.attachment=vu(this.opts.ref),this.domContext=new _u(this.opts.ref),z(()=>{this.opts.disabled.current?this.resizeHandler=null:this.resizeHandler=this.#e.registerResizeHandle(this.opts.id.current)}),z(()=>{let e=this.opts.ref.current;if(!e)return;let t=this.opts.disabled.current,n=this.resizeHandler,r=L(this.#t);if(t||n===null||!r)return;let i=e=>{n(e)},a=e=>{n(e)},o=()=>{e.blur(),this.#e.stopDragging(),this.opts.onDraggingChange.current(!1)},s=this.domContext.getDocument().body,c=this.domContext.getWindow();return uu(Se(s,`contextmenu`,o),Se(s,`mousemove`,i),Se(s,`touchmove`,i,{passive:!1}),Se(s,`mouseleave`,a),Se(c,`mouseup`,o),Se(c,`touchend`,o))})}#r=e=>{e.preventDefault(),!this.opts.disabled.current&&(this.#e.startDragging(this.opts.id.current,e),this.opts.onDraggingChange.current(!0))};#i=()=>{let e=this.opts.ref.current;e&&(e.blur(),this.#e.stopDragging(),this.opts.onDraggingChange.current(!1))};#a=e=>{if(this.opts.disabled.current||!this.resizeHandler||e.defaultPrevented)return;if(ud.includes(e.key)){e.preventDefault(),this.resizeHandler(e);return}if(e.key!==`F6`)return;e.preventDefault();let t=ju(this.#e.opts.id.current,this.domContext),n=Mu({groupId:this.#e.opts.id.current,id:this.opts.id.current,domContext:this.domContext});if(n===null)return;let r=0;r=e.shiftKey?n>0?n-1:t.length-1:n+1<t.length?n+1:0,t[r].focus()};#o=()=>{R(this.#n,!1)};#s=()=>{R(this.#n,!0)};#c=e=>{this.#r(e)};#l=()=>{this.#i()};#u=()=>{this.#i()};#d=()=>{this.#i()};#f=e=>{this.#r(e)};#p=l(()=>({id:this.opts.id.current,role:`separator`,"data-direction":this.#e.opts.direction.current,"data-pane-group-id":this.#e.opts.id.current,"data-active":L(this.#t)?`pointer`:L(this.#n)?`keyboard`:void 0,"data-enabled":!this.opts.disabled.current,"data-pane-resizer-id":this.opts.id.current,"data-pane-resizer":``,tabIndex:this.opts.tabIndex.current,style:{cursor:Ju(this.#e.opts.direction.current),touchAction:`none`,userSelect:`none`,"-webkit-user-select":`none`,"-webkit-touch-callout":`none`},onkeydown:this.#a,onblur:this.#o,onfocus:this.#s,onmousedown:this.#c,onmouseup:this.#l,ontouchcancel:this.#u,ontouchend:this.#d,ontouchstart:this.#f,...this.attachment}));get props(){return L(this.#p)}set props(e){R(this.#p,e)}},fd=class e{static create(t){return new e(t,cd.get())}opts;group;attachment;domContext;#e=X(``);#t=l(()=>({onCollapse:this.opts.onCollapse.current,onExpand:this.opts.onExpand.current,onResize:this.opts.onResize.current}));get callbacks(){return L(this.#t)}set callbacks(e){R(this.#t,e)}#n=l(()=>({collapsedSize:this.opts.collapsedSize.current,collapsible:this.opts.collapsible.current,defaultSize:this.opts.defaultSize.current,maxSize:this.opts.maxSize.current,minSize:this.opts.minSize.current}));get constraints(){return L(this.#n)}set constraints(e){R(this.#n,e)}#r=e=>{R(this.#e,e,!0),_ne(()=>{if(this.opts.ref.current){let e=this.opts.ref.current;if(getComputedStyle(e).transitionDuration===`0s`){R(this.#e,``);return}let t=n=>{n.propertyName===`flex-grow`&&(R(this.#e,``),e.removeEventListener(`transitionend`,t))};e.addEventListener(`transitionend`,t)}else R(this.#e,``)})};pane={collapse:()=>{this.#r(`collapsing`),this.group.collapsePane(this)},expand:()=>{this.#r(`expanding`),this.group.expandPane(this)},getSize:()=>this.group.getPaneSize(this),isCollapsed:()=>this.group.isPaneCollapsed(this),isExpanded:()=>this.group.isPaneExpanded(this),resize:e=>this.group.resizePane(this,e),getId:()=>this.opts.id.current};constructor(e,t){this.opts=e,this.group=t,this.attachment=vu(this.opts.ref),this.domContext=new _u(this.opts.ref),ue(()=>this.group.registerPane(this)),fn(()=>E(this.constraints),()=>{this.group.panesArrayChanged=!0})}#i=l(()=>this.group.isPaneCollapsed(this));#a=l(()=>L(this.#e)===``?L(this.#i)?`collapsed`:`expanded`:L(this.#e));#o=l(()=>({id:this.opts.id.current,style:this.group.getPaneStyle(this,this.opts.defaultSize.current),"data-pane":``,"data-pane-id":this.opts.id.current,"data-pane-group-id":this.group.opts.id.current,"data-collapsed":L(this.#i)?``:void 0,"data-expanded":L(this.#i)?void 0:``,"data-pane-state":L(this.#a),...this.attachment}));get props(){return L(this.#o)}set props(e){R(this.#o,e)}},pd=new Set([`$$slots`,`$$events`,`$$legacy`,`autoSaveId`,`direction`,`id`,`keyboardResizeBy`,`onLayoutChange`,`storage`,`ref`,`child`,`children`]),md=P(`<div><!></div>`);function hd(e,t){let n=re();x(t,!0);let r=K(t,`autoSaveId`,3,null),i=K(t,`id`,3,n),a=K(t,`keyboardResizeBy`,3,null),o=K(t,`onLayoutChange`,3,ku),s=K(t,`storage`,3,sd),u=K(t,`ref`,15,null),d=U(t,pd),f=ld.create({id:su.with(()=>i()??n),ref:su.with(()=>u(),e=>u(e)),autoSaveId:su.with(()=>r()),direction:su.with(()=>t.direction),keyboardResizeBy:su.with(()=>a()),onLayout:su.with(()=>o()),storage:su.with(()=>s())}),m=()=>f.layout,g=f.setLayout,v=()=>f.opts.id.current,b=l(()=>fu(d,f.props));var S={getLayout:m,setLayout:g,getId:v},C=_(),w=F(C),T=e=>{var n=_();h(F(n),()=>t.child,()=>({props:L(b)})),q(e,n)},E=e=>{var n=md();c(n,()=>({...L(b)})),h(B(n),()=>t.children??N),y(n),q(e,n)};return p(w,e=>{t.child?e(T):e(E,-1)}),q(e,C),H(S)}var gd=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`collapsedSize`,`collapsible`,`defaultSize`,`maxSize`,`minSize`,`onCollapse`,`onExpand`,`onResize`,`order`,`child`,`children`]),_d=P(`<div><!></div>`);function vd(e,t){let n=re();x(t,!0);let r=K(t,`id`,3,n),i=K(t,`ref`,15,null),a=K(t,`onCollapse`,3,ku),o=K(t,`onExpand`,3,ku),s=K(t,`onResize`,3,ku),u=U(t,gd),d=fd.create({id:su.with(()=>r()),ref:su.with(()=>i(),e=>i(e)),collapsedSize:su.with(()=>t.collapsedSize),collapsible:su.with(()=>t.collapsible),defaultSize:su.with(()=>t.defaultSize),maxSize:su.with(()=>t.maxSize),minSize:su.with(()=>t.minSize),onCollapse:su.with(()=>a()),onExpand:su.with(()=>o()),onResize:su.with(()=>s()),order:su.with(()=>t.order)}),f=d.pane.collapse,m=d.pane.expand,g=d.pane.getSize,v=d.pane.isCollapsed,b=d.pane.isExpanded,S=d.pane.resize,C=d.pane.getId,w=l(()=>fu(u,d.props));var T={collapse:f,expand:m,getSize:g,isCollapsed:v,isExpanded:b,resize:S,getId:C},E=_(),D=F(E),O=e=>{var n=_();h(F(n),()=>t.child,()=>({props:L(w)})),q(e,n)},k=e=>{var n=_d();c(n,()=>({...L(w)})),h(B(n),()=>t.children??N),y(n),q(e,n)};return p(D,e=>{t.child?e(O):e(k,-1)}),q(e,E),H(T)}var yd=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`disabled`,`onDraggingChange`,`tabindex`,`child`,`children`]),bd=P(`<div><!></div>`);function xd(e,t){let n=re();x(t,!0);let r=K(t,`id`,3,n),i=K(t,`ref`,15,null),a=K(t,`disabled`,3,!1),o=K(t,`onDraggingChange`,3,ku),s=K(t,`tabindex`,3,0),u=U(t,yd),d=dd.create({id:su.with(()=>r()),ref:su.with(()=>i(),e=>i(e)),disabled:su.with(()=>a()),onDraggingChange:su.with(()=>o()),tabIndex:su.with(()=>s())}),f=l(()=>fu(u,d.props));var m=_(),g=F(m),v=e=>{var n=_();h(F(n),()=>t.child,()=>({props:L(f)})),q(e,n)},b=e=>{var n=bd();c(n,()=>({...L(f)})),h(B(n),()=>t.children??N),y(n),q(e,n)};p(g,e=>{t.child?e(v):e(b,-1)}),q(e,m),H()}var Sd=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`withHandle`]),Cd=P(`<div class="bg-border h-6 w-1 rounded-lg z-10 flex shrink-0"></div>`);function wd(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=K(t,`withHandle`,3,!1),i=U(t,Sd);var a=_(),o=F(a);{let e=l(()=>I(`cn-resizable-handle bg-border focus-visible:ring-ring hover:bg-ring data-[active=keyboard]:bg-ring data-[active=pointer]:bg-ring relative z-10 flex w-px items-center justify-center transition-colors after:absolute after:inset-y-0 after:left-1/2 after:w-2 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-2 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:translate-x-0 data-[direction=vertical]:after:-translate-y-1/2 [&[data-direction=vertical]>div]:rotate-90`,t.class));d(o,()=>xd,(t,a)=>{a(t,V({"data-slot":`resizable-handle`,get class(){return L(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)},children:(e,t)=>{var n=_(),i=F(n),a=e=>{q(e,Cd())};p(i,e=>{r()&&e(a)}),q(e,n)},$$slots:{default:!0}}))})}q(e,a),H()}var Td=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`this`,`class`]);function Ed(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=K(t,`this`,15),i=U(t,Td);var a=_(),o=F(a);{let e=l(()=>I(`cn-resizable-panel-group flex h-full w-full data-[direction=vertical]:flex-col`,t.class));d(o,()=>hd,(t,a)=>{ie(a(t,V({"data-slot":`resizable-pane-group`,get class(){return L(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)}})),e=>r(e),()=>r())})}q(e,a),H()}var Dd=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function Od(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=U(t,Dd);var i=_();d(F(i),()=>yc,(e,t)=>{t(e,V(()=>r,{get open(){return n()},set open(e){n(e)}}))}),q(e,i),H()}var kd=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Ad(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=U(t,kd);var i=_(),a=F(i);{let e=l(()=>I(`dialog-overlay data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 duration-200`,t.class));d(a,()=>qt,(t,i)=>{i(t,V({"data-slot":`sheet-overlay`,get class(){return L(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}q(e,i),H()}var jd=new Set([`$$slots`,`$$events`,`$$legacy`]);function Md(e,t){let n=U(t,jd);var r=_();d(F(r),()=>Wt,(e,t)=>{t(e,V(()=>n))}),q(e,r)}function Nd(e){return e===`left`?-1:1}function Pd(e,t){return Number.isFinite(t)?Math.max(0,t*Nd(e)):0}function Fd(e,t){let n=Pd(e,t);return n===0?0:n*Nd(e)}function Id({distance:e,width:t,velocity:n}){return!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(n)||e<=0||t<=0?!1:e>=t*.3||n>=.5}var Ld=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`style`,`side`,`portalProps`,`swipeToDismiss`,`onSwipeDismiss`,`children`]),Rd=P(`<!> <!>`,1);function zd(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=K(t,`side`,3,`right`),i=K(t,`swipeToDismiss`,3,!1),a=U(t,Ld),o=l(()=>i()&&(r()===`left`||r()===`right`)),s=X(void 0),c=X(!1),u=X(!1),f,p=!1,m;function g(){f!==void 0&&(clearTimeout(f),f=void 0)}function v(){if(!L(u))return;let e=p;g(),p=!1,R(u,!1),R(c,!1),R(s,void 0),e&&t.onSwipeDismiss?.()}function y(){m=void 0,g(),p=!1,R(u,!1),R(c,!1),R(s,void 0)}z(()=>{let e=n();if(!e||!L(o))return;let t=e,i=r();function a(e){t.hasPointerCapture(e)&&t.releasePointerCapture(e)}function l(e){let n=m;if(m=void 0,n&&a(n.pointerId),R(c,!1),R(u,!0),p=e,R(s,e?(i===`left`?-1:1)*t.getBoundingClientRect().width:0,!0),window.matchMedia(`(prefers-reduced-motion: reduce)`).matches){v();return}g(),f=setTimeout(v,240)}function d(e){L(u)||m||!e.isPrimary||e.pointerType===`mouse`||(m={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,startTime:e.timeStamp,horizontal:!1})}function h(e){let n=m;if(!n||e.pointerId!==n.pointerId)return;let r=e.clientX-n.startX,a=e.clientY-n.startY;if(!n.horizontal){let i=Math.abs(r),o=Math.abs(a);if(i<8&&o<8)return;if(o>i){m=void 0;return}if(i<o*1.2)return;n.horizontal=!0,t.setPointerCapture(e.pointerId),R(c,!0)}e.preventDefault(),R(s,Fd(i,r),!0)}function _(e){let n=m;if(!n||e.pointerId!==n.pointerId)return;if(!n.horizontal){m=void 0;return}let r=Pd(i,e.clientX-n.startX),a=Math.max(1,e.timeStamp-n.startTime);l(Id({distance:r,width:t.getBoundingClientRect().width,velocity:r/a}))}function b(e){!m||e.pointerId!==m.pointerId||(m.horizontal?l(!1):m=void 0)}function x(e){e.target===t&&e.propertyName===`translate`&&v()}return t.addEventListener(`pointerdown`,d,!0),t.addEventListener(`pointermove`,h,!0),t.addEventListener(`pointerup`,_,!0),t.addEventListener(`pointercancel`,b,!0),t.addEventListener(`transitionend`,x),()=>{t.removeEventListener(`pointerdown`,d,!0),t.removeEventListener(`pointermove`,h,!0),t.removeEventListener(`pointerup`,_,!0),t.removeEventListener(`pointercancel`,b,!0),t.removeEventListener(`transitionend`,x),y()}}),Md(e,V(()=>t.portalProps,{children:(e,i)=>{var f=Rd(),p=F(f);Ad(p,{});var m=Y(p,2);{let e=l(()=>I(`bg-sidebar text-foreground data-open:animate-in data-closed:animate-out fixed z-50 flex flex-col overflow-hidden shadow-lg outline-none duration-200`,r()===`right`&&`data-open:slide-in-from-right data-closed:slide-out-to-right inset-y-0 right-0 h-full w-[min(90vw,24rem)] border-l`,r()===`left`&&`data-open:slide-in-from-left data-closed:slide-out-to-left inset-y-0 left-0 h-full w-[min(85vw,20rem)] border-r`,r()===`top`&&`data-open:slide-in-from-top data-closed:slide-out-to-top inset-x-0 top-0 h-auto max-h-[85vh] border-b`,r()===`bottom`&&`data-open:slide-in-from-bottom data-closed:slide-out-to-bottom inset-x-0 bottom-0 h-auto max-h-[85vh] border-t`,L(o)&&`touch-pan-y [&_*]:touch-pan-y`,L(c)&&`transition-none will-change-[translate]`,L(u)&&`transition-[translate] ease-out`,t.class)),i=l(()=>L(s)===void 0?t.style:`${t.style?`${t.style};`:``}translate:${L(s)}px 0`);d(m,()=>Ec,(o,s)=>{s(o,V({"data-slot":`sheet-content`,get"data-side"(){return r()},get class(){return L(e)},get style(){return L(i)}},()=>a,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=_();h(F(r),()=>t.children??N),q(e,r)},$$slots:{default:!0}}))})}q(e,f)},$$slots:{default:!0}})),H()}P(`<div><!></div>`);var Bd=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Vd(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=U(t,Bd);var i=_(),a=F(i);{let e=l(()=>I(`text-foreground font-medium`,t.class));d(a,()=>kt,(t,i)=>{i(t,V({"data-slot":`sheet-title`,get class(){return L(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}q(e,i),H()}var Hd=P(`<div role="presentation"><span class="dock-drop-label svelte-17tnf9a"> </span></div>`),Ud=P(`<!> <!>`,1),Wd=P(`<!> <section class="dock-panel" data-dock="right" aria-label="Panels"><!> <div class="dock-body"><!></div></section>`,1),Gd=P(`<div class="workspace-shell compact svelte-17tnf9a"><div class="workbench-editor-area svelte-17tnf9a"><!></div></div> <!> <!>`,1),Kd=P(`<div class="workbench-editor-area svelte-17tnf9a"><!></div>`),qd=P(`<!> <!> <!>`,1),Jd=P(`<div class="workspace-shell svelte-17tnf9a"><!> <!></div>`);function Yd(e,t){x(t,!0);let n=(e,t=N)=>{var n=Hd();let r;var i=B(n),a=B(i,!0);y(i),y(n),J(()=>{r=w(n,1,`dock-drop-strip svelte-17tnf9a`,null,r,{hovered:Il.hoverDock===t()}),A(n,`data-dock`,t()),f(a,Fs[t()])}),Ae(`dragover`,n,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),Ll(t(),2**53-1)}),Ae(`dragleave`,n,()=>Rl(t())),Ae(`drop`,n,e=>ee(e,t())),q(e,n)},r=K(t,`compact`,3,!1),i=K(t,`primarySheetOpen`,3,!1),a=K(t,`secondarySheetOpen`,3,!1),o=K(t,`keyboardResizeBy`,3,8),s=K(t,`actions`,19,()=>({})),c=l(()=>tu(t.layout,`left`,t.descriptors)),u=l(()=>tu(t.layout,`right`,t.descriptors)),m=l(()=>tu(t.layout,`bottom`,t.descriptors)),v=l(()=>!r()&&nu(t.layout,`left`)),b=l(()=>!r()&&nu(t.layout,`right`)),S=l(()=>!r()&&nu(t.layout,`bottom`)),C=l(()=>[...L(u),...L(m)]),T=X(void 0),E=l(()=>L(T)&&L(C).some(e=>e.id===L(T))?L(T):L(C)[0]?.id);function O(e){R(T,e,!0),s().onActivateView?.(e)}let k=l(()=>!r()&&!!Il.viewId);function ee(e,t){e.preventDefault();let n=Il.viewId??e.dataTransfer?.getData(`application/x-nerve-panel-view`);zl(),n&&s().onMoveView?.(n,{dock:t,index:2**53-1})}Rte(e,{titlebar:e=>{var n=_();h(F(n),()=>t.titlebar),q(e,n)},workspace:e=>{var x=Ud(),w=F(x),T=e=>{var n=Gd(),r=F(n),o=B(r);h(B(o),()=>t.editor),y(o),y(r);var l=Y(r,2);d(l,()=>Od,(e,n)=>{n(e,{get open(){return i()},onOpenChange:e=>s().onSheetOpenChange?.(`primary`,e),children:(e,n)=>{var r=_();d(F(r),()=>zd,(e,n)=>{n(e,{side:`left`,class:`sheet-pane`,swipeToDismiss:!0,onSwipeDismiss:()=>s().onSheetOpenChange?.(`primary`,!1),children:(e,n)=>{var r=Ud(),i=F(r);d(i,()=>Vd,(e,t)=>{t(e,{class:`sr-only`,children:(e,t)=>{g();var n=D();J(()=>f(n,Fs.left)),q(e,n)},$$slots:{default:!0}})}),Vl(Y(i,2),{dock:`left`,get views(){return L(c)},get registry(){return t.descriptors},get activeViewId(){return t.layout.docks.left.activeViewId},draggable:!1,get onSelect(){return s().onActivateView},get onMove(){return s().onMoveView},get onHide(){return s().onHideView},get panelView(){return t.panelView}}),q(e,r)},$$slots:{default:!0}})}),q(e,r)},$$slots:{default:!0}})}),d(Y(l,2),()=>Od,(e,n)=>{n(e,{get open(){return a()},onOpenChange:e=>s().onSheetOpenChange?.(`secondary`,e),children:(e,n)=>{var r=_();d(F(r),()=>zd,(e,n)=>{n(e,{side:`right`,class:`sheet-pane`,swipeToDismiss:!0,onSwipeDismiss:()=>s().onSheetOpenChange?.(`secondary`,!1),children:(e,n)=>{var r=Wd(),i=F(r);d(i,()=>Vd,(e,t)=>{t(e,{class:`sr-only`,children:(e,t)=>{g(),q(e,D(`Panels`))},$$slots:{default:!0}})});var a=Y(i,2),o=B(a);Bl(o,{dock:`right`,get views(){return L(C)},get registry(){return t.descriptors},get activeViewId(){return L(E)},draggable:!1,onSelect:O,get onMove(){return s().onMoveView},get onHide(){return s().onHideView}});var c=Y(o,2),l=B(c),u=e=>{var n=_();h(F(n),()=>t.panelView,()=>L(E)),q(e,n)};p(l,e=>{L(E)&&e(u)}),y(c),y(a),q(e,r)},$$slots:{default:!0}})}),q(e,r)},$$slots:{default:!0}})}),q(e,n)},ee=e=>{var r=Jd(),i=B(r);Ed(i,{direction:`horizontal`,get keyboardResizeBy(){return o()},children:(e,n)=>{var r=qd(),i=F(r),a=e=>{var n=Ud(),r=F(n);vd(r,{get defaultSize(){return t.layout.docks.left.size},get minSize(){return ql.left.min},get maxSize(){return ql.left.max},order:1,onResize:e=>s().onDockResize?.(`left`,e),children:(e,n)=>{Vl(e,{dock:`left`,get views(){return L(c)},get registry(){return t.descriptors},get activeViewId(){return t.layout.docks.left.activeViewId},get onSelect(){return s().onActivateView},get onMove(){return s().onMoveView},get onHide(){return s().onHideView},get panelView(){return t.panelView}})},$$slots:{default:!0}}),wd(Y(r,2),{"aria-label":`Resize left panel`}),q(e,n)};p(i,e=>{L(v)&&e(a)});var d=Y(i,2);vd(d,{minSize:25,order:2,children:(e,n)=>{var r=_();M(F(r),()=>L(S),e=>{Ed(e,{direction:`vertical`,get keyboardResizeBy(){return o()},children:(e,n)=>{var r=Ud(),i=F(r);{let e=l(()=>100-(L(S)?t.layout.docks.bottom.size:0));vd(i,{get defaultSize(){return L(e)},minSize:25,order:1,children:(e,n)=>{var r=Kd();h(B(r),()=>t.editor),y(r),q(e,r)},$$slots:{default:!0}})}var a=Y(i,2),o=e=>{var n=Ud(),r=F(n);wd(r,{"aria-label":`Resize bottom panel`}),vd(Y(r,2),{get defaultSize(){return t.layout.docks.bottom.size},get minSize(){return ql.bottom.min},get maxSize(){return ql.bottom.max},order:2,onResize:e=>s().onDockResize?.(`bottom`,e),children:(e,n)=>{Vl(e,{dock:`bottom`,get views(){return L(m)},get registry(){return t.descriptors},get activeViewId(){return t.layout.docks.bottom.activeViewId},get onSelect(){return s().onActivateView},get onMove(){return s().onMoveView},get onHide(){return s().onHideView},get panelView(){return t.panelView}})},$$slots:{default:!0}}),q(e,n)};p(a,e=>{L(S)&&e(o)}),q(e,r)},$$slots:{default:!0}})}),q(e,r)},$$slots:{default:!0}});var f=Y(d,2),g=e=>{var n=Ud(),r=F(n);wd(r,{"aria-label":`Resize right panel`}),vd(Y(r,2),{get defaultSize(){return t.layout.docks.right.size},get minSize(){return ql.right.min},get maxSize(){return ql.right.max},order:3,onResize:e=>s().onDockResize?.(`right`,e),children:(e,n)=>{Vl(e,{dock:`right`,get views(){return L(u)},get registry(){return t.descriptors},get activeViewId(){return t.layout.docks.right.activeViewId},get onSelect(){return s().onActivateView},get onMove(){return s().onMoveView},get onHide(){return s().onHideView},get panelView(){return t.panelView}})},$$slots:{default:!0}}),q(e,n)};p(f,e=>{L(b)&&e(g)}),q(e,r)},$$slots:{default:!0}});var a=Y(i,2),d=e=>{var t=qd(),r=F(t),i=e=>{n(e,()=>`left`)};p(r,e=>{L(v)||e(i)});var a=Y(r,2),o=e=>{n(e,()=>`right`)};p(a,e=>{L(b)||e(o)});var s=Y(a,2),c=e=>{n(e,()=>`bottom`)};p(s,e=>{L(S)||e(c)}),q(e,t)};p(a,e=>{L(k)&&e(d)}),y(r),q(e,r)};p(w,e=>{r()?e(T):e(ee,-1)});var A=Y(w,2),j=e=>{var n=_();h(F(n),()=>t.overlays),q(e,n)};p(A,e=>{t.overlays&&e(j)}),q(e,x)},footer:e=>{var n=_();h(F(n),()=>t.statusBar),q(e,n)},$$slots:{titlebar:!0,workspace:!0,footer:!0}}),H()}var Xd=Ie({quitRequested:!1}),Zd=P(`<div class="shutdown-overlay svelte-xmbw1i" role="status" aria-live="polite"><div class="shutdown-card svelte-xmbw1i"><div class="shutdown-spinner svelte-xmbw1i" aria-hidden="true"></div> <strong>Closing Nerve…</strong> <span class="svelte-xmbw1i">Stopping the local daemon safely.</span></div></div>`);function Qd(e,t){x(t,!0);let n=l(()=>Dr.quitting||Xd.quitRequested);var r=_(),i=F(r),a=e=>{q(e,Zd())};p(i,e=>{Dr.isDesktop&&L(n)&&e(a)}),q(e,r),H()}var $d=new Set([`$$slots`,`$$events`,`$$legacy`]);function ef(e,t){let n=U(t,$d),r=[[`path`,{d:`M12 7v14`}],[`path`,{d:`M16 12h2`}],[`path`,{d:`M16 8h2`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`}],[`path`,{d:`M6 12h2`}],[`path`,{d:`M6 8h2`}]];G(e,V({name:`book-open-text`},()=>n,{get iconNode(){return r}}))}var tf=new Set([`$$slots`,`$$events`,`$$legacy`]);function nf(e,t){let n=U(t,tf),r=[[`path`,{d:`m18 16 4-4-4-4`}],[`path`,{d:`m6 8-4 4 4 4`}],[`path`,{d:`m14.5 4-5 16`}]];G(e,V({name:`code-xml`},()=>n,{get iconNode(){return r}}))}var rf=new Set([`$$slots`,`$$events`,`$$legacy`]);function af(e,t){let n=U(t,rf),r=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]];G(e,V({name:`copy`},()=>n,{get iconNode(){return r}}))}var of=new Set([`$$slots`,`$$events`,`$$legacy`]);function sf(e,t){let n=U(t,of),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M9 10h6`}],[`path`,{d:`M12 13V7`}],[`path`,{d:`M9 17h6`}]];G(e,V({name:`file-diff`},()=>n,{get iconNode(){return r}}))}var cf=new Set([`$$slots`,`$$events`,`$$legacy`]);function lf(e,t){let n=U(t,cf),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M10 9H8`}],[`path`,{d:`M16 13H8`}],[`path`,{d:`M16 17H8`}]];G(e,V({name:`file-text`},()=>n,{get iconNode(){return r}}))}var uf=new Set([`$$slots`,`$$events`,`$$legacy`]);function df(e,t){let n=U(t,uf),r=[[`circle`,{cx:`18`,cy:`18`,r:`3`}],[`circle`,{cx:`6`,cy:`6`,r:`3`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`}]];G(e,V({name:`git-pull-request`},()=>n,{get iconNode(){return r}}))}var ff=new Set([`$$slots`,`$$events`,`$$legacy`]);function pf(e,t){let n=U(t,ff),r=[[`path`,{d:`m10.852 19.772-.383.924`}],[`path`,{d:`m13.148 14.228.383-.923`}],[`path`,{d:`M13.148 19.772a3 3 0 1 0-2.296-5.544l-.383-.923`}],[`path`,{d:`m13.53 20.696-.382-.924a3 3 0 1 1-2.296-5.544`}],[`path`,{d:`m14.772 15.852.923-.383`}],[`path`,{d:`m14.772 18.148.923.383`}],[`path`,{d:`M4.2 15.1a7 7 0 1 1 9.93-9.858A7 7 0 0 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2`}],[`path`,{d:`m9.228 15.852-.923-.383`}],[`path`,{d:`m9.228 18.148-.923.383`}]];G(e,V({name:`cloud-cog`},()=>n,{get iconNode(){return r}}))}var mf=new Set([`$$slots`,`$$events`,`$$legacy`]);function hf(e,t){let n=U(t,mf),r=[[`path`,{d:`M3 5h1`}],[`path`,{d:`M3 12h1`}],[`path`,{d:`M3 19h1`}],[`path`,{d:`M8 5h1`}],[`path`,{d:`M8 12h1`}],[`path`,{d:`M8 19h1`}],[`path`,{d:`M13 5h8`}],[`path`,{d:`M13 12h8`}],[`path`,{d:`M13 19h8`}]];G(e,V({name:`logs`},()=>n,{get iconNode(){return r}}))}var gf=new Set([`$$slots`,`$$events`,`$$legacy`]);function _f(e,t){let n=U(t,gf),r=[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]];G(e,V({name:`settings`},()=>n,{get iconNode(){return r}}))}async function vf(e){let t=kr();if(t){await t.clipboard.writeText(e);return}let n=globalThis.navigator?.clipboard;if(n?.writeText){await n.writeText(e);return}throw Error(`Clipboard API is not available.`)}var yf=Array(12).fill(0),bf=P(`<div class="sonner-loading-bar"></div>`),xf=P(`<div><div class="sonner-spinner"></div></div>`);function Sf(e,t){x(t,!0);var n=xf(),r=B(n);O(r,23,()=>yf,(e,t)=>`spinner-bar-${t}`,(e,t)=>{q(e,bf())}),y(r),y(n),J(e=>{w(n,1,e),A(n,`data-visible`,t.visible)},[()=>_e([`sonner-loading-wrapper`,t.class].filter(Boolean).join(` `))]),q(e,n),H()}function Cf(e){return e.label!==void 0}function wf(){let e=X(Ie(typeof document<`u`?document.hidden:!1));return z(()=>Se(document,`visibilitychange`,()=>{R(e,document.hidden,!0)})),{get current(){return L(e)}}}var Tf=4e3,Ef=14,Df=45,Of=200,kf=.05,Af={toast:``,title:``,description:``,loader:``,closeButton:``,cancelButton:``,actionButton:``,action:``,warning:``,error:``,success:``,default:``,info:``,loading:``};function jf(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}function Mf(e){return 1/(1.5+Math.abs(e)/20)}var Nf=new Set(`$$slots.$$events.$$legacy.toast.index.expanded.invert.position.visibleToasts.expandByDefault.closeButton.interacting.cancelButtonStyle.actionButtonStyle.duration.descriptionClass.classes.unstyled.loadingIcon.successIcon.errorIcon.warningIcon.closeIcon.infoIcon.defaultRichColors.swipeDirections.closeButtonAriaLabel.pauseWhenPageIsHidden`.split(`.`)),Pf=P(`<div><!></div>`),Ff=P(`<button data-close-button=""><!></button>`),If=P(`<div data-icon=""><!> <!></div>`),Lf=P(`<div data-description=""><!></div>`),Rf=P(`<button data-button="" data-cancel=""> </button>`),zf=P(`<button data-button=""> </button>`),Bf=P(`<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>`,1),Vf=P(`<li aria-atomic="true" data-sonner-toast=""><!> <!></li>`);function Hf(e,t){x(t,!0);let n=e=>{var n=_(),r=F(n),i=e=>{var n=Pf();h(B(n),()=>t.loadingIcon),y(n),J(e=>{w(n,1,e),A(n,`data-visible`,L(te)===`loading`)},[()=>_e(ui(L(he)?.loader,t.toast?.classes?.loader,`sonner-loader`))]),q(e,n)},a=e=>{{let n=l(()=>ui(L(he)?.loader,t.toast.classes?.loader)),r=l(()=>L(te)===`loading`);Sf(e,{get class(){return L(n)},get visible(){return L(r)}})}};p(r,e=>{t.loadingIcon?e(i):e(a,-1)}),q(e,n)},r=K(t,`cancelButtonStyle`,3,``),i=K(t,`actionButtonStyle`,3,``),a=K(t,`descriptionClass`,3,``),o=K(t,`unstyled`,3,!1),s=K(t,`defaultRichColors`,3,!1);U(t,Nf);let c={...Af},m=X(!1),g=X(!1),v=X(!1),b=X(!1),S=X(!1),C=X(0),T=X(0),E=t.toast.duration||t.duration||Tf,O=X(void 0),k=X(null),ee=X(null),j=l(()=>t.index===0),M=l(()=>t.index+1<=t.visibleToasts),te=l(()=>t.toast.type),ne=l(()=>t.toast.dismissible===void 0?t.toast.dismissable!==!1:t.toast.dismissible!==!1),P=l(()=>t.toast.class||``),re=l(()=>t.toast.descriptionClass||``),I=l(()=>pi.heights.findIndex(e=>e.toastId===t.toast.id)||0),ae=l(()=>t.toast.closeButton??t.closeButton),oe=l(()=>t.toast.duration??t.duration??Tf),se=null,ce=l(()=>t.position.split(`-`)),de=l(()=>pi.heights.reduce((e,t,n)=>n>=L(I)?e:e+t.height,0)),fe=wf(),pe=l(()=>t.toast.invert||t.invert),me=l(()=>L(te)===`loading`),he=l(()=>({...c,...t.classes})),ge=l(()=>t.toast.title),ve=l(()=>t.toast.description),ye=X(0),be=X(0),xe=l(()=>Math.round(L(I)*Ef+L(de)));z(()=>{L(ge),L(ve);let e;e=t.expanded||t.expandByDefault?1:1-t.index*kf;let n=Oe(()=>L(O));if(n===void 0)return;n.style.setProperty(`height`,`auto`);let r=n.offsetHeight,i=n.getBoundingClientRect().height,a=Math.round(i/e+2**-52&100)/100;n.style.removeProperty(`height`);let o;o=Math.abs(a-r)<1?a:r,R(T,o,!0),pi.setHeight({toastId:t.toast.id,height:o})});function W(){R(g,!0),R(C,L(xe),!0),pi.removeHeight(t.toast.id),setTimeout(()=>{pi.remove(t.toast.id)},Of)}let Se,G=l(()=>t.toast.promise&&L(te)===`loading`||t.toast.duration===1/0);function Ce(){R(ye,new Date().getTime(),!0),Se=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),W()},E)}function we(){if(L(be)<L(ye)){let e=new Date().getTime()-L(ye);E-=e}R(be,new Date().getTime(),!0)}z(()=>{t.toast.updated&&(clearTimeout(Se),E=L(oe),L(G)||Ce())}),z(()=>(L(G)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&fe.current?we():Ce()),()=>clearTimeout(Se))),ue(()=>{R(m,!0);let e=L(O)?.getBoundingClientRect().height;return R(T,e,!0),pi.setHeight({toastId:t.toast.id,height:e}),()=>{pi.removeHeight(t.toast.id)}}),z(()=>{t.toast.delete&&Oe(()=>{W(),t.toast.onDismiss?.(t.toast)})});let Te=e=>{if(L(me))return;R(C,L(xe),!0);let t=e.target;t.setPointerCapture(e.pointerId),t.tagName!==`BUTTON`&&(R(v,!0),se={x:e.clientX,y:e.clientY})},Ee=()=>{if(L(b)||!L(ne))return;se=null;let e=Number(L(O)?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),n=Number(L(O)?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-0,i=L(k)===`x`?e:n,a=Math.abs(i)/r;if(Math.abs(i)>=Df||a>.11){R(C,L(xe),!0),t.toast.onDismiss?.(t.toast),L(k)===`x`?R(ee,e>0?`right`:`left`,!0):R(ee,n>0?`down`:`up`,!0),W(),R(b,!0);return}else L(O)?.style.setProperty(`--swipe-amount-x`,`0px`),L(O)?.style.setProperty(`--swipe-amount-y`,`0px`);R(S,!1),R(v,!1),R(k,null)},De=e=>{if(!se||!L(ne)||(window.getSelection()?.toString().length??-1)>0)return;let n=e.clientY-se.y,r=e.clientX-se.x,i=t.swipeDirections??jf(t.position);!L(k)&&(Math.abs(r)>1||Math.abs(n)>1)&&R(k,Math.abs(r)>Math.abs(n)?`x`:`y`,!0);let a={x:0,y:0};if(L(k)===`y`){if(i.includes(`top`)||i.includes(`bottom`))if(i.includes(`top`)&&n<0||i.includes(`bottom`)&&n>0)a.y=n;else{let e=n*Mf(n);a.y=Math.abs(e)<Math.abs(n)?e:n}}else if(L(k)===`x`&&(i.includes(`left`)||i.includes(`right`)))if(i.includes(`left`)&&r<0||i.includes(`right`)&&r>0)a.x=r;else{let e=r*Mf(r);a.x=Math.abs(e)<Math.abs(r)?e:r}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&R(S,!0),L(O)?.style.setProperty(`--swipe-amount-x`,`${a.x}px`),L(O)?.style.setProperty(`--swipe-amount-y`,`${a.y}px`)},ke=()=>{R(v,!1),R(k,null),se=null},je=l(()=>t.toast.icon?t.toast.icon:L(te)===`success`?t.successIcon:L(te)===`error`?t.errorIcon:L(te)===`warning`?t.warningIcon:L(te)===`info`?t.infoIcon:L(te)===`loading`?t.loadingIcon:null);var Me=Vf();A(Me,`tabindex`,0);let Ne;var Pe=B(Me),Fe=e=>{var n=Ff();h(B(n),()=>t.closeIcon??N),y(n),J(e=>{A(n,`aria-label`,t.closeButtonAriaLabel),A(n,`data-disabled`,L(me)),w(n,1,e)},[()=>_e(ui(L(he)?.closeButton,t.toast?.classes?.closeButton))]),le(`click`,n,()=>{L(me)||!L(ne)||(W(),t.toast.onDismiss?.(t.toast))}),q(e,n)};p(Pe,e=>{L(ae)&&!t.toast.component&&L(te)!==`loading`&&t.closeIcon!==null&&e(Fe)});var Ie=Y(Pe,2),Le=e=>{let n=l(()=>t.toast.component);var r=_();d(F(r),()=>L(n),(e,n)=>{n(e,V(()=>t.toast.componentProps,{closeToast:W}))}),q(e,r)},Re=e=>{var o=Bf(),s=F(o),c=e=>{var r=If(),i=B(r),a=e=>{var r=_(),i=F(r),a=e=>{var n=_();d(F(n),()=>t.toast.icon,(e,t)=>{t(e,{})}),q(e,n)},o=e=>{n(e)};p(i,e=>{t.toast.icon?e(a):e(o,-1)}),q(e,r)};p(i,e=>{(t.toast.promise||L(te)===`loading`)&&e(a)});var o=Y(i,2),s=e=>{var n=_(),r=F(n),i=e=>{var n=_();d(F(n),()=>t.toast.icon,(e,t)=>{t(e,{})}),q(e,n)},a=e=>{var n=_();h(F(n),()=>t.successIcon??N),q(e,n)},o=e=>{var n=_();h(F(n),()=>t.errorIcon??N),q(e,n)},s=e=>{var n=_();h(F(n),()=>t.warningIcon??N),q(e,n)},c=e=>{var n=_();h(F(n),()=>t.infoIcon??N),q(e,n)};p(r,e=>{t.toast.icon?e(i):L(te)===`success`?e(a,1):L(te)===`error`?e(o,2):L(te)===`warning`?e(s,3):L(te)===`info`&&e(c,4)}),q(e,n)};p(o,e=>{t.toast.type!==`loading`&&e(s)}),y(r),J(e=>w(r,1,e),[()=>_e(ui(L(he)?.icon,t.toast?.classes?.icon))]),q(e,r)};p(s,e=>{(L(te)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(L(je)!==null||t.toast.icon)&&e(c)});var m=Y(s,2),g=B(m),v=B(g),b=e=>{var n=_(),r=F(n),i=e=>{let n=l(()=>t.toast.title);var r=_();d(F(r),()=>L(n),(e,n)=>{n(e,V(()=>t.toast.componentProps))}),q(e,r)},a=e=>{var n=D();J(()=>f(n,t.toast.title)),q(e,n)};p(r,e=>{typeof t.toast.title==`string`?e(a,-1):e(i)}),q(e,n)};p(v,e=>{t.toast.title&&e(b)}),y(g);var x=Y(g,2),S=e=>{var n=Lf(),r=B(n),i=e=>{let n=l(()=>t.toast.description);var r=_();d(F(r),()=>L(n),(e,n)=>{n(e,V(()=>t.toast.componentProps))}),q(e,r)},o=e=>{var n=D();J(()=>f(n,t.toast.description)),q(e,n)};p(r,e=>{typeof t.toast.description==`string`?e(o,-1):e(i)}),y(n),J(e=>w(n,1,e),[()=>_e(ui(a(),L(re),L(he)?.description,t.toast.classes?.description))]),q(e,n)};p(x,e=>{t.toast.description&&e(S)}),y(m);var C=Y(m,2),T=e=>{var n=_(),i=F(n),a=e=>{var n=_();d(F(n),()=>t.toast.cancel,(e,t)=>{t(e,{})}),q(e,n)},o=e=>{var n=Rf(),i=B(n,!0);y(n),J(e=>{u(n,t.toast.cancelButtonStyle??r()),w(n,1,e),f(i,t.toast.cancel.label)},[()=>_e(ui(L(he)?.cancelButton,t.toast?.classes?.cancelButton))]),le(`click`,n,e=>{Cf(t.toast.cancel)&&L(ne)&&(t.toast.cancel?.onClick?.(e),W())}),q(e,n)},s=l(()=>Cf(t.toast.cancel));p(i,e=>{typeof t.toast.cancel==`function`?e(a):L(s)&&e(o,1)}),q(e,n)};p(C,e=>{t.toast.cancel&&e(T)});var E=Y(C,2),O=e=>{var n=_(),r=F(n),a=e=>{var n=_();d(F(n),()=>t.toast.action,(e,t)=>{t(e,{})}),q(e,n)},o=e=>{var n=zf(),r=B(n,!0);y(n),J(e=>{u(n,t.toast.actionButtonStyle??i()),w(n,1,e),f(r,t.toast.action.label)},[()=>_e(ui(L(he)?.actionButton,t.toast?.classes?.actionButton))]),le(`click`,n,e=>{Cf(t.toast.action)&&(t.toast.action?.onClick(e),!e.defaultPrevented&&W())}),q(e,n)},s=l(()=>Cf(t.toast.action));p(r,e=>{typeof t.toast.action==`function`?e(a):L(s)&&e(o,1)}),q(e,n)};p(E,e=>{t.toast.action&&e(O)}),J((e,t)=>{w(m,1,e),w(g,1,t)},[()=>_e(ui(L(he)?.content,t.toast?.classes?.content)),()=>_e(ui(L(he)?.title,t.toast?.classes?.title))]),q(e,o)};p(Ie,e=>{t.toast.component?e(Le):e(Re,-1)}),y(Me),ie(Me,e=>R(O,e),()=>L(O)),J((e,n,r)=>{w(Me,1,e),A(Me,`aria-live`,t.toast.important?`assertive`:`polite`),A(Me,`data-rich-colors`,t.toast.richColors??s()),A(Me,`data-styled`,!(t.toast.component||t.toast.unstyled||o())),A(Me,`data-mounted`,L(m)),A(Me,`data-promise`,n),A(Me,`data-swiped`,L(S)),A(Me,`data-removed`,L(g)),A(Me,`data-visible`,L(M)),A(Me,`data-y-position`,L(ce)[0]),A(Me,`data-x-position`,L(ce)[1]),A(Me,`data-index`,t.index),A(Me,`data-front`,L(j)),A(Me,`data-swiping`,L(v)),A(Me,`data-dismissible`,L(ne)),A(Me,`data-type`,L(te)),A(Me,`data-invert`,L(pe)),A(Me,`data-swipe-out`,L(b)),A(Me,`data-swipe-direction`,L(ee)),A(Me,`data-expanded`,r),Ne=u(Me,`${t.style} ${t.toast.style}`,Ne,{"--index":t.index,"--toasts-before":t.index,"--z-index":pi.toasts.length-t.index,"--offset":`${L(g)?L(C):L(xe)}px`,"--initial-height":t.expandByDefault?`auto`:`${L(T)}px`})},[()=>_e(ui(t.class,L(P),L(he)?.toast,t.toast?.classes?.toast,L(he)?.[L(te)],t.toast?.classes?.[L(te)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&L(m))]),le(`pointermove`,Me,De),le(`pointerup`,Me,Ee),le(`pointerdown`,Me,Te),Ae(`dragend`,Me,ke),q(e,Me),H()}r([`pointermove`,`pointerup`,`pointerdown`,`click`]);var Uf=ne(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>`);function Wf(e){q(e,Uf())}var Gf=ne(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`);function Kf(e){q(e,Gf())}var qf=ne(`<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>`);function Jf(e){q(e,qf())}var Yf=ne(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>`);function Xf(e){q(e,Yf())}var Zf=ne(`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>`);function Qf(e){q(e,Zf())}var $f=3,ep=`24px`,tp=`16px`,np=4e3,rp=356,ip=14,ap=`dark`,op=`light`;function sp(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?tp:ep;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{let r=e[t];r===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof r==`number`?`${r}px`:r}):o(a)}),n}var cp=new Set(`$$slots.$$events.$$legacy.invert.position.hotkey.expand.closeButton.offset.mobileOffset.theme.richColors.duration.visibleToasts.toastOptions.dir.gap.pauseWhenPageIsHidden.loadingIcon.successIcon.errorIcon.warningIcon.closeIcon.infoIcon.containerAriaLabel.class.closeButtonAriaLabel.onblur.onfocus.onmouseenter.onmousemove.onmouseleave.ondragend.onpointerdown.onpointerup`.split(`.`)),lp=P(`<ol></ol>`),up=P(`<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-q7vsul"><!></section>`);function dp(e,t){x(t,!0);function n(e){return e===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?ap:op:e}let r=K(t,`invert`,3,!1),i=K(t,`position`,3,`bottom-right`),a=K(t,`hotkey`,19,()=>[`altKey`,`KeyT`]),o=K(t,`expand`,3,!1),s=K(t,`closeButton`,3,!1),u=K(t,`offset`,3,ep),d=K(t,`mobileOffset`,3,tp),f=K(t,`theme`,3,`light`),m=K(t,`richColors`,3,!1),g=K(t,`duration`,3,np),v=K(t,`visibleToasts`,3,$f),b=K(t,`toastOptions`,19,()=>({})),S=K(t,`dir`,7,`auto`),C=K(t,`gap`,3,ip),w=K(t,`pauseWhenPageIsHidden`,3,!1),T=K(t,`containerAriaLabel`,3,`Notifications`),E=K(t,`closeButtonAriaLabel`,3,`Close toast`),D=U(t,cp);function ee(){if(S()!==`auto`)return S();if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?(Oe(()=>S(window.getComputedStyle(document.documentElement).direction??`ltr`)),S()):(Oe(()=>S(e)),e)}let j=l(()=>Array.from(new Set([i(),...pi.toasts.filter(e=>e.position).map(e=>e.position)].filter(Boolean)))),M=X(!1),te=X(!1),ne=X(Ie(n(f()))),P=X(void 0),re=X(null),I=X(!1),ae=l(()=>a().join(`+`).replace(/Key/g,``).replace(/Digit/g,``));z(()=>{pi.toasts.length<=1&&R(M,!1)}),z(()=>{let e=pi.toasts.filter(e=>e.dismiss&&!e.delete);e.length>0&&(pi.toasts=pi.toasts.map(t=>e.find(e=>e.id===t.id)?{...t,delete:!0}:t))}),z(()=>()=>{L(P)&&L(re)&&(L(re).focus({preventScroll:!0}),R(re,null),R(I,!1))}),ue(()=>(pi.reset(),Se(document,`keydown`,e=>{a().every(t=>e[t]||e.code===t)&&(R(M,!0),L(P)?.focus()),e.code===`Escape`&&(document.activeElement===L(P)||L(P)?.contains(document.activeElement))&&R(M,!1)}))),z(()=>{if(f()!==`system`&&R(ne,f()),typeof window<`u`){f()===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?R(ne,ap):R(ne,op));let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=({matches:e})=>{f()===`system`&&R(ne,e?ap:op,!0)};`addEventListener`in e?e.addEventListener(`change`,t):e.addListener(t)}});let oe=e=>{t.onblur?.(e),L(I)&&!e.currentTarget.contains(e.relatedTarget)&&(R(I,!1),L(re)&&(L(re).focus({preventScroll:!0}),R(re,null)))},se=e=>{t.onfocus?.(e),!(e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`)&&(L(I)||(R(I,!0),R(re,e.relatedTarget,!0)))},ce=e=>{t.onpointerdown?.(e),!(e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`)&&R(te,!0)},le=e=>{t.onmouseenter?.(e),R(M,!0)},de=e=>{t.onmouseleave?.(e),L(te)||R(M,!1)},fe=e=>{t.onmousemove?.(e),R(M,!0)},V=e=>{t.ondragend?.(e),R(M,!1)},pe=e=>{t.onpointerup?.(e),R(te,!1)};di.set(new mi);var me=up();A(me,`tabindex`,-1);var he=B(me),ge=e=>{var n=_();O(F(n),18,()=>L(j),e=>e,(e,n,i,a)=>{let f=l(()=>{let[e,t]=n.split(`-`);return{y:e,x:t}}),x=l(()=>sp(u(),d()));var S=lp();c(S,e=>({tabindex:-1,dir:e,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":L(ne),"data-y-position":L(f).y,"data-x-position":L(f).x,style:t.style,onblur:oe,onfocus:se,onmouseenter:le,onmousemove:fe,onmouseleave:de,ondragend:V,onpointerdown:ce,onpointerup:pe,...D,[k]:{"--front-toast-height":`${pi.heights[0]?.height}px`,"--width":`${rp}px`,"--gap":`${C()}px`,"--offset-top":L(x)[`--offset-top`],"--offset-right":L(x)[`--offset-right`],"--offset-bottom":L(x)[`--offset-bottom`],"--offset-left":L(x)[`--offset-left`],"--mobile-offset-top":L(x)[`--mobile-offset-top`],"--mobile-offset-right":L(x)[`--mobile-offset-right`],"--mobile-offset-bottom":L(x)[`--mobile-offset-bottom`],"--mobile-offset-left":L(x)[`--mobile-offset-left`]}}),[()=>ee()],void 0,void 0,`svelte-q7vsul`),O(S,23,()=>pi.toasts.filter(e=>!e.position&&L(i)===0||e.position===n),e=>e.id,(e,i,a,c)=>{{let c=e=>{var n=_(),r=F(n),i=e=>{var n=_();h(F(n),()=>t.successIcon??N),q(e,n)},a=e=>{Wf(e,{})};p(r,e=>{t.successIcon?e(i):t.successIcon!==null&&e(a,1)}),q(e,n)},u=e=>{var n=_(),r=F(n),i=e=>{var n=_();h(F(n),()=>t.errorIcon??N),q(e,n)},a=e=>{Kf(e,{})};p(r,e=>{t.errorIcon?e(i):t.errorIcon!==null&&e(a,1)}),q(e,n)},d=e=>{var n=_(),r=F(n),i=e=>{var n=_();h(F(n),()=>t.warningIcon??N),q(e,n)},a=e=>{Jf(e,{})};p(r,e=>{t.warningIcon?e(i):t.warningIcon!==null&&e(a,1)}),q(e,n)},f=e=>{var n=_(),r=F(n),i=e=>{var n=_();h(F(n),()=>t.infoIcon??N),q(e,n)},a=e=>{Xf(e,{})};p(r,e=>{t.infoIcon?e(i):t.infoIcon!==null&&e(a,1)}),q(e,n)},y=e=>{var n=_(),r=F(n),i=e=>{var n=_();h(F(n),()=>t.closeIcon??N),q(e,n)},a=e=>{Qf(e,{})};p(r,e=>{t.closeIcon?e(i):t.closeIcon!==null&&e(a,1)}),q(e,n)},x=l(()=>b()?.duration??g()),S=l(()=>b()?.class??``),C=l(()=>b()?.descriptionClass||``),T=l(()=>b()?.style??``),D=l(()=>b().classes||{}),O=l(()=>b().unstyled??!1),k=l(()=>b()?.cancelButtonStyle??``),ee=l(()=>b()?.actionButtonStyle??``),A=l(()=>b()?.closeButtonAriaLabel??E());Hf(e,{get index(){return L(a)},get toast(){return L(i)},get defaultRichColors(){return m()},get duration(){return L(x)},get class(){return L(S)},get descriptionClass(){return L(C)},get invert(){return r()},get visibleToasts(){return v()},get closeButton(){return s()},get interacting(){return L(te)},get position(){return n},get style(){return L(T)},get classes(){return L(D)},get unstyled(){return L(O)},get cancelButtonStyle(){return L(k)},get actionButtonStyle(){return L(ee)},get closeButtonAriaLabel(){return L(A)},get expandByDefault(){return o()},get expanded(){return L(M)},get pauseWhenPageIsHidden(){return w()},get loadingIcon(){return t.loadingIcon},successIcon:c,errorIcon:u,warningIcon:d,infoIcon:f,closeIcon:y,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),y(S),ie(S,e=>R(P,e),()=>L(P)),J(()=>S.dir=S.dir),q(e,S)}),q(e,n)};p(he,e=>{pi.toasts.length>0&&e(ge)}),y(me),J(()=>A(me,`aria-label`,`${T()??``} ${L(ae)??``}`)),q(e,me),H()}function fp(){return typeof navigator>`u`?!1:navigator.platform.toLowerCase().includes(`mac`)||navigator.userAgent.includes(`Mac OS X`)}function pp(e){return e===` `?`space`:e===`Esc`?`escape`:e.toLowerCase()}function mp(e){if(/^Key[A-Z]$/.test(e))return e.slice(3).toLowerCase();if(/^Digit[0-9]$/.test(e))return e.slice(5);switch(e){case`BracketLeft`:return`[`;case`BracketRight`:return`]`;case`Minus`:return`-`;case`Equal`:return`=`;case`Period`:return`.`;case`Enter`:case`NumpadEnter`:return`enter`;case`Escape`:return`escape`;default:return}}function hp(e){return e instanceof Element?!!e.closest(`input, textarea, select, [contenteditable="true"], .cm-editor`):!1}function gp(e,t){let n=fp(),r=!!(t.ctrl||t.mod&&!n),i=!!(t.meta||t.mod&&n),a=!!t.alt,o=!!t.shift;if(e.ctrlKey!==r||e.metaKey!==i||e.altKey!==a||e.shiftKey!==o)return!1;let s=pp(t.key);return pp(e.key)===s||pp(mp(e.code)??``)===s}function _p(e){let t=pp(e);return t===`escape`?`Esc`:t===`enter`?`Enter`:t===`space`?`Space`:t.length===1?t.toUpperCase():e}function vp(e){let t=fp(),n=[];return e.mod&&n.push(t?`⌘`:`Ctrl`),e.ctrl&&n.push(t?`⌃`:`Ctrl`),e.alt&&n.push(t?`⌥`:`Alt`),e.shift&&n.push(t?`⇧`:`Shift`),n.push(_p(e.key)),t?n.join(``):n.join(`+`)}function yp(e){let t=fp(),n=[];return e.mod&&n.push(t?`Meta`:`Control`),e.ctrl&&n.push(`Control`),e.alt&&n.push(`Alt`),e.shift&&n.push(`Shift`),n.push(_p(e.key)),n.join(`+`)}var bp=[{id:`conversation.new`,label:`New chat`,category:`Conversation`,defaultBinding:{key:`n`,mod:!0}},{id:`conversation.newFromProject`,label:`New chat from project`,category:`Conversation`,defaultBinding:{key:`n`,mod:!0,shift:!0}},{id:`pane.close`,label:`Close pane`,category:`Panes`,defaultBinding:{key:`w`,mod:!0},allowInEditable:!0},{id:`pane.closeOthers`,label:`Close other panes`,category:`Panes`,defaultBinding:{key:`w`,mod:!0,shift:!0}},{id:`pane.refresh`,label:`Refresh pane`,category:`Panes`,defaultBinding:{key:`r`,mod:!0}},{id:`pane.previous`,label:`Previous pane`,category:`Panes`,defaultBinding:{key:`[`,mod:!0}},{id:`pane.next`,label:`Next pane`,category:`Panes`,defaultBinding:{key:`]`,mod:!0}},...Array.from({length:9},(e,t)=>{let n=t+1;return{id:`pane.focusByIndex.${n}`,label:`Focus pane ${n}`,category:`Panes`,defaultBinding:{key:String(n),mod:!0}}}),{id:`projectSearch.focus`,label:`Search conversations`,category:`Conversation`,defaultBinding:{key:`k`,mod:!0}},{id:`composer.focus`,label:`Focus composer`,category:`Composer`,defaultBinding:{key:`escape`},allowInEditable:!0},{id:`composer.send`,label:`Send prompt`,category:`Composer`,defaultBinding:{key:`enter`,mod:!0},allowInEditable:!0},{id:`composer.stopRun`,label:`Stop active run`,category:`Composer`,defaultBinding:{key:`.`,mod:!0},allowInEditable:!0},{id:`composer.toggleMic`,label:`Toggle voice recording`,category:`Composer`,defaultBinding:{key:`v`,alt:!0},allowInEditable:!0},{id:`composer.cancelMic`,label:`Cancel voice recording`,category:`Composer`,defaultBinding:{key:`escape`},allowInEditable:!0},{id:`composer.toggleMode`,label:`Toggle coding/planning mode`,category:`Composer`,defaultBinding:{key:`m`,alt:!0},allowInEditable:!0},{id:`composer.cyclePermission`,label:`Cycle permission level`,category:`Composer`,defaultBinding:{key:`p`,alt:!0},allowInEditable:!0},{id:`composer.cycleThinking`,label:`Cycle thinking level`,category:`Composer`,defaultBinding:{key:`t`,alt:!0},allowInEditable:!0},{id:`zoom.in`,label:`Zoom in`,category:`View`,defaultBinding:{key:`=`,mod:!0}},{id:`zoom.out`,label:`Zoom out`,category:`View`,defaultBinding:{key:`-`,mod:!0}},{id:`zoom.reset`,label:`Reset zoom`,category:`View`,defaultBinding:{key:`0`,mod:!0}},{id:`view.toggleLeftDock`,label:`Toggle left panel`,category:`View`,defaultBinding:{key:`b`,mod:!0},allowInEditable:!0},{id:`view.toggleRightDock`,label:`Toggle right panel`,category:`View`,defaultBinding:{key:`b`,mod:!0,alt:!0},allowInEditable:!0},{id:`view.toggleBottomDock`,label:`Toggle bottom panel`,category:`View`,defaultBinding:{key:`j`,mod:!0},allowInEditable:!0}];function xp(e){return bp.find(t=>t.id===e)}function Sp(e){return xp(e)?.defaultBinding}function Cp(e){let t=Sp(e);return t?vp(t):void 0}function wp(e){let t=Sp(e);return t?yp(t):void 0}function Tp(e,t){if(!e)return``;let n=Ep(e),r=``,i=t?Ep(t):void 0;i&&(Op(n,i)||kp(n,i))?(n=n.slice(i.length),r=`~`):n.startsWith(`/`)&&(r=``);let a=n.split(`/`).filter(Boolean);if(a.length===0)return r||n||`/`;let o=a[a.length-1],s=a.slice(0,-1).map(e=>{let[t]=Array.from(e);return t??``});return[...r?[r,...s]:s,o].join(`/`)}function Ep(e){return e.replace(/\\/g,`/`).replace(/\/+$/,``)||e}function Dp(e){let t=Ep(e);return/^[A-Za-z]:\//.test(t)?t.toLowerCase():t}function Op(e,t){return Dp(e)===Dp(t)}function kp(e,t){return Dp(e).startsWith(`${Dp(t)}/`)}function Ap(e,t){if(!e||!t)return!1;let n=Ep(e),r=Ep(t);return Op(n,r)||kp(n,r)}function jp(e,t){if(!e)return``;let n=Ep(e),r=t?Ep(t):void 0;return r&&Op(n,r)?`~`:r&&kp(n,r)?`~${n.slice(r.length)}`:n||e||`/`}function Mp(e){return Dp(e)}function Np(e){let t=e.trim();return t?t.startsWith(`/`)||t.startsWith(`~`)||t.startsWith(`\\\\`)||/^[A-Za-z]:[\\/]?/.test(t)||t.includes(`/`)||t.includes(`\\`)||t.toLowerCase().startsWith(`file://`):!1}function Pp(e){return e.kind===`settings`?{kind:`settings`,id:`settings`}:e.kind===`auth`?{kind:`auth`,id:`auth`}:e.kind===`logs`?{kind:`logs`,id:`logs`}:{kind:e.kind,id:e.id}}function Fp(e){return[e.task?.displayName,e.task?.name,e.task?.command].find(e=>e?.trim())?.trim()??e.id}function Ip(e){if(e.kind===`task`)return Fp(e);if(e.kind===`file`)return e.file?.name??e.relativePath?.split(`/`).pop()??e.path?.split(`/`).pop()??`File`;if(e.kind===`pr`)return`#${e.number}`;if(e.kind===`diff`){let t=e.path?.split(`/`).pop()??`Diff`;return e.area===`staged`?`${t} (staged)`:t}return e.kind===`settings`?`Settings`:e.kind===`auth`?`Authentication`:e.kind===`logs`?`Nerve Logs`:e.kind===`pending-conversation`?e.title:e.conversation.title}function Lp(e,t){if(e.kind===`task`)return e.task?`${Fp(e)} · ${e.task.status} · ${Tp(e.task.cwd,t)} · ${e.task.id}`:`Missing task · ${e.id}`;if(e.kind===`file`)return e.file?.path??e.path??e.id;if(e.kind===`diff`)return`${e.path??e.id} · ${e.area===`staged`?`staged`:`unstaged`} changes${e.repo&&e.repo!==`.`?` · ${e.repo}`:``}`;if(e.kind===`pr`)return e.title?`#${e.number} ${e.title}`:`Pull request #${e.number}`;if(e.kind===`settings`)return`Workbench settings`;if(e.kind===`auth`)return`Providers & authentication`;if(e.kind===`logs`)return`Nerve application logs`;let n=e.project?.dir?zi(e.project.dir,t):e.kind===`pending-conversation`?zi(e.projectDir,t):`Unknown project`;return e.kind===`pending-conversation`?`${e.title} · ${n} · created on first send`:`${e.conversation.title} · ${n} · ${e.conversation.id}`}function Rp(e){if(e.error)return e.error;if(e.kind===`conversation`||e.kind===`pending-conversation`)return e.activity.label??(e.hasDraft?`Unsaved draft`:void 0);if(e.sending){if(e.kind===`task`)return`Task active`;if(e.kind===`file`)return`Loading file`;if(e.kind===`diff`)return`Loading diff`}if(e.kind===`task`)return e.task?.status??`missing`;if(e.kind===`file`&&e.file?.truncated)return`Truncated`}function zp(e){return e.kind===`file`?e.displayMode===`rendered`?`Show code`:`Show preview`:``}function Bp(e){return e.kind===`file`?e.wrapLines?`Disable line wrap`:`Wrap long lines`:``}function Vp(e,t){let n=Pp(t);return e.findIndex(e=>{let t=Pp(e);return t.kind===n.kind&&t.id===n.id})}function Hp(e,t){x(t,!0);let n=K(t,`tabs`,19,()=>[]),r=Cp(`pane.refresh`),i=Cp(`pane.close`),a=Cp(`pane.closeOthers`),o=Cp(`conversation.new`),s=wp(`conversation.new`),c=l(()=>n().map(f));function u(e){return e}function d(e){return n().find(t=>{let n=Pp(t);return n.kind===e.kind&&n.id===e.id})}function f(e){let n={...Pp(e),label:Ip(e),title:Lp(e,t.homeDir),active:e.active,running:e.sending,error:e.error,closeable:!0,wide:e.kind===`task`||e.kind===`file`||e.kind===`diff`,draft:(e.kind===`conversation`||e.kind===`pending-conversation`)&&e.hasDraft};return e.kind===`conversation`||e.kind===`pending-conversation`?n.status={tone:e.activity.tone,pulse:e.activity.pulse,label:Rp(e)}:e.kind===`task`?(n.status={label:Rp(e)},n.selectIcon=Ue):e.kind===`file`?e.renderKind?n.toggle={label:zp(e),icon:e.displayMode===`rendered`?ef:nf,disabled:!t.onToggleFileDisplayMode,onClick:()=>t.onToggleFileDisplayMode?.(e.id)}:n.icon=lf:e.kind===`pr`?n.icon=df:e.kind===`diff`?n.icon=sf:e.kind===`settings`?n.icon=_f:e.kind===`auth`?n.icon=pf:e.kind===`logs`&&(n.icon=hf),n}async function p(e,t){if(e)try{await vf(e),yi.success(`Copied ${t}`)}catch{yi.error(`Could not copy to clipboard`)}}function m(e){let o=d(e);if(!o)return[];let s=Pp(o),c=Vp(n(),o),l=c>0,u=c!==-1&&c<n().length-1,f=[];if(o.kind===`file`){let e=o.file?.path??o.path,n=o.relativePath??o.file?.relativePath;f.push({label:`Copy Path`,icon:af,disabled:!e,onSelect:()=>void p(e,`path`)},{label:`Copy Relative Path`,icon:af,disabled:!n,onSelect:()=>void p(n,`relative path`)},{type:`separator`},{label:Bp(o),icon:nf,disabled:!t.onToggleFileLineWrap,onSelect:()=>t.onToggleFileLineWrap?.(o.id)})}return f.push({label:`Refresh`,icon:Wl,shortcut:r,disabled:!t.onRefresh,onSelect:()=>t.onRefresh?.(s)}),t.onReorder&&f.push({type:`separator`},{label:`Move Left`,icon:Vs,disabled:!l,onSelect:()=>t.onReorder(s,c-1)},{label:`Move Right`,icon:Us,disabled:!u,onSelect:()=>t.onReorder(s,c+1)}),f.push({type:`separator`},{label:`Close Pane`,icon:li,shortcut:i,onSelect:()=>t.onClose?.(s)},{label:`Close Other Panes`,icon:li,shortcut:a,disabled:n().length<=1||!t.onCloseOther,onSelect:()=>t.onCloseOther?.(s)},{label:`Close Panes on Right`,icon:li,disabled:!u||!t.onCloseRight,onSelect:()=>t.onCloseRight?.(s)},{label:`Close Panes on Left`,icon:li,disabled:!l||!t.onCloseLeft,onSelect:()=>t.onCloseLeft?.(s)}),f}Kl(e,{get tabs(){return L(c)},get refreshShortcut(){return r},get closeShortcut(){return i},get closeOthersShortcut(){return a},newLabel:`New chat`,get newShortcut(){return o},get newShortcutAria(){return s},buildMenuItems:({tab:e})=>m(e),onSelect:e=>t.onSelect?.(u(e)),onClose:e=>t.onClose?.(u(e)),onRefresh:e=>t.onRefresh?.(u(e)),onCloseOther:e=>t.onCloseOther?.(u(e)),onCloseRight:e=>t.onCloseRight?.(u(e)),onCloseLeft:e=>t.onCloseLeft?.(u(e)),get onNew(){return t.onNew},onReorder:(e,n)=>t.onReorder?.(u(e),n)}),H()}function Up(e,t){let n={needsUser:0,failed:0,running:0};for(let r of e){let e=t[r.id];e&&(e.needsUser?n.needsUser+=1:e.tone===`danger`?n.failed+=1:e.busy&&(n.running+=1))}return n}function Wp(e,t){let n=[e.needsUser?`${e.needsUser} waiting for you`:``,e.failed?`${e.failed} failed`:``,e.running?`${e.running} conversation${e.running===1?``:`s`} running`:``,t.running?`${t.running} background task${t.running===1?``:`s`} running`:``].filter(Boolean);if(n.length)return{tone:e.needsUser?`warn`:e.failed?`danger`:`running`,count:e.needsUser+e.failed+e.running+t.running,summary:n.join(`, `)}}function Gp(e){let t=new Map;for(let n of e.projects){let e=Gi(n);t.set(e,[...t.get(e)??[],n])}let n=new Map;for(let[e,r]of t)for(let t of r)n.set(t.id,e);let r=new Map,i=new Set([`starting`,`running`,`ready`,`stopping`]);for(let a of e.tasks){if(a.visibility!==`background`||!i.has(a.status))continue;let e=a.projectId?n.get(a.projectId):void 0;if(!e){let n=-1;for(let[r,i]of t){let t=i[0]?.dir;t&&t.length>n&&Ap(a.cwd,t)&&(e=r,n=t.length)}}e&&r.set(e,(r.get(e)??0)+1)}let a=new Map;for(let e of t.values()){let t=Ri(e[0].dir);a.set(t,(a.get(t)??0)+1)}return[...t.entries()].map(([t,n])=>{let i=[...n].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))[0],o=n.map(e=>e.id),s=new Set(o),c=e.conversations.filter(e=>s.has(e.projectId)),l=c.map(Mee).sort((e,t)=>t.localeCompare(e))[0],u=Ri(i.dir);return{key:t,project:i,projectIds:o,label:(a.get(u)??0)>1?zi(i.dir,e.homeDir):u,sortAt:l&&l>i.updatedAt?l:i.updatedAt,lastAccessedAt:e.recency?.[t],conversationCount:c.length,activity:Up(c,e.activityById),tasks:{running:r.get(t)??0}}}).sort((t,n)=>{let r=(e.recency?.[n.key]??0)-(e.recency?.[t.key]??0);return r===0?n.sortAt.localeCompare(t.sortAt)||t.label.localeCompare(n.label):r})}function Kp(e,t,n){if(n<=0)return[];let r=e.slice(0,n),i=e.find(e=>e.key===t);return i&&!r.some(e=>e.key===i.key)&&r.splice(Math.max(0,r.length-1),1,i),r.sort((e,t)=>e.label.localeCompare(t.label,void 0,{sensitivity:`base`}))}function qp(e){return e===`planning`?`good`:`running`}function Jp(e,t=!1,n){return e===`awaiting_user`?`warn`:e===`running`||t?qp(n):`neutral`}function Yp(e,t=!1){return e===`awaiting_user`?!1:e===`running`||t}function Xp(e){return e===`running`||e===`ready`||e===`recovered`?`good`:e===`starting`||e===`stopping`?`warn`:e===`failed`||e===`timed_out`||e===`orphaned`||e===`recovery_unknown`?`danger`:`neutral`}function Zp(e){return e===`running`||e===`ready`||e===`starting`||e===`stopping`||e===`recovered`}function Qp(e){return e===`error`?`danger`:e===`warn`?`warn`:`neutral`}var $p=new Set([`.md`,`.markdown`,`.mdown`,`.mkd`]),em=new Set([`.mmd`,`.mermaid`]);function tm(e){if(!e)return;let t=e.split(/[?#]/,1)[0]?.toLowerCase()??``,n=t.lastIndexOf(`.`);if(n===-1)return;let r=t.slice(n);if($p.has(r))return`markdown`;if(em.has(r))return`mermaid`}function nm(e){return tm(e)?`rendered`:`raw`}var rm={tone:`neutral`,pulse:!1,busy:!1,needsUser:!1,source:`none`};function im(e){let t=!!e.hasPendingHumanInput,n=e.view?.activeRun?.status===`waiting`;return t||n||e.agent?.status===`awaiting_user`?{tone:`warn`,pulse:!1,label:`Needs user action`,busy:!1,needsUser:!0,source:t?`pending-input`:n?`live-view`:`agent`}:e.view?.transient?.compaction?.state===`running`?{tone:`running`,pulse:!0,label:`Compacting context`,busy:!0,needsUser:!1,source:`live-view`}:e.agent?.status===`running`||e.view?.sending||e.view?.activeRun?{tone:qp(e.agent?.mode??e.mode),pulse:!0,label:`Agent running`,busy:!0,needsUser:!1,source:e.agent?.status===`running`?`agent`:`live-view`}:e.agent?.status===`error`?{tone:`danger`,pulse:!1,label:`Agent error`,busy:!1,needsUser:!1,source:`agent`}:rm}function am(e){let t=new Map,n=new Map;for(let r of e.agents)t.set(r.id,r),r.conversationId&&!n.has(r.conversationId)&&n.set(r.conversationId,r);let r=new Set;for(let t of e.approvals)t.status===`pending`&&r.add(t.conversationId);for(let t of e.userQuestions)t.status===`pending`&&r.add(t.conversationId);for(let t of e.planReviews)t.status===`pending`&&r.add(t.conversationId);let i=Object.create(null);for(let a of e.conversations){let o=(a.activeAgentId?t.get(a.activeAgentId):void 0)??n.get(a.id);i[a.id]=im({conversationId:a.id,agent:o,mode:o?.mode??a.mode,view:e.views[$i(a.id)],hasPendingHumanInput:r.has(a.id)})}return i}function om(e,t){return Q.activeCenterTab?.kind===e&&Q.activeCenterTab.id===t}function sm(){let e=Q.activeCenterTab;if(e?.kind===`pending-conversation`)return Yi.pendingConversations[na(e.id)]}function cm(e){return[`starting`,`running`,`ready`,`stopping`].includes(e)}var lm=l(()=>am({conversations:Q.conversations,agents:Q.agents,views:Yi.conversationViews,approvals:Q.approvals,userQuestions:Q.userQuestions,planReviews:Q.planReviews}));function um(e){return`${e.kind}\0${e.id}`}var dm={get status(){return Q.status},get connection(){return Q.connection},get error(){let e=un.conversationId??Yi.activeConversationTabId,t=e?Yi.conversationViews[$i(e)]:void 0;return sm()?.error??t?.error??Q.error},get projects(){return Q.projects},get conversations(){return Q.conversations},get agents(){return Q.agents},get approvals(){return Q.approvals},get userQuestions(){return Q.userQuestions},get planReviews(){return Q.planReviews},get activeProject(){return Q.projects.find(e=>e.id===Q.selectedProjectId)??Q.projects.find(e=>Gi(e)===Q.selectedProjectKey)},get selectedProjectIds(){let e=Q.selectedProjectKey;return Q.projects.filter(t=>e&&Gi(t)===e).map(e=>e.id)},get selectedProjectConversations(){let e=new je(this.selectedProjectIds);return Q.conversations.filter(t=>e.has(t.projectId))},get projectSwitcherItems(){return Gp({projects:Q.projects,conversations:Q.conversations,tasks:Ii.tasks,activityById:this.conversationActivityById,homeDir:Q.status?.storage.userHome,recency:Q.projectRecency})},get activeConversation(){return Q.conversations.find(e=>e.id===un.conversationId)},get activeAgent(){return Q.agents.find(e=>e.id===un.agentId)},get conversationActivityById(){return L(lm)},get openConversationTabs(){let e=[],t=Object.fromEntries(Q.conversations.map(e=>[e.id,e])),n=Object.fromEntries(Q.projects.map(e=>[e.id,e])),r=Object.fromEntries(Q.agents.map(e=>[e.id,e])),i=Object.create(null);for(let e of Q.agents)e.conversationId&&!i[e.conversationId]&&(i[e.conversationId]=e);let a=L(lm);for(let o of Yi.openConversationTabIds){let s=t[o];if(!s)continue;let c=n[s.projectId],l=(s.activeAgentId?r[s.activeAgentId]:void 0)??i[s.id],u=Yi.conversationViews[$i(s.id)],d=a[s.id]??rm;e.push({kind:`conversation`,id:s.id,conversation:s,project:c,agent:l,active:om(`conversation`,s.id),hasDraft:!!u?.composerText.trim(),sending:d.busy,activity:d,error:u?.error??(l?.status===`error`?`Agent error`:void 0)})}return e},get openPendingConversationTabs(){let e=[];for(let t of Q.openCenterTabs){if(t.kind!==`pending-conversation`)continue;let n=Yi.pendingConversations[na(t.id)];n&&e.push({kind:`pending-conversation`,id:n.id,title:n.title,project:Q.projects.find(e=>e.id===n.projectId),projectDir:n.projectDir,active:om(`pending-conversation`,n.id),hasDraft:!!n.composerText.trim(),sending:n.sending,activity:n.sending?{tone:qp(n.mode),pulse:!0,label:`Agent running`,busy:!0,needsUser:!1,source:`live-view`}:rm,error:n.error})}return e},get openTaskTabs(){let e=[];for(let t of Ii.openTaskTabIds){let n=Ii.selectedRunByEntry[t],r=Ii.tasks.filter(e=>(e.definitionId??e.restartRootTaskId??e.id)===t).sort((e,t)=>t.startedAt.localeCompare(e.startedAt)),i=r.find(e=>e.id===n)??r[0];e.push({kind:`task`,id:t,task:i,active:om(`task`,t),sending:i?cm(i.status):!1,error:i?i.status===`failed`?i.error??`Task failed`:void 0:`Task not found`})}return e},get openFileTabs(){return ra.openFileTabIds.map(e=>{let t=ra.fileViews[Qi(e)],n=t?.content?.relativePath??t?.path;return{kind:`file`,id:e,file:t?.content,path:t?.path,relativePath:t?.content?.relativePath,displayMode:t?.displayMode??nm(n),wrapLines:!!t?.wrapLines,renderKind:tm(n),active:om(`file`,e),sending:!!t?.loading,error:t?.error}})},get openDiffTabs(){return Bi.openDiffTabIds.map(e=>{let t=Bi.diffViews[ta(e)];return{kind:`diff`,id:e,path:t?.path,repo:t?.repo,area:t?.area,active:om(`diff`,e),sending:!!(t?.loading||t?.refreshing),error:t?.error}})},get openPrTabs(){return Bi.openPrTabIds.map(e=>{let t=Bi.prViews[Zi(e)];return{kind:`pr`,id:e,number:t?.number??0,title:t?.core.data?.title,checksStatus:t?.checks.data?.checks.status,isDraft:t?.core.data?.isDraft,active:om(`pr`,e),sending:!!(t?.core.loading||t?.core.refreshing),error:t?.core.error}})},get openSettingsTabs(){return Pi.settingsTabOpen?[{kind:`settings`,id:`settings`,active:om(`settings`,`settings`),sending:Pi.settingsSaveStatus===`saving`,error:Pi.settingsSaveStatus===`error`?Pi.settingsMessage:void 0}]:[]},get openAuthTabs(){return Wi.authTabOpen?[{kind:`auth`,id:`auth`,active:om(`auth`,`auth`),sending:!1}]:[]},get openLogsTabs(){return Ci.logsTabOpen?[{kind:`logs`,id:`logs`,active:om(`logs`,`logs`),sending:!1}]:[]},get openConversationTabIds(){let e=new je;for(let t of Q.openCenterTabs)t.kind===`conversation`&&e.add(t.id);return e},get centerTabs(){let e=Object.create(null),t=[this.openConversationTabs,this.openPendingConversationTabs,this.openTaskTabs,this.openFileTabs,this.openPrTabs,this.openDiffTabs,this.openSettingsTabs,this.openAuthTabs,this.openLogsTabs];for(let n of t)for(let t of n)e[um(t)]=t;return Q.openCenterTabs.flatMap(t=>{let n=e[um(t)];return n?[n]:[]})},get activeCenterTab(){return Q.activeCenterTab}},fm=new Set([`$$slots`,`$$events`,`$$legacy`]);function pm(e,t){let n=U(t,fm),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}]];G(e,V({name:`file`},()=>n,{get iconNode(){return r}}))}var mm=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=ym(e.state,n.from);return r.line?gm(e):r.block?vm(e):!1};function hm(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var gm=hm(wm,0),_m=hm(Cm,0),vm=hm((e,t)=>Cm(e,t,Sm(t)),0);function ym(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var bm=50;function xm(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-bm,r),o=e.sliceDoc(i,i+bm),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*bm?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+bm),d=e.sliceDoc(i-bm,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function Sm(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function Cm(e,t,n=t.selection.ranges){let r=n.map(e=>ym(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>xm(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function wm(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=ym(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var Tm=ja.define(),Em=ja.define(),Dm=Oa.define(),Om=Oa.define({combine(e){return La(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),km=Ta.define({create(){return Jm.empty},update(e,t){let n=t.state.facet(Om),r=t.annotation(Tm);if(r){let i=Im.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?Lm(o,o.length,n.minDepth,i):Um(o,t.startState.selection),new Jm(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(Em);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(Fa.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Im.fromTransaction(t),o=t.annotation(Fa.time),s=t.annotation(Fa.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new Jm(e.done.map(Im.fromJSON),e.undone.map(Im.fromJSON))}});function Am(e={}){return[km,Om.of(e),ya.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?Mm:e.inputType==`historyRedo`?Nm:null;return n?(e.preventDefault(),n(t)):!1}})]}function jm(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(km,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var Mm=jm(0,!1),Nm=jm(1,!1),Pm=jm(0,!0),Fm=jm(1,!0),Im=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&Sa.fromJSON(t.changes),[],t.mapped&&Da.fromJSON(t.mapped),t.startSelection&&Ma.fromJSON(t.startSelection),t.selectionsAfter.map(Ma.fromJSON))}static fromTransaction(t,n){let r=Vm;for(let e of t.startState.facet(Dm)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Vm)}static selection(t){return new e(void 0,Vm,void 0,void 0,t)}};function Lm(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function Rm(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function zm(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function Bm(e,t){return e.length?t.length?e.concat(t):e:t}var Vm=[],Hm=200;function Um(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Hm));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),Lm(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Im.selection([t])]}function Wm(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function Gm(e,t){if(!e.length)return e;let n=e.length,r=Vm;for(;n;){let i=Km(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[Im.selection(r)]:Vm}function Km(e,t,n){let r=Bm(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):Vm,n);if(!e.changes)return Im.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new Im(i,Ea.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var qm=/^(input\.type|delete)($|\.)/,Jm=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||qm.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,Rm(s.changes,t.changes))||r==`input.type.compose`)?Lm(o,o.length-1,i.minDepth,new Im(t.changes.compose(s.changes),Bm(Ea.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,Vm)):Lm(o,o.length,i.minDepth,t),new e(o,Vm,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Vm;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&zm(a[a.length-1],t)?this:new e(Um(this.done,t),this.undone,n,r)}addMapping(t){return new e(Gm(this.done,t),Gm(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:Tm.of({side:e,rest:Wm(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?Vm:r.slice(0,r.length-1);return i.mapped&&(n=Gm(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:Tm.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};Jm.empty=new Jm(Vm,Vm);var Ym=[{key:`Mod-z`,run:Mm,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:Nm,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:Nm,preventDefault:!0},{key:`Mod-u`,run:Pm,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:Fm,preventDefault:!0}];function Xm(e,t){return Ma.create(e.ranges.map(t),e.mainIndex)}function Zm(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function Qm({state:e,dispatch:t},n){let r=Xm(e.selection,n);return r.eq(e.selection,!0)?!1:(t(Zm(e,r)),!0)}function $m(e,t){return Ma.cursor(t?e.to:e.from)}function eh(e,t){return Qm(e,n=>n.empty?e.moveByChar(n,t):$m(n,t))}function th(e){return e.textDirectionAt(e.state.selection.main.head)==va.LTR}var nh=e=>eh(e,!th(e)),rh=e=>eh(e,th(e));function ih(e,t){return Qm(e,n=>n.empty?e.moveByGroup(n,t):$m(n,t))}var ah=e=>ih(e,!th(e)),oh=e=>ih(e,th(e));typeof Intl<`u`&&Intl.Segmenter;function sh(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function ch(e,t,n){let r=pa(e).resolveInner(t.head),i=n?ua.closedBy:ua.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;sh(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?_a(e,r.from,1):_a(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,Ma.cursor(s,n?-1:1)}var lh=e=>Qm(e,t=>ch(e.state,t,!th(e))),uh=e=>Qm(e,t=>ch(e.state,t,th(e)));function dh(e,t){return Qm(e,n=>{if(!n.empty)return $m(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var fh=e=>dh(e,!1),ph=e=>dh(e,!0);function mh(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(ya.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function hh(e,t){let n=mh(e),{state:r}=e,i=Xm(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):$m(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=ya.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(Zm(r,i),{effects:a}),!0}var gh=e=>hh(e,!1),_h=e=>hh(e,!0);function vh(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=Ma.cursor(r.from+n))}return i}var yh=e=>Qm(e,t=>vh(e,t,!0)),bh=e=>Qm(e,t=>vh(e,t,!1)),xh=e=>Qm(e,t=>vh(e,t,!th(e))),Sh=e=>Qm(e,t=>vh(e,t,th(e))),Ch=e=>Qm(e,t=>Ma.cursor(e.lineBlockAt(t.head).from,1)),wh=e=>Qm(e,t=>Ma.cursor(e.lineBlockAt(t.head).to,-1));function Th(e,t,n){let r=!1,i=Xm(e.selection,t=>{let i=_a(e,t.head,-1)||_a(e,t.head,1)||t.head>0&&_a(e,t.head-1,1)||t.head<e.doc.length&&_a(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?Ma.range(t.anchor,a):Ma.cursor(a)});return r?(t(Zm(e,i)),!0):!1}var Eh=({state:e,dispatch:t})=>Th(e,t,!1);function Dh(e,t){let n=Xm(e.state.selection,e=>{let n=t(e);return Ma.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(Zm(e.state,n)),!0)}function Oh(e,t){return Dh(e,n=>e.moveByChar(n,t))}var kh=e=>Oh(e,!th(e)),Ah=e=>Oh(e,th(e));function jh(e,t){return Dh(e,n=>e.moveByGroup(n,t))}var Mh=e=>jh(e,!th(e)),Nh=e=>jh(e,th(e)),Ph=e=>Dh(e,t=>ch(e.state,t,!th(e))),Fh=e=>Dh(e,t=>ch(e.state,t,th(e)));function Ih(e,t){return Dh(e,n=>e.moveVertically(n,t))}var Lh=e=>Ih(e,!1),Rh=e=>Ih(e,!0);function zh(e,t){return Dh(e,n=>e.moveVertically(n,t,mh(e).height))}var Bh=e=>zh(e,!1),Vh=e=>zh(e,!0),Hh=e=>Dh(e,t=>vh(e,t,!0)),Uh=e=>Dh(e,t=>vh(e,t,!1)),Wh=e=>Dh(e,t=>vh(e,t,!th(e))),Gh=e=>Dh(e,t=>vh(e,t,th(e))),Kh=e=>Dh(e,t=>Ma.cursor(e.lineBlockAt(t.head).from)),qh=e=>Dh(e,t=>Ma.cursor(e.lineBlockAt(t.head).to)),Jh=({state:e,dispatch:t})=>(t(Zm(e,{anchor:0})),!0),Yh=({state:e,dispatch:t})=>(t(Zm(e,{anchor:e.doc.length})),!0),Xh=({state:e,dispatch:t})=>(t(Zm(e,{anchor:e.selection.main.anchor,head:0})),!0),Zh=({state:e,dispatch:t})=>(t(Zm(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Qh=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),$h=({state:e,dispatch:t})=>{let n=vg(e).map(({from:t,to:n})=>Ma.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:Ma.create(n),userEvent:`select`})),!0},eg=({state:e,dispatch:t})=>{let n=Xm(e.selection,t=>{let n=pa(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return Ma.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(Zm(e,n)),!0)};function tg(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(Zm(n,Ma.create(i,i.length-1))),!0)}var ng=e=>tg(e,!1),rg=e=>tg(e,!0),ig=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Ma.create([n.main]):n.main.empty||(r=Ma.create([Ma.cursor(n.main.head)])),r?(t(Zm(e,r)),!0):!1};function ag(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=og(e,o,!1)):o>i&&(n=`delete.forward`,o=og(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=og(e,i,!1),a=og(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:Ma.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?ya.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function og(e,t,n){if(e instanceof ya)for(let r of e.state.facet(ya.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var sg=(e,t,n)=>ag(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=ga(s,a.tabSize)%ba(a)||ba(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=la(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=la(o.text,c-o.from,!1,!1)+o.from);return c}),cg=e=>sg(e,!1,!0),lg=e=>sg(e,!0,!1),ug=(e,t)=>ag(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=la(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),dg=e=>ug(e,!1),fg=e=>ug(e,!0),pg=e=>ag(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),mg=e=>ag(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),hg=e=>ag(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),gg=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:xa.of([``,``])},range:Ma.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},_g=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:la(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:la(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:Ma.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function vg(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function yg(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of vg(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(Ma.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(Ma.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Ma.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var bg=({state:e,dispatch:t})=>yg(e,t,!1),xg=({state:e,dispatch:t})=>yg(e,t,!0);function Sg(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of vg(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var Cg=({state:e,dispatch:t})=>Sg(e,t,!1),wg=({state:e,dispatch:t})=>Sg(e,t,!0),Tg=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(vg(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=Xm(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function Eg(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=pa(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(ua.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var Dg=kg(!1),Og=kg(!0);function kg(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&Eg(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new ka(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=Pa(s,r);for(c??=ga(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,Ia(t,c)];return o&&l.push(Ia(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:xa.of(l)},range:Ma.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function Ag(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:Ma.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var jg=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new ka(e,{overrideIndentation:e=>n[e]??-1}),i=Ag(e,(t,i,a)=>{let o=Pa(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=Ia(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},Mg=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Ag(e,(t,n)=>{n.push({from:t.from,insert:e.facet(ha)})}),{userEvent:`input.indent`})),!0),Ng=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Ag(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=ga(r,e.tabSize),a=0,o=Ia(e,Math.max(0,i-ba(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),Pg=e=>(e.setTabFocusMode(),!0),Fg=[{key:`Ctrl-b`,run:nh,shift:kh,preventDefault:!0},{key:`Ctrl-f`,run:rh,shift:Ah},{key:`Ctrl-p`,run:fh,shift:Lh},{key:`Ctrl-n`,run:ph,shift:Rh},{key:`Ctrl-a`,run:Ch,shift:Kh},{key:`Ctrl-e`,run:wh,shift:qh},{key:`Ctrl-d`,run:lg},{key:`Ctrl-h`,run:cg},{key:`Ctrl-k`,run:pg},{key:`Ctrl-Alt-h`,run:dg},{key:`Ctrl-o`,run:gg},{key:`Ctrl-t`,run:_g},{key:`Ctrl-v`,run:_h}],Ig=[{key:`ArrowLeft`,run:nh,shift:kh,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:ah,shift:Mh,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:xh,shift:Wh,preventDefault:!0},{key:`ArrowRight`,run:rh,shift:Ah,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:oh,shift:Nh,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:Sh,shift:Gh,preventDefault:!0},{key:`ArrowUp`,run:fh,shift:Lh,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:Jh,shift:Xh},{mac:`Ctrl-ArrowUp`,run:gh,shift:Bh},{key:`ArrowDown`,run:ph,shift:Rh,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:Yh,shift:Zh},{mac:`Ctrl-ArrowDown`,run:_h,shift:Vh},{key:`PageUp`,run:gh,shift:Bh},{key:`PageDown`,run:_h,shift:Vh},{key:`Home`,run:bh,shift:Uh,preventDefault:!0},{key:`Mod-Home`,run:Jh,shift:Xh},{key:`End`,run:yh,shift:Hh,preventDefault:!0},{key:`Mod-End`,run:Yh,shift:Zh},{key:`Enter`,run:Dg,shift:Dg},{key:`Mod-a`,run:Qh},{key:`Backspace`,run:cg,shift:cg,preventDefault:!0},{key:`Delete`,run:lg,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:dg,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:fg,preventDefault:!0},{mac:`Mod-Backspace`,run:mg,preventDefault:!0},{mac:`Mod-Delete`,run:hg,preventDefault:!0}].concat(Fg.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),Lg=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:lh,shift:Ph},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:uh,shift:Fh},{key:`Alt-ArrowUp`,run:bg},{key:`Shift-Alt-ArrowUp`,run:Cg},{key:`Alt-ArrowDown`,run:xg},{key:`Shift-Alt-ArrowDown`,run:wg},{key:`Mod-Alt-ArrowUp`,run:ng},{key:`Mod-Alt-ArrowDown`,run:rg},{key:`Escape`,run:ig},{key:`Mod-Enter`,run:Og},{key:`Alt-l`,mac:`Ctrl-l`,run:$h},{key:`Mod-i`,run:eg,preventDefault:!0},{key:`Mod-[`,run:Ng},{key:`Mod-]`,run:Mg},{key:`Mod-Alt-\\`,run:jg},{key:`Shift-Mod-k`,run:Tg},{key:`Shift-Mod-\\`,run:Eh},{key:`Mod-/`,run:mm},{key:`Alt-A`,run:_m},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:Pg}].concat(Ig),Rg={key:`Tab`,run:Mg,shift:Ng};function zg(e){let t=[],n=da.line({class:`cm-executable-command-block-line`}),r=da.mark({class:`cm-executable-command-block-command`});for(let i of ar(e.doc.toString())){let a=i.start;for(;a<i.end;){let r=e.doc.lineAt(a);if(t.push(n.range(r.from)),r.to>=i.end)break;a=r.to+1}i.commandEnd>i.commandStart&&t.push(r.range(i.commandStart,i.commandEnd))}return da.set(t.sort((e,t)=>e.from-t.from||e.to-t.to),!0)}var Bg=fa.fromClass(class{decorations;constructor(e){this.decorations=zg(e.state)}update(e){e.docChanged&&(this.decorations=zg(e.state))}},{decorations:e=>e.decorations}),Vg={name:`Commands`,rank:0},Hg={name:`Project references`,rank:10};function Ug(e){if(e!==void 0)return Math.max(-99,Math.min(99,Math.round(e/160)))}function Wg(e){return{label:e.label,displayLabel:e.displayLabel,detail:e.detail,info:e.info,type:e.kind===`directory`?`folder`:e.kind===`file`?`file`:`keyword`,apply:e.apply??e.label,boost:Ug(e.sortScore),section:e.kind===`directory`||e.kind===`file`?Hg:Vg,matchRanges:e.matchRanges?.flatMap(([e,t])=>[e,t]),nerveKind:e.kind}}function Gg(e){return e.matchRanges??[]}function Kg(e){return`nerve-completion-option nerve-completion-${e.nerveKind??`slash`}`}var qg=`http://www.w3.org/2000/svg`,Jg={file:[`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,`M14 2v5a1 1 0 0 0 1 1h5`],folder:[`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`]};function Yg(e,t=14){let n=document.createElementNS(qg,`svg`);n.setAttribute(`viewBox`,`0 0 24 24`),n.setAttribute(`fill`,`none`),n.setAttribute(`stroke`,`currentColor`),n.setAttribute(`stroke-width`,`2`),n.setAttribute(`stroke-linecap`,`round`),n.setAttribute(`stroke-linejoin`,`round`),n.setAttribute(`width`,String(t)),n.setAttribute(`height`,String(t)),n.setAttribute(`aria-hidden`,`true`);for(let t of Jg[e]){let e=document.createElementNS(qg,`path`);e.setAttribute(`d`,t),n.appendChild(e)}return n}function Xg(e,t,n){let r=0;for(let[i,a]of n){i>r&&e.appendChild(document.createTextNode(t.slice(r,i)));let n=document.createElement(`span`);n.className=`cm-nerve-match`,n.textContent=t.slice(i,a),e.appendChild(n),r=a}r<t.length&&e.appendChild(document.createTextNode(t.slice(r)))}function Zg(e){let t=e.nerveKind,n=e.matchRanges??[],r=document.createElement(`span`);r.className=`cm-nerve-row`;let i=document.createElement(`span`);i.className=`cm-nerve-row-icon`,i.appendChild(Yg(t===`directory`?`folder`:`file`)),r.appendChild(i);let a=document.createElement(`span`);if(a.className=`cm-nerve-row-main`,t===`file`||t===`directory`){let r=e.label??``,i=typeof e.info==`string`?e.info:r.replace(/^@/,``),o=t===`directory`,s=o?i.replace(/\/+$/,``):i,c=s.lastIndexOf(`/`)+1,l=s.slice(0,c),u=s.slice(c)+(o?`/`:``),d=[];for(let e=0;e+1<n.length;e+=2){let t=Math.max(0,n[e]-1),r=Math.min(s.length,n[e+1]-1);r>t&&d.push([t,r])}if(l){let e=document.createElement(`span`);e.className=`cm-nerve-row-dir`,e.textContent=`‎`,Xg(e,l,d.filter(([e])=>e<c).map(([e,t])=>[e,Math.min(t,c)])),a.appendChild(e)}let f=document.createElement(`span`);f.className=`cm-nerve-row-name`,Xg(f,u,d.filter(([,e])=>e>c).map(([e,t])=>[Math.max(e,c)-c,t-c])),a.appendChild(f)}else{let t=document.createElement(`span`);t.className=`cm-nerve-row-name`,t.textContent=e.label??``,a.appendChild(t)}return r.appendChild(a),r}function Qg(e){return async t=>{let n=t.matchBefore(/(?:^|\s)([/@][^\s]*)/);if(!n&&!t.explicit)return null;let r=n?.text.trimStart()??``,i=n?n.to-r.length:t.pos;if(r.startsWith(`/`))return{from:i,options:e.slashCompletions().filter(e=>e.label.startsWith(r)||e.label.includes(r.slice(1))).slice(0,8).map(Wg),validFor:/^\/[\w-]*$/};if(r.startsWith(`@`)){t.addEventListener(`abort`,()=>void 0,{onDocChange:!0});let n=r.slice(1),a=(await e.fileCompletions()?.(n)??[]).slice(0,8).reverse().map(Wg);return t.aborted?null:{from:i,options:a,filter:!1,getMatch:Gg}}return t.explicit?{from:t.pos,options:e.slashCompletions().slice(0,8).map(Wg)}:null}}var $g=fa.fromClass(class{lastOptions;update(e){if(Va(e.state)!==`active`){this.lastOptions=void 0;return}let t=Ua(e.state);if(!t.some(e=>{let t=e.nerveKind;return t===`file`||t===`directory`})||t===this.lastOptions)return;this.lastOptions=t;let n=e.view;queueMicrotask(()=>{if(Va(n.state)!==`active`||Ua(n.state)!==t)return;let e=t.length-1;e<0||za(n.state)===e||n.dispatch({effects:Wa(e)})})}});function e_(e){return e.slashCompletions().length===0&&!e.fileCompletions()?[]:Ha({override:[Qg(e)],icons:!1,aboveCursor:!0,maxRenderedOptions:8,tooltipClass:()=>`nerve-composer-completions`,optionClass:Kg,addToOptions:[{render:Zg,position:20}]})}var t_=ya.theme({"&":{background:`transparent`,color:`var(--foreground)`,maxHeight:`min(40vh, 320px)`},".cm-content":{caretColor:`var(--primary)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,lineHeight:`1.5`,padding:`18px 46px 14px 11px`},".cm-line":{padding:`0 2px`},".cm-cursor":{borderLeftColor:`var(--primary)`},".cm-placeholder":{color:`color-mix(in oklab, var(--muted-foreground) 75%, transparent)`},".cm-executable-command-block-line":{backgroundColor:`color-mix(in oklab, var(--info) 9%, transparent)`},".cm-executable-command-block-command":{backgroundColor:`color-mix(in oklab, var(--info) 16%, transparent)`,color:`var(--foreground)`,borderRadius:`var(--radius-sm)`},".cm-scroller":{minHeight:`92px`,maxHeight:`min(40vh, 320px)`,overflow:`auto`},".cm-tooltip":{border:`1px solid var(--border)`,borderRadius:`var(--radius-md)`,background:`var(--popover)`,color:`var(--popover-foreground)`,boxShadow:`var(--shadow-lg)`,overflow:`hidden`},".cm-tooltip-autocomplete.nerve-composer-completions":{minWidth:`min(24rem, calc(100vw - 2rem))`,maxWidth:`min(34rem, calc(100vw - 2rem))`,padding:`0.15rem`},".cm-tooltip-autocomplete.nerve-composer-completions > ul":{maxHeight:`none`,overflow:`hidden`,padding:`0.1rem`,fontFamily:`var(--font-mono)`},".cm-tooltip-autocomplete.nerve-composer-completions > ul > completion-section":{borderBottom:`0`,color:`var(--muted-foreground)`,fontFamily:`var(--font-sans)`,fontSize:`var(--text-xs)`,fontWeight:`500`,letterSpacing:`0.02em`,padding:`0.25rem 0.4rem 0.15rem`,textTransform:`uppercase`},".cm-tooltip-autocomplete.nerve-composer-completions > ul > li":{display:`flex`,alignItems:`center`,minHeight:`1.55rem`,borderRadius:`var(--radius-sm)`,padding:`0.18rem 0.4rem`,color:`var(--popover-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions > ul > li[aria-selected]":{background:`var(--accent)`,color:`var(--accent-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-completionLabel":{display:`none`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-completionDetail":{display:`none`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row":{display:`flex`,alignItems:`center`,gap:`0.4rem`,minWidth:`0`,width:`100%`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row-icon":{display:`inline-flex`,flexShrink:`0`,alignItems:`center`,color:`var(--muted-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions .nerve-completion-directory .cm-nerve-row-icon":{color:`var(--info)`},".cm-tooltip-autocomplete.nerve-composer-completions .nerve-completion-file .cm-nerve-row-icon":{color:`var(--success)`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row-main":{display:`flex`,alignItems:`baseline`,gap:`0.3rem`,flex:`1`,minWidth:`0`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row-dir":{flexShrink:`1`,minWidth:`0`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,direction:`rtl`,textAlign:`left`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-xs)`,color:`var(--muted-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row-name":{flexShrink:`0`,whiteSpace:`nowrap`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,fontWeight:`500`,color:`var(--popover-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-match":{color:`var(--primary)`,fontWeight:`600`},".cm-tooltip.cm-completionInfo":{maxWidth:`min(30rem, calc(100vw - 2rem))`,padding:`0.55rem 0.7rem`,color:`var(--popover-foreground)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-xs)`},"&.cm-focused":{outline:`none`},"&.cm-focused .cm-cursor":{borderLeftColor:`var(--primary)`},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, ::selection":{backgroundColor:`color-mix(in oklab, var(--primary) 22%, transparent)`}}),n_=P(`<div class="pointer-events-none absolute inset-0 z-10 flex items-center justify-center gap-2 rounded-md border border-primary bg-background/95 px-4 text-sm font-medium text-foreground shadow-sm" aria-hidden="true"><!> <span>Drop files or folders to add their paths</span></div>`),r_=P(`<div role="group"><div></div> <!></div>`);function i_(e,t){x(t,!0);let n=K(t,`placeholder`,3,`Ask the Nerve agent`),r=K(t,`ariaLabel`,3,`Prompt editor drop area`),i=K(t,`disabled`,3,!1),a=K(t,`focusToken`,3,0),o=K(t,`slashCompletions`,19,()=>[]),s,c,l=``,u=0,d=0,f=X(!1),m=new Aa,h=new Aa,_=new Aa,v={slashCompletions:()=>o(),fileCompletions:()=>t.fileCompletions};function b(e){return[Ca.readOnly.of(e),ya.editable.of(!e)]}function S(){return i()?!1:(t.onSubmit?.(),!0)}function C(e){return Va(e.state)===`active`?!1:S()}function T(e){return Va(e.state)===`active`?Ba(e):!1}function E(e,t,n){if(!c||!e)return;let r=c.state.selection.main,i=c.state.doc.length,a=Math.min(t??r.from,i),o=Math.min(n??r.to,i);c.dispatch({changes:{from:a,to:o,insert:e},selection:{anchor:a+e.length},scrollIntoView:!0}),c.focus()}function D(e,t){if(!c||e.length===0)return;let n=c.state.doc,r=Math.min(t.from,n.length),i=Math.min(t.to,n.length),a=r>0?n.sliceString(r-1,r):``,o=i<n.length?n.sliceString(i,i+1):``,s=a&&!/\s/.test(a)?` `:``,l=o&&!/\s/.test(o)?` `:``;E(`${s}${e.join(` `)}${l}`,r,i)}function O(e){return e?Array.from(e.items).some(e=>e.kind===`file`)||Array.from(e.types).includes(`Files`):!1}function k(e){return!!(!i()&&t.onDropFiles&&O(e.dataTransfer))}function ee(e){k(e)&&(e.preventDefault(),e.stopPropagation(),d+=1,R(f,!0))}function j(e){k(e)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`))}function M(e){L(f)&&(e.preventDefault(),e.stopPropagation(),d=Math.max(0,d-1),d===0&&R(f,!1))}function N(e){if(!k(e)||!t.onDropFiles||!c)return;e.preventDefault(),e.stopPropagation(),d=0,R(f,!1);let n=Array.from(e.dataTransfer?.files??[]);if(n.length===0)return;let{from:r,to:i}=c.state.selection.main;t.onDropFiles(n).then(e=>D(e,{from:r,to:i})).catch(e=>{console.error(`Failed to resolve dropped file paths`,e)})}function te(e){if(i()||!t.onPasteImage)return!1;let n=Array.from(e.clipboardData?.files??[]).filter(e=>e.type.startsWith(`image/`));return n.length?(e.preventDefault(),Promise.all(n.map(e=>t.onPasteImage(e))).then(e=>E(e.join(`
6
- `))).catch(e=>{console.error(`Failed to paste clipboard image`,e)}),!0):!1}ue(()=>{l=t.value,c=new ya({parent:s,state:Ca.create({doc:t.value,extensions:[Am(),Ga(),_.of(Na(n())),m.of(b(i())),h.of(e_(v)),Bg,$g,wa.highest(ma.of([{key:`Enter`,run:C},{key:`Tab`,run:T},{key:`Escape`,run:Ra},{key:`Mod-Enter`,run:S},{key:`Ctrl-Enter`,run:S},Rg])),ma.of([...Lg,...Ym]),ya.lineWrapping,ya.domEventHandlers({paste:te}),ya.updateListener.of(e=>{e.docChanged&&(l=e.state.doc.toString(),t.onChange?.(l))}),t_]})})}),z(()=>{c&&(c.dispatch({effects:m.reconfigure(b(i()))}),i()&&(d=0,R(f,!1)))}),z(()=>{c&&(o(),t.fileCompletions,c.dispatch({effects:h.reconfigure(e_(v))}))}),z(()=>{c&&c.dispatch({effects:_.reconfigure(Na(n()))})}),z(()=>{!c||i()||a()===u||(u=a(),c.focus())}),z(()=>{!c||t.value===l||(c.dispatch({changes:{from:0,to:c.state.doc.length,insert:t.value}}),l=t.value)}),ce(()=>c?.destroy());var ne=r_();let P;var re=B(ne);ie(re,e=>s=e,()=>s);var F=Y(re,2),I=e=>{var t=n_();pm(B(t),{class:`size-4 text-primary`}),g(2),y(t),q(e,t)};p(F,e=>{L(f)&&e(I)}),y(ne),J(()=>{P=w(ne,1,`composer-editor relative svelte-18og541`,null,P,{disabled:i()}),A(ne,`aria-label`,r())}),Ae(`dragenter`,ne,ee,!0),Ae(`dragover`,ne,j,!0),Ae(`dragleave`,ne,M,!0),Ae(`drop`,ne,N,!0),q(e,ne),H()}var a_=new Set([`$$slots`,`$$events`,`$$legacy`]);function o_(e,t){let n=U(t,a_),r=[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`}],[`path`,{d:`m21.854 2.147-10.94 10.939`}]];G(e,V({name:`send`},()=>n,{get iconNode(){return r}}))}var s_=P(`<form class="composer svelte-dbq0fc" data-tour-id="composer"><!> <div class="composer-surface svelte-dbq0fc"><div class="editor-shell svelte-dbq0fc"><!> <!> <div class="composer-send svelte-dbq0fc" data-tour-id="composer-send-actions"><!> <!> <!></div></div></div></form>`);function c_(e,t){x(t,!0);let n=K(t,`commandMode`,3,!1),r=K(t,`executableBlocks`,3,!1),i=K(t,`pendingApproval`,3,!1),a=K(t,`pendingQuestion`,3,!1),o=K(t,`pendingPlan`,3,!1),s=K(t,`showStop`,3,!1),c=K(t,`stopping`,3,!1),u=K(t,`stopDisabled`,3,!1),d=K(t,`stopAriaLabel`,3,`Stop generation`),f=K(t,`stopTitle`,3,`Stop generation`);var m=s_(),g=B(m),v=e=>{var n=_();h(F(n),()=>t.header),q(e,n)};p(g,e=>{t.header&&e(v)});var b=Y(g,2),S=B(b),C=B(S);h(C,()=>t.toolbar);var w=Y(C,2);h(w,()=>t.editor);var T=Y(w,2),E=B(T),D=e=>{var n=_();h(F(n),()=>t.sendLeading),q(e,n)};p(E,e=>{t.sendLeading&&e(D)});var O=Y(E,2),k=e=>{{let n=l(()=>u()||c()),r=l(()=>c()?`Stopping generation`:d()),i=l(()=>c()?`Stopping generation`:f());W(e,{variant:`destructive`,size:`icon-sm`,class:`rounded-full`,type:`button`,get disabled(){return L(n)},get onclick(){return t.onAbort},get"aria-label"(){return L(r)},get"aria-keyshortcuts"(){return t.stopShortcutAria},get title(){return L(i)},children:(e,t)=>{var n=_(),r=F(n),i=e=>{ke(e,{class:`size-3.5`})},a=e=>{it(e,{size:13,strokeWidth:2.5})};p(r,e=>{c()?e(i):e(a,-1)}),q(e,n)},$$slots:{default:!0}})}};p(O,e=>{s()&&e(k)}),W(Y(O,2),{size:`icon-sm`,class:`rounded-full inset-ring-1 inset-ring-primary-foreground/18`,type:`submit`,get disabled(){return t.submitDisabled},get"aria-label"(){return t.sendAriaLabel},get title(){return t.sendTitle},children:(e,t)=>{o_(e,{size:14,strokeWidth:2.4})},$$slots:{default:!0}}),y(T),y(S),y(b),y(m),J(()=>{A(m,`data-pending-approval`,i()?`true`:void 0),A(m,`data-pending-question`,a()?`true`:void 0),A(m,`data-pending-plan`,o()?`true`:void 0),A(b,`data-mode`,t.mode),A(b,`data-command-mode`,n()?`true`:void 0),A(b,`data-executable-blocks`,r()?`true`:void 0)}),Ae(`submit`,m,e=>{e.preventDefault(),t.onSubmit()}),q(e,m),H()}var l_=new Set([`$$slots`,`$$events`,`$$legacy`]);function u_(e,t){let n=U(t,l_),r=[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`}],[`path`,{d:`M12 11h4`}],[`path`,{d:`M12 16h4`}],[`path`,{d:`M8 11h.01`}],[`path`,{d:`M8 16h.01`}]];G(e,V({name:`clipboard-list`},()=>n,{get iconNode(){return r}}))}var d_=new Set([`$$slots`,`$$events`,`$$legacy`]);function f_(e,t){let n=U(t,d_),r=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`}]];G(e,V({name:`lock`},()=>n,{get iconNode(){return r}}))}var p_=new Set([`$$slots`,`$$events`,`$$legacy`]);function m_(e,t){let n=U(t,p_),r=[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`}]];G(e,V({name:`shield`},()=>n,{get iconNode(){return r}}))}var h_=new Set([`$$slots`,`$$events`,`$$legacy`]);function g_(e,t){let n=U(t,h_),r=[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`}]];G(e,V({name:`zap`},()=>n,{get iconNode(){return r}}))}var __=P(`<!> <!>`,1);function v_(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=K(t,`class`,3,``),i=K(t,`triggerClass`,3,``),a=K(t,`size`,3,`xl`),o=K(t,`side`,3,`bottom`),s=K(t,`align`,3,`end`),c=K(t,`sideOffset`,3,7),u=K(t,`collisionPadding`,3,8),f=K(t,`trapFocus`,3,!0);function p(e){n(e),t.onOpenChange?.(e)}var m=_();d(F(m),()=>zc,(e,m)=>{m(e,{onOpenChange:p,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var p=__(),m=F(p);{let e=l(()=>I(`popover-trigger`,i()));d(m,()=>gc,(n,r)=>{r(n,{get class(){return L(e)},get"aria-label"(){return t.ariaLabel},get title(){return t.triggerTitle},get"aria-keyshortcuts"(){return t.triggerAriaKeyShortcuts},children:(e,n)=>{var r=_();h(F(r),()=>t.trigger??N),q(e,r)},$$slots:{default:!0}})})}d(Y(m,2),()=>Wt,(e,n)=>{n(e,{children:(e,n)=>{var i=_(),p=F(i);{let e=l(()=>I(`popover-content`,`popover-${a()}`,r()));d(p,()=>pc,(n,r)=>{r(n,{get class(){return L(e)},get side(){return o()},get align(){return s()},get sideOffset(){return c()},get collisionPadding(){return u()},get trapFocus(){return f()},children:(e,n)=>{var r=__(),i=F(r);h(i,()=>t.children??N),d(Y(i,2),()=>vc,(e,t)=>{t(e,{class:`popover-arrow`,width:9,height:5})}),q(e,r)},$$slots:{default:!0}})})}q(e,i)},$$slots:{default:!0}})}),q(e,p)},$$slots:{default:!0}})}),q(e,m),H()}var y_=P(`<div><!></div>`);function b_(e,t){x(t,!0);var n=y_();h(B(n),()=>t.children??N),y(n),J(e=>w(n,1,e),[()=>_e(I(`grid gap-3 p-3 text-xs`,t.class))]),q(e,n),H()}var x_=P(`<span class="flex-none text-xs text-muted-foreground"> </span>`),S_=P(`<div><strong class="text-sm font-semibold"> </strong> <!></div>`);function C_(e,t){x(t,!0);var n=S_(),r=B(n),i=B(r,!0);y(r);var a=Y(r,2),o=e=>{var n=_();h(F(n),()=>t.action),q(e,n)},s=e=>{var n=x_(),r=B(n,!0);y(n),J(()=>f(r,t.meta)),q(e,n)};p(a,e=>{t.action?e(o):t.meta&&e(s,1)}),y(n),J(e=>{w(n,1,e),f(i,t.title)},[()=>_e(I(`flex items-baseline justify-between gap-3`,t.class))]),q(e,n),H()}var w_=P(`<span class="text-xs text-muted-foreground"> </span>`),T_=P(`<div class="flex items-baseline justify-between gap-3"><!> <!></div>`),E_=P(`<div><!> <!></div>`);function D_(e,t){x(t,!0);let n=K(t,`separated`,3,!1);var r=E_(),i=B(r),a=e=>{var n=T_(),r=B(n),i=e=>{var n=w_(),r=B(n,!0);y(n),J(()=>f(r,t.label)),q(e,n)};p(r,e=>{t.label&&e(i)});var a=Y(r,2),o=e=>{var n=_();h(F(n),()=>t.action),q(e,n)};p(a,e=>{t.action&&e(o)}),y(n),q(e,n)};p(i,e=>{(t.label||t.action)&&e(a)}),h(Y(i,2),()=>t.children??N),y(r),J(e=>w(r,1,e),[()=>_e(I(`grid gap-1.5`,n()&&`border-t border-border/60 pt-3`,t.class))]),q(e,r),H()}var O_=P(`<span class="truncate text-xs text-muted-foreground"> </span>`),k_=P(`<button type="button"><!> <span class="grid min-w-0 flex-1 gap-0.5"><span class="truncate text-xs font-medium text-foreground"> </span> <!></span> <!> <!></button>`);function A_(e,t){x(t,!0);let n=K(t,`selected`,3,!1),r=K(t,`disabled`,3,!1);var i=k_(),a=B(i);h(a,()=>t.icon??N);var o=Y(a,2),s=B(o),c=B(s,!0);y(s);var l=Y(s,2),u=e=>{var n=O_(),r=B(n,!0);y(n),J(()=>f(r,t.detail)),q(e,n)},d=e=>{var n=_();h(F(n),()=>t.detail),q(e,n)};p(l,e=>{typeof t.detail==`string`?e(u):t.detail&&e(d,1)}),y(o);var m=Y(o,2);h(m,()=>t.trailing??N);var g=Y(m,2),v=e=>{oi(e,{class:`size-3.5 flex-none text-primary`,"aria-hidden":`true`})};p(g,e=>{n()&&e(v)}),y(i),J(e=>{i.disabled=r(),A(i,`title`,t.title),A(i,`aria-pressed`,n()),w(i,1,e),f(c,t.label)},[()=>_e(I(`flex w-full items-center gap-2.5 rounded-md border border-border bg-transparent px-2 py-2 text-left transition-colors hover:bg-accent disabled:pointer-events-none disabled:opacity-55`,n()&&`bg-accent`,t.class))]),le(`click`,i,function(...e){t.onclick?.apply(this,e)}),q(e,i),H()}r([`click`]);var j_=P(`<dl><!></dl>`);function M_(e,t){x(t,!0);var n=j_();h(B(n),()=>t.children??N),y(n),J(e=>w(n,1,e),[()=>_e(I(`grid gap-1.5 text-xs`,t.class))]),q(e,n),H()}var N_=P(`<div class="flex items-center justify-between gap-4"><dt class="flex-none text-muted-foreground"> </dt> <dd><!></dd></div>`);function P_(e,t){x(t,!0);var n=N_(),r=B(n),i=B(r,!0);y(r);var a=Y(r,2),o=B(a),s=e=>{var n=_();h(F(n),()=>t.children),q(e,n)},c=e=>{var n=D();J(()=>f(n,t.value??`—`)),q(e,n)};p(o,e=>{t.children?e(s):e(c,-1)}),y(a),y(n),J(e=>{f(i,t.label),w(a,1,e),A(a,`title`,t.title)},[()=>_e(I(`min-w-0 truncate tabular-nums text-foreground`,t.valueClass))]),q(e,n),H()}var F_=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`checked`,`size`]);function I_(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=K(t,`checked`,15,!1),i=K(t,`size`,3,`default`),a=U(t,F_);var o=_(),s=F(o);{let e=l(()=>I(`data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent shadow-xs focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] data-[size=settings]:h-4 data-[size=settings]:w-7 data-[size=settings]:p-0.5 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50`,t.class));d(s,()=>ml,(t,o)=>{o(t,V({"data-slot":`switch`,get"data-size"(){return i()},get class(){return L(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)},get checked(){return r()},set checked(e){r(e)},children:(e,t)=>{var n=_();d(F(n),()=>_l,(e,t)=>{t(e,{"data-slot":`switch-thumb`,class:`bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=settings]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=settings]/switch:data-checked:translate-x-3 group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 group-data-[size=settings]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform rtl:data-[state=checked]:translate-x-[calc(-100%)]`})}),q(e,n)},$$slots:{default:!0}}))})}q(e,o),H()}var L_=P(`<span> </span>`),R_=P(`<small class="text-xs text-muted-foreground"> </small>`),z_=P(`<label><span class="grid min-w-0 gap-0.5"><!> <!></span> <!></label>`);function B_(e,t){x(t,!0);let n=K(t,`checked`,15,!1),r=K(t,`disabled`,3,!1),i=K(t,`class`,3,``);function a(e){n(e),t.onCheckedChange?.(e)}var o=z_(),s=B(o),c=B(s),l=e=>{var n=L_(),r=B(n,!0);y(n),J(()=>f(r,t.label)),q(e,n)};p(c,e=>{t.label&&e(l)});var u=Y(c,2),d=e=>{var n=R_(),r=B(n,!0);y(n),J(()=>f(r,t.description)),q(e,n)};p(u,e=>{t.description&&e(d)}),y(s),I_(Y(s,2),{get disabled(){return r()},size:`settings`,onCheckedChange:a,get"aria-label"(){return t.label},get checked(){return n()},set checked(e){n(e)}}),y(o),J(e=>w(o,1,e),[()=>_e(I(`flex items-center justify-between gap-3 text-sm text-foreground`,i()))]),q(e,o),H()}var V_=new Set([`$$slots`,`$$events`,`$$legacy`]);function H_(e,t){let n=U(t,V_),r=[[`path`,{d:`m21 21-4.34-4.34`}],[`circle`,{cx:`11`,cy:`11`,r:`8`}]];G(e,V({name:`search`},()=>n,{get iconNode(){return r}}))}var U_=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`type`,`files`,`class`,`size`,`ariaLabel`,`data-slot`]),W_=P(`<input/>`);function G_(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=K(t,`value`,15),i=K(t,`files`,15),a=K(t,`size`,3,`default`),o=K(t,`data-slot`,3,`input`),s=U(t,U_),u=l(()=>a()===`xs`?`h-7 px-2 text-xs md:text-xs`:a()===`sm`?`h-8`:`h-9`);var d=_(),f=F(d),m=e=>{var a=W_();c(a,e=>({"data-slot":o(),"aria-label":t.ariaLabel,class:e,type:`file`,...s}),[()=>I(`dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,L(u),t.class)],void 0,void 0,void 0,!0),ie(a,e=>n(e),()=>n()),Fe(a,i),ae(a,r),q(e,a)},h=e=>{var i=W_();c(i,e=>({"data-slot":o(),"aria-label":t.ariaLabel,class:e,type:t.type,...s}),[()=>I(`dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,L(u),t.class)],void 0,void 0,void 0,!0),ie(i,e=>n(e),()=>n()),ae(i,r),q(e,i)};p(f,e=>{t.type===`file`?e(m):e(h,-1)}),q(e,d),H()}var K_=P(`<div><div class="relative min-w-0 flex-1"><!> <!> <!></div> <!></div>`);function q_(e,t){x(t,!0);let n=K(t,`value`,15,``),r=K(t,`placeholder`,3,`Search`),i=K(t,`ariaLabel`,3,`Search`),a=K(t,`size`,3,`xs`),o=K(t,`icon`,3,H_),s=K(t,`clearable`,3,!0),c=K(t,`disabled`,3,!1),u=K(t,`ref`,15,null);function f(e){n(e),t.onValueChange?.(e)}var m=K_(),g=B(m),v=B(g);{let e=l(()=>I(`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-muted-foreground`,c()&&`opacity-50`));d(v,o,(t,n)=>{n(t,{get class(){return L(e)},"aria-hidden":`true`})})}var b=Y(v,2);{let e=l(()=>I(`pl-7`,s()&&n()?`pr-7`:void 0,t.inputClass));G_(b,{get size(){return a()},get placeholder(){return r()},get ariaLabel(){return i()},get disabled(){return c()},type:`text`,get class(){return L(e)},oninput:e=>t.onValueChange?.(e.currentTarget.value),get ref(){return u()},set ref(e){u(e)},get value(){return n()},set value(e){n(e)}})}var S=Y(b,2),C=e=>{{let t=l(()=>`Clear ${i().toLowerCase()}`);W(e,{variant:`ghost`,size:`icon-xs`,class:`absolute top-1/2 right-0.5 -translate-y-1/2`,get ariaLabel(){return L(t)},get disabled(){return c()},onclick:()=>f(``),children:(e,t)=>{li(e,{class:`size-3.5`,"aria-hidden":`true`})},$$slots:{default:!0}})}};p(S,e=>{s()&&n()&&e(C)}),y(g);var T=Y(g,2),E=e=>{var n=_();h(F(n),()=>t.trailing),q(e,n)};p(T,e=>{t.trailing&&e(E)}),y(m),J(e=>w(m,1,e),[()=>_e(I(`flex min-w-0 items-center gap-2`,t.class))]),q(e,m),H()}function J_(e){let t=Fee(e);return e.map(e=>{let n=Oee(e),r=Aee(e.provider);return{key:Ki(e),model:e,displayName:n,contextualLabel:(t.get(n)??0)>1?`${r} / ${n}`:n,providerLabel:r,searchText:`${n} ${e.modelId} ${r} ${e.provider}`.toLowerCase()}}).sort((e,t)=>{let n=e.providerLabel.localeCompare(t.providerLabel),r=e.displayName.localeCompare(t.displayName);return n||r||e.key.localeCompare(t.key)})}function Y_(e,t,n=`all`){let r=t.trim().toLowerCase();return!r&&n===`all`?e:e.filter(e=>(n===`all`||e.model.provider===n)&&(!r||e.searchText.includes(r)))}function X_(e){let t=new Map;for(let n of e){let e=t.get(n.model.provider);e?e.count+=1:t.set(n.model.provider,{id:n.model.provider,label:n.providerLabel,count:1})}return[{id:`all`,label:`All`,count:e.length},...[...t.values()].sort((e,t)=>e.label.localeCompare(t.label))]}var Z_=P(`<span class="model-tab-suffix svelte-1u8q75"> </span>`),Q_=P(`<span class="model-tab-short-suffix svelte-1u8q75"> </span>`),$_=P(`<span data-tour-id="composer-model"><span class="model-tab-label svelte-1u8q75"> </span> <!> <!></span>`),ev=P(`<p class="text-muted-foreground"> </p>`),tv=P(` <span class="text-muted-foreground"> </span>`,1),nv=P(`<!> <!>`,1),rv=P(`<p class="text-muted-foreground">No models match.</p>`),iv=P(`<div class="grid gap-2"><!> <!></div>`);function av(e,t){x(t,!0);let n=K(t,`models`,19,()=>[]),r=K(t,`selectedModelKey`,3,``),i=K(t,`thinkingLevel`,3,`off`),a=K(t,`disabled`,3,!1),o=K(t,`emptyMessage`,3,`No models available. Configure a provider or adjust Scoped Models in Settings.`),s=X(!1),c=X(``),u=X(`all`),m=l(()=>J_(n())),h=l(()=>X_(L(m))),v=l(()=>Y_(L(m),n().length>10?L(c):``,n().length>10?L(u):`all`)),b=l(()=>n().find(e=>Ki(e)===r())),S={off:`No reasoning`,minimal:`Very brief reasoning`,low:`Light reasoning`,medium:`Moderate reasoning`,high:`Deep reasoning`,xhigh:`Extra-high reasoning`,max:`Maximum reasoning`};function C(e){return e===`off`?`Off`:e[0].toUpperCase()+e.slice(1)}function T(e){switch(e){case`minimal`:return`Mi`;case`low`:return`L`;case`medium`:return`M`;case`high`:return`H`;case`xhigh`:return`XH`;case`max`:return`Max`;default:return`Off`}}let E=l(()=>L(b)?.supportedThinkingLevels?.length?L(b).supportedThinkingLevels:[`off`]),k=l(()=>L(E).length>1),ee=l(()=>L(b)?Hee(L(b),n()):`Select model`),j=l(()=>L(k)&&i()!==`off`?C(i()):void 0),M=l(()=>L(k)&&i()!==`off`?T(i()):void 0),N=l(()=>`${L(j)?`${L(ee)} (${L(j)})`:L(ee)}${t.runtimeChangeHint?` · ${t.runtimeChangeHint}`:``}${t.shortcutLabel?` · Cycle thinking ${t.shortcutLabel}`:``}`);function te(e){R(s,a()?!1:e,!0),L(s)&&(R(c,``),R(u,`all`))}function ne(e){if(a())return;let n=Ki(e);n!==r()&&t.onModelChange?.(n)}function P(e){a()||e!==i()&&t.onThinkingLevelChange?.(e)}z(()=>{a()&&R(s,!1)}),v_(e,{get open(){return L(s)},onOpenChange:te,size:`lg`,triggerClass:`composer-tab model-tab`,ariaLabel:`Model and thinking level`,get triggerTitle(){return L(N)},side:`top`,align:`end`,sideOffset:9,trigger:e=>{var t=$_();let n;var r=B(t),i=B(r,!0);y(r);var o=Y(r,2),s=e=>{var t=Z_(),n=B(t);y(t),J(()=>f(n,`(${L(j)??``})`)),q(e,t)};p(o,e=>{L(j)&&e(s)});var c=Y(o,2),l=e=>{var t=Q_(),n=B(t);y(t),J(()=>f(n,`(${L(M)??``})`)),q(e,t)};p(c,e=>{L(M)&&e(l)}),y(t),J(()=>{n=w(t,1,`model-tab-inner svelte-1u8q75`,null,n,{disabled:a()}),A(t,`aria-disabled`,a()),f(i,L(ee))}),q(e,t)},children:(e,t)=>{b_(e,{children:(e,t)=>{var s=nv(),m=F(s);D_(m,{label:`Model`,children:(e,t)=>{var i=_(),s=F(i),m=e=>{var t=ev(),n=B(t,!0);y(t),J(()=>f(n,o())),q(e,t)},b=e=>{var t=iv(),i=B(t),o=e=>{var t=nv(),n=F(t);q_(n,{placeholder:`Search models`,ariaLabel:`Search models`,get value(){return L(c)},set value(e){R(c,e,!0)}});var r=Y(n,2),i=e=>{var t=_();d(F(t),()=>ii,(e,t)=>{t(e,{type:`single`,size:`xs`,spacing:1,variant:`outline`,get value(){return L(u)},"aria-label":`Filter by provider`,class:`flex-nowrap overflow-x-auto`,onValueChange:e=>{e&&R(u,e,!0)},children:(e,t)=>{var n=_();O(F(n),17,()=>L(h),e=>e.id,(e,t)=>{var n=_();d(F(n),()=>ai,(e,n)=>{n(e,{get value(){return L(t).id},class:`flex-none gap-1.5 text-xs`,children:(e,n)=>{g();var r=tv(),i=F(r),a=Y(i),o=B(a,!0);y(a),J(()=>{f(i,`${L(t).label??``} `),f(o,L(t).count)}),q(e,r)},$$slots:{default:!0}})}),q(e,n)}),q(e,n)},$$slots:{default:!0}})}),q(e,t)};p(r,e=>{L(h).length>2&&e(i)}),q(e,t)};p(i,e=>{n().length>10&&e(o)});var s=Y(i,2),m=e=>{q(e,rv())},b=e=>{Ka(e,{get items(){return L(v)},getKey:e=>e.key,estimateSize:()=>36,gap:6,paddingEnd:4,viewportClass:`max-h-[min(44vh,18rem)]`,viewportAriaLabel:`Available models`,row:(e,t)=>{let n=()=>t?.().item;{let t=l(()=>n().key===r());A_(e,{get label(){return n().contextualLabel},get selected(){return L(t)},get disabled(){return a()},onclick:()=>ne(n().model)})}},$$slots:{row:!0}})};p(s,e=>{L(v).length===0?e(m):e(b,-1)}),y(t),q(e,t)};p(s,e=>{n().length===0?e(m):e(b,-1)}),q(e,i)},$$slots:{default:!0}});var b=Y(m,2),x=e=>{D_(e,{label:`Thinking level`,separated:!0,children:(e,t)=>{var n=_();d(F(n),()=>ii,(e,t)=>{t(e,{type:`single`,size:`xs`,spacing:1,variant:`outline`,get value(){return i()},"aria-label":`Thinking level`,class:`flex-wrap justify-start`,onValueChange:e=>{e&&P(e)},children:(e,t)=>{var n=_();O(F(n),16,()=>L(E),e=>e,(e,t)=>{var n=_();d(F(n),()=>ai,(e,n)=>{n(e,{get value(){return t},class:`flex-none rounded-full text-xs data-[state=on]:text-primary`,get title(){return S[t]},get disabled(){return a()},children:(e,n)=>{g();var r=D();J(e=>f(r,e),[()=>C(t)]),q(e,r)},$$slots:{default:!0}})}),q(e,n)}),q(e,n)},$$slots:{default:!0}})}),q(e,n)},$$slots:{default:!0}})};p(b,e=>{L(k)&&e(x)}),q(e,s)},$$slots:{default:!0}})},$$slots:{trigger:!0,default:!0}}),H()}var ov=new Set([`$$slots`,`$$events`,`$$legacy`]);function sv(e,t){let n=U(t,ov),r=[[`path`,{d:`M12 22v-6`}],[`path`,{d:`M12 8V2`}],[`path`,{d:`M4 12H2`}],[`path`,{d:`M10 12H8`}],[`path`,{d:`M16 12h-2`}],[`path`,{d:`M22 12h-2`}],[`path`,{d:`m15 19-3-3-3 3`}],[`path`,{d:`m15 5-3 3-3-3`}]];G(e,V({name:`fold-vertical`},()=>n,{get iconNode(){return r}}))}var cv=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`max`,`value`]),lv=P(`<div data-slot="progress-indicator" class="bg-primary size-full flex-1 transition-all"></div>`);function uv(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=K(t,`max`,3,100),i=U(t,cv);var a=_(),o=F(a);{let e=l(()=>I(`bg-muted h-1.5 rounded-full relative flex w-full items-center overflow-x-hidden`,t.class));d(o,()=>Gc,(a,o)=>{o(a,V({"data-slot":`progress`,get class(){return L(e)},get value(){return t.value},get max(){return r()}},()=>i,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var i=lv();J(()=>u(i,`transform: translateX(-${100-100*(t.value??0)/(r()??1)}%)`)),q(e,i)},$$slots:{default:!0}}))})}q(e,a),H()}var dv=P(`<span aria-hidden="true"><span class="progress-ring-core size-2 rounded-full svelte-k86mvk"></span></span>`);function fv(e,t){x(t,!0);let n=K(t,`percent`,3,0),r=K(t,`tone`,3,`neutral`),i=l(()=>Math.min(100,Math.max(0,n()??0)));var a=dv();J(e=>{w(a,1,e,`svelte-k86mvk`),A(a,`data-tone`,r()),u(a,`--progress-ring-fill: ${L(i)}%;`)},[()=>_e(I(`progress-ring inline-grid size-3 flex-none place-items-center rounded-full`,t.class))]),q(e,a),H()}function pv(e){return e<1e3?e.toString():e<1e4?`${(e/1e3).toFixed(1)}k`:e<1e6?`${Math.round(e/1e3)}k`:e<1e7?`${(e/1e6).toFixed(1)}M`:`${Math.round(e/1e6)}M`}function mv(e){return e==null?`neutral`:e>90?`error`:e>70?`warning`:`neutral`}var hv=[{minutes:300,label:`Session`,abbreviation:`S`},{minutes:1440,label:`Daily`,abbreviation:`D`},{minutes:10080,label:`Weekly`,abbreviation:`W`},{minutes:720*60,label:`Monthly`,abbreviation:`M`},{minutes:365*24*60,label:`Annual`,abbreviation:`A`}];function gv(e,t){if(e==null||!Number.isFinite(e))return t;for(let t of hv)if(_v(e,t.minutes))return{label:t.label,abbreviation:t.abbreviation};return t}function _v(e,t){return e>=t*.95&&e<=t*1.05}function vv(e){if(e==null||!Number.isFinite(e)||e<0)return null;let t=Math.floor(e);if(t===0)return`0m`;let n=Math.floor(t/1440),r=Math.floor(t%1440/60),i=t%60,a=[];return n>0&&a.push(`${n}d`),r>0&&a.push(`${r}h`),i>0&&a.push(`${i}m`),a.join(` `)}function yv(e){if(!e)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:xv(t-Date.now())}function bv(e){return e==null||e<=0?null:xv(e*1e3)}function xv(e){return e<=0?null:vv(Math.floor(e/6e4))}var Sv=P(`<span class="context-usage-tab-inner inline-flex items-center gap-1 svelte-icoso1" data-tour-id="composer-context"><!> <span class="ctx-percent svelte-icoso1"> </span> <span class="ctx-window font-medium text-muted-foreground svelte-icoso1"> </span></span>`),Cv=P(`<span> </span>`),wv=P(`<p class="text-muted-foreground">Usage will be available after the next response.</p>`),Tv=P(`<!> <!>`,1),Ev=P(`<!> <!> <!>`,1),Dv=P(`<!> `,1),Ov=P(`<!> <!> <!> <!>`,1);function kv(e,t){x(t,!0);let n=K(t,`contextWindow`,3,0),r=K(t,`compacting`,3,!1),i=K(t,`compactDisabled`,3,!1),a=X(!1),o=X(!1),s=l(()=>n()||t.contextUsage?.contextWindow||0),c=l(()=>t.contextUsage?.tokens??null),u=l(()=>L(c)!=null&&L(s)>0?L(c)/L(s)*100:t.contextUsage?.percent??null),d=l(()=>L(u)==null?0:Math.max(0,Math.min(100,L(u)))),m=l(()=>L(c)!=null&&L(s)>0?Math.max(0,L(s)-L(c)):null),h=l(()=>mv(L(u))),g=l(()=>L(h)===`error`?`danger`:L(h)===`warning`?`warn`:`neutral`),_=l(()=>L(u)==null?`?%`:`${Math.round(L(u))}%`),v=l(()=>L(u)==null?`Usage unavailable`:`${L(_)} used`),b=l(()=>L(c)!=null&&L(s)>0?`Context: ${L(c).toLocaleString()} / ${L(s).toLocaleString()} tokens`:L(s)>0?`Context usage unknown / ${L(s).toLocaleString()} tokens`:`Context window unknown`),S=l(()=>L(s)>0?pv(L(s)):`—`),C=l(()=>r()||i()||!t.onCompact),T=l(()=>L(h)===`error`?`[&_[data-slot=progress-indicator]]:bg-destructive-solid`:L(h)===`warning`?`[&_[data-slot=progress-indicator]]:bg-warning`:``);function E(){L(C)||(R(a,!1),R(o,!0))}var D=Tv(),O=F(D),k=e=>{v_(e,{size:`md`,triggerClass:`composer-tab context-usage-tab`,ariaLabel:`Context usage`,get triggerTitle(){return L(b)},side:`top`,align:`end`,sideOffset:9,get open(){return L(a)},set open(e){R(a,e,!0)},trigger:e=>{var t=Sv(),n=B(t);fv(n,{get percent(){return L(d)},get tone(){return L(g)}});var r=Y(n,2),i=B(r,!0);y(r);var a=Y(r,2),o=B(a);y(a),y(t),J(()=>{A(t,`data-tone`,L(h)),f(i,L(_)),f(o,`/${L(S)??``}`)}),q(e,t)},children:(e,t)=>{b_(e,{children:(e,t)=>{var n=Ov(),i=F(n);C_(i,{title:`Context window`,action:e=>{var t=Cv(),n=B(t,!0);y(t),J(e=>{w(t,1,e,`svelte-icoso1`),f(n,L(v))},[()=>_e(I(`flex-none text-xs font-medium`,L(h)===`error`?`text-destructive`:L(h)===`warning`?`text-warning`:`text-foreground`))]),q(e,t)},$$slots:{action:!0}});var a=Y(i,2);D_(a,{children:(e,t)=>{var n=Tv(),r=F(n);{let e=l(()=>I(`h-1`,L(T))),t=l(()=>L(u)==null?`Context usage unavailable`:`${L(_)} of context window used`);uv(r,{get value(){return L(d)},get class(){return L(e)},get"aria-label"(){return L(t)}})}var i=Y(r,2),a=e=>{q(e,wv())};p(i,e=>{L(u)??e(a)}),q(e,n)},$$slots:{default:!0}});var o=Y(a,2);D_(o,{separated:!0,children:(e,t)=>{M_(e,{children:(e,t)=>{var n=Ev(),r=F(n);{let e=l(()=>L(c)==null?`Unavailable`:`${L(c).toLocaleString()} tokens`);P_(r,{label:`Used`,get value(){return L(e)}})}var i=Y(r,2);{let e=l(()=>L(m)==null?`Unavailable`:`${L(m).toLocaleString()} tokens`);P_(i,{label:`Remaining`,get value(){return L(e)}})}var a=Y(i,2);{let e=l(()=>L(s)>0?`${L(s).toLocaleString()} tokens`:`Unknown`);P_(a,{label:`Window`,get value(){return L(e)}})}q(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var g=Y(o,2);{let e=l(()=>r()?`Conversation compaction is in progress`:`Summarize earlier messages to reduce context usage`);W(g,{size:`xs`,variant:`outline`,class:`w-full`,get disabled(){return L(C)},get title(){return L(e)},onclick:E,children:(e,t)=>{var n=Dv(),i=F(n);sv(i,{});var a=Y(i);J(()=>f(a,` ${r()?`Compacting…`:`Compact context`}`)),q(e,n)},$$slots:{default:!0}})}q(e,n)},$$slots:{default:!0}})},$$slots:{trigger:!0,default:!0}})};p(O,e=>{(L(s)>0||L(u)!=null)&&e(k)}),Tr(Y(O,2),{title:`Compact conversation`,description:`This summarizes earlier messages to reduce context size. The full history stays available in the branch tree.`,confirmLabel:`Compact context`,onConfirm:()=>t.onCompact?.(),get open(){return L(o)},set open(e){R(o,e,!0)}}),q(e,D),H()}var Av=new Set([`$$slots`,`$$events`,`$$legacy`]);function jv(e,t){let n=U(t,Av),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}]];G(e,V({name:`circle`},()=>n,{get iconNode(){return r}}))}var Mv=P(`<p> </p>`),Nv=P(`<li><!> <span> </span></li>`),Pv=P(`<ul class="m-0 grid list-none gap-1.5 p-0" aria-label="Todo list"></ul>`);function Fv(e,t){x(t,!0);let n=K(t,`emptyLabel`,3,`No todos set.`),r=K(t,`dense`,3,!1),i=l(()=>r()?`text-xs`:`text-sm`),a=l(()=>r()?13:15);var o=_(),s=F(o),c=e=>{var t=Mv(),r=B(t,!0);y(t),J(()=>{w(t,1,`m-0 text-muted-foreground ${L(i)}`),f(r,n())}),q(e,t)},u=e=>{var n=Pv();O(n,23,()=>t.items,(e,t)=>`${e.todo}:${e.done}:${t}`,(e,t)=>{var n=Nv(),r=B(n),o=e=>{Ja(e,{get size(){return L(a)},strokeWidth:2.2,"aria-hidden":`true`,class:`mt-0.5 text-success`})},s=e=>{jv(e,{get size(){return L(a)},strokeWidth:2.2,"aria-hidden":`true`,class:`mt-0.5 text-muted-foreground`})};p(r,e=>{L(t).done?e(o):e(s,-1)});var c=Y(r,2);let l;var u=B(c,!0);y(c),y(n),J(()=>{w(n,1,`grid grid-cols-[auto_1fr] items-start gap-2 leading-normal ${L(i)} ${L(t).done?`text-muted-foreground`:`text-foreground`}`),l=w(c,1,`min-w-0 [overflow-wrap:anywhere]`,null,l,{"line-through":L(t).done}),f(u,L(t).todo)}),q(e,n)}),y(n),q(e,n)};p(s,e=>{t.items.length===0?e(c):e(u,-1)}),q(e,o),H()}var Iv=P(`<span class="todo-tab-inner svelte-1kjsgm3"><!> <span class="todo-count svelte-1kjsgm3"> </span></span>`),Lv=P(`<!> <!>`,1);function Rv(e,t){x(t,!0);let n=X(!1),r=l(()=>t.todos.length),i=l(()=>t.todos.filter(e=>e.done).length),a=l(()=>L(r)>0?L(i)/L(r)*100:0),o=l(()=>L(r)>0&&L(i)===L(r)),s=l(()=>`Todos: ${L(i)} of ${L(r)} complete`);var c=_(),u=F(c),d=e=>{v_(e,{size:`xl`,triggerClass:`composer-tab todo-progress-tab`,ariaLabel:`Todo progress`,get triggerTitle(){return L(s)},side:`top`,align:`end`,sideOffset:9,get open(){return L(n)},set open(e){R(n,e,!0)},trigger:e=>{var t=Iv(),n=B(t);{let e=l(()=>L(o)?`good`:`primary`);fv(n,{get percent(){return L(a)},get tone(){return L(e)}})}var s=Y(n,2),c=B(s);y(s),y(t),J(()=>f(c,`${L(i)??``}/${L(r)??``}`)),q(e,t)},children:(e,n)=>{b_(e,{class:`max-h-[min(48vh,20rem)] overflow-y-auto`,children:(e,n)=>{var a=Lv(),o=F(a);{let e=l(()=>`${L(i)}/${L(r)}`);C_(o,{title:`Todo list`,get meta(){return L(e)}})}Fv(Y(o,2),{get items(){return t.todos},dense:!0}),q(e,a)},$$slots:{default:!0}})},$$slots:{trigger:!0,default:!0}})};p(u,e=>{L(r)>0&&e(d)}),q(e,c),H()}var zv=P(`<span data-tour-id="composer-permission"><!></span>`),Bv=P(`<!> <!> <!>`,1),Vv=P(`<div class="composer-tabs svelte-11h85zl" data-tour-id="composer-controls"><!> <button type="button" class="composer-tab mode-tab svelte-11h85zl" data-tour-id="composer-mode"><span class="mode-tab-icon svelte-11h85zl" aria-hidden="true"><!></span> <span class="mode-tab-label svelte-11h85zl"> </span></button> <!> <!> <!></div>`);function Hv(e,t){x(t,!0);let n=K(t,`compacting`,3,!1),r=K(t,`compactDisabled`,3,!1),i=K(t,`todos`,19,()=>[]),a=l(()=>[{value:`read_only`,label:`Read only`,detail:`No writes or mutating commands`,icon:f_,iconClass:`text-muted-foreground`},{value:`supervised`,label:`Supervised`,detail:t.approvalPolicy.autoApproveReadOnly?`Ask before non-read tool calls`:`Ask before read and non-read tool calls`,icon:m_,iconClass:`text-muted-foreground`},{value:`autonomous`,label:`Autonomous`,detail:`Allow tool calls without approval`,icon:g_,iconClass:`text-warning`}]),o=l(()=>L(a).find(e=>e.value===t.permissionLevel)??L(a)[2]),s=X(!1);function c(e){e!==t.permissionLevel&&t.onPermissionChange?.(e),R(s,!1)}function u(e){t.onApprovalPolicyChange?.({...t.approvalPolicy,autoApproveReadOnly:e})}var m=Vv(),h=B(m);{let e=e=>{let n=l(()=>L(o).icon);var r=zv();let i;d(B(r),()=>L(n),(e,t)=>{t(e,{size:13,strokeWidth:2.2})}),y(r),J(()=>i=w(r,1,`permission-tab-inner svelte-11h85zl`,null,i,{disabled:t.controlsDisabled})),q(e,r)},n=l(()=>t.permissionShortcut?`Permission: ${L(o).label} (${t.permissionShortcut})`:`Permission: ${L(o).label}`);v_(h,{size:`lg`,triggerClass:`composer-tab w-7 p-0 max-sm:w-7.5`,ariaLabel:`Permission level`,get triggerTitle(){return L(n)},get triggerAriaKeyShortcuts(){return t.permissionShortcutAria},side:`top`,align:`start`,sideOffset:9,get open(){return L(s)},set open(e){R(s,e,!0)},trigger:e,children:(e,n)=>{b_(e,{children:(e,n)=>{var r=Bv(),i=F(r);C_(i,{title:`Permission level`});var o=Y(i,2);D_(o,{children:(e,n)=>{var r=_();O(F(r),17,()=>L(a),e=>e.value,(e,n)=>{let r=l(()=>L(n).icon);{let i=e=>{var t=_(),i=F(t);{let e=l(()=>`size-4 flex-none ${L(n).iconClass}`);d(i,()=>L(r),(t,n)=>{n(t,{get class(){return L(e)},strokeWidth:2.1,"aria-hidden":`true`})})}q(e,t)},a=l(()=>L(n).value===t.permissionLevel);A_(e,{get label(){return L(n).label},get detail(){return L(n).detail},get selected(){return L(a)},onclick:()=>c(L(n).value),icon:i,$$slots:{icon:!0}})}}),q(e,r)},$$slots:{default:!0}});var s=Y(o,2),f=e=>{D_(e,{separated:!0,children:(e,n)=>{B_(e,{get checked(){return t.approvalPolicy.autoApproveReadOnly},get disabled(){return t.controlsDisabled},label:`Auto-approve read-only tools`,description:`Allow read, grep, find, ls, todos, and task status/log/list without prompting.`,onCheckedChange:u})},$$slots:{default:!0}})};p(s,e=>{t.permissionLevel===`supervised`&&e(f)}),q(e,r)},$$slots:{default:!0}})},$$slots:{trigger:!0,default:!0}})}var g=Y(h,2),v=B(g),b=B(v),S=e=>{u_(e,{size:13,strokeWidth:2.2})},C=e=>{nf(e,{size:13,strokeWidth:2.2})};p(b,e=>{t.modePlanning?e(S):e(C,-1)}),y(v);var T=Y(v,2),E=B(T,!0);y(T),y(g);var D=Y(g,2);Rv(D,{get todos(){return i()}});var k=Y(D,2);kv(k,{get contextUsage(){return t.contextUsage},get contextWindow(){return t.contextWindow},get compacting(){return n()},get compactDisabled(){return r()},get onCompact(){return t.onCompact}}),av(Y(k,2),{get models(){return t.models},get selectedModelKey(){return t.selectedModelKey},get thinkingLevel(){return t.thinkingLevel},get disabled(){return t.modelDisabled},get onModelChange(){return t.onModelChange},get onThinkingLevelChange(){return t.onThinkingLevelChange},get runtimeChangeHint(){return t.runtimeChangeHint},get emptyMessage(){return t.modelEmptyMessage},get shortcutLabel(){return t.thinkingShortcut}}),y(m),J(()=>{g.disabled=t.modeDisabled,A(g,`title`,t.modeShortcut?`Mode: ${t.modeLabel} (${t.modeShortcut})`:`Mode: ${t.modeLabel} (click to switch)`),A(g,`aria-keyshortcuts`,t.modeShortcutAria),f(E,t.modeLabel)}),le(`click`,g,()=>t.onToggleMode?.()),q(e,m),H()}r([`click`]);var Uv=P(`<p class="flex items-center gap-1 text-xs text-muted-foreground"> </p>`);function Wv(e,t){x(t,!0);let n=l(()=>_r(t.model.text)),r=l(()=>xr(t.model.text)),i=l(()=>!!(t.model.disabled||t.model.compacting)),a=l(()=>t.model.editorDisabled??L(i)),o=l(()=>t.model.submitDisabled??!!(L(i)||L(n)&&t.model.sending)),s=l(()=>t.model.controlsDisabled??(L(i)||!!t.model.sending)),c=l(()=>t.model.mode===`planning`),u=l(()=>t.model.runtimeChangeHint??(t.model.sending?`Changes apply to the next model request`:void 0)),d=l(()=>t.model.placeholder??(L(i)?`Composer is unavailable right now`:t.model.sending?`Queue a prompt for the next agent turn`:`Ask the agent`)),m=l(()=>t.model.sendTitle??(L(n)?t.model.sending?`Wait for the current agent turn before running a command`:`Run command`:t.model.sending?`Queue prompt for the next agent turn`:`Send prompt`));function g(){L(o)||t.actions.onSubmit?.()}{let v=e=>{var n=_(),r=F(n),i=e=>{var n=_();h(F(n),()=>t.header),q(e,n)},a=e=>{var n=Uv(),r=B(n,!0);y(n),J(()=>f(r,t.model.hint)),q(e,n)};p(r,e=>{t.header?e(i):t.model.hint&&e(a,1)}),q(e,n)},b=e=>{{let n=l(()=>t.model.modeDisabled??L(i)),r=l(()=>t.model.modelDisabled??(L(i)||t.model.models.length===0)),a=l(()=>L(c)?`Planning`:`Coding`),o=l(()=>t.model.contextWindow??0),d=l(()=>L(i)||!t.actions.onCompact),f=l(()=>t.model.modelEmptyMessage??`No models available. Configure a provider in this host.`);Hv(e,{get controlsDisabled(){return L(s)},get modeDisabled(){return L(n)},get modelDisabled(){return L(r)},get modeLabel(){return L(a)},get modePlanning(){return L(c)},onToggleMode:()=>t.actions.onModeChange?.(L(c)?`coding`:`planning`),get permissionLevel(){return t.model.permissionLevel},get permissionShortcut(){return t.model.permissionShortcut},get permissionShortcutAria(){return t.model.permissionShortcutAria},get modeShortcut(){return t.model.modeShortcut},get modeShortcutAria(){return t.model.modeShortcutAria},get thinkingShortcut(){return t.model.thinkingShortcut},get approvalPolicy(){return t.model.approvalPolicy},get contextUsage(){return t.model.contextUsage},get contextWindow(){return L(o)},get compacting(){return t.model.compacting},get compactDisabled(){return L(d)},get onCompact(){return t.actions.onCompact},get todos(){return t.model.todos},get models(){return t.model.models},get selectedModelKey(){return t.model.selectedModelKey},get thinkingLevel(){return t.model.thinkingLevel},get runtimeChangeHint(){return L(u)},get modelEmptyMessage(){return L(f)},get onModelChange(){return t.actions.onModelChange},get onThinkingLevelChange(){return t.actions.onThinkingLevelChange},get onPermissionChange(){return t.actions.onPermissionChange},get onApprovalPolicyChange(){return t.actions.onApprovalPolicyChange}})}},x=e=>{{let n=l(()=>t.model.focusToken??0);i_(e,{get value(){return t.model.text},get disabled(){return L(a)},get placeholder(){return L(d)},get slashCompletions(){return t.model.slashCompletions},get fileCompletions(){return t.model.fileCompletions},get focusToken(){return L(n)},get onChange(){return t.actions.onComposerChange},onSubmit:g,get onPasteImage(){return t.actions.onPasteImage},get onDropFiles(){return t.actions.onDropFiles}})}},S=e=>{var n=_(),r=F(n),i=e=>{var n=_();h(F(n),()=>t.sendLeading),q(e,n)};p(r,e=>{t.sendLeading&&e(i)}),q(e,n)},C=l(()=>t.model.showStop??t.model.sending),w=l(()=>!t.actions.onAbort||t.model.stopping),T=l(()=>t.model.sendAriaLabel??(L(n)?`Run command`:`Send prompt`));c_(e,{get mode(){return t.model.mode},get commandMode(){return L(n)},get executableBlocks(){return L(r)},get pendingApproval(){return t.model.pendingApproval},get pendingQuestion(){return t.model.pendingQuestion},get pendingPlan(){return t.model.pendingPlan},get showStop(){return L(C)},get stopping(){return t.model.stopping},get stopDisabled(){return L(w)},get stopAriaLabel(){return t.model.stopAriaLabel},get stopShortcutAria(){return t.model.stopShortcutAria},get stopTitle(){return t.model.stopTitle},get submitDisabled(){return L(o)},get sendAriaLabel(){return L(T)},get sendTitle(){return L(m)},get onAbort(){return t.actions.onAbort},onSubmit:g,header:v,toolbar:b,editor:x,sendLeading:S,$$slots:{header:!0,toolbar:!0,editor:!0,sendLeading:!0}})}H()}var Gv=P(`<span>Latest</span> <!>`,1),Kv=P(`<div class="transcript svelte-10b0laq"><!></div> <!> <div><!></div> <div class="composer-wrap svelte-10b0laq"><!></div>`,1),qv=P(`<section class="conversation-pane svelte-10b0laq"><!></section>`);function Jv(e,t){x(t,!0);let n=K(t,`showScrollButton`,3,!1),r=K(t,`composerHeight`,3,0),i=K(t,`composerWrapRef`,15);var a=qv(),o=B(a),s=e=>{var a=Kv(),o=F(a);h(B(o),()=>t.transcript),y(o);var s=Y(o,2),c=e=>{var n=_();h(F(n),()=>t.announcer),q(e,n)};p(s,e=>{t.announcer&&e(c)});var d=Y(s,2);let f;var m=B(d);{let e=l(()=>n()&&r()>0?void 0:-1);W(m,{class:`rounded-full shadow-sm`,variant:`secondary`,size:`sm`,ariaLabel:`Scroll to latest`,title:`Scroll to latest`,get tabindex(){return L(e)},onclick:()=>t.onJumpToBottom?.(),children:(e,t)=>{var n=Gv();nt(Y(F(n),2),{size:15,strokeWidth:2.4,"aria-hidden":`true`}),q(e,n)},$$slots:{default:!0}})}y(d);var g=Y(d,2);h(B(g),()=>t.composer),y(g),ie(g,e=>i(e),()=>i()),J(()=>{f=w(d,1,`scroll-bottom-button-wrap rounded-full svelte-10b0laq`,null,f,{"is-visible":n()&&r()>0}),u(d,`bottom: ${r()+8}px;`),A(d,`aria-hidden`,!n()||r()<=0)}),q(e,a)},c=e=>{var n=_();h(F(n),()=>t.empty),q(e,n)};p(o,e=>{t.open?e(s):e(c,-1)}),y(a),q(e,a),H()}function Yv(e){return[...e??[]].sort().join(`\0`)}function Xv(e,t){if(!e||!e.active||!t.active)return;let n=t.pendingApprovalCount??0;if(n>0&&(n!==(e.pendingApprovalCount??0)||t.pendingApprovalId!==e.pendingApprovalId))return n===1?`1 approval required.`:`${n} approvals required.`;let r=t.pendingQuestionIds?.length??0;if(r>0&&Yv(t.pendingQuestionIds)!==Yv(e.pendingQuestionIds))return r===1?`Nerve is waiting for your answer.`:`${r} answers required.`;let i=t.pendingPlanReviewIds?.length??0;if(i>0&&Yv(t.pendingPlanReviewIds)!==Yv(e.pendingPlanReviewIds))return i===1?`A plan is ready for review.`:`${i} plans are ready for review.`;if(t.sending&&!e.sending)return`Nerve is responding.`;if(!t.sending&&e.sending)return`Response complete.`}var Zv=P(`<span> </span>`),Qv=P(`<div class="sr-only" role="status" aria-live="polite" aria-atomic="true"><!></div>`);function $v(e,t){x(t,!0);let n=X(``),r=X(0),i;z(()=>{let e={active:t.active,sending:t.sending,pendingApprovalId:t.pendingApprovalId,pendingApprovalCount:t.pendingApprovalCount,pendingQuestionIds:t.pendingQuestionIds,pendingPlanReviewIds:t.pendingPlanReviewIds},a=Xv(i,e);i=e,a&&(R(n,a,!0),R(r,L(r)+1))});var a=Qv();M(B(a),()=>L(r),e=>{var t=Zv(),r=B(t,!0);y(t),J(()=>f(r,L(n))),q(e,t)}),y(a),q(e,a),H()}var ey=ne(`<path d="M150 162L232 235L258 208L284 288L362 350"></path>`),ty=ne(`<path d="M150 162L222 226L246 194L272 300L296 262L362 350"></path>`),ny=ne(`<svg viewBox="120 120 272 272" fill="none" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M150 350V162"></path><path d="M362 350V162"></path><!></g></svg>`);function ry(e,t){let n=K(t,`compact`,3,!1);var r=ny(),i=B(r),a=Y(B(i),2),o=e=>{q(e,ey())},s=e=>{q(e,ty())};p(a,e=>{n()?e(o):e(s,-1)}),y(i),y(r),J(()=>{w(r,0,_e(t.class)),A(r,`role`,t.label?`img`:void 0),A(r,`aria-label`,t.label),A(r,`aria-hidden`,t.label?void 0:`true`),A(i,`stroke-width`,n()?32:28)}),q(e,r)}var iy=P(`<span><!></span>`);function ay(e,t){x(t,!0);var n=iy();ry(B(n),{compact:!0,get label(){return t.label}}),y(n),J(e=>w(n,1,e,`svelte-1mk3yeo`),[()=>_e(I(`nerve-badge inline-flex items-center justify-center rounded-lg bg-foreground text-background`,t.class))]),q(e,n),H()}var oy=P(`<p class="mt-4 text-xs font-medium uppercase tracking-widest text-muted-foreground">Workspace ready</p>`),sy=P(`<button type="button" class="group inline-flex h-9 cursor-pointer items-center gap-2 rounded-md border bg-card px-4 text-xs font-medium text-foreground shadow-sm transition-colors hover:border-primary/40 hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:opacity-50 @sm:text-sm"><!> <span> </span></button>`),cy=P(`<div class="mt-6 flex flex-wrap justify-center gap-2" role="group" aria-label="Conversation starters"></div>`),ly=P(`<div><!> <span class="truncate font-mono text-foreground"> </span></div>`),uy=P(`<div><!></div>`),dy=P(`<div class="@container relative flex h-full min-h-full items-center justify-center overflow-hidden p-6 text-center"><div><div><div aria-hidden="true"></div> <div aria-hidden="true"></div> <!></div> <!> <h2> </h2> <p class="mt-2 max-w-sm text-xs leading-relaxed text-muted-foreground @sm:text-sm"> </p> <!> <!> <!></div></div>`);function fy(e,t){x(t,!0);let n=K(t,`variant`,3,`conversation`),r=K(t,`starters`,19,()=>[]),i=K(t,`startersDisabled`,3,!1),a=l(()=>n()===`launchpad`);var o=dy(),s=B(o),c=B(s),u=B(c),m=Y(u,2),g=Y(m,2);{let e=l(()=>L(a)?`relative z-10 size-12`:`relative z-10 size-9`);ay(g,{get class(){return L(e)}})}y(c);var _=Y(c,2),v=e=>{q(e,oy())};p(_,e=>{L(a)&&e(v)});var b=Y(_,2),S=B(b,!0);y(b);var C=Y(b,2),T=B(C,!0);y(C);var E=Y(C,2),D=e=>{var n=cy();O(n,21,r,e=>e.id,(e,n)=>{let r=l(()=>L(n).icon);var a=sy(),o=B(a);d(o,()=>L(r),(e,t)=>{t(e,{class:`size-4 text-primary`,strokeWidth:2.2,"aria-hidden":`true`})});var s=Y(o,2),c=B(s,!0);y(s),y(a),J(()=>{a.disabled=i(),f(c,L(n).label)}),le(`click`,a,()=>t.onSelectStarter?.(L(n))),q(e,a)}),y(n),q(e,n)};p(E,e=>{r().length>0&&e(D)});var k=Y(E,2),ee=e=>{var n=ly(),i=B(n);Vr(i,{class:`size-3.5 shrink-0`,strokeWidth:2.2,"aria-hidden":`true`});var o=Y(i,2),s=B(o,!0);y(o),y(n),J(()=>{w(n,1,`${r().length>0||L(a)?`mt-4`:`mt-3`} inline-flex max-w-md items-center gap-1.5 rounded-full border bg-muted/60 px-3 py-1.5 text-xs text-muted-foreground`),A(n,`title`,t.projectPath),A(n,`aria-label`,t.projectPath?`Current project ${t.projectPath}`:`Current project ${t.projectLabel}`),f(s,t.projectLabel)}),q(e,n)};p(k,e=>{t.projectLabel&&e(ee)});var j=Y(k,2),M=e=>{var n=uy();h(B(n),()=>t.footer),y(n),J(()=>w(n,1,`${L(a)?`mt-6`:`mt-5`} flex flex-col items-center`)),q(e,n)};p(j,e=>{t.footer&&e(M)}),y(s),y(o),J(()=>{w(s,1,`brand-signal-enter relative flex w-full flex-col items-center ${L(a)?`max-w-3xl`:`max-w-2xl`}`),w(c,1,`relative flex items-center justify-center ${L(a)?`size-20`:`size-14`}`),w(u,1,`absolute rotate-6 rounded-2xl border bg-muted/50 ${L(a)?`size-16`:`size-12`}`),w(m,1,`absolute -rotate-6 rounded-2xl border border-border/70 bg-background ${L(a)?`size-14`:`size-10`}`),w(b,1,`${L(a)?`mt-2 text-lg @sm:text-xl`:`mt-4 text-lg @sm:text-xl`} font-normal tracking-tight text-foreground`),f(S,t.title),f(T,t.message)}),q(e,o),H()}r([`click`]);var py=new Set([`$$slots`,`$$events`,`$$legacy`]);function my(e,t){let n=U(t,py),r=[[`path`,{d:`M16 5H3`}],[`path`,{d:`M11 12H3`}],[`path`,{d:`M16 19H3`}],[`path`,{d:`M18 9v6`}],[`path`,{d:`M21 12h-6`}]];G(e,V({name:`list-plus`},()=>n,{get iconNode(){return r}}))}var hy=new Set([`$$slots`,`$$events`,`$$legacy`]);function gy(e,t){let n=U(t,hy),r=[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}],[`path`,{d:`m15 5 4 4`}]];G(e,V({name:`pencil`},()=>n,{get iconNode(){return r}}))}function _y(e,t){if(!e||e.isCollapsed||e.rangeCount===0)return;let n=e.toString();if(n.trim())try{for(let r=0;r<e.rangeCount;r+=1)if(e.getRangeAt(r).intersectsNode(t))return n}catch{}}var vy=P(`<div class="contents" role="presentation"><!></div>`);function yy(e,t){x(t,!0);let n=K(t,`disabled`,3,!1),r=X(void 0),i=l(()=>t.menu(t.target,L(r)));function a(e){R(r,_y(window.getSelection(),e.currentTarget),!0)}var o=vy();zr(B(o),{get items(){return L(i)},get triggerClass(){return t.triggerClass},get disabled(){return n()},children:(e,n)=>{var r=_();h(F(r),()=>t.children),q(e,r)},$$slots:{default:!0}}),y(o),le(`contextmenu`,o,a),q(e,o),H()}r([`contextmenu`]);var by=P(`<div> </div>`);function xy(e,t){x(t,!0);let n=K(t,`class`,3,``);var r=by(),i=B(r,!0);y(r),J(e=>{w(r,1,e),f(i,t.text)},[()=>_e(I(`min-w-0 max-w-full whitespace-pre-wrap break-words`,n()))]),q(e,r),H()}var Sy=P(`<span class="flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground"><!> Running…</span>`),Cy=P(`<span> </span>`),wy=P(`<pre class="min-w-0 font-mono text-xs leading-4 whitespace-pre-wrap break-words text-muted-foreground"> </pre>`),Ty=P(`<p class="font-mono text-xs italic text-muted-foreground">(no output)</p>`),Ey=P(`<div class="border-t border-border px-2.5 py-1.5"><!></div>`),Dy=P(`<div class="w-full min-w-0 overflow-hidden rounded-md border border-border bg-card text-card-foreground"><div class="flex items-start gap-2 px-2.5 py-1.5"><!> <pre class="min-w-0 flex-1 font-mono text-xs leading-5 whitespace-pre-wrap break-words"> </pre> <!></div> <!></div>`);function Oy(e,t){let n=K(t,`output`,3,``),r=l(()=>t.exitCode===0||t.exitCode===void 0&&t.status===`completed`),i=l(()=>t.exitCode===void 0?t.status??``:`exit ${t.exitCode}`);var a=Dy(),o=B(a),s=B(o);Ue(s,{size:14,strokeWidth:2,class:`mt-0.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`});var c=Y(s,2),u=B(c);y(c);var d=Y(c,2),m=e=>{var t=Sy();ke(B(t),{class:`size-3`,"aria-label":`Running command`}),g(),y(t),q(e,t)},h=e=>{var n=Cy(),a=B(n,!0);y(n),J(()=>{w(n,1,`shrink-0 font-mono text-xs leading-5 ${L(r)?`text-success`:`text-destructive`}`),A(n,`title`,t.status?`status: ${t.status}`:void 0),f(a,L(i))}),q(e,n)};p(d,e=>{t.phase===`running`?e(m):t.phase===`done`&&L(i)&&e(h,1)}),y(o);var _=Y(o,2),v=e=>{var t=Ey(),r=B(t),i=e=>{var t=wy(),r=B(t,!0);y(t),J(()=>f(r,n())),q(e,t)},a=e=>{q(e,Ty())};p(r,e=>{n()?e(i):e(a,-1)}),y(t),q(e,t)};p(_,e=>{t.phase===`done`&&e(v)}),y(a),J(()=>f(u,`$ ${t.command??``}`)),q(e,a)}var ky=`(no output)`;function Ay(e){let t=sr(e).map(e=>({start:e.start,end:e.end,segment:{kind:`command_result`,command:e.command,status:e.status,exitCode:e.exitCode,output:e.output===ky?``:e.output}})),n=ar(e).filter(e=>!t.some(t=>e.start<t.end&&e.end>t.start)).map(e=>({start:e.start,end:e.end,segment:{kind:`command_pending`,command:e.command}})),r=[...t,...n].sort((e,t)=>e.start-t.start);if(r.length===0)return[{kind:`text`,text:e}];let i=[],a=0;for(let t of r)jy(i,e.slice(a,t.start)),i.push(t.segment),a=t.end;return jy(i,e.slice(a)),i}function jy(e,t){let n=t.replace(/^\n+/,``).replace(/\n+$/,``);n.length>0&&e.push({kind:`text`,text:n})}var My=P(`<div class="flex min-w-0 flex-col gap-2"></div>`);function Ny(e,t){x(t,!0);let n=K(t,`pending`,3,!1),r=l(()=>Ay(t.text)),i=l(()=>L(r).length===1&&L(r)[0].kind===`text`);var a=_(),o=F(a),s=e=>{xy(e,{get text(){return t.text}})},c=e=>{var t=My();O(t,21,()=>L(r),Le,(e,t)=>{var r=_(),i=F(r),a=e=>{xy(e,{get text(){return L(t).text}})},o=e=>{Oy(e,{phase:`done`,get command(){return L(t).command},get status(){return L(t).status},get exitCode(){return L(t).exitCode},get output(){return L(t).output}})},s=e=>{{let r=l(()=>n()?`running`:`static`);Oy(e,{get phase(){return L(r)},get command(){return L(t).command}})}};p(i,e=>{L(t).kind===`text`?e(a):L(t).kind===`command_result`?e(o,1):e(s,-1)}),q(e,r)}),y(t),q(e,t)};p(o,e=>{L(i)?e(s):e(c,-1)}),q(e,a),H()}var Py=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function Fy(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=U(t,Py);var i=_();d(F(i),()=>Nl,(e,t)=>{t(e,V(()=>r,{get open(){return n()},set open(e){n(e)}}))}),q(e,i),H()}var Iy=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function Ly(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=U(t,Iy);var i=_();d(F(i),()=>Zee,(e,t)=>{t(e,V({"data-slot":`tooltip-trigger`},()=>r,{get ref(){return n()},set ref(e){n(e)}}))}),q(e,i),H()}var Ry=new Set([`$$slots`,`$$events`,`$$legacy`]);function zy(e,t){let n=U(t,Ry);var r=_();d(F(r),()=>Wt,(e,t)=>{t(e,V(()=>n))}),q(e,r)}var By=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`sideOffset`,`side`,`children`,`arrowClasses`,`portalProps`]),Vy=P(`<div></div>`),Hy=P(`<!> <!>`,1);function Uy(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=K(t,`sideOffset`,3,0),i=K(t,`side`,3,`top`),a=U(t,By);zy(e,V(()=>t.portalProps,{children:(e,o)=>{var s=_(),u=F(s);{let e=l(()=>I(`data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm border bg-popover text-popover-foreground shadow-md z-50 w-fit max-w-xs origin-(--bits-tooltip-content-transform-origin)`,t.class));d(u,()=>Jee,(o,s)=>{s(o,V({"data-slot":`tooltip-content`,get sideOffset(){return r()},get side(){return i()},get class(){return L(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=Hy(),i=F(r);h(i,()=>t.children??N);var a=Y(i,2);{let e=(e,n)=>{let r=()=>n?.().props;var i=Vy();c(i,e=>({class:e,...r()}),[()=>I(`size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] border-r border-b border-border bg-popover fill-popover z-50`,`data-[side=top]:translate-x-1/2 data-[side=top]:translate-y-[calc(-50%+2px)]`,`data-[side=bottom]:-translate-x-1/2 data-[side=bottom]:-translate-y-[calc(-50%+1px)]`,`data-[side=right]:translate-x-[calc(50%+2px)] data-[side=right]:translate-y-1/2`,`data-[side=left]:-translate-y-[calc(50%-3px)]`,t.arrowClasses)]),q(e,i)};d(a,()=>$ee,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}q(e,r)},$$slots:{default:!0}}))})}q(e,s)},$$slots:{default:!0}})),H()}var Wy=new Set([`$$slots`,`$$events`,`$$legacy`,`delayDuration`]);function Gy(e,t){let n=K(t,`delayDuration`,3,0),r=U(t,Wy);var i=_();d(F(i),()=>ete,(e,t)=>{t(e,V({get delayDuration(){return n()}},()=>r))}),q(e,i)}var Ky=P(`<!> <!>`,1),qy=P(`<article class="queued-prompt-card svelte-126i39" aria-label="Queued user prompt"><div class="queued-badge svelte-126i39" title="This prompt is queued for the next agent turn"><!> <span>Queued</span></div> <div class="queued-actions svelte-126i39" role="group" aria-label="Queued prompt actions"><!></div> <div class="queued-content svelte-126i39"><!></div></article>`);function Jy(e,t){x(t,!0);let n=X(void 0);async function r(e){if(!L(n)){R(n,e,!0);try{e===`edit`?await t.onMoveToComposer?.(t.prompt):await t.onDiscard?.(t.prompt)}catch{}finally{R(n,void 0)}}}let i=l(()=>({kind:`queued_prompt`,prompt:t.prompt,busy:!!L(n),canEdit:!!t.onMoveToComposer,canDiscard:!!t.onDiscard,onEdit:()=>void r(`edit`),onDiscard:()=>void r(`discard`)}));yy(e,{get target(){return L(i)},get menu(){return t.transcriptMenu},triggerClass:`block select-text`,children:(e,i)=>{var a=qy(),o=B(a);my(B(o),{size:13,strokeWidth:2.2,"aria-hidden":`true`}),g(2),y(o);var s=Y(o,2);d(B(s),()=>Gy,(e,i)=>{i(e,{delayDuration:300,disableHoverableContent:!0,children:(e,i)=>{var a=Ky(),o=F(a);d(o,()=>Fy,(e,i)=>{i(e,{children:(e,i)=>{var a=Ky(),o=F(a);{let e=(e,i)=>{let a=()=>i?.().props;{let i=l(()=>!t.onMoveToComposer||!!L(n));W(e,V(a,{variant:`ghost`,size:`icon-xs`,get disabled(){return L(i)},ariaLabel:`Cancel and edit queued prompt`,onclick:()=>void r(`edit`),children:(e,t)=>{gy(e,{"aria-hidden":`true`})},$$slots:{default:!0}}))}};d(o,()=>Ly,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}d(Y(o,2),()=>Uy,(e,t)=>{t(e,{sideOffset:4,children:(e,t)=>{g(),q(e,D(`Cancel & Edit`))},$$slots:{default:!0}})}),q(e,a)},$$slots:{default:!0}})}),d(Y(o,2),()=>Fy,(e,i)=>{i(e,{children:(e,i)=>{var a=Ky(),o=F(a);{let e=(e,i)=>{let a=()=>i?.().props;{let i=l(()=>!t.onDiscard||!!L(n));W(e,V(a,{variant:`ghost`,size:`icon-xs`,get disabled(){return L(i)},ariaLabel:`Discard queued prompt`,onclick:()=>void r(`discard`),children:(e,t)=>{Ya(e,{"aria-hidden":`true`})},$$slots:{default:!0}}))}};d(o,()=>Ly,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}d(Y(o,2),()=>Uy,(e,t)=>{t(e,{sideOffset:4,children:(e,t)=>{g(),q(e,D(`Discard`))},$$slots:{default:!0}})}),q(e,a)},$$slots:{default:!0}})}),q(e,a)},$$slots:{default:!0}})}),y(s);var c=Y(s,2);Ny(B(c),{get text(){return t.prompt.text}}),y(c),y(a),q(e,a)},$$slots:{default:!0}}),H()}var Yy=/(?:api[_-]?key|access[_-]?token|authorization|auth[_-]?token|bearer|cookie|credential|password|private[_-]?key|secret|session|token)/i,Xy=/^(?:bearer\s+\S+|(?:gh[opusr]|sk|pk)_[A-Za-z0-9_-]{16,}|[A-Za-z0-9+/=_-]{40,})$/i,Zy=24e3,Qy=12,$y=240;function eb(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function tb(e){if(typeof e!=`string`)return eb(e);try{return eb(JSON.parse(e))}catch{return{}}}function nb(e){try{return JSON.parse(`"${e}"`)}catch{return e.replaceAll(`\\n`,`
7
- `).replaceAll(`\\r`,`\r`).replaceAll(`\\t`,` `).replace(/\\(["\\/])/g,`$1`)}}function rb(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ib(e,t){let n=[],r=RegExp(`"${rb(t)}"\\s*:\\s*"`,`g`),i=r.exec(e);for(;i;){let t=``,a=!1,o=i.index+i[0].length;for(;o<e.length&&t.length<Zy;){let n=e[o];if(!a&&n===`"`)break;t+=n,a?a=!1:n===`\\`&&(a=!0),o+=1}n.push(nb(t)),i=r.exec(e)}return n}function ab(e,t){let n=-1,r=!1,i=!1,a=-1;for(let o=0;o<e.length;o+=1){let s=e[o];if(r){if(i)i=!1;else if(s===`\\`)i=!0;else if(s===`"`){if(r=!1,nb(e.slice(a,o))!==t)continue;let i=o+1;for(;/\s/.test(e[i]??``);)i+=1;if(e[i]!==`:`)continue;for(i+=1;/\s/.test(e[i]??``);)i+=1;if(e[i]===`[`){n=i;break}}continue}s===`"`&&(r=!0,a=o+1)}if(n<0)return[];let o=[],s=1,c=0,l=-1;r=!1,i=!1;for(let t=n+1;t<e.length;t+=1){let n=e[t];if(r){i?i=!1:n===`\\`?i=!0:n===`"`&&(r=!1);continue}if(n===`"`){r=!0;continue}if(n===`[`){s+=1;continue}if(n===`]`){if(--s,s===0)break;continue}if(n===`{`){c===0&&s===1&&(l=t),l>=0&&(c+=1);continue}if(n===`}`&&l>=0&&(--c,c===0&&(o.push(e.slice(l,Math.min(t+1,l+Zy))),l=-1,o.length>=Qy)))break}return l>=0&&o.length<Qy&&o.push(e.slice(l,Math.min(e.length,l+Zy))),o}function ob(e,t){let n=ib(e,t)[0];if(n!==void 0)return n;let r=e.match(RegExp(`"${rb(t)}"\\s*:\\s*(true|false|-?(?:\\d+\\.?\\d*|\\.\\d+))`));if(!r)return;if(r[1]===`true`)return!0;if(r[1]===`false`)return!1;let i=Number(r[1]);return Number.isFinite(i)?i:void 0}function sb(e){if(typeof e==`string`)return e;if(typeof e==`number`&&Number.isFinite(e))return String(e);if(typeof e==`boolean`)return e?`true`:`false`;if(e===null)return`null`;if(Array.isArray(e)){let t=e.filter(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`);return t.length===e.length?t.join(`, `):`${e.length} ${e.length===1?`item`:`items`}`}if(e&&typeof e==`object`){let t=Object.keys(e);return t.length>0?`fields: ${t.join(`, `)}`:`empty object`}}function cb(e){return Yy.test(e)}function lb(e){return Xy.test(e.trim())}function ub(e,t){if(cb(e))return`[redacted]`;let n=sb(t)??`[unavailable]`;return lb(n)?`[redacted]`:n}var db=class e{argsText;records;constructor(e={}){this.argsText=e.argsText??``;let t=eb(e.args),n=tb(this.argsText),r=tb(e.argsPreview);this.records=[t,n,r].filter(e=>Object.keys(e).length>0)}value(e){for(let t of this.records)if(Object.hasOwn(t,e))return t[e];return ob(this.argsText,e)}string(e){let t=this.value(e);return typeof t==`string`?t:void 0}strings(e){let t=this.value(e);if(Array.isArray(t)){let e=t.filter(e=>typeof e==`string`);return e.length>0?e:t.length===0?[]:void 0}let n=ib(this.argsText,e);return n.length>0?n:void 0}number(e){let t=this.value(e);return typeof t==`number`&&Number.isFinite(t)?t:void 0}boolean(e){let t=this.value(e);return typeof t==`boolean`?t:void 0}array(e){let t=this.value(e);return Array.isArray(t)?t:void 0}recordsArray(e){let t=this.array(e);if(t)return t.map(eb).filter(e=>Object.keys(e).length>0)}objectArraySources(t){for(let n of this.records){if(!Object.hasOwn(n,t))continue;let r=n[t];return Array.isArray(r)?r.slice(0,Qy).map(t=>new e({args:eb(t)})):[]}return ab(this.argsText,t).map(t=>new e({argsText:t}))}record(e){let t=this.value(e);if(!(!t||typeof t!=`object`||Array.isArray(t)))return t}objectKeys(e){return Object.keys(this.record(e)??{})}count(e){return this.array(e)?.length}selectorCount(...e){return e.reduce((e,t)=>{let n=this.value(t);return Array.isArray(n)?e+n.length:n==null||n===``?e:e+1},0)}nestedStrings(e){let t=[],n=r=>{if(Array.isArray(r)){for(let e of r)n(e);return}if(!r||typeof r!=`object`)return;let i=r;typeof i[e]==`string`&&t.push(i[e]);for(let e of Object.values(i))e&&typeof e==`object`&&n(e)};for(let e of this.records)n(e);return t.length>0?t:ib(this.argsText,e)}structuredEntries(e=Qy){let t=this.records[0]??this.records[1]??this.records[2];if(t)return Object.entries(t).slice(0,e).map(([e,t])=>{let n=ub(e,t);return{key:e,value:n.length>$y?`${n.slice(0,$y-1)}…`:n,redacted:n===`[redacted]`}});let n=Array.from(this.argsText.matchAll(/"([^"\\]{1,80})"\s*:/g),e=>e[1]);return[...new Set(n)].slice(0,e).map(e=>{let t=ub(e,ob(this.argsText,e));return{key:e,value:t,redacted:t===`[redacted]`}})}};function fb(e={}){return new db(e)}var pb=20;function mb(e,t,n,r){let i=hb(e.toolName);if(!i)return{kind:`generic`,toolName:e.toolName,args:[],result:[]};let a=bn(n),o=An(a?.details),s=Dn(a?.details),c=Bn.safeParse(a?.details),l=c.success?c.data:Sn(a?.details)??{},u=sn(a,n,r),d=gb(l.spaces,e=>Hn.parse(e)),f=gb(l.pages,e=>mr.parse(e)),p=gb(l.attachments,e=>jn.parse(e)),m=gb(l.outcomes,e=>zn.parse(e)),h=mr.safeParse(l.page),g=Hn.safeParse(l.space),_=jn.safeParse(l.attachment);return{kind:`confluence`,action:i,toolName:e.toolName,content:u,contentLineCount:o?.model?.displayedLines??vb(u),messageLines:yb(u),query:_n(l.query)??_n(t.query),cql:_n(l.cql)??_n(t.cql),pageId:_n(l.pageId)??(h.success?h.data.id:void 0)??_n(t.page_id),spaceId:_n(l.spaceId)??(g.success?g.data.id:void 0)??_n(t.space_id),spaceKey:_n(l.spaceKey)??(g.success?g.data.key:void 0)??_n(t.space_key),title:_n(l.title)??(h.success?h.data.title:void 0)??_n(t.title),status:_n(l.status)??_n(t.status),bodyFormat:_n(l.bodyFormat)??_n(t.body_format),spaces:d.slice(0,pb),space:g.success?g.data:d[0],spaceCount:_b(l.spaceCount)??(d.length>0?d.length:void 0),displayedSpaceCount:_b(l.displayedSpaceCount)??(d.length>0?Math.min(d.length,pb):void 0),pages:f.slice(0,pb),page:h.success?h.data:f[0],pageCount:_b(l.pageCount)??(f.length>0?f.length:void 0),displayedPageCount:_b(l.displayedPageCount)??(f.length>0?Math.min(f.length,pb):void 0),attachments:p.slice(0,pb),attachment:_.success?_.data:p[0],attachmentCount:_b(l.attachmentCount)??(p.length>0?p.length:void 0),displayedAttachmentCount:_b(l.displayedAttachmentCount)??(p.length>0?Math.min(p.length,pb):void 0),includedCounts:c.success?c.data.includedCounts:void 0,downloadDir:_n(l.downloadDir),manifestPath:_n(l.manifestPath),pagesJsonlPath:_n(l.pagesJsonlPath),inputPath:_n(l.inputPath)??_n(t.input_path),nextCursor:_n(l.nextCursor),outcomes:m.slice(0,pb),outcomeCount:_b(l.outcomeCount)??(m.length>0?m.length:void 0),displayedOutcomeCount:_b(l.displayedOutcomeCount)??(m.length>0?Math.min(m.length,pb):void 0),dryRun:typeof l.dryRun==`boolean`?l.dryRun:void 0,payload:l.payload,outputLimits:o,outputArtifacts:s}}function hb(e){switch(e){case`confluence_search_spaces`:return`search_spaces`;case`confluence_search_pages`:return`search_pages`;case`confluence_get_page`:return`get_page`;case`confluence_download_pages`:return`download_pages`;case`confluence_create_page`:return`create_page`;case`confluence_update_page`:return`update_page`;case`confluence_publish_pages`:return`publish_pages`;case`confluence_upload_attachment`:return`upload_attachment`;default:return}}function gb(e,t){return Array.isArray(e)?e.flatMap(e=>{try{return[t(e)]}catch{return[]}}):[]}function _b(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function vb(e){return e?e.length===0?0:e.split(`
8
- `).length:0}function yb(e){return e?e.split(`
9
- `).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith(`- `)).slice(0,8):[]}function bb(e){if(!e)return{updates:[]};let t=[],n=[];for(let r of e.split(/\r?\n/)){let e=r.trim();if(e){try{let n=Sn(JSON.parse(e));if(n.type===`explore_progress`&&typeof n.timestamp==`string`&&typeof n.phase==`string`&&typeof n.message==`string`){t.push({type:`explore_progress`,timestamp:n.timestamp,agentId:_n(n.agentId),taskIndex:typeof n.taskIndex==`number`?n.taskIndex:void 0,taskCount:typeof n.taskCount==`number`?n.taskCount:void 0,label:_n(n.label),model:_n(n.model),thinkingLevel:_n(n.thinkingLevel),phase:n.phase,message:n.message,report:In.safeParse(n.report).data});continue}}catch{}n.push(r)}}return{updates:t,fallback:n.length>0?n.join(`
10
- `):void 0}}var xb=new Set([`Final report received.`]);function Sb(e){return/\bcompleted\b/i.test(e)&&!/\b(?:failed|error)\b/i.test(e)}function Cb(e){if(!xb.has(e.message))switch(e.phase){case`tool_call`:return{text:e.message,mono:!1};case`tool_result`:return Sb(e.message)?void 0:{text:e.message,mono:!0};case`assistant`:return;case`completed`:case`failed`:return{text:e.message,mono:!1};case`started`:return e.agentId?{text:`Started.`,mono:!1}:void 0;case`queued`:return}}function wb(e){let t=e.updates.map(Cb).filter(e=>e!==void 0);return t.length>0?t.slice(-3):(e.status===`failed`||e.status===`aborted`)&&e.error?[{text:e.error,mono:!1}]:e.status===`completed`&&e.report?.summaryPreview?[{text:e.report.summaryPreview,mono:!1}]:[]}var Tb=new WeakMap;function Eb(e){let t=Tb.get(e);if(t)return t;let n=Db(e);return Tb.set(e,n),n}function Db(e){let t=e.reports,n=new Map,r=-1,i=0;for(let t of e.liveUpdates){if(typeof t.taskCount==`number`&&(i=Math.max(i,t.taskCount)),typeof t.taskIndex!=`number`)continue;r=Math.max(r,t.taskIndex);let e=n.get(t.taskIndex)??[];e.push(t),n.set(t.taskIndex,e)}let a=Math.max(i,t.length,r+1,+(e.liveUpdates.length>0||t.length>0)),o=[];for(let r=0;r<a;r+=1){let i=n.get(r)??[],s=i.findLast(e=>e.report)?.report,c=t[r]??s,l=i[i.length-1],u=i.map(Cb).filter(e=>e!==void 0).slice(-3),d=u[u.length-1],f=i.find(e=>e.phase===`failed`),p;p=c?.status===`aborted`?`aborted`:c?.status===`failed`?`failed`:c?.status===`completed`||c||i.some(e=>e.phase===`completed`)?`completed`:f?`failed`:i.some(e=>[`started`,`tool_call`,`tool_result`,`assistant`].includes(e.phase))?`running`:`queued`;let m=p===`running`?d:void 0,h=c?.model??i.find(e=>e.model)?.model??l?.model,g=c?.thinkingLevel??i.find(e=>e.thinkingLevel)?.thinkingLevel??l?.thinkingLevel,_=c?.errorMessage??c?.summaryPreview??f?.message;o.push({key:`task-${r}`,index:r,count:a||void 0,label:c?.label??l?.label,task:c?.task??e.task,agentId:c?.agentId??l?.agentId,model:h,thinkingLevel:g,status:p,revision:`${l?.timestamp??`stored`}:${c?.status??`live`}`,currentAction:m?.text,currentActionMono:m?.mono??!1,recentActions:p===`running`?u:[],recentMessages:wb({status:p,report:c,error:_,updates:i}),actionCount:i.filter(e=>e.phase===`tool_call`).length,report:c,error:_})}let s=o.filter(e=>e.status===`completed`).length,c=o.filter(e=>e.status===`failed`).length,l=o.filter(e=>e.status===`aborted`).length;return{tasks:o,summary:{total:a,completed:s,failed:c,aborted:l,running:o.filter(e=>e.status===`running`||e.status===`queued`).length,totalTurns:o.reduce((e,t)=>e+(t.report?.usage?.turns??0),0),totalTokens:o.reduce((e,t)=>{let n=t.report?.usage;return e+(n?n.totalTokens||n.input+n.output:0)},0),done:a>0&&s+c+l===a}}}var Ob=20,kb=20,Ab=300;function jb(e,t,n,r){let i=Mb(e.toolName);if(!i)return{kind:`generic`,toolName:e.toolName,args:[],result:[]};let a=bn(n),o=An(a?.details),s=Dn(a?.details),c=Kb(a?.details),l=sn(a,n,r),u=_n(c.projectKey)??_n(t.project_key),d=Vb(c.issue),f=Yb(l).slice(0,Ob),p=d??(i===`get_issue`?f[0]:void 0),m=qb(c.issues,Vb).slice(0,Ob),h=m.length>0?m:f,g=Xb(l).slice(0,Ob),_=qb(c.transitions,Ub).slice(0,Ob),v=_.length>0?_:g,y=qb(c.users,Wb).slice(0,Ob),b=qb(c.fields,Gb).slice(0,kb),x=$b(c.includedCounts,l),S=Ib(c.updatedFields).filter(e=>typeof e==`string`).slice(0,kb);return{kind:`jira`,action:i,toolName:e.toolName,content:l,contentLineCount:Fb(l,e,`lines`,`head`,o),messageLines:Qb(l),query:_n(c.query)??_n(t.query),jql:_n(c.jql)??_n(t.jql),issueKey:_n(c.issueKey)??p?.key??_n(t.issue_key)??_n(t.parent_key),projectKey:u,issueType:_n(c.issueType)??_n(t.issue_type),summary:Rb(_n(c.summary)??_n(t.summary)),issue:p,issues:h,issueCount:Lb(c.issueCount)??(h.length>0?h.length:void 0),displayedIssueCount:Lb(c.displayedIssueCount)??(h.length>0?h.length:void 0),total:Lb(c.total),nextPageToken:_n(c.nextPageToken),users:y,userCount:Lb(c.userCount)??(y.length>0?y.length:void 0),displayedUserCount:Lb(c.displayedUserCount)??(y.length>0?y.length:void 0),project:Hb(c.project,u),includedCounts:x,dryRun:typeof c.dryRun==`boolean`?c.dryRun:void 0,resolvedAssignee:Wb(c.resolvedAssignee),updatedFields:S,updatedFieldCount:Lb(c.updatedFieldCount)??(S.length>0?S.length:void 0),commentId:_n(c.commentId),transition:Ub(c.transition),transitions:v,fields:b,payload:c.payload,fieldCount:Lb(c.fieldCount)??(b.length>0?b.length:void 0),displayedFieldCount:Lb(c.displayedFieldCount)??(b.length>0?b.length:void 0),transitionCount:Lb(c.transitionCount)??(v.length>0?v.length:void 0),displayedTransitionCount:Lb(c.displayedTransitionCount)??(v.length>0?v.length:void 0),outputLimits:o,outputArtifacts:s}}function Mb(e){switch(e){case`jira_search_users`:return`search_users`;case`jira_search_issues`:return`search_issues`;case`jira_get_issue`:return`get_issue`;case`jira_get_project`:return`get_project`;case`jira_create_issue`:return`create_issue`;case`jira_update_issue`:return`update_issue`;case`jira_add_comment`:return`add_comment`;case`jira_transition_issue`:return`transition_issue`;default:return}}function Nb(e){return e?e.length===0?0:e.split(`
11
- `).length:0}function Pb(e,t,n){let r=`previewOverflow`in e?e.previewOverflow:void 0;return!r||r.noun!==t||n&&r.direction!==n?0:r.hidden}function Fb(e,t,n,r,i){return i?.model?.displayedLines??Nb(e)+Pb(t,n,r)}function Ib(e){return Array.isArray(e)?e:[]}function Lb(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function Rb(e){if(e===void 0)return;let t=e.replace(/\s+/g,` `).trim();return t.length<=Ab?t:`${t.slice(0,Ab-1)}…`}function zb(e){return _n(Sn(e).name)}function Bb(e){return _n(Sn(e).displayName)??zb(e)}function Vb(e){let t=Ar.safeParse(e);if(t.success)return t.data;let n=Sn(e),r=Sn(n.fields),i=_n(n.key)??_n(n.id);if(i)return{key:i,id:_n(n.id),summary:Rb(_n(r.summary)),issueType:Rb(zb(r.issuetype)),status:Rb(zb(r.status)),statusCategory:Rb(_n(Sn(Sn(r.status).statusCategory).key)),assignee:Rb(Bb(r.assignee)),priority:Rb(zb(r.priority)),updated:Rb(_n(r.updated))}}function Hb(e,t){let n=Mn.safeParse(e);if(n.success)return n.data;let r=Sn(e),i=_n(r.key)??t??_n(r.id);return i?{key:i,id:_n(r.id),name:Rb(_n(r.name)),projectTypeKey:Rb(_n(r.projectTypeKey)),lead:Rb(Bb(r.lead))}:t?{key:t}:void 0}function Ub(e){let t=Fn.safeParse(e);if(t.success)return t.data;let n=Sn(e),r=_n(n.id);if(r)return{id:r,name:Rb(_n(n.name)),to:Rb(zb(n.to)??_n(n.to)),toStatusCategory:Rb(_n(Sn(Sn(n.to).statusCategory).key))}}function Wb(e){let t=qn.safeParse(e);if(t.success)return t.data;let n=Sn(e),r=_n(n.accountId);if(r)return{accountId:r,displayName:Rb(Bb(n)),emailAddress:Rb(_n(n.emailAddress)),active:typeof n.active==`boolean`?n.active:void 0,accountType:Rb(_n(n.accountType))}}function Gb(e){let t=Wn.safeParse(e);if(t.success)return t.data;let n=Sn(e),r=_n(n.id)??_n(n.key);if(r)return{id:r,name:Rb(_n(n.name)),key:Rb(_n(n.key)),required:typeof n.required==`boolean`?n.required:void 0,type:Rb(_n(n.type)),custom:typeof n.custom==`boolean`?n.custom:void 0}}function Kb(e){let t=Jn.safeParse(e);return t.success?t.data:Sn(e)}function qb(e,t){return Ib(e).flatMap(e=>{let n=t(e);return n?[n]:[]})}function Jb(e){return!!(e&&/^[A-Z][A-Z0-9]+-\d+$/.test(e))}function Yb(e){return e?e.split(/\r?\n/).flatMap(e=>{let t=e.trim();if(!t.startsWith(`- `))return[];let[n,...r]=t.slice(2).split(/\s+—\s+/),i=n.split(` · `).map(e=>e.trim()).filter(Boolean),a=i[0];if(!Jb(a))return[];let o,s,c,l;for(let e of i.slice(1))e.startsWith(`assignee: `)?l=e.slice(10):e.startsWith(`priority: `)?c=e.slice(10):o?s||=e:o=e;return[{key:a,issueType:Rb(o),status:Rb(s),priority:Rb(c),assignee:Rb(l),summary:Rb(r.join(` — `))}]}):[]}function Xb(e){return e?e.split(/\r?\n/).flatMap(e=>{let t=e.trim(),n=/^-\s+([^·]+?)\s+·\s+(.+?)(?:\s+→\s+(.+))?$/.exec(t);if(!n)return[];let r=n[1]?.trim();return!r||Jb(r)?[]:[{id:r,name:Rb(n[2]?.trim()),to:Rb(n[3]?.trim())}]}):[]}function Zb(e){if(!e)return;let t={};for(let n of e.split(/\r?\n/)){let e=/^(Comments|statuses|components|versions|issueTypes|fields|priorities|resolutions|Worklogs|Attachments|Remote links|Changelog entries|Edit fields):\s+(\d+)\s*$/i.exec(n.trim());if(!e)continue;let r=e[1].toLowerCase().replace(`remote links`,`remoteLinks`).replace(`changelog entries`,`changelog`).replace(`edit fields`,`editmetaFields`).replace(`issuetypes`,`issueTypes`);t[r===`comments`?`comments`:r]=Number(e[2])}return Object.keys(t).length>0?t:void 0}function Qb(e){return e?e.split(/\r?\n/).map(e=>e.trim()).filter(e=>!(!e||e.startsWith(`Raw JSON saved to:`)||e.startsWith(`Available transitions`)||e.startsWith(`- `))).slice(0,Ob):[]}function $b(e,t){let n=Sn(e),r={};for(let e of[`comments`,`transitions`,`statuses`,`components`,`versions`,`issueTypes`,`fields`,`priorities`,`resolutions`,`worklogs`,`changelog`,`remoteLinks`,`attachments`,`editmetaFields`]){let t=Lb(n[e]);t!==void 0&&(r[e]=t)}return Object.keys(r).length>0?r:Zb(t)}function ex(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function tx(e){let t=e.exitCode!==void 0||e.signal!==void 0||e.error!==void 0,n=!!(e.groupId||e.restartedFromTaskId);return{id:e.id,name:e.name,cwd:e.cwd,command:e.command,status:e.status,readiness:{outcome:e.readiness.outcome,readyUrl:e.readiness.readyUrl,readyOnUrl:e.readiness.readyOnUrl,matched:e.readiness.matched},timing:{startedAt:e.startedAt,finishedAt:e.finishedAt},termination:t?{exitCode:e.exitCode,signal:e.signal,error:e.error}:void 0,lineage:n?{groupId:e.groupId,restartedFromTaskId:e.restartedFromTaskId}:void 0}}function nx(e){let t=Cr.safeParse(e);if(t.success)return t.data;let n=er.safeParse(e);return n.success?tx(n.data):void 0}function rx(e){if(!Array.isArray(e))return{tasks:[],valid:!1};let t=[],n=!0;for(let r of e){let e=nx(r);e?t.push(e):n=!1}return{tasks:t,valid:n}}function ix(e){if(!Array.isArray(e))return{events:[],valid:!1};let t=[],n=!0;for(let r of e){let e=pr.safeParse(r);e.success?t.push(e.data):n=!1}return{events:t,valid:n}}function ax(e){let t=Er.safeParse(e);if(t.success)return{task:t.data.task,previewUnavailable:!1};let n=nx(ex(e).task);return{task:n,previewUnavailable:!n}}function ox(e){let t=or.safeParse(e);if(t.success)return{task:t.data.task,restartedFromTaskId:t.data.restartedFromTaskId,previewUnavailable:!1};let n=ex(e),r=nx(n.task),i=typeof n.restartedFromTaskId==`string`?n.restartedFromTaskId:r?.lineage?.restartedFromTaskId;return{task:r,restartedFromTaskId:i,previewUnavailable:!r||!i}}function sx(e){let t=Un.safeParse(e);if(t.success)return{tasks:t.data.outcomes.flatMap(e=>e.task?[e.task]:[]),outcomes:t.data.outcomes,previewUnavailable:!1};let n=ex(e),r=Array.isArray(n.tasks)?n.tasks:[];if(!Array.isArray(n.cancelResults))return{tasks:[],outcomes:[],previewUnavailable:!0};let i=[],a=!0;for(let e=0;e<n.cancelResults.length;e+=1){let t=Pn.safeParse(n.cancelResults[e]);if(!t.success){a=!1;continue}let o=r[e],s=o===void 0?void 0:nx(r[e]);o!==void 0&&!s&&(a=!1),i.push({task:s,outcome:t.data.outcome,status:t.data.status,message:t.data.message})}return{tasks:i.flatMap(e=>e.task?[e.task]:[]),outcomes:i,previewUnavailable:!a}}function cx(e){let t=yr.safeParse(e);if(t.success)return{tasks:t.data.tasks,previewUnavailable:!1};let n=rx(ex(e).tasks);return{tasks:n.tasks,previewUnavailable:!n.valid}}function lx(e){let t=yee.safeParse(e);if(t.success)return{task:t.data.task,events:t.data.events,nextCursor:t.data.nextCursor,mode:t.data.mode,previewUnavailable:!1};let n=ex(e),r=nx(n.task),i=ix(n.events),a=typeof n.nextCursor==`number`&&Number.isInteger(n.nextCursor)&&n.nextCursor>=0?n.nextCursor:void 0,o=typeof n.mode==`string`?n.mode:void 0;return{task:r,events:i.events,nextCursor:a,mode:o,previewUnavailable:!r||!i.valid||a===void 0||o===void 0}}function ux(e){return Array.isArray(e)?e:[]}function dx(e){return ux(e.replacements).length+ux(e.insertions).length+ux(e.lineReplacements).length+ux(e.lineInsertions).length+ +(typeof e.patch==`string`&&e.patch.length>0)}function fx(e,t,n){let r=`previewOverflow`in e?e.previewOverflow:void 0;return!r||r.noun!==t||n&&r.direction!==n?0:r.hidden}function px(e,t,n,r){return e+fx(t,n,r)}function mx(e){return e?.model?.displayedLines}function hx(e,t,n,r,i){return mx(i)??px(Cn(e),t,n,r)}var gx=new qa(300);function _x(e){if(e===void 0)return``;if(typeof e==`string`)return`s:${e.length}`;try{return`j:${JSON.stringify(e)?.length??0}`}catch{return`u`}}function vx(e,t){let n=e,r=`result`in e||`args`in e?`full`:`preview`,i=`previewOverflow`in e?e.previewOverflow:void 0;return[e.id,e.status,e.updatedAt,r,_x(n.argsPreview??n.args),_x(n.resultPreview??n.result),i?`${i.hidden}:${i.noun}:${i.direction}`:``,t?.updatedAt??``,t?.text.length??0].join(`\0`)}function yx(e,t){let n=vx(e,t),r=gx.get(n);if(r!==void 0)return r;let i=bx(e,t);return gx.set(n,i),i}function bx(e,t){let n=e,r=n.argsPreview??n.args,i=n.resultPreview??n.result,a=Sn(r),o=e.cwd,s=bn(i),c=An(s?.details),l=Dn(s?.details);switch(e.toolName){case`read`:{let t=gn(s?.path??_n(a.path),o),n=kn(t,o),r=s?.contentBlocks?.find(e=>e.type===`image`);if(r&&r.type===`image`)return{kind:`read`,path:t,relPath:n,image:{dataUrl:vn(r.mimeType,r.data),mimeType:r.mimeType},truncated:!1,outputLimits:c,outputArtifacts:l};let i=s?.content,u=typeof a.offset==`number`||typeof a.limit==`number`,d,f=i===void 0?void 0:hx(i,e,`lines`,`head`,c);if(f!==void 0)if(u&&typeof a.offset==`number`&&f>0){let e=a.offset;d=`lines ${e}–${e+f-1}`}else d=`${f} line${f===1?``:`s`}`;return{kind:`read`,path:t,relPath:n,lineLabel:d,lineCount:f,content:i,truncated:En(s?.details),outputLimits:c,outputArtifacts:l}}case`bash`:{let n=_n(a.command),r=hr.safeParse(s?.details),o=sn(s,i,t),u=hx(o,e,`lines`,`tail`,c);return{kind:`bash`,command:n,exitCode:s?.exitCode,signal:r.success?r.data.signal??void 0:void 0,backgroundTask:r.success&&r.data.execution?.disposition===`backgrounded`?{taskId:r.data.execution.taskId,status:r.data.execution.status,elapsedMs:r.data.execution.elapsedMs,terminalUpdate:r.data.execution.terminalUpdate}:void 0,output:o,outputLineCount:u,savedTo:r.success?r.data.fullOutputPath:void 0,truncated:En(s?.details),live:!s&&!!t?.text,outputLimits:t?.outputLimits?{...c,live:{...t.outputLimits}}:c,outputArtifacts:l}}case`python`:case`python_exec`:{let n=_n(a.code),r=_n(a.path),u=Yn.safeParse(s?.details),d=gn((u.success?u.data.scriptPath:void 0)??r,o),f=sn(s,i,t),p=n?px(Cn(n),e,`lines`,`head`):0,m=hx(f,e,`lines`,`tail`,c);return{kind:`python`,inputMode:u.success?u.data.inputMode??(d?`file`:`inline`):r?`file`:`inline`,code:n,codeLineCount:p,scriptPath:d,relScriptPath:kn(d,o),exitCode:s?.exitCode,signal:u.success?u.data.signal??void 0:void 0,output:f,outputLineCount:m,savedTo:u.success?u.data.fullOutputPath:void 0,truncated:En(s?.details),live:!s&&!!t?.text,allowNetwork:u.success?u.data.allowNetwork:void 0,allowFileWrite:u.success?u.data.allowFileWrite:void 0,durationMs:u.success?u.data.durationMs:void 0,timedOut:u.success?u.data.timedOut:void 0,timeoutKilled:u.success?u.data.timeoutKilled:void 0,envKeys:u.success?u.data.envKeys:void 0,artifactDir:u.success?u.data.artifactDir:void 0,artifacts:u.success?u.data.artifacts:void 0,streams:u.success?u.data.streams:void 0,outputLimits:t?.outputLimits?{...c,live:{...t.outputLimits}}:c,outputArtifacts:l}}case`edit`:{let t=gn(s?.path??_n(a.path),o),n=kn(t,o),r=Nn.safeParse(s?.details),i=r.success?r.data.operationCount:dx(a),c=r.success?r.data.diff:void 0,l=px(Cn(c),e,`lines`,`tail`),{additions:u,deletions:d}=pee(c);return{kind:`edit`,path:t,relPath:n,operationCount:i,additions:u,deletions:d,diff:c,diffLineCount:l,dryRun:r.success?r.data.dryRun:void 0}}case`write`:{let t=gn(s?.path??_n(a.path),o),n=kn(t,o),r=_n(a.content),i=s?.content?.match(/Wrote (\d+) bytes/);return{kind:`write`,path:t,relPath:n,bytes:i?Number(i[1]):void 0,lineCount:r===void 0?void 0:px(Cn(r),e,`lines`,`tail`),charCount:r?.length,content:r}}case`grep`:{let t=_n(a.pattern),n=gn(s?.path,o)??gn(_n(a.path)??`.`,o)??o,r=(s?.matches??[]).map(e=>dee({...e,openPath:gn(e.path,n)??e.path})),i=lee(r);return{kind:`grep`,pattern:t,matchCount:px(r.length,e,`matches`,`head`),fileCount:i.length,allMatches:i}}case`find`:{let t=_n(a.pattern),n=s?.entries??[],r=gn(s?.path,o)??gn(_n(a.path)??`.`,o)??o,i=n.map(e=>e.path);return{kind:`find`,pattern:t,paths:i,openPaths:n.map(e=>gn(e.path,r)??e.path),count:px(i.length,e,`files`,`head`)}}case`ls`:{let t=gn(s?.path??_n(a.path),o),n=kn(t,o)??`.`,r=(s?.entries??[]).map(e=>({...e,openPath:gn(e.path,t??o)??e.path}));return{kind:`ls`,path:t,relPath:n,entries:r,total:px(r.length,e,`entries`,`head`)}}case`ask_user`:{let e=Vn.safeParse(i),t=e.success?e.data:void 0;return{kind:`ask_user`,question:t?.question??_n(a.question),context:t?.context??_n(a.context),recommendation:t?.recommendation??_n(a.recommendation),answer:t?.response,dismissed:!!t?.dismissed,dismissedReason:t?.dismissedReason}}case`todos_set`:case`todos_get`:{let e=Ln.safeParse(i),t=(e.success?e.data.details?.todos:void 0)??hn(a.todos)??[];return{kind:`todos`,items:t,completed:t.filter(e=>e.done).length,total:t.length}}case`task_start`:return{kind:`task_action`,action:`start`,...ax(i),liveLog:t?.text};case`task_cancel`:{let n=sx(i),r=n.outcomes?.length??0;return{kind:`task_action`,action:`cancel`,task:n.tasks?.[0],...n,outcomeCount:r+fx(e,`tasks`,`head`),liveLog:t?.text}}case`task_restart`:return{kind:`task_action`,action:`restart`,...ox(i),liveLog:t?.text};case`task_status`:{let t=cx(i),n=fx(e,`tasks`,`head`);return{kind:`task_status`,...t,hiddenTaskCount:n,taskCount:t.tasks.length+n}}case`task_logs`:{let t=lx(i);return{kind:`task_logs`,...t,eventCount:px(t.events.length,e,`events`,`tail`)}}case`explore`:{let e=Rn.safeParse(i),n=e.success?e.data:void 0,r=_n(a.task),o=bb(t?.text);return{kind:`explore`,task:r,reports:n?.reports??[],liveUpdates:o.updates,liveLog:o.fallback}}case`plan_mode_enter`:{let e=_n(Sn(i).planDir);return{kind:`plan_mode`,action:`enter`,summary:wn(i),planPath:e}}case`plan_mode_present`:{let e=Sn(i),t=Sn(e.review),n=_n(t.planPath)??_n(a.file_path),r=_n(e.outcome)??_n(t.status);return{kind:`plan_mode`,action:`present`,summary:_n(e.feedback)??wn(i),planPath:n,outcome:r}}case`plan_mode_force_exit`:return{kind:`plan_mode`,action:`force_exit`,summary:_n(Sn(i).reason)};case`jira_search_users`:case`jira_search_issues`:case`jira_get_issue`:case`jira_get_project`:case`jira_create_issue`:case`jira_update_issue`:case`jira_add_comment`:case`jira_transition_issue`:return jb(e,a,i,t);case`confluence_search_spaces`:case`confluence_search_pages`:case`confluence_get_page`:case`confluence_download_pages`:case`confluence_create_page`:case`confluence_update_page`:case`confluence_publish_pages`:case`confluence_upload_attachment`:return mb(e,a,i,t);case`web_search`:{let e=Zn.safeParse(s?.details),t=e.success?e.data.query:_n(a.query),n=e.success?e.data.results:[];return{kind:`web_search`,query:t,answer:e.success?e.data.answer:void 0,results:n,outputLimits:c,outputArtifacts:l}}case`web_fetch`:{let e=Xn.safeParse(s?.details),t=e.success?e.data:void 0;return{kind:`web_fetch`,url:t?.url??_n(a.url),status:t?.status,contentType:t?.contentType,size:t?.size,savedTo:t?.savedTo,converted:t?.converted??!1,content:s?.content,outputLimits:c,outputArtifacts:l}}default:{let n=sn(s,i,t),a=n?ub(`result`,n).slice(0,6e3):void 0;return{kind:`generic`,toolName:e.toolName,args:fb({args:r}).structuredEntries(),result:fb({args:i}).structuredEntries(),resultText:a}}}}function xx(e){return e.split(/[\\/]/).pop()||e}function Sx(e){if(e===void 0)return;if(e<1024)return`${e} B`;let t=e/1024;return t<1024?`${t.toFixed(1)} KB`:`${(t/1024).toFixed(1)} MB`}function Cx(e){if(e!==void 0)return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function wx(e,t,n=`s`){return`${e} ${t}${e===1?``:n}`}function Tx(e){return Cn(e)}function Ex(e,t,n=`head`,r=6){let i=e-r;if(!(i<=0))return Dx(i,t,n)}function Dx(e,t,n=`head`){if(!(!e||e<=0))return{hidden:e,label:n===`mixed`?`Show complete tool call (${e} more ${t})`:`Show ${e} ${n===`tail`?`earlier`:`more`} ${t}`}}function Ox(e,t){switch(e.status){case`error`:case`denied`:return{tone:`danger`,pulse:!1};case`running`:case`requested`:return{tone:`running`,pulse:!0};case`pending_approval`:case`waiting_for_user`:return{tone:`warn`,pulse:!0};default:break}return(t.kind===`bash`||t.kind===`python`)&&t.exitCode!==void 0&&t.exitCode!==0||t.kind===`explore`&&Eb(t).summary.failed>0?{tone:`danger`,pulse:!1}:{tone:`good`,pulse:!1}}var kx=300,Ax=6e3;function jx(e){if(e===void 0)return;let t=e.replace(/\s+/g,` `).trim();return t.length<=kx?t:`${t.slice(0,kx-1)}…`}function Mx(e){if(e!==void 0)return e.length<=Ax?e:e.slice(-6e3)}function Nx(e,t,n={}){return{label:e,value:t,...n}}function Px(e,t,n={}){return t===void 0||t===``?[]:[{label:e,value:t,...n}]}function Fx(e){return e.boolean(`dry_run`)===!0?[{label:`Mode`,value:`dry run`,tone:`info`}]:[]}function Ix(e){let t=new Set,n=e.fields.flatMap(e=>t.has(e.label)?[]:(t.add(e.label),[{...e,value:jx(e.value)}])),r=e.text?{...e.text,text:Mx(e.text.text)}:void 0;return n.length===0&&!r?{kind:`none`}:{kind:`atlassian-draft`,fields:n,text:r}}function Lx(e){if(!(e===void 0||e.length===0))return e.replace(/\r\n/g,`
12
- `).replace(/\r/g,`
13
- `).split(`
14
- `).length}var Rx=()=>({kind:`none`});function zx(e={}){return{primaryArg:e.primaryArg,secondary:e.secondary??[],body:e.body??Rx(),safetyNotes:e.safetyNotes??[]}}var Bx=6,Vx=6e3;function Hx(e,t,n=`s`){return`${e} ${t}${e===1?``:n}`}function Ux(e){if(!e)return;let t=e.replace(/\r\n/g,`
15
- `).replace(/\r/g,`
16
- `),n=t.split(`
17
- `),r=n.length>Bx?n.slice(-Bx).join(`
18
- `):t;return r.length>Vx?r.slice(-6e3):r}function Wx(e){return e===void 0?void 0:e.length===0?0:e.split(/\r?\n/).length}function Gx(e,t,n=`path`,r){let i=e.string(n)??r;if(i)return{text:t&&sa(i,t)||i,openPath:i===`.`?void 0:t?aa(i,t):i}}function Kx(e,t){let n=e||t;if(n)return{text:n.length>500?`${n.slice(0,499)}…`:n}}function qx(e){if(e)return{text:e.length>500?`${e.slice(0,499)}…`:e,href:e}}function Jx(e,t,n={}){let r=Ux(e);return!r||!n.force&&!r.includes(`
19
- `)?{kind:`none`}:{kind:`code`,text:r,language:t,label:n.label,tail:!0}}function Yx(e){let t=e.flatMap(([e,t,n])=>t===void 0||t===``?[]:[{label:e,value:String(t),mono:n}]);return t.length>0?{kind:`key-values`,items:t}:{kind:`none`}}function Xx(e){let t=[],n=(e,n)=>{if(!(typeof e!=`string`||!e))for(let r of e.replace(/\r\n/g,`
20
- `).split(`
21
- `))t.push(`${n}${r}`)};for(let t of e.recordsArray(`replacements`)??[])n(t.oldText,`-`),n(t.newText,`+`);for(let t of e.recordsArray(`insertions`)??[])n(t.text,`+`);for(let t of e.recordsArray(`lineReplacements`)??[])n(t.newText,`+`);for(let t of e.recordsArray(`lineInsertions`)??[])n(t.text,`+`);let r=e.string(`patch`);if(r&&t.push(...r.replace(/\r\n/g,`
22
- `).split(`
23
- `)),t.length===0){let t=e.nestedStrings(`oldText`),r=e.nestedStrings(`newText`);t.forEach(e=>n(e,`-`)),r.forEach(e=>n(e,`+`))}return t}function Ene(e){return Ux(Xx(e).join(`
24
- `))}function Dne(e){let t=(e.count(`replacements`)??0)+(e.count(`insertions`)??0)+(e.count(`lineReplacements`)??0)+(e.count(`lineInsertions`)??0)+ +!!e.string(`patch`),n=0,r=0;for(let t of Xx(e))t.startsWith(`+`)&&!t.startsWith(`+++`)&&(n+=1),t.startsWith(`-`)&&!t.startsWith(`---`)&&(r+=1);return{operations:t,additions:n,deletions:r}}function Zx(e){return e}function One(e,t,n){let r=e.number(`offset`),i=e.number(`limit`),a=e.number(`byteOffset`),o=e.number(`byteLimit`),s=[];return a!==void 0||o!==void 0?s.push({text:`bytes ${a??0}${o===void 0?``:` +${o}`}`}):(r!==void 0||i!==void 0)&&s.push({text:`lines ${r??1}${i===void 0?``:` +${i}`}`}),zx({primaryArg:Gx(e,n),secondary:s,body:t===`approval`?Yx([[`Path`,e.string(`path`),!0],[`Line start`,r],[`Line limit`,i],[`Byte offset`,a],[`Byte limit`,o]]):void 0})}function kne(e){let t=e.string(`command`),n=Wx(t)??0,r=e.string(`cwd`),i=e.number(`timeout`);return zx({primaryArg:Kx(n<=1?t:void 0,t?`inline command`:`Command`),secondary:[...r?[{text:`cwd ${r}`,mono:!0}]:[],...i===void 0?[]:[{text:`timeout ${i}s`}]],body:Jx(t,`bash`,{force:(t?.length??0)>500,label:`Command`}),safetyNotes:[`Runs a Bash-compatible command in the selected working directory.`]})}function Ane(e,t,n){let r=e.string(`path`),i=e.string(`code`),a=Wx(i)??0,o=e.objectKeys(`env`),s=[],c=e.string(`cwd`);c&&s.push({text:`cwd ${c}`,mono:!0});let l=e.number(`timeout`);l!==void 0&&s.push({text:`timeout ${l}s`}),o.length>0&&s.push({text:Hx(o.length,`env key`)});let u=e.boolean(`allowFileWrite`)??e.boolean(`allow_file_write`);u===!1&&s.push({text:`writes off`,tone:`warning`});let d=Jx(i,`python`,{force:(i?.length??0)>500,label:`Python`});return zx({primaryArg:r?Gx(e,n):Kx(a<=1?i:void 0,i?`inline Python`:`Python`),secondary:s,body:d,safetyNotes:[u===!1?`File writes are disabled.`:`Python may write files unless the execution policy disables it.`,...o.length>0?[`Environment values are hidden; keys: ${o.join(`, `)}.`]:[]]})}function jne(e,t,n){let r=e.string(`content`),i=r===void 0?void 0:new TextEncoder().encode(r).length;return zx({primaryArg:Gx(e,n),secondary:[...i===void 0?[]:[{text:Hx(i,`byte`)}]],body:t!==`failed`&&r?{kind:`code`,text:Ux(r),language:`text`,tail:!0}:void 0,safetyNotes:[`Creates the file or overwrites it if it already exists.`]})}function Mne(e,t,n){let r=Dne(e),i=Ene(e),a=[];return r.operations>0&&a.push({text:Hx(r.operations,`operation`)}),r.additions>0&&a.push({text:`+${r.additions}`,tone:`success`}),r.deletions>0&&a.push({text:`-${r.deletions}`,tone:`error`}),e.boolean(`dryRun`)===!0&&a.push({text:`dry run`,tone:`info`}),zx({primaryArg:Gx(e,n),secondary:a,body:t!==`failed`&&i?{kind:`diff`,text:i,tail:!0}:void 0,safetyNotes:[e.boolean(`dryRun`)===!0?`Previews the edit without changing the file.`:`Applies the proposed changes to the existing file.`]})}var Nne={read:Zx({name:`read`,argumentRegion:`none`,completedView:`read`,present:One}),bash:Zx({name:`bash`,argumentRegion:`persistent`,completedView:`bash`,resultPlaceholder:{variant:`text`,rows:2},emptyResult:`No output`,present:kne}),python_exec:Zx({name:`python_exec`,argumentRegion:`persistent`,completedView:`python`,resultPlaceholder:{variant:`text`,rows:2},emptyResult:`No output`,present:Ane}),edit:Zx({name:`edit`,argumentRegion:`until-result`,completedView:`edit`,present:Mne}),write:Zx({name:`write`,argumentRegion:`until-result`,completedView:`write`,present:jne}),grep:Zx({name:`grep`,argumentRegion:`none`,completedView:`grep`,emptyResult:`No matches`,present:(e,t)=>{let n=e.strings(`paths`),r=n?.length?n.join(`, `):e.string(`path`),i=[];return r&&i.push({text:r,mono:!0}),e.string(`glob`)&&i.push({text:`glob ${e.string(`glob`)}`}),i.push({text:e.boolean(`literal`)?`literal`:`regex`}),e.boolean(`ignoreCase`)&&i.push({text:`ignore case`}),(e.number(`context`)??0)>0&&i.push({text:`context ${e.number(`context`)}`}),e.number(`limit`)!==void 0&&e.number(`limit`)!==100&&i.push({text:`max ${e.number(`limit`)}`}),zx({primaryArg:Kx(e.string(`pattern`),`Pattern`),secondary:i,body:t===`approval`?Yx([[`Scope`,r??`project root`,!0],[`Pattern mode`,e.boolean(`literal`)?`literal`:`regular expression`]]):void 0})}}),find:Zx({name:`find`,argumentRegion:`none`,completedView:`find`,emptyResult:`No files found`,present:(e,t,n)=>zx({primaryArg:Kx(e.string(`pattern`),`Glob pattern`),secondary:[...e.string(`path`)?[{text:n&&sa(e.string(`path`),n)||e.string(`path`),mono:!0}]:[],...e.number(`limit`)!==void 0&&e.number(`limit`)!==1e3?[{text:`max ${e.number(`limit`)}`}]:[]],body:t===`approval`?Yx([[`Search root`,e.string(`path`)??`project root`,!0]]):void 0})}),ls:Zx({name:`ls`,argumentRegion:`none`,completedView:`ls`,emptyResult:`Empty directory`,present:(e,t,n)=>zx({primaryArg:Gx(e,n,`path`,`.`),secondary:e.number(`limit`)!==void 0&&e.number(`limit`)!==500?[{text:`max ${e.number(`limit`)}`}]:[],body:t===`approval`?Yx([[`Directory`,e.string(`path`)??`project root`,!0]]):void 0})}),ask_user:Zx({name:`ask_user`,argumentRegion:`until-result`,completedView:`ask_user`,present:e=>{let t=[e.string(`context`)?`Context: ${e.string(`context`)}`:void 0,e.string(`recommendation`)?`Recommendation: ${e.string(`recommendation`)}`:void 0].filter(e=>!!e);return zx({primaryArg:Kx(e.string(`question`),`Question`),body:t.length>0?{kind:`text-summary`,text:Ux(t.join(`
25
-
26
- `))}:void 0})}}),todos_set:Zx({name:`todos_set`,argumentRegion:`until-result`,completedView:`todos`,present:e=>{let t=e.recordsArray(`todos`)??[],n=e.nestedStrings(`todo`),r=t.length>0?t.flatMap(e=>typeof e.todo==`string`?[{text:e.todo,done:e.done===!0}]:[]):n.map(e=>({text:e,done:!1}));return zx({primaryArg:Kx(`todos`),secondary:r.length>0?[{text:Hx(r.filter(e=>e.done).length,`done`)},{text:`${r.length} total`}]:[],body:r.length>0?{kind:`checklist`,items:r}:void 0})}}),todos_get:Zx({name:`todos_get`,argumentRegion:`none`,completedView:`todos`,emptyResult:`No todos`,present:()=>zx({primaryArg:Kx(`Get todos`)})}),web_search:Zx({name:`web_search`,argumentRegion:`none`,completedView:`web_search`,resultPlaceholder:{variant:`list`,rows:3},emptyResult:`No results`,present:(e,t)=>zx({primaryArg:Kx(e.string(`query`),`Search query`),secondary:e.number(`max_results`)!==void 0&&e.number(`max_results`)!==5?[{text:`max ${e.number(`max_results`)}`}]:[],body:t===`approval`?Yx([[`External search`,e.string(`query`)]]):void 0,safetyNotes:[`Sends the query to the configured external search provider.`]})}),web_fetch:Zx({name:`web_fetch`,argumentRegion:`none`,completedView:`web_fetch`,resultPlaceholder:{variant:`text`,rows:3},present:(e,t)=>zx({primaryArg:qx(e.string(`url`))??Kx(`URL`),secondary:[{text:e.boolean(`raw`)?`raw download`:`converted`}],body:t===`approval`?Yx([[`Destination`,e.string(`url`)],[`Mode`,e.boolean(`raw`)?`save raw response`:`convert to readable text`]]):void 0,safetyNotes:[`Fetches content from an external URL.`]})})};function Qx(e){return e}function $x(e){return e&&e.length>0?e.join(`, `):void 0}function Pne(e){let t=Ux(e.join(`
27
- `));return t?{kind:`atlassian-summary`,text:t}:{kind:`none`}}function eS(e){return e.boolean(`dry_run`)===!0?[{text:`dry run`,tone:`info`}]:[]}function tS(e,t){return[e.boolean(`dry_run`)===!0?`Dry run only; Confluence will not ${t}.`:`This will ${t} in Confluence.`]}function nS(e,t){return e===`approval`?Pne(t):void 0}function rS(e){let t=!!(e.string(`page_file`)??e.string(`body_file`)),n=e.string(`body_representation`),r=e.string(`body`),i=[],a=e.string(`status`);a&&i.push({text:a}),n&&n!==`storage`&&i.push({text:n});let o=Lx(r);return o!==void 0&&i.push({text:`+${o}`,tone:`success`}),t?{body:{kind:`none`},chips:i}:{body:Ix({fields:[],text:{label:`Page body`,text:r,language:n===void 0||n===`storage`?`xml`:void 0}}),chips:i}}var Fne={confluence_search_spaces:Qx({name:`confluence_search_spaces`,argumentRegion:`none`,resultPlaceholder:{variant:`list`,rows:3},completedView:`confluence`,emptyResult:`No spaces found`,present:(e,t)=>{let n=$x(e.strings(`keys`))??$x(e.strings(`ids`)),r=[];return e.string(`type`)&&r.push({text:e.string(`type`)}),e.string(`status`)&&r.push({text:e.string(`status`)}),e.number(`limit`)!==void 0&&r.push({text:`max ${e.number(`limit`)}`}),zx({primaryArg:Kx(e.string(`query`)??n,`Spaces`),secondary:r,body:nS(t,[`Query: ${e.string(`query`)??n??`all spaces`}`])})}}),confluence_search_pages:Qx({name:`confluence_search_pages`,argumentRegion:`none`,resultPlaceholder:{variant:`list`,rows:3},completedView:`confluence`,emptyResult:`No pages found`,present:(e,t)=>{let n=e.string(`cql`)??e.string(`query`)??e.string(`title`),r=[];return e.string(`space_key`)&&r.push({text:`space ${e.string(`space_key`)}`,mono:!0}),e.string(`status`)&&r.push({text:e.string(`status`)}),e.number(`limit`)!==void 0&&r.push({text:`max ${e.number(`limit`)}`}),e.string(`cursor`)&&r.push({text:`cursor`}),zx({primaryArg:Kx(n,`Page query`),secondary:r,body:nS(t,[`${e.string(`cql`)?`CQL`:`Query`}: ${n??``}`,...e.string(`space_key`)?[`Space: ${e.string(`space_key`)}`]:[]])})}}),confluence_get_page:Qx({name:`confluence_get_page`,argumentRegion:`none`,resultPlaceholder:{variant:`list`,rows:3},completedView:`confluence`,present:(e,t)=>{let n=e.string(`page_id`)??e.string(`page_file`),r=[[`include_labels`,`labels`],[`include_properties`,`properties`],[`include_operations`,`operations`],[`include_versions`,`versions`],[`include_direct_children`,`children`],[`include_attachments`,`attachments`]].flatMap(([t,n])=>e.boolean(t)?[n]:[]);return zx({primaryArg:Kx(n,`Page`),secondary:[...e.string(`body_format`)?[{text:e.string(`body_format`)}]:[],...r.map(e=>({text:e}))],body:nS(t,[`Page: ${n??``}`,...r.length?[`Include: ${r.join(`, `)}`]:[]])})}}),confluence_download_pages:Qx({name:`confluence_download_pages`,argumentRegion:`none`,resultPlaceholder:{variant:`list`,rows:3},completedView:`confluence`,emptyResult:`No pages downloaded`,present:(e,t)=>{let n=e.string(`page_id`)??e.string(`space_key`)??e.string(`space_id`)??e.string(`cql`),r=e.string(`output_dir`)??e.string(`download_dir`),i=[];return e.boolean(`recurse`)&&i.push({text:`subtree`}),e.number(`depth`)!==void 0&&i.push({text:`depth ${e.number(`depth`)}`}),e.string(`body_format`)&&i.push({text:e.string(`body_format`)}),r&&i.push({text:r,mono:!0,openPath:r}),zx({primaryArg:Kx(n,`Page download`),secondary:i,body:nS(t,[`Scope: ${n??``}`,...r?[`Destination: ${r}`]:[],...e.boolean(`download_attachments`)?[`Attachments: download`]:[]]),safetyNotes:r?[`Writes downloaded files under ${r}.`]:[]})}}),confluence_create_page:Qx({name:`confluence_create_page`,argumentRegion:`until-result`,completedView:`confluence`,present:e=>{let t=e.string(`space_key`)??e.string(`space_id`),n=e.string(`title`)??e.string(`page_file`),{body:r,chips:i}=rS(e);return zx({primaryArg:Kx([t,n].filter(Boolean).join(` · `),`New Confluence page`),secondary:[...eS(e),...e.string(`parent_id`)?[{text:`parent ${e.string(`parent_id`)}`,mono:!0}]:[],...i],body:r,safetyNotes:tS(e,`create the page`)})}}),confluence_update_page:Qx({name:`confluence_update_page`,argumentRegion:`until-result`,completedView:`confluence`,present:e=>{let t=e.string(`page_id`)??e.string(`page_file`),{body:n,chips:r}=rS(e);return zx({primaryArg:Kx(t,`Confluence page`),secondary:[...eS(e),...e.number(`expected_version`)===void 0?[]:[{text:`version ${e.number(`expected_version`)}`}],...e.boolean(`allow_stale`)?[{text:`allow stale`,tone:`warning`}]:[],...r],body:n,safetyNotes:tS(e,`update the page`)})}}),confluence_publish_pages:Qx({name:`confluence_publish_pages`,argumentRegion:`until-result`,completedView:`confluence`,present:e=>{let t=e.string(`input_path`),n=e.nestedStrings(`title`),r=e.boolean(`allow_stale`)===!0,i=Ix({fields:[Nx(`Source`,t,{mono:!0}),...Px(`Pages`,n.length?`${Hx(n.length,`page`)}: ${n.slice(0,5).join(`, `)}${n.length>5?`, …`:``}`:void 0),...Px(`Version message`,e.string(`version_message`)),Nx(`Conflict handling`,r?`allow stale`:`enforce versions`,r?{tone:`warning`}:{}),...e.boolean(`create_missing`)===!0?[Nx(`Create missing`,`yes`)]:[],...Fx(e)]});return zx({primaryArg:t?{text:t.split(/[\\/]/).pop()||t,openPath:t}:Kx(`Page bundle`),secondary:[...eS(e),...n.length?[{text:Hx(n.length,`page`)}]:[],...e.boolean(`create_missing`)?[{text:`create missing`}]:[],...e.boolean(`allow_stale`)?[{text:`allow stale`,tone:`warning`}]:[]],body:i,safetyNotes:tS(e,`publish the pages`)})}}),confluence_upload_attachment:Qx({name:`confluence_upload_attachment`,argumentRegion:`none`,completedView:`confluence`,present:(e,t)=>{let n=e.string(`file_path`),r=e.string(`filename`)??n?.split(/[\\/]/).pop(),i=e.string(`page_id`),a=[];return i&&a.push({text:`page ${i}`,mono:!0}),e.boolean(`update_existing`)===!1&&a.push({text:`new only`}),e.boolean(`minor_edit`)&&a.push({text:`minor edit`}),zx({primaryArg:Kx([r,i].filter(Boolean).join(` · `),`Attachment`),secondary:a,body:t===`approval`?Ix({fields:[Nx(`Target page`,i,{mono:!0}),Nx(`Source file`,n,{mono:!0}),...Px(`Filename`,r),...Px(`Comment`,e.string(`comment`)),Nx(`Existing attachment`,e.boolean(`update_existing`)===!1?`do not replace`:`update if present`)]}):void 0,safetyNotes:[`Uploads this local file to the selected Confluence page.`]})}})};function iS(e){return e}function aS(e){return e&&e.length>0?e.join(`, `):void 0}function oS(e){let t=[],n=e=>{if(Array.isArray(e)){e.forEach(n);return}if(!e||typeof e!=`object`)return;let r=e;r.type===`text`&&typeof r.text==`string`&&t.push(r.text),r.content&&n(r.content)};return n(e),t.join(``).trim()||void 0}function Ine(e){let t=Ux(e.join(`
28
- `));return t?{kind:`atlassian-summary`,text:t}:{kind:`none`}}function sS(e){let t=e.string(`assignee_query`);if(t)return t;let n=e.string(`assignee_account_id`);return n?`account ${n}`:void 0}function cS(e,t){let n=e.objectKeys(t);return n.length>0?n.join(`, `):void 0}function lS(e){return e.boolean(`dry_run`)===!0?[{text:`dry run`,tone:`info`}]:[]}function uS(e,t){return[e.boolean(`dry_run`)===!0?`Dry run only; Jira will not ${t}.`:`This will ${t} in Jira.`]}function dS(e,t,n){return t===`approval`?Ine(n):void 0}var Lne={jira_search_users:iS({name:`jira_search_users`,argumentRegion:`none`,resultPlaceholder:{variant:`list`,rows:3},completedView:`jira`,emptyResult:`No users found`,present:(e,t)=>{let n=[];return e.string(`project_key`)&&n.push({text:`project ${e.string(`project_key`)}`,mono:!0}),e.string(`issue_key`)&&n.push({text:e.string(`issue_key`),mono:!0}),e.number(`max_results`)!==void 0&&n.push({text:`max ${e.number(`max_results`)}`}),e.boolean(`include_inactive`)&&n.push({text:`include inactive`}),zx({primaryArg:Kx(e.string(`query`),`User query`),secondary:n,body:dS(e,t,[`Query: ${e.string(`query`)??``}`,...e.string(`project_key`)?[`Project: ${e.string(`project_key`)}`]:[],...e.string(`issue_key`)?[`Issue: ${e.string(`issue_key`)}`]:[]])})}}),jira_search_issues:iS({name:`jira_search_issues`,argumentRegion:`none`,resultPlaceholder:{variant:`list`,rows:3},completedView:`jira`,emptyResult:`No issues found`,present:(e,t)=>{let n=e.strings(`fields`),r=[];return n&&r.push({text:Hx(n.length,`field`)}),e.number(`max_results`)!==void 0&&r.push({text:`max ${e.number(`max_results`)}`}),e.string(`next_page_token`)&&r.push({text:`next page`}),e.boolean(`save_to_file`)===!1&&r.push({text:`not saved`}),zx({primaryArg:Kx(e.string(`jql`),`JQL`),secondary:r,body:dS(e,t,[`JQL: ${e.string(`jql`)??``}`,...n?.length?[`Fields: ${n.join(`, `)}`]:[]])})}}),jira_get_issue:iS({name:`jira_get_issue`,argumentRegion:`none`,resultPlaceholder:{variant:`list`,rows:3},completedView:`jira`,present:(e,t)=>{let n=[[`include_comments`,`comments`],[`include_transitions`,`transitions`],[`include_editmeta`,`edit metadata`],[`include_worklogs`,`worklogs`],[`include_changelog`,`changelog`],[`include_remote_links`,`remote links`]].flatMap(([t,n])=>e.boolean(t)?[n]:[]);return zx({primaryArg:Kx(e.string(`issue_key`),`Issue`),secondary:n.map(e=>({text:e})),body:dS(e,t,[`Issue: ${e.string(`issue_key`)??``}`,...n.length>0?[`Include: ${n.join(`, `)}`]:[]])})}}),jira_get_project:iS({name:`jira_get_project`,argumentRegion:`none`,resultPlaceholder:{variant:`list`,rows:3},completedView:`jira`,present:(e,t)=>{let n=e.string(`project_key`)??`default project`,r=[[`include_statuses`,`statuses`],[`include_components`,`components`],[`include_versions`,`versions`],[`include_issue_types`,`issue types`],[`include_create_meta`,`create metadata`],[`include_fields`,`fields`]].flatMap(([t,n])=>e.boolean(t)?[n]:[]);return zx({primaryArg:Kx(n),secondary:r.map(e=>({text:e})),body:dS(e,t,[`Project: ${n}`,...r.length>0?[`Include: ${r.join(`, `)}`]:[]])})}}),jira_create_issue:iS({name:`jira_create_issue`,argumentRegion:`until-result`,completedView:`jira`,present:e=>{let t=e.string(`project_key`),n=e.string(`issue_type`),r=e.string(`summary`),i=Ix({fields:[Nx(`Project`,t,{mono:!0}),Nx(`Type`,n),Nx(`Summary`,r),...Px(`Parent`,e.string(`parent_key`),{mono:!0}),...Px(`Priority`,e.string(`priority`)),...Px(`Assignee`,sS(e)),...Px(`Labels`,aS(e.strings(`labels`))),...Px(`Components`,aS(e.strings(`components`))),...Px(`Custom fields`,cS(e,`fields`),{mono:!0}),...Fx(e)],text:{label:`Description`,text:e.string(`description`)??oS(e.value(`description_adf`))}});return zx({primaryArg:Kx([t,n,r].filter(Boolean).join(` · `),`New Jira issue`),secondary:[...lS(e),...e.strings(`labels`)?[{text:Hx(e.strings(`labels`).length,`label`)}]:[]],body:i,safetyNotes:uS(e,`create an issue`)})}}),jira_update_issue:iS({name:`jira_update_issue`,argumentRegion:`until-result`,completedView:`jira`,present:e=>{let t=e.string(`description`)??oS(e.value(`description_adf`)),n=[...Px(`Summary`,e.string(`summary`)),...Px(`Priority`,e.string(`priority`)),...Px(`Assignee`,sS(e)),...Px(`Labels`,aS(e.strings(`labels`))),...Px(`Field keys`,cS(e,`fields`),{mono:!0}),...Px(`Update ops`,cS(e,`update`),{mono:!0})],r=n.length+(t===void 0?0:1),i=Ix({fields:[Nx(`Issue`,e.string(`issue_key`),{mono:!0}),...n,...e.boolean(`notify_users`)===!1?[Nx(`Notify users`,`no`)]:[],...Fx(e)],text:t===void 0?void 0:{label:`Description`,text:t}});return zx({primaryArg:Kx(e.string(`issue_key`),`Issue`),secondary:[...lS(e),...r>0?[{text:Hx(r,`change`)}]:[]],body:i,safetyNotes:uS(e,`update the issue`)})}}),jira_add_comment:iS({name:`jira_add_comment`,argumentRegion:`until-result`,completedView:`jira`,present:e=>{let t=e.record(`visibility`),n=Ix({fields:[Nx(`Issue`,e.string(`issue_key`),{mono:!0}),...Px(`Visibility`,t?[t.type,t.value].filter(e=>typeof e==`string`).join(` · `):void 0)],text:{label:`Comment`,text:e.string(`body`)??oS(e.value(`body_adf`))}});return zx({primaryArg:Kx(e.string(`issue_key`),`Issue`),secondary:[{text:e.record(`body_adf`)?`ADF`:`plain text`}],body:n,safetyNotes:[`Adds this comment to the selected Jira issue.`]})}}),jira_transition_issue:iS({name:`jira_transition_issue`,argumentRegion:`until-result`,completedView:`jira`,present:e=>{let t=e.string(`transition`)??`list available transitions`,n=e.string(`comment`)??oS(e.value(`comment_adf`)),r=Ix({fields:[Nx(`Issue`,e.string(`issue_key`),{mono:!0}),Nx(`Transition`,e.string(`transition`)),...Px(`Resolution`,e.string(`resolution`)),...Px(`Field keys`,cS(e,`fields`),{mono:!0}),...Px(`Update ops`,cS(e,`update`),{mono:!0}),...Fx(e)],text:n===void 0?void 0:{label:`Comment`,text:n}});return zx({primaryArg:Kx([e.string(`issue_key`),t].filter(Boolean).join(` · `),`Issue transition`),secondary:lS(e),body:r,safetyNotes:uS(e,`transition the issue`)})}})};function fS(e){return e}function pS(e){if(e!==void 0)return e<1e3?`${e}ms`:`${e/1e3}s`}function mS(e){let t=e.string(`taskId`),n=e.string(`groupId`),r=e.strings(`taskIds`)??[],i=r.length||(t||n?1:0);return{primary:t??(r.length===1?r[0]:r.length>1?`${r.length} tasks`:n?`group ${n}`:`active tasks`),count:i}}function Rne(e,t){let n=e.string(`command`),r=e.string(`name`),i=e.string(`cwd`),a=e.objectKeys(`env`),o=e.string(`readyUrl`)??e.string(`readyPattern`)??(e.boolean(`readyOnUrl`)?`first detected URL`:void 0),s=[];i&&s.push({text:`cwd ${i}`,mono:!0}),o&&s.push({text:`ready: ${o}`}),e.number(`timeoutMs`)!==void 0&&s.push({text:`runtime ${pS(e.number(`timeoutMs`))}`}),a.length>0&&s.push({text:Hx(a.length,`env key`)}),e.boolean(`notify`)===!1&&s.push({text:`notifications off`});let c=Wx(n)??0,l=Jx(n,`bash`,{force:(n?.length??0)>500,label:`Command`});return l.kind===`none`&&t===`approval`&&(l=Yx([[`Working directory`,i??`project root`,!0],[`Readiness`,o],[`Readiness timeout`,pS(e.number(`readyTimeoutMs`))],[`Runtime timeout`,pS(e.number(`timeoutMs`))],[`Environment keys`,a.join(`, `)],[`Notifications`,e.boolean(`notify`)===!1?`off`:`on`]])),zx({primaryArg:Kx(r??(c<=1?n:void 0),n?`background task`:`Task`),secondary:s,body:l,safetyNotes:[`Starts a supervised background process; tool completion only confirms the start request.`,...a.length>0?[`Environment values are hidden; keys: ${a.join(`, `)}.`]:[]]})}var zne={task_start:fS({name:`task_start`,argumentRegion:`until-result`,completedView:`task_action`,present:Rne}),task_status:fS({name:`task_status`,argumentRegion:`none`,completedView:`task_status`,emptyResult:`No tasks`,present:(e,t)=>{let n=mS(e),r=[];return n.count>1&&r.push({text:Hx(n.count,`selector`)}),e.string(`status`)&&r.push({text:`status ${e.string(`status`)}`}),e.number(`limit`)!==void 0&&r.push({text:`max ${e.number(`limit`)}`}),zx({primaryArg:Kx(n.primary),secondary:r,body:t===`approval`?Yx([[`Task selector`,n.primary]]):void 0})}}),task_logs:fS({name:`task_logs`,argumentRegion:`none`,completedView:`task_logs`,emptyResult:`No log events`,present:(e,t)=>{let n=[];return e.string(`mode`)&&n.push({text:e.string(`mode`)}),e.number(`sinceSeq`)!==void 0&&n.push({text:`after ${e.number(`sinceSeq`)}`}),e.string(`contains`)&&n.push({text:`substring filter`}),e.string(`regex`)&&n.push({text:`regex filter`}),e.number(`contextLines`)!==void 0&&n.push({text:`context ${e.number(`contextLines`)}`}),e.number(`limit`)!==void 0&&n.push({text:`max ${e.number(`limit`)}`}),zx({primaryArg:Kx(e.string(`taskId`),`Task logs`),secondary:n,body:t===`approval`?Yx([[`Task`,e.string(`taskId`)],[`Mode`,e.string(`mode`)??`recent`],[`Contains`,e.string(`contains`)],[`Regular expression`,e.string(`regex`)]]):void 0})}}),task_cancel:fS({name:`task_cancel`,argumentRegion:`none`,completedView:`task_action`,present:(e,t)=>{let n=mS(e),r=e.string(`signal`)??`SIGTERM`,i=[];return n.count>1&&i.push({text:Hx(n.count,`target`)}),i.push({text:r,tone:r===`SIGKILL`?`error`:`warning`}),e.number(`timeoutMs`)!==void 0&&i.push({text:`escalate after ${pS(e.number(`timeoutMs`))}`}),zx({primaryArg:Kx(n.primary),secondary:i,body:t===`approval`?Yx([[`Targets`,(e.strings(`taskIds`)??[]).join(`, `)||n.primary],[`Signal`,r],[`Escalation timeout`,pS(e.number(`timeoutMs`))],[`Reason`,e.string(`reason`)]]):void 0,safetyNotes:[`Requests cancellation of the selected supervised task process.`]})}}),task_restart:fS({name:`task_restart`,argumentRegion:`none`,completedView:`task_action`,present:(e,t)=>zx({primaryArg:Kx(e.string(`taskId`),`Task`),body:t===`approval`?{kind:`text-summary`,text:`The task will restart with its stored launch settings and environment.`}:void 0,safetyNotes:[`Reuses the task's stored command, settings, and encrypted environment.`]})}),explore:fS({name:`explore`,argumentRegion:`until-result`,completedView:`explore`,present:(e,t)=>{let n=e.recordsArray(`tasks`)??[],r=n.length>0?n.map((e,t)=>typeof e.label==`string`?e.label:typeof e.task==`string`?e.task:`Agent ${t+1}`):e.nestedStrings(`label`),i=e.string(`task`),a=e.string(`label`),o=r.length||+!!i,s=r.length>0?r.map((e,t)=>`${t+1}. ${e}`):i?[Ux(i)]:[],c=e.string(`split_rationale`);return zx({primaryArg:Kx(a??(o>0?Hx(o,`agent`):void 0),`Explore`),secondary:o>0?[{text:Hx(o,`read-only agent`)}]:[],body:s.length>0?{kind:`text-summary`,text:s.join(`
29
- `)}:void 0,safetyNotes:[`Delegates read-only investigation to child agents.`,...t===`approval`&&c?[`Why parallel: ${Ux(c)}`]:[]]})}}),plan_mode_enter:fS({name:`plan_mode_enter`,argumentRegion:`until-result`,completedView:`plan_mode`,present:e=>zx({primaryArg:Kx(`Enter planning mode`),body:e.string(`reason`)?{kind:`text-summary`,text:Ux(e.string(`reason`))}:void 0})}),plan_mode_present:fS({name:`plan_mode_present`,argumentRegion:`until-result`,completedView:`plan_mode`,present:e=>{let t=e.string(`file_path`);return zx({primaryArg:t?{text:t.split(/[\\/]/).pop()||t,openPath:t}:Kx(`Plan review`),secondary:t?[{text:t,mono:!0,openPath:t}]:[],body:e.string(`summary`)?{kind:`text-summary`,text:Ux(e.string(`summary`))}:void 0})}}),plan_mode_force_exit:fS({name:`plan_mode_force_exit`,argumentRegion:`until-result`,completedView:`plan_mode`,present:e=>zx({primaryArg:Kx(`Exit planning mode`),body:e.string(`reason`)?{kind:`text-summary`,text:Ux(e.string(`reason`))}:void 0})})},Bne={...Nne,...zne,...Lne,...Fne},Vne={name:`unknown`,argumentRegion:`until-result`,completedView:`generic`,emptyResult:`No output`,present:e=>{let t=e.structuredEntries(),n=t.find(e=>!e.redacted&&e.value!==`[unavailable]`);return zx({primaryArg:n?{text:n.value}:void 0,secondary:[{text:`recorded tool`,tone:`warning`}],body:t.length>0?{kind:`key-values`,items:t.map(e=>({label:e.key,value:e.value,mono:!0,tone:e.redacted?`warning`:void 0}))}:void 0,safetyNotes:[`This tool is not in the active catalog. Review Details before approving it.`]})}};function hS(e){return rr.safeParse(e).success}function gS(e){return hS(e)?Bne[e]:Vne}function _S(e,t,n,r){return gS(e).present(fb(t),n,r)}var vS=new WeakMap;function yS(e,t){let n=vS.get(e);if(n)return n;let r=Wne(e,t);return vS.set(e,r),r}function bS(e,t){if(!(e===void 0||e<=0))return`${e.toLocaleString()} ${t}${e===1?``:`s`}`}function xS(e,t){for(let[t,n]of e)if(t>5)return Ex(t,n,`head`,5);return Ex(t,`lines`)}function SS(e){return!!(e&&!e.replace(/\r\n/g,`
30
- `).replace(/\r/g,`
31
- `).includes(`
32
- `))}function CS(e,t){return!!(t&&`outputArtifacts`in e&&e.outputArtifacts?.some(e=>e.path===t))}function Hne(e){switch(e.action){case`search_spaces`:return e.query?{text:e.query}:void 0;case`search_pages`:return e.cql?{text:e.cql}:e.query?{text:e.query}:void 0;case`download_pages`:return e.downloadDir?{text:xx(e.downloadDir),openPath:e.downloadDir}:e.pageId?{text:e.pageId}:void 0;case`publish_pages`:return e.inputPath?{text:xx(e.inputPath),openPath:e.inputPath}:void 0;case`upload_attachment`:return e.attachment?.filename?{text:e.attachment.filename}:e.pageId?{text:e.pageId}:void 0;case`get_page`:case`create_page`:case`update_page`:return e.page?.title?{text:e.page.id?`${e.page.id} · ${e.page.title}`:e.page.title}:e.pageId?{text:e.pageId}:e.title?{text:e.title}:void 0;default:return}}function Une(e){switch(e.action){case`search_users`:return e.query?{text:e.query}:void 0;case`search_issues`:return e.jql?{text:e.jql}:void 0;case`get_project`:{let t=e.project?.name?`${e.project.key} · ${e.project.name}`:e.projectKey??e.project?.key;return t?{text:t}:void 0}case`create_issue`:return e.issueKey?{text:e.issueKey}:e.summary?{text:e.issueType?`${e.issueType} · ${e.summary}`:e.summary}:void 0;case`get_issue`:case`update_issue`:case`add_comment`:case`transition_issue`:return e.issueKey?{text:e.issueKey}:void 0;default:return}}function wS(e,t={}){let n=`outputLimits`in e?e.outputLimits:void 0,r=`outputArtifacts`in e?e.outputArtifacts:void 0,i=[];if(n?.model?.truncated){let e=bS(n.model.omittedLines,`line`),t=bS(n.model.omittedChars,`char`);i.push({text:[`LLM trimmed`,e??t].filter(Boolean).join(` · `),tone:`warning`})}if(t.includeLiveLimit!==!1&&n?.live?.capped){let e=bS(n.live.omittedChars,`char`);i.push({text:[`live tail`,e?`${e} omitted`:void 0].filter(Boolean).join(` · `),tone:`info`})}for(let e of r??[]){let t=e.kind===`raw_result`?`raw result`:e.kind===`fetched_content`?`fetched content`:`full output`;i.push({text:t,mono:!0,openPath:e.path})}return i}function Wne(e,t){let n=`previewOverflow`in t?t.previewOverflow:void 0,r=n?Dx(n.hidden,n.noun,n.direction):void 0,{tone:i,pulse:a}=Ox(t,e),o=t,s=_S(t.toolName,{args:o.args,argsPreview:o.argsPreview},`completed`,t.cwd),c={badge:t.toolName,primaryArg:s.primaryArg,meta:[],dotTone:i,dotPulse:a};switch(e.kind){case`read`:{let t=e.relPath?{text:e.relPath,openPath:e.path}:void 0;if(e.image)return{...c,primaryArg:t,meta:[{text:`image`}]};let n=[];return e.lineLabel&&n.push({text:e.lineLabel}),e.truncated&&n.push({text:`truncated`,tone:`warning`}),n.push(...wS(e)),{...c,primaryArg:t,meta:n,detailsAction:r??Ex(e.lineCount??0,`lines`)}}case`bash`:{let t=[],n=e.outputLineCount;e.exitCode!==void 0&&e.exitCode!==0&&t.push({text:`exit ${e.exitCode}`,tone:`error`}),e.signal&&t.push({text:`signal ${e.signal}`,tone:`warning`}),e.backgroundTask&&(t.push({text:`background ${e.backgroundTask.taskId}`,tone:`warning`,mono:!0}),t.push({text:e.backgroundTask.status})),n>0&&t.push({text:wx(n,`line`)}),e.live&&t.push({text:`streaming`,tone:`info`}),e.truncated&&t.push({text:`truncated`,tone:`warning`}),t.push(...wS(e,{includeLiveLimit:!1})),e.savedTo&&!CS(e,e.savedTo)&&t.push({text:`saved ${xx(e.savedTo)}`,mono:!0,openPath:e.savedTo});let i=Tx(e.command),a=Math.max(0,i-6),o=a+Math.max(0,n-6);return{...c,primaryArg:e.command?SS(e.command)?{text:e.command}:{text:`inline`}:void 0,meta:t,detailsAction:r??(a>0?Dx(o,`lines`,`mixed`):Ex(n,`lines`,`tail`))}}case`python`:{let t=[],n=e.outputLineCount;e.exitCode!==void 0&&e.exitCode!==0&&t.push({text:`exit ${e.exitCode}`,tone:`error`}),e.signal&&t.push({text:`signal ${e.signal}`,tone:`warning`}),e.timedOut&&t.push({text:`timed out`,tone:`error`});let i=Cx(e.durationMs);i&&t.push({text:i}),n>0&&t.push({text:wx(n,`line`)}),e.live&&t.push({text:`streaming`,tone:`info`}),e.artifacts&&e.artifacts.length>0&&t.push({text:wx(e.artifacts.length,`artifact`),tone:`info`}),e.streams?.stdout?.truncated&&t.push({text:`stdout truncated`,tone:`warning`}),e.streams?.stderr?.truncated&&t.push({text:`stderr truncated`,tone:`warning`}),e.truncated&&t.push({text:`truncated`,tone:`warning`}),t.push(...wS(e)),e.savedTo&&!CS(e,e.savedTo)&&t.push({text:`saved ${xx(e.savedTo)}`,mono:!0,openPath:e.savedTo});let a=Math.max(0,e.codeLineCount-6)+Math.max(0,n-6),o=r??Dx(a,`lines`,`mixed`),s=e.inputMode===`file`&&e.relScriptPath?{text:e.relScriptPath,openPath:e.scriptPath}:e.code&&SS(e.code)?{text:e.code}:{text:`inline`};return{...c,primaryArg:s,meta:t,detailsAction:o}}case`edit`:{let t=[{text:wx(e.operationCount,`operation`)}];return e.dryRun&&t.push({text:`preview`,tone:`info`}),e.additions>0&&t.push({text:`+${e.additions}`,tone:`success`}),e.deletions>0&&t.push({text:`−${e.deletions}`,tone:`error`}),e.diffLineCount>0&&t.push({text:wx(e.diffLineCount,`diff line`)}),{...c,primaryArg:e.relPath?{text:e.relPath,openPath:e.path}:void 0,meta:t,detailsAction:r??Ex(e.diffLineCount,`lines`)}}case`write`:{let t=[];return e.bytes!==void 0&&t.push({text:`wrote ${e.bytes} bytes`}),e.lineCount!==void 0&&t.push({text:wx(e.lineCount,`line`)}),e.charCount!==void 0&&t.push({text:wx(e.charCount,`char`)}),{...c,primaryArg:e.relPath?{text:e.relPath,openPath:e.path}:void 0,meta:t,detailsAction:r??Ex(e.lineCount??0,`lines`)}}case`grep`:return{...c,primaryArg:e.pattern?{text:e.pattern}:void 0,meta:[{text:wx(e.matchCount,`match`,`es`)},{text:wx(e.fileCount,`file`)}],detailsAction:r??Ex(e.matchCount,`matches`)};case`find`:return{...c,primaryArg:e.pattern?{text:e.pattern}:void 0,meta:[{text:wx(e.count,`file`)}],detailsAction:r??Ex(e.count,`files`)};case`ls`:return{...c,primaryArg:e.relPath?{text:e.relPath,openPath:e.path}:void 0,meta:[{text:`${e.total} ${e.total===1?`entry`:`entries`}`}],detailsAction:r??Ex(e.total,`entries`)};case`task_logs`:{let t=[{text:wx(e.eventCount,`event`)}];return e.mode&&t.push({text:e.mode}),{...c,primaryArg:e.task?.name?{text:e.task.name}:c.primaryArg,meta:t,detailsAction:r??Ex(e.eventCount,`events`,`tail`)}}case`web_fetch`:{let t=[];e.status!==void 0&&t.push({text:`${e.status}`,tone:e.status>=400?`error`:`success`}),e.contentType&&t.push({text:e.contentType});let n=Sx(e.size);return n&&t.push({text:n}),e.converted&&t.push({text:`markdown`,tone:`info`}),e.savedTo&&!CS(e,e.savedTo)&&t.push({text:`saved ${xx(e.savedTo)}`,mono:!0,openPath:e.savedTo}),t.push(...wS(e)),{...c,primaryArg:e.url?{text:e.url,href:e.url}:void 0,meta:t,detailsAction:r??Ex(Tx(e.content),`lines`)}}case`jira`:{let t=[];e.dryRun&&t.push({text:`preview`,tone:`info`});let n=(e,n)=>{e!==void 0&&t.push({text:wx(e,n)})};switch(e.action){case`search_users`:n(e.userCount??e.users.length,`user`),e.projectKey&&t.push({text:`project ${e.projectKey}`,mono:!0}),e.issueKey&&t.push({text:e.issueKey,mono:!0});break;case`search_issues`:n(e.issueCount??e.issues.length,`issue`),e.total!==void 0&&e.total!==e.issueCount&&t.push({text:`${e.total} total`}),e.nextPageToken&&t.push({text:`next page`,tone:`info`});break;case`get_issue`:e.issue?.issueType&&t.push({text:e.issue.issueType}),e.issue?.status&&t.push({text:e.issue.status}),e.issue?.assignee&&t.push({text:`assignee ${e.issue.assignee}`}),e.includedCounts?.comments!==void 0&&n(e.includedCounts.comments,`comment`),e.includedCounts?.transitions!==void 0&&n(e.includedCounts.transitions,`transition`);break;case`get_project`:e.project?.projectTypeKey&&t.push({text:e.project.projectTypeKey}),e.includedCounts?.statuses!==void 0&&t.push({text:`${e.includedCounts.statuses} statuses`}),e.includedCounts?.components!==void 0&&n(e.includedCounts.components,`component`),e.includedCounts?.versions!==void 0&&n(e.includedCounts.versions,`version`);break;case`create_issue`:e.projectKey&&t.push({text:`project ${e.projectKey}`,mono:!0}),e.issueType&&t.push({text:e.issueType});break;case`update_issue`:{let n=e.updatedFieldCount??e.updatedFields?.length;n!==void 0&&t.push({text:`${wx(n,`field`)} updated`});break}case`add_comment`:e.commentId&&t.push({text:`comment ${e.commentId}`,mono:!0});break;case`transition_issue`:e.transition?.name&&t.push({text:e.transition.name}),e.transition?.to&&t.push({text:`to ${e.transition.to}`}),e.transition||n(e.transitionCount??e.transitions.length,`transition`);break}t.push(...wS(e));let i=r??xS([[e.issues.length,`issues`],[e.users.length,`users`],[e.transitions.length,`transitions`]],e.contentLineCount);return{...c,primaryArg:Une(e),meta:t,detailsAction:i}}case`confluence`:{let t=[];e.dryRun&&t.push({text:`preview`,tone:`info`});let n=(e,n)=>{e!==void 0&&t.push({text:wx(e,n)})};switch(e.action){case`search_spaces`:n(e.spaceCount??e.spaces.length,`space`);break;case`search_pages`:case`download_pages`:if(n(e.pageCount??e.pages.length,`page`),e.action===`download_pages`){let t=e.includedCounts?.downloadedAttachments??e.includedCounts?.attachments;t!==void 0&&t>0&&n(t,`attachment`)}e.bodyFormat&&t.push({text:e.bodyFormat}),e.downloadDir&&t.push({text:`bundle`,mono:!0,openPath:e.downloadDir}),e.manifestPath&&t.push({text:`manifest`,mono:!0,openPath:e.manifestPath}),e.pagesJsonlPath&&t.push({text:`pages.jsonl`,mono:!0,openPath:e.pagesJsonlPath});break;case`get_page`:{let t=e.attachmentCount??e.includedCounts?.attachments;t!==void 0&&t>0&&n(t,`attachment`);break}case`create_page`:case`update_page`:break;case`publish_pages`:n(e.outcomeCount??e.outcomes.length,`outcome`);break;case`upload_attachment`:n(e.attachmentCount??e.attachments.length,`attachment`),e.pageId&&t.push({text:`page ${e.pageId}`,mono:!0});break}t.push(...wS(e));let i=r??xS([[e.pages.length,`pages`],[e.spaces.length,`spaces`],[e.outcomes.length,`outcomes`]],e.contentLineCount);return{...c,primaryArg:Hne(e),meta:t,detailsAction:i}}case`web_search`:return{...c,primaryArg:e.query?{text:e.query}:void 0,meta:[{text:wx(e.results.length,`result`)},...wS(e)],detailsAction:Ex(e.results.length,`results`)};case`todos`:return{...c,badge:`todos`,primaryArg:e.total>0?{text:`${e.completed}/${e.total} done`}:void 0,meta:[]};case`task_action`:{let t=e.task??e.tasks?.[0];return{...c,badge:`task_${e.action}`,primaryArg:t?.name?{text:t.name}:c.primaryArg,meta:e.action===`cancel`&&(e.outcomeCount??0)>1?[{text:wx(e.outcomeCount??0,`outcome`)}]:[],detailsAction:r}}case`task_status`:return{...c,meta:[{text:wx(e.taskCount,`task`,`s`)}],detailsAction:Dx(e.hiddenTaskCount,`tasks`,`head`)};case`explore`:{let{summary:t}=Eb(e),n=[];t.totalTurns>0&&n.push({text:`${t.totalTurns.toLocaleString()} ${t.totalTurns===1?`turn`:`turns`}`}),t.totalTokens>0&&n.push({text:`${t.totalTokens.toLocaleString()} tokens`}),t.failed>0&&n.push({text:`${t.failed} failed`,tone:`error`}),t.aborted>0&&n.push({text:`${t.aborted} stopped`,tone:`warning`});let r=`${t.completed+t.failed+t.aborted}/${t.total} ${t.total===1?`agent`:`agents`}`;return{...c,primaryArg:t.total>0?{text:r}:void 0,meta:n}}case`ask_user`:return{...c,primaryArg:void 0,meta:[]};case`plan_mode`:return{...c,badge:`plan_mode_${e.action}`,primaryArg:c.primaryArg??(e.planPath?{text:e.planPath,openPath:e.planPath}:void 0),meta:[],detailsAction:r};default:return c}}var Gne=new Set([`$$slots`,`$$events`,`$$legacy`]);function TS(e,t){let n=U(t,Gne),r=[[`path`,{d:`M12 19v3`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`}]];G(e,V({name:`mic`},()=>n,{get iconNode(){return r}}))}function ES(e,t,n){let r=n?{description:n}:void 0;e===`success`?fi.success(t,r):e===`error`?fi.error(t,r):fi(t,r)}var DS={success(e,t={}){ES(`success`,e,t.description)},error(e,t={}){ES(`error`,e,t.description)},message(e,t={}){ES(`message`,e,t.description)}};function OS(e,t=`code block`){e?DS.success(`Copied ${t}`):DS.error(`Could not copy ${t}`)}async function Kne(e){let t=globalThis.navigator?.clipboard;if(t?.writeText){await t.writeText(e);return}throw Error(`Clipboard API is not available.`)}var kS={bash:()=>Xa(()=>import(`./bash-B7CDPTg5.js`),__vite__mapDeps([0,1])),css:()=>Xa(()=>import(`./css-BsVw1vtW.js`),[]),diff:()=>Xa(()=>import(`./diff-woXpYk--.js`),[]),html:()=>Xa(()=>import(`./html-BY76lXLH.js`),__vite__mapDeps([2,3,4])),javascript:()=>Xa(()=>import(`./javascript-BgS3c2Ky.js`),[]),json:()=>Xa(()=>import(`./json-qhed-kSA.js`),[]),jsonc:()=>Xa(()=>import(`./jsonc-CYpm1nAK.js`),[]),jsx:()=>Xa(()=>import(`./jsx-Bz0zcwM4.js`),[]),markdown:()=>Xa(()=>import(`./markdown-BYOwaDjH.js`),[]),python:()=>Xa(()=>import(`./python-gzcpVVnB.js`),[]),shellscript:()=>Xa(()=>import(`./shellscript-CLZ0U2zV.js`),[]),svelte:()=>Xa(()=>import(`./svelte-Uaf2W_lJ.js`),__vite__mapDeps([5,3,4,6])),tsx:()=>Xa(()=>import(`./tsx-udAQXfEw.js`),[]),typescript:()=>Xa(()=>import(`./typescript-bsJCZSQ-.js`),[]),xml:()=>Xa(()=>import(`./xml-DMbpbO54.js`),[]),yaml:()=>Xa(()=>import(`./yaml-rwi0_p6S.js`),[])},qne={"github-light":()=>Xa(()=>import(`./github-light-EUqPIrTm.js`),[]),"github-dark-dimmed":()=>Xa(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[])},Jne=new Map([[``,`markdown`],[`text`,`markdown`],[`plain`,`markdown`],[`plaintext`,`markdown`],[`sh`,`bash`],[`shell`,`shellscript`],[`zsh`,`shellscript`],[`js`,`javascript`],[`ts`,`typescript`],[`md`,`markdown`],[`yml`,`yaml`]]),Yne=new Set(Object.keys(kS)),AS,jS=new qa(500);function MS(e){let t=(e??``).toLowerCase().trim();return Jne.get(t)||(Yne.has(t)?t:void 0)}function Xne(e){return typeof window>`u`||typeof window.requestIdleCallback!=`function`?e():new Promise((t,n)=>{window.requestIdleCallback(()=>{e().then(t,n)},{timeout:750})})}async function Zne(){return AS??=Promise.all([Xa(()=>import(`./dist-DYAlPOZA.js`),[]),Xa(()=>import(`./dist-FQvzRocB.js`),[])]).then(([e,t])=>{let n=e.createBundledHighlighter({langs:kS,themes:qne,engine:()=>t.createJavaScriptRegexEngine()});return e.createSingletonShorthands(n)}),AS}async function Qne(e,t){let n=MS(t);if(n)return Xne(async()=>(await Zne()).codeToHtml(e,{lang:n,themes:{light:`github-light`,dark:`github-dark-dimmed`},defaultColor:!1}))}function $ne(e,t){return`${t}\0${e}`}function NS(e,t){let n=MS(t);if(!n)return;let r=$ne(e,n),i=jS.get(r);if(i!==void 0||jS.has(r))return i;let a=Qne(e,n).then(e=>(jS.set(r,e),e)).catch(()=>{jS.delete(r)});return jS.set(r,a),a}var ere=0,PS=Promise.resolve();function FS(e,t,n,r){let i=e.getPropertyValue(t).trim()||n,a=r.createElement(`canvas`);a.width=1,a.height=1;let o=a.getContext(`2d`);if(!o)return n;o.clearRect(0,0,1,1),o.fillStyle=i,o.fillRect(0,0,1,1);let[s,c,l]=o.getImageData(0,0,1,1).data;return`#${[s,c,l].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function IS(e,t,n){let r=e=>[1,3,5].map(t=>Number.parseInt(e.slice(t,t+2),16)),i=r(e),a=r(t);return`#${i.map((e,t)=>Math.round(e*(1-n)+a[t]*n).toString(16).padStart(2,`0`)).join(``)}`}function tre(e){let t=e.ownerDocument,n=t.documentElement,r=getComputedStyle(n),i=n.classList.contains(`dark`),a=FS(r,`--foreground`,`#000000`,t),o=FS(r,`--card`,`#ffffff`,t),s=FS(r,`--border`,`#808080`,t),c={dark:i,fontFamily:r.fontFamily||`sans-serif`,background:FS(r,`--background`,`#ffffff`,t),foreground:a,card:o,surface:i?IS(o,a,.1):o,primary:FS(r,`--primary`,`#000000`,t),border:s,strongBorder:i?IS(s,a,.3):s,mutedForeground:FS(r,`--muted-foreground`,`#808080`,t)};return{...c,fingerprint:[n.dataset.theme??``,c.dark?`dark`:`light`,c.fontFamily,c.background,c.foreground,c.card,c.surface,c.primary,c.border,c.strongBorder,c.mutedForeground].join(`\0`)}}function LS(e){return e?.trim().toLowerCase()===`mermaid`}async function nre(e){let{default:t}=await Xa(async()=>{let{default:e}=await import(`./purify.es-Bs0Imjnk.js`);return{default:e}},[]),n=t(window).sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:[`script`,`foreignObject`],FORBID_ATTR:[`href`,`xlink:href`]}),r=new DOMParser().parseFromString(n,`image/svg+xml`);if(!(r.querySelector(`parsererror`)||r.documentElement.tagName!==`svg`))return r.documentElement.outerHTML}async function rre(e,t){let{default:n}=await Xa(async()=>{let{default:e}=await import(`./mermaid.core-oRWj6taj.js`);return{default:e}},__vite__mapDeps([7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]));n.initialize({startOnLoad:!1,securityLevel:`strict`,htmlLabels:!1,theme:`base`,fontFamily:t.fontFamily,themeVariables:{background:t.background,primaryColor:t.surface,primaryTextColor:t.foreground,primaryBorderColor:t.strongBorder,secondaryColor:t.background,secondaryTextColor:t.foreground,secondaryBorderColor:t.strongBorder,tertiaryColor:t.surface,tertiaryTextColor:t.foreground,tertiaryBorderColor:t.strongBorder,lineColor:t.mutedForeground,textColor:t.foreground,mainBkg:t.surface,nodeBorder:t.strongBorder,clusterBkg:t.background,clusterBorder:t.strongBorder,titleColor:t.foreground,edgeLabelBackground:t.background,actorBkg:t.surface,actorBorder:t.strongBorder,actorTextColor:t.foreground,actorLineColor:t.strongBorder,signalColor:t.foreground,signalTextColor:t.foreground,labelBoxBkgColor:t.background,labelBoxBorderColor:t.strongBorder,labelTextColor:t.foreground,loopTextColor:t.foreground,activationBkgColor:t.surface,activationBorderColor:t.primary,noteBkgColor:t.surface,noteBorderColor:t.primary,noteTextColor:t.foreground,sequenceNumberColor:t.background},flowchart:{htmlLabels:!1}});let r=`nerve-mermaid-${++ere}`,{svg:i}=await n.render(r,e);return nre(i)}function RS(e,t){let n=tre(t),r=async()=>{try{let t=await rre(e,n);return t?{ok:!0,svg:t,themeFingerprint:n.fingerprint}:{ok:!1,themeFingerprint:n.fingerprint}}catch{return{ok:!1,themeFingerprint:n.fingerprint}}},i=PS.then(r,r);return PS=i.then(()=>void 0,()=>void 0),i}function zS(e,t){let n=new DOMParser().parseFromString(t,`image/svg+xml`);if(n.querySelector(`parsererror`)||n.documentElement.tagName!==`svg`)return!1;let r=e.ownerDocument.importNode(n.documentElement,!0);return r.setAttribute(`role`,`img`),r.setAttribute(`aria-label`,e.getAttribute(`aria-label`)??`Mermaid diagram`),e.replaceChildren(r),!0}function ire(e){let t=0,n=Array.from(e.querySelectorAll(`[data-mermaid-diagram]`)).map(e=>({host:e,source:e.querySelector(`pre > code`)?.textContent??``,fallback:e.cloneNode(!0)})),r=()=>{let r=++t;for(let i of n)!i.source||!i.host.isConnected||(i.host.dataset.state=`loading`,RS(i.source,i.host).then(n=>{if(r!==t||!i.host.isConnected||!e.contains(i.host))return;if(n.ok&&zS(i.host,n.svg)){i.host.dataset.state=`rendered`;return}let a=i.fallback.cloneNode(!0),o=document.createElement(`p`);o.className=`mermaid-error`,o.textContent=`Diagram could not be rendered`,i.host.replaceChildren(...Array.from(a.childNodes),o),i.host.dataset.state=`error`}))};r();let i=new MutationObserver(r);return i.observe(e.ownerDocument.documentElement,{attributes:!0,attributeFilter:[`class`,`data-theme`]}),{destroy(){t+=1,i.disconnect()}}}var are=typeof self==`object`?self:globalThis,BS=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new are[e](t)},ore=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(BS(e,t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(BS(a,o),i)};return r},VS=e=>ore(new Map,e)(0),HS=``,{toString:sre}={},{keys:cre}=Object,US=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=sre.call(e).slice(8,-1);switch(n){case`Array`:return[1,HS];case`Object`:return[2,HS];case`Date`:return[3,HS];case`RegExp`:return[4,HS];case`Map`:return[5,HS];case`Set`:return[6,HS];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},WS=([e,t])=>e===0&&(t===`function`||t===`symbol`),lre=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=US(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of cre(r))(e||!WS(US(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(WS(US(n))||WS(US(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!WS(US(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},GS=(e,{json:t,lossy:n}={})=>{let r=[];return lre(!(t||n),!!t,new Map,r)(e),r},KS=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?VS(GS(e,t)):structuredClone(e):(e,t)=>VS(GS(e,t)),qS=YS(`end`),JS=YS(`start`);function YS(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function XS(e){let t=JS(e),n=qS(e);if(t&&n)return{start:t,end:n}}var ZS=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],QS={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...ZS,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...ZS],h2:[[`className`,`sr-only`]],img:[...ZS,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...ZS,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...ZS],table:[...ZS],ul:[...ZS,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},$S={}.hasOwnProperty;function ure(e,t){let n={type:`root`,children:[]},r=eC({schema:t?{...QS,...t}:QS,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function eC(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return dre(e,n);case`doctype`:return fre(e,n);case`element`:return pre(e,n);case`root`:return mre(e,n);case`text`:return hre(e,n);default:}}}function dre(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return iC(r,t),r}}function fre(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return iC(e,t),e}}function pre(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=tC(e,t.children),i=gre(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&$S.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return iC(o,t),o}function mre(e,t){let n={type:`root`,children:tC(e,t.children)};return iC(n,t),n}function hre(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return iC(n,t),n}function tC(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=eC(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function gre(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&$S.call(r,n)?r[n]:void 0,o=r&&$S.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if($S.call(s,l)){let t=s[l],n=nC(e,aC(a,l),l,t);n??=nC(e,aC(o,l),l,t),n!=null&&(c[l]=n)}if(i&&$S.call(i,n)){let e=i[n];for(l in e)$S.call(e,l)&&!$S.call(c,l)&&(c[l]=e[l])}return c}function nC(e,t,n,r){return t?Array.isArray(r)?_re(e,t,n,r):rC(e,t,n,r):void 0}function _re(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=rC(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function rC(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&vre(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function vre(e,t,n){let r=e.schema.protocols&&$S.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function iC(e,t){let n=XS(t);t.data&&(e.data=KS(t.data)),n&&(e.position=n)}function aC(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function yre(e){return function(t){return ure(t,e)}}var bre=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],oC=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};oC.prototype.normal={},oC.prototype.property={},oC.prototype.space=void 0;function sC(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new oC(n,r,t)}function cC(e){return e.toLowerCase()}var lC=class{constructor(e,t){this.attribute=t,this.property=e}};lC.prototype.attribute=``,lC.prototype.booleanish=!1,lC.prototype.boolean=!1,lC.prototype.commaOrSpaceSeparated=!1,lC.prototype.commaSeparated=!1,lC.prototype.defined=!1,lC.prototype.mustUseProperty=!1,lC.prototype.number=!1,lC.prototype.overloadedBoolean=!1,lC.prototype.property=``,lC.prototype.spaceSeparated=!1,lC.prototype.space=void 0;var uC=e({boolean:()=>dC,booleanish:()=>fC,commaOrSpaceSeparated:()=>_C,commaSeparated:()=>gC,number:()=>mC,overloadedBoolean:()=>pC,spaceSeparated:()=>hC}),xre=0,dC=vC(),fC=vC(),pC=vC(),mC=vC(),hC=vC(),gC=vC(),_C=vC();function vC(){return 2**++xre}var yC=Object.keys(uC),bC=class extends lC{constructor(e,t,n,r){let i=-1;if(super(e,t),xC(this,`space`,r),typeof n==`number`)for(;++i<yC.length;){let e=yC[i];xC(this,yC[i],(n&uC[e])===uC[e])}}};bC.prototype.defined=!0;function xC(e,t,n){n&&(e[t]=n)}function SC(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new bC(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[cC(r)]=r,n[cC(a.attribute)]=r}return new oC(t,n,e.space)}var CC=SC({properties:{ariaActiveDescendant:null,ariaAtomic:fC,ariaAutoComplete:null,ariaBusy:fC,ariaChecked:fC,ariaColCount:mC,ariaColIndex:mC,ariaColSpan:mC,ariaControls:hC,ariaCurrent:null,ariaDescribedBy:hC,ariaDetails:null,ariaDisabled:fC,ariaDropEffect:hC,ariaErrorMessage:null,ariaExpanded:fC,ariaFlowTo:hC,ariaGrabbed:fC,ariaHasPopup:null,ariaHidden:fC,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:hC,ariaLevel:mC,ariaLive:null,ariaModal:fC,ariaMultiLine:fC,ariaMultiSelectable:fC,ariaOrientation:null,ariaOwns:hC,ariaPlaceholder:null,ariaPosInSet:mC,ariaPressed:fC,ariaReadOnly:fC,ariaRelevant:null,ariaRequired:fC,ariaRoleDescription:hC,ariaRowCount:mC,ariaRowIndex:mC,ariaRowSpan:mC,ariaSelected:fC,ariaSetSize:mC,ariaSort:null,ariaValueMax:mC,ariaValueMin:mC,ariaValueNow:mC,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function wC(e,t){return t in e?e[t]:t}function TC(e,t){return wC(e,t.toLowerCase())}var Sre=SC({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:gC,acceptCharset:hC,accessKey:hC,action:null,allow:null,allowFullScreen:dC,allowPaymentRequest:dC,allowUserMedia:dC,alt:null,as:null,async:dC,autoCapitalize:null,autoComplete:hC,autoFocus:dC,autoPlay:dC,blocking:hC,capture:null,charSet:null,checked:dC,cite:null,className:hC,cols:mC,colSpan:null,content:null,contentEditable:fC,controls:dC,controlsList:hC,coords:mC|gC,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dC,defer:dC,dir:null,dirName:null,disabled:dC,download:pC,draggable:fC,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dC,formTarget:null,headers:hC,height:mC,hidden:pC,high:mC,href:null,hrefLang:null,htmlFor:hC,httpEquiv:hC,id:null,imageSizes:null,imageSrcSet:null,inert:dC,inputMode:null,integrity:null,is:null,isMap:dC,itemId:null,itemProp:hC,itemRef:hC,itemScope:dC,itemType:hC,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dC,low:mC,manifest:null,max:null,maxLength:mC,media:null,method:null,min:null,minLength:mC,multiple:dC,muted:dC,name:null,nonce:null,noModule:dC,noValidate:dC,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:dC,optimum:mC,pattern:null,ping:hC,placeholder:null,playsInline:dC,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dC,referrerPolicy:null,rel:hC,required:dC,reversed:dC,rows:mC,rowSpan:mC,sandbox:hC,scope:null,scoped:dC,seamless:dC,selected:dC,shadowRootClonable:dC,shadowRootDelegatesFocus:dC,shadowRootMode:null,shape:null,size:mC,sizes:null,slot:null,span:mC,spellCheck:fC,src:null,srcDoc:null,srcLang:null,srcSet:null,start:mC,step:null,style:null,tabIndex:mC,target:null,title:null,translate:null,type:null,typeMustMatch:dC,useMap:null,value:fC,width:mC,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:hC,axis:null,background:null,bgColor:null,border:mC,borderColor:null,bottomMargin:mC,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dC,declare:dC,event:null,face:null,frame:null,frameBorder:null,hSpace:mC,leftMargin:mC,link:null,longDesc:null,lowSrc:null,marginHeight:mC,marginWidth:mC,noResize:dC,noHref:dC,noShade:dC,noWrap:dC,object:null,profile:null,prompt:null,rev:null,rightMargin:mC,rules:null,scheme:null,scrolling:fC,standby:null,summary:null,text:null,topMargin:mC,valueType:null,version:null,vAlign:null,vLink:null,vSpace:mC,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dC,disableRemotePlayback:dC,prefix:null,property:null,results:mC,security:null,unselectable:null},space:`html`,transform:TC}),Cre=SC({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:_C,accentHeight:mC,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:mC,amplitude:mC,arabicForm:null,ascent:mC,attributeName:null,attributeType:null,azimuth:mC,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:mC,by:null,calcMode:null,capHeight:mC,className:hC,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:mC,diffuseConstant:mC,direction:null,display:null,dur:null,divisor:mC,dominantBaseline:null,download:dC,dx:null,dy:null,edgeMode:null,editable:null,elevation:mC,enableBackground:null,end:null,event:null,exponent:mC,externalResourcesRequired:null,fill:null,fillOpacity:mC,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:gC,g2:gC,glyphName:gC,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:mC,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:mC,horizOriginX:mC,horizOriginY:mC,id:null,ideographic:mC,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:mC,k:mC,k1:mC,k2:mC,k3:mC,k4:mC,kernelMatrix:_C,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:mC,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:mC,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:mC,overlineThickness:mC,paintOrder:null,panose1:null,path:null,pathLength:mC,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:hC,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:mC,pointsAtY:mC,pointsAtZ:mC,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_C,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_C,rev:_C,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_C,requiredFeatures:_C,requiredFonts:_C,requiredFormats:_C,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:mC,specularExponent:mC,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:mC,strikethroughThickness:mC,string:null,stroke:null,strokeDashArray:_C,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:mC,strokeOpacity:mC,strokeWidth:null,style:null,surfaceScale:mC,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_C,tabIndex:mC,tableValues:null,target:null,targetX:mC,targetY:mC,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_C,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:mC,underlineThickness:mC,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:mC,values:null,vAlphabetic:mC,vMathematical:mC,vectorEffect:null,vHanging:mC,vIdeographic:mC,version:null,vertAdvY:mC,vertOriginX:mC,vertOriginY:mC,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:mC,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:wC}),EC=SC({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),DC=SC({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:TC}),OC=SC({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),wre=/[A-Z]/g,kC=/-[a-z]/g,Tre=/^data[-\w.:]+$/i;function Ere(e,t){let n=cC(t),r=t,i=lC;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Tre.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(kC,Ore);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!kC.test(e)){let n=e.replace(wre,Dre);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=bC}return new i(r,t)}function Dre(e){return`-`+e.toLowerCase()}function Ore(e){return e.charAt(1).toUpperCase()}var kre=sC([CC,Sre,EC,DC,OC],`html`),AC=sC([CC,Cre,EC,DC,OC],`svg`),jC={}.hasOwnProperty;function Are(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&jC.call(t,e)){let n=String(t[e]);i=jC.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var jre=/["&'<>`]/g,Mre=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Nre=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Pre=/[|\\{}()[\]^$+*?.]/g,MC=new WeakMap;function Fre(e,t){if(e=e.replace(t.subset?Ire(t.subset):jre,r),t.subset||t.escapeOnly)return e;return e.replace(Mre,n).replace(Nre,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Ire(e){let t=MC.get(e);return t||(t=Lre(e),MC.set(e,t)),t}function Lre(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Pre,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Rre=/[\dA-Fa-f]/;function zre(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Rre.test(String.fromCharCode(t))?r:r+`;`}var Bre=/\d/;function Vre(e,t,n){let r=`&#`+String(e);return n&&t&&!Bre.test(String.fromCharCode(t))?r:r+`;`}var Hre=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),NC={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},Ure=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],PC={}.hasOwnProperty,FC={},IC;for(IC in NC)PC.call(NC,IC)&&(FC[NC[IC]]=IC);var Wre=/[^\dA-Za-z]/;function Gre(e,t,n,r){let i=String.fromCharCode(e);if(PC.call(FC,i)){let e=FC[i],a=`&`+e;return n&&Hre.includes(e)&&!Ure.includes(e)&&(!r||t&&t!==61&&Wre.test(String.fromCharCode(t)))?a:a+`;`}return``}function Kre(e,t,n){let r=zre(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Gre(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Vre(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function LC(e,t){return Fre(e,Object.assign({format:Kre},t))}var qre=/^>|^->|<!--|-->|--!>|<!-$/g,Jre=[`>`],Yre=[`<`,`>`];function Xre(e,t,n,r){return r.settings.bogusComments?`<?`+LC(e.value,Object.assign({},r.settings.characterReferences,{subset:Jre}))+`>`:`<!--`+e.value.replace(qre,i)+`-->`;function i(e){return LC(e,Object.assign({},r.settings.characterReferences,{subset:Yre}))}}function Zre(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function RC(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Qre(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function $re(e){return e.join(` `).trim()}var eie=/[ \t\n\f\r]/g;function zC(e){return typeof e==`object`?e.type===`text`?BC(e.value):!1:BC(e)}function BC(e){return e.replace(eie,``)===``}var VC=UC(1),HC=UC(-1),tie=[];function UC(e){return t;function t(t,n,r){let i=t?t.children:tie,a=(n||0)+e,o=i[a];if(!r)for(;o&&zC(o);)a+=e,o=i[a];return o}}var nie={}.hasOwnProperty;function WC(e){return t;function t(t,n,r){return nie.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var GC=WC({body:iie,caption:KC,colgroup:KC,dd:cie,dt:sie,head:KC,html:rie,li:oie,optgroup:lie,option:uie,p:aie,rp:qC,rt:qC,tbody:fie,td:JC,tfoot:pie,th:JC,thead:die,tr:mie});function KC(e,t,n){let r=VC(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&zC(r.value.charAt(0)))}function rie(e,t,n){let r=VC(n,t);return!r||r.type!==`comment`}function iie(e,t,n){let r=VC(n,t);return!r||r.type!==`comment`}function aie(e,t,n){let r=VC(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function oie(e,t,n){let r=VC(n,t);return!r||r.type===`element`&&r.tagName===`li`}function sie(e,t,n){let r=VC(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function cie(e,t,n){let r=VC(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function qC(e,t,n){let r=VC(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function lie(e,t,n){let r=VC(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function uie(e,t,n){let r=VC(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function die(e,t,n){let r=VC(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function fie(e,t,n){let r=VC(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function pie(e,t,n){return!VC(n,t)}function mie(e,t,n){let r=VC(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function JC(e,t,n){let r=VC(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var hie=WC({body:vie,colgroup:yie,head:_ie,html:gie,tbody:bie});function gie(e){let t=VC(e,-1);return!t||t.type!==`comment`}function _ie(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function vie(e){let t=VC(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&zC(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function yie(e,t,n){let r=HC(n,t),i=VC(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&GC(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function bie(e,t,n){let r=HC(n,t),i=VC(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&GC(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var YC={name:[[`
33
- \f\r &/=>`.split(``),`
34
- \f\r "&'/=>\``.split(``)],[`\0
35
- \f\r "&'/<=>`.split(``),`\0
36
- \f\r "&'/<=>\``.split(``)]],unquoted:[[`
37
- \f\r &>`.split(``),`\0
38
- \f\r "&'<=>\``.split(``)],[`\0
39
- \f\r "&'<=>\``.split(``),`\0
40
- \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function xie(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=AC);let l=Sie(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!hie(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!GC(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Sie(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Cie(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Cie(e,t,n){let r=Ere(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=LC(r.attribute,Object.assign({},e.settings.characterReferences,{subset:YC.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Qre:$re)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=LC(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:YC.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&RC(n,o)>RC(n,e.alternative)&&(o=e.alternative),s=o+LC(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?YC.single:YC.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var wie=[`<`,`&`];function XC(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:LC(e.value,Object.assign({},r.settings.characterReferences,{subset:wie}))}function Tie(e,t,n,r){return r.settings.allowDangerousHtml?e.value:XC(e,t,n,r)}function Eie(e,t,n,r){return r.all(e)}var Die=Are(`type`,{invalid:Oie,unknown:kie,handlers:{comment:Xre,doctype:Zre,element:xie,raw:Tie,root:Eie,text:XC}});function Oie(e){throw Error("Expected node, not `"+e+"`")}function kie(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Aie={},jie={},Mie=[];function ZC(e,t){let n=t||Aie,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Nie,all:Pie,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||bre,characterReferences:n.characterReferences||jie,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?AC:kre,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Nie(e,t,n){return Die(e,t,n,this)}function Pie(e){let t=[],n=e&&e.children||Mie,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function Fie(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return ZC(e,n)}}function Iie(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}var QC=(function(e){if(e==null)return Bie;if(typeof e==`function`)return $C(e);if(typeof e==`object`)return Array.isArray(e)?Lie(e):Rie(e);if(typeof e==`string`)return zie(e);throw Error(`Expected function, string, or object as test`)});function Lie(e){let t=[],n=-1;for(;++n<e.length;)t[n]=QC(e[n]);return $C(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Rie(e){let t=e;return $C(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function zie(e){return $C(t);function t(t){return t&&t.type===e}}function $C(e){return t;function t(t,n,r){return!!(Vie(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Bie(){return!0}function Vie(e){return typeof e==`object`&&!!e&&`type`in e}function Hie(e){return e}var ew=[];function tw(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=QC(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Hie(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=ew,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Uie(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Uie(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?ew:[e]}function nw(e,t,n){let r=QC((n||{}).ignore||[]),i=Wie(t),a=-1;for(;++a<i.length;)tw(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Wie(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Gie(e[0]),Kie(e[1])])}return t}function Gie(e){return typeof e==`string`?new RegExp(Iie(e),`g`):e}function Kie(e){return typeof e==`function`?e:function(){return e}}function qie(e){nw(e,[/\r?\n|\r/g,Jie])}function Jie(){return{type:`break`}}function Yie(){return function(e){qie(e)}}var rw=fw(/[A-Za-z]/),iw=fw(/[\dA-Za-z]/),Xie=fw(/[#-'*+\--9=?A-Z^-~]/);function aw(e){return e!==null&&(e<32||e===127)}var ow=fw(/\d/),Zie=fw(/[\dA-Fa-f]/),Qie=fw(/[!-/:-@[-`{-~]/);function sw(e){return e!==null&&e<-2}function cw(e){return e!==null&&(e<0||e===32)}function lw(e){return e===-2||e===-1||e===32}var uw=fw(/\p{P}|\p{S}/u),dw=fw(/\s/);function fw(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var pw=`phrasing`,mw=[`autolink`,`link`,`image`,`label`];function $ie(){return{transforms:[oae],enter:{literalAutolink:tae,literalAutolinkEmail:hw,literalAutolinkHttp:hw,literalAutolinkWww:hw},exit:{literalAutolink:aae,literalAutolinkEmail:iae,literalAutolinkHttp:nae,literalAutolinkWww:rae}}}function eae(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:pw,notInConstruct:mw},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:pw,notInConstruct:mw},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:pw,notInConstruct:mw}]}}function tae(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function hw(e){this.config.enter.autolinkProtocol.call(this,e)}function nae(e){this.config.exit.autolinkProtocol.call(this,e)}function rae(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function iae(e){this.config.exit.autolinkEmail.call(this,e)}function aae(e){this.exit(e)}function oae(e){nw(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,sae],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,cae]],{ignore:[`link`,`linkReference`]})}function sae(e,t,n,r,i){let a=``;if(!gw(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!lae(n)))return!1;let o=uae(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function cae(e,t,n,r){return!gw(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function lae(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function uae(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=RC(e,`(`),a=RC(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function gw(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||dw(n)||uw(n))&&(!t||n!==47)}function _w(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}vw.peek=yae;function dae(){this.buffer()}function fae(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function pae(){this.buffer()}function mae(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function hae(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_w(this.sliceSerialize(e)).toLowerCase(),n.label=t}function gae(e){this.exit(e)}function _ae(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_w(this.sliceSerialize(e)).toLowerCase(),n.label=t}function vae(e){this.exit(e)}function yae(){return`[`}function vw(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function bae(){return{enter:{gfmFootnoteCallString:dae,gfmFootnoteCall:fae,gfmFootnoteDefinitionLabelString:pae,gfmFootnoteDefinition:mae},exit:{gfmFootnoteCallString:hae,gfmFootnoteCall:gae,gfmFootnoteDefinitionLabelString:_ae,gfmFootnoteDefinition:vae}}}function xae(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:vw},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
41
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?yw:Sae))),s(),o}}function Sae(e,t,n){return t===0?e:yw(e,t,n)}function yw(e,t,n){return(n?``:` `)+e}var Cae=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];bw.peek=xw;function wae(){return{canContainEols:[`delete`],enter:{strikethrough:Eae},exit:{strikethrough:Dae}}}function Tae(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Cae}],handlers:{delete:bw}}}function Eae(e){this.enter({type:`delete`,children:[]},e)}function Dae(e){this.exit(e)}function bw(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function xw(){return`~`}function Sw(e){return e.length}function Cw(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Sw,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=ww(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Tw(r[d]);else{let e=Tw(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
42
- `)}function ww(e){return e==null?``:String(e)}function Tw(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Ew(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Dw);return i(),o}function Dw(e,t,n){return`>`+(n?``:` `)+e}function Ow(e,t){return kw(e,t.inConstruct,!0)&&!kw(e,t.notInConstruct,!1)}function kw(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Aw(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
43
- `&&Ow(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
44
- `}function jw(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Mw(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Nw(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Pw(e,t,n,r){let i=Nw(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Mw(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Fw);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(jw(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
45
- `,encode:["`"],...s.current()})),t()}return u+=s.move(`
46
- `),a&&(u+=s.move(a+`
47
- `)),u+=s.move(c),l(),u}function Fw(e,t,n){return(n?``:` `)+e}function Iw(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Lw(e,t,n,r){let i=Iw(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
48
- `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Rw(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function zw(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Bw(e){if(e===null||cw(e)||dw(e))return 1;if(uw(e))return 2}function Vw(e,t,n){let r=Bw(e),i=Bw(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Hw.peek=Uw;function Hw(e,t,n,r){let i=Rw(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Vw(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=zw(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Vw(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+zw(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Uw(e,t,n){return n.options.emphasis||`*`}function Ww(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),tw(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Gw={};function Kw(e,t){let n=t||Gw;return qw(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function qw(e,t,n){if(Yw(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Jw(e.children,t,n)}return Array.isArray(e)?Jw(e,t,n):``}function Jw(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=qw(e[i],t,n);return r.join(``)}function Yw(e){return!!(e&&typeof e==`object`)}function Xw(e,t){let n=!1;return Ww(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Kw(e)&&(t.options.setext||n))}function Zw(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Xw(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
49
- `,after:`
50
- `});return r(),t(),o+`
51
- `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
52
- `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
53
- `,...a.current()});return/^[\t ]/.test(l)&&(l=zw(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Qw.peek=$w;function Qw(e){return e.value||``}function $w(){return`<`}eT.peek=tT;function eT(e,t,n,r){let i=Iw(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function tT(){return`!`}nT.peek=rT;function nT(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function rT(){return`!`}iT.peek=aT;function iT(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function aT(){return"`"}function oT(e,t){let n=Kw(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}sT.peek=cT;function sT(e,t,n,r){let i=Iw(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(oT(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function cT(e,t,n){return oT(e,n)?`<`:`[`}lT.peek=uT;function lT(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function uT(){return`[`}function dT(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function fT(e){let t=dT(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function pT(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function mT(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function hT(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?pT(n):dT(n),s=e.ordered?o===`.`?`)`:`.`:fT(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),mT(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function gT(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function _T(e,t,n,r){let i=gT(n),a=n.bulletCurrent||dT(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function vT(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var yT=QC([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function bT(e,t,n,r){return(e.children.some(function(e){return yT(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function xT(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ST.peek=CT;function ST(e,t,n,r){let i=xT(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Vw(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=zw(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Vw(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+zw(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function CT(e,t,n){return n.options.strong||`*`}function wT(e,t,n,r){return n.safe(e.value,r)}function TT(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function ET(e,t,n){let r=(mT(n)+(n.options.ruleSpaces?` `:``)).repeat(TT(n));return n.options.ruleSpaces?r.slice(0,-1):r}var DT={blockquote:Ew,break:Aw,code:Pw,definition:Lw,emphasis:Hw,hardBreak:Aw,heading:Zw,html:Qw,image:eT,imageReference:nT,inlineCode:iT,link:sT,linkReference:lT,list:hT,listItem:_T,paragraph:vT,root:bT,strong:ST,text:wT,thematicBreak:ET},OT=document.createElement(`i`);function kT(e){let t=`&`+e+`;`;OT.innerHTML=t;let n=OT.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function AT(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var jT=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function MT(e){return e.replace(jT,NT)}function NT(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return AT(n.slice(t?2:1),t?16:10)}return kT(n)||e}function PT(){return{enter:{table:FT,tableData:zT,tableHeader:zT,tableRow:LT},exit:{codeText:BT,table:IT,tableData:RT,tableHeader:RT,tableRow:RT}}}function FT(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function IT(e){this.exit(e),this.data.inTable=void 0}function LT(e){this.enter({type:`tableRow`,children:[]},e)}function RT(e){this.exit(e)}function zT(e){this.enter({type:`tableCell`,children:[]},e)}function BT(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,VT));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function VT(e,t){return t===`|`?t:e}function HT(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
54
- `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
55
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Cw(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=DT.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function UT(){return{exit:{taskListCheckValueChecked:GT,taskListCheckValueUnchecked:GT,paragraph:KT}}}function WT(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:qT}}}function GT(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function KT(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function qT(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=DT.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function JT(){return[$ie(),bae(),wae(),PT(),UT()]}function YT(e){return{extensions:[eae(),xae(e),Tae(),HT(e),WT()]}}function XT(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function ZT(e,t){return e.length>0?(XT(e,e.length,0,t),e):t}var QT={}.hasOwnProperty;function $T(e){let t={},n=-1;for(;++n<e.length;)eE(t,e[n]);return t}function eE(e,t){let n;for(n in t){let r=(QT.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){QT.call(r,a)||(r[a]=[]);let e=i[a];tE(r[a],Array.isArray(e)?e:e?[e]:[])}}}function tE(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);XT(e,0,0,r)}var nE={tokenize:gE,partial:!0},rE={tokenize:_E,partial:!0},iE={tokenize:vE,partial:!0},aE={tokenize:yE,partial:!0},oE={tokenize:bE,partial:!0},sE={name:`wwwAutolink`,tokenize:mE,previous:xE},cE={name:`protocolAutolink`,tokenize:hE,previous:SE},lE={name:`emailAutolink`,tokenize:pE,previous:CE},uE={};function dE(){return{text:uE}}for(var fE=48;fE<123;)uE[fE]=lE,fE++,fE===58?fE=65:fE===91&&(fE=97);uE[43]=lE,uE[45]=lE,uE[46]=lE,uE[95]=lE,uE[72]=[lE,cE],uE[104]=[lE,cE],uE[87]=[lE,sE],uE[119]=[lE,sE];function pE(e,t,n){let r=this,i,a;return o;function o(t){return!wE(t)||!CE.call(r,r.previous)||TE(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return wE(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(oE,u,l)(t):t===45||t===95||iw(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&rw(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function mE(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!xE.call(r,r.previous)||TE(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(nE,e.attempt(rE,e.attempt(iE,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function hE(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&SE.call(r,r.previous)&&!TE(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(rw(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||aw(t)||cw(t)||dw(t)||uw(t)?n(t):e.attempt(rE,e.attempt(iE,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function gE(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function _E(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(aE,c,s)(t):t===null||cw(t)||dw(t)||t!==45&&uw(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function vE(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(aE,t,a)(o):o===null||cw(o)||dw(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function yE(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||cw(o)||dw(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||cw(e)||dw(e)?t(e):r(e)}function a(e){return rw(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):rw(t)?(e.consume(t),o):n(t)}}function bE(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return iw(e)?n(e):t(e)}}function xE(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||cw(e)}function SE(e){return!rw(e)}function CE(e){return!(e===47||wE(e))}function wE(e){return e===43||e===45||e===46||e===95||iw(e)}function TE(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function EE(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&iw(e.charCodeAt(n+1))&&iw(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function DE(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var OE={name:`attention`,resolveAll:kE,tokenize:AE};function kE(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};jE(d,-c),jE(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=ZT(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=ZT(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=ZT(l,DE(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ZT(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=ZT(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,XT(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function AE(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Bw(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Bw(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function jE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var ME={name:`autolink`,tokenize:NE};function NE(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return rw(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||iw(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||iw(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||aw(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Xie(t)?(e.consume(t),l):n(t)}function u(e){return iw(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||iw(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function PE(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return lw(r)?(e.enter(n),s(r)):t(r)}function s(r){return lw(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var FE={partial:!0,tokenize:IE};function IE(e,t,n){return r;function r(t){return lw(t)?PE(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||sw(e)?t(e):n(e)}}var LE={continuation:{tokenize:zE},exit:BE,name:`blockQuote`,tokenize:RE};function RE(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return lw(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function zE(e,t,n){let r=this;return i;function i(t){return lw(t)?PE(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(LE,t,n)(r)}}function BE(e){e.exit(`blockQuote`)}var VE={name:`characterEscape`,tokenize:HE};function HE(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Qie(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var UE={name:`characterReference`,tokenize:WE};function WE(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=iw,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Zie,u):(e.enter(`characterReferenceValue`),a=7,o=ow,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===iw&&!kT(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var GE={partial:!0,tokenize:JE},KE={concrete:!0,name:`codeFenced`,tokenize:qE};function qE(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),lw(t)?PE(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||sw(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(GE,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||sw(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):lw(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),PE(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||sw(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||sw(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&lw(t)?PE(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||sw(t)?e.check(GE,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||sw(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),lw(t)?PE(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),lw(t)?PE(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||sw(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function JE(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var YE={name:`codeIndented`,tokenize:ZE},XE={partial:!0,tokenize:QE};function ZE(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),PE(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):sw(t)?e.attempt(XE,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||sw(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function QE(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):sw(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):PE(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):sw(e)?i(e):n(e)}}var $E={name:`codeText`,previous:tD,resolve:eD,tokenize:nD};function eD(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function tD(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function nD(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):sw(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||sw(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var rD=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&iD(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),iD(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),iD(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);iD(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);iD(this.left,t.reverse())}}};function iD(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function aD(e){let t={},n=-1,r,i,a,o,s,c,l,u=new rD(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,oD(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return XT(e,0,1/0,u.slice(0)),!l}function oD(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var sD={resolve:lD,tokenize:uD},cD={partial:!0,tokenize:dD};function lD(e){return aD(e),e}function uD(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):sw(t)?e.check(cD,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function dD(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),PE(e,a,`linePrefix`)}function a(i){if(i===null||sw(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function fD(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||aw(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||sw(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||cw(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||aw(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function pD(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):sw(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||sw(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!lw(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function mD(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):sw(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),PE(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||sw(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function hD(e,t){let n;return r;function r(i){return sw(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):lw(i)?PE(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var gD={name:`definition`,tokenize:vD},_D={partial:!0,tokenize:yD};function vD(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return pD.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=_w(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return cw(t)?hD(e,l)(t):l(t)}function l(t){return fD(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(_D,d,d)(t)}function d(t){return lw(t)?PE(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||sw(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function yD(e,t,n){return r;function r(t){return cw(t)?hD(e,i)(t):n(t)}function i(t){return mD(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return lw(t)?PE(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||sw(e)?t(e):n(e)}}var bD={name:`hardBreakEscape`,tokenize:xD};function xD(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return sw(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var SD={name:`headingAtx`,resolve:CD,tokenize:wD};function CD(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},XT(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function wD(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||cw(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||sw(n)?(e.exit(`atxHeading`),t(n)):lw(n)?PE(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||cw(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var TD=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),ED=[`pre`,`script`,`style`,`textarea`],DD={concrete:!0,name:`htmlFlow`,resolveTo:AD,tokenize:jD},OD={partial:!0,tokenize:ND},kD={partial:!0,tokenize:MD};function AD(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function jD(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ne):rw(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):rw(a)?(e.consume(a),i=4,r.interrupt?t:ne):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ne):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return rw(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||cw(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&ED.includes(l)?(i=1,r.interrupt?t(s):O(s)):TD.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||iw(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return lw(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||rw(t)?(e.consume(t),b):lw(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||iw(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):lw(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):lw(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||sw(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||cw(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||lw(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||sw(t)?O(t):lw(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),P):t===63&&i===3?(e.consume(t),ne):t===93&&i===5?(e.consume(t),te):sw(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(OD,re,k)(t)):t===null||sw(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(kD,ee,re)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),A}function A(t){return t===null||sw(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),ne):O(t)}function M(t){return t===47?(e.consume(t),o=``,N):O(t)}function N(t){if(t===62){let n=o.toLowerCase();return ED.includes(n)?(e.consume(t),P):O(t)}return rw(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):O(t)}function te(t){return t===93?(e.consume(t),ne):O(t)}function ne(t){return t===62?(e.consume(t),P):t===45&&i===2?(e.consume(t),ne):O(t)}function P(t){return t===null||sw(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),P)}function re(n){return e.exit(`htmlFlow`),t(n)}}function MD(e,t,n){let r=this;return i;function i(t){return sw(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function ND(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(FE,t,n)}}var PD={name:`htmlText`,tokenize:FD};function FD(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):rw(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):rw(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):sw(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):sw(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):sw(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):sw(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return rw(t)?(e.consume(t),S):n(t)}function S(t){return t===45||iw(t)?(e.consume(t),S):C(t)}function C(t){return sw(t)?(o=C,M(t)):lw(t)?(e.consume(t),C):j(t)}function w(t){return t===45||iw(t)?(e.consume(t),w):t===47||t===62||cw(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||rw(t)?(e.consume(t),E):sw(t)?(o=T,M(t)):lw(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||iw(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):sw(t)?(o=D,M(t)):lw(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):sw(t)?(o=O,M(t)):lw(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,A):t===null?n(t):sw(t)?(o=k,M(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||cw(t)?T(t):(e.consume(t),ee)}function A(e){return e===47||e===62||cw(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),N}function N(t){return lw(t)?PE(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var ID={name:`labelEnd`,resolveAll:BD,resolveTo:VD,tokenize:HD},LD={tokenize:UD},RD={tokenize:WD},zD={tokenize:GD};function BD(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&XT(e,0,e.length,n),e}function VD(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=ZT(s,e.slice(a+1,a+r+3)),s=ZT(s,[[`enter`,u,t]]),s=ZT(s,DE(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=ZT(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=ZT(s,e.slice(o+1)),s=ZT(s,[[`exit`,c,t]]),XT(e,a,e.length,s),e}function HD(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(_w(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(LD,u,o?u:d)(t):t===91?e.attempt(RD,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(zD,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function UD(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return cw(t)?hD(e,a)(t):a(t)}function a(t){return t===41?u(t):fD(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return cw(t)?hD(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?mD(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return cw(t)?hD(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function WD(e,t,n){let r=this;return i;function i(t){return pD.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(_w(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function GD(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var KD={name:`labelStartImage`,resolveAll:ID.resolveAll,tokenize:qD};function qD(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var JD={name:`labelStartLink`,resolveAll:ID.resolveAll,tokenize:YD};function YD(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var XD={name:`lineEnding`,tokenize:ZD};function ZD(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),PE(e,t,`linePrefix`)}}var QD={name:`thematicBreak`,tokenize:$D};function $D(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||sw(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),lw(t)?PE(e,s,`whitespace`)(t):s(t))}}var eO={continuation:{tokenize:iO},exit:oO,name:`list`,tokenize:rO},tO={partial:!0,tokenize:sO},nO={partial:!0,tokenize:aO};function rO(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:ow(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(QD,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return ow(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(FE,r.interrupt?n:u,e.attempt(tO,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return lw(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function iO(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(FE,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,PE(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!lw(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(nO,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,PE(e,e.attempt(eO,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function aO(e,t,n){let r=this;return PE(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function oO(e){e.exit(this.containerState.type)}function sO(e,t,n){let r=this;return PE(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!lw(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var cO={name:`setextUnderline`,resolveTo:lO,tokenize:uO};function lO(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function uO(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),lw(t)?PE(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||sw(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var dO={tokenize:yO,partial:!0};function fO(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:gO,continuation:{tokenize:_O},exit:vO}},text:{91:{name:`gfmFootnoteCall`,tokenize:hO},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:pO,resolveTo:mO}}}}function pO(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=_w(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function mO(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function hO(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||cw(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(_w(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return cw(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function gO(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||cw(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=_w(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return cw(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),PE(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function _O(e,t,n){return e.check(FE,t,e.attempt(dO,t,n))}function vO(e){e.exit(`gfmFootnoteDefinition`)}function yO(e,t,n){let r=this;return PE(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function bO(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&XT(o,o.length,0,DE(s,e.slice(r+1,n),t)),XT(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),XT(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Bw(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Bw(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var xO=class{constructor(){this.map=[]}add(e,t,n){SO(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function SO(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function CO(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function wO(){return{flow:{null:{name:`table`,tokenize:TO,resolveAll:EO}}}}function TO(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):sw(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):lw(t)?PE(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||cw(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,lw(t)?PE(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return lw(t)?PE(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||sw(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return lw(t)?PE(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||sw(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||sw(n)?(e.exit(`tableRow`),t(n)):lw(n)?PE(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||cw(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function EO(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new xO;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(OO(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=DO(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=DO(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=DO(f,t,o,i,n,d)):(o[0]=o[1],d=DO(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&OO(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=CO(t.events,n))}return e}function DO(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},kO(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=kO(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=kO(t.events,n[2]),a=kO(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},kO(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function OO(e,t,n,r,i){let a=[],o=kO(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function kO(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var AO={name:`tasklistCheck`,tokenize:MO};function jO(){return{text:{91:AO}}}function MO(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return cw(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return sw(r)?t(r):lw(r)?e.check({tokenize:NO},t,n)(r):n(r)}}function NO(e,t,n){return PE(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function PO(e){return $T([dE(),fO(),bO(e),wO(),jO()])}var FO={};function IO(e){let t=this,n=e||FO,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(PO(n)),a.push(JT()),o.push(YT(n))}var LO={tokenize:RO};function RO(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),PE(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return sw(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var zO={tokenize:VO},BO={tokenize:HO};function VO(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return XT(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(BO,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(BO,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return sw(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;XT(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function HO(e,t,n){return PE(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var UO={tokenize:WO};function WO(e){let t=this,n=e.attempt(FE,r,e.attempt(this.parser.constructs.flowInitial,i,PE(e,e.attempt(this.parser.constructs.flow,i,e.attempt(sD,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var GO={resolveAll:YO()},KO=JO(`string`),qO=JO(`text`);function JO(e){return{resolveAll:YO(e===`text`?XO:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function YO(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function XO(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var ZO=e({attentionMarkers:()=>ak,contentInitial:()=>$O,disable:()=>ok,document:()=>QO,flow:()=>tk,flowInitial:()=>ek,insideSpan:()=>ik,string:()=>nk,text:()=>rk}),QO={42:eO,43:eO,45:eO,48:eO,49:eO,50:eO,51:eO,52:eO,53:eO,54:eO,55:eO,56:eO,57:eO,62:LE},$O={91:gD},ek={[-2]:YE,[-1]:YE,32:YE},tk={35:SD,42:QD,45:[cO,QD],60:DD,61:cO,95:QD,96:KE,126:KE},nk={38:UE,92:VE},rk={[-5]:XD,[-4]:XD,[-3]:XD,33:KD,38:UE,42:OE,60:[ME,PD],91:JD,92:[bD,VE],93:ID,95:OE,96:$E},ik={null:[OE,GO]},ak={null:[42,95]},ok={null:[]};function sk(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=ZT(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=DE(a,l.events,l),l.events):[]}function f(e,t){return lk(p(e),t)}function p(e){return ck(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){sw(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&XT(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function ck(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function lk(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
56
- `;break;case-3:o=`\r
57
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function uk(e){let t={constructs:$T([ZO,...(e||{}).extensions||[]]),content:n(LO),defined:[],document:n(zO),flow:n(UO),lazy:{},string:n(KO),text:n(qO)};return t;function n(e){return n;function n(n){return sk(t,e,n)}}}function dk(e){for(;!aD(e););return e}var fk=/[\0\t\n\r]/g;function pk(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(fk.lastIndex=u,c=fk.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}function mk(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?gk(e.position):`start`in e||`end`in e?gk(e):`line`in e||`column`in e?hk(e):``}function hk(e){return _k(e&&e.line)+`:`+_k(e&&e.column)}function gk(e){return hk(e&&e.start)+`-`+hk(e&&e.end)}function _k(e){return e&&typeof e==`number`?e:1}var vk={}.hasOwnProperty;function yk(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),bk(n)(dk(uk(n).document().write(pk()(e,t,!0))))}function bk(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(pe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(de),blockQuote:a(se),characterEscape:T,characterReference:T,codeFenced:a(ce),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ce,o),codeText:a(z,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(le),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ue),hardBreakEscape:a(fe),hardBreakTrailing:a(fe),htmlFlow:a(B,o),htmlFlowData:T,htmlText:a(B,o),htmlTextData:T,image:a(V),label:o,link:a(pe),listItem:a(he),listItemValue:f,listOrdered:a(me,d),listUnordered:a(me),paragraph:a(ge),reference:ie,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(de),strong:a(H),thematicBreak:a(ve)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:oe,autolinkProtocol:R,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:I,characterReferenceMarkerNumeric:I,characterReferenceValue:L,characterReference:ae,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(A),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(ee),htmlTextData:E,image:c(M),label:te,labelText:N,lineEnding:D,link:c(j),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:F,resourceDestinationString:ne,resourceTitleString:P,resource:re,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Sk(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];vk.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||wk).call(a,void 0,e[0])}for(r.position={start:xk(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:xk(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:xk(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||wk).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+mk({start:e.start,end:e.end})+`): it’s not open`);n.position.end=xk(e.end)}function u(){return Kw(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=_w(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=_e(),n.position={start:xk(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=xk(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=xk(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=MT(t),n.identifier=_w(t).toLowerCase()}function te(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function re(){this.data.inReference=void 0}function ie(){this.data.referenceType=`collapsed`}function F(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=_w(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function I(e){this.data.characterReferenceType=e.type}function L(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=AT(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=kT(t);let i=this.stack[this.stack.length-1];i.value+=r}function ae(e){let t=this.stack.pop();t.position.end=xk(e.end)}function R(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function oe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function se(){return{type:`blockquote`,children:[]}}function ce(){return{type:`code`,lang:null,meta:null,value:``}}function z(){return{type:`inlineCode`,value:``}}function le(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ue(){return{type:`emphasis`,children:[]}}function de(){return{type:`heading`,depth:0,children:[]}}function fe(){return{type:`break`}}function B(){return{type:`html`,value:``}}function V(){return{type:`image`,title:null,url:``,alt:null}}function pe(){return{type:`link`,title:null,url:``,children:[]}}function me(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function he(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ge(){return{type:`paragraph`,children:[]}}function H(){return{type:`strong`,children:[]}}function _e(){return{type:`text`,value:``}}function ve(){return{type:`thematicBreak`}}}function xk(e){return{line:e.line,column:e.column,offset:e.offset}}function Sk(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Sk(e,r):Ck(e,r)}}function Ck(e,t){let n;for(n in t)if(vk.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function wk(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+mk({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+mk({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+mk({start:t.start,end:t.end})+`) is still open`)}function Tk(e){let t=this;t.parser=n;function n(n){return yk(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Ek(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Dk(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
58
- `}]}function Ok(e,t){let n=t.value?t.value+`
59
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function kk(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ak(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jk(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=EE(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Mk(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nk(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Pk(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Fk(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Pk(e,t);let i={src:EE(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Ik(e,t){let n={src:EE(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Lk(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Rk(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Pk(e,t);let i={href:EE(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function zk(e,t){let n={href:EE(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Bk(e,t,n){let r=e.all(t),i=n?Vk(n):Hk(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
60
- `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
61
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Vk(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Hk(n[r])}return t}function Hk(e){return e.spread??e.children.length>1}function Uk(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Wk(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Gk(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Kk(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qk(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=JS(t.children[1]),o=qS(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Jk(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Yk(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Xk=9,Zk=32;function Qk(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push($k(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push($k(t.slice(i),i>0,!1)),a.join(``)}function $k(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Xk||t===Zk;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Xk||t===Zk;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function eA(e,t){let n={type:`text`,value:Qk(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function tA(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var nA={blockquote:Ek,break:Dk,code:Ok,delete:kk,emphasis:Ak,footnoteReference:jk,heading:Mk,html:Nk,imageReference:Fk,image:Ik,inlineCode:Lk,linkReference:Rk,link:zk,listItem:Bk,list:Uk,paragraph:Wk,root:Gk,strong:Kk,table:qk,tableCell:Yk,tableRow:Jk,text:eA,thematicBreak:tA,toml:rA,yaml:rA,definition:rA,footnoteDefinition:rA};function rA(){}function iA(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function aA(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function oA(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||iA,r=e.options.footnoteBackLabel||aA,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=EE(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...KS(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
62
- `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
63
- `}]}}var sA={}.hasOwnProperty,cA={};function lA(e,t){let n=t||cA,r=new Map,i=new Map,a={all:s,applyData:dA,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...nA,...n.handlers},one:o,options:n,patch:uA,wrap:pA};return Ww(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(sA.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=KS(n);return r.children=a.all(e),r}return KS(e)}return(a.options.unknownHandler||fA)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=mA(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=mA(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function uA(e,t){e.position&&(t.position=XS(e))}function dA(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,KS(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function fA(e,t){let n=t.data||{},r=`value`in t&&!(sA.call(n,`hProperties`)||sA.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function pA(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
64
- `});++r<e.length;)r&&n.push({type:`text`,value:`
65
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
66
- `}),n}function mA(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function hA(e,t){let n=lA(e,t),r=n.one(e,void 0),i=oA(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
67
- `},i)),a}function gA(e,t){return e&&`run`in e?async function(n,r){let i=hA(n,{file:r,...t});await e.run(i,r)}:function(n,r){return hA(n,{file:r,...e||t})}}function _A(e){if(e)throw e}var vA=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function yA(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function bA(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?xA(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function xA(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var SA=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=mk(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};SA.prototype.file=``,SA.prototype.name=``,SA.prototype.reason=``,SA.prototype.message=``,SA.prototype.stack=``,SA.prototype.column=void 0,SA.prototype.line=void 0,SA.prototype.ancestors=void 0,SA.prototype.cause=void 0,SA.prototype.fatal=void 0,SA.prototype.place=void 0,SA.prototype.ruleId=void 0,SA.prototype.source=void 0;var CA={basename:wA,dirname:TA,extname:EA,join:DA,sep:`/`};function wA(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);AA(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function TA(e){if(AA(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function EA(e){AA(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function DA(...e){let t=-1,n;for(;++t<e.length;)AA(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:OA(n)}function OA(e){AA(e);let t=e.codePointAt(0)===47,n=kA(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function kA(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function AA(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var jA={cwd:MA};function MA(){return`/`}function NA(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function PA(e){if(typeof e==`string`)e=new URL(e);else if(!NA(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return FA(e)}function FA(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var IA=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],LA=class{constructor(e){let t;t=e?NA(e)?{path:e}:typeof e==`string`||VA(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:jA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<IA.length;){let e=IA[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)IA.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?CA.basename(this.path):void 0}set basename(e){zA(e,`basename`),RA(e,`basename`),this.path=CA.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?CA.dirname(this.path):void 0}set dirname(e){BA(this.basename,`dirname`),this.path=CA.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?CA.extname(this.path):void 0}set extname(e){if(RA(e,`extname`),BA(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=CA.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){NA(e)&&(e=PA(e)),zA(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?CA.basename(this.path,this.extname):void 0}set stem(e){zA(e,`stem`),RA(e,`stem`),this.path=CA.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new SA(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function RA(e,t){if(e&&e.includes(CA.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+CA.sep+"`")}function zA(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function BA(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function VA(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var HA=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),UA=t(vA(),1),WA={}.hasOwnProperty,GA=new class e extends HA{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=bA()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,UA.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(JA(`data`,this.frozen),this.namespace[e]=t,this):WA.call(this.namespace,e)&&this.namespace[e]||void 0:e?(JA(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=ZA(e),n=this.parser||this.Parser;return KA(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),KA(`process`,this.parser||this.Parser),qA(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=ZA(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);$A(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),KA(`processSync`,this.parser||this.Parser),qA(`processSync`,this.compiler||this.Compiler),this.process(e,r),XA(`processSync`,`process`,t),n;function r(e,r){t=!0,_A(e),n=r}}run(e,t,n){YA(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=ZA(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),XA(`runSync`,`run`,n),r;function i(e,t){_A(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=ZA(t),r=this.compiler||this.Compiler;return qA(`stringify`,r),YA(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(JA(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,UA.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];yA(o)&&yA(r)&&(r=(0,UA.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function KA(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function qA(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function JA(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function YA(e){if(!yA(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function XA(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function ZA(e){return QA(e)?e:new LA(e)}function QA(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function $A(e){return typeof e==`string`||ej(e)}function ej(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function tj(e){let t=GA().use(Tk).use(IO);return e&&t.use(Yie),t.use(gA).use(yre).use(Fie)}var nj=tj(!1),rj=tj(!0),ij=400,aj=new qa(ij),oj=new qa(ij),sj=new qa(ij),cj=new Map;function lj(e,t){return`${t?`breaks`:`standard`}\0${e}`}function uj(e,t,n){return`${t?`t`:`f`}\0${lj(e,n)}`}function dj(e){return e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`)}function fj(e,t={}){let n=t.cache??!0,r=t.preserveLineBreaks??!1,i=lj(e,r);if(n){let e=aj.get(i);if(e!==void 0)return e}let a;try{a=String((r?rj:nj).processSync(e))}catch{a=dj(e)}return n&&aj.set(i,a),a}function pj(e){return e.match(/language-([\w-]+)/)?.[1]??`text`}function mj(e,t){let n=e.textContent??``;return t?ca(n).text:n}function hj(e,t){let n=e.cloneNode(!0),r=n.querySelector(`code`);return r?r.textContent=t:n.textContent=t,n}function gj(e){let t=document.createElement(`div`);t.className=`code-block`;let n=document.createElement(`button`);return n.type=`button`,n.className=`code-copy`,n.dataset.copyCode=``,n.textContent=`Copy`,t.append(n,e),t}function _j(e){let t=document.createElement(`div`);return t.className=`mermaid-block`,t.dataset.mermaidDiagram=``,t.setAttribute(`aria-label`,`Mermaid diagram`),t.append(e.cloneNode(!0)),t}function vj(e,t){if(typeof document>`u`||!e.includes(`<pre`))return e;let n=document.createElement(`div`);n.innerHTML=e;for(let e of Array.from(n.querySelectorAll(`pre > code`))){let n=e.parentElement;if(n){if(LS(pj(e.getAttribute(`class`)??``))){n.replaceWith(_j(n));continue}n.replaceWith(gj(hj(n,mj(e,t))))}}return n.innerHTML}function yj(e){if(typeof document>`u`||!e.includes(`<table`))return e;let t=document.createElement(`div`);t.innerHTML=e;for(let e of Array.from(t.querySelectorAll(`table`))){if(e.parentElement?.classList.contains(`table-scroll`))continue;let t=document.createElement(`div`);t.className=`table-scroll`,e.replaceWith(t),t.append(e)}return t.innerHTML}async function bj(e,t){if(typeof document>`u`||!e.includes(`<pre`))return e;let n=document.createElement(`div`);n.innerHTML=e;let r=Array.from(n.querySelectorAll(`pre > code`));return await Promise.all(r.map(async e=>{let n=pj(e.getAttribute(`class`)??``);if(LS(n)){let t=e.parentElement;t&&t.replaceWith(_j(t));return}try{let r=await NS(mj(e,t),n);if(r){let t=document.createElement(`div`);t.innerHTML=r;let n=t.firstElementChild;n&&e.parentElement?.replaceWith(gj(n));return}}catch{}let r=e.parentElement;r&&r.replaceWith(gj(hj(r,mj(e,t))))})),n.innerHTML}function xj(e,t){return yj(vj(e,t))}async function Sj(e,t){return yj(await bj(e,t))}function Cj(e,t,n=!1){let r=uj(e,t,n),i=oj.get(r);if(i!==void 0)return i;let a=xj(fj(e,{preserveLineBreaks:n}),t);return oj.set(r,a),a}function wj(e,t,n=!1){return sj.get(uj(e,t,n))}function Tj(e,t,n=!1){return wj(e,t,n)??Cj(e,t,n)}function Ej(e,t,n=!1){let r=uj(e,t,n),i=sj.get(r);if(i!==void 0)return Promise.resolve(i);let a=cj.get(r);if(a)return a;let o=Sj(fj(e,{preserveLineBreaks:n}),t).then(e=>(sj.set(r,e),cj.delete(r),e)).catch(e=>{throw cj.delete(r),e});return cj.set(r,o),o}function Dj(e){let t=0,n=0,r;for(;n<e.length;){let i=e.indexOf(`
68
- `,n),a=i!==-1,o=a?i:e.length,s=a?o+1:o,c=e.slice(n,o),l=c.match(/^\s{0,3}(`{3,}|~{3,})/u)?.[1];if(l){let e=l[0];r?r.marker===e&&l.length>=r.length&&c.slice(c.indexOf(l)+l.length).trim()===``&&(r=void 0):r={marker:e,length:l.length}}n=s,!r&&a&&c.trim()===``&&(t=n)}return{prefix:e.slice(0,t),tail:e.slice(t)}}function Oj(e,t){return t.length>e.length&&t.slice(e.length).includes(`
69
- `)}var kj={now:()=>Date.now(),schedule:(e,t)=>setTimeout(e,t),cancel:e=>clearTimeout(e)},Aj=class{commit;intervalMs;clock;pending;hasPending=!1;timer;lastCommitAt;destroyed=!1;constructor(e,t=75,n=kj){this.commit=e,this.intervalMs=t,this.clock=n}enqueue(e,t={}){if(this.destroyed)return;if(this.pending=e,this.hasPending=!0,t.priority||this.lastCommitAt===void 0){this.flushNow();return}if(this.timer!==void 0)return;let n=this.clock.now()-this.lastCommitAt;this.timer=this.clock.schedule(()=>{this.timer=void 0,this.commitPending()},Math.max(0,this.intervalMs-n))}flushNow(e){this.destroyed||(arguments.length>0&&(this.pending=e,this.hasPending=!0),this.cancelTimer(),this.commitPending())}destroy(){this.destroyed||(this.destroyed=!0,this.cancelTimer(),this.pending=void 0,this.hasPending=!1)}cancelTimer(){this.timer!==void 0&&(this.clock.cancel(this.timer),this.timer=void 0)}commitPending(){if(!this.hasPending)return;let e=this.pending;this.pending=void 0,this.hasPending=!1,this.lastCommitAt=this.clock.now(),this.commit(e)}},jj=P(`<span class="whitespace-pre-wrap break-words"> </span>`),Mj=P(`<div class="markdown svelte-ss9wg9"><!> <!></div>`),Nj=P(`<div class="markdown svelte-ss9wg9"></div>`);function Pj(e,t){x(t,!0);let n=K(t,`trimCodeBlocks`,3,!0),r=K(t,`preserveLineBreaks`,3,!1),i=K(t,`streaming`,3,!1);function a(e,t,n){return e?xj(fj(e,{cache:!1,preserveLineBreaks:n}),t):``}let o=Oe(()=>{let e=i()?Dj(t.text):void 0;return{html:i()?``:Tj(t.text,n(),r()),prefixHtml:e?a(e.prefix,n(),r()):``,prefixSource:e?.prefix??``,tail:e?.tail??``,streaming:i(),source:t.text,trim:n(),preserveLineBreaks:r()}}),s=X(Ie(o.html)),c=X(Ie(o.prefixHtml)),l=o.prefixSource,u=o.trim,d=o.preserveLineBreaks,m=X(Ie(o.tail)),h=X(Ie(o.streaming)),g=o.source,b=o.trim,S=o.preserveLineBreaks,C=0;async function w(e){let n=e.target;if(!(n instanceof Element))return;let r=n.closest(`button[data-copy-code]`);if(r){let e=r.closest(`.code-block`)?.querySelector(`pre code`)?.textContent??``;if(!e)return;try{await Kne(e),t.onCopy?.(!0)}catch{t.onCopy?.(!1)}return}if(!t.onOpenFile)return;let i=n.closest(`a[href]`)?.getAttribute(`href`);if(!i)return;let a=oa(i);if(!a)return;let o=ia(a),s=t.linkBasePath?aa(o.path,t.linkBasePath)??o.path:o.path;e.preventDefault(),t.onOpenFile(s,o.line)}function T(e){return e.addEventListener(`click`,w),{destroy(){e.removeEventListener(`click`,w)}}}function E(e,t){let n=0,r;async function i(t){let i=++n;r?.destroy(),r=void 0,!(!t.enabled||!t.html.includes(`data-mermaid-diagram`))&&(await Ce(),i===n&&(r=ire(e)))}return i(t),{update:i,destroy(){n+=1,r?.destroy()}}}function D(e){let t=Dj(e.source);(t.prefix!==l||e.trim!==u||e.preserveLineBreaks!==d)&&(R(c,a(t.prefix,e.trim,e.preserveLineBreaks),!0),l=t.prefix,u=e.trim,d=e.preserveLineBreaks),R(m,t.tail,!0),R(h,!0),C+=1}let O=new Aj(D);function k(e,t,n){let r=wj(e,t,n);if(r!==void 0){R(s,r,!0),C+=1;return}R(s,Cj(e,t,n),!0);let i=C+=1;Ej(e,t,n).then(e=>{i===C&&R(s,e,!0)}).catch(()=>{i===C&&R(s,Cj(e,t,n),!0)})}z(()=>{let e=t.text,a=n(),o=r();if(!i()){L(h)&&O.flushNow({source:e,trim:a,preserveLineBreaks:o}),R(h,!1),k(e,a,o),g=e,b=a,S=o;return}let s=!L(h)||a!==b||o!==S||Oj(g,e);g=e,b=a,S=o,O.enqueue({source:e,trim:a,preserveLineBreaks:o},{priority:s})}),z(()=>()=>O.destroy());var ee=_(),A=F(ee),j=e=>{var t=Mj(),n=B(t);v(n,()=>L(c));var r=Y(n,2),i=e=>{var t=jj(),n=B(t,!0);y(t),J(()=>f(n,L(m))),q(e,t)};p(r,e=>{L(m)&&e(i)}),y(t),ge(t,e=>T?.(e)),ge(t,(e,t)=>E?.(e,t),()=>({html:L(c),enabled:!1})),q(e,t)},M=e=>{var t=Nj();v(t,()=>L(s),!0),y(t),ge(t,e=>T?.(e)),ge(t,(e,t)=>E?.(e,t),()=>({html:L(s),enabled:!0})),q(e,t)};p(A,e=>{L(h)?e(j):e(M,-1)}),q(e,ee),H()}var Fj=Symbol.for(`nerve.conversationUi.capabilities`);function Ij(e){return C(Fj,e)}function Lj(){return ve(Fj)??{}}var Rj=P(`<button type="button"> </button>`),zj=P(`<a target="_blank" rel="noreferrer noopener"> </a>`),Bj=P(`<span> </span>`),Vj=P(`<div class="chips svelte-1xvwd06"></div>`),Hj=P(`<button class="more svelte-1xvwd06" type="button"> </button>`),Uj=P(`<div class="footer-actions svelte-1xvwd06"><!></div>`),Wj=P(`<div><!> <!> <!></div>`);function Gj(e,t){x(t,!0);let n=K(t,`meta`,19,()=>[]),r=l(()=>!!t.actions),i=l(()=>n().length>0||!!t.detailsAction||L(r));var a=_(),o=F(a),s=e=>{var i=Wj(),a=B(i),o=e=>{var r=Vj();O(r,21,n,Le,(e,n)=>{var r=_(),i=F(r),a=e=>{var r=Rj(),i=B(r,!0);y(r),J(()=>{w(r,1,`chip chip-action tone-${L(n).tone??`default`}`,`svelte-1xvwd06`),A(r,`title`,L(n).openPath),f(i,L(n).text)}),le(`click`,r,()=>t.onOpenFile?.(L(n).openPath)),q(e,r)},o=e=>{var t=zj(),r=B(t,!0);y(t),J(()=>{w(t,1,`chip chip-action tone-${L(n).tone??`default`}`,`svelte-1xvwd06`),A(t,`href`,L(n).href),f(r,L(n).text)}),q(e,t)},s=e=>{var t=Bj(),r=B(t,!0);y(t),J(()=>{w(t,1,`chip tone-${L(n).tone??`default`}`,`svelte-1xvwd06`),f(r,L(n).text)}),q(e,t)};p(i,e=>{L(n).openPath?e(a):L(n).href?e(o,1):e(s,-1)}),q(e,r)}),y(r),q(e,r)};p(a,e=>{n().length>0&&e(o)});var s=Y(a,2),c=e=>{var n=Hj(),r=B(n,!0);y(n),J(()=>f(r,t.detailsAction.label)),le(`click`,n,function(...e){t.detailsAction.onClick?.apply(this,e)}),q(e,n)};p(s,e=>{t.detailsAction&&e(c)});var l=Y(s,2),u=e=>{var n=Uj();h(B(n),()=>t.actions),y(n),q(e,n)};p(l,e=>{t.actions&&e(u)}),y(i),J(()=>w(i,1,`tool-footer${L(r)?` has-actions`:``}`,`svelte-1xvwd06`)),q(e,i)};p(o,e=>{L(i)&&e(s)}),q(e,a),H()}r([`click`]);var Kj=P(`<div class="question svelte-q82h90"><!></div>`),qj=P(`<div class="meta svelte-q82h90"><span class="meta-label svelte-q82h90">context</span> <div class="meta-body svelte-q82h90"><!></div></div>`),Jj=P(`<div class="meta svelte-q82h90"><span class="meta-label svelte-q82h90">recommendation</span> <div class="meta-body svelte-q82h90"><!></div></div>`),Yj=P(`<button type="button" class="quick-reply rounded-full svelte-q82h90"> </button>`),Xj=P(`<div class="reply-voice-controls svelte-q82h90"><!> <!></div>`),Zj=P(`<!>Dismissing…`,1),Qj=P(`<!>Dismiss`,1),$j=P(`<!>Sending…`,1),eM=P(`<!>Reply`,1),tM=P(`<!> <!>`,1),nM=P(`<p class="m-0 text-xs text-destructive" role="alert"> </p>`),rM=P(`<div class="quick-replies svelte-q82h90"></div> <form class="reply svelte-q82h90"><div class="reply-field svelte-q82h90" role="group" aria-label="Reply input"><!> <!></div> <!> <!></form>`,1),iM=P(`<div class="meta answer svelte-q82h90"><span class="meta-label svelte-q82h90">answer</span> <div class="meta-body svelte-q82h90"><!></div></div>`),aM=P(`<p class="meta svelte-q82h90"><span class="meta-label svelte-q82h90">dismissed</span> </p>`),oM=P(`<div class="ask select-text svelte-q82h90"><!> <!> <!> <!></div> <!>`,1);function sM(e,t){x(t,!0);let n=Lj(),r=n.voice,i=r?.TranscriptionActivity,a=r?.AudioAuthDialog,o=[`Yes, go ahead`,`I agree`,`Can you explain further?`,`No, hold on`],s=X(``),c=X(void 0),u=X(void 0),d=X(void 0),m=X(!1),h=X(0),v,b,S,C,w=r?.micShortcutLabel,T=r?.micShortcutAria,E=l(()=>t.toolCall.status===`waiting_for_user`&&t.questionRecord?.status===`pending`),D=l(()=>t.questionRecord?.question??t.view.question),k=l(()=>t.questionRecord?.context??t.view.context),ee=l(()=>t.questionRecord?.recommendation??t.view.recommendation),A=n.askReply,j=l(()=>A?.slashCompletions?.()??[]),M=l(()=>A?.fileCompletions),N=l(()=>A?.pasteImage),te=l(()=>A?.dropFiles),ne=l(()=>t.questionRecord?.answer??t.view.answer??(L(d)?.kind===`answered`?L(d).answer:void 0)),P=l(()=>t.questionRecord?.status===`dismissed`||t.view.dismissed||L(d)?.kind===`dismissed`),re=l(()=>t.questionRecord?.dismissedReason??t.view.dismissedReason),ie=l(()=>L(s).trim()),I=l(()=>L(E)&&t.questionRecord?t.questionRecord.id:void 0),ae=l(()=>r&&L(I)?{kind:`ask-user`,id:L(I)}:void 0),oe=l(()=>!!(r&&L(ae)&&r.session.isTargetActive(L(ae))&&r.session.recording)),se=l(()=>!!(r&&L(ae)&&r.session.isTargetActive(L(ae))&&r.session.transcribing)),ue=l(()=>!!(r&&L(ae)&&r.session.isBusyForOtherTarget(L(ae)))),de=l(()=>!!r?.chatGptConfigured()),fe=l(()=>!!r?.session.isSupported()),V=l(()=>!r||!L(ae)||!!L(c)||r.session.pending||!L(oe)&&(!L(E)||L(ue))),pe=l(()=>r?L(oe)?`Stop recording${w?` (${w})`:``} — right-click to cancel (${he(r.session.elapsedMs)} / ${he(r.session.maxDurationMs)})`:L(ue)?`Voice recording is active elsewhere`:r.session.retryAttempt>0&&L(ae)&&r.session.isTargetActive(L(ae))?`Retrying transcription ${r.session.retryAttempt}/${r.session.maxRetries}…`:L(se)?`Transcribing audio…`:L(de)?w?`Record voice reply (${w})`:`Record voice reply`:`Connect ChatGPT to use voice input`:``);function me(e){let t=S;C?.(),C=void 0,S=void 0,b=void 0,e&&t&&r?.session.cancelIfTarget(t)}z(()=>{if(!r)return;let e=L(ae),t=e?r.targetKey(e):void 0;t!==b&&(me(!0),!(!e||!t)&&(S=e,b=t,C=r.session.registerTargetHandlers(e,{appendTranscript:e=>{R(s,r.appendTranscriptText(L(s),e),!0)},onError:e=>DS.error(`Voice input failed`,{description:e})})))}),z(()=>{let e=L(E)&&t.questionRecord?t.questionRecord.id:void 0;!e||e===v||(v=e,L(E)&&t.questionRecord?.id===e&&R(h,L(h)+1))}),ce(()=>me(!0));function he(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}async function _e(e){if(!L(E)||!t.questionRecord||L(c)||!t.onAnswerUserQuestion)return;let n=t.questionRecord.id;R(c,`answer`),R(u,void 0);try{await t.onAnswerUserQuestion(n,e),R(d,{kind:`answered`,answer:e},!0)}catch(e){R(u,U(e,`Could not send the reply.`),!0)}finally{R(c,void 0)}}function ve(){L(ie)&&_e(L(ie))}function ye(e){_e(e)}async function be(){if(!L(E)||!t.questionRecord||L(c)||!t.onDismissUserQuestion)return;let e=t.questionRecord.id;R(c,`dismiss`),R(u,void 0);try{await t.onDismissUserQuestion(e),R(d,{kind:`dismissed`},!0)}catch(e){R(u,U(e,`Could not dismiss the question.`),!0)}finally{R(c,void 0)}}function U(e,t){return e instanceof Error&&e.message.trim()?e.message:t}function xe(){if(!(!r||L(V)||!L(ae))){if(!L(oe)&&!L(de)){R(m,!0);return}r.session.toggle(L(ae))}}function Se(e){(e.key.toLowerCase()===`v`||e.code===`KeyV`)&&e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&(e.preventDefault(),xe())}function G(e){!r||!L(oe)||!L(ae)||(e.preventDefault(),r.session.cancel(L(ae)))}function Ce(e){return e.addEventListener(`keydown`,Se),{destroy(){e.removeEventListener(`keydown`,Se)}}}var K=oM(),we=F(K),Te=B(we),Ee=e=>{var n=Kj();Pj(B(n),{get text(){return L(D)},preserveLineBreaks:!0,get onOpenFile(){return t.onOpenFile}}),y(n),q(e,n)};p(Te,e=>{L(D)&&e(Ee)});var De=Y(Te,2),Oe=e=>{var n=qj(),r=Y(B(n),2);Pj(B(r),{get text(){return L(k)},preserveLineBreaks:!0,get onOpenFile(){return t.onOpenFile}}),y(r),y(n),q(e,n)};p(De,e=>{L(k)&&e(Oe)});var je=Y(De,2),Me=e=>{var n=Jj(),r=Y(B(n),2);Pj(B(r),{get text(){return L(ee)},preserveLineBreaks:!0,get onOpenFile(){return t.onOpenFile}}),y(r),y(n),q(e,n)};p(je,e=>{L(ee)&&e(Me)});var Ne=Y(je,2),Pe=e=>{var n=rM(),a=F(n);O(a,20,()=>o,e=>e,(e,t)=>{var n=Yj(),r=B(n,!0);y(n),J(e=>{n.disabled=e,f(r,t)},[()=>!!L(c)]),le(`click`,n,()=>ye(t)),q(e,n)}),y(a);var d=Y(a,2),m=B(d),v=B(m);{let e=l(()=>!!L(c));i_(v,{get value(){return L(s)},get disabled(){return L(e)},placeholder:`Reply to the agent's question`,ariaLabel:`Reply to agent question`,get focusToken(){return L(h)},get slashCompletions(){return L(j)},get fileCompletions(){return L(M)},onChange:e=>{R(s,e,!0)},onSubmit:ve,get onPasteImage(){return L(N)},get onDropFiles(){return L(te)}})}var b=Y(v,2),x=e=>{var t=Xj(),n=B(t);{let e=l(()=>L(ae)&&r.session.isTargetActive(L(ae))?r.session.retryAttempt:0);i(n,{get recording(){return L(oe)},get transcribing(){return L(se)},get elapsedMs(){return r.session.elapsedMs},get maxDurationMs(){return r.session.maxDurationMs},get retryAttempt(){return L(e)},get maxRetries(){return r.session.maxRetries},class:`ask-transcription-status`})}var a=Y(n,2);{let e=l(()=>L(oe)?`destructive`:`ghost`),t=l(()=>`rounded-full ${L(oe)?`inset-ring-1 inset-ring-destructive/28`:``}`),n=l(()=>L(oe)?`Stop recording; right-click to cancel`:L(de)?`Record voice reply`:`Connect ChatGPT to use voice input`);W(a,{get variant(){return L(e)},size:`icon-sm`,get class(){return L(t)},type:`button`,get disabled(){return L(V)},onclick:xe,oncontextmenu:G,get"aria-label"(){return L(n)},get"aria-keyshortcuts"(){return T},get title(){return L(pe)},children:(e,t)=>{var n=_(),r=F(n),i=e=>{ke(e,{class:`size-3.5`})},a=e=>{TS(e,{size:14,strokeWidth:2.4})};p(r,e=>{L(se)?e(i):e(a,-1)}),q(e,n)},$$slots:{default:!0}})}y(t),q(e,t)};p(b,e=>{r&&L(fe)&&i&&e(x)}),y(m),ge(m,e=>Ce?.(e));var S=Y(m,2);Gj(S,{get detailsAction(){return t.detailsAction},actions:e=>{var t=tM(),n=F(t);{let e=l(()=>!!L(c));W(n,{size:`sm`,variant:`secondary`,type:`button`,get disabled(){return L(e)},onclick:()=>void be(),children:(e,t)=>{var n=_(),r=F(n),i=e=>{var t=Zj();ke(F(t),{class:`size-3.5`}),g(),q(e,t)},a=e=>{var t=Qj();li(F(t),{size:14,strokeWidth:2.4}),g(),q(e,t)};p(r,e=>{L(c)===`dismiss`?e(i):e(a,-1)}),q(e,n)},$$slots:{default:!0}})}var r=Y(n,2);{let e=l(()=>!L(ie)||!!L(c));W(r,{size:`sm`,type:`submit`,get disabled(){return L(e)},children:(e,t)=>{var n=_(),r=F(n),i=e=>{var t=$j();ke(F(t),{class:`size-3.5`}),g(),q(e,t)},a=e=>{var t=eM();o_(F(t),{size:14,strokeWidth:2.4}),g(),q(e,t)};p(r,e=>{L(c)===`answer`?e(i):e(a,-1)}),q(e,n)},$$slots:{default:!0}})}q(e,t)},$$slots:{actions:!0}});var C=Y(S,2),w=e=>{var t=nM(),n=B(t,!0);y(t),J(()=>f(n,L(u))),q(e,t)};p(C,e=>{L(u)&&e(w)}),y(d),Ae(`submit`,d,e=>{e.preventDefault(),ve()}),q(e,n)},Fe=e=>{var n=iM(),r=Y(B(n),2);Pj(B(r),{get text(){return L(ne)},preserveLineBreaks:!0,get onOpenFile(){return t.onOpenFile}}),y(r),y(n),q(e,n)},Ie=e=>{var t=aM(),n=Y(B(t));y(t),J(()=>f(n,` ${L(re)??`No answer provided`??``}`)),q(e,t)};p(Ne,e=>{L(E)&&t.questionRecord?e(Pe):L(ne)?e(Fe,1):L(P)&&e(Ie,2)}),y(we);var Le=Y(we,2),Re=e=>{a(e,{get open(){return L(m)},set open(e){R(m,e,!0)}})};p(Le,e=>{a&&e(Re)}),q(e,K),H()}r([`click`]);function cM(e,t=0){if(!e)return t;let n=e.trim();if(!n.endsWith(`px`))return t;let r=Number.parseFloat(n.slice(0,-2));return Number.isFinite(r)?r:t}function lM(e,t,n=16){let r=cM(e);if(r>0)return r;let i=cM(t,n);return i>0?i*1.4:n*1.4}function uM(e){let t=e.borderBoxWidth-e.paddingLeft-e.paddingRight-e.borderLeftWidth-e.borderRightWidth;return Math.max(0,t)}function dM(e,t){return!Number.isFinite(t)||t<=0?!1:e===void 0||Math.abs(e-t)>.5}function fM(e,t){return e<=0||t<=0?0:Math.max(1,Math.round(e/t))}function pM(e){let t=Math.max(1,Math.floor(e.fixedRows)),n=Math.max(1,Math.ceil(e.fallbackRows)),r=e.measuredRows!==void 0&&e.measuredRows>0?Math.ceil(e.measuredRows):n,i=Math.min(Math.max(1,r),t);return Math.max(e.previousRows,i)}var mM=P(`<div class="code-block terminal-output svelte-ytenc0" data-terminal="true"><div class="code-block__viewport svelte-ytenc0"><div class="code-block__content svelte-ytenc0"></div></div></div>`),hM=P(`<span class="diff-line svelte-ytenc0"> </span>`),gM=P(`<div class="code-block svelte-ytenc0" data-language="diff"><div class="code-block__viewport svelte-ytenc0"><pre class="code-block__content code-block__content--diff svelte-ytenc0"></pre></div></div>`),_M=P(`<div class="code-block svelte-ytenc0"><div class="code-block__viewport svelte-ytenc0"><div class="code-block__content svelte-ytenc0"></div></div></div>`),vM=P(`<div class="code-block svelte-ytenc0"><div class="code-block__viewport svelte-ytenc0"><pre class="code-block__content svelte-ytenc0"> </pre></div></div>`);function yM(e,t){x(t,!0);let n=K(t,`maxHeight`,3,`18rem`),r=K(t,`trim`,3,!0),i=K(t,`highlight`,3,!0),a=K(t,`wrap`,3,!0),o=K(t,`overflow`,3,`auto`),s=K(t,`terminal`,3,!1),c=K(t,`tail`,3,!1),d=X(void 0),m=X(void 0),h=X(void 0),g=X(void 0),b=X(void 0),S=X(void 0),C=X(void 0),w=l(()=>r()?ca(t.code):{text:t.code}),T=l(()=>`${t.language??``}\0${L(w).text}`),E=l(()=>t.fixedRows!==void 0&&t.fixedRows>0),D=l(()=>He(L(w).text)),k=l(()=>!s()&&(t.language??``).toLowerCase().trim()===`diff`),ee=l(()=>L(k)?te(L(w).text):[]),j=l(()=>{if(!L(E))return 1;let e=L(w).text,n=e.length===0?1:e.split(`
70
- `).length;return Math.min(Math.max(n,1),t.fixedRows)}),M=X(0);function N(e){return e.startsWith(`@@`)?`hunk`:e.startsWith(`+++`)||e.startsWith(`---`)||e.startsWith(`diff `)?`file`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`delete`:`context`}function te(e){return e.replace(/\r\n/g,`
71
- `).replace(/\r/g,`
72
- `).split(`
73
- `).map(e=>({text:e,tone:N(e)}))}function ne(e){!L(E)||t.fixedRows===void 0||R(M,pM({previousRows:L(M),measuredRows:e,fallbackRows:L(j),fixedRows:t.fixedRows}),!0)}function P(){L(C)!==void 0&&(cancelAnimationFrame(L(C)),R(C,void 0))}function re(){if(R(C,void 0),!L(E)||!L(g)||!L(b)||!L(S))return;let e=L(b).clientWidth;if(e<=0){let t=L(g).getBoundingClientRect(),n=getComputedStyle(L(g));e=uM({borderBoxWidth:t.width,paddingLeft:cM(n.paddingLeft),paddingRight:cM(n.paddingRight),borderLeftWidth:cM(n.borderLeftWidth),borderRightWidth:cM(n.borderRightWidth)})}if(e<=0)return;let t=getComputedStyle(L(S)),n=lM(t.lineHeight,t.fontSize);ne(fM(L(S).scrollHeight,n))}function I(){if(L(E)&&L(C)===void 0){if(typeof requestAnimationFrame>`u`){re();return}R(C,requestAnimationFrame(re),!0)}}z(()=>{if(!L(E)){R(M,0),P();return}ne()}),z(()=>{let e=`${L(w).text}\0${L(d)??``}\0${L(D)}\0${t.fixedRows??``}`;!L(E)||e===void 0||I()}),z(()=>{if(!L(E)||!L(g)||!L(b)||!L(S)||typeof ResizeObserver>`u`)return;let e,t=new ResizeObserver(t=>{let n=t.at(-1);if(!n)return;let r=n.contentBoxSize[0]?.inlineSize??n.contentRect.width;dM(e,r)&&(e=r,I())});return t.observe(L(b)),I(),()=>t.disconnect()}),z(()=>()=>P());let ae=l(()=>L(E)?String(t.fixedRows):void 0),oe=l(()=>L(E)?String(Math.max(L(M),1)):void 0);z(()=>{if(s()||!i()||L(k)){R(d,void 0),R(m,void 0),R(h,void 0);return}let e=L(T);if(L(m)===e||L(h)===e)return;let n=NS(L(w).text,t.language);if(typeof n==`string`){R(d,n,!0),R(m,e,!0),R(h,void 0);return}if(!n){R(h,e,!0);return}let r=!1;return n.then(t=>{r||L(T)!==e||(t?(R(d,t,!0),R(m,e,!0),R(h,void 0)):R(h,e,!0))}),()=>{r=!0}});var se=_(),ce=F(se),le=e=>{var t=mM();let r;var i=B(t);let s;var l=B(i);v(l,()=>L(D),!0),y(l),ie(l,e=>R(S,e),()=>L(S)),y(i),ie(i,e=>R(b,e),()=>L(b)),y(t),ie(t,e=>R(g,e),()=>L(g)),J(()=>{A(t,`data-wrap`,a()?`true`:`false`),A(t,`data-overflow`,o()),A(t,`data-fixed-rows`,L(E)?`true`:void 0),A(t,`data-tail`,c()?`true`:void 0),r=u(t,``,r,{"--code-block-fixed-rows":L(ae),"--code-block-visible-rows":L(oe)}),s=u(i,``,s,{"max-height":L(E)?void 0:n()})}),q(e,t)},ue=e=>{var t=gM();let r;var i=B(t);let s;var l=B(i);O(l,23,()=>L(ee),(e,t)=>`${t}:${e.text}`,(e,t)=>{var n=hM(),r=B(n,!0);y(n),J(()=>{A(n,`data-tone`,L(t).tone),f(r,L(t).text)}),q(e,n)}),y(l),ie(l,e=>R(S,e),()=>L(S)),y(i),ie(i,e=>R(b,e),()=>L(b)),y(t),ie(t,e=>R(g,e),()=>L(g)),J(()=>{A(t,`data-wrap`,a()?`true`:`false`),A(t,`data-overflow`,o()),A(t,`data-fixed-rows`,L(E)?`true`:void 0),A(t,`data-tail`,c()?`true`:void 0),r=u(t,``,r,{"--code-block-fixed-rows":L(ae),"--code-block-visible-rows":L(oe)}),s=u(i,``,s,{"max-height":L(E)?void 0:n()})}),q(e,t)},de=e=>{var t=_M();let r;var i=B(t);let s;var l=B(i);v(l,()=>L(d),!0),y(l),ie(l,e=>R(S,e),()=>L(S)),y(i),ie(i,e=>R(b,e),()=>L(b)),y(t),ie(t,e=>R(g,e),()=>L(g)),J(()=>{A(t,`data-wrap`,a()?`true`:`false`),A(t,`data-overflow`,o()),A(t,`data-fixed-rows`,L(E)?`true`:void 0),A(t,`data-tail`,c()?`true`:void 0),r=u(t,``,r,{"--code-block-fixed-rows":L(ae),"--code-block-visible-rows":L(oe)}),s=u(i,``,s,{"max-height":L(E)?void 0:n()})}),q(e,t)},fe=e=>{var t=vM();let r;var i=B(t);let s;var l=B(i),d=B(l,!0);y(l),ie(l,e=>R(S,e),()=>L(S)),y(i),ie(i,e=>R(b,e),()=>L(b)),y(t),ie(t,e=>R(g,e),()=>L(g)),J(()=>{A(t,`data-wrap`,a()?`true`:`false`),A(t,`data-overflow`,o()),A(t,`data-fixed-rows`,L(E)?`true`:void 0),A(t,`data-tail`,c()?`true`:void 0),r=u(t,``,r,{"--code-block-fixed-rows":L(ae),"--code-block-visible-rows":L(oe)}),s=u(i,``,s,{"max-height":L(E)?void 0:n()}),f(d,L(w).text)}),q(e,t)};p(ce,e=>{s()?e(le):L(k)?e(ue,1):i()&&L(d)&&L(m)===L(T)?e(de,2):e(fe,-1)}),q(e,se),H()}var bM=P(`<p class="m-0 text-xs text-muted-foreground"> </p>`),xM=P(`<!> <!>`,1);function SM(e,t){x(t,!0);let n=K(t,`direction`,3,`head`),r=K(t,`collapsedLines`,3,6),i=K(t,`expanded`,3,!1),a=K(t,`terminal`,3,!1),o=l(()=>{if(i())return t.text;if(n()===`tail`)return cn(t.text,r());let e=On(t.text);return e.length<=r()?t.text:e.slice(0,r()).join(`
74
- `)});var s=xM(),c=F(s),u=e=>{var n=bM(),r=B(n);y(n),J(()=>f(r,`Showing latest
75
- ${t.outputLimits.live.displayedLines??0??``} lines / ${t.outputLimits.live.displayedChars??0??``} chars;
76
- ${t.outputLimits.live.omittedChars??0??``} earlier chars omitted from live preview.`)),q(e,n)};p(c,e=>{t.outputLimits?.live?.capped&&e(u)});var d=Y(c,2);{let e=l(()=>i()?void 0:r()),s=l(()=>!i()&&n()===`tail`);yM(d,{get code(){return L(o)},get language(){return t.language},trim:!1,get terminal(){return a()},get fixedRows(){return L(e)},get tail(){return L(s)}})}q(e,s),H()}var CM=P(`<section class="grid gap-1" aria-label="Bash command"><!></section>`),wM=P(`<section class="grid gap-1" aria-label="Command output"><!></section>`),TM=P(`<p class="m-0 text-xs text-muted-foreground">No output.</p>`),EM=P(`<div class="grid gap-1.5"><!> <!></div>`);function DM(e,t){x(t,!0);let n=K(t,`expanded`,3,!1),r=l(()=>!!t.view.command?.match(/[\r\n]/));var i=EM(),a=B(i),o=e=>{var r=CM();SM(B(r),{get text(){return t.view.command},language:`bash`,get expanded(){return n()}}),y(r),q(e,r)};p(a,e=>{n()&&t.view.command&&L(r)&&e(o)});var s=Y(a,2),c=e=>{var r=wM();SM(B(r),{get text(){return t.view.output},direction:`tail`,get expanded(){return n()},terminal:!0}),y(r),q(e,r)},u=e=>{q(e,TM())};p(s,e=>{t.view.output.length>0?e(c):t.toolCall.status===`completed`&&e(u,1)}),y(i),q(e,i),H()}var OM=new Set([`$$slots`,`$$events`,`$$legacy`]);function kM(e,t){let n=U(t,OM),r=[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`}],[`path`,{d:`M6.453 15h11.094`}],[`path`,{d:`M8.5 2h7`}]];G(e,V({name:`flask-conical`},()=>n,{get iconNode(){return r}}))}var AM=5,jM=20,MM=4,NM=12,PM=600,FM=2e3;function IM(e){return e.expanded?{itemLimit:jM,excerptLines:NM,excerptChars:FM}:{itemLimit:AM,excerptLines:MM,excerptChars:PM}}function LM(e,t,n,r){return n===`pending_approval`?`Review ${e} ${t}`:n===`requested`||n===`running`?`Executing ${e} ${t}`:n===`completed`?`${r?`Dry run`:`Completed`} ${e} ${t}`:n===`denied`?`Denied ${e} ${t}`:n===`error`?`Failed ${e} ${t}`:`${e} ${t}`}function RM(e){let t=e;return{args:SN(t.args??t.argsPreview),status:e.status}}function zM(e){let t=e;return SN(SN(t.result??t.resultPreview).details)}function BM(e,t,n){if(n?.resolvedAssignee){$(e,`Resolved assignee`,cN(n.resolvedAssignee));return}let r=vN(t,`assignee_account_id`),i=vN(t,`assignee_query`);r?$(e,`Assignee`,`account ${r}`):i&&$(e,`Assignee`,`query "${i}"`)}function VM(e,t){t.resolvedAssignee&&$(e,`Resolved assignee`,cN(t.resolvedAssignee))}function HM(e,t,n,r){(r??bN(t,`dry_run`))===!0?$(e,`Mode`,`dry run / no mutation`):t.status!==`completed`&&$(e,`Mode`,`will ${n}`)}function UM(e,t){bN(t,`save_to_file`)===!1&&$(e,`Raw JSON`,`not saved`)}function WM(e,t,n){for(let[r,i]of n)$(e,r,xN(t,i))}function GM(e,t,n){let r=vN(t,`page_file`),i=vN(t,`body_file`),a=vN(t,`body`);r&&$(e,`Page file`,r),i&&$(e,`Body file`,i),a&&nN(e,`Body`,a,n)}function KM(e,t){t&&($(e,`Storage`,t.storagePath),$(e,`Markdown`,t.markdownPath),$(e,`Attachments dir`,t.attachmentDir))}function qM(e,t,n){return vN(e,t)??EN(e.args[n])}function JM(e,t){return Object.entries(t).flatMap(([t,n])=>bN(e,t)===!0?[n]:[])}function YM(e,t,n,r){if(!t)return;let i=Object.entries(n).flatMap(([e,n])=>{let r=t[e];return typeof r==`number`&&Number.isFinite(r)?[`${r.toLocaleString()} ${n}`]:[]});i.length>0&&$(e,r,i.join(`, `))}function XM(e,t,n){let r=t.outputArtifacts??[];for(let t of r.slice(0,n.itemLimit))$(e,t.label??t.kind,t.path);r.length>n.itemLimit&&e.push(`… ${r.length-n.itemLimit} more artifacts`)}function ZM(e,t,n){let r=`previewOverflow`in t?t.previewOverflow:void 0;!n.expanded&&r?.hidden&&e.push(`… open Details for ${r.hidden} more ${r.noun}`)}function QM(e,t,n){let r=SN(t);if(Object.keys(r).length===0)return;$M(e,`Payload fields`,SN(r.fields),n),$M(e,`Payload update ops`,SN(r.update),n);let i=Object.keys(r).filter(e=>e!==`fields`&&e!==`update`);i.length>0&&$(e,`Payload keys`,iN(i,n.itemLimit))}function $M(e,t,n,r){let i=Object.keys(SN(n));i.length>0&&$(e,t,iN(i,r.itemLimit))}function eN(e,t,n,r){let i=n.filter(e=>!!e?.trim());if(i.length!==0){e.push(`${t}:`);for(let t of i.slice(0,r.itemLimit))e.push(`- ${t}`);i.length>r.itemLimit&&e.push(`… ${i.length-r.itemLimit} more`)}}function tN(e,t,n,r){!n||n.length===0||$(e,t,iN(n,r.itemLimit))}function $(e,t,n){n==null||n===``||e.push(`${t}: ${String(n)}`)}function nN(e,t,n,r){let i=rN(n,r);if(i){if(!i.text.includes(`
77
- `)){$(e,t,i.omitted?`${i.text}…`:i.text);return}e.push(`${t}:`);for(let t of i.text.split(`
78
- `))e.push(` ${t}`);i.omitted&&e.push(` …`)}}function rN(e,t){let n=TN(e).trim();if(!n)return;let r=n.split(`
79
- `).map(e=>e.trimEnd()).filter((e,t,n)=>e.trim().length>0||t>0&&t<n.length-1),i=r.slice(0,t.excerptLines).join(`
80
- `),a=r.length>t.excerptLines;return i.length>t.excerptChars&&(i=`${i.slice(0,t.excerptChars-1).trimEnd()}…`,a=!0),{text:i,omitted:a}}function iN(e,t){let n=e.filter(e=>e.trim().length>0),r=n.slice(0,t).join(`, `),i=n.length-t;return i>0?`${r} (+${i} more)`:r}function aN(e){let t=[e.key,e.issueType,e.status,e.assignee?`assignee ${e.assignee}`:void 0].filter(Boolean).join(` · `);return e.summary?`${t} — ${e.summary}`:t}function oN(e){return[e.key,e.name,e.projectTypeKey,e.lead?`lead ${e.lead}`:void 0].filter(Boolean).join(` · `)}function sN(e){return[e.id,e.name,e.to?`→ ${e.to}`:void 0].filter(Boolean).join(` · `)}function cN(e){let t=e.displayName??e.emailAddress??e.accountId,n=e.displayName&&e.emailAddress?` <${e.emailAddress}>`:``,r=e.active===!1?`inactive`:void 0;return[`${t}${n}`,e.accountId,e.accountType,r].filter(Boolean).join(` · `)}function lN(e){return[e.id,e.name,e.required?`required`:void 0,e.type].filter(Boolean).join(` · `)}function uN(e){return[e.key,e.name,e.id,e.status].filter(Boolean).join(` · `)}function dN(e){return[e.id,e.title,e.spaceKey?`space ${e.spaceKey}`:void 0,e.status,e.versionNumber===void 0?void 0:`v${e.versionNumber}`].filter(Boolean).join(` · `)}function fN(e){return[e.filename??e.title??e.id??e.fileId,e.mediaType,e.fileSize===void 0?void 0:hN(e.fileSize),e.versionNumber===void 0?void 0:`v${e.versionNumber}`].filter(Boolean).join(` · `)}function pN(e){return[e.index===void 0?void 0:`#${e.index}`,e.operation,e.id,e.title?`"${e.title}"`:void 0,e.status,e.message].filter(Boolean).join(` · `)}function mN(e){if(e.length===0)return;let t=new Map;for(let n of e){let e=n.status??`unknown`;t.set(e,(t.get(e)??0)+1)}return[...t.entries()].map(([e,t])=>`${t} ${e}`).join(`, `)}function hN(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function gN(e,t){if(e!==void 0)return`${e.toLocaleString()} ${t}${e===1?``:`s`}`}function _N(e){if(e!==void 0)return e?`yes`:`no`}function vN(e,t){return CN(e.args[t])??ON(e.argsText,t,{maxChars:1e3})[0]}function yN(e,t){let n=e.args[t];return Array.isArray(n)?n.flatMap(e=>typeof e==`string`?[e]:[]):void 0}function bN(e,t){let n=e.args[t];return typeof n==`boolean`?n:void 0}function xN(e,t){let n=e.args[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function SN(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function CN(e){return typeof e==`string`&&e.trim().length>0?e:void 0}function wN(e){let t=[];for(let n of e){let e=n.trimEnd();e.length!==0&&t.at(-1)!==e&&t.push(e)}return t}function TN(e){return e?.replace(/\r\n/g,`
81
- `).replace(/\r/g,`
82
- `)??``}function EN(e){let t=[],n=e=>{if(Array.isArray(e)){for(let t of e)n(t);return}let r=SN(e);if(Object.keys(r).length===0)return;let i=CN(r.type);if(i===`text`){let e=CN(r.text);e&&t.push(e);return}if(i===`hardBreak`){t.push(`
83
- `);return}let a=i&&[`paragraph`,`heading`,`blockquote`,`codeBlock`,`bulletList`,`orderedList`,`listItem`].includes(i);a&&t.length>0&&!t.at(-1)?.endsWith(`
84
- `)&&t.push(`
85
- `),n(r.content),a&&t.length>0&&!t.at(-1)?.endsWith(`
86
- `)&&t.push(`
87
- `)};n(e);let r=t.join(``).replace(/[ \t]+\n/g,`
88
- `).replace(/\n{3,}/g,`
89
-
90
- `).trim();return r.length>0?r:void 0}function DN(e){return RegExp(`"${AN(e)}"\\s*:\\s*"`,`g`)}function ON(e,t,n={}){if(!e)return[];let r=[],i=DN(t),a=i.exec(e);for(;a;){let t=n.maxChars??1/0,o=``,s=a.index+a[0].length;for(;s<e.length;){let n=e[s];if(n===`\\`){if(s+1>=e.length)break;let n=e[s+1];o.length<t&&(o+=kN(n)),s+=2;continue}if(n===`"`)break;o.length<t&&(o+=n),s+=1}r.push(o),a=i.exec(e)}return r}function kN(e){return e===`n`?`
91
- `:e===`r`?`\r`:e===`t`?` `:e}function AN(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var jN={search_spaces:`search spaces`,search_pages:`search pages`,get_page:`get page`,download_pages:`download pages`,create_page:`create page`,update_page:`update page`,publish_pages:`publish pages`,upload_attachment:`upload attachment`},MN={pages:`pages`,spaces:`spaces`,labels:`labels`,properties:`properties`,operations:`operations`,versions:`versions`,directChildren:`direct children`,attachments:`attachments`,downloadedAttachments:`downloaded attachments`};function NN(e,t,n={}){let r=IM(n),i=RM(e),a=zM(e),o=[LM(`Confluence`,jN[t.action],e.status,t.dryRun)];return PN(o,t.action,i,t,r),FN(o,t,a,r),XM(o,t,r),ZM(o,e,n),wN(o).join(`
92
- `)}function PN(e,t,n,r,i){switch(t){case`search_spaces`:$(e,`Query`,r?.query??vN(n,`query`)),tN(e,`Keys`,yN(n,`keys`),i),tN(e,`Ids`,yN(n,`ids`),i),$(e,`Limit`,xN(n,`limit`)),$(e,`Cursor`,vN(n,`cursor`)),UM(e,n);break;case`search_pages`:nN(e,`CQL`,r?.cql??vN(n,`cql`),i),$(e,`Query`,r?.query??vN(n,`query`)),$(e,`Space`,r?.spaceKey??vN(n,`space_key`)??r?.spaceId??vN(n,`space_id`)),$(e,`Title`,r?.title??vN(n,`title`)),$(e,`Status`,r?.status??vN(n,`status`)),$(e,`Body format`,r?.bodyFormat??vN(n,`body_format`)),$(e,`Limit`,xN(n,`limit`)),$(e,`Cursor`,vN(n,`cursor`)),UM(e,n);break;case`get_page`:$(e,`Page`,r?.pageId??vN(n,`page_id`)),$(e,`Body format`,r?.bodyFormat??vN(n,`body_format`)),tN(e,`Includes`,JM(n,{include_labels:`labels`,include_properties:`properties`,include_operations:`operations`,include_versions:`versions`,include_version:`version metadata`,include_direct_children:`direct children`,include_attachments:`attachments`,markdown:`markdown sidecar`}),i),UM(e,n);break;case`download_pages`:$(e,`Root page`,r?.pageId??vN(n,`page_id`)),$(e,`Space`,r?.spaceKey??vN(n,`space_key`)??r?.spaceId??vN(n,`space_id`)),nN(e,`CQL`,r?.cql??vN(n,`cql`),i),$(e,`Recurse`,_N(bN(n,`recurse`))),$(e,`Depth`,xN(n,`depth`)),$(e,`Limit`,xN(n,`limit`)),$(e,`Body format`,r?.bodyFormat??vN(n,`body_format`)),tN(e,`Outputs`,JM(n,{markdown:`markdown sidecars`,include_attachments:`attachment metadata`,download_attachments:`download attachments`}),i),UM(e,n);break;case`create_page`:$(e,`Space`,r?.spaceKey??vN(n,`space_key`)??r?.spaceId??vN(n,`space_id`)??`default space`),$(e,`Title`,r?.title??vN(n,`title`)),$(e,`Parent`,vN(n,`parent_id`)),$(e,`Status`,r?.status??vN(n,`status`)),GM(e,n,i),$(e,`Representation`,vN(n,`body_representation`)),HM(e,n,`create page`,r?.dryRun),$(e,`Return page`,_N(bN(n,`return_page`))),UM(e,n);break;case`update_page`:$(e,`Page`,r?.pageId??vN(n,`page_id`)??vN(n,`page_file`)),$(e,`Title`,r?.title??vN(n,`title`)),$(e,`Parent`,vN(n,`parent_id`)),$(e,`Status`,r?.status??vN(n,`status`)),GM(e,n,i),$(e,`Representation`,vN(n,`body_representation`)),nN(e,`Version message`,vN(n,`version_message`),i),$(e,`Allow stale`,_N(bN(n,`allow_stale`))),HM(e,n,`update page`,r?.dryRun),$(e,`Return page`,_N(bN(n,`return_page`))),UM(e,n);break;case`publish_pages`:$(e,`Input`,r?.inputPath??vN(n,`input_path`)),$(e,`Create missing`,_N(bN(n,`create_missing`))),$(e,`Allow stale`,_N(bN(n,`allow_stale`))),nN(e,`Version message`,vN(n,`version_message`),i),$(e,`Limit`,xN(n,`limit`)),HM(e,n,`publish pages`,r?.dryRun),UM(e,n);break;case`upload_attachment`:$(e,`Page`,r?.pageId??vN(n,`page_id`)),$(e,`File`,vN(n,`file_path`)),$(e,`Filename`,r?.attachment?.filename??vN(n,`filename`)),nN(e,`Comment`,vN(n,`comment`),i),$(e,`Minor edit`,_N(bN(n,`minor_edit`))),$(e,`Update existing`,_N(bN(n,`update_existing`))),$(e,`Status`,r?.status??vN(n,`status`)),UM(e,n);break}}function FN(e,t,n,r){if(IN(t))switch(t.action){case`search_spaces`:$(e,`Returned`,gN(t.spaceCount??t.spaces.length,`space`)),$(e,`Next cursor`,t.nextCursor??CN(n.nextCursor)),eN(e,`Spaces`,t.spaces.map(uN),r);break;case`search_pages`:$(e,`Returned`,gN(t.pageCount??t.pages.length,`page`)),$(e,`Next cursor`,t.nextCursor??CN(n.nextCursor)),eN(e,`Pages`,t.pages.map(dN),r);break;case`get_page`:t.page&&$(e,`Fetched`,dN(t.page)),YM(e,t.includedCounts,MN,`Included`),KM(e,t.page),eN(e,`Attachments`,t.attachments.map(fN),r);break;case`download_pages`:$(e,`Bundle`,t.downloadDir),$(e,`Manifest`,t.manifestPath),$(e,`Pages JSONL`,t.pagesJsonlPath),$(e,`Downloaded`,gN(t.pageCount??t.pages.length,`page`)),YM(e,t.includedCounts,MN,`Included`),eN(e,`Pages`,t.pages.map(dN),r);break;case`create_page`:$(e,t.dryRun?`Would create`:`Created`,t.pageId),t.page&&$(e,`Page`,dN(t.page)),QM(e,t.payload??n.payload,r);break;case`update_page`:$(e,t.dryRun?`Would update`:`Updated`,t.pageId),t.page&&$(e,`Page`,dN(t.page)),QM(e,t.payload??n.payload,r);break;case`publish_pages`:$(e,`Processed`,gN(t.outcomeCount??t.outcomes.length,`outcome`)),$(e,`Outcome statuses`,mN(t.outcomes)),eN(e,`Outcomes`,t.outcomes.map(pN),r);break;case`upload_attachment`:{$(e,`Page`,t.pageId);let n=t.attachment??t.attachments[0];n&&$(e,`Attachment`,fN(n)),n?.snippet&&nN(e,`Storage snippet`,n.snippet,r);break}}}function IN(e){return!!(e.messageLines.length>0||e.pages.length>0||e.page||e.spaces.length>0||e.space||e.attachments.length>0||e.attachment||e.outcomes.length>0||e.downloadDir||e.dryRun)}var LN={search_users:`search users`,search_issues:`search issues`,get_issue:`get issue`,get_project:`get project`,create_issue:`create issue`,update_issue:`update issue`,add_comment:`add comment`,transition_issue:`transition issue`},RN={comments:`comments`,transitions:`transitions`,statuses:`statuses`,components:`components`,versions:`versions`,issueTypes:`issue types`,fields:`fields`,priorities:`priorities`,resolutions:`resolutions`,worklogs:`worklogs`,changelog:`changelog entries`,remoteLinks:`remote links`,attachments:`attachments`,editmetaFields:`edit fields`};function zN(e,t,n={}){let r=IM(n),i=RM(e),a=zM(e),o=[LM(`Jira`,LN[t.action],e.status,t.dryRun)];return BN(o,t.action,i,t,r),VN(o,t,a,r),XM(o,t,r),ZM(o,e,n),wN(o).join(`
93
- `)}function BN(e,t,n,r,i){switch(t){case`search_users`:$(e,`Query`,r?.query??vN(n,`query`)),$(e,`Project`,r?.projectKey??vN(n,`project_key`)),$(e,`Issue`,r?.issueKey??vN(n,`issue_key`)),$(e,`Limit`,xN(n,`max_results`)),$(e,`Include inactive`,_N(bN(n,`include_inactive`))),UM(e,n);break;case`search_issues`:nN(e,`JQL`,r?.jql??vN(n,`jql`),i),tN(e,`Fields`,yN(n,`fields`),i),tN(e,`Expand`,yN(n,`expand`),i),$(e,`Limit`,xN(n,`max_results`)),$(e,`Next page token`,vN(n,`next_page_token`)),$(e,`Validate query`,_N(bN(n,`validate_query`))),UM(e,n);break;case`get_issue`:$(e,`Issue`,r?.issueKey??vN(n,`issue_key`)),tN(e,`Fields`,yN(n,`fields`),i),tN(e,`Expand`,yN(n,`expand`),i),tN(e,`Includes`,JM(n,{include_comments:`comments`,include_transitions:`transitions`,include_editmeta:`edit metadata`,include_worklogs:`worklogs`,include_changelog:`changelog`,include_remote_links:`remote links`,include_attachments:`attachments`}),i),WM(e,n,[[`Comment limit`,`comment_limit`],[`Comment start`,`comment_start_at`],[`Worklog limit`,`worklog_limit`],[`Changelog limit`,`changelog_limit`]]),UM(e,n);break;case`get_project`:$(e,`Project`,r?.projectKey??vN(n,`project_key`)??`default project`),tN(e,`Includes`,JM(n,{include_statuses:`statuses`,include_components:`components`,include_versions:`versions`,include_issue_types:`issue types`,include_create_meta:`create metadata`,include_fields:`fields`,include_priorities:`priorities`,include_resolutions:`resolutions`}),i),$(e,`Issue type id`,vN(n,`issue_type_id`)),$(e,`Issue type`,vN(n,`issue_type_name`)),$(e,`Field query`,vN(n,`field_query`)),$(e,`Field limit`,xN(n,`field_limit`)),UM(e,n);break;case`create_issue`:$(e,`Project`,r?.projectKey??vN(n,`project_key`)??`default project`),$(e,`Type`,r?.issueType??vN(n,`issue_type`)),nN(e,`Summary`,r?.summary??vN(n,`summary`),i),$(e,`Parent`,vN(n,`parent_key`)),nN(e,`Description`,qM(n,`description`,`description_adf`),i),tN(e,`Labels`,yN(n,`labels`),i),tN(e,`Components`,yN(n,`components`),i),$(e,`Priority`,vN(n,`priority`)),BM(e,n,r),$M(e,`Custom fields`,n.args.fields,i),HM(e,n,`create issue`,r?.dryRun),$(e,`Return issue`,_N(bN(n,`return_issue`)));break;case`update_issue`:$(e,`Issue`,r?.issueKey??vN(n,`issue_key`)),nN(e,`New summary`,vN(n,`summary`),i),nN(e,`Description`,qM(n,`description`,`description_adf`),i),tN(e,`Labels`,yN(n,`labels`),i),$(e,`Priority`,vN(n,`priority`)),BM(e,n,r),$M(e,`Field keys`,n.args.fields,i),$M(e,`Update ops`,n.args.update,i),$(e,`Notify users`,_N(bN(n,`notify_users`))),HM(e,n,`update issue`,r?.dryRun),$(e,`Return issue`,_N(bN(n,`return_issue`)));break;case`add_comment`:{$(e,`Issue`,r?.issueKey??vN(n,`issue_key`)),nN(e,`Comment`,qM(n,`body`,`body_adf`),i);let t=SN(n.args.visibility);Object.keys(t).length>0&&$(e,`Visibility`,[CN(t.type),CN(t.value)].filter(Boolean).join(` · `)),$(e,`Return comment`,_N(bN(n,`return_comment`))),n.status!==`completed`&&$(e,`Mode`,`will add comment`);break}case`transition_issue`:{$(e,`Issue`,r?.issueKey??vN(n,`issue_key`));let t=vN(n,`transition`);$(e,`Transition`,t??(r?.transition?void 0:`list available transitions`)),$(e,`Resolution`,vN(n,`resolution`)),nN(e,`Comment`,qM(n,`comment`,`comment_adf`),i),$M(e,`Field keys`,n.args.fields,i),$M(e,`Update ops`,n.args.update,i),t&&HM(e,n,`transition issue`,r?.dryRun);break}}}function VN(e,t,n,r){if(HN(t))switch(t.action){case`search_users`:$(e,`Returned`,gN(t.userCount??t.users.length,`user`)),eN(e,`Users`,t.users.map(cN),r);break;case`search_issues`:{let n=gN(t.issueCount??t.issues.length,`issue`);$(e,`Returned`,t.total!==void 0&&n?`${n} (${t.total} total)`:n),$(e,`Next page token`,t.nextPageToken),eN(e,`Issues`,t.issues.map(aN),r);break}case`get_issue`:t.issue&&$(e,`Fetched`,aN(t.issue)),YM(e,t.includedCounts,RN,`Included`),eN(e,`Transitions`,t.transitions.map(sN),r);break;case`get_project`:t.project&&$(e,`Project`,oN(t.project)),YM(e,t.includedCounts,RN,`Included`),eN(e,`Fields`,t.fields.map(lN),r);break;case`create_issue`:$(e,t.dryRun?`Would create`:`Created`,t.issueKey??CN(n.id)),$(e,`Jira id`,CN(n.id)),t.issue&&$(e,`Returned issue`,aN(t.issue)),VM(e,t),QM(e,t.payload??n.payload,r);break;case`update_issue`:$(e,t.dryRun?`Would update`:`Updated`,t.issueKey),$(e,`Updated fields`,gN(t.updatedFieldCount??t.updatedFields?.length,`field`)),tN(e,`Updated field keys`,t.updatedFields,r),t.issue&&$(e,`Returned issue`,aN(t.issue)),VM(e,t),QM(e,t.payload??n.payload,r);break;case`add_comment`:$(e,`Issue`,t.issueKey),$(e,`Comment id`,t.commentId),$(e,`Result`,t.messageLines[0]);break;case`transition_issue`:t.transition?($(e,t.dryRun?`Would transition`:`Transitioned`,t.issueKey),$(e,`Transition`,sN(t.transition)),QM(e,t.payload??n.payload,r)):($(e,`Available`,gN(t.transitionCount??t.transitions.length,`transition`)),eN(e,`Transitions`,t.transitions.map(sN),r)),eN(e,`Transition fields`,t.fields.map(lN),r);break}}function HN(e){return!!(e.messageLines.length>0||e.issues.length>0||e.users.length>0||e.issue||e.project||e.transitions.length>0||e.fields.length>0||e.commentId||e.updatedFieldCount!==void 0||e.dryRun)}function UN(e,t){return{text:e,tone:t?`info`:`success`}}function WN(e,t){if(t===`completed`)switch(e.action){case`create_issue`:{if(e.dryRun)return UN(e.issueKey?`Dry run — would create ${e.issueKey}`:`Dry run — would create issue`,!0);if(!e.issueKey)return;let t=e.summary?` · ${e.summary}`:``;return UN(`Created ${e.issueKey}${t}`,!1)}case`update_issue`:{if(!e.issueKey)return;if(e.dryRun)return UN(`Dry run — would update ${e.issueKey}`,!0);let t=e.updatedFieldCount??e.updatedFields?.length,n=t===void 0?``:` · ${t} field${t===1?``:`s`}`;return UN(`Updated ${e.issueKey}${n}`,!1)}case`add_comment`:{if(!e.issueKey)return;let t=e.commentId?` · id ${e.commentId}`:``;return UN(`Comment added to ${e.issueKey}${t}`,!1)}case`transition_issue`:return!e.transition||!e.issueKey?void 0:e.dryRun?UN(`Dry run — would transition ${e.issueKey}`,!0):UN(`Transitioned ${e.issueKey}`,!1);default:return}}function GN(e,t){if(t===`completed`)switch(e.action){case`create_page`:{let t=e.title??e.page?.title;return e.dryRun?UN(t?`Dry run — would create page "${t}"`:`Dry run — would create page`,!0):t?UN(`Created page "${t}"`,!1):void 0}case`update_page`:{let t=e.title??e.page?.title;if(e.dryRun)return UN(t?`Dry run — would update page "${t}"`:`Dry run — would update page`,!0);if(!t)return;let n=e.page?.versionNumber;return UN(`Updated page "${t}"${n===void 0?``:` · v${n}`}`,!1)}case`upload_attachment`:{let t=e.attachment?.filename??e.attachment?.title;return t?UN(`Uploaded ${t}`,e.dryRun):void 0}case`download_pages`:{let t=e.pageCount??e.pages.length;return t<=0?void 0:UN(`Downloaded ${t} page${t===1?``:`s`}`,!1)}case`publish_pages`:{let t=e.outcomeCount??e.outcomes.length;if(t<=0)return;let n=`${t} page${t===1?``:`s`}`;return e.dryRun?UN(`Dry run — ${n}`,!0):UN(`Published ${n}`,!1)}default:return}}function KN(e,t){if(t===`completed`){if(e.action===`search_issues`&&e.issueCount===0)return`No issues found.`;if(e.action===`search_users`&&e.userCount===0)return`No users found.`}}function qN(e,t){if(t===`completed`){if(e.action===`search_pages`&&e.pageCount===0)return`No pages found.`;if(e.action===`search_spaces`&&e.spaceCount===0)return`No spaces found.`}}function JN(e,t){return!!(e.issue||e.issues.length>0||e.users.length>0||e.project||e.transitions.length>0||e.fields.length>0||e.commentId||e.updatedFields?.length||e.updatedFieldCount!==void 0||e.includedCounts||e.resolvedAssignee||WN(e,t)||KN(e,t))}function YN(e,t){return!!(e.page||e.pages.length>0||e.space||e.spaces.length>0||e.attachment||e.attachments.length>0||e.outcomes.length>0||e.includedCounts||e.downloadDir||GN(e,t)||qN(e,t))}var XN=P(`<div class="flex min-w-0 items-center gap-2 rounded-sm border bg-sidebar px-2.5 py-2"><!> <span class="min-w-0 break-words text-xs leading-normal text-sidebar-foreground"> </span></div>`);function ZN(e,t){let n=K(t,`tone`,3,`default`),r={success:`text-success`,info:`text-info`,default:`text-muted-foreground`},i=l(()=>t.icon);var a=XN(),o=B(a),s=e=>{var t=_(),a=F(t);{let e=l(()=>`shrink-0 ${r[n()]}`);d(a,()=>L(i),(t,n)=>{n(t,{size:14,strokeWidth:2,get class(){return L(e)}})})}q(e,t)};p(o,e=>{L(i)&&e(s)});var c=Y(o,2),u=B(c,!0);y(c),y(a),J(()=>f(u,t.text)),q(e,a)}var QN=new Set([`$$slots`,`$$events`,`$$legacy`]);function $N(e,t){let n=U(t,QN),r=[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`}]];G(e,V({name:`paperclip`},()=>n,{get iconNode(){return r}}))}var eP=me({base:`h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none`,variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`},tone:{neutral:`border-border bg-muted text-foreground`,accent:`border-border bg-accent text-foreground`,running:`border-info/40 bg-info/8 text-info`,good:`border-success/40 bg-success/8 text-success`,warn:`border-warning/40 bg-warning/8 text-warning`,danger:`border-destructive/40 bg-destructive/8 text-destructive`},size:{xs:`px-1.5 py-px text-xs`,sm:`px-2 py-0.5 text-xs`}}}),tP=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`href`,`class`,`variant`,`tone`,`size`,`children`]);function nP(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=U(t,tP);var i=_();S(F(i),()=>t.href?`a`:`span`,!1,(e,i)=>{ie(e,e=>n(e),()=>n()),c(e,e=>({"data-slot":`badge`,href:t.href,class:e,...r}),[()=>I(eP({variant:t.variant,tone:t.tone,size:t.size}),t.class)]);var a=_();h(F(a),()=>t.children??N),q(i,a)}),q(e,i),H()}var rP={success:`good`,warning:`warn`,info:`running`,muted:`neutral`,default:`neutral`};function iP(e){return rP[oP(e)]}function aP(e){return rP[sP(e)]}function oP(e){let t=e?.trim().toLowerCase();return t?t===`current`?`success`:t===`draft`?`warning`:t===`archived`||t===`deleted`?`muted`:`info`:`muted`}function sP(e){let t=e?.trim().toLowerCase();return t===`created`||t===`updated`?`success`:t===`dry_run`||t===`skipped`||t===`error`?`warning`:`muted`}function cP(e,t){if(!t)return;if(/^https?:\/\//i.test(t))return t;if(!e)return;let n=e.replace(/\/+$/,``).replace(/\/wiki$/i,``),r=t.startsWith(`/`)?t:`/${t}`;return`${n}${r===`/wiki`||r.startsWith(`/wiki/`)?r:`/wiki${r}`}`}function lP(e){if(e!==void 0)return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}var uP=P(`<span class="text-xs text-muted-foreground"> </span>`),dP=P(`<div class="flex flex-wrap items-center gap-x-2.5 gap-y-1"><!> <!> <!></div>`),fP=P(`<button type="button" class="inline-flex min-w-0 items-center gap-1 border-0 bg-transparent p-0 text-xs text-primary hover:underline"><span class="text-muted-foreground">File</span> <span class="truncate font-mono"> </span></button>`),pP=P(`<code class="block break-all text-xs text-muted-foreground"> </code>`),mP=P(`<div class="grid gap-1.5 rounded-sm border bg-sidebar px-2.5 py-2"><div class="flex min-w-0 items-center gap-2"><!> <span class="min-w-0 flex-1 truncate text-xs font-medium text-sidebar-foreground"> </span></div> <!> <!> <!></div>`);function hP(e,t){x(t,!0);let n=K(t,`expanded`,3,!1),r=l(()=>t.attachment.filename??t.attachment.title??t.attachment.id??`attachment`),i=l(()=>lP(t.attachment.fileSize)),a=l(()=>!!(t.attachment.mediaType||L(i)||t.attachment.versionNumber!==void 0));var o=mP(),s=B(o),c=B(s);$N(c,{size:13,strokeWidth:2,class:`shrink-0 text-muted-foreground`});var u=Y(c,2),d=B(u,!0);y(u),y(s);var m=Y(s,2),h=e=>{var n=dP(),r=B(n),a=e=>{var n=uP(),r=B(n,!0);y(n),J(()=>f(r,t.attachment.mediaType)),q(e,n)};p(r,e=>{t.attachment.mediaType&&e(a)});var o=Y(r,2),s=e=>{var t=uP(),n=B(t,!0);y(t),J(()=>f(n,L(i))),q(e,t)};p(o,e=>{L(i)&&e(s)});var c=Y(o,2),l=e=>{nP(e,{tone:`neutral`,size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,`v${t.attachment.versionNumber??``}`)),q(e,r)},$$slots:{default:!0}})};p(c,e=>{t.attachment.versionNumber!==void 0&&e(l)}),y(n),q(e,n)};p(m,e=>{L(a)&&e(h)});var _=Y(m,2),v=e=>{var n=fP(),r=Y(B(n),2),i=B(r,!0);y(r),y(n),J(e=>{A(n,`title`,t.attachment.path),f(i,e)},[()=>xx(t.attachment.path)]),le(`click`,n,()=>t.onOpenFile?.(t.attachment.path)),q(e,n)};p(_,e=>{n()&&t.attachment.path&&e(v)});var b=Y(_,2),S=e=>{var n=pP(),r=B(n,!0);y(n),J(()=>f(r,t.attachment.snippet)),q(e,n)};p(b,e=>{n()&&t.attachment.snippet&&e(S)}),y(o),J(()=>f(d,L(r))),q(e,o),H()}r([`click`]);var gP=P(`<span class="inline-flex items-center gap-1.5 rounded-sm border bg-sidebar px-2 py-1 text-xs"><span class="font-semibold tabular-nums text-sidebar-foreground"> </span> <span class="text-muted-foreground"> </span></span>`),_P=P(`<div class="flex flex-wrap gap-1.5"></div>`);function vP(e,t){x(t,!0);let n=[[`versions`,`Versions`],[`attachments`,`Attachments`],[`downloadedAttachments`,`Downloaded`],[`labels`,`Labels`],[`properties`,`Properties`],[`directChildren`,`Children`],[`operations`,`Operations`],[`pages`,`Pages`],[`spaces`,`Spaces`]],r=l(()=>n.flatMap(([e,n])=>{let r=t.counts[e];return typeof r==`number`?[{label:n,value:r}]:[]}));var i=_(),a=F(i),o=e=>{var t=_P();O(t,21,()=>L(r),e=>e.label,(e,t)=>{var n=gP(),r=B(n),i=B(r,!0);y(r);var a=Y(r,2),o=B(a,!0);y(a),y(n),J(e=>{f(i,e),f(o,L(t).label)},[()=>L(t).value.toLocaleString()]),q(e,n)}),y(t),q(e,t)};p(a,e=>{L(r).length>0&&e(o)}),q(e,i),H()}var yP=P(`<code class="font-mono text-xs text-sidebar-foreground"> </code>`),bP=P(`<span> </span>`),xP=P(`<div class="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 rounded-sm border bg-sidebar px-2.5 py-2"><!> <!> <!> <!></div>`);function SP(e,t){x(t,!0);let n=K(t,`expanded`,3,!1),r=l(()=>t.outcome.status??t.outcome.operation??`row`);var i=xP(),a=B(i);{let e=l(()=>aP(t.outcome.status));nP(a,{get tone(){return L(e)},size:`xs`,children:(e,t)=>{g();var n=D();J(()=>f(n,L(r))),q(e,n)},$$slots:{default:!0}})}var o=Y(a,2),s=e=>{var n=yP(),r=B(n,!0);y(n),J(()=>f(r,t.outcome.id)),q(e,n)};p(o,e=>{t.outcome.id&&e(s)});var c=Y(o,2),u=e=>{var r=bP(),i=B(r,!0);y(r),J(()=>{w(r,1,`text-xs text-muted-foreground${n()?``:` min-w-0 truncate`}`),f(i,t.outcome.title)}),q(e,r)};p(c,e=>{t.outcome.title&&e(u)});var d=Y(c,2),m=e=>{var r=bP(),i=B(r,!0);y(r),J(()=>{w(r,1,`text-xs text-muted-foreground${n()?``:` min-w-0 truncate`}`),f(i,t.outcome.message)}),q(e,r)};p(d,e=>{t.outcome.message&&e(m)}),y(i),q(e,i),H()}var CP=new Set([`$$slots`,`$$events`,`$$legacy`]);function wP(e,t){let n=U(t,CP),r=[[`path`,{d:`M15 3h6v6`}],[`path`,{d:`M10 14 21 3`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}]];G(e,V({name:`external-link`},()=>n,{get iconNode(){return r}}))}var TP=P(`<a class="inline-flex items-center gap-1 font-mono text-xs font-semibold text-primary no-underline hover:underline" target="_blank" rel="noreferrer noopener"> <!></a>`),EP=P(`<span class="font-mono text-xs font-semibold text-sidebar-foreground"> </span>`),DP=P(`<span class="min-w-0 break-words text-xs font-medium leading-snug text-sidebar-foreground"> </span>`),OP=P(`<span class="text-xs text-muted-foreground"> </span>`),kP=P(`<span class="text-xs text-muted-foreground">Parent <code> </code></span>`),AP=P(`<div class="flex flex-wrap items-center gap-x-2.5 gap-y-1"><!> <!> <!> <!></div>`),jP=P(`<button type="button" class="inline-flex min-w-0 items-center gap-1 border-0 bg-transparent p-0 text-primary hover:underline"><span class="text-muted-foreground"> </span> <span class="truncate font-mono"> </span></button>`),MP=P(`<div class="flex flex-wrap gap-x-3 gap-y-1 text-xs"></div>`),NP=P(`<div class="grid gap-1.5 rounded-sm border bg-sidebar px-2.5 py-2"><div class="flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1"><span class="inline-flex items-center gap-1.5"><!> <!></span> <!></div> <!> <!></div>`);function PP(e,t){x(t,!0);let n=K(t,`expanded`,3,!1),r=l(()=>cP(t.siteUrl,t.page.webui)),i=l(()=>!!(t.page.status||t.page.versionNumber!==void 0||t.page.spaceKey||t.page.parentId)),a=l(()=>[t.page.storagePath?{label:`Storage`,path:t.page.storagePath}:void 0,t.page.markdownPath?{label:`Markdown`,path:t.page.markdownPath}:void 0,t.page.attachmentDir?{label:`Attachments`,path:t.page.attachmentDir}:void 0].filter(e=>!!e));var o=NP(),s=B(o),c=B(s),u=B(c);lf(u,{size:13,strokeWidth:2,class:`shrink-0 text-muted-foreground`});var d=Y(u,2),m=e=>{var n=TP(),i=B(n);wP(Y(i),{size:11,strokeWidth:2,class:`opacity-70`}),y(n),J(()=>{A(n,`href`,L(r)),A(n,`title`,`Open ${t.page.id} in Confluence`),f(i,`${t.page.id??``} `)}),q(e,n)},h=e=>{var n=EP(),r=B(n,!0);y(n),J(()=>f(r,t.page.id)),q(e,n)};p(d,e=>{L(r)?e(m):e(h,-1)}),y(c);var _=Y(c,2),v=e=>{var n=DP(),r=B(n,!0);y(n),J(()=>f(r,t.page.title)),q(e,n)};p(_,e=>{t.page.title&&e(v)}),y(s);var b=Y(s,2),S=e=>{var n=AP(),r=B(n),i=e=>{{let n=l(()=>iP(t.page.status));nP(e,{get tone(){return L(n)},size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,t.page.status)),q(e,r)},$$slots:{default:!0}})}};p(r,e=>{t.page.status&&e(i)});var a=Y(r,2),o=e=>{nP(e,{tone:`neutral`,size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,`v${t.page.versionNumber??``}`)),q(e,r)},$$slots:{default:!0}})};p(a,e=>{t.page.versionNumber!==void 0&&e(o)});var s=Y(a,2),c=e=>{var n=OP(),r=B(n);y(n),J(()=>f(r,`Space ${t.page.spaceKey??``}`)),q(e,n)};p(s,e=>{t.page.spaceKey&&e(c)});var u=Y(s,2),d=e=>{var n=kP(),r=Y(B(n)),i=B(r,!0);y(r),y(n),J(()=>f(i,t.page.parentId)),q(e,n)};p(u,e=>{t.page.parentId&&e(d)}),y(n),q(e,n)};p(b,e=>{L(i)&&e(S)});var C=Y(b,2),w=e=>{var n=MP();O(n,21,()=>L(a),e=>e.path,(e,n)=>{var r=jP(),i=B(r),a=B(i,!0);y(i);var o=Y(i,2),s=B(o,!0);y(o),y(r),J(e=>{A(r,`title`,L(n).path),f(a,L(n).label),f(s,e)},[()=>xx(L(n).path)]),le(`click`,r,()=>t.onOpenFile?.(L(n).path)),q(e,r)}),y(n),q(e,n)};p(C,e=>{n()&&L(a).length>0&&e(w)}),y(o),q(e,o),H()}r([`click`]);var FP=new Set([`$$slots`,`$$events`,`$$legacy`]);function IP(e,t){let n=U(t,FP),r=[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`}]];G(e,V({name:`database`},()=>n,{get iconNode(){return r}}))}var LP=P(`<span class="font-mono text-xs font-semibold text-sidebar-foreground"> </span>`),RP=P(`<span class="min-w-0 break-words text-xs font-medium leading-snug text-sidebar-foreground"> </span>`),zP=P(`<span class="text-xs text-muted-foreground"> </span>`),BP=P(`<div class="flex flex-wrap items-center gap-x-2.5 gap-y-1"><!> <!></div>`),VP=P(`<div class="grid gap-1.5 rounded-sm border bg-sidebar px-2.5 py-2"><div class="flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1"><span class="inline-flex items-center gap-1.5"><!> <!> <span class="font-mono text-xs text-muted-foreground"> </span></span> <!></div> <!></div>`);function HP(e,t){x(t,!0);let n=l(()=>!!(t.space.status||t.space.type));var r=VP(),i=B(r),a=B(i),o=B(a);IP(o,{size:13,strokeWidth:2,class:`shrink-0 text-muted-foreground`});var s=Y(o,2),c=e=>{var n=LP(),r=B(n,!0);y(n),J(()=>f(r,t.space.key)),q(e,n)};p(s,e=>{t.space.key&&e(c)});var u=Y(s,2),d=B(u,!0);y(u),y(a);var m=Y(a,2),h=e=>{var n=RP(),r=B(n,!0);y(n),J(()=>f(r,t.space.name)),q(e,n)};p(m,e=>{t.space.name&&e(h)}),y(i);var _=Y(i,2),v=e=>{var n=BP(),r=B(n),i=e=>{{let n=l(()=>iP(t.space.status));nP(e,{get tone(){return L(n)},size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,t.space.status)),q(e,r)},$$slots:{default:!0}})}};p(r,e=>{t.space.status&&e(i)});var a=Y(r,2),o=e=>{var n=zP(),r=B(n,!0);y(n),J(()=>f(r,t.space.type)),q(e,n)};p(a,e=>{t.space.type&&e(o)}),y(n),q(e,n)};p(_,e=>{L(n)&&e(v)}),y(r),J(()=>f(d,t.space.id)),q(e,r),H()}var UP=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]),WP=P(`<div></div>`);function GP(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=U(t,UP);var i=WP();c(i,e=>({"data-slot":`skeleton`,class:e,...r}),[()=>I(`bg-muted rounded-md animate-pulse`,t.class)]),ie(i,e=>n(e),()=>n()),q(e,i),H()}var KP=P(`<!> <!>`,1),qP=P(`<div class="grid gap-1.5"><span class="text-xs font-medium text-muted-foreground"> </span> <!></div>`),JP=P(`<dt class="text-muted-foreground"> </dt> <dd><!></dd>`,1),YP=P(`<div class="grid gap-1.5 rounded-sm border bg-sidebar px-2.5 py-2"><dl class="m-0 grid gap-x-3 gap-y-1 text-xs sm:grid-cols-[max-content_minmax(0,1fr)]"></dl> <!></div>`);function XP(e,t){x(t,!0);let n=e=>{var n=_(),a=F(n),o=e=>{var n=qP(),a=B(n),o=B(a,!0);y(a);var s=Y(a,2),c=e=>{{let n=l(()=>!r()&&!!t.body.text.language);yM(e,{get code(){return t.body.text.text},get language(){return t.body.text.language},trim:!1,get highlight(){return L(n)},wrap:!0,overflow:`hidden`,tail:!0,get fixedRows(){return i()}})}},u=e=>{var t=KP(),n=F(t);GP(n,{class:`h-3 w-full`}),GP(Y(n,2),{class:`h-3 w-2/3`}),q(e,t)};p(s,e=>{t.body.text.text===void 0?e(u,-1):e(c)}),y(n),J(()=>f(o,t.body.text.label)),q(e,n)};p(a,e=>{t.body.text&&e(o)}),q(e,n)},r=K(t,`streaming`,3,!1),i=K(t,`fixedRows`,3,6),a=l(()=>t.body.fields.filter(e=>e.value!==void 0||r())),o=l(()=>!!(t.body.text&&(t.body.text.text!==void 0||r())));var s=_(),c=F(s),u=e=>{var t=YP(),r=B(t);O(r,21,()=>L(a),e=>e.label,(e,t)=>{var n=JP(),r=F(n),i=B(r,!0);y(r);var a=Y(r,2);let o;var s=B(a),c=e=>{var n=D();J(()=>f(n,L(t).value)),q(e,n)},l=e=>{GP(e,{class:`h-3 w-24`})};p(s,e=>{L(t).value===void 0?e(l,-1):e(c)}),y(a),J(()=>{f(i,L(t).label),o=w(a,1,`m-0 min-w-0 whitespace-pre-wrap [overflow-wrap:anywhere]`,null,o,{"font-mono":L(t).mono,"text-warning":L(t).tone===`warning`,"text-destructive":L(t).tone===`error`,"text-success":L(t).tone===`success`,"text-info":L(t).tone===`info`})}),q(e,n)}),y(r);var i=Y(r,2),s=e=>{n(e)};p(i,e=>{L(o)&&e(s)}),y(t),q(e,t)},d=e=>{n(e)};p(c,e=>{L(a).length>0?e(u):L(o)&&e(d,1)}),q(e,s),H()}var ZP=P(`<p class="m-0 text-xs font-medium text-muted-foreground"> </p>`),QP=P(`<div class="grid gap-1.5"><!> <!></div>`),$P=P(`<dt class="text-muted-foreground"> </dt> <dd> </dd>`,1),eF=P(`<dl class="m-0 grid gap-x-3 gap-y-1 text-sm sm:grid-cols-[max-content_minmax(0,1fr)]"></dl>`),tF=P(`<div class="grid gap-1.5"><!> <p class="m-0 whitespace-pre-wrap text-sm leading-relaxed text-foreground [overflow-wrap:anywhere]"> </p></div>`);function nF(e,t){x(t,!0);let n=K(t,`fixedRows`,3,6),r=K(t,`highlight`,3,!0),i=K(t,`streaming`,3,!1);var a=_(),o=F(a),s=e=>{var i=QP(),a=B(i),o=e=>{var n=ZP(),r=B(n,!0);y(n),J(()=>f(r,t.body.label)),q(e,n)};p(a,e=>{t.body.label&&e(o)});var s=Y(a,2);{let e=l(()=>t.body.language===`text`?void 0:t.body.language),i=l(()=>r()&&t.body.language!==`text`);yM(s,{get code(){return t.body.text},get language(){return L(e)},trim:!1,get highlight(){return L(i)},wrap:!0,overflow:`hidden`,get tail(){return t.body.tail},get fixedRows(){return n()}})}y(i),q(e,i)},c=e=>{var r=QP(),i=B(r),a=e=>{var n=ZP(),r=B(n,!0);y(n),J(()=>f(r,t.body.label)),q(e,n)};p(i,e=>{t.body.label&&e(a)}),yM(Y(i,2),{get code(){return t.body.text},language:`diff`,trim:!1,highlight:!1,wrap:!0,overflow:`hidden`,get tail(){return t.body.tail},get fixedRows(){return n()}}),y(r),q(e,r)},u=e=>{var n=eF();O(n,23,()=>t.body.items,(e,t)=>`${e.label}:${t}`,(e,t)=>{var n=$P(),r=F(n),i=B(r,!0);y(r);var a=Y(r,2);let o;var s=B(a,!0);y(a),J(()=>{f(i,L(t).label),o=w(a,1,`m-0 min-w-0 whitespace-pre-wrap [overflow-wrap:anywhere]`,null,o,{"font-mono":L(t).mono,"text-warning":L(t).tone===`warning`,"text-destructive":L(t).tone===`error`,"text-success":L(t).tone===`success`,"text-info":L(t).tone===`info`}),f(s,L(t).value)}),q(e,n)}),y(n),q(e,n)},d=e=>{{let n=l(()=>t.body.items.map(e=>({todo:e.text,done:e.done})));Fv(e,{get items(){return L(n)}})}},m=e=>{XP(e,{get body(){return t.body},get streaming(){return i()},get fixedRows(){return n()}})},h=e=>{var n=tF(),r=B(n),i=e=>{var n=ZP(),r=B(n,!0);y(n),J(()=>f(r,t.body.label)),q(e,n)};p(r,e=>{t.body.kind===`text-summary`&&t.body.label&&e(i)});var a=Y(r,2),o=B(a,!0);y(a),y(n),J(()=>f(o,t.body.text)),q(e,n)};p(o,e=>{t.body.kind===`code`?e(s):t.body.kind===`diff`?e(c,1):t.body.kind===`key-values`?e(u,2):t.body.kind===`checklist`?e(d,3):t.body.kind===`atlassian-draft`?e(m,4):(t.body.kind===`text-summary`||t.body.kind===`atlassian-summary`)&&e(h,5)}),q(e,a),H()}var rF=P(`<button type="button" class="flex min-w-0 items-center gap-1.5 rounded-sm border bg-sidebar px-2.5 py-1.5 text-left font-mono text-xs text-sidebar-foreground hover:bg-muted/40"><!> <span class="truncate"> </span></button>`),iF=P(`<span class="flex min-w-0 items-center gap-1.5 rounded-sm border bg-sidebar px-2.5 py-1.5 font-mono text-xs text-sidebar-foreground"><!> <span class="truncate"> </span></span>`),aF=P(`<p class="m-0 text-xs text-muted-foreground">More results available.</p>`),oF=P(`<!> <!>`,1),sF=P(`<p class="m-0 text-xs text-muted-foreground"> </p>`),cF=P(`<div class="grid gap-1.5"><!> <!> <!></div>`),lF=P(`<p class="m-0 text-xs text-muted-foreground">No Confluence summary available. Open Details for raw arguments and result.</p>`);function uF(e,t){x(t,!0);let n=(e,n=N)=>{var r=_(),i=F(r),a=e=>{var r=rF(),i=B(r);ri(i,{size:12,strokeWidth:2,class:`shrink-0 text-muted-foreground`});var a=Y(i,2),o=B(a,!0);y(a),y(r),J(()=>{A(r,`title`,n()),f(o,n())}),le(`click`,r,()=>t.onOpenFile?.(n())),q(e,r)},o=e=>{var t=iF(),r=B(t);ri(r,{size:12,strokeWidth:2,class:`shrink-0 text-muted-foreground`});var i=Y(r,2),a=B(i,!0);y(i),y(t),J(()=>{A(t,`title`,n()),f(a,n())}),q(e,t)};p(i,e=>{t.onOpenFile?e(a):e(o,-1)}),q(e,r)},r=K(t,`expanded`,3,!1),i=Lj(),a=l(()=>i.atlassian?.confluenceSiteUrl()),o=l(()=>r()?1/0:5),s=l(()=>GN(t.view,t.toolCall.status)),c=l(()=>qN(t.view,t.toolCall.status)),u=l(()=>YN(t.view,t.toolCall.status)),d=l(()=>L(u)?void 0:NN(t.toolCall,t.view,{expanded:r()})),m=l(()=>{if(!t.view.includedCounts)return;let e={...t.view.includedCounts};return delete e.attachments,delete e.downloadedAttachments,Object.keys(e).length>0?e:void 0}),h=l(()=>t.view.action===`download_pages`?[t.view.downloadDir,...r()?[t.view.manifestPath,t.view.pagesJsonlPath]:[]].filter(e=>!!e):[]);var g=_(),v=F(g),b=e=>{var i=cF(),u=B(i),d=e=>{{let t=l(()=>L(s).tone===`info`?kM:Ja);ZN(e,{get text(){return L(s).text},get tone(){return L(s).tone},get icon(){return L(t)}})}};p(u,e=>{L(s)&&e(d)});var g=Y(u,2),v=e=>{var n=oF(),i=F(n);O(i,17,()=>t.view.pages.slice(0,L(o)),e=>e.id,(e,n)=>{PP(e,{get page(){return L(n)},get siteUrl(){return L(a)},get expanded(){return r()},get onOpenFile(){return t.onOpenFile}})});var s=Y(i,2),c=e=>{q(e,aF())};p(s,e=>{t.view.nextCursor&&e(c)}),q(e,n)},b=e=>{var n=_();O(F(n),17,()=>t.view.spaces.slice(0,L(o)),e=>e.id,(e,t)=>{HP(e,{get space(){return L(t)}})}),q(e,n)},x=e=>{var n=oF(),i=F(n),o=e=>{PP(e,{get page(){return t.view.page},get siteUrl(){return L(a)},get expanded(){return r()},get onOpenFile(){return t.onOpenFile}})};p(i,e=>{t.view.page&&e(o)});var s=Y(i,2),c=e=>{vP(e,{get counts(){return L(m)}})};p(s,e=>{L(m)&&e(c)}),q(e,n)},S=e=>{var i=oF(),s=F(i);O(s,16,()=>L(h),e=>e,(e,t)=>{n(e,()=>t)}),O(Y(s,2),17,()=>t.view.pages.slice(0,L(o)),e=>e.id,(e,n)=>{PP(e,{get page(){return L(n)},get siteUrl(){return L(a)},get expanded(){return r()},get onOpenFile(){return t.onOpenFile}})}),q(e,i)},C=e=>{var n=_(),i=F(n),o=e=>{PP(e,{get page(){return t.view.page},get siteUrl(){return L(a)},get expanded(){return r()},get onOpenFile(){return t.onOpenFile}})};p(i,e=>{t.view.page&&e(o)}),q(e,n)},w=e=>{var n=_();O(F(n),19,()=>t.view.outcomes.slice(0,L(o)),(e,t)=>e.id??e.index??t,(e,t)=>{SP(e,{get outcome(){return L(t)},get expanded(){return r()}})}),q(e,n)},T=e=>{var n=_(),i=F(n),a=e=>{hP(e,{get attachment(){return t.view.attachment},get expanded(){return r()},get onOpenFile(){return t.onOpenFile}})};p(i,e=>{t.view.attachment&&e(a)}),q(e,n)};p(g,e=>{t.view.action===`search_pages`?e(v):t.view.action===`search_spaces`?e(b,1):t.view.action===`get_page`?e(x,2):t.view.action===`download_pages`?e(S,3):t.view.action===`create_page`||t.view.action===`update_page`?e(C,4):t.view.action===`publish_pages`?e(w,5):t.view.action===`upload_attachment`&&e(T,6)});var E=Y(g,2),D=e=>{var t=sF(),n=B(t,!0);y(t),J(()=>f(n,L(c))),q(e,t)};p(E,e=>{L(c)&&e(D)}),y(i),q(e,i)},S=e=>{{let t=l(()=>({kind:`atlassian-summary`,text:L(d)}));nF(e,{get body(){return L(t)}})}},C=e=>{q(e,lF())};p(v,e=>{L(u)?e(b):L(d)?e(S,1):t.toolCall.status===`completed`&&e(C,2)}),q(e,g),H()}r([`click`]);var dF=P(`<p class="m-0 text-xs text-muted-foreground">No changes.</p>`);function fF(e,t){x(t,!0);let n=K(t,`expanded`,3,!1);var r=_(),i=F(r),a=e=>{SM(e,{get text(){return t.view.diff},language:`diff`,direction:`tail`,get expanded(){return n()}})},o=e=>{q(e,dF())};p(i,e=>{t.view.diff?e(a):t.toolCall.status===`completed`&&e(o,1)}),q(e,r),H()}var pF=new Set([`$$slots`,`$$events`,`$$legacy`]);function mF(e,t){let n=U(t,pF),r=[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`}]];G(e,V({name:`messages-square`},()=>n,{get iconNode(){return r}}))}function hF(e){let t=fb(e),n=t.objectArraySources(`tasks`);if(n.length===0){let e=t.string(`task`);return[gF(0,1,t.string(`label`),e)]}let r=n.length;return n.map((e,t)=>gF(t,r,e.string(`label`),e.string(`task`)))}function gF(e,t,n,r){return{key:`task-${e}`,index:e,count:t,label:n,task:r,status:`drafting`}}var _F=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function vF(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=U(t,_F);var i=_();d(F(i),()=>yc,(e,t)=>{t(e,V(()=>r,{get open(){return n()},set open(e){n(e)}}))}),q(e,i),H()}var yF=new Set([`$$slots`,`$$events`,`$$legacy`]);function bF(e,t){let n=U(t,yF);var r=_();d(F(r),()=>Wt,(e,t)=>{t(e,V(()=>n))}),q(e,r)}var xF=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function SF(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=U(t,xF);var i=_(),a=F(i);{let e=l(()=>I(`leading-none font-medium`,t.class));d(a,()=>kt,(t,i)=>{i(t,V({"data-slot":`dialog-title`,get class(){return L(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}q(e,i),H()}P(`<div><!> <!></div>`),P(`<div><!></div>`);var CF=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function wF(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=U(t,CF);var i=_(),a=F(i);{let e=l(()=>I(`dialog-overlay data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 duration-100`,t.class));d(a,()=>qt,(t,i)=>{i(t,V({"data-slot":`dialog-overlay`,get class(){return L(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}q(e,i),H()}var TF=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`portalProps`,`children`,`showCloseButton`,`layout`]),EF=P(`<!> <span class="sr-only">Close</span>`,1),DF=P(`<!> <!>`,1);function OF(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=K(t,`showCloseButton`,3,!0),i=K(t,`layout`,3,`default`),a=U(t,TF);bF(e,V(()=>t.portalProps,{children:(e,o)=>{var s=DF(),c=F(s);d(c,()=>wF,(e,t)=>{t(e,{})});var u=Y(c,2);{let e=l(()=>I(`bg-card text-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 border-border grid rounded-lg border text-sm shadow-xl duration-100 fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,i()==="default"&&`max-w-[calc(100%-2rem)] gap-4 p-4 sm:max-w-md`,t.class));d(u,()=>Ec,(i,o)=>{o(i,V({"data-slot":`dialog-content`,get class(){return L(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var i=DF(),a=F(i);h(a,()=>t.children??N);var o=Y(a,2),s=e=>{var t=_(),n=F(t);{let e=(e,t)=>{W(e,V({variant:`ghost`,class:`absolute top-4 right-4`,size:`icon-sm`},()=>t?.().props,{children:(e,t)=>{var n=EF();li(F(n),{}),g(2),q(e,n)},$$slots:{default:!0}}))};d(n,()=>Sc,(t,n)=>{n(t,{"data-slot":`dialog-close`,child:e,$$slots:{child:!0}})})}q(e,t)};p(o,e=>{r()&&e(s)}),q(e,i)},$$slots:{default:!0}}))})}q(e,s)},$$slots:{default:!0}})),H()}var kF=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function AF(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=U(t,kF);var i=_(),a=F(i);{let e=l(()=>I(`text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3`,t.class));d(a,()=>en,(t,i)=>{i(t,V({"data-slot":`dialog-description`,get class(){return L(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}q(e,i),H()}var jF=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`type`]);function MF(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=K(t,`type`,3,`button`),i=U(t,jF);var a=_();d(F(a),()=>Sc,(e,t)=>{t(e,V({"data-slot":`dialog-close`,get type(){return r()}},()=>i,{get ref(){return n()},set ref(e){n(e)}}))}),q(e,a),H()}var NF=P(`<div class="dialog-header-actions"><!></div>`),PF=P(`<footer class="dialog-footer"><!></footer>`),FF=P(`<header class="dialog-header"><div class="dialog-title-block"><!> <!></div> <!> <!></header> <div><!></div> <!>`,1);function IF(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=K(t,`title`,3,`Dialog`),i=K(t,`class`,3,``),a=K(t,`closeLabel`,3,`Close dialog`),o=K(t,`size`,3,`default`),s=K(t,`flush`,3,!1),c=K(t,`closeOnInteractOutside`,3,!0);function u(e){n(e),t.onOpenChange?.(e)}var m=_();d(F(m),()=>vF,(e,m)=>{m(e,{onOpenChange:u,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var u=_(),m=F(u);{let e=l(()=>I(`dialog-content data-open:animate-in data-closed:animate-out data-open:fade-in-0 data-closed:fade-out-0 data-open:zoom-in-95 data-closed:zoom-out-95 duration-100 outline-none`,o()===`sm`&&`dialog-content-sm`,o()===`md`&&`dialog-content-md`,o()===`wide`&&`dialog-content-wide`,o()===`wide-viewport`&&`dialog-content-wide-viewport`,o()===`viewport`&&`dialog-content-viewport`,i()));d(m,()=>OF,(n,i)=>{i(n,{showCloseButton:!1,layout:`shell`,onInteractOutside:e=>{c()||e.preventDefault()},get class(){return L(e)},children:(e,n)=>{var i=FF(),o=F(i),c=B(o),l=B(c);d(l,()=>SF,(e,t)=>{t(e,{class:`dialog-title`,children:(e,t)=>{g();var n=D();J(()=>f(n,r())),q(e,n)},$$slots:{default:!0}})});var u=Y(l,2),m=e=>{var n=_();d(F(n),()=>AF,(e,n)=>{n(e,{class:`dialog-description`,children:(e,n)=>{g();var r=D();J(()=>f(r,t.description)),q(e,r)},$$slots:{default:!0}})}),q(e,n)};p(u,e=>{t.description&&e(m)}),y(c);var v=Y(c,2),b=e=>{var n=NF();h(B(n),()=>t.headerActions),y(n),q(e,n)};p(v,e=>{t.headerActions&&e(b)}),d(Y(v,2),()=>MF,(e,t)=>{t(e,{class:`dialog-close`,get"aria-label"(){return a()},children:(e,t)=>{li(e,{size:14,strokeWidth:2.25,"aria-hidden":`true`})},$$slots:{default:!0}})}),y(o);var x=Y(o,2);h(B(x),()=>t.children??N),y(x);var S=Y(x,2),C=e=>{var n=PF();h(B(n),()=>t.footer),y(n),q(e,n)};p(S,e=>{t.footer&&e(C)}),J(e=>w(x,1,e),[()=>_e(I(`dialog-body`,s()&&`dialog-body-flush`))]),q(e,i)},$$slots:{default:!0}})})}q(e,u)},$$slots:{default:!0}})}),q(e,m),H()}function LF({atEnd:e,scrollDelta:t,userScrollAwayIntent:n,scrollbarPointerActive:r,epsilon:i=1}){return e?!1:r?!0:n&&t<-i}var RF=30,zF=2400,BF=32,VF=100,HF=350,UF=120,WF=1,GF=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),KF=new Set([`ArrowUp`,`Home`,`PageUp`]);function qF(e){return Math.max(e.scrollHeight-e.clientHeight-e.scrollTop,0)}function JF(e,t=BF){return qF(e)<=t}function YF(e,t){if(t.scrollHeight<=t.clientHeight)return!1;let n=t.offsetWidth-t.clientWidth;if(n<=0)return!1;let r=t.getBoundingClientRect();return e.clientX>=r.right-n&&e.clientX<=r.right&&e.clientY>=r.top&&e.clientY<=r.bottom}function XF(e){let t=X(void 0),n=X(0),r=X(void 0),i=X(!0),a=X(!0),o,s=!1,c=!1,l,u=!1,d,f=!1,p;function m(){d!==void 0&&(clearTimeout(d),d=void 0)}function h(){p!==void 0&&(clearTimeout(p),p=void 0)}function g(){f=!0,h(),p=setTimeout(()=>{f=!1,p=void 0},UF)}function _(){l!==void 0&&(cancelAnimationFrame(l),l=void 0)}function v(e){g(),L(r)?.scrollToEnd(e)}function y(e){let t=L(r);if(e){if(JF(e,BF)){R(a,!0);return}u&&qF(e)>VF&&(R(a,!1),_());return}if(t?.isAtEnd(BF)){R(a,!0);return}u&&(t?.getDistanceFromEnd()??0)>VF&&(R(a,!1),_())}function b(){R(a,!1),_()}function x(e){f||(u=e?.scrollAwayIntent??!!e?.disableFollowImmediately,e?.disableFollowImmediately&&b(),m(),d=setTimeout(()=>{u=!1,d=void 0},HF),requestAnimationFrame(()=>y(e?.viewport)))}function S(){let e=L(r);e&&(R(a,!0),e.getDistanceFromEnd()<=zF?v({behavior:`smooth`}):C())}function C(){_(),R(a,!0);let e=0,t=()=>{l=void 0,e+=1;let n=L(r);if(!n){e<RF&&(l=requestAnimationFrame(t));return}v({behavior:`instant`}),!n.isAtEnd(BF)&&e<RF&&(l=requestAnimationFrame(t))};l=requestAnimationFrame(t)}return z(()=>{if(!L(i))return;let e=L(r)?.getViewportElement();e&&!JF(e,BF)||R(a,!0)}),z(()=>{let t=e.active?.()??!0,n=e.conversationId(),r=e.contentReady(),i=t&&!s;if(s=t,n!==o&&(o=n,c=!1,R(a,!0),_()),!t){_();return}if(!(!e.conversationOpen()||!n||!r)){if(!c){c=!0,Ce().then(C);return}i&&L(a)&&Ce().then(C)}}),z(()=>{let r=L(t),i=e.active?.()??!0;if(!r||typeof ResizeObserver>`u`)return;let a=()=>{R(n,i?r.offsetHeight:0,!0)};a();let o=new ResizeObserver(a);return o.observe(r),()=>o.disconnect()}),z(()=>{let e=L(r)?.getViewportElement();if(!e)return;let t=e.scrollTop,n=!1,i=()=>{let r=e.scrollTop,i=r-t;if(t=r,f)return;let o=JF(e,BF);if(o){R(a,!0);return}LF({atEnd:o,scrollDelta:i,userScrollAwayIntent:u,scrollbarPointerActive:n,epsilon:WF})&&b()},o=t=>{n=YF(t,e),n&&x({disableFollowImmediately:!0,viewport:e})},s=()=>{n&&x({disableFollowImmediately:!0,viewport:e})},c=()=>{n&&JF(e,BF)&&R(a,!0),n=!1},l=t=>{let n=t.deltaY<0;x({disableFollowImmediately:n,scrollAwayIntent:n,viewport:e})},d=()=>{x({disableFollowImmediately:!0,viewport:e})},p=t=>{if(!GF.has(t.key))return;let n=KF.has(t.key)||t.key===` `&&t.shiftKey;x({disableFollowImmediately:n,scrollAwayIntent:n,viewport:e})};return e.addEventListener(`scroll`,i,{passive:!0}),e.addEventListener(`wheel`,l,{passive:!0}),e.addEventListener(`touchmove`,d,{passive:!0}),e.addEventListener(`pointerdown`,o,{passive:!0}),e.addEventListener(`pointermove`,s,{passive:!0}),e.addEventListener(`pointerup`,c,{passive:!0}),e.addEventListener(`pointerleave`,c,{passive:!0}),e.addEventListener(`keydown`,p),()=>{e.removeEventListener(`scroll`,i),e.removeEventListener(`wheel`,l),e.removeEventListener(`touchmove`,d),e.removeEventListener(`pointerdown`,o),e.removeEventListener(`pointermove`,s),e.removeEventListener(`pointerup`,c),e.removeEventListener(`pointerleave`,c),e.removeEventListener(`keydown`,p)}}),z(()=>()=>{_(),m(),h(),u=!1,f=!1}),{get composerWrapEl(){return L(t)},set composerWrapEl(e){R(t,e,!0)},get composerHeight(){return L(n)},get controller(){return L(r)},set controller(e){R(r,e,!0)},get atEnd(){return L(i)},set atEnd(e){R(i,e,!0)},get followBottom(){return L(a)},scrollToEnd:v,jumpToBottom:S}}function ZF(e){return e.kind===`message`&&e.item.role===`assistant`&&e.item.displayKind===`thinking`}function QF(e){let t=[];for(let n of e){if(!ZF(n)){t.push(n);continue}let e=t.at(-1);e?.kind===`thinking_group`?e.items.push(n):t.push({kind:`thinking_group`,key:n.key,items:[n]})}return t}var $F=P(`<p>Provider returned redacted thinking.</p>`),eI=P(`<span class="stream-caret svelte-ngmo3" aria-hidden="true"></span>`),tI=P(`<div><!> <!></div>`),nI=P(`<div><!></div>`),rI=P(`<div class="thinking-group svelte-ngmo3"><div class="thinking-content svelte-ngmo3"></div></div>`);function iI(e,t){var n=rI(),r=B(n);O(r,23,()=>t.items,(e,t)=>e.id??t,(e,t)=>{let n=l(()=>!!(L(t).live&&!L(t).done));var r=nI();let i;var a=B(r),o=e=>{var t=$F();let r;J(()=>r=w(t,1,`redacted svelte-ngmo3`,null,r,{"live-caret":L(n)})),q(e,t)},s=e=>{var r=tI();let i;var a=B(r);Pj(a,{get text(){return L(t).text},get streaming(){return L(n)},get onCopy(){return OS}});var o=Y(a,2),s=e=>{q(e,eI())};p(o,e=>{L(n)&&!L(t).text&&e(s)}),y(r),J(()=>i=w(r,1,`step-markdown svelte-ngmo3`,null,i,{"live-caret":L(n)})),q(e,r)};p(a,e=>{L(t).redacted&&!L(t).text?e(o):e(s,-1)}),y(r),J(()=>i=w(r,1,`thinking-step svelte-ngmo3`,null,i,{"step-live":L(n)})),q(e,r)}),y(r),y(n),q(e,n)}var aI=P(`<span class="elapsed svelte-8dfbf0"> </span>`),oI=P(`<div class="working-indicator svelte-8dfbf0"><span class="orbit svelte-8dfbf0" aria-hidden="true"><span class="orbit-spinner svelte-8dfbf0"></span></span> <span class="label svelte-8dfbf0"> </span> <!></div>`);function sI(e,t){x(t,!0);let n=[`Thinking…`,`Planning next steps…`,`Connecting the dots…`,`Reasoning through it…`,`Mapping it out…`,`Gathering context…`,`Weighing options…`,`Putting the pieces together…`,`Sketching an approach…`,`Getting my bearings…`],r=n[Math.floor(Math.random()*n.length)],i=X(0);z(()=>{let e=Date.now(),t=setInterval(()=>{R(i,Math.floor((Date.now()-e)/1e3),!0)},250);return()=>clearInterval(t)});let a=l(()=>`${Math.floor(L(i)/60)}:${String(L(i)%60).padStart(2,`0`)}`);var o=oI(),s=Y(B(o),2),c=B(s,!0);y(s);var u=Y(s,2),d=e=>{var t=aI(),n=B(t,!0);y(t),J(()=>f(n,L(a))),q(e,t)};p(u,e=>{L(i)>=3&&e(d)}),y(o),J(()=>f(c,r)),q(e,o),H()}var cI=new Set([`$$slots`,`$$events`,`$$legacy`]);function lI(e,t){let n=U(t,cI),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`}]];G(e,V({name:`circle-alert`},()=>n,{get iconNode(){return r}}))}var uI=P(`<span class="tool-status-glyph inline-flex size-full items-center justify-center svelte-1ya8e7m"><!></span>`),dI=P(`<span><!></span>`);function fI(e,t){x(t,!0);let n=K(t,`pulse`,3,!1),r=K(t,`waitingForUser`,3,!1),i=K(t,`size`,3,14),a=l(()=>!r()&&(n()||t.tone===`running`)),o={running:`text-info`,good:`text-success`,warn:`text-warning`,danger:`text-destructive`,neutral:`text-muted-foreground`,accent:`text-muted-foreground`},s={running:jv,good:Ja,warn:lI,danger:Je,neutral:jv,accent:jv},c=l(()=>r()?qe:s[t.tone]),f=l(()=>`${r()?`waiting`:L(a)?`spin`:`static`}:${t.tone}`);var m=dI();let h;M(B(m),()=>L(f),e=>{var n=uI(),r=B(n),s=e=>{{let n=l(()=>`width:${i()}px;height:${i()}px`),r=l(()=>I(`block`,o[t.tone])),a=l(()=>t.label?void 0:`true`);ke(e,{get style(){return L(n)},get class(){return L(r)},get"aria-hidden"(){return L(a)},get"aria-label"(){return t.label}})}},u=e=>{var n=_(),r=F(n);{let e=l(()=>I(`block`,o[t.tone])),n=l(()=>t.label?void 0:`true`);d(r,()=>L(c),(r,a)=>{a(r,{get size(){return i()},strokeWidth:2.2,get class(){return L(e)},get"aria-hidden"(){return L(n)},get"aria-label"(){return t.label}})})}q(e,n)};p(r,e=>{L(a)?e(s):e(u,-1)}),y(n),q(e,n)}),y(m),J(e=>{w(m,1,e,`svelte-1ya8e7m`),h=u(m,``,h,{width:`${i()}px`,height:`${i()}px`})},[()=>_e(I(`inline-flex shrink-0 items-center justify-center`,t.class))]),q(e,m),H()}var pI=P(`<article class="tool-result-error-card svelte-1utey9k"><div class="tool-header svelte-1utey9k"><!> <span class="badge svelte-1utey9k"> </span></div> <pre class="tool-error svelte-1utey9k"> </pre></article>`);function mI(e,t){x(t,!0);let n=l(()=>ca(t.error,{headLines:18,tailLines:6,maxChars:6e3}).text);var r=pI(),i=B(r),a=B(i);fI(a,{tone:`danger`,size:14,class:`mr-1.5 align-middle`});var o=Y(a,2),s=B(o,!0);y(o),y(i);var c=Y(i,2),u=B(c,!0);y(c),y(r),J(()=>{f(s,t.toolName),f(u,L(n))}),q(e,r),H()}var hI=P(`<div class="grid gap-3 p-6" aria-label="Loading subagent transcript"><!> <!> <!></div>`),gI=P(`<div class="grid place-items-center gap-3 p-8 text-center"><p class="m-0 text-sm text-destructive"> </p> <!></div>`),_I=P(`<span class="text-destructive"> </span>`),vI=P(`<div class="border-b bg-muted/30 px-4 py-2 text-xs text-muted-foreground"><!> <!></div>`),yI=P(`<div class="grid place-items-center p-8 text-sm text-muted-foreground">No transcript activity yet.</div>`),bI=P(`<article class="relative w-full min-w-0 p-3 text-sm"><!></article>`),xI=P(`<div class="min-w-0 px-3"><!></div>`),SI=P(`<article class="min-w-0 p-3 text-sm"><!></article>`),CI=P(`<pre class="mt-2 whitespace-pre-wrap break-words rounded-md border border-destructive/40 bg-destructive/10 p-3 font-mono text-xs text-destructive"> </pre>`),wI=P(`<article><!> <!></article>`),TI=P(`<div class="relative min-h-0"><!> <!></div>`),EI=P(`<div class="grid h-full min-h-0 grid-rows-[auto_1fr]"><!> <!></div>`);function DI(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=Lj(),i=X(void 0),a=X(void 0),o=X(!1),s=X(void 0),c=X(0),u=l(()=>gee(L(a))),d=l(()=>{let e=QF(L(u).timeline).map(e=>({kind:`timeline`,key:e.key,node:e}));return L(a)?.sending&&!L(u).hasActiveTurnOutput&&e.push({kind:`waiting`,key:`__waiting__`}),e}),m=XF({active:()=>n(),conversationOpen:()=>n(),conversationId:()=>t.parentAgentId&&t.childAgentId?`subagent:${t.parentAgentId}:${t.childAgentId}`:void 0,contentReady:()=>L(d).length>0});function h(e){if(e.kind===`waiting`)return`waiting`;let t=e.node;return t.kind===`thinking_group`?t.items.map(e=>`${e.item.text.length}:${e.item.done?`done`:`open`}`).join(`|`):t.kind===`message`?[t.item.text.length,t.item.done?`done`:`open`,t.item.stopReason??`ok`,t.item.errorMessage?.length??0].join(`:`):t.kind===`tool`?t.toolCall?`${t.toolCall.status}:${t.toolCall.updatedAt}`:`draft:${t.draft?.block.argsText.length??0}`:t.key}z(()=>{let e=t.parentAgentId,l=t.childAgentId;if(L(c),!n()||!e||!l)return;let u=r.watchSubagentTranscript;if(!u){R(s,`Subagent transcripts are unavailable here.`);return}return R(o,!L(i)),R(s,void 0),u(e,l,{snapshot:t=>{t.parentAgentId!==e||t.agentId!==l||(R(i,t,!0),R(a,yn(t),!0),R(o,!1),R(s,void 0))},event:e=>{if(!L(a))return;let t=!1;return R(a,uee(L(a),e,()=>{t=!0,R(s,`Live activity was interrupted; recovering the transcript.`)}),!0),!t},error:e=>{R(o,!1),R(s,e,!0)}})}),z(()=>{t.childAgentId&&(R(i,void 0),R(a,void 0),R(s,void 0))});function v(e){n(e),t.onOpenChange?.(e)}{let r=l(()=>`${t.label} transcript`),a=l(()=>L(i)?[L(i).status,L(i).model,L(i).thinkingLevel].filter(Boolean).join(` · `):`Read-only child-agent activity`);IF(e,{flush:!0,size:`wide-viewport`,get title(){return L(r)},get description(){return L(a)},onOpenChange:v,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var r=_(),a=F(r),u=e=>{var t=hI(),n=B(t);GP(n,{class:`h-16 w-3/4`});var r=Y(n,2);GP(r,{class:`h-24 w-full`}),GP(Y(r,2),{class:`h-20 w-4/5`}),y(t),q(e,t)},v=e=>{var t=gI(),n=B(t),r=B(n,!0);y(n),W(Y(n,2),{size:`sm`,variant:`outline`,onclick:()=>R(c,L(c)+1),children:(e,t)=>{g(),q(e,D(`Retry`))},$$slots:{default:!0}}),y(t),J(()=>f(r,L(s))),q(e,t)},b=e=>{var n=EI(),r=B(n),a=e=>{var t=vI(),n=B(t),r=e=>{q(e,D(`Showing the assignment and most recent bounded activity.`))};p(n,e=>{(L(i).entriesTruncated||L(i).toolCallsTruncated)&&e(r)});var a=Y(n,2),o=e=>{var t=_I(),n=B(t,!0);y(t),J(()=>f(n,L(s))),q(e,t)};p(a,e=>{L(s)&&e(o)}),y(t),q(e,t)};p(r,e=>{(L(i).entriesTruncated||L(i).toolCallsTruncated||L(s))&&e(a)});var o=Y(r,2),c=e=>{q(e,yI())},u=e=>{var n=TI(),r=B(n);{let e=(e,t)=>{let n=()=>t?.().item;var r=_(),i=F(r),a=e=>{var t=bI();sI(B(t),{}),y(t),q(e,t)},o=e=>{var t=xI();ZV(B(t),{get toolCall(){return n().node.toolCall},detailsEnabled:!1}),y(t),q(e,t)},s=e=>{var t=xI();mI(B(t),{get toolName(){return n().node.toolName},get error(){return n().node.error}}),y(t),q(e,t)},c=e=>{var t=SI(),r=B(t);{let e=l(()=>n().node.items.map(e=>e.item));iI(r,{get items(){return L(e)}})}y(t),q(e,t)},u=e=>{var t=wI(),r=B(t),i=e=>{Ny(e,{get text(){return n().node.item.text},pending:!1})},a=e=>{{let t=l(()=>n().node.item.role!==`assistant`);Pj(e,{get text(){return n().node.item.text},get trimCodeBlocks(){return L(t)},get onCopy(){return OS}})}};p(r,e=>{n().node.item.role===`user`?e(i):e(a,-1)});var o=Y(r,2),s=e=>{var t=CI(),r=B(t,!0);y(t),J(()=>f(r,n().node.item.errorMessage)),q(e,t)};p(o,e=>{n().node.item.stopReason===`error`&&n().node.item.errorMessage&&e(s)}),y(t),J(()=>w(t,1,`min-w-0 p-3 text-sm ${n().node.item.role===`user`?`ml-auto w-fit max-w-[70%] rounded-lg rounded-br-sm border border-primary/20 bg-primary/10 px-3 py-2`:`w-full`}`)),q(e,t)};p(i,e=>{n().kind===`waiting`?e(a):n().node.kind===`tool`&&n().node.toolCall?e(o,1):n().node.kind===`tool_result_error`?e(s,2):n().node.kind===`thinking_group`?e(c,3):n().node.kind===`message`&&e(u,4)}),q(e,r)},n=l(()=>t.parentAgentId&&t.childAgentId?`subagent-transcript:${t.parentAgentId}:${t.childAgentId}`:void 0),i=l(()=>`${t.label} subagent transcript`);Ka(r,{get items(){return L(d)},getKey:e=>e.key,get heightCacheKey(){return L(n)},getMeasurementVersion:h,estimateSize:()=>112,overscan:10,anchor:`end`,get followOutput(){return m.followBottom},scrollEndThreshold:32,paddingStart:12,paddingEnd:12,gap:2,viewportTabIndex:0,get viewportAriaLabel(){return L(i)},viewportClass:`h-full px-3`,get controller(){return m.controller},set controller(e){m.controller=e},get atEnd(){return m.atEnd},set atEnd(e){m.atEnd=e},row:e,$$slots:{row:!0}})}var i=Y(r,2),a=e=>{W(e,{size:`icon-sm`,variant:`secondary`,class:`absolute right-5 bottom-4 rounded-full shadow-md`,onclick:()=>m.jumpToBottom(),"aria-label":`Jump to latest subagent activity`,title:`Jump to latest`,children:(e,t)=>{nt(e,{class:`size-4`,"aria-hidden":`true`})},$$slots:{default:!0}})};p(i,e=>{m.atEnd||e(a)}),y(n),q(e,n)};p(o,e=>{L(d).length===0?e(c):e(u,-1)}),y(n),q(e,n)};p(a,e=>{L(o)&&!L(i)?e(u):L(s)&&!L(i)?e(v,1):L(i)&&e(b,2)}),q(e,r)},$$slots:{default:!0}})}H()}var OI=P(`<strong class="min-w-0 truncate text-sm font-medium leading-tight"> </strong>`),kI=P(`<span class="shrink-0 rounded border px-1.5 py-0.5 text-xs leading-none text-muted-foreground"> </span>`),AI=P(`<span class="shrink-0 text-xs tabular-nums text-muted-foreground"> </span>`),jI=P(`<div class="grid gap-1" aria-hidden="true"><!> <!></div>`),MI=P(`<!> Transcript`,1),NI=P(`<!> Report`,1),PI=P(`<span class="inline-flex min-h-5 items-center rounded border bg-muted/30 px-1.5 py-0.5 text-xs tabular-nums text-muted-foreground"> </span>`),FI=P(`<div class="flex min-w-0 items-center gap-2"><p class="m-0 min-w-0 flex-1 truncate text-xs text-muted-foreground"> </p> <!></div> <div class="flex min-w-0 flex-wrap items-center gap-1.5"><!> <!> <!></div>`,1),II=P(`<li class="grid min-w-0 gap-2 rounded-lg border bg-card px-3 py-2.5"><div class="flex min-w-0 items-center gap-2"><div class="flex min-w-0 flex-1 items-center gap-2"><!> <!></div> <span> </span> <!></div> <!></li>`),LI=P(`<div class="grid gap-2"><p class="sr-only" aria-live="polite"> </p> <ol class="grid gap-2"></ol></div> <!>`,1);function RI(e,t){x(t,!0);let n=l(()=>t.view?Eb(t.view):void 0),r=l(()=>L(n)?.tasks??hF({args:t.draft?.block.args,argsText:t.draft?.block.argsText})),i=l(()=>L(n)?.summary),a=X(void 0),o=X(!1);z(()=>{if(!L(a))return;let e=L(r).find(e=>e.key===L(a)?.taskKey&&e.status!==`drafting`);if(!e?.agentId)return;let t=u(e);L(a).childAgentId===e.agentId&&L(a).label===t&&L(a).status===e.status||R(a,{...L(a),childAgentId:e.agentId,label:t,status:e.status},!0)});function s(e){return e.split(/[\\/]/).pop()||e}function c(e){return e.split(/[/:]/).pop()??e}function u(e){return e.label??e.task??`Explore ${(e.index??0)+1}`}function d(e){if(!(`model`in e))return;let t=[];return e.model&&t.push(c(e.model)),e.thinkingLevel&&t.push(e.thinkingLevel),t.length>0?t.join(` · `):void 0}function m(e,t){return`${e.toLocaleString()} ${t}${e===1?``:`s`}`}function h(e){let t=e.report?.usage;if(!t)return[];let n=[];t.turns&&n.push(m(t.turns,`turn`));let r=t.totalTokens||t.input+t.output;return r>0&&n.push(m(r,`token`)),n}function _(e){switch(e.status){case`drafting`:return`Drafting`;case`queued`:return`Queued`;case`running`:return`Running`;case`completed`:return`Completed`;case`failed`:return`Failed`;case`aborted`:return`Stopped`}}function v(e){switch(e.status){case`running`:return`text-info`;case`completed`:return`text-success`;case`failed`:return`text-destructive`;case`aborted`:return`text-warning`;default:return`text-muted-foreground`}}function b(e){return e.status===`queued`?`Waiting for an active-agent slot…`:e.status===`running`?e.currentAction??`Waiting for the first tool…`:e.status===`aborted`?e.error??`Agent run stopped.`:e.status===`failed`?e.error??`Agent run failed.`:e.report?.summaryPreview??`Investigation complete.`}function S(e){!e.agentId||!t.toolCall?.agentId||(R(a,{taskKey:e.key,parentAgentId:t.toolCall.agentId,childAgentId:e.agentId,label:u(e),status:e.status},!0),R(o,!0))}let C=l(()=>{if(!L(i))return`Preparing explore agents`;let e=L(i).completed+L(i).failed+L(i).aborted,t=[L(i).failed>0?`${L(i).failed} failed`:void 0,L(i).aborted>0?`${L(i).aborted} stopped`:void 0].filter(Boolean);return`${e} of ${L(i).total} finished${t.length?` · ${t.join(` · `)}`:``}`});var T=LI(),E=F(T),D=B(E),k=B(D,!0);y(D);var ee=Y(D,2);O(ee,21,()=>L(r),e=>e.key,(e,n)=>{let r=l(()=>d(L(n)));var i=II(),a=B(i),o=B(a),c=B(o),x=e=>{GP(e,{class:`h-4 w-2/5`})},C=e=>{var t=OI(),r=B(t,!0);y(t),J(e=>f(r,e),[()=>u(L(n))]),q(e,t)};p(c,e=>{L(n).status===`drafting`&&!L(n).label&&!L(n).task?e(x):e(C,-1)});var T=Y(c,2),E=e=>{var t=kI(),n=B(t,!0);y(t),J(()=>f(n,L(r))),q(e,t)};p(T,e=>{L(r)&&e(E)}),y(o);var D=Y(o,2),k=B(D,!0);y(D);var ee=Y(D,2),j=e=>{var t=AI(),r=B(t);y(t),J(()=>f(r,`${(L(n).index??0)+1}/${L(n).count??``}`)),q(e,t)};p(ee,e=>{(L(n).count??0)>1&&e(j)}),y(a);var M=Y(a,2),N=e=>{var t=jI(),n=B(t);GP(n,{class:`h-3 w-full`}),GP(Y(n,2),{class:`h-3 w-2/3`}),y(t),q(e,t)},te=e=>{var r=FI(),i=F(r),a=B(i),o=B(a,!0);y(a);var c=Y(a,2),d=e=>{var t=AI(),r=B(t,!0);y(t),J(e=>f(r,e),[()=>m(L(n).actionCount,`action`)]),q(e,t)};p(c,e=>{L(n).status===`running`&&L(n).actionCount>0&&e(d)}),y(i);var _=Y(i,2),v=B(_),x=e=>{{let t=l(()=>`View transcript for ${u(L(n))}`);W(e,{size:`xs`,variant:`outline`,class:`h-5 gap-1 rounded px-1.5 text-xs shadow-none`,onclick:()=>S(L(n)),get"aria-label"(){return L(t)},children:(e,t)=>{var n=MI();mF(F(n),{class:`size-3`,"aria-hidden":`true`}),g(),q(e,n)},$$slots:{default:!0}})}};p(v,e=>{L(n).agentId&&t.toolCall?.agentId&&e(x)});var C=Y(v,2),w=e=>{{let r=l(()=>`Open report ${s(L(n).report.reportPath)}`);W(e,{size:`xs`,variant:`outline`,class:`h-5 gap-1 rounded px-1.5 text-xs shadow-none`,onclick:()=>L(n).report?.reportPath&&t.onOpenFile?.(L(n).report.reportPath),get title(){return L(n).report.reportPath},get"aria-label"(){return L(r)},children:(e,t)=>{var n=NI();lf(F(n),{class:`size-3`,"aria-hidden":`true`}),g(),q(e,n)},$$slots:{default:!0}})}};p(C,e=>{L(n).report?.reportPath&&e(w)}),O(Y(C,2),16,()=>h(L(n)),e=>e,(e,t)=>{var n=PI(),r=B(n,!0);y(n),J(()=>f(r,t)),q(e,n)}),y(_),J(e=>f(o,e),[()=>b(L(n))]),q(e,r)};p(M,e=>{L(n).status===`drafting`?e(N):e(te,-1)}),y(i),J((e,t)=>{A(i,`data-status`,L(n).status),w(D,1,e),f(k,t)},[()=>`shrink-0 text-xs font-medium ${v(L(n))}`,()=>_(L(n))]),q(e,i)}),y(ee),y(E);var j=Y(E,2),M=e=>{DI(e,{get parentAgentId(){return L(a).parentAgentId},get childAgentId(){return L(a).childAgentId},get label(){return L(a).label},onOpenChange:e=>R(o,e,!0),get open(){return L(o)},set open(e){R(o,e,!0)}})};p(j,e=>{L(a)&&e(M)}),J(()=>f(k,L(C))),q(e,T),H()}var zI=P(`<p class="m-0 text-xs text-muted-foreground">No files found.</p>`),BI=P(`<li><button type="button" class="cursor-pointer border-0 bg-transparent p-0 text-left font-mono text-xs text-primary hover:underline"> </button></li>`),VI=P(`<ul class="m-0 list-none rounded-sm border bg-sidebar px-2.5 py-2 font-mono text-xs leading-snug text-sidebar-foreground"></ul>`);function HI(e,t){x(t,!0);let n=K(t,`expanded`,3,!1),r=l(()=>(n()?t.view.paths:t.view.paths.slice(0,6)).map((e,n)=>({path:e,openPath:t.view.openPaths[n]??e})));var i=_(),a=F(i),o=e=>{q(e,zI())},s=e=>{var n=VI();O(n,21,()=>L(r),e=>e.path,(e,n)=>{var r=BI(),i=B(r),a=B(i,!0);y(i),y(r),J(()=>f(a,L(n).path)),le(`click`,i,()=>t.onOpenFile?.(L(n).openPath)),q(e,r)}),y(n),q(e,n)};p(a,e=>{t.view.count===0&&t.toolCall.status===`completed`?e(o):t.view.count>0&&e(s,1)}),q(e,i),H()}r([`click`]);var UI=P(`<div class="grid gap-1.5"><p class="m-0 text-xs font-medium text-muted-foreground">Result</p> <p> </p></div>`),WI=P(`<p class="m-0 text-xs text-muted-foreground">No output.</p>`),GI=P(`<div class="grid gap-1.5"><p class="m-0 text-xs font-medium text-muted-foreground">Recorded arguments</p> <!></div>`),KI=P(`<div class="grid gap-2" aria-label="Recorded tool output"><!> <!></div>`);function qI(e,t){x(t,!0);let n=K(t,`expanded`,3,!1),r=l(()=>t.view.result.length>0?{kind:`key-values`,items:t.view.result.map(e=>({label:e.key,value:e.value,mono:!0,tone:e.redacted?`warning`:void 0}))}:void 0),i=l(()=>({kind:`key-values`,items:t.view.args.map(e=>({label:e.key,value:e.value,mono:!0,tone:e.redacted?`warning`:void 0}))}));var a=KI(),o=B(a),s=e=>{var r=UI(),i=Y(B(r),2);let a;var o=B(i,!0);y(i),y(r),J(()=>{a=w(i,1,`m-0 whitespace-pre-wrap text-sm leading-relaxed text-foreground [overflow-wrap:anywhere]`,null,a,{"line-clamp-6":!n()}),f(o,t.view.resultText)}),q(e,r)},c=e=>{nF(e,{get body(){return L(r)}})},u=e=>{q(e,WI())};p(o,e=>{t.view.resultText?e(s):L(r)?e(c,1):t.toolCall.status===`completed`&&e(u,2)});var d=Y(o,2),m=e=>{var t=GI();nF(Y(B(t),2),{get body(){return L(i)}}),y(t),q(e,t)};p(d,e=>{t.view.args.length>0&&(t.toolCall.status===`error`||t.toolCall.status===`denied`)&&e(m)}),y(a),q(e,a),H()}var JI=P(`<button class="match svelte-17w44lw" type="button"><span class="line-no svelte-17w44lw"> </span><span class="line-text svelte-17w44lw"> </span></button>`),YI=P(`<div class="file"><button class="file-path svelte-17w44lw" type="button" title="Open file pane"> </button> <!></div>`),XI=P(`<div class="matches svelte-17w44lw"></div>`),ZI=P(`<p class="note svelte-17w44lw">No matches.</p>`);function QI(e,t){x(t,!0);let n=(e,n=N)=>{var r=XI();O(r,21,n,e=>e.path,(e,n)=>{var r=YI(),i=B(r),a=B(i,!0);y(i),O(Y(i,2),19,()=>L(n).matches,(e,t)=>`${L(n).path}:${e.line}:${t}:${e.text}`,(e,r)=>{var i=JI(),a=B(i),o=B(a,!0);y(a);var s=Y(a),c=B(s,!0);y(s),y(i),J(()=>{A(i,`title`,`Open ${L(n).path}:${L(r).line}`),f(o,L(r).line),f(c,L(r).text)}),le(`click`,i,()=>t.onOpenFile?.(L(r).openPath??L(n).openPath??L(n).path,L(r).line)),q(e,i)}),y(r),J(()=>f(a,L(n).path)),le(`click`,i,()=>t.onOpenFile?.(L(n).openPath??L(n).path)),q(e,r)}),y(r),q(e,r)},r=K(t,`expanded`,3,!1),i=l(()=>{if(r())return t.view.allMatches;let e=[],n=0;for(let r of t.view.allMatches){if(n>=6)break;let t=r.matches.slice(0,6-n);e.push({path:r.path,openPath:r.openPath,matches:t}),n+=t.length}return e});var a=_(),o=F(a),s=e=>{q(e,ZI())},c=e=>{n(e,()=>L(i))};p(o,e=>{t.view.matchCount===0&&t.toolCall.status===`completed`?e(s):t.view.matchCount>0&&e(c,1)}),q(e,a),H()}r([`click`]);var $I=new Set([`$$slots`,`$$events`,`$$legacy`]);function eL(e,t){let n=U(t,$I),r=[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`}]];G(e,V({name:`tag`},()=>n,{get iconNode(){return r}}))}var tL=P(`<span class="min-w-0 break-words text-xs font-medium text-sidebar-foreground"> </span>`),nL=P(`<span class="inline-flex items-center gap-1 text-xs text-muted-foreground"><!> </span>`),rL=P(`<div class="flex flex-wrap items-center gap-1.5"><!> <!> <!> <!></div>`),iL=P(`<div class="grid gap-1 rounded-sm border bg-sidebar px-2.5 py-2"><div class="flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1"><!> <span class="font-mono text-xs text-muted-foreground"> </span></div> <!></div>`);function aL(e,t){x(t,!0);let n=l(()=>t.field.allowedValues??[]);var r=iL(),i=B(r),a=B(i),o=e=>{var n=tL(),r=B(n,!0);y(n),J(()=>f(r,t.field.name)),q(e,n)};p(a,e=>{t.field.name&&e(o)});var s=Y(a,2),c=B(s,!0);y(s),y(i);var u=Y(i,2),d=e=>{var r=rL(),i=B(r),a=e=>{nP(e,{tone:`neutral`,size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,t.field.type)),q(e,r)},$$slots:{default:!0}})};p(i,e=>{t.field.type&&e(a)});var o=Y(i,2),s=e=>{nP(e,{tone:`warn`,size:`xs`,children:(e,t)=>{g(),q(e,D(`required`))},$$slots:{default:!0}})};p(o,e=>{t.field.required&&e(s)});var c=Y(o,2),l=e=>{nP(e,{tone:`accent`,size:`xs`,children:(e,t)=>{g(),q(e,D(`custom`))},$$slots:{default:!0}})};p(c,e=>{t.field.custom&&e(l)});var u=Y(c,2),d=e=>{var t=nL(),r=B(t);eL(r,{size:11,strokeWidth:2});var i=Y(r);y(t),J(e=>{A(t,`title`,e),f(i,` ${L(n).length??``} allowed`)},[()=>L(n).join(`, `)]),q(e,t)};p(u,e=>{L(n).length>0&&e(d)}),y(r),q(e,r)};p(u,e=>{(t.field.type||t.field.required||t.field.custom||L(n).length>0)&&e(d)}),y(r),J(()=>f(c,t.field.id)),q(e,r),H()}var oL=new Set([`$$slots`,`$$events`,`$$legacy`]);function sL(e,t){let n=U(t,oL),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M12 6v6l4 2`}]];G(e,V({name:`clock`},()=>n,{get iconNode(){return r}}))}var cL=new Set([`$$slots`,`$$events`,`$$legacy`]);function lL(e,t){let n=U(t,cL),r=[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`}],[`circle`,{cx:`12`,cy:`7`,r:`4`}]];G(e,V({name:`user`},()=>n,{get iconNode(){return r}}))}function uL(e){try{return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}catch{return e}}function dL(e){if(!e)return``;let t=new Date(e).getTime();if(Number.isNaN(t))return``;let n=Date.now()-t,r=Math.round(n/1e3);if(r<45)return`now`;let i=Math.round(r/60);if(i<60)return`${i}m`;let a=Math.round(i/60);if(a<24)return`${a}h`;let o=Math.round(a/24);if(o<7)return`${o}d`;let s=Math.round(o/7);if(s<5)return`${s}w`;let c=Math.round(o/30);return c<12?`${c}mo`:`${Math.round(o/365)}y`}function fL(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}function pL(e,t){switch(t?.toLowerCase()){case`new`:return`neutral`;case`indeterminate`:return`running`;case`done`:return`good`}let n=e?.toLowerCase()??``;return n?/block/.test(n)?`danger`:/progress|review|doing|started/.test(n)?`running`:/done|closed|resolved|complete/.test(n)?`good`:`neutral`:`neutral`}function mL(e){switch(e?.toLowerCase()){case`highest`:return`danger`;case`high`:return`warn`;case`medium`:case`low`:case`lowest`:return`neutral`;default:return}}function hL(e,t){let n=e?.trim().replace(/\/+$/,``);if(n)return`${n}/browse/${encodeURIComponent(t)}`}function gL(e){let t=e.displayName?.trim()||e.emailAddress?.trim()||``;if(t){let e=t.split(/[\s@._-]+/).filter(Boolean);if(e.length>=2)return(e[0][0]+e[1][0]).toUpperCase();if(e.length===1)return e[0].slice(0,2).toUpperCase()}return e.accountId.slice(0,2).toUpperCase()}var _L=new Set([`$$slots`,`$$events`,`$$legacy`]);function vL(e,t){let n=U(t,_L),r=[[`path`,{d:`M10 2v8l3-3 3 3V2`}],[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`}]];G(e,V({name:`book-marked`},()=>n,{get iconNode(){return r}}))}var yL=new Set([`$$slots`,`$$events`,`$$legacy`]);function bL(e,t){let n=U(t,yL),r=[[`path`,{d:`M12 20v-9`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`}],[`path`,{d:`M14.12 3.88 16 2`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`}],[`path`,{d:`M22 13h-4`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`}],[`path`,{d:`M6 13H2`}],[`path`,{d:`m8 2 1.88 1.88`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`}]];G(e,V({name:`bug`},()=>n,{get iconNode(){return r}}))}var xL=new Set([`$$slots`,`$$events`,`$$legacy`]);function SL(e,t){let n=U(t,xL),r=[[`path`,{d:`m7 6 5 5 5-5`}],[`path`,{d:`m7 13 5 5 5-5`}]];G(e,V({name:`chevrons-down`},()=>n,{get iconNode(){return r}}))}var CL=new Set([`$$slots`,`$$events`,`$$legacy`]);function wL(e,t){let n=U(t,CL),r=[[`path`,{d:`m17 11-5-5-5 5`}],[`path`,{d:`m17 18-5-5-5 5`}]];G(e,V({name:`chevrons-up`},()=>n,{get iconNode(){return r}}))}var TL=new Set([`$$slots`,`$$events`,`$$legacy`]);function EL(e,t){let n=U(t,TL),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`circle`,{cx:`12`,cy:`12`,r:`1`}]];G(e,V({name:`circle-dot`},()=>n,{get iconNode(){return r}}))}var DL=new Set([`$$slots`,`$$events`,`$$legacy`]);function OL(e,t){let n=U(t,DL),r=[[`line`,{x1:`5`,x2:`19`,y1:`9`,y2:`9`}],[`line`,{x1:`5`,x2:`19`,y1:`15`,y2:`15`}]];G(e,V({name:`equal`},()=>n,{get iconNode(){return r}}))}var kL=new Set([`$$slots`,`$$events`,`$$legacy`]);function AL(e,t){let n=U(t,kL),r=[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`}],[`circle`,{cx:`6`,cy:`18`,r:`3`}]];G(e,V({name:`git-branch`},()=>n,{get iconNode(){return r}}))}var jL=new Set([`$$slots`,`$$events`,`$$legacy`]);function ML(e,t){let n=U(t,jL),r=[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`}],[`path`,{d:`m9 11 3 3L22 4`}]];G(e,V({name:`square-check-big`},()=>n,{get iconNode(){return r}}))}function NL(e){let t=e?.toLowerCase()??``;return t.includes(`epic`)?g_:t.includes(`story`)?vL:t.includes(`bug`)?bL:t.includes(`subtask`)||t.includes(`sub-task`)?AL:t.includes(`task`)?ML:EL}function PL(e){let t=mL(e);if(t)return{icon:{highest:wL,high:Qa,medium:OL,low:Za,lowest:SL}[e?.toLowerCase()??``],tone:t}}var FL=P(`<a class="inline-flex items-center gap-1 font-mono text-xs font-semibold text-primary no-underline hover:underline" target="_blank" rel="noreferrer noopener"> <!></a>`),IL=P(`<span class="font-mono text-xs font-semibold text-primary"> </span>`),LL=P(`<span class="min-w-0 break-words text-xs font-medium leading-snug text-sidebar-foreground"> </span>`),RL=P(`<span><!> </span>`),zL=P(`<span class="inline-flex min-w-0 items-center gap-1 text-xs text-muted-foreground"><!> <span class="truncate"> </span></span>`),BL=P(`<span class="ml-auto inline-flex items-center gap-1 text-xs text-muted-foreground"><!> </span>`),VL=P(`<div class="flex flex-wrap items-center gap-x-2.5 gap-y-1"><!> <!> <!> <!></div>`),HL=P(`<div class="grid gap-1.5 rounded-sm border bg-sidebar px-2.5 py-2"><div class="flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1"><span class="inline-flex items-center gap-1.5"><!> <!></span> <!></div> <!></div>`);function UL(e,t){x(t,!0);let n=l(()=>hL(t.siteUrl,t.issue.key)),r=l(()=>NL(t.issue.issueType)),i=l(()=>pL(t.issue.status,t.issue.statusCategory)),a=l(()=>PL(t.issue.priority)),o=l(()=>t.issue.assignee??t.assigneeFallback),s=l(()=>dL(t.issue.updated)),c=l(()=>!!(t.issue.status||t.issue.priority||L(o)||L(s))),u={neutral:`text-muted-foreground`,accent:`text-foreground`,running:`text-info`,good:`text-success`,warn:`text-warning`,danger:`text-destructive`},m=l(()=>L(a)?u[L(a).tone??`neutral`]:`text-muted-foreground`);var h=HL(),_=B(h),v=B(_),b=B(v);d(b,()=>L(r),(e,n)=>{n(e,{size:13,strokeWidth:2,class:`shrink-0 text-muted-foreground`,get"aria-label"(){return t.issue.issueType}})});var S=Y(b,2),C=e=>{var r=FL(),i=B(r);wP(Y(i),{size:11,strokeWidth:2,class:`opacity-70`}),y(r),J(()=>{A(r,`href`,L(n)),A(r,`title`,`Open ${t.issue.key} in Jira`),f(i,`${t.issue.key??``} `)}),q(e,r)},T=e=>{var n=IL(),r=B(n,!0);y(n),J(()=>f(r,t.issue.key)),q(e,n)};p(S,e=>{L(n)?e(C):e(T,-1)}),y(v);var E=Y(v,2),O=e=>{var n=LL(),r=B(n,!0);y(n),J(()=>f(r,t.issue.summary)),q(e,n)};p(E,e=>{t.issue.summary&&e(O)}),y(_);var k=Y(_,2),ee=e=>{var n=VL(),r=B(n),c=e=>{nP(e,{get tone(){return L(i)},size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,t.issue.status)),q(e,r)},$$slots:{default:!0}})};p(r,e=>{t.issue.status&&e(c)});var u=Y(r,2),h=e=>{let n=l(()=>L(a).icon);var r=RL(),i=B(r);d(i,()=>L(n),(e,t)=>{t(e,{size:13,strokeWidth:2.2})});var o=Y(i);y(r),J(()=>{w(r,1,`inline-flex items-center gap-1 text-xs ${L(m)}`),A(r,`title`,`Priority: ${t.issue.priority}`),f(o,` ${t.issue.priority??``}`)}),q(e,r)};p(u,e=>{L(a)&&e(h)});var _=Y(u,2),v=e=>{var t=zL(),n=B(t);lL(n,{size:12,strokeWidth:2,class:`shrink-0`});var r=Y(n,2),i=B(r,!0);y(r),y(t),J(()=>f(i,L(o))),q(e,t)};p(_,e=>{L(o)&&e(v)});var b=Y(_,2),x=e=>{var n=BL(),r=B(n);sL(r,{size:12,strokeWidth:2});var i=Y(r);y(n),J(e=>{A(n,`title`,e),f(i,` ${L(s)??``}`)},[()=>`Updated ${fL(t.issue.updated)}`]),q(e,n)};p(b,e=>{L(s)&&e(x)}),y(n),q(e,n)};p(k,e=>{L(c)&&e(ee)}),y(h),q(e,h),H()}var WL=P(`<span class="inline-flex items-center gap-1.5 rounded-sm border bg-sidebar px-2 py-1 text-xs"><span class="font-semibold tabular-nums text-sidebar-foreground"> </span> <span class="text-muted-foreground"> </span></span>`),GL=P(`<div class="flex flex-wrap gap-1.5"></div>`);function KL(e,t){x(t,!0);let n=[[`comments`,`Comments`],[`transitions`,`Transitions`],[`statuses`,`Statuses`],[`components`,`Components`],[`versions`,`Versions`],[`issueTypes`,`Issue types`],[`fields`,`Fields`],[`priorities`,`Priorities`],[`resolutions`,`Resolutions`],[`worklogs`,`Worklogs`],[`changelog`,`Changelog`],[`remoteLinks`,`Remote links`],[`attachments`,`Attachments`],[`editmetaFields`,`Edit fields`]],r=l(()=>n.flatMap(([e,n])=>{let r=t.counts[e];return typeof r==`number`?[{label:n,value:r}]:[]}));var i=_(),a=F(i),o=e=>{var t=GL();O(t,21,()=>L(r),e=>e.label,(e,t)=>{var n=WL(),r=B(n),i=B(r,!0);y(r);var a=Y(r,2),o=B(a,!0);y(a),y(n),J(e=>{f(i,e),f(o,L(t).label)},[()=>L(t).value.toLocaleString()]),q(e,n)}),y(t),q(e,t)};p(a,e=>{L(r).length>0&&e(o)}),q(e,i),H()}var qL=P(`<span class="min-w-0 break-words text-xs font-medium leading-snug text-sidebar-foreground"> </span>`),JL=P(`<span class="inline-flex min-w-0 items-center gap-1 text-xs text-muted-foreground"><!> <span class="truncate"> </span></span>`),YL=P(`<div class="flex flex-wrap items-center gap-x-2.5 gap-y-1"><!> <!></div>`),XL=P(`<div class="grid gap-1.5 rounded-sm border bg-sidebar px-2.5 py-2"><div class="flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1"><span class="font-mono text-xs font-semibold text-primary"> </span> <!></div> <!></div>`);function ZL(e,t){x(t,!0);var n=XL(),r=B(n),i=B(r),a=B(i,!0);y(i);var o=Y(i,2),s=e=>{var n=qL(),r=B(n,!0);y(n),J(()=>f(r,t.project.name)),q(e,n)};p(o,e=>{t.project.name&&e(s)}),y(r);var c=Y(r,2),l=e=>{var n=YL(),r=B(n),i=e=>{nP(e,{tone:`neutral`,size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,t.project.projectTypeKey)),q(e,r)},$$slots:{default:!0}})};p(r,e=>{t.project.projectTypeKey&&e(i)});var a=Y(r,2),o=e=>{var n=JL(),r=B(n);lL(r,{size:12,strokeWidth:2,class:`shrink-0`});var i=Y(r,2),a=B(i,!0);y(i),y(n),J(()=>f(a,t.project.lead)),q(e,n)};p(a,e=>{t.project.lead&&e(o)}),y(n),q(e,n)};p(c,e=>{(t.project.projectTypeKey||t.project.lead)&&e(l)}),y(n),J(()=>f(a,t.project.key)),q(e,n),H()}var QL=new Set([`$$slots`,`$$events`,`$$legacy`]);function $L(e,t){let n=U(t,QL),r=[[`path`,{d:`M5 12h14`}],[`path`,{d:`m12 5 7 7-7 7`}]];G(e,V({name:`arrow-right`},()=>n,{get iconNode(){return r}}))}var eR=P(`<!> <!>`,1),tR=P(`<div class="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 rounded-sm border bg-sidebar px-2.5 py-2"><span class="rounded-sm border bg-muted/40 px-1.5 py-0.5 font-mono text-xs text-muted-foreground"> </span> <span class="text-xs font-medium text-sidebar-foreground"> </span> <!></div>`);function nR(e,t){x(t,!0);let n=l(()=>t.transition.name??`(unnamed)`),r=l(()=>pL(t.transition.to,t.transition.toStatusCategory)),i=l(()=>!!(t.transition.to&&t.transition.to!==t.transition.name));var a=tR(),o=B(a),s=B(o,!0);y(o);var c=Y(o,2),u=B(c,!0);y(c);var d=Y(c,2),m=e=>{var n=eR(),i=F(n);$L(i,{size:13,strokeWidth:2,class:`text-muted-foreground`}),nP(Y(i,2),{get tone(){return L(r)},size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,t.transition.to)),q(e,r)},$$slots:{default:!0}}),q(e,n)},h=e=>{nP(e,{get tone(){return L(r)},size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,t.transition.to)),q(e,r)},$$slots:{default:!0}})};p(d,e=>{L(i)?e(m):t.transition.to&&e(h,1)}),y(a),J(()=>{f(s,t.transition.id),f(u,L(n))}),q(e,a),H()}var rR=P(`<span class="min-w-0 truncate font-mono text-xs text-muted-foreground"> </span>`),iR=P(`<div class="flex min-w-0 items-center gap-2.5 rounded-sm border bg-sidebar px-2.5 py-2"><span class="flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-semibold text-muted-foreground" aria-hidden="true"> </span> <div class="grid min-w-0 flex-1 gap-0.5"><div class="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1"><span class="min-w-0 truncate text-xs font-medium text-sidebar-foreground"> </span> <!> <!> <!></div> <span class="truncate font-mono text-xs text-muted-foreground/80"> </span></div></div>`);function aR(e,t){x(t,!0);let n=l(()=>gL(t.user)),r=l(()=>t.user.displayName??t.user.emailAddress??t.user.accountId);var i=iR(),a=B(i),o=B(a,!0);y(a);var s=Y(a,2),c=B(s),u=B(c),d=B(u,!0);y(u);var m=Y(u,2),h=e=>{var n=rR(),r=B(n,!0);y(n),J(()=>f(r,t.user.emailAddress)),q(e,n)};p(m,e=>{t.user.emailAddress&&t.user.emailAddress!==L(r)&&e(h)});var _=Y(m,2),v=e=>{nP(e,{tone:`neutral`,size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,t.user.accountType)),q(e,r)},$$slots:{default:!0}})};p(_,e=>{t.user.accountType&&e(v)});var b=Y(_,2),S=e=>{nP(e,{tone:`warn`,size:`xs`,children:(e,t)=>{g(),q(e,D(`inactive`))},$$slots:{default:!0}})};p(b,e=>{t.user.active===!1&&e(S)}),y(c);var C=Y(c,2),w=B(C,!0);y(C),y(s),y(i),J(()=>{f(o,L(n)),f(d,L(r)),f(w,t.user.accountId)}),q(e,i),H()}var oR=(e,t=N)=>{var n=sR(),r=B(n,!0);y(n),J(()=>f(r,t())),q(e,n)},sR=P(`<span class="text-xs font-medium text-muted-foreground"> </span>`),cR=P(`<!> <!>`,1),lR=P(`<!> <!> <!>`,1),uR=P(`<span class="text-xs text-muted-foreground"> </span>`),dR=P(`<div class="flex flex-wrap items-center gap-1"><!> <!></div>`),fR=P(`<p class="m-0 text-xs text-muted-foreground"> </p>`),pR=P(`<div class="grid gap-1.5"><!> <!> <!></div>`),mR=P(`<p class="m-0 text-xs text-muted-foreground">No Jira summary available. Open Details for raw arguments and result.</p>`);function hR(e,t){x(t,!0);let n=K(t,`expanded`,3,!1),r=Lj(),i=l(()=>r.atlassian?.jiraSiteUrl()),a=l(()=>n()?1/0:5),o=l(()=>WN(t.view,t.toolCall.status)),s=l(()=>KN(t.view,t.toolCall.status)),c=l(()=>JN(t.view,t.toolCall.status)),u=l(()=>L(c)?void 0:zN(t.toolCall,t.view,{expanded:n()})),d=l(()=>t.view.updatedFields??[]),m=l(()=>Math.max(0,L(d).length-L(a)));var h=_(),v=F(h),b=e=>{var n=pR(),r=B(n),c=e=>{{let t=l(()=>L(o).tone===`info`?kM:Ja);ZN(e,{get text(){return L(o).text},get tone(){return L(o).tone},get icon(){return L(t)}})}};p(r,e=>{L(o)&&e(c)});var u=Y(r,2),h=e=>{var n=_();O(F(n),17,()=>t.view.issues.slice(0,L(a)),e=>e.key,(e,t)=>{UL(e,{get issue(){return L(t)},get siteUrl(){return L(i)}})}),q(e,n)},v=e=>{var n=_();O(F(n),17,()=>t.view.users.slice(0,L(a)),e=>e.accountId,(e,t)=>{aR(e,{get user(){return L(t)}})}),q(e,n)},b=e=>{var n=lR(),r=F(n),o=e=>{UL(e,{get issue(){return t.view.issue},get siteUrl(){return L(i)}})};p(r,e=>{t.view.issue&&e(o)});var s=Y(r,2),c=e=>{KL(e,{get counts(){return t.view.includedCounts}})};p(s,e=>{t.view.includedCounts&&e(c)});var l=Y(s,2),u=e=>{var n=cR(),r=F(n);oR(r,()=>`Transitions`),O(Y(r,2),17,()=>t.view.transitions.slice(0,L(a)),e=>e.id,(e,t)=>{nR(e,{get transition(){return L(t)}})}),q(e,n)};p(l,e=>{t.view.transitions.length>0&&e(u)}),q(e,n)},x=e=>{var n=lR(),r=F(n),i=e=>{ZL(e,{get project(){return t.view.project}})};p(r,e=>{t.view.project&&e(i)});var o=Y(r,2),s=e=>{KL(e,{get counts(){return t.view.includedCounts}})};p(o,e=>{t.view.includedCounts&&e(s)});var c=Y(o,2),l=e=>{var n=cR(),r=F(n);oR(r,()=>`Fields`),O(Y(r,2),17,()=>t.view.fields.slice(0,L(a)),e=>e.id,(e,t)=>{aL(e,{get field(){return L(t)}})}),q(e,n)};p(c,e=>{t.view.fields.length>0&&e(l)}),q(e,n)},S=e=>{var n=cR(),r=F(n),a=e=>{UL(e,{get issue(){return t.view.issue},get siteUrl(){return L(i)}})};p(r,e=>{t.view.issue&&e(a)});var o=Y(r,2),s=e=>{var n=cR(),r=F(n);oR(r,()=>`Assignee`),aR(Y(r,2),{get user(){return t.view.resolvedAssignee}}),q(e,n)};p(o,e=>{t.view.resolvedAssignee&&e(s)}),q(e,n)},C=e=>{var n=lR(),r=F(n),o=e=>{var t=dR(),n=B(t);O(n,16,()=>L(d).slice(0,L(a)),e=>e,(e,t)=>{nP(e,{tone:`neutral`,size:`xs`,class:`font-mono`,children:(e,n)=>{g();var r=D();J(()=>f(r,t)),q(e,r)},$$slots:{default:!0}})});var r=Y(n,2),i=e=>{var t=uR(),n=B(t);y(t),J(()=>f(n,`+${L(m)??``} more`)),q(e,t)};p(r,e=>{L(m)>0&&e(i)}),y(t),q(e,t)};p(r,e=>{L(d).length>0&&e(o)});var s=Y(r,2),c=e=>{UL(e,{get issue(){return t.view.issue},get siteUrl(){return L(i)}})};p(s,e=>{t.view.issue&&e(c)});var l=Y(s,2),u=e=>{var n=cR(),r=F(n);oR(r,()=>`Assignee`),aR(Y(r,2),{get user(){return t.view.resolvedAssignee}}),q(e,n)};p(l,e=>{t.view.resolvedAssignee&&e(u)}),q(e,n)},w=e=>{var n=cR(),r=F(n),i=e=>{nR(e,{get transition(){return t.view.transition}})},o=e=>{var n=cR(),r=F(n);oR(r,()=>`Available transitions`),O(Y(r,2),17,()=>t.view.transitions.slice(0,L(a)),e=>e.id,(e,t)=>{nR(e,{get transition(){return L(t)}})}),q(e,n)};p(r,e=>{t.view.transition?e(i):t.view.transitions.length>0&&e(o,1)});var s=Y(r,2),c=e=>{var n=cR(),r=F(n);oR(r,()=>`Transition fields`),O(Y(r,2),17,()=>t.view.fields.slice(0,L(a)),e=>e.id,(e,t)=>{aL(e,{get field(){return L(t)}})}),q(e,n)};p(s,e=>{t.view.fields.length>0&&e(c)}),q(e,n)};p(u,e=>{t.view.action===`search_issues`?e(h):t.view.action===`search_users`?e(v,1):t.view.action===`get_issue`?e(b,2):t.view.action===`get_project`?e(x,3):t.view.action===`create_issue`?e(S,4):t.view.action===`update_issue`?e(C,5):t.view.action===`transition_issue`&&e(w,6)});var T=Y(u,2),E=e=>{var t=fR(),n=B(t,!0);y(t),J(()=>f(n,L(s))),q(e,t)};p(T,e=>{L(s)&&e(E)}),y(n),q(e,n)},S=e=>{{let t=l(()=>({kind:`atlassian-summary`,text:L(u)}));nF(e,{get body(){return L(t)}})}},C=e=>{q(e,mR())};p(v,e=>{L(c)?e(b):L(u)?e(S,1):t.toolCall.status===`completed`&&e(C,2)}),q(e,h),H()}var gR=P(`<p class="m-0 text-xs text-muted-foreground">Empty directory.</p>`),_R=P(`<button type="button" class="cursor-pointer border-0 bg-transparent p-0 text-left font-mono text-xs text-primary hover:underline"> </button>`),vR=P(`<span> </span>`),yR=P(`<li class="flex items-center gap-1.5"><!> <!></li>`),bR=P(`<ul class="m-0 list-none rounded-sm border bg-sidebar px-2.5 py-2 font-mono text-xs leading-normal text-sidebar-foreground"></ul>`);function xR(e,t){x(t,!0);let n=K(t,`expanded`,3,!1);function r(e){return[...e].sort((e,t)=>e.kind===t.kind?e.path.localeCompare(t.path):e.kind===`directory`?-1:1)}let i=l(()=>r(t.view.entries)),a=l(()=>n()?L(i):L(i).slice(0,6));var o=_(),s=F(o),c=e=>{q(e,gR())},u=e=>{var n=bR();O(n,21,()=>L(a),e=>e.path,(e,n)=>{var r=yR(),i=B(r),a=e=>{Vr(e,{size:12,strokeWidth:2,class:`flex-none text-muted-foreground`})},o=e=>{pm(e,{size:12,strokeWidth:2,class:`flex-none text-muted-foreground`})};p(i,e=>{L(n).kind===`directory`?e(a):e(o,-1)});var s=Y(i,2),c=e=>{var r=_R(),i=B(r,!0);y(r),J(()=>f(i,L(n).path)),le(`click`,r,()=>t.onOpenFile?.(L(n).openPath??L(n).path)),q(e,r)},l=e=>{var t=vR(),r=B(t,!0);y(t),J(()=>f(r,L(n).path)),q(e,t)};p(s,e=>{L(n).kind===`file`?e(c):e(l,-1)}),y(r),q(e,r)}),y(n),q(e,n)};p(s,e=>{t.view.total===0&&t.toolCall.status===`completed`?e(c):t.view.total>0&&e(u,1)}),q(e,o),H()}r([`click`]);var SR=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function CR(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=U(t,SR);var i=_();d(F(i),()=>Dc,(e,t)=>{t(e,V(()=>r,{get open(){return n()},set open(e){n(e)}}))}),q(e,i),H()}var wR=new Set([`$$slots`,`$$events`,`$$legacy`]);function TR(e,t){let n=U(t,wR),r=[[`path`,{d:`M5 12h14`}]];G(e,V({name:`minus`},()=>n,{get iconNode(){return r}}))}P(`<span class="absolute right-2 flex items-center justify-center pointer-events-none" data-slot="dropdown-menu-checkbox-item-indicator"><!></span> <!>`,1);var ER=new Set([`$$slots`,`$$events`,`$$legacy`]);function DR(e,t){let n=U(t,ER);var r=_();d(F(r),()=>Wt,(e,t)=>{t(e,V(()=>n))}),q(e,r)}var OR=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`sideOffset`,`align`,`portalProps`,`class`]);function kR(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=K(t,`sideOffset`,3,4),i=K(t,`align`,3,`start`),a=U(t,OR);DR(e,V(()=>t.portalProps,{children:(e,o)=>{var s=_(),c=F(s);{let e=l(()=>I(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-md p-1 shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 w-(--bits-dropdown-menu-anchor-width) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden`,t.class));d(c,()=>Ac,(t,o)=>{o(t,V({"data-slot":`dropdown-menu-content`,get sideOffset(){return r()},get align(){return i()},get class(){return L(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)}}))})}q(e,s)},$$slots:{default:!0}})),H()}var AR=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`inset`,`variant`]);function jR(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=K(t,`variant`,3,`default`),i=U(t,AR);var a=_(),o=F(a);{let e=l(()=>I(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm data-inset:pl-8 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0`,t.class));d(o,()=>Br,(a,o)=>{o(a,V({"data-slot":`dropdown-menu-item`,get"data-inset"(){return t.inset},get"data-variant"(){return r()},get class(){return L(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)}}))})}q(e,a),H()}P(`<div><!></div>`),P(`<span class="absolute right-2 flex items-center justify-center pointer-events-none" data-slot="dropdown-menu-radio-item-indicator"><!></span> <!>`,1);var MR=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function NR(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=U(t,MR);var i=_(),a=F(i);{let e=l(()=>I(`bg-border -mx-1 my-1 h-px`,t.class));d(a,()=>Rr,(t,i)=>{i(t,V({"data-slot":`dropdown-menu-separator`,get class(){return L(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}q(e,i),H()}P(`<span><!></span>`);var PR=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function FR(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=U(t,PR);var i=_();d(F(i),()=>Nc,(e,t)=>{t(e,V({"data-slot":`dropdown-menu-trigger`},()=>r,{get ref(){return n()},set ref(e){n(e)}}))}),q(e,i),H()}P(`<!> <!>`,1);var IR=P(`<!> <!>`,1),LR=P(`<div class="inline-flex" role="group"><!> <!></div>`);function RR(e,t){x(t,!0);let n=K(t,`variant`,3,`default`),r=K(t,`size`,3,`sm`),i=K(t,`disabled`,3,!1),a=K(t,`menuAlign`,3,`end`),o=l(()=>n()==="default"||n()===`success`?`border-l-primary-foreground/25`:`border-l-border/70`);var s=LR(),c=B(s);W(c,{get variant(){return n()},get size(){return r()},get disabled(){return i()},get onclick(){return t.onclick},class:`rounded-r-none`,children:(e,n)=>{var r=_();h(F(r),()=>t.children),q(e,r)},$$slots:{default:!0}}),d(Y(c,2),()=>CR,(e,s)=>{s(e,{children:(e,s)=>{var c=IR(),u=F(c);{let e=l(()=>I(Te({variant:n(),size:r()}),`-ml-px rounded-l-none border-l px-1.5`,L(o)));d(u,()=>FR,(n,r)=>{r(n,{get class(){return L(e)},get disabled(){return i()},get"aria-label"(){return t.triggerLabel},children:(e,t)=>{Za(e,{class:`size-3.5`,strokeWidth:2.3})},$$slots:{default:!0}})})}d(Y(u,2),()=>kR,(e,n)=>{n(e,{get align(){return a()},get class(){return t.menuClass},children:(e,n)=>{var r=_();h(F(r),()=>t.menu),q(e,r)},$$slots:{default:!0}})}),q(e,c)},$$slots:{default:!0}})}),y(s),q(e,s),H()}var zR=P(`<!> <!>`,1),BR=P(`<p class="m-0 rounded-md border border-dashed border-border bg-muted p-3 text-sm text-muted-foreground">No models available. Configure a provider or adjust Scoped Models in
94
- Settings.</p>`),VR=P(` <span class="text-muted-foreground"> </span>`,1),HR=P(`<p class="m-0 px-1 py-2 text-sm text-muted-foreground">No models match the current filters.</p>`),UR=P(`<button type="button" role="option"><span class="min-w-0 truncate font-medium"> </span> <!></button>`),WR=P(`<div class="grid gap-2"><!> <!> <!></div>`),GR=P(`<button type="button"> </button>`),KR=P(`<section class="grid gap-2 border-t border-border/60 pt-3"><p class="m-0 text-xs font-semibold uppercase tracking-wide text-muted-foreground">Thinking level</p> <div class="flex flex-wrap gap-2" role="group" aria-label="Implementation thinking level"></div></section>`),qR=P(`<div class="grid gap-3"><section class="grid gap-2"><p class="m-0 text-xs font-semibold uppercase tracking-wide text-muted-foreground">Model</p> <!></section> <!></div>`);function JR(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=X(``),i=X(`off`),a=X(``),o=X(`all`),s=l(()=>J_(t.models)),c=l(()=>X_(L(s))),u=l(()=>Y_(L(s),L(a),L(o))),m=l(()=>t.models.find(e=>Ki(e)===L(r))),h=l(()=>hee(L(m))),v=l(()=>!L(m)),b={off:`No reasoning`,minimal:`Very brief reasoning`,low:`Light reasoning`,medium:`Moderate reasoning`,high:`Deep reasoning`,xhigh:`Extra-high reasoning`,max:`Maximum reasoning`};function S(e){return e===`off`?`Off`:e[0].toUpperCase()+e.slice(1)}function C(){R(a,``),R(o,`all`);let e=t.models.find(e=>Ki(e)===t.initialModelKey)??t.models[0];R(r,e?Ki(e):``,!0),R(i,Tn(t.initialThinkingLevel,e),!0)}function T(e){n(e),t.onOpenChange?.(e)}function E(e){R(r,Ki(e),!0),R(i,Tn(L(i),e),!0)}function k(e){R(i,Tn(e,L(m)),!0)}function ee(){if(!L(m))return;let e=Vi(L(r));if(!e)return;let n={implementationModel:e,implementationThinkingLevel:L(i)};T(!1),t.onConfirm?.(n)}z(()=>{n()&&C()}),IF(e,{get open(){return n()},get title(){return t.title},get description(){return t.description},onOpenChange:T,class:`max-w-xl`,footer:e=>{var n=zR(),r=F(n);W(r,{size:`sm`,variant:`ghost`,onclick:()=>T(!1),children:(e,t)=>{g(),q(e,D(`Cancel`))},$$slots:{default:!0}}),W(Y(r,2),{size:`sm`,onclick:ee,get disabled(){return L(v)},children:(e,n)=>{g();var r=D();J(()=>f(r,t.confirmLabel)),q(e,r)},$$slots:{default:!0}}),q(e,n)},children:(e,n)=>{var s=qR(),v=B(s),x=Y(B(v),2),C=e=>{q(e,BR())},T=e=>{var t=WR(),n=B(t);q_(n,{placeholder:`Search models`,ariaLabel:`Search models`,get value(){return L(a)},set value(e){R(a,e,!0)}});var i=Y(n,2),s=e=>{var t=_();d(F(t),()=>ii,(e,t)=>{t(e,{type:`single`,size:`xs`,spacing:1,variant:`outline`,get value(){return L(o)},"aria-label":`Filter by provider`,class:`flex-nowrap overflow-x-auto`,onValueChange:e=>{e&&R(o,e,!0)},children:(e,t)=>{var n=_();O(F(n),17,()=>L(c),e=>e.id,(e,t)=>{var n=_();d(F(n),()=>ai,(e,n)=>{n(e,{get value(){return L(t).id},class:`flex-none gap-1.5 text-xs`,children:(e,n)=>{g();var r=VR(),i=F(r),a=Y(i),o=B(a,!0);y(a),J(()=>{f(i,`${L(t).label??``} `),f(o,L(t).count)}),q(e,r)},$$slots:{default:!0}})}),q(e,n)}),q(e,n)},$$slots:{default:!0}})}),q(e,t)};p(i,e=>{L(c).length>2&&e(s)});var m=Y(i,2),h=e=>{q(e,HR())},v=e=>{Ka(e,{get items(){return L(u)},getKey:e=>e.key,estimateSize:()=>38,viewportClass:`max-h-[min(45vh,20rem)]`,viewportAriaLabel:`Implementation model`,row:(e,t)=>{let n=()=>t?.().item,i=l(()=>n().key===L(r));var a=UR(),o=B(a),s=B(o,!0);y(o);var c=Y(o,2),u=e=>{oi(e,{class:`size-4`,strokeWidth:2.4})};p(c,e=>{L(i)&&e(u)}),y(a),J(()=>{w(a,1,`flex w-full items-center justify-between gap-3 rounded-md border px-2.5 py-1.5 text-left text-sm transition-colors ${L(i)?`border-primary/40 bg-primary/10 text-primary`:`border-transparent text-foreground hover:bg-accent`}`),A(a,`aria-selected`,L(i)),f(s,n().contextualLabel)}),le(`click`,a,()=>E(n().model)),q(e,a)},$$slots:{row:!0}})};p(m,e=>{L(u).length===0?e(h):e(v,-1)}),y(t),q(e,t)};p(x,e=>{t.models.length===0?e(C):e(T,-1)}),y(v);var D=Y(v,2),ee=e=>{var t=KR(),n=Y(B(t),2);O(n,20,()=>L(h),e=>e,(e,t)=>{let n=l(()=>t===L(i));var r=GR(),a=B(r,!0);y(r),J(e=>{w(r,1,`rounded-full border px-3 py-1 text-xs font-medium transition-colors ${L(n)?`border-primary bg-primary/10 text-primary`:`border-border bg-input text-muted-foreground hover:border-primary/40 hover:text-foreground`}`),A(r,`aria-pressed`,L(n)),A(r,`title`,b[t]),f(a,e)},[()=>S(t)]),le(`click`,r,()=>k(t)),q(e,r)}),y(n),y(t),q(e,t)};p(D,e=>{L(m)&&e(ee)}),y(s),q(e,s)},$$slots:{footer:!0,default:!0}}),H()}r([`click`]);var YR=P(`<div class="min-w-0 rounded-sm border bg-sidebar p-3"><!></div>`),XR=P(`<div class="whitespace-pre-wrap rounded-sm border bg-sidebar p-2.5 font-mono text-xs leading-relaxed text-foreground [overflow-wrap:anywhere]"> </div>`),ZR=P(`<!> <!> <!> <!> <!> <!> <!>`,1),QR=P(`<!> `,1),$R=P(`<!> <!>`,1),ez=P(`<p class="m-0 text-xs text-destructive" role="alert"> </p>`),tz=P(`<div class="grid gap-2" aria-label="Plan review"><!> <!> <!> <!> <!> <!></div>`),nz=P(`<p class="m-0 text-sm text-muted-foreground"> </p>`);function rz(e,t){x(t,!0);let n=K(t,`expanded`,3,!1),r=K(t,`planReviewModels`,19,()=>[]),i=K(t,`planReviewModelKey`,3,``),a=K(t,`planReviewThinkingLevel`,3,`off`),o=X(void 0),s=X(void 0),c=X(!1),u=X(void 0);function m(e){return e&&typeof e==`object`?e:{}}function h(e){return typeof e==`string`?e:void 0}function v(e){let t=m(m(e).review);return typeof t.id==`string`||typeof t.content==`string`?t:void 0}function b(e){let t=e;return t.resultPreview??t.result}function S(e,t){let n=e.split(`
95
- `);return n.length>t?n.slice(0,t).join(`
96
- `):e}let C=l(()=>b(t.toolCall)),w=l(()=>v(L(C))),T=l(()=>t.planReview?{...L(w),...t.planReview,content:L(w)?.content??t.planReview.content}:L(w)),E=l(()=>t.toolCall.toolName===`plan_mode_present`&&t.toolCall.status===`waiting_for_user`&&t.planReview?.status===`pending`),O=l(()=>L(T)?.status??h(m(L(C)).outcome)),k=l(()=>L(O)===`accepted`),ee=l(()=>L(O)===`accepted_in_new_chat`),A=l(()=>L(O)===`changes_requested`||L(O)===`discarded`),j=l(()=>L(w)?.content??L(T)?.content??``),M=l(()=>n()?L(T)?.content??``:S(L(j),6)),N=l(()=>t.toolCall.toolName===`plan_mode_present`&&!!L(T)),te=l(()=>!L(E)||!!L(s)||L(c)),ne=l(()=>L(k)||L(ee)?`success`:`default`),P=l(()=>L(k)||L(ee)?[{text:`Accepted`,tone:`success`}]:L(O)===`changes_requested`?[{text:`Changes requested`}]:L(O)===`discarded`?[{text:`Discarded`}]:L(E)?[{text:`Awaiting review`,tone:`warning`}]:[]);async function re(e){if(!(!t.planReview||!L(E)||L(s)||L(c)||!t.onAcceptPlanReview)){R(s,`same`),R(u,void 0);try{await t.onAcceptPlanReview(t.planReview.id,e)}catch(e){R(u,ce(e,`Could not accept the plan.`),!0)}finally{R(s,void 0)}}}async function ie(e){if(!(!t.planReview||!L(E)||L(s)||L(c)||!t.onAcceptPlanReview)){R(s,`compact`),R(u,void 0);try{await t.onAcceptPlanReview(t.planReview.id,{...e,compactBeforeImplementation:!0})}catch(e){R(u,ce(e,`Could not compact and accept the plan.`),!0)}finally{R(s,void 0)}}}async function I(e){if(!(!t.planReview||!L(E)||L(s)||L(c)||!t.onAcceptPlanReviewInNewChat)){R(s,`new-chat`),R(u,void 0);try{await t.onAcceptPlanReviewInNewChat(t.planReview.id,e)}catch(e){R(u,ce(e,`Could not accept the plan.`),!0)}finally{R(s,void 0)}}}function ae(){!L(E)||L(s)||L(c)||R(o,`same`)}function oe(){!L(E)||L(s)||L(c)||R(o,`compact`)}function se(){!L(E)||L(s)||L(c)||R(o,`new-chat`)}function ce(e,t){return e instanceof Error&&e.message.trim()?e.message:t}async function z(){if(!(!t.planReview||!L(E)||L(s)||L(c)||!t.onRejectPlanReview)){R(c,!0),R(u,void 0);try{await t.onRejectPlanReview(t.planReview.id)}catch(e){R(u,ce(e,`Could not reject the plan.`),!0)}finally{R(c,!1)}}}var le=_(),ue=F(le),de=e=>{var m=tz(),h=B(m),v=e=>{var r=_(),i=F(r),a=e=>{var n=YR();Pj(B(n),{get text(){return L(M)},get onOpenFile(){return t.onOpenFile}}),y(n),q(e,n)},o=e=>{var t=XR(),n=B(t,!0);y(t),J(()=>f(n,L(M))),q(e,t)};p(i,e=>{n()?e(a):e(o,-1)}),q(e,r)},b=l(()=>L(M).trim());p(h,e=>{L(b)&&e(v)});var x=Y(h,2);Gj(x,{get meta(){return L(P)},get detailsAction(){return t.detailsAction},actions:e=>{var n=$R(),r=F(n);RR(r,{get variant(){return L(ne)},size:`sm`,get disabled(){return L(te)},menuAlign:`end`,menuClass:`w-60`,triggerLabel:`Accept options`,onclick:()=>void re(),menu:e=>{var n=ZR(),r=F(n);d(r,()=>jR,(e,t)=>{t(e,{get disabled(){return L(te)},onSelect:()=>void re(),children:(e,t)=>{g(),q(e,D(`Accept & implement`))},$$slots:{default:!0}})});var i=Y(r,2);d(i,()=>jR,(e,t)=>{t(e,{get disabled(){return L(te)},onSelect:()=>void ie(),children:(e,t)=>{g(),q(e,D(`Compact & implement`))},$$slots:{default:!0}})});var a=Y(i,2),o=e=>{var t=_();d(F(t),()=>jR,(e,t)=>{t(e,{get disabled(){return L(te)},onSelect:()=>void I(),children:(e,t)=>{g(),q(e,D(`Accept in new chat`))},$$slots:{default:!0}})}),q(e,t)};p(a,e=>{t.onAcceptPlanReviewInNewChat&&e(o)});var s=Y(a,2);d(s,()=>NR,(e,t)=>{t(e,{})});var c=Y(s,2);d(c,()=>jR,(e,t)=>{t(e,{get disabled(){return L(te)},onSelect:ae,children:(e,t)=>{g(),q(e,D(`Choose model & implement`))},$$slots:{default:!0}})});var l=Y(c,2);d(l,()=>jR,(e,t)=>{t(e,{get disabled(){return L(te)},onSelect:oe,children:(e,t)=>{g(),q(e,D(`Choose model & compact`))},$$slots:{default:!0}})});var u=Y(l,2),f=e=>{var t=_();d(F(t),()=>jR,(e,t)=>{t(e,{get disabled(){return L(te)},onSelect:se,children:(e,t)=>{g(),q(e,D(`Choose model & start new chat`))},$$slots:{default:!0}})}),q(e,t)};p(u,e=>{t.onAcceptPlanReviewInNewChat&&e(f)}),q(e,n)},children:(e,t)=>{var n=QR(),r=F(n),i=e=>{oi(e,{class:`size-3.5`,strokeWidth:2.4})};p(r,e=>{(L(k)||L(ee))&&e(i)});var a=Y(r);J(()=>f(a,` ${L(s)===`same`?`Accepting…`:L(s)===`compact`?`Compacting…`:L(s)===`new-chat`?`Accepting in new chat…`:`Accept & Implement`}`)),q(e,n)},$$slots:{menu:!0,default:!0}}),W(Y(r,2),{size:`sm`,variant:`secondary`,get disabled(){return L(te)},onclick:z,children:(e,t)=>{var n=QR(),r=F(n),i=e=>{oi(e,{class:`size-3.5`,strokeWidth:2.4})};p(r,e=>{L(A)&&e(i)});var a=Y(r);J(()=>f(a,` ${L(c)?`Rejecting…`:`Reject Plan`}`)),q(e,n)},$$slots:{default:!0}}),q(e,n)},$$slots:{actions:!0}});var S=Y(x,2),C=e=>{var t=ez(),n=B(t,!0);y(t),J(()=>f(n,L(u))),q(e,t)};p(S,e=>{L(u)&&e(C)});var w=Y(S,2);{let e=l(()=>L(o)===`same`);JR(w,{get open(){return L(e)},title:`Choose implementation model`,description:`The selected model will be used when implementation continues in this conversation.`,confirmLabel:`Accept and implement`,get models(){return r()},get initialModelKey(){return i()},get initialThinkingLevel(){return a()},onOpenChange:e=>{R(o,e?`same`:void 0,!0)},onConfirm:re})}var T=Y(w,2);{let e=l(()=>L(o)===`compact`);JR(T,{get open(){return L(e)},title:`Choose implementation model`,description:`The selected model will compact the planning context, then implement the plan in this conversation.`,confirmLabel:`Compact and implement`,get models(){return r()},get initialModelKey(){return i()},get initialThinkingLevel(){return a()},onOpenChange:e=>{R(o,e?`compact`:void 0,!0)},onConfirm:ie})}var E=Y(T,2),O=e=>{{let t=l(()=>L(o)===`new-chat`);JR(e,{get open(){return L(t)},title:`Choose implementation model`,description:`The selected model will be used by the new implementation chat.`,confirmLabel:`Accept in new chat`,get models(){return r()},get initialModelKey(){return i()},get initialThinkingLevel(){return a()},onOpenChange:e=>{R(o,e?`new-chat`:void 0,!0)},onConfirm:I})}};p(E,e=>{t.onAcceptPlanReviewInNewChat&&e(O)}),y(m),q(e,m)},fe=e=>{var n=nz(),r=B(n,!0);y(n),J(()=>f(r,t.view.summary)),q(e,n)};p(ue,e=>{L(N)&&L(T)?e(de):t.view.summary&&e(fe,1)}),q(e,le),H()}var iz=P(`<section class="grid gap-1" aria-label="Python script"><!></section>`),az=P(`<section class="grid gap-1" aria-label="Python output"><!></section>`),oz=P(`<section class="grid gap-1" aria-label="Python output"><p class="m-0 text-xs text-muted-foreground">No output.</p></section>`),sz=P(`<div class="grid gap-1.5"><!> <!></div>`);function cz(e,t){x(t,!0);let n=K(t,`expanded`,3,!1),r=l(()=>t.view.inputMode!==`file`&&!!t.view.code?.match(/[\r\n]/));var i=sz(),a=B(i),o=e=>{var r=iz();SM(B(r),{get text(){return t.view.code},language:`python`,get expanded(){return n()}}),y(r),q(e,r)};p(a,e=>{n()&&t.view.code&&L(r)&&e(o)});var s=Y(a,2),c=e=>{var r=az();SM(B(r),{get text(){return t.view.output},direction:`tail`,get expanded(){return n()},get outputLimits(){return t.view.outputLimits},terminal:!0}),y(r),q(e,r)},u=e=>{q(e,oz())};p(s,e=>{t.view.output.length>0?e(c):t.toolCall.status===`completed`&&e(u,1)}),y(i),q(e,i),H()}var lz={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`jsonc`,css:`css`,html:`html`,svelte:`svelte`,md:`markdown`,markdown:`markdown`,py:`python`,yml:`yaml`,yaml:`yaml`,sh:`bash`,bash:`bash`,zsh:`shellscript`};function uz(e){if(!e)return;let t=e.split(/[\\/]/).pop()??e,n=t.lastIndexOf(`.`);if(!(n<=0))return lz[t.slice(n+1).toLowerCase()]}var dz=P(`<button class="cursor-pointer border-0 bg-transparent p-0" type="button" title="Open image pane"><img class="max-h-60 max-w-80 rounded-sm border object-contain"/></button>`),fz=P(`<p class="m-0 text-xs text-muted-foreground">Empty file.</p>`);function pz(e,t){x(t,!0);let n=K(t,`expanded`,3,!1),r=l(()=>uz(t.view.relPath));var i=_(),a=F(i),o=e=>{var n=dz(),r=B(n);y(n),J(()=>{A(r,`src`,t.view.image.dataUrl),A(r,`alt`,t.view.relPath??`image`)}),le(`click`,n,()=>t.view.path&&t.onOpenFile?.(t.view.path)),q(e,n)},s=e=>{SM(e,{get text(){return t.view.content},get language(){return L(r)},get expanded(){return n()}})},c=e=>{q(e,fz())};p(a,e=>{t.view.image?e(o):t.view.content!==void 0&&t.view.content.length>0?e(s,1):t.toolCall.status===`completed`&&e(c,2)}),q(e,i),H()}r([`click`]);var mz=/https?:\/\/[^\s)'"]+/i;function hz(e){if(e.readiness.readyUrl)return e.readiness.readyUrl;if(!e.readiness.readyOnUrl)return;let t=e.readiness.matched;return t&&mz.test(t)?t:void 0}var gz=P(`<a class="inline-flex min-w-0 items-center gap-1 truncate font-mono text-xs text-info hover:underline" target="_blank" rel="noreferrer noopener"><!> </a>`),_z=P(`<div><!> <div> </div> <!> <!> <!></div>`),vz=P(`<span class="tt-row svelte-1462m86"><span class="tt-key svelte-1462m86">group</span> </span>`),yz=P(`<span class="tt-row svelte-1462m86"><span class="tt-key svelte-1462m86">finished</span> </span>`),bz=P(`<span class="tt-row svelte-1462m86"><span class="tt-key svelte-1462m86">exit</span> </span>`),xz=P(`<span class="tt-row svelte-1462m86"><span class="tt-key svelte-1462m86">signal</span> </span>`),Sz=P(`<span class="tt-row svelte-1462m86"><span class="tt-key svelte-1462m86">error</span> </span>`),Cz=P(`<span class="tt-title svelte-1462m86"> </span> <span class="tt-row svelte-1462m86"><span class="tt-key svelte-1462m86">command</span> </span> <span class="tt-row svelte-1462m86"><span class="tt-key svelte-1462m86">cwd</span> </span> <span class="tt-row svelte-1462m86"><span class="tt-key svelte-1462m86">status</span> </span> <span class="tt-row svelte-1462m86"><span class="tt-key svelte-1462m86">started</span> </span> <!> <!> <!> <!> <span class="tt-id svelte-1462m86"> </span>`,1),wz=P(`<!> <!>`,1),Tz=P(`<p class="m-0 break-words text-xs text-destructive"> </p>`);function Ez(e,t){x(t,!0);let n=K(t,`dense`,3,!1),r=l(()=>hz(t.task)),i=l(()=>Xp(t.task.status)),a=l(()=>t.task.termination?.exitCode!==void 0&&t.task.termination.exitCode!==null);var o=wz(),s=F(o);d(s,()=>Gy,(e,o)=>{o(e,{delayDuration:300,disableHoverableContent:!0,children:(e,o)=>{var s=_();d(F(s),()=>Fy,(e,o)=>{o(e,{children:(e,o)=>{var s=wz(),u=F(s);{let e=(e,o)=>{let s=()=>o?.().props;var u=_z();c(u,()=>({...s(),class:`flex min-w-0 items-center gap-2.5 rounded-md border bg-card px-2.5 py-2`}),void 0,void 0,void 0,`svelte-1462m86`);var d=B(u);{let e=l(()=>Zp(t.task.status));ci(d,{get tone(){return L(i)},get pulse(){return L(e)},size:`xs`,class:`flex-none`})}var m=Y(d,2),h=B(m,!0);y(m);var _=Y(m,2),v=e=>{var t=gz(),n=B(t);wP(n,{size:12,strokeWidth:2});var i=Y(n,1,!0);y(t),J(()=>{A(t,`href`,L(r)),f(i,L(r))}),q(e,t)};p(_,e=>{L(r)&&e(v)});var b=Y(_,2),x=e=>{{let n=l(()=>t.task.termination?.exitCode===0?`neutral`:`danger`);nP(e,{get tone(){return L(n)},size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,`exit ${t.task.termination?.exitCode??``}`)),q(e,r)},$$slots:{default:!0}})}},S=e=>{nP(e,{tone:`warn`,size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,`signal ${t.task.termination.signal??``}`)),q(e,r)},$$slots:{default:!0}})};p(b,e=>{L(a)?e(x):t.task.termination?.signal&&e(S,1)});var C=Y(b,2);{let e=l(()=>L(i)===`neutral`?`border-border bg-muted text-muted-foreground`:``);nP(C,{get tone(){return L(i)},size:`xs`,get class(){return L(e)},children:(e,n)=>{g();var r=D();J(()=>f(r,t.task.status)),q(e,r)},$$slots:{default:!0}})}y(u),J(()=>{w(m,1,`min-w-0 flex-1 ${n()?`truncate`:`whitespace-pre-wrap break-words`} font-mono text-xs text-foreground`),f(h,t.task.command)}),q(e,u)};d(u,()=>Ly,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}d(Y(u,2),()=>Uy,(e,n)=>{n(e,{side:`left`,sideOffset:6,class:`max-w-88 flex-col items-start gap-0.5 font-mono text-xs leading-[1.35] [overflow-wrap:anywhere]`,children:(e,n)=>{var r=Cz(),i=F(r),o=B(i,!0);y(i);var s=Y(i,2),c=Y(B(s),1,!0);y(s);var l=Y(s,2),u=Y(B(l),1,!0);y(l);var d=Y(l,2),m=Y(B(d),1,!0);y(d);var h=Y(d,2),g=Y(B(h),1,!0);y(h);var _=Y(h,2),v=e=>{var n=vz(),r=Y(B(n),1,!0);y(n),J(()=>f(r,t.task.lineage.groupId)),q(e,n)};p(_,e=>{t.task.lineage?.groupId&&e(v)});var b=Y(_,2),x=e=>{var n=yz(),r=Y(B(n),1,!0);y(n),J(e=>f(r,e),[()=>fL(t.task.timing.finishedAt)]),q(e,n)};p(b,e=>{t.task.timing.finishedAt&&e(x)});var S=Y(b,2),C=e=>{var n=bz(),r=Y(B(n),1,!0);y(n),J(()=>f(r,t.task.termination?.exitCode)),q(e,n)},w=e=>{var n=xz(),r=Y(B(n),1,!0);y(n),J(()=>f(r,t.task.termination.signal)),q(e,n)};p(S,e=>{L(a)?e(C):t.task.termination?.signal&&e(w,1)});var T=Y(S,2),E=e=>{var n=Sz(),r=Y(B(n),1,!0);y(n),J(()=>f(r,t.task.termination.error)),q(e,n)};p(T,e=>{t.task.termination?.error&&e(E)});var D=Y(T,2),O=B(D,!0);y(D),J(e=>{f(o,t.task.name??t.task.command),f(c,t.task.command),f(u,t.task.cwd),f(m,t.task.status),f(g,e),f(O,t.task.id)},[()=>fL(t.task.timing.startedAt)]),q(e,r)},$$slots:{default:!0}})}),q(e,s)},$$slots:{default:!0}})}),q(e,s)},$$slots:{default:!0}})});var u=Y(s,2),m=e=>{var n=Tz(),r=B(n,!0);y(n),J(()=>f(r,t.task.termination.error)),q(e,n)};p(u,e=>{t.task.termination?.error&&e(m)}),q(e,o),H()}var Dz=P(`<p> </p>`),Oz=P(`<div class="grid gap-1"></div>`);function kz(e,t){x(t,!0);var n=_(),r=F(n),i=e=>{var n=Dz();let r;var i=B(n,!0);y(n),J(()=>{r=w(n,1,`m-0 text-xs`,null,r,{"text-warning":t.view.previewUnavailable,"text-muted-foreground":!t.view.previewUnavailable}),f(i,t.view.previewUnavailable?`Task status preview unavailable. Open Details to inspect the full result.`:`No matching tasks.`)}),q(e,n)},a=e=>{var n=Oz();O(n,21,()=>t.view.tasks,e=>e.id,(e,t)=>{Ez(e,{get task(){return L(t)},dense:!0})}),y(n),q(e,n)};p(r,e=>{t.view.tasks.length===0&&t.toolCall.status===`completed`?e(i):t.view.tasks.length>0&&e(a,1)}),q(e,n),H()}var Az=P(`<p class="m-0 text-xs text-warning">Log preview is incomplete. Open Details to inspect the full result.</p>`),jz=P(`<div><span class="text-right text-muted-foreground"> </span> <span class="whitespace-pre-wrap break-words"><!></span></div>`),Mz=P(`<div class="terminal-output rounded-sm border bg-sidebar px-2.5 py-1.5 font-mono text-xs text-sidebar-foreground"></div>`),Nz=P(`<p class="m-0 text-xs text-muted-foreground"> </p>`),Pz=P(`<!> <!>`,1);function Fz(e,t){x(t,!0);let n=K(t,`expanded`,3,!1),r=l(()=>n()?t.view.events:ln(t.view.events,6));var i=Pz(),a=F(i),o=e=>{q(e,Az())};p(a,e=>{t.view.previewUnavailable&&t.toolCall.status===`completed`&&e(o)});var s=Y(a,2),c=e=>{var t=Mz();O(t,21,()=>L(r),e=>e.seq,(e,t)=>{var n=jz();let r;var i=B(n),a=B(i,!0);y(i);var o=Y(i,2),s=B(o);{let e=l(()=>L(t).line||`\xA0`);Xe(s,{get text(){return L(e)},get stream(){return L(t).stream},get level(){return L(t).level}})}y(o),y(n),J(()=>{r=w(n,1,`grid grid-cols-[3.5rem_minmax(0,1fr)] gap-2`,null,r,{"text-warning":L(t).level===`warn`,"text-destructive":L(t).level===`error`}),f(a,L(t).seq)}),q(e,n)}),y(t),q(e,t)},u=e=>{var n=Nz(),r=B(n);y(n),J(()=>f(r,`No matching log events${t.view.task?` for ${t.view.task.name??t.view.task.id} (${t.view.task.status})`:``}.`)),q(e,n)};p(s,e=>{t.view.events.length>0?e(c):t.toolCall.status===`completed`&&!t.view.previewUnavailable&&e(u,1)}),q(e,i),H()}var Iz=P(`<p class="m-0 text-xs font-medium text-muted-foreground"> </p>`),Lz=P(`<div class="grid gap-1"><!> <p> </p></div>`),Rz=P(`<p class="m-0 text-xs text-muted-foreground">Replacement <span class="font-mono"> </span> restarted <span class="font-mono"> </span>.</p>`),zz=P(`<div class="grid gap-1.5"><!> <!> <!></div>`),Bz=P(`<p class="m-0 text-xs text-warning">Task result preview unavailable. Open Details to inspect the full result.</p>`),Vz=P(`<section class="grid gap-1" aria-label="Task startup output"><!></section>`),Hz=P(`<!> <!>`,1);function Uz(e,t){x(t,!0);let n=l(()=>t.view.action===`start`?`Task started; process state is shown below.`:t.view.action===`restart`?`Task restarted; process state is shown below.`:`Cancellation completed.`),r=l(()=>t.view.tasks??(t.view.task?[t.view.task]:[])),i=l(()=>t.view.outcomes??[]),a=l(()=>L(r).length>0||L(i).length>0);var o=Hz(),s=F(o),c=e=>{var a=zz(),o=B(a),s=e=>{var t=Iz(),r=B(t,!0);y(t),J(()=>f(r,L(n))),q(e,t)};p(o,e=>{t.toolCall.status===`completed`&&e(s)});var c=Y(o,2),l=e=>{var t=_();O(F(t),19,()=>L(i),(e,t)=>`${e.task?.id??`none`}-${t}`,(e,t)=>{var n=Lz(),r=B(n),i=e=>{Ez(e,{get task(){return L(t).task}})};p(r,e=>{L(t).task&&e(i)});var a=Y(r,2);let o;var s=B(a,!0);y(a),y(n),J(()=>{o=w(a,1,`m-0 break-words text-xs`,null,o,{"text-warning":L(t).outcome===`already_terminal`||L(t).outcome===`became_terminal_before_cancel`,"text-muted-foreground":L(t).outcome!==`already_terminal`&&L(t).outcome!==`became_terminal_before_cancel`}),f(s,L(t).message)}),q(e,n)}),q(e,t)},u=e=>{var t=_();O(F(t),17,()=>L(r),e=>e.id,(e,t)=>{Ez(e,{get task(){return L(t)}})}),q(e,t)};p(c,e=>{t.view.action===`cancel`?e(l):e(u,-1)});var d=Y(c,2),m=e=>{var n=Rz(),r=Y(B(n)),i=B(r,!0);y(r);var a=Y(r,2),o=B(a,!0);y(a),g(),y(n),J(()=>{f(i,t.view.task.id),f(o,t.view.restartedFromTaskId)}),q(e,n)};p(d,e=>{t.view.action===`restart`&&t.view.task&&t.view.restartedFromTaskId&&e(m)}),y(a),q(e,a)},u=e=>{q(e,Bz())};p(s,e=>{L(a)?e(c):t.toolCall.status===`completed`&&t.view.previewUnavailable&&e(u,1)});var d=Y(s,2),m=e=>{var n=Vz();SM(B(n),{get text(){return t.view.liveLog},direction:`tail`,terminal:!0}),y(n),q(e,n)};p(d,e=>{t.view.liveLog&&e(m)}),q(e,o),H()}function Wz(e,t){x(t,!0);var n=_(),r=F(n),i=e=>{Fv(e,{get items(){return t.view.items}})},a=e=>{Fv(e,{items:[],emptyLabel:`No todos.`})};p(r,e=>{t.view.items.length>0?e(i):t.toolCall.status===`completed`&&e(a,1)}),q(e,n),H()}var Gz=P(`<p class="m-0 text-xs text-muted-foreground">No content.</p>`);function Kz(e,t){x(t,!0);let n=K(t,`expanded`,3,!1),r=l(()=>t.view.converted?`markdown`:void 0);var i=_(),a=F(i),o=e=>{SM(e,{get text(){return t.view.content},get language(){return L(r)},get expanded(){return n()}})},s=e=>{q(e,Gz())};p(a,e=>{t.view.content!==void 0&&t.view.content.length>0?e(o):t.toolCall.status===`completed`&&e(s,1)}),q(e,i),H()}var qz=new Set([`$$slots`,`$$events`,`$$legacy`]);function Jz(e,t){let n=U(t,qz),r=[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`}],[`path`,{d:`M20 2v4`}],[`path`,{d:`M22 4h-4`}],[`circle`,{cx:`4`,cy:`20`,r:`2`}]];G(e,V({name:`sparkles`},()=>n,{get iconNode(){return r}}))}var Yz=P(`<div class="grid gap-1 rounded-sm border bg-sidebar px-2.5 py-2"><span class="inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground"><!> Answer</span> <p> </p></div>`),Xz=P(`<span class="line-clamp-2 pl-6 text-xs leading-snug text-muted-foreground"> </span>`),Zz=P(`<li><a class="group flex flex-col gap-0.5 px-2.5 py-1.5 text-inherit no-underline hover:bg-muted/40" target="_blank" rel="noreferrer"><span class="flex min-w-0 items-baseline gap-2"><span class="w-4 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground/70"> </span> <span class="min-w-0 flex-1 truncate text-xs font-medium text-foreground group-hover:underline"> </span> <span class="shrink-0 font-mono text-xs text-muted-foreground"> </span></span> <!></a></li>`),Qz=P(`<ul class="m-0 grid list-none gap-0 divide-y overflow-hidden rounded-sm border bg-sidebar p-0"></ul>`),$z=P(`<p class="m-0 text-xs text-muted-foreground">No results.</p>`),eB=P(`<!> <!>`,1);function tB(e,t){x(t,!0);let n=K(t,`expanded`,3,!1),r=l(()=>n()?t.view.results:t.view.results.slice(0,6));function i(e){try{return new URL(e).hostname.replace(/^www\./,``)}catch{return e}}var a=eB(),o=F(a),s=e=>{var r=Yz(),i=B(r);Jz(B(i),{size:12,strokeWidth:2,class:`text-info`}),g(),y(i);var a=Y(i,2);let o;var s=B(a,!0);y(a),y(r),J(()=>{o=w(a,1,`m-0 text-xs leading-normal text-sidebar-foreground`,null,o,{"line-clamp-6":!n()}),f(s,t.view.answer)}),q(e,r)};p(o,e=>{t.view.answer&&e(s)});var c=Y(o,2),u=e=>{var t=Qz();O(t,23,()=>L(r),e=>e.url,(e,t,n)=>{var r=Zz(),a=B(r),o=B(a),s=B(o),c=B(s,!0);y(s);var l=Y(s,2),u=B(l,!0);y(l);var d=Y(l,2),m=B(d,!0);y(d),y(o);var h=Y(o,2),g=e=>{var n=Xz(),r=B(n,!0);y(n),J(()=>f(r,L(t).content)),q(e,n)};p(h,e=>{L(t).content&&e(g)}),y(a),y(r),J(e=>{A(a,`href`,L(t).url),A(a,`title`,L(t).url),f(c,L(n)+1),f(u,L(t).title),f(m,e)},[()=>i(L(t).url)]),q(e,r)}),y(t),q(e,t)},d=e=>{q(e,$z())};p(c,e=>{L(r).length>0?e(u):!t.view.answer&&t.toolCall.status===`completed`&&e(d,1)}),q(e,a),H()}var nB=P(`<p class="m-0 text-xs text-muted-foreground">Empty file written.</p>`);function rB(e,t){x(t,!0);let n=K(t,`expanded`,3,!1),r=l(()=>uz(t.view.relPath));var i=_(),a=F(i),o=e=>{SM(e,{get text(){return t.view.content},get language(){return L(r)},direction:`tail`,get expanded(){return n()}})},s=e=>{q(e,nB())};p(a,e=>{t.view.content!==void 0&&t.view.content.length>0?e(o):t.toolCall.status===`completed`&&e(s,1)}),q(e,i),H()}var iB={read:pz,bash:DM,python:cz,edit:fF,write:rB,grep:QI,find:HI,ls:xR,ask_user:sM,todos:Wz,task_action:Uz,task_status:kz,task_logs:Fz,explore:RI,plan_mode:rz,jira:hR,confluence:uF,web_search:tB,web_fetch:Kz,generic:qI};function aB(e){return iB[e]??qI}function oB(e){return e.replace(/\r\n/g,`
97
- `).replace(/\r/g,`
98
- `)}function sB(e,t){if(e.length===0)return``;let n=oB(e).split(`
99
- `);return n.length<=t?n.join(`
100
- `):n.slice(-t).join(`
101
- `)}function cB(e,t){return e.length<=t?e:e.slice(-t)}function lB(e,t){let n=oB(e).trimEnd();if(n.length!==0)return sB(cB(n,t.maxChars),t.maxLines)}function uB(e){let t=``,n=0,r=!1,i=!1,a=()=>{t+=` `.repeat(n)},o=()=>{t=t.trimEnd(),t+=`
102
- `,a()};for(let a of e){if(r){t+=a,i?i=!1:a===`\\`?i=!0:a===`"`&&(r=!1);continue}if(a===`"`){r=!0,t+=a;continue}if(a===`{`||a===`[`){t+=a,n+=1,o();continue}if(a===`}`||a===`]`){n=Math.max(0,n-1),o(),t+=a;continue}if(a===`,`){t+=a,o();continue}if(a===`:`){t+=`: `;continue}a===` `||a===`
103
- `||a===`\r`||a===` `||(t+=a)}return t.trimEnd()}function dB(e,t){let n=fB(e,t).argsPreview;return n?{kind:`code`,language:`json`,text:n,tail:!0}:void 0}function fB(e,t){if(e.toolName&&hS(e.toolName))return{};if(e.args!==void 0){let n=lB(JSON.stringify(e.args,null,2),t);return n?{argsPreview:n,argsPreviewLanguage:`json`}:{}}let n=e.argsText.trim();if(!n)return{};let r=lB(uB(n),t);return r?{argsPreview:r,argsPreviewLanguage:`json`}:{}}function pB(e,t){let n=new Set;return[...e,...t].filter(e=>n.has(e.text)?!1:(n.add(e.text),!0))}function mB(e){if(e.preview)return e.kind===`edit`?{kind:`diff`,text:e.preview,tail:!0}:{kind:`code`,text:e.preview,language:`text`,tail:!0};if(e.inputPreview)return{kind:`code`,text:e.inputPreview,language:e.language??`text`,tail:!0}}function hB(e,t){let n=e.argumentBody,r=n?.kind===`atlassian-draft`?!e.done||n.fields.some(e=>e.value!==void 0)||n.text?.text!==void 0:!!(n&&n.kind!==`none`);return!!(e.preview?.length||e.inputPreview?.length||r||t?.length&&!t.includes(`Waiting for arguments…`))}function gB(e){return e&&typeof e==`object`?e:{}}function _B(e){return typeof e==`string`?e:void 0}function vB(e,t,n=`s`){return`${e} ${t}${e===1?``:n}`}function yB(e){if(e!==void 0)return e.length===0?0:e.split(`
104
- `).length}function bB(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function xB(e){return RegExp(`"${bB(e)}"\\s*:\\s*"`,`g`)}function SB(e,t,n={}){let r=[],i=xB(t),a=i.exec(e);for(;a;){let t=n.maxChars??1/0,o=``,s=a.index+a[0].length;for(;s<e.length;){let n=e[s];if(n===`\\`){if(s+1>=e.length)break;let n=e[s+1];o.length<t&&(n===`n`?o+=`
105
- `:n===`r`?o+=`\r`:n===`t`?o+=` `:o+=n),s+=2;continue}if(n===`"`)break;o.length<t&&(o+=n),s+=1}r.push(o),a=i.exec(e)}return r}function CB(e,t){let n=[],r=xB(t),i=r.exec(e);for(;i;){let t=0,a=!1,o=i.index+i[0].length;for(;o<e.length;){let n=e[o];if(n===`\\`){if(o+1>=e.length)break;let n=e[o+1];n===`n`?(t=Math.max(t,1)+1,a=!0):n!==`r`&&(a=!0),o+=2;continue}if(n===`"`)break;n===`
106
- `?t=Math.max(t,1)+1:n!==`\r`&&(a=!0),o+=1}n.push(Math.max(t,+!!a)),i=r.exec(e)}return n}var wB=24e3;function TB(e){return e===`n`?`
107
- `:e===`r`?`\r`:e===`t`?` `:e}function EB(e,t,n){return e.length+t.length<=n?e+t:`${e}${t}`.slice(-n)}function DB(e){return RegExp(`"(${e.map(bB).join(`|`)})"\\s*:\\s*"`,`g`)}function OB(e,t,n={}){if(t.length===0)return[];let r=[],i=DB(t),a=i.exec(e);for(;a;){let t=n.maxChars??wB,o=``,s=!1,c=a.index+a[0].length;for(;c<e.length;){let n=e[c];if(n===`\\`){if(c+1>=e.length)break;o=EB(o,TB(e[c+1]),t),c+=2;continue}if(n===`"`){s=!0;break}o=EB(o,n,t),c+=1}r.push({property:a[1],value:o,complete:s,index:a.index}),a=i.exec(e)}return r.sort((e,t)=>e.index-t.index)}function kB(e){return e.replace(/\r\n/g,`
108
- `).replace(/\r/g,`
109
- `)}function AB(e,t){let n=kB(e);if(t)return n;let r=n.lastIndexOf(`
110
- `);return r<0?``:n.slice(0,r)}function jB(e,t=6){if(e.length===0)return``;let n=kB(e).split(`
111
- `);return n.length<=t?n.join(`
112
- `):n.slice(-t).join(`
113
- `)}function MB(e){return!kB(e).includes(`
114
- `)}function NB(e){if(e===void 0||e.length===0)return{};let t=kB(e),n=yB(t);return MB(t)?{inlineInput:t,inputLineCount:n}:{inputPreview:jB(t),inputLineCount:n}}function PB(e){let t=e.filter(e=>e.length>0).join(`
115
- `);return t.length>0?jB(t):void 0}function FB(e,t){let n=kB(e);return n.length===0?``:n.split(`
116
- `).map(e=>`${t}${e}`).join(`
117
- `)}function IB(e,t){return PB(e.map(e=>{let n=AB(e.text,e.complete||t);return e.kind===`patch`?n:FB(n,e.kind===`added`?`+`:`-`)}))}function LB(e,t){return PB(e.map(e=>AB(e.value,e.complete||t)))}function RB(e,t){let n=_B(gB(e.args).path)??e.progress?.path??SB(e.argsText,`path`,{maxChars:240})[0];return n&&t?sa(n,t)??n:n}function zB(e,t){let n=_B(gB(e.args).content),r=e.argsText?CB(e.argsText,`content`)[0]:void 0,i=e.progress?.lineCount??e.progress?.generatedLineCount,a=yB(n)??r??i,o=e.progress?.generatedPreview?jB(e.progress.generatedPreview):void 0,s=n===void 0?(e.argsText?LB(OB(e.argsText,[`content`]),!!e.done):void 0)??o:PB([kB(n)]),c=n===void 0&&!!e.progress?.estimated,l=[];return a!==void 0&&a>0&&l.push({text:`+${a}`,tone:`success`}),{kind:`write`,toolName:`write`,path:RB(e,t),statusText:e.done?`Submitting`:`Generating`,meta:l,lineCount:a,generatedLineCount:a,estimated:c,preview:s,done:!!e.done}}function BB(e){let t=0,n=0;for(let r of e.split(/\r?\n/))r.startsWith(`+`)&&!r.startsWith(`+++`)?t+=1:r.startsWith(`-`)&&!r.startsWith(`---`)&&(n+=1);return{additions:t,deletions:n}}function VB(e){return Array.isArray(e)?e:[]}function HB(e){if(!Array.isArray(e.replacements)&&!Array.isArray(e.insertions)&&!Array.isArray(e.lineReplacements)&&!Array.isArray(e.lineInsertions)&&typeof e.patch!=`string`)return;let t=0,n=0,r=0,i=VB(e.replacements);t+=i.length;for(let e of i){let t=gB(e);n+=yB(_B(t.newText))??0,r+=yB(_B(t.oldText))??0}let a=VB(e.insertions);t+=a.length;for(let e of a)n+=yB(_B(gB(e).text))??0;let o=VB(e.lineReplacements);t+=o.length;for(let e of o)n+=yB(_B(gB(e).newText))??0;let s=VB(e.lineInsertions);t+=s.length;for(let e of s)n+=yB(_B(gB(e).text))??0;let c=_B(e.patch);if(c){t+=1;let e=BB(c);n+=e.additions,r+=e.deletions}return{operations:t,generatedLines:n,estimatedAdditions:n,estimatedDeletions:r,estimated:!1}}function UB(e){let t=[];for(let n of VB(e.replacements)){let e=gB(n),r=_B(e.oldText),i=_B(e.newText);r!==void 0&&t.push({text:r,kind:`removed`,complete:!0}),i!==void 0&&t.push({text:i,kind:`added`,complete:!0})}for(let n of VB(e.insertions)){let e=_B(gB(n).text);e!==void 0&&t.push({text:e,kind:`added`,complete:!0})}for(let n of VB(e.lineReplacements)){let e=_B(gB(n).newText);e!==void 0&&t.push({text:e,kind:`added`,complete:!0})}for(let n of VB(e.lineInsertions)){let e=_B(gB(n).text);e!==void 0&&t.push({text:e,kind:`added`,complete:!0})}let n=_B(e.patch);n!==void 0&&t.push({text:n,kind:`patch`,complete:!0});let r=IB(t,!0);return{preview:r,previewLanguage:r?`diff`:void 0}}function WB(e,t){let n=IB(OB(e,[`oldText`,`newText`,`text`,`patch`]).map(e=>({text:e.value,kind:e.property===`oldText`?`removed`:e.property===`patch`?`patch`:`added`,complete:e.complete})),t);return{preview:n,previewLanguage:n?`diff`:void 0}}function GB(e){let t=e.progress;if(t)return{operations:t.operationCount??0,generatedLines:t.generatedLineCount??0,estimatedAdditions:t.estimatedAdditions,estimatedDeletions:t.estimatedDeletions,estimated:t.estimated}}function KB(e){let t=CB(e,`oldText`),n=CB(e,`newText`),r=CB(e,`text`),i=SB(e,`patch`,{maxChars:24e3}),a=i.reduce((e,t)=>{let n=BB(t);return{additions:e.additions+n.additions,deletions:e.deletions+n.deletions}},{additions:0,deletions:0}),o=n.reduce((e,t)=>e+t,0)+r.reduce((e,t)=>e+t,0)+a.additions,s=t.reduce((e,t)=>e+t,0)+a.deletions;return{operations:Math.max(t.length,n.length)+r.length+i.length,generatedLines:o,estimatedAdditions:o,estimatedDeletions:s,estimated:!0}}function qB(e,t){let n=gB(e.args),r=HB(n),i=e.argsText?KB(e.argsText):void 0,a=GB(e),o=r??i??a??{operations:0,generatedLines:0,estimated:!1},s=e.progress?.generatedPreview?{preview:jB(e.progress.generatedPreview),previewLanguage:e.progress.generatedPreviewLanguage}:{},c=e.argsText?WB(e.argsText,!!e.done):void 0,l=r?UB(n):c?.preview?c:s,u=[];o.operations>0&&u.push({text:vB(o.operations,`operation`)});let d=o.estimatedAdditions??o.generatedLines;return d>0&&u.push({text:`+${d}`,tone:`success`}),o.estimatedDeletions!==void 0&&o.estimatedDeletions>0&&u.push({text:`-${o.estimatedDeletions}`,tone:`error`}),{kind:`edit`,toolName:`edit`,path:RB(e,t),statusText:e.done?`Submitting`:`Generating`,meta:u,operationCount:o.operations,generatedLineCount:o.generatedLines,estimatedAdditions:o.estimatedAdditions,estimatedDeletions:o.estimatedDeletions,estimated:o.estimated,preview:l.preview,previewLanguage:l.previewLanguage,done:!!e.done}}function JB(e){let t=_B(gB(e.args).command),n=OB(e.argsText,[`command`])[0]?.value,r=t??n,i=NB(r),a=yB(r),o=r!==void 0&&r.length>0,s=[];return a!==void 0&&a>1&&s.push({text:vB(a,`command line`),tone:`info`}),{kind:`bash`,toolName:`bash`,statusText:o?e.done?`Submitting command…`:`Generating command…`:`Waiting for command…`,meta:s,command:r,inputMode:`inline`,...i,language:`bash`,done:!!e.done}}function YB(e,t){let n=gB(e.args),r=RB(e,t),i=_B(n.code),a=OB(e.argsText,[`code`])[0]?.value,o=i??a,s=NB(o),c=yB(o),l=o!==void 0&&o.length>0,u=r!==void 0&&r.length>0,d=u&&!l?`file`:`inline`,f=[];return c!==void 0&&c>0&&f.push({text:vB(c,`code line`),tone:`info`}),u&&!l&&f.push({text:`file`,tone:`info`}),{kind:`python`,toolName:`python_exec`,path:d===`file`?r:void 0,statusText:d===`file`?e.done?`Submitting Python file…`:`Preparing Python file…`:l?e.done?`Submitting Python code…`:`Generating Python code…`:`Waiting for Python code or path…`,meta:f,code:o,codeLineCount:c,inputMode:d,...s,language:`python`,done:!!e.done}}function XB(e,t,n){let r=t.toolName??`tool`,i=_S(r,{args:t.args,argsText:t.argsText},`drafting`,n),a=mB(e),o=i.body.kind===`none`?hS(r)?void 0:dB(t,{maxLines:6,maxChars:wB}):i.body;return{...e,path:e.path??i.primaryArg?.text,primaryArg:i.primaryArg,meta:pB(e.meta,i.secondary),argumentBody:a??o??i.body,safetyNotes:i.safetyNotes}}function ZB(e,t){if(e.toolName===`write`)return XB(zB(e,t),e,t);if(e.toolName===`edit`)return XB(qB(e,t),e,t);if(e.toolName===`bash`)return XB(JB(e),e,t);if(e.toolName===`python_exec`)return XB(YB(e,t),e,t);let n=e.toolName??`tool`,r=_S(n,{args:e.args,argsText:e.argsText},`drafting`,t);return XB({kind:`generic`,toolName:n,path:r.primaryArg?.text,statusText:e.done?`${n} arguments prepared.`:`Preparing ${n} arguments…`,meta:r.secondary,primaryArg:r.primaryArg,argumentBody:r.body,safetyNotes:r.safetyNotes,done:!!e.done},e,t)}var QB=new Set([`INVALID_TOOL_ARGUMENTS`,`TOOL_ARGUMENT_INVALID`]);function $B(e){if(e.status!==`error`)return!1;let t=e.errorDetails?.code.toUpperCase();return t?QB.has(t)||t.endsWith(`_ARGUMENT_INVALID`):!1}function eV(e){if(!e.toolCall)return e.draft?.done?`prepared`:`drafting`;switch(e.toolCall.status){case`pending_approval`:return`approval`;case`waiting_for_user`:return`interaction`;case`requested`:case`running`:return`executing`;case`completed`:return`completed`;case`error`:case`denied`:return`failed`}}function tV(e,t){return[...(e??[]).map(e=>`${e.tone??`default`}:${e.mono?`mono`:`text`}:${e.openPath?`file`:e.href?`link`:`label`}`),t?`details`:``].join(`,`)}function nV(e){let t=e.toolCall?e.toolCall.status:e.draft?.done?`prepared`:`drafting`,n=e.toolCall?.status===`error`||e.toolCall?.status===`denied`,r=!!(e.toolCall&&(e.toolCall.status===`requested`||e.toolCall.status===`running`)),i;i=!e.toolCall||n||e.hasApproval||e.toolCall.status===`pending_approval`?`none`:e.hasInteraction?`output`:r&&!e.hasDurableBodyContent?e.resultPlaceholder?`placeholder`:`none`:`output`;let a=i===`output`;i===`output`&&!e.bodyHydrated&&(i=`none`);let o=e.argumentRegion===`none`?!1:e.argumentRegion===`persistent`?!!e.hasArgumentBody:!!(e.hasArgumentBody&&!a),s=e.hasApproval?`approval`:`none`,c=!!(n&&e.toolCall?.error?.trim()),l=s===`none`&&!e.hasInteraction&&((e.footerItems?.length??0)>0||!!e.hasDetailsAction),u=tV(e.footerItems,!!e.hasDetailsAction);return{phase:t,argumentVisible:o,interactionMode:s,resultMode:i,errorVisible:c,footerVisible:l,structuralRevision:[o?`arg`:`no-arg`,`interaction:${s}`,i===`placeholder`?`result:placeholder:${e.resultPlaceholder?.variant}:${e.resultPlaceholder?.rows}`:`result:${i}`,c?`error`:`no-error`,l?`footer:${u}`:`no-footer`].join(`|`)}}function rV(e){return e?`${e.openPath?`file`:e.href?`link`:`text`}:${e.preserveWhitespace?`preserve`:`wrap`}`:`none`}function iV(e){return[e.stage,e.activityRevision,`badge:${e.badge}`,`arg:${rV(e.arg)}`].join(`|`)}var aV=P(`<button type="button"> </button>`),oV=P(`<a target="_blank" rel="noreferrer noopener"> </a>`),sV=P(`<span> </span>`),cV=P(`<div class="tool-header svelte-jnd58a"><!> <span class="badge svelte-jnd58a"> </span> <!></div>`);function lV(e,t){x(t,!0);let n=K(t,`dotPulse`,3,!1),r=K(t,`waitingForUser`,3,!1);var i=cV(),a=B(i);fI(a,{get tone(){return t.dotTone},get pulse(){return n()},get waitingForUser(){return r()},get label(){return t.statusLabel},size:14,class:`mr-1.5 align-middle`});var o=Y(a,2),s=B(o,!0);y(o);var c=Y(o,2),l=e=>{var n=_(),r=F(n),i=e=>{var n=aV();let r;var i=B(n,!0);y(n),J(()=>{r=w(n,1,`arg link svelte-jnd58a`,null,r,{"whitespace-pre-wrap":t.arg.preserveWhitespace}),A(n,`title`,t.arg.text),f(i,t.arg.text)}),le(`click`,n,()=>t.onOpenFile?.(t.arg.openPath,t.arg.line)),q(e,n)},a=e=>{var n=oV();let r;var i=B(n,!0);y(n),J(()=>{r=w(n,1,`arg link svelte-jnd58a`,null,r,{"whitespace-pre-wrap":t.arg.preserveWhitespace}),A(n,`href`,t.arg.href),A(n,`title`,t.arg.text),f(i,t.arg.text)}),q(e,n)},o=e=>{var n=sV();let r;var i=B(n,!0);y(n),J(()=>{r=w(n,1,`arg svelte-jnd58a`,null,r,{"whitespace-pre-wrap":t.arg.preserveWhitespace}),A(n,`title`,t.arg.text),f(i,t.arg.text)}),q(e,n)};p(r,e=>{t.arg.openPath?e(i):t.arg.href?e(a,1):e(o,-1)}),q(e,n)};p(c,e=>{t.arg&&e(l)}),y(i),J(()=>f(s,t.badge)),q(e,i),H()}r([`click`]);var uV=new De(`(prefers-reduced-motion: reduce)`),dV=Symbol(`conversation-motion-budget`);function fV(e){C(dV,e)}function pV(){return ve(dV)}var mV={standard:{durationMs:180,easing:`cubic-bezier(0.2, 0.8, 0.2, 1)`,settleOffsetPx:2,fromOpacity:.88},compact:{durationMs:120,easing:`cubic-bezier(0.2, 0.8, 0.2, 1)`,settleOffsetPx:0,fromOpacity:.9},minimal:{durationMs:90,easing:`ease-out`,settleOffsetPx:0,fromOpacity:.92}};function hV(e){let t=mV[e.profile],n=e.reducedMotion||!e.visible;return{animateHeight:!n&&e.profile!==`minimal`&&Math.abs(e.fromHeight-e.targetHeight)>.5,animateContent:!n&&e.targetHeight>0,durationMs:n?0:t.durationMs,easing:t.easing,settleOffsetPx:t.settleOffsetPx,fromOpacity:t.fromOpacity}}function gV(e,t){let n,r,i=!1;function a(){e.style.removeProperty(`overflow`),e.style.removeProperty(`will-change`)}function o(){t.style.removeProperty(`will-change`)}function s(){n?.cancel(),r?.cancel(),n=void 0,r=void 0,a(),o()}function c(){i||s()}function l(c,l,u){if(i)return;let d=t.getBoundingClientRect().height,f=hV({profile:u,fromHeight:c,targetHeight:d,reducedMotion:l,visible:e.getClientRects().length>0});if(s(),f.animateHeight){e.style.overflow=`hidden`,e.style.willChange=`height`;let t=e.animate([{height:`${Math.max(0,c)}px`},{height:`${Math.max(0,d)}px`}],{duration:f.durationMs,easing:f.easing});n=t,t.finished.then(()=>{n===t&&(n=void 0,a())}).catch(()=>void 0)}if(f.animateContent){t.style.willChange=`transform, opacity`;let e=t.animate([{opacity:f.fromOpacity,transform:`translateY(${f.settleOffsetPx}px)`},{opacity:1,transform:`translateY(0)`}],{duration:f.durationMs,easing:f.easing});r=e,e.finished.then(()=>{r===e&&(r=void 0,o())}).catch(()=>void 0)}}return{transition:l,snap:c,destroy(){i||=(s(),!0)}}}var _V=P(`<div class="min-w-0"><div class="min-w-0"><!></div></div>`);function vV(e,t){x(t,!0);let n=pV(),r=X(void 0),i=X(void 0),a,o,s;function c(){return!a&&L(r)&&L(i)&&(a=gV(L(r),L(i))),a}de(()=>{let e=t.revision;if(o===void 0){o=e;return}e!==o&&(s=L(r)?.getBoundingClientRect().height,o=e)}),z(()=>{if(t.revision,s===void 0)return;let e=s;s=void 0;let i=uV.current,a=!!L(r)?.getClientRects().length,o=!i&&a?n?.claim()??`standard`:`standard`;c()?.transition(e,i,o)}),z(()=>{uV.current&&a?.snap()}),z(()=>()=>a?.destroy());var l=_V(),u=B(l),d=B(u),f=e=>{var n=_();h(F(n),()=>t.children),q(e,n)};p(d,e=>{t.children&&e(f)}),y(u),ie(u,e=>R(i,e),()=>L(i)),y(l),ie(l,e=>R(r,e),()=>L(r)),q(e,l),H()}var yV=P(`<pre class="tool-error svelte-ga7hcf"> </pre>`),bV=P(`<div class="tool-body grid gap-1.5 svelte-ga7hcf"><!></div>`),xV=P(`<article class="tool-card svelte-ga7hcf"><!> <div><!> <!> <!></div></article>`);function SV(e,t){x(t,!0);let n=K(t,`dotPulse`,3,!1),r=K(t,`meta`,19,()=>[]),i=K(t,`footer`,3,!0),a=K(t,`bodyVisible`,3,!1),o=K(t,`layoutRevision`,3,`static`),s=l(()=>{if(t.draftPhase)return`running`;switch(t.status){case`requested`:case`pending_approval`:case`waiting_for_user`:case`running`:return`running`;case`completed`:return`complete`;case`error`:case`denied`:return`error`;default:return`idle`}}),c=l(()=>t.draftPhase?`Preparing tool call`:t.status===`pending_approval`?`Needs approval`:t.status===`waiting_for_user`?`Waiting for user feedback`:t.status===`requested`||t.status===`running`?`Executing tool call`:t.status===`completed`?`Tool call completed`:t.status===`denied`?`Tool call denied`:t.status===`error`?`Tool call failed`:`Tool call status`),u=l(()=>i()&&(r().length>0||!!t.detailsAction)),d=l(()=>!!t.error||a()||L(u));vV(e,{get revision(){return o()},children:(e,i)=>{var o=xV(),m=B(o);{let e=l(()=>t.status===`waiting_for_user`||t.status===`pending_approval`);lV(m,{get dotTone(){return t.dotTone},get dotPulse(){return n()},get waitingForUser(){return L(e)},get statusLabel(){return L(c)},get badge(){return t.badge},get arg(){return t.arg},get onOpenFile(){return t.onOpenFile}})}var g=Y(m,2),_=B(g),v=e=>{var n=yV(),r=B(n,!0);y(n),J(()=>f(r,t.error)),q(e,n)};p(_,e=>{t.error&&e(v)});var b=Y(_,2),x=e=>{var n=bV();h(B(n),()=>t.children),y(n),q(e,n)};p(b,e=>{a()&&t.children&&e(x)});var S=Y(b,2),C=e=>{Gj(e,{get meta(){return r()},get detailsAction(){return t.detailsAction},get onOpenFile(){return t.onOpenFile}})};p(S,e=>{L(u)&&e(C)}),y(g),y(o),J(()=>{A(o,`data-state`,t.draftPhase??L(s)),w(g,1,`grid min-w-0 gap-1.5${L(d)?` pt-1.5`:``}`,`svelte-ga7hcf`)}),q(e,o)},$$slots:{default:!0}}),H()}var CV=P(`<div class="grid gap-1.5 rounded-sm border border-border bg-sidebar p-2.5" aria-hidden="true"></div>`),wV=P(`<div class="grid gap-1.5" aria-hidden="true"></div>`);function TV(e,t){let n=K(t,`variant`,3,`list`),r=K(t,`rows`,3,3),i=l(()=>Array.from({length:Math.max(1,r())},(e,t)=>t));var a=_(),o=F(a),s=e=>{var t=CV();O(t,20,()=>L(i),e=>e,(e,t)=>{{let n=l(()=>t%2==0?`h-3 w-full`:`h-3 w-2/3`);GP(e,{get class(){return L(n)}})}}),y(t),q(e,t)},c=e=>{var t=wV();O(t,20,()=>L(i),e=>e,(e,t)=>{GP(e,{class:`h-9 w-full rounded-sm`})}),y(t),q(e,t)};p(o,e=>{n()===`text`?e(s):e(c,-1)}),q(e,a)}var EV=P(`<div class="flex min-h-40 items-center justify-center text-sm text-muted-foreground">Loading full tool call…</div>`),DV=P(`<div class="grid gap-3"><p class="m-0 text-sm text-destructive"> </p> <!></div>`),OV=P(`<span> </span>`),kV=P(`<div class="flex flex-wrap gap-1.5"></div>`),AV=P(`<details class="rounded-sm border bg-muted/20"><summary class="cursor-pointer px-2.5 py-2 text-xs font-medium text-muted-foreground">Arguments</summary> <div class="border-t p-2"><!></div></details>`),jV=P(`<details class="rounded-sm border bg-muted/20"><summary class="cursor-pointer px-2.5 py-2 text-xs font-medium text-muted-foreground">Result</summary> <div class="border-t p-2"><!></div></details>`),MV=P(`<div class="grid gap-2"><!> <!></div>`),NV=P(`<div class="grid gap-3"><!> <!> <!></div>`);function PV(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=K(t,`loading`,3,!1),i=K(t,`planReviewModels`,19,()=>[]),a=K(t,`planReviewModelKey`,3,``),o=K(t,`planReviewThinkingLevel`,3,`off`),s=l(()=>t.toolCall??t.previewToolCall),c=l(()=>yx(L(s))),u=l(()=>yS(L(c),L(s))),m=l(()=>aB(L(c).kind)),h=l(()=>t.pendingUserQuestion?.toolCallId===L(s).id?t.pendingUserQuestion:void 0),v=l(()=>t.pendingPlanReview?.toolCallId===L(s).id?t.pendingPlanReview:void 0);function b(e,t,n){let r=e;return r[t]??r[n]}function S(e){if(e!==void 0){if(typeof e==`string`)return e.length>0?{text:e}:void 0;try{let t=JSON.stringify(e,null,2);if(t!==void 0)return{text:t,language:`json`}}catch{}return{text:String(e)}}}let C=l(()=>S(b(L(s),`args`,`argsPreview`))),T=l(()=>S(b(L(s),`result`,`resultPreview`))),E=l(()=>[L(s).status,L(u).primaryArg?.text].filter(Boolean).join(` · `));{let b=l(()=>`${L(s).toolName} details`);IF(e,{get title(){return L(b)},get description(){return L(E)},size:`wide`,get onOpenChange(){return t.onOpenChange},get open(){return n()},set open(e){n(e)},children:(e,n)=>{var l=_(),b=F(l),x=e=>{q(e,EV())},S=e=>{var n=DV(),r=B(n),i=B(r,!0);y(r),W(Y(r,2),{size:`sm`,variant:`outline`,class:`w-fit`,onclick:()=>void t.onRetry?.(),children:(e,t)=>{g(),q(e,D(`Retry`))},$$slots:{default:!0}}),y(n),J(()=>f(i,t.error)),q(e,n)},E=e=>{var n=NV(),r=B(n),l=e=>{var t=kV();O(t,21,()=>L(u).meta,Le,(e,t)=>{var n=OV();let r;var i=B(n,!0);y(n),J(()=>{r=w(n,1,`rounded-sm border bg-muted/30 px-1.5 py-0.5 text-xs text-muted-foreground`,null,r,{"font-mono":L(t).mono}),f(i,L(t).text)}),q(e,n)}),y(t),q(e,t)};p(r,e=>{L(u).meta.length>0&&e(l)});var g=Y(r,2);d(g,()=>L(m),(e,n)=>{n(e,{get toolCall(){return L(s)},get view(){return L(c)},expanded:!0,get onOpenFile(){return t.onOpenFile},get questionRecord(){return L(h)},get planReview(){return L(v)},get onAnswerUserQuestion(){return t.onAnswerUserQuestion},get planReviewModels(){return i()},get planReviewModelKey(){return a()},get planReviewThinkingLevel(){return o()},get onDismissUserQuestion(){return t.onDismissUserQuestion},get onAcceptPlanReview(){return t.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return t.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return t.onRejectPlanReview}})});var _=Y(g,2),b=e=>{var t=MV(),n=B(t),r=e=>{var t=AV(),n=Y(B(t),2);yM(B(n),{get code(){return L(C).text},get language(){return L(C).language},maxHeight:`22rem`,trim:!1}),y(n),y(t),q(e,t)};p(n,e=>{L(C)&&e(r)});var i=Y(n,2),a=e=>{var t=jV(),n=Y(B(t),2);yM(B(n),{get code(){return L(T).text},get language(){return L(T).language},maxHeight:`22rem`,trim:!1}),y(n),y(t),q(e,t)};p(i,e=>{L(T)&&e(a)}),y(t),q(e,t)};p(_,e=>{(L(C)||L(T))&&e(b)}),y(n),q(e,n)};p(b,e=>{r()&&!t.toolCall?e(x):t.error&&!t.toolCall?e(S,1):e(E,-1)}),q(e,l)},$$slots:{default:!0}})}H()}var FV=P(`<span class="font-normal text-muted-foreground"> </span>`),IV=P(`<li> </li>`),LV=P(`<ul class="m-0 grid list-disc gap-1 pl-5 text-xs text-muted-foreground"></ul>`),RV=P(`<div class="grid gap-2" aria-label="Approval operation summary"><p class="m-0 text-sm font-medium text-foreground"> <!></p> <!> <!></div>`);function zV(e,t){x(t,!0);let n=K(t,`includeBody`,3,!0);var r=RV(),i=B(r),a=B(i),o=Y(a),s=e=>{var n=FV(),r=B(n);y(n),J(()=>f(r,`— ${t.presentation.primaryArg.text??``}`)),q(e,n)};p(o,e=>{t.presentation.primaryArg&&e(s)}),y(i);var c=Y(i,2),l=e=>{nF(e,{get body(){return t.presentation.body}})};p(c,e=>{n()&&t.presentation.body.kind!==`none`&&e(l)});var u=Y(c,2),d=e=>{var n=LV();O(n,23,()=>t.presentation.safetyNotes,(e,t)=>`${e}:${t}`,(e,t)=>{var n=IV(),r=B(n,!0);y(n),J(()=>f(r,L(t))),q(e,n)}),y(n),q(e,n)};p(u,e=>{t.presentation.safetyNotes.length>0&&e(d)}),y(r),J(()=>f(a,`${t.toolName??``} `)),q(e,r),H()}var BV=P(`<p class="m-0 text-sm text-muted-foreground"> </p>`),VV=P(`<!>Approving…`,1),HV=P(`<!>Approve`,1),UV=P(`<!>Denying…`,1),WV=P(`<!>Deny`,1),GV=P(`<!> <!>`,1),KV=P(`<p class="m-0 text-xs text-destructive" role="alert"> </p>`),qV=P(`<div class="grid gap-2" aria-label="Tool approval"><!> <!> <!> <!></div>`);function JV(e,t){x(t,!0);let n=K(t,`includeBody`,3,!0),r=X(void 0),i=X(void 0);async function a(e){if(L(r))return;let n=e===`approve`?t.onGrantApproval:t.onDenyApproval;if(n){R(r,e,!0),R(i,void 0);try{await n(t.approval.id)}catch(e){R(i,e instanceof Error&&e.message.trim()?e.message:`Could not resolve the approval.`,!0)}finally{R(r,void 0)}}}function o(e){return e===`destructive`||e===`secret`||e===`deployment`?`error`:e===`command`||e===`network`||e===`workspace_write`?`warning`:e===`agent_spawn`?`info`:`default`}let s=l(()=>[...t.presentation.secondary,{text:t.approval.risk,tone:o(t.approval.risk)}]);var c=qV(),u=B(c);zV(u,{get toolName(){return t.toolName},get presentation(){return t.presentation},get includeBody(){return n()}});var d=Y(u,2),m=e=>{var n=BV(),r=B(n,!0);y(n),J(()=>f(r,t.approval.reason)),q(e,n)};p(d,e=>{t.approval.reason&&e(m)});var h=Y(d,2);Gj(h,{get meta(){return L(s)},get detailsAction(){return t.detailsAction},actions:e=>{var t=GV(),n=F(t);{let e=l(()=>!!L(r));W(n,{size:`sm`,get disabled(){return L(e)},onclick:()=>void a(`approve`),children:(e,t)=>{var n=_(),i=F(n),a=e=>{var t=VV();ke(F(t),{class:`size-3.5`}),g(),q(e,t)},o=e=>{var t=HV();oi(F(t),{size:14,strokeWidth:2.4}),g(),q(e,t)};p(i,e=>{L(r)===`approve`?e(a):e(o,-1)}),q(e,n)},$$slots:{default:!0}})}var i=Y(n,2);{let e=l(()=>!!L(r));W(i,{size:`sm`,variant:`secondary`,get disabled(){return L(e)},onclick:()=>void a(`deny`),children:(e,t)=>{var n=_(),i=F(n),a=e=>{var t=UV();ke(F(t),{class:`size-3.5`}),g(),q(e,t)},o=e=>{var t=WV();li(F(t),{size:14,strokeWidth:2.4}),g(),q(e,t)};p(i,e=>{L(r)===`deny`?e(a):e(o,-1)}),q(e,n)},$$slots:{default:!0}})}q(e,t)},$$slots:{actions:!0}});var v=Y(h,2),b=e=>{var t=KV(),n=B(t,!0);y(t),J(()=>f(n,L(i))),q(e,t)};p(v,e=>{L(i)&&e(b)}),y(c),q(e,c),H()}var YV=P(`<!> <!> <!>`,1),XV=P(`<!> <!>`,1);function ZV(e,t){x(t,!0);let n=K(t,`hydrateBody`,3,!0),r=K(t,`detailsEnabled`,3,!0),i=K(t,`planReviewModels`,19,()=>[]),a=K(t,`planReviewModelKey`,3,``),o=K(t,`planReviewThinkingLevel`,3,`off`),s=X(!1),c=X(!1),u=X(void 0),f=X(void 0),m=X(void 0),h,g=X(!1),v=l(()=>n()||L(g)),y=Lj(),b=Oe(()=>t.liveOutput),S=X(Ie(b)),C=b?.text??``,w=new Aj(e=>{R(S,e,!0)});z(()=>{let e=t.liveOutput,n=e?.text??``,r=n.slice(C.length),i=!!(t.toolCall&&![`requested`,`pending_approval`,`running`].includes(t.toolCall.status));C=n,w.enqueue(e,{priority:i||r.includes(`
118
- `)})}),z(()=>()=>w.destroy());let T=l(()=>t.toolCall?yx(t.toolCall,L(S)):void 0),E=l(()=>t.toolCall&&L(T)?yS(L(T),t.toolCall):void 0),D=l(()=>L(T)?aB(L(T).kind):void 0),O=l(()=>t.draft?ZB(t.draft.block,t.cwd):void 0),k=l(()=>L(O)?hB(L(O)):!1);function ee(e){if(!e)return!1;switch(e.kind){case`read`:return!!(e.image||e.content?.length);case`bash`:case`python`:return e.output.length>0;case`edit`:return!!e.diff;case`write`:return!!e.content?.length;case`grep`:return e.matchCount>0;case`find`:return e.count>0;case`ls`:return e.total>0;case`todos`:return e.items.length>0;case`task_action`:return!!(e.task||e.tasks?.length||e.liveLog?.length);case`task_status`:return e.tasks.length>0;case`task_logs`:return e.events.length>0;case`explore`:return!!(e.reports.length||e.liveUpdates.length||e.liveLog?.length);case`web_search`:return!!(e.answer||e.results.length);case`web_fetch`:return!!e.content?.length;case`generic`:return!!(e.resultText||e.result.length);case`jira`:case`confluence`:return t.toolCall?.resultPreview!==void 0;case`ask_user`:case`plan_mode`:return!0}}let A=l(()=>ee(L(T))),j=l(()=>t.toolCall&&t.pendingApproval?.toolCallId===t.toolCall.id&&t.toolCall.status===`pending_approval`?t.pendingApproval:void 0),M=l(()=>gS(t.toolCall?.toolName??t.draft?.block.toolName??`tool`)),N=l(()=>({args:t.draft?.block.args,argsText:t.draft?.block.argsText,argsPreview:t.toolCall?.argsPreview}));function te(){return t.toolCall?t.toolCall.status===`error`||t.toolCall.status===`denied`?`failed`:t.toolCall.status===`completed`?`completed`:`executing`:`drafting`}let ne=l(()=>{let e=t.toolCall?.toolName??t.draft?.block.toolName;if(e)return _S(e,L(N),te(),t.cwd)}),P=l(()=>{if(!t.toolCall)return L(O)?.argumentBody;if(!$B(t.toolCall))return L(ne)?.body}),re=l(()=>t.toolCall?!!(L(P)&&L(P).kind!==`none`):L(k)),ie=l(()=>{let e=t.toolCall?.toolName??t.draft?.block.toolName;if(e)return _S(e,L(N),`approval`,t.cwd)}),I=l(()=>(t.toolCall?.toolName??t.draft?.block.toolName)===`explore`),ae=l(()=>L(T)?.kind===`ask_user`||L(T)?.kind===`plan_mode`&&L(T).action===`present`),oe=l(()=>t.toolCall&&t.pendingUserQuestion?.toolCallId===t.toolCall.id?t.pendingUserQuestion:void 0),se=l(()=>t.toolCall&&t.pendingPlanReview?.toolCallId===t.toolCall.id?t.pendingPlanReview:void 0);function ce(...e){let t=[];return e.flat().filter(e=>t.includes(e.text)?!1:(t.push(e.text),!0))}let le=l(()=>t.toolCall?t.toolCall.status===`completed`?L(E)?.meta??[]:ce(L(O)?.meta??[],L(ne)?.secondary??[],L(E)?.meta??[]):L(O)?.meta??[]),ue=l(()=>nV({draft:t.draft?.block,toolCall:t.toolCall,argumentRegion:L(M).argumentRegion,hasArgumentBody:L(re),hasDurableBodyContent:L(A),bodyHydrated:L(v),hasApproval:!!L(j),hasInteraction:L(ae),resultPlaceholder:L(M).resultPlaceholder,footerItems:L(le),hasDetailsAction:!!(t.toolCall&&r())})),de=l(()=>{if(L(O))return L(O).primaryArg?L(O).primaryArg:L(O).path?{text:L(O).path}:{text:`Preparing arguments…`}}),fe=l(()=>L(E)?.badge??L(O)?.toolName??t.draft?.block.toolName??`tool`),B=l(()=>L(ae)?L(E)?.primaryArg:L(E)?.primaryArg??L(ne)?.primaryArg??L(de)),V=l(()=>eV({draft:t.draft?.block,toolCall:t.toolCall})),pe=l(()=>iV({stage:L(V),activityRevision:L(ue).structuralRevision,badge:L(fe),arg:L(B)})),me=l(()=>L(E)?.dotTone??`running`),he=l(()=>L(E)?.dotPulse??!0),ge=l(()=>L(le)),_e=l(()=>t.toolCall&&r()?{label:L(E)?.detailsAction?.label??`Details`,onClick:be}:void 0),ve=l(()=>({label:L(E)?.detailsAction?.label??`Details`,onClick:be})),ye=l(()=>t.toolCall?.error?ca(t.toolCall.error,{headLines:4,tailLines:2,maxChars:2e3}).text:void 0);z(()=>{n()&&R(g,!0)}),z(()=>{let e=t.toolCall?.id;e!==h&&(h=e,R(s,!1),R(c,!1),R(u,void 0),R(f,void 0),R(m,void 0))});async function be(){if(t.toolCall&&(R(s,!0),!(L(f)&&L(m)===t.toolCall.updatedAt))){R(c,!0),R(u,void 0);try{let e=y.fetchToolCall;if(!e)throw Error(`Tool details are unavailable here.`);R(f,await e(t.toolCall.id),!0),R(m,t.toolCall.updatedAt,!0)}catch(e){R(u,e instanceof Error?e.message:String(e),!0)}finally{R(c,!1)}}}var U=XV(),xe=F(U);{let e=l(()=>t.toolCall?.status),n=l(()=>t.toolCall?void 0:L(ue).phase===`prepared`?`prepared`:`drafting`),r=l(()=>L(ue).errorVisible?L(ye):void 0),s=l(()=>L(I)||L(ue).argumentVisible||L(ue).interactionMode!==`none`||L(ue).resultMode!==`none`);SV(xe,{get status(){return L(e)},get draftPhase(){return L(n)},get dotTone(){return L(me)},get dotPulse(){return L(he)},get badge(){return L(fe)},get arg(){return L(B)},get error(){return L(r)},get meta(){return L(ge)},get footer(){return L(ue).footerVisible},get bodyVisible(){return L(s)},get layoutRevision(){return L(pe)},get detailsAction(){return L(_e)},get onOpenFile(){return t.onOpenFile},children:(e,n)=>{var r=YV(),s=F(r),c=e=>{{let n=l(()=>L(T)?.kind===`explore`?L(T):void 0);RI(e,{get draft(){return t.draft},get toolCall(){return t.toolCall},get view(){return L(n)},get onOpenFile(){return t.onOpenFile}})}},u=e=>{{let n=l(()=>!!(t.toolCall||t.draft?.block.done)),r=l(()=>!t.toolCall&&!t.draft?.block.done);nF(e,{get body(){return L(P)},get highlight(){return L(n)},get streaming(){return L(r)}})}};p(s,e=>{L(I)?e(c):L(ue).argumentVisible&&L(P)&&e(u,1)});var f=Y(s,2),m=e=>{{let n=l(()=>!L(ue).argumentVisible);JV(e,{get approval(){return L(j)},get toolName(){return t.toolCall.toolName},get presentation(){return L(ie)},get includeBody(){return L(n)},get detailsAction(){return L(ve)},get onGrantApproval(){return t.onGrantApproval},get onDenyApproval(){return t.onDenyApproval}})}};p(f,e=>{L(ue).interactionMode===`approval`&&L(j)&&L(ie)&&t.toolCall&&e(m)});var h=Y(f,2),g=e=>{TV(e,{get variant(){return L(M).resultPlaceholder.variant},get rows(){return L(M).resultPlaceholder.rows}})},v=e=>{var n=_(),r=F(n);{let e=l(()=>L(ae)?L(ve):void 0);d(r,()=>L(D),(n,r)=>{r(n,{get toolCall(){return t.toolCall},get view(){return L(T)},expanded:!1,get onOpenFile(){return t.onOpenFile},get detailsAction(){return L(e)},get questionRecord(){return L(oe)},get planReview(){return L(se)},get onAnswerUserQuestion(){return t.onAnswerUserQuestion},get planReviewModels(){return i()},get planReviewModelKey(){return a()},get planReviewThinkingLevel(){return o()},get onDismissUserQuestion(){return t.onDismissUserQuestion},get onAcceptPlanReview(){return t.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return t.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return t.onRejectPlanReview}})})}q(e,n)};p(h,e=>{!L(I)&&L(ue).resultMode===`placeholder`&&L(M).resultPlaceholder?e(g):!L(I)&&L(ue).resultMode===`output`&&t.toolCall&&L(T)&&L(D)&&e(v,1)}),q(e,r)},$$slots:{default:!0}})}var W=Y(xe,2),Se=e=>{PV(e,{get open(){return L(s)},get previewToolCall(){return t.toolCall},get toolCall(){return L(f)},get loading(){return L(c)},get error(){return L(u)},get pendingUserQuestion(){return t.pendingUserQuestion},get pendingPlanReview(){return t.pendingPlanReview},get onOpenFile(){return t.onOpenFile},get planReviewModels(){return i()},get planReviewModelKey(){return a()},get planReviewThinkingLevel(){return o()},get onAnswerUserQuestion(){return t.onAnswerUserQuestion},get onDismissUserQuestion(){return t.onDismissUserQuestion},get onAcceptPlanReview(){return t.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return t.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return t.onRejectPlanReview},onRetry:be,onOpenChange:e=>R(s,e,!0)})};p(W,e=>{t.toolCall&&r()&&e(Se)}),q(e,U),H()}function QV(e){return e.bodyVisible?e.previewVisible?`preview`:`status`:`none`}function $V(e){return[e.state,`body:${e.bodyKind}`,e.errorVisible?`error`:`no-error`,e.footerItemCount>0?`footer:${e.footerItemCount}`:`no-footer`].join(`|`)}var eH=P(`<p class="m-0 text-sm leading-6 text-muted-foreground">Summarizing recent work…</p>`),tH=P(`<p class="m-0 text-sm leading-6 text-muted-foreground">Compaction stopped.</p>`),nH=P(`<div class="my-2"><!></div>`);function rH(e,t){x(t,!0);function n(e){return e&&typeof e==`object`?e:void 0}let r=l(()=>n(t.notice.details)),i=l(()=>typeof L(r)?.compactedMessages==`number`?L(r).compactedMessages:void 0),a=l(()=>t.notice.reason===`threshold`?`auto compact`:t.notice.reason===`overflow`?`overflow recovery`:`manual`),o=l(()=>t.notice.state===`failed`?`danger`:t.notice.state===`cancelled`?`warn`:t.notice.state===`running`?`running`:`good`),s=l(()=>{let e=t.notice.contextTokens??t.notice.tokensBefore;if(!(!e||!t.notice.contextWindow))return Math.round(e/t.notice.contextWindow*100)}),c=l(()=>{if(t.notice.state===`running`)return t.notice.summaryPreview?.trimEnd()??``;if(t.notice.state!==`completed`)return``;let e=(t.notice.summary??t.notice.text??``).trimEnd();return e?On(e).slice(-6).join(`
119
- `):``}),u=X(Ie(Date.now()));z(()=>{if(t.notice.state!==`running`)return;let e=setInterval(()=>{R(u,Date.now(),!0)},250);return()=>clearInterval(e)});let d=l(()=>t.notice.createdAt?Date.parse(t.notice.createdAt):NaN),f=l(()=>{if(!(t.notice.state!==`running`||Number.isNaN(L(d))))return Math.max(0,Math.floor((L(u)-L(d))/1e3))}),m=l(()=>L(f)===void 0?void 0:`${Math.floor(L(f)/60)}:${String(L(f)%60).padStart(2,`0`)}`),h=l(()=>L(f)!==void 0&&L(f)>=1),g=l(()=>{let e=[];return typeof t.notice.tokensBefore==`number`&&e.push({text:`${pv(t.notice.tokensBefore)} before`}),typeof t.notice.tokensAfter==`number`&&e.push({text:`≈${pv(t.notice.tokensAfter)} after`}),typeof t.notice.freedTokens==`number`&&t.notice.freedTokens>0&&e.push({text:`${pv(t.notice.freedTokens)} freed`,tone:`success`}),typeof L(i)==`number`&&e.push({text:`${L(i)} messages`}),typeof L(s)==`number`&&e.push({text:`${L(s)}% context`}),e}),v=l(()=>{let e=[],n=t.notice.contextTokens??t.notice.tokensBefore;return typeof n==`number`&&e.push({text:`${pv(n)} before`}),typeof L(s)==`number`&&e.push({text:`${L(s)}% context`}),typeof t.notice.generatedLines==`number`&&t.notice.generatedLines>0&&e.push({text:`${t.notice.generatedLines} lines`}),L(h)&&L(m)&&e.push({text:L(m)}),e}),b=l(()=>t.notice.state===`completed`?L(g):t.notice.state===`running`?L(v):[]),S=l(()=>t.notice.errorMessage?.trim()||`Could not compact this conversation.`),C=l(()=>t.notice.state===`running`||t.notice.state===`cancelled`||t.notice.state===`completed`&&L(c).length>0),w=l(()=>$V({state:t.notice.state,bodyKind:QV({bodyVisible:L(C),previewVisible:L(c).length>0}),errorVisible:t.notice.state===`failed`,footerItemCount:L(b).length}));var T=nH(),E=B(T);{let e=l(()=>t.notice.state===`completed`?void 0:t.notice.state),n=l(()=>t.notice.state===`running`),r=l(()=>({text:L(a)})),i=l(()=>t.notice.state===`failed`?L(S):void 0);SV(E,{get status(){return L(e)},get dotTone(){return L(o)},get dotPulse(){return L(n)},badge:`compact`,get arg(){return L(r)},get error(){return L(i)},get meta(){return L(b)},get bodyVisible(){return L(C)},get layoutRevision(){return L(w)},children:(e,n)=>{var r=_(),i=F(r),a=e=>{yM(e,{get code(){return L(c)},language:`markdown`,trim:!1,wrap:!0,overflow:`hidden`,tail:!0,get fixedRows(){return 6}})},o=e=>{q(e,eH())},s=e=>{q(e,tH())};p(i,e=>{L(c)?e(a):t.notice.state===`running`?e(o,1):t.notice.state===`cancelled`&&e(s,2)}),q(e,r)},$$slots:{default:!0}})}y(T),q(e,T),H()}var iH=P(`<span class="arg svelte-1ey3ztt"> </span>`),aH=P(`<div class="flex min-w-0 items-center gap-2.5 rounded-md border bg-card px-2.5 py-2"><div class="min-w-0 flex-1 truncate font-mono text-xs text-foreground"> </div> <!> <!></div>`),oH=P(`<article class="task-event svelte-1ey3ztt"><div class="task-event-header svelte-1ey3ztt"><!> <span class="badge svelte-1ey3ztt"> </span> <!></div> <!></article>`);function sH(e,t){x(t,!0);let n=l(()=>Xp(t.notice.status)),r=l(()=>t.notice.exitCode!==void 0&&t.notice.exitCode!==null),i=l(()=>t.notice.event?`task ${t.notice.event}`:`task update`);var a=oH(),o=B(a),s=B(o);{let e=l(()=>Zp(t.notice.status));ci(s,{get tone(){return L(n)},get pulse(){return L(e)},size:`xs`,class:`mr-1.5 align-middle`})}var c=Y(s,2),u=B(c,!0);y(c);var d=Y(c,2),m=e=>{var n=iH(),r=B(n,!0);y(n),J(()=>f(r,t.notice.taskName)),q(e,n)};p(d,e=>{t.notice.taskName&&e(m)}),y(o);var h=Y(o,2),_=e=>{var i=aH(),a=B(i),o=B(a,!0);y(a);var s=Y(a,2),c=e=>{{let n=l(()=>t.notice.exitCode===0?`neutral`:`danger`);nP(e,{get tone(){return L(n)},size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,`exit ${t.notice.exitCode??``}`)),q(e,r)},$$slots:{default:!0}})}},u=e=>{nP(e,{tone:`warn`,size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,`signal ${t.notice.signal??``}`)),q(e,r)},$$slots:{default:!0}})};p(s,e=>{L(r)?e(c):t.notice.signal&&e(u,1)});var d=Y(s,2),m=e=>{{let r=l(()=>L(n)===`neutral`?`border-border bg-muted text-muted-foreground`:``);nP(e,{get tone(){return L(n)},size:`xs`,get class(){return L(r)},children:(e,n)=>{g();var r=D();J(()=>f(r,t.notice.status)),q(e,r)},$$slots:{default:!0}})}};p(d,e=>{t.notice.status&&e(m)}),y(i),J(()=>f(o,t.notice.commandPreview??``)),q(e,i)};p(h,e=>{(t.notice.commandPreview||L(r)||t.notice.signal||t.notice.status)&&e(_)}),y(a),J(()=>f(u,L(i))),q(e,a),H()}var cH=P(`<div class="status-actions svelte-qhsjll"><!></div>`),lH=P(`<article><div class="run-status-header svelte-qhsjll"><!> <span class="badge svelte-qhsjll"> </span> <span class="arg svelte-qhsjll"> </span></div> <p class="status-summary svelte-qhsjll"> </p> <!></article>`);function uH(e,t){x(t,!0);let n=X(Ie(Date.now()));z(()=>{if(t.notice.state!==`retrying`||!t.notice.retryAt)return;R(n,Date.now(),!0);let e=setInterval(()=>{R(n,Date.now(),!0)},250);return()=>clearInterval(e)});let r=l(()=>t.notice.state!==`retrying`&&t.isLast&&!t.sending&&t.notice.retryable===!0&&!!t.notice.runId&&!!t.onContinueFromFailure),i=l(()=>t.notice.state===`retrying`?`running`:`warn`),a=l(()=>t.notice.state===`retrying`?`retrying`:`run`),o=l(()=>{switch(t.notice.state){case`retrying`:return`model request`;case`interrupted`:return`interrupted`;default:return`failed`}}),s=l(()=>{let e=t.notice.retryAt?Date.parse(t.notice.retryAt):NaN;if(Number.isFinite(e))return Math.max(0,Math.ceil((e-L(n))/1e3));if(typeof t.notice.delayMs==`number`&&t.notice.delayMs>0)return Math.ceil(t.notice.delayMs/1e3)}),c=l(()=>t.notice.errorMessage?.trim()?t.notice.errorMessage.trim():void 0),u=l(()=>typeof t.notice.attempt==`number`&&typeof t.notice.maxRetries==`number`?`retry ${t.notice.attempt}/${t.notice.maxRetries}`:typeof t.notice.attempt==`number`?`retry ${t.notice.attempt}`:void 0),d=l(()=>t.notice.state===`retrying`?`${L(c)?`Request failed with ${L(c)}`:`Request failed`}, ${typeof L(s)==`number`?L(s)>0?`retry in ${L(s)}s`:`retrying now`:`retrying soon`}${L(u)?` (${L(u)})`:``}`:t.notice.state===`interrupted`?`${L(c)??`Nerve stopped this run after the host restarted.`} Nothing will resume until you choose Continue.`:`${L(c)?`Request failed with ${L(c)}`:`Request failed`}. Click Continue to retry.`);function m(){!t.notice.runId||!L(r)||t.onContinueFromFailure?.(t.notice.runId)}var h=lH(),_=B(h),v=B(_);{let e=l(()=>t.notice.state===`retrying`);ci(v,{get tone(){return L(i)},get pulse(){return L(e)},size:`xs`,class:`mr-1.5 align-middle`})}var b=Y(v,2),S=B(b,!0);y(b);var C=Y(b,2),T=B(C,!0);y(C),y(_);var E=Y(_,2),O=B(E,!0);y(E);var k=Y(E,2),ee=e=>{var t=cH();W(B(t),{size:`sm`,variant:`default`,onclick:m,children:(e,t)=>{g(),q(e,D(`Continue`))},$$slots:{default:!0}}),y(t),q(e,t)};p(k,e=>{L(r)&&e(ee)}),y(h),J(()=>{w(h,1,`run-status-line state-${t.notice.state}`,`svelte-qhsjll`),f(S,L(a)),f(T,L(o)),f(O,L(d))}),q(e,h),H()}var dH=P(`<div class="relative min-w-0 px-3"><!></div>`),fH=P(`<article class="transcript-entry assistant thinking-entry svelte-1tpvsz2" data-state="static"><div class="message-body svelte-1tpvsz2"><!></div></article>`),pH=P(`<span class="stream-caret svelte-1tpvsz2" aria-hidden="true"></span>`),mH=P(`<div class="message-content svelte-1tpvsz2"><!> <!></div>`),hH=P(`<pre class="mt-2 whitespace-pre-wrap break-words rounded-md border border-destructive/40 bg-destructive/10 p-3 font-mono text-xs text-destructive"> </pre>`),gH=P(`<article><div class="message-body svelte-1tpvsz2"><!> <!></div></article>`),_H=P(`<div><!></div>`);function vH(e,t){x(t,!0);let n=K(t,`approvalsByToolCallId`,19,()=>new Map),r=K(t,`questionsByToolCallId`,19,()=>new Map),i=K(t,`reviewsByToolCallId`,19,()=>new Map),a=K(t,`hydrateToolBodies`,3,!0),o=K(t,`planReviewModels`,19,()=>[]),s=K(t,`planReviewModelKey`,3,``),c=K(t,`planReviewThinkingLevel`,3,`off`),d=l(()=>{if(t.node.kind!==`thinking_group`)return;let e=t.node.items[0]?.item;if(e)return{kind:`thinking`,item:{...e,text:t.node.items.map(e=>e.item.text).join(`
120
-
121
- `)}}}),m=l(()=>{if(t.node.kind!==`message`)return`static`;let e=t.node.item;return e.role===`assistant`&&e.live?e.done?`complete`:`running`:`static`}),h=X(!1),g=X(void 0),_;z(()=>{let e=t.entranceMotion;!e||e.token===_||(_=e.token,t.onClaimEntrance?.(e.token)&&(R(g,e,!0),R(h,!0)))});var v=_H();let b,S;var C=B(v),T=e=>{var u=dH(),d=B(u);{let e=l(()=>t.node.toolCall?{kind:`tool`,anchorEntryId:t.node.anchorEntryId,toolCall:t.node.toolCall}:{kind:`tool_result_error`,toolName:t.node.draft?.block.toolName??`tool`,error:``}),u=l(()=>!t.node.toolCall);yy(d,{get target(){return L(e)},get menu(){return t.transcriptMenu},get disabled(){return L(u)},triggerClass:`block min-w-0`,children:(e,u)=>{{let u=l(()=>t.activeProject?.dir),d=l(()=>t.node.toolCall&&n().get(t.node.toolCall.id)?.status===`pending`?n().get(t.node.toolCall.id):void 0),f=l(()=>t.node.toolCall?r().get(t.node.toolCall.id):void 0),p=l(()=>t.node.toolCall?i().get(t.node.toolCall.id):void 0);ZV(e,{get draft(){return t.node.draft},get toolCall(){return t.node.toolCall},get liveOutput(){return t.node.liveOutput},get cwd(){return L(u)},get pendingApproval(){return L(d)},get pendingUserQuestion(){return L(f)},get hydrateBody(){return a()},get pendingPlanReview(){return L(p)},get onOpenFile(){return t.onOpenFile},get planReviewModels(){return o()},get planReviewModelKey(){return s()},get planReviewThinkingLevel(){return c()},get onAnswerUserQuestion(){return t.onAnswerUserQuestion},get onDismissUserQuestion(){return t.onDismissUserQuestion},get onGrantApproval(){return t.onGrantApproval},get onDenyApproval(){return t.onDenyApproval},get onAcceptPlanReview(){return t.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return t.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return t.onRejectPlanReview}})}},$$slots:{default:!0}})}y(u),q(e,u)},E=e=>{{let n=l(()=>({kind:`tool_result_error`,toolName:t.node.toolName,error:t.node.error}));yy(e,{get target(){return L(n)},get menu(){return t.transcriptMenu},triggerClass:`block select-text`,children:(e,n)=>{var r=dH();mI(B(r),{get toolName(){return t.node.toolName},get error(){return t.node.error}}),y(r),q(e,r)},$$slots:{default:!0}})}},D=e=>{{let n=l(()=>({kind:`run_status`,notice:t.node.notice}));yy(e,{get target(){return L(n)},get menu(){return t.transcriptMenu},triggerClass:`block select-text`,children:(e,n)=>{{let n=l(()=>t.node.key===t.lastTimelineKey);uH(e,{get notice(){return t.node.notice},get isLast(){return L(n)},get sending(){return t.sending},get onContinueFromFailure(){return t.onContinueFromFailure}})}},$$slots:{default:!0}})}},O=e=>{{let n=l(()=>({kind:`compaction`,notice:t.node.notice}));yy(e,{get target(){return L(n)},get menu(){return t.transcriptMenu},triggerClass:`block select-text`,children:(e,n)=>{var r=dH();rH(B(r),{get notice(){return t.node.notice}}),y(r),q(e,r)},$$slots:{default:!0}})}},k=e=>{{let n=l(()=>({kind:`task_event`,notice:t.node.notice}));yy(e,{get target(){return L(n)},get menu(){return t.transcriptMenu},triggerClass:`block select-text`,children:(e,n)=>{sH(e,{get notice(){return t.node.notice}})},$$slots:{default:!0}})}},ee=e=>{yy(e,{get target(){return L(d)},get menu(){return t.transcriptMenu},triggerClass:`select-text`,children:(e,n)=>{var r=fH(),i=B(r),a=B(i);{let e=l(()=>t.node.items.map(e=>e.item));iI(a,{get items(){return L(e)}})}y(i),y(r),q(e,r)},$$slots:{default:!0}})},j=e=>{{let n=l(()=>({kind:`message`,item:t.node.item})),r=l(()=>`select-text ${t.node.item.role===`user`?`block`:``}`);yy(e,{get target(){return L(n)},get menu(){return t.transcriptMenu},get triggerClass(){return L(r)},children:(e,n)=>{var r=gH(),i=B(r),a=B(i),o=e=>{var n=mH(),r=B(n),i=e=>{{let n=l(()=>!!t.node.item.optimistic);Ny(e,{get text(){return t.node.item.text},get pending(){return L(n)}})}},a=e=>{{let n=l(()=>t.node.item.role!==`assistant`),r=l(()=>!!(t.node.item.live&&!t.node.item.done)),i=l(()=>t.activeProject?.dir);Pj(e,{get text(){return t.node.item.text},get trimCodeBlocks(){return L(n)},get streaming(){return L(r)},get linkBasePath(){return L(i)},get onOpenFile(){return t.onOpenFile},get onCopy(){return OS}})}};p(r,e=>{t.node.item.role===`user`?e(i):e(a,-1)});var o=Y(r,2),s=e=>{q(e,pH())};p(o,e=>{t.node.item.live&&!t.node.item.done&&e(s)}),y(n),q(e,n)};p(a,e=>{t.node.item.text&&e(o)});var s=Y(a,2),c=e=>{var n=hH(),r=B(n,!0);y(n),J(e=>f(r,e),[()=>t.node.item.errorMessage.trim()]),q(e,n)},u=l(()=>t.node.item.stopReason===`error`&&t.node.item.errorMessage?.trim());p(s,e=>{L(u)&&e(c)}),y(i),y(r),J(()=>{w(r,1,`transcript-entry ${t.node.item.role} ${t.node.item.live?`streaming`:``}`,`svelte-1tpvsz2`),A(r,`data-state`,L(m))}),q(e,r)},$$slots:{default:!0}})}};p(C,e=>{t.node.kind===`tool`?e(T):t.node.kind===`tool_result_error`?e(E,1):t.node.kind===`run_status`?e(D,2):t.node.kind===`compaction`?e(O,3):t.node.kind===`task_event`?e(k,4):t.node.kind===`thinking_group`&&L(d)?e(ee,5):t.node.kind===`message`&&e(j,6)}),y(v),J(()=>{b=w(v,1,`transcript-row-content svelte-1tpvsz2`,null,b,{"transcript-enter-standard":L(h)&&L(g)?.profile===`standard`,"transcript-enter-compact":L(h)&&L(g)?.profile===`compact`,"transcript-enter-minimal":L(h)&&L(g)?.profile===`minimal`}),S=u(v,``,S,{"--transcript-enter-delay":L(g)?`${L(g).delayMs}ms`:void 0})}),Ae(`animationend`,v,e=>{e.target===e.currentTarget&&(R(h,!1),R(g,void 0))}),q(e,v),H()}function yH(e){return{profile:`standard`,delaysMs:Array.from({length:e},()=>0)}}var bH=class{allocateMotion;scope;seeded=!1;sequence=0;seen=new Set;pending=new Map;constructor(e=yH){this.allocateMotion=e}project(e,t){if(e!==this.scope&&this.reset(e),!this.seeded){for(let e of t)this.seen.add(e.key);return this.seeded=!0,new Map}let n=[];for(let e of t)this.seen.has(e.key)||(this.seen.add(e.key),e.eligible&&(this.sequence+=1,n.push({key:e.key,token:`${this.sequence}`})));if(n.length>0){let e=this.allocateMotion(n.length);n.forEach((t,n)=>{this.pending.set(t.key,{token:t.token,profile:e.profile,delayMs:e.delaysMs[n]??0})})}let r=new Set(t.map(e=>e.key));for(let e of this.pending.keys())r.has(e)||this.pending.delete(e);return new Map(t.flatMap(e=>{let t=this.pending.get(e.key);return t?[[e.key,t]]:[]}))}claim(e,t){return this.pending.get(e)?.token===t?(this.pending.delete(e),!0):!1}reset(e){this.scope=e,this.seeded=!1,this.seen.clear(),this.pending.clear()}},xH={burstWindowMs:160,cooldownMs:240,compactThreshold:4,minimalThreshold:9,compactDelayStepMs:12,compactDelayCapMs:60},SH={standard:0,compact:1,minimal:2};function CH(e,t){return SH[t]>SH[e]?t:e}function wH(e){return e>=xH.minimalThreshold?`minimal`:e>=xH.compactThreshold?`compact`:`standard`}var TH=class{now;eventTimes=[];lastEventAt;activeProfile=`standard`;constructor(e=()=>performance.now()){this.now=e}allocateBatch(e){if(e<=0)return{profile:`standard`,delaysMs:[]};let t=this.now();this.prepareWindow(t);for(let n=0;n<e;n+=1)this.eventTimes.push(t);this.lastEventAt=t,this.activeProfile=CH(this.activeProfile,wH(this.eventTimes.length));let n=Array.from({length:e},(e,t)=>this.activeProfile===`compact`?Math.min(t*xH.compactDelayStepMs,xH.compactDelayCapMs):0);return{profile:this.activeProfile,delaysMs:n}}claim(){return this.allocateBatch(1).profile}reset(){this.eventTimes.length=0,this.lastEventAt=void 0,this.activeProfile=`standard`}prepareWindow(e){this.lastEventAt!==void 0&&e-this.lastEventAt>=xH.cooldownMs&&this.reset();let t=e-xH.burstWindowMs;for(;this.eventTimes.length>0&&this.eventTimes[0]<t;)this.eventTimes.shift()}};function EH(e){return e.timelineLength>0||!!e.streamingText||e.sending||e.queuedPromptCount>0}var DH=P(`<article class="waiting-entry svelte-96a2zm"><!></article>`);function OH(e,t){x(t,!0);function n(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}:duplicate:${n}`}let r=K(t,`controller`,15),i=K(t,`atEnd`,15,!0),a=K(t,`paddingEnd`,3,0),o=K(t,`contentVisibility`,3,!1),s=K(t,`transcriptLabel`,3,`Conversation transcript`),c=K(t,`followBottom`,3,!0),u=K(t,`approvals`,19,()=>[]),d=K(t,`pendingUserQuestions`,19,()=>[]),f=K(t,`pendingPlanReviews`,19,()=>[]),m=K(t,`active`,3,!0),h=K(t,`planReviewModels`,19,()=>[]),g=K(t,`planReviewModelKey`,3,``),v=K(t,`planReviewThinkingLevel`,3,`off`),b=new TH;fV(b);let S=new bH(e=>b.allocateBatch(e)),C;function w(e){return e.kind===`message`?!!e.item.live:e.kind===`thinking_group`?e.items.some(e=>!!e.item.live):e.kind===`tool`&&!!e.draft}let T=0,E=l(()=>{let e=new Map,r=QF(t.timelinePrefix).map(t=>({kind:`timeline`,key:n(t.key,e),node:t}));return T+=1,{revision:T,rows:r,seenKeys:e}}),D=l(()=>QF(t.timelineTail)),O=l(()=>t.timelinePrefix.some(e=>e.kind===`compaction`&&e.notice.state===`running`)),k=l(()=>t.timelineTail.some(e=>e.kind===`compaction`&&e.notice.state===`running`)),ee=l(()=>L(O)||L(k)),A,j=new ye,M=l(()=>{let e=new ye(L(E).seenKeys),r=[...L(E).rows],i=[...L(D)],a=r.at(-1),o=i[0];if(a?.node.kind===`thinking_group`&&o?.kind===`thinking_group`){r.pop(),i.shift();let t=e.get(a.node.key)??0;t<=1?e.delete(a.node.key):e.set(a.node.key,t-1),i.unshift({kind:`thinking_group`,key:a.node.key,items:[...a.node.items,...o.items]})}let s=i.map(t=>({kind:`timeline`,key:n(t.key,e),node:t})),c=[...r,...s],l=t.heightCacheKey??`__default-transcript__`;l!==C&&(C=l,b.reset());let u=s.map(e=>`${e.key}:${+!!w(e.node)}`).join(`|`),d=`${l}\0${L(E).revision}\0${u}`;d!==A&&(A=d,j=S.project(l,c.map(e=>({key:e.key,eligible:w(e.node)}))));let f=[...r,...s.map(e=>({...e,entranceMotion:j.get(e.key)}))];t.sending&&!t.hasActiveTurnOutput&&!L(ee)&&f.push({kind:`waiting`,key:`__waiting__`});for(let e of t.queuedPrompts)f.push({kind:`queued`,key:`__queued__:${e.id}`,prompt:e});return f}),N=l(()=>new Map(u().map(e=>[e.toolCallId,e]))),te=l(()=>new Map(d().map(e=>[e.toolCallId,e]))),ne=l(()=>new Map(f().map(e=>[e.toolCallId,e]))),P=l(()=>`${L(E).revision}\0${L(D).map(e=>e.key).join(`|`)}\0${t.sending&&!t.hasActiveTurnOutput&&!L(ee)?`waiting`:``}\0${t.queuedPrompts.map(e=>e.id).join(`|`)}`);function re(e,t){return S.claim(e,t)}function ie(e){if(e.kind===`waiting`)return`waiting`;if(e.kind===`queued`)return`${e.prompt.status}:${e.prompt.updatedAt}`;let t=e.node;if(t.kind===`thinking_group`)return t.items.map(e=>`${e.item.text.length}:${e.item.live?`live`:`stored`}:${e.item.done?`done`:`open`}`).join(`|`);if(t.kind===`message`){let e=t.item;return[e.text.length,e.live?`live`:`stored`,e.done?`done`:`open`,e.optimistic?`optimistic`:`settled`,e.stopReason??`ok`,e.errorMessage?.length??0].join(`:`)}if(t.kind===`tool`){if(!t.toolCall){let e=t.draft?.block,n=e?.progress,r=gS(e?.toolName??`tool`);return[`draft`,`arg:${r.argumentRegion}`,`placeholder:${r.resultPlaceholder?.variant??`none`}`,e?.argsText.length??0,e?.done?`done`:`open`,n?.lineCount??0,n?.generatedLineCount??0,n?.generatedPreview?.length??0,e?.argsText||n?.generatedPreview?`activity-visible`:`header-only`].join(`:`)}let e=t.toolCall.id,n=gS(t.toolCall.toolName),r=L(N).get(e),i=L(te).get(e),a=L(ne).get(e);return[`tool`,`arg:${n.argumentRegion}`,`placeholder:${n.resultPlaceholder?.variant??`none`}`,t.toolCall.status,t.toolCall.updatedAt,t.liveOutput?.updatedAt??`no-output`,m()?`body-hydrated`:`body-deferred`,t.toolCall.status===`error`||t.toolCall.status===`denied`?`activity-error`:`activity-visible`,r?`${r.id}:${r.status}`:`no-approval`,i?`${i.id}:${i.status}`:`no-question`,a?`${a.id}:${a.status}`:`no-plan`].join(`:`)}if(t.kind===`compaction`){let e=t.notice;return[`compaction`,e.state,e.summaryPreview?.length??0,e.summary?.length??0,e.errorMessage?.length??0].join(`:`)}return t.key}let I=l(()=>!EH({timelineLength:t.timelinePrefix.length+t.timelineTail.length,streamingText:t.streamingText,sending:t.sending,queuedPromptCount:t.queuedPrompts.length}));var ae=_(),R=F(ae),oe=e=>{{let n=l(()=>t.activeProject?.dir);fy(e,{title:`The cursor is yours.`,message:`Bring the question. Nerve will bring the map, the tools, and the follow-through.`,get projectLabel(){return t.activeProjectLabel},get projectPath(){return L(n)}})}},se=e=>{Ka(e,{get items(){return L(M)},getKey:e=>e.key,get structureVersion(){return L(P)},get heightCacheKey(){return t.heightCacheKey},getMeasurementVersion:ie,get contentVisibility(){return o()},estimateSize:()=>120,overscan:10,anchor:`end`,get followOutput(){return c()},scrollEndThreshold:32,paddingStart:12,get paddingEnd(){return a()},gap:2,viewportTabIndex:0,get viewportAriaLabel(){return s()},viewportClass:`@container h-full px-3`,get controller(){return r()},set controller(e){r(e)},get atEnd(){return i()},set atEnd(e){i(e)},row:(e,n)=>{let r=()=>n?.().item;var i=_(),a=F(i),o=e=>{vH(e,{get node(){return r().node},get entranceMotion(){return r().entranceMotion},onClaimEntrance:e=>re(r().key,e),get sending(){return t.sending},get hydrateToolBodies(){return m()},get activeProject(){return t.activeProject},get approvalsByToolCallId(){return L(N)},get questionsByToolCallId(){return L(te)},get reviewsByToolCallId(){return L(ne)},get lastTimelineKey(){return t.lastTimelineKey},get planReviewModels(){return h()},get planReviewModelKey(){return g()},get planReviewThinkingLevel(){return v()},get onOpenFile(){return t.onOpenFile},get onAnswerUserQuestion(){return t.onAnswerUserQuestion},get onDismissUserQuestion(){return t.onDismissUserQuestion},get onGrantApproval(){return t.onGrantApproval},get onDenyApproval(){return t.onDenyApproval},get onAcceptPlanReview(){return t.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return t.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return t.onRejectPlanReview},get onContinueFromFailure(){return t.onContinueFromFailure},get transcriptMenu(){return t.transcriptMenu}})},s=e=>{var t=DH();sI(B(t),{}),y(t),q(e,t)},c=e=>{Jy(e,{get prompt(){return r().prompt},get onDiscard(){return t.onDiscardQueuedPrompt},get onMoveToComposer(){return t.onMoveQueuedPromptToComposer},get transcriptMenu(){return t.transcriptMenu}})};p(a,e=>{r().kind===`timeline`?e(o):r().kind===`waiting`?e(s,1):e(c,-1)}),q(e,i)},$$slots:{row:!0}})};p(R,e=>{L(I)?e(oe):e(se,-1)}),q(e,ae),H()}var kH=P(`<div><span class="font-medium text-foreground"> </span> <!></div>`);function AH(e,t){let n=K(t,`tone`,3,`muted`);var r=kH(),i=B(r),a=B(i,!0);y(i);var o=Y(i,2),s=e=>{var n=D();J(()=>f(n,t.message)),q(e,n)};p(o,e=>{t.message&&e(s)}),y(r),J(()=>{w(r,1,`flex-none border-b px-4 py-2 text-xs text-muted-foreground ${n()===`warning`?`bg-warning/10`:`bg-muted/40`}`),f(a,t.title)}),q(e,r)}var jH=new Set([`$$slots`,`$$events`,`$$legacy`]);function MH(e,t){let n=U(t,jH),r=[[`path`,{d:`M19 19H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.7.7 0 0 1 2 21.286V5a2 2 0 0 1 1.184-1.826`}],[`path`,{d:`m2 2 20 20`}],[`path`,{d:`M8.656 3H20a2 2 0 0 1 2 2v11.344`}]];G(e,V({name:`message-square-off`},()=>n,{get iconNode(){return r}}))}var NH=P(`<p class="max-w-md text-xs text-muted-foreground"> </p>`),PH=P(`<div class="flex min-h-0 flex-col items-center justify-center gap-2 p-4 text-center"><!> <p class="text-sm text-muted-foreground"> </p> <!></div>`);function FH(e,t){let n=K(t,`title`,3,`No conversation selected.`);var r=PH(),i=B(r);MH(i,{class:`size-8 text-muted-foreground`});var a=Y(i,2),o=B(a,!0);y(a);var s=Y(a,2),c=e=>{var n=NH(),r=B(n,!0);y(n),J(()=>f(r,t.message)),q(e,n)};p(s,e=>{t.message&&e(c)}),y(r),J(()=>f(o,n())),q(e,r)}var IH=P(`<div class="flex h-full min-h-0 flex-col"><!> <div class="min-h-0 flex-1"><!></div></div>`);function LH(e,t){x(t,!0);let n=l(()=>t.model.active??!0),r=l(()=>t.model.timeline.tail.at(-1)?.key??t.model.timeline.prefix.at(-1)?.key),i=l(()=>t.model.approvals?.filter(e=>e.status===`pending`)??[]),a=l(()=>L(i)[0]?.id),o=l(()=>L(i).length),s=l(()=>t.model.pendingUserQuestions?.filter(e=>e.status===`pending`).map(e=>e.id)??[]),c=l(()=>t.model.pendingPlanReviews?.filter(e=>e.status===`pending`).map(e=>e.id)??[]),u=l(()=>EH({timelineLength:t.model.timeline.prefix.length+t.model.timeline.tail.length,streamingText:t.model.streamingText,sending:t.model.sending,queuedPromptCount:t.model.queuedPrompts.length})),d=XF({active:()=>L(n),conversationOpen:()=>t.model.open,conversationId:()=>t.model.conversationId,contentReady:()=>L(u)});{let i=e=>{$v(e,{get active(){return L(n)},get sending(){return t.model.sending},get pendingApprovalId(){return L(a)},get pendingApprovalCount(){return L(o)},get pendingQuestionIds(){return L(s)},get pendingPlanReviewIds(){return L(c)}})},u=e=>{var i=IH(),a=B(i),o=e=>{AH(e,V(()=>t.model.banner))};p(a,e=>{t.model.banner&&e(o)});var s=Y(a,2),c=B(s);{let e=l(()=>t.model.transcriptHeightCacheKey??t.model.conversationId),i=l(()=>L(n)?d.followBottom:!1);OH(c,{paddingEnd:18,get heightCacheKey(){return L(e)},get transcriptLabel(){return t.model.transcriptLabel},get timelinePrefix(){return t.model.timeline.prefix},get timelineTail(){return t.model.timeline.tail},get streamingText(){return t.model.streamingText},get sending(){return t.model.sending},get hasActiveTurnOutput(){return t.model.hasActiveTurnOutput},get queuedPrompts(){return t.model.queuedPrompts},get followBottom(){return L(i)},get activeProject(){return t.model.activeProject},get activeProjectLabel(){return t.model.activeProjectLabel},get approvals(){return t.model.approvals},get pendingUserQuestions(){return t.model.pendingUserQuestions},get pendingPlanReviews(){return t.model.pendingPlanReviews},get active(){return L(n)},get planReviewModels(){return t.model.planReviewModels},get planReviewModelKey(){return t.model.planReviewModelKey},get planReviewThinkingLevel(){return t.model.planReviewThinkingLevel},get lastTimelineKey(){return L(r)},get onOpenFile(){return t.actions.onOpenFile},get onAnswerUserQuestion(){return t.actions.onAnswerUserQuestion},get onDismissUserQuestion(){return t.actions.onDismissUserQuestion},get onGrantApproval(){return t.actions.onGrantApproval},get onDenyApproval(){return t.actions.onDenyApproval},get onAcceptPlanReview(){return t.actions.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return t.actions.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return t.actions.onRejectPlanReview},get onContinueFromFailure(){return t.actions.onContinueFromFailure},get onDiscardQueuedPrompt(){return t.actions.onDiscardQueuedPrompt},get onMoveQueuedPromptToComposer(){return t.actions.onMoveQueuedPromptToComposer},get transcriptMenu(){return t.menus.transcriptMenu},get controller(){return d.controller},set controller(e){d.controller=e},get atEnd(){return d.atEnd},set atEnd(e){d.atEnd=e}})}y(s),y(i),q(e,i)},f=e=>{var n=_(),r=F(n),i=e=>{var n=_();h(F(n),()=>t.composer),q(e,n)},a=e=>{Wv(e,{get model(){return t.model.composer},get actions(){return t.actions}})};p(r,e=>{t.composer?e(i):e(a,-1)}),q(e,n)},m=e=>{var n=_(),r=F(n),i=e=>{var n=_();h(F(n),()=>t.emptyExtension),q(e,n)},a=e=>{FH(e,{get title(){return t.model.emptyTitle},get message(){return t.model.emptyMessage}})};p(r,e=>{t.emptyExtension?e(i):e(a,-1)}),q(e,n)},g=l(()=>L(n)&&!d.atEnd);Jv(e,{get open(){return t.model.open},get showScrollButton(){return L(g)},get composerHeight(){return d.composerHeight},onJumpToBottom:()=>d.jumpToBottom(),get composerWrapRef(){return d.composerWrapEl},set composerWrapRef(e){d.composerWrapEl=e},announcer:i,transcript:u,composer:f,empty:m,$$slots:{announcer:!0,transcript:!0,composer:!0,empty:!0}})}H()}var RH=new Set([`$$slots`,`$$events`,`$$legacy`]);function zH(e,t){let n=U(t,RH),r=[[`path`,{d:`M13 5h8`}],[`path`,{d:`M13 12h8`}],[`path`,{d:`M13 19h8`}],[`path`,{d:`m3 17 2 2 4-4`}],[`path`,{d:`m3 7 2 2 4-4`}]];G(e,V({name:`list-checks`},()=>n,{get iconNode(){return r}}))}var BH=[{id:`plan`,label:`Plan`,mode:`planning`,icon:zH},{id:`code`,label:`Code`,mode:`coding`,icon:nf}],VH=P(`<div aria-live="polite"><span class="activity-sr svelte-9ds0r"> </span> <span aria-hidden="true"> </span></div>`);function HH(e,t){x(t,!0);let n=K(t,`recording`,3,!1),r=K(t,`transcribing`,3,!1),i=K(t,`elapsedMs`,3,0),a=K(t,`maxDurationMs`,3,1),o=K(t,`retryAttempt`,3,0),s=K(t,`maxRetries`,3,0),c=K(t,`class`,3,``),u=l(()=>n()||r()),d=l(()=>S(i())),m=l(()=>S(a())),h=l(()=>Math.max(0,Math.min(1,a()>0?i()/a():0))),g=l(()=>L(h)>=.85),v=l(()=>n()?`${L(d)} / ${L(m)}`:o()>0?`Retry ${o()}/${s()}`:`Transcribing…`),b=l(()=>n()?`Recording ${L(d)} of ${L(m)}`:o()>0?`Retrying transcription ${o()} of ${s()}`:`Transcribing audio`);function S(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}var C=_(),T=F(C),E=e=>{var t=VH(),r=B(t),i=B(r,!0);y(r);var a=Y(r,2),o=B(a,!0);y(a),y(t),J(()=>{w(t,1,`transcription-activity rounded-full ${c()}`,`svelte-9ds0r`),A(t,`data-state`,n()?`recording`:`transcribing`),A(t,`data-near-limit`,L(g)?`true`:void 0),f(i,L(b)),f(o,L(v))}),q(e,t)};p(T,e=>{L(u)&&e(E)}),q(e,C),H()}var UH=new Set([`$$slots`,`$$events`,`$$legacy`]);function WH(e,t){let n=U(t,UH),r=[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`}]];G(e,V({name:`key-round`},()=>n,{get iconNode(){return r}}))}var GH=new Set([`$$slots`,`$$events`,`$$legacy`]);function KH(e,t){let n=U(t,GH),r=[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`}],[`path`,{d:`m9 12 2 2 4-4`}]];G(e,V({name:`shield-check`},()=>n,{get iconNode(){return r}}))}var qH={kind:`auth`,id:`auth`};function JH(e,t){e&&(Wi.activePageId=e),t&&(Wi.activeSectionId=t)}async function YH(e,t){JH(e,t),Ui(qH),Ai(qH),await QH()}function XH(e,t){JH(e,t),Ui(qH),Ai(qH),Wi.catalogLoaded||QH()}function ZH(){let e=Q.activeCenterTab?.kind===`auth`,t=Ni(qH);ji(qH),e&&Fi(t)}async function QH(){let[e]=await Promise.all([co(),dt()]);Wi.customProviders=e.providers,Wi.modelDefinitions=e.models,Wi.catalogLoaded=!0}async function $H(){let e=await co();Wi.customProviders=e.providers,Wi.modelDefinitions=e.models,Wi.catalogLoaded=!0,await dt()}var eU=new Map,tU=new Set,nU=new Set;function rU(e){return`seq`in e}function iU(){return cU.length}function aU(e,t){let n=eU.get(e);return n||(n=new Set,eU.set(e,n)),n.add(t),()=>{n?.delete(t),n?.size===0&&eU.delete(e)}}function oU(e){return tU.add(e),()=>tU.delete(e)}function sU(e){let t=[...eU.get(e.type)??[],...tU];for(let n of t)try{let t=n(e);t instanceof Promise&&t.catch(t=>mU(e,t))}catch(t){mU(e,t)}}var cU=[],lU=!1;function uU(){if(lU)return;lU=!0;let e=()=>{lU=!1,pU()};typeof requestAnimationFrame==`function`?requestAnimationFrame(e):queueMicrotask(e)}function dU(e){cU.push(e),uU()}async function fU(e){let t=[...eU.get(e.type)??[],...tU];for(let n of t)await n(e);for(let t of nU)t([e])}function pU(){let e=[];for(let t=0;t<cU.length;t+=1){let n=cU[t];e.push(n),sU(n)}if(cU.length=0,e.length!==0)for(let t of nU)try{t(e)}catch(e){console.error(`Workbench notify flush handler failed`,e)}}function mU(e,t){console.error(`Workbench event handler failed`,{type:e.type,seq:rU(e)?e.seq:void 0,error:t})}function hU(){return oU(gU)}function gU(e){Wi.catalogLoaded&&e.type.startsWith(`providers.`)&&$H()}var _U=P(`<!> Open authentication`,1),vU=P(`<!> <!>`,1),yU=P(`<div class="audio-auth-body svelte-8zh17m"><div class="audio-auth-summary svelte-8zh17m"><span class="audio-auth-icon rounded-full svelte-8zh17m" aria-hidden="true"><!></span> <div><h3 class="svelte-8zh17m">Audio input is not configured yet</h3> <p class="svelte-8zh17m">Nerve records from your microphone locally, then sends the captured
122
- audio to ChatGPT for transcription through the OpenAI Codex OAuth
123
- provider.</p></div></div> <div class="audio-auth-detail svelte-8zh17m"><!> <p class="svelte-8zh17m">A free or paid ChatGPT account can be used. It just needs to be
124
- connected so the orchestrator can request transcription securely.</p></div> <p class="audio-auth-path svelte-8zh17m">To enable it, open <strong class="svelte-8zh17m">Authentication</strong> → <strong class="svelte-8zh17m">Subscriptions</strong>, then connect <strong class="svelte-8zh17m">OpenAI Codex</strong>.</p></div>`);function bU(e,t){x(t,!0);let n=K(t,`open`,15,!1);function r(){n(!1)}function i(){r(),YH()}IF(e,{title:`Connect ChatGPT to use voice input`,description:`Voice input needs a ChatGPT OAuth connection before Nerve can transcribe recordings.`,size:`sm`,get open(){return n()},set open(e){n(e)},footer:e=>{var t=vU(),n=F(t);W(n,{size:`sm`,variant:`ghost`,onclick:r,children:(e,t)=>{g(),q(e,D(`Close`))},$$slots:{default:!0}}),W(Y(n,2),{size:`sm`,onclick:i,children:(e,t)=>{var n=_U();WH(F(n),{size:15,strokeWidth:2.1}),g(),q(e,n)},$$slots:{default:!0}}),q(e,t)},children:(e,t)=>{var n=yU(),r=B(n),i=B(r);TS(B(i),{size:18,strokeWidth:2.2}),y(i),g(2),y(r);var a=Y(r,2);KH(B(a),{size:16,strokeWidth:2.1,"aria-hidden":`true`}),g(2),y(a),g(2),y(n),q(e,n)},$$slots:{footer:!0,default:!0}}),H()}function xU(e){return!!e?.some(e=>e.provider===`openai-codex`&&e.configured&&e.credentialType===`oauth`)}var SU={get configured(){return xU(Pi.authProviders)}},CU=new Set([`$$slots`,`$$events`,`$$legacy`]);function wU(e,t){let n=U(t,CU),r=[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`}],[`path`,{d:`M9 18h6`}],[`path`,{d:`M10 22h4`}]];G(e,V({name:`lightbulb`},()=>n,{get iconNode(){return r}}))}var TU=P(`<button type="button" class="inline-flex h-7 items-center gap-1.5 rounded-full border border-border bg-card px-3 text-xs font-medium text-muted-foreground transition-colors hover:border-primary/40 hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-default disabled:opacity-55"><!> <span> </span></button>`),EU=P(`<div class="flex flex-wrap gap-1 px-0.5" role="group" aria-label="Suggested prompt actions"></div>`);function DU(e,t){x(t,!0);let n=K(t,`suggestions`,19,()=>[]),r=K(t,`disabled`,3,!1);var i=_(),a=F(i),o=e=>{var i=EU();O(i,21,n,e=>e.id,(e,n)=>{let i=l(()=>L(n).icon??wU);var a=TU(),o=B(a);d(o,()=>L(i),(e,t)=>{t(e,{class:`size-3.5 text-primary`,strokeWidth:2.2,"aria-hidden":`true`})});var s=Y(o,2),c=B(s,!0);y(s),y(a),J(()=>{a.disabled=r(),A(a,`title`,`Click to send. Right-click to insert into composer.\n\n${L(n).prompt}`),A(a,`aria-label`,`${L(n).label}. Click to send. Right-click to insert into composer.`),f(c,L(n).label)}),le(`click`,a,()=>t.onSend?.(L(n))),le(`contextmenu`,a,e=>{e.preventDefault(),t.onDraft?.(L(n))}),q(e,a)}),y(i),q(e,i)};p(a,e=>{n().length>0&&e(o)}),q(e,i),H()}r([`click`,`contextmenu`]);function OU(e){let t=e.hasProject&&e.hasConversation,n=!!(e.interactive&&t&&!e.blockedForReview&&!e.compacting&&!e.stopping),r=n&&e.hasModels;return{hasTarget:t,canEdit:n,canPrompt:r,canSubmit:!!(r&&!e.voiceSubmitPending&&!(e.commandMode&&e.sending))}}function kU(e){return/\s/.test(e)?`"${e.replaceAll(`"`,`\\"`)}"`:e}function AU(e,t,n){return e.length===0?[]:e.map(e=>{let r=n(e).trim();if(!r)throw Error(`Could not resolve the native path for ${e.name||`a dropped item`}.`);return kU(sa(r,t)??r)})}var jU=P(`<!> <!>`,1);function MU(e,t){x(t,!0);let n=K(t,`text`,3,``),r=K(t,`pendingConversationActive`,3,!1),i=K(t,`approvals`,19,()=>[]),a=K(t,`pendingUserQuestions`,19,()=>[]),o=K(t,`pendingPlanReviews`,19,()=>[]),s=K(t,`interactive`,3,!0),c=K(t,`sending`,3,!1),u=K(t,`stopping`,3,!1),d=K(t,`compacting`,3,!1),f=K(t,`models`,19,()=>[]),m=K(t,`selectedModelKey`,3,``),h=K(t,`contextWindow`,3,0),g=K(t,`todos`,19,()=>[]),v=K(t,`focusToken`,3,0),y=K(t,`composerEscapeToken`,3,0),b=K(t,`micShortcutToken`,3,0),S=K(t,`thinkingLevel`,3,`off`),C=K(t,`mode`,3,`coding`),w=K(t,`permissionLevel`,3,`autonomous`),T=K(t,`approvalPolicy`,19,()=>({autoApproveReadOnly:!0})),E=K(t,`slashCompletions`,19,()=>[]),D=K(t,`composerSuggestions`,19,()=>[]),O=X(Ie(Oe(()=>+!!r()))),k=X(!1),ee,A,j,M=X(!1),N=Cp(`composer.toggleMic`),te=wp(`composer.toggleMic`),ne=Cp(`composer.cancelMic`),P=Cp(`composer.toggleMode`),re=wp(`composer.toggleMode`),ie=Cp(`composer.cyclePermission`),I=wp(`composer.cyclePermission`),ae=Cp(`composer.cycleThinking`),oe=Cp(`composer.stopRun`),se=wp(`composer.stopRun`),ce=l(()=>{if(t.activeConversation)return{kind:`conversation`,id:t.activeConversation.id};if(t.activePendingConversation)return{kind:`pending-conversation`,id:t.activePendingConversation.id}}),le=l(()=>!!(L(ce)&&Cs.isTargetActive(L(ce))&&Cs.recording)),ue=l(()=>!!(L(ce)&&Cs.isTargetActive(L(ce))&&Cs.transcribing)),de=l(()=>!!(L(ce)&&Cs.isBusyForOtherTarget(L(ce)))),fe=l(()=>i().length>0),B=l(()=>a().length>0),V=l(()=>o().length>0),pe=l(()=>L(fe)||L(B)||L(V)),me=l(()=>_r(n())),he=l(()=>OU({interactive:s(),hasProject:!!t.activeProject,hasConversation:!!(t.activeConversation||r()),hasModels:f().length>0,blockedForReview:L(pe),compacting:d(),stopping:u(),sending:c(),commandMode:L(me),voiceSubmitPending:L(k)})),ge=l(()=>L(he).canPrompt),_e=l(()=>!L(he).canEdit),ve=l(()=>!L(he).canSubmit),ye=l(()=>SU.configured),be=l(()=>!!kr()?.files),U=l(()=>Cs.isSupported()),xe=l(()=>!s()||u()||!L(ce)||Cs.pending||!L(le)&&(!L(ge)||!L(U)||L(de))),Se=l(()=>L(le)?`Stop recording${N?` (${N})`:``} — ${ne??`Esc`} to cancel; right-click to cancel (${we(Cs.elapsedMs)} / ${we(Cs.maxDurationMs)})`:L(de)?`Voice recording is active in another conversation`:Cs.retryAttempt>0&&L(ce)&&Cs.isTargetActive(L(ce))?`Retrying transcription ${Cs.retryAttempt}/${Cs.maxRetries}…`:L(ue)?`Transcribing audio…`:L(ye)?N?`Record voice prompt (${N})`:`Record voice prompt`:`Connect ChatGPT to use voice input`),G=l(()=>L(k)?`Transcribing and sending prompt`:L(le)?`Transcribe and send prompt`:d()?`Compacting context`:L(he).canEdit&&f().length===0?`Waiting for an available model`:L(me)?`Run command`:c()?`Queue prompt`:`Send prompt`),Ce=l(()=>L(k)?`Transcribing audio, then sending prompt`:L(le)?`Stop recording, transcribe, and send prompt`:d()?`Compacting context`:L(he).canEdit&&f().length===0?`Models are loading; you can continue drafting`:L(me)?c()?`Wait for the current agent turn before running a command`:`Run command`:c()?`Queue prompt for the next agent turn`:`Send prompt`);function we(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}async function Te(){if(L(he).canSubmit){if(L(le)&&L(ce)){R(k,!0);try{await Cs.stop(L(ce))&&t.onSubmit?.()}finally{R(k,!1)}return}t.onSubmit?.()}}async function Ee(e){return no(e)}async function De(e){try{let n=kr();if(!n?.files||!t.activeProject)throw Error(`Native file paths are unavailable in this window.`);return AU(e,t.activeProject.dir,n.files.getPathForFile)}catch(e){let t=e instanceof Error?e.message:String(e);throw yi.error(`Could not add dropped paths`,{description:t}),e}}let Ae=l(()=>!s()||!(t.activeConversation||r())||u()||d()||L(pe)),je=l(()=>!s()||!(t.activeConversation||r())),J=l(()=>!s()||!(t.activeConversation||r())||f().length===0||d()||u()),Me=l(()=>c()?`Changes apply to the next model request`:void 0);function Ne(){if(!(!s()||L(xe)||d()||u()||!L(ce))){if(!L(le)&&!L(ye)){R(M,!0);return}Cs.toggle(L(ce))}}function Pe(){return!L(le)||!L(ce)?!1:(Cs.cancel(L(ce)),!0)}z(()=>{if(ee===void 0||!s()){ee=v();return}v()!==ee&&(ee=v(),R(O,L(O)+1))}),z(()=>{if(A===void 0||!s()){A=y();return}y()!==A&&(A=y(),Pe()||R(O,L(O)+1))}),z(()=>{if(j===void 0||!s()){j=b();return}b()!==j&&(j=b(),Ne())});function Fe(e){!L(le)||!L(ce)||(e.preventDefault(),Cs.cancel(L(ce)))}var Le=jU(),Re=F(Le);{let e=e=>{var n=_(),r=F(n),i=e=>{DU(e,{get suggestions(){return D()},get disabled(){return c()},get onSend(){return t.onSendSuggestion},get onDraft(){return t.onDraftSuggestion}})};p(r,e=>{D().length>0&&!L(pe)&&!d()&&L(ge)&&e(i)}),q(e,n)},r=e=>{var t=jU(),n=F(t);{let e=l(()=>L(ce)&&Cs.isTargetActive(L(ce))?Cs.retryAttempt:0);HH(n,{get recording(){return L(le)},get transcribing(){return L(ue)},get elapsedMs(){return Cs.elapsedMs},get maxDurationMs(){return Cs.maxDurationMs},get retryAttempt(){return L(e)},get maxRetries(){return Cs.maxRetries},class:`composer-transcription-status`})}var r=Y(n,2);{let e=l(()=>L(le)?`destructive`:`secondary`),t=l(()=>`rounded-full ${L(le)?`inset-ring-1 inset-ring-destructive/28`:``}`),n=l(()=>L(le)?`Stop recording; right-click to cancel`:L(ye)?`Record voice prompt`:`Connect ChatGPT to use voice input`);W(r,{get variant(){return L(e)},size:`icon-sm`,get class(){return L(t)},type:`button`,get disabled(){return L(xe)},onclick:Ne,oncontextmenu:Fe,get"aria-label"(){return L(n)},get"aria-keyshortcuts"(){return te},get title(){return L(Se)},children:(e,t)=>{var n=_(),r=F(n),i=e=>{ke(e,{class:`size-3.5`})},a=e=>{TS(e,{size:14,strokeWidth:2.4})};p(r,e=>{L(ue)?e(i):e(a,-1)}),q(e,n)},$$slots:{default:!0}})}q(e,t)},i=l(()=>({text:n(),disabled:L(_e),editorDisabled:L(_e),submitDisabled:L(ve),sending:c(),stopping:u(),compacting:d(),showStop:c()||u()||d(),pendingApproval:L(fe),pendingQuestion:L(B),pendingPlan:L(V),models:f(),selectedModelKey:m(),thinkingLevel:S(),mode:C(),permissionLevel:w(),approvalPolicy:T(),contextUsage:t.contextUsage,contextWindow:h(),placeholder:L(fe)?`Approval required before the agent can continue`:L(V)?`Review the plan in the transcript before the agent can continue`:L(B)?`Reply in the transcript before the agent can continue`:d()?`Compacting context…`:c()?`Queue a prompt for the next agent turn`:`Ask the local Nerve agent`,focusToken:L(O),controlsDisabled:L(Ae),modeDisabled:L(je),modelDisabled:L(J),runtimeChangeHint:L(Me),sendAriaLabel:L(G),sendTitle:L(Ce),stopAriaLabel:d()?`Stop compaction`:`Stop generation`,stopShortcutAria:se,stopTitle:u()?d()?`Stopping compaction`:`Stopping generation`:d()?oe?`Stop compaction (${oe})`:`Stop compaction`:oe?`Stop generation (${oe})`:`Stop generation`,permissionShortcut:ie,permissionShortcutAria:I,modeShortcut:P,modeShortcutAria:re,thinkingShortcut:ae,todos:g(),slashCompletions:E(),fileCompletions:t.fileCompletions,capabilities:{voice:!0,imagePaste:!0,fileDrop:L(be),completions:!0,suggestions:!0,shortcuts:!0,todos:!0,queueing:!0}})),a=l(()=>({onComposerChange:t.onChange,onSubmit:Te,onAbort:t.onAbort,onCompact:t.onCompact,onModelChange:t.onModelChange,onThinkingLevelChange:t.onThinkingLevelChange,onModeChange:t.onModeChange,onPermissionChange:t.onPermissionChange,onApprovalPolicyChange:t.onApprovalPolicyChange,onPasteImage:Ee,onDropFiles:L(be)?De:void 0}));Wv(Re,{get model(){return L(i)},get actions(){return L(a)},header:e,sendLeading:r,$$slots:{header:!0,sendLeading:!0}})}bU(Y(Re,2),{get open(){return L(M)},set open(e){R(M,e,!0)}}),q(e,Le),H()}var NU=`agent.subagent_transcript.`,PU=`agent.subagent_transcript.run.completed`;function FU(e){return e&&typeof e==`object`?e:void 0}function IU(e,t,n,r){let i=FU(e.data);return!i||r&&(i.conversationId!==r.conversationId||i.projectId!==r.projectId)?!1:e.type.startsWith(NU)?i.parentAgentId===t&&i.childAgentId===n:e.type===`toolCall.updated`&&i.agentId===n}function LU(e){return function(t,n,r){let i=!1,a=!1,o,s=-1,c=[],l,u=!1,d=!1,f=!1,p=e=>{e.seq<=s||(s=e.seq,r.event(e)===!1&&m(),e.type===PU&&!f&&(d=!0,m()))},m=()=>{if(i)return;if(l){u=!0;return}let h=d;l=e.fetch(t,n).then(e=>{if(i)return;if(e.parentAgentId!==t||e.agentId!==n)throw Error(`Subagent transcript ownership mismatch.`);o={conversationId:e.conversationId,projectId:e.projectId},r.snapshot(e);let l=s;if(s=Math.max(s,e.cursorSeq),e.cursorSeq>=l&&(u=!1),!a){a=!0;let r=c.filter(r=>r.seq>e.cursorSeq&&IU(r,t,n,o)).sort((e,t)=>e.seq-t.seq);c=[];for(let e of r)p(e)}h&&(d=!1,f=!0)}).catch(e=>{i||r.error(e instanceof Error?e.message:String(e))}).finally(()=>{l=void 0,u&&!i&&(u=!1,m())})},h=e.subscribe(e=>{if(i||!rU(e))return;let r=e;if(IU(r,t,n,o)){if(!a){c.push(r);return}p(r)}});return m(),()=>{i=!0,c=[],h()}}}var RU=LU({fetch:lo,subscribe:oU});function zU(){return Pi.settingsDraft?.tools?.jira?.siteUrl}function BU(){return Pi.settingsDraft?.tools?.confluence?.siteUrl}function VU(){return{fetchToolCall:e=>po(e),watchSubagentTranscript:RU,atlassian:{jiraSiteUrl:zU,confluenceSiteUrl:BU},voice:{session:Cs,targetKey:es,appendTranscriptText:Zo,chatGptConfigured:()=>SU.configured,micShortcutLabel:Cp(`composer.toggleMic`),micShortcutAria:wp(`composer.toggleMic`),TranscriptionActivity:HH,AudioAuthDialog:bU},askReply:{pasteImage:no,dropFiles:async e=>{let t=kr(),n=Q.projects.find(e=>e.id===un.projectId);if(!t?.files||!n)throw Error(`Native file paths are unavailable in this window.`);return AU(e,n.dir,t.files.getPathForFile)},slashCompletions:()=>Yi.slashCompletions,fileCompletions:bs}}}var HU=new Set([`$$slots`,`$$events`,`$$legacy`]);function UU(e,t){let n=U(t,HU),r=[[`path`,{d:`m5 12 7-7 7 7`}],[`path`,{d:`M12 19V5`}]];G(e,V({name:`arrow-up`},()=>n,{get iconNode(){return r}}))}var WU=new Set([`$$slots`,`$$events`,`$$legacy`]);function GU(e,t){let n=U(t,WU),r=[[`path`,{d:`M12 13v8l-4-4`}],[`path`,{d:`m12 21 4-4`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`}]];G(e,V({name:`cloud-download`},()=>n,{get iconNode(){return r}}))}var KU=new Set([`$$slots`,`$$events`,`$$legacy`]);function qU(e,t){let n=U(t,KU),r=[[`circle`,{cx:`5`,cy:`6`,r:`3`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`}],[`path`,{d:`m15 9-3-3 3-3`}],[`circle`,{cx:`19`,cy:`18`,r:`3`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`}],[`path`,{d:`m9 15 3 3-3 3`}]];G(e,V({name:`git-compare-arrows`},()=>n,{get iconNode(){return r}}))}var JU=new Set([`$$slots`,`$$events`,`$$legacy`]);function YU(e,t){let n=U(t,JU),r=[[`path`,{d:`M12 17V3`}],[`path`,{d:`m6 11 6 6 6-6`}],[`path`,{d:`M19 21H5`}]];G(e,V({name:`arrow-down-to-line`},()=>n,{get iconNode(){return r}}))}var XU=new Set([`$$slots`,`$$events`,`$$legacy`]);function ZU(e,t){let n=U(t,XU),r=[[`path`,{d:`m18 9-6-6-6 6`}],[`path`,{d:`M12 3v14`}],[`path`,{d:`M5 21h14`}]];G(e,V({name:`arrow-up-from-line`},()=>n,{get iconNode(){return r}}))}var QU=[{minCount:9,maxLength:12},{minCount:5,maxLength:16},{minCount:0,maxLength:22}];function $U(e){return e.relativePath===`.`?`project root`:e.relativePath}function eW(e,t){if(e.length<=t)return e;let n=Math.max(4,t-1),r=Math.ceil(n/2),i=Math.floor(n/2);return`${e.slice(0,r)}…${e.slice(-i)}`}function tW(e,t){return eW(t.some(t=>t.relativePath!==e.relativePath&&t.name===e.name)?$U(e):e.name,QU.find(e=>t.length>=e.minCount)?.maxLength??22)}function nW(e){return e.untracked?`text-muted-foreground`:e.index===`A`?`text-success`:e.index===`D`||e.worktree===`D`?`text-destructive`:`text-info`}function rW(e,t){if(e.untracked)return`?`;let n=t===`staged`?e.index:e.worktree;return n===` `?e.index===` `?`M`:e.index:n}function iW(e,t){let n=t===`staged`?e.index:e.worktree;if(e.untracked)return`untracked`;switch(n){case`A`:return`added`;case`D`:return`deleted`;case`R`:return`renamed`;case`M`:return`modified`;case`U`:return`conflict`;default:return t}}function aW(e){switch(e.status){case`passing`:return`good`;case`failing`:return`danger`;case`pending`:return`warn`;default:return`neutral`}}var oW=P(`<span> </span>`),sW=P(`<!> <!>`,1),cW=P(`<p class="py-1 text-xs text-muted-foreground">Loading…</p>`),lW=P(`<p class="py-1 text-xs text-muted-foreground">Working tree clean.</p>`),uW=P(`<div class="flex min-h-0 flex-1 flex-col"><!></div>`);function dW(e,t){x(t,!0);let n=(e,n=N,r=N,i=N,a=N,o=N)=>{var s=sW(),c=F(s);{let e=e=>{var t=_(),n=F(t),r=e=>{Za(e,{class:`-mr-1 size-3`,"aria-hidden":`true`})},i=e=>{si(e,{class:`-mr-1 size-3`,"aria-hidden":`true`})};p(n,e=>{a()?e(r):e(i,-1)}),q(e,t)},s=e=>{var t=oW(),n=B(t,!0);y(t),J(()=>f(n,r().length)),q(e,t)},u=e=>{{let n=l(()=>i()===`staged`?YU:ZU),a=l(()=>i()===`staged`?`Unstage all`:`Stage all`),o=l(()=>t.bulkMutation===(i()===`staged`?`unstage-all`:`stage-all`)),s=l(()=>r().length===0||!t.capabilities.bulkMutateFiles.enabled||!!t.bulkMutation||!!t.fileMutation);Hr(e,{get icon(){return L(n)},get label(){return L(a)},dense:!0,get loading(){return L(o)},get disabled(){return L(s)},onclick:e=>{e.stopPropagation(),t.onBulkStage(t.selectedRepo,i()===`staged`?`unstage-all`:`stage-all`)}})}},d=l(()=>`${a()?`Collapse`:`Expand`} ${n().toLowerCase()} changes`);Wr(c,{get label(){return n()},get title(){return L(d)},dense:!0,flush:!0,hoverable:!1,alwaysShowActions:!0,get ariaExpanded(){return a()},role:`none`,class:`font-medium`,get onclick(){return o()},leading:e,badges:s,actions:u,$$slots:{leading:!0,badges:!0,actions:!0}})}var u=Y(c,2),d=e=>{{let a=(e,t=N)=>{var n=oW(),r=B(n,!0);y(n),J((e,t,i)=>{w(n,1,e),A(n,`title`,t),f(r,i)},[()=>_e(I(`font-mono font-semibold`,nW(t()))),()=>iW(t(),i()),()=>rW(t(),i())]),q(e,n)},o=(e,n=N)=>{let r=l(()=>t.fileMutation?.path===n().path);var a=sW(),o=F(a);{let e=l(()=>i()===`staged`?YU:ZU),a=l(()=>i()===`staged`?`Unstage ${n().path}`:`Stage ${n().path}`),s=l(()=>i()===`staged`?`Unstage`:`Stage`),c=l(()=>L(r)&&t.fileMutation?.action===(i()===`staged`?`unstage`:`stage`)),u=l(()=>!t.capabilities.mutateFiles.enabled||L(r));Hr(o,{get icon(){return L(e)},get label(){return L(a)},get title(){return L(s)},dense:!0,get loading(){return L(c)},get disabled(){return L(u)},onclick:e=>{e.stopPropagation(),t.onMutateFile(t.selectedRepo,n(),i()===`staged`?`unstage`:`stage`)}})}var s=Y(o,2);{let e=l(()=>`Discard ${n().path}`),i=l(()=>L(r)&&t.fileMutation?.action===`discard`),a=l(()=>!t.capabilities.mutateFiles.enabled||L(r));Hr(s,{get icon(){return li},get label(){return L(e)},title:`Discard`,dense:!0,get loading(){return L(i)},get disabled(){return L(a)},onclick:e=>{e.stopPropagation(),t.onRequestDiscard(n())}})}q(e,a)},s=l(()=>qr(r(),{getPath:e=>e.path.split(`/`),getKey:e=>`${i()}:${e.path}`})),c=l(()=>`${n()} file tree`);Xr(e,{get nodes(){return L(s)},get ariaLabel(){return L(c)},baseIndent:0,getItemTitle:e=>`${iW(e,i())} · ${e.renamedFrom?`${e.renamedFrom} → `:``}${e.path}`,onItemActivate:e=>t.onOpenDiff(t.selectedRepo,e,i()),itemLeading:a,itemActions:o,$$slots:{itemLeading:!0,itemActions:!0}})}};p(u,e=>{a()&&e(d)}),q(e,s)},r=X(!0),i=X(!0);var a=uW(),o=B(a),s=e=>{q(e,cW())},c=e=>{q(e,lW())},u=e=>{As(e,{class:`min-h-0 flex-1`,viewportClass:`min-w-0`,children:(e,a)=>{Qr(e,{role:`none`,class:`py-0.5`,children:(e,a)=>{var o=sW(),s=F(o),c=e=>{n(e,()=>`Staged`,()=>t.stagedFiles,()=>`staged`,()=>L(r),()=>()=>R(r,!L(r)))};p(s,e=>{t.stagedFiles.length>0&&e(c)});var l=Y(s,2),u=e=>{n(e,()=>`Unstaged`,()=>t.unstagedFiles,()=>`unstaged`,()=>L(i),()=>()=>R(i,!L(i)))};p(l,e=>{t.unstagedFiles.length>0&&e(u)}),q(e,o)},$$slots:{default:!0}})},$$slots:{default:!0}})};p(o,e=>{t.changes?t.changes.files.length===0?e(c,1):e(u,-1):e(s)}),y(a),q(e,a),H()}var fW=new Set([`$$slots`,`$$events`,`$$legacy`]);function pW(e,t){let n=U(t,fW),r=[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}],[`path`,{d:`M12 9v4`}],[`path`,{d:`M12 17h.01`}]];G(e,V({name:`triangle-alert`},()=>n,{get iconNode(){return r}}))}function mW(e,t){x(t,!0);var n=_(),r=F(n),i=e=>{Lr(e,{tone:`muted`,children:(e,n)=>{g();var r=D();J(()=>f(r,t.model.availability.message)),q(e,r)},$$slots:{default:!0}})},a=e=>{Lr(e,{tone:`destructive`,get icon(){return pW},children:(e,n)=>{g();var r=D();J(()=>f(r,t.model.cachedError)),q(e,r)},$$slots:{default:!0}})},o=e=>{Lr(e,{tone:`warning`,get icon(){return pW},children:(e,n)=>{g();var r=D();J(()=>f(r,`Using cached Git data. Refresh failed: ${t.model.cachedError??``}`)),q(e,r)},$$slots:{default:!0}})},s=e=>{Lr(e,{tone:`muted`,children:(e,t)=>{g(),q(e,D(`Loading Git repositories…`))},$$slots:{default:!0}})},c=e=>{Lr(e,{tone:`muted`,children:(e,n)=>{g();var r=D();J(()=>f(r,t.model.emptyMessage??`No Git repositories found.`)),q(e,r)},$$slots:{default:!0}})};p(r,e=>{t.model.availability.available?t.model.cachedError&&t.model.repositories.length===0?e(a,1):t.model.cachedError?e(o,2):t.model.initialLoading?e(s,3):t.model.repositories.length===0&&e(c,4):e(i)}),q(e,n),H()}var hW=new Set([`$$slots`,`$$events`,`$$legacy`]);function gW(e,t){let n=U(t,hW),r=[[`path`,{d:`M6 3v12`}],[`path`,{d:`M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`}],[`path`,{d:`M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`}],[`path`,{d:`M15 6a9 9 0 0 0-9 9`}],[`path`,{d:`M18 15v6`}],[`path`,{d:`M21 18h-6`}]];G(e,V({name:`git-branch-plus`},()=>n,{get iconNode(){return r}}))}var _W=P(`<!> New branch`,1),vW=P(`<!> <!>`,1),yW=P(`<!> Create`,1),bW=P(`<span class="text-xs text-muted-foreground">You're here</span>`),xW=P(`<!> Switch to base`,1),SW=P(`<div class="flex items-center gap-2 rounded-md border border-info/40 bg-info/10 px-3 py-2"><!> <div class="flex min-w-0 flex-1 flex-col"><span class="text-xs font-medium text-foreground">Base branch</span> <span class="truncate font-mono text-xs text-muted-foreground"> </span></div> <!></div>`),CW=P(`<div class="flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground"><!> Loading branches…</div>`),wW=P(`<div class="px-3 py-2 text-xs text-muted-foreground">No branches found.</div>`),TW=P(`<button type="button" class="flex w-full items-center gap-2 border-b px-2.5 py-1.5 text-left text-xs last:border-b-0 hover:bg-muted/60 disabled:opacity-60"><!> <span class="min-w-0 flex-1 truncate font-mono text-foreground"> </span> <!> <!></button>`),EW=P(`<div class="grid gap-4"><!> <!> <div class="max-h-72 overflow-y-auto rounded-md border"><!></div></div>`),DW=P(`<p class="text-xs text-destructive">Enter a valid branch name (no spaces or special characters).</p>`),OW=P(`<p class="text-xs text-muted-foreground">The new branch is created from the current branch.</p>`),kW=P(`<form class="grid gap-1.5"><!> <!></form>`);function AW(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=K(t,`branchFilter`,15,``),i=K(t,`newBranchName`,15,``),a=X(`switch`),o=l(()=>t.repoSummary.currentBranch??`detached`),s=l(()=>t.repoSummary.baseBranch),c=l(()=>!t.repoSummary.detached&&!!L(s)),u=l(()=>i().trim()),d=l(()=>L(u).length>0&&!/\s/.test(L(u))&&!L(u).startsWith(`-`)&&!L(u).startsWith(`/`)&&!L(u).endsWith(`/`)&&!L(u).includes(`..`)&&!/[\u0000-\u001f~^:?*[\\]/.test(L(u))),m=l(()=>L(u).length>0&&!L(d)),h=l(()=>L(a)===`switch`?`Switch branch`:`Create branch`),v=l(()=>L(a)===`switch`?`Current branch: ${L(o)}`:`Create from: ${L(o)}`);IF(e,{get title(){return L(h)},get description(){return L(v)},size:`sm`,onOpenChange:e=>{e||R(a,`switch`)},get open(){return n()},set open(e){n(e)},footer:e=>{var r=_(),i=F(r),o=e=>{var r=vW(),i=F(r);W(i,{size:`sm`,variant:`ghost`,onclick:()=>n(!1),children:(e,t)=>{g(),q(e,D(`Close`))},$$slots:{default:!0}});var o=Y(i,2);{let e=l(()=>!t.branchesEnabled);W(o,{size:`sm`,get disabled(){return L(e)},onclick:()=>R(a,`create`),children:(e,t)=>{var n=_W();gW(F(n),{}),g(),q(e,n)},$$slots:{default:!0}})}q(e,r)},s=e=>{var n=vW(),r=F(n);W(r,{size:`sm`,variant:`ghost`,onclick:()=>R(a,`switch`),children:(e,t)=>{g(),q(e,D(`Back`))},$$slots:{default:!0}});var i=Y(r,2);{let e=l(()=>!t.branchesEnabled||t.creatingBranch||!L(d));W(i,{size:`sm`,get disabled(){return L(e)},onclick:()=>t.onCreateBranch(t.selectedRepo),children:(e,n)=>{var r=yW(),i=F(r),a=e=>{ke(e,{})},o=e=>{AL(e,{})};p(i,e=>{t.creatingBranch?e(a):e(o,-1)}),g(),q(e,r)},$$slots:{default:!0}})}q(e,n)};p(i,e=>{L(a)===`switch`?e(o):e(s,-1)}),q(e,r)},children:(e,n)=>{var o=_(),u=F(o),h=e=>{var n=EW(),i=B(n),a=e=>{var n=SW(),r=B(n);AL(r,{size:14,class:`shrink-0 text-info`});var i=Y(r,2),a=Y(B(i),2),o=B(a,!0);y(a),y(i);var c=Y(i,2),u=e=>{q(e,bW())},d=e=>{{let n=l(()=>!t.branchesEnabled||t.switchingBranch===t.baseBranchSummary.name);W(e,{size:`xs`,get disabled(){return L(n)},onclick:()=>t.onSwitchBranch(t.selectedRepo,t.baseBranchSummary),children:(e,n)=>{var r=xW(),i=F(r),a=e=>{ke(e,{class:`size-3`})},o=e=>{AL(e,{})};p(i,e=>{t.switchingBranch===t.baseBranchSummary.name?e(a):e(o,-1)}),g(),q(e,r)},$$slots:{default:!0}})}};p(c,e=>{t.repoSummary.onBaseBranch?e(u):t.baseBranchSummary&&e(d,1)}),y(n),J(()=>f(o,L(s))),q(e,n)};p(i,e=>{L(c)&&e(a)});var o=Y(i,2);q_(o,{placeholder:`Filter branches`,ariaLabel:`Filter branches`,get value(){return r()},set value(e){r(e)}});var u=Y(o,2),d=B(u),m=e=>{var t=CW();ke(B(t),{class:`size-3.5`}),g(),y(t),q(e,t)},h=e=>{q(e,wW())},v=e=>{var n=_();O(F(n),17,()=>t.filteredBranches,e=>e.name,(e,n)=>{var r=TW(),i=B(r),a=e=>{ke(e,{class:`text-muted-foreground size-3.5`})},o=e=>{oi(e,{size:13,class:`text-success`})},c=e=>{AL(e,{size:13,class:`text-muted-foreground`})};p(i,e=>{t.switchingBranch===L(n).name?e(a):L(n).current?e(o,1):e(c,-1)});var l=Y(i,2),u=B(l,!0);y(l);var d=Y(l,2),m=e=>{nP(e,{tone:`running`,size:`xs`,children:(e,t)=>{g(),q(e,D(`base`))},$$slots:{default:!0}})};p(d,e=>{L(n).name===L(s)&&e(m)});var h=Y(d,2),_=e=>{nP(e,{tone:`neutral`,size:`xs`,children:(e,t)=>{g(),q(e,D(`remote`))},$$slots:{default:!0}})};p(h,e=>{L(n).remote&&e(_)}),y(r),J(()=>{r.disabled=L(n).current||t.switchingBranch===L(n).name,f(u,L(n).name)}),le(`click`,r,()=>t.onSwitchBranch(t.selectedRepo,L(n))),q(e,r)}),q(e,n)};p(d,e=>{t.loadingBranches?e(m):t.filteredBranches.length===0?e(h,1):e(v,-1)}),y(u),y(n),q(e,n)},v=e=>{var n=kW(),r=B(n);G_(r,{placeholder:`feature/branch-name`,autofocus:!0,class:`h-9 font-mono text-sm`,"aria-label":`New branch name`,get"aria-invalid"(){return L(m)},get value(){return i()},set value(e){i(e)}});var a=Y(r,2),o=e=>{q(e,DW())},s=e=>{q(e,OW())};p(a,e=>{L(m)?e(o):e(s,-1)}),y(n),Ae(`submit`,n,e=>{e.preventDefault(),L(d)&&!t.creatingBranch&&t.onCreateBranch(t.selectedRepo)}),q(e,n)};p(u,e=>{L(a)===`switch`?e(h):e(v,-1)}),q(e,o)},$$slots:{footer:!0,default:!0}}),H()}r([`click`]);var jW=P(`<span class="block truncate font-mono"> </span>`);function MW(e,t){x(t,!0);var n=_(),r=F(n),i=e=>{ii(e,{type:`single`,get value(){return t.selectedRepo},variant:`outline`,size:`sm`,spacing:1,class:`flex w-full flex-wrap items-start gap-1`,onValueChange:e=>{e&&t.onSelectRepo(e)},children:(e,n)=>{var r=_();O(F(r),17,()=>t.repos,e=>e.relativePath,(e,n)=>{{let r=l(()=>!t.selectCapability.enabled),i=l(()=>`Switch to ${$U(L(n))}`),a=l(()=>$U(L(n)));ai(e,{get value(){return L(n).relativePath},get disabled(){return L(r)},get"aria-label"(){return L(i)},get title(){return L(a)},class:`h-6 max-w-28 min-w-0 rounded-md px-2 text-xs data-[state=on]:border-primary/40 data-[state=on]:bg-primary/10 data-[state=on]:text-primary`,children:(e,r)=>{var i=jW(),a=B(i,!0);y(i),J(e=>f(a,e),[()=>tW(L(n),t.repos)]),q(e,i)},$$slots:{default:!0}})}}),q(e,r)},$$slots:{default:!0}})};p(r,e=>{t.repos.length>1&&e(i)}),q(e,n),H()}var NW=P(`<p class="text-xs text-muted-foreground">Remote actions are unavailable for local-only repositories.</p>`),PW=P(`<!> <button type="button"><!> <span class="truncate font-mono"> </span> <!></button> <!> <!>`,1),FW=P(`<p class="text-xs text-muted-foreground">Loading…</p>`),IW=P(`<div class="flex shrink-0 flex-col gap-1.5 pt-1.5"><!></div>`);function LW(e,t){x(t,!0);let n=K(t,`branchFilter`,15,``),r=K(t,`newBranchName`,15,``),i=K(t,`branchDialogOpen`,15,!1);var a=IW(),o=B(a),s=e=>{let a=l(()=>t.repoSummary);var o=PW(),s=F(o);MW(s,{get repos(){return t.repos},get selectedRepo(){return t.selectedRepo},get selectCapability(){return t.capabilities.selectRepository},get onSelectRepo(){return t.onSelectRepo}});var c=Y(s,2),u=B(c);AL(u,{class:`size-3 shrink-0`,"aria-hidden":`true`});var d=Y(u,2),m=B(d,!0);y(d),Za(Y(d,2),{class:`size-3 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),y(c);var h=Y(c,2),g=e=>{q(e,NW())};p(h,e=>{L(a).hasRemote||e(g)}),AW(Y(h,2),{get repoSummary(){return L(a)},get selectedRepo(){return t.selectedRepo},get filteredBranches(){return t.filteredBranches},get baseBranchSummary(){return t.baseBranchSummary},get loadingBranches(){return t.loadingBranches},get switchingBranch(){return t.switchingBranch},get creatingBranch(){return t.creatingBranch},get branchesEnabled(){return t.capabilities.branches.enabled},get onSwitchBranch(){return t.onSwitchBranch},get onCreateBranch(){return t.onCreateBranch},get open(){return i()},set open(e){i(e)},get branchFilter(){return n()},set branchFilter(e){n(e)},get newBranchName(){return r()},set newBranchName(e){r(e)}}),J(e=>{c.disabled=!t.capabilities.branches.enabled,A(c,`title`,t.capabilities.branches.enabled?`Switch or create a branch`:t.capabilities.branches.reason),w(c,1,e),f(m,L(a).currentBranch??`(detached)`)},[()=>_e(I(`inline-flex max-w-full min-w-0 items-center gap-1.5 self-start rounded-md border bg-background px-2 py-0.5 text-xs font-medium text-foreground transition-colors hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50`,L(a).detached&&`text-muted-foreground`))]),le(`click`,c,function(...e){t.onOpenBranchDialog?.apply(this,e)}),q(e,o)},c=e=>{q(e,FW())};p(o,e=>{t.repoSummary?e(s):e(c,-1)}),y(a),q(e,a),H()}r([`click`]);function RW(e){return{staged:e.filter(e=>e.staged),unstaged:e.filter(e=>e.untracked||e.worktree!==` `)}}function zW(e,t,n){let r=t.trim().toLocaleLowerCase();return e.filter(e=>e.name.toLocaleLowerCase().includes(r)).sort((e,t)=>{if(e.current!==t.current)return e.current?-1:1;let r=n!==void 0&&e.name===n;return r===(n!==void 0&&t.name===n)?e.name.localeCompare(t.name):r?-1:1})}var BW={author:`any`,username:``,drafts:`include`,title:``,currentBranchOnly:!1,labels:[],sort:`updated-desc`};function VW(e){let t=[...new Set(e.labels.map(e=>e.trim()))].filter(Boolean).slice(0,20);return{author:e.author,username:e.username.trim(),drafts:e.drafts,title:e.title.trim(),currentBranchOnly:e.currentBranchOnly,labels:t,sort:e.sort}}function HW(e){let t=VW(e);return{...t,labels:t.labels.join(`, `)}}function UW(e,t){return VW({...e,currentBranchOnly:t&&e.currentBranchOnly,labels:e.labels.split(`,`)})}function WW(e,t){let n=VW(e),r=VW(t);return n.author===r.author&&n.username===r.username&&n.drafts===r.drafts&&n.title===r.title&&n.currentBranchOnly===r.currentBranchOnly&&n.sort===r.sort&&n.labels.length===r.labels.length&&n.labels.every((e,t)=>e===r.labels[t])}function GW(e){let t=VW(e);return Number(t.author!==BW.author)+Number(t.drafts!==BW.drafts)+Number(t.title.length>0)+Number(t.currentBranchOnly)+t.labels.length+Number(t.sort!==BW.sort)}function KW(e){let t=VW(e);return t.author!==BW.author||t.drafts!==BW.drafts||t.title!==BW.title||t.currentBranchOnly||t.labels.length>0||t.sort!==BW.sort}function qW(e){return e.slice(0,10)}function JW(e,t){let n=()=>e().availability.available,r=t=>n()&&e().capabilities.remote[t].enabled;return{refreshAll:()=>{if(n()&&e().capabilities.refresh.enabled)return t.refreshAll()},refreshRepository:r=>{if(n()&&e().capabilities.refresh.enabled)return t.refreshRepository(r)},refreshBranches:r=>{if(n()&&e().capabilities.refresh.enabled)return t.refreshBranches(r)},refreshPullRequests:r=>{if(n()&&e().capabilities.refresh.enabled)return t.refreshPullRequests(r)},configurePullRequests:(r,i)=>{if(n()&&e().capabilities.refresh.enabled)return t.configurePullRequests(r,i)},resetPullRequestConfig:r=>{if(n()&&e().capabilities.refresh.enabled)return t.resetPullRequestConfig(r)},selectRepository:r=>{if(n()&&e().capabilities.selectRepository.enabled)return t.selectRepository(r)},createBranch:(r,i)=>n()&&e().capabilities.branches.enabled?t.createBranch(r,i):!1,switchBranch:(r,i)=>n()&&e().capabilities.branches.enabled?t.switchBranch(r,i):!1,openDiff:(e,r,i)=>{if(n())return t.openDiff(e,r,i)},mutateFile:(r,i,a)=>{if(n()&&e().capabilities.mutateFiles.enabled)return t.mutateFile(r,i,a)},bulkMutateFiles:(r,i)=>{if(n()&&e().capabilities.bulkMutateFiles.enabled)return t.bulkMutateFiles(r,i)},runRemoteOperation:(e,n)=>{if(r(n))return t.runRemoteOperation(e,n)},selectPullRequest:e=>{if(n())return t.selectPullRequest(e)},openPullRequest:(r,i)=>{if(n()&&e().capabilities.openPullRequest.enabled)return t.openPullRequest(r,i)}}}function YW(e,t){return t||!e.hasRemote}function XW(e,t){return YW(e,t)||e.detached||!e.hasUpstream||e.dirty}function ZW(e,t){return YW(e,t)||e.detached||(e.ahead??0)<=0}function QW(e,t){return YW(e,t)||e.detached}function $W(e,t){return YW(e,t)||e.dirty}function eG(e){return e.hasUpstream&&!e.detached&&(e.behind??0)>0}function tG(e){return!e.detached&&(e.ahead??0)>0}var nG=P(`<!> <!> <!> <!> <!>`,1),rG=P(`<!> <!> <!> <!>`,1),iG=P(`<!> <!>`,1);function aG(e,t){x(t,!0);let n=X(!1),r=X(``),i=X(``),a=X(void 0),o=l(()=>RW(t.model.changes?.files??[])),s=l(()=>t.model.changes?.files.length??0),c=l(()=>zW(t.model.branches,L(r),t.model.repositorySummary?.baseBranch)),u=l(()=>t.model.branches.find(e=>e.name===t.model.repositorySummary?.baseBranch)),d=l(()=>t.model.operations.fetching||t.model.operations.pulling||t.model.operations.pushing||t.model.operations.syncing||t.model.operations.switchingBaseAndPulling);function f(){R(r,``),R(i,``)}function m(e){e!==t.model.selectedRepository&&(f(),t.actions.selectRepository(e))}async function h(e,r){await t.actions.switchBranch(e,r)!==!1&&(R(n,!1),f())}async function g(e){let r=L(i).trim();r&&await t.actions.createBranch(e,r)!==!1&&(R(n,!1),f())}function v(){R(n,!0),f(),t.actions.refreshBranches(t.model.selectedRepository)}var y=iG(),b=F(y);ti(b,{padded:!1,scroll:!1,banner:e=>{mW(e,{get model(){return t.model}})},children:(e,f)=>{var y=_(),b=F(y),x=e=>{var f=rG(),_=F(f);Yr(_,{title:`Git changes`,get count(){return L(s)},trailing:e=>{{let n=l(()=>!t.model.capabilities.refresh.enabled||t.model.refreshing);Hr(e,{get icon(){return Wl},label:`Refresh Git changes`,get loading(){return t.model.refreshing},get disabled(){return L(n)},onclick:()=>void t.actions.refreshRepository(t.model.selectedRepository)})}},$$slots:{trailing:!0}});var y=Y(_,2);{let e=l(()=>[...t.model.repositories]);LW(y,{get repoSummary(){return t.model.repositorySummary},get repos(){return L(e)},get selectedRepo(){return t.model.selectedRepository},get filteredBranches(){return L(c)},get loadingBranches(){return t.model.loadingBranches},get switchingBranch(){return t.model.operations.switchingBranch},get creatingBranch(){return t.model.operations.creatingBranch},get capabilities(){return t.model.capabilities},get baseBranchSummary(){return L(u)},onSelectRepo:m,onOpenBranchDialog:v,onSwitchBranch:(e,t)=>void h(e,t),onCreateBranch:e=>void g(e),get branchFilter(){return L(r)},set branchFilter(e){R(r,e,!0)},get newBranchName(){return L(i)},set newBranchName(e){R(i,e,!0)},get branchDialogOpen(){return L(n)},set branchDialogOpen(e){R(n,e,!0)}})}var b=Y(y,2),x=e=>{let n=l(()=>t.model.repositorySummary);Zr(e,{dense:!0,class:`h-auto flex-wrap border-b-0 bg-transparent py-1.5`,children:(e,r)=>{var i=nG(),a=F(i);{let e=l(()=>L(n).hasRemote?`Fetch from remote and prune deleted refs`:`Add a remote before fetching`),r=l(()=>!t.model.capabilities.remote.fetch.enabled||YW(L(n),L(d)));Hr(a,{get icon(){return GU},label:`Fetch`,variant:`outline`,showLabel:!0,get title(){return L(e)},get loading(){return t.model.operations.fetching},get disabled(){return L(r)},onclick:()=>void t.actions.runRemoteOperation(t.model.selectedRepository,`fetch`)})}var o=Y(a,2),s=e=>{{let r=l(()=>`Pull${(L(n).behind??0)>0?` (${L(n).behind})`:``}`),i=l(()=>L(n).dirty?`Commit or stash changes before pulling`:`Pull current branch with fast-forward only`),a=l(()=>!t.model.capabilities.remote.pull.enabled||XW(L(n),L(d)));Hr(e,{get icon(){return nt},get label(){return L(r)},variant:`outline`,showLabel:!0,get title(){return L(i)},get loading(){return t.model.operations.pulling},get disabled(){return L(a)},onclick:()=>void t.actions.runRemoteOperation(t.model.selectedRepository,`pull`)})}},c=l(()=>eG(L(n)));p(o,e=>{L(c)&&e(s)});var u=Y(o,2),f=e=>{{let r=l(()=>`Push${(L(n).ahead??0)>0?` (${L(n).ahead})`:``}`),i=l(()=>!t.model.capabilities.remote.push.enabled||ZW(L(n),L(d)));Hr(e,{get icon(){return UU},get label(){return L(r)},variant:`outline`,showLabel:!0,title:`Push current branch`,get loading(){return t.model.operations.pushing},get disabled(){return L(i)},onclick:()=>void t.actions.runRemoteOperation(t.model.selectedRepository,`push`)})}},m=l(()=>tG(L(n)));p(u,e=>{L(m)&&e(f)});var h=Y(u,2);{let e=l(()=>L(n).hasRemote?L(n).detached?`Check out a branch before syncing`:`Fetch, then pull and push the current branch when needed`:`Add a remote before syncing`),r=l(()=>!t.model.capabilities.remote.sync.enabled||QW(L(n),L(d)));Hr(h,{get icon(){return Wl},label:`Sync`,variant:`outline`,showLabel:!0,get title(){return L(e)},get loading(){return t.model.operations.syncing},get disabled(){return L(r)},onclick:()=>void t.actions.runRemoteOperation(t.model.selectedRepository,`sync`)})}var g=Y(h,2),_=e=>{{let r=l(()=>`${L(n).baseBranch} + pull`),i=l(()=>L(n).dirty?`Commit or stash changes before switching branches`:`Switch to ${L(n).baseBranch} and pull with fast-forward only`),a=l(()=>!t.model.capabilities.remote[`switch-base-and-pull`].enabled||$W(L(n),L(d)));Hr(e,{get icon(){return qU},get label(){return L(r)},variant:`outline`,showLabel:!0,get title(){return L(i)},get loading(){return t.model.operations.switchingBaseAndPulling},get disabled(){return L(a)},onclick:()=>void t.actions.runRemoteOperation(t.model.selectedRepository,`switch-base-and-pull`)})}};p(g,e=>{!L(n).detached&&!L(n).onBaseBranch&&e(_)}),q(e,i)},$$slots:{default:!0}})};p(b,e=>{t.model.repositorySummary&&e(x)}),dW(Y(b,2),{get changes(){return t.model.changes},get stagedFiles(){return L(o).staged},get unstagedFiles(){return L(o).unstaged},get fileMutation(){return t.model.operations.fileMutation},get bulkMutation(){return t.model.operations.bulkMutation},get selectedRepo(){return t.model.selectedRepository},get capabilities(){return t.model.capabilities},onOpenDiff:(e,n,r)=>void t.actions.openDiff(e,n,r),onMutateFile:(e,n,r)=>void t.actions.mutateFile(e,n,r),onBulkStage:(e,n)=>void t.actions.bulkMutateFiles(e,n),onRequestDiscard:e=>R(a,{repository:t.model.selectedRepository,file:e},!0)}),q(e,f)};p(b,e=>{t.model.availability.available&&t.model.repositories.length>0&&e(x)}),q(e,y)},$$slots:{banner:!0,default:!0}});var S=Y(b,2);{let e=l(()=>!!L(a)),n=l(()=>L(a)?`This will permanently discard all uncommitted changes for ${L(a).file.path}.`:`This will permanently discard this uncommitted change.`);Tr(S,{get open(){return L(e)},title:`Discard change?`,get description(){return L(n)},confirmLabel:`Discard`,destructive:!0,onConfirm:()=>{let e=L(a);R(a,void 0),e&&t.actions.mutateFile(e.repository,e.file,`discard`)},onCancel:()=>R(a,void 0),onOpenChange:e=>{e||R(a,void 0)}})}q(e,y),H()}var oG={enabled:!0};function sG(e){return{enabled:!1,reason:e}}var cG=new Set([`$$slots`,`$$events`,`$$legacy`]);function lG(e,t){let n=U(t,cG),r=[[`path`,{d:`M13 5h8`}],[`path`,{d:`M13 12h8`}],[`path`,{d:`M13 19h8`}],[`path`,{d:`m3 17 2 2 4-4`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`}]];G(e,V({name:`list-todo`},()=>n,{get iconNode(){return r}}))}var uG=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function dG(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=U(t,uG);var i=_(),a=F(i);{let e=l(()=>I(`gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed`,t.class));d(a,()=>Rc,(t,i)=>{i(t,V({"data-slot":`label`,get class(){return L(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}q(e,i),H()}var fG=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`,`data-slot`]),pG=P(`<textarea></textarea>`);function mG(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=K(t,`value`,15),i=K(t,`data-slot`,3,`textarea`),a=U(t,fG);var o=pG();we(o),c(o,e=>({"data-slot":i(),class:e,...a}),[()=>I(`border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] focus-visible:ring-3 aria-invalid:ring-3 md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50`,t.class)]),ie(o,e=>n(e),()=>n()),ae(o,r),q(e,o),H()}var hG=P(`<!> <!>`,1),gG=P(`<div class="grid gap-4"><div class="grid gap-1.5"><!> <!></div> <div class="grid gap-1.5"><!> <!> <p class="text-xs text-muted-foreground">This is the shell command run by the play button.</p></div> <div class="grid gap-1.5"><!> <!> <p class="text-xs text-muted-foreground">Single run focuses an existing process. Concurrent runs may start
125
- another process.</p></div> <div class="grid gap-1.5"><!> <!> <p class="text-xs text-muted-foreground">Leave blank to use the default working directory.</p></div></div>`);function _G(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=K(t,`saving`,3,!1),i=X(``),a=X(``),o=X(``),s=X(`single`),c=l(()=>t.title??(t.definition?`Edit task`:`Create task`)),u=l(()=>t.description??(t.definition?`Update this task definition and its launch policy. Existing runs keep their original command.`:`Create a reusable task definition for this workspace.`)),d=l(()=>t.submitLabel??(t.definition?`Save task`:`Create task`)),p=l(()=>!r()&&L(a).trim().length>0);z(()=>{if(!n())return;let e=t.definition??t.initial;R(i,e?.label??``,!0),R(a,e?.command??``,!0),R(o,e?.cwd??``,!0),R(s,t.definition?.runPolicy??`single`,!0)});function m(){if(!L(p))return;let e=L(i).trim(),n=L(o).trim();t.onSave?.({command:L(a).trim(),...e.length>0?{label:e}:{},...n.length>0?{cwd:n}:{},runPolicy:L(s)})}IF(e,{get title(){return L(c)},get description(){return L(u)},class:`max-w-xl`,get onOpenChange(){return t.onOpenChange},get open(){return n()},set open(e){n(e)},footer:e=>{var t=hG(),i=F(t);W(i,{size:`sm`,variant:`ghost`,onclick:()=>n(!1),get disabled(){return r()},children:(e,t)=>{g(),q(e,D(`Cancel`))},$$slots:{default:!0}});var a=Y(i,2);{let e=l(()=>!L(p));W(a,{size:`sm`,onclick:m,get disabled(){return L(e)},children:(e,t)=>{g();var n=D();J(()=>f(n,r()?`Saving…`:L(d))),q(e,n)},$$slots:{default:!0}})}q(e,t)},children:(e,n)=>{var c=gG(),u=B(c),d=B(u);dG(d,{for:`task-definition-label`,children:(e,t)=>{g(),q(e,D(`Label`))},$$slots:{default:!0}}),G_(Y(d,2),{id:`task-definition-label`,placeholder:`web-dev`,get disabled(){return r()},get value(){return L(i)},set value(e){R(i,e,!0)}}),y(u);var f=Y(u,2),p=B(f);dG(p,{for:`task-definition-command`,children:(e,t)=>{g(),q(e,D(`Command`))},$$slots:{default:!0}}),mG(Y(p,2),{id:`task-definition-command`,rows:4,placeholder:`pnpm dev`,class:`font-mono text-xs`,get disabled(){return r()},get value(){return L(a)},set value(e){R(a,e,!0)}}),g(2),y(f);var m=Y(f,2),h=B(m);dG(h,{for:`task-run-policy`,children:(e,t)=>{g(),q(e,D(`Run policy`))},$$slots:{default:!0}}),Ve(Y(h,2),{ariaLabel:`Task run policy`,items:[{value:`single`,label:`Single run`},{value:`concurrent`,label:`Concurrent runs`}],get disabled(){return r()},get value(){return L(s)},set value(e){R(s,e,!0)}}),g(2),y(m);var _=Y(m,2),v=B(_);dG(v,{for:`task-definition-cwd`,children:(e,t)=>{g(),q(e,D(`Working directory`))},$$slots:{default:!0}});var b=Y(v,2);{let e=l(()=>t.projectCwd?`Default: ${t.projectCwd}`:`Default working directory`);G_(b,{id:`task-definition-cwd`,get placeholder(){return L(e)},class:`font-mono text-xs`,get disabled(){return r()},get value(){return L(o)},set value(e){R(o,e,!0)}})}g(2),y(_),y(c),q(e,c)},$$slots:{footer:!0,default:!0}}),H()}var vG=new Set([`$$slots`,`$$events`,`$$legacy`]);function yG(e,t){let n=U(t,vG),r=[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}],[`path`,{d:`M3 3v5h5`}],[`path`,{d:`M12 7v5l4 2`}]];G(e,V({name:`history`},()=>n,{get iconNode(){return r}}))}var bG=new Set([`$$slots`,`$$events`,`$$legacy`]);function xG(e,t){let n=U(t,bG),r=[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`}]];G(e,V({name:`play`},()=>n,{get iconNode(){return r}}))}var SG=P(`<!> `,1),CG=P(`<!> <!>`,1);function wG(e,t){x(t,!0);let n=l(()=>t.entry.latestRun),r=l(()=>L(n)?.status??`saved`),i=l(()=>tee(t.entry)),a=l(()=>t.entry.definition.command),o=l(()=>t.entry.definition.cwd),s=l(()=>t.entry.definition.runPolicy===`concurrent`),c=l(()=>L(s)||t.entry.activeRuns.length===0),u=l(()=>t.entry.activeRuns[0]),d=l(()=>t.entry.runs.filter(e=>e.isRemovable&&e.run.id!==L(n)?.id)),m=l(()=>t.entry.needsRecovery?L(n)?.status===`recovered`?`Process recovered; live output disconnected.`:`Process identity needs recovery review.`:void 0),h=l(()=>[L(a),L(o),L(m)].filter(Boolean).join(`
126
- `)),v=l(()=>L(s)&&L(u)?`Start another run`:`Run task`),y=l(()=>{let e=[];L(n)&&e.push({label:`Open logs`,icon:Ue,disabled:!t.capabilities.logs,onSelect:()=>t.onOpen?.(L(n).id)}),L(d).length>0&&e.push({label:`Clean up old runs`,icon:Ya,destructive:!0,disabled:!t.capabilities.remove,onSelect:()=>t.onCleanupRuns?.(L(d).map(e=>e.run.id))}),L(c)&&e.push({label:L(v),icon:xG,disabled:!t.capabilities.start,onSelect:()=>t.onRun?.()}),L(u)&&(e.push({label:`Restart`,icon:Ge,disabled:!t.capabilities.restart,onSelect:()=>t.onRestart?.(L(u).id)}),L(u).status!==`stopping`&&e.push({label:`Stop`,icon:it,disabled:!t.capabilities.cancel,onSelect:()=>t.onCancel?.(L(u).id)}),(L(u).status===`recovered`||L(u).status===`stopping`)&&e.push({label:`Force kill`,icon:tt,destructive:!0,disabled:!t.capabilities.cancel,onSelect:()=>t.onForceKill?.(L(u).id)})),e.length>0&&e.push({type:`separator`}),e.push({label:`Edit task`,icon:gy,disabled:!t.capabilities.manageDefinitions,onSelect:()=>t.onEdit?.()}),e.push({label:`Delete task`,icon:Ya,destructive:!0,disabled:!t.capabilities.manageDefinitions,onSelect:()=>t.onDelete?.()});let r=[];return L(a)&&r.push({label:`Copy command`,icon:af,disabled:!t.capabilities.copy,onSelect:()=>t.onCopy?.(L(a))}),L(o)&&r.push({label:`Copy working directory`,icon:ri,disabled:!t.capabilities.copy,onSelect:()=>t.onCopy?.(L(o))}),r.length>0&&e.push({type:`separator`},...r),e});{let a=e=>{Ze(e,{get status(){return L(r)}})},o=e=>{var n=CG(),r=F(n),i=e=>{nP(e,{tone:`accent`,size:`xs`,children:(e,n)=>{g();var r=D();J(()=>f(r,`${t.entry.activeRuns.length??``} running`)),q(e,r)},$$slots:{default:!0}})};p(r,e=>{t.entry.activeRuns.length>1&&e(i)});var a=Y(r,2),o=e=>{nP(e,{tone:`neutral`,size:`xs`,children:(e,n)=>{var r=SG(),i=F(r);yG(i,{class:`mr-1 size-3`});var a=Y(i,1,!0);J(()=>f(a,t.entry.runs.length)),q(e,r)},$$slots:{default:!0}})};p(a,e=>{t.entry.runs.length>1&&e(o)}),q(e,n)},s=e=>{var n=_(),r=F(n),i=e=>{{let n=l(()=>!t.capabilities.cancel);Hr(e,{get icon(){return tt},label:`Force kill task`,dense:!0,get disabled(){return L(n)},onclick:()=>t.onForceKill?.(L(u).id)})}},a=e=>{var n=CG(),r=F(n);{let e=l(()=>!t.capabilities.restart);Hr(r,{get icon(){return Ge},label:`Restart task`,dense:!0,get disabled(){return L(e)},onclick:()=>t.onRestart?.(L(u).id)})}var i=Y(r,2);{let e=l(()=>!t.capabilities.cancel);Hr(i,{get icon(){return it},label:`Stop task`,dense:!0,get disabled(){return L(e)},onclick:()=>t.onCancel?.(L(u).id)})}q(e,n)},o=e=>{{let n=l(()=>!t.capabilities.start);Hr(e,{get icon(){return xG},get label(){return L(v)},dense:!0,get disabled(){return L(n)},onclick:()=>t.onRun?.()})}};p(r,e=>{L(u)?.status===`stopping`?e(i):L(u)?e(a,1):L(c)&&e(o,2)}),q(e,n)},d=l(()=>L(i).isCommand?`muted`:`default`),m=l(()=>!L(n));Wr(e,{get label(){return L(i).text},get title(){return L(h)},get mono(){return L(i).isCommand},get tone(){return L(d)},get disabled(){return L(m)},indent:0,alwaysShowActions:!0,get menuItems(){return L(y)},onclick:()=>L(n)&&t.onOpen?.(L(n).id),leading:a,badges:o,actions:s,$$slots:{leading:!0,badges:!0,actions:!0}})}H()}var TG=new Set([`$$slots`,`$$events`,`$$legacy`]);function EG(e,t){let n=U(t,TG),r=[[`path`,{d:`M12 7v6`}],[`path`,{d:`M15 10H9`}],[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`}]];G(e,V({name:`bookmark-plus`},()=>n,{get iconNode(){return r}}))}var DG=P(`<!> <!>`,1);function OG(e,t){x(t,!0);let n=K(t,`nested`,3,!1),r=l(()=>t.entry.run),i=l(()=>We(t.entry)),a=l(()=>eee(L(r).startedAt)),o=l(()=>t.entry.needsRecovery?L(r).status===`recovered`?`Process recovered; live output disconnected.`:`Process identity needs recovery review.`:void 0),s=l(()=>[L(r).command,L(r).cwd,L(o)].filter(Boolean).join(`
127
- `)),c=l(()=>{let e=[{label:`Open logs`,icon:Ue,disabled:!t.capabilities.logs,onSelect:()=>t.onOpen?.(L(r).id)},{label:`Restart`,icon:Ge,disabled:!t.capabilities.restart,onSelect:()=>t.onRestart?.(L(r).id)}];t.entry.definition&&t.entry.isRemovable&&e.push({label:`Run saved task again`,icon:Ge,disabled:!t.capabilities.start,onSelect:()=>t.onRerunDefinition?.()}),t.entry.isActive&&L(r).status!==`stopping`&&e.push({label:`Stop`,icon:it,disabled:!t.capabilities.cancel,onSelect:()=>t.onCancel?.(L(r).id)}),t.entry.canForceKill&&e.push({label:`Force kill`,icon:tt,destructive:!0,disabled:!t.capabilities.cancel,onSelect:()=>t.onForceKill?.(L(r).id)}),t.entry.definition||e.push({type:`separator`},{label:`Save as task definition`,icon:EG,disabled:!t.capabilities.manageDefinitions,onSelect:()=>t.onSaveAsDefinition?.(L(r))});let n=[{label:`Copy command`,icon:af,disabled:!t.capabilities.copy,onSelect:()=>t.onCopy?.(L(r).command)},{label:`Copy working directory`,icon:ri,disabled:!t.capabilities.copy,onSelect:()=>t.onCopy?.(L(r).cwd)}];return t.entry.isRemovable&&n.push({label:`Remove run`,icon:li,destructive:!0,disabled:!t.capabilities.remove,onSelect:()=>t.onRemove?.(L(r).id)}),e.push({type:`separator`},...n),e});{let o=e=>{Ze(e,{get status(){return L(r).status}})},u=e=>{var n=_(),a=F(n),o=e=>{{let n=l(()=>`Force kill ${L(i).text}`),a=l(()=>!t.capabilities.cancel);Hr(e,{get icon(){return tt},get label(){return L(n)},dense:!0,get disabled(){return L(a)},onclick:()=>t.onForceKill?.(L(r).id)})}},s=e=>{var n=DG(),a=F(n);{let e=l(()=>`Restart ${L(i).text}`),n=l(()=>!t.capabilities.restart);Hr(a,{get icon(){return Ge},get label(){return L(e)},dense:!0,get disabled(){return L(n)},onclick:()=>t.onRestart?.(L(r).id)})}var o=Y(a,2);{let e=l(()=>`Stop ${L(i).text}`),n=l(()=>!t.capabilities.cancel);Hr(o,{get icon(){return it},get label(){return L(e)},dense:!0,get disabled(){return L(n)},onclick:()=>t.onCancel?.(L(r).id)})}q(e,n)},c=e=>{{let n=l(()=>`Restart ${L(i).text}`),a=l(()=>!t.capabilities.restart);Hr(e,{get icon(){return Ge},get label(){return L(n)},dense:!0,get disabled(){return L(a)},onclick:()=>t.onRestart?.(L(r).id)})}};p(a,e=>{L(r).status===`stopping`?e(o):t.entry.isActive?e(s,1):e(c,-1)}),q(e,n)},d=l(()=>n()?L(a):L(i).text),f=l(()=>n()?void 0:L(a)),m=l(()=>!n()&&L(i).isCommand),h=l(()=>n()||L(i).isCommand?`muted`:`default`),g=l(()=>+!!n());Wr(e,{get label(){return L(d)},get description(){return L(f)},get title(){return L(s)},get mono(){return L(m)},get tone(){return L(h)},get indent(){return L(g)},alwaysShowActions:!0,get menuItems(){return L(c)},onclick:()=>t.onOpen?.(L(r).id),leading:o,actions:u,$$slots:{leading:!0,actions:!0}})}H()}var kG=P(`<p class="p-2 text-xs text-muted-foreground">No runs match.</p>`),AG=P(`<div class="flex min-h-0 flex-col"><div class="flex shrink-0 items-center border-b border-border/60 p-2"><!></div> <div class="min-h-0 flex-1 p-1"><!></div></div>`);function jG(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=X(``),i=l(()=>{let e=L(r).trim().toLowerCase();return e.length===0?t.runs:t.runs.filter(t=>`${We(t).text} ${t.run.command}`.toLowerCase().includes(e))});z(()=>{n()&&R(r,``)});function a(e){n(e),t.onOpenChange?.(e)}function o(e){t.onOpen(e),a(!1)}{let s=l(()=>`${t.runs.length} task runs`);IF(e,{flush:!0,size:`wide`,title:`Runs`,get description(){return L(s)},class:`h-[min(40rem,calc(100vh-6rem))]`,onOpenChange:a,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var a=AG(),s=B(a);q_(B(s),{class:`flex-1`,placeholder:`Filter runs`,ariaLabel:`Filter runs`,get value(){return L(r)},set value(e){R(r,e,!0)}}),y(s);var c=Y(s,2),l=B(c),u=e=>{q(e,kG())},d=e=>{As(e,{class:`h-full`,children:(e,n)=>{Qr(e,{ariaLabel:`All runs`,class:`gap-1`,children:(e,n)=>{var r=_();O(F(r),17,()=>L(i),e=>e.key,(e,n)=>{ni(e,{children:(e,r)=>{OG(e,{get entry(){return L(n)},get capabilities(){return t.capabilities},onOpen:o,get onCancel(){return t.onCancel},get onForceKill(){return t.onForceKill},get onRestart(){return t.onRestart},onRerunDefinition:()=>t.onRerunDefinition(L(n)),get onRemove(){return t.onRemove},get onCopy(){return t.onCopy},get onSaveAsDefinition(){return t.onSaveAsDefinition}})},$$slots:{default:!0}})}),q(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}})};p(l,e=>{L(i).length===0?e(u):e(d,-1)}),y(c),y(a),q(e,a)},$$slots:{default:!0}})}H()}var MG=P(`<p class="py-1 text-xs text-muted-foreground">Loading tasks…</p>`),NG=P(`<div class="mt-auto shrink-0 p-1"><!></div>`),PG=P(`<div class="flex min-h-0 min-w-0 flex-1 basis-0 flex-col overflow-hidden"><!> <!> <!></div>`),FG=P(`<div class="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden"><div class="flex min-w-0 shrink flex-col overflow-y-auto"><!></div> <!></div>`),IG=P(`<!> <!>`,1),LG=P(`<div class="flex h-full min-h-0 flex-col"><!></div>`),RG=P(`<!> <!> <!>`,1),zG=P(`<div class="h-full min-h-0"><!></div> <!> <!> <!> <!> <!> <!> <!> <!>`,1);function BG(e,t){x(t,!0);let n=e=>{var n=FG(),i=B(n),a=B(i),o=e=>{q(e,MG())},c=e=>{Kr(e,{get icon(){return lG},title:`No saved tasks`,description:`Create a task to run it anytime.`})},f=e=>{Qr(e,{role:`none`,class:`gap-1`,children:(e,n)=>{var i=_();O(F(i),17,()=>L(r).definitions,e=>e.key,(e,n)=>{ni(e,{children:(e,r)=>{wG(e,{get entry(){return L(n)},get capabilities(){return L(A)},onOpen:e=>void t.actions.openTaskOutput(e),onRun:()=>void t.actions.runDefinition(L(n).definition),onCancel:e=>void t.actions.cancelTask(e),onForceKill:P,onRestart:e=>void t.actions.restartTask(e),onEdit:()=>R(u,L(n).definition,!0),onDelete:()=>R(d,L(n).definition,!0),onCleanupRuns:e=>R(m,e,!0),onCopy:e=>void t.actions.copyText(e)})},$$slots:{default:!0}})}),q(e,i)},$$slots:{default:!0}})};p(a,e=>{t.model.definitionsLoading&&t.model.definitions.length===0?e(o):L(r).definitions.length===0?e(c,1):e(f,-1)}),y(i);var v=Y(i,2),x=e=>{var n=PG(),i=B(n);ei(i,{title:`Runs`,get count(){return L(r).runs.length},actions:e=>{{let n=l(()=>!t.model.capabilities.prune.enabled||L(T)===0);Hr(e,{get icon(){return Ya},label:`Prune history`,title:`Prune finished ad-hoc task runs`,get disabled(){return L(n)},onclick:()=>R(s,!0)})}},$$slots:{actions:!0}});var a=Y(i,2);Qr(a,{ariaLabel:`Runs`,class:`shrink-0 gap-1`,children:(e,n)=>{var r=_();O(F(r),17,()=>L(k),e=>e.key,(e,n)=>{ni(e,{children:(e,r)=>{OG(e,{get entry(){return L(n)},get capabilities(){return L(A)},onOpen:e=>void t.actions.openTaskOutput(e),onCancel:e=>void t.actions.cancelTask(e),onForceKill:P,onRestart:e=>void t.actions.restartTask(e),onRemove:e=>void t.actions.removeTask(e),onCopy:e=>void t.actions.copyText(e),onSaveAsDefinition:e=>R(h,e,!0)})},$$slots:{default:!0}})}),q(e,r)},$$slots:{default:!0}});var o=Y(a,2),c=e=>{var t=NG();W(B(t),{variant:`ghost`,size:`xs`,class:`w-full text-muted-foreground`,onclick:()=>R(C,!0),children:(e,t)=>{g(),q(e,D(`See More`))},$$slots:{default:!0}}),y(t),ie(t,e=>R(S,e),()=>L(S)),q(e,t)};p(o,e=>{L(ee)>0&&e(c)}),y(n),ie(n,e=>R(b,e),()=>L(b)),q(e,n)};p(v,e=>{L(r).runs.length>0&&e(x)}),y(n),q(e,n)},r=l(()=>Qe(t.model.definitions,t.model.tasks)),i=l(()=>{let e=t.model.selectedTask;if(!e)return[];let n=e.definitionId??e.restartRootTaskId??e.id;return t.model.tasks.filter(e=>(e.definitionId??e.restartRootTaskId??e.id)===n).sort((e,t)=>t.startedAt.localeCompare(e.startedAt))}),a=X(!1),o=X(!1),s=X(!1),c=X(void 0),u=X(void 0),d=X(void 0),m=X(Ie([])),h=X(void 0),v=X(0),b=X(null),S=X(null),C=X(!1),w=l(()=>L(v)>=720),T=l(()=>L(r).runs.filter(e=>e.isRemovable).length),E=Ur({region:()=>L(b),footer:()=>L(S),total:()=>L(r).runs.length}),k=l(()=>L(r).runs.slice(0,E.count)),ee=l(()=>L(r).runs.length-L(k).length),A=l(()=>({start:t.model.capabilities.start.enabled,cancel:t.model.capabilities.cancel.enabled,restart:t.model.capabilities.restart.enabled,remove:t.model.capabilities.remove.enabled,logs:t.model.capabilities.logs.enabled,copy:t.model.capabilities.copy.enabled,manageDefinitions:t.model.capabilities.manageDefinitions.enabled}));async function j(e){R(o,!0);try{await t.actions.createDefinition(e),R(a,!1),R(h,void 0)}finally{R(o,!1)}}async function M(e){if(L(u)){R(o,!0);try{await t.actions.updateDefinition(L(u),e),R(u,void 0)}finally{R(o,!1)}}}async function N(){let e=L(m);R(m,[],!0),await t.actions.cleanupRuns(e)}async function te(){L(d)&&(await t.actions.deleteDefinition(L(d)),R(d,void 0))}async function ne(){if(!L(c))return;let e=L(c).id;R(c,void 0),await t.actions.forceKillTask(e)}function P(e){let n=t.model.tasks.find(t=>t.id===e);n&&(n.status===`recovered`?R(c,n,!0):t.actions.forceKillTask(e))}function re(e){e.definition&&t.actions.runDefinition(e.definition)}var I=zG(),ae=F(I);ti(B(ae),{scroll:!1,padded:!1,banner:e=>{var n=IG(),i=F(n);{let e=e=>{var n=_(),r=F(n),i=e=>{{let n=l(()=>!t.model.capabilities.manageDefinitions.enabled);Hr(e,{get icon(){return Ul},label:`Create task`,get disabled(){return L(n)},onclick:()=>R(a,!0)})}};p(r,e=>{t.model.availability.available&&e(i)}),q(e,n)},n=l(()=>t.model.availability.available?L(r).definitions.length:void 0);Yr(i,{title:`Tasks`,get count(){return L(n)},trailing:e,$$slots:{trailing:!0}})}var o=Y(i,2),s=e=>{Lr(e,{tone:`muted`,children:(e,n)=>{g();var r=D();J(()=>f(r,t.model.availability.message)),q(e,r)},$$slots:{default:!0}})},c=e=>{Lr(e,{tone:`info`,children:(e,n)=>{g();var r=D();J(()=>f(r,t.model.notice)),q(e,r)},$$slots:{default:!0}})};p(o,e=>{t.model.availability.available?t.model.notice&&e(c,1):e(s)}),q(e,n)},children:(e,r)=>{var a=_(),o=F(a),s=e=>{var r=_(),a=F(r),o=e=>{Ed(e,{direction:`horizontal`,class:`min-h-0 flex-1`,children:(e,r)=>{var a=RG(),o=F(a);vd(o,{defaultSize:38,minSize:24,maxSize:60,children:(e,t)=>{var r=LG();n(B(r)),y(r),q(e,r)},$$slots:{default:!0}});var s=Y(o,2);wd(s,{"aria-label":`Resize task output`}),vd(Y(s,2),{defaultSize:62,minSize:30,children:(e,n)=>{et(e,{get task(){return t.model.selectedTask},get taskLogs(){return t.model.selectedLogs},get siblingRuns(){return L(i)},get canRestart(){return L(A).restart},get canCancel(){return L(A).cancel},onSelectRun:e=>void t.actions.selectTask(e),onRestartRun:e=>void t.actions.restartTask(e),onCancelRun:e=>void t.actions.cancelTask(e),onForceKillRun:e=>void t.actions.forceKillTask(e),onCleanupRuns:e=>t.actions.cleanupRuns(e)})},$$slots:{default:!0}}),q(e,a)},$$slots:{default:!0}})},s=e=>{n(e)};p(a,e=>{L(w)?e(o):e(s,-1)}),q(e,r)};p(o,e=>{t.model.availability.available&&e(s)}),q(e,a)},$$slots:{banner:!0,default:!0}}),y(ae);var oe=Y(ae,2);jG(oe,{get runs(){return L(r).runs},get capabilities(){return L(A)},onOpen:e=>void t.actions.openTaskOutput(e),onCancel:e=>void t.actions.cancelTask(e),onForceKill:P,onRestart:e=>void t.actions.restartTask(e),onRerunDefinition:re,onRemove:e=>void t.actions.removeTask(e),onCopy:e=>void t.actions.copyText(e),onSaveAsDefinition:e=>R(h,e,!0),get open(){return L(C)},set open(e){R(C,e,!0)}});var se=Y(oe,2);_G(se,{get projectCwd(){return t.model.defaultCwd},get saving(){return L(o)},onSave:e=>void j(e),get open(){return L(a)},set open(e){R(a,e,!0)}});var ce=Y(se,2);{let e=l(()=>!!L(u));_G(ce,{get open(){return L(e)},get definition(){return L(u)},get projectCwd(){return t.model.defaultCwd},get saving(){return L(o)},onSave:e=>void M(e),onOpenChange:e=>{e||R(u,void 0)}})}var z=Y(ce,2);{let e=l(()=>!!L(h)),n=l(()=>L(h)?{label:L(h).displayName??L(h).name,command:L(h).command,cwd:L(h).cwd===t.model.defaultCwd?void 0:L(h).cwd}:void 0);_G(z,{get open(){return L(e)},get projectCwd(){return t.model.defaultCwd},get initial(){return L(n)},title:`Save as task definition`,description:`Create a reusable definition from this run. The run stays linked to it.`,submitLabel:`Save task`,get saving(){return L(o)},onSave:e=>L(h)&&void j({...e,sourceTaskId:L(h).id}),onOpenChange:e=>{e||R(h,void 0)}})}var le=Y(z,2);{let e=l(()=>!!L(c)),t=l(()=>`Immediately terminates ${L(c)?.displayName??L(c)?.name??L(c)?.command??`this task`}. Buffered output and process cleanup may be lost.`);Tr(le,{get open(){return L(e)},destructive:!0,title:`Force kill task?`,get description(){return L(t)},confirmLabel:`Force kill`,onConfirm:()=>void ne(),onCancel:()=>R(c,void 0),onOpenChange:e=>{e||R(c,void 0)}})}var ue=Y(le,2);{let e=l(()=>L(m).length>0),t=l(()=>`This removes ${L(m).length} old finished ${L(m).length===1?`run`:`runs`} and their captured logs. The latest run is retained.`);Tr(ue,{get open(){return L(e)},destructive:!0,title:`Clean up old task runs?`,get description(){return L(t)},confirmLabel:`Clean up`,onConfirm:()=>void N(),onCancel:()=>R(m,[],!0),onOpenChange:e=>{e||R(m,[],!0)}})}var de=Y(ue,2);{let e=l(()=>!!L(d));Tr(de,{get open(){return L(e)},destructive:!0,title:`Delete saved task?`,description:`The saved definition is removed. Existing run history and logs are retained.`,confirmLabel:`Delete`,onConfirm:()=>void te(),onCancel:()=>R(d,void 0),onOpenChange:e=>{e||R(d,void 0)}})}Tr(Y(de,2),{destructive:!0,title:`Prune task history`,description:`This removes completed ad-hoc task runs and their captured logs. Saved tasks and recovery warnings are retained.`,confirmLabel:`Prune`,onConfirm:()=>void t.actions.pruneTasks(),get open(){return L(s)},set open(e){R(s,e,!0)}}),Me(ae,`clientWidth`,e=>R(v,e)),q(e,I),H()}function VG(e,t){x(t,!0);let n=K(t,`projectSelected`,3,!1);function r(e){t.onNewChat(e.mode)}{let i=l(()=>n()?`Plot the move, or dive straight into the code.`:`Bring a project. We'll bring the momentum.`),a=l(()=>!n());fy(e,{variant:`launchpad`,title:`Let's give this repo a plot twist.`,get message(){return L(i)},get projectLabel(){return t.projectLabel},get projectPath(){return t.projectPath},get starters(){return BH},get startersDisabled(){return L(a)},onSelectStarter:r})}H()}var HG=new Set([`$$slots`,`$$events`,`$$legacy`]);function UG(e,t){let n=U(t,HG),r=[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`}]];G(e,V({name:`clipboard`},()=>n,{get iconNode(){return r}}))}var WG=new Set([`$$slots`,`$$events`,`$$legacy`]);function GG(e,t){let n=U(t,WG),r=[[`path`,{d:`M17 5H3`}],[`path`,{d:`M21 12H8`}],[`path`,{d:`M21 19H8`}],[`path`,{d:`M3 12v7`}]];G(e,V({name:`text-quote`},()=>n,{get iconNode(){return r}}))}function KG(e){if(e)return e.split(`:thinking:`)[0]}function qG(e){if(e!=null){if(typeof e==`string`)return e.trim()||void 0;try{return JSON.stringify(e,null,2)}catch{return String(e)}}}function JG(e){let t=e.filter(e=>!!e?.trim());return t.length>0?t.join(`
128
- `):void 0}function YG(e,t){switch(e.kind){case`message`:case`thinking`:{let n=KG(e.item.id),r=n?t.get(n):void 0;return{content:e.item.text,id:e.item.id,idLabel:`message id`,quote:e.item.text,entryId:r?n:void 0,entry:r}}case`tool`:{let t=qG(e.toolCall.argsPreview),n=qG(e.toolCall.resultPreview);return{content:JG([e.toolCall.toolName,t?`Arguments:\n${t}`:void 0,n?`Result:\n${n}`:void 0,e.toolCall.error?`Error:\n${e.toolCall.error}`:void 0]),id:e.toolCall.id,idLabel:`tool id`,entryId:e.anchorEntryId}}case`tool_result_error`:return{content:JG([e.toolName,e.error])};case`run_status`:return{content:JG([`Run ${e.notice.state.replaceAll(`_`,` `)}`,e.notice.errorMessage]),id:e.notice.runId,idLabel:`run id`};case`compaction`:return{content:JG([`Compaction ${e.notice.state}`,e.notice.summary,e.notice.text,e.notice.errorMessage]),id:e.notice.id,idLabel:`compaction id`};case`task_event`:return{content:JG([e.notice.taskName?`Task: ${e.notice.taskName}`:`Task update`,e.notice.commandPreview,e.notice.status?`Status: ${e.notice.status}`:void 0,e.notice.exitCode===void 0?void 0:`Exit: ${e.notice.exitCode}`,e.notice.signal?`Signal: ${e.notice.signal}`:void 0]),id:e.notice.taskId??e.notice.entryId,idLabel:e.notice.taskId?`task id`:`entry id`};case`queued_prompt`:return{content:e.prompt.text,id:e.prompt.id,idLabel:`queued prompt id`}}}function XG(e){return e.filter(e=>e.length>0).flatMap((e,t)=>t===0?e:[{type:`separator`},...e])}function ZG(e,t,n){let r=YG(e,n.treeEntriesById),i=r.content?.trim()?r.content:void 0,a=t?.trim()?t:void 0,o=[{label:`Copy selection`,disabled:!a,onSelect:()=>{a&&n.copyText(a,`selection`)}},{label:`Copy content`,disabled:!i,onSelect:()=>{i&&n.copyText(i,`content`)}}];r.quote?.trim()&&o.push({label:`Quote`,onSelect:()=>n.quoteInComposer(r.quote??``)});let s=[];e.kind===`message`&&r.entry?.role===`user`&&n.onEditEntry&&s.push({label:`Edit message`,onSelect:()=>n.onEditEntry?.(r.entry)}),e.kind===`queued_prompt`&&s.push({label:`Edit prompt`,disabled:e.busy||!e.canEdit,onSelect:e.onEdit},{label:`Discard`,destructive:!0,disabled:e.busy||!e.canDiscard,onSelect:e.onDiscard}),r.entryId&&n.onNavigateToEntry&&s.push({label:`Continue from here`,onSelect:()=>n.onNavigateToEntry?.(r.entryId)});let c=[];return r.id&&c.push({label:`Copy ID`,onSelect:()=>void n.copyText(r.id??``,r.idLabel??`id`)}),n.onOpenHistory&&c.push({label:`Branch history`,onSelect:n.onOpenHistory}),XG([o,s,c])}var QG={"Copy selection":af,"Copy content":UG,Quote:GG,"Edit message":gy,"Edit prompt":gy,Discard:Ya,"Continue from here":$L,"Copy ID":af,"Branch history":AL};function $G(e){return e.map(e=>e.type===`separator`||e.type===`label`?e:e.type===`submenu`?{...e,items:$G(e.items)}:{...e,icon:QG[e.label]})}function eK(e,t,n){return $G(ZG(e,t,n))}function tK(e){let t={cancelled:!1},n=()=>{t.cancelled||e()};return typeof requestAnimationFrame==`function`?t.animationFrame=requestAnimationFrame(n):queueMicrotask(n),t}function nK(e){e.cancelled=!0,e.animationFrame!==void 0&&typeof cancelAnimationFrame==`function`&&cancelAnimationFrame(e.animationFrame)}var rK=class{commit;schedule;cancel;pending;hasPending=!1;frame;destroyed=!1;constructor(e,t=tK,n=nK){this.commit=e,this.schedule=t,this.cancel=n}enqueue(e){this.destroyed||(this.pending=e,this.hasPending=!0,this.frame===void 0&&(this.frame=this.schedule(()=>this.flushPending())))}hold(e){this.destroyed||(this.pending=e,this.hasPending=!0,this.cancelFrame())}flushNow(e){this.destroyed||(arguments.length>0&&(this.pending=e,this.hasPending=!0),this.cancelFrame(),this.flushPending())}destroy(){this.destroyed||(this.destroyed=!0,this.cancelFrame(),this.pending=void 0,this.hasPending=!1)}cancelFrame(){this.frame!==void 0&&(this.cancel(this.frame),this.frame=void 0)}flushPending(){if(this.frame=void 0,this.destroyed||!this.hasPending)return;let e=this.pending;this.pending=void 0,this.hasPending=!1,this.commit(e)}};function iK(e){let t=X(e.initialValue),n=e.initialScope,r=e.initialActive,i=new rK(e=>{R(t,e)});return{get current(){return L(t)},update(e,t,a){let o=e!==n,s=t&&!r;n=e,r=t,o||s?i.flushNow(a):t?i.enqueue(a):i.hold(a)},destroy(){i.destroy()}}}function aK(e,t){x(t,!0),Ij(VU());let n=K(t,`pendingConversationActive`,3,!1),r=K(t,`approvals`,19,()=>[]),i=K(t,`pendingUserQuestions`,19,()=>[]),a=K(t,`pendingPlanReviews`,19,()=>[]),o=K(t,`active`,3,!0),s=K(t,`entries`,19,()=>[]),c=K(t,`optimisticMessages`,19,()=>[]),u=K(t,`toolCalls`,19,()=>[]),d=K(t,`treeNodes`,19,()=>[]),f=K(t,`queuedPrompts`,19,()=>[]),p=K(t,`sending`,3,!1),m=K(t,`stopping`,3,!1),h=K(t,`composerText`,3,``),g=K(t,`models`,19,()=>[]),_=K(t,`selectedModelKey`,3,``),v=K(t,`planReviewModels`,19,()=>[]),y=K(t,`planReviewModelKey`,3,``),b=K(t,`planReviewThinkingLevel`,3,`off`),S=K(t,`contextWindow`,3,0),C=K(t,`composerFocusToken`,3,0),w=K(t,`composerEscapeToken`,3,0),T=K(t,`micShortcutToken`,3,0),E=K(t,`thinkingLevel`,3,`off`),D=K(t,`mode`,3,`coding`),O=K(t,`permissionLevel`,3,`autonomous`),k=K(t,`approvalPolicy`,19,()=>({autoApproveReadOnly:!0})),ee=K(t,`slashCompletions`,19,()=>[]),A=K(t,`composerSuggestions`,19,()=>[]),j=l(()=>mee(u(),t.activeAgent?.id)),M=l(()=>!!(t.activeConversation||n())),N=l(()=>t.activeProject?zi(t.activeProject.dir,t.homeDir):void 0),te=l(()=>t.activeConversation?.id??(n()?t.activePendingConversation?.id??`pending`:void 0));function ne(){return{entries:s(),optimisticMessages:c(),toolCalls:u(),activeRun:t.activeRun,transient:t.transient,queuedPrompts:f(),sending:p(),approvals:r(),pendingUserQuestions:i(),pendingPlanReviews:a()}}let P=iK({initialScope:Oe(()=>L(te)),initialActive:Oe(()=>o()),initialValue:Oe(ne)});z(()=>{P.update(L(te),o(),ne())}),z(()=>()=>P.destroy());let re=l(()=>P.current),ie=new _ee,F=l(()=>ie.project({entries:L(re).entries,optimisticMessages:L(re).optimisticMessages,toolCalls:L(re).toolCalls,includeUnanchoredTerminalToolCalls:!L(re).activeRun})),I=l(()=>fee(L(re).activeRun,L(re).transient,L(F).context)),ae=l(()=>vee(L(F).items,L(re).activeRun,L(re).transient,L(F).context)),R=l(()=>({prefix:L(ae),tail:L(I)})),oe=l(()=>[...L(ae),...L(I)]),se=l(()=>t.transient?.compaction?.state===`running`),ce=l(()=>m()||t.activeRun?.status===`aborting`),le=l(()=>pn(L(re).activeRun)),ue=l(()=>new Map(d().map(e=>[e.entry.id,e.entry]))),de=l(()=>xn(L(oe),L(re).activeRun));async function fe(e,t=`message`){try{await vf(e),yi.success(`Copied ${t}`)}catch{yi.error(`Could not copy to clipboard`)}}function B(e){let n=e.split(`
129
- `).map(e=>`> ${e}`).join(`
130
- `),r=h()?`${h()}\n\n`:``;t.onComposerChange?.(`${r}${n}\n\n`)}function V(e,n){return eK(e,n,{treeEntriesById:L(ue),copyText:fe,quoteInComposer:B,onNavigateToEntry:t.onNavigateToEntry,onEditEntry:t.onEditEntry,onOpenHistory:t.onOpenHistory})}{let s=e=>{{let s=l(()=>t.activeConversation?t.onCompact:void 0);MU(e,{get text(){return h()},get activeProject(){return t.activeProject},get activeConversation(){return t.activeConversation},get activePendingConversation(){return t.activePendingConversation},get pendingConversationActive(){return n()},get approvals(){return r()},get pendingUserQuestions(){return i()},get pendingPlanReviews(){return a()},get interactive(){return o()},get sending(){return p()},get stopping(){return L(ce)},get compacting(){return L(se)},get models(){return g()},get selectedModelKey(){return _()},get contextUsage(){return t.contextUsage},get contextWindow(){return S()},get todos(){return L(j)},get focusToken(){return C()},get composerEscapeToken(){return w()},get micShortcutToken(){return T()},get thinkingLevel(){return E()},get mode(){return D()},get permissionLevel(){return O()},get approvalPolicy(){return k()},get slashCompletions(){return ee()},get fileCompletions(){return t.fileCompletions},get composerSuggestions(){return A()},get onSendSuggestion(){return t.onSendSuggestion},get onDraftSuggestion(){return t.onDraftSuggestion},get onChange(){return t.onComposerChange},get onSubmit(){return t.onSubmit},get onAbort(){return t.onAbort},get onCompact(){return L(s)},get onModelChange(){return t.onModelChange},get onThinkingLevelChange(){return t.onThinkingLevelChange},get onModeChange(){return t.onModeChange},get onPermissionChange(){return t.onPermissionChange},get onApprovalPolicyChange(){return t.onApprovalPolicyChange}})}},c=e=>{{let n=l(()=>!!(t.activeProject&&t.onNewConversationInProject)),r=l(()=>t.activeProject?.dir);VG(e,{get projectSelected(){return L(n)},get projectLabel(){return L(N)},get projectPath(){return L(r)},onNewChat:e=>{t.activeProject&&t.onNewConversationInProject?.(t.activeProject.dir,e)}})}},u=l(()=>({conversationId:L(te),open:L(M),active:o(),timeline:L(R),streamingText:L(le),sending:L(re).sending,hasActiveTurnOutput:L(de),queuedPrompts:L(re).queuedPrompts,approvals:L(re).approvals,pendingUserQuestions:L(re).pendingUserQuestions,pendingPlanReviews:L(re).pendingPlanReviews,activeProject:t.activeProject,activeProjectLabel:L(N),planReviewModels:v(),planReviewModelKey:y(),planReviewThinkingLevel:b(),emptyTitle:`Open a conversation or start a new one.`,composer:{text:h(),disabled:!o(),sending:p(),stopping:L(ce),compacting:L(se),models:g(),selectedModelKey:_(),thinkingLevel:E(),mode:D(),permissionLevel:O(),approvalPolicy:k(),contextUsage:t.contextUsage,contextWindow:S(),capabilities:{voice:!0,imagePaste:!0,fileDrop:!!kr()?.files,completions:!0,suggestions:!0,shortcuts:!0,todos:!0,queueing:!0}}})),d=l(()=>({onOpenFile:t.onOpenFile,onAnswerUserQuestion:t.onAnswerUserQuestion,onDismissUserQuestion:t.onDismissUserQuestion,onGrantApproval:t.onGrantApproval,onDenyApproval:t.onDenyApproval,onAcceptPlanReview:t.onAcceptPlanReview,onAcceptPlanReviewInNewChat:t.onAcceptPlanReviewInNewChat,onRejectPlanReview:t.onRejectPlanReview,onContinueFromFailure:t.onContinueFromFailure,onDiscardQueuedPrompt:t.onDiscardQueuedPrompt,onMoveQueuedPromptToComposer:t.onMoveQueuedPromptToComposer}));LH(e,{get model(){return L(u)},get actions(){return L(d)},menus:{transcriptMenu:V},composer:s,emptyExtension:c,$$slots:{composer:!0,emptyExtension:!0}})}H()}var oK=Ie({focusToken:0,escapeToken:0,micToken:0,historyDialogOpen:!1});function sK(){oK.focusToken+=1}function cK(){oK.escapeToken+=1}function lK(){oK.micToken+=1}function uK(){oK.historyDialogOpen=!0}function dK(e,t){return`${e}:${encodeURIComponent(t)}`}function fK(e){Ui({kind:`file`,id:e})}async function pK(e){let t=ra.fileViews[Qi(e)];if(t){t.loading=!0,t.error=void 0;try{t.content=await _o(t.projectId,t.path,t.line),t.path=t.content.path}catch(e){let n=e instanceof Error?e.message:String(e);t.error=n,yi.error(`Could not open file`,{description:n})}finally{t.loading=!1}}}async function mK(e){if(e.projectId!==Q.selectedProjectId){let{selectProject:t}=await Xa(async()=>{let{selectProject:e}=await import(`./workspace-actions.svelte-fmfCaU70.js`).then(e=>e.g);return{selectProject:e}},__vite__mapDeps([30,11,8,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54]));await t(e.projectId)}let t=dK(e.projectId,e.path),n=Qi(t);fK(t),ra.fileViews[n]??={id:t,projectId:e.projectId,path:e.path,line:e.line,loading:!1},ra.fileViews[n].line=e.line,Ai({kind:`file`,id:t}),await pK(t)}async function hK(e){let t=ra.fileViews[Qi(e)];t&&(fK(e),Ai({kind:`file`,id:e}),!t.content&&!t.loading&&await pK(e))}async function gK(e){await pK(e)}function _K(e){let t=ra.fileViews[Qi(e)];t&&(t.displayMode=(t.displayMode??nm(t.content?.relativePath??t.path))===`raw`?`rendered`:`raw`)}function vK(e){let t=ra.fileViews[Qi(e)];t&&(t.wrapLines=!t.wrapLines)}function yK(e){let t=new je(Object.values(ra.fileViews).filter(t=>{let n=t.content?.relativePath??t.path;return t.projectId===e.projectId&&(n===e.path||e.descendants&&n.startsWith(`${e.path}/`))}).map(e=>e.id));if(t.size===0)return;let n=Q.activeCenterTab,r=n?.kind===`file`&&t.has(n.id),i=Q.openCenterTabs.filter(e=>e.kind!==`file`||!t.has(e.id));for(let e of t)delete ra.fileViews[Qi(e)];qee(i),r&&Fi(i.at(-1))}function bK(e){let t={kind:`file`,id:e},n=Q.activeCenterTab?.kind===`file`&&Q.activeCenterTab.id===e,r=Ni(t);ji(t),delete ra.fileViews[Qi(e)],n&&Fi(r)}var xK=new Set([`$$slots`,`$$events`,`$$legacy`]);function SK(e,t){let n=U(t,xK),r=[[`circle`,{cx:`12`,cy:`12`,r:`3`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`}]];G(e,V({name:`git-commit-horizontal`},()=>n,{get iconNode(){return r}}))}function CK(e){return JSON.stringify({projectId:e.projectId,projectIsRepo:e.projectIsRepo,repos:e.repos.map(e=>({relativePath:e.relativePath,currentBranch:e.currentBranch,detached:e.detached,ahead:e.ahead,behind:e.behind,hasUpstream:e.hasUpstream,hasRemote:e.hasRemote,hasGithubRemote:e.hasGithubRemote,baseBranch:e.baseBranch,onBaseBranch:e.onBaseBranch,mergedToBase:e.mergedToBase,dirty:e.dirty,changeCount:e.changeCount})),github:e.github?{available:e.github.available,authenticated:e.github.authenticated}:void 0})}function wK(e){return e?.status===`pending`}function TK(e){return e.some(e=>wK(e.checks))}var EK={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},DK=class{cooldownMs;dispatch;clock;#e=new Map;constructor(e,t,n=EK){this.cooldownMs=e,this.dispatch=t,this.clock=n}schedule(e,t){let n=this.#t(e);n.pending.overview||=!!t.overview,n.pending.prs||=!!t.prs,this.#n(n)}noteDirectStart(e,t){let n=this.#t(e),r=this.clock.now();for(let e of OK(t))n.lastStartedAt[e]=r,n.pending[e]=!1;this.#r(n)}#t(e){let t=this.#e.get(e);if(t)return t;let n={key:e,pending:{overview:!1,prs:!1},lastStartedAt:{overview:void 0,prs:void 0}};return this.#e.set(e,n),n}#n(e){let t=this.clock.now(),n={};for(let r of OK(e.pending)){let i=e.lastStartedAt[r];(i===void 0||t-i>=this.cooldownMs[r])&&(n[r]=!0,e.pending[r]=!1,e.lastStartedAt[r]=t)}this.#r(e),(n.overview||n.prs)&&this.dispatch(e.key,n)}#r(e){e.timer!==void 0&&(this.clock.clearTimeout(e.timer),e.timer=void 0);let t=this.clock.now(),n=OK(e.pending).map(n=>{let r=e.lastStartedAt[n];return r===void 0?0:Math.max(0,this.cooldownMs[n]-(t-r))});n.length!==0&&(e.timer=this.clock.setTimeout(()=>{e.timer=void 0,this.#n(e)},Math.min(...n)))}};function OK(e){return Object.keys(e).filter(t=>!!e[t])}function kK(e,t){return e.reposRequestInFlight?(e.activeRequestLoadsDetails||=t,!0):!1}function AK(e){return[e.status,e.total,e.passed,e.failed,e.pending,e.runs.map(e=>`${e.name}:${e.status}`).sort().join(`|`)].join(`,`)}function jK(e){return[e.number,e.title,e.url,e.state,e.isDraft,e.headRefName,e.baseRefName,e.updatedAt,AK(e.checks)].join(`\0`)}function MK(e,t){return e!==void 0&&AK(e)===AK(t)}function NK(e,t){return e.number===t.number&&e.title===t.title&&e.url===t.url&&e.state===t.state&&e.isDraft===t.isDraft&&e.headRefName===t.headRefName&&e.baseRefName===t.baseRefName&&e.updatedAt===t.updatedAt}function PK(e){return JSON.stringify({relativePath:e.relativePath,absDir:e.absDir,name:e.name,currentBranch:e.currentBranch,detached:e.detached,ahead:e.ahead,behind:e.behind,hasUpstream:e.hasUpstream,hasRemote:e.hasRemote,hasGithubRemote:e.hasGithubRemote,baseBranch:e.baseBranch,onBaseBranch:e.onBaseBranch,mergedToBase:e.mergedToBase,dirty:e.dirty,changeCount:e.changeCount})}function FK(e){return{files:e.files,stagedCount:e.stagedCount,unstagedCount:e.unstagedCount,untrackedCount:e.untrackedCount,insertions:e.insertions,deletions:e.deletions}}function IK(e){return JSON.stringify({counts:{staged:e.stagedCount,unstaged:e.unstagedCount,untracked:e.untrackedCount,insertions:e.insertions,deletions:e.deletions},files:e.files.map(e=>({path:e.path,renamedFrom:e.renamedFrom,index:e.index,worktree:e.worktree,staged:e.staged,untracked:e.untracked}))})}function LK(e){return JSON.stringify(e.map(e=>({hash:e.hash,subject:e.subject,relativeDate:e.relativeDate})))}function RK(e){return JSON.stringify(e.map(e=>({name:e.name,current:e.current,remote:e.remote,upstream:e.upstream})))}function zK(e){if(e)return JSON.stringify({available:e.available,authenticated:e.authenticated,login:e.login,reason:e.reason})}function BK(e){return e.map(jK).join(`
131
- `)}function VK(e){return JSON.stringify(e.map(e=>PK(e)))}var HK=Ie({projects:{}}),UK=8,WK=new je;function GK(e,t,n){return`${e}:${encodeURIComponent(t)}:${n}`}function KK(e,t,n){return n.filter(n=>!WK.has(GK(e,t,n.number)))}function qK(){return{fetching:!1,pulling:!1,pushing:!1,syncing:!1,switchingBaseAndPulling:!1,switchingBranch:void 0,creatingBranch:!1,fileMutation:void 0,bulkMutation:void 0}}function JK(e,t){return{repoSummary:void 0,changes:void 0,recentCommits:[],github:void 0,prs:[],prFilters:e&&t?$K(e,t):BW,branches:[],operations:qK(),loadingOverview:!1,loadingPrs:!1,prsError:void 0,loadingBranches:!1,prsRequestInFlight:!1,prsRefreshQueued:!1,prsQueuedVisible:!1,prsRequestSeq:0,overviewRequestInFlight:!1,overviewRefreshQueued:!1,overviewInvalidated:!1,lastRepoSummaryFingerprint:void 0,lastChangesFingerprint:void 0,lastRecentCommitsFingerprint:void 0,lastBranchesFingerprint:void 0,lastPrsFingerprint:void 0,lastGithubFingerprint:void 0,loaded:!1,loadedAt:void 0,prsLoadedAt:void 0,requestSeq:0}}function YK(e){return{projectId:e.id,projectDir:e.dir,projectIsRepo:!1,repos:[],selectedRepo:`.`,repoStates:{},discoverError:void 0,loadingRepos:!1,refreshingRepos:!1,reposRequestInFlight:!1,activeRequestLoadsDetails:!1,projectRefreshQueued:!1,queuedRefreshLoadsDetails:!1,lastReposFingerprint:void 0,loaded:!1,loadedAt:void 0,requestSeq:0,touchedAt:Date.now()}}function XK(e){return`nerve.git.repo.${e}`}function ZK(e,t){return`nerve.git.prFilters.${e}.${encodeURIComponent(t)}`}function QK(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return[`any`,`me`,`username`].includes(String(t.author))&&typeof t.username==`string`&&[`include`,`exclude`,`only`].includes(String(t.drafts))&&typeof t.title==`string`&&typeof t.currentBranchOnly==`boolean`&&Array.isArray(t.labels)&&t.labels.every(e=>typeof e==`string`)&&[`updated-desc`,`updated-asc`].includes(String(t.sort))}function $K(e,t){if(typeof localStorage>`u`)return BW;try{let n=localStorage.getItem(ZK(e,t));if(!n)return BW;let r=JSON.parse(n);return QK(r)?VW(r):BW}catch{return BW}}function eq(e,t,n){if(!(typeof localStorage>`u`))try{localStorage.setItem(ZK(e,t),JSON.stringify(VW(n)))}catch{}}function tq(e){let t=HK.projects[Xi(e)];t&&(t.touchedAt=Date.now(),nq())}function nq(){let e=Object.values(HK.projects).sort((e,t)=>t.touchedAt-e.touchedAt);for(let t of e.slice(UK))delete HK.projects[Xi(t.projectId)]}function rq(e){let t=Xi(e.id);HK.projects[t]??=YK(e);let n=HK.projects[t];return n.projectDir!==e.dir&&(n.projectDir=e.dir),tq(e.id),n}function iq(e,t){let n=HK.projects[Xi(e)];if(!n)return JK();let r=ea(t);return n.repoStates[r]??=JK(e,t),n.repoStates[r]}function aq(e){if(e instanceof Error){try{let t=JSON.parse(e.message);if(t?.error?.message)return String(t.error.message)}catch{}return e.message}return String(e)}function oq(e){let t=e?.operations;return!!(t&&(t.fetching||t.pulling||t.pushing||t.syncing||t.switchingBaseAndPulling||t.creatingBranch||t.switchingBranch||t.fileMutation||t.bulkMutation))}function sq(e,t){let n=PK(t);return e.lastRepoSummaryFingerprint===n&&e.repoSummary?!1:(e.repoSummary=t,e.lastRepoSummaryFingerprint=n,!0)}function cq(e,t){let n=IK(t);return e.lastChangesFingerprint===n&&e.changes?!1:(e.changes=t,e.lastChangesFingerprint=n,!0)}function lq(e,t){let n=LK(t);return e.lastRecentCommitsFingerprint===n?!1:(e.recentCommits=t,e.lastRecentCommitsFingerprint=n,!0)}function uq(e,t){let n=sq(e,t.repo),r=cq(e,FK(t)),i=lq(e,t.recentCommits),a=n||r||i;return e.loaded||=!0,e.loadedAt=Date.now(),{changed:a,repoChanged:n,changesChanged:r,recentCommitsChanged:i}}function dq(e,t){let n=VK(t);return e.lastReposFingerprint===n?!1:(e.repos=t,e.lastReposFingerprint=n,!0)}function fq(e,t){let n=RK(t);return e.lastBranchesFingerprint===n?!1:(e.branches=t,e.lastBranchesFingerprint=n,!0)}function pq(e,t){let n=zK(t);return e.lastGithubFingerprint===n?!1:(e.github=t,e.lastGithubFingerprint=n,!0)}function mq(e,t){let n=BK(t);return e.lastPrsFingerprint===n?!1:(e.prs=t,e.lastPrsFingerprint=n,!0)}function hq(e,t,n){return HK.projects[Xi(e)]?.repoStates[ea(t)]?.prs.find(e=>e.number===n)}function gq(e,t,n){let r=HK.projects[Xi(e)]?.repoStates[ea(t)];r&&r.prs.find(e=>e.number===n.number)&&mq(r,r.prs.map(e=>e.number===n.number?{...e,title:n.title,url:n.url,state:n.state,isDraft:n.isDraft,headRefName:n.headRefName,baseRefName:n.baseRefName,updatedAt:n.updatedAt}:e))}function _q(e,t,n,r){let i=HK.projects[Xi(e)]?.repoStates[ea(t)];i&&mq(i,i.prs.map(e=>e.number===n?{...e,checks:r}:e))}function vq(e,t,n){WK.add(GK(e,t,n));let r=HK.projects[Xi(e)]?.repoStates[ea(t)];r&&mq(r,r.prs.filter(e=>e.number!==n))}function yq(e,t){let n=HK.projects[Xi(e)];if(!n)return;let r=n.repos.find(e=>e.relativePath===t.relativePath);r?PK(r)!==PK(t)&&dq(n,n.repos.map(e=>e.relativePath===t.relativePath?t:e)):dq(n,[...n.repos,t]);let i=n.repoStates[ea(t.relativePath)];i&&sq(i,t),i&&(!t.hasRemote||!t.hasGithubRemote)&&Sq(e,i),Eq(e)}function bq(e,t){let n=HK.projects[Xi(e)];if(n)return n.repoStates[ea(t)]?.repoSummary??n.repos.find(e=>e.relativePath===t)}function xq(e,t){let n=bq(e,t);return!!(n?.hasRemote&&n.hasGithubRemote)}function Sq(e,t){let n=!1;(t.github!==void 0||t.lastGithubFingerprint!==void 0)&&(t.github=void 0,t.lastGithubFingerprint=void 0,n=!0);let r=BK([]);(t.prs.length>0||t.lastPrsFingerprint!==void 0&&t.lastPrsFingerprint!==r)&&(t.prs=[],t.lastPrsFingerprint=r,n=!0),t.loadingPrs&&(t.loadingPrs=!1,n=!0),t.prsRequestInFlight&&(t.prsRequestInFlight=!1,n=!0),t.prsRefreshQueued&&(t.prsRefreshQueued=!1,n=!0),t.prsQueuedVisible&&(t.prsQueuedVisible=!1,n=!0),t.prsError&&(t.prsError=void 0,n=!0),n&&Eq(e)}function Cq(e){if(!(typeof localStorage>`u`))return localStorage.getItem(XK(e))??void 0}function wq(e,t){typeof localStorage>`u`||localStorage.setItem(XK(e),t)}function Tq(e){if(!e.loaded&&e.repos.length===0)return;let t=e.repoStates[ea(e.selectedRepo)];return{projectId:e.projectId,projectIsRepo:e.projectIsRepo,repos:e.repos,github:t?.github?{available:t.github.available,authenticated:t.github.authenticated}:void 0,loadedAt:e.loadedAt??Date.now()}}function Eq(e){let t=HK.projects[Xi(e)];if(!t)return;let n=Tq(t);if(!n)return;let r=Bi.gitContext;(!r||r.projectId!==n.projectId||CK(r)!==CK(n))&&(Bi.gitContext=n)}var Dq=3e4,Oq=3e3,kq=3e4,Aq=5*6e4,jq=1e4;function Mq(e){return JSON.stringify({author:e.author,username:e.username??``,drafts:e.drafts,title:e.title,head:e.head??``,labels:[...e.labels].sort(),sort:e.sort})}function Nq(e,t,n){return e!==void 0&&t-e<n}function Pq(e){if(!e.visible)return{pollActiveDetail:!1,pollList:!1};let t=e.prs.filter(e=>e.checks.status===`pending`),n=e.activePrPending;return{pollActiveDetail:n,pollList:t.some(t=>t.number!==e.activePrNumber)||!n&&t.length>0}}function Fq(e,t,n){return JSON.stringify([e,t,n.path,n.previousPath??``,n.status])}var Iq=Dq,Lq=6e4,Rq=1/0,zq=5*6e4,Bq=new ye,Vq=new ye;function Hq(e){let t=JSON.stringify(e),n=(Vq.get(t)??0)+1;return Vq.set(t,n),n}function Uq(e,t){return Vq.get(JSON.stringify(e))===t}function Wq(e){return e instanceof Error?e.message:String(e)}async function Gq(e){let t=JSON.stringify(e.key),n=Bq.get(t);if(n)return n;let r=Hq(e.key);if(!e.options?.force){let t=Ke.getQueryState(e.key),n=Ke.getQueryData(e.key);if(n!==void 0&&Uq(e.key,r)&&(e.resource.data!==n&&(e.resource.data=n,e.apply?.(n)),e.resource.error=void 0),n!==void 0&&t?.dataUpdatedAt!==void 0&&Date.now()-t.dataUpdatedAt<e.staleTime)return n}let i=(async()=>{let t=e.resource.data!==void 0;e.resource.loading=!t,e.resource.refreshing=t,e.options?.silent||(e.resource.error=void 0);try{e.options?.force&&await Ke.invalidateQueries({queryKey:e.key});let t=await Ke.fetchQuery({queryKey:e.key,queryFn:e.query,staleTime:e.staleTime,gcTime:zq});return Uq(e.key,r)&&(e.resource.data!==t&&(e.resource.data=t,e.apply?.(t)),e.resource.error=void 0),t}catch(n){Uq(e.key,r)&&(!e.options?.silent||!t)&&(e.resource.error=Wq(n));return}finally{Uq(e.key,r)&&(e.resource.loading=!1,e.resource.refreshing=!1)}})();Bq.set(t,i);try{return await i}finally{Bq.get(t)===i&&Bq.delete(t)}}function Kq(e){let t=e?.core.data,n=e?.files.data?.files.find(t=>t.path===e.selectedFilePath);if(!(!e||!t||!n))return e.fileDiffs[Fq(t.baseRefOid,t.headRefOid,n)]}async function qq(e,t,n){let r=e.core.data,i=e.files.data?.files.find(e=>e.path===t);if(!r||!i)return;let a=Fq(r.baseRefOid,r.headRefOid,i);e.fileDiffs[a]??={loading:!1,refreshing:!1};let o=e.fileDiffs[a];return Gq({key:$e.git.prFileDiff(e.projectId,e.repo,e.number,r.baseRefOid,r.headRefOid,i.path,i.previousPath,i.status),query:()=>Dee({projectId:e.projectId,repo:e.repo,number:e.number,path:i.path,...i.previousPath?{previousPath:i.previousPath}:{},status:i.status,expectedBaseRefOid:r.baseRefOid,expectedHeadRefOid:r.headRefOid,...r.headRepository?{expectedHeadRepository:r.headRepository}:{}}),staleTime:Rq,resource:o,options:n})}function Jq(e,t){return $e.git.prSection(e.projectId,e.repo,e.number,t)}function Yq(e,t){gq(e.projectId,e.repo,t),Zq(e)}function Xq(e,t){Zq(e,t.mergeSettings.allowedMethods)}function Zq(e,t=e.overview.data?.mergeSettings.allowedMethods??[]){(!e.selectedMergeMethod||!t.includes(e.selectedMergeMethod))&&(e.selectedMergeMethod=[`merge`,`squash`,`rebase`].find(e=>t.includes(e)))}function Qq(e){if(!Uq(e.key,e.version)||(Ke.getQueryState(e.key)?.dataUpdatedAt??0)>e.initialUpdatedAt)return;let t=Ke.setQueryData(e.key,e.data)??e.data;e.resource.data!==t&&(e.resource.data=t,e.apply?.(t)),e.resource.error=void 0}async function $q(e,t={}){let n=$e.git.prInitial(e.projectId,e.repo,e.number),r=JSON.stringify(n),i=Bq.get(r);if(i)return i;let a=Jq(e,`core`),o=Jq(e,`conversation`),s=Jq(e,`overview`),c={core:Hq(a),conversation:Hq(o),overview:Hq(s)},l=t=>{let r=Ke.getQueryState(n)?.dataUpdatedAt??Date.now();Qq({key:a,version:c.core,initialUpdatedAt:r,resource:e.core,data:t.core,apply:t=>Yq(e,t)}),Qq({key:o,version:c.conversation,initialUpdatedAt:r,resource:e.conversation,data:t.conversation}),Qq({key:s,version:c.overview,initialUpdatedAt:r,resource:e.overview,data:t.overview,apply:t=>Xq(e,t)})};if(!t.force){let e=Ke.getQueryState(n),t=Ke.getQueryData(n);if(t!==void 0&&l(t),t!==void 0&&e?.dataUpdatedAt!==void 0&&Date.now()-e.dataUpdatedAt<Iq)return t}let u=[e.core,e.conversation,e.overview];for(let e of u){let n=e.data!==void 0;e.loading=!n,e.refreshing=n,t.silent||(e.error=void 0)}let d=(async()=>{try{t.force&&await Ke.invalidateQueries({queryKey:n});let r=await Ke.fetchQuery({queryKey:n,queryFn:()=>Pee(e.projectId,e.repo,e.number),staleTime:Iq,gcTime:zq});return l(r),r}catch(n){let r=Wq(n);for(let[n,i,l]of[[e.core,a,c.core],[e.conversation,o,c.conversation],[e.overview,s,c.overview]])Uq(i,l)&&(!t.silent||n.data===void 0)&&(n.error=r);return}finally{for(let[t,n,r]of[[e.core,a,c.core],[e.conversation,o,c.conversation],[e.overview,s,c.overview]])Uq(n,r)&&(t.loading=!1,t.refreshing=!1)}})();Bq.set(r,d);try{return await d}finally{Bq.get(r)===d&&Bq.delete(r)}}async function eJ(e,t={}){return Gq({key:$e.git.prSection(e.projectId,e.repo,e.number,`core`),query:()=>Eee(e.projectId,e.repo,e.number),staleTime:Iq,resource:e.core,options:t,apply:t=>Yq(e,t)})}async function tJ(e,t,n={}){if(t===`conversation`)return Gq({key:$e.git.prSection(e.projectId,e.repo,e.number,`conversation`),query:()=>Vee(e.projectId,e.repo,e.number),staleTime:Lq,resource:e.conversation,options:n});if(t===`overview`)return Gq({key:$e.git.prSection(e.projectId,e.repo,e.number,`overview`),query:()=>jee(e.projectId,e.repo,e.number),staleTime:Iq,resource:e.overview,options:n,apply:t=>Xq(e,t)});if(t===`checks`)return Gq({key:$e.git.prSection(e.projectId,e.repo,e.number,`checks`),query:()=>Tee(e.projectId,e.repo,e.number),staleTime:e.checks.data?.checks.status===`pending`?0:Iq,resource:e.checks,options:n,apply:({checks:t})=>_q(e.projectId,e.repo,e.number,t)});let r=e.core.data?.baseRefOid,i=e.core.data?.headRefOid;if(!(!r||!i))return Gq(t===`commits`?{key:$e.git.prHeadSection(e.projectId,e.repo,e.number,`commits`,i),query:()=>Nee(e.projectId,e.repo,e.number),staleTime:Rq,resource:e.commits,options:n}:{key:$e.git.prFiles(e.projectId,e.repo,e.number,r,i),query:()=>Ree(e.projectId,e.repo,e.number),staleTime:Rq,resource:e.files,options:n,apply:t=>{(!e.selectedFilePath||!t.files.some(t=>t.path===e.selectedFilePath))&&(e.selectedFilePath=t.files[0]?.path),e.selectedFilePath&&qq(e,e.selectedFilePath,{silent:!0})}})}function nJ(e){if(e.activeTab===`conversation`){Promise.all([tJ(e,`conversation`,{silent:!0}),tJ(e,`overview`,{silent:!0}),...e.checks.data?[]:[tJ(e,`checks`,{silent:!0})]]);return}tJ(e,e.activeTab,{silent:!0})}async function rJ(e){if(e.refreshing)return;e.refreshing=!0,e.refreshError=void 0;let t=e.core.data?.baseRefOid,n=e.core.data?.headRefOid;try{await eJ(e,{force:!0}),t&&n&&e.core.data?.baseRefOid&&e.core.data?.headRefOid&&(t!==e.core.data?.baseRefOid||n!==e.core.data?.headRefOid)&&(e.commits.data=void 0,e.commits.error=void 0,e.files.data=void 0,e.files.error=void 0,e.fileDiffs={},e.selectedFilePath=void 0);let r=e.activeTab===`conversation`?[`conversation`,`overview`,`checks`]:[e.activeTab];await Promise.all(r.map(t=>tJ(e,t,{force:!0}))),e.refreshError=e.core.error??r.map(t=>e[t].error).find(Boolean)}finally{e.refreshing=!1}}var iJ,aJ,oJ;function sJ(e){iJ=e}function cJ(){if(typeof document<`u`&&document.visibilityState!==`visible`)return;let e=iJ?Bi.prViews[Zi(iJ)]:void 0;e?.checks.data?.checks.status===`pending`&&!e.checks.loading&&!e.checks.refreshing&&tJ(e,`checks`,{force:!0,silent:!0})}function lJ(){cJ(),document.visibilityState===`visible`&&oJ?.()}function uJ(e){return typeof window>`u`||aJ!==void 0?dJ:(oJ=e,aJ=window.setInterval(cJ,jq),window.addEventListener(`focus`,lJ),document.addEventListener(`visibilitychange`,lJ),dJ)}function dJ(){typeof window>`u`||(aJ!==void 0&&window.clearInterval(aJ),aJ=void 0,oJ=void 0,window.removeEventListener(`focus`,lJ),document.removeEventListener(`visibilitychange`,lJ))}async function fJ(e){e.core.data&&(e.core.data={...e.core.data,state:`MERGED`}),vq(e.projectId,e.repo,e.number);let t=[`git`,e.projectId,`repo`,e.repo,`prs`];for(let[n,r]of Ke.getQueriesData({queryKey:t}))r&&Ke.setQueryData(n,{...r,prs:r.prs.filter(t=>t.number!==e.number)});await Ke.invalidateQueries({queryKey:$e.git.pr(e.projectId,e.repo,e.number)}),await Ke.invalidateQueries({queryKey:t})}function pJ(e,t,n){return`${e}:${encodeURIComponent(t)}:${n}`}function mJ(){return{loading:!1,refreshing:!1}}function hJ(e){return{...e,core:mJ(),conversation:mJ(),overview:mJ(),commits:mJ(),checks:mJ(),files:mJ(),fileDiffs:{},activeTab:`conversation`,refreshing:!1,merging:!1}}function gJ(e){Ui({kind:`pr`,id:e})}async function _J(e){if(e.activeTab===`conversation`&&(!e.core.data||!e.conversation.data||!e.overview.data)){await $q(e,{silent:!!(e.core.data||e.conversation.data||e.overview.data)})&&nJ(e);return}await eJ(e,{silent:!!e.core.data}),nJ(e)}function vJ(e,t,n){for(let r of Object.values(Bi.prViews)){if(r.projectId!==e||r.repo!==t)continue;let i=n.find(e=>e.number===r.number);i&&(r.summary=i,MK(r.checks.data?.checks,i.checks)||(r.checks.data={checks:i.checks}),r.core.data&&!NK(r.core.data,i)&&(r.core.data={...r.core.data,title:i.title,url:i.url,state:i.state,isDraft:i.isDraft,headRefName:i.headRefName,baseRefName:i.baseRefName,updatedAt:i.updatedAt}))}}async function yJ(e){if(e.projectId!==Q.selectedProjectId){let{selectProject:t}=await Xa(async()=>{let{selectProject:e}=await import(`./workspace-actions.svelte-fmfCaU70.js`).then(e=>e.g);return{selectProject:e}},__vite__mapDeps([30,11,8,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54]));await t(e.projectId)}let t=pJ(e.projectId,e.repo,e.number),n=Zi(t);gJ(t);let r=hq(e.projectId,e.repo,e.number);Bi.prViews[n]??=hJ({id:t,...e,summary:r});let i=Bi.prViews[n];r&&(i.summary=r),r&&!i.checks.data&&(i.checks.data={checks:r.checks}),Ai({kind:`pr`,id:t}),await _J(i)}async function bJ(e){let t=Bi.prViews[Zi(e)];t&&(gJ(e),Ai({kind:`pr`,id:e}),await _J(t))}async function xJ(e){let t=Bi.prViews[Zi(e)];t&&await rJ(t)}function SJ(e,t){let n=Bi.prViews[Zi(e)];n&&(n.activeTab=t,nJ(n))}function CJ(e,t){let n=Bi.prViews[Zi(e)];n&&(n.selectedFilePath=t,qq(n,t,{silent:!0}))}function wJ(e){let t=Bi.prViews[Zi(e)];t?.selectedFilePath&&qq(t,t.selectedFilePath,{force:!0})}function TJ(e,t){let n=Bi.prViews[Zi(e)];n&&(n.selectedMergeMethod=t)}function EJ(e){let t={kind:`pr`,id:e},n=Q.activeCenterTab?.kind===`pr`&&Q.activeCenterTab.id===e,r=Ni(t);ji(t),delete Bi.prViews[Zi(e)],n&&Fi(r)}function DJ(e,t){return JSON.stringify([e,t])}var OJ=new je,kJ=new DK({overview:Oq,prs:kq},(e,t)=>{let[n,r]=JSON.parse(e),i=iq(n,r);if(oq(i)){kJ.schedule(e,t);return}Promise.all([...t.overview?[FJ(n,r,{force:!0,silent:!0,onlyIfChanged:!0})]:[],...t.prs&&i.github?.authenticated?[BJ(n,r,!0,!0)]:[]])});function AJ(e,t,n){let r=DJ(e,t);n?OJ.add(r):OJ.delete(r)}function jJ(e,t){let n=HK.projects[Xi(e)]?.repoStates[ea(t)];n&&(n.overviewInvalidated=!0,OJ.has(DJ(e,t))&&(typeof document>`u`||document.visibilityState===`visible`)&&MJ(e,t,{overview:!0}))}function MJ(e,t,n){kJ.schedule(DJ(e,t),n)}function NJ(e,t){if(!e)return;let n=HK.projects[Xi(e)];n?.selectedRepo&&MJ(e,n.selectedRepo,t)}async function PJ(e,t={}){let n=rq(e),r=t.loadDetails!==!1;if(kK(n,r)){t.force&&(n.projectRefreshQueued=!0,n.queuedRefreshLoadsDetails||=r);return}let i=n.requestSeq+1;n.requestSeq=i,n.reposRequestInFlight=!0,n.activeRequestLoadsDetails=r,n.discoverError=void 0;let a=!n.loaded&&!t.silent;n.loadingRepos=a,n.refreshingRepos=!a&&!t.silent;try{t.force&&await Ke.invalidateQueries({queryKey:$e.git.repos(e.id)});let r=await Ke.fetchQuery({queryKey:$e.git.repos(e.id),queryFn:()=>Hi(e.id),staleTime:Dq});if(n.requestSeq!==i)return;n.projectIsRepo!==r.projectIsRepo&&(n.projectIsRepo=r.projectIsRepo),dq(n,r.repos);for(let t of r.repos)iq(e.id,t.relativePath);let a=Cq(e.id),o=r.repos.some(e=>e.relativePath===n.selectedRepo),s=r.repos[0]?.relativePath??`.`,c=n.selectedRepo;if(a&&r.repos.some(e=>e.relativePath===a)?c=a:o||(c=s),n.selectedRepo!==c&&(n.selectedRepo=c),n.loaded||=!0,n.loadedAt=Date.now(),Eq(e.id),r.repos.length>0&&n.activeRequestLoadsDetails){let t=iq(e.id,n.selectedRepo).loaded?{silent:!0,onlyIfChanged:!0}:{};await Promise.all([FJ(e.id,n.selectedRepo,t),LJ(e.id,n.selectedRepo),BJ(e.id,n.selectedRepo,!0,!1,!0)])}}catch(e){if(n.requestSeq!==i)return;n.discoverError=aq(e),n.loaded||dq(n,[])}finally{if(n.requestSeq===i&&(n.loadingRepos=!1,n.refreshingRepos=!1,n.reposRequestInFlight=!1,n.activeRequestLoadsDetails=!1,n.projectRefreshQueued)){let t=n.queuedRefreshLoadsDetails;n.projectRefreshQueued=!1,n.queuedRefreshLoadsDetails=!1,queueMicrotask(()=>void PJ(e,{force:!1,silent:!0,onlyIfChanged:!0,loadDetails:t}))}}}async function FJ(e,t,n={}){let r=iq(e,t);if(r.overviewRequestInFlight){n.force&&(r.overviewRefreshQueued=!0);return}kJ.noteDirectStart(DJ(e,t),{overview:!0});let i=r.requestSeq+1;r.requestSeq=i,r.overviewRequestInFlight=!0,n.silent||(r.loadingOverview=!0),r.overviewInvalidated=!1;try{n.force&&await Ke.invalidateQueries({queryKey:$e.git.overview(e,t)});let a=await Ke.fetchQuery({queryKey:$e.git.overview(e,t),queryFn:()=>Bee(e,t),staleTime:Dq});if(r.requestSeq!==i)return;yq(e,a.repo),uq(r,a)}catch(e){r.overviewInvalidated=!0,n.silent||yi.error(`Git overview failed: ${aq(e)}`)}finally{r.requestSeq===i&&(n.silent||(r.loadingOverview=!1),r.overviewRequestInFlight=!1,r.overviewRefreshQueued&&(r.overviewRefreshQueued=!1,queueMicrotask(()=>void FJ(e,t,{silent:!0,onlyIfChanged:!0}))))}}async function IJ(e,t){let n=iq(e,t);n.loadingBranches=!0;try{fq(n,(await Ke.fetchQuery({queryKey:$e.git.branches(e,t),queryFn:()=>Uee(e,t),staleTime:Dq})).branches)}catch(e){yi.error(`Could not list branches: ${aq(e)}`)}finally{n.loadingBranches=!1}}async function LJ(e,t,n=!1){let r=iq(e,t);if(!xq(e,t)){Sq(e,r);return}try{let i=$e.git.githubStatus(e,t);n&&await Ke.invalidateQueries({queryKey:i});let a=await Ke.fetchQuery({queryKey:i,queryFn:()=>kee(e,t),staleTime:r.github?.authenticated?Aq:Dq});pq(r,a),Eq(e),a.authenticated?await BJ(e,t,!0,n):mq(r,[])}catch(t){pq(r,{available:!1,authenticated:!1,login:null,reason:aq(t)}),mq(r,[]),Eq(e)}}var RJ=new ye;function zJ(e){return{author:e.prFilters.author,...e.prFilters.author===`username`?{username:e.prFilters.username}:{},drafts:e.prFilters.drafts,title:e.prFilters.title,...e.prFilters.currentBranchOnly&&e.repoSummary?.currentBranch?{head:e.repoSummary.currentBranch}:{},labels:[...e.prFilters.labels],sort:e.prFilters.sort}}async function BJ(e,t,n=!1,r=!1,i=!n){let a=iq(e,t);if(!xq(e,t)){Sq(e,a);return}let o=DJ(e,t),s=RJ.get(o);if(s)return a.prsRefreshQueued||=r,a.prsQueuedVisible||=i,i&&(a.loadingPrs=!0,a.prsError=void 0),s;i&&(a.loadingPrs=!0,a.prsError=void 0),a.prsRequestInFlight=!0,kJ.noteDirectStart(o,{prs:!0});let c=(async()=>{let i=n,o=r;try{do{a.prsRefreshQueued=!1,a.prsQueuedVisible=!1;let n=a.prsRequestSeq+1;a.prsRequestSeq=n;try{let r=zJ(a),i=$e.git.prs(e,t,Mq(r));o&&await Ke.invalidateQueries({queryKey:i});let s=await Ke.fetchQuery({queryKey:i,queryFn:()=>Kee(e,t,r),staleTime:TK(a.prs)?jq:Dq});if(a.prsRequestSeq===n&&Mq(r)===Mq(zJ(a))){let n=KK(e,t,s.prs);mq(a,n),vJ(e,t,n),a.prsError=void 0,a.prsLoadedAt=Date.now()}}catch(e){a.prsRequestSeq===n&&!i&&(a.prsError=aq(e),yi.error(`Could not list PRs: ${a.prsError}`))}o=a.prsRefreshQueued,i=!a.prsQueuedVisible}while(a.prsRefreshQueued&&(typeof document>`u`||document.visibilityState===`visible`))}finally{a.prsRequestInFlight=!1,a.prsRefreshQueued=!1,a.prsQueuedVisible=!1,a.loadingPrs=!1}})();RJ.set(o,c);try{await c}finally{RJ.get(o)===c&&RJ.delete(o)}}function VJ(e,t){if(typeof document<`u`&&document.visibilityState!==`visible`)return;let n=HK.projects[Xi(e)]?.repoStates[ea(t)];if(n?.overviewInvalidated){MJ(e,t,{overview:!0});return}!n||Nq(n.loadedAt,Date.now(),3e4)||MJ(e,t,{overview:!0})}function HJ(e,t){if(typeof document<`u`&&document.visibilityState!==`visible`)return;let n=HK.projects[Xi(e)]?.repoStates[ea(t)];!n?.github?.authenticated||Nq(n.prsLoadedAt,Date.now(),6e4)||MJ(e,t,{prs:!0})}function UJ(e){let t=rq(e);if(!t.loaded){PJ(e);return}t.reposRequestInFlight||PJ(e,{silent:!0,onlyIfChanged:!0})}function WJ(e,t){let n=HK.projects[Xi(e)];if(!n||t===n.selectedRepo)return;n.selectedRepo=t,wq(e,t);let r=iq(e,t);r.loaded?oq(r)||(FJ(e,t,{silent:!0,onlyIfChanged:!0}),r.github?.authenticated&&BJ(e,t,!0)):(FJ(e,t),LJ(e,t)),Eq(e)}function GJ(e,t){MJ(e,t,{overview:!0,prs:!0})}function KJ(e,t){yi.error(e,{description:aq(t)})}async function qJ(e,t){let n=iq(e,t);n.operations.fetching=!0;try{yq(e,(await wee(e,t)).repo),yi.success(`Fetched from remote`),GJ(e,t)}catch(e){KJ(`Fetch failed`,e)}finally{n.operations.fetching=!1}}async function JJ(e,t){let n=iq(e,t);n.operations.pulling=!0;try{yq(e,(await Gee(e,t)).repo),yi.success(`Pulled from upstream`),GJ(e,t)}catch(e){KJ(`Pull failed`,e)}finally{n.operations.pulling=!1}}async function YJ(e,t){let n=iq(e,t);n.operations.pushing=!0;try{yq(e,(await See(e,t)).repo),yi.success(`Pushed to upstream`),GJ(e,t)}catch(e){KJ(`Push failed`,e)}finally{n.operations.pushing=!1}}async function XJ(e,t){let n=iq(e,t);n.operations.syncing=!0;try{yq(e,(await Oi(e,t)).repo),yi.success(`Branch synced`),GJ(e,t)}catch(e){KJ(`Sync failed`,e)}finally{n.operations.syncing=!1}}async function ZJ(e,t){let n=iq(e,t);n.operations.switchingBaseAndPulling=!0;try{let r=await Wee(e,t);yq(e,r.repo),fq(n,[]),yi.success(`Switched to ${r.repo.baseBranch} and pulled`),GJ(e,t)}catch(e){KJ(`Switch and pull failed`,e)}finally{n.operations.switchingBaseAndPulling=!1}}async function QJ(e,t,n){if(n.current)return!1;let r=iq(e,t);r.operations.switchingBranch=n.name;try{let i=await Cee(e,t,n.name);return yq(e,i.repo),fq(r,[]),yi.success(`Switched to ${i.repo.currentBranch??n.name}`),GJ(e,t),!0}catch(e){return KJ(`Switch branch failed`,e),!1}finally{r.operations.switchingBranch=void 0}}async function $J(e,t,n){if(n.trim().length===0)return!1;let r=iq(e,t);r.operations.creatingBranch=!0;try{return yq(e,(await Iee(e,t,n.trim())).repo),fq(r,[]),yi.success(`Created branch ${n.trim()}`),GJ(e,t),!0}catch(e){return KJ(`Create branch failed`,e),!1}finally{r.operations.creatingBranch=!1}}async function eY(e,t,n,r){let i=iq(e,t);i.operations.fileMutation={path:n.path,action:r};try{yq(e,(await(r===`stage`?Ei:r===`unstage`?Di:zee)(e,t,n.path)).repo),await FJ(e,t)}catch(e){KJ(`${r[0].toUpperCase()}${r.slice(1)} failed`,e)}finally{i.operations.fileMutation=void 0}}async function tY(e,t,n){let r=iq(e,t),i=r.changes?.files??[],a=n===`stage-all`?i.filter(e=>e.untracked||e.worktree!==` `):i.filter(e=>e.staged);if(a.length===0)return;let o=n===`stage-all`?Ei:Di;r.operations.bulkMutation=n;try{for(let n of a)await o(e,t,n.path);await FJ(e,t)}catch(e){KJ(`${n===`stage-all`?`Stage all`:`Unstage all`} failed`,e)}finally{r.operations.bulkMutation=void 0}}var nY=2e3,rY=new je,iY,aY=0;function oY(){iY===void 0||typeof window>`u`||(window.clearTimeout(iY),iY=void 0)}function sY(e,t,n){iY!==void 0||typeof window>`u`||(iY=window.setTimeout(()=>{iY=void 0,uY(e,{...t,force:!1})},n))}function cY(e){let t=Bi.gitContext;!t||t.projectId!==e.projectId||CK(t)!==CK(e)?Bi.gitContext=e:Bi.gitContext={...t,loadedAt:e.loadedAt}}async function lY(e,t={}){let n=Q.projects.find(t=>t.id===e);if(!n)return;await PJ(n,{force:t.force,silent:!0,onlyIfChanged:!t.force,loadDetails:!1}),Eq(e);let r=Bi.gitContext;return r?.projectId===e?r:void 0}async function uY(e,t={}){let n=e??un.projectId;if(!n)return;t.force&&oY();let r=Date.now(),i=r-aY;if(!t.force&&aY>0&&i<nY){sY(n,t,nY-i);return}if(rY.has(n)){t.force&&sY(n,t,nY);return}aY=r,rY.add(n);try{let e=await lY(n,t);e&&cY(e)}catch{Bi.gitContext?.projectId===n&&(Bi.gitContext=void 0)}finally{rY.delete(n)}}function dY(){oY(),Bi.gitContext=void 0}function fY(e){NJ(e,{overview:!0,prs:!0})}var pY=Ie({suggestions:[],trustRequests:[],statuses:[],diagnostics:[],loading:!1,error:void 0,lastProjectId:void 0,dismissedTrustIds:[]}),mY={idle:0,critical:1,"core-ready":2,progressive:3};function hY(e){return e===`core-ready`||e===`progressive`||e===`failed`}var gY=class{phase=`idle`;generation=0;error;begin(){return this.generation+=1,this.phase=`idle`,this.error=void 0,this.generation}isCurrent(e){return this.generation===e&&this.phase!==`stopped`}transition(e,t,n){if(!this.isCurrent(e))return!1;if(t===`failed`)return this.phase===`progressive`?!1:(this.phase=t,n!==void 0&&(this.error=n),!0);if(t===`stopped`)return this.stop(e);let r=mY[this.phase],i=mY[t];return r===void 0||i===void 0||i!==r+1?!1:(this.phase=t,!0)}stop(e){return e!==void 0&&e!==this.generation?!1:(this.generation+=1,this.phase=`stopped`,!0)}},_Y=class{#e=X(`idle`);get phase(){return L(this.#e)}set phase(e){R(this.#e,e,!0)}#t=X(0);get generation(){return L(this.#t)}set generation(e){R(this.#t,e,!0)}#n=X();get error(){return L(this.#n)}set error(e){R(this.#n,e,!0)}get coreReady(){return this.phase===`core-ready`||this.phase===`progressive`}get progressiveActive(){return this.phase===`progressive`}},vY=new gY,yY=new _Y;function bY(){yY.phase=vY.phase,yY.generation=vY.generation,yY.error=vY.error}function xY(){let e=vY.begin();return bY(),e}function SY(e){return vY.isCurrent(e)}function CY(e,t,n){let r=vY.transition(e,t,n);return r&&bY(),r}function wY(e,t){return CY(e,`failed`,t)}function TY(e){let t=vY.stop(e);return t&&bY(),t}async function EY(e,t={}){if(!e){pY.suggestions=[],pY.trustRequests=[],pY.lastProjectId=void 0;return}pY.loading=!0,pY.error=void 0;try{let n=await oo(e,t);pY.suggestions=n.suggestions,pY.trustRequests=n.trustRequests.filter(e=>!pY.dismissedTrustIds.includes(e.trustId)),pY.statuses=n.statuses,pY.diagnostics=n.diagnostics??[],pY.lastProjectId=e}catch(e){pY.error=MY(e)}finally{pY.loading=!1}}async function DY(e){pY.loading=!0,pY.error=void 0;try{pY.statuses=await ho(e)}catch(e){pY.error=MY(e)}finally{pY.loading=!1}}async function OY(e,t){await eo(e),await DY(t),yi.success(e.enabled?`Prompt suggestion enabled`:`Prompt suggestion disabled`)}async function kY(e,t){let n=await to(e);return await DY(t),yi.success(`Prompt suggestion created`),n.suggestion}function AY(e){pY.dismissedTrustIds.includes(e)||(pY.dismissedTrustIds=[...pY.dismissedTrustIds,e]),pY.trustRequests=pY.trustRequests.filter(t=>t.trustId!==e)}async function jY(e){await ao(e),pY.dismissedTrustIds=pY.dismissedTrustIds.filter(t=>t!==e.trustId),yi.success(e.status===`unset`?`Prompt suggestion trust reset`:`Prompt suggestion ${e.status}`)}function MY(e){return e instanceof Error?e.message:String(e)}var NY=P(`<!> <!> <!>`,1),PY=P(`<p class="text-xs text-muted-foreground"> </p>`),FY=P(`<section class="grid gap-1 rounded-md border border-border bg-transparent p-3"><div class="flex items-center justify-between gap-3"><strong class="text-sm font-medium text-foreground"> </strong> <span class="rounded-full border border-border px-2 py-0.5 text-xs text-muted-foreground"> </span></div> <p class="font-mono text-xs text-muted-foreground"> </p> <!></section>`),IY=P(`<div class="grid gap-4"><div class="flex gap-3 rounded-md border border-warning/40 bg-warning/10 p-3 text-sm"><!> <p class="text-muted-foreground">Only allow JavaScript from suggestion files you trust. Nerve runs it
132
- locally in the daemon with a limited context and timeout, but it is
133
- still local code from the listed Markdown file.</p></div> <div class="grid gap-2"></div></div>`);function LY(e,t){x(t,!0);let n=X(!1),r=l(()=>pY.trustRequests),i=l(()=>L(r).length>0);async function a(e){R(n,!0);try{for(let t of L(r))await jY({trustId:t.trustId,status:e});t.projectId&&await EY(t.projectId,{conversationId:t.conversationId,agentId:t.agentId})}finally{R(n,!1)}}function o(){for(let e of L(r))AY(e.trustId)}IF(e,{get open(){return L(i)},title:`Allow prompt suggestion JavaScript?`,description:`Some prompt suggestions include JavaScript that decides when the suggestion appears.`,size:`md`,onOpenChange:e=>{e||o()},footer:e=>{var t=NY(),r=F(t);W(r,{size:`sm`,variant:`ghost`,get disabled(){return L(n)},onclick:o,children:(e,t)=>{g(),q(e,D(`Decide later`))},$$slots:{default:!0}});var i=Y(r,2);W(i,{size:`sm`,variant:`destructive`,get disabled(){return L(n)},onclick:()=>a(`denied`),children:(e,t)=>{g(),q(e,D(`Deny`))},$$slots:{default:!0}}),W(Y(i,2),{size:`sm`,get disabled(){return L(n)},onclick:()=>a(`allowed`),children:(e,t)=>{g(),q(e,D(`Allow`))},$$slots:{default:!0}}),q(e,t)},children:(e,t)=>{var n=IY(),i=B(n);pW(B(i),{class:`mt-0.5 size-4 flex-none text-warning`,strokeWidth:2.2}),g(2),y(i);var a=Y(i,2);O(a,21,()=>L(r),e=>e.trustId,(e,t)=>{var n=FY(),r=B(n),i=B(r),a=B(i,!0);y(i);var o=Y(i,2),s=B(o,!0);y(o),y(r);var c=Y(r,2),l=B(c,!0);y(c);var u=Y(c,2),d=e=>{var n=PY(),r=B(n,!0);y(n),J(()=>f(r,L(t).description)),q(e,n)};p(u,e=>{L(t).description&&e(d)}),y(n),J(()=>{f(a,L(t).label),f(s,L(t).sourceKind),f(l,L(t).path)}),q(e,n)}),y(a),y(n),q(e,n)},$$slots:{footer:!0,default:!0}}),H()}var RY=P(`<!> <!>`,1);function zY(e,t){x(t,!0);let n=K(t,`active`,3,!0),r=l(()=>t.tab??Q.activeCenterTab),i=l(()=>L(r)?.kind===`conversation`?L(r).id:void 0),a=l(()=>L(r)?.kind===`pending-conversation`?L(r).id:void 0),o=l(()=>L(i)?Yi.conversationViews[$i(L(i))]:void 0),s=l(()=>L(a)?Yi.pendingConversations[na(L(a))]:void 0),c=l(()=>L(i)?Q.conversations.find(e=>e.id===L(i)):void 0),u=l(()=>L(c)?Q.agents.find(e=>e.id===L(c).activeAgentId||e.conversationId===L(c).id):void 0),d=l(()=>{let e=L(s)?.projectId??L(c)?.projectId;return e?Q.projects.find(t=>t.id===e):L(r)?void 0:dm.activeProject}),f=l(()=>!!L(s)),p=l(()=>{let e=L(u)?.id;return Q.userQuestions.filter(t=>L(i)&&t.conversationId===L(i)?!0:!!(e&&t.agentId===e))}),m=l(()=>{let e=L(u)?.id;return Q.planReviews.filter(t=>L(i)&&t.conversationId===L(i)?!0:!!(e&&t.agentId===e))}),h=l(()=>{let e=L(u)?.id;return Q.approvals.filter(t=>L(i)&&t.conversationId===L(i)?!0:!!(e&&t.agentId===e))}),g=l(()=>L(m)[0]?Q.agents.find(e=>e.id===L(m)[0]?.agentId):void 0),_=l(()=>fs(L(u)?.id)),v=l(()=>L(s)?.selectedModelKey??(L(_)?.model?Ki(L(_).model):L(u)?.model?Ki(L(u).model):Yi.selectedModelKey)),y=l(()=>Pi.models.find(e=>Ki(e)===L(v))),b=l(()=>L(u)?.model),S=l(()=>L(b)?Pi.models.find(e=>Ki(e)===Ki(L(b))):void 0),C=l(()=>L(s)?.thinkingLevel??L(_)?.thinkingLevel??L(u)?.thinkingLevel??`off`),w=l(()=>L(s)?.mode??L(_)?.mode??L(u)?.mode??L(c)?.mode??Yi.selectedMode),T=l(()=>L(s)?.permissionLevel??L(_)?.permissionLevel??L(u)?.permissionLevel??L(c)?.permissionLevel??Yi.selectedPermissionLevel),E=l(()=>L(s)?.approvalPolicy??L(_)?.approvalPolicy??L(u)?.approvalPolicy??L(c)?.approvalPolicy??Yi.selectedApprovalPolicy),D=l(()=>L(s)?.composerText??L(o)?.composerText??``),O=l(()=>Li(Pi.models,Pi.authProviders,Pi.settingsDraft?.scopedModels)),k=l(()=>L(g)?.model?Ki(L(g).model):L(v)),ee=l(()=>L(g)?.thinkingLevel??L(C)),A=l(()=>L(y)?.contextWindow??L(S)?.contextWindow??L(o)?.contextUsage?.contextWindow??0),j={"commit-changes":SK,"commit-on-feature-branch":gW,"create-pull-request":df},M=l(()=>pY.suggestions.map(e=>({id:`prompt:${e.id}`,label:e.label,prompt:e.prompt,icon:e.source.kind===`builtin`?j[e.name]??Jz:Jz}))),N=l(()=>{let e=Bi.gitContext;return e?`${e.projectId}:${CK(e)}`:`none`}),te=l(()=>n()?Yi.slashCompletions:[]);function ne(e,t){return!!(e&&t&&e.kind===t.kind&&e.id===t.id)}async function P(){let e=L(r);!e||ne(Q.activeCenterTab,e)||await Fi(e)}function re(e){let t=L(s);if(t){t.composerText=e;return}if(L(i)){ms(L(i)).composerText=e;return}if(n()&&ne(Q.activeCenterTab,L(r))){So(e);return}mn.text=e}async function ie(e){await P(),await e()}async function I(e,t=!1){await ie(()=>jo(e,t)),sK()}async function ae(e){await ie(()=>jo(e.parentEntryId)),re(e.text),sK()}function R(e,t){L(d)&&mK({projectId:L(d).id,path:e,line:t})}z(()=>{!yY.progressiveActive||!n()||!L(d)?.id||(L(N),EY(L(d).id,{conversationId:L(i),agentId:L(u)?.id}))});function oe(e){re(L(D).trim()?`${L(D)}\n\n${e.prompt}`:e.prompt)}function se(e){ie(()=>Co(e.prompt,{clearComposer:!1}))}async function ce(e){try{await Sr(`agent.promptQueue.cancel`,{agentId:e.agentId,queuedPromptId:e.id});let t=ms(e.conversationId);return t.queuedPrompts=t.queuedPrompts.filter(t=>t.id!==e.id),!0}catch(e){let t=e instanceof Error?e.message:String(e);return yi.error(`Queued prompt action failed`,{description:t}),!1}}function le(e){ie(async()=>{await ce(e)&&yi.message(`Queued prompt discarded`)})}function ue(e){ie(async()=>{await ce(e)&&(re(e.text),sK(),yi.success(`Moved queued prompt to composer`))})}var de=RY(),fe=F(de);{let e=l(()=>Q.status?.storage.userHome),t=l(()=>L(o)?.entries??[]),r=l(()=>L(o)?.optimisticMessages??[]),i=l(()=>L(o)?.toolCalls??[]),a=l(()=>L(o)?.treeNodes??[]),g=l(()=>L(o)?.activeRun),_=l(()=>L(o)?.transient),y=l(()=>L(o)?.queuedPrompts??[]),b=l(()=>L(s)?.sending??L(o)?.sending??!1),x=l(()=>L(o)?.stopping??!1),S=l(()=>L(o)?.contextUsage),j=l(()=>n()?bs:void 0);aK(fe,{get active(){return n()},get activeProject(){return L(d)},get activeConversation(){return L(c)},get activeAgent(){return L(u)},get activePendingConversation(){return L(s)},get pendingConversationActive(){return L(f)},get homeDir(){return L(e)},get approvals(){return L(h)},get pendingUserQuestions(){return L(p)},get pendingPlanReviews(){return L(m)},get entries(){return L(t)},get optimisticMessages(){return L(r)},get toolCalls(){return L(i)},get treeNodes(){return L(a)},get activeRun(){return L(g)},get transient(){return L(_)},get queuedPrompts(){return L(y)},get sending(){return L(b)},get stopping(){return L(x)},get composerText(){return L(D)},get composerSuggestions(){return L(M)},onSendSuggestion:se,onDraftSuggestion:oe,get models(){return L(O)},get selectedModelKey(){return L(v)},get thinkingLevel(){return L(C)},get planReviewModels(){return L(O)},get planReviewModelKey(){return L(k)},get planReviewThinkingLevel(){return L(ee)},get mode(){return L(w)},get permissionLevel(){return L(T)},get approvalPolicy(){return L(E)},get slashCompletions(){return L(te)},get contextUsage(){return L(S)},get contextWindow(){return L(A)},get composerFocusToken(){return oK.focusToken},get composerEscapeToken(){return oK.escapeToken},get micShortcutToken(){return oK.micToken},get fileCompletions(){return L(j)},onComposerChange:re,onSubmit:()=>{ie(Lo)},get onAnswerUserQuestion(){return Eo},get onDismissUserQuestion(){return Bo},onAbort:()=>{ie(L(o)?.transient?.compaction?.state===`running`?as:No)},onCompact:()=>{ie(yo)},get onNewConversationInProject(){return os},onOpenFile:R,onModelChange:e=>{ie(()=>Do(e))},onThinkingLevelChange:e=>{ie(()=>Io(e))},onModeChange:e=>{ie(()=>wo(e))},onPermissionChange:e=>{ie(()=>Ao(e))},onApprovalPolicyChange:e=>{ie(()=>Po(e))},get onGrantApproval(){return To},get onDenyApproval(){return Ro},onAcceptPlanReview:(e,t)=>bo(e,t),onAcceptPlanReviewInNewChat:(e,t)=>zo(e,t),get onRejectPlanReview(){return ko},onContinueFromFailure:e=>{ie(()=>is(e))},onDiscardQueuedPrompt:le,onMoveQueuedPromptToComposer:ue,onNavigateToEntry:(e,t)=>{I(e,t)},onEditEntry:e=>{ae(e)},onOpenHistory:()=>{ie(uK)}})}var B=Y(fe,2);{let e=l(()=>L(d)?.id),t=l(()=>L(u)?.id);LY(B,{get projectId(){return L(e)},get conversationId(){return L(i)},get agentId(){return L(t)}})}q(e,de),H()}var BY=P(`<div class="lazy-shell-pending svelte-1iqc6q3" aria-busy="true"><!></div>`);function VY(e){var t=BY();ke(B(t),{class:`size-5`}),y(t),q(e,t)}function HY(e){return`${e.projectId}:${encodeURIComponent(e.repo)}:${e.area}:${encodeURIComponent(e.path)}`}function UY(e){Ui({kind:`diff`,id:e})}async function WY(e){e.data?e.refreshing=!0:e.loading=!0,e.error=void 0;try{e.data=await Lee(e.projectId,e.repo,e.path,e.area),e.path=e.data.path,e.renamedFrom=e.data.renamedFrom}catch(t){let n=t instanceof Error?t.message:String(t);e.error=n,yi.error(`Could not load diff`,{description:n})}finally{e.loading=!1,e.refreshing=!1}}async function GY(e){if(e.projectId!==Q.selectedProjectId){let{selectProject:t}=await Xa(async()=>{let{selectProject:e}=await import(`./workspace-actions.svelte-fmfCaU70.js`).then(e=>e.g);return{selectProject:e}},__vite__mapDeps([30,11,8,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54]));await t(e.projectId)}let t=HY(e),n=ta(t);Bi.diffViews[n]??={id:t,...e,loading:!1,refreshing:!1},UY(t),Ai({kind:`diff`,id:t}),await WY(Bi.diffViews[n])}async function KY(e){let t=Bi.diffViews[ta(e)];t&&(UY(e),Ai({kind:`diff`,id:e}),!t.data&&!t.loading&&await WY(t))}async function qY(e){let t=Bi.diffViews[ta(e)];t&&!t.loading&&!t.refreshing&&await WY(t)}function JY(e){let t={kind:`diff`,id:e},n=Q.activeCenterTab?.kind===`diff`&&Q.activeCenterTab.id===e,r=Ni(t);ji(t),delete Bi.diffViews[ta(e)],n&&Fi(r)}var YY={kind:`logs`,id:`logs`};function XY(){Q.status?.capabilities.applicationLogs&&(Ui(YY),Ai(YY))}function ZY(){Q.status?.capabilities.applicationLogs&&(Ui(YY),Ai(YY))}function QY(){let e=Q.activeCenterTab?.kind===`logs`,t=Ni(YY);ji(YY),e&&Fi(t)}function $Y(e){return e.definitionId??e.restartRootTaskId??e.id}function eX(e){let t=Ii.tasks.find(t=>t.id===e);return t?$Y(t):e}function tX(e){let t=Ii.selectedRunByEntry[e],n=Ii.tasks.filter(t=>$Y(t)===e).sort((e,t)=>t.startedAt.localeCompare(e.startedAt));return n.find(e=>e.id===t)??n[0]}function nX(e,t){Ii.selectedRunByEntry[e]=t}async function rX(e,t){Ii.tasks.find(n=>n.id===t&&$Y(n)===e)&&(nX(e,t),Ii.selectedTaskId=t,await xo(t))}async function iX(e){let t=Ii.tasks.find(t=>t.id===e);if(t?.projectId&&t.projectId!==Q.selectedProjectId){let{selectProject:e}=await Xa(async()=>{let{selectProject:e}=await import(`./workspace-actions.svelte-fmfCaU70.js`).then(e=>e.g);return{selectProject:e}},__vite__mapDeps([30,11,8,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54]));await e(t.projectId)}let n=eX(e);nX(n,e),Ui({kind:`task`,id:n}),await aX(n)}async function aX(e){let t=tX(e);Ui({kind:`task`,id:e}),Ai({kind:`task`,id:e}),t?await rX(e,t.id):Ii.selectedTaskId=void 0}async function oX(e){let t={kind:`task`,id:e},n=Q.activeCenterTab?.kind===`task`&&Q.activeCenterTab.id===e,r=Ni(t);ji(t),delete Ii.selectedRunByEntry[e],Ii.selectedTaskId&&eX(Ii.selectedTaskId)===e&&(Ii.selectedTaskId=void 0,Ii.taskLogs=void 0),n&&await Fi(r)}ki({select:{conversation:e=>Ho(e.id),"pending-conversation":e=>Os(e.id),task:e=>aX(e.id),file:e=>hK(e.id),pr:e=>bJ(e.id),diff:e=>KY(e.id),settings:()=>nee(),auth:()=>XH(),logs:()=>ZY()},close:{conversation:e=>hs(e.id),"pending-conversation":e=>Oo(e.id),task:e=>oX(e.id),file:e=>bK(e.id),pr:e=>EJ(e.id),diff:e=>JY(e.id),settings:()=>gt(),auth:()=>ZH(),logs:()=>QY()}});var sX={get activeCenterFileView(){let e=Q.activeCenterTab;if(e?.kind===`file`)return ra.fileViews[Qi(e.id)]},get openFileTabs(){return ra.openFileTabIds}};function cX(e){return e?.kind===`conversation`||e?.kind===`pending-conversation`}function lX(e){return`${e.kind}:${e.id}`}function uX(e,t){return!!(e&&t&&e.kind===t.kind&&e.id===t.id)}function dX(e,t){return e.length===t.length&&e.every((e,n)=>uX(e,t[n]))}function fX(e,t,n,r=4){let i=new Set(n.filter(cX).map(lX)),a=e.filter(e=>i.has(lX(e)));if(!cX(t))return a.slice(0,r);let o=lX(t);return i.has(o)?[t,...a.filter(e=>lX(e)!==o)].slice(0,r):a.slice(0,r)}function pX(e,t,n=4){if(!cX(t))return e.slice(0,n);let r=lX(t);return e.some(e=>lX(e)===r)?e.slice(0,n):[t,...e].slice(0,n)}var mX=new Set([`$$slots`,`$$events`,`$$legacy`]);function hX(e,t){let n=U(t,mX),r=[[`path`,{d:`M12 8V4H8`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`}],[`path`,{d:`M2 14h2`}],[`path`,{d:`M20 14h2`}],[`path`,{d:`M15 13v2`}],[`path`,{d:`M9 13v2`}]];G(e,V({name:`bot`},()=>n,{get iconNode(){return r}}))}var gX={read_only:`read only`,supervised:`supervised`,autonomous:`autonomous`};function _X(e){return gX[e]??e}function vX({status:e,activeProject:t,activeConversation:n}){return[{label:`Project`,value:t?.name},{label:`Directory`,value:t?.dir,mono:!0},{label:`Conversation`,value:n?.id,mono:!0},{label:`Daemon`,value:e?.daemonId,mono:!0},{label:`Data`,value:e?.dataDir,mono:!0}]}function yX(e){return e.map(e=>`${e.label}: ${e.value??`—`}`).join(`
134
- `)}function bX(e,t){x(t,!0);let n=K(t,`conversationAgents`,19,()=>[]);function r(e){return e.status===`running`||e.status===`awaiting_user`}function i(e){return[...e].sort((e,n)=>{let i=+(e.id===t.activeAgent?.id),a=+(n.id===t.activeAgent?.id);if(i!==a)return a-i;let o=+!!r(e),s=+!!r(n);if(o!==s)return s-o;let c=new Date(e.updatedAt).getTime(),l=new Date(n.updatedAt).getTime();return c===l?new Date(n.createdAt).getTime()-new Date(e.createdAt).getTime():l-c})}function a(e){return e.parentAgentId?`Subagent`:`Main agent`}let o={minimal:`min`,low:`low`,medium:`med`,high:`high`,xhigh:`xhi`,max:`max`};function s(e){let t=Ji(e),n=o[e.thinkingLevel??`off`];return n?`${t} (${n})`:t}function c(e){return`${e.mode} · ${_X(e.permissionLevel)} · ${s(e)}`}function u(e){let t=e.model?`${e.model.provider}/${e.model.modelId}`:`model pending`,n=e.thinkingLevel&&e.thinkingLevel!==`off`?`thinking: ${e.thinkingLevel}`:void 0;return[e.id,`status: ${e.status}`,`mode: ${e.mode} · ${_X(e.permissionLevel)}`,`model: ${t}`,n].filter(Boolean).join(`
135
- `)}let d=l(()=>$r(i(n()),{getKey:e=>e.id,getParentKey:e=>e.parentAgentId??void 0,getLabel:a}));var f=_(),m=F(f),h=e=>{Kr(e,{get icon(){return hX},title:`No agents yet`,description:`Agents appear once a run starts.`})},g=e=>{Xr(e,{get nodes(){return L(d)},ariaLabel:`Conversation agents`,itemStacked:!0,itemMetaMono:!0,itemVariant:`card`,indentItems:!1,getItemDescription:c,getItemMeta:e=>e.id,getItemTitle:u,getItemSelected:e=>e.id===t.activeAgent?.id,onItemActivate:e=>t.onSelectAgent?.(e),itemLabelTrailing:(e,t=N)=>{{let n=l(()=>Jp(t().status,!1,t().mode)),r=l(()=>Yp(t().status));ci(e,{get tone(){return L(n)},get pulse(){return L(r)}})}},$$slots:{itemLabelTrailing:!0}})};p(m,e=>{n().length===0?e(h):e(g,-1)}),q(e,f),H()}var xX=new Set([`$$slots`,`$$events`,`$$legacy`]);function SX(e,t){let n=U(t,xX),r=[[`path`,{d:`M12 15V3`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}],[`path`,{d:`m7 10 5 5 5-5`}]];G(e,V({name:`download`},()=>n,{get iconNode(){return r}}))}var CX=new Set([`$$slots`,`$$events`,`$$legacy`]);function wX(e,t){let n=U(t,CX),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M10 12.5 8 15l2 2.5`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`}]];G(e,V({name:`file-code`},()=>n,{get iconNode(){return r}}))}var TX=new Set([`$$slots`,`$$events`,`$$legacy`]);function EX(e,t){let n=U(t,TX),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`}]];G(e,V({name:`file-braces`},()=>n,{get iconNode(){return r}}))}var DX=new Set([`$$slots`,`$$events`,`$$legacy`]);function OX(e,t){let n=U(t,DX),r=[[`path`,{d:`M15 12h-5`}],[`path`,{d:`M15 8h-5`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`}]];G(e,V({name:`scroll-text`},()=>n,{get iconNode(){return r}}))}var kX=P(`<!> <span> </span>`,1),AX=P(`<!> <!>`,1);function jX(e,t){x(t,!0);let n=l(()=>{if(!t.activeConversation)return[];let e=t.activeConversation.id;return[{id:`json`,label:`JSON`,icon:EX,href:t.exportUrl?.(`json`),filename:`conversation-${e}.json`},{id:`md`,label:`Markdown`,icon:lf,href:t.exportUrl?.(`md`),filename:`conversation-${e}.md`},{id:`html`,label:`HTML`,icon:wX,href:t.exportUrl?.(`html`),filename:`conversation-${e}.html`},{id:`system-prompt`,label:`System prompt`,icon:OX,href:t.systemPromptUrl?.()}]});function r(e){if(!e.href)return;let t=document.createElement(`a`);t.href=e.href,e.filename&&(t.download=e.filename),t.rel=`noopener`,document.body.append(t),t.click(),t.remove()}var i=_();d(F(i),()=>CR,(e,i)=>{i(e,{children:(e,i)=>{var a=AX(),o=F(a);{let e=l(()=>Te({variant:`ghost`,size:`icon-xs`})),n=l(()=>!t.activeConversation);d(o,()=>FR,(t,r)=>{r(t,{get class(){return L(e)},"aria-label":`Export conversation`,title:`Export conversation`,get disabled(){return L(n)},children:(e,t)=>{SX(e,{class:`size-4`,"aria-hidden":`true`})},$$slots:{default:!0}})})}d(Y(o,2),()=>kR,(e,t)=>{t(e,{align:`end`,class:`w-48`,children:(e,t)=>{var i=_();O(F(i),17,()=>L(n),e=>e.id,(e,t)=>{let n=l(()=>L(t).icon);var i=_(),a=F(i);{let e=l(()=>!L(t).href);d(a,()=>jR,(i,a)=>{a(i,{get disabled(){return L(e)},onSelect:()=>r(L(t)),children:(e,r)=>{var i=kX(),a=F(i);d(a,()=>L(n),(e,t)=>{t(e,{})});var o=Y(a,2),s=B(o,!0);y(o),J(()=>f(s,L(t).label)),q(e,i)},$$slots:{default:!0}})})}q(e,i)}),q(e,i)},$$slots:{default:!0}})}),q(e,a)},$$slots:{default:!0}})}),q(e,i),H()}function MX(e,t){var n=_();O(F(n),17,()=>t.fields,e=>e.label,(e,t)=>{{let n=l(()=>L(t).mono??!1);Gr(e,{get label(){return L(t).label},get value(){return L(t).value},get title(){return L(t).value},get mono(){return L(n)},dense:!0})}}),q(e,n)}var NX=ne(`<path fill="none" stroke-width="8" stroke-linecap="round"></path>`),PX=P(`<div class="relative mx-auto w-full max-w-56"><svg viewBox="0 0 120 66" class="w-full" role="img"><path fill="none" stroke-width="8" stroke-linecap="round" class="stroke-muted"></path><!></svg> <div class="absolute inset-x-4 bottom-0.5 flex min-w-0 flex-col items-center gap-1"><span> </span> <span class="max-w-full truncate text-xs text-muted-foreground"> </span> <!></div></div>`),FX=P(`<p class="py-1.5 text-xs text-muted-foreground">Context usage is available after the first run.</p>`);function IX(e,t){x(t,!0);let n=K(t,`contextWindow`,3,0),r=Math.PI*50,i=`M 10 60 A 50 50 0 0 1 110 60`,a=l(()=>n()||t.contextUsage?.contextWindow||0),o=l(()=>t.contextUsage?.tokens??null),s=l(()=>L(o)!=null&&L(a)>0?L(o)/L(a)*100:t.contextUsage?.percent??null),c=l(()=>L(a)>0||L(s)!=null),u=l(()=>L(s)==null?0:Math.max(0,Math.min(100,L(s)))),d=l(()=>L(s)==null?`—`:`${Math.round(L(s))}%`),m=l(()=>L(o)!=null&&L(a)>0?`${pv(L(o))} / ${pv(L(a))} tokens`:L(a)>0?`${pv(L(a))} token window`:`Usage unknown`),g=l(()=>mv(L(s))),v=l(()=>L(g)===`error`?`stroke-destructive-solid`:L(g)===`warning`?`stroke-warning`:`stroke-primary`),b=l(()=>L(g)===`error`?`text-destructive`:L(g)===`warning`?`text-warning`:`text-foreground`);var S=_(),C=F(S),T=e=>{var n=PX(),a=B(n),o=B(a);A(o,`d`,i);var c=Y(o),l=e=>{var t=NX();A(t,`d`,i),A(t,`stroke-dasharray`,r),J(()=>{w(t,0,_e(L(v))),A(t,`stroke-dashoffset`,r*(1-L(u)/100))}),q(e,t)};p(c,e=>{L(s)!=null&&e(l)}),y(a);var g=Y(a,2),x=B(g),S=B(x,!0);y(x);var C=Y(x,2),T=B(C,!0);y(C);var E=Y(C,2),D=e=>{var n=_();h(F(n),()=>t.children),q(e,n)};p(E,e=>{t.children&&e(D)}),y(g),y(n),J(e=>{A(a,`aria-label`,`Context window usage: ${L(d)} of ${L(m)}`),w(x,1,e),f(S,L(d)),f(T,L(m))},[()=>_e(I(`text-xl leading-none font-semibold`,L(b)))]),q(e,n)},E=e=>{q(e,FX())};p(C,e=>{L(c)?e(T):e(E,-1)}),q(e,S),H()}var LX=P(`<!> <!>`,1),RX=P(`<!> `,1),zX=P(`<div class="flex flex-col gap-4 py-1"><!> <div class="flex min-w-0 flex-col"><!></div> <!></div>`);function BX(e,t){x(t,!0);let n=K(t,`contextWindow`,3,0),r=K(t,`conversationAgents`,19,()=>[]),i=K(t,`compacting`,3,!1),a=X(!1),o=l(()=>vX({status:t.status,activeProject:t.activeProject,activeConversation:t.activeConversation})),s=l(()=>t.activeConversation?i()?`Conversation compaction is in progress`:`Summarize earlier messages to reduce context usage`:`Select a conversation to compact its context`);async function c(){try{await vf(yX(L(o))),yi.success(`Copied session details`)}catch{yi.error(`Could not copy to clipboard`)}}var u=LX(),d=F(u);ti(d,{padded:!1,banner:e=>{var n=LX(),r=F(n);Yr(r,{title:`Context`,trailing:e=>{var n=LX(),r=F(n);{let e=l(()=>!t.activeProject);Hr(r,{get icon(){return af},label:`Copy session details`,get disabled(){return L(e)},onclick:()=>void c()})}jX(Y(r,2),{get activeConversation(){return t.activeConversation},get exportUrl(){return t.exportUrl},get systemPromptUrl(){return t.systemPromptUrl}}),q(e,n)},$$slots:{trailing:!0}});var i=Y(r,2),a=e=>{Lr(e,{tone:`muted`,children:(e,t)=>{g(),q(e,D(`Select a project to view context.`))},$$slots:{default:!0}})};p(i,e=>{t.activeProject||e(a)}),q(e,n)},children:(e,c)=>{var u=_(),d=F(u),m=e=>{var c=zX(),u=B(c);IX(u,{get contextUsage(){return t.contextUsage},get contextWindow(){return n()},children:(e,n)=>{{let n=l(()=>!t.activeConversation||i());W(e,{size:`xs`,variant:`outline`,class:`rounded-full`,get title(){return L(s)},get disabled(){return L(n)},onclick:()=>R(a,!0),children:(e,t)=>{var n=RX(),r=F(n);sv(r,{});var a=Y(r);J(()=>f(a,` ${i()?`Compacting…`:`Compact`}`)),q(e,n)},$$slots:{default:!0}})}},$$slots:{default:!0}});var d=Y(u,2);MX(B(d),{get fields(){return L(o)}}),y(d),bX(Y(d,2),{get conversationAgents(){return r()},get activeAgent(){return t.activeAgent},get onSelectAgent(){return t.onSelectAgent}}),y(c),q(e,c)};p(d,e=>{t.activeProject&&e(m)}),q(e,u)},$$slots:{banner:!0,default:!0}}),Tr(Y(d,2),{title:`Compact conversation`,description:`This summarizes earlier messages to reduce context size. The full history stays available in the branch tree.`,confirmLabel:`Compact context`,onConfirm:()=>t.onCompact?.(),get open(){return L(a)},set open(e){R(a,e,!0)}}),q(e,u),H()}function VX(){let e=un.conversationId??Yi.activeConversationTabId;if(e)return Yi.conversationViews[$i(e)]}function HX(){let e=Q.activeCenterTab;if(e?.kind===`pending-conversation`)return Yi.pendingConversations[na(e.id)]}var UX={get activeProject(){return dm.activeProject},get activeConversation(){return dm.activeConversation},get activeAgent(){return dm.activeAgent},get activePendingConversation(){return HX()},get pendingConversationActive(){return!!HX()},get activeUserQuestion(){let e=un.conversationId,t=un.agentId;return Q.userQuestions.find(n=>e&&n.conversationId===e?!0:!!(t&&n.agentId===t))},get activePlanReview(){let e=un.conversationId,t=un.agentId;return Q.planReviews.find(n=>e&&n.conversationId===e?!0:!!(t&&n.agentId===t))},get conversationActivityById(){return dm.conversationActivityById},get conversationAgents(){return Q.agents.filter(e=>e.conversationId===un.conversationId)},get pendingApprovalCount(){return Q.approvals.length},get conversationActiveRun(){return VX()?.activeRun},get compacting(){return VX()?.transient?.compaction?.state===`running`},get entries(){return VX()?.entries??[]},get toolCalls(){return VX()?.toolCalls??[]},get treeNodes(){return VX()?.treeNodes??[]},get streamingText(){return pn(VX()?.activeRun)},get queuedPrompts(){return VX()?.queuedPrompts??[]},get activeComposerText(){return HX()?.composerText??VX()?.composerText??``},get slashCompletions(){return Yi.slashCompletions},get selectedModelKey(){return Yi.selectedModelKey},get selectedThinkingLevel(){return Yi.selectedThinkingLevel},get selectedMode(){return Yi.selectedMode},get selectedPermissionLevel(){return Yi.selectedPermissionLevel},get selectedApprovalPolicy(){return Yi.selectedApprovalPolicy},get activeContextUsage(){return VX()?.contextUsage},get activeModelInfo(){let e=Q.agents.find(e=>e.id===un.agentId)?.model;if(e)return Pi.models.find(t=>t.provider===e.provider&&t.modelId===e.modelId)},get activeContextWindow(){let e=Pi.models.find(e=>Ki(e)===Yi.selectedModelKey);return e?.contextWindow?e.contextWindow:this.activeModelInfo?.contextWindow?this.activeModelInfo.contextWindow:VX()?.contextUsage?.contextWindow??0},get activeConversationUsage(){let e={input:0,output:0,cacheRead:0,cacheWrite:0,cost:0};for(let t of VX()?.entries??[])t.usage&&(e.input+=t.usage.input,e.output+=t.usage.output,e.cacheRead+=t.usage.cacheRead,e.cacheWrite+=t.usage.cacheWrite,e.cost+=t.usage.cost);return e},get usableModels(){return Li(Pi.models,Pi.authProviders,Pi.settingsDraft?.scopedModels)},get live(){return Q.connection===`live`},get sending(){return HX()?.sending??VX()?.sending??!1},get activeSubscriptionProvider(){return Q.agents.find(e=>e.id===un.agentId)?.model?.provider??Vi(Yi.selectedModelKey)?.provider},get activeSubscriptionUsage(){let e=this.activeSubscriptionProvider;if(e)return ut.subscriptionUsage[e]}};function WX(){let e=un.conversationId??Yi.activeConversationTabId;if(e)return Yi.conversationViews[$i(e)]}var GX={get activeCenterPrView(){let e=Q.activeCenterTab;if(e?.kind===`pr`)return Bi.prViews[Zi(e.id)]},get gitStatus(){let e=dm.activeProject?.id,t=e?HK.projects[Xi(e)]:void 0;if(!t||t.repos.length===0)return;let n=t.repoStates[ea(t.selectedRepo)]?.repoSummary??t.repos.find(e=>e.relativePath===t.selectedRepo)??t.repos[0];return{branch:n.currentBranch??`detached`,dirty:n.dirty,changeCount:n.changeCount,ahead:n.ahead,behind:n.behind,detached:n.detached,hasUpstream:n.hasUpstream,relativePath:n.relativePath,repoName:n.name,repoCount:t.repos.length}},get branchDepth(){return WX()?.treeNodes.length??0}};function KX(e){let t,n=!1;return{update(r,i){r&&(n&&i===t||(n=!0,t=i,e(i)))}}}function qX(e){return!!(e.progressiveActive&&e.enabled&&e.projectId&&e.projectId!==e.lastProjectId)}var JX=sG(`Select a project to use Git operations.`);function YX(e,t=()=>!0,n=t){let r={get model(){let t=e(),n=t?HK.projects[Xi(t.id)]:void 0,r=n?.repos??[],i=n?.selectedRepo??`.`,a=n?.repoStates[ea(i)],o=t?{refresh:oG,selectRepository:oG,branches:oG,mutateFiles:oG,bulkMutateFiles:oG,remote:{fetch:oG,pull:oG,push:oG,sync:oG,"switch-base-and-pull":oG},openPullRequest:oG}:{refresh:JX,selectRepository:JX,branches:JX,mutateFiles:JX,bulkMutateFiles:JX,remote:{fetch:JX,pull:JX,push:JX,sync:JX,"switch-base-and-pull":JX},openPullRequest:JX};return{availability:t?{available:!0}:{available:!1,message:`Select a project to inspect its Git repositories.`},emptyMessage:`No Git repositories found in this directory (searched up to 2 levels deep).`,repositories:r,selectedRepository:i,repositorySummary:a?.repoSummary,changes:a?.changes,branches:a?.branches??[],github:a?.github,pullRequests:a?.prs??[],pullRequestFilters:a?.prFilters??BW,initialLoading:!!(t&&!n)||!!n?.loadingRepos||!!(n?.reposRequestInFlight&&!n.loaded&&r.length===0),cachedError:n?.discoverError,refreshing:!!n?.refreshingRepos||!!((a?.loadingOverview||a?.loadingPrs)&&(a.repoSummary||a.changes)),loadingOverview:a?.loadingOverview??!1,loadingBranches:a?.loadingBranches??!1,loadingPullRequests:a?.loadingPrs??!1,pullRequestError:a?.prsError,operations:a?.operations??{fetching:!1,pulling:!1,pushing:!1,syncing:!1,switchingBaseAndPulling:!1,creatingBranch:!1},capabilities:o}},actions:void 0};r.actions=JW(()=>r.model,{refreshAll:()=>{let t=e();if(t)return PJ(t,{force:!0})},refreshRepository:async t=>{let n=e();n&&await Promise.all([FJ(n.id,t,{force:!0}),LJ(n.id,t,!0)])},refreshBranches:t=>{let n=e();if(n)return IJ(n.id,t)},refreshPullRequests:async t=>{let n=e();n&&await Promise.all([FJ(n.id,t,{force:!0}),LJ(n.id,t,!0)])},configurePullRequests:(t,n)=>{let r=e();if(!r)return;let i=HK.projects[Xi(r.id)]?.repoStates[ea(t)];if(i)return i.prFilters=VW(n),eq(r.id,t,i.prFilters),BJ(r.id,t,!1,!0)},resetPullRequestConfig:t=>{let n=e();if(!n)return;let r=HK.projects[Xi(n.id)]?.repoStates[ea(t)];if(r)return r.prFilters=BW,eq(n.id,t,r.prFilters),BJ(n.id,t,!1,!0)},selectRepository:t=>{let n=e();n&&WJ(n.id,t)},createBranch:(t,n)=>{let r=e();return r?$J(r.id,t,n):!1},switchBranch:(t,n)=>{let r=e();return r?QJ(r.id,t,n):!1},openDiff:(t,n,r)=>{let i=e();if(i)return GY({projectId:i.id,repo:t,path:n.path,renamedFrom:n.renamedFrom,area:r})},mutateFile:(t,n,r)=>{let i=e();if(i)return eY(i.id,t,n,r)},bulkMutateFiles:(t,n)=>{let r=e();if(r)return tY(r.id,t,n)},runRemoteOperation:(t,n)=>{let r=e();if(r)return{fetch:()=>qJ(r.id,t),pull:()=>JJ(r.id,t),push:()=>YJ(r.id,t),sync:()=>XJ(r.id,t),"switch-base-and-pull":()=>ZJ(r.id,t)}[n]()},selectPullRequest:()=>void 0,openPullRequest:(t,n)=>{let r=e();if(r)return yJ({projectId:r.id,repo:t,number:n})}});let i;return z(()=>{let n=e(),r=t();qX({progressiveActive:yY.progressiveActive,enabled:r,projectId:n?.id,lastProjectId:i})&&(i=n?.id,n&&queueMicrotask(()=>{yY.progressiveActive&&t()&&UJ(n)}))}),z(()=>{let r=yY.progressiveActive&&t(),i=e(),a=i?HK.projects[Xi(i.id)]:void 0,o=a?.selectedRepo;if(!r||!i||!a?.repos.length||!o)return;AJ(i.id,o,!0);let s=()=>{VJ(i.id,o),n()&&HJ(i.id,o)},c=()=>{document.visibilityState===`visible`&&s()};return s(),window.addEventListener(`focus`,s),document.addEventListener(`visibilitychange`,c),()=>{AJ(i.id,o,!1),window.removeEventListener(`focus`,s),document.removeEventListener(`visibilitychange`,c)}}),z(()=>{let r=yY.progressiveActive&&t()&&n(),i=e(),a=i?HK.projects[Xi(i.id)]:void 0,o=a?.selectedRepo,s=o?a?.repoStates[ea(o)]:void 0,c=s?.prs??[],l=GX.activeCenterPrView;if(!r||!i||!a?.repos.length||!o||!s?.repoSummary?.hasGithubRemote||!s.github?.authenticated)return;let u=l?.projectId===i.id&&l.repo===o;if(!Pq({visible:document.visibilityState===`visible`,prs:c,activePrNumber:u?l?.number:void 0,activePrPending:u&&l?.checks.data?.checks.status===`pending`}).pollList)return;let d=window.setInterval(()=>{document.visibilityState===`visible`&&BJ(i.id,o,!0,!0)},jq);return()=>window.clearInterval(d)}),r}var XX=Ie({request:0});function ZX(){XX.request+=1}var QX={get settingsDraft(){return Pi.settingsDraft},get settingsSaveStatus(){return Pi.settingsSaveStatus},get settingsMessage(){return Pi.settingsMessage},get selectedModelKey(){return Yi.selectedModelKey}};function $X(e){return t=>{switch(t.kind){case`conversation`:e.refreshConversation(t.id);return;case`pending-conversation`:case`task`:e.selectTab(t);return;case`file`:e.refreshFile(t.id);return;case`pr`:e.refreshPullRequest(t.id);return;case`diff`:e.refreshDiff(t.id);return;case`settings`:e.loadSettings();return;case`auth`:e.loadAuth();return;case`logs`:e.refreshLogs();return}}}var eZ=$X({refreshConversation:e=>void Uo(e),selectTab:e=>void Fi(e),refreshFile:e=>void gK(e),refreshPullRequest:e=>void xJ(e),refreshDiff:e=>void qY(e),loadSettings:()=>void dt(),loadAuth:()=>void QH(),refreshLogs:ZX}),tZ=P(`<div class="conversation-pane-layer svelte-198ko60"><!></div>`),nZ=P(`<div class="center-workspace-content h-full svelte-198ko60"><!> <!></div>`);function rZ(e,t){x(t,!0);let n=l(()=>dm.status),r=l(()=>dm.centerTabs),i=l(()=>dm.activeCenterTab),a=l(()=>Q.openCenterTabs),o=l(()=>cX(L(i))?L(i):void 0),s=X(Ie([])),c=l(()=>pX(L(s),L(o)));z(()=>{let e=fX(L(s),L(i),L(a));dX(L(s),e)||R(s,e,!0)});function u(e){qo(Wo(e),e)}let f={task:()=>Xa(()=>import(`./TaskShell-6yD46EEs.js`),__vite__mapDeps([55,31,32,33,34,35,36,37,38,39,40,41,42,43,44,30,11,8,45,46,47,48,49,50,51,52,53,54])),file:()=>Xa(()=>import(`./FileShell-51rdTc2O.js`),__vite__mapDeps([56,31,57,58,8,59,60])),pr:()=>Xa(()=>import(`./PrShell-D0xu74Xe.js`),__vite__mapDeps([61,62,59,31,33,63,64,43,34,65,39,40,41,57,66,37,67,42,58,8,68,48,49,50,51,52,53,54])),diff:()=>Xa(()=>import(`./DiffShell-DJOeYrRj.js`),__vite__mapDeps([69,62,59,31,33,63,64,43,34,65,39,40,41,57,66,37,67,42,58,8,68,51,50,52,53])),settings:()=>Xa(()=>import(`./SettingsShell-3yiDBypm.js`),__vite__mapDeps([70,31,33,65,36,37,38,67,39,40,41,42,43,71,72,64,34,35,73,74,57,75,76,45,46,47,48,49,50,51,52,53,54])),auth:()=>Xa(()=>import(`./AuthShell-GogBMM7S.js`),__vite__mapDeps([77,31,38,42,43,74,65,57,75,72,64,33,34,35,73,76,48,49,50,51,52,53,54,78])),logs:()=>Xa(()=>import(`./LogsShell-CtA5DDqm.js`),__vite__mapDeps([79,31,65,38,42,43,76,57,49]))},m=Ie({});z(()=>{let e=L(i)?.kind;!e||!(e in f)||m[e]||(m[e]=f[e]())});function h(e){qo(Ds(e),e)}function g(e){qo(ws(e),e)}_te(e,{contentVisible:!0,tabStrip:e=>{{let t=l(()=>L(n)?.storage.userHome);Hp(e,{get tabs(){return L(r)},get homeDir(){return L(t)},onSelect:e=>void Fi(e),onClose:e=>void Mi(e),get onRefresh(){return eZ},onCloseOther:u,onCloseRight:h,onCloseLeft:g,get onToggleFileDisplayMode(){return _K},get onToggleFileLineWrap(){return vK},get onNew(){return Jo},get onReorder(){return bee}})}},content:e=>{var t=nZ(),n=B(t),r=e=>{var t=_();j(F(t),()=>m.task,e=>{VY(e,{})},(e,t)=>{let n=l(()=>L(t)?.default);var r=_(),i=F(r),a=e=>{var t=_();d(F(t),()=>L(n),(e,t)=>{t(e,{})}),q(e,t)};p(i,e=>{L(n)&&e(a)}),q(e,r)}),q(e,t)},a=e=>{var t=_();j(F(t),()=>m.file,e=>{VY(e,{})},(e,t)=>{let n=l(()=>L(t)?.default);var r=_(),i=F(r),a=e=>{var t=_();d(F(t),()=>L(n),(e,t)=>{t(e,{})}),q(e,t)};p(i,e=>{L(n)&&e(a)}),q(e,r)}),q(e,t)},s=e=>{var t=_();j(F(t),()=>m.pr,e=>{VY(e,{})},(e,t)=>{let n=l(()=>L(t)?.default);var r=_(),i=F(r),a=e=>{var t=_();d(F(t),()=>L(n),(e,t)=>{t(e,{})}),q(e,t)};p(i,e=>{L(n)&&e(a)}),q(e,r)}),q(e,t)},u=e=>{var t=_();j(F(t),()=>m.diff,e=>{VY(e,{})},(e,t)=>{let n=l(()=>L(t)?.default);var r=_(),i=F(r),a=e=>{var t=_();d(F(t),()=>L(n),(e,t)=>{t(e,{})}),q(e,t)};p(i,e=>{L(n)&&e(a)}),q(e,r)}),q(e,t)},f=e=>{var t=_();j(F(t),()=>m.settings,e=>{VY(e,{})},(e,t)=>{let n=l(()=>L(t)?.default);var r=_(),i=F(r),a=e=>{var t=_();d(F(t),()=>L(n),(e,t)=>{t(e,{})}),q(e,t)};p(i,e=>{L(n)&&e(a)}),q(e,r)}),q(e,t)},h=e=>{var t=_();j(F(t),()=>m.auth,e=>{VY(e,{})},(e,t)=>{let n=l(()=>L(t)?.default);var r=_(),i=F(r),a=e=>{var t=_();d(F(t),()=>L(n),(e,t)=>{t(e,{})}),q(e,t)};p(i,e=>{L(n)&&e(a)}),q(e,r)}),q(e,t)},g=e=>{var t=_();j(F(t),()=>m.logs,e=>{VY(e,{})},(e,t)=>{let n=l(()=>L(t)?.default);var r=_(),i=F(r),a=e=>{var t=_();d(F(t),()=>L(n),(e,t)=>{t(e,{})}),q(e,t)};p(i,e=>{L(n)&&e(a)}),q(e,r)}),q(e,t)};p(n,e=>{L(i)?.kind===`task`?e(r):L(i)?.kind===`file`?e(a,1):L(i)?.kind===`pr`?e(s,2):L(i)?.kind===`diff`?e(u,3):L(i)?.kind===`settings`?e(f,4):L(i)?.kind===`auth`?e(h,5):L(i)?.kind===`logs`&&e(g,6)});var v=Y(n,2),b=e=>{var t=_();O(F(t),17,()=>L(c),e=>lX(e),(e,t)=>{let n=l(()=>uX(L(o),L(t)));var r=tZ();zY(B(r),{get tab(){return L(t)},get active(){return L(n)}}),y(r),J(()=>A(r,`hidden`,!L(n))),q(e,r)}),q(e,t)},x=e=>{zY(e,{active:!0})};p(v,e=>{L(c).length>0?e(b):L(i)||e(x,1)}),y(t),q(e,t)},$$slots:{tabStrip:!0,content:!0}}),H()}function iZ(e,t){x(t,!0);let n=K(t,`isOpen`,3,!1),r=K(t,`isActive`,3,!1),i=l(()=>t.row.agent?.status??`idle`),a=l(()=>t.activity??im({conversationId:t.row.conversation.id,agent:t.row.agent,mode:t.row.agent?.mode??t.row.conversation.mode})),o=l(()=>t.row.agent?.mode??t.row.conversation.mode),s=l(()=>t.row.agent?.permissionLevel??t.row.conversation.permissionLevel),c=l(()=>[t.row.conversation.title,`status: ${L(i)}`,`mode: ${L(o)} · ${L(s)}`,`model: ${Ji(t.row.agent)}`,`updated: ${fL(t.row.conversation.updatedAt)}`,t.row.conversation.id].join(`
136
- `));ni(e,{children:(e,i)=>{{let i=l(()=>n()?`solid`:`outline`);Wr(e,{get label(){return t.row.conversation.title},labelLines:2,get title(){return L(c)},get status(){return L(a).tone},get statusVariant(){return L(i)},get pulse(){return L(a).pulse},class:`px-2`,get active(){return r()},get menuItems(){return t.menuItems},onclick:()=>t.onOpenConversation?.(t.row.conversation.id)})}},$$slots:{default:!0}}),H()}var aZ=P(`<p class="mx-2 my-3 grid min-h-48 place-items-center gap-1 text-center font-mono text-xs text-muted-foreground">No conversations match.</p>`),oZ=P(`<div class="py-0.5"><!></div>`),sZ=P(`<div class="conversations-modal svelte-1m5r4e2"><div class="search-box svelte-1m5r4e2"><!></div> <div class="list-region svelte-1m5r4e2"><!></div></div>`);function cZ(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=K(t,`projectLabel`,3,``),i=K(t,`projectIds`,19,()=>[]),a=K(t,`conversations`,19,()=>[]),o=K(t,`agents`,19,()=>[]),s=K(t,`conversationActivityById`,19,()=>({})),c=X(``),u=X(null),f=l(()=>qi({conversations:a(),agents:o(),projectIds:i(),filter:L(c)}));z(()=>{if(!n())return;R(c,``);let e,t=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>L(u)?.focus())});return()=>{cancelAnimationFrame(t),e!==void 0&&cancelAnimationFrame(e)}});function m(e){n(e),t.onOpenChange?.(e)}function h(e){t.onOpenConversation?.(e),m(!1)}{let i=l(()=>`${L(f).length} in ${r()}`);IF(e,{flush:!0,title:`Conversations`,get description(){return L(i)},class:`project-conversations-dialog`,onOpenChange:m,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var r=_();d(F(r),()=>Gy,(e,n)=>{n(e,{delayDuration:300,disableHoverableContent:!0,children:(e,n)=>{var r=sZ(),i=B(r);q_(B(i),{placeholder:`Filter conversations`,ariaLabel:`Filter conversations`,get ref(){return L(u)},set ref(e){R(u,e,!0)},get value(){return L(c)},set value(e){R(c,e,!0)}}),y(i);var a=Y(i,2),o=B(a),d=e=>{q(e,aZ())},m=e=>{Ka(e,{get items(){return L(f)},getKey:e=>e.conversation.id,estimateSize:()=>48,viewportClass:`h-full px-0.5`,row:(e,n)=>{let r=()=>n?.().item;var i=oZ(),a=B(i);{let e=l(()=>t.openConversationTabIds?.has(r().conversation.id)??!1),n=l(()=>r().conversation.id===t.selectedConversationId),i=l(()=>t.buildMenu?.(r().conversation)??[]);iZ(a,{get row(){return r()},get isOpen(){return L(e)},get isActive(){return L(n)},get activity(){return s()[r().conversation.id]},get menuItems(){return L(i)},onOpenConversation:h})}y(i),q(e,i)},$$slots:{row:!0}})};p(o,e=>{L(f).length===0?e(d):e(m,-1)}),y(a),y(r),q(e,r)},$$slots:{default:!0}})}),q(e,r)},$$slots:{default:!0}})}H()}var lZ=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
137
- <path d="M0.228341 8.36915C0.228341 8.36915 -0.356212 7.94324 0.345251 7.37453L1.97956 5.89736C1.97956 5.89736 2.44721 5.40004 2.94164 5.83334L18.0231 17.375V22.9094C18.0231 22.9094 18.0158 23.7785 16.9124 23.6825L0.228341 8.36915Z" fill="currentColor" />
138
- <path d="M4.11555 11.9367L0.228273 15.5089C0.228273 15.5089 -0.171172 15.8093 0.228273 16.346L2.03308 18.0053C2.03308 18.0053 2.46175 18.4706 3.09502 17.9413L7.21611 14.7827L4.11555 11.9367Z" fill="currentColor" />
139
- <path d="M10.94 11.9661L18.0691 6.46362L18.0228 0.95865C18.0228 0.95865 17.7183 -0.242793 16.7027 0.382548L7.21589 9.11025L10.94 11.9661Z" fill="currentColor" />
140
- <path d="M16.9121 23.69C17.3261 24.1183 17.8279 23.978 17.8279 23.978L23.3838 21.2108C24.0951 20.7208 23.9952 20.1127 23.9952 20.1127V3.58803C23.9952 2.86175 23.2596 2.61063 23.2596 2.61063L18.4441 0.264377C17.3919 -0.392968 16.7027 0.382548 16.7027 0.382548C16.7027 0.382548 17.5892 -0.262484 18.0228 0.95865L18.0228 22.8086C18.0228 22.9588 17.9911 23.1065 17.9278 23.2394C17.8011 23.4979 17.5259 23.7392 16.8658 23.6383L16.9121 23.69Z" fill="currentColor" />
141
- </svg>
142
- `;function uZ(e,t){x(t,!1);let n=lZ.replace(`<svg `,`<svg class="size-3.5" `);fe();var r=_();v(F(r),()=>n),q(e,r),H()}var dZ=`<svg viewBox="0 0 90 90" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
143
- <path fill-rule="evenodd" clip-rule="evenodd" d="M8.4375 5.625C6.8842 5.625 5.625 6.8842 5.625 8.4375V70.3125H0V8.4375C0 3.7776 3.7776 0 8.4375 0H83.7925C87.551 0 89.4333 4.5442 86.7756 7.20186L40.3642 53.6133H53.4375V47.8125H59.0625V55.0195C59.0625 57.3495 57.1737 59.2383 54.8438 59.2383H34.7392L25.0712 68.9062H68.9062V33.75H74.5312V68.9062C74.5312 72.0128 72.0128 74.5312 68.9062 74.5312H19.4462L9.60248 84.375H81.5625C83.1158 84.375 84.375 83.1158 84.375 81.5625V19.6875H90V81.5625C90 86.2224 86.2224 90 81.5625 90H6.20749C2.44898 90 0.566723 85.4558 3.22438 82.7981L49.46 36.5625H36.5625V42.1875H30.9375V35.1562C30.9375 32.8263 32.8263 30.9375 35.1562 30.9375H55.085L64.9288 21.0938H21.0938V56.25H15.4688V21.0938C15.4688 17.9871 17.9871 15.4688 21.0938 15.4688H70.5538L80.3975 5.625H8.4375Z" fill="currentColor" />
144
- </svg>
145
- `;function fZ(e,t){x(t,!1);let n=dZ.replace(`<svg `,`<svg class="size-3.5" `);fe();var r=_();v(F(r),()=>n),q(e,r),H()}function pZ(e,t){return e.filter(e=>e.projectId===t).length}function mZ(e,t,n){let r=Date.now()-n*24*60*60*1e3;return e.filter(e=>{let n=Date.parse(e.updatedAt);return e.projectId===t&&Number.isFinite(n)&&n<r}).length}function hZ(e,t,n){return Math.max(0,pZ(e,t)-n)}async function gZ(e,t){try{await vf(e),yi.success(`Copied ${t}`)}catch{yi.error(`Could not copy to clipboard`)}}function _Z(e,t){let n=[];return t.editorAvailability?.vscode.available&&n.push({label:`Open in VS Code`,icon:uZ,onSelect:()=>t.onOpenProjectInEditor?.(e.id,`vscode`)}),t.editorAvailability?.zed.available&&n.push({label:`Open in Zed`,icon:fZ,onSelect:()=>t.onOpenProjectInEditor?.(e.id,`zed`)}),n}function vZ(e,t){let n=_Z(e,t),r=[{label:`New chat`,icon:Ul,shortcut:t.newConversationShortcut,onSelect:()=>t.onNewConversationInProject?.(e.dir)}];return n.length>0&&r.push({type:`separator`},...n),r.push({type:`separator`},{label:`Copy path`,icon:af,onSelect:()=>void gZ(e.dir,`path`)},{label:`Clean up`,icon:Ya,destructive:!0,disabled:t.conversationCount(e.id)===0,onSelect:()=>t.requestPrune(e)},{label:`Remove project`,icon:Ya,destructive:!0,onSelect:()=>t.requestDelete({kind:`project`,id:e.id,label:zi(e.dir,t.homeDir)})}),r}function yZ(e,t,n){return[{label:`Open conversation`,icon:$L,onSelect:()=>n.onOpenConversation?.(t.id)},{label:`New chat`,icon:Ul,shortcut:n.newConversationShortcut,onSelect:()=>n.onNewConversationInProject?.(e.dir)},{type:`separator`},{label:`Copy conversation id`,icon:af,onSelect:()=>void gZ(t.id,`conversation id`)},{label:`Delete conversation`,icon:Ya,destructive:!0,onSelect:()=>n.requestDelete({kind:`conversation`,id:t.id,label:t.title})}]}var bZ=P(`<span class="inline-flex" data-tour-id="panel-new-conversation"><!></span>`),xZ=P(`<!> <!>`,1),SZ=P(`<!> <!> <!>`,1);function CZ(e,t){x(t,!0);let n=K(t,`projects`,19,()=>[]),r=K(t,`conversations`,19,()=>[]),i=K(t,`agents`,19,()=>[]),a=K(t,`conversationActivityById`,19,()=>({})),o=K(t,`searchFocusToken`,3,0),s=X(void 0),c=X(!1),u=l(()=>n().find(e=>e.id===t.selectedProjectId)??n()[0]),f=l(()=>n().map(e=>e.id)),m=l(()=>qi({conversations:r(),agents:i(),projectIds:L(f)})),h=l(()=>L(m).slice(0,100)),v=Cp(`conversation.new`),b=Cp(`conversation.newFromProject`),S=b?`Use the folder button in the header (${b}) to get started.`:`Use the folder button in the header to get started.`,C=0;z(()=>{o()!==C&&(C=o(),R(c,!0))});let w=l(()=>({homeDir:t.homeDir,newConversationShortcut:v,editorAvailability:t.editorAvailability,conversationCount:e=>r().filter(t=>t.projectId===e).length,onOpenConversation:t.onOpenConversation,onNewConversationInProject:t.onNewConversationInProject,onOpenProjectInEditor:t.onOpenProjectInEditor,requestPrune:e=>t.onPruneProjectConversations?.(e.id,{strategy:`keepLatest`,keepLatest:20}),requestDelete:e=>R(s,e,!0)}));var T=SZ(),E=F(T);d(E,()=>Gy,(e,r)=>{r(e,{delayDuration:300,disableHoverableContent:!0,children:(e,r)=>{ti(e,{padded:!1,scroll:!1,children:(e,r)=>{var i=xZ(),o=F(i);Yr(o,{title:`Conversations`,get count(){return L(m).length},trailing:e=>{var n=bZ(),r=B(n);{let e=l(()=>v?`New chat (${v})`:`New chat`),n=l(()=>!L(u)||!t.onNewConversationInProject);Hr(r,{get icon(){return Ul},label:`New chat`,get title(){return L(e)},get disabled(){return L(n)},onclick:()=>{L(u)&&t.onNewConversationInProject?.(L(u).dir)}})}y(n),q(e,n)},$$slots:{trailing:!0}});var s=Y(o,2),c=e=>{Kr(e,{title:`No project selected.`,get description(){return S}})},d=e=>{Kr(e,{title:`No conversations in this project yet.`,action:e=>{W(e,{variant:`outline`,size:`sm`,onclick:()=>t.onNewConversationInProject?.(L(u).dir),children:(e,t)=>{g(),q(e,D(`New chat`))},$$slots:{default:!0}})},$$slots:{action:!0}})},f=e=>{Jr(e,{ariaLabel:`Conversations`,children:(e,r)=>{Qr(e,{ariaLabel:`Conversations`,class:`shrink-0 gap-1 pt-1 pb-0`,children:(e,r)=>{var i=_();O(F(i),17,()=>L(h),e=>e.conversation.id,(e,r)=>{let i=l(()=>n().find(e=>e.id===L(r).conversation.projectId)??L(u));{let n=l(()=>t.openConversationTabIds?.has(L(r).conversation.id)??!1),o=l(()=>L(r).conversation.id===t.selectedConversationId),s=l(()=>yZ(L(i),L(r).conversation,L(w)));iZ(e,{get row(){return L(r)},get isOpen(){return L(n)},get isActive(){return L(o)},get activity(){return a()[L(r).conversation.id]},get menuItems(){return L(s)},get onOpenConversation(){return t.onOpenConversation}})}}),q(e,i)},$$slots:{default:!0}})},$$slots:{default:!0}})};p(s,e=>{L(u)?L(m).length===0?e(d,1):e(f,-1):e(c)}),q(e,i)},$$slots:{default:!0}})},$$slots:{default:!0}})});var k=Y(E,2);{let e=l(()=>L(s)?.kind===`conversation`),n=l(()=>L(s)?`This permanently removes “${L(s).label}”.`:``);Tr(k,{get open(){return L(e)},title:`Delete conversation?`,get description(){return L(n)},confirmLabel:`Delete`,destructive:!0,onConfirm:()=>{L(s)?.kind===`conversation`&&t.onDeleteConversation?.(L(s).id)},onOpenChange:e=>{e||R(s,void 0)}})}var ee=Y(k,2),A=e=>{cZ(e,{get open(){return L(c)},get projectLabel(){return L(u).name},get project(){return L(u)},get projectIds(){return L(f)},get conversations(){return r()},get agents(){return i()},get selectedConversationId(){return t.selectedConversationId},get openConversationTabIds(){return t.openConversationTabIds},get conversationActivityById(){return a()},get onOpenConversation(){return t.onOpenConversation},buildMenu:e=>yZ(n().find(t=>t.id===e.projectId)??L(u),e,L(w)),onOpenChange:e=>R(c,e,!0)})};p(ee,e=>{L(u)&&e(A)}),q(e,T),H()}var wZ=Ie({searchFocusToken:0});function TZ(){wZ.searchFocusToken+=1}function EZ(e,t){x(t,!0);let n=l(()=>dm.status),r=l(()=>new Set(dm.selectedProjectIds)),i=l(()=>dm.projects.filter(e=>L(r).has(e.id))),a=l(()=>dm.selectedProjectConversations),o=l(()=>dm.agents),s=l(()=>dm.openConversationTabIds),c=l(()=>UX.conversationActivityById);{let t=l(()=>L(n)?.storage.userHome),r=l(()=>L(n)?.runtime.editors);CZ(e,{get projects(){return L(i)},get conversations(){return L(a)},get agents(){return L(o)},get homeDir(){return L(t)},get selectedProjectId(){return un.projectId},get selectedConversationId(){return un.conversationId},get openConversationTabIds(){return L(s)},get conversationActivityById(){return L(c)},get searchFocusToken(){return wZ.searchFocusToken},get editorAvailability(){return L(r)},get onOpenConversation(){return Ho},get onNewConversationInProject(){return os},onOpenProjectInEditor:(e,t)=>void Xo(e,t),onDeleteProject:e=>void ns(e),onDeleteConversation:e=>void gs(e),onPruneProjectConversations:(e,t)=>void $o(e,t)})}H()}var DZ=new Set([`$$slots`,`$$events`,`$$legacy`]);function OZ(e,t){let n=U(t,DZ),r=[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`}]];G(e,V({name:`layout-grid`},()=>n,{get iconNode(){return r}}))}var kZ=P(`<span><span class="scale-90"> </span></span>`),AZ=P(`<span aria-hidden="true"><!> <!></span>`),jZ=P(`<!> <span class="truncate"> </span>`,1),MZ=P(`<nav class="flex min-w-0 flex-1 items-center gap-1 overflow-hidden" aria-label="Projects"><!> <div class="flex min-w-0 flex-1 items-center gap-0.5 overflow-hidden"></div></nav>`);function NZ(e,t){x(t,!0);let n=K(t,`items`,19,()=>[]),r=wp(`conversation.newFromProject`);function i(e){let t=Wp(e.activity,e.tasks);return t?`${e.label}: ${t.summary}`:e.label}function a(e){return e===`warn`?`bg-warning text-warning-foreground`:e===`danger`?`bg-destructive-solid text-destructive-solid-foreground`:`bg-info text-info-foreground`}var o=MZ(),s=B(o);W(s,{variant:`ghost`,size:`icon-sm`,class:`shrink-0 [-webkit-app-region:no-drag]`,ariaLabel:`Switch project`,"data-tour-id":`guide-project-open`,get"aria-keyshortcuts"(){return r},onclick:()=>t.onOpenPicker?.(),children:(e,t)=>{OZ(e,{class:`size-4`,"aria-hidden":`true`})},$$slots:{default:!0}});var c=Y(s,2);O(c,21,n,e=>e.key,(e,n)=>{let r=l(()=>Wp(L(n).activity,L(n).tasks)),o=l(()=>L(n).activity.needsUser+L(n).activity.failed+L(n).activity.running),s=l(()=>L(o)>0&&L(n).tasks.running>0),c=l(()=>L(n).key===t.activeKey);{let u=l(()=>t.buildMenuItems?.(L(n))??[]),d=l(()=>!t.buildMenuItems);zr(e,{get items(){return L(u)},get disabled(){return L(d)},triggerClass:`block min-w-0 max-w-56 overflow-hidden [-webkit-app-region:no-drag]`,children:(e,u)=>{{let u=l(()=>`w-full min-w-0 gap-1.5 rounded-md bg-accent/35 px-2 ${L(c)?`text-foreground hover:bg-accent/40`:`text-muted-foreground hover:bg-accent/40 hover:text-foreground`}`),d=l(()=>L(c)?`page`:void 0),m=l(()=>i(L(n)));W(e,{variant:`ghost`,size:`sm`,get class(){return L(u)},get pressed(){return L(c)},get"aria-current"(){return L(d)},get ariaLabel(){return L(m)},onclick:()=>t.onSelect?.(L(n).project.id),children:(e,t)=>{var i=jZ(),c=F(i),l=e=>{var t=AZ(),i=B(t),c=e=>{var t=kZ(),n=B(t),i=B(n,!0);y(n),y(t),J(e=>{w(t,1,e),f(i,L(o))},[()=>`${L(s)?`absolute top-0 left-0`:`relative`} z-10 inline-flex size-4 items-center justify-center rounded-full border-[1.5px] border-background text-xs leading-none tabular-nums ${a(L(r).tone)}`]),q(e,t)};p(i,e=>{L(o)&&e(c)});var l=Y(i,2),u=e=>{var t=kZ(),r=B(t),i=B(r,!0);y(r),y(t),J(()=>{w(t,1,`${L(s)?`absolute top-0 right-0`:`relative`} z-0 inline-flex size-4 items-center justify-center rounded-sm border-[1.5px] border-background bg-info text-xs leading-none text-info-foreground tabular-nums`),f(i,L(n).tasks.running)}),q(e,t)};p(l,e=>{L(n).tasks.running&&e(u)}),y(t),J(()=>w(t,1,_e(L(s)?`relative isolate h-4 w-7 flex-none`:`inline-flex size-4 flex-none items-center`))),q(e,t)};p(c,e=>{L(r)&&e(l)});var u=Y(c,2),d=B(u,!0);y(u),J(()=>f(d,L(n).label)),q(e,i)},$$slots:{default:!0}})}},$$slots:{default:!0}})}}),y(c),y(o),q(e,o),H()}var PZ={get tasks(){return Ii.tasks},get scopedTasks(){let e=dm.activeProject?.dir;return e?Ii.tasks.filter(t=>Ap(t.cwd,e)):[]},get selectedTask(){return Ii.tasks.find(e=>e.id===Ii.selectedTaskId)},get activeCenterTask(){let e=Q.activeCenterTab;if(e?.kind!==`task`)return;let t=Ii.tasks.filter(t=>$Y(t)===e.id).sort((e,t)=>t.startedAt.localeCompare(e.startedAt));return t.find(t=>t.id===Ii.selectedRunByEntry[e.id])??t[0]},get activeCenterTaskRuns(){let e=Q.activeCenterTab;return e?.kind===`task`?Ii.tasks.filter(t=>$Y(t)===e.id).sort((e,t)=>t.startedAt.localeCompare(e.startedAt)):[]},get taskLogs(){return Ii.taskLogs}};async function FZ(e){Ii.selectedTaskId=e,await xo(e)}async function IZ(e,t={}){let n=Ii.tasks.find(t=>t.id===e)?.status===`orphaned`;await fo(e,t),await vs(),Ii.selectedTaskId&&await xo(Ii.selectedTaskId),yi.success(t.signal===`SIGKILL`?`Task force killed`:n?`Orphaned task cleanup completed`:`Task cancelled`)}async function LZ(e){let t=eX(e),n=await go(e);nX(t,n.id),Ii.selectedTaskId=n.id,await vs(),await xo(n.id),yi.success(`Task restarted`,{description:n.name??n.command??n.id})}function RZ(e){let t=eX(e),n=Ii.tasks.filter(n=>n.id!==e&&(n.definitionId??n.restartRootTaskId??n.id)===t).sort((e,t)=>t.startedAt.localeCompare(e.startedAt));n[0]?nX(t,n[0].id):ji({kind:`task`,id:t}),Q.activeCenterTab?.kind===`task`&&Q.activeCenterTab.id===e&&xee(),Ii.selectedTaskId===e&&(Ii.selectedTaskId=void 0,Ii.taskLogs=void 0)}async function zZ(e){await uo(e),RZ(e),await vs(),yi.success(`Task removed`)}async function BZ(e){let t=e.filter((t,n)=>e.indexOf(t)===n);if(t.length===0)return;let n=await Promise.allSettled(t.map(e=>uo(e))),r=t.filter((e,t)=>n[t]?.status===`fulfilled`),i=t.length-r.length;for(let e of r)RZ(e);await vs(),r.length>0&&yi.success(r.length===1?`Removed 1 old task run`:`Removed ${r.length} old task runs`),i>0&&yi.error(i===1?`Could not remove 1 old task run`:`Could not remove ${i} old task runs`)}async function VZ(){let{removed:e}=await mo();for(let t of e)RZ(t);await vs(),yi.success(e.length===1?`Removed 1 finished task`:`Removed ${e.length} finished tasks`)}async function HZ(e){let t=await so(e);return await vs(),await FZ(t.id),yi.success(`Command started`,{description:e.name??e.command}),t}var UZ=`max-width: 1023px`,WZ=`max-width: 639px`,GZ,KZ;typeof window<`u`&&typeof window.matchMedia==`function`&&(GZ=new De(UZ),KZ=new De(WZ));var qZ={get isCompact(){return GZ?.current??!1},get isPhone(){return KZ?.current??!1}},JZ=new Set([`$$slots`,`$$events`,`$$legacy`]);function YZ(e,t){let n=U(t,JZ),r=[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`}]];G(e,V({name:`folder-tree`},()=>n,{get iconNode(){return r}}))}var XZ=new Set([`$$slots`,`$$events`,`$$legacy`]);function ZZ(e,t){let n=U(t,XZ),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M12 16v-4`}],[`path`,{d:`M12 8h.01`}]];G(e,V({name:`info`},()=>n,{get iconNode(){return r}}))}var QZ=new Set([`$$slots`,`$$events`,`$$legacy`]);function $Z(e,t){let n=U(t,QZ),r=[[`path`,{d:`M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4`}],[`path`,{d:`M2 6h4`}],[`path`,{d:`M2 10h4`}],[`path`,{d:`M2 14h4`}],[`path`,{d:`M2 18h4`}],[`path`,{d:`M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`}]];G(e,V({name:`notebook-pen`},()=>n,{get iconNode(){return r}}))}var eQ=[{id:`conversations`,title:`Conversations`,icon:mF,defaultDock:`left`,defaultOrder:0,hideable:!1},{id:`files`,title:`Files`,icon:YZ,defaultDock:`left`,defaultOrder:1},{id:`git`,title:`Git Changes`,icon:AL,defaultDock:`right`,defaultOrder:0},{id:`pull-requests`,title:`Pull Requests`,icon:df,defaultDock:`right`,defaultOrder:1},{id:`context`,title:`Context`,icon:ZZ,defaultDock:`right`,defaultOrder:2},{id:`tasks`,title:`Tasks`,icon:Ue,defaultDock:`left`,defaultOrder:2},{id:`notes`,title:`Scratch Notes`,icon:$Z,defaultDock:`left`,defaultOrder:3}],tQ=`nerve.layout.v1`,nQ=200,rQ={collapsed:[`bottom`]};function iQ(){if(typeof localStorage>`u`)return $l(void 0,eQ,{collapsed:[...rQ.collapsed]});let e;try{let t=localStorage.getItem(tQ);e=t?JSON.parse(t):void 0}catch{e=void 0}return $l(e,eQ,{collapsed:[...rQ.collapsed]})}var aQ=Ie({layout:iQ()}),oQ=Ie({primary:!1,secondary:!1}),sQ={get current(){return aQ.layout}};function cQ(){if(!(typeof localStorage>`u`))try{localStorage.setItem(tQ,JSON.stringify(aQ.layout))}catch{}}function lQ(e,t=!0){e!==aQ.layout&&(aQ.layout=e,t&&cQ())}function uQ(){return{layout:JSON.parse(JSON.stringify(aQ.layout)),sheets:{primary:oQ.primary,secondary:oQ.secondary}}}function dQ(e){aQ.layout=$l(e.layout,eQ,{collapsed:[...rQ.collapsed]}),oQ.primary=e.sheets.primary,oQ.secondary=e.sheets.secondary,cQ()}function fQ(e){lQ(Ste(aQ.layout,e))}function pQ(e,t){lQ(xte(aQ.layout,e,t))}function mQ(e){lQ(Cte(aQ.layout,e))}function hQ(e){lQ(Tte(aQ.layout,e))}function gQ(e){return nu(aQ.layout,e)}var _Q;function vQ(e,t){let n=Ete(aQ.layout,e,t);n!==aQ.layout&&(aQ.layout=n,_Q&&clearTimeout(_Q),_Q=setTimeout(cQ,nQ))}function yQ(e,t){oQ[e]=t,t&&(oQ[e===`primary`?`secondary`:`primary`]=!1)}function bQ(){oQ.primary=!1,oQ.secondary=!1}function xQ(e,t){if(!t){hQ(e);return}let n=e===`left`?`primary`:`secondary`;yQ(n,!oQ[n])}function SQ(e,t){wQ(e,t,!0)}function CQ(e,t){wQ(e,t,!1)}function wQ(e,t,n){if(lQ(wte(aQ.layout,e),n),!t)return;let r=[`left`,`right`,`bottom`].find(t=>aQ.layout.docks[t].views.includes(e));r&&yQ(r===`left`?`primary`:`secondary`,!0)}function TQ(e,t){x(t,!0);let n=X(void 0),r=X(void 0),i=X(void 0),a=X(void 0),o=l(()=>dm.status),s=l(()=>dm.activeProject),c=l(()=>UX.activeConversation),u=l(()=>UX.activeAgent),f=l(()=>UX.conversationAgents),m=l(()=>UX.compacting),h=l(()=>UX.activeContextUsage),g=l(()=>UX.activeContextWindow),v=l(()=>PZ.scopedTasks),y=l(()=>PZ.selectedTask);z(()=>{t.viewId===`files`?R(n,L(n)??Xa(()=>import(`./FilesPanelView-CRi7ktm1.js`),__vite__mapDeps([80,31,63,64,43,34,65,39,40,41,57,66,38,42,48,49,50,51,52,53,54])),!0):t.viewId===`tasks`?R(r,L(r)??Xa(()=>import(`./TasksPanelView-Bpimx72m.js`),__vite__mapDeps([81,31,32,33,34,35,36,37,38,39,40,41,42,43,44,48,49,50,51,52,53,54,30,11,8,45,46,47])),!0):t.viewId===`notes`?R(i,L(i)??Xa(()=>import(`./scratch-notes-Cxtj6KmK.js`),__vite__mapDeps([82,31,63,64,43,34,65,39,40,41,57,66,38,42,52,53,54])),!0):t.viewId===`pull-requests`&&R(a,L(a)??Xa(()=>import(`./GitPullRequestsPanelView-piJz3lXy.js`),__vite__mapDeps([83,31,33,63,64,43,34,65,39,40,41,57,66,37,67,71,72,35,73,68])),!0)});function b(e){un.agentId=e.id,un.projectId=e.projectId,un.conversationId=e.conversationId,SQ(`context`,qZ.isCompact)}function S(){SQ(`tasks`,qZ.isCompact),fQ(`tasks`)}var C=_(),w=F(C),T=e=>{var t=_();j(F(t),()=>L(n),e=>{VY(e,{})},(e,t)=>{let n=l(()=>L(t)?.default);var r=_(),i=F(r),a=e=>{var t=_();d(F(t),()=>L(n),(e,t)=>{t(e,{get activeProject(){return L(s)}})}),q(e,t)};p(i,e=>{L(n)&&e(a)}),q(e,r)}),q(e,t)},E=e=>{EZ(e,{})},D=e=>{aG(e,{get model(){return t.gitModel},get actions(){return t.gitActions}})},O=e=>{var n=_();j(F(n),()=>L(a),e=>{VY(e,{})},(e,n)=>{let r=l(()=>L(n)?.default);var i=_(),a=F(i),o=e=>{var n=_();d(F(n),()=>L(r),(e,n)=>{n(e,{get model(){return t.gitModel},get actions(){return t.gitActions}})}),q(e,n)};p(a,e=>{L(r)&&e(o)}),q(e,i)}),q(e,n)},k=e=>{BX(e,{get status(){return L(o)},get contextUsage(){return L(h)},get contextWindow(){return L(g)},get activeProject(){return L(s)},get activeConversation(){return L(c)},get activeAgent(){return L(u)},get conversationAgents(){return L(f)},get compacting(){return L(m)},get exportUrl(){return Go},get systemPromptUrl(){return ts},onSelectAgent:b,onCompact:()=>void yo()})},ee=e=>{var t=_();j(F(t),()=>L(i),e=>{VY(e,{})},(e,t)=>{let n=l(()=>L(t)?.NotesPanelView);var r=_(),i=F(r),a=e=>{var t=_();d(F(t),()=>L(n),(e,t)=>{t(e,{get activeProject(){return L(s)}})}),q(e,t)};p(i,e=>{L(n)&&e(a)}),q(e,r)}),q(e,t)},A=e=>{var t=_();j(F(t),()=>L(r),e=>{VY(e,{})},(e,t)=>{let n=l(()=>L(t)?.default);var r=_(),i=F(r),a=e=>{var t=_(),r=F(t);{let e=l(()=>L(o)?.storage.userHome);d(r,()=>L(n),(t,n)=>{n(t,{get activeProject(){return L(s)},get tasks(){return L(v)},get selectedTask(){return L(y)},get homeDir(){return L(e)},onOpenTaskOutput:e=>{S(),iX(e)},onCancelTask:(e,t)=>void IZ(e,t),onRestartTask:e=>void LZ(e),onRemoveTask:e=>void zZ(e),onCleanupRuns:e=>void BZ(e),onPruneTasks:()=>void VZ(),onRunCommand:e=>{S(),HZ(e)}})})}q(e,t)};p(i,e=>{L(n)&&e(a)}),q(e,r)}),q(e,t)};p(w,e=>{t.viewId===`files`?e(T):t.viewId===`conversations`?e(E,1):t.viewId===`git`?e(D,2):t.viewId===`pull-requests`?e(O,3):t.viewId===`context`?e(k,4):t.viewId===`notes`?e(ee,5):t.viewId===`tasks`&&e(A,6)}),q(e,C),H()}var EQ={value:()=>{}};function DQ(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new OQ(n)}function OQ(e){this._=e}function kQ(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}OQ.prototype=DQ.prototype={constructor:OQ,on:function(e,t){var n=this._,r=kQ(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=AQ(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=jQ(n[i],e.name,t);else if(t==null)for(i in n)n[i]=jQ(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new OQ(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function AQ(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function jQ(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=EQ,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var MQ={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function NQ(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),MQ.hasOwnProperty(t)?{space:MQ[t],local:e}:e}function PQ(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function FQ(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function IQ(e){var t=NQ(e);return(t.local?FQ:PQ)(t)}function LQ(){}function RQ(e){return e==null?LQ:function(){return this.querySelector(e)}}function zQ(e){typeof e!=`function`&&(e=RQ(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new E1(r,this._parents)}function BQ(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function VQ(){return[]}function HQ(e){return e==null?VQ:function(){return this.querySelectorAll(e)}}function UQ(e){return function(){return BQ(e.apply(this,arguments))}}function WQ(e){e=typeof e==`function`?UQ(e):HQ(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new E1(r,i)}function GQ(e){return function(){return this.matches(e)}}function KQ(e){return function(t){return t.matches(e)}}var qQ=Array.prototype.find;function JQ(e){return function(){return qQ.call(this.children,e)}}function YQ(){return this.firstElementChild}function XQ(e){return this.select(e==null?YQ:JQ(typeof e==`function`?e:KQ(e)))}var ZQ=Array.prototype.filter;function QQ(){return Array.from(this.children)}function $Q(e){return function(){return ZQ.call(this.children,e)}}function e$(e){return this.selectAll(e==null?QQ:$Q(typeof e==`function`?e:KQ(e)))}function t$(e){typeof e!=`function`&&(e=GQ(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new E1(r,this._parents)}function n$(e){return Array(e.length)}function r$(){return new E1(this._enter||this._groups.map(n$),this._parents)}function i$(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}i$.prototype={constructor:i$,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function a$(e){return function(){return e}}function o$(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new i$(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function s$(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new i$(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function c$(e){return e.__data__}function l$(e,t){if(!arguments.length)return Array.from(this,c$);var n=t?s$:o$,r=this._parents,i=this._groups;typeof e!=`function`&&(e=a$(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=u$(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new E1(o,r),o._enter=s,o._exit=c,o}function u$(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function d$(){return new E1(this._exit||this._groups.map(n$),this._parents)}function f$(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function p$(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new E1(s,this._parents)}function m$(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function h$(e){e||=g$;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new E1(i,this._parents).order()}function g$(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _$(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function v$(){return Array.from(this)}function y$(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function b$(){let e=0;for(let t of this)++e;return e}function x$(){return!this.node()}function S$(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function C$(e){return function(){this.removeAttribute(e)}}function w$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function T$(e,t){return function(){this.setAttribute(e,t)}}function E$(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function D$(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function O$(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function k$(e,t){var n=NQ(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?w$:C$:typeof t==`function`?n.local?O$:D$:n.local?E$:T$)(n,t))}function A$(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function j$(e){return function(){this.style.removeProperty(e)}}function M$(e,t,n){return function(){this.style.setProperty(e,t,n)}}function N$(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function P$(e,t,n){return arguments.length>1?this.each((t==null?j$:typeof t==`function`?N$:M$)(e,t,n??``)):F$(this.node(),e)}function F$(e,t){return e.style.getPropertyValue(t)||A$(e).getComputedStyle(e,null).getPropertyValue(t)}function I$(e){return function(){delete this[e]}}function Oae(e,t){return function(){this[e]=t}}function L$(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function R$(e,t){return arguments.length>1?this.each((t==null?I$:typeof t==`function`?L$:Oae)(e,t)):this.node()[e]}function z$(e){return e.trim().split(/^|\s+/)}function B$(e){return e.classList||new V$(e)}function V$(e){this._node=e,this._names=z$(e.getAttribute(`class`)||``)}V$.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function H$(e,t){for(var n=B$(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function U$(e,t){for(var n=B$(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function W$(e){return function(){H$(this,e)}}function G$(e){return function(){U$(this,e)}}function K$(e,t){return function(){(t.apply(this,arguments)?H$:U$)(this,e)}}function q$(e,t){var n=z$(e+``);if(arguments.length<2){for(var r=B$(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?K$:t?W$:G$)(n,t))}function J$(){this.textContent=``}function Y$(e){return function(){this.textContent=e}}function X$(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Z$(e){return arguments.length?this.each(e==null?J$:(typeof e==`function`?X$:Y$)(e)):this.node().textContent}function Q$(){this.innerHTML=``}function $$(e){return function(){this.innerHTML=e}}function e1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function t1(e){return arguments.length?this.each(e==null?Q$:(typeof e==`function`?e1:$$)(e)):this.node().innerHTML}function n1(){this.nextSibling&&this.parentNode.appendChild(this)}function r1(){return this.each(n1)}function i1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function a1(){return this.each(i1)}function o1(e){var t=typeof e==`function`?e:IQ(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function s1(){return null}function c1(e,t){var n=typeof e==`function`?e:IQ(e),r=t==null?s1:typeof t==`function`?t:RQ(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function l1(){var e=this.parentNode;e&&e.removeChild(this)}function u1(){return this.each(l1)}function d1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function f1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function p1(e){return this.select(e?f1:d1)}function m1(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function h1(e){return function(t){e.call(this,t,this.__data__)}}function g1(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function _1(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function v1(e,t,n){return function(){var r=this.__on,i,a=h1(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function y1(e,t,n){var r=g1(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?v1:_1,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function b1(e,t,n){var r=A$(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function x1(e,t){return function(){return b1(this,e,t)}}function S1(e,t){return function(){return b1(this,e,t.apply(this,arguments))}}function C1(e,t){return this.each((typeof t==`function`?S1:x1)(e,t))}function*w1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var T1=[null];function E1(e,t){this._groups=e,this._parents=t}function D1(){return new E1([[document.documentElement]],T1)}function O1(){return this}E1.prototype=D1.prototype={constructor:E1,select:zQ,selectAll:WQ,selectChild:XQ,selectChildren:e$,filter:t$,data:l$,enter:r$,exit:d$,join:f$,merge:p$,selection:O1,order:m$,sort:h$,call:_$,nodes:v$,node:y$,size:b$,empty:x$,each:S$,attr:k$,style:P$,property:R$,classed:q$,text:Z$,html:t1,raise:r1,lower:a1,append:o1,insert:c1,remove:u1,clone:p1,datum:m1,on:y1,dispatch:C1,[Symbol.iterator]:w1};function k1(e){return typeof e==`string`?new E1([[document.querySelector(e)]],[document.documentElement]):new E1([[e]],T1)}function A1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function j1(e,t){if(e=A1(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var M1={passive:!1},N1={capture:!0,passive:!1};function P1(e){e.stopImmediatePropagation()}function F1(e){e.preventDefault(),e.stopImmediatePropagation()}function I1(e){var t=e.document.documentElement,n=k1(e).on(`dragstart.drag`,F1,N1);`onselectstart`in t?n.on(`selectstart.drag`,F1,N1):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function L1(e,t){var n=e.document.documentElement,r=k1(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,F1,N1),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var R1=e=>()=>e;function z1(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}z1.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function B1(e){return!e.ctrlKey&&!e.button}function V1(){return this.parentNode}function H1(e,t){return t??{x:e.x,y:e.y}}function U1(){return navigator.maxTouchPoints||`ontouchstart`in this}function W1(){var e=B1,t=V1,n=H1,r=U1,i={},a=DQ(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,M1).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(k1(n.view).on(`mousemove.drag`,m,N1).on(`mouseup.drag`,h,N1),I1(n.view),P1(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(F1(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){k1(e.view).on(`mousemove.drag mouseup.drag`,null),L1(e.view,l),F1(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(P1(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&(F1(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(P1(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=j1(l||r,t),p,m,h;if((h=n.call(e,new z1(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=j1(l||a,t),_=o;break}u.call(r,e,new z1(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:R1(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:R1(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:R1(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:R1(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function G1(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function K1(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function q1(){}var J1=.7,Y1=1/J1,X1=`\\s*([+-]?\\d+)\\s*`,Z1=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Q1=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,$1=/^#([0-9a-f]{3,8})$/,e0=RegExp(`^rgb\\(${X1},${X1},${X1}\\)$`),t0=RegExp(`^rgb\\(${Q1},${Q1},${Q1}\\)$`),n0=RegExp(`^rgba\\(${X1},${X1},${X1},${Z1}\\)$`),r0=RegExp(`^rgba\\(${Q1},${Q1},${Q1},${Z1}\\)$`),i0=RegExp(`^hsl\\(${Z1},${Q1},${Q1}\\)$`),a0=RegExp(`^hsla\\(${Z1},${Q1},${Q1},${Z1}\\)$`),o0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};G1(q1,d0,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:s0,formatHex:s0,formatHex8:c0,formatHsl:l0,formatRgb:u0,toString:u0});function s0(){return this.rgb().formatHex()}function c0(){return this.rgb().formatHex8()}function l0(){return w0(this).formatHsl()}function u0(){return this.rgb().formatRgb()}function d0(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=$1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?f0(t):n===3?new g0(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?p0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?p0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=e0.exec(e))?new g0(t[1],t[2],t[3],1):(t=t0.exec(e))?new g0(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=n0.exec(e))?p0(t[1],t[2],t[3],t[4]):(t=r0.exec(e))?p0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=i0.exec(e))?C0(t[1],t[2]/100,t[3]/100,1):(t=a0.exec(e))?C0(t[1],t[2]/100,t[3]/100,t[4]):o0.hasOwnProperty(e)?f0(o0[e]):e===`transparent`?new g0(NaN,NaN,NaN,0):null}function f0(e){return new g0(e>>16&255,e>>8&255,e&255,1)}function p0(e,t,n,r){return r<=0&&(e=t=n=NaN),new g0(e,t,n,r)}function m0(e){return e instanceof q1||(e=d0(e)),e?(e=e.rgb(),new g0(e.r,e.g,e.b,e.opacity)):new g0}function h0(e,t,n,r){return arguments.length===1?m0(e):new g0(e,t,n,r??1)}function g0(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}G1(g0,h0,K1(q1,{brighter(e){return e=e==null?Y1:Y1**+e,new g0(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?J1:J1**+e,new g0(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new g0(x0(this.r),x0(this.g),x0(this.b),b0(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:_0,formatHex:_0,formatHex8:v0,formatRgb:y0,toString:y0}));function _0(){return`#${S0(this.r)}${S0(this.g)}${S0(this.b)}`}function v0(){return`#${S0(this.r)}${S0(this.g)}${S0(this.b)}${S0((isNaN(this.opacity)?1:this.opacity)*255)}`}function y0(){let e=b0(this.opacity);return`${e===1?`rgb(`:`rgba(`}${x0(this.r)}, ${x0(this.g)}, ${x0(this.b)}${e===1?`)`:`, ${e})`}`}function b0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function x0(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function S0(e){return e=x0(e),(e<16?`0`:``)+e.toString(16)}function C0(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new E0(e,t,n,r)}function w0(e){if(e instanceof E0)return new E0(e.h,e.s,e.l,e.opacity);if(e instanceof q1||(e=d0(e)),!e)return new E0;if(e instanceof E0)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new E0(o,s,c,e.opacity)}function T0(e,t,n,r){return arguments.length===1?w0(e):new E0(e,t,n,r??1)}function E0(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}G1(E0,T0,K1(q1,{brighter(e){return e=e==null?Y1:Y1**+e,new E0(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?J1:J1**+e,new E0(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new g0(k0(e>=240?e-240:e+120,i,r),k0(e,i,r),k0(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new E0(D0(this.h),O0(this.s),O0(this.l),b0(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=b0(this.opacity);return`${e===1?`hsl(`:`hsla(`}${D0(this.h)}, ${O0(this.s)*100}%, ${O0(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function D0(e){return e=(e||0)%360,e<0?e+360:e}function O0(e){return Math.max(0,Math.min(1,e||0))}function k0(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var A0=e=>()=>e;function j0(e,t){return function(n){return e+n*t}}function M0(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function N0(e,t){var n=t-e;return n?j0(e,n>180||n<-180?n-360*Math.round(n/360):n):A0(isNaN(e)?t:e)}function P0(e){return(e=+e)==1?F0:function(t,n){return n-t?M0(t,n,e):A0(isNaN(t)?n:t)}}function F0(e,t){var n=t-e;return n?j0(e,n):A0(isNaN(e)?t:e)}var I0=(function e(t){var n=P0(t);function r(e,t){var r=n((e=h0(e)).r,(t=h0(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=F0(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function L0(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function R0(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function z0(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=J0(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function B0(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function V0(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function H0(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=J0(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var U0=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,W0=new RegExp(U0.source,`g`);function G0(e){return function(){return e}}function K0(e){return function(t){return e(t)+``}}function q0(e,t){var n=U0.lastIndex=W0.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=U0.exec(e))&&(i=W0.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:V0(r,i)})),n=W0.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?K0(c[0].x):G0(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function J0(e,t){var n=typeof t,r;return t==null||n===`boolean`?A0(t):(n===`number`?V0:n===`string`?(r=d0(t))?(t=r,I0):q0:t instanceof d0?I0:t instanceof Date?B0:R0(t)?L0:Array.isArray(t)?z0:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?H0:V0)(e,t)}var Y0=180/Math.PI,X0={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Z0(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Y0,skewX:Math.atan(c)*Y0,scaleX:o,scaleY:s}}var Q0;function $0(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?X0:Z0(t.a,t.b,t.c,t.d,t.e,t.f)}function e2(e){return e==null||(Q0||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Q0.setAttribute(`transform`,e),!(e=Q0.transform.baseVal.consolidate()))?X0:(e=e.matrix,Z0(e.a,e.b,e.c,e.d,e.e,e.f))}function t2(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:V0(e,i)},{i:c-2,x:V0(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:V0(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:V0(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:V0(e,n)},{i:s-2,x:V0(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var n2=t2($0,`px, `,`px)`,`deg)`),r2=t2(e2,`, `,`)`,`)`),i2=1e-12;function a2(e){return((e=Math.exp(e))+1/e)/2}function o2(e){return((e=Math.exp(e))-1/e)/2}function s2(e){return((e=Math.exp(2*e))-1)/(e+1)}var c2=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<i2)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=a2(y),c=s/(n*g)*(i*s2(t*r+y)-o2(y));return[a+c*d,o+c*f,s*i/a2(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),l2=0,u2=0,d2=0,f2=1e3,p2,m2,h2=0,g2=0,_2=0,v2=typeof performance==`object`&&performance.now?performance:Date,y2=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function b2(){return g2||=(y2(x2),v2.now()+_2)}function x2(){g2=0}function S2(){this._call=this._time=this._next=null}S2.prototype=C2.prototype={constructor:S2,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?b2():+n)+(t==null?0:+t),!this._next&&m2!==this&&(m2?m2._next=this:p2=this,m2=this),this._call=e,this._time=n,O2()},stop:function(){this._call&&(this._call=null,this._time=1/0,O2())}};function C2(e,t,n){var r=new S2;return r.restart(e,t,n),r}function w2(){b2(),++l2;for(var e=p2,t;e;)(t=g2-e._time)>=0&&e._call.call(void 0,t),e=e._next;--l2}function T2(){g2=(h2=v2.now())+_2,l2=u2=0;try{w2()}finally{l2=0,D2(),g2=0}}function E2(){var e=v2.now(),t=e-h2;t>f2&&(_2-=t,h2=e)}function D2(){for(var e,t=p2,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:p2=n);m2=e,O2(r)}function O2(e){l2||(u2&&=clearTimeout(u2),e-g2>24?(e<1/0&&(u2=setTimeout(T2,e-v2.now()-_2)),d2&&=clearInterval(d2)):(d2||=(h2=v2.now(),setInterval(E2,f2)),l2=1,y2(T2)))}function k2(e,t,n){var r=new S2;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var A2=DQ(`start`,`end`,`cancel`,`interrupt`),j2=[];function M2(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;I2(e,n,{name:t,index:r,group:i,on:A2,tween:j2,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function N2(e,t){var n=F2(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function P2(e,t){var n=F2(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function F2(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function I2(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=C2(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return k2(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(k2(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function L2(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function R2(e){return this.each(function(){L2(this,e)})}function z2(e,t){var n,r;return function(){var i=P2(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function B2(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=P2(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function V2(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=F2(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?z2:B2)(n,e,t))}function H2(e,t,n){var r=e._id;return e.each(function(){var e=P2(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return F2(e,r).value[t]}}function U2(e,t){var n;return(typeof t==`number`?V0:t instanceof d0?I0:(n=d0(t))?(t=n,I0):q0)(e,t)}function W2(e){return function(){this.removeAttribute(e)}}function G2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function K2(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function q2(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function J2(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Y2(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function X2(e,t){var n=NQ(e),r=n===`transform`?r2:U2;return this.attrTween(e,typeof t==`function`?(n.local?Y2:J2)(n,r,H2(this,`attr.`+e,t)):t==null?(n.local?G2:W2)(n):(n.local?q2:K2)(n,r,t))}function Z2(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Q2(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function $2(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Q2(e,i)),n}return i._value=t,i}function e4(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Z2(e,i)),n}return i._value=t,i}function t4(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=NQ(e);return this.tween(n,(r.local?$2:e4)(r,t))}function n4(e,t){return function(){N2(this,e).delay=+t.apply(this,arguments)}}function r4(e,t){return t=+t,function(){N2(this,e).delay=t}}function i4(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?n4:r4)(t,e)):F2(this.node(),t).delay}function a4(e,t){return function(){P2(this,e).duration=+t.apply(this,arguments)}}function o4(e,t){return t=+t,function(){P2(this,e).duration=t}}function s4(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?a4:o4)(t,e)):F2(this.node(),t).duration}function c4(e,t){if(typeof t!=`function`)throw Error();return function(){P2(this,e).ease=t}}function l4(e){var t=this._id;return arguments.length?this.each(c4(t,e)):F2(this.node(),t).ease}function u4(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();P2(this,e).ease=n}}function d4(e){if(typeof e!=`function`)throw Error();return this.each(u4(this._id,e))}function f4(e){typeof e!=`function`&&(e=GQ(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new V4(r,this._parents,this._name,this._id)}function p4(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new V4(o,this._parents,this._name,this._id)}function m4(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function h4(e,t,n){var r,i,a=m4(t)?N2:P2;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function g4(e,t){var n=this._id;return arguments.length<2?F2(this.node(),n).on.on(e):this.each(h4(n,e,t))}function _4(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function v4(){return this.on(`end.remove`,_4(this._id))}function y4(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=RQ(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,M2(l[f],t,n,f,l,F2(u,n)));return new V4(a,this._parents,t,n)}function b4(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=HQ(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=F2(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&M2(p,t,n,h,f,m);a.push(f),o.push(u)}return new V4(a,o,t,n)}var x4=D1.prototype.constructor;function S4(){return new x4(this._groups,this._parents)}function C4(e,t){var n,r,i;return function(){var a=F$(this,e),o=(this.style.removeProperty(e),F$(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function w4(e){return function(){this.style.removeProperty(e)}}function T4(e,t,n){var r,i=n+``,a;return function(){var o=F$(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function E4(e,t,n){var r,i,a;return function(){var o=F$(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),F$(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function D4(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=P2(this,e),l=c.on,u=c.value[a]==null?s||=w4(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function O4(e,t,n){var r=(e+=``)==`transform`?n2:U2;return t==null?this.styleTween(e,C4(e,r)).on(`end.style.`+e,w4(e)):typeof t==`function`?this.styleTween(e,E4(e,r,H2(this,`style.`+e,t))).each(D4(this._id,e)):this.styleTween(e,T4(e,r,t),n).on(`end.style.`+e,null)}function k4(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function A4(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&k4(e,a,n)),r}return a._value=t,a}function j4(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,A4(e,t,n??``))}function M4(e){return function(){this.textContent=e}}function N4(e){return function(){var t=e(this);this.textContent=t??``}}function P4(e){return this.tween(`text`,typeof e==`function`?N4(H2(this,`text`,e)):M4(e==null?``:e+``))}function F4(e){return function(t){this.textContent=e.call(this,t)}}function I4(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&F4(r)),t}return r._value=e,r}function L4(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,I4(e))}function R4(){for(var e=this._name,t=this._id,n=U4(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=F2(c,t);M2(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new V4(r,this._parents,e,n)}function z4(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=P2(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var B4=0;function V4(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function H4(e){return D1().transition(e)}function U4(){return++B4}var W4=D1.prototype;V4.prototype=H4.prototype={constructor:V4,select:y4,selectAll:b4,selectChild:W4.selectChild,selectChildren:W4.selectChildren,filter:f4,merge:p4,selection:S4,transition:R4,call:W4.call,nodes:W4.nodes,node:W4.node,size:W4.size,empty:W4.empty,each:W4.each,on:g4,attr:X2,attrTween:t4,style:O4,styleTween:j4,text:P4,textTween:L4,remove:v4,tween:V2,delay:i4,duration:s4,ease:l4,easeVarying:d4,end:z4,[Symbol.iterator]:W4[Symbol.iterator]};function G4(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var K4={time:null,delay:0,duration:250,ease:G4};function q4(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function J4(e){var t,n;e instanceof V4?(t=e._id,e=e._name):(t=U4(),(n=K4).time=b2(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&M2(c,e,t,l,o,n||q4(c,t));return new V4(r,this._parents,e,t)}D1.prototype.interrupt=R2,D1.prototype.transition=J4;var Y4=e=>()=>e;function X4(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Z4(e,t,n){this.k=e,this.x=t,this.y=n}Z4.prototype={constructor:Z4,scale:function(e){return e===1?this:new Z4(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Z4(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Q4=new Z4(1,0,0);$4.prototype=Z4.prototype;function $4(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Q4;return e.__zoom}function e3(e){e.stopImmediatePropagation()}function t3(e){e.preventDefault(),e.stopImmediatePropagation()}function n3(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function r3(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function i3(){return this.__zoom||Q4}function a3(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function o3(){return navigator.maxTouchPoints||`ontouchstart`in this}function s3(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function c3(){var e=n3,t=r3,n=s3,r=a3,i=o3,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=c2,l=DQ(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,i3).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,i3),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Q4.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Z4(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Z4(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Z4(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=k1(this.that).datum();l.call(e,this.that,new X4(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=j1(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],L2(this),s.start();t3(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=k1(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=j1(t,i),l=t.clientX,u=t.clientY;I1(t.view),e3(t),a.mouse=[c,this.__zoom.invert(c)],L2(this),a.start();function d(e){if(t3(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=j1(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),L1(e.view,a.moved),t3(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=j1(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);t3(r),s>0?k1(this).transition().duration(s).call(x,d,c,r):k1(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(e3(t),s=0;s<i;++s)c=r[s],l=j1(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),L2(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(t3(e),s=0;s<a;++s)c=i[s],l=j1(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(e3(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=j1(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=k1(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Y4(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Y4(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Y4(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Y4([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var l3={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},u3=[[-1/0,-1/0],[1/0,1/0]],d3=[`Enter`,` `,`Escape`],f3={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},p3;(function(e){e.Strict=`strict`,e.Loose=`loose`})(p3||={});var m3;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(m3||={});var h3;(function(e){e.Partial=`partial`,e.Full=`full`})(h3||={});var g3={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},_3;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(_3||={});var v3;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(v3||={});var y3;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(y3||={});var b3={[y3.Left]:y3.Right,[y3.Right]:y3.Left,[y3.Top]:y3.Bottom,[y3.Bottom]:y3.Top};function x3(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(let n of e.keys())if(!t.has(n))return!1;return!0}function S3(e,t,n){if(!n)return;let r=[];e.forEach((e,n)=>{t?.has(n)||r.push(e)}),r.length&&n(r)}function C3(e){return e===null?null:e?`valid`:`invalid`}var w3=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,T3=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),E3=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),D3=(e,t=[0,0])=>{let{width:n,height:r}=e6(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},kae=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:R3(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):E3(n)?n:t.nodeLookup.get(n.id)),I3(e,i?B3(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),O3=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=I3(n,B3(e)),r=!0)}),r?R3(n):{x:0,y:0,width:0,height:0}},k3=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=H3(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},Aae=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function jae(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=e6(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function Mae({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=Z3(O3(jae(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function A3({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent)if(!s)a?.(`005`,l3.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&$3(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=$3(d)?M3(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,l3.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function Nae({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=Aae(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var j3=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),M3=(e={x:0,y:0},t,n)=>({x:j3(e.x,t[0][0],t[1][0]-(n?.width??0)),y:j3(e.y,t[0][1],t[1][1]-(n?.height??0))});function N3(e,t,n){let{width:r,height:i}=e6(n),{x:a,y:o}=n.internals.positionAbsolute;return M3(e,[[a,o],[a+r,o+i]],t)}var P3=(e,t,n)=>e<t?j3(Math.abs(e-t),1,t)/t:e>n?-j3(Math.abs(e-n),1,t)/t:0,F3=(e,t,n=15,r=40)=>[P3(e.x,r,t.width-r)*n,P3(e.y,r,t.height-r)*n],I3=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),L3=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),R3=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),z3=(e,t=[0,0])=>{let{x:n,y:r}=E3(e)?e.internals.positionAbsolute:D3(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},B3=(e,t=[0,0])=>{let{x:n,y:r}=E3(e)?e.internals.positionAbsolute:D3(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},V3=(e,t)=>R3(I3(L3(e),L3(t))),H3=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},U3=(e,t)=>H3(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),W3=e=>G3(e.width)&&G3(e.height)&&G3(e.x)&&G3(e.y),G3=e=>!isNaN(e)&&isFinite(e),K3=(e,t)=>(e,t)=>{},q3=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),J3=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?q3(s,o):s},Y3=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function X3(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Pae(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=X3(e,n),i=X3(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=X3(e.top??e.y??0,n),i=X3(e.bottom??e.y??0,n),a=X3(e.left??e.x??0,t),o=X3(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Fae(e,t,n,r,i,a){let{x:o,y:s}=Y3(e,[t,n,r]),{x:c,y:l}=Y3({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var Z3=(e,t,n,r,i,a)=>{let o=Pae(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=j3(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=Fae(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},Q3=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function $3(e){return e!=null&&e!==`parent`}function e6(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function t6(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Iae(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function Lae(e){return{...f3,...e||{}}}function n6(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=s6(e),s=J3({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?q3(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var r6=e=>({width:e.offsetWidth,height:e.offsetHeight}),i6=e=>e?.getRootNode?.()||window?.document,Rae=[`INPUT`,`SELECT`,`TEXTAREA`];function a6(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?Rae.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var o6=e=>`clientX`in e,s6=(e,t)=>{let n=o6(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},c6=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...r6(t)}})};function zae({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function l6(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function u6({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case y3.Left:return[t-l6(t-r,a),n];case y3.Right:return[t+l6(r-t,a),n];case y3.Top:return[t,n-l6(n-i,a)];case y3.Bottom:return[t,n+l6(i-n,a)]}}function d6({sourceX:e,sourceY:t,sourcePosition:n=y3.Bottom,targetX:r,targetY:i,targetPosition:a=y3.Top,curvature:o=.25}){let[s,c]=u6({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=u6({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=zae({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function f6({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function Bae({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function Vae({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=I3(B3(e),B3(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),U3({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},R3(a))>0}var Hae=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,Uae=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),Wae=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,l3.error006()),t;let r=n.getEdgeId||Hae,i;return i=w3(e)?{...e}:{...e,id:r(e)},Uae(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function p6({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=f6({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var m6={[y3.Left]:{x:-1,y:0},[y3.Right]:{x:1,y:0},[y3.Top]:{x:0,y:-1},[y3.Bottom]:{x:0,y:1}},Gae=({source:e,sourcePosition:t=y3.Bottom,target:n})=>t===y3.Left||t===y3.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},h6=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function Kae({source:e,sourcePosition:t=y3.Bottom,target:n,targetPosition:r=y3.Top,center:i,offset:a,stepPosition:o}){let s=m6[t],c=m6[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=Gae({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=f6({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function qae(e,t,n,r){let i=Math.min(h6(e,t)/2,h6(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function g6({sourceX:e,sourceY:t,sourcePosition:n=y3.Bottom,targetX:r,targetY:i,targetPosition:a=y3.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=Kae({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=qae(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function _6(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Jae(e){let{sourceNode:t,targetNode:n}=e;if(!_6(t)||!_6(n))return null;let r=t.internals.handleBounds||v6(t.handles),i=n.internals.handleBounds||v6(n.handles),a=b6(r?.source??[],e.sourceHandle),o=b6(e.connectionMode===p3.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,l3.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||y3.Bottom,c=o?.position||y3.Top,l=y6(t,a,s),u=y6(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function v6(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function y6(e,t,n=y3.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??e6(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case y3.Top:return{x:i+o/2,y:a};case y3.Right:return{x:i+o,y:a+s/2};case y3.Bottom:return{x:i+o/2,y:a+s};case y3.Left:return{x:i,y:a+s/2}}}function b6(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function x6(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function Yae(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=x6(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var S6=1e3,Xae=10,C6={nodeOrigin:[0,0],nodeExtent:u3,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},Zae={...C6,checkEquality:!0};function w6(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function Qae(e,t,n){let r=w6(C6,n);for(let n of e.values())if(n.parentId)E6(n,e,t,r);else{let e=M3(D3(n,r.nodeOrigin),$3(n.extent)?n.extent:r.nodeExtent,e6(n));n.internals.positionAbsolute=e}}function $ae(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function T6(e){return e===`manual`}function eoe(e,t,n,r={}){let i=w6(Zae,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!T6(i.zIndexMode)?S6:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=M3(D3(u,i.nodeOrigin),$3(u.extent)?u.extent:i.nodeExtent,e6(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:$ae(u,e),z:D6(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&E6(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function toe(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function E6(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=w6(C6,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}toe(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*Xae),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=noe(e,u,o,s,a&&!T6(c)?S6:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function D6(e,t,n){let r=G3(e.zIndex)?e.zIndex:0;return T6(n)?r:r+(e.selected?t:0)}function noe(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=e6(e),l=D3(e,n),u=$3(e.extent)?M3(l,e.extent,c):l,d=M3({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=N3(d,c,t));let f=D6(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function roe(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=V3(a.get(n.parentId)?.expandedRect??z3(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=e6(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function ioe(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=r6(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=$3(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=N3(h,s,n))}else m&&(h=M3(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:c6(`source`,r.nodeElement,p,d,e.id),target:c6(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&E6(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:z3(g,i)}))}}if(f.length>0){let e=roe(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function aoe({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function O6(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function ooe(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;O6(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),O6(`target`,s,c,e,i,o),t.set(r.id,r)}}function k6(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:k6(n,t):!1}function A6(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function soe(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!k6(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function j6({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function coe({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=q3(a,t);return{x:o.x-a.x,y:o.y-a.y}}function loe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=k1(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?L3(O3(s)):null,x=v&&l?coe({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:q3(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=A3({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=j6({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=F3(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=n6(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=soe(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=j6({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=W1().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=n6(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=s6(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=n6(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=s6(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=s6(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=j6({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!A6(t,`.${g}`,v))&&(!_||A6(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function uoe(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())U3(i,z3(e))>0&&r.push(e);return r}var doe=250;function foe(e,t,n,r){let i=[],a=1/0,o=uoe(e,n,t+doe);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=y6(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function M6(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...y6(o,c,c.position,!0)}:c}function N6(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function poe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var P6=()=>!0;function moe(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=P6,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=i6(e.target),E=0,D,{x:O,y:k}=s6(e),ee=N6(a,w),A=s?.getBoundingClientRect(),j=!1;if(!A||!ee)return;let M=M6(i,ee,r,c,t);if(!M)return;let N=s6(e,A),te=!1,ne=null,P=!1,re=null;function ie(){if(!u||!A)return;let[e,t]=F3(N,A,S);f({x:e,y:t}),E=requestAnimationFrame(ie)}let F={...M,nodeId:i,type:ee,position:M.position},I=c.get(i),L={inProgress:!0,isValid:null,from:y6(I,F,y3.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:I,to:N,toHandle:null,toPosition:b3[F.position],toNode:null,pointer:N};function ae(){j=!0,y(L),m?.(e,{nodeId:i,handleId:r,handleType:ee})}C===0&&ae();function R(e){if(!j){let{x:t,y:n}=s6(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;ae()}if(!x()||!F){oe(e);return}let a=b();N=s6(e,A),D=foe(J3(N,a,!1,[1,1]),n,c,F),te||=(ie(),!0);let s=F6(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});re=s.handleDomNode,ne=s.connection,P=poe(!!D,s.isValid);let u=c.get(i),f=u?y6(u,F,y3.Left,!0):L.from,p={...L,from:f,isValid:P,to:s.toHandle&&P?Y3({x:s.toHandle.x,y:s.toHandle.y},a):N,toHandle:s.toHandle,toPosition:P&&s.toHandle?s.toHandle.position:b3[F.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:N};y(p),L=p}function oe(e){if(!(`touches`in e&&e.touches.length>0)){if(j){(D||re)&&ne&&P&&h?.(ne);let{inProgress:t,...n}=L,r={...n,toPosition:L.toHandle?L.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),te=!1,P=!1,ne=null,re=null,T.removeEventListener(`mousemove`,R),T.removeEventListener(`mouseup`,oe),T.removeEventListener(`touchmove`,R),T.removeEventListener(`touchend`,oe)}}T.addEventListener(`mousemove`,R),T.addEventListener(`mouseup`,oe),T.addEventListener(`touchmove`,R),T.addEventListener(`touchend`,oe)}function F6(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=P6,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=s6(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=N6(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===p3.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=M6(t,e,a,u,n,!0)}return _}var I6={onPointerDown:moe,isValid:F6};function hoe({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=k1(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&Q3()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=c3().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:j1}}var L6=e=>({x:e.x,y:e.y,zoom:e.k}),R6=({x:e,y:t,zoom:n})=>Q4.translate(e,t).scale(n),z6=(e,t)=>e.target.closest(`.${t}`),B6=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),goe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,V6=(e,t=0,n=goe,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},H6=e=>{let t=e.ctrlKey&&Q3()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function _oe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(z6(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=j1(u),t=d*2**H6(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===m3.Vertical?0:u.deltaX*f,m=i===m3.Horizontal?0:u.deltaY*f;!Q3()&&u.shiftKey&&i!==m3.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=L6(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function voe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=z6(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function yoe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=L6(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function boe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&B6(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,L6(a.transform))}}function xoe({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&B6(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=L6(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function Soe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,m=d.type===`wheel`;if(d.button===1&&d.type===`mousedown`&&(z6(d,`${l}-flow__node`)||z6(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||z6(d,s)&&m||z6(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type===`touchstart`&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type===`mousedown`||d.type===`touchstart`)||Array.isArray(r)&&!r.includes(d.button)&&d.type===`mousedown`)return!1;let h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}function Coe({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=c3().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=k1(e).call(f);y({x:i.x,y:i.y,zoom:j3(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(H6);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?J0:c2).transform(V6(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&v();let O=i&&!S&&!r;f.clickDistance(D?1/0:!G3(E)||E<0?0:E);let k=O?_oe({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):voe({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,k,{passive:!1});let ee=yoe({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,ee);let A=boe({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});f.on(`zoom`,A);let j=xoe({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,j);let M=Soe({zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});f.filter(M),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=R6(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=R6(e);return await g(n,t),n}function x(e){if(p){let t=R6(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?$4(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?J0:c2).scaleTo(V6(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?J0:c2).scaleBy(V6(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!G3(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var woe;(function(e){e.Line=`line`,e.Handle=`handle`})(woe||={});var Toe=K3(`Svelte Flow`,`https://svelteflow.dev/`);function Eoe(e,t,n={}){return Wae(e,t,{...n,onError:n.onError??Toe})}function U6(){let e={};return[t=>{if(t&&!a(e))throw Error(t);return ve(e)},t=>C(e,t)]}var[Doe,Ooe]=U6(),[koe,Aoe]=U6(),[joe,Moe]=U6(),Noe=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`type`,`position`,`style`,`class`,`isConnectable`,`isConnectableStart`,`isConnectableEnd`,`isValidConnection`,`onconnect`,`ondisconnect`,`children`]),Poe=P(`<div><!></div>`);function W6(e,t){x(t,!0);let n=K(t,`id`,3,null),r=K(t,`type`,3,`source`),i=K(t,`position`,19,()=>y3.Top),a=K(t,`isConnectableStart`,3,!0),o=K(t,`isConnectableEnd`,3,!0),s=U(t,Noe),u=Doe(`Handle must be used within a Custom Node component`),d=koe(`Handle must be used within a Custom Node component`),f=l(()=>r()===`target`),p=l(()=>t.isConnectable===void 0?d.value:t.isConnectable),g=t8(),_=l(()=>g.ariaLabelConfig),v=null;de(()=>{if(t.onconnect||t.ondisconnect){g.edges;let e=g.connectionLookup.get(`${u}-${r()}${n()?`-${n()}`:``}`);if(v&&!x3(e,v)){let n=e??new Map;S3(v,n,t.ondisconnect),S3(n,v,t.onconnect)}v=new Map(e)}});let b=l(()=>{if(!g.connection.inProgress)return[!1,!1,!1,!1,null];let{fromHandle:e,toHandle:t,isValid:i}=g.connection,a=e&&e.nodeId===u&&e.type===r()&&e.id===n(),o=t&&t.nodeId===u&&t.type===r()&&t.id===n();return[!0,a,o,g.connectionMode===p3.Strict?e?.type!==r():u!==e?.nodeId||n()!==e?.id,o&&i]}),S=l(()=>m(L(b),5)),C=l(()=>L(S)[0]),w=l(()=>L(S)[1]),T=l(()=>L(S)[2]),D=l(()=>L(S)[3]),O=l(()=>L(S)[4]);function k(e){let t=g.onbeforeconnect?g.onbeforeconnect(e):e;t&&(g.addEdge(t),g.onconnect?.(e))}function ee(e){let r=o6(e);e.currentTarget&&(r&&e.button===0||!r)&&I6.onPointerDown(e,{handleId:n(),nodeId:u,isTarget:L(f),connectionRadius:g.connectionRadius,domNode:g.domNode,nodeLookup:g.nodeLookup,connectionMode:g.connectionMode,lib:`svelte`,autoPanOnConnect:g.autoPanOnConnect,autoPanSpeed:g.autoPanSpeed,flowId:g.flowId,isValidConnection:t.isValidConnection||((...e)=>g.isValidConnection?.(...e)??!0),updateConnection:g.updateConnection,cancelConnection:g.cancelConnection,panBy:g.panBy,onConnect:k,onConnectStart:g.onconnectstart,onConnectEnd:(...e)=>g.onconnectend?.(...e),getTransform:()=>[g.viewport.x,g.viewport.y,g.viewport.zoom],getFromHandle:()=>g.connection.fromHandle,dragThreshold:g.connectionDragThreshold,handleDomNode:e.currentTarget})}function A(e){if(!u||!g.clickConnectStartHandle&&!a())return;if(!g.clickConnectStartHandle){g.onclickconnectstart?.(e,{nodeId:u,handleId:n(),handleType:r()}),g.clickConnectStartHandle={nodeId:u,type:r(),id:n()};return}let i=i6(e.target),o=t.isValidConnection??g.isValidConnection,{connectionMode:s,clickConnectStartHandle:c,flowId:l,nodeLookup:d}=g,{connection:f,isValid:p}=I6.isValid(e,{handle:{nodeId:u,id:n(),type:r()},connectionMode:s,fromNodeId:c.nodeId,fromHandleId:c.id??null,fromType:c.type,isValidConnection:o,flowId:l,doc:i,lib:`svelte`,nodeLookup:d});p&&f&&k(f);let m=structuredClone(E(g.connection));delete m.inProgress,m.toPosition=m.toHandle?m.toHandle.position:null,g.onclickconnectend?.(e,m),g.clickConnectStartHandle=null}var j=Poe(),M=()=>{};c(j,()=>({"data-handleid":n(),"data-nodeid":u,"data-handlepos":i(),"data-id":`${g.flowId??``}-${u??``}-${n()??`null`??``}-${r()??``}`,class:[`svelte-flow__handle`,`svelte-flow__handle-${i()}`,g.noDragClass,g.noPanClass,i(),t.class],onmousedown:ee,ontouchstart:ee,onclick:g.clickConnect?A:void 0,onkeypress:M,style:t.style,role:`button`,"aria-label":L(_)[`handle.ariaLabel`],tabindex:`-1`,...s,[Pe]:{valid:L(O),connectingto:L(T),connectingfrom:L(w),source:!L(f),target:L(f),connectablestart:a(),connectableend:o(),connectable:L(p),connectionindicator:L(p)&&(!L(C)||L(D))&&(L(C)||g.clickConnectStartHandle?o():a())}})),h(B(j),()=>t.children??N),y(j),q(e,j),H()}var Foe=P(`<!> <!>`,1);function G6(e,t){x(t,!0);let n=K(t,`targetPosition`,19,()=>y3.Top),r=K(t,`sourcePosition`,19,()=>y3.Bottom);var i=Foe(),a=F(i);W6(a,{type:`target`,get position(){return n()}});var o=Y(a);W6(Y(o),{type:`source`,get position(){return r()}}),J(()=>f(o,` ${t.data?.label??``} `)),q(e,i),H()}var Ioe=P(` <!>`,1);function Loe(e,t){x(t,!0);let n=K(t,`data`,19,()=>({label:`Node`})),r=K(t,`sourcePosition`,19,()=>y3.Bottom);g();var i=Ioe(),a=F(i);W6(Y(a),{type:`source`,get position(){return r()}}),J(()=>f(a,`${n()?.label??``} `)),q(e,i),H()}var Roe=P(` <!>`,1);function zoe(e,t){x(t,!0);let n=K(t,`data`,19,()=>({label:`Node`})),r=K(t,`targetPosition`,19,()=>y3.Top);g();var i=Roe(),a=F(i);W6(Y(a),{type:`target`,get position(){return r()}}),J(()=>f(a,`${n()?.label??``} `)),q(e,i),H()}function Boe(e,t){}function K6(e,t,n){if(!n||!t)return;let r=n===`root`?t:t.querySelector(`.svelte-flow__${n}`);r&&r.appendChild(e)}function Voe(e,t){let n=l(t8),r=l(()=>L(n).domNode),i;return L(r)?K6(e,L(r),t):i=be(()=>{z(()=>{K6(e,L(r),t),i?.()})}),{async update(t){K6(e,L(r),t)},destroy(){e.parentNode&&e.parentNode.removeChild(e),i?.()}}}function Hoe(){let e=X(typeof window>`u`);if(L(e)){let t=be(()=>{z(()=>{R(e,!1),t?.()})})}return{get value(){return L(e)}}}var q6=e=>T3(e),Uoe=e=>w3(e);function J6(e){return e===void 0?void 0:`${e}px`}var Y6={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Woe=new Set([`$$slots`,`$$events`,`$$legacy`,`x`,`y`,`width`,`height`,`selectEdgeOnClick`,`transparent`,`class`,`children`]),Goe=P(`<div><!></div>`);function Koe(e,t){x(t,!0);let n=K(t,`x`,3,0),r=K(t,`y`,3,0),i=K(t,`selectEdgeOnClick`,3,!1),a=K(t,`transparent`,3,!1),o=U(t,Woe),s=t8(),u=joe(`EdgeLabel must be used within a Custom Edge component`),d=l(()=>s.visible.edges.get(u)?.zIndex);var f=Goe(),p=()=>{i()&&u&&s.handleEdgeSelection(u)};c(f,e=>({class:[`svelte-flow__edge-label`,{transparent:a()},t.class],tabindex:`-1`,onclick:p,...o,[k]:e}),[()=>({display:Hoe().value?`none`:void 0,cursor:i()?`pointer`:void 0,transform:`translate(-50%, -50%) translate(${n()??``}px,${r()??``}px)`,"pointer-events":`all`,width:J6(t.width),height:J6(t.height),"z-index":L(d)})],void 0,void 0,`svelte-lqczsv`),h(B(f),()=>t.children??N),y(f),ge(f,(e,t)=>Voe?.(e,t),()=>`edge-labels`),q(e,f),H()}var qoe=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`path`,`label`,`labelX`,`labelY`,`labelStyle`,`markerStart`,`markerEnd`,`style`,`interactionWidth`,`class`]),Joe=ne(`<path></path>`),Yoe=ne(`<path fill="none"></path><!><!>`,1);function X6(e,t){let n=K(t,`interactionWidth`,3,20),r=U(t,qoe);var i=Yoe(),a=F(i),o=Y(a),s=e=>{var i=Joe();c(i,()=>({d:t.path,"stroke-opacity":0,"stroke-width":n(),fill:`none`,class:`svelte-flow__edge-interaction`,...r})),q(e,i)};p(o,e=>{n()>0&&e(s)});var l=Y(o),d=e=>{Koe(e,{get x(){return t.labelX},get y(){return t.labelY},get style(){return t.labelStyle},selectEdgeOnClick:!0,children:(e,n)=>{g();var r=D();J(()=>f(r,t.label)),q(e,r)},$$slots:{default:!0}})};p(l,e=>{t.label&&e(d)}),J(()=>{A(a,`id`,t.id),A(a,`d`,t.path),w(a,0,_e([`svelte-flow__edge-path`,t.class])),A(a,`marker-start`,t.markerStart),A(a,`marker-end`,t.markerEnd),u(a,t.style)}),q(e,i)}function Z6(e,t){x(t,!0);let n=l(()=>d6({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition,curvature:t.pathOptions?.curvature})),r=l(()=>m(L(n),3)),i=l(()=>L(r)[0]),a=l(()=>L(r)[1]),o=l(()=>L(r)[2]);X6(e,{get id(){return t.id},get path(){return L(i)},get labelX(){return L(a)},get labelY(){return L(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),H()}function Xoe(e,t){x(t,!0);let n=l(()=>g6({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition})),r=l(()=>m(L(n),3)),i=l(()=>L(r)[0]),a=l(()=>L(r)[1]),o=l(()=>L(r)[2]);X6(e,{get path(){return L(i)},get labelX(){return L(a)},get labelY(){return L(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),H()}function Zoe(e,t){x(t,!0);let n=l(()=>p6({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY})),r=l(()=>m(L(n),3)),i=l(()=>L(r)[0]),a=l(()=>L(r)[1]),o=l(()=>L(r)[2]);X6(e,{get path(){return L(i)},get labelX(){return L(a)},get labelY(){return L(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),H()}function Qoe(e,t){x(t,!0);let n=l(()=>g6({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition,borderRadius:0})),r=l(()=>m(L(n),3)),i=l(()=>L(r)[0]),a=l(()=>L(r)[1]),o=l(()=>L(r)[2]);X6(e,{get path(){return L(i)},get labelX(){return L(a)},get labelY(){return L(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),H()}function $oe(e,t,n,r){let i=new Map;return k3(e,{x:0,y:0,width:n,height:r},t,!0).forEach(e=>{i.set(e.id,e)}),i}function Q6(e){let{edges:t,defaultEdgeOptions:n,nodeLookup:r,previousEdges:i,connectionMode:a,onerror:o,onlyRenderVisible:s,elevateEdgesOnSelect:c,zIndexMode:l}=e,u=new Map;for(let d of t){let t=r.get(d.source),f=r.get(d.target);if(!t||!f)continue;if(s){let{visibleNodes:n,transform:r,width:i,height:a}=e;if(Vae({sourceNode:t,targetNode:f,width:i,height:a,transform:r}))n.set(t.id,t),n.set(f.id,f);else continue}let p=i.get(d.id);if(p&&d===p.edge&&t==p.sourceNode&&f==p.targetNode){u.set(d.id,p);continue}let m=Jae({id:d.id,sourceNode:t,targetNode:f,sourceHandle:d.sourceHandle||null,targetHandle:d.targetHandle||null,connectionMode:a,onError:o});m&&u.set(d.id,{...n,...d,...m,zIndex:Bae({selected:d.selected,zIndex:d.zIndex??n.zIndex,sourceNode:t,targetNode:f,elevateOnSelect:c,zIndexMode:l}),sourceNode:t,targetNode:f,edge:d})}return u}var ese=K3(`Svelte Flow`,`https://svelteflow.dev/`),$6={input:Loe,output:zoe,default:G6,group:Boe},e8={straight:Zoe,smoothstep:Xoe,default:Z6,step:Qoe};function tse(e,t,n,r,i,a){return t&&!n&&r&&i?Z3(O3(a,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),r,i,.5,2,.1):n??{x:0,y:0,zoom:1}}function nse(e){class t{#e=l(()=>e.props.id??`1`);get flowId(){return L(this.#e)}set flowId(e){R(this.#e,e)}#t=X(null);get domNode(){return L(this.#t)}set domNode(e){R(this.#t,e)}#n=X(null);get panZoom(){return L(this.#n)}set panZoom(e){R(this.#n,e)}#r=X(e.width??0);get width(){return L(this.#r)}set width(e){R(this.#r,e)}#i=X(e.height??0);get height(){return L(this.#i)}set height(e){R(this.#i,e)}#a=X(e.props.zIndexMode??`basic`);get zIndexMode(){return L(this.#a)}set zIndexMode(e){R(this.#a,e)}#o=l(()=>{let{nodesInitialized:t}=eoe(e.nodes,this.nodeLookup,this.parentLookup,{nodeExtent:this.nodeExtent,nodeOrigin:this.nodeOrigin,elevateNodesOnSelect:e.props.elevateNodesOnSelect??!0,checkEquality:!0,zIndexMode:this.zIndexMode});return this.fitViewQueued&&t&&(this.fitViewOptions?.duration?this.resolveFitView():queueMicrotask(()=>{this.resolveFitView()})),t});get nodesInitialized(){return L(this.#o)}set nodesInitialized(e){R(this.#o,e)}#s=l(()=>this.panZoom!==null);get viewportInitialized(){return L(this.#s)}set viewportInitialized(e){R(this.#s,e)}#c=l(()=>(ooe(this.connectionLookup,this.edgeLookup,e.edges),e.edges));get _edges(){return L(this.#c)}set _edges(e){R(this.#c,e)}get nodes(){return this.nodesInitialized,e.nodes}set nodes(t){e.nodes=t}get edges(){return this._edges}set edges(t){e.edges=t}_prevSelectedNodes=[];_prevSelectedNodeIds=new Set;#l=l(()=>{let e=this._prevSelectedNodeIds.size,t=new Set,n=this.nodes.filter(e=>(e.selected&&(t.add(e.id),this._prevSelectedNodeIds.delete(e.id)),e.selected));return(e!==t.size||this._prevSelectedNodeIds.size>0)&&(this._prevSelectedNodes=n),this._prevSelectedNodeIds=t,this._prevSelectedNodes});get selectedNodes(){return L(this.#l)}set selectedNodes(e){R(this.#l,e)}_prevSelectedEdges=[];_prevSelectedEdgeIds=new Set;#u=l(()=>{let e=this._prevSelectedEdgeIds.size,t=new Set,n=this.edges.filter(e=>(e.selected&&(t.add(e.id),this._prevSelectedEdgeIds.delete(e.id)),e.selected));return(e!==t.size||this._prevSelectedEdgeIds.size>0)&&(this._prevSelectedEdges=n),this._prevSelectedEdgeIds=t,this._prevSelectedEdges});get selectedEdges(){return L(this.#u)}set selectedEdges(e){R(this.#u,e)}selectionChangeHandlers=new Map;nodeLookup=new Map;parentLookup=new Map;connectionLookup=new Map;edgeLookup=new Map;_prevVisibleEdges=new Map;#d=l(()=>{let{nodes:t,_edges:n,_prevVisibleEdges:r,nodeLookup:i,connectionMode:a,onerror:o,onlyRenderVisibleElements:s,defaultEdgeOptions:c,zIndexMode:l}=this,u,d,f={edges:n,defaultEdgeOptions:c,previousEdges:r,nodeLookup:i,connectionMode:a,elevateEdgesOnSelect:e.props.elevateEdgesOnSelect??!0,zIndexMode:l,onerror:o};if(s){let{viewport:e,width:t,height:n}=this,r=[e.x,e.y,e.zoom];u=$oe(i,r,t,n),d=Q6({...f,onlyRenderVisible:!0,visibleNodes:u,transform:r,width:t,height:n})}else u=this.nodeLookup,d=Q6(f);return{nodes:u,edges:d}});get visible(){return L(this.#d)}set visible(e){R(this.#d,e)}#f=l(()=>e.props.nodesDraggable??!0);get nodesDraggable(){return L(this.#f)}set nodesDraggable(e){R(this.#f,e)}#p=l(()=>e.props.nodesConnectable??!0);get nodesConnectable(){return L(this.#p)}set nodesConnectable(e){R(this.#p,e)}#m=l(()=>e.props.elementsSelectable??!0);get elementsSelectable(){return L(this.#m)}set elementsSelectable(e){R(this.#m,e)}#h=l(()=>e.props.nodesFocusable??!0);get nodesFocusable(){return L(this.#h)}set nodesFocusable(e){R(this.#h,e)}#g=l(()=>e.props.edgesFocusable??!0);get edgesFocusable(){return L(this.#g)}set edgesFocusable(e){R(this.#g,e)}#_=l(()=>e.props.disableKeyboardA11y??!1);get disableKeyboardA11y(){return L(this.#_)}set disableKeyboardA11y(e){R(this.#_,e)}#v=l(()=>e.props.minZoom??.5);get minZoom(){return L(this.#v)}set minZoom(e){R(this.#v,e)}#y=l(()=>e.props.maxZoom??2);get maxZoom(){return L(this.#y)}set maxZoom(e){R(this.#y,e)}#b=l(()=>e.props.nodeOrigin??[0,0]);get nodeOrigin(){return L(this.#b)}set nodeOrigin(e){R(this.#b,e)}#x=l(()=>e.props.nodeExtent??u3);get nodeExtent(){return L(this.#x)}set nodeExtent(e){R(this.#x,e)}#S=l(()=>e.props.translateExtent??u3);get translateExtent(){return L(this.#S)}set translateExtent(e){R(this.#S,e)}#C=l(()=>e.props.defaultEdgeOptions??{});get defaultEdgeOptions(){return L(this.#C)}set defaultEdgeOptions(e){R(this.#C,e)}#w=l(()=>e.props.nodeDragThreshold??1);get nodeDragThreshold(){return L(this.#w)}set nodeDragThreshold(e){R(this.#w,e)}#T=l(()=>e.props.autoPanOnNodeDrag??!0);get autoPanOnNodeDrag(){return L(this.#T)}set autoPanOnNodeDrag(e){R(this.#T,e)}#E=l(()=>e.props.autoPanOnConnect??!0);get autoPanOnConnect(){return L(this.#E)}set autoPanOnConnect(e){R(this.#E,e)}#D=l(()=>e.props.autoPanOnNodeFocus??!0);get autoPanOnNodeFocus(){return L(this.#D)}set autoPanOnNodeFocus(e){R(this.#D,e)}#O=l(()=>e.props.autoPanSpeed??15);get autoPanSpeed(){return L(this.#O)}set autoPanSpeed(e){R(this.#O,e)}#k=l(()=>e.props.connectionDragThreshold??1);get connectionDragThreshold(){return L(this.#k)}set connectionDragThreshold(e){R(this.#k,e)}fitViewQueued=e.props.fitView??!1;fitViewOptions=e.props.fitViewOptions;fitViewResolver=null;#A=l(()=>e.props.snapGrid??null);get snapGrid(){return L(this.#A)}set snapGrid(e){R(this.#A,e)}#j=X(!1);get dragging(){return L(this.#j)}set dragging(e){R(this.#j,e)}#M=X(null);get selectionRect(){return L(this.#M)}set selectionRect(e){R(this.#M,e)}#N=X(!1);get selectionKeyPressed(){return L(this.#N)}set selectionKeyPressed(e){R(this.#N,e)}#P=X(!1);get multiselectionKeyPressed(){return L(this.#P)}set multiselectionKeyPressed(e){R(this.#P,e)}#F=X(!1);get deleteKeyPressed(){return L(this.#F)}set deleteKeyPressed(e){R(this.#F,e)}#I=X(!1);get panActivationKeyPressed(){return L(this.#I)}set panActivationKeyPressed(e){R(this.#I,e)}#L=X(!1);get zoomActivationKeyPressed(){return L(this.#L)}set zoomActivationKeyPressed(e){R(this.#L,e)}#R=X(null);get selectionRectMode(){return L(this.#R)}set selectionRectMode(e){R(this.#R,e)}#z=X(``);get ariaLiveMessage(){return L(this.#z)}set ariaLiveMessage(e){R(this.#z,e)}#B=l(()=>e.props.selectionMode??h3.Partial);get selectionMode(){return L(this.#B)}set selectionMode(e){R(this.#B,e)}#V=l(()=>({...$6,...e.props.nodeTypes}));get nodeTypes(){return L(this.#V)}set nodeTypes(e){R(this.#V,e)}#H=l(()=>({...e8,...e.props.edgeTypes}));get edgeTypes(){return L(this.#H)}set edgeTypes(e){R(this.#H,e)}#U=l(()=>e.props.noPanClass??`nopan`);get noPanClass(){return L(this.#U)}set noPanClass(e){R(this.#U,e)}#W=l(()=>e.props.noDragClass??`nodrag`);get noDragClass(){return L(this.#W)}set noDragClass(e){R(this.#W,e)}#G=l(()=>e.props.noWheelClass??`nowheel`);get noWheelClass(){return L(this.#G)}set noWheelClass(e){R(this.#G,e)}#K=l(()=>Lae(e.props.ariaLabelConfig));get ariaLabelConfig(){return L(this.#K)}set ariaLabelConfig(e){R(this.#K,e)}#q=X(tse(this.nodesInitialized,e.props.fitView,e.props.initialViewport,this.width,this.height,this.nodeLookup));get _viewport(){return L(this.#q)}set _viewport(e){R(this.#q,e)}get viewport(){return e.viewport??this._viewport}set viewport(t){e.viewport&&=t,this._viewport=t}#J=X(g3);get _connection(){return L(this.#J)}set _connection(e){R(this.#J,e)}#Y=l(()=>this._connection.inProgress?{...this._connection,to:J3(this._connection.to,[this.viewport.x,this.viewport.y,this.viewport.zoom])}:this._connection);get connection(){return L(this.#Y)}set connection(e){R(this.#Y,e)}#X=l(()=>e.props.connectionMode??p3.Strict);get connectionMode(){return L(this.#X)}set connectionMode(e){R(this.#X,e)}#Z=l(()=>e.props.connectionRadius??20);get connectionRadius(){return L(this.#Z)}set connectionRadius(e){R(this.#Z,e)}#Q=l(()=>e.props.isValidConnection??(()=>!0));get isValidConnection(){return L(this.#Q)}set isValidConnection(e){R(this.#Q,e)}#$=l(()=>e.props.selectNodesOnDrag??!0);get selectNodesOnDrag(){return L(this.#$)}set selectNodesOnDrag(e){R(this.#$,e)}#ee=l(()=>e.props.defaultMarkerColor===void 0?`#b1b1b7`:e.props.defaultMarkerColor);get defaultMarkerColor(){return L(this.#ee)}set defaultMarkerColor(e){R(this.#ee,e)}#te=l(()=>Yae(e.edges,{defaultColor:this.defaultMarkerColor,id:this.flowId,defaultMarkerStart:this.defaultEdgeOptions.markerStart,defaultMarkerEnd:this.defaultEdgeOptions.markerEnd}));get markers(){return L(this.#te)}set markers(e){R(this.#te,e)}#ne=l(()=>e.props.onlyRenderVisibleElements??!1);get onlyRenderVisibleElements(){return L(this.#ne)}set onlyRenderVisibleElements(e){R(this.#ne,e)}#re=l(()=>e.props.onflowerror??ese);get onerror(){return L(this.#re)}set onerror(e){R(this.#re,e)}#ie=l(()=>e.props.ondelete);get ondelete(){return L(this.#ie)}set ondelete(e){R(this.#ie,e)}#ae=l(()=>e.props.onbeforedelete);get onbeforedelete(){return L(this.#ae)}set onbeforedelete(e){R(this.#ae,e)}#oe=l(()=>e.props.onbeforeconnect);get onbeforeconnect(){return L(this.#oe)}set onbeforeconnect(e){R(this.#oe,e)}#se=l(()=>e.props.onconnect);get onconnect(){return L(this.#se)}set onconnect(e){R(this.#se,e)}#ce=l(()=>e.props.onconnectstart);get onconnectstart(){return L(this.#ce)}set onconnectstart(e){R(this.#ce,e)}#le=l(()=>e.props.onconnectend);get onconnectend(){return L(this.#le)}set onconnectend(e){R(this.#le,e)}#ue=l(()=>e.props.onbeforereconnect);get onbeforereconnect(){return L(this.#ue)}set onbeforereconnect(e){R(this.#ue,e)}#de=l(()=>e.props.onreconnect);get onreconnect(){return L(this.#de)}set onreconnect(e){R(this.#de,e)}#fe=l(()=>e.props.onreconnectstart);get onreconnectstart(){return L(this.#fe)}set onreconnectstart(e){R(this.#fe,e)}#pe=l(()=>e.props.onreconnectend);get onreconnectend(){return L(this.#pe)}set onreconnectend(e){R(this.#pe,e)}#me=l(()=>e.props.clickConnect??!0);get clickConnect(){return L(this.#me)}set clickConnect(e){R(this.#me,e)}#he=l(()=>e.props.onclickconnectstart);get onclickconnectstart(){return L(this.#he)}set onclickconnectstart(e){R(this.#he,e)}#ge=l(()=>e.props.onclickconnectend);get onclickconnectend(){return L(this.#ge)}set onclickconnectend(e){R(this.#ge,e)}#_e=X(null);get clickConnectStartHandle(){return L(this.#_e)}set clickConnectStartHandle(e){R(this.#_e,e)}#ve=l(()=>e.props.onselectiondrag);get onselectiondrag(){return L(this.#ve)}set onselectiondrag(e){R(this.#ve,e)}#ye=l(()=>e.props.onselectiondragstart);get onselectiondragstart(){return L(this.#ye)}set onselectiondragstart(e){R(this.#ye,e)}#be=l(()=>e.props.onselectiondragstop);get onselectiondragstop(){return L(this.#be)}set onselectiondragstop(e){R(this.#be,e)}resolveFitView=async()=>{this.panZoom&&(await Mae({nodes:this.nodeLookup,width:this.width,height:this.height,panZoom:this.panZoom,minZoom:this.minZoom,maxZoom:this.maxZoom},this.fitViewOptions),this.fitViewResolver?.resolve(!0),this.fitViewQueued=!1,this.fitViewOptions=void 0,this.fitViewResolver=null)};_prefersDark=new De(`(prefers-color-scheme: dark)`,e.props.colorModeSSR===`dark`);#xe=l(()=>e.props.colorMode===`system`?this._prefersDark.current?`dark`:`light`:e.props.colorMode??`light`);get colorMode(){return L(this.#xe)}set colorMode(e){R(this.#xe,e)}constructor(){}resetStoreValues(){this.dragging=!1,this.selectionRect=null,this.selectionRectMode=null,this.selectionKeyPressed=!1,this.multiselectionKeyPressed=!1,this.deleteKeyPressed=!1,this.panActivationKeyPressed=!1,this.zoomActivationKeyPressed=!1,this._connection=g3,this.clickConnectStartHandle=null,this.viewport=e.props.initialViewport??{x:0,y:0,zoom:1},this.ariaLiveMessage=``}}return new t}var rse=l3.error001(`svelte`);function t8(){let e=ve(n8);if(!e)throw Error(rse);return e.getStore()}var n8=Symbol();function ise(e){let t=nse(e);function n(e){t.nodeTypes={...$6,...e}}function r(e){t.edgeTypes={...e8,...e}}function i(e){t.edges=Eoe(e,t.edges,{onError:t.onerror})}let a=(e,n=!1)=>{t.nodes=t.nodes.map(r=>{if(t.connection.inProgress&&t.connection.fromNode.id===r.id){let e=t.nodeLookup.get(r.id);e&&(t.connection={...t.connection,from:y6(e,t.connection.fromHandle,y3.Left,!0)})}let i=e.get(r.id);return i?{...r,position:i.position,dragging:n}:r})};function o(e){let{changes:n,updatedInternals:r}=ioe(e,t.nodeLookup,t.parentLookup,t.domNode,t.nodeOrigin,t.nodeExtent,t.zIndexMode);if(!r)return;Qae(t.nodeLookup,t.parentLookup,{nodeOrigin:t.nodeOrigin,nodeExtent:t.nodeExtent,zIndexMode:t.zIndexMode}),t.fitViewQueued&&t.resolveFitView();let i=new Map;for(let e of n){let n=t.nodeLookup.get(e.id)?.internals.userNode;if(!n)continue;let r={...n};switch(e.type){case`dimensions`:{let t={...r.measured,...e.dimensions};e.setAttributes&&(r.width=e.dimensions?.width??r.width,r.height=e.dimensions?.height??r.height),r.measured=t;break}case`position`:r.position=e.position??r.position;break}i.set(e.id,r)}t.nodes=t.nodes.map(e=>i.get(e.id)??e)}function s(e){let n=t.fitViewResolver??Promise.withResolvers();return t.fitViewQueued=!0,t.fitViewOptions=e,t.fitViewResolver=n,t.nodes=[...t.nodes],n.promise}async function c(e,n,r){let i=r?.zoom===void 0?t.maxZoom:r.zoom,a=t.panZoom;return a?(await a.setViewport({x:t.width/2-e*i,y:t.height/2-n*i,zoom:i},{duration:r?.duration,ease:r?.ease,interpolate:r?.interpolate}),!0):!1}async function l(e,n){let r=t.panZoom;return r?r.scaleBy(e,n):!1}async function u(e){return l(1.2,e)}function d(e){return l(1/1.2,e)}function f(e){let n=t.panZoom;n&&(n.setScaleExtent([e,t.maxZoom]),t.minZoom=e)}function p(e){let n=t.panZoom;n&&(n.setScaleExtent([t.minZoom,e]),t.maxZoom=e)}function m(e){let n=t.panZoom;n&&(n.setTranslateExtent(e),t.translateExtent=e)}function h(e,t=null){let n=!1,r=e.map(e=>(!t||t.has(e.id))&&e.selected?(n=!0,{...e,selected:!1}):e);return[n,r]}function g(e){let n=e?.nodes?new Set(e.nodes.map(e=>e.id)):null,[r,i]=h(t.nodes,n);r&&(t.nodes=i);let a=e?.edges?new Set(e.edges.map(e=>e.id)):null,[o,s]=h(t.edges,a);o&&(t.edges=s)}function _(e){let n=t.multiselectionKeyPressed;t.nodes=t.nodes.map(t=>{let r=e.includes(t.id),i=n&&t.selected||r;return!!t.selected===i?t:{...t,selected:i}}),n||g({nodes:[]})}function v(e){let n=t.multiselectionKeyPressed;t.edges=t.edges.map(t=>{let r=e.includes(t.id),i=n&&t.selected||r;return!!t.selected===i?t:{...t,selected:i}}),n||g({edges:[]})}function y(e,n,r){let i=t.nodeLookup.get(e);if(!i){t.onerror(`012`,l3.error012(e));return}t.selectionRect=null,t.selectionRectMode=null,i.selected?(n||i.selected&&t.multiselectionKeyPressed)&&(g({nodes:[i.internals.userNode],edges:[]}),requestAnimationFrame(()=>r?.blur())):_([e])}function b(e){let n=t.edgeLookup.get(e);if(!n){t.onerror(`016`,l3.error016(e));return}(n.selectable||t.elementsSelectable&&n.selectable===void 0)&&(t.selectionRect=null,t.selectionRectMode=null,n.selected?n.selected&&t.multiselectionKeyPressed&&g({nodes:[],edges:[n]}):v([e]))}function x(e,n){let{nodeExtent:r,snapGrid:i,nodeOrigin:o,nodeLookup:s,nodesDraggable:c,onerror:l}=t,u=new Map,d=i?.[0]??5,f=i?.[1]??5,p=e.x*d*n,m=e.y*f*n;for(let e of s.values()){if(!(e.selected&&(e.draggable||c&&e.draggable===void 0)))continue;let t={x:e.internals.positionAbsolute.x+p,y:e.internals.positionAbsolute.y+m};i&&(t=q3(t,i));let{position:n,positionAbsolute:a}=A3({nodeId:e.id,nextPosition:t,nodeLookup:s,nodeExtent:r,nodeOrigin:o,onError:l});e.position=n,e.internals.positionAbsolute=a,u.set(e.id,e)}a(u)}function S(e){return aoe({delta:e,panZoom:t.panZoom,transform:[t.viewport.x,t.viewport.y,t.viewport.zoom],translateExtent:t.translateExtent,width:t.width,height:t.height})}let C=e=>{t._connection={...e}};function w(){t._connection=g3}function T(){t.resetStoreValues(),g()}return Object.assign(t,{setNodeTypes:n,setEdgeTypes:r,addEdge:i,updateNodePositions:a,updateNodeInternals:o,zoomIn:u,zoomOut:d,fitView:s,setCenter:c,setMinZoom:f,setMaxZoom:p,setTranslateExtent:m,unselectNodesAndEdges:g,addSelectedNodes:_,addSelectedEdges:v,handleNodeSelection:y,handleEdgeSelection:b,moveSelectedNodes:x,panBy:S,updateConnection:C,cancelConnection:w,reset:T})}function ase(e,t){let{minZoom:n,maxZoom:r,initialViewport:i,onPanZoomStart:a,onPanZoom:o,onPanZoomEnd:s,translateExtent:c,setPanZoomInstance:l,onDraggingChange:u,onTransformChange:d}=t,f=Coe({domNode:e,minZoom:n,maxZoom:r,translateExtent:c,viewport:i,onPanZoom:o,onPanZoomStart:a,onPanZoomEnd:s,onDraggingChange:u}),p=f.getViewport();return(i.x!==p.x||i.y!==p.y||i.zoom!==p.zoom)&&d([p.x,p.y,p.zoom]),l(f),f.update(t),{update(e){f.update(e)}}}var ose=P(`<div class="svelte-flow__zoom svelte-flow__container"><!></div>`);function sse(e,t){x(t,!0);let n=K(t,`store`,15),r=l(()=>n().panActivationKeyPressed||t.panOnDrag),i=l(()=>n().panActivationKeyPressed||t.panOnScroll),{viewport:a}=n(),o=!1;z(()=>{!o&&n().viewportInitialized&&(t.oninit?.(),o=!0)});var s=ose();h(B(s),()=>t.children),y(s),ge(s,(e,t)=>ase?.(e,t),()=>({viewport:n().viewport,minZoom:n().minZoom,maxZoom:n().maxZoom,initialViewport:a,onDraggingChange:e=>{n(n().dragging=e,!0)},setPanZoomInstance:e=>{n(n().panZoom=e,!0)},onPanZoomStart:t.onmovestart,onPanZoom:t.onmove,onPanZoomEnd:t.onmoveend,zoomOnScroll:t.zoomOnScroll,zoomOnDoubleClick:t.zoomOnDoubleClick,zoomOnPinch:t.zoomOnPinch,panOnScroll:L(i),panOnDrag:L(r),panOnScrollSpeed:t.panOnScrollSpeed,panOnScrollMode:t.panOnScrollMode,zoomActivationKeyPressed:n().zoomActivationKeyPressed,preventScrolling:typeof t.preventScrolling==`boolean`?t.preventScrolling:!0,noPanClassName:n().noPanClass,noWheelClassName:n().noWheelClass,userSelectionActive:!!n().selectionRect,translateExtent:n().translateExtent,lib:`svelte`,paneClickDistance:t.paneClickDistance,selectionOnDrag:t.selectionOnDrag,onTransformChange:e=>{n(n().viewport={x:e[0],y:e[1],zoom:e[2]},!0)},connectionInProgress:n().connection.inProgress})),q(e,s),H()}function r8(e,t){return n=>{n.target===t&&e?.(n)}}function i8(e){return t=>{let n=e.has(t.id);return!!t.selected===n?t:{...t,selected:n}}}function a8(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var cse=P(`<div><!></div>`);function lse(e,t){x(t,!0);let n=K(t,`store`,15),r=K(t,`panOnDrag`,3,!0),i=K(t,`paneClickDistance`,3,1),a=K(t,`autoPanOnSelection`,3,!0),o,s=null,c=!1,u=new Set,d=new Set,f=l(()=>n().panActivationKeyPressed||r()),p=l(()=>n().selectionKeyPressed||!!n().selectionRect||t.selectionOnDrag&&L(f)!==!0),m=l(()=>n().elementsSelectable&&(L(p)||n().selectionRectMode===`user`)),g=!1,_=0,v={x:0,y:0},b=!1;function S(e){if(s=o?.getBoundingClientRect(),!s)return;let r=e.target===o,i=!r&&!!e.target.closest(`.nokey`),a=t.selectionOnDrag&&r||n().selectionKeyPressed;if(i||!L(p)||!a||e.button!==0||!e.isPrimary)return;e.target?.setPointerCapture?.(e.pointerId),g=!1,b=!1;let{x:c,y:l}=s6(e,s),u=J3({x:c,y:l},[n().viewport.x,n().viewport.y,n().viewport.zoom]);n(n().selectionRect={width:0,height:0,startX:u.x,startY:u.y,x:c,y:l},!0),r||(e.stopPropagation(),e.preventDefault())}function C(e,t){if(n().selectionRect?.startX===void 0||n().selectionRect.startY===void 0)return;let r={x:n().selectionRect?.startX,y:n().selectionRect?.startY},i=Y3(r,[n().viewport.x,n().viewport.y,n().viewport.zoom]),a={startX:r.x,startY:r.y,x:e<i.x?e:i.x,y:t<i.y?t:i.y,width:Math.abs(e-i.x),height:Math.abs(t-i.y)},o=u,s=d;u=new Set(k3(n().nodeLookup,a,[n().viewport.x,n().viewport.y,n().viewport.zoom],n().selectionMode===h3.Partial,!0).map(e=>e.id));let c=n().defaultEdgeOptions.selectable??!0;d=new Set;for(let e of u){let t=n().connectionLookup.get(e);if(t)for(let{edgeId:e}of t.values()){let t=n().edgeLookup.get(e);t&&(t.selectable??c)&&d.add(e)}}a8(o,u)||n(n().nodes=n().nodes.map(i8(u)),!0),a8(s,d)||n(n().edges=n().edges.map(i8(d)),!0),n(n().selectionRectMode=`user`,!0),n(n().selectionRect=a,!0)}function T(){if(!a()||!s)return;let[e,t]=F3(v,s,n().autoPanSpeed);n().panBy({x:e,y:t}).then(e=>{if(!g||!e){_=requestAnimationFrame(T);return}C(v.x,v.y),_=requestAnimationFrame(T)})}function E(){cancelAnimationFrame(_),_=0,b=!1}ce(()=>{typeof window<`u`&&E()});function D(e){if(!L(p)||!s||!n().selectionRect)return;let r=s6(e,s);v={x:r.x,y:r.y};let a=Y3({x:n().selectionRect.startX,y:n().selectionRect.startY},[n().viewport.x,n().viewport.y,n().viewport.zoom]);if(!g){let o=n().selectionKeyPressed?0:i();if(Math.hypot(r.x-a.x,r.y-a.y)<=o)return;n().unselectNodesAndEdges(),t.onselectionstart?.(e)}g=!0,b||=(T(),!0),C(r.x,r.y)}function O(e){if(!L(m)){e.target===o&&n().connection.inProgress&&(c=!0);return}e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!g&&e.target===o&&j?.(e),n(n().selectionRect=null,!0),g&&n(n().selectionRectMode=u.size>0?`nodes`:null,!0),g&&t.onselectionend?.(e),E())}function k(e){e.target?.releasePointerCapture?.(e.pointerId),E()}let ee=e=>{if(Array.isArray(L(f))&&L(f).includes(2)){e.preventDefault();return}t.onpanecontextmenu?.({event:e})},A=e=>{g&&=(e.stopPropagation(),!1)};function j(e){if(g||n().connection.inProgress||c){g=!1,c=!1;return}t.onpaneclick?.({event:e}),n().unselectNodesAndEdges(),n(n().selectionRectMode=null,!0),n(n().selectionRect=null,!0)}var M=cse();let N;var te=l(()=>L(m)?void 0:r8(j,o)),ne=l(()=>r8(ee,o));h(B(M),()=>t.children),y(M),ie(M,e=>o=e,()=>o),J(e=>N=w(M,1,`svelte-flow__pane svelte-flow__container`,null,N,e),[()=>({draggable:r()===!0||Array.isArray(r())&&r().includes(0),dragging:n().dragging,selection:L(p)})]),le(`click`,M,function(...e){L(te)?.apply(this,e)}),Ae(`pointerdown`,M,function(...e){(L(m)?S:void 0)?.apply(this,e)},!0),le(`pointermove`,M,function(...e){(L(m)?D:void 0)?.apply(this,e)}),le(`pointerup`,M,O),Ae(`pointercancel`,M,function(...e){(L(m)?k:void 0)?.apply(this,e)}),le(`contextmenu`,M,function(...e){L(ne)?.apply(this,e)}),Ae(`click`,M,function(...e){(L(m)?A:void 0)?.apply(this,e)},!0),q(e,M),H()}r([`click`,`pointermove`,`pointerup`,`contextmenu`]);var use=P(`<div class="svelte-flow__viewport xyflow__viewport svelte-flow__container"><!></div>`);function dse(e,t){x(t,!0);var n=use();let r;h(B(n),()=>t.children),y(n),J(()=>r=u(n,``,r,{transform:`translate(${t.store.viewport.x??``}px, ${t.store.viewport.y??``}px) scale(${t.store.viewport.zoom??``})`})),q(e,n),H()}function o8(e,t){let{store:n,onDrag:r,onDragStart:i,onDragStop:a,onNodeMouseDown:o}=t,s=loe({onDrag:r,onDragStart:i,onDragStop:a,onNodeMouseDown:o,getStoreItems:()=>{let{snapGrid:e,viewport:t}=n;return{nodes:n.nodes,nodeLookup:n.nodeLookup,edges:n.edges,nodeExtent:n.nodeExtent,snapGrid:e||[0,0],snapToGrid:!!e,nodeOrigin:n.nodeOrigin,multiSelectionActive:n.multiselectionKeyPressed,domNode:n.domNode,transform:[t.x,t.y,t.zoom],autoPanOnNodeDrag:n.autoPanOnNodeDrag,nodesDraggable:n.nodesDraggable,selectNodesOnDrag:n.selectNodesOnDrag,nodeDragThreshold:n.nodeDragThreshold,unselectNodesAndEdges:n.unselectNodesAndEdges,updateNodePositions:n.updateNodePositions,onSelectionDrag:n.onselectiondrag,onSelectionDragStart:n.onselectiondragstart,onSelectionDragStop:n.onselectiondragstop,panBy:n.panBy}}});function c(e,t){if(t.disabled){s.destroy();return}s.update({domNode:e,noDragClassName:t.noDragClass,handleSelector:t.handleSelector,nodeId:t.nodeId,isSelectable:t.isSelectable,nodeClickDistance:t.nodeClickDistance})}return c(e,t),{update(t){c(e,t)},destroy(){s.destroy()}}}var fse=P(`<div aria-live="assertive" aria-atomic="true" class="a11y-live-msg svelte-pnzxrn"> </div>`),pse=P(`<div class="a11y-hidden svelte-pnzxrn"> </div> <div class="a11y-hidden svelte-pnzxrn"> </div> <!>`,1);function mse(e,t){x(t,!0);var n=pse(),r=F(n),i=B(r,!0);y(r);var a=Y(r,2),o=B(a,!0);y(a);var s=Y(a,2),c=e=>{var n=fse(),r=B(n,!0);y(n),J(()=>{A(n,`id`,`${hse}-${t.store.flowId}`),f(r,t.store.ariaLiveMessage)}),q(e,n)};p(s,e=>{t.store.disableKeyboardA11y||e(c)}),J(()=>{A(r,`id`,`${s8}-${t.store.flowId}`),f(i,t.store.disableKeyboardA11y?t.store.ariaLabelConfig[`node.a11yDescription.default`]:t.store.ariaLabelConfig[`node.a11yDescription.keyboardDisabled`]),A(a,`id`,`${c8}-${t.store.flowId}`),f(o,t.store.ariaLabelConfig[`edge.a11yDescription.default`])}),q(e,n),H()}var s8=`svelte-flow__node-desc`,c8=`svelte-flow__edge-desc`,hse=`svelte-flow__aria-live`,gse=P(`<div><!></div>`);function _se(e,t){x(t,!0);let n=K(t,`store`,15),r=l(()=>s(t.node.data,()=>({}),!0)),i=l(()=>s(t.node.selected,!1)),a=l(()=>t.node.draggable),o=l(()=>t.node.selectable),u=l(()=>s(t.node.deletable,!0)),f=l(()=>t.node.connectable),m=l(()=>t.node.focusable),h=l(()=>s(t.node.hidden,!1)),g=l(()=>s(t.node.dragging,!1)),v=l(()=>s(t.node.style,``)),b=l(()=>t.node.class),S=l(()=>s(t.node.type,`default`)),C=l(()=>t.node.parentId),w=l(()=>t.node.sourcePosition),T=l(()=>t.node.targetPosition),E=l(()=>s(t.node.measured,()=>({width:0,height:0}),!0).width),D=l(()=>s(t.node.measured,()=>({width:0,height:0}),!0).height),O=l(()=>t.node.initialWidth),ee=l(()=>t.node.initialHeight),A=l(()=>t.node.width),j=l(()=>t.node.height),M=l(()=>t.node.dragHandle),N=l(()=>s(t.node.internals.z,0)),te=l(()=>t.node.internals.positionAbsolute.x),ne=l(()=>t.node.internals.positionAbsolute.y),P=l(()=>t.node.internals.userNode),{id:re}=t.node,I=l(()=>L(a)??n().nodesDraggable),ae=l(()=>L(o)??n().elementsSelectable),oe=l(()=>L(f)??n().nodesConnectable),se=l(()=>t6(t.node)),le=l(()=>!!t.node.internals.handleBounds),ue=l(()=>L(se)&&L(le)),de=l(()=>L(m)??n().nodesFocusable);function fe(e){return n().parentLookup.has(e)}let V=l(()=>fe(re)),pe=X(null),me=null,he=L(S),_e=L(w),ve=L(T),ye=l(()=>n().nodeTypes[L(S)]??G6),be=l(()=>n().ariaLabelConfig);Ooe(re),Aoe({get value(){return L(oe)}});let U=l(()=>{let e=L(E)===void 0?L(A)??L(O):L(A),t=L(D)===void 0?L(j)??L(ee):L(j);if(!(e===void 0&&t===void 0&&L(v)===void 0))return`${L(v)};${e?`width:${J6(e)};`:``}${t?`height:${J6(t)};`:``}`});z(()=>{(L(S)!==he||L(w)!==_e||L(T)!==ve)&&L(pe)!==null&&requestAnimationFrame(()=>{L(pe)!==null&&n().updateNodeInternals(new Map([[re,{id:re,nodeElement:L(pe),force:!0}]]))}),he=L(S),_e=L(w),ve=L(T)}),z(()=>{t.resizeObserver&&(!L(ue)||L(pe)!==me)&&(me&&t.resizeObserver.unobserve(me),L(pe)&&t.resizeObserver.observe(L(pe)),me=L(pe))}),ce(()=>{me&&t.resizeObserver?.unobserve(me)});function xe(e){L(ae)&&(!n().selectNodesOnDrag||!L(I)||n().nodeDragThreshold>0)&&n().handleNodeSelection(re),t.onnodeclick?.({node:L(P),event:e})}function W(e){if(!(a6(e)||n().disableKeyboardA11y))if(d3.includes(e.key)&&L(ae)){let t=e.key===`Escape`;n().handleNodeSelection(re,t,L(pe))}else L(I)&&t.node.selected&&Object.prototype.hasOwnProperty.call(Y6,e.key)&&(e.preventDefault(),n(n().ariaLiveMessage=L(be)[`node.a11yDescription.ariaLiveMessage`]({direction:e.key.replace(`Arrow`,``).toLowerCase(),x:~~t.node.internals.positionAbsolute.x,y:~~t.node.internals.positionAbsolute.y}),!0),n().moveSelectedNodes(Y6[e.key],e.shiftKey?4:1))}let Se=()=>{if(n().disableKeyboardA11y||!n().autoPanOnNodeFocus||!L(pe)?.matches(`:focus-visible`))return;let{width:e,height:r,viewport:i}=n();k3(new Map([[re,t.node]]),{x:0,y:0,width:e,height:r},[i.x,i.y,i.zoom],!0).length>0||n().setCenter(t.node.position.x+(t.node.measured.width??0)/2,t.node.position.y+(t.node.measured.height??0)/2,{zoom:i.zoom})};var G=_(),Ce=F(G),we=e=>{var a=gse();c(a,()=>({"data-id":re,class:[`svelte-flow__node`,`svelte-flow__node-${L(S)}`,L(b)],style:L(U),onclick:xe,onpointerenter:t.onnodepointerenter?e=>t.onnodepointerenter({node:L(P),event:e}):void 0,onpointerleave:t.onnodepointerleave?e=>t.onnodepointerleave({node:L(P),event:e}):void 0,onpointermove:t.onnodepointermove?e=>t.onnodepointermove({node:L(P),event:e}):void 0,oncontextmenu:t.onnodecontextmenu?e=>t.onnodecontextmenu({node:L(P),event:e}):void 0,onkeydown:L(de)?W:void 0,onfocus:L(de)?Se:void 0,tabIndex:L(de)?0:void 0,role:t.node.ariaRole??(L(de)?`group`:void 0),"aria-label":t.node.ariaLabel,"aria-roledescription":`node`,"aria-describedby":n().disableKeyboardA11y?void 0:`${s8}-${n().flowId}`,...t.node.domAttributes,[Pe]:{dragging:L(g),selected:L(i),draggable:L(I),connectable:L(oe),selectable:L(ae),nopan:L(I),parent:L(V)},[k]:{"z-index":L(N),transform:`translate(${L(te)??``}px, ${L(ne)??``}px)`,visibility:L(se)?`visible`:`hidden`}})),d(B(a),()=>L(ye),(e,t)=>{t(e,{get data(){return L(r)},get id(){return re},get selected(){return L(i)},get selectable(){return L(ae)},get deletable(){return L(u)},get sourcePosition(){return L(w)},get targetPosition(){return L(T)},get zIndex(){return L(N)},get dragging(){return L(g)},get draggable(){return L(I)},get dragHandle(){return L(M)},get parentId(){return L(C)},get type(){return L(S)},get isConnectable(){return L(oe)},get positionAbsoluteX(){return L(te)},get positionAbsoluteY(){return L(ne)},get width(){return L(A)},get height(){return L(j)}})}),y(a),ge(a,(e,t)=>o8?.(e,t),()=>({nodeId:re,isSelectable:L(ae),disabled:!L(I),handleSelector:L(M),noDragClass:n().noDragClass,nodeClickDistance:t.nodeClickDistance,onNodeMouseDown:n().handleNodeSelection,onDrag:(e,n,r,i)=>{t.onnodedrag?.({event:e,targetNode:r,nodes:i})},onDragStart:(e,n,r,i)=>{t.onnodedragstart?.({event:e,targetNode:r,nodes:i})},onDragStop:(e,n,r,i)=>{t.onnodedragstop?.({event:e,targetNode:r,nodes:i})},store:n()})),ie(a,e=>R(pe,e),()=>L(pe)),q(e,a)};p(Ce,e=>{L(h)||e(we)}),q(e,G),H()}var vse=P(`<div class="svelte-flow__nodes"></div>`);function yse(e,t){x(t,!0);let n=K(t,`store`,15),r=typeof ResizeObserver>`u`?null:new ResizeObserver(e=>{let t=new Map;e.forEach(e=>{let n=e.target.getAttribute(`data-id`);t.set(n,{id:n,nodeElement:e.target,force:!0})}),n().updateNodeInternals(t)});ce(()=>{r?.disconnect()});var i=vse();O(i,21,()=>n().visible.nodes.values(),e=>e.id,(e,i)=>{_se(e,{get node(){return L(i)},get resizeObserver(){return r},get nodeClickDistance(){return t.nodeClickDistance},get onnodeclick(){return t.onnodeclick},get onnodepointerenter(){return t.onnodepointerenter},get onnodepointermove(){return t.onnodepointermove},get onnodepointerleave(){return t.onnodepointerleave},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get onnodecontextmenu(){return t.onnodecontextmenu},get store(){return n()},set store(e){n(e)}})}),y(i),q(e,i),H()}var bse=ne(`<svg class="svelte-flow__edge-wrapper"><g><!></g></svg>`);function xse(e,t){x(t,!0);let n=l(()=>t.edge.id),r=l(()=>t.edge.source),i=l(()=>t.edge.target),a=l(()=>t.edge.sourceX),o=l(()=>t.edge.sourceY),f=l(()=>t.edge.targetX),m=l(()=>t.edge.targetY),h=l(()=>t.edge.sourcePosition),g=l(()=>t.edge.targetPosition),v=l(()=>s(t.edge.animated,!1)),b=l(()=>s(t.edge.selected,!1)),S=l(()=>t.edge.label),C=l(()=>t.edge.labelStyle),w=l(()=>s(t.edge.data,()=>({}),!0)),T=l(()=>t.edge.style),E=l(()=>t.edge.interactionWidth),D=l(()=>s(t.edge.type,`default`)),O=l(()=>t.edge.sourceHandle),k=l(()=>t.edge.targetHandle),ee=l(()=>t.edge.markerStart),A=l(()=>t.edge.markerEnd),j=l(()=>t.edge.selectable),M=l(()=>t.edge.focusable),N=l(()=>s(t.edge.deletable,!0)),te=l(()=>t.edge.hidden),ne=l(()=>t.edge.zIndex),P=l(()=>t.edge.class),re=l(()=>t.edge.ariaLabel);Moe(L(n));let I=null,ae=l(()=>L(j)??t.store.elementsSelectable),R=l(()=>L(M)??t.store.edgesFocusable),oe=l(()=>t.store.edgeTypes[L(D)]??Z6),se=l(()=>L(ee)?`url('#${x6(L(ee),t.store.flowId)}')`:void 0),ce=l(()=>L(A)?`url('#${x6(L(A),t.store.flowId)}')`:void 0);function z(e){let r=t.store.edgeLookup.get(L(n));r&&(L(ae)&&t.store.handleEdgeSelection(L(n)),t.onedgeclick?.({event:e,edge:r}))}function le(e,r){let i=t.store.edgeLookup.get(L(n));i&&r({event:e,edge:i})}function ue(e){if(!t.store.disableKeyboardA11y&&d3.includes(e.key)&&L(ae)){let{unselectNodesAndEdges:r,addSelectedEdges:i}=t.store;e.key===`Escape`?(I?.blur(),r({edges:[t.edge]})):i([L(n)])}}var de=_(),fe=F(de),V=e=>{var s=bse();let l;var p=B(s);c(p,()=>({class:[`svelte-flow__edge`,L(P)],"data-id":L(n),onclick:z,oncontextmenu:t.onedgecontextmenu?e=>{le(e,t.onedgecontextmenu)}:void 0,onpointerenter:t.onedgepointerenter?e=>{le(e,t.onedgepointerenter)}:void 0,onpointerleave:t.onedgepointerleave?e=>{le(e,t.onedgepointerleave)}:void 0,"aria-label":L(re)===null?void 0:L(re)?L(re):`Edge from ${L(r)} to ${L(i)}`,"aria-describedby":L(R)?`${c8}-${t.store.flowId}`:void 0,role:t.edge.ariaRole??(L(R)?`group`:`img`),"aria-roledescription":`edge`,onkeydown:L(R)?ue:void 0,tabindex:L(R)?0:void 0,...t.edge.domAttributes,[Pe]:{animated:L(v),selected:L(b),selectable:L(ae)}})),d(B(p),()=>L(oe),(e,t)=>{t(e,{get id(){return L(n)},get source(){return L(r)},get target(){return L(i)},get sourceX(){return L(a)},get sourceY(){return L(o)},get targetX(){return L(f)},get targetY(){return L(m)},get sourcePosition(){return L(h)},get targetPosition(){return L(g)},get animated(){return L(v)},get selected(){return L(b)},get label(){return L(S)},get labelStyle(){return L(C)},get data(){return L(w)},get style(){return L(T)},get interactionWidth(){return L(E)},get selectable(){return L(ae)},get deletable(){return L(N)},get type(){return L(D)},get sourceHandleId(){return L(O)},get targetHandleId(){return L(k)},get markerStart(){return L(se)},get markerEnd(){return L(ce)}})}),y(p),ie(p,e=>I=e,()=>I),y(s),J(()=>l=u(s,``,l,{"z-index":L(ne)})),q(e,s)};p(fe,e=>{L(te)||e(V)}),q(e,de),H()}var Sse=ne(`<defs></defs>`);function Cse(e,t){x(t,!1);let n=t8();fe();var r=Sse();O(r,5,()=>n.markers,e=>e.id,(e,t)=>{Dse(e,V(()=>L(t)))}),y(r),q(e,r),H()}var wse=ne(`<polyline class="arrow" fill="none" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4"></polyline>`),Tse=ne(`<polyline class="arrowclosed" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4"></polyline>`),Ese=ne(`<marker class="svelte-flow__arrowhead" viewBox="-10 -10 20 20" refX="0" refY="0"><!></marker>`);function Dse(e,t){x(t,!0);let n=K(t,`width`,3,12.5),r=K(t,`height`,3,12.5),i=K(t,`markerUnits`,3,`strokeWidth`),a=K(t,`orient`,3,`auto-start-reverse`),o=K(t,`color`,3,`none`);var s=Ese(),c=B(s),l=e=>{var n=wse();let r;J(()=>{A(n,`stroke-width`,t.strokeWidth),r=u(n,``,r,{stroke:o()})}),q(e,n)},d=e=>{var n=Tse();let r;J(()=>{A(n,`stroke-width`,t.strokeWidth),r=u(n,``,r,{stroke:o(),fill:o()})}),q(e,n)};p(c,e=>{t.type===v3.Arrow?e(l):t.type===v3.ArrowClosed&&e(d,1)}),y(s),J(()=>{A(s,`id`,t.id),A(s,`markerWidth`,`${n()}`),A(s,`markerHeight`,`${r()}`),A(s,`markerUnits`,i()),A(s,`orient`,a())}),q(e,s),H()}var Ose=P(`<div class="svelte-flow__edges"><svg class="svelte-flow__marker"><!></svg> <!></div>`);function kse(e,t){x(t,!0);let n=K(t,`store`,15);var r=Ose(),i=B(r);Cse(B(i),{}),y(i),O(Y(i,2),17,()=>n().visible.edges.values(),e=>e.id,(e,r)=>{xse(e,{get edge(){return L(r)},get onedgeclick(){return t.onedgeclick},get onedgecontextmenu(){return t.onedgecontextmenu},get onedgepointerenter(){return t.onedgepointerenter},get onedgepointerleave(){return t.onedgepointerleave},get store(){return n()},set store(e){n(e)}})}),y(r),q(e,r),H()}var Ase=P(`<div class="svelte-flow__selection svelte-1fy294n"></div>`);function l8(e,t){x(t,!0);let n=K(t,`x`,3,0),r=K(t,`y`,3,0),i=K(t,`width`,3,0),a=K(t,`height`,3,0),o=K(t,`isVisible`,3,!0);var s=_(),c=F(s),l=e=>{var t=Ase();let o;J(e=>o=u(t,``,o,e),[()=>({width:typeof i()==`string`?i():J6(i()),height:typeof a()==`string`?a():J6(a()),transform:`translate(${n()}px, ${r()}px)`})]),q(e,t)};p(c,e=>{o()&&e(l)}),q(e,s),H()}var jse=P(`<div><!></div>`);function Mse(e,t){x(t,!0);let n=X(void 0);z(()=>{t.store.disableKeyboardA11y||L(n)?.focus({preventScroll:!0})});let r=l(()=>{if(t.store.selectionRectMode===`nodes`){t.store.nodes;let e=O3(t.store.nodeLookup,{filter:e=>!!e.selected});if(e.width>0&&e.height>0)return e}return null});function i(e){let n=t.store.nodes.filter(e=>e.selected);t.onselectioncontextmenu?.({nodes:n,event:e})}function a(e){let n=t.store.nodes.filter(e=>e.selected);t.onselectionclick?.({nodes:n,event:e})}function o(e){Object.prototype.hasOwnProperty.call(Y6,e.key)&&(e.preventDefault(),t.store.moveSelectedNodes(Y6[e.key],e.shiftKey?4:1))}var s=_(),c=F(s),d=e=>{var s=jse();let c;l8(B(s),{width:`100%`,height:`100%`,x:0,y:0}),y(s),ge(s,(e,t)=>o8?.(e,t),()=>({disabled:!1,store:t.store,onDrag:(e,n,r,i)=>{t.onnodedrag?.({event:e,targetNode:null,nodes:i})},onDragStart:(e,n,r,i)=>{t.onnodedragstart?.({event:e,targetNode:null,nodes:i})},onDragStop:(e,n,r,i)=>{t.onnodedragstop?.({event:e,targetNode:null,nodes:i})}})),ie(s,e=>R(n,e),()=>L(n)),J(e=>{w(s,1,_e([`svelte-flow__selection-wrapper`,t.store.noPanClass]),`svelte-1lxk677`),A(s,`role`,t.store.disableKeyboardA11y?void 0:`button`),A(s,`tabindex`,t.store.disableKeyboardA11y?void 0:-1),c=u(s,``,c,e)},[()=>({width:J6(L(r).width),height:J6(L(r).height),transform:`translate(${L(r).x??``}px, ${L(r).y??``}px)`})]),le(`contextmenu`,s,i),le(`click`,s,a),le(`keydown`,s,function(...e){(t.store.disableKeyboardA11y?void 0:o)?.apply(this,e)}),q(e,s)},f=l(()=>t.store.selectionRectMode===`nodes`&&L(r)&&G3(L(r).x)&&G3(L(r).y));p(c,e=>{L(f)&&e(d)}),q(e,s),H()}r([`contextmenu`,`click`,`keydown`]);function Nse(e){switch(e){case`none`:return 0;case`ctrl`:return 8;case`shift`:return 4;case`alt`:return 2;case`meta`:return 1}}function u8(e,t){let{enabled:n=!0,trigger:r,type:i=`keydown`}=t;function a(t){let n=Array.isArray(r)?r:[r],i=[t.metaKey,t.altKey,t.shiftKey,t.ctrlKey].reduce((e,t,n)=>t?e|1<<n:e,0);for(let r of n){let n={preventDefault:!1,enabled:!0,...r},{modifier:a,key:o,code:s,callback:c,preventDefault:l,enabled:u}=n;if(!o&&!s&&console.warn("[svelte-put/shortcut] Trigger should have either `key` or `code`, a trigger missing both was detected! Check your configuration"),u&&(o||s)){if(s&&t.code!==s||o&&t.key!==o)continue;if(a===null||a===!1){if(i!==0)continue}else if(a!==void 0&&a?.[0]?.length>0){let e=Array.isArray(a)?a:[a],t=!1;for(let n of e)if((Array.isArray(n)?n:[n]).reduce((e,t)=>e|Nse(t),0)===i){t=!0;break}if(!t)continue}l&&t.preventDefault();let r={node:e,trigger:n,originalEvent:t};e.dispatchEvent(new CustomEvent(`shortcut`,{detail:r})),c?.(r)}}}let o;return n&&(o=Se(e,i,a)),{update:t=>{let{enabled:s=!0,type:c=`keydown`}=t;n&&(!s||i!==c)?o?.():!n&&s&&(o=Se(e,c,a)),n=s,i=c,r=t.trigger},destroy:()=>{o?.()}}}function d8(){let e=l(t8),t=t=>{let n=q6(t)?t:L(e).nodeLookup.get(t.id),r=n.parentId?Iae(n.position,n.measured,n.parentId,L(e).nodeLookup,L(e).nodeOrigin):n.position;return z3({...n,position:r,width:n.measured?.width??n.width,height:n.measured?.height??n.height})};function n(t,n,r={replace:!1}){L(e).nodes=Oe(()=>L(e).nodes).map(e=>{if(e.id===t){let t=typeof n==`function`?n(e):n;return r?.replace&&q6(t)?t:{...e,...t}}return e})}function r(t,n,r={replace:!1}){L(e).edges=Oe(()=>L(e).edges).map(e=>{if(e.id===t){let t=typeof n==`function`?n(e):n;return r.replace&&Uoe(t)?t:{...e,...t}}return e})}let i=t=>L(e).nodeLookup.get(t);return{zoomIn:L(e).zoomIn,zoomOut:L(e).zoomOut,getInternalNode:i,getNode:e=>i(e)?.internals.userNode,getNodes:t=>t===void 0?L(e).nodes:f8(L(e).nodeLookup,t),getEdge:t=>L(e).edgeLookup.get(t),getEdges:t=>t===void 0?L(e).edges:f8(L(e).edgeLookup,t),setZoom:async(t,n)=>{let r=L(e).panZoom;return r?r.scaleTo(t,n):!1},getZoom:()=>L(e).viewport.zoom,setViewport:async(t,n)=>{let r=L(e).viewport;return L(e).panZoom?(await L(e).panZoom.setViewport({x:t.x??r.x,y:t.y??r.y,zoom:t.zoom??r.zoom},n),!0):!1},getViewport:()=>E(L(e).viewport),setCenter:async(t,n,r)=>L(e).setCenter(t,n,r),fitView:t=>L(e).fitView(t),fitBounds:async(t,n)=>{if(!L(e).panZoom)return!1;let r=Z3(t,L(e).width,L(e).height,L(e).minZoom,L(e).maxZoom,n?.padding??.1);return await L(e).panZoom.setViewport(r,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},getIntersectingNodes:(n,r=!0,i)=>{let a=W3(n),o=a?n:t(n);return o?(i||L(e).nodes).filter(t=>{let i=L(e).nodeLookup.get(t.id);if(!i||!a&&t.id===n.id)return!1;let s=z3(i),c=U3(s,o);return r&&c>0||c>=s.width*s.height||c>=o.width*o.height}):[]},isNodeIntersecting:(e,n,r=!0)=>{let i=W3(e)?e:t(e);if(!i)return!1;let a=U3(i,n);return r&&a>0||a>=n.width*n.height||a>=i.width*i.height},deleteElements:async({nodes:t=[],edges:n=[]})=>{let{nodes:r,edges:i}=await Nae({nodesToRemove:t,edgesToRemove:n,nodes:L(e).nodes,edges:L(e).edges,onBeforeDelete:L(e).onbeforedelete});return r&&(L(e).nodes=Oe(()=>L(e).nodes).filter(e=>!r.some(({id:t})=>t===e.id))),i&&(L(e).edges=Oe(()=>L(e).edges).filter(e=>!i.some(({id:t})=>t===e.id))),(r.length>0||i.length>0)&&L(e).ondelete?.({nodes:r,edges:i}),{deletedNodes:r,deletedEdges:i}},screenToFlowPosition:(t,n={snapToGrid:!0})=>{if(!L(e).domNode)return t;let r=n.snapToGrid?L(e).snapGrid:!1,{x:i,y:a,zoom:o}=L(e).viewport,{x:s,y:c}=L(e).domNode.getBoundingClientRect();return J3({x:t.x-s,y:t.y-c},[i,a,o],r!==null,r||[1,1])},flowToScreenPosition:t=>{if(!L(e).domNode)return t;let{x:n,y:r,zoom:i}=L(e).viewport,{x:a,y:o}=L(e).domNode.getBoundingClientRect(),s=Y3(t,[n,r,i]);return{x:s.x+a,y:s.y+o}},toObject:()=>structuredClone({nodes:[...L(e).nodes],edges:[...L(e).edges],viewport:{...L(e).viewport}}),updateNode:n,updateNodeData:(t,r,i)=>{let a=L(e).nodeLookup.get(t)?.internals.userNode;if(!a)return;let o=typeof r==`function`?r(a):r;n(t,e=>({...e,data:i?.replace?o:{...e.data,...o}}))},updateEdge:r,getNodesBounds:t=>kae(t,{nodeLookup:L(e).nodeLookup,nodeOrigin:L(e).nodeOrigin}),getHandleConnections:({type:t,id:n,nodeId:r})=>Array.from(L(e).connectionLookup.get(`${r}-${t}-${n??null}`)?.values()??[])}}function f8(e,t){let n=[];for(let r of t){let t=e.get(r);if(t){let e=`internals`in t?t.internals?.userNode:t;n.push(e)}}return n}function Pse(e,t){x(t,!0);let n=K(t,`store`,15),r=K(t,`selectionKey`,3,`Shift`),i=K(t,`multiSelectionKey`,19,()=>Q3()?`Meta`:`Control`),a=K(t,`deleteKey`,3,`Backspace`),o=K(t,`panActivationKey`,3,` `),s=K(t,`zoomActivationKey`,19,()=>Q3()?`Meta`:`Control`),{deleteElements:c}=d8();function l(e){return typeof e==`object`&&!!e}function u(e){return l(e)&&e.modifier||[]}function d(e){return e==null?``:l(e)?e.key:e}function f(e,t){return(Array.isArray(e)?e:[e]).map(e=>{let n=d(e);return{key:n,modifier:u(e),enabled:n!==null,callback:t}})}function p(){n(n().selectionRect=null,!0),n(n().selectionKeyPressed=!1,!0),n(n().multiselectionKeyPressed=!1,!0),n(n().deleteKeyPressed=!1,!0),n(n().panActivationKeyPressed=!1,!0),n(n().zoomActivationKeyPressed=!1,!0)}function m(){c({nodes:n().nodes.filter(e=>e.selected),edges:n().edges.filter(e=>e.selected)})}Ae(`blur`,pe,p),Ae(`contextmenu`,pe,p),ge(pe,(e,t)=>u8?.(e,t),()=>({trigger:f(r(),()=>n(n().selectionKeyPressed=!0,!0)),type:`keydown`})),ge(pe,(e,t)=>u8?.(e,t),()=>({trigger:f(r(),()=>n(n().selectionKeyPressed=!1,!0)),type:`keyup`})),ge(pe,(e,t)=>u8?.(e,t),()=>({trigger:f(i(),()=>{n(n().multiselectionKeyPressed=!0,!0)}),type:`keydown`})),ge(pe,(e,t)=>u8?.(e,t),()=>({trigger:f(i(),()=>n(n().multiselectionKeyPressed=!1,!0)),type:`keyup`})),ge(pe,(e,t)=>u8?.(e,t),()=>({trigger:f(a(),e=>{!(e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)&&!a6(e.originalEvent)&&(n(n().deleteKeyPressed=!0,!0),m())}),type:`keydown`})),ge(pe,(e,t)=>u8?.(e,t),()=>({trigger:f(a(),()=>n(n().deleteKeyPressed=!1,!0)),type:`keyup`})),ge(pe,(e,t)=>u8?.(e,t),()=>({trigger:f(o(),()=>n(n().panActivationKeyPressed=!0,!0)),type:`keydown`})),ge(pe,(e,t)=>u8?.(e,t),()=>({trigger:f(o(),()=>n(n().panActivationKeyPressed=!1,!0)),type:`keyup`})),ge(pe,(e,t)=>u8?.(e,t),()=>({trigger:f(s(),()=>n(n().zoomActivationKeyPressed=!0,!0)),type:`keydown`})),ge(pe,(e,t)=>u8?.(e,t),()=>({trigger:f(s(),()=>n(n().zoomActivationKeyPressed=!1,!0)),type:`keyup`})),H()}var Fse=ne(`<path fill="none" class="svelte-flow__connection-path"></path>`),Ise=ne(`<svg class="svelte-flow__connectionline"><g><!></g></svg>`);function Lse(e,t){x(t,!0);let n=l(()=>{if(!t.store.connection.inProgress)return``;let e={sourceX:t.store.connection.from.x,sourceY:t.store.connection.from.y,sourcePosition:t.store.connection.fromPosition,targetX:t.store.connection.to.x,targetY:t.store.connection.to.y,targetPosition:t.store.connection.toPosition};switch(t.type){case _3.Bezier:{let[t]=d6(e);return t}case _3.Straight:{let[t]=p6(e);return t}case _3.Step:case _3.SmoothStep:{let[n]=g6({...e,borderRadius:t.type===_3.Step?0:void 0});return n}}});var r=_(),i=F(r),a=e=>{var r=Ise(),i=B(r),a=B(i),o=e=>{var n=_();d(F(n),()=>t.LineComponent,(e,t)=>{t(e,{})}),q(e,n)},s=e=>{var r=Fse();J(()=>{A(r,`d`,L(n)),u(r,t.style)}),q(e,r)};p(a,e=>{t.LineComponent?e(o):e(s,-1)}),y(i),y(r),J(e=>{A(r,`width`,t.store.width),A(r,`height`,t.store.height),u(r,t.containerStyle),w(i,0,e)},[()=>_e([`svelte-flow__connection`,C3(t.store.connection.isValid)])]),q(e,r)};p(i,e=>{t.store.connection.inProgress&&e(a)}),q(e,r),H()}var Rse=new Set([`$$slots`,`$$events`,`$$legacy`,`position`,`style`,`class`,`children`]),zse=P(`<div><!></div>`);function p8(e,t){x(t,!0);let n=K(t,`position`,3,`top-right`),r=U(t,Rse),i=l(()=>`${n()}`.split(`-`));var a=zse();c(a,e=>({class:e,style:t.style,...r}),[()=>[`svelte-flow__panel`,t.class,...L(i)]]),h(B(a),()=>t.children??N),y(a),q(e,a),H()}var Bse=P(`<a target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>`);function Vse(e,t){x(t,!0);let n=K(t,`position`,3,`bottom-right`),r=`https://svelteflow.dev?utm_source=attribution`;var i=_(),a=F(i),o=e=>{{let t=l(()=>`Please only hide this attribution when you are subscribed to Svelte Flow Pro: ${r}`);p8(e,{get position(){return n()},class:`svelte-flow__attribution`,get"data-message"(){return L(t)},children:(e,t)=>{var n=Bse();J(()=>A(n,`href`,r)),q(e,n)},$$slots:{default:!0}})}};p(a,e=>{t.proOptions?.hideAttribution||e(o)}),q(e,i),H()}var Hse=P(`<div><!></div>`);function Use(e,t){x(t,!0);let n=K(t,`domNode`,15),r=K(t,`clientWidth`,15),i=K(t,`clientHeight`,15);l(()=>t.rest.id);let a=l(()=>t.rest.class);l(()=>t.rest.nodeTypes),l(()=>t.rest.edgeTypes),l(()=>t.rest.colorMode),l(()=>t.rest.isValidConnection),l(()=>t.rest.onmove),l(()=>t.rest.onmovestart),l(()=>t.rest.onmoveend),l(()=>t.rest.onflowerror),l(()=>t.rest.ondelete),l(()=>t.rest.onbeforedelete),l(()=>t.rest.onbeforeconnect),l(()=>t.rest.onconnect),l(()=>t.rest.onconnectstart),l(()=>t.rest.onconnectend),l(()=>t.rest.onbeforereconnect),l(()=>t.rest.onreconnect),l(()=>t.rest.onreconnectstart),l(()=>t.rest.onreconnectend),l(()=>t.rest.onclickconnectstart),l(()=>t.rest.onclickconnectend),l(()=>t.rest.oninit),l(()=>t.rest.onselectionchange),l(()=>t.rest.onselectiondragstart),l(()=>t.rest.onselectiondrag),l(()=>t.rest.onselectiondragstop),l(()=>t.rest.onselectionstart),l(()=>t.rest.onselectionend),l(()=>t.rest.clickConnect),l(()=>t.rest.fitView),l(()=>t.rest.fitViewOptions),l(()=>t.rest.nodeOrigin),l(()=>t.rest.nodeDragThreshold),l(()=>t.rest.connectionDragThreshold),l(()=>t.rest.minZoom),l(()=>t.rest.maxZoom),l(()=>t.rest.initialViewport),l(()=>t.rest.connectionRadius),l(()=>t.rest.connectionMode),l(()=>t.rest.selectionMode),l(()=>t.rest.selectNodesOnDrag),l(()=>t.rest.snapGrid),l(()=>t.rest.defaultMarkerColor),l(()=>t.rest.translateExtent),l(()=>t.rest.nodeExtent),l(()=>t.rest.onlyRenderVisibleElements),l(()=>t.rest.autoPanOnConnect),l(()=>t.rest.autoPanOnNodeDrag),l(()=>t.rest.colorModeSSR),l(()=>t.rest.defaultEdgeOptions),l(()=>t.rest.elevateNodesOnSelect),l(()=>t.rest.elevateEdgesOnSelect),l(()=>t.rest.nodesDraggable),l(()=>t.rest.autoPanOnNodeFocus),l(()=>t.rest.nodesConnectable),l(()=>t.rest.elementsSelectable),l(()=>t.rest.nodesFocusable),l(()=>t.rest.edgesFocusable),l(()=>t.rest.disableKeyboardA11y),l(()=>t.rest.noDragClass),l(()=>t.rest.noPanClass),l(()=>t.rest.noWheelClass),l(()=>t.rest.ariaLabelConfig),l(()=>t.rest.autoPanSpeed),l(()=>t.rest.panOnScrollSpeed),l(()=>t.rest.zIndexMode),l(()=>t.rest.autoPanOnSelection);let o=l(()=>Re(t.rest,`id.class.nodeTypes.edgeTypes.colorMode.isValidConnection.onmove.onmovestart.onmoveend.onflowerror.ondelete.onbeforedelete.onbeforeconnect.onconnect.onconnectstart.onconnectend.onbeforereconnect.onreconnect.onreconnectstart.onreconnectend.onclickconnectstart.onclickconnectend.oninit.onselectionchange.onselectiondragstart.onselectiondrag.onselectiondragstop.onselectionstart.onselectionend.clickConnect.fitView.fitViewOptions.nodeOrigin.nodeDragThreshold.connectionDragThreshold.minZoom.maxZoom.initialViewport.connectionRadius.connectionMode.selectionMode.selectNodesOnDrag.snapGrid.defaultMarkerColor.translateExtent.nodeExtent.onlyRenderVisibleElements.autoPanOnConnect.autoPanOnNodeDrag.colorModeSSR.defaultEdgeOptions.elevateNodesOnSelect.elevateEdgesOnSelect.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.elementsSelectable.nodesFocusable.edgesFocusable.disableKeyboardA11y.noDragClass.noPanClass.noWheelClass.ariaLabelConfig.autoPanSpeed.panOnScrollSpeed.zIndexMode.autoPanOnSelection`.split(`.`)));function s(e){e.currentTarget.scrollTo({top:0,left:0,behavior:`auto`}),t.rest.onscroll&&t.rest.onscroll(e)}var u=Hse();c(u,e=>({class:[`svelte-flow`,`svelte-flow__container`,t.colorMode,L(a)],"data-testid":`svelte-flow__wrapper`,role:`application`,onscroll:s,...L(o),[k]:e}),[()=>({width:J6(t.width),height:J6(t.height)})],void 0,void 0,`svelte-k1b1ck`),h(B(u),()=>t.children??N),y(u),ie(u,e=>n(e),()=>n()),Me(u,`clientHeight`,i),Me(u,`clientWidth`,r),q(e,u),H()}var Wse=new Set(`$$slots.$$events.$$legacy.width.height.proOptions.selectionKey.deleteKey.panActivationKey.multiSelectionKey.zoomActivationKey.paneClickDistance.nodeClickDistance.onmovestart.onmoveend.onmove.oninit.onnodeclick.onnodecontextmenu.onnodedrag.onnodedragstart.onnodedragstop.onnodepointerenter.onnodepointermove.onnodepointerleave.onselectionclick.onselectioncontextmenu.onselectionstart.onselectionend.onedgeclick.onedgecontextmenu.onedgepointerenter.onedgepointerleave.onpaneclick.onpanecontextmenu.panOnScrollMode.preventScrolling.zoomOnScroll.zoomOnDoubleClick.zoomOnPinch.panOnScroll.panOnScrollSpeed.panOnDrag.selectionOnDrag.autoPanOnSelection.connectionLineComponent.connectionLineStyle.connectionLineContainerStyle.connectionLineType.attributionPosition.children.nodes.edges.viewport`.split(`.`)),Gse=P(`<div class="svelte-flow__viewport-back svelte-flow__container"></div> <!> <div class="svelte-flow__edge-labels svelte-flow__container"></div> <!> <!> <!> <div class="svelte-flow__viewport-front svelte-flow__container"></div>`,1),Kse=P(`<!> <!>`,1),qse=P(`<!> <!> <!> <!> <!>`,1);function Jse(e,t){x(t,!0);let n=K(t,`paneClickDistance`,3,1),r=K(t,`nodeClickDistance`,3,1),i=K(t,`panOnScrollMode`,19,()=>m3.Free),a=K(t,`preventScrolling`,3,!0),o=K(t,`zoomOnScroll`,3,!0),s=K(t,`zoomOnDoubleClick`,3,!0),c=K(t,`zoomOnPinch`,3,!0),u=K(t,`panOnScroll`,3,!1),d=K(t,`panOnScrollSpeed`,3,.5),f=K(t,`panOnDrag`,3,!0),p=K(t,`selectionOnDrag`,3,!1),m=K(t,`autoPanOnSelection`,3,!0),_=K(t,`connectionLineType`,19,()=>_3.Bezier),v=K(t,`nodes`,31,()=>Ie([])),y=K(t,`edges`,31,()=>Ie([])),b=K(t,`viewport`,15,void 0),S=U(t,Wse),w=ise({props:S,width:t.width,height:t.height,get nodes(){return v()},set nodes(e){v(e)},get edges(){return y()},set edges(e){y(e)},get viewport(){return b()},set viewport(e){b(e)}}),T=ve(n8);T&&T.setStore&&T.setStore(w),C(n8,{provider:!1,getStore(){return w}}),z(()=>{let e={nodes:w.selectedNodes,edges:w.selectedEdges};Oe(()=>t.onselectionchange)?.(e);for(let t of w.selectionChangeHandlers.values())t(e)}),ce(()=>{w.reset()}),Use(e,{get colorMode(){return w.colorMode},get width(){return t.width},get height(){return t.height},get rest(){return S},get domNode(){return w.domNode},set domNode(e){w.domNode=e},get clientWidth(){return w.width},set clientWidth(e){w.width=e},get clientHeight(){return w.height},set clientHeight(e){w.height=e},children:(e,v)=>{var y=qse(),b=F(y);Pse(b,{get selectionKey(){return t.selectionKey},get deleteKey(){return t.deleteKey},get panActivationKey(){return t.panActivationKey},get multiSelectionKey(){return t.multiSelectionKey},get zoomActivationKey(){return t.zoomActivationKey},get store(){return w},set store(e){w=e}});var x=Y(b,2);sse(x,{get panOnScrollMode(){return i()},get preventScrolling(){return a()},get zoomOnScroll(){return o()},get zoomOnDoubleClick(){return s()},get zoomOnPinch(){return c()},get panOnScroll(){return u()},get panOnScrollSpeed(){return d()},get panOnDrag(){return f()},get paneClickDistance(){return n()},get selectionOnDrag(){return p()},get onmovestart(){return t.onmovestart},get onmove(){return t.onmove},get onmoveend(){return t.onmoveend},get oninit(){return t.oninit},get store(){return w},set store(e){w=e},children:(e,i)=>{lse(e,{get onpaneclick(){return t.onpaneclick},get onpanecontextmenu(){return t.onpanecontextmenu},get onselectionstart(){return t.onselectionstart},get onselectionend(){return t.onselectionend},get panOnDrag(){return f()},get paneClickDistance(){return n()},get selectionOnDrag(){return p()},get autoPanOnSelection(){return m()},get store(){return w},set store(e){w=e},children:(e,n)=>{var i=Kse(),a=F(i);dse(a,{get store(){return w},set store(e){w=e},children:(e,n)=>{var i=Gse(),a=Y(F(i),2);kse(a,{get onedgeclick(){return t.onedgeclick},get onedgecontextmenu(){return t.onedgecontextmenu},get onedgepointerenter(){return t.onedgepointerenter},get onedgepointerleave(){return t.onedgepointerleave},get store(){return w},set store(e){w=e}});var o=Y(a,4);Lse(o,{get type(){return _()},get LineComponent(){return t.connectionLineComponent},get containerStyle(){return t.connectionLineContainerStyle},get style(){return t.connectionLineStyle},get store(){return w},set store(e){w=e}});var s=Y(o,2);yse(s,{get nodeClickDistance(){return r()},get onnodeclick(){return t.onnodeclick},get onnodecontextmenu(){return t.onnodecontextmenu},get onnodepointerenter(){return t.onnodepointerenter},get onnodepointermove(){return t.onnodepointermove},get onnodepointerleave(){return t.onnodepointerleave},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get store(){return w},set store(e){w=e}}),Mse(Y(s,2),{get onselectionclick(){return t.onselectionclick},get onselectioncontextmenu(){return t.onselectioncontextmenu},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get store(){return w},set store(e){w=e}}),g(2),q(e,i)},$$slots:{default:!0}});var o=Y(a,2);{let e=l(()=>!!(w.selectionRect&&w.selectionRectMode===`user`)),t=l(()=>w.selectionRect?.width),n=l(()=>w.selectionRect?.height),r=l(()=>w.selectionRect?.x),i=l(()=>w.selectionRect?.y);l8(o,{get isVisible(){return L(e)},get width(){return L(t)},get height(){return L(n)},get x(){return L(r)},get y(){return L(i)}})}q(e,i)},$$slots:{default:!0}})},$$slots:{default:!0}});var S=Y(x,2);Vse(S,{get proOptions(){return t.proOptions},get position(){return t.attributionPosition}});var C=Y(S,2);mse(C,{get store(){return w}}),h(Y(C,2),()=>t.children??N),q(e,y)},$$slots:{default:!0}}),H()}var m8;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(m8||={});var Yse=ne(`<circle></circle>`);function Xse(e,t){var n=Yse();J(()=>{A(n,`cx`,t.radius),A(n,`cy`,t.radius),A(n,`r`,t.radius),w(n,0,_e([`svelte-flow__background-pattern`,`dots`,t.class]))}),q(e,n)}var Zse=ne(`<path></path>`);function Qse(e,t){x(t,!0);var n=Zse();J(()=>{A(n,`stroke-width`,t.lineWidth),A(n,`d`,`M${t.dimensions[0]/2} 0 V${t.dimensions[1]} M0 ${t.dimensions[1]/2} H${t.dimensions[0]}`),w(n,0,_e([`svelte-flow__background-pattern`,t.variant,t.class]))}),q(e,n),H()}var $se={[m8.Dots]:1,[m8.Lines]:1,[m8.Cross]:6},ece=ne(`<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>`);function tce(e,t){x(t,!0);let n=K(t,`variant`,19,()=>m8.Dots),r=K(t,`gap`,3,20),i=K(t,`lineWidth`,3,1),a=l(t8),o=l(()=>n()===m8.Dots),s=l(()=>n()===m8.Cross),c=l(()=>Array.isArray(r())?r():[r(),r()]),d=l(()=>`background-pattern-${L(a).flowId}-${t.id??``}`),f=l(()=>[L(c)[0]*L(a).viewport.zoom||1,L(c)[1]*L(a).viewport.zoom||1]),m=l(()=>(t.size??$se[n()])*L(a).viewport.zoom),h=l(()=>L(s)?[L(m),L(m)]:L(f)),g=l(()=>L(o)?[L(m)/2,L(m)/2]:[L(h)[0]/2,L(h)[1]/2]);var _=ece();let v;var b=B(_),S=B(b),C=e=>{{let n=l(()=>L(m)/2);Xse(e,{get radius(){return L(n)},get class(){return t.patternClass}})}},T=e=>{Qse(e,{get dimensions(){return L(h)},get variant(){return n()},get lineWidth(){return i()},get class(){return t.patternClass}})};p(S,e=>{L(o)?e(C):e(T,-1)}),y(b);var E=Y(b);y(_),J(()=>{w(_,0,_e([`svelte-flow__background`,`svelte-flow__container`,t.class])),v=u(_,``,v,{"--xy-background-color-props":t.bgColor,"--xy-background-pattern-color-props":t.patternColor}),A(b,`id`,L(d)),A(b,`x`,L(a).viewport.x%L(f)[0]),A(b,`y`,L(a).viewport.y%L(f)[1]),A(b,`width`,L(f)[0]),A(b,`height`,L(f)[1]),A(b,`patternTransform`,`translate(-${L(g)[0]},-${L(g)[1]})`),A(E,`fill`,`url(#${L(d)})`)}),q(e,_),H()}function nce(e){let t=l(t8),n=l(()=>L(t).nodeLookup),r=l(()=>L(t).nodes),i=l(()=>(L(r),L(n).get(e)));return{get current(){return L(i)}}}var rce=ne(`<rect></rect>`);function ice(e,t){x(t,!0);let n=K(t,`borderRadius`,3,5),r=K(t,`strokeWidth`,3,2),i=l(()=>nce(t.id)),a=l(()=>{if(!L(i).current)return{width:0,height:0,x:0,y:0};let{width:e,height:n}=e6(L(i).current);return{width:t.width??e,height:t.height??n,x:t.x??L(i).current.internals.positionAbsolute.x,y:t.y??L(i).current.internals.positionAbsolute.y}}),o=l(()=>L(a).width),s=l(()=>L(a).height),c=l(()=>L(a).x),f=l(()=>L(a).y);var m=_(),h=F(m),g=e=>{let i=l(()=>t.nodeComponent);var a=_();d(F(a),()=>L(i),(e,i)=>{i(e,{get id(){return t.id},get x(){return L(c)},get y(){return L(f)},get width(){return L(o)},get height(){return L(s)},get borderRadius(){return n()},get class(){return t.class},get color(){return t.color},get shapeRendering(){return t.shapeRendering},get strokeColor(){return t.strokeColor},get strokeWidth(){return r()},get selected(){return t.selected}})}),q(e,a)},v=e=>{var i=rce();let a,l;J(()=>{a=w(i,0,_e([`svelte-flow__minimap-node`,t.class]),null,a,{selected:t.selected}),A(i,`x`,L(c)),A(i,`y`,L(f)),A(i,`rx`,n()),A(i,`ry`,n()),A(i,`width`,L(o)),A(i,`height`,L(s)),A(i,`shape-rendering`,t.shapeRendering),l=u(i,``,l,{fill:t.color,stroke:t.strokeColor,"stroke-width":r()})}),q(e,i)};p(h,e=>{t.nodeComponent?e(g):e(v,-1)}),q(e,m),H()}function ace(e,t){let n=hoe({domNode:e,panZoom:t.panZoom,getTransform:()=>{let{viewport:e}=t.store;return[e.x,e.y,e.zoom]},getViewScale:t.getViewScale});n.update({translateExtent:t.translateExtent,width:t.width,height:t.height,inversePan:t.inversePan,zoomStep:t.zoomStep,pannable:t.pannable,zoomable:t.zoomable});function r(e){n.update({translateExtent:e.translateExtent,width:e.width,height:e.height,inversePan:e.inversePan,zoomStep:e.zoomStep,pannable:e.pannable,zoomable:e.zoomable})}return{update:r,destroy(){n.destroy()}}}var h8=e=>e instanceof Function?e:()=>e,oce=new Set([`$$slots`,`$$events`,`$$legacy`,`position`,`ariaLabel`,`nodeStrokeColor`,`nodeColor`,`nodeClass`,`nodeBorderRadius`,`nodeStrokeWidth`,`nodeComponent`,`bgColor`,`maskColor`,`maskStrokeColor`,`maskStrokeWidth`,`width`,`height`,`pannable`,`zoomable`,`inversePan`,`zoomStep`,`class`]),sce=ne(`<title> </title>`),cce=ne(`<svg class="svelte-flow__minimap-svg" role="img"><!><!><path class="svelte-flow__minimap-mask" fill-rule="evenodd" pointer-events="none"></path></svg>`),lce=P(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function uce(e,t){x(t,!0);let n=K(t,`position`,3,`bottom-right`),r=K(t,`nodeStrokeColor`,3,`transparent`),i=K(t,`nodeClass`,3,``),a=K(t,`nodeBorderRadius`,3,5),s=K(t,`nodeStrokeWidth`,3,2),c=K(t,`width`,3,200),d=K(t,`height`,3,150),m=K(t,`pannable`,3,!0),h=K(t,`zoomable`,3,!0),g=U(t,oce),v=l(t8),b=l(()=>L(v).ariaLabelConfig),S=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`,C=l(()=>`svelte-flow__minimap-desc-${L(v).flowId}`),w=l(()=>({x:-L(v).viewport.x/L(v).viewport.zoom,y:-L(v).viewport.y/L(v).viewport.zoom,width:L(v).width/L(v).viewport.zoom,height:L(v).height/L(v).viewport.zoom})),T=l(()=>V3(O3(L(v).nodeLookup,{filter:e=>!e.hidden}),L(w))),E=l(()=>L(T).width/c()),D=l(()=>L(T).height/d()),k=l(()=>Math.max(L(E),L(D))),ee=l(()=>L(k)*c()),j=l(()=>L(k)*d()),M=l(()=>5*L(k)),N=l(()=>L(T).x-(L(ee)-L(T).width)/2-L(M)),te=l(()=>L(T).y-(L(j)-L(T).height)/2-L(M)),ne=l(()=>L(ee)+L(M)*2),P=l(()=>L(j)+L(M)*2),re=()=>L(k);var ie=lce(),I=F(ie);{let e=l(()=>[`svelte-flow__minimap`,t.class]);o(I,()=>({"--xy-minimap-background-color-props":t.bgColor})),p8(I.lastChild,V({get position(){return n()},get class(){return L(e)},"data-testid":`svelte-flow__minimap`},()=>g,{children:(e,n)=>{var o=_(),g=F(o),x=e=>{var n=cce();let o;var g=B(n),x=e=>{var n=sce(),r=B(n,!0);y(n),J(()=>{A(n,`id`,L(C)),f(r,t.ariaLabel??L(b)[`minimap.ariaLabel`])}),q(e,n)};p(g,e=>{(t.ariaLabel??L(b)[`minimap.ariaLabel`])&&e(x)});var T=Y(g);O(T,17,()=>L(v).nodes,e=>e.id,(e,n)=>{let o=l(()=>L(v).nodeLookup.get(L(n).id));var c=_(),u=F(c),d=e=>{{let c=l(()=>t.nodeColor===void 0?void 0:h8(t.nodeColor)(L(n))),u=l(()=>h8(r())(L(n))),d=l(()=>h8(i())(L(n)));ice(e,{get id(){return L(o).id},get selected(){return L(o).selected},get nodeComponent(){return t.nodeComponent},get color(){return L(c)},get borderRadius(){return a()},get strokeColor(){return L(u)},get strokeWidth(){return s()},get shapeRendering(){return S},get class(){return L(d)}})}},f=l(()=>L(o)&&t6(L(o))&&!L(o).hidden);p(u,e=>{L(f)&&e(d)}),q(e,c)});var E=Y(T);y(n),ge(n,(e,t)=>ace?.(e,t),()=>({store:L(v),panZoom:L(v).panZoom,getViewScale:re,translateExtent:L(v).translateExtent,width:L(v).width,height:L(v).height,inversePan:t.inversePan,zoomStep:t.zoomStep,pannable:m(),zoomable:h()})),J(()=>{A(n,`width`,c()),A(n,`height`,d()),A(n,`viewBox`,`${L(N)??``} ${L(te)??``} ${L(ne)??``} ${L(P)??``}`),A(n,`aria-labelledby`,L(C)),o=u(n,``,o,{"--xy-minimap-mask-background-color-props":t.maskColor,"--xy-minimap-mask-stroke-color-props":t.maskStrokeColor,"--xy-minimap-mask-stroke-width-props":t.maskStrokeWidth?t.maskStrokeWidth*L(k):void 0}),A(E,`d`,`M${L(N)-L(M)},${L(te)-L(M)}h${L(ne)+L(M)*2}v${L(P)+L(M)*2}h${-L(ne)-L(M)*2}z
146
- M${L(w).x??``},${L(w).y??``}h${L(w).width??``}v${L(w).height??``}h${-L(w).width}z`)}),q(e,n)};p(g,e=>{L(v).panZoom&&e(x)}),q(e,o)},$$slots:{default:!0}})),y(I)}q(e,ie),H()}var dce=/^\[Tool call:([\s\S]*)\]$/,g8=new Set([`ask_user`,`plan_mode_present`]),fce={read:`file-text`,bash:`terminal`,python:`terminal`,edit:`file-pen`,write:`file-plus`,grep:`search`,find:`folder-search`,ls:`folder-tree`,web_search:`globe`,web_fetch:`download`,task_start:`cpu`,task_status:`cpu`,task_logs:`cpu`,task_cancel:`cpu`,task_restart:`cpu`,explore:`search`,ask_user:`message-circle-question`,plan_mode_enter:`clipboard-list`,plan_mode_present:`clipboard-check`,plan_mode_force_exit:`clipboard-list`,todos_set:`list-todo`,todos_get:`list-todo`};function _8(e){return e&&fce[e]||`wrench`}function v8(e){return e&&typeof e==`object`?e:void 0}function pce(e){return typeof e==`string`&&e.length>0?e:void 0}function y8(e){return typeof e==`string`&&e.startsWith(`tool_`)?e:void 0}function mce(e){let t=e?.thinkingBlocks;return Array.isArray(t)?t.some(e=>{let t=v8(e);return t?typeof t.text==`string`&&t.text.length>0||t.redacted===!0:!1}):!1}function b8(e,t){if(!e)return;let n=v8(v8(e.details)?.toolCall),r=y8(e.toolRecordId)??y8(n?.id);return r?t.get(r):void 0}function hce(e,t){return b8(v8(e.details),t)}function x8(e){let t=e.trim().match(dce);return t?[...t[1].matchAll(/([a-z_][a-z0-9_]*)\s*\(/gi)].map(e=>e[1]):[]}function S8(e){let t=e.replace(/\s+/g,` `).trim();return t.length>160?`${t.slice(0,160)}…`:t}function C8(e,t){let n=v8(e.details),r=[],i=e.usage?.totalTokens,a=()=>i&&i>0?{icon:`sparkles`,label:i>=1e3?`${Math.round(i/1e3)}k`:`${i}`,tone:`default`,title:`${i.toLocaleString()} tokens`}:void 0;if(e.kind===`compaction`)return{type:`compaction`,icon:`fold-vertical`,label:`Compacted`,preview:S8(e.summary||e.text),tone:`info`,mono:!1,badges:r};if(e.kind===`branch_summary`)return{type:`branch_summary`,icon:`git-branch`,label:`Branch summary`,preview:S8(e.summary||e.text),tone:`info`,mono:!1,badges:r};if(e.kind===`explore_report`)return{type:`explore_report`,icon:`search`,label:`Explore`,preview:S8(e.summary||e.text),tone:`info`,mono:!1,badges:r};if(e.role===`user`)return{type:`user`,icon:`user`,label:`You`,preview:S8(e.text)||`empty message`,tone:`default`,mono:!1,badges:r};if(e.role===`assistant`){mce(n)&&r.push({icon:`brain`,tone:`info`,title:`Includes thinking`});let t=x8(e.text);if(t.length>0){let e=t[0],n=t.some(e=>g8.has(e)),i=t.length>1?` +${t.length-1}`:``;return{type:n?`human_loop`:`tool_call`,icon:_8(e),label:`${e}${i}`,preview:t.slice(0,4).join(`, `),tone:n?`warning`:`default`,mono:!0,badges:n?[{icon:`hand`,label:`input`,tone:`warning`},...r]:r}}let i=a();return i&&r.push(i),{type:`assistant`,icon:`sparkles`,label:`Assistant`,preview:S8(e.text)||`(thinking)`,tone:`default`,mono:!1,badges:r}}let o=pce(n?.toolName);if(o){let i=b8(n,t),a=n?.isError===!0||i?.status===`error`||i?.status===`denied`,s=g8.has(o)||i?.risk===`interaction`||!!i?.approvalId;return s&&r.push({icon:`hand`,label:`human`,tone:`warning`}),a&&r.push({icon:`triangle-alert`,label:`error`,tone:`danger`}),{type:s?`human_loop`:`tool_result`,icon:_8(o),label:o,preview:S8(e.text),tone:a?`danger`:s?`warning`:`success`,mono:!0,badges:r}}return{type:`system`,icon:`info`,label:`System`,preview:S8(e.text)||`system entry`,tone:`default`,mono:!1,badges:r}}function gce(e,t){let n=new Map(e.map(e=>[e.entry.id,e])),r=e=>e.entry.parentEntryId!==void 0&&n.has(e.entry.parentEntryId),i=e.filter(e=>!r(e)),a=new Set;if(t){let e=t;for(;e;){let t=n.get(e);if(!t)break;a.add(t.entry.id),e=t.entry.parentEntryId}}let o=[],s=new Set,c=0,l=e=>e.childEntryIds.map(e=>n.get(e)).filter(e=>!!e),u=e=>{if(s.has(e.entry.id))return;s.add(e.entry.id);let n=l(e);o.push({node:e,index:++c,isOnActivePath:a.has(e.entry.id),isActive:e.entry.id===t,isLeaf:n.length===0,isBranchPoint:n.length>1}),n.forEach(u)};return i.forEach(u),e.forEach(u),{rows:o}}function _ce(e){let t=e.details;return Array.isArray(t?.thinkingBlocks)?t.thinkingBlocks:void 0}function w8(e){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function vce(e,t=560){let n=e.trim();return n.length<=t?n:`${n.slice(0,Math.max(0,t-1)).trimEnd()}…`}function T8(e){return e==null||e===``?!1:Array.isArray(e)?e.length>0:typeof e==`object`?Object.keys(e).length>0:!0}function E8(e,t){let n=C8(e,t),r=hce(e,t),i=(_ce(e)??[]).map(e=>e?.text??``).filter(Boolean).join(`
147
-
148
- `),a=e.summary||e.text,o=n.type===`tool_call`||n.type===`tool_result`||n.type===`human_loop`,s=r?.toolName??x8(e.text)[0]??e.details?.toolName,c=T8(r?.argsPreview)?w8(r?.argsPreview):``,l=e.role===`system`&&e.text?e.text:r?.resultPreview,u=T8(l)?w8(l):``,d=r?.error??``;return{descriptor:n,record:r,thinkingText:i,messageText:a,isToolEntry:o,toolName:s,argsText:c,resultText:u,errorText:d,detailPreview:vce(o?d?`Error\n${d}`:e.role===`system`&&u?`Result\n${u}`:c?`Arguments\n${c}`:u?`Result\n${u}`:n.preview:a||i||n.preview)}}var D8=Object.defineProperty,yce=(e,t,n)=>t in e?D8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bce=(e,t)=>{for(var n in t)D8(e,n,{get:t[n],enumerable:!0})},xce=(e,t,n)=>yce(e,typeof t==`symbol`?t:t+``,n),O8={};bce(O8,{Graph:()=>A8,alg:()=>I8,json:()=>F8,version:()=>wce});var Sce=Object.defineProperty,k8=(e,t)=>{for(var n in t)Sce(e,n,{get:t[n],enumerable:!0})},A8=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e?e.multigraph:!1,this._isCompound=`compound`in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e==`function`?this._defaultNodeLabelFn=e:this._defaultNodeLabelFn=()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let t of this.successors(e))n.add(t);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i??void 0,i??void 0):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return typeof e==`function`?this._defaultEdgeLabelFn=e:this._defaultEdgeLabelFn=()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=N8(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=Cce(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,j8(this._preds[a],i),j8(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?P8(this._isDirected,e):N8(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r==`object`?r:{label:r}}hasEdge(e,t,n){return(arguments.length===1?P8(this._isDirected,e):N8(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?P8(this._isDirected,e):N8(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],M8(this._preds[t],e),M8(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function j8(e,t){e[t]?e[t]++:e[t]=1}function M8(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function N8(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function Cce(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function P8(e,t){return N8(e,t.v,t.w,t.name)}var wce=`4.0.1`,F8={};k8(F8,{read:()=>Oce,write:()=>Tce});function Tce(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Ece(e),edges:Dce(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function Ece(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function Dce(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function Oce(e){let t=new A8(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var I8={};k8(I8,{CycleException:()=>V8,bellmanFord:()=>L8,components:()=>jce,dijkstra:()=>z8,dijkstraAll:()=>Pce,findCycles:()=>Fce,floydWarshall:()=>Lce,isAcyclic:()=>zce,postorder:()=>Vce,preorder:()=>Hce,prim:()=>Uce,shortestPaths:()=>Wce,tarjan:()=>B8,topsort:()=>H8});var kce=()=>1;function L8(e,t,n,r){return Ace(e,String(t),n||kce,r||function(t){return e.outEdges(t)})}function Ace(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=n(e);i[e.v].distance+t<i[e.w].distance&&(i[e.w]={distance:i[e.v].distance+t,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w;c({v:n,w:n===t.v?t.w:t.v})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function jce(e){let t={},n=[],r;function i(n){n in t||(t[n]=!0,r.push(n),e.successors(n).forEach(i),e.predecessors(n).forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var R8=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},Mce=()=>1;function z8(e,t,n,r){return Nce(e,String(t),n||Mce,r||function(t){return e.outEdges(t)})}function Nce(e,t,n,r){let i={},a=new R8,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t],c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0&&(o=a.removeMin(),s=i[o],s.distance!==1/0);)r(o).forEach(c);return i}function Pce(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=z8(e,i,t,n),r},{})}function B8(e){let t=0,n=[],r={},i=[];function a(o){let s=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(e){e in r?r[e].onStack&&(s.lowlink=Math.min(s.lowlink,r[e].index)):(a(e),s.lowlink=Math.min(s.lowlink,r[e].lowlink))}),s.lowlink===s.index){let e=[],t;do t=n.pop(),r[t].onStack=!1,e.push(t);while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function Fce(e){return B8(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var Ice=()=>1;function Lce(e,t,n){return Rce(e,t||Ice,n||function(t){return e.outEdges(t)})}function Rce(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){r[e]={},r[e][e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(r[e][t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let i=n.v===e?n.w:n.v,a=t(n);r[e][i]={distance:a,predecessor:e}})}),i.forEach(function(e){let t=r[e];i.forEach(function(n){let a=r[n];i.forEach(function(n){let r=a[e],i=t[n],o=a[n],s=r.distance+i.distance;s<o.distance&&(o.distance=s,o.predecessor=i.predecessor)})})}),r}var V8=class extends Error{constructor(...e){super(...e)}};function H8(e){let t={},n={},r=[];function i(a){if(a in n)throw new V8;a in t||(n[a]=!0,t[a]=!0,e.predecessors(a).forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new V8;return r}function zce(e){try{H8(e)}catch(e){if(e instanceof V8)return!1;throw e}return!0}function Bce(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=U8(e,t,n===`post`,o,a,r,i)}),i}function U8(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=U8(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function W8(e,t,n){return Bce(e,t,n,function(e,t){return e.push(t),e},[])}function Vce(e,t){return W8(e,t,`post`)}function Hce(e,t){return W8(e,t,`pre`)}function Uce(e,t){let n=new A8,r={},i=new R8,a;function o(e){let n=e.v===a?e.w:e.v,o=i.priority(n);if(o!==void 0){let s=t(e);s<o&&(r[n]=a,i.decrease(n,s))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(e){i.add(e,1/0),n.setNode(e)}),i.decrease(e.nodes()[0],0);let s=!1;for(;i.size()>0;){if(a=i.removeMin(),a in r)n.setEdge(a,r[a]);else{if(s)throw Error(`Input graph is not connected: `+e);s=!0}e.nodeEdges(a).forEach(o)}return n}function Wce(e,t,n,r){return Gce(e,t,n,r??(t=>e.outEdges(t)??[]))}function Gce(e,t,n,r){if(n===void 0)return z8(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=r(a[o]);for(let e=0;e<s.length;e++){let t=s[e],r=t.v===a[o]?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return L8(e,t,n,r)}return z8(e,t,n,r)}function G8(e,t,n,r){let i=r;for(;e.hasNode(i);)i=t5(r);return n.dummy=t,e.setNode(i,n),i}function Kce(e){let t=new A8().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function K8(e){let t=new A8({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function q8(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function J8(e){let t=n5(Q8(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function qce(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=Z8(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function Jce(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=Z8(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function Y8(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),G8(e,`border`,i,t)}function Yce(e,t=X8){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var X8=65535;function Z8(e,t){return t.length>X8?e(...Yce(t).map(t=>e(...t))):e(...t)}function Q8(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return Z8(Math.max,t)}function Xce(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function $8(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function e5(e,t){return t()}var Zce=0;function t5(e){return e+(``+ ++Zce)}function n5(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function r5(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function i5(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function Qce(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var a5=`\0`,$ce=`3.0.0`,ele=class{constructor(){xce(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return o5(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&o5(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,tle)),n=n._prev;return`[`+e.join(`, `)+`]`}};function o5(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function tle(e,t){if(e!==`_next`&&e!==`_prev`)return t}var nle=ele,rle=()=>1;function ile(e,t){if(e.nodeCount()<=1)return[];let n=ole(e,t||rle);return ale(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function ale(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)s5(e,t,n,o);for(;o=i.dequeue();)s5(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(s5(e,t,n,o,!0)||[]);break}}}return r}function s5(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,c5(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,c5(t,n,o)}),e.removeNode(r.v),o}function ole(e,t){let n=new A8,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=sle(i+r+3).map(()=>new nle),o=r+1;return n.nodes().forEach(e=>{c5(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function c5(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function sle(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function cle(e){(e.graph().acyclicer===`greedy`?ile(e,t(e)):lle(e)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,t5(`rev`))});function t(e){return t=>e.edge(t).weight}}function lle(e){let t=[],n={},r={};function i(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,e.outEdges(a).forEach(e=>{Object.hasOwn(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return e.nodes().forEach(i),t}function ule(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function dle(e){e.graph().dummyChains=[],e.edges().forEach(t=>fle(e,t))}function fle(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d;for(d=0,++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=G8(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function ple(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function l5(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=Z8(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function u5(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var d5=mle;function mle(e){let t=new A8({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;hle(t,e)<i&&(a=gle(t,e),a);)o=t.hasNode(a.v)?u5(e,a):-u5(e,a),_le(t,e,o);return t}function hle(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!u5(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function gle(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=u5(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function _le(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:vle,postorder:yle}=I8,ble=f5;f5.initLowLimValues=h5,f5.initCutValues=p5,f5.calcCutValue=m5,f5.leaveEdge=_5,f5.enterEdge=v5,f5.exchangeEdges=y5;function f5(e){e=Kce(e),l5(e);let t=d5(e);h5(t),p5(t,e);let n,r;for(;n=_5(t);)r=v5(t,e,n),y5(t,e,n,r)}function p5(e,t){let n=yle(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>xle(e,t,n))}function xle(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=m5(e,t,n)}function m5(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,Cle(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function h5(e,t){arguments.length<2&&(t=e.nodes()[0]),g5(e,{},1,t)}function g5(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=g5(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function _5(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function v5(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===b5(e,e.node(t.v),s)&&c!==b5(e,e.node(t.w),s)).reduce((e,n)=>u5(t,n)<u5(t,e)?n:e)}function y5(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),h5(e),p5(e,t),Sle(e,t)}function Sle(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=vle(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Cle(e,t,n){return e.hasEdge(t,n)}function b5(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var wle=Tle;function Tle(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:x5(e);break;case`tight-tree`:Dle(e);break;case`longest-path`:Ele(e);break;case`none`:break;default:x5(e)}}var Ele=l5;function Dle(e){l5(e),d5(e)}function x5(e){ble(e)}var Ole=kle;function kle(e){let t=jle(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=Ale(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function Ale(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function jle(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(a5).forEach(r),t}function Mle(e){let t=G8(e,`root`,{},`_root`),n=Nle(e),r=Object.values(n),i=Z8(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=Ple(e)+1;e.children(a5).forEach(r=>S5(e,t,a,o,i,n,r)),e.graph().nodeRankFactor=a}function S5(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=Y8(e,`_bt`),l=Y8(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{S5(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function Nle(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(a5).forEach(e=>n(e,1)),t}function Ple(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Fle(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var Ile=Lle;function Lle(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)C5(e,`borderLeft`,`_bl`,n,i,t),C5(e,`borderRight`,`_br`,n,i,t)}}e.children(a5).forEach(t)}function C5(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=G8(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Rle(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&w5(e)}function zle(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&Ble(e),(t===`lr`||t===`rl`)&&(Vle(e),w5(e))}function w5(e){e.nodes().forEach(t=>T5(e.node(t))),e.edges().forEach(t=>T5(e.edge(t)))}function T5(e){let t=e.width;e.width=e.height,e.height=t}function Ble(e){e.nodes().forEach(t=>E5(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(E5),Object.hasOwn(r,`y`)&&E5(r)})}function E5(e){e.y=-e.y}function Vle(e){e.nodes().forEach(t=>D5(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(D5),Object.hasOwn(r,`x`)&&D5(r)})}function D5(e){let t=e.x;e.x=e.y,e.y=t}function Hle(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),r=n.map(t=>e.node(t).rank),i=n5(Z8(Math.max,r)+1).map(()=>[]);function a(n){if(t[n])return;t[n]=!0,i[e.node(n).rank].push(n);let r=e.successors(n);r&&r.forEach(a)}return n.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(a),i}function Ule(e,t){let n=0;for(let r=1;r<t.length;++r)n+=Wle(e,t[r-1],t[r]);return n}function Wle(e,t,n){let r=Qce(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function Gle(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function Kle(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),qle(Object.values(n).filter(e=>!e.indegree))}function qle(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&Jle(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>r5(e,[`vs`,`i`,`barycenter`,`weight`]))}function Jle(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Yle(e,t){let n=Xce(e,e=>Object.hasOwn(e,`barycenter`)),r=n.lhs,i=n.rhs.sort((e,t)=>t.i-e.i),a=[],o=0,s=0,c=0;r.sort(Xle(!!t)),c=O5(a,i,c),r.forEach(e=>{c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=O5(a,i,c)});let l={vs:a.flat(1)};return s&&(l.barycenter=o/s,l.weight=s),l}function O5(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Xle(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}function k5(e,t,n,r){let i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=i.filter(e=>e!==o&&e!==s));let l=Gle(e,i);l.forEach(t=>{if(e.children(t.v).length){let i=k5(e,t.v,n,r);c[t.v]=i,Object.hasOwn(i,`barycenter`)&&Qle(t,i)}});let u=Kle(l,n);Zle(u,c);let d=Yle(u,r);if(o&&s){d.vs=[o,d.vs,s].flat(1);let t=e.predecessors(o);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(s),i=e.node(r[0]);Object.hasOwn(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+n.order+i.order)/(d.weight+2),d.weight+=2}}return d}function Zle(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function Qle(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function $le(e,t,n,r){r||=e.nodes();let i=eue(e),a=new A8({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function eue(e){let t;for(;e.hasNode(t=t5(`_root`)););return t}function tue(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function A5(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,A5);return}let n=Q8(e),r=j5(e,n5(1,n+1),`inEdges`),i=j5(e,n5(n-1,-1,-1),`outEdges`),a=Hle(e);if(M5(e,a),t.disableOptimalOrderHeuristic)return;let o=1/0,s,c=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){nue(t%2?r:i,t%4>=2,c),a=J8(e);let l=Ule(e,a);l<o?(n=0,s=Object.assign({},a),o=l):l===o&&(s=structuredClone(a))}M5(e,s)}function j5(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return $le(e,t,n,r.get(t)||[])})}function nue(e,t,n){let r=new A8;e.forEach(function(e){n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,a=k5(e,i,r,t);a.vs.forEach((t,n)=>e.node(t).order=n),tue(e,r,a.vs)})}function M5(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function rue(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=aue(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&N5(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function iue(e,t){let n={};function r(t,r,i,a,o){n5(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&N5(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function aue(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function N5(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function oue(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function sue(e,t,n,r){let i={},a={},o={};return t.forEach(e=>{e.forEach((e,t)=>{i[e]=e,a[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s&&s.length){let r=s.sort((e,t)=>{let n=o[e],r=o[t];return(n===void 0?0:n)-(r===void 0?0:r)}),c=(r.length-1)/2;for(let s=Math.floor(c),l=Math.ceil(c);s<=l;++s){let c=r[s];if(c===void 0)continue;let l=o[c];if(l!==void 0&&a[e]===e&&t<l&&!oue(n,e,c)){let n=i[c];n!==void 0&&(a[c]=e,a[e]=i[e]=n,t=l)}}}})}),{root:i,align:a}}function cue(e,t,n,r,i=!1){let a={},o=lue(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function lue(e,t,n,r){let i=new A8,a=e.graph(),o=mue(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function uue(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=hue(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function due(e,t){let n=Object.values(t),r=Z8(Math.min,n),i=Z8(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-Z8(Math.min,c);a!==`l`&&(l=i-Z8(Math.max,c)),l&&(e[o]=i5(s,e=>e+l))})})}function fue(e,t=void 0){let n=e.ul;return n?i5(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function pue(e){let t=J8(e),n=Object.assign(rue(e,t),iue(e,t)),r={},i;return[`u`,`d`].forEach(a=>{i=a===`u`?t:Object.values(t).reverse(),[`l`,`r`].forEach(t=>{t===`r`&&(i=i.map(e=>Object.values(e).reverse()));let o=sue(e,i,n,t=>(a===`u`?e.predecessors(t):e.successors(t))||[]),s=cue(e,i,o.root,o.align,t===`r`);t===`r`&&(s=i5(s,e=>-e)),r[a+t]=s})}),due(r,uue(e,r)),fue(r,e.graph().align)}function mue(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2;break}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2;break}return l&&(c+=n?l:-l),c}}function hue(e,t){return e.node(t).width}function gue(e){e=K8(e),_ue(e),Object.entries(pue(e)).forEach(([t,n])=>e.node(t).x=n)}function _ue(e){let t=J8(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);i===`top`?r.y=a+r.height/2:i===`bottom`?r.y=a+n-r.height/2:r.y=a+n/2}),a+=n+r})}function vue(e,t={}){let n=t.debugTiming?$8:e5;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>Oue(e));return n(` runLayout`,()=>yue(r,n,t)),n(` updateInputGraph`,()=>bue(e,r)),r})}function yue(e,t,n){t(` makeSpaceForEdgeLabels`,()=>kue(e)),t(` removeSelfEdges`,()=>Rue(e)),t(` acyclic`,()=>cle(e)),t(` nestingGraph.run`,()=>Mle(e)),t(` rank`,()=>wle(K8(e))),t(` injectEdgeLabelProxies`,()=>Aue(e)),t(` removeEmptyRanks`,()=>Jce(e)),t(` nestingGraph.cleanup`,()=>Fle(e)),t(` normalizeRanks`,()=>qce(e)),t(` assignRankMinMax`,()=>jue(e)),t(` removeEdgeLabelProxies`,()=>Mue(e)),t(` normalize.run`,()=>dle(e)),t(` parentDummyChains`,()=>Ole(e)),t(` addBorderSegments`,()=>Ile(e)),t(` order`,()=>A5(e,n)),t(` insertSelfEdges`,()=>zue(e)),t(` adjustCoordinateSystem`,()=>Rle(e)),t(` position`,()=>gue(e)),t(` positionSelfEdges`,()=>Bue(e)),t(` removeBorderNodes`,()=>Lue(e)),t(` normalize.undo`,()=>ple(e)),t(` fixupEdgeLabelCoords`,()=>Fue(e)),t(` undoCoordinateSystem`,()=>zle(e)),t(` translateGraph`,()=>Nue(e)),t(` assignNodeIntersects`,()=>Pue(e)),t(` reversePoints`,()=>Iue(e)),t(` acyclic.undo`,()=>ule(e))}function bue(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var xue=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],Sue={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},Cue=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],wue=[`width`,`height`,`rank`],P5={width:0,height:0},Tue=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Eue={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Due=[`labelpos`];function Oue(e){let t=new A8({multigraph:!0,compound:!0}),n=I5(e.graph());return t.setGraph(Object.assign({},Sue,F5(n,xue),r5(n,Cue))),e.nodes().forEach(n=>{let r=F5(I5(e.node(n)),wue);Object.keys(P5).forEach(e=>{r[e]===void 0&&(r[e]=P5[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=I5(e.edge(n));t.setEdge(n,Object.assign({},Eue,F5(r,Tue),r5(r,Due)))}),t}function kue(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Aue(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);G8(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function jue(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function Mue(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function Nue(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function Pue(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(q8(r,a)),n.points.push(q8(i,o))})}function Fue(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset;break}})}function Iue(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Lue(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function Rue(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function zue(e){J8(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{G8(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Bue(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`selfedge`){let r=n,i=e.node(r.e.v),a=i.x+i.width/2,o=i.y,s=n.x-a,c=i.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:a+2*s/3,y:o-c},{x:a+5*s/6,y:o-c},{x:a+s,y:o},{x:a+5*s/6,y:o+c},{x:a+2*s/3,y:o+c}],r.label.x=n.x,r.label.y=n.y}})}function F5(e,t){return i5(r5(e,t),Number)}function I5(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function Vue(e){let t=J8(e),n=new A8({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var L5={graphlib:O8,version:$ce,layout:vue,debug:Vue,util:{time:$8,notime:e5}},R5=`history-root`,Hue=`top`,Uue=`bottom`,z5={root:{width:320,height:80},segment:{width:320,height:112},entry:{width:320,height:192},nodeGap:48,rankGap:64};function B5(e){return`history-entry:${e}`}function V5(e){return`history-segment:${e}`}function Wue(e){return e.kind===`root`?`root`:e.kind===`entry`?`e:${e.row.node.entry.id}`:`s:${e.segment.id}`}function H5(e){return z5[e.kind]}function Gue(e){if(e.kind===`root`)return`Start of conversation`;if(e.kind===`segment`)return`${e.segment.total} collapsed conversation steps`;let t=e.isActive?`, active entry`:``;return`Step ${e.row.index}: ${e.view.descriptor.label}${t}`}function U5(e,t,n){let r=H5(t);return{id:e,type:`history`,position:{x:0,y:0},initialWidth:r.width,initialHeight:r.height,data:t,selected:Wue(t.selection)===n,draggable:!1,connectable:!1,deletable:!1,selectable:!0,focusable:!0,sourcePosition:Uue,targetPosition:Hue,ariaLabel:Gue(t),class:[t.isActive&&`history-node-active`,t.isOnActivePath&&`history-node-on-path`]}}function Kue(e,t){let n=new L5.graphlib.Graph;n.setDefaultEdgeLabel(()=>({})),n.setGraph({rankdir:`TB`,ranker:`tight-tree`,nodesep:z5.nodeGap,ranksep:z5.rankGap,marginx:z5.nodeGap,marginy:z5.nodeGap});for(let t of e){let e=H5(t.data);n.setNode(t.id,{...e})}for(let e of t)n.setEdge(e.source,e.target);return L5.layout(n),e.map(e=>{let t=n.node(e.id),r=H5(e.data);return{...e,position:t?{x:t.x-r.width/2,y:t.y-r.height/2}:e.position}})}function que({visible:e,hasConversation:t,rootActive:n,rootOnActivePath:r,selectedKey:i,entryViewById:a}){if(!t)return{nodes:[],edges:[],visibleNodeIdByEntryId:new Map};let o=new Map;for(let t of e.items)if(t.type===`entry`)o.set(t.row.node.entry.id,B5(t.row.node.entry.id));else{let e=V5(t.segment.id);for(let n of t.segment.rows)o.set(n.node.entry.id,e)}let s=[U5(R5,{kind:`root`,selection:{kind:`root`},zoomTier:`summary`,isActive:n,isOnActivePath:r},i)];for(let t of e.items)if(t.type===`entry`){let e=t.row.node.entry.id,n=a.get(e);if(!n)continue;let r={kind:`entry`,row:t.row};s.push(U5(B5(e),{kind:`entry`,selection:r,row:t.row,view:n,zoomTier:`summary`,isActive:t.row.isActive,isOnActivePath:t.row.isOnActivePath},i))}else{let e={kind:`segment`,segment:t.segment};s.push(U5(V5(t.segment.id),{kind:`segment`,selection:e,segment:t.segment,zoomTier:`summary`,isActive:!1,isOnActivePath:t.segment.isOnActivePath},i))}let c=[];for(let e of s){if(e.id===`history-root`)continue;let t=e.data.kind===`entry`?e.data.row.node.entry.parentEntryId:e.data.kind===`segment`?e.data.segment.headParentEntryId:void 0,n=t?o.get(t)??`history-root`:R5;if(n===e.id)continue;let r=e.data.isOnActivePath;c.push({id:`history-edge:${n}->${e.id}`,source:n,target:e.id,type:`default`,data:{isOnActivePath:r},class:r?`history-edge-active`:void 0,selectable:!1,deletable:!1,focusable:!1,ariaLabel:r?`Conversation branch connection on active path`:`Conversation branch connection`})}return{nodes:Kue(s,c),edges:c,visibleNodeIdByEntryId:o}}function Jue(e,t,n){return{...e,nodes:e.nodes.map(e=>({...e,data:{...e.data,zoomTier:t,actions:n}}))}}function Yue(e){return e<.4?`overview`:e<.85?`summary`:`detail`}var Xue=new Set([`$$slots`,`$$events`,`$$legacy`]);function W5(e,t){let n=U(t,Xue),r=[[`path`,{d:`M12 22v-6`}],[`path`,{d:`M12 8V2`}],[`path`,{d:`M4 12H2`}],[`path`,{d:`M10 12H8`}],[`path`,{d:`M16 12h-2`}],[`path`,{d:`M22 12h-2`}],[`path`,{d:`m15 19-3 3-3-3`}],[`path`,{d:`m15 5-3-3-3 3`}]];G(e,V({name:`unfold-vertical`},()=>n,{get iconNode(){return r}}))}var Zue=new Set([`$$slots`,`$$events`,`$$legacy`]);function G5(e,t){let n=U(t,Zue),r=[[`path`,{d:`M12 18V5`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`}]];G(e,V({name:`brain`},()=>n,{get iconNode(){return r}}))}var Que=new Set([`$$slots`,`$$events`,`$$legacy`]);function $ue(e,t){let n=U(t,Que),r=[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`}],[`path`,{d:`m9 14 2 2 4-4`}]];G(e,V({name:`clipboard-check`},()=>n,{get iconNode(){return r}}))}var ede=new Set([`$$slots`,`$$events`,`$$legacy`]);function tde(e,t){let n=U(t,ede),r=[[`path`,{d:`M12 20v2`}],[`path`,{d:`M12 2v2`}],[`path`,{d:`M17 20v2`}],[`path`,{d:`M17 2v2`}],[`path`,{d:`M2 12h2`}],[`path`,{d:`M2 17h2`}],[`path`,{d:`M2 7h2`}],[`path`,{d:`M20 12h2`}],[`path`,{d:`M20 17h2`}],[`path`,{d:`M20 7h2`}],[`path`,{d:`M7 20v2`}],[`path`,{d:`M7 2v2`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`}]];G(e,V({name:`cpu`},()=>n,{get iconNode(){return r}}))}var nde=new Set([`$$slots`,`$$events`,`$$legacy`]);function rde(e,t){let n=U(t,nde),r=[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`}]];G(e,V({name:`file-pen`},()=>n,{get iconNode(){return r}}))}var ide=new Set([`$$slots`,`$$events`,`$$legacy`]);function K5(e,t){let n=U(t,ide),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M9 15h6`}],[`path`,{d:`M12 18v-6`}]];G(e,V({name:`file-plus`},()=>n,{get iconNode(){return r}}))}var ade=new Set([`$$slots`,`$$events`,`$$legacy`]);function q5(e,t){let n=U(t,ade),r=[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`}],[`path`,{d:`m21 21-1.9-1.9`}],[`circle`,{cx:`17`,cy:`17`,r:`3`}]];G(e,V({name:`folder-search`},()=>n,{get iconNode(){return r}}))}var ode=new Set([`$$slots`,`$$events`,`$$legacy`]);function sde(e,t){let n=U(t,ode),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`}],[`path`,{d:`M2 12h20`}]];G(e,V({name:`globe`},()=>n,{get iconNode(){return r}}))}var cde=new Set([`$$slots`,`$$events`,`$$legacy`]);function lde(e,t){let n=U(t,cde),r=[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`}]];G(e,V({name:`hand`},()=>n,{get iconNode(){return r}}))}var ude=new Set([`$$slots`,`$$events`,`$$legacy`]);function J5(e,t){let n=U(t,ude),r=[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}],[`path`,{d:`M12 17h.01`}]];G(e,V({name:`message-circle-question-mark`},()=>n,{get iconNode(){return r}}))}var dde=new Set([`$$slots`,`$$events`,`$$legacy`]);function Y5(e,t){let n=U(t,dde),r=[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`}]];G(e,V({name:`wrench`},()=>n,{get iconNode(){return r}}))}var X5={user:lL,sparkles:Jz,brain:G5,wrench:Y5,"file-text":lf,terminal:Ue,"file-pen":rde,"file-plus":K5,search:H_,"folder-search":q5,"folder-tree":YZ,globe:sde,download:SX,cpu:tde,bot:hX,"message-circle-question":J5,"clipboard-list":u_,"clipboard-check":$ue,"list-todo":lG,"fold-vertical":sv,"git-branch":AL,info:ZZ,hand:lde,"triangle-alert":pW},Z5={default:`text-muted-foreground`,success:`text-success`,warning:`text-warning`,info:`text-info`,danger:`text-destructive`},fde=P(`<div class="flex h-full items-center justify-center p-6 text-center text-xs text-muted-foreground">Select an entry on the left to preview it here.</div>`),pde=P(`<!> New branch from beginning`,1),mde=P(`<div class="flex h-full flex-col gap-4 overflow-y-auto p-5"><div class="flex items-center gap-2 text-primary"><!> <h3 class="text-sm font-semibold text-foreground">Start of conversation</h3></div> <p class="text-sm text-muted-foreground">Branch from the beginning to start a new path. Your next message becomes
149
- the first entry of that branch; the existing history stays available in
150
- the tree.</p> <div><!></div></div>`),hde=P(`<span class="flex items-center gap-1 rounded-full border bg-muted/40 px-2 py-0.5 text-xs text-muted-foreground"><!> <span class="font-medium text-foreground"> </span> </span>`),gde=P(`<!> Expand in tree`,1),_de=P(`<button class="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted/60" type="button"><span><!></span> <span class="shrink-0 text-xs font-medium text-foreground"> </span> <span> </span></button>`),vde=P(`<div class="flex h-full flex-col gap-4 overflow-y-auto p-5"><div class="flex flex-col gap-1"><h3 class="text-sm font-semibold text-foreground"> </h3> <p class="text-xs text-muted-foreground"> </p></div> <div class="flex flex-wrap gap-1.5"></div> <div class="flex"><!></div> <div class="flex flex-col gap-0.5 border-t pt-3"></div></div>`),yde=P(`<span><!> <!></span>`),bde=P(`<span class="flex items-center gap-1"><!> </span>`),xde=P(`<!> Branch from here`,1),Sde=P(`<!> Edit & resend`,1),Cde=P(`<span class="rounded-full border px-1.5 py-0.5"> </span>`),wde=P(`<div class="flex items-center gap-2 text-xs text-muted-foreground"><span class="font-medium text-foreground">Tool</span> <span class="font-mono"> </span> <!></div>`),Tde=P(`<div class="flex flex-col gap-1"><span class="text-xs font-medium text-muted-foreground">Arguments</span> <pre class="overflow-x-auto rounded-md border bg-muted/40 p-3 font-mono text-xs whitespace-pre-wrap break-words"> </pre></div>`),Ede=P(`<div class="flex flex-col gap-1"><span class="text-xs font-medium text-muted-foreground">Result</span> <pre class="overflow-x-auto rounded-md border bg-muted/40 p-3 font-mono text-xs whitespace-pre-wrap break-words"> </pre></div>`),Dde=P(`<div class="flex flex-col gap-1"><span class="text-xs font-medium text-destructive">Error</span> <pre class="overflow-x-auto rounded-md border border-destructive/40 bg-destructive/10 p-3 font-mono text-xs whitespace-pre-wrap break-words"> </pre></div>`),Ode=P(`<p class="text-xs text-muted-foreground">No tool details available for this entry.</p>`),kde=P(`<div class="flex flex-col gap-3"><!> <!> <!> <!> <!></div>`),Ade=P(`<div class="text-sm text-muted-foreground"><!></div>`),jde=P(`<div class="mt-4 border-t pt-3 text-sm text-muted-foreground"><span class="mb-1 block text-xs font-medium">Thinking</span> <!></div>`),Mde=P(`<div class="text-sm text-foreground"><!></div> <!>`,1),Nde=P(`<p class="text-xs text-muted-foreground">This entry has no text content.</p>`),Pde=P(`<div class="flex h-full flex-col"><div class="flex flex-col gap-3 border-b p-5"><div class="flex items-center gap-2"><span><!></span> <h3 class="text-sm font-semibold text-foreground"> </h3> <!></div> <div class="flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground"><span> </span> <!> <button class="flex min-w-0 max-w-full items-center gap-1 font-mono hover:text-foreground" type="button" aria-label="Copy entry id"><!> <span class="truncate"> </span></button></div> <div class="flex flex-wrap gap-2"><!> <!></div></div> <div class="min-h-0 flex-1 overflow-y-auto p-5"><!></div></div>`);function Fde(e,t){x(t,!0);let n=l(()=>t.selection?.kind===`entry`?t.selection.row.node.entry:void 0),r=l(()=>L(n)?E8(L(n),t.toolCallsById):void 0),i=l(()=>L(r)?.descriptor),a=l(()=>L(r)?.record);async function o(e){try{await vf(e),yi.success(`Copied entry id`)}catch{yi.error(`Could not copy to clipboard`)}}var s=_(),c=F(s),u=e=>{q(e,fde())},m=e=>{var n=mde(),r=B(n);AL(B(r),{class:`size-5`,strokeWidth:2}),g(2),y(r);var i=Y(r,4);W(B(i),{size:`sm`,onclick:()=>t.onNavigateToEntry?.(void 0),children:(e,t)=>{var n=pde();AL(F(n),{class:`size-4`,strokeWidth:2}),g(),q(e,n)},$$slots:{default:!0}}),y(i),y(n),q(e,n)},h=e=>{let n=l(()=>t.selection.segment);var r=vde(),i=B(r),a=B(i),o=B(a);y(a);var s=Y(a,2),c=B(s);y(s),y(i);var u=Y(i,2);O(u,21,()=>L(n).parts,Le,(e,t)=>{let n=l(()=>X5[L(t).icon]);var r=hde(),i=B(r);d(i,()=>L(n),(e,t)=>{t(e,{class:`size-3.5`,strokeWidth:2})});var a=Y(i,2),o=B(a,!0);y(a);var s=Y(a);y(r),J(()=>{f(o,L(t).count),f(s,` ${L(t).label??``}`)}),q(e,r)}),y(u);var p=Y(u,2);W(B(p),{variant:`outline`,size:`sm`,onclick:()=>t.onExpandSegment?.(L(n).id),children:(e,t)=>{var n=gde();W5(F(n),{class:`size-4`,strokeWidth:2}),g(),q(e,n)},$$slots:{default:!0}}),y(p);var m=Y(p,2);O(m,21,()=>L(n).rows,e=>e.node.entry.id,(e,n)=>{let r=l(()=>E8(L(n).node.entry,t.toolCallsById).descriptor),i=l(()=>X5[L(r).icon]);var a=_de(),o=B(a);d(B(o),()=>L(i),(e,t)=>{t(e,{class:`size-3.5`,strokeWidth:2})}),y(o);var s=Y(o,2),c=B(s,!0);y(s);var u=Y(s,2);let p;var m=B(u,!0);y(u),y(a),J(()=>{w(o,1,`flex size-4 shrink-0 items-center justify-center ${Z5[L(r).tone]}`),f(c,L(r).label),p=w(u,1,`min-w-0 flex-1 truncate text-xs text-muted-foreground`,null,p,{"font-mono":L(r).mono}),f(m,L(r).preview)}),le(`click`,a,()=>t.onSelectRow?.(L(n))),q(e,a)}),y(m),y(r),J((e,t)=>{f(o,`${L(n).total??``} collapsed steps`),f(c,`${e??``} — ${t??``}`)},[()=>fL(L(n).startedAt),()=>fL(L(n).endedAt)]),q(e,r)},v=e=>{let s=l(()=>X5[L(i).icon]),c=l(()=>L(r)?.thinkingText??``);var u=Pde(),m=B(u),h=B(m),_=B(h);d(B(_),()=>L(s),(e,t)=>{t(e,{class:`size-5`,strokeWidth:2})}),y(_);var v=Y(_,2),b=B(v,!0);y(v),O(Y(v,2),17,()=>L(i).badges,Le,(e,t)=>{let n=l(()=>X5[L(t).icon]);var r=yde(),i=B(r);d(i,()=>L(n),(e,t)=>{t(e,{class:`size-3.5`,strokeWidth:2})});var a=Y(i,2),o=e=>{var n=D();J(()=>f(n,L(t).label)),q(e,n)};p(a,e=>{L(t).label&&e(o)}),y(r),J(()=>{w(r,1,`flex items-center gap-0.5 text-xs ${Z5[L(t).tone]}`),A(r,`title`,L(t).title??L(t).label)}),q(e,r)}),y(h);var x=Y(h,2),S=B(x),C=B(S);y(S);var T=Y(S,2),E=e=>{var t=bde(),r=B(t);Jz(r,{class:`size-3.5`,strokeWidth:2});var i=Y(r);y(t),J(e=>f(i,` ${e??``} tokens`),[()=>L(n).usage.totalTokens.toLocaleString()]),q(e,t)};p(T,e=>{L(n).usage?.totalTokens&&e(E)});var k=Y(T,2),ee=B(k);af(ee,{class:`size-3 shrink-0`,strokeWidth:2});var j=Y(ee,2),M=B(j,!0);y(j),y(k),y(x);var N=Y(x,2),te=B(N);W(te,{size:`sm`,onclick:()=>t.onNavigateToEntry?.(L(n).id),children:(e,t)=>{var n=xde();AL(F(n),{class:`size-4`,strokeWidth:2}),g(),q(e,n)},$$slots:{default:!0}});var ne=Y(te,2),P=e=>{W(e,{variant:`outline`,size:`sm`,onclick:()=>t.onEditEntry?.(L(n)),children:(e,t)=>{var n=Sde();gy(F(n),{class:`size-4`,strokeWidth:2}),g(),q(e,n)},$$slots:{default:!0}})};p(ne,e=>{L(n).role===`user`&&e(P)}),y(N),y(m);var re=Y(m,2),ie=B(re),I=e=>{var t=kde(),n=B(t),i=e=>{var t=wde(),n=Y(B(t),2),i=B(n,!0);y(n);var o=Y(n,2),s=e=>{var t=Cde(),n=B(t,!0);y(t),J(()=>f(n,L(a).status)),q(e,t)};p(o,e=>{L(a)?.status&&e(s)}),y(t),J(()=>f(i,L(r).toolName)),q(e,t)};p(n,e=>{L(r).toolName&&e(i)});var o=Y(n,2),s=e=>{var t=Tde(),n=Y(B(t),2),i=B(n,!0);y(n),y(t),J(()=>f(i,L(r).argsText)),q(e,t)};p(o,e=>{L(r).argsText&&e(s)});var c=Y(o,2),l=e=>{var t=Ede(),n=Y(B(t),2),i=B(n,!0);y(n),y(t),J(()=>f(i,L(r).resultText)),q(e,t)};p(c,e=>{L(r).resultText&&e(l)});var u=Y(c,2),d=e=>{var t=Dde(),n=Y(B(t),2),i=B(n,!0);y(n),y(t),J(()=>f(i,L(r).errorText)),q(e,t)};p(u,e=>{L(r).errorText&&e(d)});var m=Y(u,2),h=e=>{q(e,Ode())};p(m,e=>{!L(r).argsText&&!L(r).resultText&&!L(r).errorText&&e(h)}),y(t),q(e,t)},ae=e=>{var t=Ade();Pj(B(t),{get text(){return L(c)}}),y(t),q(e,t)},R=e=>{var t=Mde(),r=F(t),i=B(r),a=e=>{{let t=l(()=>L(n).summary||L(n).text);xy(e,{get text(){return L(t)}})}},o=e=>{{let t=l(()=>L(n).summary||L(n).text),r=l(()=>L(n).role!==`assistant`);Pj(e,{get text(){return L(t)},get trimCodeBlocks(){return L(r)}})}};p(i,e=>{L(n).role===`user`?e(a):e(o,-1)}),y(r);var s=Y(r,2),u=e=>{var t=jde();Pj(Y(B(t),2),{get text(){return L(c)}}),y(t),q(e,t)};p(s,e=>{L(c)&&e(u)}),q(e,t)},oe=e=>{q(e,Nde())};p(ie,e=>{L(r)?.isToolEntry?e(I):L(c)&&!L(n).text?e(ae,1):L(n).summary||L(n).text?e(R,2):e(oe,-1)}),y(re),y(u),J((e,t)=>{w(_,1,`flex size-5 shrink-0 items-center justify-center ${Z5[L(i).tone]}`),f(b,L(i).label),A(S,`title`,e),f(C,`${t??``} ago`),A(k,`title`,L(n).id),f(M,L(n).id)},[()=>fL(L(n).createdAt),()=>dL(L(n).createdAt)]),le(`click`,k,()=>o(L(n).id)),q(e,u)};p(c,e=>{t.selection?t.selection.kind===`root`?e(m,1):t.selection.kind===`segment`?e(h,2):L(n)&&L(i)&&e(v,3):e(u)}),q(e,s),H()}r([`click`]);var Ide=new Set([`$$slots`,`$$events`,`$$legacy`]);function Lde(e,t){let n=U(t,Ide),r=[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`}],[`circle`,{cx:`12`,cy:`12`,r:`7`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]];G(e,V({name:`locate-fixed`},()=>n,{get iconNode(){return r}}))}var Rde=new Set([`$$slots`,`$$events`,`$$legacy`]);function zde(e,t){let n=U(t,Rde),r=[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`}]];G(e,V({name:`scan`},()=>n,{get iconNode(){return r}}))}var Bde=new Set([`$$slots`,`$$events`,`$$legacy`]);function Q5(e,t){let n=U(t,Bde),r=[[`circle`,{cx:`11`,cy:`11`,r:`8`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`}]];G(e,V({name:`zoom-in`},()=>n,{get iconNode(){return r}}))}var Vde=new Set([`$$slots`,`$$events`,`$$legacy`]);function $5(e,t){let n=U(t,Vde),r=[[`circle`,{cx:`11`,cy:`11`,r:`8`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`}]];G(e,V({name:`zoom-out`},()=>n,{get iconNode(){return r}}))}var Hde=P(`<span class="mx-0.5 h-5 w-px bg-border" aria-hidden="true"></span> <!>`,1),Ude=P(`<div class="nopan flex items-center gap-1 rounded-md border bg-card p-1 shadow-sm" aria-label="Conversation graph controls"><!> <!> <!> <!> <!></div>`);function Wde(e,t){x(t,!0);let{fitView:n,getNode:r,getZoom:i,setCenter:a,zoomIn:o,zoomOut:s}=d8(),c=0,u=0;function d(){n({padding:.12,minZoom:.12,maxZoom:1,duration:200})}function f(){let e=r(t.activeNodeId);e&&n({nodes:[e],padding:.8,maxZoom:1,duration:200})}z(()=>{t.fitRequest<=c||(c=t.fitRequest,queueMicrotask(d))}),z(()=>{!t.centerRequest||t.centerRequest.serial<=u||(u=t.centerRequest.serial,queueMicrotask(()=>{let e=r(t.centerRequest.id);if(!e)return;let n=e.measured?.width??e.initialWidth??0,o=e.measured?.height??e.initialHeight??0;a(e.position.x+n/2,e.position.y+o/2,{zoom:i(),duration:180})}))}),p8(e,{position:`top-left`,children:(e,n)=>{var r=Ude(),i=B(r);W(i,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Zoom in`,title:`Zoom in`,onclick:()=>void o({duration:120}),children:(e,t)=>{Q5(e,{class:`size-4`,strokeWidth:2})},$$slots:{default:!0}});var a=Y(i,2);W(a,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Zoom out`,title:`Zoom out`,onclick:()=>void s({duration:120}),children:(e,t)=>{$5(e,{class:`size-4`,strokeWidth:2})},$$slots:{default:!0}});var c=Y(a,2);W(c,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Fit entire graph`,title:`Fit entire graph`,onclick:d,children:(e,t)=>{zde(e,{class:`size-4`,strokeWidth:2})},$$slots:{default:!0}});var u=Y(c,2);W(u,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Focus active entry`,title:`Focus active entry`,onclick:f,children:(e,t)=>{Lde(e,{class:`size-4`,strokeWidth:2})},$$slots:{default:!0}});var m=Y(u,2),h=e=>{var n=Hde(),r=Y(F(n),2);{let e=l(()=>t.allExpanded?`Collapse all tool runs`:`Expand all tool runs`),n=l(()=>t.allExpanded?`Collapse all tool runs`:`Expand all tool runs`);W(r,{variant:`ghost`,size:`icon-sm`,get ariaLabel(){return L(e)},get title(){return L(n)},get onclick(){return t.onToggleAll},children:(e,n)=>{var r=_(),i=F(r),a=e=>{sv(e,{class:`size-4`,strokeWidth:2})},o=e=>{W5(e,{class:`size-4`,strokeWidth:2})};p(i,e=>{t.allExpanded?e(a):e(o,-1)}),q(e,r)},$$slots:{default:!0}})}q(e,n)};p(m,e=>{t.hasSegments&&e(h)}),y(r),q(e,r)},$$slots:{default:!0}}),H()}var Gde=P(`<span><!></span>`),Kde=P(`<span class="flex size-10 items-center justify-center rounded-full border border-dashed bg-card text-muted-foreground"><!></span>`),qde=P(`<span class="flex size-10 items-center justify-center rounded-full border bg-card text-primary"><!></span>`),Jde=P(`<div class="flex h-full items-center justify-center"><!></div>`),Yde=P(`<div class="flex h-full items-center gap-3 px-4"><span class="flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary"><!></span> <div class="min-w-0"><p class="text-sm font-semibold">Start of conversation</p> <p class="truncate text-xs text-muted-foreground">Fork a new branch from the beginning</p></div></div>`),Xde=P(`<span class="rounded-full border bg-muted/40 px-1.5 py-0.5 text-xs text-muted-foreground"> </span>`),Zde=P(`<div class="flex flex-wrap gap-1 overflow-hidden"></div>`),Qde=P(`<div class="flex h-full flex-col justify-center gap-2 px-4 py-3"><div class="flex items-center gap-2"><span class="flex size-7 shrink-0 items-center justify-center rounded-full border border-dashed text-muted-foreground"><!></span> <div class="min-w-0 flex-1"><p class="text-sm font-semibold"> </p> <p class="truncate text-xs text-muted-foreground"> </p></div> <!></div> <!></div>`),$de=P(`<span><!> <!></span>`),efe=P(`<span class="truncate font-mono"> </span>`),tfe=P(`<pre> </pre>`),nfe=P(`<p> </p>`),rfe=P(`<div class="flex items-center justify-end gap-1 border-t px-2 py-1.5"><!> <!></div>`),ife=P(`<div class="flex items-center gap-2 border-b px-3 py-2.5"><span><!></span> <div class="min-w-0 flex-1"><div class="flex items-center gap-1.5"><span class="font-mono text-xs text-muted-foreground/60"> </span> <p class="truncate text-sm font-semibold"> </p> <!></div> <div class="flex items-center gap-2 text-xs text-muted-foreground"><span> </span> <!></div></div></div> <div class="min-h-0 flex-1 px-3 py-2.5"><!></div> <!>`,1),afe=P(`<div role="group"><!> <!> <!></div>`);function ofe(e,t){x(t,!0);let n=e=>{var n=afe();let a;var o=B(n),c=e=>{W6(e,{type:`target`,get position(){return y3.Top},isConnectable:!1})};p(o,e=>{t.data.kind!==`root`&&e(c)});var u=Y(o,2),m=e=>{var n=Jde(),r=B(n),i=e=>{let n=l(()=>X5[t.data.view.descriptor.icon]);var r=Gde();d(B(r),()=>L(n),(e,t)=>{t(e,{class:`size-5`,strokeWidth:2})}),y(r),J(()=>w(r,1,`flex size-10 items-center justify-center rounded-full border bg-card ${Z5[t.data.view.descriptor.tone]}`)),q(e,r)},a=e=>{var t=Kde();W5(B(t),{class:`size-5`,strokeWidth:2}),y(t),q(e,t)},o=e=>{var t=qde();AL(B(t),{class:`size-5`,strokeWidth:2}),y(t),q(e,t)};p(r,e=>{t.data.kind===`entry`?e(i):t.data.kind===`segment`?e(a,1):e(o,-1)}),y(n),q(e,n)},h=e=>{var t=Yde(),n=B(t);AL(B(n),{class:`size-4`,strokeWidth:2}),y(n),g(2),y(t),q(e,t)},_=e=>{var n=Qde(),r=B(n),a=B(r);W5(B(a),{class:`size-4`,strokeWidth:2}),y(a);var o=Y(a,2),s=B(o),c=B(s);y(s);var l=Y(s,2),u=B(l,!0);y(l),y(o),W(Y(o,2),{class:`nodrag nopan`,variant:`ghost`,size:`icon-xs`,ariaLabel:`Expand collapsed steps`,title:`Expand collapsed steps`,onclick:e=>{i(e),t.data.actions?.onToggleSegment(t.data.segment)},children:(e,t)=>{W5(e,{class:`size-3.5`,strokeWidth:2})},$$slots:{default:!0}}),y(r);var d=Y(r,2),m=e=>{var n=Zde();O(n,21,()=>t.data.segment.parts.slice(0,4),e=>e.label,(e,t)=>{var n=Xde(),r=B(n);y(n),J(()=>f(r,`${L(t).count??``} ${L(t).label??``}`)),q(e,n)}),y(n),q(e,n)};p(d,e=>{t.data.zoomTier===`detail`&&e(m)}),y(n),J(e=>{f(c,`${t.data.segment.total??``} collapsed steps`),f(u,e)},[()=>t.data.segment.parts.map(e=>`${e.count} ${e.label}`).join(` · `)]),q(e,n)},v=e=>{let n=l(()=>t.data.view.descriptor),r=l(()=>X5[L(n).icon]);var a=ife(),o=F(a),c=B(o);d(B(c),()=>L(r),(e,t)=>{t(e,{class:`size-4`,strokeWidth:2})}),y(c);var u=Y(c,2),m=B(u),h=B(m),g=B(h,!0);y(h);var _=Y(h,2),v=B(_,!0);y(_),O(Y(_,2),17,()=>L(n).badges,Le,(e,t)=>{let n=l(()=>X5[L(t).icon]);var r=$de(),i=B(r);d(i,()=>L(n),(e,t)=>{t(e,{class:`size-3`,strokeWidth:2})});var a=Y(i,2),o=e=>{var n=D();J(()=>f(n,L(t).label)),q(e,n)};p(a,e=>{L(t).label&&e(o)}),y(r),J(()=>{w(r,1,`flex shrink-0 items-center gap-0.5 text-xs ${Z5[L(t).tone]}`),A(r,`title`,L(t).title??L(t).label)}),q(e,r)}),y(m);var b=Y(m,2),x=B(b),S=B(x);y(x);var C=Y(x,2),T=e=>{var n=efe(),r=B(n,!0);y(n),J(()=>f(r,t.data.view.record.status)),q(e,n)};p(C,e=>{t.data.view.record?.status&&e(T)}),y(b),y(u),y(o);var E=Y(o,2),k=B(E),ee=e=>{var r=tfe();let i;var a=B(r,!0);y(r),J(()=>{i=w(r,1,`line-clamp-5 font-sans text-xs leading-relaxed whitespace-pre-wrap break-words text-foreground`,null,i,{"font-mono":L(n).mono}),f(a,t.data.view.detailPreview)}),q(e,r)},j=e=>{var t=nfe();let r;var i=B(t,!0);y(t),J(()=>{r=w(t,1,`line-clamp-3 text-xs leading-relaxed text-muted-foreground`,null,r,{"font-mono":L(n).mono}),f(i,L(n).preview||`No preview available`)}),q(e,t)};p(k,e=>{t.data.zoomTier===`detail`?e(ee):e(j,-1)}),y(E);var M=Y(E,2),N=e=>{var n=rfe(),r=B(n);W(r,{class:`nodrag nopan`,variant:`ghost`,size:`icon-xs`,ariaLabel:`Branch from here`,title:`Branch from here`,onclick:e=>{i(e),s(t.data)},children:(e,t)=>{AL(e,{class:`size-3.5`,strokeWidth:2})},$$slots:{default:!0}});var a=Y(r,2),o=e=>{W(e,{class:`nodrag nopan`,variant:`ghost`,size:`icon-xs`,ariaLabel:`Edit and resend`,title:`Edit and resend`,onclick:e=>{i(e),t.data.actions?.onEditEntry?.(t.data.row.node.entry)},children:(e,t)=>{gy(e,{class:`size-3.5`,strokeWidth:2})},$$slots:{default:!0}})};p(a,e=>{t.data.row.node.entry.role===`user`&&e(o)}),y(n),q(e,n)};p(M,e=>{t.data.zoomTier===`detail`&&e(N)}),J((e,t)=>{w(c,1,`flex size-7 shrink-0 items-center justify-center rounded-md bg-muted/50 ${Z5[L(n).tone]}`),f(g,e),f(v,L(n).label),f(S,`${t??``} ago`)},[()=>String(t.data.row.index).padStart(2,`0`),()=>dL(t.data.row.node.entry.createdAt)]),q(e,a)};p(u,e=>{t.data.zoomTier===`overview`?e(m):t.data.kind===`root`?e(h,1):t.data.kind===`segment`?e(_,2):e(v,-1)});var b=Y(u,2),x=e=>{W6(e,{type:`source`,get position(){return y3.Bottom},isConnectable:!1})};p(b,e=>{(t.data.kind===`root`||t.data.kind===`segment`||t.data.kind===`entry`&&!t.data.row.isLeaf)&&e(x)}),y(n),J(()=>a=w(n,1,`relative flex ${L(r)} cursor-pointer flex-col overflow-hidden rounded-lg border bg-card text-foreground shadow-sm transition-[border-color,box-shadow,opacity]`,null,a,{"border-primary":t.data.isOnActivePath,"border-border":!t.data.isOnActivePath,"ring-2":t.selected,"ring-ring":t.selected,"opacity-65":!t.data.isOnActivePath&&!t.selected})),le(`dblclick`,n,()=>s(t.data)),q(e,n)},r=l(()=>t.data.kind===`entry`?`h-48 w-80`:t.data.kind===`segment`?`h-28 w-80`:`h-20 w-80`);function i(e){e.stopPropagation()}async function a(e){try{await vf(e),yi.success(`Copied entry id`)}catch{yi.error(`Could not copy to clipboard`)}}function o(e){let t=e.row.node.entry,n=[{label:`Branch from here`,icon:AL,onSelect:()=>e.actions?.onNavigateToEntry?.(t.id)}];return t.role===`user`&&n.push({label:`Edit & resend`,icon:gy,onSelect:()=>e.actions?.onEditEntry?.(t)}),n.push({type:`separator`},{label:`Copy entry id`,icon:af,onSelect:()=>a(t.id)}),n}function s(e){e.kind===`entry`?e.actions?.onNavigateToEntry?.(e.row.node.entry.id):e.kind===`root`&&e.actions?.onNavigateToEntry?.(void 0)}var c=_(),u=F(c),m=e=>{{let r=l(()=>o(t.data));zr(e,{get items(){return L(r)},triggerClass:`block h-full w-full`,children:(e,t)=>{n(e)},$$slots:{default:!0}})}},h=e=>{n(e)};p(u,e=>{t.data.kind===`entry`?e(m):e(h,-1)}),q(e,c),H()}r([`dblclick`]);var sfe=new Set([`assistant`,`tool_call`,`tool_result`,`system`]);function cfe(e,t,n){let r=t[e[0]],i=t[e[e.length-1]],a=new Map;for(let t of e){let e=n[t],r=a.get(e.label);r?r.count+=1:a.set(e.label,{icon:e.icon,label:e.label,count:1})}return{id:r.node.entry.id,headParentEntryId:r.node.entry.parentEntryId,rows:e.map(e=>t[e]),isOnActivePath:e.some(e=>t[e].isOnActivePath),total:e.length,parts:[...a.values()].sort((e,t)=>t.count-e.count),startedAt:r.node.entry.createdAt,endedAt:i.node.entry.createdAt}}function lfe(e,t,n){let r=e.map(e=>C8(e.node.entry,t)),i=t=>{let n=e[t];return!n.isActive&&!n.isLeaf&&!n.isBranchPoint&&sfe.has(r[t].type)},a=[],o=[],s=()=>{o.length&&(a.push({kind:`run`,indices:o}),o=[])};for(let t=0;t<e.length;t++){if(!i(t)){s(),a.push({kind:`row`,index:t});continue}let n=o.at(-1),r=n===void 0?void 0:e[n],c=r!==void 0&&e[t].node.entry.parentEntryId===r.node.entry.id;o.length&&!c&&s(),o.push(t)}s();let c=[],l=[],u=new Map,d=t=>{u.set(e[t].node.entry.id,c.length),c.push({type:`entry`,row:e[t]})};for(let t of a){if(t.kind===`row`){d(t.index);continue}if(t.indices.length<3){for(let e of t.indices)d(e);continue}let i=cfe(t.indices,e,r);if(l.push(i),n.has(i.id))for(let e of t.indices)d(e);else{let n=c.length;c.push({type:`segment`,segment:i});for(let r of t.indices)u.set(e[r].node.entry.id,n)}}return{items:c,visibleIndexById:u,segments:l}}function ufe(e){switch(e.kind){case`root`:return`root`;case`entry`:return`e:${e.row.node.entry.id}`;case`segment`:return`s:${e.segment.id}`}}var dfe=P(`<!> <!> <!>`,1),ffe=P(`<aside class="flex min-w-80 w-1/3 max-w-md shrink-0 flex-col overflow-hidden border-l bg-card max-[900px]:absolute max-[900px]:inset-y-0 max-[900px]:right-0 max-[900px]:z-10 max-[900px]:w-[min(24rem,70%)] max-[900px]:shadow-lg max-[640px]:w-full max-[640px]:min-w-0 max-[640px]:max-w-none" aria-label="Conversation entry details"><div class="flex items-center justify-between border-b px-3 py-2"><span class="text-xs font-medium text-muted-foreground">Entry details</span> <!></div> <div class="min-h-0 flex-1 overflow-hidden"><!></div></aside>`),pfe=P(`<div class="flex h-full min-h-0"><div class="relative min-w-0 flex-1"><!></div> <!></div>`),mfe=P(`<div class="flex h-full items-center justify-center p-6 text-center text-sm text-muted-foreground">No conversation history loaded.</div>`),hfe=P(`<div class="history-graph relative h-full min-h-0 overflow-hidden bg-transparent svelte-xljnpe"><!></div>`);function gfe(e,t){x(t,!0);let n=K(t,`treeNodes`,19,()=>[]),r=K(t,`toolCalls`,19,()=>[]),i={history:ofe},a=l(()=>new Map(r().map(e=>[e.id,e]))),o=l(()=>gce(n(),t.activeConversation?.activeEntryId)),s=l(()=>!!t.activeConversation),c=l(()=>!!(t.activeConversation&&!t.activeConversation.activeEntryId)),u=l(()=>L(c)||L(o).rows.some(e=>e.isOnActivePath)),d=l(()=>new Map(n().map(({entry:e})=>[e.id,E8(e,L(a))]))),f=X(Ie(new Set)),m=X(void 0),h=X(!1),g=X(`summary`),_=X(0),v=X(0),b=X(void 0),S=X(!1),C=l(()=>lfe(L(o).rows,L(a),L(f))),w=l(()=>L(m)?ufe(L(m)):``),T=l(()=>L(C).segments.length>0&&L(C).segments.every(e=>L(f).has(e.id))),E=l(()=>que({visible:L(C),hasConversation:L(s),rootActive:L(c),rootOnActivePath:L(u),selectedKey:L(w),entryViewById:L(d)})),D=l(()=>({onToggleSegment:te,onNavigateToEntry:t.onNavigateToEntry,onEditEntry:t.onEditEntry})),O=l(()=>Jue(L(E),L(g),L(D))),k=l(()=>t.activeConversation?.activeEntryId?L(E).visibleNodeIdByEntryId.get(t.activeConversation.activeEntryId)??B5(t.activeConversation.activeEntryId):R5),A;z(()=>{let e=t.activeConversation?.id;if(e===A)return;A=e,R(f,new Set,!0),R(h,!1),e||R(S,!1);let n=t.activeConversation?.activeEntryId,r=n?L(o).rows.find(e=>e.node.entry.id===n):void 0;R(m,t.activeConversation?r?{kind:`entry`,row:r}:{kind:`root`}:void 0,!0),R(_,L(_)+1)});function j(e){R(b,{id:e,serial:ee(v)},!0)}function M(e){R(m,e,!0),R(h,!0)}function N(e){return L(C).segments.find(t=>t.rows.some(t=>t.node.entry.id===e))}function te(e){let t=new je(L(f));if(t.has(e.id)){t.delete(e.id);let n=L(m)?.kind===`entry`?L(m).row.node.entry.id:void 0;n&&e.rows.some(e=>e.node.entry.id===n)&&R(m,{kind:`segment`,segment:e},!0),R(f,t,!0),j(`history-segment:${e.id}`);return}t.add(e.id),R(f,t,!0);let n=e.rows[0];n&&R(m,{kind:`entry`,row:n},!0),j(n?B5(n.node.entry.id):L(k))}function ne(){if(L(T)){let e=L(m)?.kind===`entry`?N(L(m).row.node.entry.id):void 0;R(f,new Set,!0),e&&(R(m,{kind:`segment`,segment:e},!0),j(`history-segment:${e.id}`));return}if(R(f,new Set(L(C).segments.map(e=>e.id)),!0),L(m)?.kind===`segment`){let e=L(m).segment.rows[0];e&&(R(m,{kind:`entry`,row:e},!0),j(B5(e.node.entry.id)))}}function P(e){let t=L(C).segments.find(t=>t.id===e);t&&!L(f).has(e)&&te(t)}function re(e){let t=N(e.node.entry.id);if(t&&!L(f).has(t.id)){let e=new je(L(f));e.add(t.id),R(f,e,!0)}R(m,{kind:`entry`,row:e},!0),j(B5(e.node.entry.id))}function ie(e,t){let n=Yue(t.zoom);n!==L(g)&&R(g,n,!0)}function I(e){M(e.data.selection)}function ae(e){!L(S)||e.length!==1||M(e[0].data.selection)}function oe(e){return e.data.isActive||e.data.isOnActivePath?`var(--primary)`:`var(--muted-foreground)`}var se=hfe(),ce=B(se),le=e=>{var n=pfe(),r=B(n);Jse(B(r),{get nodes(){return L(O).nodes},get edges(){return L(O).edges},get nodeTypes(){return i},minZoom:.12,maxZoom:1.75,onlyRenderVisibleElements:!0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,nodesFocusable:!0,edgesFocusable:!1,selectionOnDrag:!1,selectNodesOnDrag:!1,deleteKey:null,multiSelectionKey:null,zoomOnDoubleClick:!1,onmove:ie,onnodeclick:({node:e})=>I(e),onselectionchange:({nodes:e})=>ae(e),onpaneclick:()=>R(h,!1),oninit:()=>queueMicrotask(()=>{R(S,!0)}),children:(e,t)=>{var n=dfe(),r=F(n);tce(r,{gap:24,size:1});var i=Y(r,2);uce(i,{position:`bottom-left`,pannable:!0,zoomable:!0,nodeColor:oe,nodeStrokeColor:oe,nodeStrokeWidth:2,nodeBorderRadius:6,ariaLabel:`Conversation graph minimap`});var a=Y(i,2);{let e=l(()=>L(C).segments.length>0);Wde(a,{get activeNodeId(){return L(k)},get hasSegments(){return L(e)},get allExpanded(){return L(T)},onToggleAll:ne,get fitRequest(){return L(_)},get centerRequest(){return L(b)}})}q(e,n)},$$slots:{default:!0}}),y(r);var o=Y(r,2),s=e=>{var n=ffe(),r=B(n);W(Y(B(r),2),{variant:`ghost`,size:`icon-xs`,ariaLabel:`Close details`,title:`Close details`,onclick:()=>R(h,!1),children:(e,t)=>{li(e,{class:`size-3.5`,strokeWidth:2})},$$slots:{default:!0}}),y(r);var i=Y(r,2);Fde(B(i),{get selection(){return L(m)},get toolCallsById(){return L(a)},get onNavigateToEntry(){return t.onNavigateToEntry},get onEditEntry(){return t.onEditEntry},onSelectRow:re,onExpandSegment:P}),y(i),y(n),q(e,n)};p(o,e=>{L(h)&&L(m)&&e(s)}),y(n),q(e,n)},ue=e=>{q(e,mfe())};p(ce,e=>{L(s)?e(le):e(ue,-1)}),y(se),q(e,se),H()}var _fe=P(`<div data-tour-id="conversation-history" class="h-full min-h-0"><!></div>`);function vfe(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=K(t,`treeNodes`,19,()=>[]),i=K(t,`toolCalls`,19,()=>[]);function a(e){n(e),t.onOpenChange?.(e)}function o(e){t.onNavigateToEntry?.(e),n(!1),t.onOpenChange?.(!1)}function s(e){t.onEditEntry?.(e),n(!1),t.onOpenChange?.(!1)}IF(e,{flush:!0,size:`viewport`,title:`Conversation history`,description:`Explore branches, inspect message and tool details, then branch from any point.`,onOpenChange:a,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var a=_fe();gfe(B(a),{get activeConversation(){return t.activeConversation},get treeNodes(){return r()},get toolCalls(){return i()},onNavigateToEntry:o,onEditEntry:s}),y(a),q(e,a)},$$slots:{default:!0}}),H()}var yfe=P(`<!> `,1),bfe=P(`<!> Open`,1),xfe=P(`<div class="flex min-w-0 flex-1 items-center gap-1.5 text-muted-foreground"><!> <span class="min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-mono text-xs text-foreground"> </span> <span class="flex flex-none items-center gap-1"></span></div> <div class="flex flex-none items-center gap-2.5"><!></div>`,1);function Sfe(e,t){x(t,!0);let n=K(t,`signals`,19,()=>[]),r=K(t,`loading`,3,!1);var i=xfe(),a=F(i),o=B(a);ri(o,{size:14,strokeWidth:2.1,"aria-hidden":`true`,class:`flex-none text-primary`});var s=Y(o,2),c=B(s,!0);y(s);var u=Y(s,2);O(u,20,n,e=>e,(e,n)=>{let r=l(()=>t.signalMeta[n]),i=l(()=>L(r).icon);{let t=l(()=>L(r).tone??`neutral`);nP(e,{get tone(){return L(t)},size:`xs`,get title(){return L(r).title},children:(e,t)=>{var n=yfe(),a=F(n);d(a,()=>L(i),(e,t)=>{t(e,{size:11,strokeWidth:2.2})});var o=Y(a,1,!0);J(()=>f(o,L(r).label)),q(e,n)},$$slots:{default:!0}})}}),y(u),y(a);var p=Y(a,2),m=B(p);{let e=l(()=>!t.path||r()),n=l(()=>t.path?`Open ${t.path}`:`Open`);W(m,{size:`sm`,get disabled(){return L(e)},get title(){return L(n)},get onclick(){return t.onOpen},children:(e,t)=>{var n=bfe();ri(F(n),{size:14,strokeWidth:2.2}),g(),q(e,n)},$$slots:{default:!0}})}y(p),J(e=>{A(a,`title`,t.path),f(c,e)},[()=>t.path?Tp(t.path,t.homeDir):`—`]),q(e,i),H()}var Cfe=P(`<span class="skeleton-row svelte-cb8hzu"></span>`),wfe=P(`<div class="grid gap-0.5" aria-label="Loading directories"></div>`),Tfe=P(`<!>Opened`,1),Efe=P(`<!> `,1),Dfe=P(`<span class="flex items-center justify-end gap-1.5"><!> <!></span>`),Ofe=P(`<div role="option" tabindex="-1"><!> <span class="grid min-w-0 flex-1 gap-px"><strong class="overflow-hidden text-sm font-medium text-ellipsis whitespace-nowrap"> </strong></span> <!></div>`),kfe=P(`<div class="grid gap-0.5" role="listbox" aria-label="Folders"></div>`),Afe=P(`<div class="grid min-h-48 place-items-center gap-1 text-center text-muted-foreground"><!> <p class="mt-1 text-sm text-foreground"> </p> <span class="font-mono text-xs"> </span></div>`),jfe=P(`<div class="min-h-0 overflow-x-hidden overflow-y-auto p-2"><section><!></section></div>`);function Mfe(e,t){x(t,!0);let n=K(t,`listEl`,15);var r=jfe(),i=B(r),a=B(i),o=e=>{var t=wfe();O(t,20,()=>[0,1,2,3,4,5,6],e=>e,(e,t)=>{q(e,Cfe())}),y(t),q(e,t)},s=e=>{var n=kfe();A(n,`tabindex`,-1),O(n,23,()=>t.filteredEntries,e=>e.path,(e,n,r)=>{let i=l(()=>L(r)),a=l(()=>t.uniqueSignals(L(n).signals));var o=Ofe();let s;var c=B(o);Vr(c,{size:15,strokeWidth:2.1,"aria-hidden":`true`,class:`flex-none text-muted-foreground`});var u=Y(c,2),m=B(u),h=B(m,!0);y(m),y(u);var _=Y(u,2),v=e=>{var r=Dfe(),i=B(r),o=e=>{nP(e,{tone:`good`,size:`xs`,children:(e,t)=>{var n=Tfe();Ja(F(n),{size:11}),g(),q(e,n)},$$slots:{default:!0}})},s=l(()=>t.isOpened(L(n).path));p(i,e=>{L(s)&&e(o)}),O(Y(i,2),16,()=>L(a),e=>e,(e,n)=>{let r=l(()=>t.signalMeta[n]),i=l(()=>L(r).icon);{let t=l(()=>L(r).tone??`neutral`);nP(e,{get tone(){return L(t)},size:`xs`,get title(){return L(r).title},class:`max-[520px]:hidden`,children:(e,t)=>{var n=Efe(),a=F(n);d(a,()=>L(i),(e,t)=>{t(e,{size:11,strokeWidth:2.2})});var o=Y(a,1,!0);J(()=>f(o,L(r).label)),q(e,n)},$$slots:{default:!0}})}}),y(r),q(e,r)},b=l(()=>t.isOpened(L(n).path)||L(a).length);p(_,e=>{L(b)&&e(v)}),y(o),J(()=>{A(o,`id`,`folder:${L(n).path}`),s=w(o,1,`row svelte-cb8hzu`,null,s,{selected:t.selectedIndex===L(i)}),A(o,`aria-selected`,t.selectedIndex===L(i)),A(o,`title`,L(n).path),f(h,L(n).name)}),le(`click`,o,()=>t.onSelectedIndexChange?.(L(i))),le(`dblclick`,o,()=>void t.load(L(n).path)),le(`keydown`,o,e=>t.onRowKeydown(e,L(i),{kind:`folder`,id:`folder:${L(n).path}`,path:L(n).path,entry:L(n)})),q(e,o)}),y(n),J(()=>A(n,`aria-activedescendant`,t.selectedItem?.kind===`folder`?t.activeDescendant:void 0)),q(e,n)},c=e=>{var n=Afe(),r=B(n);ri(r,{size:26,strokeWidth:1.8});var i=Y(r,2),a=B(i,!0);y(i);var o=Y(i,2),s=B(o,!0);y(o),y(n),J((e,t)=>{f(a,e),f(s,t)},[()=>t.query.trim()?`No folders match your filter.`:`No subfolders here.`,()=>t.query.trim()?`Clear the filter or paste a path.`:`Use Open below to choose this folder as the project.`]),q(e,n)};p(a,e=>{t.loading?e(o):t.filteredEntries.length?e(s,1):e(c,-1)}),y(i),y(r),ie(r,e=>n(e),()=>n()),q(e,r),H()}r([`click`,`dblclick`,`keydown`]);var Nfe=new Set([`$$slots`,`$$events`,`$$legacy`]);function e7(e,t){let n=U(t,Nfe),r=[[`path`,{d:`m12 19-7-7 7-7`}],[`path`,{d:`M19 12H5`}]];G(e,V({name:`arrow-left`},()=>n,{get iconNode(){return r}}))}var Pfe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ffe(e,t){let n=U(t,Pfe),r=[[`path`,{d:`M8 6L12 2L16 6`}],[`path`,{d:`M12 2V22`}]];G(e,V({name:`move-up`},()=>n,{get iconNode(){return r}}))}var Ife=P(`<div class="grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-1.5 border-b border-border/50 p-2"><span class="flex size-8 items-center justify-center"><!></span> <form class="col-span-3 row-start-2 min-w-0 sm:col-span-1 sm:col-start-2 sm:row-start-1"><!></form> <div class="col-start-3 row-start-1 flex flex-none items-center justify-end gap-0.5"><!> <!> <!></div></div>`);function Lfe(e,t){x(t,!0);let n=K(t,`query`,15),r=K(t,`showHidden`,15);var i=Ife(),a=B(i),o=B(a),s=e=>{W(e,{variant:`ghost`,size:`icon-sm`,title:`Back to projects`,ariaLabel:`Back to projects`,get onclick(){return t.onBack},children:(e,t)=>{e7(e,{size:15,strokeWidth:2.2})},$$slots:{default:!0}})};p(o,e=>{t.onBack&&e(s)}),y(a);var c=Y(a,2);q_(B(c),{onValueChange:()=>t.onQueryChange?.(n()),placeholder:`Filter folders or paste a path`,get disabled(){return t.loading},inputClass:`font-mono`,ariaLabel:`Filter folders or enter a path`,get value(){return n()},set value(e){n(e)}}),y(c);var u=Y(c,2),d=B(u);{let e=l(()=>!t.parent||t.loading);W(d,{variant:`ghost`,size:`icon-sm`,get disabled(){return L(e)},title:`Parent directory`,ariaLabel:`Parent directory`,onclick:()=>t.onLoad?.(t.parent),children:(e,t)=>{Ffe(e,{size:14,strokeWidth:2.2})},$$slots:{default:!0}})}var f=Y(d,2);W(f,{variant:`ghost`,size:`icon-sm`,get disabled(){return t.loading},title:`Refresh`,ariaLabel:`Refresh`,get onclick(){return t.onReload},children:(e,t)=>{Wl(e,{size:14,strokeWidth:2.2})},$$slots:{default:!0}}),B_(Y(f,2),{label:`Hidden`,class:`h-7 gap-1.5 px-1 text-xs`,get checked(){return r()},set checked(e){r(e)}}),y(u),y(i),Ae(`submit`,c,function(...e){t.onSubmit?.apply(this,e)}),q(e,i),H()}var Rfe=new Set([`$$slots`,`$$events`,`$$legacy`]);function zfe(e,t){let n=U(t,Rfe),r=[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`}],[`path`,{d:`M8 12h.01`}],[`path`,{d:`M12 12h.01`}],[`path`,{d:`M16 12h.01`}]];G(e,V({name:`message-circle-more`},()=>n,{get iconNode(){return r}}))}var Bfe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Vfe(e,t){let n=U(t,Bfe),r=[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`}],[`path`,{d:`m15 9-6 6`}],[`path`,{d:`m9 9 6 6`}]];G(e,V({name:`message-circle-x`},()=>n,{get iconNode(){return r}}))}var t7=P(`<button><!> <span> </span></button>`),n7=P(`<!> <!>`,1),Hfe=P(`<span class="text-muted-foreground">No active work</span>`),Ufe=P(`<span> </span>`),Wfe=P(`<button><!> <!></button>`),Gfe=P(`<div class="flex min-w-0 items-center justify-between gap-3 text-xs tabular-nums" aria-label="Project status summary"><span class="flex min-w-0 items-center gap-1.5"><!> <!> <!> <!> <!></span> <!></div>`);function Kfe(e,t){x(t,!0);let n=K(t,`gitLoading`,3,!1),r=K(t,`gitError`,3,!1);function i(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}let a=l(()=>`${i(t.item.activity.running,`conversation`)} running`),o=l(()=>`${i(t.item.activity.needsUser,`conversation`)} waiting for you`),s=l(()=>`${i(t.item.activity.failed,`conversation`)} failed`),u=l(()=>`${i(t.item.tasks.running,`background task`)} running`),m=l(()=>n()&&!t.git?`Loading Git status`:r()?`Git status unavailable`:!t.git||t.git.repositoryCount===0?`No Git repository`:`${t.git.repositoryCount>1?`${t.git.repositoryCount} repositories`:t.git.detached?`Detached HEAD`:t.git.branch??`Unknown branch`}. ${t.git.changeCount?i(t.git.changeCount,`working tree change`):`Clean working tree`}. ${t.git.aheadCount?i(t.git.aheadCount,`unpublished commit`):t.git.upstreamKnown?`No unpublished commits`:`Unpublished commits unknown`}.`),h=l(()=>r()||!t.git||t.git.repositoryCount===0?`—`:t.git.changeCount),v=l(()=>t.item.activity.running>0||t.item.activity.needsUser>0||t.item.activity.failed>0||t.item.tasks.running>0);var b=Gfe(),S=B(b),C=B(S),w=e=>{var n=_();d(F(n),()=>Fy,(e,n)=>{n(e,{children:(e,n)=>{var r=n7(),i=F(r);{let e=(e,n)=>{let r=()=>n?.().props;var i=t7(),a=e=>e.stopPropagation(),s=e=>e.stopPropagation();c(i,()=>({...r(),type:`button`,class:`inline-flex cursor-help items-center gap-1 rounded-sm border-0 bg-warning/10 px-1.5 py-0.5 text-warning`,"aria-label":L(o),onclick:a,onkeydown:s}));var l=B(i);J5(l,{class:`size-3.5`,"aria-hidden":`true`});var u=Y(l,2),d=B(u,!0);y(u),y(i),J(()=>f(d,t.item.activity.needsUser)),q(e,i)};d(i,()=>Ly,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}d(Y(i,2),()=>Uy,(e,t)=>{t(e,{sideOffset:5,children:(e,t)=>{g();var n=D();J(()=>f(n,L(o))),q(e,n)},$$slots:{default:!0}})}),q(e,r)},$$slots:{default:!0}})}),q(e,n)};p(C,e=>{t.item.activity.needsUser&&e(w)});var T=Y(C,2),E=e=>{var n=_();d(F(n),()=>Fy,(e,n)=>{n(e,{children:(e,n)=>{var r=n7(),i=F(r);{let e=(e,n)=>{let r=()=>n?.().props;var i=t7(),a=e=>e.stopPropagation(),o=e=>e.stopPropagation();c(i,()=>({...r(),type:`button`,class:`inline-flex cursor-help items-center gap-1 rounded-sm border-0 bg-destructive/10 px-1.5 py-0.5 text-destructive`,"aria-label":L(s),onclick:a,onkeydown:o}));var l=B(i);Vfe(l,{class:`size-3.5`,"aria-hidden":`true`});var u=Y(l,2),d=B(u,!0);y(u),y(i),J(()=>f(d,t.item.activity.failed)),q(e,i)};d(i,()=>Ly,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}d(Y(i,2),()=>Uy,(e,t)=>{t(e,{sideOffset:5,children:(e,t)=>{g();var n=D();J(()=>f(n,L(s))),q(e,n)},$$slots:{default:!0}})}),q(e,r)},$$slots:{default:!0}})}),q(e,n)};p(T,e=>{t.item.activity.failed&&e(E)});var O=Y(T,2),k=e=>{var n=_();d(F(n),()=>Fy,(e,n)=>{n(e,{children:(e,n)=>{var r=n7(),i=F(r);{let e=(e,n)=>{let r=()=>n?.().props;var i=t7(),o=e=>e.stopPropagation(),s=e=>e.stopPropagation();c(i,()=>({...r(),type:`button`,class:`inline-flex cursor-help items-center gap-1 rounded-sm border-0 bg-info/10 px-1.5 py-0.5 text-info`,"aria-label":L(a),onclick:o,onkeydown:s}));var l=B(i);zfe(l,{class:`size-3.5`,"aria-hidden":`true`});var u=Y(l,2),d=B(u,!0);y(u),y(i),J(()=>f(d,t.item.activity.running)),q(e,i)};d(i,()=>Ly,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}d(Y(i,2),()=>Uy,(e,t)=>{t(e,{sideOffset:5,children:(e,t)=>{g();var n=D();J(()=>f(n,L(a))),q(e,n)},$$slots:{default:!0}})}),q(e,r)},$$slots:{default:!0}})}),q(e,n)};p(O,e=>{t.item.activity.running&&e(k)});var ee=Y(O,2),A=e=>{var n=_();d(F(n),()=>Fy,(e,n)=>{n(e,{children:(e,n)=>{var r=n7(),i=F(r);{let e=(e,n)=>{let r=()=>n?.().props;var i=t7(),a=e=>e.stopPropagation(),o=e=>e.stopPropagation();c(i,()=>({...r(),type:`button`,class:`inline-flex cursor-help items-center gap-1 rounded-sm border-0 bg-info/10 px-1.5 py-0.5 text-info`,"aria-label":L(u),onclick:a,onkeydown:o}));var s=B(i);lG(s,{class:`size-3.5`,"aria-hidden":`true`});var l=Y(s,2),d=B(l,!0);y(l),y(i),J(()=>f(d,t.item.tasks.running)),q(e,i)};d(i,()=>Ly,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}d(Y(i,2),()=>Uy,(e,t)=>{t(e,{sideOffset:5,children:(e,t)=>{g();var n=D();J(()=>f(n,L(u))),q(e,n)},$$slots:{default:!0}})}),q(e,r)},$$slots:{default:!0}})}),q(e,n)};p(ee,e=>{t.item.tasks.running&&e(A)});var j=Y(ee,2),M=e=>{q(e,Hfe())};p(j,e=>{L(v)||e(M)}),y(S),d(Y(S,2),()=>Fy,(e,r)=>{r(e,{children:(e,r)=>{var i=n7(),a=F(i);{let e=(e,r)=>{let i=()=>r?.().props;var a=Wfe(),o=e=>e.stopPropagation(),s=e=>e.stopPropagation();c(a,()=>({...i(),type:`button`,class:`inline-flex flex-none cursor-help items-center gap-1 rounded-sm border-0 px-1.5 py-0.5 ${t.git&&t.git.repositoryCount>0?t.git.changeCount?`bg-warning/10 text-warning`:`bg-success/10 text-success`:`bg-transparent text-muted-foreground`}`,"aria-label":L(m),onclick:o,onkeydown:s}));var l=B(a);AL(l,{class:`size-3.5`,"aria-hidden":`true`});var u=Y(l,2),d=e=>{GP(e,{class:`h-3 w-4`,"aria-label":`Loading Git status`})},g=e=>{var t=Ufe(),n=B(t,!0);y(t),J(()=>f(n,L(h))),q(e,t)};p(u,e=>{n()&&!t.git?e(d):e(g,-1)}),y(a),q(e,a)};d(a,()=>Ly,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}d(Y(a,2),()=>Uy,(e,t)=>{t(e,{sideOffset:5,class:`max-w-72`,children:(e,t)=>{g();var n=D();J(()=>f(n,L(m))),q(e,n)},$$slots:{default:!0}})}),q(e,i)},$$slots:{default:!0}})}),y(b),q(e,b),H()}var qfe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Jfe(e,t){let n=U(t,qfe),r=[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`}]];G(e,V({name:`layers`},()=>n,{get iconNode(){return r}}))}var Yfe=P(`<img alt="" loading="lazy" decoding="async" class="absolute inset-0 size-full bg-muted/40 object-cover"/>`),Xfe=P(`<span aria-hidden="true"><!> <!></span>`);function Zfe(e,t){x(t,!0);let n=X(!1),r=l(()=>`/api/projects/${encodeURIComponent(t.projectId)}/icon?v=2`);var i=Xfe(),a=B(i);Jfe(a,{class:`size-1/2`,strokeWidth:1.8});var o=Y(a,2),s=e=>{var t=Yfe();J(()=>A(t,`src`,L(r))),Ae(`error`,t,()=>R(n,!0)),Ee(t),q(e,t)};p(o,e=>{L(n)||e(s)}),y(i),J(e=>w(i,1,e),[()=>_e(I(`relative grid shrink-0 place-items-center overflow-hidden rounded-md border border-border/60 bg-muted/40 text-muted-foreground`,t.class))]),q(e,i),H()}var Qfe=P(`<button type="button" class="group flex w-full items-center gap-2.5 rounded-md border border-transparent bg-transparent px-2.5 py-2 text-left hover:bg-accent/60 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none"><span class="grid size-8 flex-none place-items-center rounded-md border border-border/60 bg-muted/40 text-muted-foreground group-hover:text-foreground"><!></span> <span class="grid min-w-0 flex-1 gap-0.5"><span class="text-sm font-medium text-foreground">Browse path</span> <span class="truncate font-mono text-xs text-muted-foreground"> </span></span> <!></button>`),$fe=P(`<div role="option" tabindex="-1"><!> <span class="grid min-w-0 flex-1 gap-0.5"><span class="flex min-w-0 items-center gap-1.5"><strong class="min-w-0 flex-1 truncate text-sm font-medium text-foreground"> </strong> <!> <span class="ml-auto min-w-0 flex-none"><!></span></span> <span class="min-w-0 truncate font-mono text-xs text-muted-foreground"> </span></span></div>`),epe=P(`<div class="grid grid-cols-1 gap-1.5" role="listbox" aria-label="Recent projects"></div>`),tpe=P(`<div class="grid min-h-40 place-items-center gap-1 p-6 text-center text-muted-foreground"><!> <p class="m-0 mt-1 text-sm text-foreground"> </p> <span class="text-xs">Use Browse below to open a project folder.</span></div>`),npe=P(`<form class="grid items-center px-3 py-2.5"><!></form> <div class="relative flex min-h-0 flex-1 overflow-hidden"><div class="recent-projects-scroller min-h-0 flex-1 overflow-y-auto p-2 svelte-15ciugr"><div><!></div></div> <div></div> <div></div></div>`,1);function rpe(e,t){x(t,!0);let n=K(t,`scrollEl`,15),r=K(t,`query`,15),i=X(void 0),a=X(!1),o=X(!1);function s(){n()&&(R(a,n().scrollTop>2),R(o,n().scrollTop+n().clientHeight<n().scrollHeight-2))}z(()=>{let e=n(),t=L(i);if(!e||!t)return;s();let r=new ResizeObserver(s);return r.observe(e),r.observe(t),()=>r.disconnect()});function c(e){let n=e.project,r=[{label:`New chat`,icon:Ul,onSelect:()=>t.onNewChat(n.dir)},{label:`Copy path`,icon:af,onSelect:()=>t.onCopyPath(n.dir)}];return t.onForget&&r.push({type:`separator`},{label:`Forget project`,icon:Ya,destructive:!0,onSelect:()=>t.onForget(n.id)}),r}var u=npe(),m=F(u);q_(B(m),{onValueChange:()=>t.onQueryChange?.(),placeholder:`Search recent projects or paste a path`,get disabled(){return t.loading},ariaLabel:`Search recent projects or enter a path`,get value(){return r()},set value(e){r(e)}}),y(m);var h=Y(m,2),v=B(h),b=B(v),S=B(b),C=e=>{var n=Qfe(),i=B(n);ri(B(i),{class:`size-4`,"aria-hidden":`true`}),y(i);var a=Y(i,2),o=Y(B(a),2),s=B(o,!0);y(o),y(a),$L(Y(a,2),{class:`size-3.5 flex-none text-muted-foreground group-hover:text-foreground`,strokeWidth:2.2,"aria-hidden":`true`}),y(n),J(e=>f(s,e),[()=>r().trim()]),le(`click`,n,function(...e){t.onBrowsePath?.apply(this,e)}),q(e,n)},T=e=>{var n=_();d(F(n),()=>Gy,(e,n)=>{n(e,{delayDuration:300,disableHoverableContent:!0,children:(e,n)=>{var r=epe();A(r,`tabindex`,-1),O(r,23,()=>t.items,e=>e.key,(e,n,r)=>{let i=l(()=>L(n).key===t.activeProjectKey),a=l(()=>t.selectedIndex===L(r));{let o=l(()=>c(L(n)));zr(e,{get items(){return L(o)},triggerClass:`contents`,children:(e,o)=>{var s=$fe(),c=B(s);Zfe(c,{get projectId(){return L(n).project.id},class:`size-8`});var u=Y(c,2),d=B(u),m=B(d),h=B(m,!0);y(m);var _=Y(m,2),v=e=>{nP(e,{tone:`accent`,size:`xs`,class:`flex-none`,children:(e,t)=>{g(),q(e,D(`Current`))},$$slots:{default:!0}})};p(_,e=>{L(i)&&e(v)});var b=Y(_,2),x=B(b);{let e=l(()=>t.gitLoadingByProjectKey[L(n).key]??!1),r=l(()=>t.gitErrorByProjectKey[L(n).key]??!1);Kfe(x,{get item(){return L(n)},get git(){return t.gitByProjectKey[L(n).key]},get gitLoading(){return L(e)},get gitError(){return L(r)}})}y(b),y(d);var S=Y(d,2),C=B(S,!0);y(S),y(u),y(s),J((e,t)=>{A(s,`id`,e),w(s,1,`group flex w-full cursor-pointer items-center gap-2.5 rounded-md border border-transparent bg-accent/35 px-2.5 py-1.5 text-left focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none ${L(a)?`bg-accent/80`:`hover:bg-accent/70`}`,`svelte-15ciugr`),A(s,`aria-selected`,L(a)),f(h,L(n).project.name),f(C,t)},[()=>`recent:${encodeURIComponent(L(n).key)}`,()=>jp(L(n).project.dir,t.homeDir)]),le(`click`,s,()=>t.onOpen(L(n))),le(`keydown`,s,e=>t.onRowKeydown(e,L(r),L(n))),q(e,s)},$$slots:{default:!0}})}}),y(r),J(()=>A(r,`aria-activedescendant`,t.activeDescendant)),q(e,r)},$$slots:{default:!0}})}),q(e,n)},E=e=>{var n=tpe(),r=B(n);ri(r,{size:26,strokeWidth:1.8,"aria-hidden":`true`});var i=Y(r,2),a=B(i,!0);y(i),g(2),y(n),J(()=>f(a,t.totalRecentCount?`No recent projects match your search.`:`No recent projects yet.`)),q(e,n)};p(S,e=>{t.pathQuery?e(C):t.items.length?e(T,1):e(E,-1)}),y(b),ie(b,e=>R(i,e),()=>L(i)),y(v),ie(v,e=>n(e),()=>n());var k=Y(v,2);let ee;var j=Y(k,2);let M;y(h),J(()=>{ee=w(k,1,`recent-projects-shadow recent-projects-shadow-top pointer-events-none absolute inset-x-0 top-0 h-6 opacity-0 transition-opacity duration-150 svelte-15ciugr`,null,ee,{"opacity-100":L(a)}),M=w(j,1,`recent-projects-shadow recent-projects-shadow-bottom pointer-events-none absolute inset-x-0 bottom-0 h-6 opacity-0 transition-opacity duration-150 svelte-15ciugr`,null,M,{"opacity-100":L(o)})}),Ae(`submit`,m,function(...e){t.onSubmit?.apply(this,e)}),Ae(`scroll`,v,s),q(e,u),H()}r([`click`,`keydown`]);var ipe=new Set([`$$slots`,`$$events`,`$$legacy`]);function r7(e,t){let n=U(t,ipe),r=[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`}],[`path`,{d:`M12 22V12`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`}],[`path`,{d:`m7.5 4.27 9 5.15`}]];G(e,V({name:`package`},()=>n,{get iconNode(){return r}}))}var i7={git:{label:`Git`,title:`Git repository`,tone:`accent`,icon:AL},package:{label:`Pkg`,title:`JavaScript package`,icon:r7},workspace:{label:`Workspace`,title:`Workspace marker`,tone:`accent`,icon:r7},python:{label:`Py`,title:`Python project`,icon:Ue},rust:{label:`Rust`,title:`Rust project`,icon:Ue},go:{label:`Go`,title:`Go module`,icon:Ue}};function a7(e){return[...new Set(e??[])]}function o7(e,t){let n=e.trim();if(!t)return n;if(n===`~`)return t;if(n.startsWith(`~/`)||n.startsWith(`~\\`)){let e=t.includes(`\\`)?`\\`:`/`;return`${t.replace(/[\\/]+$/,``)}${e}${n.slice(2)}`}return n}function ape(e){let t=e.repos.length===1?e.repos[0]:void 0;return{repositoryCount:e.repos.length,branch:t?.currentBranch??void 0,detached:t?.detached??!1,changeCount:e.repos.reduce((e,t)=>e+t.changeCount,0),aheadCount:e.repos.reduce((e,t)=>e+Math.max(0,t.ahead??0),0),upstreamKnown:e.repos.length>0&&e.repos.every(e=>e.hasUpstream)}}var ope=P(`<!> Browse`,1),spe=P(`<p class="m-0 px-3 py-2 text-xs text-destructive"> </p>`),cpe=P(`<!> <!> <!>`,1),lpe=P(`<div role="presentation"><!></div>`);function upe(e,t){x(t,!0);let n=e=>{W(e,{variant:`outline`,size:`sm`,"data-tour-id":`guide-project-browse`,onclick:()=>pe(),children:(e,t)=>{var n=ope();q5(F(n),{size:14,strokeWidth:2.2}),g(),q(e,n)},$$slots:{default:!0}})},r=e=>{Sfe(e,{get path(){return L(I)},get homeDir(){return t.homeDir},get signals(){return L(ae)},get signalMeta(){return i7},get loading(){return L(d)},onOpen:()=>void ve()})},i=K(t,`open`,15,!1),a=K(t,`projects`,19,()=>[]),o=K(t,`switcherItems`,19,()=>[]),s=X(`recent`),c=X(``),u=X(void 0),d=X(!1),m=X(void 0),h=X(!1),_=X(-1),v=X(-1),b=X(!1),S=X(!1),C=X(void 0),T=X(void 0),E=X(Ie({})),D=Ie({}),O=X(Ie({})),k=0,ee=new je,A=l(()=>new Set(a().map(e=>Mp(e.dir)))),j=l(()=>o().slice(0,100)),M=l(()=>Np(L(c).trim())),N=l(()=>{if(L(M))return[];let e=L(c).trim().toLowerCase();return e?L(j).filter(t=>t.label.toLowerCase().includes(e)||t.project.name.toLowerCase().includes(e)||t.project.dir.toLowerCase().includes(e)):L(j)}),te=l(()=>L(v)>=0&&L(N)[L(v)]?`recent:${encodeURIComponent(L(N)[L(v)].key)}`:void 0),ne=l(()=>{let e=L(u)?.entries??[],t=L(c).trim();if(!t||Np(t))return e;let n=t.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(n))}),P=l(()=>L(ne).map(e=>({kind:`folder`,id:`folder:${e.path}`,path:e.path,entry:e}))),re=l(()=>L(_)>=0?L(P)[L(_)]:void 0),ie=l(()=>L(re)?.entry),I=l(()=>L(re)?.path??L(u)?.path??``),ae=l(()=>a7(L(ie)?.signals??(L(re)?[]:L(u)?.signals))),oe=l(()=>L(re)?.id);function se(e){return L(A).has(Mp(e))}async function ce(e){R(d,!0),R(m,void 0);try{R(u,await $a(e,L(h)),!0),R(c,``),R(_,-1)}catch(e){R(m,e instanceof Error?e.message:String(e),!0)}finally{R(d,!1)}}function ue(){ce(L(u)?.path||void 0)}function de(){requestAnimationFrame(()=>{L(C)?.querySelector(`.row.selected`)?.scrollIntoView({block:`nearest`})})}function fe(){requestAnimationFrame(()=>{L(T)?.querySelector(`[role="option"][aria-selected="true"]`)?.scrollIntoView({block:`nearest`})})}function V(){R(v,-1)}function pe(e){R(s,`browse`),R(c,``),R(_,-1),e?ce(e):L(u)||ce(t.homeDir||void 0)}function me(){R(s,`recent`),R(c,``),R(v,-1)}function he(e){i(e),e||t.onClose?.()}async function ge(e){await t.onSelectProject?.(e),he(!1)}function _e(e){e.preventDefault();let n=L(c).trim();if(!n)return;if(Np(n)){pe(o7(n,t.homeDir));return}if(L(s)===`recent`){let e=L(N)[L(v)>=0?L(v):0];e&&ge(e.project.id);return}let r=L(P)[0];r&&ce(r.path)}async function ve(){let e=L(I);e&&(await t.onOpenDirectory?.(e),he(!1))}function ye(e,t,n){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),R(_,t,!0),ce(n.path))}function be(e,t,n){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),R(v,t,!0),ge(n.project.id))}async function U(e){try{await vf(e),yi.success(`Path copied`)}catch{yi.error(`Could not copy to clipboard`)}}async function xe(e,t){let n=0;async function r(){for(;t===k&&i()&&L(s)===`recent`;){let t=e[n++];if(!t)return;if(!(L(E)[t.key]||L(O)[t.key]||ee.has(t.key))){ee.add(t.key),D[t.key]=!0;try{let e=await Ke.fetchQuery({queryKey:$e.git.repos(t.project.id),queryFn:()=>Hi(t.project.id),staleTime:Dq});L(E)[t.key]=ape(e)}catch{L(E)[t.key]||(L(O)[t.key]=!0)}finally{ee.delete(t.key),D[t.key]=!1}}}}await Promise.all(Array.from({length:4},()=>r()))}function Se(e){let n=e.target?.tagName===`INPUT`,r=L(N).length;switch(e.key){case`ArrowDown`:e.preventDefault(),r&&(R(v,L(v)<0?0:Math.min(L(v)+1,r-1),!0),fe());break;case`ArrowUp`:e.preventDefault(),r&&(R(v,Math.max(0,L(v)-1),!0),fe());break;case`Enter`:if(n)return;if(e.preventDefault(),L(M)){pe(o7(L(c),t.homeDir));return}{let e=L(N)[L(v)>=0?L(v):0];e&&ge(e.project.id)}break}}function G(e){let t=e.target?.tagName===`INPUT`,n=L(P).length;switch(e.key){case`ArrowDown`:e.preventDefault(),n&&(R(_,L(_)<0?0:Math.min(L(_)+1,n-1),!0),de());break;case`ArrowUp`:e.preventDefault(),n&&(R(_,L(_)<=0?0:L(_)-1,!0),de());break;case`ArrowRight`:!t&&L(ie)&&(e.preventDefault(),ce(L(ie).path));break;case`Enter`:e.metaKey||e.ctrlKey?(e.preventDefault(),ve()):!t&&L(re)&&(e.preventDefault(),ce(L(re).path));break;case`ArrowLeft`:!t&&L(u)?.parent&&(e.preventDefault(),ce(L(u).parent));break;case`Backspace`:L(c).length===0&&L(u)?.parent&&(e.preventDefault(),ce(L(u).parent));break}}function Ce(e){L(s)===`recent`?Se(e):G(e)}z(()=>{let e=i()&&L(s)===`recent`?L(N):[],t=++k;!e.length||typeof window>`u`||Oe(()=>void xe(e,t))}),z(()=>{i()&&!L(b)&&(R(s,L(j).length?`recent`:`browse`,!0),R(v,-1),R(_,-1),R(c,``),R(E,{},!0),R(O,{},!0),ce(L(u)?.path||void 0)),R(b,i(),!0)}),z(()=>{i()&&L(h)!==L(S)&&ue(),R(S,L(h),!0)});{let a=l(()=>L(s)===`recent`?`Projects`:`Open Project`),o=l(()=>L(s)===`recent`?`Choose a recent project or browse for a folder.`:`Choose a folder to open as a project.`),g=l(()=>`project-picker-dialog ${L(s)===`recent`?`project-picker-dialog-recent`:``}`),b=l(()=>L(s)===`recent`?n:r);IF(e,{flush:!0,get title(){return L(a)},get description(){return L(o)},get class(){return L(g)},get footer(){return L(b)},onOpenChange:he,get open(){return i()},set open(e){i(e)},children:(e,n)=>{var r=lpe(),i=B(r),a=e=>{rpe(e,{get items(){return L(N)},get totalRecentCount(){return L(j).length},get pathQuery(){return L(M)},get selectedIndex(){return L(v)},get activeDescendant(){return L(te)},get activeProjectKey(){return t.activeProjectKey},get homeDir(){return t.homeDir},get loading(){return L(d)},get gitByProjectKey(){return L(E)},get gitLoadingByProjectKey(){return D},get gitErrorByProjectKey(){return L(O)},onOpen:e=>void ge(e.project.id),onNewChat:e=>void t.onNewChat?.(e),onCopyPath:e=>void U(e),get onForget(){return t.onForget},onBrowsePath:()=>pe(o7(L(c),t.homeDir)),onQueryChange:V,onSubmit:_e,onRowKeydown:be,get scrollEl(){return L(T)},set scrollEl(e){R(T,e,!0)},get query(){return L(c)},set query(e){R(c,e,!0)}})},o=e=>{var t=cpe(),n=F(t);{let e=l(()=>L(u)?.parent),t=l(()=>L(j).length?me:void 0);Lfe(n,{get loading(){return L(d)},get parent(){return L(e)},onLoad:e=>void ce(e),onReload:ue,onQueryChange:()=>R(_,-1),onSubmit:_e,get onBack(){return L(t)},get query(){return L(c)},set query(e){R(c,e,!0)},get showHidden(){return L(h)},set showHidden(e){R(h,e,!0)}})}var r=Y(n,2),i=e=>{var t=spe(),n=B(t,!0);y(t),J(()=>f(n,L(m))),q(e,t)};p(r,e=>{L(m)&&e(i)}),Mfe(Y(r,2),{get filteredEntries(){return L(ne)},get loading(){return L(d)},get query(){return L(c)},get selectedIndex(){return L(_)},get selectedItem(){return L(re)},get activeDescendant(){return L(oe)},get signalMeta(){return i7},isOpened:se,get uniqueSignals(){return a7},load:e=>void ce(e),onSelectedIndexChange:e=>R(_,e,!0),onRowKeydown:ye,get listEl(){return L(C)},set listEl(e){R(C,e,!0)}}),q(e,t)};p(i,e=>{L(s)===`recent`?e(a):e(o,-1)}),y(r),J(()=>w(r,1,`grid h-full min-h-0 ${L(s)===`recent`||!L(m)?`grid-rows-[auto_minmax(0,1fr)]`:`grid-rows-[auto_auto_minmax(0,1fr)]`}`)),le(`keydown`,r,Ce),q(e,r)},$$slots:{default:!0}})}H()}r([`keydown`]);var dpe=P(`<!> <!>`,1);function fpe(e,t){x(t,!0);let n=l(()=>dm.status),r=l(()=>dm.projects),i=l(()=>dm.projectSwitcherItems),a=l(()=>UX.activeConversation),o=l(()=>UX.treeNodes),s=l(()=>UX.toolCalls);async function c(e){await jo(e),sK()}async function u(e){await jo(e.parentEntryId),So(e.text),sK()}var d=dpe(),f=F(d);{let e=l(()=>L(n)?.storage.userHome);upe(f,{get projects(){return L(r)},get switcherItems(){return L(i)},get activeProjectKey(){return Q.selectedProjectKey},get homeDir(){return L(e)},onSelectProject:e=>void cs(e),onOpenDirectory:e=>void Ss(e),onNewChat:e=>void ls(e),onForget:e=>void ns(e),get open(){return Q.projectPickerOpen},set open(e){Q.projectPickerOpen=e}})}vfe(Y(f,2),{get activeConversation(){return L(a)},get treeNodes(){return L(o)},get toolCalls(){return L(s)},onNavigateToEntry:e=>{c(e)},onEditEntry:e=>{u(e)},get open(){return oK.historyDialogOpen},set open(e){oK.historyDialogOpen=e}}),q(e,d),H()}var ppe=new Set([`$$slots`,`$$events`,`$$legacy`]);function mpe(e,t){let n=U(t,ppe),r=[[`path`,{d:`M12 3v14`}],[`path`,{d:`M5 10h14`}],[`path`,{d:`M5 21h14`}]];G(e,V({name:`diff`},()=>n,{get iconNode(){return r}}))}var hpe=P(`<span> </span>`),gpe=P(`<span class="status-trigger svelte-1bl2f4l"><!> <!></span>`),_pe=P(`<span class="flex items-center gap-1.5"><!> </span>`),vpe=P(`<!> <!> <!> <!> <!>`,1),ype=P(`<!> <!>`,1);function bpe(e,t){x(t,!0);let n=K(t,`connection`,3,`connecting`),r=K(t,`live`,3,!1),i=K(t,`side`,3,`top`),a=K(t,`compact`,3,!1),o=l(()=>r()?`good`:n()===`error`?`danger`:n()===`closed`?`warn`:`running`),s=l(()=>r()?`Connected`:n()),c=l(()=>{if(!t.status?.startedAt)return null;let e=new Date(t.status.startedAt).getTime();return Number.isNaN(e)?null:vv((Date.now()-e)/6e4)});v_(e,{size:`sm`,triggerClass:`h-5.5 rounded-sm px-1.5 text-muted-foreground hover:bg-accent hover:text-foreground data-[state=open]:bg-accent data-[state=open]:text-foreground`,ariaLabel:`Open daemon status`,get side(){return i()},align:`end`,trigger:e=>{var t=gpe(),n=B(t);ci(n,{get tone(){return L(o)},get pulse(){return r()}});var i=Y(n,2),c=e=>{var t=hpe(),n=B(t,!0);y(t),J(()=>f(n,L(s))),q(e,t)};p(i,e=>{a()||e(c)}),y(t),J(()=>A(t,`title`,`Nerve daemon · ${L(s)}`)),q(e,t)},children:(e,r)=>{b_(e,{children:(e,r)=>{var i=ype(),a=F(i);C_(a,{title:`Nerve daemon`,action:e=>{nP(e,{size:`xs`,get tone(){return L(o)},children:(e,t)=>{g();var n=D();J(()=>f(n,L(s))),q(e,n)},$$slots:{default:!0}})},$$slots:{action:!0}}),M_(Y(a,2),{children:(e,r)=>{var i=vpe(),a=F(i);P_(a,{label:`Connection`,children:(e,t)=>{var r=_pe(),i=B(r);ci(i,{get tone(){return L(o)},size:`xs`});var a=Y(i,1,!0);y(r),J(()=>f(a,n())),q(e,r)},$$slots:{default:!0}});var s=Y(a,2);{let e=l(()=>t.status?.version);P_(s,{label:`Version`,get value(){return L(e)},valueClass:`font-mono`})}var u=Y(s,2);{let e=l(()=>L(c)??void 0);P_(u,{label:`Uptime`,get value(){return L(e)}})}var d=Y(u,2);{let e=l(()=>t.status==null?void 0:t.status.storage.indexHealthy?`healthy`:`rebuilding`),n=l(()=>t.status?.storage.indexHealthy?`text-success`:`text-warning`);P_(d,{label:`Index`,get value(){return L(e)},get valueClass(){return L(n)}})}var p=Y(d,2);{let e=l(()=>t.status?.storage.home),n=l(()=>t.status?.storage.home);P_(p,{label:`Data dir`,get value(){return L(e)},valueClass:`font-mono`,get title(){return L(n)}})}q(e,i)},$$slots:{default:!0}}),q(e,i)},$$slots:{default:!0}})},$$slots:{trigger:!0,default:!0}}),H()}var xpe=P(`<span class="text-xs text-muted-foreground"> </span>`),Spe=P(`<div class="flex flex-col gap-1"><div class="flex items-center justify-between gap-2 text-xs"><span class="text-muted-foreground"> </span> <span> </span></div> <div class="h-1 overflow-hidden rounded-full bg-muted"><div></div></div> <!></div>`),Cpe=P(`<span class="usage-meter svelte-fvy830"><span class="usage-meter-label svelte-fvy830"> </span> <span class="usage-meter-track svelte-fvy830"><span></span></span> <span> </span></span>`),wpe=P(`<span class="usage-reset svelte-fvy830"> </span>`),Tpe=P(`<span class="usage-trigger svelte-fvy830"><!> <!></span>`),Epe=P(`<span class="font-normal text-muted-foreground"> </span>`),s7=P(`<span class="text-muted-foreground">No data</span>`),Dpe=P(`<div class="flex items-baseline justify-between gap-2"><span class="flex items-baseline gap-1.5 text-xs font-medium"> <!></span> <!></div> <!>`,1),Ope=P(`<!> <!>`,1);function c7(e,t){x(t,!0);let n=(e,t=N)=>{let n=l(()=>t().window.usedPercent??null),r=l(()=>a(t().window));var i=Spe(),c=B(i),d=B(c),g=B(d,!0);y(d);var _=Y(d,2),v=B(_,!0);y(_),y(c);var b=Y(c,2),x=B(b);y(b);var S=Y(b,2),C=e=>{var t=xpe(),n=B(t);y(t),J(()=>f(n,`resets in ${L(r)??``}`)),q(e,t)};p(S,e=>{L(r)&&e(C)}),y(i),J((e,n,r,i)=>{f(g,t().label),w(_,1,e,`svelte-fvy830`),f(v,n),w(x,1,r,`svelte-fvy830`),u(x,`width: ${i??``}%`)},[()=>_e(I(`font-medium tabular-nums`,m(L(n)))),()=>o(L(n)),()=>_e(I(`h-full rounded-full`,h(L(n)))),()=>s(L(n))]),q(e,i)},r=K(t,`usages`,19,()=>[]),i=K(t,`compact`,3,!1);function a(e){return e?yv(e.resetsAt)??bv(e.resetAfterSeconds):null}function o(e){return e==null?`—`:`${Math.round(e)}%`}function s(e){return e==null?0:Math.min(100,Math.max(0,e))}function c(e){return e===`openai-codex`?`Codex`:e===`anthropic`?`Anthropic`:e}function d(e){if(!e)return[];let t=[];return e.session&&t.push({slot:`session`,window:e.session,...gv(e.session.windowMinutes,{label:`Session`,abbreviation:`S`})}),e.weekly&&t.push({slot:`weekly`,window:e.weekly,...gv(e.weekly.windowMinutes,{label:`Weekly`,abbreviation:`W`})}),t}function m(e){let t=mv(e);return t===`error`?`text-destructive`:t===`warning`?`text-warning`:``}function h(e){let t=mv(e);return t===`error`?`bg-destructive-solid`:t===`warning`?`bg-warning`:`bg-success`}function v(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}let b=l(r),S=l(()=>L(b).some(e=>d(e.usage).length>0)),C=l(()=>L(b).find(e=>e.active&&d(e.usage).length>0)??L(b).find(e=>d(e.usage).length>0)),T=l(()=>d(L(C)?.usage)),E=l(()=>!i()||L(T).length<=1?L(T):[L(T).reduce((e,t)=>(t.window.usedPercent??0)>(e.window.usedPercent??0)?t:e)]),k=l(()=>i()?null:a(L(E)[0]?.window)),ee=l(()=>v(L(b).map(e=>e.usage?.updatedAt).filter(e=>!!e).sort().at(-1))),j=l(()=>{let e=[];for(let t of L(b)){let n=d(t.usage);if(n.length===0)continue;let r=n.map(e=>`${e.label.toLowerCase()} ${o(e.window.usedPercent)}`).join(` / `);e.push(`${c(t.provider)} — ${r}`)}return e.join(`
151
- `)});var M=_(),te=F(M),ne=e=>{v_(e,{size:`md`,triggerClass:`h-5.5 rounded-sm px-1.5 text-muted-foreground hover:bg-accent hover:text-foreground data-[state=open]:bg-accent data-[state=open]:text-foreground`,ariaLabel:`Open subscription usage details`,side:`top`,align:`end`,trigger:e=>{var t=Tpe(),n=B(t);O(n,17,()=>L(E),e=>e.slot,(e,t)=>{let n=l(()=>L(t).window.usedPercent);var r=Cpe(),i=B(r),a=B(i,!0);y(i);var c=Y(i,2),d=B(c);y(c);var p=Y(c,2),g=B(p,!0);y(p),y(r),J((e,n,r,i)=>{f(a,L(t).abbreviation),w(d,1,e,`svelte-fvy830`),u(d,`width: ${n??``}%`),w(p,1,r,`svelte-fvy830`),f(g,i)},[()=>_e(I(`usage-meter-fill`,h(L(n)))),()=>s(L(n)),()=>_e(I(`usage-meter-value`,m(L(n)))),()=>o(L(n))]),q(e,r)});var r=Y(n,2),i=e=>{var t=wpe(),n=B(t,!0);y(t),J(()=>f(n,L(k))),q(e,t)};p(r,e=>{L(k)&&e(i)}),y(t),J(()=>A(t,`title`,L(j))),q(e,t)},children:(e,t)=>{b_(e,{children:(e,t)=>{var r=Ope(),i=F(r);{let e=l(()=>L(ee)?`Updated ${L(ee)}`:void 0);C_(i,{title:`Subscription usage`,get meta(){return L(e)}})}O(Y(i,2),19,()=>L(b),e=>e.provider,(e,t,r)=>{{let i=l(()=>L(r)>0);D_(e,{get separated(){return L(i)},children:(e,r)=>{var i=Dpe(),a=F(i),o=B(a),s=B(o),u=Y(s),m=e=>{var n=Epe(),r=B(n);y(n),J(()=>f(r,`· ${L(t).usage.planType??``}`)),q(e,n)};p(u,e=>{L(t).usage?.planType&&e(m)}),y(o);var h=Y(o,2),v=e=>{nP(e,{size:`xs`,tone:`neutral`,children:(e,t)=>{g(),q(e,D(`Active`))},$$slots:{default:!0}})};p(h,e=>{L(t).active&&e(v)}),y(a);var b=Y(a,2),x=e=>{let r=l(()=>d(L(t).usage));var i=_(),a=F(i),o=e=>{var t=_();O(F(t),17,()=>L(r),e=>e.slot,(e,t)=>{n(e,()=>L(t))}),q(e,t)},s=e=>{q(e,s7())};p(a,e=>{L(r).length>0?e(o):e(s,-1)}),q(e,i)},S=e=>{q(e,s7())};p(b,e=>{L(t).usage?e(x):e(S,-1)}),J(e=>f(s,`${e??``} `),[()=>c(L(t).provider)]),q(e,i)},$$slots:{default:!0}})}}),q(e,r)},$$slots:{default:!0}})},$$slots:{trigger:!0,default:!0}})};p(te,e=>{L(S)&&e(ne)}),q(e,M),H()}var kpe=new Set([`$$slots`,`$$events`,`$$legacy`]);function l7(e,t){let n=U(t,kpe),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M3 9h18`}],[`path`,{d:`M9 21V9`}]];G(e,V({name:`panels-top-left`},()=>n,{get iconNode(){return r}}))}var Ape=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),jpe=P(`<kbd><!></kbd>`);function u7(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=U(t,Ape);var i=jpe();c(i,e=>({"data-slot":`kbd`,class:e,...r}),[()=>I(`bg-muted text-muted-foreground in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 h-5 w-fit min-w-5 gap-1 rounded-sm px-1 font-sans text-xs font-medium [&_svg:not([class*='size-'])]:size-3 pointer-events-none inline-flex items-center justify-center select-none`,t.class)]),h(B(i),()=>t.children??N),y(i),ie(i,e=>n(e),()=>n()),q(e,i),H()}P(`<kbd><!></kbd>`);var Mpe=P(`<span class="layout-trigger svelte-14ergwt"><!> <span> </span></span>`),Npe=P(`<span class="flex-none text-sm font-semibold tabular-nums"> </span>`),Ppe=P(`<!> <div class="flex items-center justify-between gap-2"><div class="flex items-center gap-1" aria-label="Zoom controls"><!> <!> <!></div> <span class="text-muted-foreground"> </span></div> <!>`,1);function Fpe(e,t){x(t,!0);let n=K(t,`zoomLevel`,3,0),r=K(t,`dockToggles`,19,()=>[]),i={left:qs,right:Ys,bottom:Gs},a={left:`view.toggleLeftDock`,right:`view.toggleRightDock`,bottom:`view.toggleBottomDock`};function o(e){let t=xp(a[e]);return t?vp(t.defaultBinding):void 0}let s=l(()=>xt(n())),c=l(()=>bt(L(s))),u=l(()=>L(s)>0?`+${L(s)}`:String(L(s)));function m(e){t.onZoomLevelChange?.(xt(e))}function h(e){m(L(s)+e)}v_(e,{size:`md`,triggerClass:`h-5.5 rounded-sm px-1.5 text-muted-foreground hover:bg-accent hover:text-foreground data-[state=open]:bg-accent data-[state=open]:text-foreground`,ariaLabel:`Open layout controls`,side:`top`,align:`end`,trigger:e=>{var t=Mpe(),n=B(t);l7(n,{size:12,strokeWidth:2.1,"aria-hidden":`true`});var r=Y(n,2),i=B(r);y(r),y(t),J(()=>{A(t,`title`,`Layout · Zoom ${L(c)}%`),f(i,`${L(c)??``}%`)}),q(e,t)},children:(e,t)=>{b_(e,{children:(e,t)=>{var n=Ppe(),a=F(n);C_(a,{title:`Layout`,action:e=>{var t=Npe(),n=B(t);y(t),J(()=>f(n,`${L(c)??``}%`)),q(e,t)},$$slots:{action:!0}});var v=Y(a,2),b=B(v),x=B(b);{let e=l(()=>L(s)<=-8);W(x,{variant:`ghost`,size:`icon-xs`,ariaLabel:`Zoom out`,title:`Zoom out`,get disabled(){return L(e)},onclick:()=>h(-1),children:(e,t)=>{$5(e,{class:`size-3.5`,"aria-hidden":`true`})},$$slots:{default:!0}})}var S=Y(x,2);{let e=l(()=>L(s)===0);W(S,{variant:`ghost`,size:`icon-xs`,ariaLabel:`Reset zoom`,title:`Reset zoom`,get disabled(){return L(e)},onclick:()=>m(0),children:(e,t)=>{ks(e,{class:`size-3.5`,"aria-hidden":`true`})},$$slots:{default:!0}})}var C=Y(S,2);{let e=l(()=>L(s)>=8);W(C,{variant:`ghost`,size:`icon-xs`,ariaLabel:`Zoom in`,title:`Zoom in`,get disabled(){return L(e)},onclick:()=>h(1),children:(e,t)=>{Q5(e,{class:`size-3.5`,"aria-hidden":`true`})},$$slots:{default:!0}})}y(b);var w=Y(b,2),T=B(w);y(w),y(v),D_(Y(v,2),{label:`Panels`,separated:!0,children:(e,t)=>{var n=_();O(F(n),17,r,e=>e.dock,(e,t)=>{let n=l(()=>i[L(t).dock]),r=l(()=>o(L(t).dock));A_(e,{get label(){return Fs[L(t).dock]},get selected(){return L(t).open},get onclick(){return L(t).onToggle},icon:e=>{var t=_();d(F(t),()=>L(n),(e,t)=>{t(e,{class:`size-4 flex-none text-muted-foreground`,"aria-hidden":`true`})}),q(e,t)},trailing:e=>{var t=_(),n=F(t),i=e=>{u7(e,{class:`flex-none`,children:(e,t)=>{g();var n=D();J(()=>f(n,L(r))),q(e,n)},$$slots:{default:!0}})};p(n,e=>{L(r)&&e(i)}),q(e,t)},$$slots:{icon:!0,trailing:!0}})}),q(e,n)},$$slots:{default:!0}}),J(()=>f(T,`Zoom level ${L(u)??``}`)),q(e,n)},$$slots:{default:!0}})},$$slots:{trigger:!0,default:!0}}),H()}var Ipe=P(`<span class="footer-project-path svelte-y7e2kl"> </span>`),d7=P(`<span class="footer-git-detail svelte-y7e2kl"><!> </span>`),Lpe=P(`<span class="footer-git-dot svelte-y7e2kl" aria-label="Uncommitted changes">•</span>`),Rpe=P(`<span class="footer-item footer-git svelte-y7e2kl"><!> <span class="footer-git-branch svelte-y7e2kl"> </span> <!> <!> <!></span>`),zpe=P(`<!> <!>`,1),Bpe=P(`<span class="footer-item svelte-y7e2kl" title="Running tasks"><!> <span> </span></span>`),Vpe=P(`<span class="footer-item warn svelte-y7e2kl" title="Pending approvals"><!> <span> </span></span>`),Hpe=P(`<!> <!> <!> <!>`,1),Upe=P(`<span class="inline-flex items-center gap-1" data-tour-id="status-controls"><!> <!></span>`);function Wpe(e,t){x(t,!0);let n=K(t,`connection`,3,`connecting`),r=K(t,`live`,3,!1),i=K(t,`pendingApprovals`,3,0),a=K(t,`tasks`,19,()=>[]),o=K(t,`subscriptionUsages`,19,()=>[]),s=K(t,`zoomLevel`,3,0),c=K(t,`dockToggles`,19,()=>[]),u=K(t,`phone`,3,!1),d=l(()=>a().filter(e=>[`starting`,`running`,`ready`,`stopping`].includes(e.status)).length),m=l(()=>t.activeProject?jp(t.activeProject.dir,t.homeDir):`No project`),h=l(()=>o().some(e=>!!(e.usage?.session??e.usage?.weekly))),g=l(()=>u()&&L(h));function _(e){return`${e} ${e===1?`change`:`changes`}`}function v(e){let t=[e.detached?`Detached HEAD`:`Branch: ${e.branch}`];return e.repoCount>1&&t.unshift(`Repo: ${e.relativePath===`.`?e.repoName:e.relativePath}`),e.changeCount>0&&t.push(_(e.changeCount)),(e.ahead??0)>0&&t.push(`${e.ahead} ahead`),(e.behind??0)>0&&t.push(`${e.behind} behind`),!e.hasUpstream&&!e.detached&&t.push(`No upstream`),t.join(` • `)}Pte(e,{get toggles(){return c()},left:e=>{var n=zpe(),r=F(n),i=e=>{c7(e,{get usages(){return o()},compact:!0})},a=e=>{var n=Ipe(),r=B(n,!0);y(n),J(()=>{A(n,`title`,t.activeProject?.dir),f(r,L(m))}),q(e,n)};p(r,e=>{L(g)?e(i):e(a,-1)});var s=Y(r,2),c=e=>{var n=Rpe(),r=B(n);AL(r,{size:12,strokeWidth:2.1,"aria-hidden":`true`});var i=Y(r,2),a=B(i,!0);y(i);var o=Y(i,2),s=e=>{var n=d7(),r=B(n);mpe(r,{size:11,strokeWidth:2.1,"aria-hidden":`true`});var i=Y(r,1,!0);y(n),J(e=>{A(n,`aria-label`,e),f(i,t.gitStatus.changeCount)},[()=>_(t.gitStatus.changeCount)]),q(e,n)},c=e=>{q(e,Lpe())};p(o,e=>{t.gitStatus.changeCount>0?e(s):t.gitStatus.dirty&&e(c,1)});var l=Y(o,2),u=e=>{var n=d7(),r=B(n);UU(r,{size:11,strokeWidth:2.1,"aria-hidden":`true`});var i=Y(r,1,!0);y(n),J(()=>{A(n,`aria-label`,`${t.gitStatus.ahead} ahead`),f(i,t.gitStatus.ahead)}),q(e,n)};p(l,e=>{(t.gitStatus.ahead??0)>0&&e(u)});var d=Y(l,2),m=e=>{var n=d7(),r=B(n);nt(r,{size:11,strokeWidth:2.1,"aria-hidden":`true`});var i=Y(r,1,!0);y(n),J(()=>{A(n,`aria-label`,`${t.gitStatus.behind} behind`),f(i,t.gitStatus.behind)}),q(e,n)};p(d,e=>{(t.gitStatus.behind??0)>0&&e(m)}),y(n),J(e=>{A(n,`title`,e),f(a,t.gitStatus.branch)},[()=>v(t.gitStatus)]),q(e,n)};p(s,e=>{!u()&&t.gitStatus&&e(c)}),q(e,n)},right:e=>{var a=Upe(),l=B(a),m=e=>{var n=Hpe(),r=F(n),a=e=>{var t=Bpe(),n=B(t);Ue(n,{size:12,strokeWidth:2.1,"aria-hidden":`true`});var r=Y(n,2),i=B(r,!0);y(r),y(t),J(()=>f(i,L(d))),q(e,t)};p(r,e=>{L(d)>0&&e(a)});var l=Y(r,2),u=e=>{var t=Vpe(),n=B(t);pW(n,{size:12,strokeWidth:2.1,"aria-hidden":`true`});var r=Y(n,2),a=B(r,!0);y(r),y(t),J(()=>f(a,i())),q(e,t)};p(l,e=>{i()>0&&e(u)});var m=Y(l,2);c7(m,{get usages(){return o()}}),Fpe(Y(m,2),{get zoomLevel(){return s()},get dockToggles(){return c()},get onZoomLevelChange(){return t.onZoomLevelChange}}),q(e,n)};p(l,e=>{u()||e(m)}),bpe(Y(l,2),{get connection(){return n()},get live(){return r()},get status(){return t.status},side:`top`,get compact(){return u()}}),y(a),q(e,a)},$$slots:{left:!0,right:!0}}),H()}var Gpe=[`anthropic`,`openai-codex`],Kpe={get activeSubscriptionProvider(){return UX.activeSubscriptionProvider},get activeSubscriptionUsage(){return UX.activeSubscriptionUsage},get subscriptionUsages(){let e=UX.activeSubscriptionProvider;return Gpe.map(t=>({provider:t,usage:ut.subscriptionUsage[t],active:t===e}))}};function qpe(e,t){x(t,!0);let n=l(()=>dm.activeProject),r=l(()=>dm.connection),i=l(()=>UX.live),a=l(()=>UX.pendingApprovalCount),o=l(()=>PZ.scopedTasks),s=l(()=>GX.gitStatus),c=l(()=>Kpe.subscriptionUsages),u=l(()=>dm.status),d=l(()=>QX.settingsDraft),f=l(()=>L(d)?.ui.zoomLevel??ot.level),p=l(()=>qZ.isCompact),m=l(()=>qZ.isPhone),h=l(()=>Ps.map(e=>({dock:e,label:Fs[e].toLowerCase(),open:L(p)?e===`left`?oQ.primary:oQ.secondary:gQ(e),onToggle:()=>xQ(e,L(p))})));{let t=l(()=>L(u)?.storage.userHome);Wpe(e,{get activeProject(){return L(n)},get connection(){return L(r)},get live(){return L(i)},get pendingApprovals(){return L(a)},get tasks(){return L(o)},get gitStatus(){return L(s)},get subscriptionUsages(){return L(c)},get status(){return L(u)},get homeDir(){return L(t)},get zoomLevel(){return L(f)},get dockToggles(){return L(h)},get phone(){return L(m)},get onZoomLevelChange(){return ft}})}H()}var f7=Ie({latest:void 0}),p7=[],m7,h7=!1,g7=!1,_7=!1,v7=1e3,y7=500,Jpe=1e4,Ype=[/ResizeObserver loop completed with undelivered notifications\./i,/ResizeObserver loop limit exceeded/i];function Xpe(e){return typeof e==`string`&&Ype.some(t=>t.test(e))}function Zpe(){h7||typeof window>`u`||(h7=!0,g7=!0,window.addEventListener(`error`,e=>{Xpe((e.error instanceof Error?e.error.message:void 0)??e.message)||b7(`error`,`web-runtime`,`Unhandled browser error`,{context:{filename:e.filename,lineno:e.lineno,colno:e.colno},error:e.error??e.message})}),window.addEventListener(`unhandledrejection`,e=>{b7(`error`,`web-runtime`,`Unhandled promise rejection`,{error:e.reason})}))}function b7(e,t,n,r={}){g7&&(p7.push({level:e,component:t,message:n,ts:new Date().toISOString(),durationMs:r.durationMs,context:r.context,error:r.error?$pe(r.error):void 0}),p7.length>200&&p7.splice(0,p7.length-200),x7())}function x7(e=y7){m7===void 0&&(m7=setTimeout(()=>{m7=void 0,Qpe()},e))}async function Qpe(){if(_7||p7.length===0)return;_7=!0;let e=p7.splice(0,50),t=y7;try{let t=await fetch(`/api/logs/client`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({logs:e})});if(!t.ok)throw Error(`${t.status} ${t.statusText}`);v7=1e3}catch(n){p7.unshift(...e),p7.length>200&&p7.splice(0,p7.length-200),t=v7,v7=Math.min(v7*2,Jpe),console.warn(`Failed to submit Nerve client logs`,n)}finally{_7=!1,p7.length>0&&x7(t)}}function $pe(e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(typeof e==`string`)return{message:e};if(e&&typeof e==`object`){let t=eme(e);return{message:typeof e.message==`string`?e.message:t.split(`
152
- `,1)[0],stack:t}}return{message:String(e)}}function eme(e){try{let t=new WeakSet;return JSON.stringify(e,(e,n)=>{if(n&&typeof n==`object`){if(t.has(n))return`[Circular]`;t.add(n)}return n},2)}catch{return String(e)}}async function tme(){return(await Sr(`status.latestRelease.get`,{})).result}var nme=60*6e4,S7,C7=!1;function rme(){w7(),T7(),S7=setInterval(()=>void T7(),nme)}function w7(){S7!==void 0&&clearInterval(S7),S7=void 0}async function T7(){if(!C7){C7=!0;try{f7.latest=await Ke.fetchQuery({queryKey:$e.latestRelease,queryFn:tme,staleTime:0})}catch(e){b7(`warn`,`releases`,`Latest release check failed`,{error:e})}finally{C7=!1}}}var ime=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;function E7(e){return`v${e.replace(/^v/,``)}`}function ame(e,t){let n=D7(e),r=D7(t);return!n||!r?!1:ome(n,r)<0}function D7(e){if(!e)return;let t=ime.exec(e.trim());if(!t)return;let n=t[4]?.split(`.`)??[];if(!n.some(e=>e.length===0))return{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),prerelease:n}}function ome(e,t){for(let n of[`major`,`minor`,`patch`])if(e[n]!==t[n])return e[n]<t[n]?-1:1;if(e.prerelease.length===0&&t.prerelease.length===0)return 0;if(e.prerelease.length===0)return 1;if(t.prerelease.length===0)return-1;let n=Math.max(e.prerelease.length,t.prerelease.length);for(let r=0;r<n;r+=1){let n=e.prerelease[r],i=t.prerelease[r];if(n===void 0)return-1;if(i===void 0)return 1;if(n===i)continue;let a=/^\d+$/.test(n),o=/^\d+$/.test(i);return a&&o?Number(n)<Number(i)?-1:1:a===o?n<i?-1:1:a?-1:1}return 0}var sme=P(`<a target="_blank" rel="noreferrer" class="flex-none cursor-pointer text-xs text-muted-foreground underline-offset-2 hover:underline focus-visible:underline focus-visible:outline-none"> </a>`),O7=P(`<span class="inline-flex"><!></span>`),cme=P(`<span class="text-muted-foreground">Run the latest release</span> <div class="flex items-center rounded-sm bg-muted pl-2 pr-1"><code class="min-w-0 flex-1 select-text py-1.5 text-foreground"></code> <!></div> <span class="mt-1 text-muted-foreground">Or pin this release</span> <div class="flex items-center rounded-sm bg-muted pl-2 pr-1"><code class="min-w-0 flex-1 select-text py-1.5 text-foreground"> </code> <!></div>`,1),lme=P(`<p class="text-warning"> </p> <!> <span class="text-muted-foreground">Select the latest version above to open the release notes.</span>`,1),ume=P(`<p class="text-muted-foreground">No newer stable release is available. Select the latest version above
153
- to open the release notes.</p>`),dme=P(`<p class="text-muted-foreground">The latest release could not be checked. Nerve will retry
154
- automatically.</p>`),fme=P(`<!> <!>`,1),pme=P(`<span><!></span>`);function mme(e,t){x(t,!0);let n=l(()=>E7(t.currentVersion)),r=l(()=>t.latestRelease?E7(t.latestRelease.version):void 0),i=l(()=>ame(t.currentVersion,t.latestRelease?.version)),a=l(()=>L(i)&&L(r)?`Nerve ${L(n)}; update available: ${L(r)}`:L(r)?`Nerve ${L(n)}; no newer stable release detected`:`Nerve ${L(n)}; latest release check unavailable`),o=l(()=>t.latestRelease?`npx @nervekit/desktop@${t.latestRelease.version}`:``),s=X(void 0),c;async function u(e,t){try{await vf(e)}catch{return}R(s,t,!0),c!==void 0&&clearTimeout(c),c=setTimeout(()=>{R(s,void 0),c=void 0},1500)}ce(()=>{c!==void 0&&clearTimeout(c)});var d=pme(),m=B(d);{let e=e=>{g();var t=D();J(()=>f(t,L(n))),q(e,t)},c=l(()=>`cursor-pointer rounded-sm border border-border bg-transparent px-1.5 py-0.5 font-mono text-xs font-medium leading-none text-muted-foreground transition-colors hover:bg-accent ${L(i)?`is-outdated`:``}`);v_(m,{get ariaLabel(){return L(a)},side:`bottom`,align:`end`,size:`md`,get triggerClass(){return L(c)},trigger:e,children:(e,a)=>{b_(e,{children:(e,a)=>{var c=fme(),d=F(c);{let e=e=>{var n=_(),i=F(n),a=e=>{var n=sme(),i=B(n);y(n),J(()=>{A(n,`href`,t.latestRelease.releaseUrl),f(i,`Latest ${L(r)??``}`)}),q(e,n)};p(i,e=>{L(r)&&t.latestRelease&&e(a)}),q(e,n)},i=l(()=>`Nerve ${L(n)}`);C_(d,{get title(){return L(i)},action:e,$$slots:{action:!0}})}var m=Y(d,2),h=e=>{var t=lme(),n=F(t),i=B(n);y(n),D_(Y(n,2),{separated:!0,children:(e,t)=>{var n=cme(),r=Y(F(n),2),i=B(r);i.textContent=`npx @nervekit/desktop@latest`;var a=Y(i,2);{let e=l(()=>L(s)===`latest`?`Latest release command copied`:`Copy latest release command`),t=l(()=>L(s)===`latest`?`Copied`:`Copy command`);W(a,{variant:`ghost`,size:`icon-xs`,get ariaLabel(){return L(e)},get title(){return L(t)},onclick:()=>void u(`npx @nervekit/desktop@latest`,`latest`),children:(e,t)=>{var n=_();M(F(n),()=>L(s)===`latest`,e=>{var t=_(),n=F(t),r=e=>{var t=O7();oi(B(t),{class:`size-3.5 text-success`,"aria-hidden":`true`}),y(t),T(3,t,()=>Ye,()=>({duration:120})),q(e,t)},i=e=>{var t=O7();af(B(t),{class:`size-3.5`,"aria-hidden":`true`}),y(t),T(3,t,()=>Ye,()=>({duration:120})),q(e,t)};p(n,e=>{L(s)===`latest`?e(r):e(i,-1)}),q(e,t)}),q(e,n)},$$slots:{default:!0}})}y(r);var c=Y(r,4),d=B(c),m=B(d,!0);y(d);var h=Y(d,2);{let e=l(()=>L(s)===`pinned`?`Pinned release command copied`:`Copy pinned release command`),t=l(()=>L(s)===`pinned`?`Copied`:`Copy command`);W(h,{variant:`ghost`,size:`icon-xs`,get ariaLabel(){return L(e)},get title(){return L(t)},onclick:()=>void u(L(o),`pinned`),children:(e,t)=>{var n=_();M(F(n),()=>L(s)===`pinned`,e=>{var t=_(),n=F(t),r=e=>{var t=O7();oi(B(t),{class:`size-3.5 text-success`,"aria-hidden":`true`}),y(t),T(3,t,()=>Ye,()=>({duration:120})),q(e,t)},i=e=>{var t=O7();af(B(t),{class:`size-3.5`,"aria-hidden":`true`}),y(t),T(3,t,()=>Ye,()=>({duration:120})),q(e,t)};p(n,e=>{L(s)===`pinned`?e(r):e(i,-1)}),q(e,t)}),q(e,n)},$$slots:{default:!0}})}y(c),J(()=>f(m,L(o))),q(e,n)},$$slots:{default:!0}}),g(2),J(()=>f(i,`This version is out of date. Update to ${L(r)??``} to use the latest stable
155
- release.`)),q(e,t)},v=e=>{q(e,ume())},b=e=>{q(e,dme())};p(m,e=>{L(i)&&L(r)&&t.latestRelease?e(h):L(r)?e(v,1):e(b,-1)}),q(e,c)},$$slots:{default:!0}})},$$slots:{trigger:!0,default:!0}})}y(d),J(()=>w(d,1,`version-indicator inline-flex ${L(i)?``:`max-sm:hidden`}`,`svelte-10mwu6d`)),q(e,d),H()}var hme=new Set([`$$slots`,`$$events`,`$$legacy`]);function gme(e,t){let n=U(t,hme),r=[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`}]];G(e,V({name:`diamond`},()=>n,{get iconNode(){return r}}))}var _me=ne(`<path d="m22.5 57.8 35.3-35.3c1.4-1.4 3.6-1.4 5 0l.1.1c1.4 1.4 1.4 3.6 0 5L27.6 62.9c-1.4 1.4-3.6 1.4-5 0l-.1-.1c-1.3-1.4-1.3-3.6 0-5Z"></path><path d="m27.6 22.5 35.3 35.3c1.4 1.4 1.4 3.6 0 5l-.1.1c-1.4 1.4-3.6 1.4-5 0L22.5 27.6c-1.4-1.4-1.4-3.6 0-5l.1-.1c1.4-1.3 3.6-1.3 5 0Z"></path>`,1),vme=ne(`<path d="M17.8 39.1h49.9c1.9 0 3.5 1.6 3.5 3.5v.1c0 1.9-1.6 3.5-3.5 3.5H17.8c-1.9 0-3.5-1.6-3.5-3.5v-.1c0-1.9 1.5-3.5 3.5-3.5Z"></path>`),yme=ne(`<path d="M31.2 20.8h26.7c3.6 0 6.5 2.9 6.5 6.5V54Zm23.2 43.7H27.6c-3.6 0-6.5-2.9-6.5-6.5V31.2Z"></path>`),bme=ne(`<svg viewBox="0 0 85.4 85.4" aria-hidden="true" focusable="false"><circle cx="42.7" cy="42.7" r="42.7"></circle><circle cx="42.7" cy="42.7" r="39.1"></circle><g class="opacity-0 group-hover/window-controls:opacity-100 group-focus-within/window-controls:opacity-100"><!></g></svg>`);function k7(e,t){let n={close:{border:`#e24b41`,fill:`#ed6a5f`,symbol:`#460804`},minimize:{border:`#e1a73e`,fill:`#f6be50`,symbol:`#90591d`},maximize:{border:`#2dac2f`,fill:`#61c555`,symbol:`#2a6218`}};var r=bme(),i=B(r),a=Y(i),o=Y(a),s=B(o),c=e=>{var t=_me();g(),q(e,t)},l=e=>{q(e,vme())},u=e=>{q(e,yme())};p(s,e=>{t.kind===`close`?e(c):t.kind===`minimize`?e(l,1):e(u,-1)}),y(o),y(r),J(()=>{w(r,0,_e(t.class)),A(i,`fill`,n[t.kind].border),A(a,`fill`,n[t.kind].fill),A(o,`fill`,n[t.kind].symbol)}),q(e,r)}var xme=P(`<div class="group/window-controls mr-1.5 flex flex-none items-center gap-2 [-webkit-app-region:no-drag]" aria-label="Window controls"><button type="button" class="size-3.5 rounded-full p-0 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50"><!></button> <button type="button" class="size-3.5 rounded-full p-0 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50" aria-label="Minimize window" title="Minimize"><!></button> <button type="button" class="size-3.5 rounded-full p-0 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50"><!></button></div>`),A7=P(`<div class="flex flex-none items-center gap-0.5 [-webkit-app-region:no-drag]" aria-label="Window controls"><!> <!> <!></div>`),j7=P(`<span class="flex size-4.5 items-center justify-center rounded-full group-hover/linux-control:bg-foreground group-hover/linux-control:text-background group-focus-visible/linux-control:bg-foreground group-focus-visible/linux-control:text-background"><!></span>`),Sme=P(`<span class="flex size-4.5 items-center justify-center rounded-full group-hover/linux-control:bg-destructive/20 group-hover/linux-control:text-destructive group-focus-visible/linux-control:bg-destructive/20 group-focus-visible/linux-control:text-destructive"><!></span>`);function M7(e,t){x(t,!0);let n=K(t,`maximized`,3,!1),r=K(t,`closeToTray`,3,!0),i=K(t,`quitting`,3,!1),a=l(()=>i()?`Closing Nerve`:r()?`Close window to tray`:`Close Nerve`),o=l(()=>i()?`Closing Nerve…`:r()?`Close to tray`:`Close Nerve`);var s=_(),c=F(s),u=e=>{var r=xme(),s=B(r),c=B(s),l=e=>{ke(e,{class:`size-3.5`})},u=e=>{k7(e,{kind:`close`,class:`size-3.5`})};p(c,e=>{i()?e(l):e(u,-1)}),y(s);var d=Y(s,2);k7(B(d),{kind:`minimize`,class:`size-3.5`}),y(d);var f=Y(d,2);k7(B(f),{kind:`maximize`,class:`size-3.5`}),y(f),y(r),J(()=>{A(s,`aria-label`,L(a)),A(s,`title`,L(o)),s.disabled=i(),d.disabled=i(),A(f,`aria-label`,n()?`Restore window`:`Maximize window`),A(f,`title`,n()?`Restore`:`Maximize`),f.disabled=i()}),le(`click`,s,()=>t.onClose?.()),le(`click`,d,()=>t.onMinimize?.()),le(`click`,f,()=>t.onToggleMaximize?.()),q(e,r)},d=e=>{var r=A7(),s=B(r);W(s,{variant:`ghost`,size:`icon-sm`,class:`size-7 rounded-full`,ariaLabel:`Minimize window`,title:`Minimize`,get disabled(){return i()},onclick:()=>t.onMinimize?.(),children:(e,t)=>{TR(e,{class:`size-3.5`,strokeWidth:1.75})},$$slots:{default:!0}});var c=Y(s,2);{let e=l(()=>n()?`Restore window`:`Maximize window`),r=l(()=>n()?`Restore`:`Maximize`);W(c,{variant:`ghost`,size:`icon-sm`,class:`size-7 rounded-full`,get ariaLabel(){return L(e)},get title(){return L(r)},get disabled(){return i()},onclick:()=>t.onToggleMaximize?.(),children:(e,t)=>{var r=_(),i=F(r),a=e=>{af(e,{class:`size-3`,strokeWidth:1.75})},o=e=>{it(e,{class:`size-3`,strokeWidth:1.75})};p(i,e=>{n()?e(a):e(o,-1)}),q(e,r)},$$slots:{default:!0}})}W(Y(c,2),{variant:`ghost`,size:`icon-sm`,class:`size-7 rounded-full hover:bg-destructive-solid hover:text-destructive-solid-foreground focus-visible:bg-destructive-solid focus-visible:text-destructive-solid-foreground`,get ariaLabel(){return L(a)},get title(){return L(o)},get disabled(){return i()},onclick:()=>t.onClose?.(),children:(e,t)=>{var n=_(),r=F(n),a=e=>{ke(e,{})},o=e=>{li(e,{class:`size-3.5`,strokeWidth:1.75})};p(r,e=>{i()?e(a):e(o,-1)}),q(e,n)},$$slots:{default:!0}}),y(r),q(e,r)},f=e=>{var r=A7(),s=B(r);W(s,{variant:`ghost`,size:`icon-sm`,class:`group/linux-control size-7 rounded-full hover:bg-transparent focus-visible:bg-transparent`,ariaLabel:`Minimize window`,title:`Minimize`,get disabled(){return i()},onclick:()=>t.onMinimize?.(),children:(e,t)=>{var n=j7();Za(B(n),{class:`size-3.5`,strokeWidth:2}),y(n),q(e,n)},$$slots:{default:!0}});var c=Y(s,2);{let e=l(()=>n()?`Restore window`:`Maximize window`),r=l(()=>n()?`Restore`:`Maximize`);W(c,{variant:`ghost`,size:`icon-sm`,class:`group/linux-control size-7 rounded-full hover:bg-transparent focus-visible:bg-transparent`,get ariaLabel(){return L(e)},get title(){return L(r)},get disabled(){return i()},onclick:()=>t.onToggleMaximize?.(),children:(e,t)=>{var r=j7(),i=B(r),a=e=>{gme(e,{class:`size-2.5`,strokeWidth:2})},o=e=>{Qa(e,{class:`size-3.5`,strokeWidth:2})};p(i,e=>{n()?e(a):e(o,-1)}),y(r),q(e,r)},$$slots:{default:!0}})}W(Y(c,2),{variant:`ghost`,size:`icon-sm`,class:`group/linux-control size-7 rounded-full hover:bg-transparent focus-visible:bg-transparent`,get ariaLabel(){return L(a)},get title(){return L(o)},get disabled(){return i()},onclick:()=>t.onClose?.(),children:(e,t)=>{var n=_(),r=F(n),a=e=>{ke(e,{})},o=e=>{var t=Sme();li(B(t),{class:`size-3.5`,strokeWidth:2}),y(t),q(e,t)};p(r,e=>{i()?e(a):e(o,-1)}),q(e,n)},$$slots:{default:!0}}),y(r),q(e,r)};p(c,e=>{t.headerType===`macos`?e(u):t.headerType===`windows`?e(d,1):e(f,-1)}),q(e,s),H()}r([`click`]);var Cme=P(`<span class="inline-flex items-center gap-1.5 text-foreground"><span class="brand-mark svelte-a35yzb"><!></span></span> <!>`,1),wme=P(`<span class="absolute -right-1 -top-1 inline-flex min-w-4 items-center justify-center rounded-full bg-info px-1 text-xs font-medium text-info-foreground" aria-hidden="true"> </span>`),Tme=P(`<!> <!>`,1),Eme=P(`<span class="mx-0.5 h-5 w-px bg-border" aria-hidden="true"></span> <!>`,1),Dme=P(`<!> <!> <!> <!> <!> <!>`,1);function Ome(e,t){x(t,!0);let n=K(t,`projects`,19,()=>[]),r=K(t,`desktop`,3,!1),i=K(t,`headerType`,3,`linux`),a=K(t,`maximized`,3,!1),o=K(t,`closeToTray`,3,!0),s=K(t,`quitting`,3,!1),c=K(t,`settingsActive`,3,!1),u=K(t,`guideActive`,3,!1),m=K(t,`incompleteGuideCount`,3,0),h=K(t,`authActive`,3,!1),g=K(t,`logsActive`,3,!1),v=K(t,`applicationLogsEnabled`,3,!1);Ite(e,{get desktop(){return r()},leadingControls:e=>{var n=_(),c=F(n),l=e=>{M7(e,{get headerType(){return i()},get maximized(){return a()},get closeToTray(){return o()},get quitting(){return s()},get onMinimize(){return t.onMinimize},get onToggleMaximize(){return t.onToggleMaximize},get onClose(){return t.onClose}})};p(c,e=>{r()&&i()===`macos`&&e(l)}),q(e,n)},left:e=>{var r=Cme(),i=F(r),a=B(i);ry(B(a),{compact:!0}),y(a),y(i),NZ(Y(i,2),{get items(){return n()},get activeKey(){return t.activeProjectKey},get buildMenuItems(){return t.buildProjectMenuItems},get onSelect(){return t.onSelectProject},get onOpenPicker(){return t.onOpenProject}}),q(e,r)},actions:e=>{var n=_();d(F(n),()=>Cl,(e,n)=>{n(e,{class:`flex min-w-0 flex-none items-center gap-1.5 [-webkit-app-region:no-drag]`,"aria-label":`Application actions`,children:(e,n)=>{var d=Dme(),_=F(d),b=e=>{mme(e,{get currentVersion(){return t.currentVersion},get latestRelease(){return t.latestRelease}})};p(_,e=>{t.currentVersion&&e(b)});var x=Y(_,2);{let e=l(()=>m()>0?`Open Nerve guides, ${m()} incomplete`:`Open Nerve guides`);W(x,{variant:`ghost`,size:`icon-sm`,class:`relative max-sm:hidden`,"data-tour-id":`help`,get ariaLabel(){return L(e)},title:`Open Nerve guides`,get active(){return u()},get pressed(){return u()},onclick:()=>t.onOpenGuide?.(),children:(e,t)=>{var n=Tme(),r=F(n);qe(r,{size:16,strokeWidth:2.1});var i=Y(r,2),a=e=>{var t=wme(),n=B(t,!0);y(t),J(()=>f(n,m())),q(e,t)};p(i,e=>{m()>0&&e(a)}),q(e,n)},$$slots:{default:!0}})}var S=Y(x,2),C=e=>{W(e,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Open Nerve logs`,title:`Open Nerve logs`,get active(){return g()},get pressed(){return g()},onclick:()=>t.onOpenLogs?.(),children:(e,t)=>{hf(e,{size:16,strokeWidth:2.1})},$$slots:{default:!0}})};p(S,e=>{v()&&e(C)});var w=Y(S,2);W(w,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Open authentication`,title:`Providers & authentication`,"data-tour-id":`providers`,get active(){return h()},get pressed(){return h()},onclick:()=>t.onOpenAuth?.(),children:(e,t)=>{pf(e,{size:16,strokeWidth:2.1})},$$slots:{default:!0}});var T=Y(w,2);W(T,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Open settings`,title:`Open settings`,"data-tour-id":`settings`,get active(){return c()},get pressed(){return c()},onclick:()=>t.onOpenSettings?.(),children:(e,t)=>{_f(e,{size:16,strokeWidth:2.1})},$$slots:{default:!0}});var E=Y(T,2),D=e=>{var n=Eme();M7(Y(F(n),2),{get headerType(){return i()},get maximized(){return a()},get closeToTray(){return o()},get quitting(){return s()},get onMinimize(){return t.onMinimize},get onToggleMaximize(){return t.onToggleMaximize},get onClose(){return t.onClose}}),q(e,n)};p(E,e=>{r()&&i()!==`macos`&&e(D)}),q(e,d)},$$slots:{default:!0}})}),q(e,n)},$$slots:{leadingControls:!0,left:!0,actions:!0}}),H()}var kme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`value`]);function N7(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=K(t,`value`,15,``),i=U(t,kme);var a=_(),o=F(a);{let e=l(()=>I(`grid gap-3 w-full`,t.class));d(o,()=>tl,(t,a)=>{a(t,V({"data-slot":`radio-group`,get class(){return L(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)},get value(){return r()},set value(e){r(e)}}))})}q(e,a),H()}var Ame=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`size`]),jme=P(`<div data-slot="radio-group-indicator" class="flex size-full items-center justify-center"><!></div>`);function P7(e,t){x(t,!0);let n=K(t,`ref`,15,null),r=K(t,`size`,3,`default`),i=U(t,Ame);var a=_(),o=F(a);{let e=(e,t)=>{let n=()=>t?.().checked;var i=jme(),a=B(i),o=e=>{{let t=l(()=>I(`bg-primary-foreground absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full`,r()===`sm`?`size-1.5`:`size-2`));jv(e,{get class(){return L(t)}})}};p(a,e=>{n()&&e(o)}),y(i),q(e,i)},a=l(()=>I(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex rounded-full data-[size=default]:size-4 data-[size=sm]:size-3.5 focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,t.class));d(o,()=>il,(t,o)=>{o(t,V({"data-slot":`radio-group-item`,get"data-size"(){return r()},get class(){return L(a)}},()=>i,{get ref(){return n()},set ref(e){n(e)},children:e,$$slots:{default:!0}}))})}q(e,a),H()}var Mme=P(`<span class="text-xs leading-snug text-muted-foreground"> </span>`),Nme=P(`<!> <span class="grid min-w-0 gap-0.5"><span class="text-sm font-medium leading-tight"> </span> <!></span>`,1);function Pme(e,t){x(t,!0);let n=K(t,`items`,19,()=>[]),r=K(t,`value`,15,``),i=K(t,`orientation`,3,`vertical`),a=K(t,`disabled`,3,!1);var o=_(),s=F(o);{let e=l(()=>I(`grid gap-2`,i()===`horizontal`&&`grid-cols-[repeat(auto-fit,minmax(9rem,1fr))]`,t.class));d(s,()=>N7,(o,s)=>{s(o,{get orientation(){return i()},get disabled(){return a()},get"aria-label"(){return t.ariaLabel},get onValueChange(){return t.onValueChange},get class(){return L(e)},get value(){return r()},set value(e){r(e)},children:(e,t)=>{var r=_();O(F(r),17,n,e=>e.value,(e,t)=>{dG(e,{class:`flex cursor-pointer items-start gap-2.5 rounded-md border border-border bg-input/30 p-3 transition-colors hover:bg-accent/50 has-data-[state=checked]:border-primary has-data-[state=checked]:bg-accent`,children:(e,n)=>{var r=Nme(),i=F(r);d(i,()=>P7,(e,n)=>{n(e,{get value(){return L(t).value},get disabled(){return L(t).disabled},class:`mt-0.5`})});var a=Y(i,2),o=B(a),s=B(o,!0);y(o);var c=Y(o,2),l=e=>{var n=Mme(),r=B(n,!0);y(n),J(()=>f(r,L(t).detail)),q(e,n)};p(c,e=>{L(t).detail&&e(l)}),y(a),J(()=>f(s,L(t).label)),q(e,r)},$$slots:{default:!0}})}),q(e,r)},$$slots:{default:!0}})})}q(e,o),H()}var Fme=P(`<!> <!>`,1),Ime=P(`<div class="prune-body svelte-1bkj6xz"><!> <div class="prune-control svelte-1bkj6xz"><!></div> <p class="prune-summary svelte-1bkj6xz">Removes up to <strong class="svelte-1bkj6xz"> </strong> </p></div>`);function Lme(e,t){x(t,!0);let n=K(t,`open`,15,!1),r=K(t,`projectLabel`,3,``),i=K(t,`totalCount`,3,0),a=K(t,`ageEligible`,3,()=>0),o=K(t,`keepEligible`,3,()=>0),s=[{value:`olderThanDays`,label:`By age`,detail:`Remove conversations not updated within the selected window.`},{value:`keepLatest`,label:`By count`,detail:`Keep the most recent conversations and remove the rest.`}],c=[{value:`1`,label:`Older than 1 day`},{value:`2`,label:`Older than 2 days`},{value:`3`,label:`Older than 3 days`},{value:`7`,label:`Older than 7 days`},{value:`14`,label:`Older than 14 days`},{value:`30`,label:`Older than 30 days`},{value:`90`,label:`Older than 90 days`}],u=[{value:`5`,label:`Keep the latest 5`},{value:`10`,label:`Keep the latest 10`},{value:`20`,label:`Keep the latest 20`},{value:`50`,label:`Keep the latest 50`},{value:`100`,label:`Keep the latest 100`}],d=X(`olderThanDays`),m=X(`7`),h=X(`20`),_=l(()=>L(d)===`olderThanDays`?a()(Number(L(m))):o()(Number(L(h))));function v(){return L(d)===`olderThanDays`?{strategy:`olderThanDays`,olderThanDays:Number(L(m))}:{strategy:`keepLatest`,keepLatest:Number(L(h))}}function b(){t.onConfirm?.(v()),n(!1),t.onOpenChange?.(!1)}function S(e){n(e),t.onOpenChange?.(e)}{let t=e=>{var t=Fme(),n=F(t);W(n,{size:`sm`,variant:`ghost`,onclick:()=>S(!1),children:(e,t)=>{g(),q(e,D(`Cancel`))},$$slots:{default:!0}});var r=Y(n,2);{let e=l(()=>L(_)===0);W(r,{size:`sm`,variant:`destructive`,onclick:b,get disabled(){return L(e)},children:(e,t)=>{g(),q(e,D(`Clean up`))},$$slots:{default:!0}})}q(e,t)},a=l(()=>r()?`Choose how to clean up conversations in “${r()}”.`:`Choose how to clean up conversations.`);IF(e,{title:`Clean up conversations`,get description(){return L(a)},size:`sm`,onOpenChange:S,get open(){return n()},set open(e){n(e)},footer:t,children:(e,t)=>{var n=Ime(),r=B(n);Pme(r,{get items(){return s},ariaLabel:`Cleanup strategy`,get value(){return L(d)},set value(e){R(d,e,!0)}});var a=Y(r,2),o=B(a),l=e=>{Ve(e,{get items(){return c},ariaLabel:`Age window`,get value(){return L(m)},set value(e){R(m,e,!0)}})},g=e=>{Ve(e,{get items(){return u},ariaLabel:`Conversations to keep`,get value(){return L(h)},set value(e){R(h,e,!0)}})};p(o,e=>{L(d)===`olderThanDays`?e(l):e(g,-1)}),y(a);var v=Y(a,2),b=Y(B(v)),x=B(b,!0);y(b);var S=Y(b);y(v),y(n),J(()=>{f(x,L(_)),f(S,` of ${i()??``} conversation${i()===1?``:`s`}. Active conversations and tasks are skipped.`)}),q(e,n)},$$slots:{footer:!0,default:!0}})}H()}var F7=[{id:`open-project`,version:1,title:`Open a project`,description:`Choose a project folder so Nerve can keep conversations, files, Git changes, and agent work together.`,priority:`must-do`,lifecycle:`available`,actionLabel:`Start guide`,run:{kind:`setup-coach`,area:`open-project`},completionSignal:`project-open`},{id:`provider`,version:1,title:`Connect a model provider`,description:`Authenticate a subscription, API key, or compatible custom provider before prompting an agent.`,priority:`must-do`,lifecycle:`available`,actionLabel:`Start guide`,run:{kind:`setup-coach`,area:`provider`},completionSignal:`provider-ready`},{id:`voice`,version:1,title:`Enable voice input`,description:`Connect an OpenAI Codex subscription to dictate prompts from the composer.`,priority:`highly-recommended`,lifecycle:`available`,actionLabel:`Start guide`,run:{kind:`setup-coach`,area:`voice`},completionSignal:`voice-ready`},{id:`scoped-models`,version:1,title:`Configure scoped models`,description:`Choose which authenticated models appear in the composer so model selection stays focused.`,priority:`highly-recommended`,lifecycle:`available`,actionLabel:`Start guide`,run:{kind:`setup-coach`,area:`scoped-models`}},{id:`agent-defaults`,version:1,title:`Configure agent defaults`,description:`Choose the mode, permissions, model, and thinking defaults used by new agents.`,priority:`highly-recommended`,lifecycle:`available`,actionLabel:`Start guide`,run:{kind:`setup-coach`,area:`agent-defaults`}},{id:`web-search`,version:1,title:`Set up web search`,description:`Add a Tavily API key to let agents use the web_search tool for current information.`,priority:`optional`,lifecycle:`available`,actionLabel:`Start guide`,run:{kind:`setup-coach`,area:`web-search`},completionSignal:`web-search-ready`},{id:`workbench`,version:1,title:`Work through the Workbench`,description:`Tour conversations, composer controls, panels, Git workflows, tasks, providers, settings, and Help.`,priority:`highly-recommended`,lifecycle:`available`,actionLabel:`Start tour`,run:{kind:`workbench-tour`}}];function Rme(e,t,n){let r=e.completionSignal?n[e.completionSignal]:void 0;return{...e,available:e.lifecycle!==`upcoming`,ready:r,completed:(t[e.id]??0)>=e.version||r===!0}}function zme(e,t,n){return e.map(e=>Rme(e,t,n))}function Bme(e,t){return e.filter(e=>e.available&&e.ready===!0&&(t[e.id]??0)<e.version).map(e=>e.id)}function Vme(e){return e.filter(e=>e.available&&!e.completed).length}function I7(e){let t=e.findIndex(e=>e.available&&!e.completed);return t<0?0:t}function Hme(e,t,n){return t<=0?0:Math.min(t-1,Math.max(0,e+n))}function Ume(e){return e.progressiveActive&&e.settingsLoaded&&e.incompleteCount>0&&e.consideredGeneration!==e.generation}var L7=`nerve.guides.completion`,Wme=`nerve.product-tour.completed-version`,Gme=new Set(F7.map(e=>e.id));function R7(){try{return typeof localStorage>`u`?void 0:localStorage}catch{return}}function z7(e){return Number.isSafeInteger(e)&&Number(e)>=0}function B7(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e))Gme.has(n)&&z7(r)&&(t[n]=r);return t}function Kme(e=R7()){if(!e)return{};try{let t=e.getItem(L7);if(t){let e=JSON.parse(t);return e.schemaVersion===1?B7(e.guides):{}}let n=e.getItem(Wme);if(!n||!/^(0|[1-9]\d*)$/.test(n))return{};let r=Number(n);return Number.isSafeInteger(r)?{workbench:r}:{}}catch{return{}}}function qme(e,t=R7()){if(t)try{let n={schemaVersion:1,guides:B7(e)};t.setItem(L7,JSON.stringify(n))}catch{}}function V7(e,t,n){return!z7(n)||(e[t]??0)>=n?e:{...e,[t]:n}}var H7=[{id:`conversations`,introducedIn:1,title:`Your project conversations`,description:`The Conversations panel keeps every saved conversation for the active project together. Return here to reopen previous work or start something new.`,targetId:`conversations-tab`},{id:`panel-new-conversation`,introducedIn:1,title:`Start from the Conversations panel`,description:`Use New chat in the Conversations panel header to create a conversation in the active project.`,targetId:`panel-new-conversation`},{id:`tab-new-conversation`,introducedIn:1,title:`Start from the editor tabs`,description:`The plus action beside the center editor tabs creates the same new conversation without leaving your current workspace.`,targetId:`tab-new-conversation`},{id:`composer`,introducedIn:1,title:`Write the first prompt`,description:`The tour has opened a pending conversation. Type a prompt here, drop files into the composer, paste images, or use suggestions to begin.`,targetId:`composer`},{id:`permission`,introducedIn:1,title:`Choose a permission level`,description:`Permission controls whether the agent can only read, asks before tool calls, or works autonomously. You can change it before sending a prompt.`,targetId:`composer-permission`},{id:`mode`,introducedIn:1,title:`Switch between coding and planning`,description:`Coding mode implements changes. Planning mode inspects and prepares a reviewed approach before edits.`,targetId:`composer-mode`},{id:`context`,introducedIn:1,title:`Watch context usage`,description:`Open context details to inspect the active model window and compact a long conversation when needed.`,targetId:`composer-context`},{id:`model`,introducedIn:1,title:`Pick the model and thinking level`,description:`Choose an available scoped model and its thinking level for this conversation before the run starts.`,targetId:`composer-model`},{id:`send`,introducedIn:1,title:`Send or dictate your prompt`,description:`Use voice input to dictate when it is configured, then send the prompt to start the agent run.`,targetId:`composer-send-actions`},{id:`history`,introducedIn:1,title:`Navigate and branch conversations`,description:`Conversation History is a graph of messages and branches. Jump to an earlier point or edit from the middle without losing the original path.`,targetId:`conversation-history`},{id:`git`,introducedIn:1,title:`Review Git changes`,description:`Inspect the working tree, review file diffs, and use branch, fetch, and sync actions from the Git Changes panel.`,targetId:`git-workflow`,fallback:`Open a Git project to review local changes.`},{id:`pull-requests`,introducedIn:1,title:`Manage pull requests`,description:`Open GitHub pull requests to inspect checks, commits, changed files, linked conversations, and merge readiness.`,targetId:`pull-request-workflow`,fallback:`Open a GitHub project to use pull request workflows.`},{id:`tasks`,introducedIn:1,title:`Track reusable tasks`,description:`The Tasks panel organizes saved task definitions and their runs so you can launch, monitor, and revisit repeatable agent work.`,targetId:`tasks-panel`},{id:`files`,introducedIn:1,title:`Browse project files`,description:`Use the Files panel to navigate the active project tree, inspect Git status, and open files in the center workspace.`,targetId:`files-panel`},{id:`scratch-notes`,introducedIn:1,title:`Keep scratch notes`,description:`Scratch Notes keeps lightweight project notes close to the conversation without mixing them into agent history.`,targetId:`scratch-notes-panel`},{id:`context-panel`,introducedIn:1,title:`Inspect conversation context`,description:`The Context panel shows the files and other context attached to the active conversation so you can understand what the agent can use.`,targetId:`context-panel`},{id:`providers`,introducedIn:1,title:`Manage model providers`,description:`Open Providers and authentication from the titlebar to connect subscriptions, API keys, and custom model providers.`,targetId:`providers`},{id:`settings`,introducedIn:1,title:`Customize Nerve`,description:`Settings is the central place for workbench preferences, scoped models, agent defaults, suggestions, tools, skills, storage, and system options.`,targetId:`settings`},{id:`status`,introducedIn:1,title:`Usage and live status`,description:`The status bar tracks subscription usage, background tasks, pending approvals, Git state, connection health, layout controls, and zoom.`,targetId:`status-controls`},{id:`help`,introducedIn:1,title:`Return to Nerve guides`,description:`Use Help in the titlebar whenever you want to reopen the Guides catalog or replay a completed guide.`,targetId:`help`},{id:`finish`,introducedIn:1,title:`You are ready to explore`,description:`Your project and Workbench are ready. Return to Nerve guides whenever you want a refresher or new guidance appears.`}];function Jme(e,t,n){return e.filter(e=>n||e.introducedIn>t)}function Yme(e,t,n){return t<=0?0:Math.min(t-1,Math.max(0,e+n))}function Xme(e){let t=e.gap??12,n=e.margin??12,r=Math.max(n,e.viewportWidth-e.calloutWidth-n),i=Math.min(r,Math.max(n,(e.viewportWidth-e.calloutWidth)/2));if(e.centered)return{top:Math.max(n,(e.viewportHeight-e.calloutHeight)/2),left:i,side:`center`};if(e.compact||!e.target)return{top:Math.max(n,e.viewportHeight-e.calloutHeight-n),left:i,side:`center`};let a=e.target.left+e.target.width/2,o=Math.min(r,Math.max(n,a-e.calloutWidth/2));if(e.target.bottom+t+e.calloutHeight<=e.viewportHeight-n)return{top:e.target.bottom+t,left:o,side:`bottom`};if(e.target.top-t-e.calloutHeight>=n)return{top:e.target.top-t-e.calloutHeight,left:o,side:`top`};let s=Math.max(n,e.viewportHeight-e.calloutHeight-n),c=e.target.top+e.target.height/2,l=Math.min(s,Math.max(n,c-e.calloutHeight/2));return e.target.right+t+e.calloutWidth<=e.viewportWidth-n?{top:l,left:e.target.right+t,side:`right`}:e.target.left-t-e.calloutWidth>=n?{top:l,left:e.target.left-t-e.calloutWidth,side:`left`}:{top:Math.max(n,(e.viewportHeight-e.calloutHeight)/2),left:i,side:`center`}}var Zme={"open-project":[{id:`open-project-switcher`,title:`Open the project switcher`,description:`Use the project control in the titlebar to open or switch projects.`,targetId:`guide-project-open`,fallback:`Choose the project icon in the titlebar.`,advanceByClickingTarget:!0},{id:`open-project-browse`,title:`Open a project folder`,description:`Choose Open to find and open a project folder from your computer.`,targetId:`guide-project-browse`,fallback:`The project browser is already open when there are no recent projects.`}],provider:[{id:`provider-subscription`,title:`Connect a subscription`,description:`Use Connections to authenticate a supported subscription provider.`,targetId:`setup-auth-connect-subscription`,fallback:`Open Connections → Subscriptions and choose Connect subscription.`,preparation:{kind:`auth`,pageId:`connections`,sectionId:`subscriptions`}},{id:`provider-api-key`,title:`Add an API key`,description:`API keys are another direct way to connect a model provider. Compatible local or self-hosted endpoints can instead be added from Custom providers.`,targetId:`setup-auth-add-api-key`,fallback:`Open Connections → API keys and choose Add API key. Custom providers remain available separately for compatible local or self-hosted endpoints.`,preparation:{kind:`auth`,pageId:`connections`,sectionId:`api-keys`}}],voice:[{id:`voice-connect`,title:`Connect a subscription`,description:`Voice input uses an OpenAI Codex/ChatGPT subscription connection.`,targetId:`setup-auth-connect-subscription`,fallback:`Open Connections → Subscriptions and choose Connect subscription.`,preparation:{kind:`auth`,pageId:`connections`,sectionId:`subscriptions`},advanceByClickingTarget:!0},{id:`voice-codex-choice`,title:`Choose OpenAI Codex`,description:`Select OpenAI Codex and complete the ChatGPT subscription sign-in. The composer microphone becomes available after connection.`,targetId:`setup-auth-openai-codex-choice`,fallback:`In the provider dialog, select OpenAI Codex. If it is already connected, close the dialog to see the connected row.`,preparation:{kind:`auth`,pageId:`connections`,sectionId:`subscriptions`}}],"scoped-models":[{id:`scoped-models-add`,title:`Choose Add models`,description:`Open the scoped-model catalog to limit which authenticated models appear in the composer.`,targetId:`setup-scoped-models-add`,fallback:`Open Settings → Models and choose Add models.`,preparation:{kind:`settings`,pageId:`models`,sectionId:`models`},advanceByClickingTarget:!0},{id:`scoped-models-catalog`,title:`Search and select models`,description:`Search, filter by provider, and check the models you want in scope.`,targetId:`setup-scoped-models-catalog`,fallback:`Click Add models first; the search, filters, and model catalog will appear in the dialog.`,preparation:{kind:`settings`,pageId:`models`,sectionId:`models`}},{id:`scoped-models-save`,title:`Save the selection`,description:`Save your choices. Leaving every model unchecked is valid and keeps all authenticated models available.`,targetId:`setup-scoped-models-save`,fallback:`In the Add models dialog, choose Save selection when ready.`,preparation:{kind:`settings`,pageId:`models`,sectionId:`models`}}],"web-search":[{id:`web-search-configure`,title:`Configure Tavily`,description:`Tavily powers the web_search tool. Open its configuration to add your API key.`,targetId:`setup-tavily-configure`,fallback:`Open Settings → Tools → Integrations and choose Configure beside Tavily.`,preparation:{kind:`settings`,pageId:`tools`,sectionId:`integrations`},advanceByClickingTarget:!0},{id:`web-search-api-key`,title:`Enter your Tavily API key`,description:`Paste an API key from your Tavily account. Nerve encrypts the key before sending it to the daemon.`,targetId:`setup-tavily-api-key`,fallback:`Choose Configure beside Tavily, then paste your API key into the dialog.`,preparation:{kind:`settings`,pageId:`tools`,sectionId:`integrations`}},{id:`web-search-save`,title:`Save the API key`,description:`Save the key to enable web search for subsequent agent runs.`,targetId:`setup-tavily-save`,fallback:`In the Tavily configuration dialog, choose Save key.`,preparation:{kind:`settings`,pageId:`tools`,sectionId:`integrations`}}],"agent-defaults":[{id:`agent-default-mode`,title:`Choose the default mode`,description:`Set whether new agents begin in coding or planning mode.`,targetId:`setup-agent-default-mode`,fallback:`Open Settings → Agents → Defaults to choose a mode.`,preparation:{kind:`settings`,pageId:`agents`,sectionId:`defaults`}},{id:`agent-default-permission`,title:`Choose default permissions`,description:`Set the approval level new agents use by default.`,targetId:`setup-agent-default-permission`,fallback:`Open Settings → Agents → Defaults to choose a permission level.`,preparation:{kind:`settings`,pageId:`agents`,sectionId:`defaults`}},{id:`agent-explore-model`,title:`Choose the Explore model`,description:`Pick the model and thinking level used by Explore subagents.`,targetId:`setup-agent-explore-model`,fallback:`Open Settings → Agents → Explore agent and use the model picker.`,preparation:{kind:`settings`,pageId:`agents`,sectionId:`explore-agent`}},{id:`agent-default-model`,title:`Choose the main model`,description:`Finish with the main agent model and its default thinking level—the settings you will use most often. Additional approval and compaction controls remain available nearby.`,targetId:`setup-agent-default-model`,fallback:`Open Settings → Agents → Defaults and use the main model picker.`,preparation:{kind:`settings`,pageId:`agents`,sectionId:`defaults`}}]};function Qme(e,t){let n=[...Zme[e]];return e!==`voice`||!t.codexConnected?n:[{id:`voice-connected`,title:`OpenAI Codex is connected`,description:`Your ChatGPT subscription is ready, so the composer microphone is available for voice input.`,targetId:`setup-auth-openai-codex-connected`,fallback:`Open Connections → Subscriptions to review the connected OpenAI Codex provider.`,preparation:{kind:`auth`,pageId:`connections`,sectionId:`subscriptions`}}]}function $me(e,t,n){return t<=0?0:Math.min(t-1,Math.max(0,e+n))}function U7(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function W7(e,t,n){if(!e)return n;let r=t.find(t=>t.provider===e.provider&&t.modelId===e.modelId);return r?.name||r?.label||e.modelId}function ehe(e,t){let n=W7(e.defaultModel,t,`First available scoped model`),r=W7(e.exploreAgent.model,t,`Default model`);return{configured:!!(e.defaultModel&&e.exploreAgent.model),text:`${U7(e.defaultMode)} · ${U7(e.defaultPermissionLevel)} · Main: ${n} (${e.defaultThinkingLevel}) · Explore: ${r} (${e.exploreAgent.thinkingLevel})`}}function the(e){return e===`conversation`||e===`pending-conversation`}var G7=Ie({mode:`closed`,manual:!1,selectedGuideIndex:0,consideredGeneration:void 0,preparing:!1,targetAvailable:!1,runSteps:[],stepIndex:0,activeGuideId:void 0,setupArea:void 0,setupSteps:[],setupStepIndex:0,completionVersions:Kme()}),K7,q7=0;function J7(){return Pi.authProviders.some(e=>e.configured)}function Y7(){return xU(Pi.authProviders)}function X7(){return Pi.authProviders.some(e=>e.provider===`tavily`&&e.configured&&e.credentialType===`api_key`)}function nhe(){let e=Pi.settingsDraft?.scopedModels.length??0;return e===0?`All authenticated models are currently available`:`${e} scoped ${e===1?`model`:`models`} selected`}function rhe(){let e=Pi.settingsDraft;return e?ehe(e,Pi.models):{configured:!1,text:`Agent defaults are loading.`}}function ihe(){return{"project-open":!!dm.activeProject,"provider-ready":J7(),"voice-ready":Y7(),"web-search-ready":X7()}}function Z7(){return zme(F7,G7.completionVersions,ihe())}function Q7(){return Vme(Z7())}function $7(){return Z7()[G7.selectedGuideIndex]}function ahe(e){if(e===`open-project`)return dm.activeProject?`A project is open and ready.`:`No project is open yet.`;if(e===`provider`)return J7()?`A model provider is connected.`:`No model provider is connected.`;if(e===`voice`)return Y7()?`Voice input is ready.`:`Voice input is not connected yet.`;if(e===`scoped-models`)return nhe();if(e===`agent-defaults`)return rhe().text;if(e===`web-search`)return X7()?`Web search is ready with Tavily.`:`A Tavily API key is not configured yet.`;if(e===`workbench`)return`Covers conversations, composer controls, panels, Git, tasks, and settings.`}function e9(e){G7.completionVersions=e,qme(e)}function t9(e){let t=F7.find(t=>t.id===e);if(!t||t.lifecycle===`upcoming`)return;let n=V7(G7.completionVersions,e,t.version);n!==G7.completionVersions&&e9(n)}function ohe(){let e=Z7(),t=G7.completionVersions;for(let n of Bme(e,t)){let e=F7.find(e=>e.id===n);e&&(t=V7(t,n,e.version))}t!==G7.completionVersions&&e9(t)}function she(){if(!yY.progressiveActive||!Pi.settingsDraft)return;ohe();let e=yY.generation;Ume({progressiveActive:yY.progressiveActive,settingsLoaded:!!Pi.settingsDraft,incompleteCount:Q7(),generation:e,consideredGeneration:G7.consideredGeneration})&&(G7.consideredGeneration=e,G7.manual=!1,G7.selectedGuideIndex=I7(Z7()),G7.mode=`catalog`)}function che(){G7.manual=!0,G7.selectedGuideIndex=I7(Z7()),G7.mode=`catalog`}function n9(e){G7.selectedGuideIndex=Hme(G7.selectedGuideIndex,F7.length,e)}function lhe(e){let t=F7.findIndex(t=>t.id===e);t>=0&&(G7.selectedGuideIndex=t),G7.mode=`catalog`}function uhe(){return{shell:uQ(),tabs:wi(),settingsPageId:Pi.activePageId,settingsSectionId:Pi.activeSectionId,historyOpen:!!document.querySelector(`[data-tour-id="conversation-history"]`)}}function r9(){document.querySelector(`[data-tour-id="conversation-history"]`)?.closest(`[data-slot="dialog-content"]`)?.querySelector(`[aria-label="Close dialog"]`)?.click()}function i9(){let e=K7;K7=void 0,e&&(dQ(e.shell),Ti(e.tabs),Pi.activePageId=e.settingsPageId,Pi.activeSectionId=e.settingsSectionId,e.historyOpen||r9())}function a9(e){if(e)return[...document.querySelectorAll(`[data-tour-id="${e}"]`)].find(e=>{let t=e.getBoundingClientRect();return t.width>0&&t.height>0})}function o9(){return G7.runSteps[G7.stepIndex]}function s9(){return G7.setupSteps[G7.setupStepIndex]}var dhe={conversations:`conversations`,"panel-new-conversation":`conversations`,git:`git`,"pull-requests":`pull-requests`,tasks:`tasks`,files:`files`,"scratch-notes":`notes`,"context-panel":`context`};async function c9(){await Ce(),await new Promise(e=>requestAnimationFrame(()=>e()))}async function l9(e){if(!e)return;let t=[];for(let n=e;n;n=n.parentElement)for(let e of n.getAnimations())[`pending`,`running`].includes(e.playState)&&t.push(e);t.length!==0&&(await Promise.allSettled(t.map(e=>e.finished)),await c9())}async function u9(e){let t=++q7;G7.preparing=!0,G7.targetAvailable=!1,e.id!==`history`&&r9();let n=dhe[e.id];n?CQ(n,qZ.isCompact):e.id===`composer`?the(dm.activeCenterTab?.kind)||(Jo(),await Ce()):e.id===`history`&&UX.activeConversation&&uK(),await c9(),await l9(a9(e.targetId)),!(t!==q7||G7.mode!==`tour`)&&(G7.targetAvailable=!!a9(e.targetId),G7.preparing=!1)}async function d9(e,t){let n=performance.now()+t;do{let t=a9(e);if(t)return t;await new Promise(e=>requestAnimationFrame(()=>e()))}while(performance.now()<n)}async function f9(e,t=!1){let n=++q7;G7.preparing=!0,G7.targetAvailable=!1;let r=a9(e.targetId),i=e.preparation;t&&!r&&i?.kind===`auth`?await YH(i.pageId,i.sectionId):t&&!r&&i?.kind===`settings`&&await mt(i.pageId,i.sectionId),await c9(),r=await d9(e.targetId,t?3e3:150),!(n!==q7||![`preparing-coach`,`coach`].includes(G7.mode))&&(r?.scrollIntoView({behavior:`instant`,block:`nearest`,inline:`nearest`}),await c9(),await l9(r),!(n!==q7||![`preparing-coach`,`coach`].includes(G7.mode))&&(G7.mode=`coach`,G7.targetAvailable=!!a9(e.targetId),G7.preparing=!1))}function fhe(e,t){G7.activeGuideId=e,G7.setupArea=t,G7.setupSteps=Qme(t,{codexConnected:Y7()}),G7.setupStepIndex=0,G7.mode=`preparing-coach`;let n=s9();n&&f9(n,!0)}async function p9(e){let t=s9(),n=$me(G7.setupStepIndex,G7.setupSteps.length,e);if(n===G7.setupStepIndex)return;let r=G7.setupSteps[n];e===1&&t?.advanceByClickingTarget&&r&&!a9(r.targetId)&&(G7.preparing=!0,a9(t.targetId)?.click(),await d9(r.targetId,3e3)),G7.setupStepIndex=n,r&&await f9(r)}function m9(){if(G7.activeGuideId===`open-project`&&Q.projectPickerOpen){G7.mode=`closed`;return}G7.mode=`catalog`}function h9(){q7+=1,G7.preparing=!1,G7.mode===`tour`&&i9(),m9()}function g9(){let e=G7.activeGuideId;e&&t9(e),q7+=1,G7.preparing=!1,G7.mode===`tour`&&i9(),m9()}function phe(){let e=F7.find(e=>e.id===`workbench`);if(!e)return;K7??=uhe();let t=G7.completionVersions.workbench??0;G7.runSteps=Jme(H7,t,t>=e.version).filter(e=>e.id!==`history`||UX.activeConversation),G7.runSteps.length===0&&(G7.runSteps=[...H7]),G7.activeGuideId=`workbench`,G7.stepIndex=0,G7.mode=`tour`;let n=o9();n&&u9(n)}function mhe(){let e=$7();if(!(!e||!e.available)){if(!e.run){t9(e.id);return}if(e.run.kind===`setup-coach`){fhe(e.id,e.run.area);return}if(!dm.activeProject){lhe(`open-project`);return}phe()}}function _9(e){let t=Yme(G7.stepIndex,G7.runSteps.length,e);if(t===G7.stepIndex)return;G7.stepIndex=t;let n=o9();n&&u9(n)}function hhe(){q7+=1,G7.mode=`closed`,G7.preparing=!1,i9(),requestAnimationFrame(()=>{document.querySelector(`[data-tour-id="help"]`)?.focus({preventScroll:!0})})}function ghe(){hhe()}var _he=new Set([`$$slots`,`$$events`,`$$legacy`]);function vhe(e,t){let n=U(t,_he),r=[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`}]];G(e,V({name:`circle-dashed`},()=>n,{get iconNode(){return r}}))}var yhe=new Set([`$$slots`,`$$events`,`$$legacy`]);function bhe(e,t){let n=U(t,yhe),r=[[`path`,{d:`M10 5H3`}],[`path`,{d:`M12 19H3`}],[`path`,{d:`M14 3v4`}],[`path`,{d:`M16 17v4`}],[`path`,{d:`M21 12h-9`}],[`path`,{d:`M21 19h-5`}],[`path`,{d:`M21 5h-7`}],[`path`,{d:`M8 10v4`}],[`path`,{d:`M8 12H3`}]];G(e,V({name:`sliders-horizontal`},()=>n,{get iconNode(){return r}}))}var xhe=P(`<!> Back`,1),She=P(`<!> Done`,1),Che=P(`Next <!>`,1),whe=P(`<div class="flex w-full flex-wrap items-center justify-between gap-2"><!> <div class="flex items-center gap-2"><!> <!></div></div>`),The=P(`<span class="text-info">New</span>`),Ehe=P(`<span class="text-muted-foreground">Upcoming</span>`),Dhe=P(`<!> Completed`,1),Ohe=P(`<!> Not completed`,1),khe=P(`<div class="border-l-2 border-border pl-3 text-xs text-muted-foreground"><!></div>`),Ahe=P(`<!> Mark completed`,1),jhe=P(`<div class="flex flex-wrap items-center gap-2"><!> <!></div>`),Mhe=P(`<p class="text-sm text-muted-foreground">This guide will become available with a future release.</p>`),Nhe=P(`<div class="grid gap-6"><div class="grid gap-2"><div class="flex items-center justify-between gap-3 text-xs text-muted-foreground"><span> </span> <span> </span></div> <!></div> <section class="grid min-h-56 content-center gap-4 px-2 py-3 sm:grid-cols-[auto_1fr] sm:items-start sm:px-5" aria-live="polite" aria-labelledby="current-guide-title"><div class="flex size-11 items-center justify-center rounded-lg bg-muted text-foreground"><!></div> <div class="grid max-w-lg gap-4"><div class="grid gap-1.5"><div class="flex flex-wrap items-center gap-x-2 gap-y-1 text-xs"><span> </span> <!> <span class="text-border" aria-hidden="true">·</span> <span><!></span></div> <h2 id="current-guide-title" class="text-lg font-semibold"> </h2> <p class="text-sm leading-relaxed text-muted-foreground"> </p></div> <!> <!></div></section></div>`);function Phe(e,t){x(t,!0);let n={"open-project":ri,provider:WH,voice:TS,"scoped-models":bhe,"agent-defaults":hX,"web-search":H_,workbench:l7},r=l(()=>n[t.guide.id]),i=l(()=>t.index===t.count-1),a=l(()=>t.guide.id===`workbench`&&t.workbenchBlocked?`Open project guide`:t.guide.completed?t.guide.run?.kind===`workbench-tour`?`Replay tour`:`Replay guide`:t.guide.actionLabel??`Got it`),o=l(()=>t.guide.priority===`must-do`?`Must do`:t.guide.priority===`highly-recommended`?`Highly recommended`:`Optional`),s=l(()=>t.guide.completed||!t.guide.available);IF(e,{open:!0,size:`md`,title:`Nerve guides`,description:`Learn the essentials and explore Workbench features at your own pace.`,closeLabel:`Later`,onOpenChange:e=>{e||t.onLater()},footer:e=>{var n=whe(),r=B(n);W(r,{variant:`ghost`,size:`sm`,get onclick(){return t.onLater},children:(e,t)=>{g(),q(e,D(`Later`))},$$slots:{default:!0}});var a=Y(r,2),o=B(a);{let e=l(()=>t.index===0);W(o,{variant:`outline`,size:`sm`,get onclick(){return t.onBack},get disabled(){return L(e)},children:(e,t)=>{var n=xhe();e7(F(n),{class:`size-4`,"aria-hidden":`true`}),g(),q(e,n)},$$slots:{default:!0}})}var c=Y(o,2),u=e=>{{let n=l(()=>L(s)?`default`:`outline`);W(e,{get variant(){return L(n)},size:`sm`,get onclick(){return t.onLater},children:(e,t)=>{var n=She();oi(F(n),{class:`size-4`,"aria-hidden":`true`}),g(),q(e,n)},$$slots:{default:!0}})}},d=e=>{{let n=l(()=>L(s)?`default`:`outline`);W(e,{get variant(){return L(n)},size:`sm`,get onclick(){return t.onNext},children:(e,t)=>{g();var n=Che();$L(Y(F(n)),{class:`size-4`,"aria-hidden":`true`}),q(e,n)},$$slots:{default:!0}})}};p(c,e=>{L(i)?e(u):e(d,-1)}),y(a),y(n),q(e,n)},children:(e,n)=>{var i=Nhe(),s=B(i),c=B(s),u=B(c),m=B(u);y(u);var h=Y(u,2),_=B(h,!0);y(h),y(c);var v=Y(c,2);{let e=l(()=>t.index+1),n=l(()=>`Guide ${t.index+1} of ${t.count}`);uv(v,{get value(){return L(e)},get max(){return t.count},get"aria-label"(){return L(n)}})}y(s);var b=Y(s,2),x=B(b);d(B(x),()=>L(r),(e,t)=>{t(e,{class:`size-5`,"aria-hidden":`true`})}),y(x);var S=Y(x,2),C=B(S),T=B(C),E=B(T),O=B(E,!0);y(E);var k=Y(E,2),ee=e=>{q(e,The())},A=e=>{q(e,Ehe())};p(k,e=>{t.guide.lifecycle===`new`?e(ee):t.guide.lifecycle===`upcoming`&&e(A,1)});var j=Y(k,4),M=B(j),N=e=>{var t=Dhe();Ja(F(t),{class:`size-3.5`,"aria-hidden":`true`}),g(),q(e,t)},te=e=>{var t=Ohe();vhe(F(t),{class:`size-3.5`,"aria-hidden":`true`}),g(),q(e,t)};p(M,e=>{t.guide.completed?e(N):e(te,-1)}),y(j),y(T);var ne=Y(T,2),P=B(ne,!0);y(ne);var re=Y(ne,2),ie=B(re,!0);y(re),y(C);var I=Y(C,2),ae=e=>{var n=khe(),r=B(n),i=e=>{q(e,D(`Open a project before starting this tour.`))},a=e=>{var n=D();J(()=>f(n,t.summary)),q(e,n)};p(r,e=>{t.guide.id===`workbench`&&t.workbenchBlocked?e(i):e(a,-1)}),y(n),q(e,n)};p(I,e=>{(t.summary||t.guide.id===`workbench`&&t.workbenchBlocked)&&e(ae)});var R=Y(I,2),oe=e=>{var n=jhe(),r=B(n),i=e=>{{let n=l(()=>t.guide.completed?`outline`:`default`);W(e,{get variant(){return L(n)},size:`sm`,get onclick(){return t.onStart},children:(e,t)=>{g();var n=D();J(()=>f(n,L(a))),q(e,n)},$$slots:{default:!0}})}};p(r,e=>{(t.guide.run||!t.guide.completed)&&e(i)});var o=Y(r,2),s=e=>{W(e,{variant:`ghost`,size:`sm`,get onclick(){return t.onMarkCompleted},children:(e,t)=>{var n=Ahe();oi(F(n),{class:`size-4`,"aria-hidden":`true`}),g(),q(e,n)},$$slots:{default:!0}})};p(o,e=>{t.guide.run&&!t.guide.completed&&e(s)}),y(n),q(e,n)},se=e=>{q(e,Mhe())};p(R,e=>{t.guide.available?e(oe):e(se,-1)}),y(S),y(b),y(i),J(()=>{f(m,`Guide ${t.index+1} of ${t.count??``}`),f(_,t.guide.title),w(E,1,_e(t.guide.priority===`must-do`?`font-medium text-warning`:`font-medium text-muted-foreground`)),f(O,L(o)),w(j,1,_e(t.guide.completed?`inline-flex items-center gap-1 text-success`:`inline-flex items-center gap-1 text-muted-foreground`)),f(P,t.guide.title),f(ie,t.guide.description)}),q(e,i)},$$slots:{footer:!0,default:!0}}),H()}var Fhe=P(`<div></div> <div></div> <div></div> <div></div> <div class="fixed rounded-lg ring-2 ring-primary ring-offset-2 ring-offset-background/80" aria-hidden="true"></div>`,1),Ihe=P(`<div></div>`),Lhe=P(`<p class="rounded-md bg-muted p-3 text-xs text-muted-foreground"> </p>`),Rhe=P(`<p class="text-xs text-muted-foreground">Opening this feature…</p>`),zhe=P(`<!> Back`,1),Bhe=P(`<!> `,1),Vhe=P(`Next <!>`,1),Hhe=P(`<div role="presentation"><!> <div role="dialog" aria-labelledby="guided-tour-title" aria-describedby="guided-tour-description"><div class="grid gap-2"><div class="flex items-center justify-between gap-3 text-xs text-muted-foreground"><span> </span> <span> </span></div> <!></div> <div class="grid gap-2" aria-live="polite"><h2 id="guided-tour-title" class="text-base font-semibold text-foreground"> </h2> <p id="guided-tour-description" class="text-sm leading-relaxed text-muted-foreground"> </p> <!></div> <div class="flex flex-wrap items-center justify-between gap-2"><!> <div class="flex items-center gap-2"><!> <!></div></div></div></div>`);function v9(e,t){x(t,!0);let n=K(t,`variant`,3,`modal`),r=K(t,`preparing`,3,!1),i=K(t,`compact`,3,!1),a=X(void 0),o=X(null),s=X(384),c=X(220),d=X(Ie(typeof window>`u`?1024:window.innerWidth)),m=X(Ie(typeof window>`u`?768:window.innerHeight)),h=l(()=>n()===`modal`),_=l(()=>t.index===t.count-1),v=l(()=>`introducedIn`in t.step&&t.step.id===`finish`||L(_)&&!L(a)),b=l(()=>Xme({target:L(a),viewportWidth:L(d),viewportHeight:L(m),calloutWidth:L(s),calloutHeight:L(c),compact:i(),centered:L(v)}));function S(){if(t.step.targetId)return[...document.querySelectorAll(`[data-tour-id="${t.step.targetId}"]`)].find(e=>{let t=e.getBoundingClientRect();return t.width>0&&t.height>0})}function C(){R(d,window.innerWidth,!0),R(m,window.innerHeight,!0);let e=S();if(!e)R(a,void 0);else{let t=e.getBoundingClientRect(),n=Math.max(0,t.left-6),r=Math.max(0,t.top-6),i=Math.min(window.innerWidth,t.right+6),o=Math.min(window.innerHeight,t.bottom+6);R(a,{top:r,right:i,bottom:o,left:n,width:i-n,height:o-r},!0)}if(L(o)){let e=L(o).getBoundingClientRect();R(s,e.width,!0),R(c,e.height,!0)}}z(()=>{let e=t.step.targetId,n=L(h);Ce().then(()=>{C(),n&&L(o)?.focus({preventScroll:!0})});let r=e?S():void 0,i=new ResizeObserver(C),a=new MutationObserver(C);return r?i.observe(r):e&&a.observe(document.body,{childList:!0,subtree:!0}),L(o)&&i.observe(L(o)),()=>{i.disconnect(),a.disconnect()}});function T(e){if(e.key===`Escape`){e.preventDefault(),t.onClose();return}if(!L(h)||e.key!==`Tab`||!L(o))return;let n=[...L(o).querySelectorAll(`button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])`)];if(n.length===0)return;let r=n.indexOf(document.activeElement);e.shiftKey&&r<=0?(e.preventDefault(),n.at(-1)?.focus()):!e.shiftKey&&r===n.length-1&&(e.preventDefault(),n[0]?.focus())}var E=Hhe();Ae(`resize`,pe,C),Ae(`scroll`,pe,C),Ae(`keydown`,pe,T);var O=B(E),k=e=>{var t=Fhe(),n=F(t);let r;var i=Y(n,2);let o;var s=Y(i,2);let c;var l=Y(s,2);let d;var f=Y(l,2);let p;J(()=>{w(n,1,`fixed left-0 right-0 top-0 ${L(h)?`bg-background/60`:`bg-background/30`}`),r=u(n,``,r,{height:`${L(a).top}px`}),w(i,1,`fixed bottom-0 left-0 right-0 ${L(h)?`bg-background/60`:`bg-background/30`}`),o=u(i,``,o,{top:`${L(a).bottom}px`}),w(s,1,`fixed left-0 ${L(h)?`bg-background/60`:`bg-background/30`}`),c=u(s,``,c,{top:`${L(a).top}px`,width:`${L(a).left}px`,height:`${L(a).height}px`}),w(l,1,`fixed right-0 ${L(h)?`bg-background/60`:`bg-background/30`}`),d=u(l,``,d,{top:`${L(a).top}px`,left:`${L(a).right}px`,height:`${L(a).height}px`}),p=u(f,``,p,{top:`${L(a).top}px`,left:`${L(a).left}px`,width:`${L(a).width}px`,height:`${L(a).height}px`})}),q(e,t)},ee=e=>{var t=Ihe();J(()=>w(t,1,`fixed inset-0 ${L(h)?`bg-background/60`:`bg-background/30`}`)),q(e,t)};p(O,e=>{L(a)?e(k):e(ee,-1)});var j=Y(O,2);let M;var N=B(j),te=B(N),ne=B(te),P=B(ne,!0);y(ne);var re=Y(ne,2),I=B(re);y(re),y(te);var ae=Y(te,2);{let e=l(()=>t.index+1),n=l(()=>`${L(h)?`Workbench tour`:`Guide`} progress`);uv(ae,{get value(){return L(e)},get max(){return t.count},get"aria-label"(){return L(n)}})}y(N);var oe=Y(N,2),se=B(oe),ce=B(se,!0);y(se);var le=Y(se,2),ue=B(le,!0);y(le);var de=Y(le,2),fe=e=>{var n=Lhe(),r=B(n,!0);y(n),J(()=>f(r,t.step.fallback)),q(e,n)},V=e=>{q(e,Rhe())};p(de,e=>{!L(a)&&t.step.fallback?e(fe):r()&&e(V,1)}),y(oe);var me=Y(oe,2),he=B(me);W(he,{variant:`ghost`,size:`sm`,get onclick(){return t.onClose},children:(e,t)=>{g();var n=D();J(()=>f(n,L(h)?`Not now`:`Close guide`)),q(e,n)},$$slots:{default:!0}});var ge=Y(he,2),_e=B(ge);{let e=l(()=>t.index===0||r());W(_e,{variant:`outline`,size:`sm`,get disabled(){return L(e)},get onclick(){return t.onBack},children:(e,t)=>{var n=zhe();e7(F(n),{class:`size-3.5`,"aria-hidden":`true`}),g(),q(e,n)},$$slots:{default:!0}})}var ve=Y(_e,2),ye=e=>{W(e,{size:`sm`,get disabled(){return r()},get onclick(){return t.onComplete},children:(e,t)=>{var n=Bhe(),r=F(n);oi(r,{class:`size-3.5`,"aria-hidden":`true`});var i=Y(r);J(()=>f(i,` ${L(h)?`Finish`:`Finish guide`}`)),q(e,n)},$$slots:{default:!0}})},be=e=>{W(e,{size:`sm`,get disabled(){return r()},get onclick(){return t.onNext},children:(e,t)=>{g();var n=Vhe();$L(Y(F(n)),{class:`size-3.5`,"aria-hidden":`true`}),q(e,n)},$$slots:{default:!0}})};p(ve,e=>{L(_)?e(ye):e(be,-1)}),y(ge),y(me),y(j),ie(j,e=>R(o,e),()=>L(o)),y(E),J(()=>{w(E,1,`fixed inset-0 z-100 ${L(h)?``:`pointer-events-none`}`),w(j,1,`fixed grid max-w-[calc(100vw-1.5rem)] gap-4 rounded-xl border border-border bg-popover p-5 text-popover-foreground shadow-xl outline-none ${L(h)?`w-96`:`pointer-events-auto w-80`}`),A(j,`aria-modal`,L(h)?`true`:`false`),A(j,`tabindex`,L(h)?-1:void 0),M=u(j,``,M,{top:`${L(b).top}px`,left:`${L(b).left}px`}),f(P,L(h)?`Workbench tour`:`Guide`),f(I,`Step ${t.index+1} of ${t.count??``}`),f(ce,t.step.title),f(ue,t.step.description)}),q(e,E),H()}function Uhe(e,t){x(t,!0),z(()=>{qZ.isPhone||she()});let n=l(o9),r=l(s9),i=l(Z7),a=l($7);var o=_(),s=F(o),c=e=>{{let t=l(()=>ahe(L(a).id)),n=l(()=>!dm.activeProject);Phe(e,{get guide(){return L(a)},get summary(){return L(t)},get index(){return G7.selectedGuideIndex},get count(){return L(i).length},get workbenchBlocked(){return L(n)},onBack:()=>n9(-1),onNext:()=>n9(1),get onStart(){return mhe},onMarkCompleted:()=>t9(L(a).id),get onLater(){return ghe}})}},u=e=>{v9(e,{get step(){return L(n)},variant:`modal`,get index(){return G7.stepIndex},get count(){return G7.runSteps.length},get preparing(){return G7.preparing},get compact(){return qZ.isCompact},onBack:()=>_9(-1),onNext:()=>_9(1),get onComplete(){return g9},get onClose(){return h9}})},d=e=>{v9(e,{get step(){return L(r)},variant:`coach`,get index(){return G7.setupStepIndex},get count(){return G7.setupSteps.length},get preparing(){return G7.preparing},compact:!1,onBack:()=>void p9(-1),onNext:()=>void p9(1),get onComplete(){return g9},get onClose(){return h9}})};p(s,e=>{!qZ.isPhone&&G7.mode===`catalog`&&L(a)?e(c):!qZ.isPhone&&G7.mode===`tour`&&L(n)?e(u,1):!qZ.isPhone&&G7.mode===`coach`&&L(r)&&e(d,2)}),q(e,o),H()}function Whe(e,t){return e===`auto`?t===`darwin`?`macos`:t===`win32`?`windows`:`linux`:e}var Ghe=P(`<!> <!> <!>`,1);function Khe(e,t){x(t,!0);let n=l(()=>dm.projectSwitcherItems),r=l(()=>dm.status),i=l(()=>dm.conversations),a=Cp(`conversation.new`),o=X(void 0),s=X(void 0),c=l(()=>qZ.isPhone?1:qZ.isCompact?2:5),u=l(()=>Kp(L(n),Q.selectedProjectKey,L(c))),d=l(()=>dm.activeCenterTab),f=l(()=>QX.settingsDraft),p=l(()=>Whe(L(f)?.desktop.headerType??`auto`,Dr.platform)),m=l(Q7),h=l(()=>Dr.quitting||Xd.quitRequested),g=l(()=>({homeDir:L(r)?.storage.userHome,newConversationShortcut:a,editorAvailability:L(r)?.runtime.editors,conversationCount:e=>pZ(L(i),e),onNewConversationInProject:os,onOpenProjectInEditor:(e,t)=>void Xo(e,t),requestPrune:e=>{R(s,{id:e.id,label:zi(e.dir,L(r)?.storage.userHome)},!0)},requestDelete:e=>R(o,e,!0)}));function _(e){return vZ(e.project,L(g))}function v(){L(o)?.kind===`project`&&ns(L(o).id)}function y(e){L(s)&&$o(L(s).id,e)}function b(){Q.projectPickerOpen=!0}async function S(){let e=L(f)?.desktop.closeToTray??!0;e||(Xd.quitRequested=!0,Dr.quitting=!0);try{await Qn({closeToTray:e})}catch(t){e||(Xd.quitRequested=!1,Dr.quitting=!1),Q.error=t instanceof Error?t.message:String(t)}}var C=Ghe(),w=F(C);{let e=l(()=>L(f)?.desktop.closeToTray??!0),t=l(()=>L(d)?.kind===`settings`),n=l(()=>G7.mode===`catalog`||G7.mode===`tour`||G7.mode===`preparing-coach`||G7.mode===`coach`),i=l(()=>L(d)?.kind===`auth`),a=l(()=>L(d)?.kind===`logs`),o=l(()=>L(r)?.capabilities.applicationLogs??!1),s=l(()=>L(r)?.version);Ome(w,{get projects(){return L(u)},get activeProjectKey(){return Q.selectedProjectKey},get desktop(){return Dr.isDesktop},get headerType(){return L(p)},get maximized(){return Dr.windowState.maximized},get closeToTray(){return L(e)},get quitting(){return L(h)},get settingsActive(){return L(t)},get guideActive(){return L(n)},get incompleteGuideCount(){return L(m)},get authActive(){return L(i)},get logsActive(){return L(a)},get applicationLogsEnabled(){return L(o)},get currentVersion(){return L(s)},get latestRelease(){return f7.latest},buildProjectMenuItems:_,onOpenProject:b,onSelectProject:e=>void cs(e),onOpenLogs:()=>XY(),get onOpenGuide(){return che},onOpenAuth:()=>YH(),onOpenSettings:()=>void mt(),onMinimize:()=>void Gn(),onToggleMaximize:()=>void Kn(),onClose:()=>void S()})}var T=Y(w,2);{let e=l(()=>L(o)?.kind===`project`),t=l(()=>L(o)?`This removes “${L(o).label}” from Nerve and deletes its Nerve conversations. Files on disk are not deleted.`:``);Tr(T,{get open(){return L(e)},title:`Remove project?`,get description(){return L(t)},confirmLabel:`Remove`,destructive:!0,onConfirm:v,onOpenChange:e=>{e||R(o,void 0)}})}var E=Y(T,2);{let e=l(()=>!!L(s)),t=l(()=>L(s)?.label??``),n=l(()=>L(s)?pZ(L(i),L(s).id):0);Lme(E,{get open(){return L(e)},get projectLabel(){return L(t)},get totalCount(){return L(n)},ageEligible:e=>L(s)?mZ(L(i),L(s).id,e):0,keepEligible:e=>L(s)?hZ(L(i),L(s).id,e):0,onConfirm:y,onOpenChange:e=>{e||R(s,void 0)}})}q(e,C),H()}var qhe=new Set([`$$slots`,`$$events`,`$$legacy`]);function y9(e,t){let n=U(t,qhe),r=[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`}]];G(e,V({name:`bell`},()=>n,{get iconNode(){return r}}))}var Jhe=P(`<aside class="fixed right-4 bottom-4 z-50 w-[min(24rem,calc(100vw-2rem))] rounded-lg border border-border bg-card p-4 text-card-foreground shadow-lg" aria-live="polite" aria-label="Notification permission"><div class="flex gap-3"><div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground"><!></div> <div class="min-w-0 flex-1 space-y-3"><div class="space-y-1"><h2 class="text-sm font-medium">Enable desktop notifications</h2> <p class="text-sm text-muted-foreground">Let Nerve alert you when an agent needs approval, asks a question,
156
- or finishes in the background.</p></div> <div class="flex flex-wrap justify-end gap-2"><!> <!></div></div></div></aside>`);function Yhe(e,t){x(t,!1),fe();var n=_(),r=F(n),i=e=>{var t=Jhe(),n=B(t),r=B(n);y9(B(r),{class:`size-4`,strokeWidth:2}),y(r);var i=Y(r,2),a=Y(B(i),2),o=B(a);W(o,{variant:`ghost`,size:`sm`,get onclick(){return vi},children:(e,t)=>{g(),q(e,D(`Not now`))},$$slots:{default:!0}}),W(Y(o,2),{size:`sm`,onclick:()=>void gi(),children:(e,t)=>{g(),q(e,D(`Enable notifications`))},$$slots:{default:!0}}),y(a),y(i),y(n),y(t),q(e,t)};p(r,e=>{hi.promptVisible&&e(i)}),q(e,n),H()}var Xhe=P(`<!> <!> <!>`,1),Zhe=P(`<!> <!>`,1);function Qhe(e,t){x(t,!0);let n=l(()=>qZ.isCompact),r=l(()=>dm.activeCenterTab);function i(e){return Object.entries(sQ.current.docks).some(([t,r])=>!r.activeViewId||!e.includes(r.activeViewId)?!1:L(n)?t===`left`?oQ.primary:oQ.secondary:!r.collapsed)}let a=l(()=>i([`git`,`pull-requests`])),o=l(()=>i([`pull-requests`])),s=YX(()=>dm.activeProject,()=>L(a),()=>L(o)),c;z(()=>{let e=L(r)?`${L(r).kind}:${L(r).id}`:void 0;e!==c&&(c=e,oQ.primary&&bQ())}),z(()=>{!L(n)&&(oQ.primary||oQ.secondary)&&bQ()});var u=Zhe(),d=F(u);{let e=e=>{Khe(e,{})},t=e=>{rZ(e,{})},r=(e,t=N)=>{TQ(e,{get viewId(){return t()},get gitModel(){return s.model},get gitActions(){return s.actions}})},i=e=>{qpe(e,{})},a=e=>{var t=Xhe(),n=F(t);Yhe(n,{});var r=Y(n,2);Uhe(r,{}),Qd(Y(r,2),{}),q(e,t)},o=l(()=>({onActivateView:fQ,onMoveView:pQ,onHideView:mQ,onToggleDock:hQ,onDockResize:vQ,onSheetOpenChange:yQ}));Yd(d,{get layout(){return sQ.current},get descriptors(){return eQ},get compact(){return L(n)},get primarySheetOpen(){return oQ.primary},get secondarySheetOpen(){return oQ.secondary},get actions(){return L(o)},titlebar:e,editor:t,panelView:r,statusBar:i,overlays:a,$$slots:{titlebar:!0,editor:!0,panelView:!0,statusBar:!0,overlays:!0}})}fpe(Y(d,2),{}),q(e,u),H()}function $he(e){let t=b9(e);return t?cr(e.type,e.data)===gr(t):!1}function b9(e){let t=e.data?.conversationId;if(typeof t==`string`)return t;let n=e.data?.entry;if(typeof n?.conversationId==`string`)return n.conversationId;let r=e.data?.toolCall;if(typeof r?.conversationId==`string`)return r.conversationId}function x9(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function S9(e){return un.conversationId===e}function C9(e){return Q.openCenterTabs.some(t=>t.kind===`conversation`&&t.id===e)}function ege(e){S9(e.conversationId)&&(Q.error=e.error)}function tge(e,t){if(e.activeEntryIds.indexOf(t.id)!==-1)return!0;let n=e.activeEntryId??e.activeEntryIds.at(-1);return n?t.parentEntryId===n:e.activeEntryIds.length===0&&!t.parentEntryId}function nge(e,t){Q.conversations=Q.conversations.map(n=>n.id===e?{...n,activeEntryId:t,updatedAt:new Date().toISOString()}:n)}function rge(e,t){if(e.treeNodes.find(e=>e.entry.id===t.id)){e.treeNodes=e.treeNodes.map(e=>e.entry.id===t.id?{...e,entry:t}:e);return}e.treeNodes=[...e.treeNodes.map(e=>t.parentEntryId&&e.entry.id===t.parentEntryId?{...e,childEntryIds:Array.from(new Set([...e.childEntryIds,t.id]))}:e),{entry:t,childEntryIds:[]}]}var w9=new Map,ige=1e3;function T9(e){let t=w9.get(e);t&&(clearTimeout(t),w9.delete(e))}function E9(e){if(!C9(e))return;T9(e);let t=setTimeout(()=>{w9.delete(e),age(e)},ige);w9.set(e,t)}async function age(e){if(!C9(e))return;let t=await io(e).catch(()=>void 0),n=Yi.conversationViews[$i(e)];!t||!n||(n.contextUsage=t)}function D9(e){return e&&typeof e==`object`?e:void 0}function oge(e){let t=D9(e.details),n=D9(t?.details);for(let e of[t?.toolCall,n?.toolCall]){let t=wr.safeParse(e);if(t.success)return t.data}}function sge(e,t){if(t){if(t.hidden){e.toolCalls=e.toolCalls.filter(e=>e.id!==t.id);return}e.toolCalls=e.toolCalls.findIndex(e=>e.id===t.id)===-1?[...e.toolCalls,t]:e.toolCalls.map(e=>e.id===t.id?t:e)}}function cge(e){let t=b9(e);if(!t||!C9(t))return;let n=ms(t),r=e.type===`conversation.entry.appended`?e.data?.entry:void 0;if(e.type===`conversation.entry.appended`&&r&&e.seq>n.cursorSeq&&!tge(n,r)){O9(n,t,Error(`Conversation branch diverged from the active snapshot`)),E9(t);return}let i=!1,a;try{a=on(n,e,{consumeUnhandled:!0,onGap:()=>{i=!0}})}catch(e){if(!(e instanceof ir))throw e;O9(n,t,e);return}if(i){O9(n,t,Error(`Conversation event gap at ${e.type}`));return}let o=n;if(a!==n){let e=$i(t);Yi.conversationViews[e]=a,o=Yi.conversationViews[e]}lge(o,e,r),ege(o)}function O9(e,t,n){e.error=`Conversation state corrupted — resyncing`,console.error(`Conversation event invariant violated`,{conversationId:t,error:n}),rs(gr(t)),Uo(t)}function lge(e,t,n){let r=e.conversationId;switch(t.type){case`conversation.entry.appended`:if(!n)break;e.activeEntryId=n.id,rge(e,n),nge(r,n.id),S9(r)&&(un.entryId=n.id),e.optimisticMessages=Mo(e.optimisticMessages,n),sge(e,oge(n)),E9(r);break;case`conversation.context.updated`:T9(r);break;case`run.completed`:Fo(e),Uo(r).then(()=>{un.conversationId===r&&Ho(r)}),S9(r)&&fY(x9(t.data?.projectId));break;case`run.cancelled`:Fo(e);break;case`run.failed`:Fo(e);break;case`run.suspended`:e.optimisticMessages=[];break;case`run.waiting`:vo(e,x9(t.data?.runId));break}}function uge(){return oU(dge)}function dge(e){if(!rU(e))return;let t=b9(e);if(t&&C9(t)&&$he(e)){cge(e),(e.type===`conversation.compacted`||e.type===`conversation.navigated`)&&Uo(t);return}if(e.type===`agent.configured`){let t=e.data?.agent;typeof t?.conversationId==`string`&&E9(t.conversationId)}}function fge(e,t){switch(e.type){case`approval.updated`:return M9(e.data.approval)?.status===`pending`?pge(e,t):void 0;case`userQuestion.updated`:return M9(e.data.question)?.status===`pending`?mge(e,t):void 0;case`planReview.updated`:return M9(e.data.planReview)?.status===`pending`?hge(e,t):void 0;case`run.completed`:return gge(e,t);case`run.failed`:return _ge(e,t);case`run.suspended`:return;default:return}}function pge(e,t){let n=M9(e.data?.approval),r=M9(e.data?.toolCall),i=N9(r?.toolName),a=N9(n?.risk)??N9(r?.risk),o=N9(n?.reason);return{backgroundOnly:!1,kind:`error`,soundEvent:`approval`,tag:P9(`approval`,N9(n?.id)),payload:{title:i?`Approval needed: ${i}`:`Approval needed`,body:j9([a?`Risk: ${a}`:void 0,o??`An agent is waiting for tool approval.`,k9(e,t)]),urgency:`attention`}}}function mge(e,t){let n=M9(e.data?.question),r=N9(n?.question),i=N9(n?.context),a=N9(n?.recommendation);return{backgroundOnly:!1,kind:`error`,soundEvent:`question`,tag:P9(`question`,N9(n?.id)),payload:{title:`Nerve needs your answer`,body:j9([r??`An agent asked a question.`,i?`Context: ${i}`:void 0,a?`Recommendation: ${a}`:void 0,k9(e,t)]),urgency:`attention`}}}function hge(e,t){let n=M9(e.data?.planReview),r=N9(n?.title),i=N9(n?.summary),a=N9(n?.planPath);return{backgroundOnly:!1,kind:`error`,soundEvent:`planReview`,tag:P9(`plan-review`,N9(n?.id)),payload:{title:r?`Plan ready: ${r}`:`Plan ready for review`,body:j9([r,i??`An agent submitted a plan for review.`,a?`Plan: ${a}`:void 0,k9(e,t)]),urgency:`attention`}}}function gge(e,t){return{backgroundOnly:!0,kind:`success`,soundEvent:`completed`,tag:P9(`run-completed`,N9(e.data?.runId)),payload:{title:`Agent run completed`,body:j9([k9(e,t)])??`Nerve finished a run.`,urgency:`normal`}}}function _ge(e,t){if(e.data?.aborted===!0)return;let n=M9(e.data?.retryExhausted);if(n){let r=xge(n.maxRetries),i=N9(n.errorMessage)??N9(e.data?.message);return{backgroundOnly:!1,kind:`error`,soundEvent:`failed`,tag:P9(`run-retry-exhausted`,N9(e.data?.runId)),payload:{title:`Model request needs retry`,body:j9([r===void 0?`Model request failed after retries. Open Nerve and click Continue.`:`Model request failed after ${r} ${r===1?`retry`:`retries`}. Open Nerve and click Continue.`,i,k9(e,t)]),urgency:`attention`}}}return{backgroundOnly:!0,kind:`error`,soundEvent:`failed`,tag:P9(`run-failed`,N9(e.data?.runId)),payload:{title:`Agent run failed`,body:j9([N9(e.data?.message)??`Nerve hit an agent error.`,k9(e,t)]),urgency:`attention`}}}function k9(e,t){return j9([vge(e,t),yge(e,t)])}function vge(e,t){let n=A9(e,`conversationId`);if(!n)return;let r=t.conversations.find(e=>e.id===n)?.title;return r?`Chat: ${r}`:void 0}function yge(e,t){let n=A9(e,`projectId`);if(!n)return;let r=t.projects.find(e=>e.id===n);if(r)return`Project: ${r.name||r.dir}`}function A9(e,t){let n=N9(e.data?.[t]);if(n)return n;for(let n of[`approval`,`question`,`planReview`,`toolCall`]){let r=N9(M9(e.data?.[n])?.[t]);if(r)return r}}function j9(e){let t=e.filter(Boolean).join(` · `);return t?bge(t):void 0}function bge(e){let t=e.replace(/\s+/g,` `).trim();return t.length<=220?t:`${t.slice(0,219)}…`}function M9(e){return e&&typeof e==`object`?e:void 0}function N9(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function xge(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function P9(e,t){return t?`nerve:${e}:${t}`:void 0}var F9;function Sge(){return F9||(F9=oU(Cge),()=>{F9?.(),F9=void 0})}function Cge(e){if(!rU(e)||!wge(e))return;let t=fge(e,{projects:Q.projects,conversations:Q.conversations});t&&xi(t.payload,{backgroundOnly:t.backgroundOnly,kind:t.kind,soundEvent:t.soundEvent,tag:t.tag})}function wge(e){let t=Date.parse(e.ts);return Number.isFinite(t)&&Date.now()-t<6e4}var Tge=new Set([`branch.created`,`branch.switched`,`branch.synced`,`base.updated`,`remote.fetched`,`remote.pulled`,`remote.pushed`,`github.pr.checked_out`]);function Ege(e){let t=I9(e.data?.projectId),n=I9(e.data?.repo);if(!t?.startsWith(`proj_`)||!n)return;if(e.type===`git.repository.invalidated`)return{projectId:t,repo:n,demand:{overview:!0}};if(e.type!==`git.repository.changed`)return;let r=I9(e.data?.reason);return{projectId:t,repo:n,demand:{overview:!0,...r&&Tge.has(r)?{prs:!0}:{}}}}function I9(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function Dge(e=MJ){let t=t=>{try{let n=Ege(t);if(!n)return;if(t.type===`git.repository.invalidated`){jJ(n.projectId,n.repo);return}e(n.projectId,n.repo,n.demand)}catch{}},n=aU(`git.repository.invalidated`,t),r=aU(`git.repository.changed`,t);return()=>{n(),r()}}function Oge(){let e=()=>{DY(un.projectId),EY(un.projectId,{conversationId:un.conversationId,agentId:un.agentId})},t=[aU(`prompt_suggestions.trust_updated`,e),aU(`prompt_suggestions.enabled_updated`,e),aU(`prompt_suggestions.created`,e)];return()=>{for(let e of t)e()}}function kge(e,t){switch(e){case`run.started`:case`run.resumed`:case`run.retrying`:return`running`;case`run.waiting`:case`run.suspended`:return`awaiting_user`;case`run.completed`:return`idle`;case`run.cancelled`:return`aborted`;case`run.failed`:return t?.aborted?`aborted`:`error`;default:return}}function Age(e){return e===`conversation.created`||e===`conversation.updated`||e===`conversation.deleted`||e===`conversation.compacted`||e===`conversation.branch_summarized`||e===`conversation.navigated`||e===`project.deleted`||e===`agent.created`||e===`agent.subagent_started`||e===`agent.subagent_completed`||e.startsWith(`agent.explore_`)||e===`project.created`||e===`plan.written`||e===`toolCall.updated`||e.startsWith(`task.`)||L9(e)}function L9(e){return e.startsWith(`settings.`)||e.startsWith(`secrets.`)||e.startsWith(`auth.`)||e.startsWith(`providers.`)}function jge(){return oU(Mge)}function Mge(e){L9(e.type)&&!(e.type.startsWith(`settings.`)&&pt())&&dt()}function Nge(){let e=[aU(`task.output`,Fge),aU(`task.removed`,Pge),aU(`task.created`,R9),aU(`task.started`,R9),aU(`task.runtime_updated`,R9),aU(`task.ready`,R9),aU(`task.timed_out`,R9),aU(`task.promoted`,R9),aU(`task.completed`,R9),aU(`task.failed`,R9),aU(`task.cancelled`,R9),aU(`task.orphaned`,R9),aU(`task.recovered`,R9),aU(`task.interrupted`,R9),aU(`task.recovery_unknown`,R9),aU(`task.updated`,R9),aU(`task.orphan_cleanup_succeeded`,R9)];return()=>{for(let t of e.splice(0))t()}}function R9(e){let t=e.data?.task;t?.id&&(Ii.tasks=Es(Ii.tasks,t))}function Pge(e){let t=String(e.data?.taskId??``);t&&(Ii.tasks=Ii.tasks.filter(e=>e.id!==t),Ii.selectedTaskId===t&&(Ii.selectedTaskId=void 0,Ii.taskLogs=void 0))}function Fge(e){R9(e);let t=String(e.data?.taskId??``),n=Ii.tasks.find(e=>e.id===t),r=n?.definitionId??n?.restartRootTaskId??t,i=Q.activeCenterTab?.kind===`task`&&Q.activeCenterTab.id===r;t&&t===Ii.selectedTaskId&&i&&Ts(t).catch(()=>void 0)}function Ige(){return aU(`usage.subscription.updated`,Lge)}function Lge(e){let t=e.data;t?.provider&&(ut.subscriptionUsage={...ut.subscriptionUsage,[t.provider]:t})}var Rge=150,z9;function zge(){return oU(Bge)}function Bge(e){if(rU(e)&&(ys(e),Wge(e)),e.type===`conversation.deleted`){let t=B9(e.data?.conversationId);t&&rs(gr(t))}if(Hge(e.type)){let t=Uge(e.data?.agent);t&&ss(t)}Age(e.type)&&Vge()}function Vge(){z9&&clearTimeout(z9),z9=setTimeout(()=>{z9=void 0,Ke.invalidateQueries({queryKey:$e.workspace}),vs()},Rge)}function B9(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function Hge(e){return e===`agent.created`||e===`agent.configured`||e===`agent.mode_changed`||e===`agent.status_changed`}function Uge(e){if(!e||typeof e!=`object`)return;let t=e;return typeof t.id==`string`&&typeof t.updatedAt==`string`?t:void 0}function Wge(e){let t=kge(e.type,e.data);t&&Yo(B9(e.data?.agentId),t,e.ts)}function Gge(){let e=[zge(),uge(),Nge(),jge(),hU(),Ige(),Sge(),Oge(),Dge()];return()=>{for(let t of e.splice(0))t()}}function Kge(e){function t(t){return!(t.metaKey||t.ctrlKey)||t.altKey?!1:t.key===`=`||t.key===`+`?(t.preventDefault(),e.setUiZoomLevel(e.currentZoomLevel()+1),!0):t.key===`-`||t.key===`_`?(t.preventDefault(),e.setUiZoomLevel(e.currentZoomLevel()-1),!0):t.key===`0`?(t.preventDefault(),e.setUiZoomLevel(0),!0):!1}function n(e){return e.kind===`settings`?{kind:`settings`,id:`settings`}:e.kind===`logs`?{kind:`logs`,id:`logs`}:{kind:e.kind,id:e.id}}function r(){let t=e.activeCenterTab();return t?e.centerTabs().findIndex(e=>e.kind===t.kind&&e.id===t.id):-1}function i(t){let i=e.centerTabs();if(i.length===0)return!1;let a=r(),o=((a===-1?0:a)+t+i.length)%i.length;return e.selectCenterTab(n(i[o])),!0}function a(t){let r=e.centerTabs()[t];return r?(e.selectCenterTab(n(r)),!0):!1}function o(){if(!e.hasConversationComposer())return!1;let t=[`read_only`,`supervised`,`autonomous`],n=t[(t.indexOf(e.selectedPermissionLevel())+1)%t.length]??t[0];return e.setComposerPermission(n),!0}function s(){if(!e.hasConversationComposer())return!1;let t=e.usableModels().find(t=>`${t.provider}:${t.modelId}`===e.selectedModelKey()),n=t?.supportedThinkingLevels?.length?t.supportedThinkingLevels:[`off`],r=n[(n.indexOf(e.selectedThinkingLevel())+1)%n.length]??n[0]??`off`;return e.setComposerThinkingLevel(r),!0}function c(){return e.hasConversationComposer()?(e.setComposerMode(e.selectedMode()===`coding`?`planning`:`coding`),!0):!1}function l(t){if(t.startsWith(`pane.focusByIndex.`)){let e=Number(t.split(`.`).at(-1))-1;return Number.isInteger(e)&&a(e)}let n=e.activeCenterTab();switch(t){case`conversation.new`:return e.newConversation(),!0;case`conversation.newFromProject`:return e.openProjectPicker(),!0;case`pane.close`:return n?(e.closeCenterTab(n),!0):!1;case`pane.closeOthers`:return n?(e.closeCenterTabs(e.centerTabsExcept(n),n),!0):!1;case`pane.refresh`:return n?(e.refreshCenterTab(n),!0):!1;case`pane.previous`:return i(-1);case`pane.next`:return i(1);case`projectSearch.focus`:return e.focusProjectSearch(),!0;case`composer.focus`:case`composer.cancelMic`:return e.hasConversationComposer()?(e.composerEscape(),!0):!1;case`composer.stopRun`:return e.sending()?(e.abortActiveRun(),!0):!1;case`composer.toggleMic`:return e.hasConversationComposer()?(e.toggleMic(),!0):!1;case`composer.toggleMode`:return c();case`composer.cyclePermission`:return o();case`composer.cycleThinking`:return s();case`view.toggleLeftDock`:return e.togglePanelDock(`left`),!0;case`view.toggleRightDock`:return e.togglePanelDock(`right`),!0;case`view.toggleBottomDock`:return e.togglePanelDock(`bottom`),!0;case`zoom.in`:case`zoom.out`:case`zoom.reset`:case`composer.send`:return!1}return!1}function u(e){if(t(e))return;let n=bp.find(t=>gp(e,t.defaultBinding));if(!n)return;let r=n.id===`pane.close`;r&&e.preventDefault(),!(hp(e.target)&&!n.allowInEditable)&&l(n.id)&&!r&&n.id!==`composer.focus`&&n.id!==`composer.cancelMic`&&e.preventDefault()}return{activeCenterTabIndex:r,centerTabIdentity:n,cyclePermissionLevel:o,cycleThinkingLevel:s,handleWorkbenchShortcut:u,handleZoomShortcut:t,runShortcutCommand:l,selectCenterTabByIndex:a,selectRelativeCenterTab:i,toggleComposerModeShortcut:c}}async function qge(e){let t=e.now??(()=>performance.now()),n=[],r=r=>{let i={name:r,at:t()};n.push(i),e.observeMilestone?.(i)},i=t(),a;try{r(`config:start`);let o=await e.loadClientConfig();if(!e.isCurrent()||(e.applyClientConfig(o),r(`config:ready`),!e.transition(`critical`)))return V9(n,i,t());a=t(),r(`critical:start`);let s=e.loadCoreSettings().then(()=>r(`core-settings:ready`));s.catch(()=>void 0);let c=e.recoverWorkspace().then(e=>(r(`workspace:ready`),e));r(`critical:started-concurrently`);let l=await c;if(!e.isCurrent())return V9(n,i,t());let u=e.restoreCriticalConversation(l).then(e=>(r(`conversation-restoration:ready`),e)),[,d]=await Promise.all([s,u]);if(!e.isCurrent()||(await e.reconcileComposerSelection(),r(`composer-selection:reconciled`),!e.transition(`core-ready`))||(r(`core-ready`),!e.transition(`progressive`)))return V9(n,i,t());r(`progressive`);try{Promise.resolve(e.activateDeferredTab(l,d)).catch(()=>void 0)}catch{}try{e.startProgressiveWork()}catch{}return r(`progressive-work:started`),{milestones:n,phaseDurations:[{phase:`config`,durationMs:a-i},{phase:`critical`,durationMs:t()-a}],criticalBeforeProgressive:!0}}catch(t){throw e.isCurrent()&&e.transition(`failed`),r(`failed`),t}}function V9(e,t,n){return{milestones:e,phaseDurations:[{phase:`config`,durationMs:n-t},{phase:`critical`,durationMs:0}],criticalBeforeProgressive:!0}}var H9=[`encoding.json`,`event.batch`,`event.notify`,nr,`snapshot.workspace`],Jge=[250,500,1e3,1500,2500,4e3,5e3],Yge=1e4,Xge={role:`workbench_server`},U9,W9,G9=!1,K9=!1,q9;async function Zge(){G9=!1,K9=!1;let e=xY(),t=ct();st(t.theme,t.colorMode);try{let t=await qge({loadClientConfig:()=>n_e(`load client config`,ro),applyClientConfig:e=>{Q.config=e,e.status.capabilities.applicationLogs&&Zpe(),Q.status=e.status,Q.error=void 0,mn.projectDir=e.status.storage.home},loadCoreSettings:ht,recoverWorkspace:()=>$ge(Q.config.wsUrl),restoreCriticalConversation:Vo,reconcileComposerSelection:lt,activateDeferredTab:async(e,t)=>{e&&!t&&await Fi(e)},startProgressiveWork:()=>{ds().catch(()=>void 0),rme(),ree(),r_e()},transition:t=>CY(e,t),isCurrent:()=>SY(e)});return SY(e)?(b7(`info`,`workbench`,`Workbench initialized`,{context:t}),!0):!1}catch(t){if(!SY(e))return!1;throw wY(e,t),Q.error=J9(t),Q.connection=`error`,b7(`error`,`workbench`,`Workbench initialization failed`,{context:{criticalBeforeProgressive:!0},error:t}),t}}function Qge(){return{role:`ui`,id:dr(),instanceId:lr(),name:`Nerve Web UI`}}async function $ge(e){await U9?.close(),W9?.();let t=fr({source:Qge(),target:Xge}),n,r,i=new Promise((e,t)=>{n=e,r=t});return U9=new br({transport:vr(t_e(e)),onStateChange:e_e,onError:e=>{G9||(Q.error=J9(e),b7(`warn`,`websocket`,`Protocol transport error`,{error:e})),K9||r(e)},createSession:({send:e,onDisconnect:r})=>new $n({createMessage:t,capabilities:H9,requiredCapabilities:H9,cursors:us,send:e,onDisconnect:r,onReady:async e=>{Q.protocolSessionId=e.sessionId;let t;if(!K9){let e=await ps({deferTabActivation:!0});_s(e.cursor.streams,{replace:!0,sync:!1}),t=e.desiredTab,K9=!0}Q.connection=`live`,Ko(),n(t)},onSnapshotRequired:async e=>{if(e===`workspace`){_s((await ps()).cursor.streams,{sync:!1}),Ko();return}let t=ur(e);t&&await Uo(t)},onStreamUnavailable:e=>{b7(`warn`,`websocket`,`Event stream unavailable`,{context:{stream:e}}),rs(e)},applyEvent:async(e,t)=>{pU(),await fU(t),Qo(e,t.seq)},onNotify:e=>{for(let t of e)dU(t)},diagnostics:{publish(e){b7(`warn`,`websocket`,`Protocol diagnostic`,{context:{...e,pendingNotifyEvents:iU()}})}}})}),W9=xs(async e=>{let t=U9?.session;return!t||t.state!==`ready`?`skipped`:(await t.subscribe(e),`applied`)}),U9.start().catch(r),i}function e_e(e){e===`ready`?Q.connection=`live`:e===`closed`&&G9?Q.connection=`closed`:e===`closed`?Q.connection=`error`:Q.connection=`connecting`}function t_e(e){if(globalThis.location?.protocol===`http:`||globalThis.location?.protocol===`https:`){let e=new oe(`/ws`,globalThis.location.href);return e.protocol=globalThis.location.protocol===`https:`?`wss:`:`ws:`,e}return new URL(e)}async function n_e(e,t){for(let[n,r]of Jge.entries())try{return await t()}catch(t){if(G9)throw t;Q.connection=`connecting`,Q.error=`Waiting for Nerve daemon to start (${J9(t)})`,b7(`warn`,`workbench`,`Workbench initialization retrying`,{context:{label:e,attempt:n+1,delayMs:r},error:t}),await new Promise(e=>setTimeout(e,r))}return t()}function J9(e){return e instanceof Error?e.message:String(e)}function r_e(){Y9(),q9=setInterval(()=>void _t().catch(()=>void 0),Yge)}function Y9(){q9!==void 0&&clearInterval(q9),q9=void 0}function i_e(){G9=!0,TY(),Y9(),w7(),pU(),W9?.(),W9=void 0,U9?.close(),U9=void 0,Q.protocolSessionId=void 0,Q.connection=`closed`}var a_e=P(`<main class="fixed inset-0 grid place-items-center bg-background text-foreground" aria-busy="true" aria-label="Starting Nerve"><div class="grid w-full max-w-lg justify-items-center p-6 text-center" style="transform: scale(var(--nerve-inverse-zoom-scale, 1)); transform-origin: center;"><!> <div class="mt-6 w-full max-w-48"><p class="mb-2 text-sm leading-relaxed text-muted-foreground" role="status" aria-live="polite"> </p> <div class="h-1 w-full overflow-hidden rounded-full bg-border" role="progressbar" aria-label="Starting Nerve"><span class="block h-full w-full rounded-full bg-primary"></span></div></div></div></main>`);function o_e(e,t){let n=K(t,`status`,3,`Opening Nerve`);var r=a_e(),i=B(r),a=B(i);ay(a,{class:`startup-breathe size-12`});var o=Y(a,2),s=B(o),c=B(s,!0);y(s),g(2),y(o),y(i),y(r),J(()=>f(c,n())),q(e,r)}function s_e(e,t){x(t,!0);let n=l(()=>dm.activeProject),r=l(()=>UX.activeConversation),i=l(()=>dm.activeCenterTab),a=l(()=>dm.centerTabs),o=l(()=>UX.pendingConversationActive),s=l(()=>UX.selectedMode),c=l(()=>UX.selectedModelKey),u=l(()=>UX.selectedPermissionLevel),d=l(()=>UX.selectedThinkingLevel),f=l(()=>UX.sending),m=l(()=>UX.compacting),g=l(()=>QX.settingsDraft),v=l(()=>UX.usableModels),y=l(()=>L(g)?.ui.zoomLevel??ot.level),b=l(()=>hY(yY.phase));function S(){Q.projectPickerOpen=!0}function C(){SQ(`conversations`,qZ.isCompact),TZ()}let w=Kge({currentZoomLevel:()=>L(y),setUiZoomLevel:ft,centerTabs:()=>L(a),activeCenterTab:()=>L(i),selectCenterTab:Fi,newConversation:Jo,openProjectPicker:S,closeCenterTab:Mi,closeCenterTabs:qo,centerTabsExcept:Wo,refreshCenterTab:eZ,focusProjectSearch:C,hasConversationComposer:()=>!!(L(r)||L(o)),sending:()=>L(f)||L(m),abortActiveRun:()=>L(m)?as():No(),composerEscape:cK,toggleMic:lK,selectedPermissionLevel:()=>L(u),setComposerPermission:Ao,usableModels:()=>L(v),selectedModelKey:()=>L(c),selectedThinkingLevel:()=>L(d),setComposerThinkingLevel:Io,selectedMode:()=>L(s),setComposerMode:wo,togglePanelDock:e=>xQ(e,qZ.isCompact)});z(()=>{let e=L(g)?.notifications;e&&Si(e)});let T;z(()=>{let e=L(g)?.desktop.closeToTray;!Dr.isDesktop||e===void 0||e===T||(T=e,Or(e))});let E=KX(e=>{e?uY(e,{reason:`project`,force:!0}):dY()});z(()=>{E.update(yY.progressiveActive,L(n)?.id)}),z(()=>{if(yY.progressiveActive)return uJ(()=>void uY(void 0,{reason:`focus`}))}),ue(()=>{let e=Gge(),t=bi(),n=tr(),r=window.location.pathname===`/settings`||window.location.pathname===`/settings/`;return r&&window.history.replaceState({},``,`/${window.location.search}${window.location.hash}`),window.addEventListener(`keydown`,w.handleWorkbenchShortcut,{capture:!0}),Zge().then(e=>{e&&(_i(),r&&mt())}).catch(()=>void 0),()=>{window.removeEventListener(`keydown`,w.handleWorkbenchShortcut,{capture:!0}),n(),t(),e(),i_e()}});var D=_(),O=F(D),k=e=>{var n=_();h(F(n),()=>t.children??N),q(e,n)},ee=e=>{o_e(e,{})};p(O,e=>{L(b)?e(k):e(ee,-1)}),q(e,D),H()}function c_e(e){b(`629kra`,e=>{se(()=>{xe.title=`nerve`})}),s_e(e,{children:(e,t)=>{Qhe(e,{})},$$slots:{default:!0}})}function l_e(e){c_e(e,{})}var u_e=new Set([`$$slots`,`$$events`,`$$legacy`]);function d_e(e,t){let n=U(t,u_e),r=[[`path`,{d:`m15 9-6 6`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`}],[`path`,{d:`m9 9 6 6`}]];G(e,V({name:`octagon-x`},()=>n,{get iconNode(){return r}}))}var f_e=new Set([`$$slots`,`$$events`,`$$legacy`]);function p_e(e,t){x(t,!0);let n=U(t,f_e);dp(e,V({get theme(){return yt.current},class:`toaster group`,style:`--normal-bg: var(--color-popover); --normal-text: var(--color-popover-foreground); --normal-border: var(--color-border);`},()=>n,{loadingIcon:e=>{ke(e,{class:`size-4`})},successIcon:e=>{Ja(e,{class:`size-4`})},errorIcon:e=>{d_e(e,{class:`size-4`})},infoIcon:e=>{ZZ(e,{class:`size-4`})},warningIcon:e=>{pW(e,{class:`size-4`})},$$slots:{loadingIcon:!0,successIcon:!0,errorIcon:!0,infoIcon:!0,warningIcon:!0}})),H()}var X9=P(`<!> <!>`,1);function m_e(e,t){x(t,!1),fe();var n=X9(),r=F(n);at(r,{}),Ns(Y(r,2),{get client(){return Ke},children:(e,t)=>{var n=X9(),r=F(n);l_e(r,{});var i=Y(r,2),a=e=>{p_e(e,{position:`bottom-right`,closeButton:!0})};p(i,e=>{Dr.isDesktop||e(a)}),q(e,n)},$$slots:{default:!0}}),q(e,n),H()}var h_e=`false`,g_e=`false`,Z9=h_e===`true`,__e=g_e===`true`;function v_e(e={}){let{immediate:t=!1,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,c,l,u,d=async(e=!0)=>{await l,Z9||u?.()};async function f(){if(`serviceWorker`in navigator){if(c=await Xa(async()=>{let{Workbox:e}=await import(`./workbox-window.prod.es5-Bd17z0YL.js`);return{Workbox:e}},[]).then(({Workbox:e})=>new e(`/sw.js`,{scope:`/`,type:`classic`})).catch(e=>{s?.(e)}),!c)return;if(u=()=>{c?.messageSkipWaiting()},!__e)if(Z9)c.addEventListener(`activated`,e=>{(e.isUpdate||e.isExternal)&&(n?n():window.location.reload())}),c.addEventListener(`installed`,e=>{e.isUpdate||i?.()});else{let e=!1,t=()=>{e=!0,c?.addEventListener(`controlling`,e=>{e.isUpdate&&(n?n():window.location.reload())}),r?.()};c.addEventListener(`installed`,n=>{n.isUpdate===void 0?n.isExternal===void 0?!e&&i?.():n.isExternal?t():!e&&i?.():n.isUpdate||i?.()}),c.addEventListener(`waiting`,t)}c.register({immediate:t}).then(e=>{o?o(`/sw.js`,e):a?.(e)}).catch(e=>{s?.(e)})}}return l=f(),d}function y_e(e){let t=e.window??window,n=e.document??document,r=e.now??Date.now,i=e.minimumCheckIntervalMs??6e4,a=-1/0,o=!1,s=()=>{if(n.visibilityState!==`visible`||o)return;let t=r();t-a<i||(a=t,o=!0,Promise.resolve().then(e.checkForUpdate).catch(()=>void 0).finally(()=>{o=!1}))},c=t.setInterval(s,e.intervalMs??60*6e4);return t.addEventListener(`focus`,s),t.addEventListener(`online`,s),n.addEventListener(`visibilitychange`,s),()=>{t.clearInterval(c),t.removeEventListener(`focus`,s),t.removeEventListener(`online`,s),n.removeEventListener(`visibilitychange`,s)}}var b_e=`nerve-pwa-update`;function x_e(){if(!S_e())return;let e,t=v_e({immediate:!0,onNeedRefresh:()=>{fi.message(`Update available`,{id:b_e,description:`A new version of Nerve is ready.`,duration:1/0,dismissible:!1,action:{label:`Reload`,onClick:()=>{t().catch(e=>{console.error(`Failed to activate the Nerve update.`,e)})}}})},onRegisteredSW:(t,n)=>{e?.(),e=n?y_e({checkForUpdate:async()=>{await n.update()}}):void 0},onRegisterError:e=>{console.error(`Failed to register the Nerve service worker.`,e)}})}function S_e(){return`serviceWorker`in navigator&&window.nerveDesktop?.kind!==`electron`}var Q9=null;try{Q9=window.sessionStorage.getItem(`nerve.initialZoomLevel`),window.sessionStorage.removeItem(`nerve.initialZoomLevel`)}catch{}Q9!==null&&vt(Number(Q9));var $9=document.getElementById(`app`);if(!$9)throw Error(`Missing #app mount target.`);x_e();var C_e=document.getElementById(`startup-bootstrap`);te(m_e,{target:$9}),C_e?.remove();export{Kq as $,J_ as $t,wX as A,RR as At,jY as B,wP as Bt,IZ as C,wU as Ct,QX as D,KH as Dt,PZ as E,$H as Et,eX as F,uL as Ft,xJ as G,RS as Gt,pY as H,Pj as Ht,qY as I,eL as It,TJ as J,Uy as Jt,wJ as K,OS as Kt,kY as L,lI as Lt,sX as M,TR as Mt,rX as N,$L as Nt,XX as O,WH as Ot,nX as P,EL as Pt,tJ as Q,uv as Qt,DY as R,IF as Rt,ZZ as S,YU as St,LZ as T,QH as Tt,fY as U,ZC as Ut,yY as V,nP as Vt,BJ as W,zS as Wt,fJ as X,Fy as Xt,SJ as Y,Ly as Yt,eJ as Z,gy as Zt,m0 as _,Ul as _n,MW as _t,e7 as a,dm as an,xG as at,k1 as b,gc as bn,aW as bt,Y5 as c,Qp as cn,sG as ct,J0 as d,vf as dn,UW as dt,Y_ as en,sJ as et,V0 as f,df as fn,HW as ft,g0 as g,Wl as gn,qW as gt,q1 as h,af as hn,KW as ht,u7 as i,I_ as in,BG as it,hX as j,jR as jt,GX as k,Jz as kt,K5 as l,bp as ln,oG as lt,F0 as m,sf as mn,WW as mt,P7 as n,q_ as nn,yK as nt,$5 as o,nm as on,mG as ot,N0 as p,lf as pn,BW as pt,CJ as q,Gy as qt,N7 as r,G_ as rn,mK as rt,Q5 as s,tm as sn,dG as st,y9 as t,X_ as tn,SK as tt,G5 as u,vp as un,GW as ut,G1 as v,Hl as vn,mW as vt,BZ as w,aU as wt,$Z as x,pc as xn,ZU as xt,K1 as y,zc as yn,pW as yt,OY as z,GP as zt};