@buoy-gg/network 7.0.40 → 7.0.42

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 (275) hide show
  1. package/README.md +11 -79
  2. package/lib/commonjs/index.js +1 -325
  3. package/lib/commonjs/index.web.js +1 -420
  4. package/lib/commonjs/network/components/DataViewer.web.js +1 -879
  5. package/lib/commonjs/network/components/NetworkCopyScreen.web.js +1 -48
  6. package/lib/commonjs/network/components/NetworkCopySettingsView.js +27 -755
  7. package/lib/commonjs/network/components/NetworkCopySettingsView.web.js +14 -1242
  8. package/lib/commonjs/network/components/NetworkDetailScreen.web.js +1 -101
  9. package/lib/commonjs/network/components/NetworkDetailStepper.js +1 -108
  10. package/lib/commonjs/network/components/NetworkDetailStepper.web.js +1 -298
  11. package/lib/commonjs/network/components/NetworkEventDetailView.js +15 -1130
  12. package/lib/commonjs/network/components/NetworkEventDetailView.web.js +15 -1484
  13. package/lib/commonjs/network/components/NetworkEventItemCompact.js +2 -401
  14. package/lib/commonjs/network/components/NetworkEventItemCompact.web.js +2 -820
  15. package/lib/commonjs/network/components/NetworkFilterScreen.web.js +1 -55
  16. package/lib/commonjs/network/components/NetworkFilterViewV3.js +1 -442
  17. package/lib/commonjs/network/components/NetworkFilterViewV3.web.js +1 -1310
  18. package/lib/commonjs/network/components/NetworkHeaderLive.js +1 -375
  19. package/lib/commonjs/network/components/NetworkHeaderLive.web.js +1 -623
  20. package/lib/commonjs/network/components/NetworkHeaderMenu.js +1 -190
  21. package/lib/commonjs/network/components/NetworkListScreen.js +1 -404
  22. package/lib/commonjs/network/components/NetworkListScreen.web.js +1 -625
  23. package/lib/commonjs/network/components/NetworkModal.js +1 -786
  24. package/lib/commonjs/network/components/NetworkNumberPrompt.js +1 -178
  25. package/lib/commonjs/network/components/NetworkNumberPrompt.web.js +1 -232
  26. package/lib/commonjs/network/components/NetworkOverrideEditor.js +1 -814
  27. package/lib/commonjs/network/components/NetworkOverrideEditor.web.js +1 -942
  28. package/lib/commonjs/network/components/NetworkOverrideHeaderButton.js +1 -107
  29. package/lib/commonjs/network/components/NetworkOverrideHeaderButton.web.js +1 -133
  30. package/lib/commonjs/network/components/NetworkOverridesButton.js +1 -90
  31. package/lib/commonjs/network/components/NetworkOverridesButton.web.js +1 -143
  32. package/lib/commonjs/network/components/NetworkOverridesScreen.js +1 -543
  33. package/lib/commonjs/network/components/NetworkOverridesScreen.web.js +1 -830
  34. package/lib/commonjs/network/components/NetworkSavedScreen.js +1 -226
  35. package/lib/commonjs/network/components/NetworkSavedScreen.web.js +1 -463
  36. package/lib/commonjs/network/components/NetworkUpgradeBanner.js +1 -76
  37. package/lib/commonjs/network/components/response-editor/Explorer.js +1 -973
  38. package/lib/commonjs/network/components/response-editor/Explorer.web.js +1 -1136
  39. package/lib/commonjs/network/components/response-editor/deleteNestedDataByPath.js +1 -56
  40. package/lib/commonjs/network/components/response-editor/editorContext.js +1 -33
  41. package/lib/commonjs/network/components/response-editor/updateNestedDataByPath.js +1 -61
  42. package/lib/commonjs/network/conditions/NetworkConditionsControl.js +1 -235
  43. package/lib/commonjs/network/conditions/NetworkConditionsControl.test.js +1 -136
  44. package/lib/commonjs/network/conditions/NetworkConditionsIcon.js +1 -33
  45. package/lib/commonjs/network/conditions/NetworkFloatingTool.js +1 -310
  46. package/lib/commonjs/network/conditions/NetworkFloatingTool.test.js +1 -219
  47. package/lib/commonjs/network/conditions/store.js +1 -75
  48. package/lib/commonjs/network/conditions/wait.js +1 -43
  49. package/lib/commonjs/network/conditions/xhr.js +1 -110
  50. package/lib/commonjs/network/hooks/useLiveNetworkEvent.js +1 -62
  51. package/lib/commonjs/network/hooks/useNetworkBadgeCounts.js +1 -83
  52. package/lib/commonjs/network/hooks/useNetworkEventList.js +1 -108
  53. package/lib/commonjs/network/hooks/useNetworkEvents.js +1 -318
  54. package/lib/commonjs/network/hooks/useNetworkHasMatches.js +1 -56
  55. package/lib/commonjs/network/hooks/useNetworkSaved.js +1 -38
  56. package/lib/commonjs/network/hooks/useNetworkSelection.js +1 -53
  57. package/lib/commonjs/network/hooks/useOverrideRules.js +1 -36
  58. package/lib/commonjs/network/hooks/useTickEveryMinute.js +1 -21
  59. package/lib/commonjs/network/overrides/applyToFetch.js +1 -80
  60. package/lib/commonjs/network/overrides/applyToXhr.js +2 -453
  61. package/lib/commonjs/network/overrides/engine.js +1 -93
  62. package/lib/commonjs/network/overrides/matchRule.js +1 -81
  63. package/lib/commonjs/network/overrides/overriddenRows.js +1 -0
  64. package/lib/commonjs/network/overrides/overrideRulesStore.js +1 -550
  65. package/lib/commonjs/network/overrides/presets.js +1 -70
  66. package/lib/commonjs/network/overrides/resolveOverride.js +1 -158
  67. package/lib/commonjs/network/overrides/types.js +1 -90
  68. package/lib/commonjs/network/sync/networkBodyResolver.js +1 -39
  69. package/lib/commonjs/network/sync/networkSyncAdapter.js +1 -882
  70. package/lib/commonjs/network/sync/overrideHonesty.release.test.js +1 -36
  71. package/lib/commonjs/network/types/index.js +1 -5
  72. package/lib/commonjs/network/utils/extractOperationName.js +1 -80
  73. package/lib/commonjs/network/utils/filterNetworkEvents.js +1 -96
  74. package/lib/commonjs/network/utils/formatGraphQLVariables.js +1 -219
  75. package/lib/commonjs/network/utils/formatting.js +1 -30
  76. package/lib/commonjs/network/utils/generateCurl.js +2 -71
  77. package/lib/commonjs/network/utils/generateNetworkCopyText.js +37 -166
  78. package/lib/commonjs/network/utils/httpCompletion.js +1 -37
  79. package/lib/commonjs/network/utils/networkEventStore.js +1 -393
  80. package/lib/commonjs/network/utils/networkListener.js +4 -1259
  81. package/lib/commonjs/network/utils/networkSavedStore.js +3 -577
  82. package/lib/commonjs/network/utils/networkSelectionStore.js +1 -193
  83. package/lib/commonjs/network/utils/realNow.js +1 -0
  84. package/lib/commonjs/network/utils/requestId.js +1 -0
  85. package/lib/commonjs/network/utils/resolveRequestUrl.js +1 -0
  86. package/lib/commonjs/network/utils/selectSavedEvents.js +1 -39
  87. package/lib/commonjs/network/utils/startNetworkCapture.js +1 -0
  88. package/lib/commonjs/network/utils/withPinnedFirst.js +1 -32
  89. package/lib/commonjs/preset.js +1 -102
  90. package/lib/module/index.js +1 -103
  91. package/lib/module/index.web.js +1 -82
  92. package/lib/module/network/components/DataViewer.web.js +1 -875
  93. package/lib/module/network/components/NetworkCopyScreen.web.js +1 -44
  94. package/lib/module/network/components/NetworkCopySettingsView.js +27 -750
  95. package/lib/module/network/components/NetworkCopySettingsView.web.js +14 -1237
  96. package/lib/module/network/components/NetworkDetailScreen.web.js +1 -97
  97. package/lib/module/network/components/NetworkDetailStepper.js +1 -104
  98. package/lib/module/network/components/NetworkDetailStepper.web.js +1 -296
  99. package/lib/module/network/components/NetworkEventDetailView.js +15 -1129
  100. package/lib/module/network/components/NetworkEventDetailView.web.js +15 -1482
  101. package/lib/module/network/components/NetworkEventItemCompact.js +2 -398
  102. package/lib/module/network/components/NetworkEventItemCompact.web.js +2 -818
  103. package/lib/module/network/components/NetworkFilterScreen.web.js +1 -51
  104. package/lib/module/network/components/NetworkFilterViewV3.js +1 -438
  105. package/lib/module/network/components/NetworkFilterViewV3.web.js +1 -1306
  106. package/lib/module/network/components/NetworkHeaderLive.js +1 -366
  107. package/lib/module/network/components/NetworkHeaderLive.web.js +1 -617
  108. package/lib/module/network/components/NetworkHeaderMenu.js +1 -184
  109. package/lib/module/network/components/NetworkListScreen.js +1 -400
  110. package/lib/module/network/components/NetworkListScreen.web.js +1 -623
  111. package/lib/module/network/components/NetworkModal.js +1 -781
  112. package/lib/module/network/components/NetworkNumberPrompt.js +1 -174
  113. package/lib/module/network/components/NetworkNumberPrompt.web.js +1 -230
  114. package/lib/module/network/components/NetworkOverrideEditor.js +1 -811
  115. package/lib/module/network/components/NetworkOverrideEditor.web.js +1 -939
  116. package/lib/module/network/components/NetworkOverrideHeaderButton.js +1 -104
  117. package/lib/module/network/components/NetworkOverrideHeaderButton.web.js +1 -131
  118. package/lib/module/network/components/NetworkOverridesButton.js +1 -87
  119. package/lib/module/network/components/NetworkOverridesButton.web.js +1 -141
  120. package/lib/module/network/components/NetworkOverridesScreen.js +1 -539
  121. package/lib/module/network/components/NetworkOverridesScreen.web.js +1 -826
  122. package/lib/module/network/components/NetworkSavedScreen.js +1 -222
  123. package/lib/module/network/components/NetworkSavedScreen.web.js +1 -461
  124. package/lib/module/network/components/NetworkUpgradeBanner.js +1 -72
  125. package/lib/module/network/components/response-editor/Explorer.js +1 -972
  126. package/lib/module/network/components/response-editor/Explorer.web.js +1 -1133
  127. package/lib/module/network/components/response-editor/deleteNestedDataByPath.js +1 -51
  128. package/lib/module/network/components/response-editor/editorContext.js +1 -29
  129. package/lib/module/network/components/response-editor/updateNestedDataByPath.js +1 -56
  130. package/lib/module/network/conditions/NetworkConditionsControl.js +1 -231
  131. package/lib/module/network/conditions/NetworkConditionsControl.test.js +1 -135
  132. package/lib/module/network/conditions/NetworkConditionsIcon.js +1 -29
  133. package/lib/module/network/conditions/NetworkFloatingTool.js +1 -304
  134. package/lib/module/network/conditions/NetworkFloatingTool.test.js +1 -218
  135. package/lib/module/network/conditions/store.js +1 -65
  136. package/lib/module/network/conditions/wait.js +1 -38
  137. package/lib/module/network/conditions/xhr.js +1 -106
  138. package/lib/module/network/hooks/useLiveNetworkEvent.js +1 -58
  139. package/lib/module/network/hooks/useNetworkBadgeCounts.js +1 -79
  140. package/lib/module/network/hooks/useNetworkEventList.js +1 -104
  141. package/lib/module/network/hooks/useNetworkEvents.js +1 -314
  142. package/lib/module/network/hooks/useNetworkHasMatches.js +1 -52
  143. package/lib/module/network/hooks/useNetworkSaved.js +1 -34
  144. package/lib/module/network/hooks/useNetworkSelection.js +1 -46
  145. package/lib/module/network/hooks/useOverrideRules.js +1 -32
  146. package/lib/module/network/hooks/useTickEveryMinute.js +1 -11
  147. package/lib/module/network/overrides/applyToFetch.js +1 -72
  148. package/lib/module/network/overrides/applyToXhr.js +2 -446
  149. package/lib/module/network/overrides/engine.js +1 -85
  150. package/lib/module/network/overrides/matchRule.js +1 -75
  151. package/lib/module/network/overrides/overriddenRows.js +1 -0
  152. package/lib/module/network/overrides/overrideRulesStore.js +1 -547
  153. package/lib/module/network/overrides/presets.js +1 -65
  154. package/lib/module/network/overrides/resolveOverride.js +1 -152
  155. package/lib/module/network/overrides/types.js +1 -86
  156. package/lib/module/network/sync/networkBodyResolver.js +1 -34
  157. package/lib/module/network/sync/networkSyncAdapter.js +1 -880
  158. package/lib/module/network/sync/overrideHonesty.release.test.js +1 -35
  159. package/lib/module/network/types/index.js +1 -3
  160. package/lib/module/network/utils/extractOperationName.js +1 -76
  161. package/lib/module/network/utils/filterNetworkEvents.js +1 -92
  162. package/lib/module/network/utils/formatGraphQLVariables.js +1 -213
  163. package/lib/module/network/utils/formatting.js +1 -9
  164. package/lib/module/network/utils/generateCurl.js +2 -67
  165. package/lib/module/network/utils/generateNetworkCopyText.js +37 -162
  166. package/lib/module/network/utils/httpCompletion.js +1 -32
  167. package/lib/module/network/utils/networkEventStore.js +1 -391
  168. package/lib/module/network/utils/networkListener.js +4 -1249
  169. package/lib/module/network/utils/networkSavedStore.js +3 -572
  170. package/lib/module/network/utils/networkSelectionStore.js +1 -188
  171. package/lib/module/network/utils/realNow.js +1 -0
  172. package/lib/module/network/utils/requestId.js +1 -0
  173. package/lib/module/network/utils/resolveRequestUrl.js +1 -0
  174. package/lib/module/network/utils/selectSavedEvents.js +1 -35
  175. package/lib/module/network/utils/startNetworkCapture.js +1 -0
  176. package/lib/module/network/utils/withPinnedFirst.js +1 -28
  177. package/lib/module/preset.js +1 -100
  178. package/lib/typescript/index.d.ts +1 -0
  179. package/lib/typescript/network/overrides/applyToXhr.d.ts +1 -0
  180. package/lib/typescript/network/overrides/engine.d.ts +1 -1
  181. package/lib/typescript/network/overrides/matchRule.d.ts +1 -1
  182. package/lib/typescript/network/overrides/overriddenRows.d.ts +16 -0
  183. package/lib/typescript/network/overrides/resolveOverride.d.ts +2 -2
  184. package/lib/typescript/network/overrides/types.d.ts +9 -0
  185. package/lib/typescript/network/utils/networkListener.d.ts +14 -4
  186. package/lib/typescript/network/utils/networkSavedStore.d.ts +4 -4
  187. package/lib/typescript/network/utils/realNow.d.ts +18 -0
  188. package/lib/typescript/network/utils/requestId.d.ts +2 -0
  189. package/lib/typescript/network/utils/resolveRequestUrl.d.ts +3 -0
  190. package/lib/typescript/network/utils/startNetworkCapture.d.ts +6 -0
  191. package/lib/web/index.mjs +145 -0
  192. package/package.json +32 -10
  193. package/lib/typescript/index.d.ts.map +0 -1
  194. package/lib/typescript/index.web.d.ts.map +0 -1
  195. package/lib/typescript/network/components/DataViewer.web.d.ts.map +0 -1
  196. package/lib/typescript/network/components/NetworkCopyScreen.web.d.ts.map +0 -1
  197. package/lib/typescript/network/components/NetworkCopySettingsView.d.ts.map +0 -1
  198. package/lib/typescript/network/components/NetworkCopySettingsView.web.d.ts.map +0 -1
  199. package/lib/typescript/network/components/NetworkDetailScreen.web.d.ts.map +0 -1
  200. package/lib/typescript/network/components/NetworkDetailStepper.d.ts.map +0 -1
  201. package/lib/typescript/network/components/NetworkDetailStepper.web.d.ts.map +0 -1
  202. package/lib/typescript/network/components/NetworkEventDetailView.d.ts.map +0 -1
  203. package/lib/typescript/network/components/NetworkEventDetailView.web.d.ts.map +0 -1
  204. package/lib/typescript/network/components/NetworkEventItemCompact.d.ts.map +0 -1
  205. package/lib/typescript/network/components/NetworkEventItemCompact.web.d.ts.map +0 -1
  206. package/lib/typescript/network/components/NetworkFilterScreen.web.d.ts.map +0 -1
  207. package/lib/typescript/network/components/NetworkFilterViewV3.d.ts.map +0 -1
  208. package/lib/typescript/network/components/NetworkFilterViewV3.web.d.ts.map +0 -1
  209. package/lib/typescript/network/components/NetworkHeaderLive.d.ts.map +0 -1
  210. package/lib/typescript/network/components/NetworkHeaderLive.web.d.ts.map +0 -1
  211. package/lib/typescript/network/components/NetworkHeaderMenu.d.ts.map +0 -1
  212. package/lib/typescript/network/components/NetworkListScreen.d.ts.map +0 -1
  213. package/lib/typescript/network/components/NetworkListScreen.web.d.ts.map +0 -1
  214. package/lib/typescript/network/components/NetworkModal.d.ts.map +0 -1
  215. package/lib/typescript/network/components/NetworkNumberPrompt.d.ts.map +0 -1
  216. package/lib/typescript/network/components/NetworkNumberPrompt.web.d.ts.map +0 -1
  217. package/lib/typescript/network/components/NetworkOverrideEditor.d.ts.map +0 -1
  218. package/lib/typescript/network/components/NetworkOverrideEditor.web.d.ts.map +0 -1
  219. package/lib/typescript/network/components/NetworkOverrideHeaderButton.d.ts.map +0 -1
  220. package/lib/typescript/network/components/NetworkOverrideHeaderButton.web.d.ts.map +0 -1
  221. package/lib/typescript/network/components/NetworkOverridesButton.d.ts.map +0 -1
  222. package/lib/typescript/network/components/NetworkOverridesButton.web.d.ts.map +0 -1
  223. package/lib/typescript/network/components/NetworkOverridesScreen.d.ts.map +0 -1
  224. package/lib/typescript/network/components/NetworkOverridesScreen.web.d.ts.map +0 -1
  225. package/lib/typescript/network/components/NetworkSavedScreen.d.ts.map +0 -1
  226. package/lib/typescript/network/components/NetworkSavedScreen.web.d.ts.map +0 -1
  227. package/lib/typescript/network/components/NetworkUpgradeBanner.d.ts.map +0 -1
  228. package/lib/typescript/network/components/response-editor/Explorer.d.ts.map +0 -1
  229. package/lib/typescript/network/components/response-editor/Explorer.web.d.ts.map +0 -1
  230. package/lib/typescript/network/components/response-editor/deleteNestedDataByPath.d.ts.map +0 -1
  231. package/lib/typescript/network/components/response-editor/editorContext.d.ts.map +0 -1
  232. package/lib/typescript/network/components/response-editor/updateNestedDataByPath.d.ts.map +0 -1
  233. package/lib/typescript/network/conditions/NetworkConditionsControl.d.ts.map +0 -1
  234. package/lib/typescript/network/conditions/NetworkConditionsControl.test.d.ts.map +0 -1
  235. package/lib/typescript/network/conditions/NetworkConditionsIcon.d.ts.map +0 -1
  236. package/lib/typescript/network/conditions/NetworkFloatingTool.d.ts.map +0 -1
  237. package/lib/typescript/network/conditions/NetworkFloatingTool.test.d.ts.map +0 -1
  238. package/lib/typescript/network/conditions/store.d.ts.map +0 -1
  239. package/lib/typescript/network/conditions/wait.d.ts.map +0 -1
  240. package/lib/typescript/network/conditions/xhr.d.ts.map +0 -1
  241. package/lib/typescript/network/hooks/useLiveNetworkEvent.d.ts.map +0 -1
  242. package/lib/typescript/network/hooks/useNetworkBadgeCounts.d.ts.map +0 -1
  243. package/lib/typescript/network/hooks/useNetworkEventList.d.ts.map +0 -1
  244. package/lib/typescript/network/hooks/useNetworkEvents.d.ts.map +0 -1
  245. package/lib/typescript/network/hooks/useNetworkHasMatches.d.ts.map +0 -1
  246. package/lib/typescript/network/hooks/useNetworkSaved.d.ts.map +0 -1
  247. package/lib/typescript/network/hooks/useNetworkSelection.d.ts.map +0 -1
  248. package/lib/typescript/network/hooks/useOverrideRules.d.ts.map +0 -1
  249. package/lib/typescript/network/hooks/useTickEveryMinute.d.ts.map +0 -1
  250. package/lib/typescript/network/overrides/applyToFetch.d.ts.map +0 -1
  251. package/lib/typescript/network/overrides/applyToXhr.d.ts.map +0 -1
  252. package/lib/typescript/network/overrides/engine.d.ts.map +0 -1
  253. package/lib/typescript/network/overrides/matchRule.d.ts.map +0 -1
  254. package/lib/typescript/network/overrides/overrideRulesStore.d.ts.map +0 -1
  255. package/lib/typescript/network/overrides/presets.d.ts.map +0 -1
  256. package/lib/typescript/network/overrides/resolveOverride.d.ts.map +0 -1
  257. package/lib/typescript/network/overrides/types.d.ts.map +0 -1
  258. package/lib/typescript/network/sync/networkBodyResolver.d.ts.map +0 -1
  259. package/lib/typescript/network/sync/networkSyncAdapter.d.ts.map +0 -1
  260. package/lib/typescript/network/sync/overrideHonesty.release.test.d.ts.map +0 -1
  261. package/lib/typescript/network/types/index.d.ts.map +0 -1
  262. package/lib/typescript/network/utils/extractOperationName.d.ts.map +0 -1
  263. package/lib/typescript/network/utils/filterNetworkEvents.d.ts.map +0 -1
  264. package/lib/typescript/network/utils/formatGraphQLVariables.d.ts.map +0 -1
  265. package/lib/typescript/network/utils/formatting.d.ts.map +0 -1
  266. package/lib/typescript/network/utils/generateCurl.d.ts.map +0 -1
  267. package/lib/typescript/network/utils/generateNetworkCopyText.d.ts.map +0 -1
  268. package/lib/typescript/network/utils/httpCompletion.d.ts.map +0 -1
  269. package/lib/typescript/network/utils/networkEventStore.d.ts.map +0 -1
  270. package/lib/typescript/network/utils/networkListener.d.ts.map +0 -1
  271. package/lib/typescript/network/utils/networkSavedStore.d.ts.map +0 -1
  272. package/lib/typescript/network/utils/networkSelectionStore.d.ts.map +0 -1
  273. package/lib/typescript/network/utils/selectSavedEvents.d.ts.map +0 -1
  274. package/lib/typescript/network/utils/withPinnedFirst.d.ts.map +0 -1
  275. package/lib/typescript/preset.d.ts.map +0 -1
