@tangle-network/sandbox-cli 0.21.23 → 0.21.25

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 (534) hide show
  1. package/dist/graph-viewer/Analytics-DocMpB6T.js +953 -0
  2. package/dist/graph-viewer/AnswerStrip-DhwqOyxI.js +112 -0
  3. package/dist/graph-viewer/Checks-CbnY4tuh.js +113 -0
  4. package/dist/graph-viewer/Conversations-CISiWrR9.js +513 -0
  5. package/dist/graph-viewer/Files-Dh8p_Fpw.js +435 -0
  6. package/dist/graph-viewer/LiveRun-C-yKwkKs.js +190 -0
  7. package/dist/graph-viewer/Outputs-QET3nPPp.js +803 -0
  8. package/dist/graph-viewer/Overview-BaXPdCFC.js +477 -0
  9. package/dist/graph-viewer/RunOverview-DJQDAMIx.js +1720 -0
  10. package/dist/graph-viewer/RunPage-nJwCsArn.js +258 -0
  11. package/dist/graph-viewer/Timeline-bPjhV3il.js +293 -0
  12. package/dist/graph-viewer/Today-pebCsPJ1.js +653 -0
  13. package/dist/graph-viewer/Topology-CyhuK6XW.js +550 -0
  14. package/dist/graph-viewer/Traces-C5x2UvJh.js +232 -0
  15. package/dist/graph-viewer/WallPages-DSmRm2v3.js +658 -0
  16. package/dist/graph-viewer/agent-runtime.js +2293 -0
  17. package/dist/graph-viewer/anchor-C4i5SrB9.js +23 -0
  18. package/dist/graph-viewer/assessment.js +117 -0
  19. package/dist/graph-viewer/data-BJmP7F1M.js +247 -0
  20. package/dist/graph-viewer/harness-sessions.js +165 -0
  21. package/dist/graph-viewer/index.js +14991 -0
  22. package/dist/graph-viewer/lazy-pages-CpmkG5o2.js +19 -0
  23. package/dist/graph-viewer/outputs-model-CGdvjkQh.js +553 -0
  24. package/dist/graph-viewer/part-events-BrLrg_EV.js +276 -0
  25. package/dist/graph-viewer/plain-words-CgvxtEOa.js +17 -0
  26. package/dist/graph-viewer/publication.js +111 -0
  27. package/dist/graph-viewer/receipt.js +25 -0
  28. package/dist/graph-viewer/record-part-Cx9GDQeo.js +1378 -0
  29. package/dist/graph-viewer/record.js +336 -0
  30. package/dist/graph-viewer/report-viewer.js +557 -0
  31. package/dist/graph-viewer/report.js +392 -0
  32. package/dist/graph-viewer/research-publication.js +35 -0
  33. package/dist/graph-viewer/run-files-C1NgzM0l.js +82 -0
  34. package/dist/graph-viewer/run-receipt-Bvi4-KVM.js +1112 -0
  35. package/dist/graph-viewer/schemas/agent-record.bundle.v1.json +157 -0
  36. package/dist/graph-viewer/schemas/agent-record.v1.json +1025 -0
  37. package/dist/graph-viewer/schemas/agent-trace-assessment.v1.json +302 -0
  38. package/dist/graph-viewer/schemas/agent-trace-assessments.v1.json +335 -0
  39. package/dist/graph-viewer/schemas/agent-trace-dimensions.v1.json +131 -0
  40. package/dist/graph-viewer/schemas/agent-workspace.play.v1.json +8149 -0
  41. package/dist/graph-viewer/schemas/agent-workspace.plays.v1.json +1295 -0
  42. package/dist/graph-viewer/schemas/agent-workspace.run.v1.json +10907 -0
  43. package/dist/graph-viewer/schemas/agent-workspace.version-graph.json +1131 -0
  44. package/dist/graph-viewer/schemas/discovery-lab.profile-graph.json +2628 -0
  45. package/dist/graph-viewer/schemas/evidence.snapshot.v1.json +71 -0
  46. package/dist/graph-viewer/styles.css +13976 -0
  47. package/dist/graph-viewer/trace-spans.js +157 -0
  48. package/dist/graph-viewer/ui-CEhDqce8.js +906 -0
  49. package/dist/graph-viewer/use-file-text-BaE98QxE.js +47 -0
  50. package/dist/graph-viewer/viewer/AgentGraphCanvas-D7jjAE6i-DecKyUGA.js +8808 -0
  51. package/dist/graph-viewer/viewer/Analytics-CtKucZjs.js +954 -0
  52. package/dist/graph-viewer/viewer/AnswerStrip-DsI9aF-i.js +45 -0
  53. package/dist/graph-viewer/viewer/Checks-DZTgeYlV.js +114 -0
  54. package/dist/graph-viewer/viewer/Conversations-DQBCyko6.js +787 -0
  55. package/dist/graph-viewer/viewer/Files-B-g25gSO.js +433 -0
  56. package/dist/graph-viewer/viewer/LiveRun-BMQnTpTZ.js +6713 -0
  57. package/dist/graph-viewer/viewer/Outputs-DXnN1wEQ.js +929 -0
  58. package/dist/graph-viewer/viewer/Overview-u7-8-rGx.js +478 -0
  59. package/dist/graph-viewer/viewer/RunPage-ChipoSdO.js +257 -0
  60. package/dist/graph-viewer/viewer/Scores-CjriXjf_.js +414 -0
  61. package/dist/graph-viewer/viewer/Timeline-DzEzobA0.js +294 -0
  62. package/dist/graph-viewer/viewer/Today-DLHe_wTA.js +653 -0
  63. package/dist/graph-viewer/viewer/Topology-Dsmuu27J.js +551 -0
  64. package/dist/graph-viewer/viewer/Traces-BWBulSPE.js +232 -0
  65. package/dist/graph-viewer/viewer/WallPages-Crj-qPoK.js +657 -0
  66. package/dist/graph-viewer/viewer/WorkflowGraph-DYsP_Kcg-C0O7M5iH.js +1559 -0
  67. package/dist/graph-viewer/viewer/abap-DF4NaQCD.js +3 -0
  68. package/dist/graph-viewer/viewer/actionscript-3-O89o1DyQ.js +3 -0
  69. package/dist/graph-viewer/viewer/ada-UiOHRbSd.js +3 -0
  70. package/dist/graph-viewer/viewer/agent-record-Dw772ROs.css +2 -0
  71. package/dist/graph-viewer/viewer/agent-timeline-C-UIhXgu.js +1786 -0
  72. package/dist/graph-viewer/viewer/ahk-7eXkLipS.js +3 -0
  73. package/dist/graph-viewer/viewer/ahk2-BRygvKjG.js +3 -0
  74. package/dist/graph-viewer/viewer/andromeeda-CXE6Hd_y.js +4 -0
  75. package/dist/graph-viewer/viewer/andromeeda-D4hkA5d4.js +135 -0
  76. package/dist/graph-viewer/viewer/angular-html-CH3lfmUV.js +16 -0
  77. package/dist/graph-viewer/viewer/angular-ts-B687Yw-e.js +18 -0
  78. package/dist/graph-viewer/viewer/apache-zsgjHeYU.js +3 -0
  79. package/dist/graph-viewer/viewer/apex-DvIWVZE0.js +3 -0
  80. package/dist/graph-viewer/viewer/apl-MlL-eOOA.js +16 -0
  81. package/dist/graph-viewer/viewer/applescript-D_ETOzPj.js +3 -0
  82. package/dist/graph-viewer/viewer/ara-CXdsJbD3.js +3 -0
  83. package/dist/graph-viewer/viewer/asciidoc-CpqrUCBV.js +3 -0
  84. package/dist/graph-viewer/viewer/asm-DLrPCi7c.js +3 -0
  85. package/dist/graph-viewer/viewer/astro-CEu262ke.js +18 -0
  86. package/dist/graph-viewer/viewer/aurora-x-ByDc5ddl.js +4 -0
  87. package/dist/graph-viewer/viewer/aurora-x-DR-LXA3G.js +149 -0
  88. package/dist/graph-viewer/viewer/awk-452npsTH.js +3 -0
  89. package/dist/graph-viewer/viewer/ayu-dark-AY3FJIQr.js +125 -0
  90. package/dist/graph-viewer/viewer/ayu-dark-Bwg9SdAf.js +4 -0
  91. package/dist/graph-viewer/viewer/ayu-light-CDT1HkHg.js +125 -0
  92. package/dist/graph-viewer/viewer/ayu-light-DPCSrH1e.js +4 -0
  93. package/dist/graph-viewer/viewer/ayu-mirage-BrWHc4Mk.js +125 -0
  94. package/dist/graph-viewer/viewer/ayu-mirage-CArVigxm.js +4 -0
  95. package/dist/graph-viewer/viewer/ballerina-8wA0eHgr.js +3 -0
  96. package/dist/graph-viewer/viewer/bash-B3Pt0-io.js +2 -0
  97. package/dist/graph-viewer/viewer/bat-D5zNUOf1.js +3 -0
  98. package/dist/graph-viewer/viewer/beancount-BXtNUIgX.js +3 -0
  99. package/dist/graph-viewer/viewer/berry-oDXeVIfk.js +3 -0
  100. package/dist/graph-viewer/viewer/bibtex-CAeObnSR.js +3 -0
  101. package/dist/graph-viewer/viewer/bicep-udSZHxea.js +3 -0
  102. package/dist/graph-viewer/viewer/bird2-CeHO9zcD.js +3 -0
  103. package/dist/graph-viewer/viewer/blade-6Y8QadpX.js +20 -0
  104. package/dist/graph-viewer/viewer/bot-Bivadvxn.js +40 -0
  105. package/dist/graph-viewer/viewer/bsl-BYwMGpx9.js +5 -0
  106. package/dist/graph-viewer/viewer/c-CSBSx-ud.js +2 -0
  107. package/dist/graph-viewer/viewer/c-DAvbji88.js +5 -0
  108. package/dist/graph-viewer/viewer/c3-CWnhEhIf.js +3 -0
  109. package/dist/graph-viewer/viewer/cadence-C2DNIpxD.js +3 -0
  110. package/dist/graph-viewer/viewer/cairo-Be_WUhk8.js +5 -0
  111. package/dist/graph-viewer/viewer/catppuccin-frappe-BOyy9syt.js +254 -0
  112. package/dist/graph-viewer/viewer/catppuccin-frappe-XWBMtHoj.js +4 -0
  113. package/dist/graph-viewer/viewer/catppuccin-latte-BTeMSDF4.js +254 -0
  114. package/dist/graph-viewer/viewer/catppuccin-latte-CYOvCvxh.js +4 -0
  115. package/dist/graph-viewer/viewer/catppuccin-macchiato-BdFrVtzY.js +254 -0
  116. package/dist/graph-viewer/viewer/catppuccin-macchiato-Bl-TAIIg.js +4 -0
  117. package/dist/graph-viewer/viewer/catppuccin-mocha-BkEo6vVC.js +4 -0
  118. package/dist/graph-viewer/viewer/catppuccin-mocha-nwxgrdZf.js +254 -0
  119. package/dist/graph-viewer/viewer/ccount-8lyDUwnq.js +1116 -0
  120. package/dist/graph-viewer/viewer/chapel-BipHs2dR.js +5 -0
  121. package/dist/graph-viewer/viewer/chevron-right-WW7tFY6B.js +14 -0
  122. package/dist/graph-viewer/viewer/clarity-CYwjxkRS.js +3 -0
  123. package/dist/graph-viewer/viewer/clojure-g5hblQ59.js +3 -0
  124. package/dist/graph-viewer/viewer/cmake-D30WusUY.js +3 -0
  125. package/dist/graph-viewer/viewer/cobol-BSufitvZ.js +10 -0
  126. package/dist/graph-viewer/viewer/codeowners-a_Z0p9_y.js +3 -0
  127. package/dist/graph-viewer/viewer/codeql-BkSUw1F6.js +3 -0
  128. package/dist/graph-viewer/viewer/coffee-Cq8545xS.js +5 -0
  129. package/dist/graph-viewer/viewer/common-lisp-D2PkvS4V.js +3 -0
  130. package/dist/graph-viewer/viewer/coq-BLTGLocz.js +3 -0
  131. package/dist/graph-viewer/viewer/core-I74i0Bj-.js +3283 -0
  132. package/dist/graph-viewer/viewer/cpp--S2jMQNE.js +16 -0
  133. package/dist/graph-viewer/viewer/cpp-D1SvvKgJ.js +2 -0
  134. package/dist/graph-viewer/viewer/createLucideIcon-Z6KTw8ff.js +132 -0
  135. package/dist/graph-viewer/viewer/crystal-CwAQylTf.js +18 -0
  136. package/dist/graph-viewer/viewer/csharp--dn-Xz3x.js +3 -0
  137. package/dist/graph-viewer/viewer/csharp-CFNIW_9w.js +2 -0
  138. package/dist/graph-viewer/viewer/css-DDvgy_Pj.js +2 -0
  139. package/dist/graph-viewer/viewer/css-OZkJJXvy.js +5 -0
  140. package/dist/graph-viewer/viewer/csv-DFU5sVkH.js +3 -0
  141. package/dist/graph-viewer/viewer/cue-cdFZcSz0.js +3 -0
  142. package/dist/graph-viewer/viewer/cypher-DRjO_s97.js +3 -0
  143. package/dist/graph-viewer/viewer/d-BTgKsJ9x.js +3 -0
  144. package/dist/graph-viewer/viewer/dark-plus-C3f5UfGH.js +4 -0
  145. package/dist/graph-viewer/viewer/dark-plus-DpxqFdZb.js +133 -0
  146. package/dist/graph-viewer/viewer/dart-D4omMRdb.js +3 -0
  147. package/dist/graph-viewer/viewer/data-azhapQrS.js +5459 -0
  148. package/dist/graph-viewer/viewer/dax-DMzovUnU.js +3 -0
  149. package/dist/graph-viewer/viewer/desktop-0YG2NeB2.js +3 -0
  150. package/dist/graph-viewer/viewer/diff-Bqcnq92f.js +2 -0
  151. package/dist/graph-viewer/viewer/diff-D0WgTNQn.js +3 -0
  152. package/dist/graph-viewer/viewer/dist-CyOc-K4O.js +488 -0
  153. package/dist/graph-viewer/viewer/docker-DzSfvS0u.js +5 -0
  154. package/dist/graph-viewer/viewer/dockerfile-CM1sLMN0.js +2 -0
  155. package/dist/graph-viewer/viewer/dotenv-BSNpOEA3.js +3 -0
  156. package/dist/graph-viewer/viewer/dracula-BfBOnDty.js +4 -0
  157. package/dist/graph-viewer/viewer/dracula-DhjcxBGE.js +153 -0
  158. package/dist/graph-viewer/viewer/dracula-soft-C8OuVugS.js +103 -0
  159. package/dist/graph-viewer/viewer/dracula-soft-D6ffXinY.js +4 -0
  160. package/dist/graph-viewer/viewer/dream-maker-Br_aTy0D.js +3 -0
  161. package/dist/graph-viewer/viewer/edge-BXg6ZoA5.js +12 -0
  162. package/dist/graph-viewer/viewer/elixir-BP4dycnf.js +5 -0
  163. package/dist/graph-viewer/viewer/elk.bundled-ZJBRnwyo.js +46151 -0
  164. package/dist/graph-viewer/viewer/elm-XJ6BGRhm.js +5 -0
  165. package/dist/graph-viewer/viewer/emacs-lisp-CaNYORYC.js +3 -0
  166. package/dist/graph-viewer/viewer/engine-javascript-CuJOa50W.js +2400 -0
  167. package/dist/graph-viewer/viewer/engine-oniguruma-CUxoKLbG.js +238 -0
  168. package/dist/graph-viewer/viewer/erb-Cny7ijxm.js +10 -0
  169. package/dist/graph-viewer/viewer/erlang-CcYvFpBd.js +5 -0
  170. package/dist/graph-viewer/viewer/everforest-dark-1Qcrb-nR.js +4 -0
  171. package/dist/graph-viewer/viewer/everforest-dark-B8sohDPe.js +87 -0
  172. package/dist/graph-viewer/viewer/everforest-light-CwMdzDa5.js +87 -0
  173. package/dist/graph-viewer/viewer/everforest-light-pWd_20u5.js +4 -0
  174. package/dist/graph-viewer/viewer/fennel-XqmdNU54.js +3 -0
  175. package/dist/graph-viewer/viewer/file-text-B34N7Soo.js +47 -0
  176. package/dist/graph-viewer/viewer/final-output-Db2D9cMT.js +112 -0
  177. package/dist/graph-viewer/viewer/fish-DnIfDEl-.js +3 -0
  178. package/dist/graph-viewer/viewer/fluent-Dv7iXi9Q.js +3 -0
  179. package/dist/graph-viewer/viewer/fortran-fixed-form-CclFI1c1.js +5 -0
  180. package/dist/graph-viewer/viewer/fortran-free-form-B6CnEX04.js +3 -0
  181. package/dist/graph-viewer/viewer/fsharp-KngoBKg1.js +5 -0
  182. package/dist/graph-viewer/viewer/gdresource-DmwEW6Q8.js +10 -0
  183. package/dist/graph-viewer/viewer/gdscript-DZvGV2HF.js +3 -0
  184. package/dist/graph-viewer/viewer/gdshader-C-YpNGc4.js +3 -0
  185. package/dist/graph-viewer/viewer/genie-eGJU5Fha.js +3 -0
  186. package/dist/graph-viewer/viewer/gherkin-DPafK1RH.js +3 -0
  187. package/dist/graph-viewer/viewer/git-commit-ic1koML8.js +5 -0
  188. package/dist/graph-viewer/viewer/git-rebase-Cv1EDRHu.js +5 -0
  189. package/dist/graph-viewer/viewer/github-dark-DDdIZDt9.js +4 -0
  190. package/dist/graph-viewer/viewer/github-dark-JXVciwdu.js +130 -0
  191. package/dist/graph-viewer/viewer/github-dark-default-BdQpbWGL.js +76 -0
  192. package/dist/graph-viewer/viewer/github-dark-default-Dqlx6Tfn.js +4 -0
  193. package/dist/graph-viewer/viewer/github-dark-dimmed-Cf-YKaPv.js +4 -0
  194. package/dist/graph-viewer/viewer/github-dark-dimmed-W_ejuONg.js +125 -0
  195. package/dist/graph-viewer/viewer/github-dark-high-contrast-BfhJh7Fv.js +4 -0
  196. package/dist/graph-viewer/viewer/github-dark-high-contrast-Dta6H4l1.js +125 -0
  197. package/dist/graph-viewer/viewer/github-light-D4EN-pJE.js +130 -0
  198. package/dist/graph-viewer/viewer/github-light-D7vUnDjY.js +4 -0
  199. package/dist/graph-viewer/viewer/github-light-default-CA96ogap.js +125 -0
  200. package/dist/graph-viewer/viewer/github-light-default-CbQ7dbx-.js +4 -0
  201. package/dist/graph-viewer/viewer/github-light-high-contrast-CWkjO7j1.js +125 -0
  202. package/dist/graph-viewer/viewer/github-light-high-contrast-Oc7ptxOl.js +4 -0
  203. package/dist/graph-viewer/viewer/gleam-DDi89CaZ.js +3 -0
  204. package/dist/graph-viewer/viewer/glimmer-js-B4XGl72Q.js +14 -0
  205. package/dist/graph-viewer/viewer/glimmer-ts-Cd-JLCfl.js +14 -0
  206. package/dist/graph-viewer/viewer/glsl-gcTBSfUq.js +6 -0
  207. package/dist/graph-viewer/viewer/gn-DMs_IqO4.js +3 -0
  208. package/dist/graph-viewer/viewer/gnuplot-Dwu09Wsa.js +3 -0
  209. package/dist/graph-viewer/viewer/go-BEdBk4fh.js +3 -0
  210. package/dist/graph-viewer/viewer/go-DHVK1MDf.js +2 -0
  211. package/dist/graph-viewer/viewer/graphql-CLsas7pB.js +15 -0
  212. package/dist/graph-viewer/viewer/graphql-hf2jeRF3.js +2 -0
  213. package/dist/graph-viewer/viewer/groovy-CmZ205Qh.js +3 -0
  214. package/dist/graph-viewer/viewer/gruvbox-dark-hard-C03xMCtB.js +4 -0
  215. package/dist/graph-viewer/viewer/gruvbox-dark-hard-D6fxqIcJ.js +128 -0
  216. package/dist/graph-viewer/viewer/gruvbox-dark-medium-CC6ndC01.js +128 -0
  217. package/dist/graph-viewer/viewer/gruvbox-dark-medium-ZTNTOYs1.js +4 -0
  218. package/dist/graph-viewer/viewer/gruvbox-dark-soft-1zGnpoEy.js +4 -0
  219. package/dist/graph-viewer/viewer/gruvbox-dark-soft-DBjjA89e.js +128 -0
  220. package/dist/graph-viewer/viewer/gruvbox-light-hard-CNtKpSCc.js +128 -0
  221. package/dist/graph-viewer/viewer/gruvbox-light-hard-Rq8jWy-t.js +4 -0
  222. package/dist/graph-viewer/viewer/gruvbox-light-medium-DT10IcB_.js +128 -0
  223. package/dist/graph-viewer/viewer/gruvbox-light-medium-qoNn8l_N.js +4 -0
  224. package/dist/graph-viewer/viewer/gruvbox-light-soft-BugAsRiM.js +128 -0
  225. package/dist/graph-viewer/viewer/gruvbox-light-soft-Dnxtmee2.js +4 -0
  226. package/dist/graph-viewer/viewer/hack-CDch_7MP.js +10 -0
  227. package/dist/graph-viewer/viewer/haml-BqkvTyZm.js +11 -0
  228. package/dist/graph-viewer/viewer/handlebars-RDj3fZHz.js +14 -0
  229. package/dist/graph-viewer/viewer/haskell-DSSJ-2AO.js +3 -0
  230. package/dist/graph-viewer/viewer/haxe-DrA0Xrjd.js +3 -0
  231. package/dist/graph-viewer/viewer/hcl-BxX70ue-.js +3 -0
  232. package/dist/graph-viewer/viewer/highlights-Bgg6O5ub.js +1351 -0
  233. package/dist/graph-viewer/viewer/hjson-Znrrrv1t.js +3 -0
  234. package/dist/graph-viewer/viewer/hlsl-D-dP8z1U.js +3 -0
  235. package/dist/graph-viewer/viewer/horizon-CE4Yvsia.js +4 -0
  236. package/dist/graph-viewer/viewer/horizon-EI29cEvA.js +85 -0
  237. package/dist/graph-viewer/viewer/horizon-bright-BOLA2YFR.js +4 -0
  238. package/dist/graph-viewer/viewer/horizon-bright-hHpSmrYh.js +85 -0
  239. package/dist/graph-viewer/viewer/houston-CiDLA2oo.js +4 -0
  240. package/dist/graph-viewer/viewer/houston-CiUxf-HU.js +195 -0
  241. package/dist/graph-viewer/viewer/html-9DDE6S-h.js +2 -0
  242. package/dist/graph-viewer/viewer/html-D0TTaG52.js +11 -0
  243. package/dist/graph-viewer/viewer/html-derivative-Gg3E-n-U.js +5 -0
  244. package/dist/graph-viewer/viewer/http-BPgEi3D2.js +14 -0
  245. package/dist/graph-viewer/viewer/hurl-Sfhn3XgM.js +12 -0
  246. package/dist/graph-viewer/viewer/hxml-Dv3Zqri9.js +5 -0
  247. package/dist/graph-viewer/viewer/hy-Cd4h6N3W.js +3 -0
  248. package/dist/graph-viewer/viewer/imba-DdhTsO9l.js +3 -0
  249. package/dist/graph-viewer/viewer/ini-CmgEGOBJ.js +3 -0
  250. package/dist/graph-viewer/viewer/java-CgzoQF6Y.js +5 -0
  251. package/dist/graph-viewer/viewer/java-DnKlCRJQ.js +2 -0
  252. package/dist/graph-viewer/viewer/javascript-CHiBfg7Q.js +2 -0
  253. package/dist/graph-viewer/viewer/javascript-Du25Lw0B.js +5 -0
  254. package/dist/graph-viewer/viewer/jinja-CmKrofRU.js +5 -0
  255. package/dist/graph-viewer/viewer/jison-Bh7j04oA.js +5 -0
  256. package/dist/graph-viewer/viewer/json-Cd131axV.js +2 -0
  257. package/dist/graph-viewer/viewer/json-Cd3mvCHu.js +5 -0
  258. package/dist/graph-viewer/viewer/json5-D2Eltym1.js +3 -0
  259. package/dist/graph-viewer/viewer/jsonc-BPIJyZ7u.js +3 -0
  260. package/dist/graph-viewer/viewer/jsonc-DyuEwhdL.js +2 -0
  261. package/dist/graph-viewer/viewer/jsonl-BGkjXns2.js +3 -0
  262. package/dist/graph-viewer/viewer/jsonnet-DsRfEVPr.js +3 -0
  263. package/dist/graph-viewer/viewer/jssm-DP2pbfxn.js +3 -0
  264. package/dist/graph-viewer/viewer/jsx-BC18Lfga.js +5 -0
  265. package/dist/graph-viewer/viewer/jsx-CDweqMY2.js +2 -0
  266. package/dist/graph-viewer/viewer/jsx-runtime-BSzbUOFc.js +2136 -0
  267. package/dist/graph-viewer/viewer/julia-DWXGq3n5.js +16 -0
  268. package/dist/graph-viewer/viewer/just-CPEDqFxc.js +18 -0
  269. package/dist/graph-viewer/viewer/kanagawa-dragon-D5ZXvoAT.js +147 -0
  270. package/dist/graph-viewer/viewer/kanagawa-dragon-m178euzh.js +4 -0
  271. package/dist/graph-viewer/viewer/kanagawa-lotus-BUmV0rdY.js +147 -0
  272. package/dist/graph-viewer/viewer/kanagawa-lotus-C4yCdgdL.js +4 -0
  273. package/dist/graph-viewer/viewer/kanagawa-wave-B6YTgVPM.js +4 -0
  274. package/dist/graph-viewer/viewer/kanagawa-wave-C4G5CGrn.js +147 -0
  275. package/dist/graph-viewer/viewer/kdl-BdIUXyK8.js +3 -0
  276. package/dist/graph-viewer/viewer/kotlin-BYbH5_qW.js +2 -0
  277. package/dist/graph-viewer/viewer/kotlin-CQsNEM2o.js +3 -0
  278. package/dist/graph-viewer/viewer/kusto-UWPUoeE5.js +3 -0
  279. package/dist/graph-viewer/viewer/langs-DKPMizJR.js +1323 -0
  280. package/dist/graph-viewer/viewer/laserwave-BHOyZkaw.js +72 -0
  281. package/dist/graph-viewer/viewer/laserwave-CWOG7haO.js +4 -0
  282. package/dist/graph-viewer/viewer/latex-H1oLZZMa.js +5 -0
  283. package/dist/graph-viewer/viewer/lazy-pages-fgtpXQ00.js +20 -0
  284. package/dist/graph-viewer/viewer/lean-D3P_r_z_.js +3 -0
  285. package/dist/graph-viewer/viewer/less-9LYkHheD.js +3 -0
  286. package/dist/graph-viewer/viewer/lib-YfRUb5Qz.js +633 -0
  287. package/dist/graph-viewer/viewer/light-plus-BqoAVMwn.js +4 -0
  288. package/dist/graph-viewer/viewer/light-plus-mr4QmlNu.js +134 -0
  289. package/dist/graph-viewer/viewer/liquid-BIl6scjw.js +14 -0
  290. package/dist/graph-viewer/viewer/llvm-eWADufTp.js +3 -0
  291. package/dist/graph-viewer/viewer/loader-CJrlDBKq.js +80 -0
  292. package/dist/graph-viewer/viewer/log-DvQMOE69.js +3 -0
  293. package/dist/graph-viewer/viewer/logo-Cl5E_QyH.js +3 -0
  294. package/dist/graph-viewer/viewer/lua-2MenSe50.js +6 -0
  295. package/dist/graph-viewer/viewer/luau-7dQCidxK.js +3 -0
  296. package/dist/graph-viewer/viewer/make-CE9Hryyp.js +3 -0
  297. package/dist/graph-viewer/viewer/markdown-BpJEJUTW.js +8504 -0
  298. package/dist/graph-viewer/viewer/markdown-CSNMIXpG.js +2 -0
  299. package/dist/graph-viewer/viewer/markdown-nUtTZkU8.js +3 -0
  300. package/dist/graph-viewer/viewer/marko-C5vBSh9z.js +14 -0
  301. package/dist/graph-viewer/viewer/material-theme-B36kIseS.js +93 -0
  302. package/dist/graph-viewer/viewer/material-theme-D46aZ2Q0.js +4 -0
  303. package/dist/graph-viewer/viewer/material-theme-darker-DPrN5MJM.js +4 -0
  304. package/dist/graph-viewer/viewer/material-theme-darker-iFXeHXKD.js +93 -0
  305. package/dist/graph-viewer/viewer/material-theme-lighter-2HJjoQcP.js +4 -0
  306. package/dist/graph-viewer/viewer/material-theme-lighter-BBaTLa5v.js +93 -0
  307. package/dist/graph-viewer/viewer/material-theme-ocean-D1aXUM1Z.js +4 -0
  308. package/dist/graph-viewer/viewer/material-theme-ocean-Dj5vMPI8.js +93 -0
  309. package/dist/graph-viewer/viewer/material-theme-palenight-B6DS-lbj.js +4 -0
  310. package/dist/graph-viewer/viewer/material-theme-palenight-EjN7Wy3X.js +93 -0
  311. package/dist/graph-viewer/viewer/matlab-fM7rwTZt.js +3 -0
  312. package/dist/graph-viewer/viewer/mdc-IFxaehab.js +12 -0
  313. package/dist/graph-viewer/viewer/mdx-DswfiFg4.js +3 -0
  314. package/dist/graph-viewer/viewer/mdx-e70j-_I5.js +2 -0
  315. package/dist/graph-viewer/viewer/mermaid-CAl3BhSL.js +3 -0
  316. package/dist/graph-viewer/viewer/min-dark-BAW8Cmrn.js +4 -0
  317. package/dist/graph-viewer/viewer/min-dark-BMrfDL-S.js +110 -0
  318. package/dist/graph-viewer/viewer/min-light-DMqORsIf.js +110 -0
  319. package/dist/graph-viewer/viewer/min-light-PpFL3JTA.js +4 -0
  320. package/dist/graph-viewer/viewer/mipsasm-DbPELTlh.js +3 -0
  321. package/dist/graph-viewer/viewer/model-brand-bTcMjQtB-C9bHPsPk.js +723 -0
  322. package/dist/graph-viewer/viewer/mojo-B8iEg1Sv.js +3 -0
  323. package/dist/graph-viewer/viewer/monokai-2mdc1PFC.js +4 -0
  324. package/dist/graph-viewer/viewer/monokai-b6RWCwKp.js +150 -0
  325. package/dist/graph-viewer/viewer/moonbit-BR88EIMx.js +3 -0
  326. package/dist/graph-viewer/viewer/move-CpCLo8d1.js +3 -0
  327. package/dist/graph-viewer/viewer/narrat-9pGDjQTI.js +3 -0
  328. package/dist/graph-viewer/viewer/nextflow-BEOXmhnx.js +5 -0
  329. package/dist/graph-viewer/viewer/nextflow-groovy-Cvo9WVFK.js +3 -0
  330. package/dist/graph-viewer/viewer/nginx-Dx1JJUel.js +5 -0
  331. package/dist/graph-viewer/viewer/night-owl-B66IhhIZ.js +4 -0
  332. package/dist/graph-viewer/viewer/night-owl-Dgg_EwNf.js +176 -0
  333. package/dist/graph-viewer/viewer/night-owl-light-C6oRQ1ih.js +177 -0
  334. package/dist/graph-viewer/viewer/night-owl-light-D2RFQCtQ.js +4 -0
  335. package/dist/graph-viewer/viewer/nim-CpR9PfF3.js +20 -0
  336. package/dist/graph-viewer/viewer/nix-CwcLdFnB.js +3 -0
  337. package/dist/graph-viewer/viewer/nord-BD48P4mW.js +116 -0
  338. package/dist/graph-viewer/viewer/nord-Sih_lPjv.js +4 -0
  339. package/dist/graph-viewer/viewer/nsis-Dn88_Onr.js +3 -0
  340. package/dist/graph-viewer/viewer/nushell-DDaptVCJ.js +3 -0
  341. package/dist/graph-viewer/viewer/objective-c-DK-EKgyd.js +3 -0
  342. package/dist/graph-viewer/viewer/objective-cpp-CXtEgxjw.js +3 -0
  343. package/dist/graph-viewer/viewer/ocaml-BO-0Wjtk.js +3 -0
  344. package/dist/graph-viewer/viewer/odin-BDNmOx6H.js +3 -0
  345. package/dist/graph-viewer/viewer/one-dark-pro-DFN4GD0H.js +4 -0
  346. package/dist/graph-viewer/viewer/one-dark-pro-MBgmHRam.js +112 -0
  347. package/dist/graph-viewer/viewer/one-light-Bi4vf2dv.js +138 -0
  348. package/dist/graph-viewer/viewer/one-light-zI0r8mzs.js +4 -0
  349. package/dist/graph-viewer/viewer/openscad-B8gTrm-E.js +3 -0
  350. package/dist/graph-viewer/viewer/org-SBzxSGZD.js +100 -0
  351. package/dist/graph-viewer/viewer/page-header-C6YCPkzJ.js +72 -0
  352. package/dist/graph-viewer/viewer/pascal-CRtegPzh.js +3 -0
  353. package/dist/graph-viewer/viewer/perl-Cotj8Fvk.js +16 -0
  354. package/dist/graph-viewer/viewer/php-BCjZGKW5.js +2 -0
  355. package/dist/graph-viewer/viewer/php-DuQlfgak.js +18 -0
  356. package/dist/graph-viewer/viewer/pierre-dark-Dc3Ll6Hl.js +154 -0
  357. package/dist/graph-viewer/viewer/pierre-dark-eM2ca6q-.js +4 -0
  358. package/dist/graph-viewer/viewer/pierre-dark-protanopia-deuteranopia-FuOdjT6t.js +4 -0
  359. package/dist/graph-viewer/viewer/pierre-dark-protanopia-deuteranopia-h_4QkzS0.js +154 -0
  360. package/dist/graph-viewer/viewer/pierre-dark-soft-BFXGcQOC.js +4 -0
  361. package/dist/graph-viewer/viewer/pierre-dark-soft-DlFiKlWf.js +154 -0
  362. package/dist/graph-viewer/viewer/pierre-dark-tritanopia-D8Wgm6MB.js +154 -0
  363. package/dist/graph-viewer/viewer/pierre-dark-tritanopia-HphJrMfv.js +4 -0
  364. package/dist/graph-viewer/viewer/pierre-dark-vibrant-BxJmNTpB.js +154 -0
  365. package/dist/graph-viewer/viewer/pierre-dark-vibrant-CJwaYoBu.js +4 -0
  366. package/dist/graph-viewer/viewer/pierre-light-Bd7oPgtx.js +4 -0
  367. package/dist/graph-viewer/viewer/pierre-light-CFLGbwCM.js +154 -0
  368. package/dist/graph-viewer/viewer/pierre-light-protanopia-deuteranopia-BlBh_kV-.js +154 -0
  369. package/dist/graph-viewer/viewer/pierre-light-protanopia-deuteranopia-fUFGoRe8.js +4 -0
  370. package/dist/graph-viewer/viewer/pierre-light-soft-Ah2itsu1.js +154 -0
  371. package/dist/graph-viewer/viewer/pierre-light-soft-DobqmynA.js +4 -0
  372. package/dist/graph-viewer/viewer/pierre-light-tritanopia-Bpej1qhn.js +154 -0
  373. package/dist/graph-viewer/viewer/pierre-light-tritanopia-BrKH6xXA.js +4 -0
  374. package/dist/graph-viewer/viewer/pierre-light-vibrant-BjCO0blv.js +154 -0
  375. package/dist/graph-viewer/viewer/pierre-light-vibrant-COFDSNWf.js +4 -0
  376. package/dist/graph-viewer/viewer/pkl-C53Sb050.js +3 -0
  377. package/dist/graph-viewer/viewer/plain-words-CgvxtEOa.js +17 -0
  378. package/dist/graph-viewer/viewer/plastic-BKBSI3T4.js +4 -0
  379. package/dist/graph-viewer/viewer/plastic-BtQ0IfLu.js +125 -0
  380. package/dist/graph-viewer/viewer/plsql-Bx7tup_v.js +3 -0
  381. package/dist/graph-viewer/viewer/po-DSTB2Mz9.js +3 -0
  382. package/dist/graph-viewer/viewer/poimandres-DaSN2vl7.js +112 -0
  383. package/dist/graph-viewer/viewer/poimandres-Dbcm0FXZ.js +4 -0
  384. package/dist/graph-viewer/viewer/polar-E3hAEXm5.js +3 -0
  385. package/dist/graph-viewer/viewer/popover-DrLB9iar.js +5329 -0
  386. package/dist/graph-viewer/viewer/postcss-BZib8l4b.js +3 -0
  387. package/dist/graph-viewer/viewer/powerquery-CJblX2B2.js +3 -0
  388. package/dist/graph-viewer/viewer/powershell-jc6OXU_u.js +3 -0
  389. package/dist/graph-viewer/viewer/prisma-CBAWJppo.js +3 -0
  390. package/dist/graph-viewer/viewer/prolog-Ce1YjgEP.js +3 -0
  391. package/dist/graph-viewer/viewer/proto-DGLklcji.js +3 -0
  392. package/dist/graph-viewer/viewer/pug-CPAFvvT7.js +12 -0
  393. package/dist/graph-viewer/viewer/puppet-B2qoEJs2.js +3 -0
  394. package/dist/graph-viewer/viewer/purescript-Cq_6EhvO.js +3 -0
  395. package/dist/graph-viewer/viewer/python-BgSzeAZt.js +2 -0
  396. package/dist/graph-viewer/viewer/python-D0AaDoWC.js +3 -0
  397. package/dist/graph-viewer/viewer/qml-CAJAZclz.js +5 -0
  398. package/dist/graph-viewer/viewer/qmldir-BSWsNKCW.js +3 -0
  399. package/dist/graph-viewer/viewer/qss-CT2jsqXX.js +3 -0
  400. package/dist/graph-viewer/viewer/r-gNt6i8Zf.js +5 -0
  401. package/dist/graph-viewer/viewer/racket-B0_wXtli.js +3 -0
  402. package/dist/graph-viewer/viewer/raku-DKDZy5Ck.js +3 -0
  403. package/dist/graph-viewer/viewer/razor-CmVjd-Dh.js +10 -0
  404. package/dist/graph-viewer/viewer/rbs-DvNU-OQ_.js +3 -0
  405. package/dist/graph-viewer/viewer/react-CisnW4fB.js +4262 -0
  406. package/dist/graph-viewer/viewer/react-dom-C5NDYQCD.js +143 -0
  407. package/dist/graph-viewer/viewer/record-part-d0gKKrMI.js +1299 -0
  408. package/dist/graph-viewer/viewer/red-D-VJz2zz.js +154 -0
  409. package/dist/graph-viewer/viewer/red-DidxQpA-.js +4 -0
  410. package/dist/graph-viewer/viewer/reg-D6txjqBF.js +3 -0
  411. package/dist/graph-viewer/viewer/regexp-CJmLSLYE.js +5 -0
  412. package/dist/graph-viewer/viewer/rel-CY3GbSca.js +3 -0
  413. package/dist/graph-viewer/viewer/riscv-BKjM5F1V.js +3 -0
  414. package/dist/graph-viewer/viewer/rolldown-runtime-DArdT4gl.js +23 -0
  415. package/dist/graph-viewer/viewer/ron-DJgcWJZU.js +3 -0
  416. package/dist/graph-viewer/viewer/rose-pine-DN0mhTLO.js +4 -0
  417. package/dist/graph-viewer/viewer/rose-pine-dawn-C7BTe7Qj.js +124 -0
  418. package/dist/graph-viewer/viewer/rose-pine-dawn-wShSQEG_.js +4 -0
  419. package/dist/graph-viewer/viewer/rose-pine-moon-CXZ0x-tN.js +4 -0
  420. package/dist/graph-viewer/viewer/rose-pine-moon-DpdAjsWi.js +124 -0
  421. package/dist/graph-viewer/viewer/rose-pine-ndHcBYxH.js +124 -0
  422. package/dist/graph-viewer/viewer/rosmsg-BTByjkSH.js +3 -0
  423. package/dist/graph-viewer/viewer/rst-BNLuumiw.js +22 -0
  424. package/dist/graph-viewer/viewer/ruby-BPTDv07s.js +30 -0
  425. package/dist/graph-viewer/viewer/ruby-Dgthgv0F.js +2 -0
  426. package/dist/graph-viewer/viewer/rust-DCdaqFaU.js +2 -0
  427. package/dist/graph-viewer/viewer/rust-Dj2n2rl0.js +3 -0
  428. package/dist/graph-viewer/viewer/sas-DViflgLe.js +5 -0
  429. package/dist/graph-viewer/viewer/sass-CL6GLiPQ.js +3 -0
  430. package/dist/graph-viewer/viewer/scala-D9AnhX7I.js +3 -0
  431. package/dist/graph-viewer/viewer/scheme-BksZ4zIw.js +3 -0
  432. package/dist/graph-viewer/viewer/scss-7wpnG0B9.js +2 -0
  433. package/dist/graph-viewer/viewer/scss-DR3BWwkk.js +6 -0
  434. package/dist/graph-viewer/viewer/sdbl-CLOIgNSF.js +3 -0
  435. package/dist/graph-viewer/viewer/segmented-control-ChhLMa6h.js +142 -0
  436. package/dist/graph-viewer/viewer/shaderlab-BNI6l0C5.js +5 -0
  437. package/dist/graph-viewer/viewer/shellscript-JaF_7KS2.js +5 -0
  438. package/dist/graph-viewer/viewer/shellsession-BpXPWCuv.js +5 -0
  439. package/dist/graph-viewer/viewer/shiki-BwlTRTY6.js +488 -0
  440. package/dist/graph-viewer/viewer/slack-dark-BxRxM-DA.js +72 -0
  441. package/dist/graph-viewer/viewer/slack-dark-eYrSWFNQ.js +4 -0
  442. package/dist/graph-viewer/viewer/slack-ochin-BkYWF81M.js +95 -0
  443. package/dist/graph-viewer/viewer/slack-ochin-DnDV13wS.js +4 -0
  444. package/dist/graph-viewer/viewer/smalltalk-OVt5uEUD.js +3 -0
  445. package/dist/graph-viewer/viewer/smithy-CseSvY8s.js +3 -0
  446. package/dist/graph-viewer/viewer/snazzy-light-CY4buyRs.js +4 -0
  447. package/dist/graph-viewer/viewer/snazzy-light-nzcYE5KK.js +81 -0
  448. package/dist/graph-viewer/viewer/solarized-dark-CJ28ehED.js +4 -0
  449. package/dist/graph-viewer/viewer/solarized-dark-CNL-YE5C.js +148 -0
  450. package/dist/graph-viewer/viewer/solarized-light-CPffzncm.js +4 -0
  451. package/dist/graph-viewer/viewer/solarized-light-CkLaeXvs.js +148 -0
  452. package/dist/graph-viewer/viewer/solidity-CGi7NMBq.js +2 -0
  453. package/dist/graph-viewer/viewer/solidity-CXjfwKeT.js +3 -0
  454. package/dist/graph-viewer/viewer/soy-BgMg3QC4.js +5 -0
  455. package/dist/graph-viewer/viewer/sparql-RY7y0-Jf.js +5 -0
  456. package/dist/graph-viewer/viewer/splunk-MGILMmew.js +3 -0
  457. package/dist/graph-viewer/viewer/sql-BIIYxsxo.js +5 -0
  458. package/dist/graph-viewer/viewer/sql-bbpzmmG9.js +2 -0
  459. package/dist/graph-viewer/viewer/ssh-config-CFmUyPR7.js +3 -0
  460. package/dist/graph-viewer/viewer/stata-W40nJXFi.js +5 -0
  461. package/dist/graph-viewer/viewer/stream-tokenizer-CaVb21TO.js +99 -0
  462. package/dist/graph-viewer/viewer/stylus-Kh83dApl.js +3 -0
  463. package/dist/graph-viewer/viewer/surrealql-BvdRuViV.js +5 -0
  464. package/dist/graph-viewer/viewer/svelte-BIpAIvXq.js +14 -0
  465. package/dist/graph-viewer/viewer/swift-B7Z-rXzN.js +3 -0
  466. package/dist/graph-viewer/viewer/swift-CITNSfj8.js +2 -0
  467. package/dist/graph-viewer/viewer/synthwave-84-k9mB1wtO.js +4 -0
  468. package/dist/graph-viewer/viewer/synthwave-84-kUO_gAph.js +398 -0
  469. package/dist/graph-viewer/viewer/system-verilog-CQoMYllC.js +3 -0
  470. package/dist/graph-viewer/viewer/systemd-ArfzIYBi.js +3 -0
  471. package/dist/graph-viewer/viewer/talonscript-SIE54PtE.js +3 -0
  472. package/dist/graph-viewer/viewer/tasl-Ck4PO08m.js +3 -0
  473. package/dist/graph-viewer/viewer/tcl-DfkVwqLO.js +3 -0
  474. package/dist/graph-viewer/viewer/templ-CcrsYqs3.js +12 -0
  475. package/dist/graph-viewer/viewer/terminal-BxRacTx0.js +52 -0
  476. package/dist/graph-viewer/viewer/terraform-DccThf6s.js +3 -0
  477. package/dist/graph-viewer/viewer/tex-OxWF-6wM.js +6 -0
  478. package/dist/graph-viewer/viewer/themes-BxrCCwH5.js +238 -0
  479. package/dist/graph-viewer/viewer/tokyo-night-pVep8RHB.js +141 -0
  480. package/dist/graph-viewer/viewer/tokyo-night-wSZ66vL4.js +4 -0
  481. package/dist/graph-viewer/viewer/toml-CIQJnU5u.js +3 -0
  482. package/dist/graph-viewer/viewer/toml-D2vAS7BS.js +2 -0
  483. package/dist/graph-viewer/viewer/ts-tags-CBuzNYes.js +38 -0
  484. package/dist/graph-viewer/viewer/tsv-AfvsdcL-.js +3 -0
  485. package/dist/graph-viewer/viewer/tsx-BjEV2c_V.js +2 -0
  486. package/dist/graph-viewer/viewer/tsx-utlJ2eBd.js +5 -0
  487. package/dist/graph-viewer/viewer/turtle-D1NNZBgy.js +3 -0
  488. package/dist/graph-viewer/viewer/twig-BojFE3iW.js +18 -0
  489. package/dist/graph-viewer/viewer/typescript-S9qHhxTN.js +5 -0
  490. package/dist/graph-viewer/viewer/typescript-ekZNylIf.js +2 -0
  491. package/dist/graph-viewer/viewer/typespec-M_tZhO7D.js +3 -0
  492. package/dist/graph-viewer/viewer/typst-D2koCOEy.js +120 -0
  493. package/dist/graph-viewer/viewer/ui-ByOBsvk7.js +5 -0
  494. package/dist/graph-viewer/viewer/ui-CxK41KO5.js +5 -0
  495. package/dist/graph-viewer/viewer/ui-DZiGjPwl.js +906 -0
  496. package/dist/graph-viewer/viewer/v-DbYZLS97.js +3 -0
  497. package/dist/graph-viewer/viewer/vala-i5OYwFuH.js +3 -0
  498. package/dist/graph-viewer/viewer/vb-DRaXf86R.js +3 -0
  499. package/dist/graph-viewer/viewer/verilog-Dl3uFuBh.js +3 -0
  500. package/dist/graph-viewer/viewer/vesper-B2HI-Qu1.js +84 -0
  501. package/dist/graph-viewer/viewer/vesper-DgN5ShJZ.js +4 -0
  502. package/dist/graph-viewer/viewer/vhdl-UepOATuw.js +3 -0
  503. package/dist/graph-viewer/viewer/viml-DgaHry3T.js +3 -0
  504. package/dist/graph-viewer/viewer/vitesse-black-B09teiUx.js +4 -0
  505. package/dist/graph-viewer/viewer/vitesse-black-BLUtFdIS.js +184 -0
  506. package/dist/graph-viewer/viewer/vitesse-dark-CSebpMf5.js +184 -0
  507. package/dist/graph-viewer/viewer/vitesse-dark-CkA3-NtU.js +4 -0
  508. package/dist/graph-viewer/viewer/vitesse-light-DECVT8fj.js +4 -0
  509. package/dist/graph-viewer/viewer/vitesse-light-DJPcjfyV.js +184 -0
  510. package/dist/graph-viewer/viewer/vue-CiFPO7R5.js +21 -0
  511. package/dist/graph-viewer/viewer/vue-html-BZL30ZyU.js +5 -0
  512. package/dist/graph-viewer/viewer/vue-vine-CVQkz-vV.js +18 -0
  513. package/dist/graph-viewer/viewer/vyper-BiyGiCmH.js +3 -0
  514. package/dist/graph-viewer/viewer/wasm-BXdtUMGf.js +4 -0
  515. package/dist/graph-viewer/viewer/wasm-DXa1gtBd.js +3 -0
  516. package/dist/graph-viewer/viewer/wenyan-Ke6AN0BI.js +3 -0
  517. package/dist/graph-viewer/viewer/wgsl-Vcm3Lg52.js +3 -0
  518. package/dist/graph-viewer/viewer/wikitext-C4uDiSA9.js +3 -0
  519. package/dist/graph-viewer/viewer/wit-hbIPZwZR.js +3 -0
  520. package/dist/graph-viewer/viewer/wolfram-DGFnG0I5.js +3 -0
  521. package/dist/graph-viewer/viewer/workspace-DalRxssx.js +25100 -0
  522. package/dist/graph-viewer/viewer/x-B_F8B4lq.js +56 -0
  523. package/dist/graph-viewer/viewer/xml-C4j_mOgu.js +6 -0
  524. package/dist/graph-viewer/viewer/xml-SfvhYhbQ.js +2 -0
  525. package/dist/graph-viewer/viewer/xsl-CNv6nqtA.js +5 -0
  526. package/dist/graph-viewer/viewer/yaml-CS1e8wnG.js +5 -0
  527. package/dist/graph-viewer/viewer/yaml-CudzZ2m4.js +2 -0
  528. package/dist/graph-viewer/viewer/zenscript-BtXHY1aa.js +3 -0
  529. package/dist/graph-viewer/viewer/zig-BaU1vZRj.js +3 -0
  530. package/dist/graph-viewer/workspace-model-Ewf17pTW.js +1541 -0
  531. package/dist/graph-viewer/workspace-viewer.js +24443 -0
  532. package/dist/graph-viewer/workspace.js +2 -0
  533. package/dist/index.mjs +11 -11
  534. package/package.json +5 -5
