@buoy-gg/network 7.0.41 → 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 (272) hide show
  1. package/README.md +11 -85
  2. package/lib/commonjs/index.js +1 -332
  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 -403
  22. package/lib/commonjs/network/components/NetworkListScreen.web.js +1 -624
  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 -135
  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 -510
  61. package/lib/commonjs/network/overrides/engine.js +1 -93
  62. package/lib/commonjs/network/overrides/matchRule.js +1 -87
  63. package/lib/commonjs/network/overrides/overriddenRows.js +1 -37
  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 -411
  80. package/lib/commonjs/network/utils/networkListener.js +4 -1352
  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 -16
  85. package/lib/commonjs/network/utils/resolveRequestUrl.js +1 -15
  86. package/lib/commonjs/network/utils/selectSavedEvents.js +1 -39
  87. package/lib/commonjs/network/utils/startNetworkCapture.js +1 -24
  88. package/lib/commonjs/network/utils/withPinnedFirst.js +1 -32
  89. package/lib/commonjs/preset.js +1 -93
  90. package/lib/module/index.js +1 -104
  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 -399
  110. package/lib/module/network/components/NetworkListScreen.web.js +1 -622
  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 -131
  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 -502
  149. package/lib/module/network/overrides/engine.js +1 -85
  150. package/lib/module/network/overrides/matchRule.js +1 -81
  151. package/lib/module/network/overrides/overriddenRows.js +1 -33
  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 -409
  168. package/lib/module/network/utils/networkListener.js +4 -1341
  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 -12
  173. package/lib/module/network/utils/resolveRequestUrl.js +1 -11
  174. package/lib/module/network/utils/selectSavedEvents.js +1 -35
  175. package/lib/module/network/utils/startNetworkCapture.js +1 -21
  176. package/lib/module/network/utils/withPinnedFirst.js +1 -28
  177. package/lib/module/preset.js +1 -91
  178. package/lib/typescript/network/overrides/engine.d.ts +1 -1
  179. package/lib/typescript/network/overrides/matchRule.d.ts +1 -1
  180. package/lib/typescript/network/overrides/resolveOverride.d.ts +2 -2
  181. package/lib/typescript/network/overrides/types.d.ts +9 -0
  182. package/lib/typescript/network/utils/networkListener.d.ts +11 -0
  183. package/lib/typescript/network/utils/realNow.d.ts +18 -0
  184. package/lib/web/index.mjs +73 -74
  185. package/package.json +2 -2
  186. package/lib/typescript/index.d.ts.map +0 -1
  187. package/lib/typescript/index.web.d.ts.map +0 -1
  188. package/lib/typescript/network/components/DataViewer.web.d.ts.map +0 -1
  189. package/lib/typescript/network/components/NetworkCopyScreen.web.d.ts.map +0 -1
  190. package/lib/typescript/network/components/NetworkCopySettingsView.d.ts.map +0 -1
  191. package/lib/typescript/network/components/NetworkCopySettingsView.web.d.ts.map +0 -1
  192. package/lib/typescript/network/components/NetworkDetailScreen.web.d.ts.map +0 -1
  193. package/lib/typescript/network/components/NetworkDetailStepper.d.ts.map +0 -1
  194. package/lib/typescript/network/components/NetworkDetailStepper.web.d.ts.map +0 -1
  195. package/lib/typescript/network/components/NetworkEventDetailView.d.ts.map +0 -1
  196. package/lib/typescript/network/components/NetworkEventDetailView.web.d.ts.map +0 -1
  197. package/lib/typescript/network/components/NetworkEventItemCompact.d.ts.map +0 -1
  198. package/lib/typescript/network/components/NetworkEventItemCompact.web.d.ts.map +0 -1
  199. package/lib/typescript/network/components/NetworkFilterScreen.web.d.ts.map +0 -1
  200. package/lib/typescript/network/components/NetworkFilterViewV3.d.ts.map +0 -1
  201. package/lib/typescript/network/components/NetworkFilterViewV3.web.d.ts.map +0 -1
  202. package/lib/typescript/network/components/NetworkHeaderLive.d.ts.map +0 -1
  203. package/lib/typescript/network/components/NetworkHeaderLive.web.d.ts.map +0 -1
  204. package/lib/typescript/network/components/NetworkHeaderMenu.d.ts.map +0 -1
  205. package/lib/typescript/network/components/NetworkListScreen.d.ts.map +0 -1
  206. package/lib/typescript/network/components/NetworkListScreen.web.d.ts.map +0 -1
  207. package/lib/typescript/network/components/NetworkModal.d.ts.map +0 -1
  208. package/lib/typescript/network/components/NetworkNumberPrompt.d.ts.map +0 -1
  209. package/lib/typescript/network/components/NetworkNumberPrompt.web.d.ts.map +0 -1
  210. package/lib/typescript/network/components/NetworkOverrideEditor.d.ts.map +0 -1
  211. package/lib/typescript/network/components/NetworkOverrideEditor.web.d.ts.map +0 -1
  212. package/lib/typescript/network/components/NetworkOverrideHeaderButton.d.ts.map +0 -1
  213. package/lib/typescript/network/components/NetworkOverrideHeaderButton.web.d.ts.map +0 -1
  214. package/lib/typescript/network/components/NetworkOverridesButton.d.ts.map +0 -1
  215. package/lib/typescript/network/components/NetworkOverridesButton.web.d.ts.map +0 -1
  216. package/lib/typescript/network/components/NetworkOverridesScreen.d.ts.map +0 -1
  217. package/lib/typescript/network/components/NetworkOverridesScreen.web.d.ts.map +0 -1
  218. package/lib/typescript/network/components/NetworkSavedScreen.d.ts.map +0 -1
  219. package/lib/typescript/network/components/NetworkSavedScreen.web.d.ts.map +0 -1
  220. package/lib/typescript/network/components/NetworkUpgradeBanner.d.ts.map +0 -1
  221. package/lib/typescript/network/components/response-editor/Explorer.d.ts.map +0 -1
  222. package/lib/typescript/network/components/response-editor/Explorer.web.d.ts.map +0 -1
  223. package/lib/typescript/network/components/response-editor/deleteNestedDataByPath.d.ts.map +0 -1
  224. package/lib/typescript/network/components/response-editor/editorContext.d.ts.map +0 -1
  225. package/lib/typescript/network/components/response-editor/updateNestedDataByPath.d.ts.map +0 -1
  226. package/lib/typescript/network/conditions/NetworkConditionsControl.d.ts.map +0 -1
  227. package/lib/typescript/network/conditions/NetworkConditionsControl.test.d.ts.map +0 -1
  228. package/lib/typescript/network/conditions/NetworkConditionsIcon.d.ts.map +0 -1
  229. package/lib/typescript/network/conditions/NetworkFloatingTool.d.ts.map +0 -1
  230. package/lib/typescript/network/conditions/NetworkFloatingTool.test.d.ts.map +0 -1
  231. package/lib/typescript/network/conditions/store.d.ts.map +0 -1
  232. package/lib/typescript/network/conditions/wait.d.ts.map +0 -1
  233. package/lib/typescript/network/conditions/xhr.d.ts.map +0 -1
  234. package/lib/typescript/network/hooks/useLiveNetworkEvent.d.ts.map +0 -1
  235. package/lib/typescript/network/hooks/useNetworkBadgeCounts.d.ts.map +0 -1
  236. package/lib/typescript/network/hooks/useNetworkEventList.d.ts.map +0 -1
  237. package/lib/typescript/network/hooks/useNetworkEvents.d.ts.map +0 -1
  238. package/lib/typescript/network/hooks/useNetworkHasMatches.d.ts.map +0 -1
  239. package/lib/typescript/network/hooks/useNetworkSaved.d.ts.map +0 -1
  240. package/lib/typescript/network/hooks/useNetworkSelection.d.ts.map +0 -1
  241. package/lib/typescript/network/hooks/useOverrideRules.d.ts.map +0 -1
  242. package/lib/typescript/network/hooks/useTickEveryMinute.d.ts.map +0 -1
  243. package/lib/typescript/network/overrides/applyToFetch.d.ts.map +0 -1
  244. package/lib/typescript/network/overrides/applyToXhr.d.ts.map +0 -1
  245. package/lib/typescript/network/overrides/engine.d.ts.map +0 -1
  246. package/lib/typescript/network/overrides/matchRule.d.ts.map +0 -1
  247. package/lib/typescript/network/overrides/overriddenRows.d.ts.map +0 -1
  248. package/lib/typescript/network/overrides/overrideRulesStore.d.ts.map +0 -1
  249. package/lib/typescript/network/overrides/presets.d.ts.map +0 -1
  250. package/lib/typescript/network/overrides/resolveOverride.d.ts.map +0 -1
  251. package/lib/typescript/network/overrides/types.d.ts.map +0 -1
  252. package/lib/typescript/network/sync/networkBodyResolver.d.ts.map +0 -1
  253. package/lib/typescript/network/sync/networkSyncAdapter.d.ts.map +0 -1
  254. package/lib/typescript/network/sync/overrideHonesty.release.test.d.ts.map +0 -1
  255. package/lib/typescript/network/types/index.d.ts.map +0 -1
  256. package/lib/typescript/network/utils/extractOperationName.d.ts.map +0 -1
  257. package/lib/typescript/network/utils/filterNetworkEvents.d.ts.map +0 -1
  258. package/lib/typescript/network/utils/formatGraphQLVariables.d.ts.map +0 -1
  259. package/lib/typescript/network/utils/formatting.d.ts.map +0 -1
  260. package/lib/typescript/network/utils/generateCurl.d.ts.map +0 -1
  261. package/lib/typescript/network/utils/generateNetworkCopyText.d.ts.map +0 -1
  262. package/lib/typescript/network/utils/httpCompletion.d.ts.map +0 -1
  263. package/lib/typescript/network/utils/networkEventStore.d.ts.map +0 -1
  264. package/lib/typescript/network/utils/networkListener.d.ts.map +0 -1
  265. package/lib/typescript/network/utils/networkSavedStore.d.ts.map +0 -1
  266. package/lib/typescript/network/utils/networkSelectionStore.d.ts.map +0 -1
  267. package/lib/typescript/network/utils/requestId.d.ts.map +0 -1
  268. package/lib/typescript/network/utils/resolveRequestUrl.d.ts.map +0 -1
  269. package/lib/typescript/network/utils/selectSavedEvents.d.ts.map +0 -1
  270. package/lib/typescript/network/utils/startNetworkCapture.d.ts.map +0 -1
  271. package/lib/typescript/network/utils/withPinnedFirst.d.ts.map +0 -1
  272. package/lib/typescript/preset.d.ts.map +0 -1
