@adea-ai/ui 0.162.6 → 0.162.7

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 (364) hide show
  1. package/dist/components/composites/about-dialog/about-dialog.js +5 -5
  2. package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
  3. package/dist/components/composites/accent-picker/accent-picker.js +3 -3
  4. package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
  5. package/dist/components/composites/accent-picker/custom-color-popover.js +2 -2
  6. package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
  7. package/dist/components/composites/account-menu/account-menu.js +22 -22
  8. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  9. package/dist/components/composites/action-button/action-button.js +2 -2
  10. package/dist/components/composites/action-button/action-button.js.map +1 -1
  11. package/dist/components/composites/appearance-editor/accent-swatch-groups.js +3 -3
  12. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  13. package/dist/components/composites/appearance-editor/appearance-choices.js +10 -10
  14. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  15. package/dist/components/composites/appearance-editor/appearance-editor.js +13 -13
  16. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  17. package/dist/components/composites/appearance-editor/appearance-rows.js +12 -12
  18. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  19. package/dist/components/composites/appearance-editor/font-settings-group.js +13 -13
  20. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  21. package/dist/components/composites/appearance-editor/theme-preview.js +1 -1
  22. package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
  23. package/dist/components/composites/catalog-browser/catalog-browser-group.js +9 -9
  24. package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
  25. package/dist/components/composites/catalog-browser/catalog-browser.js +10 -10
  26. package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
  27. package/dist/components/composites/catalog-browser/catalog-detail.js +1 -1
  28. package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
  29. package/dist/components/composites/chain-of-thought/chain-of-thought.js +5 -5
  30. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
  31. package/dist/components/composites/chat/chat.js +7 -7
  32. package/dist/components/composites/chat/chat.js.map +1 -1
  33. package/dist/components/composites/checkpoint/checkpoint.js +5 -5
  34. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
  35. package/dist/components/composites/confirmation/confirmation.js +13 -13
  36. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  37. package/dist/components/composites/context/context.js +7 -7
  38. package/dist/components/composites/context/context.js.map +1 -1
  39. package/dist/components/composites/file-tree/build-file-tree.js +1 -1
  40. package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
  41. package/dist/components/composites/file-tree/file-tree.js +9 -9
  42. package/dist/components/composites/file-tree/file-tree.js.map +1 -1
  43. package/dist/components/composites/help-center/help-center.js +5 -5
  44. package/dist/components/composites/help-center/help-center.js.map +1 -1
  45. package/dist/components/composites/icon-picker/icon-picker.js +10 -10
  46. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  47. package/dist/components/composites/icon-picker/image-data-url.js.map +1 -1
  48. package/dist/components/composites/icon-picker/shell-icons.js +117 -117
  49. package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
  50. package/dist/components/composites/inline-citation/inline-citation.js +7 -7
  51. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  52. package/dist/components/composites/list-row/list-row-control.js +1 -1
  53. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  54. package/dist/components/composites/list-row/list-row.js +2 -2
  55. package/dist/components/composites/list-row/list-row.js.map +1 -1
  56. package/dist/components/composites/message-scroller/message-scroller.js +7 -7
  57. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
  58. package/dist/components/composites/message-scroller/scroll-anchor.js +1 -1
  59. package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -1
  60. package/dist/components/composites/model-selector/model-selector.js +12 -12
  61. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  62. package/dist/components/composites/plan/plan.js +5 -5
  63. package/dist/components/composites/plan/plan.js.map +1 -1
  64. package/dist/components/composites/prompt-input/prompt-input.js +3 -3
  65. package/dist/components/composites/prompt-input/prompt-input.js.map +1 -1
  66. package/dist/components/composites/queue/queue.js +13 -13
  67. package/dist/components/composites/queue/queue.js.map +1 -1
  68. package/dist/components/composites/reasoning/reasoning.js +5 -5
  69. package/dist/components/composites/reasoning/reasoning.js.map +1 -1
  70. package/dist/components/composites/scene-controls/scene-controls.js +16 -16
  71. package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
  72. package/dist/components/composites/settings/settings-layout.js +2 -2
  73. package/dist/components/composites/settings/settings-layout.js.map +1 -1
  74. package/dist/components/composites/settings/settings-navigation.js +2 -2
  75. package/dist/components/composites/settings/settings-navigation.js.map +1 -1
  76. package/dist/components/composites/settings/settings.js +5 -5
  77. package/dist/components/composites/settings/settings.js.map +1 -1
  78. package/dist/components/composites/sources/sources.js +5 -5
  79. package/dist/components/composites/sources/sources.js.map +1 -1
  80. package/dist/components/composites/stack-trace/parse-stack-trace.js +2 -2
  81. package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
  82. package/dist/components/composites/stack-trace/stack-trace.js +10 -10
  83. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  84. package/dist/components/composites/stat/stat.js +6 -6
  85. package/dist/components/composites/stat/stat.js.map +1 -1
  86. package/dist/components/composites/subagent/subagent.js +5 -5
  87. package/dist/components/composites/subagent/subagent.js.map +1 -1
  88. package/dist/components/composites/suggestion/suggestion.js +2 -2
  89. package/dist/components/composites/suggestion/suggestion.js.map +1 -1
  90. package/dist/components/composites/task/task.js +5 -5
  91. package/dist/components/composites/task/task.js.map +1 -1
  92. package/dist/components/composites/terminal/ansi.js +1 -1
  93. package/dist/components/composites/terminal/ansi.js.map +1 -1
  94. package/dist/components/composites/terminal/terminal.js +18 -18
  95. package/dist/components/composites/terminal/terminal.js.map +1 -1
  96. package/dist/components/composites/test-results/test-results.js +17 -17
  97. package/dist/components/composites/test-results/test-results.js.map +1 -1
  98. package/dist/components/composites/tool/tool.js +5 -5
  99. package/dist/components/composites/tool/tool.js.map +1 -1
  100. package/dist/components/composites/tree/tree.js +6 -6
  101. package/dist/components/composites/tree/tree.js.map +1 -1
  102. package/dist/components/composites/update-dialog/channel-control.js +1 -1
  103. package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
  104. package/dist/components/composites/update-dialog/update-dialog.js +23 -23
  105. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  106. package/dist/components/composites/workspace-mark/workspace-mark.js +2 -2
  107. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  108. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +6 -6
  109. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
  110. package/dist/components/composites/workspace-switcher/workspace-switcher.js +11 -11
  111. package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
  112. package/dist/components/conversation/atomic/chat-composer.js +1 -1
  113. package/dist/components/conversation/busy-send-button.js +10 -10
  114. package/dist/components/conversation/busy-send-button.js.map +1 -1
  115. package/dist/components/conversation/chat-composer.js +1 -1
  116. package/dist/components/conversation/composer-core.js +1 -1
  117. package/dist/components/conversation/composer-menu.js +2 -2
  118. package/dist/components/conversation/composer-menu.js.map +1 -1
  119. package/dist/components/conversation/conversation-avatar.js +7 -7
  120. package/dist/components/conversation/conversation-avatar.js.map +1 -1
  121. package/dist/components/conversation/conversation-pane.js +1 -1
  122. package/dist/components/conversation/conversation-pane.js.map +1 -1
  123. package/dist/components/conversation/conversation-surface.js +5 -5
  124. package/dist/components/conversation/conversation-surface.js.map +1 -1
  125. package/dist/components/conversation/internal/chat-composer-shell.js +9 -9
  126. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  127. package/dist/components/conversation/message-composer.js +9 -9
  128. package/dist/components/conversation/message-composer.js.map +1 -1
  129. package/dist/components/conversation/message-row.js +13 -13
  130. package/dist/components/conversation/message-row.js.map +1 -1
  131. package/dist/components/conversation/paste-token-editor.js +1 -1
  132. package/dist/components/conversation/paste-token-editor.js.map +1 -1
  133. package/dist/components/conversation/scroll-follow.js +1 -1
  134. package/dist/components/conversation/thread-panel.js +5 -5
  135. package/dist/components/conversation/thread-panel.js.map +1 -1
  136. package/dist/components/conversation/transcript-composition.js +5 -5
  137. package/dist/components/conversation/transcript-composition.js.map +1 -1
  138. package/dist/components/layout/app-shell/app-shell.js +1 -1
  139. package/dist/components/layout/app-shell/app-shell.js.map +1 -1
  140. package/dist/components/layout/app-shell/skip-link.js +1 -1
  141. package/dist/components/layout/app-shell/skip-link.js.map +1 -1
  142. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +2 -2
  143. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
  144. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +1 -1
  145. package/dist/components/layout/floating-preview/floating-preview.js +7 -7
  146. package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
  147. package/dist/components/layout/orbit-layout/orbit-layout.js +1 -1
  148. package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
  149. package/dist/components/layout/page/page.js +2 -2
  150. package/dist/components/layout/page/page.js.map +1 -1
  151. package/dist/components/layout/panel/panel.js +1 -1
  152. package/dist/components/layout/panel/panel.js.map +1 -1
  153. package/dist/components/layout/pixel-pane/pixel-pane.js +1 -1
  154. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +5 -5
  155. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  156. package/dist/components/layout/shell-rail/shell-rail.js +5 -5
  157. package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
  158. package/dist/components/layout/shell-top-bar/shell-top-bar.js +2 -2
  159. package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
  160. package/dist/components/layout/side-rail/side-rail.js +2 -2
  161. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  162. package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js +1 -1
  163. package/dist/components/layout/sidebar-nav/sidebar-nav.js +5 -5
  164. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  165. package/dist/components/layout/split-layout/pane-focus.js.map +1 -1
  166. package/dist/components/layout/split-layout/resize-controller-core-retry.js +1 -1
  167. package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
  168. package/dist/components/layout/split-layout/resize-controller-core.js +1 -1
  169. package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
  170. package/dist/components/layout/split-layout/split-layout.js +7 -7
  171. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  172. package/dist/components/layout/status-bar/status-bar.js +1 -1
  173. package/dist/components/layout/status-bar/status-bar.js.map +1 -1
  174. package/dist/components/layout/top-bar/top-bar.js +5 -5
  175. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  176. package/dist/components/layout/virtual-window/virtual-window.js +1 -1
  177. package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
  178. package/dist/components/motion/presence.js +1 -1
  179. package/dist/components/theme/appearance-panel.js +3 -3
  180. package/dist/components/theme/appearance-panel.js.map +1 -1
  181. package/dist/components/theme/lazy.js +3 -3
  182. package/dist/components/theme/lazy.js.map +1 -1
  183. package/dist/components/theme/script-projection.js +1 -1
  184. package/dist/components/theme/theme-catalogue-source.js +1 -1
  185. package/dist/components/theme/theme-document.js.map +1 -1
  186. package/dist/components/theme/theme-mode-toggle.js +7 -7
  187. package/dist/components/theme/theme-mode-toggle.js.map +1 -1
  188. package/dist/components/theme/theme-picker.js +2 -2
  189. package/dist/components/theme/theme-picker.js.map +1 -1
  190. package/dist/components/theme/theme-provider-value.js +1 -1
  191. package/dist/components/theme/theme-provider-value.js.map +1 -1
  192. package/dist/components/theme/theme-provider.js +1 -1
  193. package/dist/components/theme/theme-toggle.js +7 -7
  194. package/dist/components/theme/theme-toggle.js.map +1 -1
  195. package/dist/components/ui/accordion/accordion.js +13 -13
  196. package/dist/components/ui/accordion/accordion.js.map +1 -1
  197. package/dist/components/ui/alert/alert.js +12 -12
  198. package/dist/components/ui/alert/alert.js.map +1 -1
  199. package/dist/components/ui/alert-dialog/alert-dialog.js +14 -14
  200. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  201. package/dist/components/ui/annotation-surface/annotation-surface.js +2 -2
  202. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
  203. package/dist/components/ui/aspect-ratio/aspect-ratio.js +1 -1
  204. package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
  205. package/dist/components/ui/attachment/attachment.js +16 -16
  206. package/dist/components/ui/attachment/attachment.js.map +1 -1
  207. package/dist/components/ui/avatar/avatar.js +1 -1
  208. package/dist/components/ui/avatar/avatar.js.map +1 -1
  209. package/dist/components/ui/badge/badge.js +2 -2
  210. package/dist/components/ui/badge/badge.js.map +1 -1
  211. package/dist/components/ui/board/board.js +2 -2
  212. package/dist/components/ui/board/board.js.map +1 -1
  213. package/dist/components/ui/breadcrumb/breadcrumb.js +7 -7
  214. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  215. package/dist/components/ui/bubble/bubble.js +2 -2
  216. package/dist/components/ui/bubble/bubble.js.map +1 -1
  217. package/dist/components/ui/button/button.js +2 -2
  218. package/dist/components/ui/button-group/button-group.js +2 -2
  219. package/dist/components/ui/button-group/button-group.js.map +1 -1
  220. package/dist/components/ui/calendar/calendar.js +8 -8
  221. package/dist/components/ui/calendar/calendar.js.map +1 -1
  222. package/dist/components/ui/callout/callout.js +2 -2
  223. package/dist/components/ui/callout/callout.js.map +1 -1
  224. package/dist/components/ui/card/card.js +2 -2
  225. package/dist/components/ui/card/card.js.map +1 -1
  226. package/dist/components/ui/carousel/carousel.js +8 -8
  227. package/dist/components/ui/carousel/carousel.js.map +1 -1
  228. package/dist/components/ui/chart/chart.js +2 -2
  229. package/dist/components/ui/chart/chart.js.map +1 -1
  230. package/dist/components/ui/checkbox/checkbox.js +6 -6
  231. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  232. package/dist/components/ui/code-block/code-block.js +6 -6
  233. package/dist/components/ui/code-block/code-block.js.map +1 -1
  234. package/dist/components/ui/collapsible/collapsible.js +7 -7
  235. package/dist/components/ui/collapsible/collapsible.js.map +1 -1
  236. package/dist/components/ui/combobox/combobox.js +21 -21
  237. package/dist/components/ui/combobox/combobox.js.map +1 -1
  238. package/dist/components/ui/combobox/value-combobox.js +1 -1
  239. package/dist/components/ui/command/command.js +23 -23
  240. package/dist/components/ui/command/command.js.map +1 -1
  241. package/dist/components/ui/context-menu/context-menu.js +2 -2
  242. package/dist/components/ui/detail-panel/detail-panel.js +5 -5
  243. package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
  244. package/dist/components/ui/dialog/dialog-layer.js +2 -2
  245. package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
  246. package/dist/components/ui/dialog/dialog.js +21 -21
  247. package/dist/components/ui/dialog/dialog.js.map +1 -1
  248. package/dist/components/ui/diff-block/diff-block.js +2 -2
  249. package/dist/components/ui/diff-block/diff-block.js.map +1 -1
  250. package/dist/components/ui/drawer/drawer.js +14 -14
  251. package/dist/components/ui/drawer/drawer.js.map +1 -1
  252. package/dist/components/ui/dropdown-menu/dropdown-menu.js +3 -3
  253. package/dist/components/ui/dropdown-menu/menu-parts.js +10 -10
  254. package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
  255. package/dist/components/ui/empty/empty-state.js +5 -5
  256. package/dist/components/ui/empty/empty-state.js.map +1 -1
  257. package/dist/components/ui/empty/empty.js +1 -1
  258. package/dist/components/ui/empty/empty.js.map +1 -1
  259. package/dist/components/ui/entity-icon/entity-icon.js +2 -2
  260. package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
  261. package/dist/components/ui/field/field.js +14 -14
  262. package/dist/components/ui/field/field.js.map +1 -1
  263. package/dist/components/ui/field/number-field.js +2 -2
  264. package/dist/components/ui/field/number-field.js.map +1 -1
  265. package/dist/components/ui/hover-card/hover-card.js +10 -10
  266. package/dist/components/ui/hover-card/hover-card.js.map +1 -1
  267. package/dist/components/ui/input/input-control.js +1 -1
  268. package/dist/components/ui/input/input-control.js.map +1 -1
  269. package/dist/components/ui/input/input.js +2 -2
  270. package/dist/components/ui/input/input.js.map +1 -1
  271. package/dist/components/ui/input-group/input-group.js +2 -2
  272. package/dist/components/ui/input-group/input-group.js.map +1 -1
  273. package/dist/components/ui/input-group/secret-input-group.js +2 -2
  274. package/dist/components/ui/input-otp/input-otp.js +2 -2
  275. package/dist/components/ui/input-otp/input-otp.js.map +1 -1
  276. package/dist/components/ui/item/item.js +2 -2
  277. package/dist/components/ui/item/item.js.map +1 -1
  278. package/dist/components/ui/kbd/kbd.js +2 -2
  279. package/dist/components/ui/kbd/kbd.js.map +1 -1
  280. package/dist/components/ui/label/label.js +1 -1
  281. package/dist/components/ui/label/label.js.map +1 -1
  282. package/dist/components/ui/marker/marker.js +2 -2
  283. package/dist/components/ui/marker/marker.js.map +1 -1
  284. package/dist/components/ui/menubar/menubar.js +7 -7
  285. package/dist/components/ui/menubar/menubar.js.map +1 -1
  286. package/dist/components/ui/message/message.js +3 -3
  287. package/dist/components/ui/message/message.js.map +1 -1
  288. package/dist/components/ui/modal-dialog/modal-dialog.js +2 -2
  289. package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
  290. package/dist/components/ui/native-select/native-select.js +5 -5
  291. package/dist/components/ui/native-select/native-select.js.map +1 -1
  292. package/dist/components/ui/navigation-menu/navigation-menu.js +18 -18
  293. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  294. package/dist/components/ui/pagination/pagination.js +28 -28
  295. package/dist/components/ui/pagination/pagination.js.map +1 -1
  296. package/dist/components/ui/popover/popover.js +15 -15
  297. package/dist/components/ui/popover/popover.js.map +1 -1
  298. package/dist/components/ui/progress/progress.js +5 -5
  299. package/dist/components/ui/progress/progress.js.map +1 -1
  300. package/dist/components/ui/questionnaire/questionnaire.js +10 -10
  301. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
  302. package/dist/components/ui/radio-group/radio-group.js +9 -9
  303. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  304. package/dist/components/ui/resizable/resizable.js +11 -11
  305. package/dist/components/ui/resizable/resizable.js.map +1 -1
  306. package/dist/components/ui/scroll-area/scroll-area.js +1 -1
  307. package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
  308. package/dist/components/ui/select/select.js +21 -21
  309. package/dist/components/ui/select/select.js.map +1 -1
  310. package/dist/components/ui/separator/separator.js +5 -5
  311. package/dist/components/ui/separator/separator.js.map +1 -1
  312. package/dist/components/ui/sheet/sheet.js +6 -6
  313. package/dist/components/ui/sheet/sheet.js.map +1 -1
  314. package/dist/components/ui/skeleton/skeleton.js +1 -1
  315. package/dist/components/ui/skeleton/skeleton.js.map +1 -1
  316. package/dist/components/ui/slider/slider.js +5 -5
  317. package/dist/components/ui/slider/slider.js.map +1 -1
  318. package/dist/components/ui/spinner/spinner.js +5 -5
  319. package/dist/components/ui/spinner/spinner.js.map +1 -1
  320. package/dist/components/ui/status-chip/status-chip.js +2 -2
  321. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  322. package/dist/components/ui/switch/switch.js +4 -4
  323. package/dist/components/ui/switch/switch.js.map +1 -1
  324. package/dist/components/ui/table/table.js +1 -1
  325. package/dist/components/ui/table/table.js.map +1 -1
  326. package/dist/components/ui/tabs/tabs.js +7 -7
  327. package/dist/components/ui/tabs/tabs.js.map +1 -1
  328. package/dist/components/ui/text-link/text-link.js +1 -1
  329. package/dist/components/ui/text-link/text-link.js.map +1 -1
  330. package/dist/components/ui/textarea/textarea.js +2 -2
  331. package/dist/components/ui/textarea/textarea.js.map +1 -1
  332. package/dist/components/ui/toast/toast.js +7 -7
  333. package/dist/components/ui/toast/toast.js.map +1 -1
  334. package/dist/components/ui/toggle/toggle.js +6 -6
  335. package/dist/components/ui/toggle/toggle.js.map +1 -1
  336. package/dist/components/ui/toggle-group/toggle-group.js +7 -8
  337. package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
  338. package/dist/components/ui/tooltip/deferred-tooltip.js +6 -6
  339. package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
  340. package/dist/components/ui/tooltip/lazy-tooltip.js +2 -2
  341. package/dist/components/ui/tooltip/tooltip.js +10 -10
  342. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  343. package/dist/components/ui/trace/trace.js +19 -19
  344. package/dist/components/ui/trace/trace.js.map +1 -1
  345. package/dist/components/ui/typography/typography.js +2 -2
  346. package/dist/lib/accent-presets.js +1 -1
  347. package/dist/lib/accent-roles.js +2 -2
  348. package/dist/lib/async-action.js +1 -1
  349. package/dist/lib/create-poll.js +1 -1
  350. package/dist/lib/create-poll.js.map +1 -1
  351. package/dist/lib/external-link.js +1 -1
  352. package/dist/lib/external-link.js.map +1 -1
  353. package/dist/lib/fast-icon.js +1 -1
  354. package/dist/lib/theme-css.js +1 -1
  355. package/dist/lib/theme-engine-light.js +1 -1
  356. package/dist/lib/theme-projection.js +2 -2
  357. package/dist/lib/theme-records.js +1 -1
  358. package/dist/lib/themes.js +1 -1
  359. package/dist/lib/themes.js.map +1 -1
  360. package/dist/lib/tooltip-focus-gate.js.map +1 -1
  361. package/dist/lib/utils.js +1 -1
  362. package/dist/vite/source-parser.js +1 -1
  363. package/dist/vite/tailwind-sources.js +1 -1
  364. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"sources.js","names":["<Show when={local.sources.length > 0}>\n <Trace aria-label=\"Sources\" data-slot=\"sources\" {...rest}>\n <TraceLine\n icon={<BookOpen />}\n title={local.label ?? sourcesLabel(local.sources.length)}\n open={local.open}\n defaultOpen={local.defaultOpen}\n onOpenChange={local.onOpenChange}\n >\n {/* A body function: a folded list builds none of its rows. */}\n {() => (\n <TraceDetail>\n <ol class=\"m-0 flex list-none flex-col gap-2 p-0\" aria-label=\"Sources used\">\n <For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded() ? 'true' : 'false'}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>\n </TraceDetail>\n )}\n </TraceLine>\n </Trace>\n </Show>","<Trace aria-label=\"Sources\" data-slot=\"sources\" {...rest}>\n <TraceLine\n icon={<BookOpen />}\n title={local.label ?? sourcesLabel(local.sources.length)}\n open={local.open}\n defaultOpen={local.defaultOpen}\n onOpenChange={local.onOpenChange}\n >\n {/* A body function: a folded list builds none of its rows. */}\n {() => (\n <TraceDetail>\n <ol class=\"m-0 flex list-none flex-col gap-2 p-0\" aria-label=\"Sources used\">\n <For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded() ? 'true' : 'false'}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>\n </TraceDetail>\n )}\n </TraceLine>\n </Trace>","<TraceLine\n icon={<BookOpen />}\n title={local.label ?? sourcesLabel(local.sources.length)}\n open={local.open}\n defaultOpen={local.defaultOpen}\n onOpenChange={local.onOpenChange}\n >\n {/* A body function: a folded list builds none of its rows. */}\n {() => (\n <TraceDetail>\n <ol class=\"m-0 flex list-none flex-col gap-2 p-0\" aria-label=\"Sources used\">\n <For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded() ? 'true' : 'false'}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>\n </TraceDetail>\n )}\n </TraceLine>","<BookOpen />","<TraceDetail>\n <ol class=\"m-0 flex list-none flex-col gap-2 p-0\" aria-label=\"Sources used\">\n <For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded() ? 'true' : 'false'}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>\n </TraceDetail>","<For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>","<SourceRow source={source} position={index() + 1} />","<Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded() ? 'true' : 'false'}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>","<Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded() ? 'true' : 'false'}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>","type=\"button\"","variant=\"ghost\"","size=\"xs\"","class=\"mt-1\"","onClick={() => setExpanded((value) => !value)}","{expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}","<Show\n when={href()}\n fallback={\n <span class=\"text-sm text-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n </span>\n }\n >\n {(url) => (\n <TextLink\n href={url()}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"\n >\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n <span class=\"visually-hidden\"> (opens in a new tab)</span>\n </TextLink>\n )}\n </Show>","<span class=\"visually-hidden\">Source {props.position}: </span>","<span class=\"text-sm text-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n </span>","<TextLink\n href={url()}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"\n >\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n <span class=\"visually-hidden\"> (opens in a new tab)</span>\n </TextLink>","target=\"_blank\"","rel=\"noreferrer noopener\"","class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"","title()","<span class=\"visually-hidden\"> (opens in a new tab)</span>","<div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <Show\n when={href()}\n fallback={\n <span class=\"text-sm text-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n </span>\n }\n >\n {(url) => (\n <TextLink\n href={url()}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"\n >\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n <span class=\"visually-hidden\"> (opens in a new tab)</span>\n </TextLink>\n )}\n </Show>\n <Show when={host() || withheld()}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {host()}\n <Show when={withheld()}>{host() ? ' · ' : ''}Address not linked</Show>\n </span>\n </Show>\n <Show when={snippet()}>\n <p class=\"m-0 line-clamp-3 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {snippet()}\n </p>\n </Show>\n </div>","<span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {host()}\n <Show when={withheld()}>{host() ? ' · ' : ''}Address not linked</Show>\n </span>","<li data-slot=\"source\" class=\"flex min-w-0 items-baseline gap-2\">\n <span\n aria-hidden=\"true\"\n class=\"w-5 shrink-0 text-end text-xs text-muted-foreground tabular-nums\"\n >\n {props.position}\n </span>\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <Show\n when={href()}\n fallback={\n <span class=\"text-sm text-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n </span>\n }\n >\n {(url) => (\n <TextLink\n href={url()}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"\n >\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n <span class=\"visually-hidden\"> (opens in a new tab)</span>\n </TextLink>\n )}\n </Show>\n <Show when={host() || withheld()}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {host()}\n <Show when={withheld()}>{host() ? ' · ' : ''}Address not linked</Show>\n </span>\n </Show>\n <Show when={snippet()}>\n <p class=\"m-0 line-clamp-3 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {snippet()}\n </p>\n </Show>\n </div>\n </li>","BookOpen","LucideBookOpen","_$memo"],"sources":["../../../../src/components/composites/sources/sources.tsx"],"sourcesContent":["import { BookOpen as LucideBookOpen } from '@lucide/solid'\nimport { createSignal, For, Show, omit } from 'solid-js'\nimport { Button } from '../../ui/button'\nimport { TextLink } from '../../ui/text-link'\nimport { Trace, TraceDetail, TraceLine, type TraceProps } from '../../ui/trace'\nimport {\n SOURCE_SNIPPET_LIMIT,\n boundText,\n safeSourceUrl,\n sourceHost,\n sourceTitle,\n sourcesLabel,\n type Source,\n} from './source'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst BookOpen = fastIcon(LucideBookOpen)\n\n/**\n * Sources.\n *\n * The links a reply used, as one `Trace` line, \"Used 4 sources\", that expands\n * into the list. It lives under the answer with the rest of the agent's activity\n * rather than as a card of its own, because a reader who wants to check a claim\n * will open it and one who does not should not have to scroll past it. For a\n * marker inside a sentence use `InlineCitation`, which points at the same\n * `Source` shape; the two are numbered the same way (position in this list).\n *\n * ## What it will and will not say\n *\n * - **No sources, no line.** An empty list renders nothing: \"Used 0 sources\" is a\n * claim about an answer that may simply not have been grounded.\n * - **A row is a link only with a safe address.** `http:`, `https:` and `mailto:`\n * without embedded credentials (`safeSourceUrl`). Any other address is not\n * linked and not printed, the row says the address was not linked, so the\n * reader knows something was withheld instead of finding a dead title.\n * - **The host is read from the parsed URL**, never from the title, so a title\n * that reads \"docs.example.com\" cannot make a link to somewhere else look like it.\n * - **Nothing is merged.** Two entries that share a URL are two rows, with their\n * own numbers; the host may have cited two passages and the citations point at\n * positions.\n * - **Hostile and long values are bounded.** Titles, hosts and snippets are\n * clipped and stripped of direction overrides (`boundText`), and are only ever\n * text nodes.\n * - **A long list is shown in pages.** Past `initialVisible` the rest is behind a\n * button that names how many there are, so a 200-source answer is not 200 rows\n * the moment it opens. The button stays in place and toggles, so focus is never\n * left on a control that has just disappeared.\n */\nexport type SourcesProps = Omit<TraceProps, 'children'> & {\n sources: readonly Source[]\n /** Replaces the default \"Used N sources\" for another language or a different verb. */\n label?: string\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /** Rows shown before the \"Show all\" button. Default 25. */\n initialVisible?: number\n}\n\nconst DEFAULT_VISIBLE = 25\n\nexport function Sources(props: SourcesProps) {\n const local = props\n const rest = omit(\n props,\n 'sources',\n 'label',\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'initialVisible'\n )\n const [expanded, setExpanded] = createSignal(false)\n const limit = () => Math.max(1, Math.floor(local.initialVisible ?? DEFAULT_VISIBLE))\n const hidden = () => Math.max(0, local.sources.length - limit())\n const visible = () => (expanded() ? local.sources : local.sources.slice(0, limit()))\n\n return (\n <Show when={local.sources.length > 0}>\n <Trace aria-label=\"Sources\" data-slot=\"sources\" {...rest}>\n <TraceLine\n icon={<BookOpen />}\n title={local.label ?? sourcesLabel(local.sources.length)}\n open={local.open}\n defaultOpen={local.defaultOpen}\n onOpenChange={local.onOpenChange}\n >\n {/* A body function: a folded list builds none of its rows. */}\n {() => (\n <TraceDetail>\n <ol class=\"m-0 flex list-none flex-col gap-2 p-0\" aria-label=\"Sources used\">\n <For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded() ? 'true' : 'false'}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>\n </TraceDetail>\n )}\n </TraceLine>\n </Trace>\n </Show>\n )\n}\n\nfunction SourceRow(props: { source: Source; position: number }) {\n const href = () => safeSourceUrl(props.source.url)\n const host = () => sourceHost(props.source.url)\n const title = () => sourceTitle(props.source)\n const snippet = () =>\n props.source.snippet ? boundText(props.source.snippet, SOURCE_SNIPPET_LIMIT) : ''\n // An address was supplied but is not one we link: say so rather than go silent.\n const withheld = () => props.source.url !== undefined && props.source.url !== '' && !href()\n\n return (\n <li data-slot=\"source\" class=\"flex min-w-0 items-baseline gap-2\">\n <span\n aria-hidden=\"true\"\n class=\"w-5 shrink-0 text-end text-xs text-muted-foreground tabular-nums\"\n >\n {props.position}\n </span>\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <Show\n when={href()}\n fallback={\n <span class=\"text-sm text-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n </span>\n }\n >\n {(url) => (\n <TextLink\n href={url()}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"\n >\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n <span class=\"visually-hidden\"> (opens in a new tab)</span>\n </TextLink>\n )}\n </Show>\n <Show when={host() || withheld()}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {host()}\n <Show when={withheld()}>{host() ? ' · ' : ''}Address not linked</Show>\n </span>\n </Show>\n <Show when={snippet()}>\n <p class=\"m-0 line-clamp-3 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {snippet()}\n </p>\n </Show>\n </div>\n </li>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAM2B,aAAW,SAASC,QAAc;AA4CxC,IAAM,kBAAkB;AAExB,SAAgB,QAAQ,OAAqB;CAC3C,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,WACA,SACA,QACA,eACA,gBACA,gBACF;CACA,MAAM,CAAC,UAAU,eAAe,aAAa,KAAK;CAClD,MAAM,cAAc,KAAK,IAAI,GAAG,KAAK,MAAM,MAAM,kBAAkB,eAAe,CAAC;CACnF,MAAM,eAAe,KAAK,IAAI,GAAG,MAAM,QAAQ,SAAS,MAAM,CAAC;CAC/D,MAAM,gBAAiB,SAAS,IAAI,MAAM,UAAU,MAAM,QAAQ,MAAM,GAAG,MAAM,CAAC;CAElF,OACE5B,WAAAA;;GAAY,OAAA,MAAM,QAAQ,SAAS;EAiC7B,CAAA,CAAC,CAAD,IAhCJC,gBAAAA,OAAAA,WAAAA;GAAO,cAAW;GAAU,aAAU;EA+B/B,GA/B6C,MAApD,EAAA,IAAA,WAAA;GACEC,OAAAA,gBAAAA,WAAAA;IACE,IAAA,OAAA;KAAMC,OAAAA,gBAAAA,YAAAA,CAAW,CAAA;IAAC;IAClB,IAAA,QAAA;KAAO,OAAA,MAAM,SAAS,aAAa,MAAM,QAAQ,MAAM;IAAC;IACxD,IAAA,OAAA;KAAM,OAAA,MAAM;IAAI;IAChB,IAAA,cAAA;KAAa,OAAA,MAAM;IAAW;IAC9B,IAAA,eAAA;KAAc,OAAA,MAAM;IAAY;IALlCD,gBASIE,gBA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OAAA,KAAA,WAHJ;IAEG,IAAA,SAAA,QAAA;IAFH,OAAA,QACG,OACA;IAFH,OAAA;GAEG,EAAA,CAAA,IAHL,KAAA;EAIM;CAAC,EAAA,CAAD,GAjCRA,KAkCK;CA1CT,OACEE;AA4CJ"}