@@ -1,879 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CopyButton = void 0;
7
- exports.DataViewer = DataViewer;
8
- exports.InlineCopyButton = void 0;
9
- var _react = require("react");
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- /**
12
- * DataViewer.web — DOM twin of the shared-ui data-viewer stack, exactly as the
13
- * network DETAIL view consumes it (`rawMode` + type-filter legend +
14
- * `initialExpanded`). The web shim exposes none of this chrome, so it is
15
- * replicated here as DOM with provenance:
16
- *
17
- * - `DataViewer` — shared/src/dataViewer/DataViewer.tsx (type-filter chips +
18
- * the `flattenByType` filtered projection, algorithms copied verbatim).
19
- * - Tree rows — shared/src/dataViewer/VirtualizedDataExplorer.tsx, rawMode
20
- * path: synthetic "root" row, 24px rows, 16px indent per depth, chevron
21
- * expander, `key:` in monospace, values colored by type
22
- * (macOSColors.dataTypes via the gameUIColors macOS theme), expandable rows
23
- * reading "object (3 items)", per-row copy button, MAX_ITEMS_PER_LEVEL 500 /
24
- * MAX_DEPTH_LIMIT 15 caps and the circular-reference guard.
25
- * - Indent guides — shared/src/dataViewer/IndentGuidesOverlay.tsx (same
26
- * segment computation, 1px lines at (depth-0.5)*16, primary @ ~30% alpha).
27
- * - Type chips — shared/src/dataViewer/TypeLegend.tsx (`getTypeColor` copied
28
- * verbatim).
29
- * - `CopyButton` / `InlineCopyButton` — shared/src/ui/components/
30
- * CopyButton.tsx: idle/success/error states, 1500ms feedback, lazy function
31
- * values resolved at press time, object values pretty-printed (2-space,
32
- * circular-safe — clipboard/copyToClipboard.ts's safeStringify semantics).
33
- *
34
- * Intentional deviations (all logged):
35
- * - FlatList virtualization + the chunked/debounced async flatten
36
- * ("Processing data…") → a synchronous flatten over plain DOM rows. The
37
- * same 500-per-level/15-deep caps bound the work, and web rows are cheap;
38
- * the settle-window in `networkSelectionStore` (see `showBodies` on the
39
- * detail view) is what keeps stepping fast, exactly as on native.
40
- * - Row selection / double-tap inline editing / `DataTreeActionBar` are NOT
41
- * ported — that is the response-EDITOR surface (overrides), a later port
42
- * feature. Read-only rows toggle expansion on press, as native does when no
43
- * `onSelectionChange` is wired.
44
- * - `CopyButton`'s Pro upgrade modal + first-copy hint banner are not ported
45
- * (license gating isn't part of the web port); `disableCopy` is accepted
46
- * for API compatibility and ignored, same as the native explorer.
47
- * - `displayValue`'s minimal-SuperJSON serialization → JSON.stringify; for
48
- * the JSON payloads this tool renders the output is identical.
49
- *
50
- * @platform React DOM Web
51
- */
52
-
53
- // =============================
54
- // Native palettes (provenance)
55
- // =============================
56
-
57
- /**
58
- * gameUIColors, macOS theme — shared/src/ui/gameUI/constants/gameUIColors.ts
59
- * resolves to `macOSGameUIColors` (macOSDesignSystemColors.ts), verbatim
60
- * subset. `primary`/`primaryLight` are the macOS text primary, NOT white.
61
- */const gameUI = {
62
- primary: "#F5F5F7",
63
- // macOSColors.text.primary
64
- primaryLight: "#F5F5F7",
65
- secondary: "#A1A1A6",
66
- // macOSColors.text.secondary
67
- muted: "#8E8E93",
68
- success: "#34C759",
69
- warning: "#FFEB3B",
70
- error: "#FF453A",
71
- info: "#00B8E6",
72
- critical: "#FF453A",
73
- // macOS theme maps critical → semantic.error
74
- optional: "#BF5AF2",
75
- // macOS theme maps optional → semantic.debug
76
- dataTypes: {
77
- object: "#00B8E6",
78
- array: "#FFEB3B",
79
- string: "#34C759",
80
- number: "#FF9F0A",
81
- boolean: "#BF5AF2",
82
- function: "#5E5CE6",
83
- undefined: "#8E8E93",
84
- null: "#FF453A"
85
- }
86
- };
87
-
88
- /** macOSColors subset — shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts, verbatim. */
89
- const macOSColors = {
90
- background: {
91
- hover: "#1D1D1F",
92
- input: "#26262A"
93
- },
94
- text: {
95
- primary: "#F5F5F7",
96
- secondary: "#A1A1A6"
97
- },
98
- semantic: {
99
- error: "#FF453A",
100
- debug: "#BF5AF2"
101
- }
102
- };
103
-
104
- // Stable constants — VirtualizedDataExplorer.tsx, verbatim.
105
- const ITEM_HEIGHT = 24;
106
- const MAX_DEPTH_LIMIT = 15;
107
- const MAX_ITEMS_PER_LEVEL = 500;
108
- const INDENT_WIDTH = 16;
109
- /** IndentGuidesOverlay.tsx — ~30% alpha on the primary color. */
110
- const GUIDE_ALPHA = "4D";
111
-
112
- // =============================
113
- // Inline lucide icons (shared-ui icons are lucide re-exports)
114
- // =============================
115
-
116
- function Svg({
117
- size = 14,
118
- color = "currentColor",
119
- style,
120
- children
121
- }) {
122
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
123
- width: size,
124
- height: size,
125
- viewBox: "0 0 24 24",
126
- fill: "none",
127
- stroke: color,
128
- strokeWidth: 2,
129
- strokeLinecap: "round",
130
- strokeLinejoin: "round",
131
- style: {
132
- flexShrink: 0,
133
- display: "block",
134
- ...style
135
- },
136
- children: children
137
- });
138
- }
139
- const ChevronRight = p => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
140
- ...p,
141
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
142
- d: "m9 18 6-6-6-6"
143
- })
144
- });
145
- const CopyIcon = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
146
- ...p,
147
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
148
- width: "14",
149
- height: "14",
150
- x: "8",
151
- y: "8",
152
- rx: "2",
153
- ry: "2"
154
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
155
- d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
156
- })]
157
- });
158
- const CheckCircle2 = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
159
- ...p,
160
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
161
- cx: "12",
162
- cy: "12",
163
- r: "10"
164
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
165
- d: "m9 12 2 2 4-4"
166
- })]
167
- });
168
- const AlertTriangle = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
169
- ...p,
170
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
171
- d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 20h16a2 2 0 0 0 1.73-2Z"
172
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
173
- d: "M12 9v4"
174
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
175
- d: "M12 17h.01"
176
- })]
177
- });
178
-
179
- // =============================
180
- // CopyButton twin (shared/src/ui/components/CopyButton.tsx)
181
- // =============================
182
-
183
- /**
184
- * Circular-safe pretty printer — clipboard/copyToClipboard.ts semantics
185
- * (strings pass through; objects pretty-print at 2 spaces; everything else is
186
- * stringified). safeStringify's cycle guard is a WeakSet replacer here.
187
- */
188
- function stringifyForClipboard(value) {
189
- if (typeof value === "string") return value;
190
- if (typeof value === "object" && value !== null) {
191
- const seen = new WeakSet();
192
- try {
193
- return JSON.stringify(value, (_key, v) => {
194
- if (typeof v === "object" && v !== null) {
195
- if (seen.has(v)) return "[Circular]";
196
- seen.add(v);
197
- }
198
- if (typeof v === "bigint") return `${v}n`;
199
- return v;
200
- }, 2);
201
- } catch {
202
- return String(value);
203
- }
204
- }
205
- return String(value);
206
- }
207
- /**
208
- * Copy button with idle/success/error feedback (1500ms), same icon set and
209
- * state colors as native. No Pro modal / hint banner — see the deviations log.
210
- */
211
- const CopyButton = exports.CopyButton = /*#__PURE__*/(0, _react.memo)(function CopyButton({
212
- value,
213
- size = 16,
214
- buttonStyle,
215
- colors = {},
216
- "aria-label": ariaLabel
217
- }) {
218
- const [copyState, setCopyState] = (0, _react.useState)("idle");
219
- const valueRef = (0, _react.useRef)(value);
220
- valueRef.current = value;
221
- const timeoutRef = (0, _react.useRef)(null);
222
- (0, _react.useEffect)(() => () => {
223
- if (timeoutRef.current) clearTimeout(timeoutRef.current);
224
- }, []);
225
- const settle = state => {
226
- setCopyState(state);
227
- if (timeoutRef.current) clearTimeout(timeoutRef.current);
228
- // 1500ms — native `feedbackDuration` default.
229
- timeoutRef.current = setTimeout(() => {
230
- setCopyState("idle");
231
- timeoutRef.current = null;
232
- }, 1500);
233
- };
234
- const handlePress = async () => {
235
- try {
236
- const resolved = typeof valueRef.current === "function" ? valueRef.current() : valueRef.current;
237
- await navigator.clipboard.writeText(stringifyForClipboard(resolved));
238
- settle("success");
239
- } catch {
240
- settle("error");
241
- }
242
- };
243
- const color = copyState === "success" ? colors.success || gameUI.success : copyState === "error" ? colors.error || gameUI.error : colors.idle || gameUI.secondary;
244
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
245
- type: "button",
246
- onClick: copyState === "idle" ? handlePress : undefined,
247
- "aria-label": ariaLabel ?? (copyState === "idle" ? "Copy to clipboard" : copyState === "success" ? "Copied to clipboard" : "Failed to copy"),
248
- style: {
249
- ...copyStyles.button,
250
- ...buttonStyle
251
- },
252
- children: copyState === "success" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(CheckCircle2, {
253
- size: size,
254
- color: color
255
- }) : copyState === "error" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AlertTriangle, {
256
- size: size,
257
- color: color
258
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(CopyIcon, {
259
- size: size,
260
- color: color
261
- })
262
- });
263
- });
264
-
265
- /** Preset copy button for inline use (smaller size) — native `InlineCopyButton`. */
266
- const InlineCopyButton = exports.InlineCopyButton = /*#__PURE__*/(0, _react.memo)(function InlineCopyButton(props) {
267
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(CopyButton, {
268
- size: 12,
269
- ...props
270
- });
271
- });
272
- const copyStyles = {
273
- // Native CopyButton `styles.button`, verbatim.
274
- button: {
275
- display: "inline-flex",
276
- padding: 4,
277
- justifyContent: "center",
278
- alignItems: "center",
279
- background: "none",
280
- border: "none",
281
- cursor: "pointer",
282
- margin: 0
283
- }
284
- };
285
-
286
- // =============================
287
- // Tree flattening (VirtualizedDataExplorer.tsx, verbatim algorithm minus the
288
- // chunked async yields — see the deviations log)
289
- // =============================
290
-
291
- const getValueType = value => {
292
- if (value === null) return "null";
293
- if (value === undefined) return "undefined";
294
- if (Array.isArray(value)) return "array";
295
- if (value instanceof Date) return "date";
296
- if (value instanceof Error) return "error";
297
- if (value instanceof Map) return "map";
298
- if (value instanceof Set) return "set";
299
- if (value instanceof RegExp) return "regexp";
300
- if (typeof value === "function") return "function";
301
- if (typeof value === "symbol") return "symbol";
302
- if (typeof value === "bigint") return "bigint";
303
- if (typeof value === "object") return "object";
304
- return typeof value;
305
- };
306
- const getValueCount = (value, valueType) => {
307
- if (value === null) return 0;
308
- switch (valueType) {
309
- case "array":
310
- return Array.isArray(value) ? value.length : 0;
311
- case "object":
312
- return typeof value === "object" ? Object.keys(value).length : 0;
313
- case "map":
314
- return value instanceof Map ? value.size : 0;
315
- case "set":
316
- return value instanceof Set ? value.size : 0;
317
- default:
318
- return 0;
319
- }
320
- };
321
-
322
- // Format value for display — VirtualizedDataExplorer `formatValue`, verbatim
323
- // (default branch: displayValue → JSON.stringify, see deviations).
324
- const formatValue = (value, valueType) => {
325
- if (value === null) return "null";
326
- if (value === undefined) return "undefined";
327
- switch (valueType) {
328
- case "string":
329
- return `"${String(value)}"`;
330
- case "boolean":
331
- return value === true ? "true" : "false";
332
- case "function":
333
- return typeof value === "function" ? value.toString().slice(0, 50) + "..." : "undefined";
334
- case "symbol":
335
- return typeof value === "symbol" ? String(value) : "undefined";
336
- case "date":
337
- return value instanceof Date ? value.toISOString() : "undefined";
338
- case "regexp":
339
- return value instanceof RegExp ? value.toString() : "undefined";
340
- case "bigint":
341
- return typeof value === "bigint" ? value.toString() + "n" : "undefined";
342
- case "error":
343
- return value instanceof Error ? `${value.name}: ${value.message}` : "undefined";
344
- default:
345
- try {
346
- return JSON.stringify(value) ?? String(value);
347
- } catch {
348
- return String(value);
349
- }
350
- }
351
- };
352
-
353
- // Type color lookup — VirtualizedDataExplorer TYPE_COLOR_CACHE, verbatim.
354
- const TYPE_COLOR_CACHE = new Map([["string", gameUI.dataTypes.string], ["number", gameUI.dataTypes.number], ["bigint", gameUI.optional], ["boolean", gameUI.dataTypes.boolean], ["null", gameUI.dataTypes.null], ["undefined", gameUI.dataTypes.undefined], ["function", gameUI.dataTypes.function], ["symbol", gameUI.critical], ["date", gameUI.critical], ["error", gameUI.error], ["array", gameUI.dataTypes.array], ["object", gameUI.dataTypes.object], ["map", gameUI.info], ["set", gameUI.success], ["circular", gameUI.warning]]);
355
- const getRowTypeColor = valueType => TYPE_COLOR_CACHE.get(valueType) || gameUI.dataTypes.array;
356
- function flattenData(value, expandedSet, maxDepth, circularCache, key = "root", depth = 0, path = []) {
357
- if (depth > Math.min(maxDepth, MAX_DEPTH_LIMIT)) return [];
358
- const currentPath = [...path, key];
359
- const id = currentPath.join(".");
360
- const valueType = getValueType(value);
361
- const isExpandable = ["object", "array", "map", "set"].includes(valueType) && value !== null;
362
- const childCount = Math.min(isExpandable ? getValueCount(value, valueType) : 0, MAX_ITEMS_PER_LEVEL);
363
- if (value && typeof value === "object") {
364
- if (circularCache.has(value)) {
365
- return [{
366
- id,
367
- key,
368
- value: "[Circular Reference]",
369
- valueType: "circular",
370
- depth,
371
- isExpandable: false,
372
- isExpanded: false,
373
- childCount: 0
374
- }];
375
- }
376
- circularCache.add(value);
377
- }
378
- const result = [{
379
- id,
380
- key,
381
- value,
382
- valueType,
383
- depth,
384
- isExpandable,
385
- isExpanded: expandedSet.has(id),
386
- childCount
387
- }];
388
- if (isExpandable && expandedSet.has(id) && depth < Math.min(maxDepth, MAX_DEPTH_LIMIT)) {
389
- try {
390
- let entries = [];
391
- switch (valueType) {
392
- case "array":
393
- entries = value.map((item, index) => [index.toString(), item]);
394
- break;
395
- case "object":
396
- entries = Object.entries(value);
397
- break;
398
- case "map":
399
- entries = Array.from(value.entries()).map(([k, v]) => [String(k), v]);
400
- break;
401
- case "set":
402
- entries = Array.from(value.values()).map((v, index) => [index.toString(), v]);
403
- break;
404
- }
405
- for (const [childKey, childValue] of entries.slice(0, childCount)) {
406
- result.push(...flattenData(childValue, expandedSet, maxDepth, circularCache, childKey, depth + 1, currentPath));
407
- }
408
- } catch {
409
- // Skip malformed data (same silent-skip as native).
410
- }
411
- }
412
- return result;
413
- }
414
-
415
- // =============================
416
- // Indent guides (IndentGuidesOverlay.tsx — same segment computation, drawn
417
- // over the full list since the web tree isn't virtualized)
418
- // =============================
419
-
420
- function IndentGuides({
421
- items
422
- }) {
423
- const columns = (0, _react.useMemo)(() => {
424
- let maxDepth = 0;
425
- for (const item of items) if (item.depth > maxDepth) maxDepth = item.depth;
426
- const results = [];
427
- for (let depth = 1; depth <= maxDepth; depth++) {
428
- // Center of the indent column, snapped for a crisp 1px line.
429
- const left = Math.round((depth - 0.5) * INDENT_WIDTH) + 0.5;
430
- const segments = [];
431
- let segStart = -1;
432
- let segEnd = -1;
433
- for (let i = 0; i < items.length; i++) {
434
- if ((items[i]?.depth ?? 0) >= depth) {
435
- if (segStart === -1) segStart = i;
436
- segEnd = i;
437
- } else if (segStart !== -1) {
438
- segments.push({
439
- startIndex: segStart,
440
- endIndex: segEnd
441
- });
442
- segStart = -1;
443
- segEnd = -1;
444
- }
445
- }
446
- if (segStart !== -1) segments.push({
447
- startIndex: segStart,
448
- endIndex: segEnd
449
- });
450
- if (segments.length > 0) results.push({
451
- depth,
452
- left,
453
- segments
454
- });
455
- }
456
- return results;
457
- }, [items]);
458
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
459
- style: styles.guidesOverlay,
460
- "aria-hidden": true,
461
- children: columns.map(col => col.segments.map((seg, idx) => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
462
- style: {
463
- ...styles.guideLine,
464
- left: col.left,
465
- top: seg.startIndex * ITEM_HEIGHT,
466
- height: (seg.endIndex - seg.startIndex + 1) * ITEM_HEIGHT,
467
- backgroundColor: `${gameUI.primary}${GUIDE_ALPHA}`
468
- }
469
- }, `${col.depth}-${idx}`)))
470
- });
471
- }
472
-
473
- // =============================
474
- // Tree row (VirtualizedItemComponent, read-only mode)
475
- // =============================
476
-
477
- const TreeRow = /*#__PURE__*/(0, _react.memo)(function TreeRow({
478
- item,
479
- onToggleExpanded
480
- }) {
481
- const [isPressed, setIsPressed] = (0, _react.useState)(false);
482
- const color = getRowTypeColor(item.valueType);
483
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
484
- style: {
485
- ...styles.itemContainer,
486
- marginLeft: item.depth * INDENT_WIDTH
487
- },
488
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
489
- type: "button",
490
- style: {
491
- ...styles.itemTouchable,
492
- ...(isPressed ? styles.itemTouchablePressed : null),
493
- cursor: item.isExpandable ? "pointer" : "default"
494
- },
495
- onClick: item.isExpandable ? () => onToggleExpanded(item.id) : undefined,
496
- onPointerDown: () => setIsPressed(true),
497
- onPointerUp: () => setIsPressed(false),
498
- onPointerLeave: () => setIsPressed(false),
499
- disabled: !item.isExpandable,
500
- "aria-expanded": item.isExpandable ? item.isExpanded : undefined,
501
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
502
- style: styles.expanderContainer,
503
- children: item.isExpandable ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronRight, {
504
- size: 12,
505
- color: gameUI.secondary,
506
- style: {
507
- transform: item.isExpanded ? "rotate(90deg)" : "rotate(0deg)"
508
- }
509
- }) : null
510
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
511
- style: styles.labelContainer,
512
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
513
- style: styles.labelText,
514
- children: [item.key, ":"]
515
- }), item.isExpandable ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
516
- style: {
517
- ...styles.valueText,
518
- color: gameUI.secondary
519
- },
520
- children: [item.valueType, " (", item.childCount, " ", item.childCount === 1 ? "item" : "items", ")"]
521
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
522
- style: {
523
- ...styles.valueText,
524
- color
525
- },
526
- children: formatValue(item.value, item.valueType)
527
- })]
528
- })]
529
- }), item.value !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(CopyButton, {
530
- value: item.value,
531
- size: 14,
532
- buttonStyle: {
533
- marginLeft: 8,
534
- marginRight: 8
535
- }
536
- }) : null]
537
- });
538
- });
539
-
540
- // =============================
541
- // Raw-mode explorer (VirtualizedDataExplorer rawMode path)
542
- // =============================
543
-
544
- function RawExplorer({
545
- data,
546
- maxDepth,
547
- initialExpanded
548
- }) {
549
- // Initial expansion — `getInitialExpanded`, verbatim: root + first level.
550
- const [expandedItems, setExpandedItems] = (0, _react.useState)(() => {
551
- const initial = new Set(["root"]);
552
- if (initialExpanded && data && typeof data === "object") {
553
- if (Array.isArray(data)) {
554
- data.forEach((_, index) => initial.add(`root.${index}`));
555
- } else {
556
- Object.keys(data).forEach(key => initial.add(`root.${key}`));
557
- }
558
- }
559
- return initial;
560
- });
561
- const flatData = (0, _react.useMemo)(() => flattenData(data, expandedItems, maxDepth, new WeakSet()), [data, expandedItems, maxDepth]);
562
- const toggleExpanded = id => {
563
- setExpandedItems(prev => {
564
- const next = new Set(prev);
565
- if (next.has(id)) next.delete(id);else next.add(id);
566
- return next;
567
- });
568
- };
569
- const hasData = data !== null && data !== undefined && (typeof data === "string" ? data.length > 0 : typeof data === "number" || typeof data === "boolean" ? true : Array.isArray(data) ? data.length > 0 : typeof data === "object" ? Object.keys(data).length > 0 : false);
570
- if (!hasData) {
571
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
572
- style: styles.noDataContainer,
573
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
574
- style: styles.noDataText,
575
- children: "No data available"
576
- })
577
- });
578
- }
579
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
580
- style: styles.rawRoot,
581
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(IndentGuides, {
582
- items: flatData
583
- }), flatData.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(TreeRow, {
584
- item: item,
585
- onToggleExpanded: toggleExpanded
586
- }, item.id))]
587
- });
588
- }
589
-
590
- // =============================
591
- // Type legend with filter (dataViewer/TypeLegend.tsx)
592
- // =============================
593
-
594
- /** Type color mapping — dataViewer/TypeLegend.tsx `getTypeColor`, verbatim. */
595
- const getLegendTypeColor = type => {
596
- const colors = {
597
- string: gameUI.dataTypes.string,
598
- number: gameUI.dataTypes.number,
599
- bigint: macOSColors.semantic.debug,
600
- boolean: gameUI.dataTypes.boolean,
601
- null: gameUI.dataTypes.null,
602
- undefined: gameUI.dataTypes.undefined,
603
- function: gameUI.dataTypes.function,
604
- symbol: macOSColors.semantic.error,
605
- date: macOSColors.semantic.error,
606
- error: macOSColors.semantic.error,
607
- array: gameUI.dataTypes.array,
608
- object: gameUI.dataTypes.object
609
- };
610
- return colors[type] || macOSColors.text.secondary;
611
- };
612
- function TypeLegend({
613
- types,
614
- activeFilter,
615
- onFilterChange
616
- }) {
617
- if (types.length === 0) return null;
618
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
619
- style: styles.typeLegend,
620
- children: types.map(type => {
621
- const color = getLegendTypeColor(type);
622
- const isActive = activeFilter === type;
623
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
624
- type: "button",
625
- style: {
626
- ...styles.typeBadge,
627
- ...(isActive ? styles.typeBadgeActive : null),
628
- border: `1px solid ${isActive ? color : macOSColors.text.primary + "1A"}`
629
- },
630
- onClick: () => onFilterChange(activeFilter === type ? null : type),
631
- "aria-label": `Filter by ${type} values`,
632
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
633
- style: {
634
- ...styles.typeColor,
635
- backgroundColor: color
636
- }
637
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
638
- style: {
639
- ...styles.typeName,
640
- ...(isActive ? {
641
- color
642
- } : null)
643
- },
644
- children: type
645
- })]
646
- }, type);
647
- })
648
- });
649
- }
650
-
651
- // =============================
652
- // DataViewer (dataViewer/DataViewer.tsx)
653
- // =============================
654
-
655
- const isPlainObject = value => typeof value === "object" && value !== null && !Array.isArray(value);
656
- function DataViewer({
657
- title: _title,
658
- data,
659
- maxDepth = 10,
660
- rawMode: _rawMode = true,
661
- showTypeFilter = true,
662
- initialExpanded = false,
663
- disableCopy: _disableCopy = false
664
- }) {
665
- const [activeFilter, setActiveFilter] = (0, _react.useState)(null);
666
-
667
- // Calculate visible types in the data — DataViewer.tsx, verbatim.
668
- const visibleTypes = (0, _react.useMemo)(() => {
669
- if (!data || !showTypeFilter) return [];
670
- const types = [];
671
- const processValue = (value, depth = 0) => {
672
- if (depth > 3) return;
673
- const type = Array.isArray(value) ? "array" : value === null ? "null" : typeof value;
674
- types.push(type);
675
- if (type === "object" && isPlainObject(value)) {
676
- Object.values(value).forEach(v => processValue(v, depth + 1));
677
- } else if (Array.isArray(value)) {
678
- value.forEach(v => processValue(v, depth + 1));
679
- }
680
- };
681
- processValue(data);
682
- return Array.from(new Set(types)).slice(0, 8);
683
- }, [data, showTypeFilter]);
684
-
685
- // Filtered projection by type — DataViewer.tsx `flattenByType`, verbatim.
686
- const getFilteredData = (0, _react.useMemo)(() => {
687
- if (!activeFilter || !data) return null;
688
- const filteredObject = {};
689
- let itemCount = 0;
690
- const flattenByType = (obj, targetType, path = "", depth = 0) => {
691
- if (depth > 10 || itemCount > 100) return;
692
- if (Array.isArray(obj)) {
693
- obj.forEach((item, index) => {
694
- const currentPath = path ? `${path}[${index}]` : `[${index}]`;
695
- const itemType = item === null ? "null" : typeof item;
696
- if (itemType === targetType) {
697
- filteredObject[currentPath] = item;
698
- itemCount++;
699
- }
700
- if (itemType === "object" && item !== null || Array.isArray(item)) {
701
- flattenByType(item, targetType, currentPath, depth + 1);
702
- }
703
- });
704
- } else if (obj && typeof obj === "object") {
705
- Object.entries(obj).forEach(([key, value]) => {
706
- const currentPath = path ? `${path}.${key}` : key;
707
- const valueType = Array.isArray(value) ? "array" : value === null ? "null" : typeof value;
708
- if (valueType === targetType) {
709
- filteredObject[currentPath] = value;
710
- itemCount++;
711
- }
712
- if (valueType === "object" && value !== null || valueType === "array") {
713
- flattenByType(value, targetType, currentPath, depth + 1);
714
- }
715
- });
716
- }
717
- };
718
- flattenByType(data, activeFilter);
719
- return {
720
- filteredObject,
721
- itemCount
722
- };
723
- }, [activeFilter, data]);
724
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
725
- children: [showTypeFilter && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
726
- style: styles.header,
727
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TypeLegend, {
728
- types: visibleTypes,
729
- activeFilter: activeFilter,
730
- onFilterChange: setActiveFilter
731
- })
732
- }), activeFilter && getFilteredData ? /*#__PURE__*/(0, _jsxRuntime.jsx)(RawExplorer, {
733
- data: getFilteredData.filteredObject,
734
- maxDepth: maxDepth,
735
- initialExpanded: initialExpanded
736
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(RawExplorer, {
737
- data: data,
738
- maxDepth: maxDepth,
739
- initialExpanded: initialExpanded
740
- })]
741
- });
742
- }
743
-
744
- // Values mirror the native StyleSheet blocks 1:1.
745
- const styles = {
746
- header: {
747
- display: "flex",
748
- flexDirection: "row",
749
- justifyContent: "space-between",
750
- alignItems: "center"
751
- },
752
- rawRoot: {
753
- position: "relative"
754
- },
755
- guidesOverlay: {
756
- position: "absolute",
757
- left: 0,
758
- right: 0,
759
- top: 0,
760
- bottom: 0,
761
- zIndex: 1,
762
- pointerEvents: "none"
763
- },
764
- guideLine: {
765
- position: "absolute",
766
- width: 1
767
- },
768
- itemContainer: {
769
- minHeight: ITEM_HEIGHT,
770
- height: ITEM_HEIGHT,
771
- boxSizing: "border-box",
772
- backgroundColor: "transparent",
773
- position: "relative",
774
- display: "flex",
775
- flexDirection: "row",
776
- alignItems: "flex-start"
777
- },
778
- itemTouchable: {
779
- flex: 1,
780
- minWidth: 0,
781
- display: "flex",
782
- flexDirection: "row",
783
- alignItems: "flex-start",
784
- padding: "2px 16px 2px 0",
785
- minHeight: ITEM_HEIGHT,
786
- boxSizing: "border-box",
787
- background: "none",
788
- border: "none",
789
- margin: 0,
790
- textAlign: "left",
791
- font: "inherit"
792
- },
793
- itemTouchablePressed: {
794
- backgroundColor: `${gameUI.primary}0A`
795
- },
796
- expanderContainer: {
797
- width: 16,
798
- display: "inline-flex",
799
- alignItems: "center",
800
- justifyContent: "center",
801
- marginTop: 4,
802
- flexShrink: 0
803
- },
804
- labelContainer: {
805
- flex: 1,
806
- minWidth: 0,
807
- display: "flex",
808
- flexDirection: "row",
809
- alignItems: "flex-start",
810
- paddingLeft: 2
811
- },
812
- labelText: {
813
- color: gameUI.primary,
814
- fontSize: 12,
815
- fontWeight: 500,
816
- fontFamily: "ui-monospace, Menlo, monospace",
817
- marginRight: 8,
818
- flexShrink: 1,
819
- whiteSpace: "nowrap",
820
- overflow: "hidden",
821
- textOverflow: "ellipsis"
822
- },
823
- valueText: {
824
- fontSize: 12,
825
- fontFamily: "ui-monospace, Menlo, monospace",
826
- flex: 1,
827
- minWidth: 0,
828
- color: gameUI.primaryLight,
829
- whiteSpace: "nowrap",
830
- overflow: "hidden",
831
- textOverflow: "ellipsis"
832
- },
833
- noDataContainer: {
834
- display: "flex",
835
- flex: 1,
836
- justifyContent: "center",
837
- alignItems: "center",
838
- padding: 20
839
- },
840
- noDataText: {
841
- color: gameUI.secondary,
842
- fontSize: 12
843
- },
844
- // dataViewer/TypeLegend.tsx styles, verbatim.
845
- typeLegend: {
846
- display: "flex",
847
- flexDirection: "row",
848
- flexWrap: "wrap",
849
- gap: 6,
850
- width: "100%",
851
- padding: 8,
852
- boxSizing: "border-box"
853
- },
854
- typeBadge: {
855
- display: "inline-flex",
856
- flexDirection: "row",
857
- alignItems: "center",
858
- backgroundColor: macOSColors.background.hover,
859
- padding: "4px 8px",
860
- borderRadius: 12,
861
- cursor: "pointer",
862
- margin: 0
863
- },
864
- typeBadgeActive: {
865
- backgroundColor: macOSColors.background.input
866
- },
867
- typeColor: {
868
- width: 8,
869
- height: 8,
870
- borderRadius: 4,
871
- marginRight: 6,
872
- display: "inline-block"
873
- },
874
- typeName: {
875
- color: macOSColors.text.secondary,
876
- fontSize: 11,
877
- fontWeight: 500
878
- }
879
- };
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.CopyButton=void 0;exports.DataViewer=DataViewer;exports.InlineCopyButton=void 0;var _react=require("react");var _jsxRuntime=require("react/jsx-runtime");const gameUI={primary:"#F5F5F7",primaryLight:"#F5F5F7",secondary:"#A1A1A6",muted:"#8E8E93",success:"#34C759",warning:"#FFEB3B",error:"#FF453A",info:"#00B8E6",critical:"#FF453A",optional:"#BF5AF2",dataTypes:{object:"#00B8E6",array:"#FFEB3B",string:"#34C759",number:"#FF9F0A",boolean:"#BF5AF2",function:"#5E5CE6",undefined:"#8E8E93",null:"#FF453A"}};const macOSColors={background:{hover:"#1D1D1F",input:"#26262A"},text:{primary:"#F5F5F7",secondary:"#A1A1A6"},semantic:{error:"#FF453A",debug:"#BF5AF2"}};const ITEM_HEIGHT=24;const MAX_DEPTH_LIMIT=15;const MAX_ITEMS_PER_LEVEL=500;const INDENT_WIDTH=16;const GUIDE_ALPHA="4D";function Svg({size:e=14,color:t="currentColor",style:o,children:n}){return(0,_jsxRuntime.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,display:"block",...o},children:n})}const ChevronRight=e=>(0,_jsxRuntime.jsx)(Svg,{...e,children:(0,_jsxRuntime.jsx)("path",{d:"m9 18 6-6-6-6"})});const CopyIcon=e=>(0,_jsxRuntime.jsxs)(Svg,{...e,children:[(0,_jsxRuntime.jsx)("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),(0,_jsxRuntime.jsx)("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]});const CheckCircle2=e=>(0,_jsxRuntime.jsxs)(Svg,{...e,children:[(0,_jsxRuntime.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,_jsxRuntime.jsx)("path",{d:"m9 12 2 2 4-4"})]});const AlertTriangle=e=>(0,_jsxRuntime.jsxs)(Svg,{...e,children:[(0,_jsxRuntime.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 20h16a2 2 0 0 0 1.73-2Z"}),(0,_jsxRuntime.jsx)("path",{d:"M12 9v4"}),(0,_jsxRuntime.jsx)("path",{d:"M12 17h.01"})]});function stringifyForClipboard(e){if(typeof e==="string")return e;if(typeof e==="object"&&e!==null){const t=new WeakSet;try{return JSON.stringify(e,(o,n)=>{if(typeof n==="object"&&n!==null){if(t.has(n))return"[Circular]";t.add(n)}if(typeof n==="bigint")return`${n}n`;return n},2)}catch{return String(e)}}return String(e)}const CopyButton=exports.CopyButton=(0,_react.memo)(function e({value:t,size:o=16,buttonStyle:n,colors:r={},"aria-label":a}){const[d,c]=(0,_react.useState)("idle");const i=(0,_react.useRef)(t);i.current=t;const s=(0,_react.useRef)(null);(0,_react.useEffect)(()=>()=>{if(s.current)clearTimeout(s.current)},[]);const f=l=>{c(l);if(s.current)clearTimeout(s.current);s.current=setTimeout(()=>{c("idle");s.current=null},1500)};const x=async()=>{try{const l=typeof i.current==="function"?i.current():i.current;await navigator.clipboard.writeText(stringifyForClipboard(l));f("success")}catch{f("error")}};const p=d==="success"?r.success||gameUI.success:d==="error"?r.error||gameUI.error:r.idle||gameUI.secondary;return(0,_jsxRuntime.jsx)("button",{type:"button",onClick:d==="idle"?x:void 0,"aria-label":a??(d==="idle"?"Copy to clipboard":d==="success"?"Copied to clipboard":"Failed to copy"),style:{...copyStyles.button,...n},children:d==="success"?(0,_jsxRuntime.jsx)(CheckCircle2,{size:o,color:p}):d==="error"?(0,_jsxRuntime.jsx)(AlertTriangle,{size:o,color:p}):(0,_jsxRuntime.jsx)(CopyIcon,{size:o,color:p})})});const InlineCopyButton=exports.InlineCopyButton=(0,_react.memo)(function e(t){return(0,_jsxRuntime.jsx)(CopyButton,{size:12,...t})});const copyStyles={button:{display:"inline-flex",padding:4,justifyContent:"center",alignItems:"center",background:"none",border:"none",cursor:"pointer",margin:0}};const getValueType=e=>{if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";if(e instanceof Date)return"date";if(e instanceof Error)return"error";if(e instanceof Map)return"map";if(e instanceof Set)return"set";if(e instanceof RegExp)return"regexp";if(typeof e==="function")return"function";if(typeof e==="symbol")return"symbol";if(typeof e==="bigint")return"bigint";if(typeof e==="object")return"object";return typeof e};const getValueCount=(e,t)=>{if(e===null)return 0;switch(t){case"array":return Array.isArray(e)?e.length:0;case"object":return typeof e==="object"?Object.keys(e).length:0;case"map":return e instanceof Map?e.size:0;case"set":return e instanceof Set?e.size:0;default:return 0}};const formatValue=(e,t)=>{if(e===null)return"null";if(e===void 0)return"undefined";switch(t){case"string":return`"${String(e)}"`;case"boolean":return e===true?"true":"false";case"function":return typeof e==="function"?e.toString().slice(0,50)+"...":"undefined";case"symbol":return typeof e==="symbol"?String(e):"undefined";case"date":return e instanceof Date?e.toISOString():"undefined";case"regexp":return e instanceof RegExp?e.toString():"undefined";case"bigint":return typeof e==="bigint"?e.toString()+"n":"undefined";case"error":return e instanceof Error?`${e.name}: ${e.message}`:"undefined";default:try{return JSON.stringify(e)??String(e)}catch{return String(e)}}};const TYPE_COLOR_CACHE=new Map([["string",gameUI.dataTypes.string],["number",gameUI.dataTypes.number],["bigint",gameUI.optional],["boolean",gameUI.dataTypes.boolean],["null",gameUI.dataTypes.null],["undefined",gameUI.dataTypes.undefined],["function",gameUI.dataTypes.function],["symbol",gameUI.critical],["date",gameUI.critical],["error",gameUI.error],["array",gameUI.dataTypes.array],["object",gameUI.dataTypes.object],["map",gameUI.info],["set",gameUI.success],["circular",gameUI.warning]]);const getRowTypeColor=e=>TYPE_COLOR_CACHE.get(e)||gameUI.dataTypes.array;function flattenData(e,t,o,n,r="root",a=0,d=[]){if(a>Math.min(o,MAX_DEPTH_LIMIT))return[];const c=[...d,r];const i=c.join(".");const s=getValueType(e);const f=["object","array","map","set"].includes(s)&&e!==null;const x=Math.min(f?getValueCount(e,s):0,MAX_ITEMS_PER_LEVEL);if(e&&typeof e==="object"){if(n.has(e)){return[{id:i,key:r,value:"[Circular Reference]",valueType:"circular",depth:a,isExpandable:false,isExpanded:false,childCount:0}]}n.add(e)}const p=[{id:i,key:r,value:e,valueType:s,depth:a,isExpandable:f,isExpanded:t.has(i),childCount:x}];if(f&&t.has(i)&&a<Math.min(o,MAX_DEPTH_LIMIT)){try{let l=[];switch(s){case"array":l=e.map((u,y)=>[y.toString(),u]);break;case"object":l=Object.entries(e);break;case"map":l=Array.from(e.entries()).map(([u,y])=>[String(u),y]);break;case"set":l=Array.from(e.values()).map((u,y)=>[y.toString(),u]);break}for(const[u,y]of l.slice(0,x)){p.push(...flattenData(y,t,o,n,u,a+1,c))}}catch{}}return p}function IndentGuides({items:e}){const t=(0,_react.useMemo)(()=>{let o=0;for(const r of e)if(r.depth>o)o=r.depth;const n=[];for(let r=1;r<=o;r++){const a=Math.round((r-.5)*INDENT_WIDTH)+.5;const d=[];let c=-1;let i=-1;for(let s=0;s<e.length;s++){if((e[s]?.depth??0)>=r){if(c===-1)c=s;i=s}else if(c!==-1){d.push({startIndex:c,endIndex:i});c=-1;i=-1}}if(c!==-1)d.push({startIndex:c,endIndex:i});if(d.length>0)n.push({depth:r,left:a,segments:d})}return n},[e]);return(0,_jsxRuntime.jsx)("div",{style:styles.guidesOverlay,"aria-hidden":true,children:t.map(o=>o.segments.map((n,r)=>(0,_jsxRuntime.jsx)("div",{style:{...styles.guideLine,left:o.left,top:n.startIndex*ITEM_HEIGHT,height:(n.endIndex-n.startIndex+1)*ITEM_HEIGHT,backgroundColor:`${gameUI.primary}${GUIDE_ALPHA}`}},`${o.depth}-${r}`)))})}const TreeRow=(0,_react.memo)(function e({item:t,onToggleExpanded:o}){const[n,r]=(0,_react.useState)(false);const a=getRowTypeColor(t.valueType);return(0,_jsxRuntime.jsxs)("div",{style:{...styles.itemContainer,marginLeft:t.depth*INDENT_WIDTH},children:[(0,_jsxRuntime.jsxs)("button",{type:"button",style:{...styles.itemTouchable,...n?styles.itemTouchablePressed:null,cursor:t.isExpandable?"pointer":"default"},onClick:t.isExpandable?()=>o(t.id):void 0,onPointerDown:()=>r(true),onPointerUp:()=>r(false),onPointerLeave:()=>r(false),disabled:!t.isExpandable,"aria-expanded":t.isExpandable?t.isExpanded:void 0,children:[(0,_jsxRuntime.jsx)("span",{style:styles.expanderContainer,children:t.isExpandable?(0,_jsxRuntime.jsx)(ChevronRight,{size:12,color:gameUI.secondary,style:{transform:t.isExpanded?"rotate(90deg)":"rotate(0deg)"}}):null}),(0,_jsxRuntime.jsxs)("span",{style:styles.labelContainer,children:[(0,_jsxRuntime.jsxs)("span",{style:styles.labelText,children:[t.key,":"]}),t.isExpandable?(0,_jsxRuntime.jsxs)("span",{style:{...styles.valueText,color:gameUI.secondary},children:[t.valueType," (",t.childCount," ",t.childCount===1?"item":"items",")"]}):(0,_jsxRuntime.jsx)("span",{style:{...styles.valueText,color:a},children:formatValue(t.value,t.valueType)})]})]}),t.value!==void 0?(0,_jsxRuntime.jsx)(CopyButton,{value:t.value,size:14,buttonStyle:{marginLeft:8,marginRight:8}}):null]})});function RawExplorer({data:e,maxDepth:t,initialExpanded:o}){const[n,r]=(0,_react.useState)(()=>{const i=new Set(["root"]);if(o&&e&&typeof e==="object"){if(Array.isArray(e)){e.forEach((s,f)=>i.add(`root.${f}`))}else{Object.keys(e).forEach(s=>i.add(`root.${s}`))}}return i});const a=(0,_react.useMemo)(()=>flattenData(e,n,t,new WeakSet),[e,n,t]);const d=i=>{r(s=>{const f=new Set(s);if(f.has(i))f.delete(i);else f.add(i);return f})};const c=e!==null&&e!==void 0&&(typeof e==="string"?e.length>0:typeof e==="number"||typeof e==="boolean"?true:Array.isArray(e)?e.length>0:typeof e==="object"?Object.keys(e).length>0:false);if(!c){return(0,_jsxRuntime.jsx)("div",{style:styles.noDataContainer,children:(0,_jsxRuntime.jsx)("span",{style:styles.noDataText,children:"No data available"})})}return(0,_jsxRuntime.jsxs)("div",{style:styles.rawRoot,children:[(0,_jsxRuntime.jsx)(IndentGuides,{items:a}),a.map(i=>(0,_jsxRuntime.jsx)(TreeRow,{item:i,onToggleExpanded:d},i.id))]})}const getLegendTypeColor=e=>{const t={string:gameUI.dataTypes.string,number:gameUI.dataTypes.number,bigint:macOSColors.semantic.debug,boolean:gameUI.dataTypes.boolean,null:gameUI.dataTypes.null,undefined:gameUI.dataTypes.undefined,function:gameUI.dataTypes.function,symbol:macOSColors.semantic.error,date:macOSColors.semantic.error,error:macOSColors.semantic.error,array:gameUI.dataTypes.array,object:gameUI.dataTypes.object};return t[e]||macOSColors.text.secondary};function TypeLegend({types:e,activeFilter:t,onFilterChange:o}){if(e.length===0)return null;return(0,_jsxRuntime.jsx)("div",{style:styles.typeLegend,children:e.map(n=>{const r=getLegendTypeColor(n);const a=t===n;return(0,_jsxRuntime.jsxs)("button",{type:"button",style:{...styles.typeBadge,...a?styles.typeBadgeActive:null,border:`1px solid ${a?r:macOSColors.text.primary+"1A"}`},onClick:()=>o(t===n?null:n),"aria-label":`Filter by ${n} values`,children:[(0,_jsxRuntime.jsx)("span",{style:{...styles.typeColor,backgroundColor:r}}),(0,_jsxRuntime.jsx)("span",{style:{...styles.typeName,...a?{color:r}:null},children:n})]},n)})})}const isPlainObject=e=>typeof e==="object"&&e!==null&&!Array.isArray(e);function DataViewer({title:e,data:t,maxDepth:o=10,rawMode:n=true,showTypeFilter:r=true,initialExpanded:a=false,disableCopy:d=false}){const[c,i]=(0,_react.useState)(null);const s=(0,_react.useMemo)(()=>{if(!t||!r)return[];const x=[];const p=(l,u=0)=>{if(u>3)return;const y=Array.isArray(l)?"array":l===null?"null":typeof l;x.push(y);if(y==="object"&&isPlainObject(l)){Object.values(l).forEach(h=>p(h,u+1))}else if(Array.isArray(l)){l.forEach(h=>p(h,u+1))}};p(t);return Array.from(new Set(x)).slice(0,8)},[t,r]);const f=(0,_react.useMemo)(()=>{if(!c||!t)return null;const x={};let p=0;const l=(u,y,h="",C=0)=>{if(C>10||p>100)return;if(Array.isArray(u)){u.forEach((g,b)=>{const j=h?`${h}[${b}]`:`[${b}]`;const m=g===null?"null":typeof g;if(m===y){x[j]=g;p++}if(m==="object"&&g!==null||Array.isArray(g)){l(g,y,j,C+1)}})}else if(u&&typeof u==="object"){Object.entries(u).forEach(([g,b])=>{const j=h?`${h}.${g}`:g;const m=Array.isArray(b)?"array":b===null?"null":typeof b;if(m===y){x[j]=b;p++}if(m==="object"&&b!==null||m==="array"){l(b,y,j,C+1)}})}};l(t,c);return{filteredObject:x,itemCount:p}},[c,t]);return(0,_jsxRuntime.jsxs)("div",{children:[r&&(0,_jsxRuntime.jsx)("div",{style:styles.header,children:(0,_jsxRuntime.jsx)(TypeLegend,{types:s,activeFilter:c,onFilterChange:i})}),c&&f?(0,_jsxRuntime.jsx)(RawExplorer,{data:f.filteredObject,maxDepth:o,initialExpanded:a}):(0,_jsxRuntime.jsx)(RawExplorer,{data:t,maxDepth:o,initialExpanded:a})]})}const styles={header:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},rawRoot:{position:"relative"},guidesOverlay:{position:"absolute",left:0,right:0,top:0,bottom:0,zIndex:1,pointerEvents:"none"},guideLine:{position:"absolute",width:1},itemContainer:{minHeight:ITEM_HEIGHT,height:ITEM_HEIGHT,boxSizing:"border-box",backgroundColor:"transparent",position:"relative",display:"flex",flexDirection:"row",alignItems:"flex-start"},itemTouchable:{flex:1,minWidth:0,display:"flex",flexDirection:"row",alignItems:"flex-start",padding:"2px 16px 2px 0",minHeight:ITEM_HEIGHT,boxSizing:"border-box",background:"none",border:"none",margin:0,textAlign:"left",font:"inherit"},itemTouchablePressed:{backgroundColor:`${gameUI.primary}0A`},expanderContainer:{width:16,display:"inline-flex",alignItems:"center",justifyContent:"center",marginTop:4,flexShrink:0},labelContainer:{flex:1,minWidth:0,display:"flex",flexDirection:"row",alignItems:"flex-start",paddingLeft:2},labelText:{color:gameUI.primary,fontSize:12,fontWeight:500,fontFamily:"ui-monospace, Menlo, monospace",marginRight:8,flexShrink:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},valueText:{fontSize:12,fontFamily:"ui-monospace, Menlo, monospace",flex:1,minWidth:0,color:gameUI.primaryLight,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},noDataContainer:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",padding:20},noDataText:{color:gameUI.secondary,fontSize:12},typeLegend:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:6,width:"100%",padding:8,boxSizing:"border-box"},typeBadge:{display:"inline-flex",flexDirection:"row",alignItems:"center",backgroundColor:macOSColors.background.hover,padding:"4px 8px",borderRadius:12,cursor:"pointer",margin:0},typeBadgeActive:{backgroundColor:macOSColors.background.input},typeColor:{width:8,height:8,borderRadius:4,marginRight:6,display:"inline-block"},typeName:{color:macOSColors.text.secondary,fontSize:11,fontWeight:500}};