@@ -0,0 +1,4262 @@
1
+ import { i as e } from "./rolldown-runtime-DArdT4gl.js";
2
+ import { i as t, t as n } from "./jsx-runtime-BSzbUOFc.js";
3
+ //#region node_modules/.pnpm/@tangle-network+charts@0.21.19_react@19.3.0/node_modules/@tangle-network/charts/dist/timeline-B7c-cede.js
4
+ function r(e) {
5
+ return String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
6
+ }
7
+ var i = [
8
+ 281,
9
+ 288,
10
+ 466,
11
+ 633,
12
+ 642,
13
+ 982,
14
+ 644,
15
+ 300,
16
+ 365,
17
+ 365,
18
+ 501,
19
+ 662,
20
+ 288,
21
+ 460,
22
+ 288,
23
+ 360,
24
+ 631,
25
+ 407,
26
+ 610,
27
+ 618,
28
+ 646,
29
+ 608,
30
+ 620,
31
+ 566,
32
+ 619,
33
+ 620,
34
+ 288,
35
+ 302,
36
+ 662,
37
+ 662,
38
+ 662,
39
+ 511,
40
+ 966,
41
+ 690,
42
+ 654,
43
+ 730,
44
+ 722,
45
+ 601,
46
+ 590,
47
+ 746,
48
+ 743,
49
+ 269,
50
+ 571,
51
+ 672,
52
+ 565,
53
+ 903,
54
+ 753,
55
+ 765,
56
+ 639,
57
+ 765,
58
+ 644,
59
+ 642,
60
+ 646,
61
+ 744,
62
+ 690,
63
+ 985,
64
+ 682,
65
+ 679,
66
+ 629,
67
+ 365,
68
+ 360,
69
+ 365,
70
+ 471,
71
+ 456,
72
+ 323,
73
+ 562,
74
+ 612,
75
+ 571,
76
+ 612,
77
+ 583,
78
+ 370,
79
+ 613,
80
+ 591,
81
+ 242,
82
+ 242,
83
+ 549,
84
+ 242,
85
+ 876,
86
+ 591,
87
+ 600,
88
+ 612,
89
+ 612,
90
+ 376,
91
+ 528,
92
+ 327,
93
+ 591,
94
+ 562,
95
+ 818,
96
+ 546,
97
+ 562,
98
+ 552,
99
+ 426,
100
+ 333,
101
+ 426,
102
+ 662
103
+ ], a = [
104
+ 252,
105
+ 321,
106
+ 523,
107
+ 644,
108
+ 650,
109
+ 1004,
110
+ 663,
111
+ 326,
112
+ 373,
113
+ 373,
114
+ 540,
115
+ 673,
116
+ 319,
117
+ 465,
118
+ 319,
119
+ 379,
120
+ 660,
121
+ 423,
122
+ 623,
123
+ 636,
124
+ 666,
125
+ 629,
126
+ 640,
127
+ 576,
128
+ 640,
129
+ 640,
130
+ 319,
131
+ 329,
132
+ 673,
133
+ 673,
134
+ 673,
135
+ 543,
136
+ 999,
137
+ 728,
138
+ 659,
139
+ 737,
140
+ 722,
141
+ 605,
142
+ 588,
143
+ 749,
144
+ 746,
145
+ 277,
146
+ 580,
147
+ 703,
148
+ 565,
149
+ 922,
150
+ 759,
151
+ 769,
152
+ 645,
153
+ 773,
154
+ 652,
155
+ 650,
156
+ 660,
157
+ 736,
158
+ 728,
159
+ 1020,
160
+ 720,
161
+ 713,
162
+ 652,
163
+ 373,
164
+ 379,
165
+ 373,
166
+ 481,
167
+ 469,
168
+ 351,
169
+ 574,
170
+ 624,
171
+ 583,
172
+ 624,
173
+ 591,
174
+ 389,
175
+ 625,
176
+ 612,
177
+ 262,
178
+ 262,
179
+ 569,
180
+ 262,
181
+ 900,
182
+ 612,
183
+ 609,
184
+ 624,
185
+ 624,
186
+ 397,
187
+ 549,
188
+ 353,
189
+ 612,
190
+ 587,
191
+ 839,
192
+ 569,
193
+ 588,
194
+ 566,
195
+ 455,
196
+ 359,
197
+ 455,
198
+ 673
199
+ ], o = {
200
+ "·": 300,
201
+ "×": 670,
202
+ "—": 1e3,
203
+ "–": 500,
204
+ "…": 900,
205
+ "≥": 670,
206
+ "≤": 670,
207
+ "±": 670,
208
+ "→": 954,
209
+ "−": 662
210
+ }, s = 1.04;
211
+ function c(e, t, n = "sans") {
212
+ if (n === "mono") return e.length * .6 * t * s;
213
+ let r = n === "sans-semibold" ? a : i, c = 0;
214
+ for (let t of e) {
215
+ let e = t.codePointAt(0) ?? 0;
216
+ c += e >= 32 && e <= 126 ? r[e - 32] : o[t] ?? 620;
217
+ }
218
+ return c / 1e3 * t * s;
219
+ }
220
+ function l(e, t, n, r = "sans", i = 2) {
221
+ let a = (e) => c(e, n, r) <= t, o = [], s = [], l = "", u = (e, t) => {
222
+ o.push(l), s.push(t), l = e;
223
+ };
224
+ for (let t of e.split(/\s+/).filter(Boolean)) {
225
+ let e = l ? `${l} ${t}` : t;
226
+ if (a(e)) l = e;
227
+ else if (a(t)) l ? u(t, " ") : l = t;
228
+ else {
229
+ let e = t.match(/[^\-/_·]+[\-/_·]?|[\-/_·]/g) ?? [t];
230
+ for (let [t, n] of e.entries()) {
231
+ let e = t === 0 ? " " : "", r = l ? `${l}${e}${n}` : n;
232
+ a(r) || !l ? l = r : u(n, e);
233
+ }
234
+ }
235
+ }
236
+ if (l && o.push(l), o.length <= i && o.every(a)) return {
237
+ lines: o,
238
+ truncated: !1
239
+ };
240
+ let d = o.slice(0, i), f = o.slice(i - 1).reduce((e, t, n) => n === 0 ? t : `${e}${s[i - 2 + n]}${t}`, "");
241
+ for (; f.length > 1 && !a(`${f}…`);) f = f.slice(0, -1);
242
+ return d[i - 1] = `${f.trimEnd()}…`, {
243
+ lines: d,
244
+ truncated: !0
245
+ };
246
+ }
247
+ function u(e, t, n, i, a) {
248
+ return e.length === 1 ? `<text x="${t}" y="${n}" ${a}>${r(e[0])}</text>` : `<text x="${t}" y="${n}" ${a}>${e.map((e, n) => `<tspan x="${t}" dy="${n === 0 ? 0 : i}">${r(e)}</tspan>`).join("")}</text>`;
249
+ }
250
+ function d(e, t, n, r = "sans") {
251
+ let i = [];
252
+ for (let a of e) {
253
+ let e = i[i.length - 1];
254
+ e !== void 0 && c(`${e} · ${a}`, n, r) <= t ? i[i.length - 1] = `${e} · ${a}` : i.push(a);
255
+ }
256
+ return i;
257
+ }
258
+ function f(e, t, n = `${t}s`) {
259
+ return e === 1 ? t : n;
260
+ }
261
+ function p(e) {
262
+ return e.charAt(0).toUpperCase() + e.slice(1);
263
+ }
264
+ function m(e) {
265
+ return e !== void 0 && Number.isFinite(e) && e > 720 ? Math.floor(e) : 720;
266
+ }
267
+ var h = (e) => Math.round(e * 100) / 100;
268
+ function g(e, t, n) {
269
+ let r = Math.ceil(t);
270
+ return `<svg class="tgc-svg" xmlns="http://www.w3.org/2000/svg" width="${e}" height="${r}" viewBox="0 0 ${e} ${r}" aria-hidden="true" focusable="false">${n}</svg>`;
271
+ }
272
+ function _(e, t, n, r, i) {
273
+ if (n <= 0) return "";
274
+ let a = Math.min(4, r / 2, n);
275
+ return `<path class="${i}" d="M${h(e)} ${h(t)}h${h(n - a)}a${a} ${a} 0 0 1 ${a} ${a}v${h(r - 2 * a)}a${a} ${a} 0 0 1 -${a} ${a}h-${h(n - a)}z"/>`;
276
+ }
277
+ function v(e, t, n, r, i, a = "") {
278
+ return n <= 0 || r <= 0 ? "" : `<rect class="${i}" x="${h(e)}" y="${h(t)}" width="${h(n)}" height="${h(r)}"${a ? ` ${a}` : ""}/>`;
279
+ }
280
+ function y(e, t, n, r, i = 6) {
281
+ if (!(n > 0) || !(r > 0)) return "";
282
+ let a = "";
283
+ for (let o = i / 2; o < n + r; o += i) {
284
+ let i = Math.max(0, o - r), s = Math.min(n, o);
285
+ a += `M${h(e + i)} ${h(t + o - i)}L${h(e + s)} ${h(t + o - s)}`;
286
+ }
287
+ return a;
288
+ }
289
+ function b(e, t, n, r, i) {
290
+ return n <= 0 || r <= 0 ? "" : `<g class="${i}" data-hatched="true">${v(e, t, n, r, "tgc-hatch-bg")}<path class="tgc-hatch" d="${y(e, t, n, r)}"/></g>`;
291
+ }
292
+ function x(e, t, n, r, i) {
293
+ return `<line class="${i}" x1="${h(e)}" y1="${h(t)}" x2="${h(n)}" y2="${h(r)}"/>`;
294
+ }
295
+ function S(e, t, n, r) {
296
+ return `<circle class="${r}" cx="${h(e)}" cy="${h(t)}" r="${n}"/>`;
297
+ }
298
+ var C = [
299
+ "circle",
300
+ "square",
301
+ "triangle",
302
+ "diamond"
303
+ ];
304
+ function w(e, t, n, r) {
305
+ let [i, a] = [h(t), h(n)];
306
+ if (e === "square") {
307
+ let e = h(r * .9);
308
+ return `M${h(i - e)} ${h(a - e)}h${h(2 * e)}v${h(2 * e)}h${h(-2 * e)}z`;
309
+ }
310
+ if (e === "triangle") {
311
+ let e = h(r * 1.2);
312
+ return `M${i} ${h(a - e)}L${h(i + e)} ${h(a + e * .8)}L${h(i - e)} ${h(a + e * .8)}z`;
313
+ }
314
+ if (e === "diamond") {
315
+ let e = h(r * 1.3);
316
+ return `M${i} ${h(a - e)}L${h(i + e)} ${a}L${i} ${h(a + e)}L${h(i - e)} ${a}z`;
317
+ }
318
+ return `M${h(i - r)} ${a}a${r} ${r} 0 1 0 ${h(2 * r)} 0a${r} ${r} 0 1 0 ${h(-2 * r)} 0`;
319
+ }
320
+ function T(e, t) {
321
+ return `<polyline class="${t}" points="${e.map(([e, t]) => `${h(e)},${h(t)}`).join(" ")}"/>`;
322
+ }
323
+ function E(e, t, n, i = {}) {
324
+ let a = i.anchor && i.anchor !== "start" ? ` text-anchor="${i.anchor}"` : "", o = i.weight === 600 ? " font-weight=\"600\"" : "";
325
+ return `<text class="${i.cls ?? "tgc-ink"}" x="${h(e)}" y="${h(t)}" font-size="${i.size ?? 12}"${a}${o}>${r(n)}</text>`;
326
+ }
327
+ function D(e, t) {
328
+ return `<g><title>${r(e)}</title>${t}</g>`;
329
+ }
330
+ function O(e, t, n) {
331
+ let i = t.map((e) => `<th scope="col"${e.numeric ? " class=\"tgc-n\"" : ""}>${r(e.label)}</th>`).join(""), a = n.map((e) => `<tr>${e.map((e, n) => n === 0 ? `<th scope="row">${r(e)}</th>` : `<td${t[n]?.numeric ? " class=\"tgc-n\"" : ""}>${r(e)}</td>`).join("")}</tr>`).join("");
332
+ return `<table class="tgc-table"><caption>${r(e)}</caption><thead><tr>${i}</tr></thead><tbody>${a}</tbody></table>`;
333
+ }
334
+ var k = [
335
+ "S",
336
+ "A",
337
+ "B",
338
+ "C",
339
+ "F"
340
+ ], A = [
341
+ "F",
342
+ "C",
343
+ "B",
344
+ "A",
345
+ "S"
346
+ ];
347
+ function j(e, t) {
348
+ return A.indexOf(e) >= A.indexOf(t);
349
+ }
350
+ function M(e) {
351
+ return `${Math.round(e * 100)}%`;
352
+ }
353
+ function N(e) {
354
+ return e >= 100 ? `$${Math.round(e).toLocaleString("en-US")}` : e >= 1 ? `$${e.toFixed(2)}` : e >= .01 ? `$${e.toFixed(3)}` : `$${e.toFixed(4)}`;
355
+ }
356
+ function P(e) {
357
+ let t = e / 1e3;
358
+ return t < 60 ? `${Math.round(t)} s` : t < 3600 ? `${(t / 60).toFixed(1)} min` : `${(t / 3600).toFixed(1)} h`;
359
+ }
360
+ function F(e, t) {
361
+ return `${e}/${t}`;
362
+ }
363
+ var I = {
364
+ "task-cluster-bootstrap": "task-clustered bootstrap",
365
+ "mcnemar-exact": "exact McNemar",
366
+ wilson: "Wilson score"
367
+ };
368
+ function L(e) {
369
+ return `${Math.round((e.level ?? 0) * 100)}% ${e.method ? I[e.method] : ""}`.trim();
370
+ }
371
+ function ee(e) {
372
+ if (!e) return "no interval";
373
+ let t = [e.level === null ? "level" : "", e.method === null ? "method" : ""].filter(Boolean);
374
+ return t.length ? `the interval names no ${t.join(" or ")}` : e.method in I ? !Number.isFinite(e.level) || e.level <= 0 || e.level >= 1 ? "the interval level is outside 0–1" : !Number.isFinite(e.lower) || !Number.isFinite(e.upper) ? "the interval bounds are not finite" : e.lower <= e.upper ? null : "the interval bounds are out of order" : "the interval method is unknown";
375
+ }
376
+ function R(e) {
377
+ return e === "descriptive" || e === "bootstrap";
378
+ }
379
+ function z(e, t) {
380
+ return e === "none" ? t === 1 ? "1 unit" : `${t} units` : e === "insufficient" ? "too few units" : "";
381
+ }
382
+ function B(e) {
383
+ return e.basis !== "unknown" && e.perSolvedUsd !== null && Number.isFinite(e.perSolvedUsd) && e.perSolvedUsd > 0 ? e.perSolvedUsd : null;
384
+ }
385
+ function V(e, t) {
386
+ if (t === 0) return "no pass";
387
+ let n = B(e);
388
+ return n === null ? "unknown" : e.basis === "receipts" ? N(n) : `${N(n)} est.`;
389
+ }
390
+ function te(e) {
391
+ return R(e.estimate) ? !Number.isFinite(e.rate) || e.rate < 0 || e.rate > 1 ? "rate is outside 0–1" : ee(e.interval) || (e.interval.method === "mcnemar-exact" ? "exact McNemar applies to paired comparisons, not rates" : e.estimate === "descriptive" && e.interval.method !== "wilson" ? `descriptive estimate does not support ${L(e.interval)}` : e.interval.lower < 0 || e.interval.upper > 1 ? "the rate interval is outside 0–1" : e.rate < e.interval.lower - 1e-6 || e.rate > e.interval.upper + 1e-6 ? "the rate falls outside its interval" : null) : `${e.estimate} estimate`;
392
+ }
393
+ function ne(e) {
394
+ return !Number.isInteger(e.attempts) || e.attempts < 0 || !Number.isInteger(e.solved) || e.solved < 0 || e.solved > e.attempts ? "passed and attempt counts are invalid" : !Number.isFinite(e.rate) || e.rate < 0 || e.rate > 1 ? "rate is outside 0–1" : e.attempts > 0 && Math.abs(e.rate - e.solved / e.attempts) > 1e-6 ? "rate disagrees with passed/attempts" : e.attempts === 0 && e.rate !== 0 ? "rate has no attempts" : R(e.estimate) && e.attempts === 0 ? "drawable estimate has no attempts" : null;
395
+ }
396
+ function re(e) {
397
+ if (e.length > 0 && e.every((e) => e.rank !== null && e.estimate === "bootstrap")) return [...e].sort((e, t) => e.rank - t.rank);
398
+ let t = e.filter((e) => R(e.estimate)).sort((e, t) => t.rate - e.rate), n = e.filter((e) => !R(e.estimate)).sort((e, t) => t.attempts - e.attempts);
399
+ return [...t, ...n];
400
+ }
401
+ function ie(e, t = 0, n = 0) {
402
+ let r = e ? k.filter((t) => e[t] > 0).map((t) => `${e[t]}${t}`) : [];
403
+ return n && r.push(`${n} flagged`), t && r.push(`${t}U`), r.join(" ");
404
+ }
405
+ function ae(e) {
406
+ return e ? A.reduce((t, n) => t + e[n], 0) : 0;
407
+ }
408
+ function oe(e) {
409
+ return "refused" in e;
410
+ }
411
+ var H = [
412
+ "pass",
413
+ "deadline",
414
+ "died",
415
+ "event",
416
+ "release",
417
+ "steer",
418
+ "ruling",
419
+ "wake"
420
+ ], se = [
421
+ "pass",
422
+ "fail",
423
+ "unknown"
424
+ ], ce = [
425
+ "after-pass",
426
+ "idle",
427
+ "missing",
428
+ "blocked",
429
+ "group"
430
+ ], le = {
431
+ release: "diamond",
432
+ steer: "triangle",
433
+ ruling: "square",
434
+ wake: "circle"
435
+ };
436
+ function ue(e = [], t = [], n) {
437
+ let r = (e) => !n || e >= n[0] && e <= n[1];
438
+ for (let t of e) {
439
+ if (!t || typeof t.label != "string" || !t.label.trim()) return "Every mark needs a label.";
440
+ if (!H.includes(t.kind)) return `${t.label}: unknown mark kind.`;
441
+ if (t.verdict !== void 0 && !se.includes(t.verdict)) return `${t.label}: a verdict is pass, fail or unknown.`;
442
+ if (t.source !== void 0 && (typeof t.source != "string" || !t.source.trim())) return `${t.label}: a source needs a name.`;
443
+ if (!Number.isFinite(t.at) || !r(t.at)) return `${t.label}: mark position must be finite and inside the axis domain.`;
444
+ }
445
+ for (let e of t) {
446
+ if (!e || typeof e.label != "string" || !e.label.trim()) return "Every band needs a label.";
447
+ if (!ce.includes(e.kind)) return `${e.label}: unknown band kind.`;
448
+ if (!Number.isFinite(e.from) || !Number.isFinite(e.to) || (e.kind === "group" ? e.from > e.to : e.from >= e.to) || !r(e.from) || !r(e.to)) return `${e.label}: a band needs finite, increasing bounds inside the axis domain.`;
449
+ }
450
+ return null;
451
+ }
452
+ function de(e) {
453
+ return e.kind === "event" && e.source === "gap";
454
+ }
455
+ function U(e) {
456
+ return e.source ? `${e.label} · ${e.source}` : e.label;
457
+ }
458
+ function W(e) {
459
+ return [
460
+ e.kind,
461
+ e.verdict,
462
+ e.lane && `lane ${e.lane}`
463
+ ].filter(Boolean).join(" · ");
464
+ }
465
+ function fe(e, t, n, r, i, a, o) {
466
+ return e.map((e) => {
467
+ if (e.kind === "group") return "";
468
+ let s = a ? Math.max(e.from, a[0]) : e.from, c = a ? Math.min(e.to, a[1]) : e.to;
469
+ if (c <= s) return "";
470
+ let [l, u] = o ? o(s, c) : [t(s), t(c)], d = l, f = u - l, p = `tgc-band tgc-band-${e.kind}`, m = e.kind === "missing" ? b(d, n, f, r - n, p) : v(d, n, f, r - n, p) + (e.kind === "blocked" ? x(d, n, d + f, n, "tgc-band-wall") : "");
471
+ return D(`${e.label}: ${i(e.from)} to ${i(e.to)}`, `<g data-band="${e.kind}">${m}</g>`);
472
+ }).join("");
473
+ }
474
+ function pe(e = []) {
475
+ return e.some((e) => e.kind === "group") ? 18 : 0;
476
+ }
477
+ function me(e, t, n, r, i, a, o, s) {
478
+ return e.filter((e) => e.kind === "group").map((e) => {
479
+ let c = s ? Math.max(e.from, s[0]) : e.from, u = s ? Math.min(e.to, s[1]) : e.to;
480
+ if (u < c) return "";
481
+ let [d, f] = t(c, u), p = f - d, m = p >= 24 ? l(e.label, p - 10, 12, "sans", 1).lines[0] : "", h = [d, f].filter((e) => e > i + .5 && e < a - .5).map((e) => x(e, n - 16, e, r, "tgc-group-edge")).join(""), g = x(d + 2, n - 3, f - 2, n - 3, "tgc-group-rule") + (m ? E(d + 3, n - 7, m, {
482
+ size: 12,
483
+ cls: "tgc-group-label"
484
+ }) : "");
485
+ return D(`${e.label}: ${o(e.from)} to ${o(e.to)}`, `<g data-band="group">${h}${g}</g>`);
486
+ }).join("");
487
+ }
488
+ function he(e, t) {
489
+ let n = [];
490
+ for (let r of [...e].sort((e, t) => e.at - t.at)) {
491
+ let e = t(r.at), i = n.at(-1), a = i?.marks[0], o = i && t(i.marks.at(-1).at);
492
+ i && r.kind !== "ruling" && a.kind === r.kind && a.verdict === r.verdict && (e - o < 3 || e - o < 12 && U(a) === U(r)) ? i.marks.push(r) : n.push({
493
+ x: e,
494
+ marks: [r]
495
+ });
496
+ }
497
+ return n;
498
+ }
499
+ function ge(e, t, n, r) {
500
+ let i = r.rows ?? 3, a = Math.max(48, Math.min(200, (n - t) * .42)), o = Array.from({ length: i }, () => []), s = (e, t, n) => o[e].every(([e, r]) => n + 6 <= e || t >= r + 6), u = (e, r, u, d, f) => {
501
+ let p = l(e, a, 12, "sans", 1).lines[0], m = c(p, 12);
502
+ for (let e of f ? [d, d === "start" ? "end" : "start"] : [d]) {
503
+ let [a, c] = e === "start" ? [r, r + m] : [u - m, u];
504
+ if (!(a < t - 4 || c > n + 4)) {
505
+ for (let t = 0; t < i; t++) if (s(t, a, c)) return o[t].push([a, c]), {
506
+ row: t,
507
+ x: e === "start" ? r : u,
508
+ anchor: e,
509
+ text: p
510
+ };
511
+ }
512
+ }
513
+ return null;
514
+ }, [d, f] = r.window ?? [-Infinity, Infinity], p = [...(r.after ?? []).map((e) => u(`${U(e)} +${P(e.at - f)} →`, n, n, "end", !1)), ...(r.before ?? []).map((e) => u(`← ${U(e)} −${P(d - e.at)}`, t, t, "start", !1))].filter((e) => e !== null), m = /* @__PURE__ */ new Map();
515
+ for (let r of [...e.filter((e) => !de(e.marks[0])), ...e.filter((e) => de(e.marks[0]))]) {
516
+ let e = r.x > t + (n - t) * .62, i = u(U(r.marks[0]) + (r.marks.length > 1 ? ` (+${r.marks.length - 1})` : ""), r.x + 4, r.x - 4, e ? "end" : "start", !0);
517
+ i && m.set(r, i);
518
+ }
519
+ return {
520
+ placed: m,
521
+ edges: p,
522
+ rows: Math.max(0, ...[...m.values(), ...p].map((e) => e.row + 1))
523
+ };
524
+ }
525
+ function G(e, t, n, r, i = {}) {
526
+ return ge(he(e, t), n, r, i).rows;
527
+ }
528
+ function _e(e, t, n, r = 3.5) {
529
+ let i = le[e];
530
+ return i ? `<path class="tgc-mark-head" d="${w(i, t, n, r)}"/>` : "";
531
+ }
532
+ function K(e, t, n, r, i, a, o, s = n, c = {}) {
533
+ let l = he(e, t), { placed: u, edges: d } = ge(l, i, a, c), f = (e) => s + 12 + e * 14, p = l.map((e) => {
534
+ let { x: t, marks: i } = e, a = i[0], c = le[a.kind] !== void 0 && a.kind !== "ruling" || de(a), l = x(t, Math.min(n, s), t, c ? n + 4 : r, `tgc-mark tgc-mark-${a.kind}`);
535
+ a.kind === "died" && (l += x(t - 4, r - 8, t + 4, r, "tgc-mark tgc-mark-died") + x(t - 4, r, t + 4, r - 8, "tgc-mark tgc-mark-died")), l += _e(a.kind, t, n + 4);
536
+ let u = a.verdict ? ` data-verdict="${a.verdict}" class="tgc-verdict-${a.verdict}"` : "";
537
+ return D(i.map((e) => `${U(e)}: ${o(e.at)}${e.verdict ? ` · ${e.verdict}` : ""}`).join("\n"), `<g data-mark="${a.kind}"${i.length > 1 ? ` data-merged="${i.length}"` : ""}${u}>${l}</g>`);
538
+ }).join("");
539
+ for (let e of l) {
540
+ let t = u.get(e);
541
+ t && (p += E(t.x, f(t.row), t.text, {
542
+ size: 12,
543
+ anchor: t.anchor,
544
+ cls: "tgc-mark-label"
545
+ }));
546
+ }
547
+ for (let e of d) p += `<g data-edge="${e.anchor === "end" ? "after" : "before"}">${E(e.x, f(e.row), e.text, {
548
+ size: 12,
549
+ anchor: e.anchor,
550
+ cls: "tgc-mark-label tgc-mark-edge"
551
+ })}</g>`;
552
+ return p;
553
+ }
554
+ function ve(e, t, n, r) {
555
+ if (!e.length && !t.length) return "";
556
+ let i = [...e.map((e) => ({
557
+ at: e.at,
558
+ cells: [
559
+ U(e),
560
+ W(e),
561
+ r(e.at),
562
+ ""
563
+ ]
564
+ })), ...t.map((e) => ({
565
+ at: e.from,
566
+ cells: [
567
+ e.label,
568
+ e.kind === "missing" ? "no data" : e.kind,
569
+ r(e.from),
570
+ r(e.to)
571
+ ]
572
+ }))].sort((e, t) => e.at - t.at);
573
+ return O(`Recorded events by ${n}`, [
574
+ { label: "Event" },
575
+ { label: "Kind" },
576
+ {
577
+ label: `${n} from`,
578
+ numeric: !0
579
+ },
580
+ {
581
+ label: `${n} to`,
582
+ numeric: !0
583
+ }
584
+ ], i.map((e) => e.cells));
585
+ }
586
+ var q = "Vertical rules mark recorded events (solid: pass, dashed: deadline, cross: died, dotted: other; a diamond is a release, a triangle a steer, a square a ruling and a circle a wake, coloured by verdict when one is recorded); tinted spans are recorded periods, a wall-topped span is a system-wide block, and hatched spans have no data.", ye = [
587
+ "ok",
588
+ "quota",
589
+ "lost",
590
+ "rate-limit",
591
+ "oom",
592
+ "refused",
593
+ "aborted",
594
+ "other"
595
+ ];
596
+ Object.freeze(Object.fromEntries(ye.map((e) => [e, `var(--chart-outcome-${e === "aborted" ? "neutral" : e})`])));
597
+ var be = [
598
+ "solved",
599
+ "not solved",
600
+ "died",
601
+ "stalled",
602
+ "cancelled",
603
+ "live",
604
+ "never started"
605
+ ], J = Object.freeze(Object.fromEntries(be.map((e) => [e, `var(--chart-ending-${e.replace(" ", "-")})`])));
606
+ function xe(e) {
607
+ return e === void 0 ? "" : Number.isInteger(e) && e >= 0 && e < 4 ? `tgc-checker-${e}` : "tgc-checker-other";
608
+ }
609
+ var Se = ye, Ce = (e) => new Date(e).toISOString().slice(11, 16), we = 6e4, Te = 864e5, Ee = [
610
+ "Jan",
611
+ "Feb",
612
+ "Mar",
613
+ "Apr",
614
+ "May",
615
+ "Jun",
616
+ "Jul",
617
+ "Aug",
618
+ "Sep",
619
+ "Oct",
620
+ "Nov",
621
+ "Dec"
622
+ ], De = [
623
+ 1,
624
+ 2,
625
+ 5,
626
+ 10,
627
+ 15,
628
+ 30,
629
+ 60,
630
+ 120,
631
+ 180,
632
+ 360,
633
+ 720,
634
+ 1440,
635
+ 2880,
636
+ 10080
637
+ ].map((e) => e * we);
638
+ function Oe(e, t) {
639
+ let n = t.id ?? "timeline";
640
+ if (!e.length) return {
641
+ id: n,
642
+ refused: "No lanes recorded."
643
+ };
644
+ if (!t.measure?.trim()) return {
645
+ id: n,
646
+ refused: "A timeline needs a measure."
647
+ };
648
+ if (new Set(e.map((e) => e.id)).size !== e.length) return {
649
+ id: n,
650
+ refused: "Duplicate lane ids."
651
+ };
652
+ if (t.now !== void 0 && !Number.isFinite(t.now)) return {
653
+ id: n,
654
+ refused: "now must be a finite time."
655
+ };
656
+ let i = new Map(e.map((e) => [e.id, e]));
657
+ for (let t of e) {
658
+ let e = /* @__PURE__ */ new Set();
659
+ for (let r = t; r.parent !== void 0; r = i.get(r.parent)) {
660
+ if (!i.has(r.parent)) return {
661
+ id: n,
662
+ refused: `${r.label}: parent ${r.parent} is not a lane.`
663
+ };
664
+ if (e.has(r.id)) return {
665
+ id: n,
666
+ refused: `${t.label}: its parent chain loops back to ${r.label}.`
667
+ };
668
+ e.add(r.id);
669
+ }
670
+ if (t.depth !== void 0 && (!Number.isInteger(t.depth) || t.depth < 0)) return {
671
+ id: n,
672
+ refused: `${t.label}: depth must be a whole number of at least 0.`
673
+ };
674
+ }
675
+ let a = /* @__PURE__ */ new Map(), o = (e) => a.get(e.id) ?? a.set(e.id, e.parent === void 0 ? e.depth ?? 0 : o(i.get(e.parent)) + 1).get(e.id);
676
+ for (let t of e) {
677
+ let e = o(t);
678
+ if (t.depth !== void 0 && t.depth !== e) return {
679
+ id: n,
680
+ refused: `${t.label}: depth ${t.depth} is not one below its parent's ${e - 1}.`
681
+ };
682
+ }
683
+ let s = e.flatMap((e) => e.spans.map((t) => ({
684
+ lane: e,
685
+ span: t
686
+ })));
687
+ for (let { lane: e, span: r } of s) {
688
+ if (typeof r.state != "string" || !r.state.trim()) return {
689
+ id: n,
690
+ refused: `${e.label}: every span needs a state.`
691
+ };
692
+ if (!Number.isFinite(r.start) || r.end !== null && (!Number.isFinite(r.end) || r.end < r.start)) return {
693
+ id: n,
694
+ refused: `${e.label}: span times must be finite and end at or after their start.`
695
+ };
696
+ if (r.end === null && t.now === void 0) return {
697
+ id: n,
698
+ refused: `${e.label}: an open span needs now.`
699
+ };
700
+ if (r.end === null && t.now < r.start) return {
701
+ id: n,
702
+ refused: `${e.label}: an open span starts after now.`
703
+ };
704
+ }
705
+ for (let t of e) for (let e of t.ticks ?? []) {
706
+ if (!e || !Number.isFinite(e.at)) return {
707
+ id: n,
708
+ refused: `${t.label}: every tick needs a finite time.`
709
+ };
710
+ if (!Se.includes(e.outcome)) return {
711
+ id: n,
712
+ refused: `${t.label}: tick outcome ${String(e.outcome)} is not one of ${Se.join(", ")}.`
713
+ };
714
+ }
715
+ let u = ue(t.marks, t.bands);
716
+ if (u) return {
717
+ id: n,
718
+ refused: u
719
+ };
720
+ let d = t.marks ?? [], h = t.bands ?? [], _ = d.find((e) => e.lane !== void 0 && !i.has(e.lane));
721
+ if (_) return {
722
+ id: n,
723
+ refused: `${_.label}: lane ${_.lane} is not a lane.`
724
+ };
725
+ let y = (e) => e.end ?? t.now, S = e.flatMap((e) => e.ticks ?? []), C = [
726
+ ...s.flatMap(({ span: e }) => [e.start, y(e)]),
727
+ ...S.map((e) => e.at),
728
+ ...t.now === void 0 ? [] : [t.now]
729
+ ], w = C.length ? C : [...d.map((e) => e.at), ...h.flatMap((e) => [e.from, e.to])];
730
+ if (!w.length) return {
731
+ id: n,
732
+ refused: "No spans, ticks, marks or bands recorded."
733
+ };
734
+ let T = t.start ?? Math.min(...w), k = t.end ?? Math.max(...w);
735
+ if (!Number.isFinite(T) || !Number.isFinite(k) || k <= T) return {
736
+ id: n,
737
+ refused: "The window needs two finite, increasing times."
738
+ };
739
+ if (C.some((e) => e < T || e > k)) return {
740
+ id: n,
741
+ refused: "A span, tick or now falls outside the recorded window."
742
+ };
743
+ let A = t.formatTime ?? Ce, j = t.formatTime ?? ((e) => e % Te === 0 ? `${Ee[new Date(e).getUTCMonth()]} ${new Date(e).getUTCDate()}` : Ce(e)), M = new Set(t.hatch ?? ["missing", "untraced"]), N = new Set(t.muted ?? ["idle"]), F = t.collapsed !== void 0, I = new Set(t.collapsed ?? []), L = /* @__PURE__ */ new Map();
744
+ for (let t of e) L.set(t.parent, [...L.get(t.parent) ?? [], t]);
745
+ let ee = (e) => (L.get(e.id) ?? []).flatMap((e) => [e, ...ee(e)]), R = [], z = (e) => {
746
+ let t = ee(e), n = I.has(e.id) && t.length > 0, r = e.ticks, i = n && (r || t.some((e) => e.ticks)) ? [...r ?? [], ...t.flatMap((e) => e.ticks ?? [])] : r;
747
+ R.push({
748
+ lane: e,
749
+ depth: a.get(e.id),
750
+ children: (L.get(e.id) ?? []).length,
751
+ hidden: n ? t.length : 0,
752
+ folded: n,
753
+ ticks: i
754
+ }), n || (L.get(e.id) ?? []).forEach(z);
755
+ };
756
+ (L.get(void 0) ?? []).forEach(z);
757
+ let B = new Map(R.map((e, t) => [e.lane.id, t])), V = (e) => {
758
+ for (let t = i.get(e); t; t = t.parent === void 0 ? void 0 : i.get(t.parent)) if (B.has(t.id)) return B.get(t.id);
759
+ return 0;
760
+ }, te = (e) => e.at >= T && e.at <= k, ne = d.filter((e) => e.lane === void 0 && te(e)), re = d.filter((e) => e.lane !== void 0 && te(e)), ie = d.filter((e) => e.at < T), ae = d.filter((e) => e.at > k), oe = s.filter(({ span: e }) => e.end === null).length, H = s.filter(({ span: e }) => M.has(e.state)), se = H.reduce((e, { span: t }) => e + y(t) - t.start, 0), ce = (e) => {
761
+ let t = /* @__PURE__ */ new Map();
762
+ for (let n of e) t.set(n.outcome, (t.get(n.outcome) ?? 0) + 1);
763
+ let n = t.get("ok") ?? 0, r = e.length - n, i = [...t].filter(([e]) => e !== "ok").sort((e, t) => t[1] - e[1]).map(([e, t]) => `${t} ${e}`).join(", ");
764
+ return {
765
+ ok: n,
766
+ failed: r,
767
+ why: i,
768
+ text: `${n}✓ ${r}✗`,
769
+ sentence: `${n} ok, ${r} failed${i ? ` (${i})` : ""}`
770
+ };
771
+ }, le = (e) => (e.detail ?? []).filter((e) => typeof e == "string" && e.trim()), de = (e, n) => [`${e.label}: ${n.state} ${A(n.start)} to ${n.end === null ? `now (${A(t.now)}, open)` : A(n.end)}, ${P(y(n) - n.start)}${n.note ? ` · ${n.note}` : ""}`, ...le(e)].join("\n"), W = R.some((e) => e.ticks !== void 0), he = W ? Math.max(...R.filter((e) => e.ticks).map((e) => c(ce(e.ticks).text, 12, "mono"))) : 0, ge = (e) => {
772
+ let n = e === 358, i = n ? 10 : 12, a = (e) => 4 + e * i, o = (e) => a(e) + 11, s = (e) => e.hidden ? ` +${e.hidden}` : "", u = n ? 12 : Math.max(120, Math.min(Math.round(e * .34), Math.ceil(Math.max(...R.map((e) => o(e.depth) + c(e.lane.label + s(e), 12))) + 10))), d = n ? e - 12 : e - 16 - (he ? he + 10 : 0), p = (e) => u + (e - T) / (k - T) * (d - u), m = G(ne, p, u, d, {
773
+ before: ie,
774
+ after: ae,
775
+ window: [T, k]
776
+ }), _ = 8 + (m ? m * 14 + 6 : 0) + pe(h), S = n ? 40 : 24, C = _ + R.length * S, w = (e) => e + (n ? 19 : 5), O = fe(h, p, _, C, A, [T, k]) + me(h, (e, t) => [p(e), p(t)], _, C, u, d, A, [T, k]);
777
+ for (let e of Ae(T, k, p, u, d, j)) O += x(p(e), _, p(e), C, "tgc-gridline") + E(p(e), C + 16, j(e), {
778
+ size: 12,
779
+ cls: "tgc-ink-muted tgc-num",
780
+ anchor: "middle"
781
+ });
782
+ O += K(ne, p, _ - 8, C, u, d, A, 4, {
783
+ before: ie,
784
+ after: ae,
785
+ window: [T, k]
786
+ }), R.forEach((t, i) => {
787
+ let { lane: d } = t, m = _ + i * S, h = m + (n ? 9 : 12), g = m + (n ? 13 : 16), x = d.parent === void 0 ? void 0 : B.get(d.parent);
788
+ if (x !== void 0) {
789
+ let e = a(t.depth - 1) + 3, r = n ? m + 2 : _ + x * S + 19;
790
+ O += `<path class="tgc-tree" d="M${e} ${r}V${h}H${o(t.depth) - (t.children ? 13 : 3)}"/>`;
791
+ }
792
+ let C = t.ticks ? ce(t.ticks) : void 0, T = (n ? e - 12 - (C ? c(C.text, 12, "mono") + 8 : 0) : u - 8) - o(t.depth) - c(s(t), 12), E = l(d.label, Math.max(24, T), 12, "sans", 1).lines[0], k = `<text class="tgc-ink tgc-lane-label" x="${o(t.depth)}" y="${g}" font-size="12">${r(E)}${t.hidden ? `<tspan class="tgc-ink-muted">${r(s(t))}</tspan>` : ""}</text>`, j = t.children ? `<path class="tgc-caret" d="${t.folded ? `M${a(t.depth)} ${h - 4}l6 4l-6 4z` : `M${a(t.depth) - 1} ${h - 3}h8l-4 6z`}"/>` : "", P = [
793
+ d.label,
794
+ ...le(d),
795
+ ...C ? [`Attempts: ${C.sentence}${t.hidden ? `, including ${t.hidden} folded ${f(t.hidden, "lane")}` : ""}`] : []
796
+ ].join("\n"), I = F && t.children ? ` data-toggle="${r(d.id)}" class="tgc-lane-toggle" role="button" tabindex="0" aria-expanded="${!t.folded}" aria-label="${r(`${t.folded ? "Unfold" : "Fold"} ${d.label}`)}"` : "", L = I ? v(a(t.depth) - 3, m + 1, (n ? e - 12 : u - 4) - a(t.depth) + 3, n ? 16 : S - 2, "tgc-lane-hit", "rx=\"3\"") : "";
797
+ O += `<g data-lane="${r(d.id)}" data-depth="${t.depth}"${t.folded ? ` data-folded="${t.hidden}"` : ""}><g${I}><title>${r(P)}</title>${L}${j}${k}</g>`;
798
+ for (let e of d.spans) {
799
+ let t = p(e.start), n = Math.max(1, p(y(e)) - t), r = M.has(e.state) ? b(t, w(m), n, 14, "tgc-span tgc-span-missing") : v(t, w(m), n, 14, `tgc-span${N.has(e.state) ? " tgc-span-muted" : ""}${e.end === null ? " tgc-span-open" : ""}`, "rx=\"2\"");
800
+ O += D(de(d, e), `<g data-state="${e.state.replace(/[^a-z0-9-]/gi, "")}"${e.end === null ? " data-open=\"true\"" : ""}>${r}</g>`);
801
+ }
802
+ if (t.ticks?.length && (O += ke(t.ticks, d.label, p, w(m), 14, A)), C) {
803
+ let r = n ? e - 12 : e - 16;
804
+ O += D(`${d.label}: ${C.sentence}${t.hidden ? ` across ${t.hidden + 1} lanes` : ""}`, `<text class="tgc-num tgc-count" x="${r}" y="${g}" font-size="12" text-anchor="end">${C.ok}<tspan class="tgc-count-ok">✓</tspan> ${C.failed}<tspan class="tgc-count-failed">✗</tspan></text>`);
805
+ }
806
+ O += "</g>";
807
+ });
808
+ for (let e of re) {
809
+ let t = _ + V(e.lane) * S, i = w(t) + 7, a = p(e.at), o = _e(e.kind, a, i, n ? 3 : 3.5) || x(a, w(t) - 3, a, w(t) + 14 + 3, `tgc-mark tgc-mark-${e.kind}`), s = e.verdict ? ` data-verdict="${e.verdict}" class="tgc-verdict-${e.verdict}"` : "";
810
+ O += D(`${U(e)}: ${A(e.at)}${e.verdict ? ` · ${e.verdict}` : ""}`, `<g data-mark="${e.kind}" data-lane-mark="${r(e.lane)}"${s}>${o}</g>`);
811
+ }
812
+ return t.now !== void 0 && (O += x(p(t.now), _, p(t.now), C, "tgc-now") + E(p(t.now), C + 30, `now ${A(t.now)}`, {
813
+ size: 12,
814
+ cls: "tgc-ink tgc-num",
815
+ anchor: p(t.now) > (u + d) / 2 ? "end" : "start"
816
+ })), g(e, C + (t.now === void 0 ? 22 : 36), O);
817
+ }, ye = ce(S), be = e.some((e) => e.parent !== void 0 || e.depth), J = F && R.some((e) => e.children), xe = be || S.length || e.some((e) => e.ticks || le(e).length) ? O(`${p(t.measure)}: lanes`, [
818
+ { label: "Lane" },
819
+ { label: "Started by" },
820
+ {
821
+ label: "Depth",
822
+ numeric: !0
823
+ },
824
+ {
825
+ label: "Attempts ok",
826
+ numeric: !0
827
+ },
828
+ {
829
+ label: "Attempts failed",
830
+ numeric: !0
831
+ },
832
+ { label: "Failed by outcome" },
833
+ { label: "Detail" }
834
+ ], e.map((e) => {
835
+ let t = e.ticks ? ce(e.ticks) : void 0;
836
+ return [
837
+ e.label,
838
+ e.parent === void 0 ? "" : i.get(e.parent).label,
839
+ String(a.get(e.id)),
840
+ t ? String(t.ok) : "not recorded",
841
+ t ? String(t.failed) : "not recorded",
842
+ t?.why ?? "",
843
+ le(e).join(" · ")
844
+ ];
845
+ })) : "";
846
+ return {
847
+ id: n,
848
+ finding: `${p(t.measure)} across ${e.length} ${f(e.length, "lane")}, ${A(T)} to ${A(k)}.`,
849
+ lede: `${s.length} recorded ${f(s.length, "span")}; ${oe} open${t.now === void 0 ? "" : ` at ${A(t.now)}`}; ${H.length} without data (${P(se)}).${S.length ? ` ${S.length} recorded ${f(S.length, "attempt")}: ${ye.sentence}.` : ""}`,
850
+ read: [
851
+ `Each lane shows its recorded spans on one time axis. Muted spans are ${[...N].join(", ") || "none"}; hatched spans have no data; an open span runs to now.`,
852
+ ...be ? [`An indented lane was started by the lane its connector leads to${J ? "; a caret folds a lane's subtree, and a folded lane's ticks and counts include its subtree" : ""}.`] : [],
853
+ ...W ? ["Each tick is one recorded attempt: ok ticks rise above the bar and failed ticks drop below it in their outcome's colour; the counts at the right are ok (✓) and failed (✗)."] : [],
854
+ ...d.length + h.length ? [q] : []
855
+ ].join(" "),
856
+ svg: {
857
+ wide: ge(m(t.width)),
858
+ narrow: ge(358),
859
+ ...J ? { interactive: !0 } : {}
860
+ },
861
+ table: xe + O(`${p(t.measure)} by lane`, [
862
+ { label: "Lane" },
863
+ { label: "State" },
864
+ {
865
+ label: "Start",
866
+ numeric: !0
867
+ },
868
+ {
869
+ label: "End",
870
+ numeric: !0
871
+ },
872
+ {
873
+ label: "Duration",
874
+ numeric: !0
875
+ },
876
+ { label: "Note" }
877
+ ], s.map(({ lane: e, span: t }) => [
878
+ e.label,
879
+ t.state,
880
+ A(t.start),
881
+ t.end === null ? "open" : A(t.end),
882
+ P(y(t) - t.start),
883
+ t.note ?? ""
884
+ ])) + ve(d, h, "time", A),
885
+ note: {
886
+ method: `Recorded span start and end times as supplied by the producer; open spans are drawn to the supplied now. No span is inferred, merged or reordered.${S.length ? " Ticks are recorded attempts at their recorded times; ticks of one outcome within 2 px are drawn as one, with the count in its hover." : ""}`,
887
+ n: `${s.length} spans${S.length ? ` and ${S.length} attempts` : ""} in ${e.length} lanes.`,
888
+ exclusions: [...H.map(({ lane: e, span: t }) => `${e.label}: ${t.state} ${A(t.start)} to ${t.end === null ? "now" : A(t.end)} has no data.`), ...[...ie, ...ae].map((e) => `${U(e)} falls ${e.at < T ? `${P(T - e.at)} before` : `${P(e.at - k)} after`} the recorded window; it is named at the edge, not drawn.`)]
889
+ }
890
+ };
891
+ }
892
+ function ke(e, t, n, r, i, a) {
893
+ let o = /* @__PURE__ */ new Map();
894
+ for (let t of [...e].sort((e, t) => e.at - t.at)) {
895
+ let e = `${t.outcome}|${Math.round(n(t.at) / 2)}`;
896
+ o.set(e, [...o.get(e) ?? [], t]);
897
+ }
898
+ return `<g class="tgc-ticks">${[...o.values()].sort((e, t) => Number(e[0].outcome === "ok") - Number(t[0].outcome === "ok")).map((e) => {
899
+ let o = e[0], s = e.at(-1), c = o.outcome === "ok", l = n(e.reduce((e, t) => e + t.at, 0) / e.length), u = /* @__PURE__ */ new Map();
900
+ for (let t of e) t.note && u.set(t.note, (u.get(t.note) ?? 0) + 1);
901
+ let d = [...u].sort((e, t) => t[1] - e[1])[0]?.[0];
902
+ return D(`${t}: ${e.length > 1 ? `${e.length} × ` : ""}${o.outcome} ${a(o.at)}${e.length > 1 ? ` to ${a(s.at)}` : ""}${d ? ` · ${d.length > 160 ? `${d.slice(0, 159)}…` : d}` : ""}`, x(l, c ? r - 4 : r + i / 2, l, c ? r + i / 2 : r + i + 4, `tgc-tick tgc-tick-${o.outcome}`));
903
+ }).join("")}</g>`;
904
+ }
905
+ function Ae(e, t, n, r, i, a) {
906
+ let o = (e) => {
907
+ let t = -Infinity;
908
+ for (let o of e) {
909
+ let e = c(a(o), 12, "mono"), s = n(o) - e / 2, l = n(o) + e / 2;
910
+ if (s < r - 14 || l > i + 14 || s < t + 10) return !1;
911
+ t = l;
912
+ }
913
+ return !0;
914
+ };
915
+ for (let n of De) {
916
+ let r = [];
917
+ for (let i = Math.ceil(e / n) * n; i <= t && r.length <= 12; i += n) r.push(i);
918
+ if (r.length >= 2 && r.length <= 12 && o(r)) return r;
919
+ }
920
+ return o([e, t]) ? [e, t] : [e];
921
+ }
922
+ //#endregion
923
+ //#region node_modules/.pnpm/@tangle-network+charts@0.21.19_react@19.3.0/node_modules/@tangle-network/charts/dist/react/index.js
924
+ var Y = n(), X = /* @__PURE__ */ e(t(), 1);
925
+ new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 });
926
+ var je = [
927
+ "#8b7cf6",
928
+ "#0ea5a0",
929
+ "#c98500",
930
+ "#e2508f",
931
+ "#4a90e2"
932
+ ], Me = (e) => e == null || !Number.isFinite(e) ? "—" : new Intl.NumberFormat("en-US", {
933
+ notation: "compact",
934
+ maximumFractionDigits: 1
935
+ }).format(e), Ne = (e) => e === null || !Number.isFinite(e) ? "—" : `${Math.round(e * 100)}%`;
936
+ function Pe() {
937
+ let [e, t] = (0, X.useState)(null), [n, r] = (0, X.useState)({
938
+ width: 0,
939
+ em: 16
940
+ });
941
+ return (0, X.useEffect)(() => {
942
+ if (!e) return;
943
+ let t = new ResizeObserver(([t]) => r({
944
+ width: Math.floor(t.contentRect.width),
945
+ em: parseFloat(getComputedStyle(e).fontSize) || 16
946
+ }));
947
+ return t.observe(e), () => t.disconnect();
948
+ }, [e]), [
949
+ t,
950
+ n.width,
951
+ n.em
952
+ ];
953
+ }
954
+ function Fe(e) {
955
+ if (!(e > 0)) return {
956
+ top: 1,
957
+ ticks: [
958
+ 0,
959
+ .5,
960
+ 1
961
+ ]
962
+ };
963
+ let t = 10 ** Math.floor(Math.log10(e)), n = [
964
+ 1,
965
+ 2,
966
+ 2.5,
967
+ 5,
968
+ 10
969
+ ].map((e) => e * t).find((t) => t * 4 >= e) ?? t * 10, r = Math.ceil(e / n) * n;
970
+ return {
971
+ top: r,
972
+ ticks: [
973
+ 0,
974
+ r / 2,
975
+ r
976
+ ]
977
+ };
978
+ }
979
+ function Ie({ tip: e }) {
980
+ return e ? /* @__PURE__ */ (0, Y.jsxs)("div", {
981
+ className: "ov-tip",
982
+ role: "tooltip",
983
+ style: {
984
+ left: e.x,
985
+ top: e.y
986
+ },
987
+ children: [/* @__PURE__ */ (0, Y.jsx)("strong", { children: e.title }), e.lines.map((e) => /* @__PURE__ */ (0, Y.jsxs)("span", {
988
+ className: "ov-tip-line",
989
+ children: [
990
+ e.color && /* @__PURE__ */ (0, Y.jsx)("i", { style: { background: e.color } }),
991
+ /* @__PURE__ */ (0, Y.jsx)("span", { children: e.label }),
992
+ /* @__PURE__ */ (0, Y.jsx)("b", { children: e.value })
993
+ ]
994
+ }, e.label))]
995
+ }) : null;
996
+ }
997
+ function Le({ days: e, series: t, format: n = Me, rows: r = 13, missing: i = "No runs started", tick: a = (e) => e.slice(5), onOpen: o }) {
998
+ let [s, c, l] = Pe(), u = Math.round(r * l), [d, f] = (0, X.useState)(null), p = e.map((e, n) => t.reduce((e, t) => e + (t.values[n] ?? 0), 0)), { top: m, ticks: h } = Fe(Math.max(...p)), g = Math.round(3.4 * l), _ = Math.round(1.8 * l), v = Math.max(0, c - g - 8), y = u - _ - 8, b = e.length ? v / e.length : 0, x = Math.max(3, b * .72), S = Math.max(1, Math.ceil(e.length / Math.max(1, Math.floor(v / (4.5 * l))))), C = Math.ceil(4.5 * l / Math.max(b, 1)), w = (e) => 8 + y - e / m * y;
999
+ return /* @__PURE__ */ (0, Y.jsxs)("div", {
1000
+ ref: s,
1001
+ className: "ov-plot",
1002
+ onMouseLeave: () => f(null),
1003
+ children: [c > 0 && /* @__PURE__ */ (0, Y.jsxs)("svg", {
1004
+ width: c,
1005
+ height: u,
1006
+ role: "img",
1007
+ "aria-label": `${t.map((e) => e.name).join(", ")} per day`,
1008
+ children: [h.map((e) => /* @__PURE__ */ (0, Y.jsxs)("g", { children: [/* @__PURE__ */ (0, Y.jsx)("line", {
1009
+ x1: g,
1010
+ x2: c - 8,
1011
+ y1: w(e),
1012
+ y2: w(e),
1013
+ className: "ov-gridline"
1014
+ }), /* @__PURE__ */ (0, Y.jsx)("text", {
1015
+ x: g - l * .4,
1016
+ y: w(e),
1017
+ dominantBaseline: "middle",
1018
+ className: "ov-axis",
1019
+ textAnchor: "end",
1020
+ children: n(e)
1021
+ })] }, e)), e.map((r, s) => {
1022
+ let d = 0, m = g + s * b + (b - x) / 2, h = () => f({
1023
+ x: Math.min(g + s * b + b + 8, c - l * 14),
1024
+ y: 8,
1025
+ title: `${r} · ${t.every((e) => e.values[s] === null) ? i : n(p[s] ?? 0)}`,
1026
+ lines: t.map((e) => ({
1027
+ label: e.name,
1028
+ value: e.values[s] === null ? i : n(e.values[s] ?? 0),
1029
+ color: e.color
1030
+ }))
1031
+ });
1032
+ return /* @__PURE__ */ (0, Y.jsxs)("g", {
1033
+ role: o ? "button" : void 0,
1034
+ tabIndex: o ? 0 : void 0,
1035
+ "aria-label": o ? `Open ${r}` : void 0,
1036
+ onFocus: o ? h : void 0,
1037
+ onBlur: o ? () => f(null) : void 0,
1038
+ onKeyDown: o ? (e) => {
1039
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o(s));
1040
+ } : void 0,
1041
+ children: [
1042
+ t.map((e) => {
1043
+ let t = e.values[s] ?? 0;
1044
+ if (!t) return null;
1045
+ let n = w(d);
1046
+ d += t;
1047
+ let r = w(d);
1048
+ return /* @__PURE__ */ (0, Y.jsx)("rect", {
1049
+ x: m,
1050
+ y: r,
1051
+ width: x,
1052
+ height: Math.max(2, n - r - 2),
1053
+ rx: 2,
1054
+ fill: e.color
1055
+ }, e.name);
1056
+ }),
1057
+ (s === e.length - 1 || s % S === 0 && s + C <= e.length - 1) && /* @__PURE__ */ (0, Y.jsx)("text", {
1058
+ x: m + x / 2,
1059
+ y: u - l * .35,
1060
+ className: "ov-axis",
1061
+ textAnchor: "middle",
1062
+ children: a(r)
1063
+ }),
1064
+ /* @__PURE__ */ (0, Y.jsx)("rect", {
1065
+ x: g + s * b,
1066
+ y: 8,
1067
+ width: b,
1068
+ height: y,
1069
+ fill: "transparent",
1070
+ style: o ? { cursor: "pointer" } : void 0,
1071
+ onClick: o ? () => o(s) : void 0,
1072
+ onMouseEnter: h
1073
+ })
1074
+ ]
1075
+ }, r);
1076
+ })]
1077
+ }), /* @__PURE__ */ (0, Y.jsx)(Ie, { tip: d })]
1078
+ });
1079
+ }
1080
+ function Re({ rows: e, format: t = Me, color: n = je[0], max: r, limit: i = 8 }) {
1081
+ let a = r ?? Math.max(1, ...e.map((e) => e.value));
1082
+ if (!e.length) return /* @__PURE__ */ (0, Y.jsx)("p", {
1083
+ className: "ov-empty",
1084
+ children: "Nothing recorded."
1085
+ });
1086
+ let o = e.slice(i);
1087
+ return /* @__PURE__ */ (0, Y.jsxs)("ol", {
1088
+ className: "ov-hbars",
1089
+ children: [e.slice(0, i).map((e) => {
1090
+ let r = e.title ?? `${e.label}: ${t(e.value)}`, i = /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [
1091
+ /* @__PURE__ */ (0, Y.jsx)("span", {
1092
+ className: "ov-hbar-label",
1093
+ children: e.label
1094
+ }),
1095
+ /* @__PURE__ */ (0, Y.jsx)("span", {
1096
+ className: "ov-hbar-track",
1097
+ children: /* @__PURE__ */ (0, Y.jsx)("span", { style: {
1098
+ width: `${Math.max(1, e.value / a * 100)}%`,
1099
+ background: e.color ?? n
1100
+ } })
1101
+ }),
1102
+ /* @__PURE__ */ (0, Y.jsx)("span", {
1103
+ className: "ov-hbar-value",
1104
+ children: t(e.value)
1105
+ }),
1106
+ e.note && /* @__PURE__ */ (0, Y.jsx)("span", {
1107
+ className: "ov-hbar-note",
1108
+ children: e.note
1109
+ })
1110
+ ] });
1111
+ return /* @__PURE__ */ (0, Y.jsx)("li", { children: e.href ? /* @__PURE__ */ (0, Y.jsx)("a", {
1112
+ href: e.href,
1113
+ title: r,
1114
+ children: i
1115
+ }) : /* @__PURE__ */ (0, Y.jsx)("div", {
1116
+ title: r,
1117
+ children: i
1118
+ }) }, e.label);
1119
+ }), o.length > 0 && /* @__PURE__ */ (0, Y.jsxs)("li", {
1120
+ className: "ov-hbars-more",
1121
+ children: [
1122
+ "+",
1123
+ o.length,
1124
+ " more · ",
1125
+ t(o.reduce((e, t) => e + t.value, 0))
1126
+ ]
1127
+ })]
1128
+ });
1129
+ }
1130
+ function ze({ series: e, format: t = Me, rows: n = 13, axis: r, marks: i = [], bands: a = [] }) {
1131
+ let [o, s, c] = Pe(), l = Math.round(n * c), [u, d] = (0, X.useState)(null), f = ue(i, a);
1132
+ if (f) throw RangeError(f);
1133
+ let p = e.flatMap((e) => e.points);
1134
+ if (!p.length) return /* @__PURE__ */ (0, Y.jsx)("p", {
1135
+ className: "ov-empty",
1136
+ children: "No history yet."
1137
+ });
1138
+ let m = [
1139
+ ...p.map((e) => e[0]),
1140
+ ...i.map((e) => e.at),
1141
+ ...a.flatMap((e) => [e.from, e.to])
1142
+ ], h = Math.min(...m), g = Math.max(...m), { top: _, ticks: v } = Fe(Math.max(...p.map((e) => e[1]))), y = Math.round(3.4 * c), b = Math.round(1.8 * c), x = Math.max(0, s - y - 10), S = l - b - 8, C = (e) => y + (g > h ? (e - h) / (g - h) * x : 0), T = (e) => 8 + S - e / _ * S, E = (e, t) => e.reduce((e, n) => Math.abs(n[0] - t) < Math.abs(e[0] - t) ? n : e, e[0]), D = (e) => new Date(e).toISOString().slice(5, 16).replace("T", " ");
1143
+ return /* @__PURE__ */ (0, Y.jsxs)("div", {
1144
+ ref: o,
1145
+ className: "ov-plot",
1146
+ onMouseMove: (e) => {
1147
+ let t = e.currentTarget.getBoundingClientRect(), n = e.clientX - t.left;
1148
+ d(n >= y ? h + (n - y) / Math.max(1, x) * (g - h) : null);
1149
+ },
1150
+ onMouseLeave: () => d(null),
1151
+ children: [
1152
+ s > 0 && /* @__PURE__ */ (0, Y.jsxs)("svg", {
1153
+ width: s,
1154
+ height: l,
1155
+ role: "img",
1156
+ "aria-label": e.map((e) => e.name).join(", "),
1157
+ children: [
1158
+ v.map((e) => /* @__PURE__ */ (0, Y.jsxs)("g", { children: [/* @__PURE__ */ (0, Y.jsx)("line", {
1159
+ x1: y,
1160
+ x2: s - 10,
1161
+ y1: T(e),
1162
+ y2: T(e),
1163
+ className: "ov-gridline"
1164
+ }), /* @__PURE__ */ (0, Y.jsx)("text", {
1165
+ x: y - c * .4,
1166
+ y: T(e),
1167
+ dominantBaseline: "middle",
1168
+ className: "ov-axis",
1169
+ textAnchor: "end",
1170
+ children: t(e)
1171
+ })] }, e)),
1172
+ [
1173
+ h,
1174
+ (h + g) / 2,
1175
+ g
1176
+ ].map((e, t) => /* @__PURE__ */ (0, Y.jsx)("text", {
1177
+ x: C(e),
1178
+ y: l - c * .35,
1179
+ className: "ov-axis",
1180
+ textAnchor: t === 0 ? "start" : t === 2 ? "end" : "middle",
1181
+ children: r ? r(e) : D(e).slice(0, 5)
1182
+ }, t)),
1183
+ a.map((e, t) => /* @__PURE__ */ (0, Y.jsx)(Ve, {
1184
+ band: e,
1185
+ x: C(e.from),
1186
+ y: 8,
1187
+ width: C(e.to) - C(e.from),
1188
+ height: S
1189
+ }, `band-${t}`)),
1190
+ e.map((e) => e.dots ? /* @__PURE__ */ (0, Y.jsx)("g", { children: e.points.map((t) => /* @__PURE__ */ (0, Y.jsx)("circle", {
1191
+ cx: C(t[0]),
1192
+ cy: T(t[1]),
1193
+ r: Math.max(3, c / 5),
1194
+ fill: e.color,
1195
+ stroke: "var(--chart-live-surface, #fff)",
1196
+ strokeWidth: 1.5
1197
+ }, t[0])) }, e.name) : /* @__PURE__ */ (0, Y.jsxs)("g", {
1198
+ "data-series": e.name,
1199
+ "data-dash": e.dash ?? "solid",
1200
+ "data-marker": e.marker,
1201
+ children: [/* @__PURE__ */ (0, Y.jsx)("polyline", {
1202
+ fill: "none",
1203
+ stroke: e.color,
1204
+ strokeWidth: Math.max(2, c / 8),
1205
+ strokeLinejoin: "round",
1206
+ strokeLinecap: e.dash === "dot" ? "round" : void 0,
1207
+ strokeDasharray: Be(e.dash, c),
1208
+ points: e.points.map((e) => `${C(e[0])},${T(e[1])}`).join(" ")
1209
+ }), e.marker && (e.points.length <= 30 ? e.points : e.points.slice(-1)).map((t) => /* @__PURE__ */ (0, Y.jsx)("path", {
1210
+ d: w(e.marker, C(t[0]), T(t[1]), Math.max(3, c / 5)),
1211
+ fill: e.color,
1212
+ stroke: "var(--chart-live-surface, var(--chart-canvas))",
1213
+ strokeWidth: 1.5
1214
+ }, t[0]))]
1215
+ }, e.name)),
1216
+ [...i].sort((e, t) => e.at - t.at).map((e, t) => /* @__PURE__ */ (0, Y.jsx)(He, {
1217
+ mark: e,
1218
+ x: C(e.at),
1219
+ top: 8,
1220
+ bottom: 8 + S,
1221
+ row: t % 3,
1222
+ em: c,
1223
+ flip: C(e.at) > y + x * .62
1224
+ }, `mark-${t}`)),
1225
+ u !== null && /* @__PURE__ */ (0, Y.jsx)("line", {
1226
+ x1: C(u),
1227
+ x2: C(u),
1228
+ y1: 8,
1229
+ y2: 8 + S,
1230
+ className: "ov-crosshair"
1231
+ }),
1232
+ u !== null && e.map((e) => {
1233
+ let t = e.points.length ? E(e.points, u) : null;
1234
+ return t ? /* @__PURE__ */ (0, Y.jsx)("circle", {
1235
+ cx: C(t[0]),
1236
+ cy: T(t[1]),
1237
+ r: Math.max(4, c / 4),
1238
+ fill: e.color,
1239
+ stroke: "var(--chart-live-surface, #fff)",
1240
+ strokeWidth: 2
1241
+ }, e.name) : null;
1242
+ })
1243
+ ]
1244
+ }),
1245
+ u !== null && /* @__PURE__ */ (0, Y.jsx)(Ie, { tip: {
1246
+ x: Math.min(C(u) + 10, s - c * 14),
1247
+ y: 8,
1248
+ title: r ? r(u) : D(u),
1249
+ lines: e.filter((e) => e.points.length).map((e) => {
1250
+ let n = E(e.points, u);
1251
+ return {
1252
+ label: e.label ? e.label(n[0]) : e.name,
1253
+ value: t(n[1]),
1254
+ color: e.color
1255
+ };
1256
+ })
1257
+ } }),
1258
+ e.length > 1 && e.some((e) => e.dash || e.marker) && /* @__PURE__ */ (0, Y.jsx)("ul", {
1259
+ className: "ov-key",
1260
+ "aria-label": "Series",
1261
+ children: e.map((e) => /* @__PURE__ */ (0, Y.jsxs)("li", { children: [/* @__PURE__ */ (0, Y.jsxs)("svg", {
1262
+ width: c * 2,
1263
+ height: c,
1264
+ "aria-hidden": "true",
1265
+ children: [/* @__PURE__ */ (0, Y.jsx)("line", {
1266
+ x1: 0,
1267
+ x2: c * 2,
1268
+ y1: c / 2,
1269
+ y2: c / 2,
1270
+ stroke: e.color,
1271
+ strokeWidth: Math.max(2, c / 8),
1272
+ strokeDasharray: Be(e.dash, c),
1273
+ strokeLinecap: e.dash === "dot" ? "round" : void 0
1274
+ }), e.marker && /* @__PURE__ */ (0, Y.jsx)("path", {
1275
+ d: w(e.marker, c, c / 2, Math.max(3, c / 5)),
1276
+ fill: e.color
1277
+ })]
1278
+ }), e.name] }, e.name))
1279
+ }),
1280
+ /* @__PURE__ */ (0, Y.jsx)(Ue, {
1281
+ marks: i,
1282
+ bands: a,
1283
+ format: r ?? ((e) => D(e))
1284
+ })
1285
+ ]
1286
+ });
1287
+ }
1288
+ function Be(e, t) {
1289
+ return e === "dash" ? `${Math.round(t * .55)} ${Math.round(t * .3)}` : e === "dot" ? `0.1 ${Math.round(t * .35)}` : void 0;
1290
+ }
1291
+ function Ve({ band: e, x: t, y: n, width: r, height: i }) {
1292
+ return /* @__PURE__ */ (0, Y.jsxs)("g", {
1293
+ "data-band": e.kind,
1294
+ "data-hatched": e.kind === "missing" ? "true" : void 0,
1295
+ children: [
1296
+ /* @__PURE__ */ (0, Y.jsx)("title", { children: e.label }),
1297
+ /* @__PURE__ */ (0, Y.jsx)("rect", {
1298
+ x: t,
1299
+ y: n,
1300
+ width: Math.max(0, r),
1301
+ height: i,
1302
+ className: e.kind === "missing" ? "ov-hatch-bg" : `ov-band ov-band-${e.kind}`
1303
+ }),
1304
+ e.kind === "missing" && /* @__PURE__ */ (0, Y.jsx)("path", {
1305
+ d: y(t, n, r, i),
1306
+ className: "ov-hatch"
1307
+ })
1308
+ ]
1309
+ });
1310
+ }
1311
+ function He({ mark: e, x: t, top: n, bottom: r, row: i, em: a, flip: o }) {
1312
+ let s = Math.max(3, a / 4), c = le[e.kind];
1313
+ return /* @__PURE__ */ (0, Y.jsxs)("g", {
1314
+ "data-mark": e.kind,
1315
+ "data-verdict": e.verdict,
1316
+ className: e.verdict ? `ov-verdict-${e.verdict}` : void 0,
1317
+ children: [
1318
+ /* @__PURE__ */ (0, Y.jsx)("title", { children: U(e) }),
1319
+ /* @__PURE__ */ (0, Y.jsx)("line", {
1320
+ x1: t,
1321
+ x2: t,
1322
+ y1: n,
1323
+ y2: r,
1324
+ className: `ov-mark ov-mark-${e.kind}`
1325
+ }),
1326
+ e.kind === "died" && /* @__PURE__ */ (0, Y.jsx)("path", {
1327
+ d: `M${t - s} ${r - 2 * s}L${t + s} ${r}M${t - s} ${r}L${t + s} ${r - 2 * s}`,
1328
+ className: "ov-mark ov-mark-died"
1329
+ }),
1330
+ c && /* @__PURE__ */ (0, Y.jsx)("path", {
1331
+ d: w(c, t, n + s, s),
1332
+ className: "ov-mark-head"
1333
+ }),
1334
+ /* @__PURE__ */ (0, Y.jsx)("text", {
1335
+ x: o ? t - a * .3 : t + a * .3,
1336
+ y: n + a * (.9 + i),
1337
+ textAnchor: o ? "end" : "start",
1338
+ className: "ov-mark-label",
1339
+ children: U(e)
1340
+ })
1341
+ ]
1342
+ });
1343
+ }
1344
+ function Ue({ marks: e, bands: t, format: n }) {
1345
+ if (!e.length && !t.length) return null;
1346
+ let r = [...e.map((e) => ({
1347
+ at: e.at,
1348
+ kind: e.kind,
1349
+ text: `${U(e)} · ${n(e.at)}${e.verdict ? ` · ${e.verdict}` : ""}`
1350
+ })), ...t.map((e) => ({
1351
+ at: e.from,
1352
+ kind: e.kind,
1353
+ text: `${e.label} · ${n(e.from)} to ${n(e.to)}${e.kind === "missing" ? " · no data" : ""}`
1354
+ }))].sort((e, t) => e.at - t.at);
1355
+ return /* @__PURE__ */ (0, Y.jsx)("ul", {
1356
+ className: "ov-events",
1357
+ "aria-label": "Recorded events",
1358
+ children: r.map((e, t) => /* @__PURE__ */ (0, Y.jsxs)("li", {
1359
+ "data-kind": e.kind,
1360
+ children: [/* @__PURE__ */ (0, Y.jsx)("i", {
1361
+ className: `ov-event-swatch ov-event-${e.kind}`,
1362
+ "aria-hidden": "true"
1363
+ }), e.text]
1364
+ }, t))
1365
+ });
1366
+ }
1367
+ var We = [
1368
+ "var(--chart-accent)",
1369
+ "var(--chart-tier-c)",
1370
+ "var(--chart-muted)"
1371
+ ];
1372
+ function Ge({ used: e, total: t, format: n = Me, tone: r, text: i, segments: a, untraced: o = "untraced" }) {
1373
+ if (a) return /* @__PURE__ */ (0, Y.jsx)(Ke, {
1374
+ segments: a,
1375
+ total: t,
1376
+ format: n,
1377
+ text: i,
1378
+ untraced: o
1379
+ });
1380
+ let s = e != null && t ? Math.min(1, e / t) : null;
1381
+ return /* @__PURE__ */ (0, Y.jsxs)("div", {
1382
+ className: "ov-meter",
1383
+ children: [/* @__PURE__ */ (0, Y.jsx)("span", {
1384
+ className: "ov-meter-track",
1385
+ children: /* @__PURE__ */ (0, Y.jsx)("span", { style: {
1386
+ width: `${(s ?? 0) * 100}%`,
1387
+ background: r ?? (s !== null && s > .9 ? "var(--chart-live-danger, #d85050)" : s !== null && s > .7 ? "var(--chart-live-warning, #c98500)" : je[0])
1388
+ } })
1389
+ }), /* @__PURE__ */ (0, Y.jsx)("span", {
1390
+ className: "ov-meter-text",
1391
+ children: i ?? `${n(e ?? NaN)} of ${n(t ?? NaN)} · ${Ne(s)}`
1392
+ })]
1393
+ });
1394
+ }
1395
+ function Ke({ segments: e, total: t, format: n, text: r, untraced: i }) {
1396
+ for (let t of e) if (t.value !== null && (!Number.isFinite(t.value) || t.value < 0)) throw RangeError(`${t.label}: a segment value must be a nonnegative finite number or null.`);
1397
+ let a = e.reduce((e, t) => e + (t.value ?? 0), 0), o = t != null && Number.isFinite(t) && t > 0 ? t : null;
1398
+ if (o !== null && a > o * (1 + 1e-9)) throw RangeError(`Segments sum to ${a}, more than the total ${o}.`);
1399
+ let s = o === null ? 0 : o - a, c = [...e.map((e, t) => ({
1400
+ ...e,
1401
+ color: e.color ?? We[t % We.length],
1402
+ remainder: !1
1403
+ })), ...s > o * 1e-9 ? [{
1404
+ label: i,
1405
+ value: s,
1406
+ kind: "untraced",
1407
+ color: void 0,
1408
+ remainder: !0
1409
+ }] : []], l = (e) => o === null ? null : e / o;
1410
+ return /* @__PURE__ */ (0, Y.jsxs)("div", {
1411
+ className: "ov-meter",
1412
+ "data-segmented": "true",
1413
+ children: [
1414
+ /* @__PURE__ */ (0, Y.jsx)("span", {
1415
+ className: `ov-meter-track${o === null ? " ov-hatched" : ""}`,
1416
+ "data-hatched": o === null ? "true" : void 0,
1417
+ "aria-hidden": "true",
1418
+ children: o !== null && c.filter((e) => e.value !== null && e.value > 0).map((e) => /* @__PURE__ */ (0, Y.jsx)("span", {
1419
+ "data-segment": e.label,
1420
+ "data-hatched": e.kind === "untraced" ? "true" : void 0,
1421
+ className: e.kind === "untraced" ? "ov-hatched" : void 0,
1422
+ style: {
1423
+ width: `${e.value / o * 100}%`,
1424
+ background: e.kind === "untraced" ? void 0 : e.color
1425
+ }
1426
+ }, e.label))
1427
+ }),
1428
+ /* @__PURE__ */ (0, Y.jsx)("ul", {
1429
+ className: "ov-meter-key",
1430
+ children: c.map((e) => /* @__PURE__ */ (0, Y.jsxs)("li", {
1431
+ "data-segment": e.label,
1432
+ children: [
1433
+ /* @__PURE__ */ (0, Y.jsx)("i", {
1434
+ className: e.kind === "untraced" || e.value === null ? "ov-hatched" : void 0,
1435
+ style: e.kind === "untraced" || e.value === null ? void 0 : { background: e.color },
1436
+ "aria-hidden": "true"
1437
+ }),
1438
+ /* @__PURE__ */ (0, Y.jsx)("span", { children: e.label }),
1439
+ /* @__PURE__ */ (0, Y.jsx)("b", { children: e.value === null ? "not recorded" : `${n(e.value)}${o === null ? "" : ` · ${Ne(l(e.value))}`}` })
1440
+ ]
1441
+ }, e.label))
1442
+ }),
1443
+ /* @__PURE__ */ (0, Y.jsx)("span", {
1444
+ className: "ov-meter-text",
1445
+ children: r ?? (o === null ? "total not recorded" : `${n(a)} of ${n(o)} accounted · ${Ne(a / o)}`)
1446
+ })
1447
+ ]
1448
+ });
1449
+ }
1450
+ function qe({ rows: e, lanes: t, colors: n, axis: r, span: i, marks: a = [], now: o, hatch: s = ["missing", "untraced"] }) {
1451
+ let [c, l, u] = Pe(), [d, f] = (0, X.useState)(null), p = t ?? (e ?? []).map((e, t) => ({
1452
+ id: `${e.label}-${t}`,
1453
+ label: e.label,
1454
+ spans: [{
1455
+ start: e.start,
1456
+ end: e.end,
1457
+ state: e.state,
1458
+ note: e.note
1459
+ }]
1460
+ })), m = ue(a);
1461
+ if (m) throw RangeError(m);
1462
+ if (o !== void 0 && !Number.isFinite(o)) throw RangeError("now must be a finite time.");
1463
+ if (t) for (let e of p) for (let t of e.spans) {
1464
+ if (!Number.isFinite(t.start) || t.end !== null && (!Number.isFinite(t.end) || t.end < t.start)) throw RangeError(`${e.label}: span times must be finite and end at or after their start.`);
1465
+ if (t.end === null && (o === void 0 || o < t.start)) throw RangeError(`${e.label}: an open span needs a now at or after its start.`);
1466
+ }
1467
+ let h = p.flatMap((e) => e.spans);
1468
+ if (!h.length) return /* @__PURE__ */ (0, Y.jsx)("p", {
1469
+ className: "ov-empty",
1470
+ children: "No agent has started."
1471
+ });
1472
+ let g = (e) => e.end ?? o, _ = Math.round(1.25 * u), v = Math.min(Math.round(13 * u), Math.round(l * .32)), b = a.length ? 4 + Math.round(Math.min(3, a.length) * u + .3 * u) : 4, x = Math.round(1.8 * u), S = b + p.length * _ + x, C = [
1473
+ ...h.flatMap((e) => [e.start, g(e)]),
1474
+ ...a.map((e) => e.at),
1475
+ ...o === void 0 ? [] : [o]
1476
+ ], w = Math.min(...C), T = Math.max(...C, w + 6e4), E = Math.max(0, l - v - 10), D = (e) => v + (e - w) / (T - w) * E, O = n.unknown ?? "var(--chart-live-faint, var(--chart-muted))", k = new Set(s), A = b + p.length * _;
1477
+ return /* @__PURE__ */ (0, Y.jsxs)("div", {
1478
+ ref: c,
1479
+ className: "ov-plot",
1480
+ onMouseLeave: () => f(null),
1481
+ children: [
1482
+ l > 0 && /* @__PURE__ */ (0, Y.jsxs)("svg", {
1483
+ width: l,
1484
+ height: S,
1485
+ role: "img",
1486
+ "aria-label": `${p.length} ${t ? "lanes" : "agents"} over time`,
1487
+ children: [
1488
+ [
1489
+ 0,
1490
+ .25,
1491
+ .5,
1492
+ .75,
1493
+ 1
1494
+ ].map((e) => /* @__PURE__ */ (0, Y.jsxs)("g", { children: [/* @__PURE__ */ (0, Y.jsx)("line", {
1495
+ x1: v + e * E,
1496
+ x2: v + e * E,
1497
+ y1: b,
1498
+ y2: A,
1499
+ className: "ov-gridline"
1500
+ }), /* @__PURE__ */ (0, Y.jsx)("text", {
1501
+ x: v + e * E,
1502
+ y: S - u * .35,
1503
+ className: "ov-axis",
1504
+ textAnchor: e === 0 ? "start" : e === 1 ? "end" : "middle",
1505
+ children: r(w + e * (T - w))
1506
+ })] }, e)),
1507
+ p.map((e, t) => {
1508
+ let r = b + t * _;
1509
+ return /* @__PURE__ */ (0, Y.jsxs)("g", {
1510
+ "data-lane": e.id,
1511
+ children: [
1512
+ /* @__PURE__ */ (0, Y.jsx)("rect", {
1513
+ x: 0,
1514
+ y: r,
1515
+ width: l,
1516
+ height: _,
1517
+ fill: "transparent",
1518
+ onMouseEnter: () => f({
1519
+ x: Math.min(D(g(e.spans.at(-1) ?? { end: T })) + 8, l - u * 16),
1520
+ y: Math.max(0, r - u),
1521
+ title: e.label,
1522
+ lines: e.spans.flatMap((e) => [{
1523
+ label: e.end === null ? `${e.state} (open)` : e.state,
1524
+ value: i(e.start, g(e)),
1525
+ color: k.has(e.state) ? void 0 : n[e.state] ?? O
1526
+ }, ...e.note ? [{
1527
+ label: e.note,
1528
+ value: ""
1529
+ }] : []])
1530
+ })
1531
+ }),
1532
+ /* @__PURE__ */ (0, Y.jsx)("text", {
1533
+ x: v - u * .5,
1534
+ y: r + _ / 2,
1535
+ dominantBaseline: "middle",
1536
+ textAnchor: "end",
1537
+ className: "ov-axis ov-gantt-label",
1538
+ children: e.label.length > 26 ? `${e.label.slice(0, 25)}…` : e.label
1539
+ }),
1540
+ e.spans.map((t, a) => {
1541
+ let o = n[t.state] ?? O, s = D(t.start), c = Math.max(2, D(g(t)) - s), d = r + _ * .18, p = _ * .64, m = t.end === null;
1542
+ return /* @__PURE__ */ (0, Y.jsx)("g", {
1543
+ "data-state": t.state,
1544
+ "data-open": m ? "true" : void 0,
1545
+ "data-hatched": k.has(t.state) ? "true" : void 0,
1546
+ onMouseEnter: () => f({
1547
+ x: Math.min(s + c + 8, l - u * 16),
1548
+ y: Math.max(0, r - u),
1549
+ title: e.label,
1550
+ lines: [{
1551
+ label: m ? `${t.state} (open)` : t.state,
1552
+ value: i(t.start, g(t)),
1553
+ color: k.has(t.state) ? void 0 : o
1554
+ }, ...t.note ? [{
1555
+ label: t.note,
1556
+ value: ""
1557
+ }] : []]
1558
+ }),
1559
+ children: k.has(t.state) ? /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)("rect", {
1560
+ x: s,
1561
+ y: d,
1562
+ width: c,
1563
+ height: p,
1564
+ className: "ov-hatch-bg"
1565
+ }), /* @__PURE__ */ (0, Y.jsx)("path", {
1566
+ d: y(s, d, c, p, 4),
1567
+ className: "ov-hatch"
1568
+ })] }) : /* @__PURE__ */ (0, Y.jsx)("rect", {
1569
+ x: s,
1570
+ y: d,
1571
+ width: c,
1572
+ height: p,
1573
+ rx: 2,
1574
+ fill: o,
1575
+ className: m ? "ov-gantt-open" : void 0
1576
+ })
1577
+ }, a);
1578
+ })
1579
+ ]
1580
+ }, e.id);
1581
+ }),
1582
+ o !== void 0 && /* @__PURE__ */ (0, Y.jsx)("line", {
1583
+ x1: D(o),
1584
+ x2: D(o),
1585
+ y1: b,
1586
+ y2: A,
1587
+ className: "ov-now",
1588
+ "data-now": "true"
1589
+ }),
1590
+ [...a].sort((e, t) => e.at - t.at).map((e, t) => /* @__PURE__ */ (0, Y.jsx)(He, {
1591
+ mark: e,
1592
+ x: D(e.at),
1593
+ top: 4,
1594
+ bottom: A,
1595
+ row: t % 3,
1596
+ em: u,
1597
+ flip: D(e.at) > v + E * .62
1598
+ }, `mark-${t}`))
1599
+ ]
1600
+ }),
1601
+ /* @__PURE__ */ (0, Y.jsx)(Ie, { tip: d }),
1602
+ /* @__PURE__ */ (0, Y.jsx)(Ue, {
1603
+ marks: a,
1604
+ bands: [],
1605
+ format: r
1606
+ })
1607
+ ]
1608
+ });
1609
+ }
1610
+ var Je = 24, Ye = Je / 2;
1611
+ function Xe({ value: e, bound: t = null, target: n, stretch: r = null, scale: i = "log", format: a = Me, tone: o = "var(--chart-live-accent, #8b7cf6)", titles: s = {}, label: c }) {
1612
+ let [l, u] = Pe(), d = i === "log" && e > 0 && n.min > 0, f = (e) => d ? Math.log10(e) : e, p = [
1613
+ e,
1614
+ n.min,
1615
+ n.max,
1616
+ ...r ? [r.min, r.max] : []
1617
+ ].map(f), m = Math.min(...p), h = Math.max(...p), g = Math.max((h - m) * .08, d ? .15 : Math.abs(h) * .05 || 1), _ = (e) => u ? (f(e) - (m - g)) / (h - m + 2 * g) * u : 0, v = (e) => ({
1618
+ x: _(e.min),
1619
+ w: Math.max(4, _(e.max) - _(e.min))
1620
+ }), y = v(n), b = r ? v(r) : null, x = e < n.min ? _(n.min) : e > n.max ? _(n.max) : _(e), S = _(e), C = (e) => e.min === e.max ? `≈${a(e.min)}` : `${a(e.min)}–${a(e.max)}`, w = d && u ? Array.from({ length: Math.floor(h + g) - Math.ceil(m - g) + 1 }, (e, t) => Math.ceil(m - g) + t) : [], T = t === "upper" ? `M${S + 4},6 L${S - 4},${Ye} L${S + 4},18` : `M${S - 4},6 L${S + 4},${Ye} L${S - 4},18`;
1621
+ return /* @__PURE__ */ (0, Y.jsx)("div", {
1622
+ ref: l,
1623
+ className: "ov-gap",
1624
+ role: "img",
1625
+ "aria-label": c ?? `${t === "upper" ? "≤" : t === "lower" ? "≥" : ""}${a(e)} against ${C(n)}`,
1626
+ children: u > 0 && /* @__PURE__ */ (0, Y.jsxs)("svg", {
1627
+ width: u,
1628
+ height: Je,
1629
+ viewBox: `0 0 ${u} ${Je}`,
1630
+ "aria-hidden": !0,
1631
+ children: [
1632
+ /* @__PURE__ */ (0, Y.jsx)("line", {
1633
+ className: "ov-gap-track",
1634
+ x1: 0,
1635
+ x2: u,
1636
+ y1: Ye,
1637
+ y2: Ye
1638
+ }),
1639
+ w.map((e) => /* @__PURE__ */ (0, Y.jsx)("line", {
1640
+ className: "ov-gap-tick",
1641
+ x1: _(10 ** e),
1642
+ x2: _(10 ** e),
1643
+ y1: 8,
1644
+ y2: 16
1645
+ }, e)),
1646
+ b && /* @__PURE__ */ (0, Y.jsx)("rect", {
1647
+ className: "ov-gap-stretch",
1648
+ x: b.x,
1649
+ y: 4,
1650
+ width: b.w,
1651
+ height: 16,
1652
+ rx: 4,
1653
+ children: /* @__PURE__ */ (0, Y.jsx)("title", { children: s.stretch ?? `stretch ${C(r)}` })
1654
+ }),
1655
+ /* @__PURE__ */ (0, Y.jsx)("rect", {
1656
+ className: "ov-gap-target",
1657
+ x: y.x,
1658
+ y: 4,
1659
+ width: y.w,
1660
+ height: 16,
1661
+ rx: 4,
1662
+ children: /* @__PURE__ */ (0, Y.jsx)("title", { children: s.target ?? `target ${C(n)}` })
1663
+ }),
1664
+ Math.abs(x - S) > 1 && /* @__PURE__ */ (0, Y.jsx)("line", {
1665
+ className: "ov-gap-span",
1666
+ x1: S,
1667
+ x2: x,
1668
+ y1: Ye,
1669
+ y2: Ye,
1670
+ style: { stroke: o }
1671
+ }),
1672
+ /* @__PURE__ */ (0, Y.jsxs)("g", {
1673
+ className: "ov-gap-value",
1674
+ children: [
1675
+ /* @__PURE__ */ (0, Y.jsx)("title", { children: s.value ?? `${t === "upper" ? "≤" : t === "lower" ? "≥" : ""}${a(e)}` }),
1676
+ t ? /* @__PURE__ */ (0, Y.jsx)("path", {
1677
+ d: T,
1678
+ fill: "none",
1679
+ stroke: o,
1680
+ strokeWidth: 2,
1681
+ strokeLinecap: "round",
1682
+ strokeLinejoin: "round"
1683
+ }) : /* @__PURE__ */ (0, Y.jsx)("circle", {
1684
+ cx: S,
1685
+ cy: Ye,
1686
+ r: 5,
1687
+ fill: o
1688
+ }),
1689
+ /* @__PURE__ */ (0, Y.jsx)("rect", {
1690
+ x: S - 8,
1691
+ y: 0,
1692
+ width: 16,
1693
+ height: Je,
1694
+ fill: "transparent"
1695
+ })
1696
+ ]
1697
+ })
1698
+ ]
1699
+ })
1700
+ });
1701
+ }
1702
+ function Ze({ figure: e, presentation: t = "chart" }) {
1703
+ let [n, r] = Pe(), i = r >= 720 ? Math.floor(r / 32) * 32 : 720, a = (0, X.useMemo)(() => typeof e == "function" ? e(i) : e, [e, i]);
1704
+ if (oe(a)) return /* @__PURE__ */ (0, Y.jsx)("p", {
1705
+ className: "ov-refusal",
1706
+ role: "note",
1707
+ "data-refused": a.id,
1708
+ children: a.refused
1709
+ });
1710
+ let o = r > 0 && r < 720 ? a.svg.narrow ? "narrow" : "table" : "wide", s = o === "wide" ? a.svg.wide : o === "narrow" ? a.svg.narrow : a.table, c = [
1711
+ a.note.method,
1712
+ a.note.n,
1713
+ ...a.note.exclusions
1714
+ ].join(" ");
1715
+ return /* @__PURE__ */ (0, Y.jsxs)("figure", {
1716
+ ref: n,
1717
+ className: "tgc-figure tgc-figure-chart tgc-figure-view",
1718
+ "data-figure": a.id,
1719
+ "data-layout": o,
1720
+ "aria-label": a.finding,
1721
+ children: [
1722
+ t === "report" && /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)("h3", {
1723
+ className: "tgc-finding",
1724
+ children: a.finding
1725
+ }), /* @__PURE__ */ (0, Y.jsx)("p", {
1726
+ className: "tgc-lede",
1727
+ children: a.lede
1728
+ })] }),
1729
+ /* @__PURE__ */ (0, Y.jsx)("div", {
1730
+ className: `tgc-view-plot tgc-view-${o}`,
1731
+ role: a.svg.interactive ? "group" : "img",
1732
+ "aria-label": `${a.finding} ${a.lede}`,
1733
+ style: o === "narrow" ? { maxWidth: 358 } : void 0,
1734
+ dangerouslySetInnerHTML: { __html: s }
1735
+ }),
1736
+ /* @__PURE__ */ (0, Y.jsxs)("details", {
1737
+ className: "tgc-data",
1738
+ children: [
1739
+ /* @__PURE__ */ (0, Y.jsx)("summary", { children: "Data and method" }),
1740
+ /* @__PURE__ */ (0, Y.jsx)("p", {
1741
+ className: "tgc-lede",
1742
+ children: a.lede
1743
+ }),
1744
+ /* @__PURE__ */ (0, Y.jsx)("p", {
1745
+ className: "tgc-read",
1746
+ children: a.read
1747
+ }),
1748
+ /* @__PURE__ */ (0, Y.jsx)("p", {
1749
+ className: "tgc-read",
1750
+ children: c
1751
+ }),
1752
+ /* @__PURE__ */ (0, Y.jsx)("div", {
1753
+ className: "tgc-scroll",
1754
+ role: "region",
1755
+ "aria-label": `${a.finding} data`,
1756
+ tabIndex: 0,
1757
+ dangerouslySetInnerHTML: { __html: a.table }
1758
+ })
1759
+ ]
1760
+ })
1761
+ ]
1762
+ });
1763
+ }
1764
+ var Qe = Object.freeze([
1765
+ "var(--chart-category-1)",
1766
+ "var(--chart-category-2)",
1767
+ "var(--chart-category-3)",
1768
+ "var(--chart-category-other)"
1769
+ ]);
1770
+ function $e(e, t) {
1771
+ let n = document.createElement("span");
1772
+ n.style.display = "none", e.appendChild(n);
1773
+ let r = t.map((e) => (n.style.color = "", n.style.color = e, getComputedStyle(n).color || e));
1774
+ return n.remove(), r;
1775
+ }
1776
+ function et(e, t, n) {
1777
+ let [r, i, a, o] = t, s = Math.max(1, Math.ceil((a - r) / n)), c = Math.max(1, Math.ceil((o - i) / n)), l = /* @__PURE__ */ new Map();
1778
+ for (let t = 0; t < e.length / 2; t++) {
1779
+ let a = Math.min(s - 1, Math.max(0, Math.floor((e[t * 2] - r) / n))), o = Math.min(c - 1, Math.max(0, Math.floor((e[t * 2 + 1] - i) / n))) * s + a, u = l.get(o);
1780
+ u ? u.push(t) : l.set(o, [t]);
1781
+ }
1782
+ return {
1783
+ cols: s,
1784
+ rows: c,
1785
+ cell: n,
1786
+ cells: l,
1787
+ x0: r,
1788
+ y0: i
1789
+ };
1790
+ }
1791
+ function tt({ positions: e, radii: t, colors: n, palette: r, extent: i, rects: a, labels: o, dimmed: s, selected: c, minPixelRadius: l = 1.2, onHover: u, onSelect: d, describe: f, height: p = 560, ariaLabel: m }) {
1792
+ let h = (0, X.useRef)(null), g = (0, X.useRef)(null), [_, v] = (0, X.useState)({
1793
+ width: 0,
1794
+ height: p
1795
+ }), y = (0, X.useRef)({
1796
+ scale: 1,
1797
+ tx: 0,
1798
+ ty: 0
1799
+ }), b = (0, X.useRef)(""), x = (0, X.useRef)(0), [S, C] = (0, X.useState)(null), w = (0, X.useRef)([]), T = e.length / 2, E = (0, X.useMemo)(() => typeof t == "number" ? t : t.reduce((e, t) => t > e ? t : e, 0), [t]), D = (0, X.useMemo)(() => et(e, i, Math.max(E * 2, (i[2] - i[0]) / 200)), [
1800
+ e,
1801
+ i,
1802
+ E
1803
+ ]);
1804
+ (0, X.useEffect)(() => {
1805
+ if (!h.current) return;
1806
+ let e = new ResizeObserver(([e]) => v({
1807
+ width: Math.floor(e.contentRect.width),
1808
+ height: p
1809
+ }));
1810
+ return e.observe(h.current), () => e.disconnect();
1811
+ }, [p]);
1812
+ let O = (0, X.useCallback)(() => {
1813
+ let [e, t, n, r] = i, a = Math.min((_.width - 16) / Math.max(1e-9, n - e), (_.height - 16) / Math.max(1e-9, r - t));
1814
+ y.current = {
1815
+ scale: a,
1816
+ tx: 8 - e * a + (_.width - 16 - (n - e) * a) / 2,
1817
+ ty: 8 - t * a + (_.height - 16 - (r - t) * a) / 2
1818
+ };
1819
+ }, [i, _]), k = (0, X.useCallback)(() => {
1820
+ x.current = 0;
1821
+ let i = g.current;
1822
+ if (!i || !_.width) return;
1823
+ let u = performance.now(), d = window.devicePixelRatio || 1;
1824
+ (i.width !== Math.round(_.width * d) || i.height !== Math.round(_.height * d)) && (i.width = Math.round(_.width * d), i.height = Math.round(_.height * d));
1825
+ let f = i.getContext("2d");
1826
+ if (!f) return;
1827
+ !w.current.length && h.current && (w.current = $e(h.current, r));
1828
+ let { scale: p, tx: m, ty: v } = y.current;
1829
+ f.setTransform(d, 0, 0, d, 0, 0), f.clearRect(0, 0, _.width, _.height);
1830
+ let b = h.current ? getComputedStyle(h.current) : null, S = b?.color || "#888";
1831
+ if (a?.length) {
1832
+ f.lineWidth = 1, f.font = "11px ui-sans-serif, system-ui, sans-serif";
1833
+ for (let e of a) {
1834
+ if (e.x1 <= e.x0) continue;
1835
+ let t = e.x0 * p + m, n = e.y0 * p + v, r = (e.x1 - e.x0) * p, i = (e.y1 - e.y0) * p;
1836
+ if (!(t > _.width || n > _.height || t + r < 0 || n + i < 0) && (f.globalAlpha = .35, f.strokeStyle = S, f.strokeRect(t + .5, n + .5, r, i), r > 36)) {
1837
+ f.globalAlpha = .8, f.fillStyle = S;
1838
+ let i = e.note ? `${e.label} · ${e.note}` : e.label;
1839
+ f.save(), f.beginPath(), f.rect(t, n, r - 4, 16), f.clip(), f.fillText(i, t + 4, n + 12), f.restore();
1840
+ }
1841
+ }
1842
+ f.globalAlpha = 1;
1843
+ }
1844
+ let C = /* @__PURE__ */ new Map(), E = new Path2D(), D = typeof t == "number" ? t : 0;
1845
+ for (let r = 0; r < T; r++) {
1846
+ let i = e[r * 2] * p + m, a = e[r * 2 + 1] * p + v;
1847
+ if (i < -8 || a < -8 || i > _.width + 8 || a > _.height + 8) continue;
1848
+ let o = Math.max(l, (typeof t == "number" ? D : t[r]) * p), c = s?.[r] ? E : C.get(n[r]) ?? C.set(n[r], new Path2D()).get(n[r]);
1849
+ c.moveTo(i + o, a), c.arc(i, a, o, 0, Math.PI * 2);
1850
+ }
1851
+ f.globalAlpha = .18, f.fillStyle = S, f.fill(E), f.globalAlpha = .92;
1852
+ for (let [e, t] of C) f.fillStyle = w.current[e] ?? S, f.fill(t);
1853
+ if (f.globalAlpha = 1, c != null && c < T) {
1854
+ let n = e[c * 2] * p + m, r = e[c * 2 + 1] * p + v, i = Math.max(4, (typeof t == "number" ? D : t[c]) * p + 3);
1855
+ f.lineWidth = 2, f.strokeStyle = S, f.beginPath(), f.arc(n, r, i, 0, Math.PI * 2), f.stroke();
1856
+ }
1857
+ if (o?.length) {
1858
+ f.font = "600 12px ui-sans-serif, system-ui, sans-serif", f.textAlign = "center", f.lineWidth = 3;
1859
+ let e = b?.getPropertyValue("--dot-map-surface").trim() || b?.backgroundColor || "#161616", t = [];
1860
+ for (let n of o) {
1861
+ let r = n.x * p + m, i = n.y * p + v;
1862
+ if (r < 0 || i < 0 || r > _.width || i > _.height) continue;
1863
+ let a = f.measureText(n.text).width, o = [
1864
+ r - a / 2 - 2,
1865
+ i - 10,
1866
+ r + a / 2 + 2,
1867
+ i + 4
1868
+ ];
1869
+ t.some(([e, t, n, r]) => o[0] < n && o[2] > e && o[1] < r && o[3] > t) || (t.push(o), f.strokeStyle = e, f.strokeText(n.text, r, i), f.fillStyle = S, f.fillText(n.text, r, i));
1870
+ }
1871
+ f.textAlign = "start";
1872
+ }
1873
+ i.dataset.frameMs = (performance.now() - u).toFixed(2);
1874
+ }, [
1875
+ _,
1876
+ e,
1877
+ t,
1878
+ n,
1879
+ r,
1880
+ a,
1881
+ o,
1882
+ s,
1883
+ c,
1884
+ T,
1885
+ l
1886
+ ]), A = (0, X.useCallback)(() => {
1887
+ x.current ||= requestAnimationFrame(k);
1888
+ }, [k]);
1889
+ (0, X.useEffect)(() => {
1890
+ w.current = [];
1891
+ }, [r]), (0, X.useEffect)(() => {
1892
+ if (!_.width) return;
1893
+ let e = `${i.join(",")}:${_.width}x${_.height}`;
1894
+ b.current !== e && (O(), b.current = e), A();
1895
+ }, [
1896
+ _,
1897
+ i,
1898
+ O,
1899
+ A
1900
+ ]), (0, X.useEffect)(() => A(), [A]), (0, X.useEffect)(() => () => cancelAnimationFrame(x.current), []);
1901
+ let j = (0, X.useCallback)((n, r) => {
1902
+ let i = g.current;
1903
+ if (!i) return null;
1904
+ let a = i.getBoundingClientRect(), { scale: o, tx: s, ty: c } = y.current, l = (n - a.left - s) / o, u = (r - a.top - c) / o, d = Math.floor((l - D.x0) / D.cell), f = Math.floor((u - D.y0) / D.cell), p = null, m = Infinity, h = Math.max(1, Math.ceil(6 / (o * D.cell)));
1905
+ for (let n = -h; n <= h; n++) for (let r = -h; r <= h; r++) if (!(d + r < 0 || f + n < 0 || d + r >= D.cols || f + n >= D.rows)) for (let i of D.cells.get((f + n) * D.cols + (d + r)) ?? []) {
1906
+ let n = e[i * 2] - l, r = e[i * 2 + 1] - u, a = n * n + r * r, s = Math.max(6 / o, typeof t == "number" ? t : t[i]);
1907
+ a < m && a <= s * s && (m = a, p = i);
1908
+ }
1909
+ return p;
1910
+ }, [
1911
+ D,
1912
+ e,
1913
+ t
1914
+ ]), M = (0, X.useRef)(null), N = (0, X.useRef)(/* @__PURE__ */ new Map()), P = (0, X.useRef)(null);
1915
+ (0, X.useEffect)(() => {
1916
+ let e = g.current;
1917
+ if (!e) return;
1918
+ let t = (t) => {
1919
+ t.preventDefault();
1920
+ let n = e.getBoundingClientRect(), r = t.clientX - n.left, i = t.clientY - n.top, a = Math.exp(-t.deltaY * .0015), o = y.current, s = Math.min(o.scale * 400, Math.max(o.scale * .0025, o.scale * a));
1921
+ y.current = {
1922
+ scale: s,
1923
+ tx: r - (r - o.tx) / o.scale * s,
1924
+ ty: i - (i - o.ty) / o.scale * s
1925
+ }, A();
1926
+ };
1927
+ return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
1928
+ }, [A]);
1929
+ let F = S ? f?.(S.index) ?? null : null;
1930
+ return /* @__PURE__ */ (0, Y.jsxs)("div", {
1931
+ ref: h,
1932
+ className: "tgc-dot-map",
1933
+ style: {
1934
+ position: "relative",
1935
+ height: p
1936
+ },
1937
+ "data-points": T,
1938
+ children: [/* @__PURE__ */ (0, Y.jsx)("canvas", {
1939
+ ref: g,
1940
+ role: "img",
1941
+ "aria-label": m,
1942
+ tabIndex: 0,
1943
+ style: {
1944
+ width: "100%",
1945
+ height: p,
1946
+ display: "block",
1947
+ touchAction: "none",
1948
+ cursor: S ? "pointer" : "grab"
1949
+ },
1950
+ onPointerDown: (e) => {
1951
+ if (N.current.set(e.pointerId, {
1952
+ x: e.clientX,
1953
+ y: e.clientY
1954
+ }), N.current.size === 2) {
1955
+ let [e, t] = [...N.current.values()];
1956
+ P.current = {
1957
+ distance: Math.hypot(e.x - t.x, e.y - t.y) || 1,
1958
+ view: { ...y.current }
1959
+ }, M.current = null;
1960
+ } else M.current = {
1961
+ x: e.clientX,
1962
+ y: e.clientY,
1963
+ moved: !1
1964
+ };
1965
+ e.currentTarget.setPointerCapture(e.pointerId);
1966
+ },
1967
+ onPointerMove: (e) => {
1968
+ N.current.has(e.pointerId) && N.current.set(e.pointerId, {
1969
+ x: e.clientX,
1970
+ y: e.clientY
1971
+ });
1972
+ let t = P.current;
1973
+ if (t && N.current.size === 2) {
1974
+ let [n, r] = [...N.current.values()], i = e.currentTarget.getBoundingClientRect(), a = (n.x + r.x) / 2 - i.left, o = (n.y + r.y) / 2 - i.top, s = t.view.scale * ((Math.hypot(n.x - r.x, n.y - r.y) || 1) / t.distance);
1975
+ y.current = {
1976
+ scale: s,
1977
+ tx: a - (a - t.view.tx) / t.view.scale * s,
1978
+ ty: o - (o - t.view.ty) / t.view.scale * s
1979
+ }, A();
1980
+ return;
1981
+ }
1982
+ let n = M.current;
1983
+ if (n) {
1984
+ let t = e.clientX - n.x, r = e.clientY - n.y;
1985
+ if (n.moved || Math.abs(t) + Math.abs(r) > 3) {
1986
+ n.moved = !0, y.current = {
1987
+ ...y.current,
1988
+ tx: y.current.tx + t,
1989
+ ty: y.current.ty + r
1990
+ }, n.x = e.clientX, n.y = e.clientY, A();
1991
+ return;
1992
+ }
1993
+ }
1994
+ let r = j(e.clientX, e.clientY), i = e.currentTarget.getBoundingClientRect();
1995
+ C(r === null ? null : {
1996
+ index: r,
1997
+ x: e.clientX - i.left,
1998
+ y: e.clientY - i.top
1999
+ }), u?.(r);
2000
+ },
2001
+ onPointerUp: (e) => {
2002
+ if (N.current.delete(e.pointerId), P.current) {
2003
+ N.current.size < 2 && (P.current = null), M.current = null;
2004
+ return;
2005
+ }
2006
+ let t = M.current;
2007
+ M.current = null, t && !t.moved && d?.(j(e.clientX, e.clientY));
2008
+ },
2009
+ onPointerCancel: (e) => {
2010
+ N.current.delete(e.pointerId), N.current.size < 2 && (P.current = null), M.current = null;
2011
+ },
2012
+ onPointerLeave: () => {
2013
+ C(null), u?.(null);
2014
+ },
2015
+ onDoubleClick: () => {
2016
+ O(), A();
2017
+ },
2018
+ onKeyDown: (e) => {
2019
+ let t = y.current, n = (e) => {
2020
+ let n = _.width / 2, r = _.height / 2;
2021
+ y.current = {
2022
+ scale: t.scale * e,
2023
+ tx: n - (n - t.tx) / t.scale * t.scale * e,
2024
+ ty: r - (r - t.ty) / t.scale * t.scale * e
2025
+ };
2026
+ };
2027
+ if (e.key === "+" || e.key === "=") n(1.4);
2028
+ else if (e.key === "-") n(1 / 1.4);
2029
+ else if (e.key === "0") O();
2030
+ else if (e.key === "ArrowLeft") y.current = {
2031
+ ...t,
2032
+ tx: t.tx + 60
2033
+ };
2034
+ else if (e.key === "ArrowRight") y.current = {
2035
+ ...t,
2036
+ tx: t.tx - 60
2037
+ };
2038
+ else if (e.key === "ArrowUp") y.current = {
2039
+ ...t,
2040
+ ty: t.ty + 60
2041
+ };
2042
+ else if (e.key === "ArrowDown") y.current = {
2043
+ ...t,
2044
+ ty: t.ty - 60
2045
+ };
2046
+ else return;
2047
+ e.preventDefault(), A();
2048
+ }
2049
+ }), S && F && /* @__PURE__ */ (0, Y.jsx)("div", {
2050
+ className: "tgc-dot-map-tip",
2051
+ role: "tooltip",
2052
+ style: {
2053
+ position: "absolute",
2054
+ left: Math.min(S.x + 12, Math.max(0, _.width - 300)),
2055
+ top: S.y + 12,
2056
+ pointerEvents: "none"
2057
+ },
2058
+ children: F
2059
+ })]
2060
+ });
2061
+ }
2062
+ var nt = (e) => e?.split(" · ")[0], rt = (e) => e <= 0 ? 0 : (e - 1) % 5 + 1, it = (e) => e.status === "failed", Z = (e) => e.status === "running", at = (e) => Number.isFinite(e.startMs) && Number.isFinite(e.endMs) && e.endMs >= e.startMs;
2063
+ function Q(e) {
2064
+ if (!Number.isFinite(e) || e < 0) return "—";
2065
+ if (e < 1e3) return `${Math.round(e)}ms`;
2066
+ if (e < 1e4) return `${(e / 1e3).toFixed(1)}s`;
2067
+ if (e < 6e4) return `${Math.round(e / 1e3)}s`;
2068
+ if (e < 36e5) {
2069
+ let t = Math.floor(e / 6e4), n = Math.round(e % 6e4 / 1e3);
2070
+ return n === 60 ? `${t + 1}m` : n ? `${t}m ${n}s` : `${t}m`;
2071
+ }
2072
+ let t = Math.floor(e / 36e5), n = Math.round(e % 36e5 / 6e4);
2073
+ return n === 60 ? `${t + 1}h` : `${t}h ${String(n).padStart(2, "0")}m`;
2074
+ }
2075
+ function ot(e) {
2076
+ return e === 0 ? "$0.00" : e < .01 ? `$${e.toPrecision(1).replace(/0+$/, "")}` : `$${e.toFixed(2)}`;
2077
+ }
2078
+ function st(e) {
2079
+ return e < 1e3 ? String(e) : e < 1e6 ? `${(e / 1e3).toFixed(1)}k` : `${(e / 1e6).toFixed(1)}M`;
2080
+ }
2081
+ function ct(e, t, n = 240) {
2082
+ e.sort((e, t) => e.startMs - t.startMs);
2083
+ let r = t;
2084
+ for (let t = 0; t < 40; t++, r *= 2) {
2085
+ let t = [], i = /* @__PURE__ */ new Map();
2086
+ for (let n of e) {
2087
+ let e = t[t.length - 1], a = Math.min(n.endMs, n.startMs + r * 4) - n.startMs, o = (e) => e.retry || e.kind === "failed", s = a < r || e !== void 0 && e.endMs - e.startMs < r;
2088
+ if (e && !o(e) && !o(n) && e.tone === n.tone && n.startMs - e.endMs <= r && (e.kind === n.kind || s)) {
2089
+ let t = i.get(e) ?? {
2090
+ model: e.kind === "model" ? e.endMs - e.startMs : 0,
2091
+ tool: e.kind === "tool" ? e.endMs - e.startMs : 0
2092
+ };
2093
+ t[n.kind === "model" ? "model" : "tool"] += a, i.set(e, t), e.endMs = Math.max(e.endMs, n.endMs), e.count += n.count, e.tool !== n.tool && (e.tool = void 0), n.costUsd !== void 0 && (e.costUsd = (e.costUsd ?? 0) + n.costUsd), e.kind = t.model >= t.tool ? "model" : "tool";
2094
+ } else t.push({ ...n });
2095
+ }
2096
+ if (t.length <= n) return t;
2097
+ }
2098
+ return e;
2099
+ }
2100
+ function lt(e, t) {
2101
+ let n = /* @__PURE__ */ new Set(), r = [...e.spans].map((e, t) => ({
2102
+ span: e,
2103
+ key: e.id ?? `span-${t}`
2104
+ })).sort((e, t) => e.span.startMs - t.span.startMs).map(({ span: t, key: r }, i) => {
2105
+ let a = r, o = i;
2106
+ for (; n.has(a);) a = `${r}:${o++}`;
2107
+ return n.add(a), {
2108
+ id: a,
2109
+ parentId: t.parentId,
2110
+ name: t.name,
2111
+ kind: t.kind,
2112
+ durationLabel: at(t) ? `${Q(t.endMs - t.startMs)}${t.approx ? "~" : ""}` : "—",
2113
+ approx: t.approx === !0,
2114
+ ok: !it(t),
2115
+ depth: 0,
2116
+ hasChildren: !1,
2117
+ span: t,
2118
+ tone: -1,
2119
+ descendants: 0,
2120
+ segments: [],
2121
+ own: [],
2122
+ retry: t.retryOf !== void 0,
2123
+ hasAgents: !1,
2124
+ ...t.costBound === "lower" || t.costBound === void 0 && e.costBound === "lower" ? { costFloor: !0 } : {}
2125
+ };
2126
+ }), i = new Map(r.map((e) => [e.id, e])), a = /* @__PURE__ */ new Map();
2127
+ for (let e of r) {
2128
+ let t = /* @__PURE__ */ new Set([e.id]), n = e.parentId;
2129
+ for (; n && i.has(n);) {
2130
+ if (t.has(n)) {
2131
+ e.parentId = void 0;
2132
+ break;
2133
+ }
2134
+ t.add(n), n = i.get(n)?.parentId;
2135
+ }
2136
+ if (e.parentId && !i.has(e.parentId) && (e.parentId = void 0), e.parentId) {
2137
+ let t = a.get(e.parentId) ?? [];
2138
+ t.push(e), a.set(e.parentId, t);
2139
+ }
2140
+ }
2141
+ let o = Math.max(1, Number.isFinite(e.totalMs) ? e.totalMs : 1), s = t ?? o / 900, c = [], l = 0, u = (e, t, n) => {
2142
+ e.depth = t, e.tone = e.kind === "pipeline" ? l++ : n;
2143
+ let r = a.get(e.id) ?? [];
2144
+ e.hasChildren = r.length > 0, c.push(e);
2145
+ let i = [], o = e.span.promptTokens !== void 0 || e.span.completionTokens !== void 0 || e.span.cachedTokens !== void 0, d = e.span.costUsd ?? 0, f = e.span.kind !== "model" || e.span.costUsd !== void 0;
2146
+ for (let n of r) {
2147
+ for (let r of u(n, t + 1, e.tone)) i.push(r);
2148
+ e.descendants += 1 + n.descendants, n.kind === "pipeline" && (e.hasAgents = !0);
2149
+ let r = n.hasChildren ? n.rollupCostUsd : n.span.costUsd;
2150
+ r === void 0 ? (n.kind === "model" || n.hasChildren) && (f = !1) : d += r, n.kind !== "pipeline" && n.kind !== "waiting" && at(n.span) && e.own.push(pt(n));
2151
+ }
2152
+ Object.assign(e, ut(r));
2153
+ let p = o ? {
2154
+ prompt: e.span.promptTokens,
2155
+ completion: e.span.completionTokens,
2156
+ cached: e.span.cachedTokens
2157
+ } : ft(r);
2158
+ return p && (e.tokens = p), e.hasChildren && f && (e.rollupCostUsd = d), e.hasChildren && (e.segments = ct(i.map((e) => ({ ...e })), s), e.own = ct(e.own, s)), e.kind === "pipeline" || e.kind === "waiting" || !at(e.span) || i.push(pt(e)), i;
2159
+ };
2160
+ for (let e of r) e.parentId || u(e, 0, -1);
2161
+ return c;
2162
+ }
2163
+ function ut(e) {
2164
+ let t, n = [];
2165
+ for (let r of e) if (r.kind !== "pipeline" && r.kind !== "waiting" && at(r.span)) {
2166
+ if (t ??= {
2167
+ model: 0,
2168
+ tool: 0,
2169
+ failed: 0,
2170
+ retried: 0,
2171
+ tools: {}
2172
+ }, r.ok || t.failed++, r.retry && t.retried++, r.kind === "model") t.model++, Z(r.span) || n.push(r.span.endMs - r.span.startMs);
2173
+ else {
2174
+ t.tool++;
2175
+ let e = nt(r.name) || r.kind;
2176
+ t.tools[e] = (t.tools[e] ?? 0) + 1;
2177
+ }
2178
+ }
2179
+ return t ? {
2180
+ counts: t,
2181
+ modelMs: n.sort((e, t) => e - t)
2182
+ } : {};
2183
+ }
2184
+ function dt(e) {
2185
+ let t;
2186
+ for (let n of e) if (n.counts) {
2187
+ t ??= {
2188
+ model: 0,
2189
+ tool: 0,
2190
+ failed: 0,
2191
+ retried: 0,
2192
+ tools: {}
2193
+ }, t.model += n.counts.model, t.tool += n.counts.tool, t.failed += n.counts.failed, t.retried += n.counts.retried;
2194
+ for (let [e, r] of Object.entries(n.counts.tools)) t.tools[e] = (t.tools[e] ?? 0) + r;
2195
+ }
2196
+ let n = ft(e);
2197
+ return {
2198
+ ...t ? {
2199
+ counts: t,
2200
+ modelMs: e.flatMap((e) => e.modelMs ?? []).sort((e, t) => e - t)
2201
+ } : {},
2202
+ ...n ? { tokens: n } : {}
2203
+ };
2204
+ }
2205
+ function ft(e) {
2206
+ let t;
2207
+ for (let n of e) for (let e of [
2208
+ "prompt",
2209
+ "completion",
2210
+ "cached"
2211
+ ]) {
2212
+ let r = n.tokens?.[e];
2213
+ r !== void 0 && ((t ??= {})[e] = (t[e] ?? 0) + r);
2214
+ }
2215
+ return t;
2216
+ }
2217
+ function pt(e) {
2218
+ return {
2219
+ startMs: e.span.startMs,
2220
+ endMs: Z(e.span) ? Infinity : e.span.endMs,
2221
+ kind: e.ok ? e.kind === "model" ? "model" : "tool" : "failed",
2222
+ tone: e.tone,
2223
+ id: e.id,
2224
+ count: 1,
2225
+ retry: e.retry,
2226
+ name: e.name,
2227
+ tool: nt(e.name),
2228
+ ...e.span.costUsd === void 0 ? {} : { costUsd: e.span.costUsd },
2229
+ ...!e.ok && e.kind === "model" ? { modelCall: !0 } : {}
2230
+ };
2231
+ }
2232
+ function mt(e, t, n) {
2233
+ let r = t.trim(), i = r.toLowerCase();
2234
+ return new Set(e.filter((e) => n ? n(e.span, r) : `${e.name} ${e.span.detail ?? ""} ${e.kind} ${e.ok ? "" : "failed"} ${e.span.status ?? ""}`.toLowerCase().includes(i)).map((e) => e.id));
2235
+ }
2236
+ function ht(e, t, n, r) {
2237
+ let i = new Map(e.map((e) => [e.id, e]));
2238
+ if (t.trim()) {
2239
+ let n = /* @__PURE__ */ new Set();
2240
+ for (let a of mt(e, t, r)) {
2241
+ let e = i.get(a);
2242
+ for (; e && !n.has(e.id);) n.add(e.id), e = e.parentId ? i.get(e.parentId) : void 0;
2243
+ }
2244
+ return e.filter((e) => n.has(e.id));
2245
+ }
2246
+ let a = /* @__PURE__ */ new Set();
2247
+ return e.filter((e) => {
2248
+ let t = e.parentId !== void 0 && (n.has(e.parentId) || a.has(e.parentId));
2249
+ return t && a.add(e.id), !t;
2250
+ });
2251
+ }
2252
+ function gt(e, t) {
2253
+ let n, r = -1;
2254
+ for (let i of e) {
2255
+ if (i.hasChildren || i.kind === "pipeline" || i.kind === "waiting" || i.durationLabel === "—" || i.span.startMs > t) continue;
2256
+ let e = (Z(i.span) ? Math.max(i.span.endMs, t) : Math.min(i.span.endMs, t)) - i.span.startMs;
2257
+ e > r && (n = i, r = e);
2258
+ }
2259
+ return n;
2260
+ }
2261
+ function _t(e) {
2262
+ let t = /* @__PURE__ */ new Map();
2263
+ for (let n of e) {
2264
+ if (!n.parentId) continue;
2265
+ let e = t.get(n.parentId);
2266
+ e ? e.push(n) : t.set(n.parentId, [n]);
2267
+ }
2268
+ let n;
2269
+ for (let r of e) {
2270
+ if (r.parentId) continue;
2271
+ let e = [], i = r.span.endMs;
2272
+ for (let n = r; n;) e.push(n.id), i = Math.max(i, n.span.endMs), n = t.get(n.id)?.reduce((e, t) => !e || t.span.endMs > e.span.endMs ? t : e, void 0);
2273
+ (!n || i > n.end) && (n = {
2274
+ end: i,
2275
+ chain: e
2276
+ });
2277
+ }
2278
+ return new Set(n?.chain);
2279
+ }
2280
+ function vt(e, t) {
2281
+ let n, r = -1, i, a = -1, o = 0, s = 0;
2282
+ for (let c of e) {
2283
+ if (c.durationLabel === "—" || c.span.startMs > t || c.kind !== "pipeline" || c.id.startsWith("family:") || c.id.startsWith("run:")) continue;
2284
+ if (c.parentId !== void 0) {
2285
+ let e = (Z(c.span) ? Math.max(c.span.endMs, t) : Math.min(c.span.endMs, t)) - c.span.startMs;
2286
+ s += 1, e > r && (n = c, r = e);
2287
+ }
2288
+ let e = c.span.costUsd ?? c.rollupCostUsd;
2289
+ e !== void 0 && (o += 1, e > a && (i = c, a = e));
2290
+ }
2291
+ return {
2292
+ slowestId: s > 1 ? n?.id : void 0,
2293
+ costliestId: o > 1 && a > 0 ? i?.id : void 0
2294
+ };
2295
+ }
2296
+ function yt(e, t) {
2297
+ let n = 0, r = -Infinity;
2298
+ for (let i of e.own) {
2299
+ let e = Math.max(i.startMs, r), a = Math.min(i.endMs, t);
2300
+ a > e && (n += a - e), r = Math.max(r, Math.min(i.endMs, t));
2301
+ }
2302
+ return n;
2303
+ }
2304
+ function bt(e, t) {
2305
+ let n = 0, r = 0, i = 0, a = 0, o = 0, s = !1, c = !1;
2306
+ for (let l of e.spans) l.startMs > t || (l.kind === "model" && i++, l.kind === "tool" && a++, !(l.endMs > t) && (it(l) && o++, l.costUsd !== void 0 && (n += l.costUsd, s = !0), (l.promptTokens !== void 0 || l.completionTokens !== void 0) && (r += (l.promptTokens ?? 0) + (l.completionTokens ?? 0), c = !0)));
2307
+ return {
2308
+ costUsd: e.costUsd === void 0 ? void 0 : s ? n : e.costUsd,
2309
+ tokens: c ? r : e.promptTokens + e.completionTokens,
2310
+ modelCalls: e.modelCalls === void 0 ? void 0 : i,
2311
+ toolCalls: e.toolCalls === void 0 ? void 0 : a,
2312
+ errors: o
2313
+ };
2314
+ }
2315
+ function xt(e, t) {
2316
+ let n = t.costBasis === "list", r = n ? "Cost · list price" : "Cost";
2317
+ if (e === void 0) return t.billedUsd === void 0 ? {
2318
+ value: "—",
2319
+ title: "No cost source: the harness recorded no cost and no price catalog was given",
2320
+ label: r
2321
+ } : {
2322
+ value: `${ot(t.billedUsd)} billed`,
2323
+ title: "No list price for these calls; billed is the seat charge",
2324
+ label: r
2325
+ };
2326
+ let i = t.costCoverage, a = i !== void 0 && i.priced < i.total, o = !a && t.costBound === "upper";
2327
+ return {
2328
+ value: `${a || t.costBound === "lower" ? "≥" : o ? "≤" : n ? "≈" : ""}${ot(e)}${t.billedUsd === void 0 ? "" : ` · ${ot(t.billedUsd)} billed`}`,
2329
+ title: [
2330
+ a ? `${i.priced} of ${i.total} model calls priced` : i ? `all ${i.total} model calls priced` : "",
2331
+ n ? "at the model catalog list price; not a bill" : "",
2332
+ o ? "cached input is not split out, so it is priced as fresh input: at most this" : "",
2333
+ t.costBound === "lower" ? "a floor: the producer reports at least this" : "",
2334
+ t.billedUsd === void 0 ? "" : `billed ${ot(t.billedUsd)} (the seat charge)`
2335
+ ].filter(Boolean).join("; "),
2336
+ label: r
2337
+ };
2338
+ }
2339
+ var St = (e) => e.replace(/[-\s]\d+$/, "");
2340
+ function Ct(e, t, n) {
2341
+ let r = e.length <= t, i = wt(e, /* @__PURE__ */ new Set()).filter((e) => e.id.startsWith("family:")).map((e) => e.id);
2342
+ return new Set(i.filter((e) => r !== n.has(e)));
2343
+ }
2344
+ function wt(e, t) {
2345
+ let n = /* @__PURE__ */ new Map();
2346
+ for (let t of e) {
2347
+ let e = t.parentId === void 0 ? `root:${t.id}` : St(t.name);
2348
+ n.set(e, [...n.get(e) ?? [], t]);
2349
+ }
2350
+ let r = [], i = 0, a = (e) => e.tone <= 0 ? e.tone : ++i;
2351
+ for (let [e, i] of n) {
2352
+ if (i.length < 2) {
2353
+ r.push(...i.map((e) => ({
2354
+ ...e,
2355
+ tone: a(e)
2356
+ })));
2357
+ continue;
2358
+ }
2359
+ let n = a(i[0]), o = `family:${e}`, s = Math.min(...i.map((e) => e.span.startMs)), c = Math.max(...i.map((e) => e.span.endMs)), l = i.some((e) => Z(e.span)), u = i.map((e) => e.span.costUsd ?? e.rollupCostUsd).filter((e) => e !== void 0), d = i.filter((e) => e.span.outcome ? e.span.outcome.tone === "failed" : !e.ok).length, f = i.every((e) => e.span.outcome && e.span.outcome.tone === i[0].span.outcome?.tone) ? i[0].span.outcome : void 0;
2360
+ r.push({
2361
+ costFloor: u.length < i.length || i.some((e) => e.costFloor),
2362
+ id: o,
2363
+ parentId: i[0].parentId,
2364
+ name: e,
2365
+ kind: "pipeline",
2366
+ durationLabel: Q(c - s),
2367
+ approx: i.some((e) => e.approx),
2368
+ ok: d === 0,
2369
+ depth: 0,
2370
+ hasChildren: !0,
2371
+ tone: n,
2372
+ descendants: i.length,
2373
+ segments: [],
2374
+ retry: !1,
2375
+ hasAgents: !1,
2376
+ own: i.flatMap((e, t) => e.own.map((e) => ({
2377
+ ...e,
2378
+ tone: n,
2379
+ alt: t % 2 == 1
2380
+ }))).sort((e, t) => e.startMs - t.startMs),
2381
+ ...u.length ? { rollupCostUsd: u.reduce((e, t) => e + t, 0) } : {},
2382
+ ...dt(i),
2383
+ span: {
2384
+ id: o,
2385
+ kind: "pipeline",
2386
+ name: e,
2387
+ startMs: s,
2388
+ endMs: c,
2389
+ status: l ? "running" : d ? "failed" : "done",
2390
+ ...f ? { outcome: f } : {},
2391
+ detail: i[0].span.detail,
2392
+ meta: {
2393
+ failedAgents: d,
2394
+ costPartial: u.length < i.length,
2395
+ members: i.map((e) => e.id)
2396
+ }
2397
+ }
2398
+ }), t.has(o) && r.push(...i.map((e, t) => ({
2399
+ ...e,
2400
+ family: o,
2401
+ inset: 1,
2402
+ tone: n,
2403
+ own: e.own.map((e) => ({
2404
+ ...e,
2405
+ tone: n,
2406
+ alt: t % 2 == 1
2407
+ }))
2408
+ })));
2409
+ }
2410
+ return r;
2411
+ }
2412
+ function Tt(e) {
2413
+ if (e.id.startsWith("family:")) {
2414
+ let t = Number(e.span.meta?.failedAgents ?? 0);
2415
+ return [`${e.descendants} agents`, ...t ? [`${t} failed`] : []];
2416
+ }
2417
+ if (e.id.startsWith("run:")) {
2418
+ let t = e.own.filter((e) => e.kind === "failed").length;
2419
+ return [t ? `${t} failed` : "all done"];
2420
+ }
2421
+ let t = e.counts?.model ?? 0, n = e.counts?.tool ?? 0;
2422
+ return [
2423
+ e.span.outcome?.label ?? (Z(e.span) ? "running" : e.ok ? e.kind === "pipeline" ? "" : "done" : "failed"),
2424
+ t ? `${t} LLM ${t === 1 ? "call" : "calls"}` : "",
2425
+ n ? `${n} tool ${n === 1 ? "call" : "calls"}` : ""
2426
+ ].filter(Boolean);
2427
+ }
2428
+ function Et(e, t, n, r) {
2429
+ let i = wt(e, n);
2430
+ if (r.size === 0) return i;
2431
+ let a = /* @__PURE__ */ new Map();
2432
+ for (let e of t) e.parentId !== void 0 && r.has(e.parentId) && e.kind !== "pipeline" && a.set(e.parentId, [...a.get(e.parentId) ?? [], e]);
2433
+ return i.flatMap((e) => r.has(e.id) ? [e, ...Dt(a.get(e.id) ?? []).map((t) => ({
2434
+ ...t,
2435
+ stepOf: e.id,
2436
+ inset: (e.inset ?? 0) + 1,
2437
+ tone: e.tone,
2438
+ own: t.own.map((t) => ({
2439
+ ...t,
2440
+ tone: e.tone
2441
+ }))
2442
+ }))] : [e]);
2443
+ }
2444
+ function Dt(e) {
2445
+ let t = [];
2446
+ for (let n = 0; n < e.length;) {
2447
+ let r = n;
2448
+ for (; r < e.length && e[r].kind === e[n].kind && e[r].name === e[n].name;) r++;
2449
+ let i = e.slice(n, r);
2450
+ if (i.length < 3) {
2451
+ t.push(...i), n = r;
2452
+ continue;
2453
+ }
2454
+ let a = i[0], o = Math.min(...i.map((e) => e.span.startMs)), s = Math.max(...i.map((e) => e.span.endMs)), c = i.filter((e) => !e.ok).length, l = i.map((e) => e.span.costUsd ?? e.rollupCostUsd).filter((e) => e !== void 0), u = a.kind === "model" ? "model calls" : a.kind === "tool" ? `${a.name} calls` : `${a.name} steps`;
2455
+ t.push({
2456
+ ...a,
2457
+ id: `run:${a.id}`,
2458
+ name: `${i.length} ${u}`,
2459
+ durationLabel: Q(s - o),
2460
+ ok: c === 0,
2461
+ hasChildren: !1,
2462
+ descendants: 0,
2463
+ segments: [],
2464
+ ...ut(i),
2465
+ tokens: ft(i),
2466
+ own: i.map((e) => ({
2467
+ startMs: e.span.startMs,
2468
+ endMs: e.span.endMs,
2469
+ kind: e.ok ? e.kind === "model" ? "model" : "tool" : "failed",
2470
+ tone: a.tone,
2471
+ id: e.id,
2472
+ count: 1,
2473
+ retry: e.retry,
2474
+ name: e.name,
2475
+ tool: nt(e.name)
2476
+ })),
2477
+ ...l.length ? { rollupCostUsd: l.reduce((e, t) => e + t, 0) } : {},
2478
+ span: {
2479
+ ...a.span,
2480
+ id: `run:${a.id}`,
2481
+ name: `${i.length} ${u}`,
2482
+ startMs: o,
2483
+ endMs: s,
2484
+ status: c ? "failed" : a.span.status,
2485
+ costUsd: void 0
2486
+ }
2487
+ }), n = r;
2488
+ }
2489
+ return t;
2490
+ }
2491
+ function Ot(e, t) {
2492
+ let n = t.find((t) => t.id === e.id);
2493
+ if (n) return n;
2494
+ let r = t.find((t) => (t.span.meta?.members)?.includes(e.id));
2495
+ return r ? {
2496
+ ...e,
2497
+ tone: r.tone
2498
+ } : e;
2499
+ }
2500
+ var kt = (e, t) => `${e.costFloor ? "≥" : ""}${ot(t)}`, $ = (e, t) => /* @__PURE__ */ (0, Y.jsx)("svg", {
2501
+ viewBox: "0 0 16 16",
2502
+ width: "14",
2503
+ height: "14",
2504
+ fill: "none",
2505
+ stroke: "currentColor",
2506
+ strokeWidth: "1.5",
2507
+ strokeLinecap: "round",
2508
+ strokeLinejoin: "round",
2509
+ "aria-hidden": !t || void 0,
2510
+ role: t ? "img" : void 0,
2511
+ "aria-label": t,
2512
+ children: e
2513
+ });
2514
+ function At(e) {
2515
+ let t = (e ?? "").toLowerCase();
2516
+ if (/bash|shell|exec|terminal|command|run/.test(t)) return $(/* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)("rect", {
2517
+ x: "2",
2518
+ y: "3",
2519
+ width: "12",
2520
+ height: "10",
2521
+ rx: "2"
2522
+ }), /* @__PURE__ */ (0, Y.jsx)("path", { d: "m5 7 2 1.5L5 10M8.5 10.5h2.5" })] }));
2523
+ if (/edit|write|patch|apply/.test(t)) return $(/* @__PURE__ */ (0, Y.jsx)("path", { d: "M3 13l1-3.5L10.5 3a1.4 1.4 0 0 1 2 2L6 11.5 3 13ZM9.5 4l2 2" }));
2524
+ if (/grep|search|find|query/.test(t)) return $(/* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)("circle", {
2525
+ cx: "7",
2526
+ cy: "7",
2527
+ r: "4.25"
2528
+ }), /* @__PURE__ */ (0, Y.jsx)("path", { d: "m10.25 10.25 3.25 3.25" })] }));
2529
+ if (/read|glob|list|ls|cat|file|view/.test(t)) return $(/* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)("path", { d: "M4 2.5h5l3 3v8H4z" }), /* @__PURE__ */ (0, Y.jsx)("path", { d: "M9 2.5v3h3M6 9h4M6 11h3" })] }));
2530
+ if (/web|fetch|http|browser|url/.test(t)) return $(/* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)("circle", {
2531
+ cx: "8",
2532
+ cy: "8",
2533
+ r: "5.5"
2534
+ }), /* @__PURE__ */ (0, Y.jsx)("path", { d: "M2.5 8h11M8 2.5c2 2 2 9 0 11M8 2.5c-2 2-2 9 0 11" })] }));
2535
+ if (/git|commit|branch|merge/.test(t)) return $(/* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [
2536
+ /* @__PURE__ */ (0, Y.jsx)("circle", {
2537
+ cx: "5",
2538
+ cy: "4",
2539
+ r: "1.5"
2540
+ }),
2541
+ /* @__PURE__ */ (0, Y.jsx)("circle", {
2542
+ cx: "5",
2543
+ cy: "12",
2544
+ r: "1.5"
2545
+ }),
2546
+ /* @__PURE__ */ (0, Y.jsx)("circle", {
2547
+ cx: "11",
2548
+ cy: "6",
2549
+ r: "1.5"
2550
+ }),
2551
+ /* @__PURE__ */ (0, Y.jsx)("path", { d: "M5 5.5v5M11 7.5c0 2-3 2-6 3" })
2552
+ ] }));
2553
+ }
2554
+ function jt({ kind: e, name: t }) {
2555
+ if (e === "tool") {
2556
+ let e = At(t);
2557
+ if (e) return e;
2558
+ }
2559
+ switch (e) {
2560
+ case "pipeline": return $(/* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [
2561
+ /* @__PURE__ */ (0, Y.jsx)("circle", {
2562
+ cx: "8",
2563
+ cy: "4",
2564
+ r: "1.75"
2565
+ }),
2566
+ /* @__PURE__ */ (0, Y.jsx)("circle", {
2567
+ cx: "4",
2568
+ cy: "12",
2569
+ r: "1.75"
2570
+ }),
2571
+ /* @__PURE__ */ (0, Y.jsx)("circle", {
2572
+ cx: "12",
2573
+ cy: "12",
2574
+ r: "1.75"
2575
+ }),
2576
+ /* @__PURE__ */ (0, Y.jsx)("path", { d: "M8 5.75v2.5M8 8.25 4.8 10.6M8 8.25l3.2 2.35" })
2577
+ ] }));
2578
+ case "model": return $(/* @__PURE__ */ (0, Y.jsx)("path", { d: "M8 2.5c.5 2.8 2.2 4.6 5 5.5-2.8.9-4.5 2.7-5 5.5-.5-2.8-2.2-4.6-5-5.5 2.8-.9 4.5-2.7 5-5.5Z" }));
2579
+ case "waiting": return $(/* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)("path", { d: "M4.5 2.5h7M4.5 13.5h7" }), /* @__PURE__ */ (0, Y.jsx)("path", { d: "M5.5 2.5c0 3 5 3 5 5.5s-5 2.5-5 5.5M10.5 2.5c0 3-5 3-5 5.5" })] }));
2580
+ case "handoff": return $(/* @__PURE__ */ (0, Y.jsx)("path", { d: "M3 3v5.5a2 2 0 0 0 2 2h8M10.5 8l2.5 2.5-2.5 2.5" }));
2581
+ default: return $(/* @__PURE__ */ (0, Y.jsx)("path", { d: "M10.2 2.8a3.2 3.2 0 0 0-4 4L2.8 10.2a1.4 1.4 0 0 0 2 2l3.4-3.4a3.2 3.2 0 0 0 4-4l-1.9 1.9-1.6-.4-.4-1.6 1.9-1.9Z" }));
2582
+ }
2583
+ }
2584
+ var Mt = () => $(/* @__PURE__ */ (0, Y.jsx)("path", { d: "m6 4 4 4-4 4" })), Nt = () => $(/* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)("circle", {
2585
+ cx: "7",
2586
+ cy: "7",
2587
+ r: "4.25"
2588
+ }), /* @__PURE__ */ (0, Y.jsx)("path", { d: "m10.25 10.25 3.25 3.25" })] })), Pt = () => /* @__PURE__ */ (0, Y.jsx)("svg", {
2589
+ viewBox: "0 0 16 16",
2590
+ width: "14",
2591
+ height: "14",
2592
+ "aria-hidden": !0,
2593
+ children: /* @__PURE__ */ (0, Y.jsx)("path", {
2594
+ d: "M4.5 3.2v9.6a.6.6 0 0 0 .9.5l7.6-4.8a.6.6 0 0 0 0-1L5.4 2.7a.6.6 0 0 0-.9.5Z",
2595
+ fill: "currentColor"
2596
+ })
2597
+ }), Ft = () => /* @__PURE__ */ (0, Y.jsxs)("svg", {
2598
+ viewBox: "0 0 16 16",
2599
+ width: "14",
2600
+ height: "14",
2601
+ "aria-hidden": !0,
2602
+ children: [/* @__PURE__ */ (0, Y.jsx)("rect", {
2603
+ x: "4",
2604
+ y: "3",
2605
+ width: "2.75",
2606
+ height: "10",
2607
+ rx: ".8",
2608
+ fill: "currentColor"
2609
+ }), /* @__PURE__ */ (0, Y.jsx)("rect", {
2610
+ x: "9.25",
2611
+ y: "3",
2612
+ width: "2.75",
2613
+ height: "10",
2614
+ rx: ".8",
2615
+ fill: "currentColor"
2616
+ })]
2617
+ }), It = () => $(/* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)("path", { d: "M3 8a5 5 0 1 0 1.5-3.55" }), /* @__PURE__ */ (0, Y.jsx)("path", { d: "M3 2.75V5.5h2.75" })] })), Lt = ({ label: e }) => $(/* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)("path", { d: "M12.5 8A4.5 4.5 0 1 1 11 4.6" }), /* @__PURE__ */ (0, Y.jsx)("path", { d: "M11.5 2v3h-3" })] }), e), Rt = ({ label: e }) => $(/* @__PURE__ */ (0, Y.jsx)("path", { d: "m4.5 4.5 7 7m0-7-7 7" }), e), zt = () => $(/* @__PURE__ */ (0, Y.jsx)("path", { d: "m4.5 4.5 7 7m0-7-7 7" })), Bt = () => $(/* @__PURE__ */ (0, Y.jsx)("path", { d: "M8 1.5v3M8 11.5v3M1.5 8h3M11.5 8h3M3.4 3.4l2.1 2.1M10.5 10.5l2.1 2.1M3.4 12.6l2.1-2.1M10.5 5.5l2.1-2.1" })), Vt = ({ label: e }) => $(/* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)("path", { d: "M8 2.5 14 13H2L8 2.5Z" }), /* @__PURE__ */ (0, Y.jsx)("path", { d: "M8 6.5v3M8 11.25v.01" })] }), e), Ht = () => $(/* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)("circle", {
2618
+ cx: "7",
2619
+ cy: "7",
2620
+ r: "4.25"
2621
+ }), /* @__PURE__ */ (0, Y.jsx)("path", { d: "m10.25 10.25 3.25 3.25M5 7h4M7 5v4" })] })), Ut = () => $(/* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)("circle", {
2622
+ cx: "7",
2623
+ cy: "7",
2624
+ r: "4.25"
2625
+ }), /* @__PURE__ */ (0, Y.jsx)("path", { d: "m10.25 10.25 3.25 3.25M5 7h4" })] })), Wt = () => $(/* @__PURE__ */ (0, Y.jsx)("path", { d: "M2.5 6V3.5a1 1 0 0 1 1-1H6M10 2.5h2.5a1 1 0 0 1 1 1V6M13.5 10v2.5a1 1 0 0 1-1 1H10M6 13.5H3.5a1 1 0 0 1-1-1V10" })), Gt = (e) => e.replace(/-/g, "‑"), Kt = {
2626
+ pipeline: "Agent",
2627
+ model: "LLM call",
2628
+ tool: "Tool call",
2629
+ waiting: "Waiting",
2630
+ handoff: "Handoff"
2631
+ }, qt = (e, t) => /* @__PURE__ */ (0, Y.jsxs)("span", {
2632
+ title: `${e.toLocaleString()} ${t}`,
2633
+ children: [
2634
+ st(e),
2635
+ " ",
2636
+ t
2637
+ ]
2638
+ }), Jt = (e, t, n = `${t}s`) => `${e.toLocaleString()} ${e === 1 ? t : n}`, Yt = (e, t) => e[Math.min(e.length - 1, Math.ceil(t * e.length) - 1)], Xt = 4;
2639
+ function Zt(e, t, n) {
2640
+ let r = e.span, i = [];
2641
+ r.detail && i.push([r.kind === "tool" ? "Provider" : "Model", r.detail]);
2642
+ let a = Z(r) ? Math.max(r.endMs, t) : r.endMs;
2643
+ i.push(["Duration", Number.isFinite(a - r.startMs) && a >= r.startMs ? Q(a - r.startMs) : "—"]), n && i.push(["Started", `+${Q(Math.max(0, r.startMs))}`]);
2644
+ let o = e.tokens;
2645
+ if (o) {
2646
+ let e = [
2647
+ ["prompt", "in"],
2648
+ ["completion", "out"],
2649
+ ["cached", "cached"]
2650
+ ].flatMap(([e, t]) => o[e] === void 0 ? [] : [qt(o[e], t)]);
2651
+ i.push(["Tokens", /* @__PURE__ */ (0, Y.jsx)("span", {
2652
+ className: "fw-card-parts",
2653
+ children: e.map((e, t) => /* @__PURE__ */ (0, Y.jsx)("span", { children: e }, t))
2654
+ })]);
2655
+ }
2656
+ let s = e.modelMs;
2657
+ s?.length && i.push(["LLM latency", /* @__PURE__ */ (0, Y.jsxs)("span", {
2658
+ className: "fw-card-parts",
2659
+ children: [/* @__PURE__ */ (0, Y.jsxs)("span", { children: [Q(Yt(s, .5)), " median"] }), s.length >= 10 && /* @__PURE__ */ (0, Y.jsxs)("span", { children: [Q(Yt(s, .95)), " p95"] })]
2660
+ })]);
2661
+ let c = r.costUsd ?? e.rollupCostUsd;
2662
+ c !== void 0 && i.push(["Cost", kt(e, c)]);
2663
+ let l = e.counts;
2664
+ if (l?.model && i.push(["LLM calls", l.model.toLocaleString()]), l?.tool) {
2665
+ let e = Object.entries(l.tools).sort(([e, t], [n, r]) => r - t || e.localeCompare(n)), t = e.length - Xt;
2666
+ i.push(["Tool calls", /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [l.tool.toLocaleString(), /* @__PURE__ */ (0, Y.jsxs)("span", {
2667
+ className: "fw-card-tools",
2668
+ title: e.map(([e, t]) => `${e} ${t}`).join(", "),
2669
+ children: [e.slice(0, t > 1 ? Xt : e.length).map(([e, t]) => /* @__PURE__ */ (0, Y.jsxs)("span", { children: [/* @__PURE__ */ (0, Y.jsx)("span", { children: e }), /* @__PURE__ */ (0, Y.jsx)("span", { children: t.toLocaleString() })] }, e)), t > 1 && /* @__PURE__ */ (0, Y.jsxs)("span", { children: [/* @__PURE__ */ (0, Y.jsxs)("span", { children: [t, " more tools"] }), /* @__PURE__ */ (0, Y.jsx)("span", { children: e.slice(Xt).reduce((e, [, t]) => e + t, 0).toLocaleString() })] })]
2670
+ })] })]);
2671
+ }
2672
+ l?.failed && i.push(["Failures", Jt(l.failed, "failed step")]);
2673
+ let u = r.marks?.filter((e) => e.kind === "restart").length ?? 0;
2674
+ (l?.retried || u) && i.push(["Retries", [l?.retried ? Jt(l.retried, "step retried", "steps retried") : "", u ? Jt(u, "restart") : ""].filter(Boolean).join(" · ")]), n && e.hasChildren && i.push(["Steps", e.descendants.toLocaleString()]);
2675
+ for (let e of r.facts ?? []) i.some(([t]) => t.toLowerCase() === e.label.toLowerCase()) || i.push([e.label, e.value]);
2676
+ return i;
2677
+ }
2678
+ function Qt({ rows: e }) {
2679
+ return /* @__PURE__ */ (0, Y.jsx)("dl", {
2680
+ className: "fw-card-table",
2681
+ children: e.map(([e, t]) => /* @__PURE__ */ (0, Y.jsxs)("div", { children: [/* @__PURE__ */ (0, Y.jsx)("dt", { children: e }), /* @__PURE__ */ (0, Y.jsx)("dd", { children: t })] }, e))
2682
+ });
2683
+ }
2684
+ function $t({ id: e, row: t, agent: n, clockMs: r, left: i, top: a, pinned: o, onClose: s, renderIcon: c, compact: l }) {
2685
+ let u = t.span, d = Z(u) ? "Running" : t.ok ? "Done" : "Failed", f = n && n.id !== t.id ? n : void 0, p = {
2686
+ id: e,
2687
+ role: o ? "dialog" : "tooltip",
2688
+ "aria-label": o ? `${u.name} details` : void 0,
2689
+ style: {
2690
+ left: i,
2691
+ top: a
2692
+ },
2693
+ onKeyDown: (e) => {
2694
+ e.key === "Escape" && (e.stopPropagation(), s());
2695
+ }
2696
+ }, m = o && /* @__PURE__ */ (0, Y.jsx)("button", {
2697
+ type: "button",
2698
+ className: "fw-icon-button fw-card-close",
2699
+ "aria-label": "Close details",
2700
+ onClick: s,
2701
+ autoFocus: !0,
2702
+ children: /* @__PURE__ */ (0, Y.jsx)(zt, {})
2703
+ });
2704
+ if (l) {
2705
+ let e = f ?? t, n = e.span.outcome, i = u.kind === "model" ? "Thinking" : Kt[u.kind], a = u.name && u.name.toLowerCase() !== i.toLowerCase() && u.name.toLowerCase() !== u.kind ? ` ${u.name}` : "", o = Z(u) ? Math.max(u.endMs, r) : u.endMs, s = f && u.endMs > u.startMs ? `${i}${a} · ${Q(o - u.startMs)}${t.ok ? "" : " · failed"}` : void 0, c = !f && u.output && u.output !== e.name ? u.output : void 0;
2706
+ return /* @__PURE__ */ (0, Y.jsxs)("div", {
2707
+ ...p,
2708
+ className: "fw-card fw-card-compact",
2709
+ "data-tone": rt(e.tone),
2710
+ "data-outcome": n?.tone,
2711
+ children: [
2712
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
2713
+ className: "fw-card-agent",
2714
+ children: [
2715
+ /* @__PURE__ */ (0, Y.jsx)("span", {
2716
+ className: "fw-agent-dot",
2717
+ "aria-hidden": !0
2718
+ }),
2719
+ /* @__PURE__ */ (0, Y.jsx)("span", {
2720
+ className: "fw-card-who",
2721
+ children: Gt(e.name)
2722
+ }),
2723
+ n ? /* @__PURE__ */ (0, Y.jsx)("span", {
2724
+ className: "fw-pill fw-pill-outcome",
2725
+ "data-tone": "0",
2726
+ "data-outcome": n.tone,
2727
+ children: n.label
2728
+ }) : /* @__PURE__ */ (0, Y.jsx)("span", {
2729
+ className: `fw-pill fw-pill-${d.toLowerCase()}`,
2730
+ children: d
2731
+ }),
2732
+ m
2733
+ ]
2734
+ }),
2735
+ /* @__PURE__ */ (0, Y.jsx)(Qt, { rows: Zt(e, r, !1) }),
2736
+ s && /* @__PURE__ */ (0, Y.jsx)("p", {
2737
+ className: "fw-card-step",
2738
+ children: s
2739
+ }),
2740
+ c && /* @__PURE__ */ (0, Y.jsx)("p", {
2741
+ className: "fw-card-result",
2742
+ children: c
2743
+ })
2744
+ ]
2745
+ });
2746
+ }
2747
+ return /* @__PURE__ */ (0, Y.jsxs)("div", {
2748
+ ...p,
2749
+ className: "fw-card",
2750
+ "data-tone": rt(t.tone),
2751
+ children: [
2752
+ f && /* @__PURE__ */ (0, Y.jsxs)("div", {
2753
+ className: "fw-card-agent",
2754
+ children: [/* @__PURE__ */ (0, Y.jsx)("span", {
2755
+ className: "fw-agent-dot",
2756
+ "aria-hidden": !0
2757
+ }), f.name]
2758
+ }),
2759
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
2760
+ className: "fw-card-head",
2761
+ children: [
2762
+ /* @__PURE__ */ (0, Y.jsx)("span", {
2763
+ className: "fw-icon-tile",
2764
+ "aria-hidden": !0,
2765
+ children: c?.(u) ?? /* @__PURE__ */ (0, Y.jsx)(jt, {
2766
+ kind: u.kind,
2767
+ name: u.name
2768
+ })
2769
+ }),
2770
+ /* @__PURE__ */ (0, Y.jsx)("div", {
2771
+ className: "fw-card-name",
2772
+ children: Gt(u.name)
2773
+ }),
2774
+ /* @__PURE__ */ (0, Y.jsx)("span", {
2775
+ className: `fw-pill fw-pill-${d.toLowerCase()}`,
2776
+ children: d
2777
+ }),
2778
+ m
2779
+ ]
2780
+ }),
2781
+ /* @__PURE__ */ (0, Y.jsx)(Qt, { rows: Zt(t, r, !0) }),
2782
+ u.input && /* @__PURE__ */ (0, Y.jsxs)("div", {
2783
+ className: "fw-card-text",
2784
+ children: [/* @__PURE__ */ (0, Y.jsx)("div", {
2785
+ className: "fw-card-label",
2786
+ children: "Input"
2787
+ }), /* @__PURE__ */ (0, Y.jsx)("p", { children: u.input })]
2788
+ }),
2789
+ u.output && /* @__PURE__ */ (0, Y.jsxs)("div", {
2790
+ className: "fw-card-text",
2791
+ children: [/* @__PURE__ */ (0, Y.jsx)("div", {
2792
+ className: "fw-card-label",
2793
+ children: t.ok ? "Output" : "Error"
2794
+ }), /* @__PURE__ */ (0, Y.jsx)("p", { children: u.output })]
2795
+ })
2796
+ ]
2797
+ });
2798
+ }
2799
+ var en = 0x9184e72a000, tn = (e, t) => ({
2800
+ "--s": e,
2801
+ "--e": Number.isFinite(t) ? t : en
2802
+ }), nn = (e, t, n) => e.length * 7 + 8 + (t ? 80 : 0) + (n ? 90 : 0);
2803
+ function rn({ mark: e, events: t, agentView: n, ending: r }) {
2804
+ let i = e.kind === "failed" ? n && !r ? null : "fail" : e.retry ? "retry" : null, a = e.kind === "model" || e.modelCall, o = a ? void 0 : e.count === 1 ? e.name : e.tool, s = Number.isFinite(e.endMs) ? Q(e.endMs - e.startMs) : "", c = [s, e.costUsd ? ot(e.costUsd) : ""].filter(Boolean).join(" · ");
2805
+ return /* @__PURE__ */ (0, Y.jsxs)("span", {
2806
+ className: `fw-seg fw-seg-${e.kind}${e.alt ? " fw-seg-alt" : ""}`,
2807
+ "data-tone": rt(e.tone),
2808
+ style: tn(e.startMs, e.endMs),
2809
+ title: e.name ? `${e.name}${e.count > 1 ? ` +${e.count - 1} more` : ""}${c ? ` · ${c}` : ""}` : void 0,
2810
+ onPointerEnter: n ? (n) => t.onInspect(e.id, n.currentTarget, n.clientX) : void 0,
2811
+ onClick: n ? (n) => {
2812
+ n.stopPropagation(), t.onPin(e.id, n.currentTarget, n.clientX);
2813
+ } : void 0,
2814
+ children: [i && /* @__PURE__ */ (0, Y.jsx)("span", {
2815
+ className: "fw-glyph",
2816
+ "data-glyph": i,
2817
+ children: i === "fail" ? /* @__PURE__ */ (0, Y.jsx)(Rt, {}) : /* @__PURE__ */ (0, Y.jsx)(Lt, {})
2818
+ }), n && /* @__PURE__ */ (0, Y.jsxs)("span", {
2819
+ className: "fw-seg-label",
2820
+ children: [
2821
+ /* @__PURE__ */ (0, Y.jsx)("span", {
2822
+ className: "fw-seg-icon",
2823
+ "aria-hidden": !0,
2824
+ children: /* @__PURE__ */ (0, Y.jsx)(jt, {
2825
+ kind: a ? "model" : "tool",
2826
+ name: e.tool ?? e.name
2827
+ })
2828
+ }),
2829
+ o && /* @__PURE__ */ (0, Y.jsx)("span", {
2830
+ className: "fw-seg-name",
2831
+ children: o
2832
+ }),
2833
+ e.count > 1 && /* @__PURE__ */ (0, Y.jsxs)("span", {
2834
+ className: "fw-seg-chip",
2835
+ children: ["×", e.count]
2836
+ }),
2837
+ s && /* @__PURE__ */ (0, Y.jsx)("span", {
2838
+ className: "fw-seg-meta",
2839
+ children: s
2840
+ }),
2841
+ e.costUsd ? /* @__PURE__ */ (0, Y.jsx)("span", {
2842
+ className: "fw-seg-meta",
2843
+ children: ot(e.costUsd)
2844
+ }) : null
2845
+ ]
2846
+ })]
2847
+ });
2848
+ }
2849
+ var an = (e, t) => Z(e.span) || e.span.startMs <= t && t < e.span.endMs;
2850
+ function on(e, t) {
2851
+ let n = e.span;
2852
+ if (e.durationLabel === "—") return "—";
2853
+ if (e.approx && n.endMs === n.startMs && !Z(n)) return n.costUsd === void 0 ? "" : kt(e, n.costUsd);
2854
+ if (!Z(n) && t < n.endMs) return `${Q(Math.max(0, t - n.startMs))}${e.approx ? "~" : ""}`;
2855
+ let r = Z(n) ? `${Q(Math.max(n.endMs, t) - n.startMs)}${e.approx ? "~" : ""}` : e.durationLabel, i = n.costUsd ?? (e.rollupCostUsd ? e.rollupCostUsd : void 0);
2856
+ return i === void 0 ? r : `${r} · ${kt(e, i)}`;
2857
+ }
2858
+ var sn = (0, X.memo)(function(e) {
2859
+ let { row: t, view: n, top: r, collapsed: i, searching: a, slowest: o, costliest: s, critical: c, matched: l, active: u, focusable: d, selected: f, sticky: p, clockMs: m, renderIcon: h, fillByAgent: g, motion: _ } = e, v = t.span, y = Z(v), b = n === "agents", x = t.hasChildren && i && !a, S = t.durationLabel === "—", C = t.kind === "pipeline", w = t.ok ? t.kind : "failed", T = C || t.hasChildren || t.id.startsWith("run:") ? x && !b ? t.segments : t.own : [], E = on(t, m), D = [...v.detail && v.detail !== e.sharedDetail ? [v.detail] : [], ...Tt(t).filter((t) => t !== e.sharedOutcome)], O = (n) => e.onInspect(t.id, n.currentTarget, n.clientX), k = b && t.id.startsWith("family:"), A = b && t.stepOf !== void 0, j = k || b && C && t.own.length > 0, M = b && !t.ok ? T.map((e) => e.kind).lastIndexOf("failed") : -1;
2860
+ return /* @__PURE__ */ (0, Y.jsxs)("div", {
2861
+ role: "row",
2862
+ "data-span-id": t.id,
2863
+ "data-span-kind": w,
2864
+ "data-slowest": o || void 0,
2865
+ "data-critical": c || void 0,
2866
+ "data-search": a ? l ? "match" : "context" : void 0,
2867
+ "data-running": y || void 0,
2868
+ "aria-level": b ? void 0 : t.depth + 1,
2869
+ "aria-expanded": t.hasChildren && !b ? !x : void 0,
2870
+ "aria-selected": f,
2871
+ tabIndex: d ? 0 : -1,
2872
+ "data-tone": rt(t.tone),
2873
+ "data-outcome": g ? void 0 : v.outcome?.tone,
2874
+ className: `fw-row${u ? " fw-active" : ""}${p ? " fw-sticky-row" : ""}${C ? " fw-agent-row" : ""}${A ? " fw-step" : ""}${_?.enter === void 0 ? "" : " fw-enter"}${_?.settle ? " fw-settle" : ""}`,
2875
+ style: {
2876
+ "--row-y": `${r}px`,
2877
+ "--fw-enter-delay": `${_?.enter ?? 0}ms`,
2878
+ "--fw-end-w": `${nn(E, o, s)}px`
2879
+ },
2880
+ onFocus: (n) => {
2881
+ n.target === n.currentTarget && e.onActivate(t);
2882
+ },
2883
+ onClick: (n) => {
2884
+ if (e.onActivate(t), k) {
2885
+ e.onToggle(t);
2886
+ return;
2887
+ }
2888
+ let r = b ? n.currentTarget.querySelector(".fw-bar") : null;
2889
+ r && e.onPin(t.id, r, n.target instanceof Element && n.target.closest(".fw-lane") ? n.clientX : void 0);
2890
+ },
2891
+ children: [/* @__PURE__ */ (0, Y.jsxs)("div", {
2892
+ role: "gridcell",
2893
+ className: "fw-label",
2894
+ style: { "--depth": b ? t.inset ?? 0 : t.depth },
2895
+ children: [
2896
+ j && /* @__PURE__ */ (0, Y.jsx)("button", {
2897
+ type: "button",
2898
+ tabIndex: -1,
2899
+ className: `fw-toggle${e.expanded ? " fw-open" : ""}`,
2900
+ "aria-label": `${e.expanded ? "Collapse" : "Expand"} ${t.name}`,
2901
+ "aria-expanded": !!e.expanded,
2902
+ onClick: (n) => {
2903
+ n.stopPropagation(), e.onToggle(t);
2904
+ },
2905
+ children: /* @__PURE__ */ (0, Y.jsx)(Mt, {})
2906
+ }),
2907
+ !b && /* @__PURE__ */ (0, Y.jsx)("span", {
2908
+ className: "fw-guides",
2909
+ "aria-hidden": !0
2910
+ }),
2911
+ !b && (t.hasChildren ? /* @__PURE__ */ (0, Y.jsx)("button", {
2912
+ type: "button",
2913
+ tabIndex: -1,
2914
+ className: `fw-toggle${x ? "" : " fw-open"}`,
2915
+ disabled: a,
2916
+ "aria-label": `${x ? "Expand" : "Collapse"} ${t.name}`,
2917
+ "aria-expanded": !x,
2918
+ onClick: (n) => {
2919
+ n.stopPropagation(), e.onToggle(t);
2920
+ },
2921
+ children: /* @__PURE__ */ (0, Y.jsx)(Mt, {})
2922
+ }) : /* @__PURE__ */ (0, Y.jsx)("span", {
2923
+ className: "fw-toggle-space",
2924
+ "aria-hidden": !0
2925
+ })),
2926
+ b && !j && /* @__PURE__ */ (0, Y.jsx)("span", {
2927
+ className: "fw-toggle-space",
2928
+ "aria-hidden": !0
2929
+ }),
2930
+ (!b || A) && /* @__PURE__ */ (0, Y.jsx)("span", {
2931
+ className: "fw-icon-tile",
2932
+ "aria-hidden": !0,
2933
+ children: h?.(v) ?? /* @__PURE__ */ (0, Y.jsx)(jt, {
2934
+ kind: v.kind,
2935
+ name: v.name
2936
+ })
2937
+ }),
2938
+ /* @__PURE__ */ (0, Y.jsxs)("span", {
2939
+ className: "fw-names",
2940
+ title: `${t.name}${v.detail ? ` · ${v.detail}` : ""} · ${Kt[v.kind]}${y ? " · running" : ""}${t.ok ? "" : " · failed"}`,
2941
+ children: [/* @__PURE__ */ (0, Y.jsxs)("span", {
2942
+ className: `fw-span-name${C || t.hasChildren ? " fw-strong" : ""}`,
2943
+ children: [
2944
+ g && C && v.outcome ? /* @__PURE__ */ (0, Y.jsx)("span", {
2945
+ className: "fw-agent-dot",
2946
+ "data-tone": "0",
2947
+ "data-outcome": v.outcome.tone,
2948
+ title: v.outcome.label,
2949
+ "aria-hidden": !0
2950
+ }) : b && !A && /* @__PURE__ */ (0, Y.jsx)("span", {
2951
+ className: "fw-agent-dot",
2952
+ "aria-hidden": !0
2953
+ }),
2954
+ y && /* @__PURE__ */ (0, Y.jsx)("span", {
2955
+ className: "fw-spinner",
2956
+ role: "status",
2957
+ "aria-label": "running"
2958
+ }),
2959
+ /* @__PURE__ */ (0, Y.jsx)("span", {
2960
+ className: "fw-name-text",
2961
+ children: t.name
2962
+ })
2963
+ ]
2964
+ }), b && /* @__PURE__ */ (0, Y.jsxs)("span", {
2965
+ className: "fw-subtitle",
2966
+ children: [h && /* @__PURE__ */ (0, Y.jsx)("span", {
2967
+ className: "fw-detail-icon",
2968
+ "aria-hidden": !0,
2969
+ children: h(v)
2970
+ }), /* @__PURE__ */ (0, Y.jsxs)("span", {
2971
+ className: "fw-subtitle-tail",
2972
+ children: [/* @__PURE__ */ (0, Y.jsx)("span", {
2973
+ className: "fw-subtitle-text",
2974
+ children: D[0]
2975
+ }), D.slice(1).map((e) => /* @__PURE__ */ (0, Y.jsxs)("span", {
2976
+ className: "fw-subtitle-extra",
2977
+ children: ["· ", e]
2978
+ }, e))]
2979
+ })]
2980
+ })]
2981
+ }),
2982
+ x && /* @__PURE__ */ (0, Y.jsxs)("span", {
2983
+ className: "fw-count",
2984
+ "aria-label": `${t.descendants} hidden steps`,
2985
+ children: ["+", t.descendants]
2986
+ }),
2987
+ k && !e.expanded && /* @__PURE__ */ (0, Y.jsxs)("span", {
2988
+ className: "fw-count",
2989
+ "aria-label": `${t.descendants} agents folded`,
2990
+ children: ["+", t.descendants]
2991
+ }),
2992
+ !t.ok && !b && /* @__PURE__ */ (0, Y.jsx)("span", {
2993
+ className: "fw-alert",
2994
+ children: /* @__PURE__ */ (0, Y.jsx)(Vt, { label: "failed" })
2995
+ })
2996
+ ]
2997
+ }), /* @__PURE__ */ (0, Y.jsx)("div", {
2998
+ role: "gridcell",
2999
+ className: "fw-lane",
3000
+ "data-waterfall-track": !0,
3001
+ "aria-label": `${Kt[v.kind]}, ${E}${o ? `, slowest ${b ? "agent" : "step"}` : ""}${s ? ", costliest agent" : ""}${c ? ", critical path" : ""}`,
3002
+ children: S ? /* @__PURE__ */ (0, Y.jsx)("span", {
3003
+ className: "fw-invalid",
3004
+ children: "—"
3005
+ }) : /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [
3006
+ v.marks?.map((e) => /* @__PURE__ */ (0, Y.jsx)("span", {
3007
+ className: "fw-mark",
3008
+ "data-mark": e.kind,
3009
+ style: tn(e.at, e.at),
3010
+ title: e.label,
3011
+ "aria-label": e.label,
3012
+ role: "img"
3013
+ }, `m-${e.at}-${e.label}`)),
3014
+ /* @__PURE__ */ (0, Y.jsxs)("span", {
3015
+ className: `fw-bar fw-k-${C ? "pipeline" : w}${t.approx ? " fw-approx" : ""}${T.length ? " fw-has-marks" : ""}${t.hasAgents ? " fw-has-agents" : ""}`,
3016
+ "data-tone": rt(t.tone),
3017
+ style: tn(v.startMs, y ? en : v.endMs),
3018
+ onPointerEnter: O,
3019
+ onPointerLeave: e.onLeave,
3020
+ onClick: (n) => {
3021
+ n.stopPropagation(), k ? e.onToggle(t) : e.onPin(t.id, n.currentTarget, n.clientX);
3022
+ },
3023
+ children: [!C && !t.ok && /* @__PURE__ */ (0, Y.jsx)("span", {
3024
+ className: "fw-glyph",
3025
+ children: /* @__PURE__ */ (0, Y.jsx)(Rt, {})
3026
+ }), !C && t.ok && t.retry && /* @__PURE__ */ (0, Y.jsx)("span", {
3027
+ className: "fw-glyph",
3028
+ children: /* @__PURE__ */ (0, Y.jsx)(Lt, {})
3029
+ })]
3030
+ }),
3031
+ T.map((t, n) => /* @__PURE__ */ (0, Y.jsx)(rn, {
3032
+ mark: t,
3033
+ events: e,
3034
+ agentView: b,
3035
+ ending: n === M
3036
+ }, `${t.id}-${n}`)),
3037
+ /* @__PURE__ */ (0, Y.jsxs)("span", {
3038
+ className: "fw-end",
3039
+ style: tn(v.startMs, y ? en : v.endMs),
3040
+ children: [
3041
+ /* @__PURE__ */ (0, Y.jsx)("span", {
3042
+ className: "fw-duration",
3043
+ children: E
3044
+ }),
3045
+ o && /* @__PURE__ */ (0, Y.jsx)("span", {
3046
+ className: "fw-badge",
3047
+ children: "Slowest"
3048
+ }),
3049
+ s && /* @__PURE__ */ (0, Y.jsx)("span", {
3050
+ className: "fw-badge",
3051
+ children: "Costliest"
3052
+ })
3053
+ ]
3054
+ })
3055
+ ] })
3056
+ })]
3057
+ });
3058
+ }, (e, t) => e.row === t.row && e.view === t.view && e.top === t.top && e.collapsed === t.collapsed && e.searching === t.searching && e.slowest === t.slowest && e.costliest === t.costliest && e.critical === t.critical && e.matched === t.matched && e.active === t.active && e.focusable === t.focusable && e.selected === t.selected && e.sticky === t.sticky && e.motion === t.motion && e.renderIcon === t.renderIcon && e.fillByAgent === t.fillByAgent && e.sharedDetail === t.sharedDetail && e.sharedOutcome === t.sharedOutcome && e.expanded === t.expanded && (e.clockMs === t.clockMs || !an(e.row, e.clockMs) && !an(t.row, t.clockMs)));
3059
+ function cn({ link: e, rowHeight: t, hot: n }) {
3060
+ let r = Math.min(e.from, e.to), i = Math.max(e.from, e.to), a = {
3061
+ ...tn(e.atMs, e.atMs),
3062
+ top: r * t + t / 2 + 5,
3063
+ height: (i - r) * t - 5
3064
+ };
3065
+ return /* @__PURE__ */ (0, Y.jsx)("span", {
3066
+ className: `fw-link fw-link-${e.dir}${n ? " fw-link-hot" : ""}`,
3067
+ "data-tone": rt(e.tone),
3068
+ style: a,
3069
+ "aria-hidden": !0
3070
+ });
3071
+ }
3072
+ var ln = 700, un = 20, dn = 200;
3073
+ function fn(e) {
3074
+ let t = (0, X.useRef)(null), n = (0, X.useRef)(/* @__PURE__ */ new Set()), r = (0, X.useRef)(/* @__PURE__ */ new Map()), [i, a] = (0, X.useState)(0), o = (0, X.useMemo)(() => {
3075
+ let i = Date.now();
3076
+ for (let [e, t] of r.current) t.until <= i && r.current.delete(e);
3077
+ let a = t.current, o = 0;
3078
+ for (let t of e) {
3079
+ let e = Z(t.span);
3080
+ !a || !a.has(t.id) ? r.current.set(t.id, {
3081
+ enter: Math.min(o++ * un, dn),
3082
+ until: i + ln + dn
3083
+ }) : n.current.has(t.id) && !e && r.current.set(t.id, {
3084
+ settle: !0,
3085
+ until: i + ln
3086
+ });
3087
+ }
3088
+ return t.current = new Set(e.map((e) => e.id)), n.current = new Set(e.filter((e) => Z(e.span)).map((e) => e.id)), new Map(r.current);
3089
+ }, [e, i]);
3090
+ return (0, X.useEffect)(() => {
3091
+ if (o.size === 0) return;
3092
+ let e = setTimeout(() => a((e) => e + 1), 920);
3093
+ return () => clearTimeout(e);
3094
+ }, [o]), o;
3095
+ }
3096
+ var pn = [
3097
+ 1,
3098
+ 2,
3099
+ 5,
3100
+ 10,
3101
+ 20,
3102
+ 50,
3103
+ 100,
3104
+ 200,
3105
+ 500,
3106
+ 1e3,
3107
+ 2e3,
3108
+ 5e3,
3109
+ 1e4,
3110
+ 15e3,
3111
+ 3e4,
3112
+ 6e4,
3113
+ 12e4,
3114
+ 3e5,
3115
+ 6e5,
3116
+ 9e5,
3117
+ 18e5,
3118
+ 36e5,
3119
+ 72e5,
3120
+ 108e5,
3121
+ 216e5,
3122
+ 432e5,
3123
+ 864e5
3124
+ ];
3125
+ function mn(e, t = 72) {
3126
+ let n = e * t;
3127
+ return pn.find((e) => e >= n) ?? Math.ceil(n / 864e5) * 864e5;
3128
+ }
3129
+ function hn(e, t, n, r = 72) {
3130
+ if (!(n > 0) || !(t > e)) return [0];
3131
+ let i = mn((t - e) / n, r), a = [];
3132
+ for (let n = Math.ceil(e / i) * i; n <= t && a.length < 400; n += i) a.push(n);
3133
+ return a;
3134
+ }
3135
+ function gn(e) {
3136
+ if (e === 0) return "0s";
3137
+ if (e < 1e3) return `${Math.round(e)}ms`;
3138
+ if (e < 6e4) return `${+(e / 1e3).toFixed(1)}s`;
3139
+ if (e < 36e5) {
3140
+ let t = Math.floor(e / 6e4), n = Math.round(e % 6e4 / 1e3);
3141
+ return n ? `${t}m ${n}s` : `${t}m`;
3142
+ }
3143
+ let t = Math.floor(e / 36e5), n = Math.round(e % 36e5 / 6e4);
3144
+ return n ? `${t}h ${n}m` : `${t}h`;
3145
+ }
3146
+ function _n(e, t, n, r) {
3147
+ let i = e.endMs - e.startMs, a = Math.min(Math.max(50, i * t), Math.max(r, 50)), o = i > 0 ? (n - e.startMs) / i : .5;
3148
+ return vn({
3149
+ startMs: n - o * a,
3150
+ endMs: n - o * a + a
3151
+ }, r);
3152
+ }
3153
+ function vn(e, t) {
3154
+ let n = e.endMs - e.startMs, r = Math.max(0, e.startMs);
3155
+ return r + n > t && (r = Math.max(0, t - n)), {
3156
+ startMs: r,
3157
+ endMs: r + n
3158
+ };
3159
+ }
3160
+ var yn = {
3161
+ spans: 36,
3162
+ agents: 40
3163
+ }, bn = 8, xn = 4, Sn = 3;
3164
+ function Cn(e, t, n) {
3165
+ let r = new Map(e.map((e, t) => [e.id, t])), i = (i) => {
3166
+ let a = i.parentId;
3167
+ for (; a !== void 0;) {
3168
+ let i = r.get(a);
3169
+ if (i !== void 0 && (n === "spans" || e[i].kind === "pipeline")) return i;
3170
+ a = t.get(a)?.parentId;
3171
+ }
3172
+ }, a = [], o = /* @__PURE__ */ new Set();
3173
+ for (let t of e) {
3174
+ let n = t.span.handoffTo === void 0 ? void 0 : r.get(t.span.handoffTo), s = t.kind === "pipeline" ? r.get(t.id) : i(t);
3175
+ n !== void 0 && s !== void 0 && n !== s && (o.add(e[n].id), a.push({
3176
+ id: `h-${t.id}`,
3177
+ from: s,
3178
+ to: n,
3179
+ atMs: t.span.startMs,
3180
+ tone: e[n].tone,
3181
+ dir: n > s ? "down" : "up"
3182
+ }));
3183
+ }
3184
+ for (let [t, r] of e.entries()) {
3185
+ if (r.kind !== "pipeline" || r.parentId === void 0) continue;
3186
+ let e = i(r);
3187
+ e !== void 0 && (o.has(r.id) || a.push({
3188
+ id: `s-${r.id}`,
3189
+ from: e,
3190
+ to: t,
3191
+ atMs: r.span.startMs,
3192
+ tone: r.tone,
3193
+ dir: "down"
3194
+ }), n === "agents" && !Z(r.span) && Number.isFinite(r.span.endMs) && a.push({
3195
+ id: `r-${r.id}`,
3196
+ from: t,
3197
+ to: e,
3198
+ atMs: r.span.endMs,
3199
+ tone: r.tone,
3200
+ dir: "up"
3201
+ }));
3202
+ }
3203
+ return a;
3204
+ }
3205
+ function wn(e) {
3206
+ let { rows: t, view: n, maxHeight: r, collapsed: i, searching: a, slowestId: o, activeId: s, selectedId: c, clockMs: l, window: u, trackPx: d, showCursor: f, zoomed: p } = e, m = yn[n], h = (0, X.useRef)(null), g = (0, X.useRef)(null), [_, v] = (0, X.useState)(0), [y, b] = (0, X.useState)(r), x = (0, X.useRef)(e);
3207
+ x.current = e;
3208
+ let S = (0, X.useRef)(0);
3209
+ e.holdHeight || (S.current = 0);
3210
+ let C = S.current = Math.max(S.current, Math.min(r, Math.max(t.length, 1) * m)), w = (0, X.useMemo)(() => Cn(t, e.byId, n), [
3211
+ t,
3212
+ e.byId,
3213
+ n
3214
+ ]), T = (0, X.useMemo)(() => a ? mt(t, e.query, e.matchSpan) : void 0, [
3215
+ a,
3216
+ t,
3217
+ e.query,
3218
+ e.matchSpan
3219
+ ]), E = (0, X.useMemo)(() => new Map(t.map((e, t) => [e.id, t])), [t]), D = fn(t), [O, k] = (0, X.useState)(), A = (u.endMs - u.startMs) / Math.max(1, d), j = u.startMs + (d + (n === "spans" ? 72 : 0)) * A, M = hn(u.startMs, j, Math.max(1, d + (n === "spans" ? 72 : 0))), N = (0, X.useMemo)(() => {
3220
+ let t = /* @__PURE__ */ new Map();
3221
+ if (n === "agents") return t;
3222
+ let r = -Infinity;
3223
+ for (let n of [...e.markers ?? []].sort((e, t) => e.at - t.at)) {
3224
+ let e = (n.at - u.startMs) / A, i = n.label.length * 7 + 16, a = e + i > d ? "left" : "right", o = a === "right" ? e : e - i;
3225
+ e < 0 || e > d || o < r || (t.set(n, a), r = o + i + 8);
3226
+ }
3227
+ return t;
3228
+ }, [
3229
+ e.markers,
3230
+ u.startMs,
3231
+ A,
3232
+ d,
3233
+ n
3234
+ ]);
3235
+ (0, X.useEffect)(() => {
3236
+ let e = h.current;
3237
+ if (!e) return;
3238
+ let t = new ResizeObserver(() => b(e.clientHeight));
3239
+ return t.observe(e), () => t.disconnect();
3240
+ }, []), (0, X.useEffect)(() => {
3241
+ let e = g.current;
3242
+ if (!e) return;
3243
+ let t = (t) => {
3244
+ let { window: n, trackPx: r, zoomed: i } = x.current, a = e.querySelector("[data-fw-track]");
3245
+ if (!a) return;
3246
+ let o = a.getBoundingClientRect(), s = (n.endMs - n.startMs) / Math.max(1, r);
3247
+ if (t.ctrlKey || t.metaKey) {
3248
+ t.preventDefault();
3249
+ let e = n.startMs + (t.clientX - o.left - 12) * s;
3250
+ x.current.onZoom(Math.exp(t.deltaY * .0025), e);
3251
+ } else i && (t.shiftKey || Math.abs(t.deltaX) > Math.abs(t.deltaY)) && (t.preventDefault(), x.current.onPan((t.shiftKey ? t.deltaY : t.deltaX) * s));
3252
+ };
3253
+ return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
3254
+ }, []);
3255
+ let F = Math.max(0, _ * xn - bn), I = Math.min(t.length, _ * xn + Math.ceil(y / m) + xn + bn), L = (e, r) => {
3256
+ let i = (n === "spans" ? Math.min(Sn, t[e].depth) : 0) * m;
3257
+ e * m - i < r.scrollTop ? r.scrollTop = Math.max(0, e * m - i) : (e + 1) * m > r.scrollTop + r.clientHeight && (r.scrollTop = (e + 1) * m - r.clientHeight);
3258
+ }, ee = (0, X.useRef)(void 0);
3259
+ (0, X.useEffect)(() => {
3260
+ if (!c || c === ee.current) return;
3261
+ let e = E.get(c);
3262
+ e !== void 0 && h.current && (ee.current = c, L(e, h.current));
3263
+ });
3264
+ let R = (t) => {
3265
+ let n = E.get(t), r = h.current;
3266
+ n !== void 0 && r && (L(n, r), e.onActiveChange(t), requestAnimationFrame(() => r.querySelector(`.fw-canvas [data-span-id="${CSS.escape(t)}"]`)?.focus({ preventScroll: !0 })));
3267
+ }, z = (r) => {
3268
+ let o = E.get(s ?? "") ?? 0, c = t[o];
3269
+ if (!c) return;
3270
+ let l = Math.max(1, Math.floor(y / m) - 1), u = (e) => {
3271
+ r.preventDefault(), R(t[Math.max(0, Math.min(t.length - 1, e))].id);
3272
+ }, d = i.has(c.id) && !a;
3273
+ switch (r.key) {
3274
+ case "ArrowDown": return u(o + 1);
3275
+ case "ArrowUp": return u(o - 1);
3276
+ case "PageDown": return u(o + l);
3277
+ case "PageUp": return u(o - l);
3278
+ case "Home": return u(0);
3279
+ case "End": return u(t.length - 1);
3280
+ case "ArrowRight":
3281
+ n === "spans" && c.hasChildren && d || n === "agents" && c.hasChildren ? (r.preventDefault(), e.onToggle(c)) : c.hasChildren && u(o + 1);
3282
+ return;
3283
+ case "ArrowLeft":
3284
+ n === "spans" && c.hasChildren && !d ? (r.preventDefault(), e.onToggle(c)) : c.parentId !== void 0 && E.has(c.parentId) && u(E.get(c.parentId));
3285
+ return;
3286
+ case "Enter":
3287
+ case " ": {
3288
+ r.preventDefault();
3289
+ let t = h.current?.querySelector(`[data-span-id="${CSS.escape(c.id)}"] .fw-bar`);
3290
+ t && e.onPin(c.id, t);
3291
+ }
3292
+ }
3293
+ }, B = /* @__PURE__ */ (0, Y.jsxs)("div", {
3294
+ className: "fw-axis fw-axis-top",
3295
+ children: [/* @__PURE__ */ (0, Y.jsxs)("div", {
3296
+ className: "fw-axis-label",
3297
+ children: [n === "spans" && /* @__PURE__ */ (0, Y.jsx)(Y.Fragment, { children: e.onExpandAll && /* @__PURE__ */ (0, Y.jsxs)("span", {
3298
+ className: "fw-branch-controls",
3299
+ children: [/* @__PURE__ */ (0, Y.jsx)("button", {
3300
+ type: "button",
3301
+ className: "fw-text-button",
3302
+ onClick: e.onExpandAll,
3303
+ children: "Expand all"
3304
+ }), /* @__PURE__ */ (0, Y.jsx)("button", {
3305
+ type: "button",
3306
+ className: "fw-text-button",
3307
+ onClick: e.onCollapseAll,
3308
+ children: "Collapse all"
3309
+ })]
3310
+ }) }), /* @__PURE__ */ (0, Y.jsx)("span", {
3311
+ role: "separator",
3312
+ "aria-orientation": "vertical",
3313
+ "aria-label": "Resize the step column",
3314
+ tabIndex: 0,
3315
+ className: "fw-resize",
3316
+ "aria-valuenow": Math.round(e.nameWidth),
3317
+ "aria-valuemin": 140,
3318
+ "aria-valuemax": 560,
3319
+ onPointerDown: (t) => {
3320
+ let n = t.currentTarget, r = t.clientX, i = e.nameWidth;
3321
+ n.setPointerCapture(t.pointerId);
3322
+ let a = (t) => e.onNameWidth(i + t.clientX - r), o = () => {
3323
+ n.removeEventListener("pointermove", a), n.removeEventListener("pointerup", o);
3324
+ };
3325
+ n.addEventListener("pointermove", a), n.addEventListener("pointerup", o);
3326
+ },
3327
+ onKeyDown: (t) => {
3328
+ (t.key === "ArrowLeft" || t.key === "ArrowRight") && (t.preventDefault(), e.onNameWidth(e.nameWidth + (t.key === "ArrowLeft" ? -16 : 16)));
3329
+ }
3330
+ })]
3331
+ }), /* @__PURE__ */ (0, Y.jsxs)("div", {
3332
+ className: "fw-axis-track",
3333
+ "data-fw-track": !0,
3334
+ ref: e.onTrack,
3335
+ onPointerDown: (t) => {
3336
+ let n = t.currentTarget, r = n.getBoundingClientRect(), i = (e) => Math.max(0, u.startMs + (e - r.left - 12) * (u.endMs - u.startMs) / Math.max(1, d));
3337
+ e.onScrub(i(t.clientX)), n.setPointerCapture(t.pointerId);
3338
+ let a = (t) => e.onScrub(i(t.clientX)), o = () => {
3339
+ n.removeEventListener("pointermove", a), n.removeEventListener("pointerup", o);
3340
+ };
3341
+ n.addEventListener("pointermove", a), n.addEventListener("pointerup", o);
3342
+ },
3343
+ title: "Drag to scrub",
3344
+ children: [
3345
+ M.map((e) => /* @__PURE__ */ (0, Y.jsx)("span", {
3346
+ className: "fw-tick",
3347
+ style: { "--s": e },
3348
+ children: gn(e)
3349
+ }, e)),
3350
+ e.markers?.map((t) => /* @__PURE__ */ (0, Y.jsx)("button", {
3351
+ type: "button",
3352
+ className: "fw-event",
3353
+ "data-tone": t.tone ?? "neutral",
3354
+ style: { "--s": t.at },
3355
+ title: t.kind ? `${t.kind}: ${t.label}` : t.label,
3356
+ "aria-label": `Jump to ${t.kind ? `${t.kind} ` : ""}${t.label}`,
3357
+ "aria-pressed": O === t,
3358
+ onPointerDown: (e) => e.stopPropagation(),
3359
+ onClick: () => {
3360
+ if (O === t) {
3361
+ k(void 0);
3362
+ return;
3363
+ }
3364
+ k(t), e.onScrub(t.at);
3365
+ }
3366
+ }, `e-${t.at}-${t.label}`)),
3367
+ e.pauses?.map((e) => {
3368
+ let t = `${e.label} ${P(e.endMs - e.startMs)}${e.detail ? `: ${e.detail}` : ""}`;
3369
+ return /* @__PURE__ */ (0, Y.jsx)("span", {
3370
+ className: "fw-pause-mark",
3371
+ style: {
3372
+ "--s": e.startMs,
3373
+ "--e": e.endMs
3374
+ },
3375
+ title: t,
3376
+ "aria-label": t,
3377
+ role: "img",
3378
+ tabIndex: 0,
3379
+ onPointerDown: (e) => e.stopPropagation()
3380
+ }, `pm-${e.startMs}`);
3381
+ }),
3382
+ O && /* @__PURE__ */ (0, Y.jsx)("span", {
3383
+ className: "fw-event-label",
3384
+ "data-tone": O.tone ?? "neutral",
3385
+ style: { "--s": O.at },
3386
+ children: O.label
3387
+ }),
3388
+ f && /* @__PURE__ */ (0, Y.jsx)("span", {
3389
+ className: "fw-cursor-handle",
3390
+ "aria-hidden": !0
3391
+ })
3392
+ ]
3393
+ })]
3394
+ }), V = (t, r, u = !1) => /* @__PURE__ */ (0, Y.jsx)(sn, {
3395
+ row: t,
3396
+ view: n,
3397
+ top: r * m,
3398
+ collapsed: i.has(t.id),
3399
+ searching: a,
3400
+ slowest: t.id === o,
3401
+ costliest: t.id === e.costliestId,
3402
+ critical: e.criticalIds?.has(t.id),
3403
+ matched: T?.has(t.id),
3404
+ active: t.id === s,
3405
+ focusable: !u && (t.id === s || (s === void 0 || !E.has(s)) && r === 0),
3406
+ selected: t.id === c,
3407
+ sticky: u,
3408
+ motion: u ? void 0 : D.get(t.id),
3409
+ clockMs: l,
3410
+ renderIcon: e.renderIcon,
3411
+ fillByAgent: e.fillByAgent,
3412
+ sharedDetail: e.sharedDetail,
3413
+ sharedOutcome: e.sharedOutcome,
3414
+ expanded: e.expandedIds?.has(t.id),
3415
+ onToggle: e.onToggle,
3416
+ onInspect: e.onInspect,
3417
+ onLeave: e.onLeave,
3418
+ onPin: e.onPin,
3419
+ onActivate: (t) => e.onActiveChange(t.id)
3420
+ }, u ? `sticky-${t.id}` : t.id);
3421
+ return /* @__PURE__ */ (0, Y.jsxs)("div", {
3422
+ className: `fw-body fw-view-${n}${p ? " fw-zoomed" : ""}`,
3423
+ ref: g,
3424
+ children: [B, /* @__PURE__ */ (0, Y.jsxs)("div", {
3425
+ className: "fw-viewport",
3426
+ children: [
3427
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
3428
+ className: "fw-gridlayer",
3429
+ "aria-hidden": !0,
3430
+ children: [
3431
+ e.pauses?.map((e) => /* @__PURE__ */ (0, Y.jsx)("span", {
3432
+ className: "fw-pause",
3433
+ style: {
3434
+ "--s": e.startMs,
3435
+ "--e": e.endMs
3436
+ }
3437
+ }, `p-${e.startMs}`)),
3438
+ M.map((e) => /* @__PURE__ */ (0, Y.jsx)("span", {
3439
+ className: "fw-gridline",
3440
+ style: { "--s": e }
3441
+ }, e)),
3442
+ e.markers?.map((e) => /* @__PURE__ */ (0, Y.jsx)("span", {
3443
+ className: "fw-marker-line",
3444
+ "data-tone": e.tone ?? "neutral",
3445
+ style: { "--s": e.at }
3446
+ }, `l-${e.at}-${e.label}`))
3447
+ ]
3448
+ }),
3449
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
3450
+ ref: h,
3451
+ role: "treegrid",
3452
+ "aria-label": "Trace timeline",
3453
+ "aria-rowcount": t.length,
3454
+ "aria-multiselectable": !1,
3455
+ tabIndex: -1,
3456
+ className: "fw-scroller",
3457
+ "data-primary-content": "",
3458
+ style: {
3459
+ height: C,
3460
+ maxHeight: r
3461
+ },
3462
+ onKeyDown: z,
3463
+ onScroll: (e) => {
3464
+ let t = Math.floor(e.currentTarget.scrollTop / m / xn);
3465
+ t !== _ && v(t);
3466
+ },
3467
+ children: [/* @__PURE__ */ (0, Y.jsxs)("div", {
3468
+ className: "fw-canvas",
3469
+ style: { height: t.length * m },
3470
+ children: [/* @__PURE__ */ (0, Y.jsx)("div", {
3471
+ className: "fw-links",
3472
+ "aria-hidden": !0,
3473
+ children: w.filter((e) => Math.max(e.from, e.to) >= F && Math.min(e.from, e.to) <= I).map((n) => /* @__PURE__ */ (0, Y.jsx)(cn, {
3474
+ link: n,
3475
+ rowHeight: m,
3476
+ hot: e.focusId !== void 0 && (t[n.from]?.id === e.focusId || t[n.to]?.id === e.focusId)
3477
+ }, n.id))
3478
+ }), t.slice(F, I).map((e, t) => V(e, F + t))]
3479
+ }), t.length === 0 && /* @__PURE__ */ (0, Y.jsx)("p", {
3480
+ role: "status",
3481
+ className: "fw-empty",
3482
+ children: e.emptyText
3483
+ })]
3484
+ }),
3485
+ n === "spans" && /* @__PURE__ */ (0, Y.jsx)(Tn, {
3486
+ scroller: h,
3487
+ rows: t,
3488
+ index: E,
3489
+ rowHeight: m,
3490
+ render: V
3491
+ }),
3492
+ e.markers?.length ? /* @__PURE__ */ (0, Y.jsx)("div", {
3493
+ className: "fw-marker-layer",
3494
+ children: e.markers.map((e) => /* @__PURE__ */ (0, Y.jsx)("span", {
3495
+ className: "fw-marker",
3496
+ "data-tone": e.tone ?? "neutral",
3497
+ style: { "--s": e.at },
3498
+ title: e.label,
3499
+ children: N.has(e) && /* @__PURE__ */ (0, Y.jsx)("span", {
3500
+ className: `fw-marker-label${N.get(e) === "left" ? " fw-marker-label-left" : ""}`,
3501
+ children: e.label
3502
+ })
3503
+ }, `${e.at}-${e.label}`))
3504
+ }) : null,
3505
+ f && e.cursorLine !== !1 && /* @__PURE__ */ (0, Y.jsx)("div", {
3506
+ className: "fw-cursor-layer",
3507
+ "aria-hidden": !0,
3508
+ children: /* @__PURE__ */ (0, Y.jsx)("span", { className: "fw-cursor" })
3509
+ })
3510
+ ]
3511
+ })]
3512
+ });
3513
+ }
3514
+ function Tn({ scroller: e, rows: t, index: n, rowHeight: r, render: i }) {
3515
+ let [a, o] = (0, X.useState)(0);
3516
+ (0, X.useEffect)(() => {
3517
+ let t = e.current;
3518
+ if (!t) return;
3519
+ let n = () => o(t.scrollTop > 0 ? Math.floor(t.scrollTop / r) : -1);
3520
+ return n(), t.addEventListener("scroll", n, { passive: !0 }), () => t.removeEventListener("scroll", n);
3521
+ }, [e, r]);
3522
+ let s = [];
3523
+ if (a >= 0) {
3524
+ let e = [], r = t[Math.min(t.length - 1, a + 1)];
3525
+ for (; r?.parentId !== void 0;) {
3526
+ let i = n.get(r.parentId);
3527
+ if (i === void 0) break;
3528
+ r = t[i], r && e.unshift(r);
3529
+ }
3530
+ for (let [t, r] of e.slice(-3).entries()) (n.get(r.id) ?? 0) < a + t + 1 && s.push(r);
3531
+ }
3532
+ return s.length ? /* @__PURE__ */ (0, Y.jsx)("div", {
3533
+ className: "fw-sticky",
3534
+ style: { height: s.length * r },
3535
+ children: s.map((e, t) => i(e, t, !0))
3536
+ }) : null;
3537
+ }
3538
+ var En = 100;
3539
+ function Dn(e) {
3540
+ let { root: t, slider: n, timeOutput: r, observedTotal: i, live: a, startedAt: o, snapshot: s, playing: c, speed: l, position: u, onPlaybackEnd: d, view: f, trackPx: p } = e, [m, h] = (0, X.useState)(u ?? i), g = (0, X.useRef)(Date.now()), _ = (0, X.useRef)(u ?? i), v = (0, X.useRef)(e);
3541
+ v.current = e, (0, X.useEffect)(() => {
3542
+ g.current = Date.now();
3543
+ }, [s]);
3544
+ let y = () => {
3545
+ let { observedTotal: e, startedAt: t, live: n } = v.current;
3546
+ return n ? Math.max(e, t === void 0 ? e + Date.now() - g.current : Date.now() - t) : e;
3547
+ }, b = (e, i = y()) => {
3548
+ let a = t.current;
3549
+ if (!a) return;
3550
+ let { startMs: o, endMs: s } = v.current.view(e), c = Math.max(1e-9, v.current.trackPx / Math.max(1, s - o));
3551
+ a.style.setProperty("--fw-t", String(e)), a.style.setProperty("--fw-v0", String(o)), a.style.setProperty("--fw-k", String(c)), n.current && (n.current.max = String(Math.max(1, i, e)), n.current.value = String(e)), r.current && (r.current.textContent = Q(e));
3552
+ };
3553
+ return (0, X.useLayoutEffect)(() => {
3554
+ if (u !== null && (_.current = u), !(a || c)) {
3555
+ let e = u ?? i;
3556
+ b(e), h(e);
3557
+ return;
3558
+ }
3559
+ let e = 0, t = performance.now(), n = 0, r = (i) => {
3560
+ let a = i - t;
3561
+ t = i;
3562
+ let o, s = y();
3563
+ if (c) {
3564
+ if (_.current = Math.min(s, _.current + a * v.current.speed), o = _.current, o >= s && !v.current.live) {
3565
+ b(o, s), h(o), v.current.onPlaybackEnd(o);
3566
+ return;
3567
+ }
3568
+ } else o = v.current.position ?? s;
3569
+ b(o, s), i - n >= En && (n = i, h(o)), e = requestAnimationFrame(r);
3570
+ };
3571
+ return e = requestAnimationFrame(r), () => cancelAnimationFrame(e);
3572
+ }, [
3573
+ a,
3574
+ c,
3575
+ u,
3576
+ i,
3577
+ s
3578
+ ]), (0, X.useLayoutEffect)(() => {
3579
+ b(c ? _.current : u ?? (a ? y() : i));
3580
+ }, [f, p]), {
3581
+ clockMs: m,
3582
+ limitMs: y,
3583
+ positionMs: () => _.current
3584
+ };
3585
+ }
3586
+ var On = [
3587
+ .5,
3588
+ 1,
3589
+ 1.5,
3590
+ 2,
3591
+ 4
3592
+ ];
3593
+ function kn({ view: e, playing: t, limit: n, clockMs: r, speed: i, zoom: a, marks: o, slider: s, timeOutput: c, followLabel: l, onTogglePlay: u, onRestart: d, onSpeed: f, onScrub: p, onFollow: m, onZoom: h, onFit: g }) {
3594
+ return /* @__PURE__ */ (0, Y.jsxs)("footer", {
3595
+ className: "fw-playback",
3596
+ children: [
3597
+ /* @__PURE__ */ (0, Y.jsx)("button", {
3598
+ type: "button",
3599
+ className: "fw-round-button",
3600
+ "aria-label": t ? "Pause" : "Play",
3601
+ disabled: n === 0,
3602
+ onClick: u,
3603
+ children: t ? /* @__PURE__ */ (0, Y.jsx)(Ft, {}) : /* @__PURE__ */ (0, Y.jsx)(Pt, {})
3604
+ }),
3605
+ /* @__PURE__ */ (0, Y.jsx)("button", {
3606
+ type: "button",
3607
+ className: "fw-icon-button",
3608
+ "aria-label": "Restart",
3609
+ title: "Replay from the start",
3610
+ disabled: n === 0,
3611
+ onClick: d,
3612
+ children: /* @__PURE__ */ (0, Y.jsx)(It, {})
3613
+ }),
3614
+ e === "agents" ? /* @__PURE__ */ (0, Y.jsx)("div", {
3615
+ className: "fw-segmented",
3616
+ role: "radiogroup",
3617
+ "aria-label": "Playback speed",
3618
+ children: [
3619
+ 1,
3620
+ 2,
3621
+ 4
3622
+ ].map((e) => /* @__PURE__ */ (0, Y.jsxs)("button", {
3623
+ type: "button",
3624
+ role: "radio",
3625
+ "aria-checked": i === e,
3626
+ onClick: () => f(e),
3627
+ children: [e, "x"]
3628
+ }, e))
3629
+ }) : /* @__PURE__ */ (0, Y.jsxs)("label", {
3630
+ className: "fw-speed",
3631
+ children: [/* @__PURE__ */ (0, Y.jsx)("span", {
3632
+ className: "fw-sr-only",
3633
+ children: "Playback speed"
3634
+ }), /* @__PURE__ */ (0, Y.jsx)("select", {
3635
+ "aria-label": "Playback speed",
3636
+ value: i,
3637
+ onChange: (e) => f(Number(e.target.value)),
3638
+ children: On.map((e) => /* @__PURE__ */ (0, Y.jsxs)("option", {
3639
+ value: e,
3640
+ children: [e, "x"]
3641
+ }, e))
3642
+ })]
3643
+ }),
3644
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
3645
+ className: "fw-overview",
3646
+ children: [/* @__PURE__ */ (0, Y.jsxs)("div", {
3647
+ className: "fw-overview-marks",
3648
+ "aria-hidden": !0,
3649
+ children: [o.map((e, t) => /* @__PURE__ */ (0, Y.jsx)("span", {
3650
+ className: `fw-ov fw-seg-${e.kind}`,
3651
+ "data-tone": rt(e.tone),
3652
+ style: {
3653
+ left: `${e.startMs / Math.max(1, n) * 100}%`,
3654
+ width: `${Math.max(.15, (Math.min(e.endMs, n) - e.startMs) / Math.max(1, n) * 100)}%`
3655
+ }
3656
+ }, t)), a && /* @__PURE__ */ (0, Y.jsx)("span", {
3657
+ className: "fw-brush",
3658
+ style: {
3659
+ left: `${a.startMs / n * 100}%`,
3660
+ width: `${(a.endMs - a.startMs) / n * 100}%`
3661
+ }
3662
+ })]
3663
+ }), /* @__PURE__ */ (0, Y.jsx)("input", {
3664
+ ref: s,
3665
+ "aria-label": "Playback position",
3666
+ type: "range",
3667
+ min: 0,
3668
+ max: Math.max(1, n),
3669
+ step: "any",
3670
+ defaultValue: r,
3671
+ disabled: n === 0,
3672
+ className: "fw-slider",
3673
+ style: { "--fw-progress": `${r / Math.max(1, n) * 100}%` },
3674
+ onChange: (e) => p(Number(e.target.value))
3675
+ })]
3676
+ }),
3677
+ /* @__PURE__ */ (0, Y.jsx)("output", {
3678
+ ref: c,
3679
+ className: "fw-time",
3680
+ "aria-label": "Playback time",
3681
+ children: Q(r)
3682
+ }),
3683
+ l && /* @__PURE__ */ (0, Y.jsx)("button", {
3684
+ type: "button",
3685
+ className: "fw-text-button",
3686
+ onClick: m,
3687
+ children: l
3688
+ }),
3689
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
3690
+ className: "fw-zoom",
3691
+ role: "group",
3692
+ "aria-label": "Zoom",
3693
+ children: [
3694
+ /* @__PURE__ */ (0, Y.jsx)("button", {
3695
+ type: "button",
3696
+ className: "fw-icon-button",
3697
+ "aria-label": "Zoom out",
3698
+ disabled: !a,
3699
+ onClick: () => h(2),
3700
+ children: /* @__PURE__ */ (0, Y.jsx)(Ut, {})
3701
+ }),
3702
+ /* @__PURE__ */ (0, Y.jsx)("button", {
3703
+ type: "button",
3704
+ className: "fw-icon-button",
3705
+ "aria-label": "Zoom in",
3706
+ disabled: n === 0,
3707
+ onClick: () => h(.5),
3708
+ children: /* @__PURE__ */ (0, Y.jsx)(Ht, {})
3709
+ }),
3710
+ /* @__PURE__ */ (0, Y.jsx)("button", {
3711
+ type: "button",
3712
+ className: "fw-icon-button",
3713
+ "aria-label": "Fit the whole trace",
3714
+ disabled: !a,
3715
+ onClick: g,
3716
+ children: /* @__PURE__ */ (0, Y.jsx)(Wt, {})
3717
+ })
3718
+ ]
3719
+ })
3720
+ ]
3721
+ });
3722
+ }
3723
+ var An = 12, jn = 20, Mn = 12, Nn = {
3724
+ spans: 120,
3725
+ agents: 176
3726
+ }, Pn = {
3727
+ spans: 320,
3728
+ agents: 240
3729
+ };
3730
+ function Fn(e, t, n) {
3731
+ let [r, i] = (0, X.useState)(n), a = e === void 0 ? r : e, o = (0, X.useRef)(a);
3732
+ o.current = a;
3733
+ let s = (0, X.useRef)(t);
3734
+ s.current = t;
3735
+ let c = e !== void 0;
3736
+ return [a, (0, X.useCallback)((e) => {
3737
+ let t = typeof e == "function" ? e(o.current) : e;
3738
+ o.current = t, c || i(t), s.current?.(t);
3739
+ }, [c])];
3740
+ }
3741
+ var In = 320;
3742
+ function Ln(e) {
3743
+ let t = /* @__PURE__ */ new Map();
3744
+ for (let n of e) n && t.set(n, (t.get(n) ?? 0) + 1);
3745
+ let [n, r] = [...t].sort((e, t) => t[1] - e[1])[0] ?? [];
3746
+ return e.length > 1 && r !== void 0 && r >= 2 && r * 2 >= e.length ? n : void 0;
3747
+ }
3748
+ function Rn(e, t, n) {
3749
+ let r = xt(t ? t.costUsd : e.costUsd, e), i = t ? t.tokens : e.promptTokens + e.completionTokens, a = t ? t.modelCalls : e.modelCalls, o = t ? t.errors : e.errors ?? e.spans.filter(it).length;
3750
+ return {
3751
+ cost: r,
3752
+ tokens: i,
3753
+ errors: o,
3754
+ summary: [
3755
+ ["Duration", Q(n)],
3756
+ ...r.value === "—" ? [] : [[
3757
+ r.label,
3758
+ r.value,
3759
+ r.title
3760
+ ]],
3761
+ [
3762
+ "Tokens",
3763
+ st(i),
3764
+ `${i.toLocaleString()} tokens`
3765
+ ],
3766
+ [
3767
+ "LLM calls",
3768
+ a === void 0 ? "—" : a.toLocaleString(),
3769
+ a === void 0 ? "Model output windows do not establish the number of LLM requests" : void 0
3770
+ ],
3771
+ [
3772
+ "Tool calls",
3773
+ (t ? t.toolCalls : e.toolCalls)?.toLocaleString() ?? "—",
3774
+ (t ? t.toolCalls : e.toolCalls) === void 0 ? "The producer did not count tool calls" : void 0
3775
+ ],
3776
+ ["Errors", o.toLocaleString()]
3777
+ ]
3778
+ };
3779
+ }
3780
+ var zn = [
3781
+ "ok",
3782
+ "warn",
3783
+ "failed",
3784
+ "neutral"
3785
+ ];
3786
+ function Bn({ rows: e }) {
3787
+ let t = (t) => e.some((e) => e.own.some((e) => e.kind === t) || e.span.kind === t), n = [
3788
+ ["model", "Model call"],
3789
+ ["tool", "Tool call"],
3790
+ ["waiting", "Waiting"],
3791
+ ["handoff", "Handoff"]
3792
+ ].filter(([n]) => n === "waiting" ? e.some((e) => e.kind === "pipeline") : n === "handoff" ? e.some((e) => e.span.handoffTo || e.hasAgents) : t(n));
3793
+ return n.length === 0 ? null : /* @__PURE__ */ (0, Y.jsx)("ul", {
3794
+ className: "fw-legend fw-kinds",
3795
+ "aria-label": "Key",
3796
+ children: n.map(([e, t]) => /* @__PURE__ */ (0, Y.jsxs)("li", { children: [/* @__PURE__ */ (0, Y.jsx)("span", {
3797
+ className: `fw-swatch-${e === "waiting" ? "wait" : e}`,
3798
+ "aria-hidden": !0
3799
+ }), t] }, e))
3800
+ });
3801
+ }
3802
+ function Vn({ agents: e }) {
3803
+ let t = /* @__PURE__ */ new Map();
3804
+ for (let n of e) {
3805
+ let e = n.span.outcome;
3806
+ if (!e) continue;
3807
+ let r = t.get(e.label) ?? {
3808
+ tone: e.tone,
3809
+ count: 0
3810
+ };
3811
+ r.count += 1, t.set(e.label, r);
3812
+ }
3813
+ if (t.size === 0) return null;
3814
+ let n = e.reduce((e, t) => e + t.own.reduce((e, t) => e + (t.kind === "failed" ? t.count : 0), 0), 0);
3815
+ return /* @__PURE__ */ (0, Y.jsxs)("ul", {
3816
+ className: "fw-legend",
3817
+ "aria-label": "Outcomes",
3818
+ children: [[...t].sort(([e, t], [n, r]) => zn.indexOf(t.tone) - zn.indexOf(r.tone) || e.localeCompare(n)).map(([e, t]) => /* @__PURE__ */ (0, Y.jsxs)("li", { children: [
3819
+ /* @__PURE__ */ (0, Y.jsx)("span", {
3820
+ className: "fw-swatch",
3821
+ "data-tone": "0",
3822
+ "data-outcome": t.tone,
3823
+ "aria-hidden": !0
3824
+ }),
3825
+ e,
3826
+ " ",
3827
+ /* @__PURE__ */ (0, Y.jsx)("b", { children: t.count })
3828
+ ] }, e)), n > 0 && /* @__PURE__ */ (0, Y.jsxs)("li", { children: [
3829
+ /* @__PURE__ */ (0, Y.jsx)("span", {
3830
+ className: "fw-swatch-step",
3831
+ "aria-hidden": !0,
3832
+ children: /* @__PURE__ */ (0, Y.jsx)(Rt, {})
3833
+ }),
3834
+ "Failed step ",
3835
+ /* @__PURE__ */ (0, Y.jsx)("b", { children: n })
3836
+ ] })]
3837
+ });
3838
+ }
3839
+ function Hn({ trace: e, live: t, startedAt: n, label: r = "Trace waterfall", defaultCollapsed: i = !1, defaultView: a = "spans", renderIcon: o, maxHeight: s, onSelect: c, markers: l, onTimeChange: u, agentFill: d, selectedId: f, onDeselect: p, description: m, summary: h = !0, criticalPath: g = !1, query: _, onQueryChange: v, collapsed: y, onCollapsedChange: b, zoom: x, onZoomChange: S, matchSpan: C }) {
3840
+ let w = (0, X.useRef)(null), T = (0, X.useRef)(null), E = (0, X.useRef)(null), D = (0, X.useRef)(null), O = (0, X.useRef)(void 0), k = (0, X.useId)(), A = (0, X.useId)(), [j, M] = (0, X.useState)(a), [N, P] = Fn(_, v, ""), [F, I] = Fn(y, b, () => new Set(i ? e.spans.flatMap((e) => e.parentId ? [e.parentId] : []) : [])), [L, ee] = (0, X.useState)(1), [R, z] = (0, X.useState)(!1), [B, V] = (0, X.useState)(null), [te, ne] = Fn(x, S, null), [re, ie] = (0, X.useState)(Pn[a]), [ae, oe] = (0, X.useState)(0), [H, se] = (0, X.useState)(null), [ce, le] = (0, X.useState)(), [ue, de] = (0, X.useState)(null), U = Number.isFinite(e.totalMs) && e.totalMs >= 0 ? e.totalMs : 0, W = t ?? e.spans.some(Z), fe = d ?? "agent", pe = (0, X.useMemo)(() => Math.max(U, ...e.spans.map((e) => Number.isFinite(e.endMs) ? e.endMs : 0)), [e, U]), me = Math.max(40, ae - An - Math.min(Nn[j], ae * .3));
3841
+ (0, X.useEffect)(() => {
3842
+ if (!ue) return;
3843
+ let e = new ResizeObserver(([e]) => oe(e.contentRect.width));
3844
+ return e.observe(ue), () => e.disconnect();
3845
+ }, [ue]);
3846
+ let he = (0, X.useCallback)((e) => te ?? {
3847
+ startMs: 0,
3848
+ endMs: Math.max(pe, W ? e : 0, 1)
3849
+ }, [
3850
+ te,
3851
+ pe,
3852
+ W
3853
+ ]), ge = Dn({
3854
+ root: w,
3855
+ slider: E,
3856
+ timeOutput: D,
3857
+ observedTotal: pe,
3858
+ live: W,
3859
+ startedAt: n,
3860
+ snapshot: e,
3861
+ playing: R,
3862
+ speed: L,
3863
+ position: B,
3864
+ onPlaybackEnd: (e) => {
3865
+ z(!1), V(e);
3866
+ },
3867
+ view: he,
3868
+ trackPx: me
3869
+ }), G = ge.clockMs, _e = he(G), K = Math.max(pe, W ? G : 0), ve = 2 ** Math.round(Math.log2(Math.max(1, (_e.endMs - _e.startMs) / Math.max(200, me) * 1.5))), q = (0, X.useMemo)(() => lt({
3870
+ ...e,
3871
+ totalMs: pe
3872
+ }, ve), [
3873
+ e,
3874
+ pe,
3875
+ ve
3876
+ ]), ye = (0, X.useMemo)(() => new Map(q.map((e) => [e.id, e])), [q]), be = (0, X.useMemo)(() => _t(q), [q]), J = (0, X.useMemo)(() => {
3877
+ let e = q.filter((e) => e.kind === "pipeline");
3878
+ return e.length ? e : q.filter((e) => !e.parentId);
3879
+ }, [q]), xe = Ln(J.map((e) => e.span.detail)), Se = Ln(J.map((e) => e.span.outcome?.label)), [Ce, we] = (0, X.useState)(/* @__PURE__ */ new Set()), Te = (0, X.useMemo)(() => Ct(J, Mn, Ce), [J, Ce]), [Ee, De] = (0, X.useState)(/* @__PURE__ */ new Set()), Oe = (0, X.useMemo)(() => j === "agents" ? Et(J, q, Te, Ee) : ht(q, N, F, C), [
3880
+ j,
3881
+ J,
3882
+ q,
3883
+ Te,
3884
+ Ee,
3885
+ N,
3886
+ F,
3887
+ C
3888
+ ]), ke = j === "spans" ? gt(q, G) : void 0, Ae = (0, X.useMemo)(() => j === "agents" ? vt(Oe, G) : {}, [
3889
+ j,
3890
+ Oe,
3891
+ G
3892
+ ]), je = s ?? (j === "agents" ? yn.agents * jn : 640), Me = (0, X.useRef)(!1);
3893
+ (0, X.useLayoutEffect)(() => {
3894
+ if (j !== "agents" || Me.current || !w.current) return;
3895
+ let e = 0;
3896
+ for (let t of w.current.querySelectorAll(".fw-view-agents .fw-row:not(.fw-sticky-row) .fw-name-text")) {
3897
+ let n = t.closest(".fw-label");
3898
+ n && (e = Math.max(e, t.scrollWidth + n.clientWidth - t.clientWidth));
3899
+ }
3900
+ e > 0 && ie(Math.max(140, Math.min(560, Math.ceil(e) + 16)));
3901
+ }, [j, J]), (0, X.useEffect)(() => {
3902
+ let e = (e) => {
3903
+ let t = document.activeElement, n = w.current?.contains(t);
3904
+ if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "f") {
3905
+ let r = Array.from(document.querySelectorAll("[data-flow-waterfall]")).find((e) => e.getClientRects().length > 0);
3906
+ if (!n && (t !== document.body || r !== w.current)) return;
3907
+ e.preventDefault(), j === "agents" && M("spans"), requestAnimationFrame(() => {
3908
+ T.current?.focus(), T.current?.select();
3909
+ });
3910
+ return;
3911
+ }
3912
+ if (!(!n || t instanceof HTMLInputElement || t instanceof HTMLSelectElement || e.metaKey || e.ctrlKey || e.altKey)) {
3913
+ if (e.key === "+" || e.key === "=") Ne(.5);
3914
+ else if (e.key === "-" || e.key === "_") Ne(2);
3915
+ else if (e.key === "0") ne(null);
3916
+ else if (e.key === "Escape" && (H || f)) H && Ge(), p?.();
3917
+ else if ((e.key === "n" || e.key === "p") && l?.length) {
3918
+ let t = l.map((e) => e.at).sort((e, t) => e - t), n = e.key === "n" ? t.find((e) => e > G + 1) : [...t].reverse().find((e) => e < G - 1);
3919
+ n !== void 0 && (e.preventDefault(), Ke(n));
3920
+ }
3921
+ }
3922
+ };
3923
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
3924
+ }), (0, X.useEffect)(() => {
3925
+ if (!H?.pinned) return;
3926
+ let e = (e) => {
3927
+ let t = e.target;
3928
+ t?.closest(".fw-card") || t?.closest(".fw-bar, .fw-seg") || se(null);
3929
+ };
3930
+ return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
3931
+ }, [H?.pinned]);
3932
+ let Ne = (e, t) => ne((n) => {
3933
+ let r = n ?? he(G), i = _n(r, e, t ?? (r.startMs + r.endMs) / 2, K);
3934
+ return i.endMs - i.startMs >= K - 1 ? null : i;
3935
+ }), Pe = (0, X.useRef)(0), Fe = (e) => {
3936
+ let t = e.span, n = he(G), r = n.endMs - n.startMs, i = Z(t) ? Math.max(t.endMs, G) : t.endMs;
3937
+ if (j !== "spans" || !Number.isFinite(i) || (i - t.startMs) / Math.max(1, r) > .25) return;
3938
+ let a = Math.max((i - t.startMs) * .15, 500, (r / 8 - (i - t.startMs)) / 2), o = vn({
3939
+ startMs: t.startMs - a,
3940
+ endMs: i + a
3941
+ }, K);
3942
+ if (cancelAnimationFrame(Pe.current), globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches) {
3943
+ ne(o);
3944
+ return;
3945
+ }
3946
+ let s = performance.now(), c = (e) => {
3947
+ let t = Math.min(1, (e - s) / 320), r = 1 - (1 - t) ** 3;
3948
+ ne({
3949
+ startMs: n.startMs + (o.startMs - n.startMs) * r,
3950
+ endMs: n.endMs + (o.endMs - n.endMs) * r
3951
+ }), t < 1 && (Pe.current = requestAnimationFrame(c));
3952
+ };
3953
+ Pe.current = requestAnimationFrame(c);
3954
+ }, Ie = (e) => ne((t) => t && vn({
3955
+ startMs: t.startMs + e,
3956
+ endMs: t.endMs + e
3957
+ }, K)), Le = (0, X.useRef)({
3958
+ toggle: (e) => {},
3959
+ pin: (e, t, n) => {},
3960
+ inspect: (e, t, n) => {}
3961
+ }), Re = (e) => {
3962
+ let t = (t) => new Set(t.has(e.id) ? [...t].filter((t) => t !== e.id) : [...t, e.id]);
3963
+ if (e.id.startsWith("family:")) {
3964
+ we(t);
3965
+ return;
3966
+ }
3967
+ if (c?.(e.span), j === "agents") {
3968
+ De(t), le(e.id);
3969
+ return;
3970
+ }
3971
+ F.has(e.id) && Fe(e), I((t) => {
3972
+ let n = new Set(t);
3973
+ return n.has(e.id) ? n.delete(e.id) : n.add(e.id), n;
3974
+ });
3975
+ };
3976
+ Le.current.toggle = Re;
3977
+ let ze = (0, X.useCallback)((e) => Le.current.toggle(e), []), Be = (e, t, n, r) => {
3978
+ let i = w.current?.getBoundingClientRect();
3979
+ if (!i) return;
3980
+ let a = t.getBoundingClientRect(), o = Math.min(In, i.width - 16), s = Math.max(8, Math.min((r ?? a.left + 24) - i.left - 24, i.width - o - 8));
3981
+ clearTimeout(O.current), se({
3982
+ target: e,
3983
+ pinned: n,
3984
+ left: s,
3985
+ anchorTop: a.top - i.top,
3986
+ anchorBottom: a.bottom - i.top,
3987
+ above: j === "agents"
3988
+ });
3989
+ };
3990
+ (0, X.useLayoutEffect)(() => {
3991
+ if (!H || H.fitted || !w.current) return;
3992
+ let e = document.getElementById(A)?.getBoundingClientRect();
3993
+ if (!e) return;
3994
+ let t = w.current.getBoundingClientRect().top, n = {
3995
+ above: t + H.anchorTop - 16,
3996
+ below: globalThis.innerHeight - (t + H.anchorBottom) - 16
3997
+ }, r = H.above ? n.above : n.below, i = H.above ? n.below : n.above;
3998
+ se({
3999
+ ...H,
4000
+ fitted: !0,
4001
+ above: e.height <= r || e.height > i && r >= i ? H.above : !H.above
4002
+ });
4003
+ }, [H, A]), Le.current.inspect = (e, t, n) => {
4004
+ H?.pinned || Be(e, t, !1, n);
4005
+ };
4006
+ let Ve = (0, X.useCallback)((e, t, n) => Le.current.inspect(e, t, n), []), He = (0, X.useCallback)(() => {
4007
+ clearTimeout(O.current), O.current = setTimeout(() => se((e) => e?.pinned ? e : null), 140);
4008
+ }, []);
4009
+ (0, X.useEffect)(() => {
4010
+ if (!H || H.pinned) return;
4011
+ let e = (e) => {
4012
+ e.target?.closest(".fw-bar, .fw-seg, .fw-card") || He();
4013
+ };
4014
+ return document.addEventListener("pointermove", e), () => document.removeEventListener("pointermove", e);
4015
+ }, [H, He]), Le.current.pin = (e, t, n) => {
4016
+ if (H?.pinned && H.target === e) {
4017
+ Ge();
4018
+ return;
4019
+ }
4020
+ Be(e, t, !0, n);
4021
+ let r = ye.get(e);
4022
+ r && (c?.(r.span), Fe(r));
4023
+ };
4024
+ let Ue = (0, X.useCallback)((e, t, n) => Le.current.pin(e, t, n), []), We = f ?? (H?.pinned ? H.target : void 0), Ge = () => {
4025
+ let e = H?.target;
4026
+ se(null), e && w.current?.querySelector(`.fw-canvas [data-span-id="${CSS.escape(e)}"]`)?.focus({ preventScroll: !0 });
4027
+ }, Ke = (0, X.useCallback)((e) => {
4028
+ z(!1), V(Math.min(e, ge.limitMs()));
4029
+ }, [ge]), qe = (0, X.useRef)(u);
4030
+ qe.current = u, (0, X.useEffect)(() => {
4031
+ qe.current?.(B);
4032
+ }, [B]);
4033
+ let Je = () => {
4034
+ if (R) {
4035
+ V(ge.positionMs()), z(!1);
4036
+ return;
4037
+ }
4038
+ (B === null || B >= K - 1) && V(0), z(!0);
4039
+ }, Ye = B !== null || R, { errors: Xe, summary: Ze } = Rn(e, Ye ? bt(e, G) : void 0, Ye ? G : K), Qe = J.reduce((e, t) => e + yt(t, K), 0), $e = K > 0 ? Qe / K : 0, et = !W && !e.spans.some(Z), tt = (e) => e && Ot(e, Oe), nt = tt(H ? ye.get(H.target) : void 0), rt = nt && (() => {
4040
+ for (let e = nt; e; e = e.parentId ? ye.get(e.parentId) : void 0) if (e.kind === "pipeline") return tt(e);
4041
+ })(), it = W || B !== null || R || j === "agents", at = (0, X.useMemo)(() => q.filter((e) => !e.parentId).flatMap((e) => e.hasChildren ? e.segments : e.kind === "pipeline" ? [] : [{
4042
+ startMs: e.span.startMs,
4043
+ endMs: e.span.endMs,
4044
+ kind: e.ok ? "tool" : "failed",
4045
+ tone: e.tone,
4046
+ id: e.id,
4047
+ count: 1,
4048
+ retry: !1
4049
+ }]), [q]), Q = /* @__PURE__ */ (0, Y.jsx)(kn, {
4050
+ view: j,
4051
+ playing: R,
4052
+ limit: K,
4053
+ clockMs: G,
4054
+ speed: L,
4055
+ zoom: te,
4056
+ marks: at,
4057
+ slider: E,
4058
+ timeOutput: D,
4059
+ followLabel: B === null ? void 0 : W ? "Follow live" : "Show full trace",
4060
+ onTogglePlay: Je,
4061
+ onRestart: () => {
4062
+ V(0), z(!1);
4063
+ },
4064
+ onSpeed: ee,
4065
+ onScrub: Ke,
4066
+ onFollow: () => {
4067
+ V(null), z(!1);
4068
+ },
4069
+ onZoom: Ne,
4070
+ onFit: () => ne(null)
4071
+ });
4072
+ return /* @__PURE__ */ (0, Y.jsxs)("section", {
4073
+ ref: w,
4074
+ "data-flow-waterfall": !0,
4075
+ "aria-label": r,
4076
+ className: `fw-root fw-root-${j} fw-fill-${fe}`,
4077
+ "data-selection": f ? "" : void 0,
4078
+ style: {
4079
+ "--fw-name-w": `${re}px`,
4080
+ "--fw-pad": `${An}px`,
4081
+ "--fw-row-h": `${yn[j]}px`
4082
+ },
4083
+ children: [
4084
+ /* @__PURE__ */ (0, Y.jsxs)("header", {
4085
+ className: "fw-heading",
4086
+ children: [/* @__PURE__ */ (0, Y.jsxs)("div", {
4087
+ className: "fw-title-block",
4088
+ children: [
4089
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
4090
+ className: "fw-title-line",
4091
+ children: [
4092
+ /* @__PURE__ */ (0, Y.jsx)("span", {
4093
+ className: "fw-title-glyph",
4094
+ "aria-hidden": !0,
4095
+ children: /* @__PURE__ */ (0, Y.jsx)(Bt, {})
4096
+ }),
4097
+ /* @__PURE__ */ (0, Y.jsx)("h3", {
4098
+ className: "fw-title",
4099
+ children: r
4100
+ }),
4101
+ m && /* @__PURE__ */ (0, Y.jsx)("p", {
4102
+ className: "fw-description",
4103
+ title: m,
4104
+ children: m
4105
+ }),
4106
+ W && /* @__PURE__ */ (0, Y.jsx)("span", {
4107
+ className: "fw-state fw-state-live",
4108
+ children: "Live"
4109
+ })
4110
+ ]
4111
+ }),
4112
+ j === "agents" && /* @__PURE__ */ (0, Y.jsxs)("p", {
4113
+ className: "fw-headline",
4114
+ "aria-live": "polite",
4115
+ children: [
4116
+ et && /* @__PURE__ */ (0, Y.jsx)("span", {
4117
+ className: "fw-done-mark",
4118
+ "aria-label": "done",
4119
+ children: "✓"
4120
+ }),
4121
+ J.length,
4122
+ " ",
4123
+ J.length === 1 ? "agent" : "agents",
4124
+ xe ? ` · ${J.every((e) => e.span.detail === xe) ? "" : "mostly "}${xe}` : "",
4125
+ et && $e >= 1.05 ? ` · ${$e.toFixed(1)}x parallel` : ""
4126
+ ]
4127
+ }),
4128
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
4129
+ className: "fw-legends",
4130
+ children: [/* @__PURE__ */ (0, Y.jsx)(Vn, { agents: J }), j === "agents" && /* @__PURE__ */ (0, Y.jsx)(Bn, { rows: q })]
4131
+ })
4132
+ ]
4133
+ }), /* @__PURE__ */ (0, Y.jsxs)("div", {
4134
+ className: "fw-tools",
4135
+ children: [/* @__PURE__ */ (0, Y.jsx)("div", {
4136
+ className: "fw-views",
4137
+ role: "radiogroup",
4138
+ "aria-label": "Trace view",
4139
+ children: ["agents", "spans"].map((e) => /* @__PURE__ */ (0, Y.jsx)("button", {
4140
+ type: "button",
4141
+ role: "radio",
4142
+ "aria-checked": j === e,
4143
+ disabled: j === e,
4144
+ className: "fw-view-button",
4145
+ onClick: () => {
4146
+ M(e), ie(Pn[e]), se(null);
4147
+ },
4148
+ children: e === "agents" ? "Agents" : "Steps"
4149
+ }, e))
4150
+ }), j === "spans" && /* @__PURE__ */ (0, Y.jsxs)("div", {
4151
+ className: "fw-search",
4152
+ children: [
4153
+ /* @__PURE__ */ (0, Y.jsx)("label", {
4154
+ htmlFor: k,
4155
+ className: "fw-sr-only",
4156
+ children: "Search trace"
4157
+ }),
4158
+ /* @__PURE__ */ (0, Y.jsx)("span", {
4159
+ className: "fw-search-glyph",
4160
+ "aria-hidden": !0,
4161
+ children: /* @__PURE__ */ (0, Y.jsx)(Nt, {})
4162
+ }),
4163
+ /* @__PURE__ */ (0, Y.jsx)("input", {
4164
+ ref: T,
4165
+ id: k,
4166
+ type: "search",
4167
+ value: N,
4168
+ placeholder: "Search",
4169
+ "aria-keyshortcuts": "Meta+f Control+f",
4170
+ onChange: (e) => P(e.target.value),
4171
+ onKeyDown: (e) => {
4172
+ e.key === "Escape" && (P(""), e.stopPropagation());
4173
+ },
4174
+ className: "fw-search-input"
4175
+ })
4176
+ ]
4177
+ })]
4178
+ })]
4179
+ }),
4180
+ h && /* @__PURE__ */ (0, Y.jsx)("dl", {
4181
+ className: "fw-summary",
4182
+ children: Ze.map(([e, t, n]) => /* @__PURE__ */ (0, Y.jsxs)("div", {
4183
+ className: e === "Errors" && Xe > 0 ? "fw-has-errors" : void 0,
4184
+ children: [/* @__PURE__ */ (0, Y.jsx)("dt", { children: e }), /* @__PURE__ */ (0, Y.jsx)("dd", {
4185
+ className: "fw-value",
4186
+ title: n,
4187
+ children: t
4188
+ })]
4189
+ }, e))
4190
+ }),
4191
+ j === "agents" && Q,
4192
+ /* @__PURE__ */ (0, Y.jsx)(wn, {
4193
+ rows: Oe,
4194
+ byId: ye,
4195
+ totalRows: q.length,
4196
+ view: j,
4197
+ maxHeight: je,
4198
+ collapsed: F,
4199
+ searching: !!N.trim(),
4200
+ query: N,
4201
+ matchSpan: C,
4202
+ pauses: e.pauses,
4203
+ cursorLine: B !== null || R,
4204
+ sharedDetail: xe,
4205
+ sharedOutcome: Se,
4206
+ expandedIds: j === "agents" ? /* @__PURE__ */ new Set([...Te, ...Ee]) : void 0,
4207
+ holdHeight: W,
4208
+ slowestId: ke?.id ?? Ae.slowestId,
4209
+ costliestId: Ae.costliestId,
4210
+ criticalIds: g && j === "spans" ? be : void 0,
4211
+ activeId: ce,
4212
+ selectedId: We,
4213
+ focusId: rt?.id ?? (j === "agents" ? ce : void 0),
4214
+ clockMs: G,
4215
+ window: _e,
4216
+ trackPx: me,
4217
+ showCursor: it,
4218
+ markers: l,
4219
+ fillByAgent: fe !== "outcome",
4220
+ zoomed: te !== null,
4221
+ renderIcon: o,
4222
+ emptyText: q.length === 0 ? "No spans yet. Waiting for trace events." : `No matching steps for “${N}”.`,
4223
+ onToggle: ze,
4224
+ onInspect: Ve,
4225
+ onLeave: He,
4226
+ onPin: Ue,
4227
+ onActivate: (e) => le(e.id),
4228
+ onActiveChange: le,
4229
+ onScrub: Ke,
4230
+ onZoom: Ne,
4231
+ onPan: Ie,
4232
+ nameWidth: re,
4233
+ onNameWidth: (e) => {
4234
+ Me.current = !0, ie(Math.max(140, Math.min(560, e)));
4235
+ },
4236
+ onTrack: de,
4237
+ onExpandAll: q.some((e) => e.hasChildren) ? () => I(/* @__PURE__ */ new Set()) : void 0,
4238
+ onCollapseAll: () => I(new Set(q.filter((e) => e.hasChildren).map((e) => e.id)))
4239
+ }),
4240
+ H && nt && /* @__PURE__ */ (0, Y.jsx)("div", {
4241
+ className: `fw-card-anchor${H.above ? " fw-card-above" : ""}`,
4242
+ onPointerEnter: () => clearTimeout(O.current),
4243
+ onPointerLeave: H.pinned ? void 0 : He,
4244
+ children: /* @__PURE__ */ (0, Y.jsx)($t, {
4245
+ id: A,
4246
+ row: nt,
4247
+ agent: rt,
4248
+ clockMs: G,
4249
+ left: H.left,
4250
+ top: H.above ? H.anchorTop - 8 : H.anchorBottom + 8,
4251
+ pinned: H.pinned,
4252
+ onClose: Ge,
4253
+ renderIcon: o,
4254
+ compact: j === "agents"
4255
+ })
4256
+ }),
4257
+ j === "spans" && Q
4258
+ ]
4259
+ });
4260
+ }
4261
+ //#endregion
4262
+ export { u as $, ue as A, G as B, fe as C, P as D, R as E, _ as F, T as G, M as H, ee as I, re as J, ne as K, L, d as M, pe as N, r as O, b as P, E as Q, F as R, V as S, K as T, B as U, w as V, f as W, g as X, v as Y, O as Z, ye as _, Hn as a, D as at, xe as b, Re as c, J as d, c as et, be as f, I as g, se as h, Ze as i, Oe as it, ve as j, z as k, ze as l, C as m, Le as n, ie as nt, qe as o, m as ot, q as p, te as q, tt as r, ae as rt, Xe as s, l as st, Qe as t, j as tt, Ge as u, k as v, me as w, S as x, p as y, x as z };