1
+ {"version":3,"file":"sources.js","names":["<Show when={local.sources.length > 0}>\n <Trace aria-label=\"Sources\" data-slot=\"sources\" {...rest}>\n <TraceLine\n icon={<BookOpen />}\n title={local.label ?? sourcesLabel(local.sources.length)}\n open={local.open}\n defaultOpen={local.defaultOpen}\n onOpenChange={local.onOpenChange}\n >\n {/* A body function: a folded list builds none of its rows. */}\n {() => (\n <TraceDetail>\n <ol class=\"m-0 flex list-none flex-col gap-2 p-0\" aria-label=\"Sources used\">\n <For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded() ? 'true' : 'false'}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>\n </TraceDetail>\n )}\n </TraceLine>\n </Trace>\n </Show>","<Trace aria-label=\"Sources\" data-slot=\"sources\" {...rest}>\n <TraceLine\n icon={<BookOpen />}\n title={local.label ?? sourcesLabel(local.sources.length)}\n open={local.open}\n defaultOpen={local.defaultOpen}\n onOpenChange={local.onOpenChange}\n >\n {/* A body function: a folded list builds none of its rows. */}\n {() => (\n <TraceDetail>\n <ol class=\"m-0 flex list-none flex-col gap-2 p-0\" aria-label=\"Sources used\">\n <For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded() ? 'true' : 'false'}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>\n </TraceDetail>\n )}\n </TraceLine>\n </Trace>","<TraceLine\n icon={<BookOpen />}\n title={local.label ?? sourcesLabel(local.sources.length)}\n open={local.open}\n defaultOpen={local.defaultOpen}\n onOpenChange={local.onOpenChange}\n >\n {/* A body function: a folded list builds none of its rows. */}\n {() => (\n <TraceDetail>\n <ol class=\"m-0 flex list-none flex-col gap-2 p-0\" aria-label=\"Sources used\">\n <For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded() ? 'true' : 'false'}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>\n </TraceDetail>\n )}\n </TraceLine>","<BookOpen />","<TraceDetail>\n <ol class=\"m-0 flex list-none flex-col gap-2 p-0\" aria-label=\"Sources used\">\n <For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded() ? 'true' : 'false'}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>\n </TraceDetail>","<For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>","<SourceRow source={source} position={index() + 1} />","<Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded() ? 'true' : 'false'}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>","<Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded() ? 'true' : 'false'}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>","type=\"button\"","variant=\"ghost\"","size=\"xs\"","class=\"mt-1\"","onClick={() => setExpanded((value) => !value)}","{expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}","<Show\n when={href()}\n fallback={\n <span class=\"text-sm text-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n </span>\n }\n >\n {(url) => (\n <TextLink\n href={url()}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"\n >\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n <span class=\"visually-hidden\"> (opens in a new tab)</span>\n </TextLink>\n )}\n </Show>","<span class=\"visually-hidden\">Source {props.position}: </span>","<span class=\"text-sm text-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n </span>","<TextLink\n href={url()}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"\n >\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n <span class=\"visually-hidden\"> (opens in a new tab)</span>\n </TextLink>","target=\"_blank\"","rel=\"noreferrer noopener\"","class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"","title()","<span class=\"visually-hidden\"> (opens in a new tab)</span>","<div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <Show\n when={href()}\n fallback={\n <span class=\"text-sm text-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n </span>\n }\n >\n {(url) => (\n <TextLink\n href={url()}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"\n >\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n <span class=\"visually-hidden\"> (opens in a new tab)</span>\n </TextLink>\n )}\n </Show>\n <Show when={host() || withheld()}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {host()}\n <Show when={withheld()}>{host() ? ' · ' : ''}Address not linked</Show>\n </span>\n </Show>\n <Show when={snippet()}>\n <p class=\"m-0 line-clamp-3 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {snippet()}\n </p>\n </Show>\n </div>","<span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {host()}\n <Show when={withheld()}>{host() ? ' · ' : ''}Address not linked</Show>\n </span>","<li data-slot=\"source\" class=\"flex min-w-0 items-baseline gap-2\">\n <span\n aria-hidden=\"true\"\n class=\"w-5 shrink-0 text-end text-xs text-muted-foreground tabular-nums\"\n >\n {props.position}\n </span>\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <Show\n when={href()}\n fallback={\n <span class=\"text-sm text-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n </span>\n }\n >\n {(url) => (\n <TextLink\n href={url()}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"\n >\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n <span class=\"visually-hidden\"> (opens in a new tab)</span>\n </TextLink>\n )}\n </Show>\n <Show when={host() || withheld()}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {host()}\n <Show when={withheld()}>{host() ? ' · ' : ''}Address not linked</Show>\n </span>\n </Show>\n <Show when={snippet()}>\n <p class=\"m-0 line-clamp-3 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {snippet()}\n </p>\n </Show>\n </div>\n </li>","LucideBookOpen","_$memo","_$insert"],"sources":["../../../../src/components/composites/sources/sources.tsx"],"sourcesContent":["import { BookOpen as LucideBookOpen } from '@lucide/solid'\nimport { createSignal, For, Show, omit } from 'solid-js'\nimport { Button } from '../../ui/button'\nimport { TextLink } from '../../ui/text-link'\nimport { Trace, TraceDetail, TraceLine, type TraceProps } from '../../ui/trace'\nimport {\n SOURCE_SNIPPET_LIMIT,\n boundText,\n safeSourceUrl,\n sourceHost,\n sourceTitle,\n sourcesLabel,\n type Source,\n} from './source'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst BookOpen = fastIcon(LucideBookOpen)\n\n/**\n * Sources.\n *\n * The links a reply used, as one `Trace` line, \"Used 4 sources\", that expands\n * into the list. It lives under the answer with the rest of the agent's activity\n * rather than as a card of its own, because a reader who wants to check a claim\n * will open it and one who does not should not have to scroll past it. For a\n * marker inside a sentence use `InlineCitation`, which points at the same\n * `Source` shape; the two are numbered the same way (position in this list).\n *\n * ## What it will and will not say\n *\n * - **No sources, no line.** An empty list renders nothing: \"Used 0 sources\" is a\n * claim about an answer that may simply not have been grounded.\n * - **A row is a link only with a safe address.** `http:`, `https:` and `mailto:`\n * without embedded credentials (`safeSourceUrl`). Any other address is not\n * linked and not printed, the row says the address was not linked, so the\n * reader knows something was withheld instead of finding a dead title.\n * - **The host is read from the parsed URL**, never from the title, so a title\n * that reads \"docs.example.com\" cannot make a link to somewhere else look like it.\n * - **Nothing is merged.** Two entries that share a URL are two rows, with their\n * own numbers; the host may have cited two passages and the citations point at\n * positions.\n * - **Hostile and long values are bounded.** Titles, hosts and snippets are\n * clipped and stripped of direction overrides (`boundText`), and are only ever\n * text nodes.\n * - **A long list is shown in pages.** Past `initialVisible` the rest is behind a\n * button that names how many there are, so a 200-source answer is not 200 rows\n * the moment it opens. The button stays in place and toggles, so focus is never\n * left on a control that has just disappeared.\n */\nexport type SourcesProps = Omit<TraceProps, 'children'> & {\n sources: readonly Source[]\n /** Replaces the default \"Used N sources\" for another language or a different verb. */\n label?: string\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /** Rows shown before the \"Show all\" button. Default 25. */\n initialVisible?: number\n}\n\nconst DEFAULT_VISIBLE = 25\n\nexport function Sources(props: SourcesProps) {\n const local = props\n const rest = omit(\n props,\n 'sources',\n 'label',\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'initialVisible'\n )\n const [expanded, setExpanded] = createSignal(false)\n const limit = () => Math.max(1, Math.floor(local.initialVisible ?? DEFAULT_VISIBLE))\n const hidden = () => Math.max(0, local.sources.length - limit())\n const visible = () => (expanded() ? local.sources : local.sources.slice(0, limit()))\n\n return (\n <Show when={local.sources.length > 0}>\n <Trace aria-label=\"Sources\" data-slot=\"sources\" {...rest}>\n <TraceLine\n icon={<BookOpen />}\n title={local.label ?? sourcesLabel(local.sources.length)}\n open={local.open}\n defaultOpen={local.defaultOpen}\n onOpenChange={local.onOpenChange}\n >\n {/* A body function: a folded list builds none of its rows. */}\n {() => (\n <TraceDetail>\n <ol class=\"m-0 flex list-none flex-col gap-2 p-0\" aria-label=\"Sources used\">\n <For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded() ? 'true' : 'false'}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>\n </TraceDetail>\n )}\n </TraceLine>\n </Trace>\n </Show>\n )\n}\n\nfunction SourceRow(props: { source: Source; position: number }) {\n const href = () => safeSourceUrl(props.source.url)\n const host = () => sourceHost(props.source.url)\n const title = () => sourceTitle(props.source)\n const snippet = () =>\n props.source.snippet ? boundText(props.source.snippet, SOURCE_SNIPPET_LIMIT) : ''\n // An address was supplied but is not one we link: say so rather than go silent.\n const withheld = () => props.source.url !== undefined && props.source.url !== '' && !href()\n\n return (\n <li data-slot=\"source\" class=\"flex min-w-0 items-baseline gap-2\">\n <span\n aria-hidden=\"true\"\n class=\"w-5 shrink-0 text-end text-xs text-muted-foreground tabular-nums\"\n >\n {props.position}\n </span>\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <Show\n when={href()}\n fallback={\n <span class=\"text-sm text-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n </span>\n }\n >\n {(url) => (\n <TextLink\n href={url()}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"\n >\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n <span class=\"visually-hidden\"> (opens in a new tab)</span>\n </TextLink>\n )}\n </Show>\n <Show when={host() || withheld()}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {host()}\n <Show when={withheld()}>{host() ? ' · ' : ''}Address not linked</Show>\n </span>\n </Show>\n <Show when={snippet()}>\n <p class=\"m-0 line-clamp-3 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {snippet()}\n </p>\n </Show>\n </div>\n </li>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAM,WAAW,SAAS2B,UAAc;AA4CxC,IAAM,kBAAkB;AAExB,SAAgB,QAAQ,OAAqB;CAC3C,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,WACA,SACA,QACA,eACA,gBACA,gBACF;CACA,MAAM,CAAC,UAAU,eAAe,aAAa,KAAK;CAClD,MAAM,cAAc,KAAK,IAAI,GAAG,KAAK,MAAM,MAAM,kBAAkB,eAAe,CAAC;CACnF,MAAM,eAAe,KAAK,IAAI,GAAG,MAAM,QAAQ,SAAS,MAAM,CAAC;CAC/D,MAAM,gBAAiB,SAAS,IAAI,MAAM,UAAU,MAAM,QAAQ,MAAM,GAAG,MAAM,CAAC;CAElF,OACE3B,WAAAA;;GAAY,OAAA,MAAM,QAAQ,SAAS;EAiC7B,CAAA,CAAC,CAAD,IAhCJC,gBAAAA,OAAA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ADHJ,MAGM;IAHNI,OAAA,eAEE;;MAAY,OAAA,CAAA,CAAA,SAAS;KAAgD,CAAA;KAArE,aAAA;MAAqE,OAAA,KAAA,IAA7C,CAAAD,WAAA;OAAC,OAAA,KAAK,IAAI,QAAQ;MAAE,CAAA,GAAC,oBAAD,IAA5C,KAAA;KAAqE;IAAC,EAAA,CAAD,GAFvEH,MAGM;IAHN,OAAA;GAGM,EAAA,CAAA,IAJR,KAAA;EAKM;CAAC,EAAA,CAAD,GA5BRD,KAkCK;CAlCLK,OAAA,cA6BE;;GAAY,OAAA,CAAA,CAAA,QAAQ;EAId,CAAA;EAJN,aAAA;GAIM,OAAA,KAAA,WAHJ;IAEG,IAAA,SAAA,QAAA;IAFHA,OAAA,QACG,OACA;IAFH,OAAA;GAEG,EAAA,CAAA,IAHL,KAAA;EAIM;CAAC,EAAA,CAAD,GAjCRL,KAkCK;CA1CT,OACEE;AA4CJ"}
@@ -392,9 +392,9 @@ function frameLocation(frame) {
392
392
  var LEADING_SPACE = /^[ \t]*/;
393
393
  /** Remove the indentation every non-blank line shares, so a source snippet sits flush. */
394
394
  function dedentLines(lines) {
395
- let indent = Infinity;
395
+ let indent = 1e400;
396
396
  for (const line of lines) if (line.trim() !== "") indent = Math.min(indent, LEADING_SPACE.exec(line)[0].length);
397
- if (indent === Infinity) return [...lines];
397
+ if (indent === 1e400) return [...lines];
398
398
  return lines.map((line) => line.slice(Math.min(indent, LEADING_SPACE.exec(line)[0].length)));
399
399
  }
400
400
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"parse-stack-trace.js","names":[],"sources":["../../../../src/components/composites/stack-trace/parse-stack-trace.ts"],"sourcesContent":["/**\n * Stack traces, read without being trusted or trimmed.\n *\n * A trace is text a runtime wrote about itself, and every language writes it\n * differently. This parses the three a coding agent meets most: V8/Node\n * (`at fn (file:line:col)`), Python (`File \"x\", line N, in fn`) and Rust panic\n * backtraces (` 0: symbol` then `at file:line:col`), into frames, and does\n * three things a formatter would not:\n *\n * - **It never hides a line.** Every input line ends up in `entries`, as a frame\n * or as text, in order. A line the parser does not recognise is text, and a\n * trace it recognises nothing in has `format: 'unknown'` and `frames: []`, so a\n * caller falls back to showing the raw string. The header (error type and\n * message) is lifted out of the entries only when it is unambiguous.\n * - **It makes no claim about whose code a frame is without evidence.** A frame\n * is a dependency when its path says so (`node_modules`, `site-packages`,\n * `.cargo/registry`), internal when it belongs to the runtime (`node:` URLs,\n * Python's frozen modules, Rust's `std`), and first-party otherwise. A host that\n * knows better passes `classify`.\n * - **It is bounded.** Lines over 4 000 characters are never run through a\n * pattern, and input past 10 000 lines is kept as one trailing text entry. Every\n * pattern is anchored and linear, so a hostile trace cannot make parsing slow.\n *\n * Parsing is line-oriented and each line is classified on its own, so a trace\n * that mixes formats (a Node process that shells out to Python) keeps both.\n */\n\nexport type StackFrameKind = 'first-party' | 'dependency' | 'internal'\nexport type StackTraceFormat = 'v8' | 'python' | 'rust' | 'unknown'\n\nexport type StackFrame = Readonly<{\n /** The line exactly as written, minus its line ending. */\n raw: string\n function?: string\n /** The path or URL as written. Undefined for `<anonymous>`, `native` and the like. */\n file?: string\n line?: number\n column?: number\n kind: StackFrameKind\n async?: true\n /** Lines the runtime printed beneath the frame, such as Python's source line. */\n detail?: readonly string[]\n}>\n\nexport type StackEntry =\n | Readonly<{ type: 'frame'; frame: StackFrame }>\n | Readonly<{ type: 'text'; text: string }>\n\nexport type StackTraceHeader = Readonly<{\n /** `TypeError`, `ValueError`, `thread 'main' panicked`. */\n type?: string\n message: string\n /** Where a Rust panic says it happened. */\n location?: string\n}>\n\nexport type ParsedStackTrace = Readonly<{\n format: StackTraceFormat\n header?: StackTraceHeader\n /** Everything that is not the header, in order. */\n entries: readonly StackEntry[]\n frames: readonly StackFrame[]\n}>\n\nexport type ParseStackTraceOptions = {\n /** Override the built-in first-party/dependency/internal guess for a frame. */\n classify?: (frame: StackFrame) => StackFrameKind | undefined\n}\n\nexport const STACK_MAX_LINES = 10_000\nconst LINE_PATTERN_LIMIT = 4000\n\ntype Draft = {\n raw: string\n function?: string\n file?: string\n line?: number\n column?: number\n async?: true\n detail?: string[]\n format: 'v8' | 'python' | 'rust'\n}\n\nfunction trailingNumber(value: string): { value: number; rest: string } | undefined {\n let i = value.length\n while (i > 0 && value.charCodeAt(i - 1) >= 48 && value.charCodeAt(i - 1) <= 57) i -= 1\n if (i === value.length || i === 0 || value[i - 1] !== ':' || value.length - i > 9)\n return undefined\n return { value: Number(value.slice(i)), rest: value.slice(0, i - 1) }\n}\n\n/** Split `path:line:col` from the right, so a Windows drive or a URL port stays in the path. */\nexport function splitLocation(location: string): { file: string; line?: number; column?: number } {\n const last = trailingNumber(location)\n if (!last || last.rest === '') return { file: location }\n const before = trailingNumber(last.rest)\n if (before && before.rest !== '') {\n return { file: before.rest, line: before.value, column: last.value }\n }\n return { file: last.rest, line: last.value }\n}\n\n/**\n * Split the pre-1.78 Rust panic suffix `'message', location`. The message may\n * contain `', ` itself, and the greedy pattern this replaces took the last\n * occurrence with a non-space behind it, this scan keeps that last-wins\n * answer, in one pass, so a message repeating the marker stays linear.\n */\nfunction splitRustOldPanic(after: string): { message: string; location: string } | undefined {\n // As in `parsePython`: no `.` in the old pattern could cross a line break.\n if (/[\\n\\r\\u2028\\u2029]/.test(after) || !after.startsWith(\"'\")) return undefined\n let close: number | undefined\n let search = 1\n for (;;) {\n const at = after.indexOf(\"', \", search)\n if (at < 0) break\n search = at + 1\n const start = at + 3\n if (start >= after.length) continue\n // Preserve ECMAScript \\S, including NBSP/BOM and Unicode space separators.\n if (/\\s/.test(after[start]!)) continue\n close = at\n }\n if (close === undefined) return undefined\n return { message: after.slice(1, close), location: after.slice(close + 3) }\n}\n\nconst FILE_LIKE = /[\\\\/]|\\.[A-Za-z0-9]{1,6}$/\nconst URL_LIKE = /^node:/i\n\n/** Whether a V8 location is a place in a file rather than a runtime annotation. */\nfunction v8Location(location: string): Partial<Draft> | undefined {\n if (location === '<anonymous>' || location === 'native' || /^index \\d+$/.test(location)) {\n return {}\n }\n if (location.startsWith('eval at ')) return {}\n const split = splitLocation(location)\n if (split.line !== undefined || FILE_LIKE.test(split.file) || URL_LIKE.test(split.file)) {\n return { file: split.file, line: split.line, column: split.column }\n }\n return undefined\n}\n\nfunction parseV8(trimmed: string): Draft | undefined {\n if (!trimmed.startsWith('at ')) return undefined\n const rest = trimmed.slice(3)\n if (rest === '') return undefined\n\n let fn: string | undefined\n let location: string\n if (rest.endsWith(')') && rest.includes(' (')) {\n const open = rest.indexOf(' (')\n fn = rest.slice(0, open)\n location = rest.slice(open + 2, -1)\n } else {\n location = rest\n }\n const parsed = v8Location(location)\n if (!parsed) return undefined\n // Without parentheses the whole remainder was the location, and it must carry\n // a line or a path — otherwise \"at the end of the day\" would be a frame.\n if (\n fn === undefined &&\n parsed.file === undefined &&\n location !== '<anonymous>' &&\n location !== 'native'\n ) {\n return undefined\n }\n\n const draft: Draft = { raw: trimmed, format: 'v8', ...parsed }\n if (fn !== undefined) {\n if (fn.startsWith('async ')) {\n draft.async = true\n fn = fn.slice(6)\n }\n if (fn !== '') draft.function = fn\n }\n return draft\n}\n\nconst PYTHON_PREFIX = 'File \"'\nconst PYTHON_LINE = '\", line '\nconst PYTHON_IN = ', in '\n\n/** Whether a character is an ASCII digit, as `\\d` was in the pattern this replaced. */\nfunction isDigit(code: number): boolean {\n return code >= 48 && code <= 57\n}\n\n/**\n * Read a Python frame: `File \"<file>\", line <n>[, in <fn>]`.\n *\n * Scanned, not matched. A line repeating the frame shape many times must still\n * cost one pass, so the closing `\", line ` is found by walking its candidates\n * left to right. The last valid candidate wins, what the greedy pattern this\n * replaces would have settled on, so a file path containing a quote still\n * parses exactly as it always did.\n */\nfunction parsePython(trimmed: string): Draft | undefined {\n // `.` never matches a line break, so the whole-line pattern this replaces\n // could not have matched a string containing one either.\n if (/[\\n\\r\\u2028\\u2029]/.test(trimmed) || !trimmed.startsWith(PYTHON_PREFIX)) return undefined\n let close: number | undefined\n let digits = 0\n let rest = 0\n let hasIn = false\n let search = PYTHON_PREFIX.length\n for (;;) {\n const at = trimmed.indexOf(PYTHON_LINE, search)\n if (at < 0) break\n search = at + 1\n let end = at + PYTHON_LINE.length\n const start = end\n while (end < trimmed.length && isDigit(trimmed.charCodeAt(end))) end += 1\n if (end === start) continue\n if (end < trimmed.length && !trimmed.startsWith(PYTHON_IN, end)) continue\n close = at\n digits = end - start\n rest = end\n hasIn = end < trimmed.length\n }\n if (close === undefined) return undefined\n const draft: Draft = {\n raw: trimmed,\n format: 'python',\n file: trimmed.slice(PYTHON_PREFIX.length, close),\n line: Number(trimmed.slice(rest - digits, rest)),\n }\n if (hasIn) {\n const fn = trimmed.slice(rest + PYTHON_IN.length)\n if (fn) draft.function = fn\n }\n return draft\n}\n\nconst RUST_FRAME = /^(\\d+):\\s+(?:0x[0-9a-fA-F]+ - )?(\\S.*)$/\nconst RUST_LOCATION = /^at\\s+(\\S.*)$/\n\nfunction parseRustFrame(trimmed: string, rustContext: boolean): Draft | undefined {\n const match = RUST_FRAME.exec(trimmed)\n if (!match) return undefined\n const symbol = match[2]!\n if (!rustContext && !symbol.includes('::')) return undefined\n return { raw: trimmed, format: 'rust', function: symbol }\n}\n\nconst INTERNAL_RUST_SYMBOLS =\n /^(?:std|core|alloc)::|^<?(?:\\w+ as )?(?:std|core|alloc)::|^(?:rust_begin_unwind|rust_panic|__rust_|_start$|__libc_|_main$)/\n\n/** The built-in guess at whose code a frame is. See the module comment. */\nexport function classifyFrame(\n frame: Omit<StackFrame, 'kind'>,\n format: StackTraceFormat\n): StackFrameKind {\n const file = frame.file?.replaceAll('\\\\', '/')\n if (format === 'rust') {\n if (file !== undefined) {\n if (file.startsWith('/rustc/') || /\\/library\\/(?:std|core|alloc)\\//.test(file))\n return 'internal'\n if (/\\/\\.cargo\\/(?:registry|git)\\/|\\/registry\\/src\\//.test(file)) return 'dependency'\n return 'first-party'\n }\n return frame.function !== undefined && INTERNAL_RUST_SYMBOLS.test(frame.function)\n ? 'internal'\n : 'first-party'\n }\n if (file === undefined) return 'internal'\n if (format === 'python') {\n if (/\\/(?:site|dist)-packages\\//.test(file)) return 'dependency'\n if (\n file.startsWith('<') ||\n /\\/lib\\/python\\d/i.test(file) ||\n /\\/python\\d[\\d.]*\\/lib\\//i.test(file)\n ) {\n return 'internal'\n }\n return 'first-party'\n }\n if (file.startsWith('node:') || file.startsWith('internal/') || file.startsWith('wasm://')) {\n return 'internal'\n }\n if (file.includes('/node_modules/') || file.startsWith('node_modules/')) return 'dependency'\n return 'first-party'\n}\n\nfunction finishFrame(draft: Draft, options: ParseStackTraceOptions | undefined): StackFrame {\n const { format, detail, ...base } = draft\n const shape: Omit<StackFrame, 'kind'> = detail && detail.length > 0 ? { ...base, detail } : base\n // Classified by the frame's own format, so a mixed trace keeps both languages' rules.\n const guess = classifyFrame(shape, format)\n const override = options?.classify?.({ ...shape, kind: guess })\n return { ...shape, kind: override ?? guess }\n}\n\nconst TYPE_AND_MESSAGE = /^([A-Za-z_$][\\w$.]*)(?::\\s?([\\s\\S]*))?$/\n\nfunction splitTypeAndMessage(lines: readonly string[]): StackTraceHeader {\n const first = lines[0] ?? ''\n const match = TYPE_AND_MESSAGE.exec(first)\n const tail = lines.slice(1)\n if (!match) return { message: lines.join('\\n') }\n const message = [match[2] ?? '', ...tail].join('\\n').replace(/^\\n+/, '')\n return { type: match[1], message }\n}\n\n/** Parse a stack trace. Never throws, and every input line appears in the result. */\nexport function parseStackTrace(text: string, options?: ParseStackTraceOptions): ParsedStackTrace {\n const rawLines = text.split('\\n')\n const overflow = rawLines.length > STACK_MAX_LINES ? rawLines.splice(STACK_MAX_LINES) : []\n const rustContext = /panicked at|stack backtrace|RUST_BACKTRACE/.test(text.slice(0, 200_000))\n\n type Item = { type: 'text'; text: string } | { type: 'frame'; draft: Draft }\n const items: Item[] = []\n let python: Draft | undefined\n let rust: Draft | undefined\n\n for (const original of rawLines) {\n const line = original.endsWith('\\r') ? original.slice(0, -1) : original\n const trimmed = line.trim()\n\n if (line.length > LINE_PATTERN_LIMIT || trimmed === '') {\n python = rust = undefined\n items.push({ type: 'text', text: line })\n continue\n }\n\n // Python prints the offending source line, indented, under its frame.\n if (python && /^\\s/.test(line) && !trimmed.startsWith('File \"')) {\n ;(python.detail ??= []).push(line)\n continue\n }\n\n if (rust && rust.file === undefined && RUST_LOCATION.test(trimmed)) {\n const split = splitLocation(RUST_LOCATION.exec(trimmed)![1]!)\n rust.file = split.file\n rust.line = split.line\n rust.column = split.column\n rust.raw = `${rust.raw}\\n${line}`\n continue\n }\n\n const draft = parsePython(trimmed) ?? parseRustFrame(trimmed, rustContext) ?? parseV8(trimmed)\n python = draft?.format === 'python' ? draft : undefined\n rust = draft?.format === 'rust' ? draft : undefined\n if (draft) items.push({ type: 'frame', draft })\n else items.push({ type: 'text', text: line })\n }\n if (overflow.length > 0) items.push({ type: 'text', text: overflow.join('\\n') })\n\n const counts = { v8: 0, python: 0, rust: 0 }\n for (const item of items) if (item.type === 'frame') counts[item.draft.format] += 1\n const total = counts.v8 + counts.python + counts.rust\n const format: StackTraceFormat =\n total === 0\n ? 'unknown'\n : counts.python >= counts.v8 && counts.python >= counts.rust\n ? 'python'\n : counts.rust >= counts.v8\n ? 'rust'\n : 'v8'\n\n const entries: StackEntry[] = items.map((item) =>\n item.type === 'text' ? item : { type: 'frame', frame: finishFrame(item.draft, options) }\n )\n\n if (format === 'unknown') return { format, entries, frames: [] }\n\n const header = liftHeader(entries, format)\n const frames = entries.flatMap((entry) => (entry.type === 'frame' ? [entry.frame] : []))\n return { format, ...(header && { header }), entries, frames }\n}\n\n/**\n * Take the header out of the entries it came from. V8 and Rust print it before\n * the frames; Python prints it after. The lifted lines are removed so they are\n * drawn once, as the header, and nothing else is touched.\n */\nfunction liftHeader(entries: StackEntry[], format: StackTraceFormat): StackTraceHeader | undefined {\n const firstFrame = entries.findIndex((entry) => entry.type === 'frame')\n\n if (format === 'python') {\n let last = entries.length - 1\n while (last >= 0 && (entries[last]!.type !== 'text' || isBlank(entries[last]!))) last -= 1\n let lastFrame = entries.length - 1\n while (lastFrame >= 0 && entries[lastFrame]!.type !== 'frame') lastFrame -= 1\n const entry = entries[last]\n // Only a line shaped like `Type: message` is taken as the header; anything\n // else after the last frame (`[Previous line repeated …]`) stays where it is.\n if (\n !entry ||\n entry.type !== 'text' ||\n last < lastFrame ||\n /^\\s/.test(entry.text) ||\n !TYPE_AND_MESSAGE.test(entry.text.trim())\n ) {\n return undefined\n }\n entries.splice(last, 1)\n return splitTypeAndMessage([entry.text.trim()])\n }\n\n if (format === 'rust') {\n const panicAt = entries.findIndex(\n (entry, index) =>\n index < firstFrame && entry.type === 'text' && /panicked at/.test(entry.text)\n )\n if (panicAt < 0) return undefined\n const first = (entries[panicAt] as { text: string }).text.trim()\n const at = first.indexOf(' at ')\n if (at < 0) return undefined\n const type = first.slice(0, at).trim()\n const after = first.slice(at + 4)\n const old = splitRustOldPanic(after)\n let consumed = 1\n let message: string\n let location: string | undefined\n if (old) {\n message = old.message\n location = old.location\n } else {\n location = after.replace(/:$/, '')\n const body: string[] = []\n for (let i = panicAt + 1; i < firstFrame; i += 1) {\n const entry = entries[i]!\n if (\n entry.type !== 'text' ||\n isBlank(entry) ||\n /^(?:note:|stack backtrace:)/.test(entry.text.trim())\n )\n break\n body.push(entry.text)\n consumed += 1\n }\n message = body.join('\\n')\n }\n entries.splice(panicAt, consumed)\n return { type, message, ...(location && { location }) }\n }\n\n // V8: the block of non-blank lines directly above the first frame. Anything\n // above a blank line, Node prints the source line that threw, stays as text.\n if (firstFrame <= 0) return undefined\n let start = firstFrame\n while (start > 0 && entries[start - 1]!.type === 'text' && !isBlank(entries[start - 1]!))\n start -= 1\n if (start === firstFrame) return undefined\n const lines = entries.slice(start, firstFrame).map((entry) => (entry as { text: string }).text)\n entries.splice(start, firstFrame - start)\n return splitTypeAndMessage(lines)\n}\n\nfunction isBlank(entry: StackEntry): boolean {\n return entry.type === 'text' && entry.text.trim() === ''\n}\n\n// ---------------------------------------------------------------------------\n// Grouping\n// ---------------------------------------------------------------------------\n\nexport type StackBlock =\n | Readonly<{ type: 'frame'; frame: StackFrame }>\n | Readonly<{ type: 'text'; text: string }>\n | Readonly<{ type: 'group'; frames: readonly StackFrame[] }>\n\n/**\n * Fold runs of dependency and runtime frames into groups, so a trace reads as\n * the code the reader owns with the framework's frames one click away.\n *\n * A run of one stays a frame, a disclosure around a single line costs more than\n * it saves. When there is no first-party frame at all nothing is grouped:\n * collapsing everything would hide the entire trace behind a button, which is the\n * opposite of what a reader who owns none of the frames needs.\n */\nexport function groupStackEntries(\n entries: readonly StackEntry[],\n collapse = true\n): readonly StackBlock[] {\n const hasFirstParty = entries.some(\n (entry) => entry.type === 'frame' && entry.frame.kind === 'first-party'\n )\n if (!collapse || !hasFirstParty) return entries\n\n const blocks: StackBlock[] = []\n let run: StackFrame[] = []\n const flush = () => {\n if (run.length >= 2) blocks.push({ type: 'group', frames: run })\n else for (const frame of run) blocks.push({ type: 'frame', frame })\n run = []\n }\n for (const entry of entries) {\n if (entry.type === 'frame' && entry.frame.kind !== 'first-party') {\n run.push(entry.frame)\n continue\n }\n flush()\n blocks.push(entry)\n }\n flush()\n return blocks\n}\n\nconst framesNoun = (count: number, word: string) =>\n `${count.toLocaleString()} ${word} ${count === 1 ? 'frame' : 'frames'}`\n\n/** What a collapsed group says it holds. */\nexport function describeFrameGroup(frames: readonly StackFrame[]): string {\n const count = frames.length\n const dependency = frames.filter((frame) => frame.kind === 'dependency').length\n if (dependency === count) return framesNoun(count, 'dependency')\n if (dependency === 0) return framesNoun(count, 'runtime')\n return `${count.toLocaleString()} dependency and runtime frames`\n}\n\n/** `file:line:col`, with whichever parts the frame has. */\nexport function frameLocation(frame: StackFrame): string | undefined {\n if (frame.file === undefined) return undefined\n const column = frame.column === undefined ? '' : `:${frame.column}`\n const line = frame.line === undefined ? '' : `:${frame.line}`\n return `${frame.file}${line}${line ? column : ''}`\n}\n\nconst LEADING_SPACE = /^[ \\t]*/\n\n/** Remove the indentation every non-blank line shares, so a source snippet sits flush. */\nexport function dedentLines(lines: readonly string[]): string[] {\n let indent = Infinity\n for (const line of lines) {\n if (line.trim() !== '') indent = Math.min(indent, LEADING_SPACE.exec(line)![0].length)\n }\n if (indent === Infinity) return [...lines]\n return lines.map((line) => line.slice(Math.min(indent, LEADING_SPACE.exec(line)![0].length)))\n}\n\nexport type BoundedLines = Readonly<{\n lines: string[]\n /** Lines beyond the bound that are not in `lines` at all. */\n omittedLines: number\n /** Characters beyond the bound, in omitted lines and in the cut end of the last shown line. */\n omittedChars: number\n}>\n\n/**\n * The first lines of `lines`, up to `maxLines` of them and `maxChars` characters\n * between them, with what was left out counted rather than dropped silently. It\n * visits the shown lines and adds up the length of the rest, so the cost does not\n * depend on how much text there is to omit.\n */\nexport function boundLines(\n lines: readonly string[],\n maxLines: number,\n maxChars: number\n): BoundedLines {\n const shown: string[] = []\n let chars = 0\n let index = 0\n let partial = 0\n while (index < lines.length && shown.length < maxLines) {\n const line = lines[index]!\n const room = maxChars - chars\n if (line.length <= room) {\n shown.push(line)\n chars += line.length\n index += 1\n continue\n }\n if (room > 0) {\n shown.push(line.slice(0, room))\n partial = line.length - room\n index += 1\n }\n break\n }\n let omittedChars = partial\n for (let rest = index; rest < lines.length; rest += 1) omittedChars += lines[rest]!.length\n return { lines: shown, omittedLines: lines.length - index, omittedChars }\n}\n"],"mappings":";AAqEA,IAAa,kBAAkB;AAC/B,IAAM,qBAAqB;AAa3B,SAAS,eAAe,OAA4D;CAClF,IAAI,IAAI,MAAM;CACd,OAAO,IAAI,KAAK,MAAM,WAAW,IAAI,CAAC,KAAK,MAAM,MAAM,WAAW,IAAI,CAAC,KAAK,IAAI,KAAK;CACrF,IAAI,MAAM,MAAM,UAAU,MAAM,KAAK,MAAM,IAAI,OAAO,OAAO,MAAM,SAAS,IAAI,GAC9E,OAAO,KAAA;CACT,OAAO;EAAE,OAAO,OAAO,MAAM,MAAM,CAAC,CAAC;EAAG,MAAM,MAAM,MAAM,GAAG,IAAI,CA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IAAY,KAAK,IAAI,MAAM;CACvD,OAAO,GAAG,MAAM,OAAO,OAAO,OAAO,SAAS;AAChD;AAEA,IAAM,gBAAgB;;AAGtB,SAAgB,YAAY,OAAoC;CAC9D,IAAI,SAAS;CACb,KAAK,MAAM,QAAQ,OACjB,IAAI,KAAK,KAAK,MAAM,IAAI,SAAS,KAAK,IAAI,QAAQ,cAAc,KAAK,IAAI,CAAC,CAAE,EAAE,CAAC,MAAM;CAEvF,IAAI,WAAW,UAAU,OAAO,CAAC,GAAG,KAAK;CACzC,OAAO,MAAM,KAAK,SAAS,KAAK,MAAM,KAAK,IAAI,QAAQ,cAAc,KAAK,IAAI,CAAC,CAAE,EAAE,CAAC,MAAM,CAAC,CAAC;AAC9F;;;;;;;AAgBA,SAAgB,WACd,OACA,UACA,UACc;CACd,MAAM,QAAkB,CAAC;CACzB,IAAI,QAAQ;CACZ,IAAI,QAAQ;CACZ,IAAI,UAAU;CACd,OAAO,QAAQ,MAAM,UAAU,MAAM,SAAS,UAAU;EACtD,MAAM,OAAO,MAAM;EACnB,MAAM,OAAO,WAAW;EACxB,IAAI,KAAK,UAAU,MAAM;GACvB,MAAM,KAAK,IAAI;GACf,SAAS,KAAK;GACd,SAAS;GACT;EACF;EACA,IAAI,OAAO,GAAG;GACZ,MAAM,KAAK,KAAK,MAAM,GAAG,IAAI,CAAC;GAC9B,UAAU,KAAK,SAAS;GACxB,SAAS;EACX;EACA;CACF;CACA,IAAI,eAAe;CACnB,KAAK,IAAI,OAAO,OAAO,OAAO,MAAM,QAAQ,QAAQ,GAAG,gBAAgB,MAAM,KAAK,CAAE;CACpF,OAAO;EAAE,OAAO;EAAO,cAAc,MAAM,SAAS;EAAO;CAAa;AAC1E"}
1
+ {"version":3,"file":"parse-stack-trace.js","names":[],"sources":["../../../../src/components/composites/stack-trace/parse-stack-trace.ts"],"sourcesContent":["/**\n * Stack traces, read without being trusted or trimmed.\n *\n * A trace is text a runtime wrote about itself, and every language writes it\n * differently. This parses the three a coding agent meets most: V8/Node\n * (`at fn (file:line:col)`), Python (`File \"x\", line N, in fn`) and Rust panic\n * backtraces (` 0: symbol` then `at file:line:col`), into frames, and does\n * three things a formatter would not:\n *\n * - **It never hides a line.** Every input line ends up in `entries`, as a frame\n * or as text, in order. A line the parser does not recognise is text, and a\n * trace it recognises nothing in has `format: 'unknown'` and `frames: []`, so a\n * caller falls back to showing the raw string. The header (error type and\n * message) is lifted out of the entries only when it is unambiguous.\n * - **It makes no claim about whose code a frame is without evidence.** A frame\n * is a dependency when its path says so (`node_modules`, `site-packages`,\n * `.cargo/registry`), internal when it belongs to the runtime (`node:` URLs,\n * Python's frozen modules, Rust's `std`), and first-party otherwise. A host that\n * knows better passes `classify`.\n * - **It is bounded.** Lines over 4 000 characters are never run through a\n * pattern, and input past 10 000 lines is kept as one trailing text entry. Every\n * pattern is anchored and linear, so a hostile trace cannot make parsing slow.\n *\n * Parsing is line-oriented and each line is classified on its own, so a trace\n * that mixes formats (a Node process that shells out to Python) keeps both.\n */\n\nexport type StackFrameKind = 'first-party' | 'dependency' | 'internal'\nexport type StackTraceFormat = 'v8' | 'python' | 'rust' | 'unknown'\n\nexport type StackFrame = Readonly<{\n /** The line exactly as written, minus its line ending. */\n raw: string\n function?: string\n /** The path or URL as written. Undefined for `<anonymous>`, `native` and the like. */\n file?: string\n line?: number\n column?: number\n kind: StackFrameKind\n async?: true\n /** Lines the runtime printed beneath the frame, such as Python's source line. */\n detail?: readonly string[]\n}>\n\nexport type StackEntry =\n | Readonly<{ type: 'frame'; frame: StackFrame }>\n | Readonly<{ type: 'text'; text: string }>\n\nexport type StackTraceHeader = Readonly<{\n /** `TypeError`, `ValueError`, `thread 'main' panicked`. */\n type?: string\n message: string\n /** Where a Rust panic says it happened. */\n location?: string\n}>\n\nexport type ParsedStackTrace = Readonly<{\n format: StackTraceFormat\n header?: StackTraceHeader\n /** Everything that is not the header, in order. */\n entries: readonly StackEntry[]\n frames: readonly StackFrame[]\n}>\n\nexport type ParseStackTraceOptions = {\n /** Override the built-in first-party/dependency/internal guess for a frame. */\n classify?: (frame: StackFrame) => StackFrameKind | undefined\n}\n\nexport const STACK_MAX_LINES = 10_000\nconst LINE_PATTERN_LIMIT = 4000\n\ntype Draft = {\n raw: string\n function?: string\n file?: string\n line?: number\n column?: number\n async?: true\n detail?: string[]\n format: 'v8' | 'python' | 'rust'\n}\n\nfunction trailingNumber(value: string): { value: number; rest: string } | undefined {\n let i = value.length\n while (i > 0 && value.charCodeAt(i - 1) >= 48 && value.charCodeAt(i - 1) <= 57) i -= 1\n if (i === value.length || i === 0 || value[i - 1] !== ':' || value.length - i > 9)\n return undefined\n return { value: Number(value.slice(i)), rest: value.slice(0, i - 1) }\n}\n\n/** Split `path:line:col` from the right, so a Windows drive or a URL port stays in the path. */\nexport function splitLocation(location: string): { file: string; line?: number; column?: number } {\n const last = trailingNumber(location)\n if (!last || last.rest === '') return { file: location }\n const before = trailingNumber(last.rest)\n if (before && before.rest !== '') {\n return { file: before.rest, line: before.value, column: last.value }\n }\n return { file: last.rest, line: last.value }\n}\n\n/**\n * Split the pre-1.78 Rust panic suffix `'message', location`. The message may\n * contain `', ` itself, and the greedy pattern this replaces took the last\n * occurrence with a non-space behind it, this scan keeps that last-wins\n * answer, in one pass, so a message repeating the marker stays linear.\n */\nfunction splitRustOldPanic(after: string): { message: string; location: string } | undefined {\n // As in `parsePython`: no `.` in the old pattern could cross a line break.\n if (/[\\n\\r\\u2028\\u2029]/.test(after) || !after.startsWith(\"'\")) return undefined\n let close: number | undefined\n let search = 1\n for (;;) {\n const at = after.indexOf(\"', \", search)\n if (at < 0) break\n search = at + 1\n const start = at + 3\n if (start >= after.length) continue\n // Preserve ECMAScript \\S, including NBSP/BOM and Unicode space separators.\n if (/\\s/.test(after[start]!)) continue\n close = at\n }\n if (close === undefined) return undefined\n return { message: after.slice(1, close), location: after.slice(close + 3) }\n}\n\nconst FILE_LIKE = /[\\\\/]|\\.[A-Za-z0-9]{1,6}$/\nconst URL_LIKE = /^node:/i\n\n/** Whether a V8 location is a place in a file rather than a runtime annotation. */\nfunction v8Location(location: string): Partial<Draft> | undefined {\n if (location === '<anonymous>' || location === 'native' || /^index \\d+$/.test(location)) {\n return {}\n }\n if (location.startsWith('eval at ')) return {}\n const split = splitLocation(location)\n if (split.line !== undefined || FILE_LIKE.test(split.file) || URL_LIKE.test(split.file)) {\n return { file: split.file, line: split.line, column: split.column }\n }\n return undefined\n}\n\nfunction parseV8(trimmed: string): Draft | undefined {\n if (!trimmed.startsWith('at ')) return undefined\n const rest = trimmed.slice(3)\n if (rest === '') return undefined\n\n let fn: string | undefined\n let location: string\n if (rest.endsWith(')') && rest.includes(' (')) {\n const open = rest.indexOf(' (')\n fn = rest.slice(0, open)\n location = rest.slice(open + 2, -1)\n } else {\n location = rest\n }\n const parsed = v8Location(location)\n if (!parsed) return undefined\n // Without parentheses the whole remainder was the location, and it must carry\n // a line or a path — otherwise \"at the end of the day\" would be a frame.\n if (\n fn === undefined &&\n parsed.file === undefined &&\n location !== '<anonymous>' &&\n location !== 'native'\n ) {\n return undefined\n }\n\n const draft: Draft = { raw: trimmed, format: 'v8', ...parsed }\n if (fn !== undefined) {\n if (fn.startsWith('async ')) {\n draft.async = true\n fn = fn.slice(6)\n }\n if (fn !== '') draft.function = fn\n }\n return draft\n}\n\nconst PYTHON_PREFIX = 'File \"'\nconst PYTHON_LINE = '\", line '\nconst PYTHON_IN = ', in '\n\n/** Whether a character is an ASCII digit, as `\\d` was in the pattern this replaced. */\nfunction isDigit(code: number): boolean {\n return code >= 48 && code <= 57\n}\n\n/**\n * Read a Python frame: `File \"<file>\", line <n>[, in <fn>]`.\n *\n * Scanned, not matched. A line repeating the frame shape many times must still\n * cost one pass, so the closing `\", line ` is found by walking its candidates\n * left to right. The last valid candidate wins, what the greedy pattern this\n * replaces would have settled on, so a file path containing a quote still\n * parses exactly as it always did.\n */\nfunction parsePython(trimmed: string): Draft | undefined {\n // `.` never matches a line break, so the whole-line pattern this replaces\n // could not have matched a string containing one either.\n if (/[\\n\\r\\u2028\\u2029]/.test(trimmed) || !trimmed.startsWith(PYTHON_PREFIX)) return undefined\n let close: number | undefined\n let digits = 0\n let rest = 0\n let hasIn = false\n let search = PYTHON_PREFIX.length\n for (;;) {\n const at = trimmed.indexOf(PYTHON_LINE, search)\n if (at < 0) break\n search = at + 1\n let end = at + PYTHON_LINE.length\n const start = end\n while (end < trimmed.length && isDigit(trimmed.charCodeAt(end))) end += 1\n if (end === start) continue\n if (end < trimmed.length && !trimmed.startsWith(PYTHON_IN, end)) continue\n close = at\n digits = end - start\n rest = end\n hasIn = end < trimmed.length\n }\n if (close === undefined) return undefined\n const draft: Draft = {\n raw: trimmed,\n format: 'python',\n file: trimmed.slice(PYTHON_PREFIX.length, close),\n line: Number(trimmed.slice(rest - digits, rest)),\n }\n if (hasIn) {\n const fn = trimmed.slice(rest + PYTHON_IN.length)\n if (fn) draft.function = fn\n }\n return draft\n}\n\nconst RUST_FRAME = /^(\\d+):\\s+(?:0x[0-9a-fA-F]+ - )?(\\S.*)$/\nconst RUST_LOCATION = /^at\\s+(\\S.*)$/\n\nfunction parseRustFrame(trimmed: string, rustContext: boolean): Draft | undefined {\n const match = RUST_FRAME.exec(trimmed)\n if (!match) return undefined\n const symbol = match[2]!\n if (!rustContext && !symbol.includes('::')) return undefined\n return { raw: trimmed, format: 'rust', function: symbol }\n}\n\nconst INTERNAL_RUST_SYMBOLS =\n /^(?:std|core|alloc)::|^<?(?:\\w+ as )?(?:std|core|alloc)::|^(?:rust_begin_unwind|rust_panic|__rust_|_start$|__libc_|_main$)/\n\n/** The built-in guess at whose code a frame is. See the module comment. */\nexport function classifyFrame(\n frame: Omit<StackFrame, 'kind'>,\n format: StackTraceFormat\n): StackFrameKind {\n const file = frame.file?.replaceAll('\\\\', '/')\n if (format === 'rust') {\n if (file !== undefined) {\n if (file.startsWith('/rustc/') || /\\/library\\/(?:std|core|alloc)\\//.test(file))\n return 'internal'\n if (/\\/\\.cargo\\/(?:registry|git)\\/|\\/registry\\/src\\//.test(file)) return 'dependency'\n return 'first-party'\n }\n return frame.function !== undefined && INTERNAL_RUST_SYMBOLS.test(frame.function)\n ? 'internal'\n : 'first-party'\n }\n if (file === undefined) return 'internal'\n if (format === 'python') {\n if (/\\/(?:site|dist)-packages\\//.test(file)) return 'dependency'\n if (\n file.startsWith('<') ||\n /\\/lib\\/python\\d/i.test(file) ||\n /\\/python\\d[\\d.]*\\/lib\\//i.test(file)\n ) {\n return 'internal'\n }\n return 'first-party'\n }\n if (file.startsWith('node:') || file.startsWith('internal/') || file.startsWith('wasm://')) {\n return 'internal'\n }\n if (file.includes('/node_modules/') || file.startsWith('node_modules/')) return 'dependency'\n return 'first-party'\n}\n\nfunction finishFrame(draft: Draft, options: ParseStackTraceOptions | undefined): StackFrame {\n const { format, detail, ...base } = draft\n const shape: Omit<StackFrame, 'kind'> = detail && detail.length > 0 ? { ...base, detail } : base\n // Classified by the frame's own format, so a mixed trace keeps both languages' rules.\n const guess = classifyFrame(shape, format)\n const override = options?.classify?.({ ...shape, kind: guess })\n return { ...shape, kind: override ?? guess }\n}\n\nconst TYPE_AND_MESSAGE = /^([A-Za-z_$][\\w$.]*)(?::\\s?([\\s\\S]*))?$/\n\nfunction splitTypeAndMessage(lines: readonly string[]): StackTraceHeader {\n const first = lines[0] ?? ''\n const match = TYPE_AND_MESSAGE.exec(first)\n const tail = lines.slice(1)\n if (!match) return { message: lines.join('\\n') }\n const message = [match[2] ?? '', ...tail].join('\\n').replace(/^\\n+/, '')\n return { type: match[1], message }\n}\n\n/** Parse a stack trace. Never throws, and every input line appears in the result. */\nexport function parseStackTrace(text: string, options?: ParseStackTraceOptions): ParsedStackTrace {\n const rawLines = text.split('\\n')\n const overflow = rawLines.length > STACK_MAX_LINES ? rawLines.splice(STACK_MAX_LINES) : []\n const rustContext = /panicked at|stack backtrace|RUST_BACKTRACE/.test(text.slice(0, 200_000))\n\n type Item = { type: 'text'; text: string } | { type: 'frame'; draft: Draft }\n const items: Item[] = []\n let python: Draft | undefined\n let rust: Draft | undefined\n\n for (const original of rawLines) {\n const line = original.endsWith('\\r') ? original.slice(0, -1) : original\n const trimmed = line.trim()\n\n if (line.length > LINE_PATTERN_LIMIT || trimmed === '') {\n python = rust = undefined\n items.push({ type: 'text', text: line })\n continue\n }\n\n // Python prints the offending source line, indented, under its frame.\n if (python && /^\\s/.test(line) && !trimmed.startsWith('File \"')) {\n ;(python.detail ??= []).push(line)\n continue\n }\n\n if (rust && rust.file === undefined && RUST_LOCATION.test(trimmed)) {\n const split = splitLocation(RUST_LOCATION.exec(trimmed)![1]!)\n rust.file = split.file\n rust.line = split.line\n rust.column = split.column\n rust.raw = `${rust.raw}\\n${line}`\n continue\n }\n\n const draft = parsePython(trimmed) ?? parseRustFrame(trimmed, rustContext) ?? parseV8(trimmed)\n python = draft?.format === 'python' ? draft : undefined\n rust = draft?.format === 'rust' ? draft : undefined\n if (draft) items.push({ type: 'frame', draft })\n else items.push({ type: 'text', text: line })\n }\n if (overflow.length > 0) items.push({ type: 'text', text: overflow.join('\\n') })\n\n const counts = { v8: 0, python: 0, rust: 0 }\n for (const item of items) if (item.type === 'frame') counts[item.draft.format] += 1\n const total = counts.v8 + counts.python + counts.rust\n const format: StackTraceFormat =\n total === 0\n ? 'unknown'\n : counts.python >= counts.v8 && counts.python >= counts.rust\n ? 'python'\n : counts.rust >= counts.v8\n ? 'rust'\n : 'v8'\n\n const entries: StackEntry[] = items.map((item) =>\n item.type === 'text' ? item : { type: 'frame', frame: finishFrame(item.draft, options) }\n )\n\n if (format === 'unknown') return { format, entries, frames: [] }\n\n const header = liftHeader(entries, format)\n const frames = entries.flatMap((entry) => (entry.type === 'frame' ? [entry.frame] : []))\n return { format, ...(header && { header }), entries, frames }\n}\n\n/**\n * Take the header out of the entries it came from. V8 and Rust print it before\n * the frames; Python prints it after. The lifted lines are removed so they are\n * drawn once, as the header, and nothing else is touched.\n */\nfunction liftHeader(entries: StackEntry[], format: StackTraceFormat): StackTraceHeader | undefined {\n const firstFrame = entries.findIndex((entry) => entry.type === 'frame')\n\n if (format === 'python') {\n let last = entries.length - 1\n while (last >= 0 && (entries[last]!.type !== 'text' || isBlank(entries[last]!))) last -= 1\n let lastFrame = entries.length - 1\n while (lastFrame >= 0 && entries[lastFrame]!.type !== 'frame') lastFrame -= 1\n const entry = entries[last]\n // Only a line shaped like `Type: message` is taken as the header; anything\n // else after the last frame (`[Previous line repeated …]`) stays where it is.\n if (\n !entry ||\n entry.type !== 'text' ||\n last < lastFrame ||\n /^\\s/.test(entry.text) ||\n !TYPE_AND_MESSAGE.test(entry.text.trim())\n ) {\n return undefined\n }\n entries.splice(last, 1)\n return splitTypeAndMessage([entry.text.trim()])\n }\n\n if (format === 'rust') {\n const panicAt = entries.findIndex(\n (entry, index) =>\n index < firstFrame && entry.type === 'text' && /panicked at/.test(entry.text)\n )\n if (panicAt < 0) return undefined\n const first = (entries[panicAt] as { text: string }).text.trim()\n const at = first.indexOf(' at ')\n if (at < 0) return undefined\n const type = first.slice(0, at).trim()\n const after = first.slice(at + 4)\n const old = splitRustOldPanic(after)\n let consumed = 1\n let message: string\n let location: string | undefined\n if (old) {\n message = old.message\n location = old.location\n } else {\n location = after.replace(/:$/, '')\n const body: string[] = []\n for (let i = panicAt + 1; i < firstFrame; i += 1) {\n const entry = entries[i]!\n if (\n entry.type !== 'text' ||\n isBlank(entry) ||\n /^(?:note:|stack backtrace:)/.test(entry.text.trim())\n )\n break\n body.push(entry.text)\n consumed += 1\n }\n message = body.join('\\n')\n }\n entries.splice(panicAt, consumed)\n return { type, message, ...(location && { location }) }\n }\n\n // V8: the block of non-blank lines directly above the first frame. Anything\n // above a blank line, Node prints the source line that threw, stays as text.\n if (firstFrame <= 0) return undefined\n let start = firstFrame\n while (start > 0 && entries[start - 1]!.type === 'text' && !isBlank(entries[start - 1]!))\n start -= 1\n if (start === firstFrame) return undefined\n const lines = entries.slice(start, firstFrame).map((entry) => (entry as { text: string }).text)\n entries.splice(start, firstFrame - start)\n return splitTypeAndMessage(lines)\n}\n\nfunction isBlank(entry: StackEntry): boolean {\n return entry.type === 'text' && entry.text.trim() === ''\n}\n\n// ---------------------------------------------------------------------------\n// Grouping\n// ---------------------------------------------------------------------------\n\nexport type StackBlock =\n | Readonly<{ type: 'frame'; frame: StackFrame }>\n | Readonly<{ type: 'text'; text: string }>\n | Readonly<{ type: 'group'; frames: readonly StackFrame[] }>\n\n/**\n * Fold runs of dependency and runtime frames into groups, so a trace reads as\n * the code the reader owns with the framework's frames one click away.\n *\n * A run of one stays a frame, a disclosure around a single line costs more than\n * it saves. When there is no first-party frame at all nothing is grouped:\n * collapsing everything would hide the entire trace behind a button, which is the\n * opposite of what a reader who owns none of the frames needs.\n */\nexport function groupStackEntries(\n entries: readonly StackEntry[],\n collapse = true\n): readonly StackBlock[] {\n const hasFirstParty = entries.some(\n (entry) => entry.type === 'frame' && entry.frame.kind === 'first-party'\n )\n if (!collapse || !hasFirstParty) return entries\n\n const blocks: StackBlock[] = []\n let run: StackFrame[] = []\n const flush = () => {\n if (run.length >= 2) blocks.push({ type: 'group', frames: run })\n else for (const frame of run) blocks.push({ type: 'frame', frame })\n run = []\n }\n for (const entry of entries) {\n if (entry.type === 'frame' && entry.frame.kind !== 'first-party') {\n run.push(entry.frame)\n continue\n }\n flush()\n blocks.push(entry)\n }\n flush()\n return blocks\n}\n\nconst framesNoun = (count: number, word: string) =>\n `${count.toLocaleString()} ${word} ${count === 1 ? 'frame' : 'frames'}`\n\n/** What a collapsed group says it holds. */\nexport function describeFrameGroup(frames: readonly StackFrame[]): string {\n const count = frames.length\n const dependency = frames.filter((frame) => frame.kind === 'dependency').length\n if (dependency === count) return framesNoun(count, 'dependency')\n if (dependency === 0) return framesNoun(count, 'runtime')\n return `${count.toLocaleString()} dependency and runtime frames`\n}\n\n/** `file:line:col`, with whichever parts the frame has. */\nexport function frameLocation(frame: StackFrame): string | undefined {\n if (frame.file === undefined) return undefined\n const column = frame.column === undefined ? '' : `:${frame.column}`\n const line = frame.line === undefined ? '' : `:${frame.line}`\n return `${frame.file}${line}${line ? column : ''}`\n}\n\nconst LEADING_SPACE = /^[ \\t]*/\n\n/** Remove the indentation every non-blank line shares, so a source snippet sits flush. */\nexport function dedentLines(lines: readonly string[]): string[] {\n let indent = Infinity\n for (const line of lines) {\n if (line.trim() !== '') indent = Math.min(indent, LEADING_SPACE.exec(line)![0].length)\n }\n if (indent === Infinity) return [...lines]\n return lines.map((line) => line.slice(Math.min(indent, LEADING_SPACE.exec(line)![0].length)))\n}\n\nexport type BoundedLines = Readonly<{\n lines: string[]\n /** Lines beyond the bound that are not in `lines` at all. */\n omittedLines: number\n /** Characters beyond the bound, in omitted lines and in the cut end of the last shown line. */\n omittedChars: number\n}>\n\n/**\n * The first lines of `lines`, up to `maxLines` of them and `maxChars` characters\n * between them, with what was left out counted rather than dropped silently. It\n * visits the shown lines and adds up the length of the rest, so the cost does not\n * depend on how much text there is to omit.\n */\nexport function boundLines(\n lines: readonly string[],\n maxLines: number,\n maxChars: number\n): BoundedLines {\n const shown: string[] = []\n let chars = 0\n let index = 0\n let partial = 0\n while (index < lines.length && shown.length < maxLines) {\n const line = lines[index]!\n const room = maxChars - chars\n if (line.length <= room) {\n shown.push(line)\n chars += line.length\n index += 1\n continue\n }\n if (room > 0) {\n shown.push(line.slice(0, room))\n partial = line.length - room\n index += 1\n }\n break\n }\n let omittedChars = partial\n for (let rest = index; rest < lines.length; rest += 1) omittedChars += lines[rest]!.length\n return { lines: shown, omittedLines: lines.length - index, omittedChars }\n}\n"],"mappings":";AAqEA,IAAa,kBAAkB;AAC/B,IAAM,qBAAqB;AAa3B,SAAS,eAAe,OAA4D;CAClF,IAAI,IAAI,MAAM;CACd,OAAO,IAAI,KAAK,MAAM,WAAW,IAAI,CAAC,KAAK,MAAM,MAAM,WAAW,IAAI,CAAC,KAAK,IAAI,KAAK;CACrF,IAAI,MAAM,MAAM,UAAU,MAAM,KAAK,MAAM,IAAI,OAAO,OAAO,MAAM,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effect, insert, memo, readShallow, setAttribute, spread, template } from "@solidjs/web";
2
+ import { Check as Check$1, CircleAlert as CircleAlert$1, Copy as Copy$1, Package as Package$1 } from "@lucide/solid";
3
+ import { For, Match, Show, Switch, createMemo, createSignal, omit } from "solid-js";
1
4
  import { createCopyFeedback } from "../../../lib/clipboard.js";
2
5
  import { cn } from "../../../lib/utils.js";
3
6
  import { Button } from "../../ui/button/button.js";
@@ -5,9 +8,6 @@ import { CodeBlock } from "../../ui/code-block/code-block.js";
5
8
  import { TraceLine } from "../../ui/trace/trace.js";
6
9
  import { boundLines, dedentLines, describeFrameGroup, frameLocation, groupStackEntries, parseStackTrace } from "./parse-stack-trace.js";
7
10
  import { fastIcon } from "../../../lib/fast-icon.js";
8
- import { className, createComponent, delegateEvents, effect, insert, memo, readShallow, setAttribute, spread, template } from "@solidjs/web";
9
- import { Check, CircleAlert, Copy, Package } from "@lucide/solid";
10
- import { For, Match, Show, Switch, createMemo, createSignal, omit } from "solid-js";
11
11
  // src/components/composites/stack-trace/stack-trace.tsx
12
12
  var _tmpl$ = /* @__PURE__ */ template(`<pre class="m-0 ms-1.5 px-1.5 font-code text-code whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]">`);
13
13
  var _tmpl$2 = /* @__PURE__ */ template(`<p class="m-0 ms-1.5 px-1.5 text-xs text-muted-foreground italic"> (copy has all of it)`);
@@ -31,10 +31,10 @@ var _tmpl$19 = /* @__PURE__ */ template(`<span class=text-muted-foreground>Stack
31
31
  var _tmpl$20 = /* @__PURE__ */ template(`<p class="m-0 whitespace-pre-wrap [overflow-wrap:anywhere]"><!><!>`);
32
32
  var _tmpl$21 = /* @__PURE__ */ template(`<span class=text-muted-foreground>: `);
33
33
  var _tmpl$22 = /* @__PURE__ */ template(`<p class="m-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]">`);
34
- var Check$1 = fastIcon(Check);
35
- var CircleAlert$1 = fastIcon(CircleAlert);
36
- var Copy$1 = fastIcon(Copy);
37
- var Package$1 = fastIcon(Package);
34
+ var Check = fastIcon(Check$1);
35
+ var CircleAlert = fastIcon(CircleAlert$1);
36
+ var Copy = fastIcon(Copy$1);
37
+ var Package = fastIcon(Package$1);
38
38
  var STACK_TRACE_MAX_BLOCKS = 200;
39
39
  var TEXT_DISPLAY_LIMIT = 1e4;
40
40
  /** What a frame's own printed lines (a Python source line, a locals dump) may show. */
@@ -110,7 +110,7 @@ function FrameGroup(props) {
110
110
  const hidden = () => props.frames.length - shown().length;
111
111
  return createComponent(TraceLine, {
112
112
  get icon() {
113
- return createComponent(Package$1, {});
113
+ return createComponent(Package, {});
114
114
  },
115
115
  get title() {
116
116
  return title();
@@ -335,7 +335,7 @@ function StackTrace(props) {
335
335
  var _el$29 = _tmpl$16();
336
336
  var _el$30 = _el$29.firstChild;
337
337
  var _el$31 = _el$30.nextSibling;
338
- insert(_el$29, createComponent(CircleAlert$1, {
338
+ insert(_el$29, createComponent(CircleAlert, {
339
339
  "aria-hidden": "true",
340
340
  class: "mt-0.5 size-4 shrink-0 text-destructive"
341
341
  }), _el$30);
@@ -405,7 +405,7 @@ function StackTrace(props) {
405
405
  return memo(() => {
406
406
  return memo(() => {
407
407
  return !!copied();
408
- })() ? createComponent(Check$1, { "aria-hidden": "true" }) : createComponent(Copy$1, { "aria-hidden": "true" });
408
+ })() ? createComponent(Check, { "aria-hidden": "true" }) : createComponent(Copy, { "aria-hidden": "true" });
409
409
  });
410
410
  }
411
411
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"stack-trace.js","names":["<Show when={bounded().omittedLines > 0 || bounded().omittedChars > 0}>\n <p class=\"m-0 ms-1.5 px-1.5 text-xs text-muted-foreground italic\">\n {omissionNote(bounded().omittedLines, bounded().omittedChars)}\n {' (copy has all of it)'}\n </p>\n </Show>","<p class=\"m-0 ms-1.5 px-1.5 text-xs text-muted-foreground italic\">\n {omissionNote(bounded().omittedLines, bounded().omittedChars)}\n {' (copy has all of it)'}\n </p>","<Show when={clipped()}>\n <span class=\"block text-xs text-muted-foreground italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n (copy has all of it)\n </span>\n </Show>","<span class=\"block text-xs text-muted-foreground italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n (copy has all of it)\n </span>","<TraceLine icon={<Package />} title={title()} open={open()} onOpenChange={setOpen}>\n <Show when={open()}>\n <ol role=\"list\" aria-label={title()} class=\"m-0 flex min-w-0 list-none flex-col gap-px p-0\">\n <For each={shown()}>{(frame) => <FrameRow frame={frame} onOpen={props.onOpen} />}</For>\n </ol>\n <Show when={hidden() > 0}>\n <ShowMore\n hidden={hidden()}\n pageSize={props.pageSize}\n onClick={() => setLimit(shown().length + props.pageSize)}\n />\n </Show>\n </Show>\n </TraceLine>","<Package />","onOpenChange={setOpen}","<Show when={open()}>\n <ol role=\"list\" aria-label={title()} class=\"m-0 flex min-w-0 list-none flex-col gap-px p-0\">\n <For each={shown()}>{(frame) => <FrameRow frame={frame} onOpen={props.onOpen} />}</For>\n </ol>\n <Show when={hidden() > 0}>\n <ShowMore\n hidden={hidden()}\n pageSize={props.pageSize}\n onClick={() => setLimit(shown().length + props.pageSize)}\n />\n </Show>\n </Show>","<For each={shown()}>{(frame) => <FrameRow frame={frame} onOpen={props.onOpen} />}</For>","<FrameRow frame={frame} onOpen={props.onOpen} />","<Show when={hidden() > 0}>\n <ShowMore\n hidden={hidden()}\n pageSize={props.pageSize}\n onClick={() => setLimit(shown().length + props.pageSize)}\n />\n </Show>","<ShowMore\n hidden={hidden()}\n pageSize={props.pageSize}\n onClick={() => setLimit(shown().length + props.pageSize)}\n />","onClick={() => setLimit(shown().length + props.pageSize)}","<Button variant=\"ghost\" size=\"2xs\" onClick={props.onClick}>\n Show {Math.min(props.hidden, props.pageSize).toLocaleString()} more (\n {props.hidden.toLocaleString()} hidden)\n </Button>","variant=\"ghost\"","size=\"2xs\"","Math.min(props.hidden, props.pageSize).toLocaleString()","props.hidden.toLocaleString()","<div class=\"ps-1.5\">\n <Button variant=\"ghost\" size=\"2xs\" onClick={props.onClick}>\n Show {Math.min(props.hidden, props.pageSize).toLocaleString()} more (\n {props.hidden.toLocaleString()} hidden)\n </Button>\n </div>","<span\n class={cn('font-code text-code', {\n 'text-foreground': first(),\n 'text-muted-foreground': !first(),\n })}\n >\n {props.frame.async ? 'async ' : ''}\n {props.frame.function ?? '(anonymous)'}\n </span>","<Show when={location()}>\n <span class=\"min-w-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n {location()}\n </span>\n </Show>","<Show when={!first()}>\n <span class=\"sr-only\">\n {props.frame.kind === 'dependency' ? 'in a dependency' : 'in the runtime'}\n </span>\n </Show>","class={cn(rowClass, interactiveClass)}","<li data-slot=\"stack-frame\" data-kind={props.frame.kind} class=\"min-w-0\">\n <Show\n when={props.onOpen !== undefined && props.frame.file !== undefined}\n fallback={<div class={rowClass}>{content()}</div>}\n >\n <button\n type=\"button\"\n aria-label={`Open ${props.frame.async ? 'async ' : ''}${props.frame.function ?? '(anonymous)'} ${location()}`}\n class={cn(rowClass, interactiveClass)}\n onClick={() => props.onOpen?.(props.frame)}\n >\n {content()}\n </button>\n </Show>\n <Show when={props.frame.detail && props.frame.detail.length > 0}>\n <FrameDetail lines={props.frame.detail!} />\n </Show>\n </li>","<FrameDetail lines={props.frame.detail!} />","<li class=\"min-w-0 px-1.5 py-0.5 font-code text-code whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n {clipped() ? props.text.slice(0, TEXT_DISPLAY_LIMIT) : props.text}\n <Show when={clipped()}>\n <span class=\"block font-sans text-xs italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n </span>\n </Show>\n </li>","<span class=\"block font-sans text-xs italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n </span>","<CircleAlert aria-hidden=\"true\" class=\"mt-0.5 size-4 shrink-0 text-destructive\" />","class=\"mt-0.5 size-4 shrink-0 text-destructive\"","<div class=\"group/stack flex items-start gap-2\">\n <CircleAlert aria-hidden=\"true\" class=\"mt-0.5 size-4 shrink-0 text-destructive\" />\n <div class=\"min-w-0 flex-1 text-sm\">\n <Show\n when={parsed().header}\n fallback={<span class=\"text-muted-foreground\">Stack trace</span>}\n >\n {(header) => (\n <>\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Show when={header().type}>\n <ClippedText class=\"font-semibold text-destructive\" text={header().type!} />\n <Show when={header().message !== ''}>\n <span class=\"text-muted-foreground\">: </span>\n </Show>\n </Show>\n <ClippedText class=\"text-foreground\" text={header().message} />\n </p>\n <Show when={header().location}>\n <p class=\"m-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n <ClippedText text={header().location!} />\n </p>\n </Show>\n </>\n )}\n </Show>\n </div>\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/stack:opacity-100 group-hover/stack:opacity-100 [@media(hover:none)]:opacity-100\">\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy stack trace')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>\n </div>\n </div>","<Show\n when={parsed().header}\n fallback={<span class=\"text-muted-foreground\">Stack trace</span>}\n >\n {(header) => (\n <>\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Show when={header().type}>\n <ClippedText class=\"font-semibold text-destructive\" text={header().type!} />\n <Show when={header().message !== ''}>\n <span class=\"text-muted-foreground\">: </span>\n </Show>\n </Show>\n <ClippedText class=\"text-foreground\" text={header().message} />\n </p>\n <Show when={header().location}>\n <p class=\"m-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n <ClippedText text={header().location!} />\n </p>\n </Show>\n </>\n )}\n </Show>","<span class=\"text-muted-foreground\">Stack trace</span>","<ClippedText class=\"font-semibold text-destructive\" text={header().type!} />","class=\"font-semibold text-destructive\"","<Show when={header().message !== ''}>\n <span class=\"text-muted-foreground\">: </span>\n </Show>","<span class=\"text-muted-foreground\">: </span>","<p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Show when={header().type}>\n <ClippedText class=\"font-semibold text-destructive\" text={header().type!} />\n <Show when={header().message !== ''}>\n <span class=\"text-muted-foreground\">: </span>\n </Show>\n </Show>\n <ClippedText class=\"text-foreground\" text={header().message} />\n </p>","<ClippedText class=\"text-foreground\" text={header().message} />","class=\"text-foreground\"","<Show when={header().location}>\n <p class=\"m-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n <ClippedText text={header().location!} />\n </p>\n </Show>","<ClippedText text={header().location!} />","<Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy stack trace')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>","size=\"icon-2xs\"","copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy stack trace')","onClick={() => void copy()}","<Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>","<Check aria-hidden=\"true\" />","<Copy aria-hidden=\"true\" />","<For each={shown()}>\n {(block) => (\n <Switch>\n <Match when={block.type === 'frame' && block}>\n {(entry) => (\n <FrameRow\n frame={(entry() as Extract<StackBlock, { type: 'frame' }>).frame}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n <Match when={block.type === 'text' && block}>\n {(entry) => (\n <TextRow text={(entry() as Extract<StackBlock, { type: 'text' }>).text} />\n )}\n </Match>\n <Match when={block.type === 'group' && block}>\n {(entry) => (\n <FrameGroup\n frames={(entry() as Extract<StackBlock, { type: 'group' }>).frames}\n defaultOpen={local.defaultDependenciesOpen}\n pageSize={pageSize()}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n </Switch>\n )}\n </For>","<Switch>\n <Match when={block.type === 'frame' && block}>\n {(entry) => (\n <FrameRow\n frame={(entry() as Extract<StackBlock, { type: 'frame' }>).frame}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n <Match when={block.type === 'text' && block}>\n {(entry) => (\n <TextRow text={(entry() as Extract<StackBlock, { type: 'text' }>).text} />\n )}\n </Match>\n <Match when={block.type === 'group' && block}>\n {(entry) => (\n <FrameGroup\n frames={(entry() as Extract<StackBlock, { type: 'group' }>).frames}\n defaultOpen={local.defaultDependenciesOpen}\n pageSize={pageSize()}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n </Switch>","<Match when={block.type === 'frame' && block}>\n {(entry) => (\n <FrameRow\n frame={(entry() as Extract<StackBlock, { type: 'frame' }>).frame}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>","<FrameRow\n frame={(entry() as Extract<StackBlock, { type: 'frame' }>).frame}\n onOpen={local.onOpenFrame}\n />","<Match when={block.type === 'text' && block}>\n {(entry) => (\n <TextRow text={(entry() as Extract<StackBlock, { type: 'text' }>).text} />\n )}\n </Match>","<TextRow text={(entry() as Extract<StackBlock, { type: 'text' }>).text} />","<Match when={block.type === 'group' && block}>\n {(entry) => (\n <FrameGroup\n frames={(entry() as Extract<StackBlock, { type: 'group' }>).frames}\n defaultOpen={local.defaultDependenciesOpen}\n pageSize={pageSize()}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>","<FrameGroup\n frames={(entry() as Extract<StackBlock, { type: 'group' }>).frames}\n defaultOpen={local.defaultDependenciesOpen}\n pageSize={pageSize()}\n onOpen={local.onOpenFrame}\n />","<Show when={hidden() > 0}>\n <div class=\"ms-2\">\n <ShowMore\n hidden={hidden()}\n pageSize={pageSize()}\n onClick={() => setLimit(shown().length + pageSize())}\n />\n </div>\n </Show>","<ShowMore\n hidden={hidden()}\n pageSize={pageSize()}\n onClick={() => setLimit(shown().length + pageSize())}\n />","onClick={() => setLimit(shown().length + pageSize())}","<div class=\"ms-2\">\n <ShowMore\n hidden={hidden()}\n pageSize={pageSize()}\n onClick={() => setLimit(shown().length + pageSize())}\n />\n </div>","<CodeBlock size=\"sm\" title=\"Error output\" code={local.text} complete wrap />","size=\"sm\"","title=\"Error output\"","<div\n data-slot=\"stack-trace\"\n data-format={parsed().format}\n class={cn('flex min-w-0 flex-col gap-1', local.class)}\n {...rest}\n >\n <Show\n when={parsed().format !== 'unknown'}\n fallback={\n // Nothing recognised: the whole text, in the block that copies it.\n <CodeBlock size=\"sm\" title=\"Error output\" code={local.text} complete wrap />\n }\n >\n <div class=\"group/stack flex items-start gap-2\">\n <CircleAlert aria-hidden=\"true\" class=\"mt-0.5 size-4 shrink-0 text-destructive\" />\n <div class=\"min-w-0 flex-1 text-sm\">\n <Show\n when={parsed().header}\n fallback={<span class=\"text-muted-foreground\">Stack trace</span>}\n >\n {(header) => (\n <>\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Show when={header().type}>\n <ClippedText class=\"font-semibold text-destructive\" text={header().type!} />\n <Show when={header().message !== ''}>\n <span class=\"text-muted-foreground\">: </span>\n </Show>\n </Show>\n <ClippedText class=\"text-foreground\" text={header().message} />\n </p>\n <Show when={header().location}>\n <p class=\"m-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n <ClippedText text={header().location!} />\n </p>\n </Show>\n </>\n )}\n </Show>\n </div>\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/stack:opacity-100 group-hover/stack:opacity-100 [@media(hover:none)]:opacity-100\">\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy stack trace')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>\n </div>\n </div>\n\n <ol\n role=\"list\"\n aria-label=\"Stack frames\"\n class=\"m-0 ms-2 flex min-w-0 list-none flex-col gap-px border-s border-border p-0 ps-2\"\n >\n <For each={shown()}>\n {(block) => (\n <Switch>\n <Match when={block.type === 'frame' && block}>\n {(entry) => (\n <FrameRow\n frame={(entry() as Extract<StackBlock, { type: 'frame' }>).frame}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n <Match when={block.type === 'text' && block}>\n {(entry) => (\n <TextRow text={(entry() as Extract<StackBlock, { type: 'text' }>).text} />\n )}\n </Match>\n <Match when={block.type === 'group' && block}>\n {(entry) => (\n <FrameGroup\n frames={(entry() as Extract<StackBlock, { type: 'group' }>).frames}\n defaultOpen={local.defaultDependenciesOpen}\n pageSize={pageSize()}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n </Switch>\n )}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <div class=\"ms-2\">\n <ShowMore\n hidden={hidden()}\n pageSize={pageSize()}\n onClick={() => setLimit(shown().length + pageSize())}\n />\n </div>\n </Show>\n </Show>\n </div>","Check","LucideCheck","CircleAlert","LucideCircleAlert","Copy","LucideCopy","Package","LucidePackage","_$readShallow","_$setAttribute"],"sources":["../../../../src/components/composites/stack-trace/stack-trace.tsx"],"sourcesContent":["import {\n Check as LucideCheck,\n CircleAlert as LucideCircleAlert,\n Copy as LucideCopy,\n Package as LucidePackage,\n} from '@lucide/solid'\nimport { createMemo, createSignal, For, Match, Show, omit, Switch } from 'solid-js'\nimport { type ComponentProps } from '@solidjs/web'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { CodeBlock } from '../../ui/code-block'\nimport { TraceLine } from '../../ui/trace'\nimport {\n boundLines,\n dedentLines,\n describeFrameGroup,\n frameLocation,\n groupStackEntries,\n parseStackTrace,\n type ParseStackTraceOptions,\n type StackBlock,\n type StackFrame,\n} from './parse-stack-trace'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst CircleAlert = fastIcon(LucideCircleAlert)\nconst Copy = fastIcon(LucideCopy)\nconst Package = fastIcon(LucidePackage)\n\n/**\n * StackTrace.\n *\n * A failed call and the frames it failed through. Put it in the body of the\n * `TraceLine` for the call that failed, or under a failing test; reach for\n * `CodeBlock` when the text is not a trace, and for `Terminal` when it is the\n * live output of a command rather than one error.\n *\n * ## The reader's code first\n *\n * A trace is mostly someone else's frames. Runs of dependency and runtime frames\n * (`node_modules`, `site-packages`, `.cargo/registry`, `node:` internals, Rust's\n * `std`) fold into one disclosure line that says what it holds, and a lone\n * dependency frame is dimmed rather than folded. When *none* of the frames is the\n * reader's, nothing folds: hiding the whole trace behind a button helps nobody.\n * Whose code a frame is comes from its path; a host that knows the project layout\n * passes `classify`.\n *\n * ## It never hides a line\n *\n * Every line of `text` is on screen in order, as a frame, as a header, or as\n * muted text, and a trace in a format this does not know is shown whole in a\n * `CodeBlock`, which also copies it. Copy writes `text` exactly as given, not a\n * reformatted version of what was parsed.\n *\n * ## Opening a frame is the host's decision\n *\n * A frame is a button only when `onOpenFrame` is supplied, and only when the\n * frame names a file; without it frames are plain text, because a control that\n * does nothing is a tab stop with no purpose. The component never builds a path\n * or tries to open one, the trace is untrusted text, and what a path in it means\n * on this machine is the host's call.\n *\n * Text is text throughout: frames, messages and source lines are rendered as text\n * nodes, long unbroken tokens wrap rather than widening the column, and what is\n * drawn is bounded with the omission stated every time: a text line or a header\n * message beyond 10 000 characters, a frame's printed lines beyond 40 lines or\n * 10 000 characters, and the frames of a folded group, which are built only while\n * it is open and then `maxBlocks` at a time. Copy and `onOpenFrame` still get all of\n * it.\n */\nexport type StackTraceProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** The trace exactly as the runtime printed it. */\n text: string\n /** Make frames that name a file open it. Omit to render them as plain text. */\n onOpenFrame?: (frame: StackFrame) => void\n classify?: ParseStackTraceOptions['classify']\n /** Fold runs of dependency and runtime frames. Default true. */\n collapseDependencies?: boolean\n /** Start folded groups open. */\n defaultDependenciesOpen?: boolean\n /** Blocks (frames, groups, text) shown before \"show more\". Default 200. */\n maxBlocks?: number\n copyLabel?: string\n copiedLabel?: string\n /** Called after each copy attempt with whether the clipboard accepted it. */\n onCopy?: (ok: boolean) => void\n}\n\nexport const STACK_TRACE_MAX_BLOCKS = 200\nconst TEXT_DISPLAY_LIMIT = 10_000\n/** What a frame's own printed lines (a Python source line, a locals dump) may show. */\nconst DETAIL_LINE_LIMIT = 40\nconst DETAIL_CHAR_LIMIT = 10_000\n\nconst rowClass =\n 'flex min-w-0 flex-wrap items-baseline gap-x-2 rounded-md px-1.5 py-0.5 text-start text-xs outline-none'\nconst interactiveClass =\n 'w-full cursor-pointer transition-colors ease-out hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-primary-subtle focus-visible:border-ring'\n\nfunction omissionNote(lines: number, chars: number): string {\n return lines > 0\n ? `… ${lines.toLocaleString()} more ${lines === 1 ? 'line' : 'lines'} (${chars.toLocaleString()} characters) not shown`\n : `… ${chars.toLocaleString()} more characters not shown`\n}\n\n/** A frame's printed lines, bounded so one frame cannot be the whole page. */\nfunction FrameDetail(props: { lines: readonly string[] }) {\n const bounded = createMemo(() => boundLines(props.lines, DETAIL_LINE_LIMIT, DETAIL_CHAR_LIMIT))\n return (\n <>\n <pre class=\"m-0 ms-1.5 px-1.5 font-code text-code whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n {dedentLines(bounded().lines).join('\\n')}\n </pre>\n <Show when={bounded().omittedLines > 0 || bounded().omittedChars > 0}>\n <p class=\"m-0 ms-1.5 px-1.5 text-xs text-muted-foreground italic\">\n {omissionNote(bounded().omittedLines, bounded().omittedChars)}\n {' (copy has all of it)'}\n </p>\n </Show>\n </>\n )\n}\n\n/** Header text, cut to the display limit with what was cut stated. */\nfunction ClippedText(props: { text: string; class?: string }) {\n const clipped = () => props.text.length > TEXT_DISPLAY_LIMIT\n return (\n <>\n <span class={props.class}>\n {clipped() ? props.text.slice(0, TEXT_DISPLAY_LIMIT) : props.text}\n </span>\n <Show when={clipped()}>\n <span class=\"block text-xs text-muted-foreground italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n (copy has all of it)\n </span>\n </Show>\n </>\n )\n}\n\n/**\n * A folded run of dependency or runtime frames. Its rows are built only while it\n * is open and then a page at a time, so a run of ten thousand frames costs the\n * same as one of a few hundred until the reader asks for more.\n */\nfunction FrameGroup(props: {\n frames: readonly StackFrame[]\n defaultOpen?: boolean\n pageSize: number\n onOpen?: (frame: StackFrame) => void\n}) {\n const [open, setOpen] = createSignal(() => props.defaultOpen === true)\n const [limit, setLimit] = createSignal<number | undefined>()\n const title = createMemo(() => describeFrameGroup(props.frames))\n const shown = createMemo(() => props.frames.slice(0, limit() ?? props.pageSize))\n const hidden = () => props.frames.length - shown().length\n return (\n <TraceLine icon={<Package />} title={title()} open={open()} onOpenChange={setOpen}>\n <Show when={open()}>\n <ol role=\"list\" aria-label={title()} class=\"m-0 flex min-w-0 list-none flex-col gap-px p-0\">\n <For each={shown()}>{(frame) => <FrameRow frame={frame} onOpen={props.onOpen} />}</For>\n </ol>\n <Show when={hidden() > 0}>\n <ShowMore\n hidden={hidden()}\n pageSize={props.pageSize}\n onClick={() => setLimit(shown().length + props.pageSize)}\n />\n </Show>\n </Show>\n </TraceLine>\n )\n}\n\nfunction ShowMore(props: { hidden: number; pageSize: number; onClick: () => void }) {\n return (\n <div class=\"ps-1.5\">\n <Button variant=\"ghost\" size=\"2xs\" onClick={props.onClick}>\n Show {Math.min(props.hidden, props.pageSize).toLocaleString()} more (\n {props.hidden.toLocaleString()} hidden)\n </Button>\n </div>\n )\n}\n\nfunction FrameRow(props: { frame: StackFrame; onOpen?: (frame: StackFrame) => void }) {\n const location = () => frameLocation(props.frame)\n const first = () => props.frame.kind === 'first-party'\n const content = () => (\n <>\n <span\n class={cn('font-code text-code', {\n 'text-foreground': first(),\n 'text-muted-foreground': !first(),\n })}\n >\n {props.frame.async ? 'async ' : ''}\n {props.frame.function ?? '(anonymous)'}\n </span>\n <Show when={location()}>\n <span class=\"min-w-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n {location()}\n </span>\n </Show>\n {/* The dimming is a colour; the kind is also spoken. */}\n <Show when={!first()}>\n <span class=\"sr-only\">\n {props.frame.kind === 'dependency' ? 'in a dependency' : 'in the runtime'}\n </span>\n </Show>\n </>\n )\n return (\n <li data-slot=\"stack-frame\" data-kind={props.frame.kind} class=\"min-w-0\">\n <Show\n when={props.onOpen !== undefined && props.frame.file !== undefined}\n fallback={<div class={rowClass}>{content()}</div>}\n >\n <button\n type=\"button\"\n aria-label={`Open ${props.frame.async ? 'async ' : ''}${props.frame.function ?? '(anonymous)'} ${location()}`}\n class={cn(rowClass, interactiveClass)}\n onClick={() => props.onOpen?.(props.frame)}\n >\n {content()}\n </button>\n </Show>\n <Show when={props.frame.detail && props.frame.detail.length > 0}>\n <FrameDetail lines={props.frame.detail!} />\n </Show>\n </li>\n )\n}\n\nfunction TextRow(props: { text: string }) {\n const clipped = () => props.text.length > TEXT_DISPLAY_LIMIT\n return (\n <li class=\"min-w-0 px-1.5 py-0.5 font-code text-code whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n {clipped() ? props.text.slice(0, TEXT_DISPLAY_LIMIT) : props.text}\n <Show when={clipped()}>\n <span class=\"block font-sans text-xs italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n </span>\n </Show>\n </li>\n )\n}\n\nexport function StackTrace(props: StackTraceProps) {\n const local = props\n const rest = omit(\n props,\n 'text',\n 'onOpenFrame',\n 'classify',\n 'collapseDependencies',\n 'defaultDependenciesOpen',\n 'maxBlocks',\n 'copyLabel',\n 'copiedLabel',\n 'onCopy',\n 'class'\n )\n\n const parsed = createMemo(() => parseStackTrace(local.text, { classify: local.classify }))\n const blocks = createMemo<readonly StackBlock[]>(() =>\n groupStackEntries(parsed().entries, local.collapseDependencies !== false).filter(\n // A blank line between paragraphs of a trace carries nothing to draw.\n (block) => block.type !== 'text' || block.text.trim() !== ''\n )\n )\n const pageSize = () => Math.max(1, Math.floor(local.maxBlocks ?? STACK_TRACE_MAX_BLOCKS))\n const [limit, setLimit] = createSignal<number | undefined>()\n const shown = createMemo(() => blocks().slice(0, limit() ?? pageSize()))\n const hidden = () => blocks().length - shown().length\n\n const { copied, failed: copyFailed, copy: copyText } = createCopyFeedback()\n const copy = async () => {\n const ok = await copyText(local.text)\n local.onCopy?.(ok)\n }\n\n return (\n <div\n data-slot=\"stack-trace\"\n data-format={parsed().format}\n class={cn('flex min-w-0 flex-col gap-1', local.class)}\n {...rest}\n >\n <Show\n when={parsed().format !== 'unknown'}\n fallback={\n // Nothing recognised: the whole text, in the block that copies it.\n <CodeBlock size=\"sm\" title=\"Error output\" code={local.text} complete wrap />\n }\n >\n <div class=\"group/stack flex items-start gap-2\">\n <CircleAlert aria-hidden=\"true\" class=\"mt-0.5 size-4 shrink-0 text-destructive\" />\n <div class=\"min-w-0 flex-1 text-sm\">\n <Show\n when={parsed().header}\n fallback={<span class=\"text-muted-foreground\">Stack trace</span>}\n >\n {(header) => (\n <>\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Show when={header().type}>\n <ClippedText class=\"font-semibold text-destructive\" text={header().type!} />\n <Show when={header().message !== ''}>\n <span class=\"text-muted-foreground\">: </span>\n </Show>\n </Show>\n <ClippedText class=\"text-foreground\" text={header().message} />\n </p>\n <Show when={header().location}>\n <p class=\"m-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n <ClippedText text={header().location!} />\n </p>\n </Show>\n </>\n )}\n </Show>\n </div>\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/stack:opacity-100 group-hover/stack:opacity-100 [@media(hover:none)]:opacity-100\">\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy stack trace')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>\n </div>\n </div>\n\n <ol\n role=\"list\"\n aria-label=\"Stack frames\"\n class=\"m-0 ms-2 flex min-w-0 list-none flex-col gap-px border-s border-border p-0 ps-2\"\n >\n <For each={shown()}>\n {(block) => (\n <Switch>\n <Match when={block.type === 'frame' && block}>\n {(entry) => (\n <FrameRow\n frame={(entry() as Extract<StackBlock, { type: 'frame' }>).frame}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n <Match when={block.type === 'text' && block}>\n {(entry) => (\n <TextRow text={(entry() as Extract<StackBlock, { type: 'text' }>).text} />\n )}\n </Match>\n <Match when={block.type === 'group' && block}>\n {(entry) => (\n <FrameGroup\n frames={(entry() as Extract<StackBlock, { type: 'group' }>).frames}\n defaultOpen={local.defaultDependenciesOpen}\n pageSize={pageSize()}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n </Switch>\n )}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <div class=\"ms-2\">\n <ShowMore\n hidden={hidden()}\n pageSize={pageSize()}\n onClick={() => setLimit(shown().length + pageSize())}\n />\n </div>\n </Show>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAMgE,UAAQ,SAASC,KAAW;AAClC,IAAMC,gBAAc,SAASC,WAAiB;AAC9C,IAAMC,SAAO,SAASC,IAAU;AAChC,IAAMC,YAAU,SAASC,OAAa;AA6DtC,IAAa,yB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AA,SAAA;QAAQ,OAAA,OAAO;OAAC;OAChB,IAAA,WAAA;QAAU,OAAA,SAAS;OAAC;OACpBC,eAAe,SAAS,MAAM,CAAC,CAAC,SAAS,SAAS,CAAC;MACpD,CAAA,CACE;MAPP,OACEC;KAOI;;GAvFP,IAHGC,gBAAAA,WAAAA;IAAWC,MAAK;IAAKC,OAAM;IAAe,IAAA,OAAA;KAAM,OAAA,MAAM;IAAI;IAAE,UAAA;IAAS,MAAA;GAAM,CAAA;EA2FzE;CAAC,EAAA,CAAD,CACH;CAvGP,OACEC;AAwGJ"}
1
+ {"version":3,"file":"stack-trace.js","names":["<Show when={bounded().omittedLines > 0 || bounded().omittedChars > 0}>\n <p class=\"m-0 ms-1.5 px-1.5 text-xs text-muted-foreground italic\">\n {omissionNote(bounded().omittedLines, bounded().omittedChars)}\n {' (copy has all of it)'}\n </p>\n </Show>","<p class=\"m-0 ms-1.5 px-1.5 text-xs text-muted-foreground italic\">\n {omissionNote(bounded().omittedLines, bounded().omittedChars)}\n {' (copy has all of it)'}\n </p>","<Show when={clipped()}>\n <span class=\"block text-xs text-muted-foreground italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n (copy has all of it)\n </span>\n </Show>","<span class=\"block text-xs text-muted-foreground italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n (copy has all of it)\n </span>","<TraceLine icon={<Package />} title={title()} open={open()} onOpenChange={setOpen}>\n <Show when={open()}>\n <ol role=\"list\" aria-label={title()} class=\"m-0 flex min-w-0 list-none flex-col gap-px p-0\">\n <For each={shown()}>{(frame) => <FrameRow frame={frame} onOpen={props.onOpen} />}</For>\n </ol>\n <Show when={hidden() > 0}>\n <ShowMore\n hidden={hidden()}\n pageSize={props.pageSize}\n onClick={() => setLimit(shown().length + props.pageSize)}\n />\n </Show>\n </Show>\n </TraceLine>","<Package />","onOpenChange={setOpen}","<Show when={open()}>\n <ol role=\"list\" aria-label={title()} class=\"m-0 flex min-w-0 list-none flex-col gap-px p-0\">\n <For each={shown()}>{(frame) => <FrameRow frame={frame} onOpen={props.onOpen} />}</For>\n </ol>\n <Show when={hidden() > 0}>\n <ShowMore\n hidden={hidden()}\n pageSize={props.pageSize}\n onClick={() => setLimit(shown().length + props.pageSize)}\n />\n </Show>\n </Show>","<For each={shown()}>{(frame) => <FrameRow frame={frame} onOpen={props.onOpen} />}</For>","<FrameRow frame={frame} onOpen={props.onOpen} />","<Show when={hidden() > 0}>\n <ShowMore\n hidden={hidden()}\n pageSize={props.pageSize}\n onClick={() => setLimit(shown().length + props.pageSize)}\n />\n </Show>","<ShowMore\n hidden={hidden()}\n pageSize={props.pageSize}\n onClick={() => setLimit(shown().length + props.pageSize)}\n />","onClick={() => setLimit(shown().length + props.pageSize)}","<Button variant=\"ghost\" size=\"2xs\" onClick={props.onClick}>\n Show {Math.min(props.hidden, props.pageSize).toLocaleString()} more (\n {props.hidden.toLocaleString()} hidden)\n </Button>","variant=\"ghost\"","size=\"2xs\"","Math.min(props.hidden, props.pageSize).toLocaleString()","props.hidden.toLocaleString()","<div class=\"ps-1.5\">\n <Button variant=\"ghost\" size=\"2xs\" onClick={props.onClick}>\n Show {Math.min(props.hidden, props.pageSize).toLocaleString()} more (\n {props.hidden.toLocaleString()} hidden)\n </Button>\n </div>","<span\n class={cn('font-code text-code', {\n 'text-foreground': first(),\n 'text-muted-foreground': !first(),\n })}\n >\n {props.frame.async ? 'async ' : ''}\n {props.frame.function ?? '(anonymous)'}\n </span>","<Show when={location()}>\n <span class=\"min-w-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n {location()}\n </span>\n </Show>","<Show when={!first()}>\n <span class=\"sr-only\">\n {props.frame.kind === 'dependency' ? 'in a dependency' : 'in the runtime'}\n </span>\n </Show>","class={cn(rowClass, interactiveClass)}","<li data-slot=\"stack-frame\" data-kind={props.frame.kind} class=\"min-w-0\">\n <Show\n when={props.onOpen !== undefined && props.frame.file !== undefined}\n fallback={<div class={rowClass}>{content()}</div>}\n >\n <button\n type=\"button\"\n aria-label={`Open ${props.frame.async ? 'async ' : ''}${props.frame.function ?? '(anonymous)'} ${location()}`}\n class={cn(rowClass, interactiveClass)}\n onClick={() => props.onOpen?.(props.frame)}\n >\n {content()}\n </button>\n </Show>\n <Show when={props.frame.detail && props.frame.detail.length > 0}>\n <FrameDetail lines={props.frame.detail!} />\n </Show>\n </li>","<FrameDetail lines={props.frame.detail!} />","<li class=\"min-w-0 px-1.5 py-0.5 font-code text-code whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n {clipped() ? props.text.slice(0, TEXT_DISPLAY_LIMIT) : props.text}\n <Show when={clipped()}>\n <span class=\"block font-sans text-xs italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n </span>\n </Show>\n </li>","<span class=\"block font-sans text-xs italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n </span>","<CircleAlert aria-hidden=\"true\" class=\"mt-0.5 size-4 shrink-0 text-destructive\" />","class=\"mt-0.5 size-4 shrink-0 text-destructive\"","<div class=\"group/stack flex items-start gap-2\">\n <CircleAlert aria-hidden=\"true\" class=\"mt-0.5 size-4 shrink-0 text-destructive\" />\n <div class=\"min-w-0 flex-1 text-sm\">\n <Show\n when={parsed().header}\n fallback={<span class=\"text-muted-foreground\">Stack trace</span>}\n >\n {(header) => (\n <>\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Show when={header().type}>\n <ClippedText class=\"font-semibold text-destructive\" text={header().type!} />\n <Show when={header().message !== ''}>\n <span class=\"text-muted-foreground\">: </span>\n </Show>\n </Show>\n <ClippedText class=\"text-foreground\" text={header().message} />\n </p>\n <Show when={header().location}>\n <p class=\"m-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n <ClippedText text={header().location!} />\n </p>\n </Show>\n </>\n )}\n </Show>\n </div>\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/stack:opacity-100 group-hover/stack:opacity-100 [@media(hover:none)]:opacity-100\">\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy stack trace')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>\n </div>\n </div>","<Show\n when={parsed().header}\n fallback={<span class=\"text-muted-foreground\">Stack trace</span>}\n >\n {(header) => (\n <>\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Show when={header().type}>\n <ClippedText class=\"font-semibold text-destructive\" text={header().type!} />\n <Show when={header().message !== ''}>\n <span class=\"text-muted-foreground\">: </span>\n </Show>\n </Show>\n <ClippedText class=\"text-foreground\" text={header().message} />\n </p>\n <Show when={header().location}>\n <p class=\"m-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n <ClippedText text={header().location!} />\n </p>\n </Show>\n </>\n )}\n </Show>","<span class=\"text-muted-foreground\">Stack trace</span>","<ClippedText class=\"font-semibold text-destructive\" text={header().type!} />","class=\"font-semibold text-destructive\"","<Show when={header().message !== ''}>\n <span class=\"text-muted-foreground\">: </span>\n </Show>","<span class=\"text-muted-foreground\">: </span>","<p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Show when={header().type}>\n <ClippedText class=\"font-semibold text-destructive\" text={header().type!} />\n <Show when={header().message !== ''}>\n <span class=\"text-muted-foreground\">: </span>\n </Show>\n </Show>\n <ClippedText class=\"text-foreground\" text={header().message} />\n </p>","<ClippedText class=\"text-foreground\" text={header().message} />","class=\"text-foreground\"","<Show when={header().location}>\n <p class=\"m-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n <ClippedText text={header().location!} />\n </p>\n </Show>","<ClippedText text={header().location!} />","<Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy stack trace')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>","size=\"icon-2xs\"","copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy stack trace')","onClick={() => void copy()}","<Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>","<Check aria-hidden=\"true\" />","<Copy aria-hidden=\"true\" />","<For each={shown()}>\n {(block) => (\n <Switch>\n <Match when={block.type === 'frame' && block}>\n {(entry) => (\n <FrameRow\n frame={(entry() as Extract<StackBlock, { type: 'frame' }>).frame}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n <Match when={block.type === 'text' && block}>\n {(entry) => (\n <TextRow text={(entry() as Extract<StackBlock, { type: 'text' }>).text} />\n )}\n </Match>\n <Match when={block.type === 'group' && block}>\n {(entry) => (\n <FrameGroup\n frames={(entry() as Extract<StackBlock, { type: 'group' }>).frames}\n defaultOpen={local.defaultDependenciesOpen}\n pageSize={pageSize()}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n </Switch>\n )}\n </For>","<Switch>\n <Match when={block.type === 'frame' && block}>\n {(entry) => (\n <FrameRow\n frame={(entry() as Extract<StackBlock, { type: 'frame' }>).frame}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n <Match when={block.type === 'text' && block}>\n {(entry) => (\n <TextRow text={(entry() as Extract<StackBlock, { type: 'text' }>).text} />\n )}\n </Match>\n <Match when={block.type === 'group' && block}>\n {(entry) => (\n <FrameGroup\n frames={(entry() as Extract<StackBlock, { type: 'group' }>).frames}\n defaultOpen={local.defaultDependenciesOpen}\n pageSize={pageSize()}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n </Switch>","<Match when={block.type === 'frame' && block}>\n {(entry) => (\n <FrameRow\n frame={(entry() as Extract<StackBlock, { type: 'frame' }>).frame}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>","<FrameRow\n frame={(entry() as Extract<StackBlock, { type: 'frame' }>).frame}\n onOpen={local.onOpenFrame}\n />","<Match when={block.type === 'text' && block}>\n {(entry) => (\n <TextRow text={(entry() as Extract<StackBlock, { type: 'text' }>).text} />\n )}\n </Match>","<TextRow text={(entry() as Extract<StackBlock, { type: 'text' }>).text} />","<Match when={block.type === 'group' && block}>\n {(entry) => (\n <FrameGroup\n frames={(entry() as Extract<StackBlock, { type: 'group' }>).frames}\n defaultOpen={local.defaultDependenciesOpen}\n pageSize={pageSize()}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>","<FrameGroup\n frames={(entry() as Extract<StackBlock, { type: 'group' }>).frames}\n defaultOpen={local.defaultDependenciesOpen}\n pageSize={pageSize()}\n onOpen={local.onOpenFrame}\n />","<Show when={hidden() > 0}>\n <div class=\"ms-2\">\n <ShowMore\n hidden={hidden()}\n pageSize={pageSize()}\n onClick={() => setLimit(shown().length + pageSize())}\n />\n </div>\n </Show>","<ShowMore\n hidden={hidden()}\n pageSize={pageSize()}\n onClick={() => setLimit(shown().length + pageSize())}\n />","onClick={() => setLimit(shown().length + pageSize())}","<div class=\"ms-2\">\n <ShowMore\n hidden={hidden()}\n pageSize={pageSize()}\n onClick={() => setLimit(shown().length + pageSize())}\n />\n </div>","<CodeBlock size=\"sm\" title=\"Error output\" code={local.text} complete wrap />","size=\"sm\"","title=\"Error output\"","<div\n data-slot=\"stack-trace\"\n data-format={parsed().format}\n class={cn('flex min-w-0 flex-col gap-1', local.class)}\n {...rest}\n >\n <Show\n when={parsed().format !== 'unknown'}\n fallback={\n // Nothing recognised: the whole text, in the block that copies it.\n <CodeBlock size=\"sm\" title=\"Error output\" code={local.text} complete wrap />\n }\n >\n <div class=\"group/stack flex items-start gap-2\">\n <CircleAlert aria-hidden=\"true\" class=\"mt-0.5 size-4 shrink-0 text-destructive\" />\n <div class=\"min-w-0 flex-1 text-sm\">\n <Show\n when={parsed().header}\n fallback={<span class=\"text-muted-foreground\">Stack trace</span>}\n >\n {(header) => (\n <>\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Show when={header().type}>\n <ClippedText class=\"font-semibold text-destructive\" text={header().type!} />\n <Show when={header().message !== ''}>\n <span class=\"text-muted-foreground\">: </span>\n </Show>\n </Show>\n <ClippedText class=\"text-foreground\" text={header().message} />\n </p>\n <Show when={header().location}>\n <p class=\"m-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n <ClippedText text={header().location!} />\n </p>\n </Show>\n </>\n )}\n </Show>\n </div>\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/stack:opacity-100 group-hover/stack:opacity-100 [@media(hover:none)]:opacity-100\">\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy stack trace')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>\n </div>\n </div>\n\n <ol\n role=\"list\"\n aria-label=\"Stack frames\"\n class=\"m-0 ms-2 flex min-w-0 list-none flex-col gap-px border-s border-border p-0 ps-2\"\n >\n <For each={shown()}>\n {(block) => (\n <Switch>\n <Match when={block.type === 'frame' && block}>\n {(entry) => (\n <FrameRow\n frame={(entry() as Extract<StackBlock, { type: 'frame' }>).frame}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n <Match when={block.type === 'text' && block}>\n {(entry) => (\n <TextRow text={(entry() as Extract<StackBlock, { type: 'text' }>).text} />\n )}\n </Match>\n <Match when={block.type === 'group' && block}>\n {(entry) => (\n <FrameGroup\n frames={(entry() as Extract<StackBlock, { type: 'group' }>).frames}\n defaultOpen={local.defaultDependenciesOpen}\n pageSize={pageSize()}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n </Switch>\n )}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <div class=\"ms-2\">\n <ShowMore\n hidden={hidden()}\n pageSize={pageSize()}\n onClick={() => setLimit(shown().length + pageSize())}\n />\n </div>\n </Show>\n </Show>\n </div>","LucideCheck","LucideCircleAlert","LucideCopy","LucidePackage","_$insert","_$effect","_$readShallow","_$className","_$setAttribute","_$spread"],"sources":["../../../../src/components/composites/stack-trace/stack-trace.tsx"],"sourcesContent":["import {\n Check as LucideCheck,\n CircleAlert as LucideCircleAlert,\n Copy as LucideCopy,\n Package as LucidePackage,\n} from '@lucide/solid'\nimport { createMemo, createSignal, For, Match, Show, omit, Switch } from 'solid-js'\nimport { type ComponentProps } from '@solidjs/web'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { CodeBlock } from '../../ui/code-block'\nimport { TraceLine } from '../../ui/trace'\nimport {\n boundLines,\n dedentLines,\n describeFrameGroup,\n frameLocation,\n groupStackEntries,\n parseStackTrace,\n type ParseStackTraceOptions,\n type StackBlock,\n type StackFrame,\n} from './parse-stack-trace'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst CircleAlert = fastIcon(LucideCircleAlert)\nconst Copy = fastIcon(LucideCopy)\nconst Package = fastIcon(LucidePackage)\n\n/**\n * StackTrace.\n *\n * A failed call and the frames it failed through. Put it in the body of the\n * `TraceLine` for the call that failed, or under a failing test; reach for\n * `CodeBlock` when the text is not a trace, and for `Terminal` when it is the\n * live output of a command rather than one error.\n *\n * ## The reader's code first\n *\n * A trace is mostly someone else's frames. Runs of dependency and runtime frames\n * (`node_modules`, `site-packages`, `.cargo/registry`, `node:` internals, Rust's\n * `std`) fold into one disclosure line that says what it holds, and a lone\n * dependency frame is dimmed rather than folded. When *none* of the frames is the\n * reader's, nothing folds: hiding the whole trace behind a button helps nobody.\n * Whose code a frame is comes from its path; a host that knows the project layout\n * passes `classify`.\n *\n * ## It never hides a line\n *\n * Every line of `text` is on screen in order, as a frame, as a header, or as\n * muted text, and a trace in a format this does not know is shown whole in a\n * `CodeBlock`, which also copies it. Copy writes `text` exactly as given, not a\n * reformatted version of what was parsed.\n *\n * ## Opening a frame is the host's decision\n *\n * A frame is a button only when `onOpenFrame` is supplied, and only when the\n * frame names a file; without it frames are plain text, because a control that\n * does nothing is a tab stop with no purpose. The component never builds a path\n * or tries to open one, the trace is untrusted text, and what a path in it means\n * on this machine is the host's call.\n *\n * Text is text throughout: frames, messages and source lines are rendered as text\n * nodes, long unbroken tokens wrap rather than widening the column, and what is\n * drawn is bounded with the omission stated every time: a text line or a header\n * message beyond 10 000 characters, a frame's printed lines beyond 40 lines or\n * 10 000 characters, and the frames of a folded group, which are built only while\n * it is open and then `maxBlocks` at a time. Copy and `onOpenFrame` still get all of\n * it.\n */\nexport type StackTraceProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** The trace exactly as the runtime printed it. */\n text: string\n /** Make frames that name a file open it. Omit to render them as plain text. */\n onOpenFrame?: (frame: StackFrame) => void\n classify?: ParseStackTraceOptions['classify']\n /** Fold runs of dependency and runtime frames. Default true. */\n collapseDependencies?: boolean\n /** Start folded groups open. */\n defaultDependenciesOpen?: boolean\n /** Blocks (frames, groups, text) shown before \"show more\". Default 200. */\n maxBlocks?: number\n copyLabel?: string\n copiedLabel?: string\n /** Called after each copy attempt with whether the clipboard accepted it. */\n onCopy?: (ok: boolean) => void\n}\n\nexport const STACK_TRACE_MAX_BLOCKS = 200\nconst TEXT_DISPLAY_LIMIT = 10_000\n/** What a frame's own printed lines (a Python source line, a locals dump) may show. */\nconst DETAIL_LINE_LIMIT = 40\nconst DETAIL_CHAR_LIMIT = 10_000\n\nconst rowClass =\n 'flex min-w-0 flex-wrap items-baseline gap-x-2 rounded-md px-1.5 py-0.5 text-start text-xs outline-none'\nconst interactiveClass =\n 'w-full cursor-pointer transition-colors ease-out hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-primary-subtle focus-visible:border-ring'\n\nfunction omissionNote(lines: number, chars: number): string {\n return lines > 0\n ? `… ${lines.toLocaleString()} more ${lines === 1 ? 'line' : 'lines'} (${chars.toLocaleString()} characters) not shown`\n : `… ${chars.toLocaleString()} more characters not shown`\n}\n\n/** A frame's printed lines, bounded so one frame cannot be the whole page. */\nfunction FrameDetail(props: { lines: readonly string[] }) {\n const bounded = createMemo(() => boundLines(props.lines, DETAIL_LINE_LIMIT, DETAIL_CHAR_LIMIT))\n return (\n <>\n <pre class=\"m-0 ms-1.5 px-1.5 font-code text-code whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n {dedentLines(bounded().lines).join('\\n')}\n </pre>\n <Show when={bounded().omittedLines > 0 || bounded().omittedChars > 0}>\n <p class=\"m-0 ms-1.5 px-1.5 text-xs text-muted-foreground italic\">\n {omissionNote(bounded().omittedLines, bounded().omittedChars)}\n {' (copy has all of it)'}\n </p>\n </Show>\n </>\n )\n}\n\n/** Header text, cut to the display limit with what was cut stated. */\nfunction ClippedText(props: { text: string; class?: string }) {\n const clipped = () => props.text.length > TEXT_DISPLAY_LIMIT\n return (\n <>\n <span class={props.class}>\n {clipped() ? props.text.slice(0, TEXT_DISPLAY_LIMIT) : props.text}\n </span>\n <Show when={clipped()}>\n <span class=\"block text-xs text-muted-foreground italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n (copy has all of it)\n </span>\n </Show>\n </>\n )\n}\n\n/**\n * A folded run of dependency or runtime frames. Its rows are built only while it\n * is open and then a page at a time, so a run of ten thousand frames costs the\n * same as one of a few hundred until the reader asks for more.\n */\nfunction FrameGroup(props: {\n frames: readonly StackFrame[]\n defaultOpen?: boolean\n pageSize: number\n onOpen?: (frame: StackFrame) => void\n}) {\n const [open, setOpen] = createSignal(() => props.defaultOpen === true)\n const [limit, setLimit] = createSignal<number | undefined>()\n const title = createMemo(() => describeFrameGroup(props.frames))\n const shown = createMemo(() => props.frames.slice(0, limit() ?? props.pageSize))\n const hidden = () => props.frames.length - shown().length\n return (\n <TraceLine icon={<Package />} title={title()} open={open()} onOpenChange={setOpen}>\n <Show when={open()}>\n <ol role=\"list\" aria-label={title()} class=\"m-0 flex min-w-0 list-none flex-col gap-px p-0\">\n <For each={shown()}>{(frame) => <FrameRow frame={frame} onOpen={props.onOpen} />}</For>\n </ol>\n <Show when={hidden() > 0}>\n <ShowMore\n hidden={hidden()}\n pageSize={props.pageSize}\n onClick={() => setLimit(shown().length + props.pageSize)}\n />\n </Show>\n </Show>\n </TraceLine>\n )\n}\n\nfunction ShowMore(props: { hidden: number; pageSize: number; onClick: () => void }) {\n return (\n <div class=\"ps-1.5\">\n <Button variant=\"ghost\" size=\"2xs\" onClick={props.onClick}>\n Show {Math.min(props.hidden, props.pageSize).toLocaleString()} more (\n {props.hidden.toLocaleString()} hidden)\n </Button>\n </div>\n )\n}\n\nfunction FrameRow(props: { frame: StackFrame; onOpen?: (frame: StackFrame) => void }) {\n const location = () => frameLocation(props.frame)\n const first = () => props.frame.kind === 'first-party'\n const content = () => (\n <>\n <span\n class={cn('font-code text-code', {\n 'text-foreground': first(),\n 'text-muted-foreground': !first(),\n })}\n >\n {props.frame.async ? 'async ' : ''}\n {props.frame.function ?? '(anonymous)'}\n </span>\n <Show when={location()}>\n <span class=\"min-w-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n {location()}\n </span>\n </Show>\n {/* The dimming is a colour; the kind is also spoken. */}\n <Show when={!first()}>\n <span class=\"sr-only\">\n {props.frame.kind === 'dependency' ? 'in a dependency' : 'in the runtime'}\n </span>\n </Show>\n </>\n )\n return (\n <li data-slot=\"stack-frame\" data-kind={props.frame.kind} class=\"min-w-0\">\n <Show\n when={props.onOpen !== undefined && props.frame.file !== undefined}\n fallback={<div class={rowClass}>{content()}</div>}\n >\n <button\n type=\"button\"\n aria-label={`Open ${props.frame.async ? 'async ' : ''}${props.frame.function ?? '(anonymous)'} ${location()}`}\n class={cn(rowClass, interactiveClass)}\n onClick={() => props.onOpen?.(props.frame)}\n >\n {content()}\n </button>\n </Show>\n <Show when={props.frame.detail && props.frame.detail.length > 0}>\n <FrameDetail lines={props.frame.detail!} />\n </Show>\n </li>\n )\n}\n\nfunction TextRow(props: { text: string }) {\n const clipped = () => props.text.length > TEXT_DISPLAY_LIMIT\n return (\n <li class=\"min-w-0 px-1.5 py-0.5 font-code text-code whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n {clipped() ? props.text.slice(0, TEXT_DISPLAY_LIMIT) : props.text}\n <Show when={clipped()}>\n <span class=\"block font-sans text-xs italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n </span>\n </Show>\n </li>\n )\n}\n\nexport function StackTrace(props: StackTraceProps) {\n const local = props\n const rest = omit(\n props,\n 'text',\n 'onOpenFrame',\n 'classify',\n 'collapseDependencies',\n 'defaultDependenciesOpen',\n 'maxBlocks',\n 'copyLabel',\n 'copiedLabel',\n 'onCopy',\n 'class'\n )\n\n const parsed = createMemo(() => parseStackTrace(local.text, { classify: local.classify }))\n const blocks = createMemo<readonly StackBlock[]>(() =>\n groupStackEntries(parsed().entries, local.collapseDependencies !== false).filter(\n // A blank line between paragraphs of a trace carries nothing to draw.\n (block) => block.type !== 'text' || block.text.trim() !== ''\n )\n )\n const pageSize = () => Math.max(1, Math.floor(local.maxBlocks ?? STACK_TRACE_MAX_BLOCKS))\n const [limit, setLimit] = createSignal<number | undefined>()\n const shown = createMemo(() => blocks().slice(0, limit() ?? pageSize()))\n const hidden = () => blocks().length - shown().length\n\n const { copied, failed: copyFailed, copy: copyText } = createCopyFeedback()\n const copy = async () => {\n const ok = await copyText(local.text)\n local.onCopy?.(ok)\n }\n\n return (\n <div\n data-slot=\"stack-trace\"\n data-format={parsed().format}\n class={cn('flex min-w-0 flex-col gap-1', local.class)}\n {...rest}\n >\n <Show\n when={parsed().format !== 'unknown'}\n fallback={\n // Nothing recognised: the whole text, in the block that copies it.\n <CodeBlock size=\"sm\" title=\"Error output\" code={local.text} complete wrap />\n }\n >\n <div class=\"group/stack flex items-start gap-2\">\n <CircleAlert aria-hidden=\"true\" class=\"mt-0.5 size-4 shrink-0 text-destructive\" />\n <div class=\"min-w-0 flex-1 text-sm\">\n <Show\n when={parsed().header}\n fallback={<span class=\"text-muted-foreground\">Stack trace</span>}\n >\n {(header) => (\n <>\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Show when={header().type}>\n <ClippedText class=\"font-semibold text-destructive\" text={header().type!} />\n <Show when={header().message !== ''}>\n <span class=\"text-muted-foreground\">: </span>\n </Show>\n </Show>\n <ClippedText class=\"text-foreground\" text={header().message} />\n </p>\n <Show when={header().location}>\n <p class=\"m-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n <ClippedText text={header().location!} />\n </p>\n </Show>\n </>\n )}\n </Show>\n </div>\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/stack:opacity-100 group-hover/stack:opacity-100 [@media(hover:none)]:opacity-100\">\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy stack trace')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>\n </div>\n </div>\n\n <ol\n role=\"list\"\n aria-label=\"Stack frames\"\n class=\"m-0 ms-2 flex min-w-0 list-none flex-col gap-px border-s border-border p-0 ps-2\"\n >\n <For each={shown()}>\n {(block) => (\n <Switch>\n <Match when={block.type === 'frame' && block}>\n {(entry) => (\n <FrameRow\n frame={(entry() as Extract<StackBlock, { type: 'frame' }>).frame}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n <Match when={block.type === 'text' && block}>\n {(entry) => (\n <TextRow text={(entry() as Extract<StackBlock, { type: 'text' }>).text} />\n )}\n </Match>\n <Match when={block.type === 'group' && block}>\n {(entry) => (\n <FrameGroup\n frames={(entry() as Extract<StackBlock, { type: 'group' }>).frames}\n defaultOpen={local.defaultDependenciesOpen}\n pageSize={pageSize()}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n </Switch>\n )}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <div class=\"ms-2\">\n <ShowMore\n hidden={hidden()}\n pageSize={pageSize()}\n onClick={() => setLimit(shown().length + pageSize())}\n />\n </div>\n </Show>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAM,QAAQ,SAASgE,OAAW;AAClC,IAAM,cAAc,SAASC,aAAiB;AAC9C,IAAM,OAAO,SAASC,MAAU;AAChC,IAAM,UAAU,SAASC,SAAa;AA6DtC,IAAa,yBAAyB;AACtC,IAAM,qBAAqB;;AAE3B,IAAM,oBAAoB;AAC1B,IAAM,oBAAoB;AAE1B,IAAM,WACJ;AACF,IAAM,mBACJ;AAEF,SAAS,aAAa,OAAe,OAAuB;CAC1D,OAAO,QAAQ,IACX,KAAK,MAAM,eAAe,EAAE,QAAQ,UAAU,IAAI,SAAS,QAAQ,IAAI,MAAM,eAAe,EAAE,0BAC9F,KAAK,MAAM,eAAe,EAAE;AAClC;;AAGA,SAAS,YAAY,OAAqC;CACxD,MAAM,UAAU,iBAAiB,WAAW,MAAM,OAAO,mBAAmB,iBAAiB,CAAC;CAC9F,OACI,QACA;EAEK,IAAA,OAAA,OAAA;EAFLC,OAAA,YACE;GAAC,OAAA,YAAY,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI;EAAC,CACrC;EAFL,OAAA;CAEK,EAAA,CAAA,GACLpE,WAAAA;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