@buoy-gg/network 7.0.41 → 7.0.43

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