@@ -1,1504 +1,35 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NetworkEventDetailView = void 0;
7
- var _react = require("react");
8
- var _formatGraphQLVariables = require("../utils/formatGraphQLVariables");
9
- var _networkBodyResolver = require("../sync/networkBodyResolver");
10
- var _DataViewer = require("./DataViewer.web");
11
- var _jsxRuntime = require("react/jsx-runtime");
12
- /**
13
- * NetworkEventDetailView.web — DOM twin of NetworkEventDetailView.tsx.
14
- *
15
- * The request DETAIL inspector: method/status/duration header row, URL
16
- * breakdown (with collapsible query parameters), error box, timing card
17
- * (Started + Sent/Received + the two real timing-phase bars), collapsible
18
- * Request/Response Headers, Request/Response Body (JSON trees, response
19
- * expanded on arrival), and the Filter Options section — same section order,
20
- * labels, defaults and styling as native. The data layer is REUSED, not
21
- * forked: `useNetworkBodyResolver` (plain React context), `formatGraphQLDisplay`
22
- * and the `NetworkEvent`/`NetworkTimings` types are the same modules native
23
- * uses; `showBodies` carries the same settle-window contract (see the native
24
- * file's prop doc) with the same fixed-height `BodyDeferred` stand-in.
25
- *
26
- * shared-ui RN chrome is replicated as DOM with provenance (web consumers
27
- * resolve `@buoy-gg/shared-ui` to a minimal shim):
28
- * - `macOSColors` — inlined verbatim subset from
29
- * shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts.
30
- * - Icons — inline lucide SVGs (shared-ui's icons are lucide re-exports).
31
- * - `formatBytes` / `formatDuration` — copied verbatim from
32
- * shared/src/utils/formatting/dataFormatting.ts (not in the web shim).
33
- * - `formatHttpStatus` — copied verbatim from
34
- * shared/src/utils/formatting/httpFormatting.ts; its `gameUIColors` are the
35
- * macOS theme, so the color table below carries the same resolved values.
36
- * - `formatRelativeTime` — copied verbatim from
37
- * shared/src/utils/time/formatRelativeTime.ts.
38
- * - `DataViewer` / `InlineCopyButton` — DOM twins in ./DataViewer.web.
39
- *
40
- * Intentional deviations (all logged):
41
- * - License gating isn't part of the web port: the view renders the Pro path
42
- * (`isPro = true` everywhere native branches) — copy buttons are real
43
- * clipboard copies, never upgrade prompts — and shared-ui's `UpgradeModal`
44
- * is therefore not mounted (`useFeatureGate` lives behind @buoy-gg/license,
45
- * outside the web port).
46
- * - Copy affordances use `navigator.clipboard` via the CopyButton twin; the
47
- * full-request copy keeps native's LAZY function value so no markdown is
48
- * built per render.
49
- * - Relative time ("12s ago") refreshes on re-render only — native mounts a
50
- * `TickProvider` at the modal root; the web port's live-event subscription
51
- * re-renders an open detail on every store update, which covers it in
52
- * practice for in-flight requests.
53
- *
54
- * @platform React DOM Web
55
- */
56
-
57
- // =============================
58
- // Native palettes (provenance)
59
- // =============================
60
-
61
- /** macOSColors subset — shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts, verbatim. */const macOSColors = {
62
- background: {
63
- base: "#0A0A0C",
64
- card: "#1A1A1C",
65
- hover: "#1D1D1F",
66
- input: "#26262A"
67
- },
68
- border: {
69
- default: "#2D2D2F"
70
- },
71
- text: {
72
- primary: "#F5F5F7",
73
- secondary: "#A1A1A6",
74
- muted: "#8E8E93"
75
- },
76
- semantic: {
77
- success: "#34C759",
78
- error: "#FF453A",
79
- errorBackground: "rgba(255, 69, 58, 0.15)",
80
- warning: "#FFEB3B",
81
- warningBackground: "rgba(255, 235, 59, 0.15)",
82
- info: "#00B8E6",
83
- infoBackground: "rgba(0, 184, 230, 0.1)"
84
- }
85
- };
86
-
87
- /**
88
- * Colour for the icons that merely LABEL a section (Sent/Received, the JSON
89
- * body glyphs) — same rationale as native.
90
- */
91
- const NEUTRAL_ICON = macOSColors.semantic.success;
92
-
93
- // =============================
94
- // Formatting utils (provenance: shared/src/utils — not in the web shim)
95
- // =============================
96
-
97
- /** shared/src/utils/formatting/dataFormatting.ts `formatBytes`, verbatim. */
98
- function formatBytes(bytes) {
99
- if (bytes === undefined || bytes === null) return "N/A";
100
- if (bytes === 0) return "0 B";
101
- const k = 1024;
102
- const sizes = ["B", "KB", "MB", "GB", "TB"];
103
- const i = Math.floor(Math.log(bytes) / Math.log(k));
104
- return `${(bytes / Math.pow(k, i)).toFixed(1)} ${sizes[i]}`;
105
- }
106
-
107
- /** shared/src/utils/formatting/dataFormatting.ts `formatDuration`, verbatim. */
108
- function formatDuration(ms) {
109
- if (ms === undefined || ms === null) return "N/A";
110
- if (ms < 1000) return `${ms}ms`;
111
- if (ms < 60000) return `${(ms / 1000).toFixed(1)}s`;
112
- if (ms < 3600000) {
113
- const minutes = Math.floor(ms / 60000);
114
- const seconds = Math.floor(ms % 60000 / 1000);
115
- return seconds > 0 ? `${minutes}m ${seconds}s` : `${minutes}m`;
116
- }
117
- const hours = Math.floor(ms / 3600000);
118
- const minutes = Math.floor(ms % 3600000 / 60000);
119
- return minutes > 0 ? `${hours}h ${minutes}m` : `${hours}h`;
120
- }
121
-
122
- /** shared/src/utils/time/formatRelativeTime.ts, verbatim. */
123
- function formatRelativeTime(timestamp, currentTime = Date.now()) {
124
- const timestampMs = timestamp instanceof Date ? timestamp.getTime() : timestamp;
125
- const seconds = Math.floor((currentTime - timestampMs) / 1000);
126
- if (seconds < 0) return "just now";
127
- if (seconds < 60) return seconds === 0 ? "just now" : `${seconds}s ago`;
128
- const minutes = Math.floor(seconds / 60);
129
- if (minutes < 60) return `${minutes}m ago`;
130
- const hours = Math.floor(minutes / 60);
131
- if (hours < 24) return `${hours}h ago`;
132
- const days = Math.floor(hours / 24);
133
- return `${days}d ago`;
134
- }
135
-
136
- /**
137
- * shared/src/utils/formatting/httpFormatting.ts `formatHttpStatus`, verbatim —
138
- * its `gameUIColors` resolve to the macOS theme's semantic values (the same
139
- * `macOSColors.semantic` palette inlined above; muted = text.muted).
140
- */
141
- function formatHttpStatus(status) {
142
- if (status >= 100 && status < 200) {
143
- return {
144
- text: String(status),
145
- color: macOSColors.semantic.info,
146
- meaning: "Informational"
147
- };
148
- }
149
- if (status >= 200 && status < 300) {
150
- const meanings = {
151
- 200: "OK",
152
- 201: "Created",
153
- 202: "Accepted",
154
- 204: "No Content",
155
- 206: "Partial Content"
156
- };
157
- return {
158
- text: String(status),
159
- color: macOSColors.semantic.success,
160
- meaning: meanings[status] || "Success"
161
- };
162
- }
163
- if (status >= 300 && status < 400) {
164
- const meanings = {
165
- 301: "Moved Permanently",
166
- 302: "Found",
167
- 303: "See Other",
168
- 304: "Not Modified",
169
- 307: "Temporary Redirect",
170
- 308: "Permanent Redirect"
171
- };
172
- return {
173
- text: String(status),
174
- color: macOSColors.semantic.warning,
175
- meaning: meanings[status] || "Redirect"
176
- };
177
- }
178
- if (status >= 400 && status < 500) {
179
- const meanings = {
180
- 400: "Bad Request",
181
- 401: "Unauthorized",
182
- 402: "Payment Required",
183
- 403: "Forbidden",
184
- 404: "Not Found",
185
- 405: "Method Not Allowed",
186
- 408: "Request Timeout",
187
- 409: "Conflict",
188
- 410: "Gone",
189
- 422: "Unprocessable Entity",
190
- 429: "Too Many Requests"
191
- };
192
- return {
193
- text: String(status),
194
- color: macOSColors.semantic.error,
195
- meaning: meanings[status] || "Client Error"
196
- };
197
- }
198
- if (status >= 500) {
199
- const meanings = {
200
- 500: "Internal Server Error",
201
- 501: "Not Implemented",
202
- 502: "Bad Gateway",
203
- 503: "Service Unavailable",
204
- 504: "Gateway Timeout",
205
- 505: "HTTP Version Not Supported"
206
- };
207
- return {
208
- text: String(status),
209
- color: macOSColors.semantic.error,
210
- meaning: meanings[status] || "Server Error"
211
- };
212
- }
213
- return {
214
- text: String(status),
215
- color: macOSColors.text.muted,
216
- meaning: "Unknown"
217
- };
218
- }
219
-
220
- // =============================
221
- // Inline lucide icons (shared-ui icons are lucide re-exports)
222
- // =============================
223
-
224
- function Svg({
225
- size = 14,
226
- color = "currentColor",
227
- children
228
- }) {
229
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
230
- width: size,
231
- height: size,
232
- viewBox: "0 0 24 24",
233
- fill: "none",
234
- stroke: color,
235
- strokeWidth: 2,
236
- strokeLinecap: "round",
237
- strokeLinejoin: "round",
238
- style: {
239
- flexShrink: 0,
240
- display: "block"
241
- },
242
- children: children
243
- });
244
- }
245
- const Clock = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
246
- ...p,
247
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
248
- cx: "12",
249
- cy: "12",
250
- r: "10"
251
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("polyline", {
252
- points: "12 6 12 12 16 14"
253
- })]
254
- });
255
- const Upload = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
256
- ...p,
257
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
258
- d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
259
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("polyline", {
260
- points: "17 8 12 3 7 8"
261
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
262
- x1: "12",
263
- x2: "12",
264
- y1: "3",
265
- y2: "15"
266
- })]
267
- });
268
- const Download = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
269
- ...p,
270
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
271
- d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
272
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("polyline", {
273
- points: "7 10 12 15 17 10"
274
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
275
- x1: "12",
276
- x2: "12",
277
- y1: "15",
278
- y2: "3"
279
- })]
280
- });
281
- const AlertCircle = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
282
- ...p,
283
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
284
- cx: "12",
285
- cy: "12",
286
- r: "10"
287
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
288
- x1: "12",
289
- x2: "12",
290
- y1: "8",
291
- y2: "12"
292
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
293
- x1: "12",
294
- x2: "12.01",
295
- y1: "16",
296
- y2: "16"
297
- })]
298
- });
299
- const ChevronDown = p => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
300
- ...p,
301
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
302
- d: "m6 9 6 6 6-6"
303
- })
304
- });
305
- const ChevronUp = p => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
306
- ...p,
307
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
308
- d: "m18 15-6-6-6 6"
309
- })
310
- });
311
- const Lock = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
312
- ...p,
313
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
314
- width: "18",
315
- height: "11",
316
- x: "3",
317
- y: "11",
318
- rx: "2",
319
- ry: "2"
320
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
321
- d: "M7 11V7a5 5 0 0 1 10 0v4"
322
- })]
323
- });
324
- const Unlock = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
325
- ...p,
326
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
327
- width: "18",
328
- height: "11",
329
- x: "3",
330
- y: "11",
331
- rx: "2",
332
- ry: "2"
333
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
334
- d: "M7 11V7a5 5 0 0 1 9.9-1"
335
- })]
336
- });
337
- const FileJson = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
338
- ...p,
339
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
340
- d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"
341
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
342
- d: "M14 2v4a2 2 0 0 0 2 2h4"
343
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
344
- d: "M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"
345
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
346
- d: "M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"
347
- })]
348
- });
349
- const Filter = p => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
350
- ...p,
351
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("polygon", {
352
- points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"
353
- })
354
- });
355
- const Globe = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
356
- ...p,
357
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
358
- cx: "12",
359
- cy: "12",
360
- r: "10"
361
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
362
- d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"
363
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
364
- d: "M2 12h20"
365
- })]
366
- });
367
- const Link = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
368
- ...p,
369
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
370
- d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"
371
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
372
- d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
373
- })]
374
- });
375
- const FlaskConical = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
376
- ...p,
377
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
378
- d: "M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2"
379
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
380
- d: "M8.5 2h7"
381
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
382
- d: "M7 16h10"
383
- })]
384
- });
385
-
386
- // =============================
387
- // View (structure mirrors the native file 1:1)
388
- // =============================
389
-
390
- /** Hoisted so the defaults don't mint a new Set/function per render (native). */
391
- const EMPTY_PATTERNS = new Set();
392
- const noop = () => {};
393
- /**
394
- * The measurable slice of a request's lifetime, as proportional bars.
395
- * Renders NOTHING when the interceptor couldn't measure it — same "absent,
396
- * not zeroed" rule as native. Only two phases, on purpose (see native).
397
- */
398
- const TimingPhases = ({
399
- timings,
400
- total
401
- }) => {
402
- // Guard the divisor: a sub-millisecond request would otherwise divide by 0.
403
- const span = Math.max(1, total);
404
- const phases = [{
405
- label: "Waiting (TTFB)",
406
- hint: "incl. queue, DNS, TLS",
407
- value: timings.ttfb,
408
- color: macOSColors.semantic.warning
409
- }, {
410
- label: "Content download",
411
- hint: undefined,
412
- value: timings.download,
413
- color: macOSColors.semantic.success
414
- }];
415
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
416
- style: styles.phaseList,
417
- children: phases.map(phase => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
418
- style: styles.phaseRow,
419
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
420
- style: styles.phaseLabelGroup,
421
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
422
- style: styles.phaseLabel,
423
- children: phase.label
424
- }), phase.hint ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
425
- style: styles.phaseHint,
426
- children: phase.hint
427
- }) : null]
428
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
429
- style: styles.phaseTrack,
430
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
431
- style: {
432
- ...styles.phaseBar,
433
- backgroundColor: phase.color,
434
- // Floor so a 1ms phase is a visible tick; ceiling because ttfb
435
- // can exceed event.duration (measured at different points).
436
- width: `${Math.min(100, Math.max(1, phase.value / span * 100))}%`
437
- }
438
- })
439
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
440
- style: styles.phaseValue,
441
- children: formatDuration(phase.value)
442
- })]
443
- }, phase.label))
444
- });
445
- };
446
-
447
- /**
448
- * Stand-in for a body tree while the prev/next cursor is still moving.
449
- * Fixed-height nothing — must cost ~0 and must not resize the scroll view as
450
- * the real tree swaps in (native rationale).
451
- */
452
- const BodyDeferred = () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
453
- style: styles.bodyDeferred
454
- });
455
-
456
- // Component for collapsible sections matching Sentry style
457
- const CollapsibleSection = ({
458
- title,
459
- icon,
460
- children,
461
- defaultOpen = false,
462
- count
463
- }) => {
464
- const [isOpen, setIsOpen] = (0, _react.useState)(defaultOpen);
465
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
466
- style: styles.collapsibleSection,
467
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
468
- type: "button",
469
- style: styles.collapsibleHeader,
470
- onClick: () => setIsOpen(!isOpen),
471
- "aria-expanded": isOpen,
472
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
473
- style: styles.collapsibleTitle,
474
- children: [icon, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
475
- style: styles.collapsibleTitleText,
476
- children: title
477
- }), count !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
478
- style: styles.collapsibleCount,
479
- children: count
480
- }) : null]
481
- }), isOpen ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronUp, {
482
- size: 16,
483
- color: macOSColors.text.secondary
484
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronDown, {
485
- size: 16,
486
- color: macOSColors.text.secondary
487
- })]
488
- }), isOpen ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
489
- style: styles.collapsibleContent,
490
- children: children
491
- }) : null]
492
- });
493
- };
494
-
495
- // URL breakdown component matching Sentry style
496
- const UrlBreakdown = ({
497
- url,
498
- operationName,
499
- graphqlVariables,
500
- requestClient
501
- }) => {
502
- const parseUrl = urlString => {
503
- try {
504
- const urlObj = new URL(urlString);
505
- const protocol = String(urlObj.protocol || "");
506
- const host = String(urlObj.host || "");
507
- const isSecure = protocol === "https:";
508
- let pathname = String(urlObj.pathname || "");
509
-
510
- // GraphQL requests format with arrow notation, matching React Query's
511
- // key display: "GetPokemon › Sandshrew" (same pure util as native).
512
- if (requestClient === "graphql" && operationName) {
513
- const graphqlDisplay = (0, _formatGraphQLVariables.formatGraphQLDisplay)(operationName, graphqlVariables);
514
- pathname = `${pathname} (${graphqlDisplay})`;
515
- } else if (operationName) {
516
- // Non-GraphQL requests with operation names (e.g., gRPC)
517
- pathname = `${pathname} (${operationName})`;
518
- }
519
- const params = {};
520
- const searchParams = urlObj.searchParams;
521
- if (searchParams && typeof searchParams.forEach === "function") {
522
- searchParams.forEach((value, key) => {
523
- params[key] = value;
524
- });
525
- }
526
- return {
527
- protocol: protocol.replace(":", ""),
528
- host,
529
- pathname,
530
- params: Object.keys(params).length > 0 ? params : null,
531
- isSecure
532
- };
533
- } catch {
534
- return {
535
- protocol: "",
536
- host: url,
537
- pathname: "",
538
- params: null,
539
- isSecure: false
540
- };
541
- }
542
- };
543
-
544
- /**
545
- * MUST be memoized — `params` is handed to DataViewer as its `data` prop,
546
- * which the tree keys on by IDENTITY (same trap the native file documents).
547
- */
548
- const urlParts = (0, _react.useMemo)(() => parseUrl(url),
549
- // parseUrl closes over the graphql/operation props, which are what change
550
- // the derived pathname.
551
- // eslint-disable-next-line react-hooks/exhaustive-deps
552
- [url, requestClient, operationName, graphqlVariables]);
553
- const [showParams, setShowParams] = (0, _react.useState)(false);
554
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
555
- style: styles.urlBreakdown,
556
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
557
- style: styles.urlRow,
558
- children: [urlParts.isSecure ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Lock, {
559
- size: 12,
560
- color: macOSColors.semantic.success
561
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(Unlock, {
562
- size: 12,
563
- color: macOSColors.semantic.warning
564
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
565
- style: styles.urlDomain,
566
- children: urlParts.host
567
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
568
- style: styles.urlProtocol,
569
- children: ["(", urlParts.protocol.toUpperCase(), ")"]
570
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DataViewer.InlineCopyButton, {
571
- value: url,
572
- buttonStyle: styles.copyButton
573
- })]
574
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
575
- style: styles.urlPathRow,
576
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
577
- style: styles.urlPath,
578
- children: [urlParts.pathname, urlParts.params ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
579
- style: styles.urlQueryString,
580
- children: ["?", new URLSearchParams(urlParts.params).toString()]
581
- }) : null]
582
- })
583
- }), urlParts.params ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
584
- style: styles.queryParamsCollapsible,
585
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
586
- type: "button",
587
- style: styles.queryParamsToggle,
588
- onClick: () => setShowParams(!showParams),
589
- "aria-expanded": showParams,
590
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
591
- style: styles.queryParamsToggleText,
592
- children: "Query Parameters"
593
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
594
- style: {
595
- ...styles.collapsibleCount,
596
- flex: 1,
597
- textAlign: "left"
598
- },
599
- children: Object.keys(urlParts.params).length
600
- }), showParams ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronUp, {
601
- size: 14,
602
- color: macOSColors.text.secondary
603
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronDown, {
604
- size: 14,
605
- color: macOSColors.text.secondary
606
- })]
607
- }), showParams ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_DataViewer.DataViewer, {
608
- title: "",
609
- data: urlParts.params,
610
- showTypeFilter: true,
611
- rawMode: true,
612
- initialExpanded: true
613
- }) : null]
614
- }) : null]
615
- });
616
- };
617
-
618
- /**
619
- * Detailed inspector for a single network event — Sentry-style layout with
620
- * collapsible sections and quick copy affordances.
621
- *
622
- * MEMOIZED for the same two render paths as native: `useLiveNetworkEvent`
623
- * replays the same event object on re-subscribe, and host-root state changes
624
- * re-render the shell with the detail body unchanged.
625
- */
626
- const NetworkEventDetailView = exports.NetworkEventDetailView = /*#__PURE__*/(0, _react.memo)(function NetworkEventDetailView({
627
- event,
628
- ignoredPatterns = EMPTY_PATTERNS,
629
- onTogglePattern = noop,
630
- showBodies = true
631
- }) {
632
- const status = event.status ? formatHttpStatus(event.status) : null;
633
- const isPending = !event.status && !event.error;
634
-
635
- // Large bodies are omitted from synced snapshots and fetched on demand
636
- // through the resolver (plain React context — reused, not forked). In a
637
- // webview port there is normally no resolver and bodies are always inline,
638
- // so this is a no-op there — exactly like on the device.
639
- const resolveBody = (0, _networkBodyResolver.useNetworkBodyResolver)();
640
- // The explicit flag is authoritative (adapter v5+). The size>0 fallback keeps
641
- // detail-on-demand working against a device on an older adapter, which marked
642
- // a withheld body only by leaving `data` undefined with a non-zero size.
643
- const requestBodyOmitted = event.requestData === undefined && (event.requestBodyOmitted === true || (event.requestSize ?? 0) > 0);
644
- const responseBodyOmitted = event.responseData === undefined && (event.responseBodyOmitted === true || (event.responseSize ?? 0) > 0);
645
- const headersOmitted = event.headersOmitted === true;
646
- const [resolvedBody, setResolvedBody] = (0, _react.useState)(null);
647
- const [isLoadingBody, setIsLoadingBody] = (0, _react.useState)(false);
648
- (0, _react.useEffect)(() => {
649
- setResolvedBody(null);
650
- if (!resolveBody || !requestBodyOmitted && !responseBodyOmitted && !headersOmitted) {
651
- setIsLoadingBody(false);
652
- return;
653
- }
654
- let cancelled = false;
655
- setIsLoadingBody(true);
656
- resolveBody(event.id).then(body => {
657
- if (!cancelled) setResolvedBody(body);
658
- }).catch(() => {}).finally(() => {
659
- if (!cancelled) setIsLoadingBody(false);
660
- });
661
- return () => {
662
- cancelled = true;
663
- };
664
- }, [event.id, resolveBody, requestBodyOmitted, responseBodyOmitted, headersOmitted]);
665
-
666
- // Effective bodies: inline data when present, otherwise the lazily resolved
667
- // body. `null`/`undefined` both collapse to undefined ("no body").
668
- const requestData = event.requestData ?? resolvedBody?.requestData ?? undefined;
669
- const responseData = event.responseData ?? resolvedBody?.responseData ?? undefined;
670
- const requestHeaders = (headersOmitted ? resolvedBody?.requestHeaders : undefined) ?? event.requestHeaders;
671
- const responseHeaders = (headersOmitted ? resolvedBody?.responseHeaders : undefined) ?? event.responseHeaders;
672
-
673
- // Generate full request details for copying (resolved LAZILY at press time —
674
- // see the copy button below).
675
- const getFullRequestDetails = () => {
676
- const requestDetails = {
677
- method: event.method,
678
- url: event.url,
679
- status: event.status,
680
- statusText: event.statusText,
681
- timestamp: new Date(event.timestamp).toISOString(),
682
- duration: event.duration ? `${event.duration}ms` : "N/A",
683
- requestHeaders,
684
- requestData,
685
- responseHeaders,
686
- responseData,
687
- requestSize: event.requestSize ? formatBytes(event.requestSize) : "N/A",
688
- responseSize: event.responseSize ? formatBytes(event.responseSize) : "N/A",
689
- error: event.error,
690
- client: event.requestClient
691
- };
692
- return `# Network Request Details
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkEventDetailView=void 0;var _react=require("react");var _formatGraphQLVariables=require("../utils/formatGraphQLVariables");var _networkBodyResolver=require("../sync/networkBodyResolver");var _DataViewer=require("./DataViewer.web");var _jsxRuntime=require("react/jsx-runtime");const macOSColors={background:{base:"#0A0A0C",card:"#1A1A1C",hover:"#1D1D1F",input:"#26262A"},border:{default:"#2D2D2F"},text:{primary:"#F5F5F7",secondary:"#A1A1A6",muted:"#8E8E93"},semantic:{success:"#34C759",error:"#FF453A",errorBackground:"rgba(255, 69, 58, 0.15)",warning:"#FFEB3B",warningBackground:"rgba(255, 235, 59, 0.15)",info:"#00B8E6",infoBackground:"rgba(0, 184, 230, 0.1)"}};const NEUTRAL_ICON=macOSColors.semantic.success;function formatBytes(t){if(t===void 0||t===null)return"N/A";if(t===0)return"0 B";const e=1024;const s=["B","KB","MB","GB","TB"];const o=Math.floor(Math.log(t)/Math.log(e));return`${(t/Math.pow(e,o)).toFixed(1)} ${s[o]}`}function formatDuration(t){if(t===void 0||t===null)return"N/A";if(t<1e3)return`${t}ms`;if(t<6e4)return`${(t/1e3).toFixed(1)}s`;if(t<36e5){const o=Math.floor(t/6e4);const i=Math.floor(t%6e4/1e3);return i>0?`${o}m ${i}s`:`${o}m`}const e=Math.floor(t/36e5);const s=Math.floor(t%36e5/6e4);return s>0?`${e}h ${s}m`:`${e}h`}function formatRelativeTime(t,e=Date.now()){const s=t instanceof Date?t.getTime():t;const o=Math.floor((e-s)/1e3);if(o<0)return"just now";if(o<60)return o===0?"just now":`${o}s ago`;const i=Math.floor(o/60);if(i<60)return`${i}m ago`;const n=Math.floor(i/60);if(n<24)return`${n}h ago`;const l=Math.floor(n/24);return`${l}d ago`}function formatHttpStatus(t){if(t>=100&&t<200){return{text:String(t),color:macOSColors.semantic.info,meaning:"Informational"}}if(t>=200&&t<300){const e={200:"OK",201:"Created",202:"Accepted",204:"No Content",206:"Partial Content"};return{text:String(t),color:macOSColors.semantic.success,meaning:e[t]||"Success"}}if(t>=300&&t<400){const e={301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect"};return{text:String(t),color:macOSColors.semantic.warning,meaning:e[t]||"Redirect"}}if(t>=400&&t<500){const e={400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",408:"Request Timeout",409:"Conflict",410:"Gone",422:"Unprocessable Entity",429:"Too Many Requests"};return{text:String(t),color:macOSColors.semantic.error,meaning:e[t]||"Client Error"}}if(t>=500){const e={500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"};return{text:String(t),color:macOSColors.semantic.error,meaning:e[t]||"Server Error"}}return{text:String(t),color:macOSColors.text.muted,meaning:"Unknown"}}function Svg({size:t=14,color:e="currentColor",children:s}){return(0,_jsxRuntime.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,display:"block"},children:s})}const Clock=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,_jsxRuntime.jsx)("polyline",{points:"12 6 12 12 16 14"})]});const Upload=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,_jsxRuntime.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,_jsxRuntime.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]});const Download=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,_jsxRuntime.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,_jsxRuntime.jsx)("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]});const AlertCircle=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,_jsxRuntime.jsx)("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),(0,_jsxRuntime.jsx)("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})]});const ChevronDown=t=>(0,_jsxRuntime.jsx)(Svg,{...t,children:(0,_jsxRuntime.jsx)("path",{d:"m6 9 6 6 6-6"})});const ChevronUp=t=>(0,_jsxRuntime.jsx)(Svg,{...t,children:(0,_jsxRuntime.jsx)("path",{d:"m18 15-6-6-6 6"})});const Lock=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),(0,_jsxRuntime.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]});const Unlock=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),(0,_jsxRuntime.jsx)("path",{d:"M7 11V7a5 5 0 0 1 9.9-1"})]});const FileJson=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),(0,_jsxRuntime.jsx)("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),(0,_jsxRuntime.jsx)("path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"}),(0,_jsxRuntime.jsx)("path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"})]});const Filter=t=>(0,_jsxRuntime.jsx)(Svg,{...t,children:(0,_jsxRuntime.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})});const Globe=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,_jsxRuntime.jsx)("path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}),(0,_jsxRuntime.jsx)("path",{d:"M2 12h20"})]});const Link=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),(0,_jsxRuntime.jsx)("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]});const FlaskConical=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2"}),(0,_jsxRuntime.jsx)("path",{d:"M8.5 2h7"}),(0,_jsxRuntime.jsx)("path",{d:"M7 16h10"})]});const EMPTY_PATTERNS=new Set;const noop=()=>{};const TimingPhases=({timings:t,total:e})=>{const s=Math.max(1,e);const o=[{label:"Waiting (TTFB)",hint:"incl. queue, DNS, TLS",value:t.ttfb,color:macOSColors.semantic.warning},{label:"Content download",hint:void 0,value:t.download,color:macOSColors.semantic.success}];return(0,_jsxRuntime.jsx)("div",{style:styles.phaseList,children:o.map(i=>(0,_jsxRuntime.jsxs)("div",{style:styles.phaseRow,children:[(0,_jsxRuntime.jsxs)("div",{style:styles.phaseLabelGroup,children:[(0,_jsxRuntime.jsx)("div",{style:styles.phaseLabel,children:i.label}),i.hint?(0,_jsxRuntime.jsx)("div",{style:styles.phaseHint,children:i.hint}):null]}),(0,_jsxRuntime.jsx)("div",{style:styles.phaseTrack,children:(0,_jsxRuntime.jsx)("div",{style:{...styles.phaseBar,backgroundColor:i.color,width:`${Math.min(100,Math.max(1,i.value/s*100))}%`}})}),(0,_jsxRuntime.jsx)("span",{style:styles.phaseValue,children:formatDuration(i.value)})]},i.label))})};const BodyDeferred=()=>(0,_jsxRuntime.jsx)("div",{style:styles.bodyDeferred});const CollapsibleSection=({title:t,icon:e,children:s,defaultOpen:o=false,count:i})=>{const[n,l]=(0,_react.useState)(o);return(0,_jsxRuntime.jsxs)("div",{style:styles.collapsibleSection,children:[(0,_jsxRuntime.jsxs)("button",{type:"button",style:styles.collapsibleHeader,onClick:()=>l(!n),"aria-expanded":n,children:[(0,_jsxRuntime.jsxs)("span",{style:styles.collapsibleTitle,children:[e,(0,_jsxRuntime.jsx)("span",{style:styles.collapsibleTitleText,children:t}),i!==void 0?(0,_jsxRuntime.jsx)("span",{style:styles.collapsibleCount,children:i}):null]}),n?(0,_jsxRuntime.jsx)(ChevronUp,{size:16,color:macOSColors.text.secondary}):(0,_jsxRuntime.jsx)(ChevronDown,{size:16,color:macOSColors.text.secondary})]}),n?(0,_jsxRuntime.jsx)("div",{style:styles.collapsibleContent,children:s}):null]})};const UrlBreakdown=({url:t,operationName:e,graphqlVariables:s,requestClient:o})=>{const i=y=>{try{const a=new URL(y);const u=String(a.protocol||"");const f=String(a.host||"");const w=u==="https:";let d=String(a.pathname||"");if(o==="graphql"&&e){const h=(0,_formatGraphQLVariables.formatGraphQLDisplay)(e,s);d=`${d} (${h})`}else if(e){d=`${d} (${e})`}const x={};const c=a.searchParams;if(c&&typeof c.forEach==="function"){c.forEach((h,g)=>{x[g]=h})}return{protocol:u.replace(":",""),host:f,pathname:d,params:Object.keys(x).length>0?x:null,isSecure:w}}catch{return{protocol:"",host:t,pathname:"",params:null,isSecure:false}}};const n=(0,_react.useMemo)(()=>i(t),[t,o,e,s]);const[l,m]=(0,_react.useState)(false);return(0,_jsxRuntime.jsxs)("div",{style:styles.urlBreakdown,children:[(0,_jsxRuntime.jsxs)("div",{style:styles.urlRow,children:[n.isSecure?(0,_jsxRuntime.jsx)(Lock,{size:12,color:macOSColors.semantic.success}):(0,_jsxRuntime.jsx)(Unlock,{size:12,color:macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)("span",{style:styles.urlDomain,children:n.host}),(0,_jsxRuntime.jsxs)("span",{style:styles.urlProtocol,children:["(",n.protocol.toUpperCase(),")"]}),(0,_jsxRuntime.jsx)(_DataViewer.InlineCopyButton,{value:t,buttonStyle:styles.copyButton})]}),(0,_jsxRuntime.jsx)("div",{style:styles.urlPathRow,children:(0,_jsxRuntime.jsxs)("span",{style:styles.urlPath,children:[n.pathname,n.params?(0,_jsxRuntime.jsxs)("span",{style:styles.urlQueryString,children:["?",new URLSearchParams(n.params).toString()]}):null]})}),n.params?(0,_jsxRuntime.jsxs)("div",{style:styles.queryParamsCollapsible,children:[(0,_jsxRuntime.jsxs)("button",{type:"button",style:styles.queryParamsToggle,onClick:()=>m(!l),"aria-expanded":l,children:[(0,_jsxRuntime.jsx)("span",{style:styles.queryParamsToggleText,children:"Query Parameters"}),(0,_jsxRuntime.jsx)("span",{style:{...styles.collapsibleCount,flex:1,textAlign:"left"},children:Object.keys(n.params).length}),l?(0,_jsxRuntime.jsx)(ChevronUp,{size:14,color:macOSColors.text.secondary}):(0,_jsxRuntime.jsx)(ChevronDown,{size:14,color:macOSColors.text.secondary})]}),l?(0,_jsxRuntime.jsx)(_DataViewer.DataViewer,{title:"",data:n.params,showTypeFilter:true,rawMode:true,initialExpanded:true}):null]}):null]})};const NetworkEventDetailView=exports.NetworkEventDetailView=(0,_react.memo)(function t({event:e,ignoredPatterns:s=EMPTY_PATTERNS,onTogglePattern:o=noop,showBodies:i=true}){const n=e.status?formatHttpStatus(e.status):null;const l=!e.status&&!e.error;const m=(0,_networkBodyResolver.useNetworkBodyResolver)();const y=e.requestData===void 0&&(e.requestBodyOmitted===true||(e.requestSize??0)>0);const a=e.responseData===void 0&&(e.responseBodyOmitted===true||(e.responseSize??0)>0);const u=e.headersOmitted===true;const[f,w]=(0,_react.useState)(null);const[d,x]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{w(null);if(!m||!y&&!a&&!u){x(false);return}let r=false;x(true);m(e.id).then(p=>{if(!r)w(p)}).catch(()=>{}).finally(()=>{if(!r)x(false)});return()=>{r=true}},[e.id,m,y,a,u]);const c=e.requestData??f?.requestData??void 0;const h=e.responseData??f?.responseData??void 0;const g=(u?f?.requestHeaders:void 0)??e.requestHeaders;const S=(u?f?.responseHeaders:void 0)??e.responseHeaders;const z=()=>{const r={method:e.method,url:e.url,status:e.status,statusText:e.statusText,timestamp:new Date(e.timestamp).toISOString(),duration:e.duration?`${e.duration}ms`:"N/A",requestHeaders:g,requestData:c,responseHeaders:S,responseData:h,requestSize:e.requestSize?formatBytes(e.requestSize):"N/A",responseSize:e.responseSize?formatBytes(e.responseSize):"N/A",error:e.error,client:e.requestClient};return`# Network Request Details
693
2
 
694
3
  ## Request
695
- - **Method:** ${requestDetails.method}
696
- - **URL:** ${requestDetails.url}
697
- - **Client:** ${requestDetails.client || "N/A"}
698
- - **Timestamp:** ${requestDetails.timestamp}
4
+ - **Method:** ${r.method}
5
+ - **URL:** ${r.url}
6
+ - **Client:** ${r.client||"N/A"}
7
+ - **Timestamp:** ${r.timestamp}
699
8
 
700
9
  ## Response
701
- - **Status:** ${requestDetails.status || "Pending"}${requestDetails.statusText ? ` (${requestDetails.statusText})` : ""}
702
- - **Duration:** ${requestDetails.duration}
703
- - **Request Size:** ${requestDetails.requestSize}
704
- - **Response Size:** ${requestDetails.responseSize}
705
- ${requestDetails.error ? `- **Error:** ${requestDetails.error}` : ""}
10
+ - **Status:** ${r.status||"Pending"}${r.statusText?` (${r.statusText})`:""}
11
+ - **Duration:** ${r.duration}
12
+ - **Request Size:** ${r.requestSize}
13
+ - **Response Size:** ${r.responseSize}
14
+ ${r.error?`- **Error:** ${r.error}`:""}
706
15
 
707
16
  ## Request Headers
708
17
  \`\`\`json
709
- ${JSON.stringify(requestDetails.requestHeaders, null, 2)}
18
+ ${JSON.stringify(r.requestHeaders,null,2)}
710
19
  \`\`\`
711
20
 
712
21
  ## Request Data
713
22
  \`\`\`json
714
- ${JSON.stringify(requestDetails.requestData, null, 2)}
23
+ ${JSON.stringify(r.requestData,null,2)}
715
24
  \`\`\`
716
25
 
717
26
  ## Response Headers
718
27
  \`\`\`json
719
- ${JSON.stringify(requestDetails.responseHeaders, null, 2)}
28
+ ${JSON.stringify(r.responseHeaders,null,2)}
720
29
  \`\`\`
721
30
 
722
31
  ## Response Data
723
32
  \`\`\`json
724
- ${JSON.stringify(requestDetails.responseData, null, 2)}
33
+ ${JSON.stringify(r.responseData,null,2)}
725
34
  \`\`\`
726
- `;
727
- };
728
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
729
- style: styles.container,
730
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
731
- style: styles.requestDetailsSection,
732
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
733
- style: styles.httpHeader,
734
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
735
- style: styles.httpMethodBadge,
736
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
737
- style: styles.httpMethod,
738
- children: event.method
739
- })
740
- }), event.status ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
741
- style: {
742
- ...styles.httpStatusBadge,
743
- backgroundColor: `${status?.color}20`
744
- },
745
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
746
- style: {
747
- ...styles.httpStatusText,
748
- color: status?.color
749
- },
750
- children: [status?.text, " ", status?.meaning]
751
- })
752
- }) : isPending ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
753
- style: styles.pendingBadge,
754
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Clock, {
755
- size: 10,
756
- color: macOSColors.semantic.warning
757
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
758
- style: styles.pendingBadgeText,
759
- children: "Pending"
760
- })]
761
- }) : null, event.duration ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
762
- style: styles.httpDuration,
763
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Clock, {
764
- size: 10,
765
- color: macOSColors.text.muted
766
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
767
- style: styles.httpDurationText,
768
- children: formatDuration(event.duration)
769
- })]
770
- }) : null, event.override ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
771
- style: styles.overrideBadge,
772
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(FlaskConical, {
773
- size: 10,
774
- color: macOSColors.semantic.warning
775
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
776
- style: styles.overrideBadgeText,
777
- children: event.override.ruleName || "Overridden"
778
- })]
779
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_DataViewer.InlineCopyButton, {
780
- value: getFullRequestDetails,
781
- buttonStyle: styles.copyFullButton
782
- })]
783
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(UrlBreakdown, {
784
- url: event.url,
785
- requestData: requestData,
786
- operationName: event.operationName,
787
- graphqlVariables: event.graphqlVariables,
788
- requestClient: event.requestClient
789
- }), event.error ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
790
- style: styles.errorBox,
791
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(AlertCircle, {
792
- size: 12,
793
- color: macOSColors.semantic.error
794
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
795
- style: styles.errorText,
796
- children: event.error
797
- })]
798
- }) : null]
799
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
800
- style: styles.timingSection,
801
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
802
- style: styles.timingRow,
803
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Clock, {
804
- size: 12,
805
- color: macOSColors.text.secondary
806
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
807
- style: styles.timingLabel,
808
- children: "Started:"
809
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
810
- style: styles.timingValue,
811
- children: formatRelativeTime(event.timestamp)
812
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
813
- style: styles.timingExact,
814
- children: ["(", new Date(event.timestamp).toLocaleTimeString(), ")"]
815
- }), event.requestSize || event.responseSize ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
816
- style: styles.sizeRow,
817
- children: [event.requestSize !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
818
- style: styles.sizeItem,
819
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Upload, {
820
- size: 10,
821
- color: macOSColors.semantic.info
822
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
823
- style: styles.sizeLabel,
824
- children: "Sent:"
825
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
826
- style: styles.sizeValue,
827
- children: formatBytes(event.requestSize)
828
- })]
829
- }) : null, event.responseSize !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
830
- style: styles.sizeItem,
831
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Download, {
832
- size: 10,
833
- color: NEUTRAL_ICON
834
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
835
- style: styles.sizeLabel,
836
- children: "Received:"
837
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
838
- style: styles.sizeValue,
839
- children: formatBytes(event.responseSize)
840
- })]
841
- }) : null]
842
- }) : null]
843
- }), event.timings ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
844
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
845
- style: styles.phaseDivider
846
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(TimingPhases, {
847
- timings: event.timings,
848
- total: event.duration ?? event.timings.ttfb + event.timings.download
849
- })]
850
- }) : null]
851
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(CollapsibleSection, {
852
- title: "Request Headers",
853
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(Upload, {
854
- size: 14,
855
- color: macOSColors.semantic.info
856
- }),
857
- defaultOpen: false,
858
- count: Object.keys(requestHeaders).length,
859
- children: Object.keys(requestHeaders).length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
860
- style: styles.dataViewerContainer,
861
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DataViewer.DataViewer, {
862
- title: "",
863
- data: requestHeaders,
864
- showTypeFilter: true,
865
- rawMode: true,
866
- initialExpanded: true
867
- })
868
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
869
- style: styles.emptyText,
870
- children: "No request headers"
871
- })
872
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(CollapsibleSection, {
873
- title: "Response Headers",
874
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(Download, {
875
- size: 14,
876
- color: NEUTRAL_ICON
877
- }),
878
- defaultOpen: false,
879
- count: Object.keys(responseHeaders).length,
880
- children: Object.keys(responseHeaders).length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
881
- style: styles.dataViewerContainer,
882
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DataViewer.DataViewer, {
883
- title: "",
884
- data: responseHeaders,
885
- showTypeFilter: true,
886
- rawMode: true,
887
- initialExpanded: true
888
- })
889
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
890
- style: styles.emptyText,
891
- children: "No response headers yet"
892
- })
893
- }), requestData !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(CollapsibleSection, {
894
- title: "Request Body",
895
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(FileJson, {
896
- size: 14,
897
- color: macOSColors.semantic.info
898
- }),
899
- defaultOpen: false,
900
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
901
- style: styles.dataViewerContainer,
902
- children: showBodies ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_DataViewer.DataViewer, {
903
- title: "",
904
- data: requestData,
905
- showTypeFilter: true,
906
- rawMode: true,
907
- initialExpanded: true
908
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(BodyDeferred, {})
909
- })
910
- }) : requestBodyOmitted ? /*#__PURE__*/(0, _jsxRuntime.jsx)(CollapsibleSection, {
911
- title: "Request Body",
912
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(FileJson, {
913
- size: 14,
914
- color: macOSColors.semantic.info
915
- }),
916
- defaultOpen: true,
917
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
918
- style: styles.emptyText,
919
- children: isLoadingBody ? `Loading request body (${formatBytes(event.requestSize ?? 0)})…` : "Request body unavailable"
920
- })
921
- }) : null, responseData !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(CollapsibleSection, {
922
- title: "Response Body",
923
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(FileJson, {
924
- size: 14,
925
- color: NEUTRAL_ICON
926
- })
927
- // The body is what you opened the row FOR — expanded on arrival,
928
- // everything else closed (native).
929
- ,
930
- defaultOpen: true,
931
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
932
- style: styles.dataViewerContainer,
933
- children: showBodies ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_DataViewer.DataViewer, {
934
- title: "",
935
- data: responseData,
936
- showTypeFilter: true,
937
- rawMode: true,
938
- initialExpanded: true
939
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(BodyDeferred, {})
940
- })
941
- }) : responseBodyOmitted ? /*#__PURE__*/(0, _jsxRuntime.jsx)(CollapsibleSection, {
942
- title: "Response Body",
943
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(FileJson, {
944
- size: 14,
945
- color: NEUTRAL_ICON
946
- }),
947
- defaultOpen: true,
948
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
949
- style: styles.emptyText,
950
- children: isLoadingBody ? `Loading response body (${formatBytes(event.responseSize ?? 0)})…` : "Response body unavailable"
951
- })
952
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(CollapsibleSection, {
953
- title: "Filter Options",
954
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(Filter, {
955
- size: 14,
956
- color: macOSColors.semantic.warning
957
- }),
958
- defaultOpen: false,
959
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
960
- style: styles.filterOptionsContainer,
961
- children: (() => {
962
- let domain = "";
963
- let urlPath = "";
964
- try {
965
- const url = new URL(event.url);
966
- domain = url.hostname;
967
- urlPath = url.pathname;
968
- } catch {
969
- urlPath = event.url;
970
- }
971
- const isDomainIgnored = ignoredPatterns.has(domain);
972
- const isUrlIgnored = ignoredPatterns.has(urlPath);
973
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
974
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
975
- type: "button",
976
- style: {
977
- ...styles.filterOption,
978
- ...(isDomainIgnored ? styles.filterOptionActive : null)
979
- },
980
- onClick: () => domain && onTogglePattern(domain),
981
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
982
- style: styles.filterOptionLeft,
983
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Globe, {
984
- size: 16,
985
- color: isDomainIgnored ? macOSColors.semantic.warning : macOSColors.text.muted
986
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
987
- style: styles.filterOptionContent,
988
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
989
- style: styles.filterOptionLabel,
990
- children: "Ignore Domain"
991
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
992
- style: styles.filterOptionValue,
993
- children: domain || "N/A"
994
- })]
995
- })]
996
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
997
- style: {
998
- ...styles.filterToggle,
999
- ...(isDomainIgnored ? styles.filterToggleActive : null)
1000
- },
1001
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
1002
- style: {
1003
- ...styles.filterToggleText,
1004
- ...(isDomainIgnored ? styles.filterToggleTextActive : null)
1005
- },
1006
- children: isDomainIgnored ? "IGNORED" : "IGNORE"
1007
- })
1008
- })]
1009
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
1010
- type: "button",
1011
- style: {
1012
- ...styles.filterOption,
1013
- ...(isUrlIgnored ? styles.filterOptionActive : null)
1014
- },
1015
- onClick: () => urlPath && onTogglePattern(urlPath),
1016
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
1017
- style: styles.filterOptionLeft,
1018
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Link, {
1019
- size: 16,
1020
- color: isUrlIgnored ? macOSColors.semantic.warning : macOSColors.text.muted
1021
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
1022
- style: styles.filterOptionContent,
1023
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
1024
- style: styles.filterOptionLabel,
1025
- children: "Ignore URL Pattern"
1026
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
1027
- style: {
1028
- ...styles.filterOptionValue,
1029
- ...styles.singleLine
1030
- },
1031
- children: urlPath || "N/A"
1032
- })]
1033
- })]
1034
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
1035
- style: {
1036
- ...styles.filterToggle,
1037
- ...(isUrlIgnored ? styles.filterToggleActive : null)
1038
- },
1039
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
1040
- style: {
1041
- ...styles.filterToggleText,
1042
- ...(isUrlIgnored ? styles.filterToggleTextActive : null)
1043
- },
1044
- children: isUrlIgnored ? "IGNORED" : "IGNORE"
1045
- })
1046
- })]
1047
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1048
- style: styles.filterInfoBox,
1049
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
1050
- style: styles.filterInfoText,
1051
- children: "Ignored requests will be hidden from the network list. You can manage filters in the Filters tab."
1052
- })
1053
- })]
1054
- });
1055
- })()
1056
- })
1057
- })]
1058
- });
1059
- });
1060
-
1061
- // Values mirror the native StyleSheet block 1:1.
1062
- const styles = {
1063
- // Native: ScrollView flex 1 on background.base — the detail body OWNS its
1064
- // scrolling so the stepper footer stays pinned under it.
1065
- container: {
1066
- flex: 1,
1067
- minHeight: 0,
1068
- overflowY: "auto",
1069
- backgroundColor: macOSColors.background.base
1070
- },
1071
- requestDetailsSection: {
1072
- margin: "12px 12px 0",
1073
- backgroundColor: macOSColors.background.card,
1074
- borderRadius: 8,
1075
- border: `1px solid ${macOSColors.border.default}`,
1076
- padding: 12
1077
- },
1078
- httpHeader: {
1079
- display: "flex",
1080
- flexDirection: "row",
1081
- alignItems: "center",
1082
- gap: 8,
1083
- marginBottom: 12,
1084
- flexWrap: "nowrap"
1085
- },
1086
- httpMethodBadge: {
1087
- display: "inline-flex",
1088
- backgroundColor: macOSColors.semantic.infoBackground,
1089
- padding: "4px 8px",
1090
- borderRadius: 4
1091
- },
1092
- httpMethod: {
1093
- color: macOSColors.semantic.info,
1094
- fontSize: 11,
1095
- fontWeight: 700,
1096
- letterSpacing: 0.5
1097
- },
1098
- httpStatusBadge: {
1099
- display: "inline-flex",
1100
- padding: "4px 8px",
1101
- borderRadius: 4,
1102
- whiteSpace: "nowrap"
1103
- },
1104
- httpStatusText: {
1105
- fontSize: 11,
1106
- fontWeight: 600
1107
- },
1108
- pendingBadge: {
1109
- display: "inline-flex",
1110
- flexDirection: "row",
1111
- alignItems: "center",
1112
- gap: 4,
1113
- backgroundColor: macOSColors.semantic.warningBackground,
1114
- padding: "4px 8px",
1115
- borderRadius: 4
1116
- },
1117
- pendingBadgeText: {
1118
- color: macOSColors.semantic.warning,
1119
- fontSize: 11,
1120
- fontWeight: 600
1121
- },
1122
- httpDuration: {
1123
- display: "inline-flex",
1124
- flexDirection: "row",
1125
- alignItems: "center",
1126
- gap: 4
1127
- },
1128
- httpDurationText: {
1129
- color: macOSColors.text.secondary,
1130
- fontSize: 11
1131
- },
1132
- overrideBadge: {
1133
- display: "inline-flex",
1134
- flexDirection: "row",
1135
- alignItems: "center",
1136
- gap: 4,
1137
- padding: "3px 6px",
1138
- borderRadius: 4,
1139
- backgroundColor: macOSColors.semantic.warningBackground
1140
- },
1141
- overrideBadgeText: {
1142
- color: macOSColors.semantic.warning,
1143
- fontSize: 10,
1144
- fontWeight: 700
1145
- },
1146
- copyFullButton: {
1147
- marginLeft: "auto",
1148
- flexShrink: 0,
1149
- padding: 4
1150
- },
1151
- // URL breakdown styles
1152
- urlBreakdown: {
1153
- backgroundColor: macOSColors.background.input,
1154
- borderRadius: 4,
1155
- padding: 8
1156
- },
1157
- urlRow: {
1158
- display: "flex",
1159
- flexDirection: "row",
1160
- alignItems: "center",
1161
- gap: 6,
1162
- marginBottom: 4
1163
- },
1164
- urlDomain: {
1165
- color: macOSColors.text.primary,
1166
- fontSize: 12,
1167
- fontWeight: 600,
1168
- flex: 1,
1169
- minWidth: 0,
1170
- overflowWrap: "anywhere"
1171
- },
1172
- urlProtocol: {
1173
- color: macOSColors.text.muted,
1174
- fontSize: 10
1175
- },
1176
- copyButton: {
1177
- padding: 4
1178
- },
1179
- urlPathRow: {
1180
- paddingLeft: 18
1181
- },
1182
- urlPath: {
1183
- color: macOSColors.text.secondary,
1184
- fontSize: 11,
1185
- fontFamily: "ui-monospace, Menlo, monospace",
1186
- // Native numberOfLines={2}
1187
- display: "-webkit-box",
1188
- WebkitLineClamp: 2,
1189
- WebkitBoxOrient: "vertical",
1190
- overflow: "hidden",
1191
- overflowWrap: "anywhere"
1192
- },
1193
- urlQueryString: {
1194
- color: macOSColors.semantic.info,
1195
- fontSize: 11,
1196
- fontFamily: "ui-monospace, Menlo, monospace"
1197
- },
1198
- // Query Parameters - Collapsible section
1199
- queryParamsCollapsible: {
1200
- marginTop: 8
1201
- },
1202
- queryParamsToggle: {
1203
- display: "flex",
1204
- width: "100%",
1205
- boxSizing: "border-box",
1206
- flexDirection: "row",
1207
- alignItems: "center",
1208
- justifyContent: "space-between",
1209
- gap: 8,
1210
- padding: "10px 12px",
1211
- backgroundColor: macOSColors.background.hover,
1212
- borderRadius: 8,
1213
- border: `1px solid ${macOSColors.border.default}`,
1214
- marginBottom: 8,
1215
- cursor: "pointer",
1216
- margin: "0 0 8px",
1217
- font: "inherit"
1218
- },
1219
- queryParamsToggleText: {
1220
- flexGrow: 0,
1221
- color: macOSColors.text.primary,
1222
- fontSize: 12,
1223
- fontWeight: 600,
1224
- letterSpacing: 0.3,
1225
- whiteSpace: "nowrap"
1226
- },
1227
- // Timing section - always visible
1228
- timingSection: {
1229
- margin: "8px 12px 0",
1230
- backgroundColor: macOSColors.background.card,
1231
- borderRadius: 8,
1232
- border: `1px solid ${macOSColors.border.default}`,
1233
- padding: 12
1234
- },
1235
- timingRow: {
1236
- display: "flex",
1237
- flexDirection: "row",
1238
- alignItems: "center",
1239
- gap: 6,
1240
- // Wraps rather than squashing when the card is narrow — the sizes drop to
1241
- // their own line there (native).
1242
- flexWrap: "wrap"
1243
- },
1244
- timingLabel: {
1245
- color: macOSColors.text.secondary,
1246
- fontSize: 11
1247
- },
1248
- timingValue: {
1249
- color: macOSColors.text.primary,
1250
- fontSize: 11,
1251
- fontWeight: 600
1252
- },
1253
- timingExact: {
1254
- color: macOSColors.text.muted,
1255
- fontSize: 10,
1256
- marginLeft: 4
1257
- },
1258
- sizeRow: {
1259
- display: "inline-flex",
1260
- flexDirection: "row",
1261
- alignItems: "center",
1262
- gap: 16,
1263
- // Pushed to the far end of the Started row (native).
1264
- marginLeft: "auto"
1265
- },
1266
- sizeItem: {
1267
- display: "inline-flex",
1268
- flexDirection: "row",
1269
- alignItems: "center",
1270
- gap: 4
1271
- },
1272
- sizeLabel: {
1273
- color: macOSColors.text.muted,
1274
- fontSize: 10
1275
- },
1276
- sizeValue: {
1277
- color: macOSColors.semantic.info,
1278
- fontSize: 10,
1279
- fontFamily: "ui-monospace, Menlo, monospace",
1280
- fontWeight: 600
1281
- },
1282
- /* ---- Timing phases ---- */
1283
- phaseDivider: {
1284
- height: 1,
1285
- backgroundColor: macOSColors.border.default,
1286
- marginTop: 12,
1287
- marginBottom: 12
1288
- },
1289
- phaseList: {
1290
- display: "flex",
1291
- flexDirection: "column",
1292
- gap: 8
1293
- },
1294
- phaseRow: {
1295
- display: "flex",
1296
- flexDirection: "row",
1297
- alignItems: "center",
1298
- gap: 14
1299
- },
1300
- phaseLabelGroup: {
1301
- width: 150,
1302
- flexShrink: 0
1303
- },
1304
- phaseLabel: {
1305
- fontSize: 12,
1306
- color: macOSColors.text.secondary
1307
- },
1308
- phaseHint: {
1309
- fontSize: 10,
1310
- color: macOSColors.text.muted
1311
- },
1312
- phaseTrack: {
1313
- flex: 1,
1314
- minWidth: 0,
1315
- height: 7,
1316
- borderRadius: 4,
1317
- backgroundColor: macOSColors.background.hover,
1318
- display: "flex",
1319
- justifyContent: "center",
1320
- flexDirection: "column",
1321
- overflow: "hidden"
1322
- },
1323
- phaseBar: {
1324
- height: 7,
1325
- borderRadius: 4
1326
- },
1327
- phaseValue: {
1328
- width: 72,
1329
- flexShrink: 0,
1330
- textAlign: "right",
1331
- fontSize: 12,
1332
- fontFamily: "ui-monospace, Menlo, monospace",
1333
- color: macOSColors.text.primary
1334
- },
1335
- // Collapsible section styles
1336
- collapsibleSection: {
1337
- margin: "8px 12px 0",
1338
- backgroundColor: macOSColors.background.card,
1339
- borderRadius: 8,
1340
- border: `1px solid ${macOSColors.border.default}`,
1341
- overflow: "hidden"
1342
- },
1343
- collapsibleHeader: {
1344
- display: "flex",
1345
- width: "100%",
1346
- boxSizing: "border-box",
1347
- flexDirection: "row",
1348
- alignItems: "center",
1349
- justifyContent: "space-between",
1350
- padding: 12,
1351
- // Near-white strip, not the selection grey (native rationale).
1352
- backgroundColor: macOSColors.background.hover,
1353
- border: "none",
1354
- cursor: "pointer",
1355
- margin: 0,
1356
- font: "inherit",
1357
- textAlign: "left"
1358
- },
1359
- collapsibleTitle: {
1360
- display: "inline-flex",
1361
- flexDirection: "row",
1362
- alignItems: "center",
1363
- gap: 8
1364
- },
1365
- collapsibleTitleText: {
1366
- color: macOSColors.text.primary,
1367
- fontSize: 13,
1368
- fontWeight: 600
1369
- },
1370
- /** The "how much is in here" number beside a section title. */
1371
- collapsibleCount: {
1372
- color: macOSColors.text.muted,
1373
- fontSize: 11.5,
1374
- fontFamily: "ui-monospace, Menlo, monospace"
1375
- },
1376
- collapsibleContent: {
1377
- padding: 12
1378
- },
1379
- // Data viewer container — pulls the tree flush against the section edges.
1380
- dataViewerContainer: {
1381
- margin: -12
1382
- },
1383
- /** Placeholder for a not-yet-mounted body tree. See BodyDeferred. */
1384
- bodyDeferred: {
1385
- height: 120
1386
- },
1387
- // Error box
1388
- errorBox: {
1389
- display: "flex",
1390
- flexDirection: "row",
1391
- alignItems: "center",
1392
- gap: 6,
1393
- backgroundColor: macOSColors.semantic.errorBackground,
1394
- padding: 8,
1395
- borderRadius: 4,
1396
- marginTop: 8
1397
- },
1398
- errorText: {
1399
- color: macOSColors.semantic.error,
1400
- fontSize: 11,
1401
- flex: 1,
1402
- minWidth: 0,
1403
- overflowWrap: "anywhere"
1404
- },
1405
- // Empty state
1406
- emptyText: {
1407
- color: macOSColors.text.muted,
1408
- fontSize: 12,
1409
- fontStyle: "italic",
1410
- textAlign: "center"
1411
- },
1412
- // Filter options styles
1413
- filterOptionsContainer: {
1414
- display: "flex",
1415
- flexDirection: "column",
1416
- gap: 12
1417
- },
1418
- filterOption: {
1419
- display: "flex",
1420
- width: "100%",
1421
- boxSizing: "border-box",
1422
- flexDirection: "row",
1423
- alignItems: "center",
1424
- justifyContent: "space-between",
1425
- backgroundColor: macOSColors.background.hover,
1426
- borderRadius: 8,
1427
- padding: 12,
1428
- border: `1px solid ${macOSColors.border.default}`,
1429
- cursor: "pointer",
1430
- margin: 0,
1431
- font: "inherit",
1432
- textAlign: "left"
1433
- },
1434
- filterOptionActive: {
1435
- backgroundColor: macOSColors.semantic.warningBackground,
1436
- border: `1px solid ${macOSColors.semantic.warning}33`
1437
- },
1438
- filterOptionLeft: {
1439
- display: "inline-flex",
1440
- flexDirection: "row",
1441
- alignItems: "center",
1442
- gap: 12,
1443
- flex: 1,
1444
- minWidth: 0
1445
- },
1446
- filterOptionContent: {
1447
- display: "inline-flex",
1448
- flexDirection: "column",
1449
- flex: 1,
1450
- minWidth: 0
1451
- },
1452
- filterOptionLabel: {
1453
- color: macOSColors.text.secondary,
1454
- fontSize: 11,
1455
- marginBottom: 2,
1456
- textTransform: "uppercase",
1457
- letterSpacing: 0.5
1458
- },
1459
- filterOptionValue: {
1460
- color: macOSColors.text.primary,
1461
- fontSize: 13,
1462
- fontFamily: "ui-monospace, Menlo, monospace",
1463
- overflowWrap: "anywhere"
1464
- },
1465
- /** Native numberOfLines={1}. */
1466
- singleLine: {
1467
- whiteSpace: "nowrap",
1468
- overflow: "hidden",
1469
- textOverflow: "ellipsis",
1470
- display: "block"
1471
- },
1472
- filterToggle: {
1473
- display: "inline-flex",
1474
- padding: "6px 10px",
1475
- borderRadius: 4,
1476
- backgroundColor: macOSColors.background.input,
1477
- border: `1px solid ${macOSColors.border.default}`,
1478
- flexShrink: 0
1479
- },
1480
- filterToggleActive: {
1481
- backgroundColor: `${macOSColors.semantic.warning}26`,
1482
- border: `1px solid ${macOSColors.semantic.warning}4D`
1483
- },
1484
- filterToggleText: {
1485
- fontSize: 10,
1486
- fontWeight: 600,
1487
- color: macOSColors.text.muted,
1488
- letterSpacing: 0.5
1489
- },
1490
- filterToggleTextActive: {
1491
- color: macOSColors.semantic.warning
1492
- },
1493
- filterInfoBox: {
1494
- backgroundColor: macOSColors.semantic.infoBackground,
1495
- borderRadius: 6,
1496
- padding: 10,
1497
- border: `1px solid ${macOSColors.semantic.info}33`
1498
- },
1499
- filterInfoText: {
1500
- color: macOSColors.text.secondary,
1501
- fontSize: 11,
1502
- lineHeight: "16px"
1503
- }
1504
- };
35
+ `};return(0,_jsxRuntime.jsxs)("div",{style:styles.container,children:[(0,_jsxRuntime.jsxs)("div",{style:styles.requestDetailsSection,children:[(0,_jsxRuntime.jsxs)("div",{style:styles.httpHeader,children:[(0,_jsxRuntime.jsx)("span",{style:styles.httpMethodBadge,children:(0,_jsxRuntime.jsx)("span",{style:styles.httpMethod,children:e.method})}),e.status?(0,_jsxRuntime.jsx)("span",{style:{...styles.httpStatusBadge,backgroundColor:`${n?.color}20`},children:(0,_jsxRuntime.jsxs)("span",{style:{...styles.httpStatusText,color:n?.color},children:[n?.text," ",n?.meaning]})}):l?(0,_jsxRuntime.jsxs)("span",{style:styles.pendingBadge,children:[(0,_jsxRuntime.jsx)(Clock,{size:10,color:macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)("span",{style:styles.pendingBadgeText,children:"Pending"})]}):null,e.duration?(0,_jsxRuntime.jsxs)("span",{style:styles.httpDuration,children:[(0,_jsxRuntime.jsx)(Clock,{size:10,color:macOSColors.text.muted}),(0,_jsxRuntime.jsx)("span",{style:styles.httpDurationText,children:formatDuration(e.duration)})]}):null,e.override?(0,_jsxRuntime.jsxs)("span",{style:styles.overrideBadge,children:[(0,_jsxRuntime.jsx)(FlaskConical,{size:10,color:macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)("span",{style:styles.overrideBadgeText,children:e.override.ruleName||"Overridden"})]}):null,(0,_jsxRuntime.jsx)(_DataViewer.InlineCopyButton,{value:z,buttonStyle:styles.copyFullButton})]}),(0,_jsxRuntime.jsx)(UrlBreakdown,{url:e.url,requestData:c,operationName:e.operationName,graphqlVariables:e.graphqlVariables,requestClient:e.requestClient}),e.error?(0,_jsxRuntime.jsxs)("div",{style:styles.errorBox,children:[(0,_jsxRuntime.jsx)(AlertCircle,{size:12,color:macOSColors.semantic.error}),(0,_jsxRuntime.jsx)("span",{style:styles.errorText,children:e.error})]}):null]}),(0,_jsxRuntime.jsxs)("div",{style:styles.timingSection,children:[(0,_jsxRuntime.jsxs)("div",{style:styles.timingRow,children:[(0,_jsxRuntime.jsx)(Clock,{size:12,color:macOSColors.text.secondary}),(0,_jsxRuntime.jsx)("span",{style:styles.timingLabel,children:"Started:"}),(0,_jsxRuntime.jsx)("span",{style:styles.timingValue,children:formatRelativeTime(e.timestamp)}),(0,_jsxRuntime.jsxs)("span",{style:styles.timingExact,children:["(",new Date(e.timestamp).toLocaleTimeString(),")"]}),e.requestSize||e.responseSize?(0,_jsxRuntime.jsxs)("span",{style:styles.sizeRow,children:[e.requestSize!==void 0?(0,_jsxRuntime.jsxs)("span",{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(Upload,{size:10,color:macOSColors.semantic.info}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeLabel,children:"Sent:"}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeValue,children:formatBytes(e.requestSize)})]}):null,e.responseSize!==void 0?(0,_jsxRuntime.jsxs)("span",{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(Download,{size:10,color:NEUTRAL_ICON}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeLabel,children:"Received:"}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeValue,children:formatBytes(e.responseSize)})]}):null]}):null]}),e.timings?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)("div",{style:styles.phaseDivider}),(0,_jsxRuntime.jsx)(TimingPhases,{timings:e.timings,total:e.duration??e.timings.ttfb+e.timings.download})]}):null]}),(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Headers",icon:(0,_jsxRuntime.jsx)(Upload,{size:14,color:macOSColors.semantic.info}),defaultOpen:false,count:Object.keys(g).length,children:Object.keys(g).length>0?(0,_jsxRuntime.jsx)("div",{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_DataViewer.DataViewer,{title:"",data:g,showTypeFilter:true,rawMode:true,initialExpanded:true})}):(0,_jsxRuntime.jsx)("div",{style:styles.emptyText,children:"No request headers"})}),(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Headers",icon:(0,_jsxRuntime.jsx)(Download,{size:14,color:NEUTRAL_ICON}),defaultOpen:false,count:Object.keys(S).length,children:Object.keys(S).length>0?(0,_jsxRuntime.jsx)("div",{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_DataViewer.DataViewer,{title:"",data:S,showTypeFilter:true,rawMode:true,initialExpanded:true})}):(0,_jsxRuntime.jsx)("div",{style:styles.emptyText,children:"No response headers yet"})}),c!==void 0?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Body",icon:(0,_jsxRuntime.jsx)(FileJson,{size:14,color:macOSColors.semantic.info}),defaultOpen:false,children:(0,_jsxRuntime.jsx)("div",{style:styles.dataViewerContainer,children:i?(0,_jsxRuntime.jsx)(_DataViewer.DataViewer,{title:"",data:c,showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsx)(BodyDeferred,{})})}):y?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Request Body",icon:(0,_jsxRuntime.jsx)(FileJson,{size:14,color:macOSColors.semantic.info}),defaultOpen:true,children:(0,_jsxRuntime.jsx)("div",{style:styles.emptyText,children:d?`Loading request body (${formatBytes(e.requestSize??0)})\u2026`:"Request body unavailable"})}):null,h!==void 0?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Body",icon:(0,_jsxRuntime.jsx)(FileJson,{size:14,color:NEUTRAL_ICON}),defaultOpen:true,children:(0,_jsxRuntime.jsx)("div",{style:styles.dataViewerContainer,children:i?(0,_jsxRuntime.jsx)(_DataViewer.DataViewer,{title:"",data:h,showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsx)(BodyDeferred,{})})}):a?(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Response Body",icon:(0,_jsxRuntime.jsx)(FileJson,{size:14,color:NEUTRAL_ICON}),defaultOpen:true,children:(0,_jsxRuntime.jsx)("div",{style:styles.emptyText,children:d?`Loading response body (${formatBytes(e.responseSize??0)})\u2026`:"Response body unavailable"})}):null,(0,_jsxRuntime.jsx)(CollapsibleSection,{title:"Filter Options",icon:(0,_jsxRuntime.jsx)(Filter,{size:14,color:macOSColors.semantic.warning}),defaultOpen:false,children:(0,_jsxRuntime.jsx)("div",{style:styles.filterOptionsContainer,children:(()=>{let r="";let p="";try{const k=new URL(e.url);r=k.hostname;p=k.pathname}catch{p=e.url}const j=s.has(r);const b=s.has(p);return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)("button",{type:"button",style:{...styles.filterOption,...j?styles.filterOptionActive:null},onClick:()=>r&&o(r),children:[(0,_jsxRuntime.jsxs)("span",{style:styles.filterOptionLeft,children:[(0,_jsxRuntime.jsx)(Globe,{size:16,color:j?macOSColors.semantic.warning:macOSColors.text.muted}),(0,_jsxRuntime.jsxs)("span",{style:styles.filterOptionContent,children:[(0,_jsxRuntime.jsx)("span",{style:styles.filterOptionLabel,children:"Ignore Domain"}),(0,_jsxRuntime.jsx)("span",{style:styles.filterOptionValue,children:r||"N/A"})]})]}),(0,_jsxRuntime.jsx)("span",{style:{...styles.filterToggle,...j?styles.filterToggleActive:null},children:(0,_jsxRuntime.jsx)("span",{style:{...styles.filterToggleText,...j?styles.filterToggleTextActive:null},children:j?"IGNORED":"IGNORE"})})]}),(0,_jsxRuntime.jsxs)("button",{type:"button",style:{...styles.filterOption,...b?styles.filterOptionActive:null},onClick:()=>p&&o(p),children:[(0,_jsxRuntime.jsxs)("span",{style:styles.filterOptionLeft,children:[(0,_jsxRuntime.jsx)(Link,{size:16,color:b?macOSColors.semantic.warning:macOSColors.text.muted}),(0,_jsxRuntime.jsxs)("span",{style:styles.filterOptionContent,children:[(0,_jsxRuntime.jsx)("span",{style:styles.filterOptionLabel,children:"Ignore URL Pattern"}),(0,_jsxRuntime.jsx)("span",{style:{...styles.filterOptionValue,...styles.singleLine},children:p||"N/A"})]})]}),(0,_jsxRuntime.jsx)("span",{style:{...styles.filterToggle,...b?styles.filterToggleActive:null},children:(0,_jsxRuntime.jsx)("span",{style:{...styles.filterToggleText,...b?styles.filterToggleTextActive:null},children:b?"IGNORED":"IGNORE"})})]}),(0,_jsxRuntime.jsx)("div",{style:styles.filterInfoBox,children:(0,_jsxRuntime.jsx)("span",{style:styles.filterInfoText,children:"Ignored requests will be hidden from the network list. You can manage filters in the Filters tab."})})]})})()})})]})});const styles={container:{flex:1,minHeight:0,overflowY:"auto",backgroundColor:macOSColors.background.base},requestDetailsSection:{margin:"12px 12px 0",backgroundColor:macOSColors.background.card,borderRadius:8,border:`1px solid ${macOSColors.border.default}`,padding:12},httpHeader:{display:"flex",flexDirection:"row",alignItems:"center",gap:8,marginBottom:12,flexWrap:"nowrap"},httpMethodBadge:{display:"inline-flex",backgroundColor:macOSColors.semantic.infoBackground,padding:"4px 8px",borderRadius:4},httpMethod:{color:macOSColors.semantic.info,fontSize:11,fontWeight:700,letterSpacing:.5},httpStatusBadge:{display:"inline-flex",padding:"4px 8px",borderRadius:4,whiteSpace:"nowrap"},httpStatusText:{fontSize:11,fontWeight:600},pendingBadge:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:4,backgroundColor:macOSColors.semantic.warningBackground,padding:"4px 8px",borderRadius:4},pendingBadgeText:{color:macOSColors.semantic.warning,fontSize:11,fontWeight:600},httpDuration:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:4},httpDurationText:{color:macOSColors.text.secondary,fontSize:11},overrideBadge:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:4,padding:"3px 6px",borderRadius:4,backgroundColor:macOSColors.semantic.warningBackground},overrideBadgeText:{color:macOSColors.semantic.warning,fontSize:10,fontWeight:700},copyFullButton:{marginLeft:"auto",flexShrink:0,padding:4},urlBreakdown:{backgroundColor:macOSColors.background.input,borderRadius:4,padding:8},urlRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},urlDomain:{color:macOSColors.text.primary,fontSize:12,fontWeight:600,flex:1,minWidth:0,overflowWrap:"anywhere"},urlProtocol:{color:macOSColors.text.muted,fontSize:10},copyButton:{padding:4},urlPathRow:{paddingLeft:18},urlPath:{color:macOSColors.text.secondary,fontSize:11,fontFamily:"ui-monospace, Menlo, monospace",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",overflowWrap:"anywhere"},urlQueryString:{color:macOSColors.semantic.info,fontSize:11,fontFamily:"ui-monospace, Menlo, monospace"},queryParamsCollapsible:{marginTop:8},queryParamsToggle:{display:"flex",width:"100%",boxSizing:"border-box",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8,padding:"10px 12px",backgroundColor:macOSColors.background.hover,borderRadius:8,border:`1px solid ${macOSColors.border.default}`,marginBottom:8,cursor:"pointer",margin:"0 0 8px",font:"inherit"},queryParamsToggleText:{flexGrow:0,color:macOSColors.text.primary,fontSize:12,fontWeight:600,letterSpacing:.3,whiteSpace:"nowrap"},timingSection:{margin:"8px 12px 0",backgroundColor:macOSColors.background.card,borderRadius:8,border:`1px solid ${macOSColors.border.default}`,padding:12},timingRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap"},timingLabel:{color:macOSColors.text.secondary,fontSize:11},timingValue:{color:macOSColors.text.primary,fontSize:11,fontWeight:600},timingExact:{color:macOSColors.text.muted,fontSize:10,marginLeft:4},sizeRow:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:16,marginLeft:"auto"},sizeItem:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:4},sizeLabel:{color:macOSColors.text.muted,fontSize:10},sizeValue:{color:macOSColors.semantic.info,fontSize:10,fontFamily:"ui-monospace, Menlo, monospace",fontWeight:600},phaseDivider:{height:1,backgroundColor:macOSColors.border.default,marginTop:12,marginBottom:12},phaseList:{display:"flex",flexDirection:"column",gap:8},phaseRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:14},phaseLabelGroup:{width:150,flexShrink:0},phaseLabel:{fontSize:12,color:macOSColors.text.secondary},phaseHint:{fontSize:10,color:macOSColors.text.muted},phaseTrack:{flex:1,minWidth:0,height:7,borderRadius:4,backgroundColor:macOSColors.background.hover,display:"flex",justifyContent:"center",flexDirection:"column",overflow:"hidden"},phaseBar:{height:7,borderRadius:4},phaseValue:{width:72,flexShrink:0,textAlign:"right",fontSize:12,fontFamily:"ui-monospace, Menlo, monospace",color:macOSColors.text.primary},collapsibleSection:{margin:"8px 12px 0",backgroundColor:macOSColors.background.card,borderRadius:8,border:`1px solid ${macOSColors.border.default}`,overflow:"hidden"},collapsibleHeader:{display:"flex",width:"100%",boxSizing:"border-box",flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,backgroundColor:macOSColors.background.hover,border:"none",cursor:"pointer",margin:0,font:"inherit",textAlign:"left"},collapsibleTitle:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:8},collapsibleTitleText:{color:macOSColors.text.primary,fontSize:13,fontWeight:600},collapsibleCount:{color:macOSColors.text.muted,fontSize:11.5,fontFamily:"ui-monospace, Menlo, monospace"},collapsibleContent:{padding:12},dataViewerContainer:{margin:-12},bodyDeferred:{height:120},errorBox:{display:"flex",flexDirection:"row",alignItems:"center",gap:6,backgroundColor:macOSColors.semantic.errorBackground,padding:8,borderRadius:4,marginTop:8},errorText:{color:macOSColors.semantic.error,fontSize:11,flex:1,minWidth:0,overflowWrap:"anywhere"},emptyText:{color:macOSColors.text.muted,fontSize:12,fontStyle:"italic",textAlign:"center"},filterOptionsContainer:{display:"flex",flexDirection:"column",gap:12},filterOption:{display:"flex",width:"100%",boxSizing:"border-box",flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:macOSColors.background.hover,borderRadius:8,padding:12,border:`1px solid ${macOSColors.border.default}`,cursor:"pointer",margin:0,font:"inherit",textAlign:"left"},filterOptionActive:{backgroundColor:macOSColors.semantic.warningBackground,border:`1px solid ${macOSColors.semantic.warning}33`},filterOptionLeft:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:12,flex:1,minWidth:0},filterOptionContent:{display:"inline-flex",flexDirection:"column",flex:1,minWidth:0},filterOptionLabel:{color:macOSColors.text.secondary,fontSize:11,marginBottom:2,textTransform:"uppercase",letterSpacing:.5},filterOptionValue:{color:macOSColors.text.primary,fontSize:13,fontFamily:"ui-monospace, Menlo, monospace",overflowWrap:"anywhere"},singleLine:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"},filterToggle:{display:"inline-flex",padding:"6px 10px",borderRadius:4,backgroundColor:macOSColors.background.input,border:`1px solid ${macOSColors.border.default}`,flexShrink:0},filterToggleActive:{backgroundColor:`${macOSColors.semantic.warning}26`,border:`1px solid ${macOSColors.semantic.warning}4D`},filterToggleText:{fontSize:10,fontWeight:600,color:macOSColors.text.muted,letterSpacing:.5},filterToggleTextActive:{color:macOSColors.semantic.warning},filterInfoBox:{backgroundColor:macOSColors.semantic.infoBackground,borderRadius:6,padding:10,border:`1px solid ${macOSColors.semantic.info}33`},filterInfoText:{color:macOSColors.text.secondary,fontSize:11,lineHeight:"16px"}};