@buoy-gg/network 7.0.40 → 7.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/README.md +11 -79
  2. package/lib/commonjs/index.js +1 -325
  3. package/lib/commonjs/index.web.js +1 -420
  4. package/lib/commonjs/network/components/DataViewer.web.js +1 -879
  5. package/lib/commonjs/network/components/NetworkCopyScreen.web.js +1 -48
  6. package/lib/commonjs/network/components/NetworkCopySettingsView.js +27 -755
  7. package/lib/commonjs/network/components/NetworkCopySettingsView.web.js +14 -1242
  8. package/lib/commonjs/network/components/NetworkDetailScreen.web.js +1 -101
  9. package/lib/commonjs/network/components/NetworkDetailStepper.js +1 -108
  10. package/lib/commonjs/network/components/NetworkDetailStepper.web.js +1 -298
  11. package/lib/commonjs/network/components/NetworkEventDetailView.js +15 -1130
  12. package/lib/commonjs/network/components/NetworkEventDetailView.web.js +15 -1484
  13. package/lib/commonjs/network/components/NetworkEventItemCompact.js +2 -401
  14. package/lib/commonjs/network/components/NetworkEventItemCompact.web.js +2 -820
  15. package/lib/commonjs/network/components/NetworkFilterScreen.web.js +1 -55
  16. package/lib/commonjs/network/components/NetworkFilterViewV3.js +1 -442
  17. package/lib/commonjs/network/components/NetworkFilterViewV3.web.js +1 -1310
  18. package/lib/commonjs/network/components/NetworkHeaderLive.js +1 -375
  19. package/lib/commonjs/network/components/NetworkHeaderLive.web.js +1 -623
  20. package/lib/commonjs/network/components/NetworkHeaderMenu.js +1 -190
  21. package/lib/commonjs/network/components/NetworkListScreen.js +1 -404
  22. package/lib/commonjs/network/components/NetworkListScreen.web.js +1 -625
  23. package/lib/commonjs/network/components/NetworkModal.js +1 -786
  24. package/lib/commonjs/network/components/NetworkNumberPrompt.js +1 -178
  25. package/lib/commonjs/network/components/NetworkNumberPrompt.web.js +1 -232
  26. package/lib/commonjs/network/components/NetworkOverrideEditor.js +1 -814
  27. package/lib/commonjs/network/components/NetworkOverrideEditor.web.js +1 -942
  28. package/lib/commonjs/network/components/NetworkOverrideHeaderButton.js +1 -107
  29. package/lib/commonjs/network/components/NetworkOverrideHeaderButton.web.js +1 -133
  30. package/lib/commonjs/network/components/NetworkOverridesButton.js +1 -90
  31. package/lib/commonjs/network/components/NetworkOverridesButton.web.js +1 -143
  32. package/lib/commonjs/network/components/NetworkOverridesScreen.js +1 -543
  33. package/lib/commonjs/network/components/NetworkOverridesScreen.web.js +1 -830
  34. package/lib/commonjs/network/components/NetworkSavedScreen.js +1 -226
  35. package/lib/commonjs/network/components/NetworkSavedScreen.web.js +1 -463
  36. package/lib/commonjs/network/components/NetworkUpgradeBanner.js +1 -76
  37. package/lib/commonjs/network/components/response-editor/Explorer.js +1 -973
  38. package/lib/commonjs/network/components/response-editor/Explorer.web.js +1 -1136
  39. package/lib/commonjs/network/components/response-editor/deleteNestedDataByPath.js +1 -56
  40. package/lib/commonjs/network/components/response-editor/editorContext.js +1 -33
  41. package/lib/commonjs/network/components/response-editor/updateNestedDataByPath.js +1 -61
  42. package/lib/commonjs/network/conditions/NetworkConditionsControl.js +1 -235
  43. package/lib/commonjs/network/conditions/NetworkConditionsControl.test.js +1 -136
  44. package/lib/commonjs/network/conditions/NetworkConditionsIcon.js +1 -33
  45. package/lib/commonjs/network/conditions/NetworkFloatingTool.js +1 -310
  46. package/lib/commonjs/network/conditions/NetworkFloatingTool.test.js +1 -219
  47. package/lib/commonjs/network/conditions/store.js +1 -75
  48. package/lib/commonjs/network/conditions/wait.js +1 -43
  49. package/lib/commonjs/network/conditions/xhr.js +1 -110
  50. package/lib/commonjs/network/hooks/useLiveNetworkEvent.js +1 -62
  51. package/lib/commonjs/network/hooks/useNetworkBadgeCounts.js +1 -83
  52. package/lib/commonjs/network/hooks/useNetworkEventList.js +1 -108
  53. package/lib/commonjs/network/hooks/useNetworkEvents.js +1 -318
  54. package/lib/commonjs/network/hooks/useNetworkHasMatches.js +1 -56
  55. package/lib/commonjs/network/hooks/useNetworkSaved.js +1 -38
  56. package/lib/commonjs/network/hooks/useNetworkSelection.js +1 -53
  57. package/lib/commonjs/network/hooks/useOverrideRules.js +1 -36
  58. package/lib/commonjs/network/hooks/useTickEveryMinute.js +1 -21
  59. package/lib/commonjs/network/overrides/applyToFetch.js +1 -80
  60. package/lib/commonjs/network/overrides/applyToXhr.js +2 -453
  61. package/lib/commonjs/network/overrides/engine.js +1 -93
  62. package/lib/commonjs/network/overrides/matchRule.js +1 -81
  63. package/lib/commonjs/network/overrides/overriddenRows.js +1 -0
  64. package/lib/commonjs/network/overrides/overrideRulesStore.js +1 -550
  65. package/lib/commonjs/network/overrides/presets.js +1 -70
  66. package/lib/commonjs/network/overrides/resolveOverride.js +1 -158
  67. package/lib/commonjs/network/overrides/types.js +1 -90
  68. package/lib/commonjs/network/sync/networkBodyResolver.js +1 -39
  69. package/lib/commonjs/network/sync/networkSyncAdapter.js +1 -882
  70. package/lib/commonjs/network/sync/overrideHonesty.release.test.js +1 -36
  71. package/lib/commonjs/network/types/index.js +1 -5
  72. package/lib/commonjs/network/utils/extractOperationName.js +1 -80
  73. package/lib/commonjs/network/utils/filterNetworkEvents.js +1 -96
  74. package/lib/commonjs/network/utils/formatGraphQLVariables.js +1 -219
  75. package/lib/commonjs/network/utils/formatting.js +1 -30
  76. package/lib/commonjs/network/utils/generateCurl.js +2 -71
  77. package/lib/commonjs/network/utils/generateNetworkCopyText.js +37 -166
  78. package/lib/commonjs/network/utils/httpCompletion.js +1 -37
  79. package/lib/commonjs/network/utils/networkEventStore.js +1 -393
  80. package/lib/commonjs/network/utils/networkListener.js +4 -1259
  81. package/lib/commonjs/network/utils/networkSavedStore.js +3 -577
  82. package/lib/commonjs/network/utils/networkSelectionStore.js +1 -193
  83. package/lib/commonjs/network/utils/realNow.js +1 -0
  84. package/lib/commonjs/network/utils/requestId.js +1 -0
  85. package/lib/commonjs/network/utils/resolveRequestUrl.js +1 -0
  86. package/lib/commonjs/network/utils/selectSavedEvents.js +1 -39
  87. package/lib/commonjs/network/utils/startNetworkCapture.js +1 -0
  88. package/lib/commonjs/network/utils/withPinnedFirst.js +1 -32
  89. package/lib/commonjs/preset.js +1 -102
  90. package/lib/module/index.js +1 -103
  91. package/lib/module/index.web.js +1 -82
  92. package/lib/module/network/components/DataViewer.web.js +1 -875
  93. package/lib/module/network/components/NetworkCopyScreen.web.js +1 -44
  94. package/lib/module/network/components/NetworkCopySettingsView.js +27 -750
  95. package/lib/module/network/components/NetworkCopySettingsView.web.js +14 -1237
  96. package/lib/module/network/components/NetworkDetailScreen.web.js +1 -97
  97. package/lib/module/network/components/NetworkDetailStepper.js +1 -104
  98. package/lib/module/network/components/NetworkDetailStepper.web.js +1 -296
  99. package/lib/module/network/components/NetworkEventDetailView.js +15 -1129
  100. package/lib/module/network/components/NetworkEventDetailView.web.js +15 -1482
  101. package/lib/module/network/components/NetworkEventItemCompact.js +2 -398
  102. package/lib/module/network/components/NetworkEventItemCompact.web.js +2 -818
  103. package/lib/module/network/components/NetworkFilterScreen.web.js +1 -51
  104. package/lib/module/network/components/NetworkFilterViewV3.js +1 -438
  105. package/lib/module/network/components/NetworkFilterViewV3.web.js +1 -1306
  106. package/lib/module/network/components/NetworkHeaderLive.js +1 -366
  107. package/lib/module/network/components/NetworkHeaderLive.web.js +1 -617
  108. package/lib/module/network/components/NetworkHeaderMenu.js +1 -184
  109. package/lib/module/network/components/NetworkListScreen.js +1 -400
  110. package/lib/module/network/components/NetworkListScreen.web.js +1 -623
  111. package/lib/module/network/components/NetworkModal.js +1 -781
  112. package/lib/module/network/components/NetworkNumberPrompt.js +1 -174
  113. package/lib/module/network/components/NetworkNumberPrompt.web.js +1 -230
  114. package/lib/module/network/components/NetworkOverrideEditor.js +1 -811
  115. package/lib/module/network/components/NetworkOverrideEditor.web.js +1 -939
  116. package/lib/module/network/components/NetworkOverrideHeaderButton.js +1 -104
  117. package/lib/module/network/components/NetworkOverrideHeaderButton.web.js +1 -131
  118. package/lib/module/network/components/NetworkOverridesButton.js +1 -87
  119. package/lib/module/network/components/NetworkOverridesButton.web.js +1 -141
  120. package/lib/module/network/components/NetworkOverridesScreen.js +1 -539
  121. package/lib/module/network/components/NetworkOverridesScreen.web.js +1 -826
  122. package/lib/module/network/components/NetworkSavedScreen.js +1 -222
  123. package/lib/module/network/components/NetworkSavedScreen.web.js +1 -461
  124. package/lib/module/network/components/NetworkUpgradeBanner.js +1 -72
  125. package/lib/module/network/components/response-editor/Explorer.js +1 -972
  126. package/lib/module/network/components/response-editor/Explorer.web.js +1 -1133
  127. package/lib/module/network/components/response-editor/deleteNestedDataByPath.js +1 -51
  128. package/lib/module/network/components/response-editor/editorContext.js +1 -29
  129. package/lib/module/network/components/response-editor/updateNestedDataByPath.js +1 -56
  130. package/lib/module/network/conditions/NetworkConditionsControl.js +1 -231
  131. package/lib/module/network/conditions/NetworkConditionsControl.test.js +1 -135
  132. package/lib/module/network/conditions/NetworkConditionsIcon.js +1 -29
  133. package/lib/module/network/conditions/NetworkFloatingTool.js +1 -304
  134. package/lib/module/network/conditions/NetworkFloatingTool.test.js +1 -218
  135. package/lib/module/network/conditions/store.js +1 -65
  136. package/lib/module/network/conditions/wait.js +1 -38
  137. package/lib/module/network/conditions/xhr.js +1 -106
  138. package/lib/module/network/hooks/useLiveNetworkEvent.js +1 -58
  139. package/lib/module/network/hooks/useNetworkBadgeCounts.js +1 -79
  140. package/lib/module/network/hooks/useNetworkEventList.js +1 -104
  141. package/lib/module/network/hooks/useNetworkEvents.js +1 -314
  142. package/lib/module/network/hooks/useNetworkHasMatches.js +1 -52
  143. package/lib/module/network/hooks/useNetworkSaved.js +1 -34
  144. package/lib/module/network/hooks/useNetworkSelection.js +1 -46
  145. package/lib/module/network/hooks/useOverrideRules.js +1 -32
  146. package/lib/module/network/hooks/useTickEveryMinute.js +1 -11
  147. package/lib/module/network/overrides/applyToFetch.js +1 -72
  148. package/lib/module/network/overrides/applyToXhr.js +2 -446
  149. package/lib/module/network/overrides/engine.js +1 -85
  150. package/lib/module/network/overrides/matchRule.js +1 -75
  151. package/lib/module/network/overrides/overriddenRows.js +1 -0
  152. package/lib/module/network/overrides/overrideRulesStore.js +1 -547
  153. package/lib/module/network/overrides/presets.js +1 -65
  154. package/lib/module/network/overrides/resolveOverride.js +1 -152
  155. package/lib/module/network/overrides/types.js +1 -86
  156. package/lib/module/network/sync/networkBodyResolver.js +1 -34
  157. package/lib/module/network/sync/networkSyncAdapter.js +1 -880
  158. package/lib/module/network/sync/overrideHonesty.release.test.js +1 -35
  159. package/lib/module/network/types/index.js +1 -3
  160. package/lib/module/network/utils/extractOperationName.js +1 -76
  161. package/lib/module/network/utils/filterNetworkEvents.js +1 -92
  162. package/lib/module/network/utils/formatGraphQLVariables.js +1 -213
  163. package/lib/module/network/utils/formatting.js +1 -9
  164. package/lib/module/network/utils/generateCurl.js +2 -67
  165. package/lib/module/network/utils/generateNetworkCopyText.js +37 -162
  166. package/lib/module/network/utils/httpCompletion.js +1 -32
  167. package/lib/module/network/utils/networkEventStore.js +1 -391
  168. package/lib/module/network/utils/networkListener.js +4 -1249
  169. package/lib/module/network/utils/networkSavedStore.js +3 -572
  170. package/lib/module/network/utils/networkSelectionStore.js +1 -188
  171. package/lib/module/network/utils/realNow.js +1 -0
  172. package/lib/module/network/utils/requestId.js +1 -0
  173. package/lib/module/network/utils/resolveRequestUrl.js +1 -0
  174. package/lib/module/network/utils/selectSavedEvents.js +1 -35
  175. package/lib/module/network/utils/startNetworkCapture.js +1 -0
  176. package/lib/module/network/utils/withPinnedFirst.js +1 -28
  177. package/lib/module/preset.js +1 -100
  178. package/lib/typescript/index.d.ts +1 -0
  179. package/lib/typescript/network/overrides/applyToXhr.d.ts +1 -0
  180. package/lib/typescript/network/overrides/engine.d.ts +1 -1
  181. package/lib/typescript/network/overrides/matchRule.d.ts +1 -1
  182. package/lib/typescript/network/overrides/overriddenRows.d.ts +16 -0
  183. package/lib/typescript/network/overrides/resolveOverride.d.ts +2 -2
  184. package/lib/typescript/network/overrides/types.d.ts +9 -0
  185. package/lib/typescript/network/utils/networkListener.d.ts +14 -4
  186. package/lib/typescript/network/utils/networkSavedStore.d.ts +4 -4
  187. package/lib/typescript/network/utils/realNow.d.ts +18 -0
  188. package/lib/typescript/network/utils/requestId.d.ts +2 -0
  189. package/lib/typescript/network/utils/resolveRequestUrl.d.ts +3 -0
  190. package/lib/typescript/network/utils/startNetworkCapture.d.ts +6 -0
  191. package/lib/web/index.mjs +145 -0
  192. package/package.json +32 -10
  193. package/lib/typescript/index.d.ts.map +0 -1
  194. package/lib/typescript/index.web.d.ts.map +0 -1
  195. package/lib/typescript/network/components/DataViewer.web.d.ts.map +0 -1
  196. package/lib/typescript/network/components/NetworkCopyScreen.web.d.ts.map +0 -1
  197. package/lib/typescript/network/components/NetworkCopySettingsView.d.ts.map +0 -1
  198. package/lib/typescript/network/components/NetworkCopySettingsView.web.d.ts.map +0 -1
  199. package/lib/typescript/network/components/NetworkDetailScreen.web.d.ts.map +0 -1
  200. package/lib/typescript/network/components/NetworkDetailStepper.d.ts.map +0 -1
  201. package/lib/typescript/network/components/NetworkDetailStepper.web.d.ts.map +0 -1
  202. package/lib/typescript/network/components/NetworkEventDetailView.d.ts.map +0 -1
  203. package/lib/typescript/network/components/NetworkEventDetailView.web.d.ts.map +0 -1
  204. package/lib/typescript/network/components/NetworkEventItemCompact.d.ts.map +0 -1
  205. package/lib/typescript/network/components/NetworkEventItemCompact.web.d.ts.map +0 -1
  206. package/lib/typescript/network/components/NetworkFilterScreen.web.d.ts.map +0 -1
  207. package/lib/typescript/network/components/NetworkFilterViewV3.d.ts.map +0 -1
  208. package/lib/typescript/network/components/NetworkFilterViewV3.web.d.ts.map +0 -1
  209. package/lib/typescript/network/components/NetworkHeaderLive.d.ts.map +0 -1
  210. package/lib/typescript/network/components/NetworkHeaderLive.web.d.ts.map +0 -1
  211. package/lib/typescript/network/components/NetworkHeaderMenu.d.ts.map +0 -1
  212. package/lib/typescript/network/components/NetworkListScreen.d.ts.map +0 -1
  213. package/lib/typescript/network/components/NetworkListScreen.web.d.ts.map +0 -1
  214. package/lib/typescript/network/components/NetworkModal.d.ts.map +0 -1
  215. package/lib/typescript/network/components/NetworkNumberPrompt.d.ts.map +0 -1
  216. package/lib/typescript/network/components/NetworkNumberPrompt.web.d.ts.map +0 -1
  217. package/lib/typescript/network/components/NetworkOverrideEditor.d.ts.map +0 -1
  218. package/lib/typescript/network/components/NetworkOverrideEditor.web.d.ts.map +0 -1
  219. package/lib/typescript/network/components/NetworkOverrideHeaderButton.d.ts.map +0 -1
  220. package/lib/typescript/network/components/NetworkOverrideHeaderButton.web.d.ts.map +0 -1
  221. package/lib/typescript/network/components/NetworkOverridesButton.d.ts.map +0 -1
  222. package/lib/typescript/network/components/NetworkOverridesButton.web.d.ts.map +0 -1
  223. package/lib/typescript/network/components/NetworkOverridesScreen.d.ts.map +0 -1
  224. package/lib/typescript/network/components/NetworkOverridesScreen.web.d.ts.map +0 -1
  225. package/lib/typescript/network/components/NetworkSavedScreen.d.ts.map +0 -1
  226. package/lib/typescript/network/components/NetworkSavedScreen.web.d.ts.map +0 -1
  227. package/lib/typescript/network/components/NetworkUpgradeBanner.d.ts.map +0 -1
  228. package/lib/typescript/network/components/response-editor/Explorer.d.ts.map +0 -1
  229. package/lib/typescript/network/components/response-editor/Explorer.web.d.ts.map +0 -1
  230. package/lib/typescript/network/components/response-editor/deleteNestedDataByPath.d.ts.map +0 -1
  231. package/lib/typescript/network/components/response-editor/editorContext.d.ts.map +0 -1
  232. package/lib/typescript/network/components/response-editor/updateNestedDataByPath.d.ts.map +0 -1
  233. package/lib/typescript/network/conditions/NetworkConditionsControl.d.ts.map +0 -1
  234. package/lib/typescript/network/conditions/NetworkConditionsControl.test.d.ts.map +0 -1
  235. package/lib/typescript/network/conditions/NetworkConditionsIcon.d.ts.map +0 -1
  236. package/lib/typescript/network/conditions/NetworkFloatingTool.d.ts.map +0 -1
  237. package/lib/typescript/network/conditions/NetworkFloatingTool.test.d.ts.map +0 -1
  238. package/lib/typescript/network/conditions/store.d.ts.map +0 -1
  239. package/lib/typescript/network/conditions/wait.d.ts.map +0 -1
  240. package/lib/typescript/network/conditions/xhr.d.ts.map +0 -1
  241. package/lib/typescript/network/hooks/useLiveNetworkEvent.d.ts.map +0 -1
  242. package/lib/typescript/network/hooks/useNetworkBadgeCounts.d.ts.map +0 -1
  243. package/lib/typescript/network/hooks/useNetworkEventList.d.ts.map +0 -1
  244. package/lib/typescript/network/hooks/useNetworkEvents.d.ts.map +0 -1
  245. package/lib/typescript/network/hooks/useNetworkHasMatches.d.ts.map +0 -1
  246. package/lib/typescript/network/hooks/useNetworkSaved.d.ts.map +0 -1
  247. package/lib/typescript/network/hooks/useNetworkSelection.d.ts.map +0 -1
  248. package/lib/typescript/network/hooks/useOverrideRules.d.ts.map +0 -1
  249. package/lib/typescript/network/hooks/useTickEveryMinute.d.ts.map +0 -1
  250. package/lib/typescript/network/overrides/applyToFetch.d.ts.map +0 -1
  251. package/lib/typescript/network/overrides/applyToXhr.d.ts.map +0 -1
  252. package/lib/typescript/network/overrides/engine.d.ts.map +0 -1
  253. package/lib/typescript/network/overrides/matchRule.d.ts.map +0 -1
  254. package/lib/typescript/network/overrides/overrideRulesStore.d.ts.map +0 -1
  255. package/lib/typescript/network/overrides/presets.d.ts.map +0 -1
  256. package/lib/typescript/network/overrides/resolveOverride.d.ts.map +0 -1
  257. package/lib/typescript/network/overrides/types.d.ts.map +0 -1
  258. package/lib/typescript/network/sync/networkBodyResolver.d.ts.map +0 -1
  259. package/lib/typescript/network/sync/networkSyncAdapter.d.ts.map +0 -1
  260. package/lib/typescript/network/sync/overrideHonesty.release.test.d.ts.map +0 -1
  261. package/lib/typescript/network/types/index.d.ts.map +0 -1
  262. package/lib/typescript/network/utils/extractOperationName.d.ts.map +0 -1
  263. package/lib/typescript/network/utils/filterNetworkEvents.d.ts.map +0 -1
  264. package/lib/typescript/network/utils/formatGraphQLVariables.d.ts.map +0 -1
  265. package/lib/typescript/network/utils/formatting.d.ts.map +0 -1
  266. package/lib/typescript/network/utils/generateCurl.d.ts.map +0 -1
  267. package/lib/typescript/network/utils/generateNetworkCopyText.d.ts.map +0 -1
  268. package/lib/typescript/network/utils/httpCompletion.d.ts.map +0 -1
  269. package/lib/typescript/network/utils/networkEventStore.d.ts.map +0 -1
  270. package/lib/typescript/network/utils/networkListener.d.ts.map +0 -1
  271. package/lib/typescript/network/utils/networkSavedStore.d.ts.map +0 -1
  272. package/lib/typescript/network/utils/networkSelectionStore.d.ts.map +0 -1
  273. package/lib/typescript/network/utils/selectSavedEvents.d.ts.map +0 -1
  274. package/lib/typescript/network/utils/withPinnedFirst.d.ts.map +0 -1
  275. package/lib/typescript/preset.d.ts.map +0 -1
@@ -1,1242 +1,14 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DEFAULT_COPY_SETTINGS = void 0;
7
- exports.NetworkCopySettingsView = NetworkCopySettingsView;
8
- var _react = require("react");
9
- var _DataViewer = require("./DataViewer.web");
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- /**
12
- * NetworkCopySettingsView.web — DOM twin of NetworkCopySettingsView.tsx.
13
- *
14
- * The COPY tab's configurator: quick presets (URLs / LLM / JSON / Full /
15
- * Custom), the Include toggles, the output-format pick, and the collapsible
16
- * live preview with its size warnings and copy action. Same preset configs,
17
- * preset detection, option-change routing (`group::key` ids), mock-request
18
- * fallback, size estimation and preview/copy text generation as the native
19
- * file — all copied verbatim.
20
- *
21
- * Natively the chrome is shared-ui's `DynamicFilterView`; the web shim
22
- * doesn't ship it, so this twin renders the exact subtree DynamicFilterView
23
- * produces FOR THIS CONFIG (no tabs, no filter-summary, no pattern sections —
24
- * those config branches are unused here), same precedent as
25
- * NetworkFilterViewV3.web:
26
- * 1. Facet-card sections — Presets (icon + label), Include (label-only
27
- * toggles), Format (icon + label); single active-card treatment
28
- * (primary fill + 2px ring + glow).
29
- * 2. PREVIEW section — SectionHeader (Eye icon, title, header actions =
30
- * status label + toolbar copy button) over the recessed content box;
31
- * collapsed by default behind the Show Preview summary (request count +
32
- * estimated size + large-payload warnings), exactly like native.
33
- *
34
- * shared-ui RN chrome replicated as DOM with provenance:
35
- * - `buoyColors` / `macOSColors` — inlined verbatim subsets from
36
- * shared/src/ui/gameUI/constants/ (DynamicFilterView + SectionHeader use
37
- * buoyColors; the preview widgets use macOSColors directly).
38
- * - Icons — inline lucide SVGs (shared-ui's icons are lucide re-exports).
39
- * - `ToolbarCopyButton` — the DataViewer.web `CopyButton` twin at size 14
40
- * (the native preset is exactly `CopyButton size={14}` with default
41
- * colors); copies via navigator.clipboard with the same 1500ms feedback.
42
- * - `DataViewer` (JSON-format preview) — the DataViewer.web twin.
43
- * - `formatRelativeTime` — copied verbatim from
44
- * shared/src/utils/time/formatRelativeTime.ts.
45
- * - Native card glow (`shadowColor` primary, opacity 0.3, radius 8) → an
46
- * equivalent CSS box-shadow.
47
- *
48
- * Intentional deviations (all logged):
49
- * - License gating isn't part of the web port: native reads
50
- * `useFeatureGate()` and wraps the view in a `ProFeatureBanner` for free
51
- * users; here `isPro` is a constant true, so that branch never renders and
52
- * is not ported. Copy is likewise ungated (native's CopyButton shows a
53
- * Pro modal via @buoy-gg/license).
54
- * - `useTickEveryMinute` (shared TickProvider context, 5s cadence as mounted
55
- * by NetworkModal) → the same module-level shared 5s interval hook the
56
- * compact row twin uses.
57
- * - Native's `previewData` memo is dead code (computed, never read) and is
58
- * dropped here — the host tsconfig runs `noUnusedLocals`.
59
- * - `selectable={isPro}` on the preview text → `userSelect: "text"` (isPro
60
- * is constant-true on web).
61
- * - `CopySettings` / `DEFAULT_COPY_SETTINGS` are re-declared against the
62
- * platform-free type in `generateNetworkCopyText` (the native module would
63
- * drag react-native in); the shape is byte-identical.
64
- *
65
- * @platform React DOM Web
66
- */
67
-
68
- /** NetworkCopySettingsView.tsx `DEFAULT_COPY_SETTINGS`, verbatim. */
69
- const DEFAULT_COPY_SETTINGS = exports.DEFAULT_COPY_SETTINGS = {
70
- includeMethod: true,
71
- includeStatus: true,
72
- includeDuration: true,
73
- includeTimestamp: true,
74
- includeClient: true,
75
- includeSizes: true,
76
- includeErrors: true,
77
- includeRequestHeaders: true,
78
- includeResponseHeaders: true,
79
- includeRequestBody: true,
80
- includeResponseBody: true,
81
- bodySizeThreshold: 10,
82
- format: "markdown",
83
- filterMode: "all"
84
- };
85
-
86
- // =============================
87
- // Native palettes (provenance)
88
- // =============================
89
-
90
- /** buoyColors subset — shared/src/ui/gameUI/constants/gameUIColors.ts, verbatim. */
91
- const buoyColors = {
92
- base: "#121212",
93
- card: "#1A1A1A",
94
- hover: "#242424",
95
- border: "#333333",
96
- borderStrong: "#444444",
97
- text: "#E0E0E0",
98
- primary: "#20C997"
99
- };
100
-
101
- /** macOSColors subset — shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts, verbatim. */
102
- const macOSColors = {
103
- background: {
104
- input: "#26262A",
105
- hover: "#1D1D1F"
106
- },
107
- border: {
108
- default: "#2D2D2F"
109
- },
110
- text: {
111
- primary: "#F5F5F7",
112
- secondary: "#A1A1A6",
113
- muted: "#8E8E93"
114
- },
115
- semantic: {
116
- success: "#34C759",
117
- error: "#FF453A",
118
- errorBackground: "rgba(255, 69, 58, 0.15)",
119
- warning: "#FFEB3B",
120
- warningBackground: "rgba(255, 235, 59, 0.15)",
121
- info: "#00B8E6"
122
- }
123
- };
124
-
125
- // =============================
126
- // Inline lucide icons (shared-ui icons are lucide re-exports)
127
- // =============================
128
-
129
- function Svg({
130
- size = 14,
131
- color = "currentColor",
132
- children
133
- }) {
134
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
135
- width: size,
136
- height: size,
137
- viewBox: "0 0 24 24",
138
- fill: "none",
139
- stroke: color,
140
- strokeWidth: 2,
141
- strokeLinecap: "round",
142
- strokeLinejoin: "round",
143
- style: {
144
- flexShrink: 0,
145
- display: "block"
146
- },
147
- children: children
148
- });
149
- }
150
- const FileText = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
151
- ...p,
152
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
153
- d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"
154
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
155
- d: "M14 2v4a2 2 0 0 0 2 2h4"
156
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
157
- d: "M10 9H8"
158
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
159
- d: "M16 13H8"
160
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
161
- d: "M16 17H8"
162
- })]
163
- });
164
- const FileCode = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
165
- ...p,
166
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
167
- d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z"
168
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
169
- d: "M14 2v4a2 2 0 0 0 2 2h4"
170
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
171
- d: "M10 12.5 8 15l2 2.5"
172
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
173
- d: "m14 12.5 2 2.5-2 2.5"
174
- })]
175
- });
176
- const Link = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
177
- ...p,
178
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
179
- d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"
180
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
181
- d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
182
- })]
183
- });
184
- const Zap = p => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
185
- ...p,
186
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("polygon", {
187
- points: "13 2 3 14 12 14 11 22 21 10 12 10 13 2"
188
- })
189
- });
190
- const Settings = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
191
- ...p,
192
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
193
- d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"
194
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
195
- cx: "12",
196
- cy: "12",
197
- r: "3"
198
- })]
199
- });
200
- const Hash = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
201
- ...p,
202
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
203
- x1: "4",
204
- x2: "20",
205
- y1: "9",
206
- y2: "9"
207
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
208
- x1: "4",
209
- x2: "20",
210
- y1: "15",
211
- y2: "15"
212
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
213
- x1: "10",
214
- x2: "8",
215
- y1: "3",
216
- y2: "21"
217
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
218
- x1: "16",
219
- x2: "14",
220
- y1: "3",
221
- y2: "21"
222
- })]
223
- });
224
- const Eye = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
225
- ...p,
226
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
227
- d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"
228
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
229
- cx: "12",
230
- cy: "12",
231
- r: "3"
232
- })]
233
- });
234
- const ChevronDown = p => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
235
- ...p,
236
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
237
- d: "m6 9 6 6 6-6"
238
- })
239
- });
240
- const ChevronUp = p => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
241
- ...p,
242
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
243
- d: "m18 15-6-6-6 6"
244
- })
245
- });
246
- const AlertTriangle = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
247
- ...p,
248
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
249
- d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"
250
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
251
- d: "M12 9v4"
252
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
253
- d: "M12 17h.01"
254
- })]
255
- });
256
-
257
- // =============================
258
- // Shared tick (DEVIATION: replaces shared-ui TickProvider/useTickEveryMinute)
259
- // =============================
260
-
261
- /**
262
- * One module-level 5s clock — the cadence NetworkModal's `TickProvider` gives
263
- * the native view (default `intervalMs` 5_000). Runs only while a consumer is
264
- * mounted. Same pattern as NetworkEventItemCompact.web.
265
- */
266
- const tickListeners = new Set();
267
- let tickInterval = null;
268
- function subscribeTick(listener) {
269
- tickListeners.add(listener);
270
- if (tickInterval == null) {
271
- tickInterval = setInterval(() => {
272
- const now = Date.now();
273
- tickListeners.forEach(l => l(now));
274
- }, 5_000);
275
- }
276
- return () => {
277
- tickListeners.delete(listener);
278
- if (tickListeners.size === 0 && tickInterval != null) {
279
- clearInterval(tickInterval);
280
- tickInterval = null;
281
- }
282
- };
283
- }
284
- function useSharedTick() {
285
- const [tick, setTick] = (0, _react.useState)(() => Date.now());
286
- (0, _react.useEffect)(() => subscribeTick(setTick), []);
287
- return tick;
288
- }
289
-
290
- /** shared/src/utils/time/formatRelativeTime.ts — verbatim. */
291
- function formatRelativeTime(timestamp, currentTime = Date.now()) {
292
- const timestampMs = timestamp instanceof Date ? timestamp.getTime() : timestamp;
293
- const seconds = Math.floor((currentTime - timestampMs) / 1000);
294
- if (seconds < 0) {
295
- return "just now";
296
- }
297
- if (seconds < 60) {
298
- return seconds === 0 ? "just now" : `${seconds}s ago`;
299
- }
300
- const minutes = Math.floor(seconds / 60);
301
- if (minutes < 60) {
302
- return `${minutes}m ago`;
303
- }
304
- const hours = Math.floor(minutes / 60);
305
- if (hours < 24) {
306
- return `${hours}h ago`;
307
- }
308
- const days = Math.floor(hours / 24);
309
- return `${days}d ago`;
310
- }
311
-
312
- // =============================
313
- // Config + pure helpers (copied verbatim from the native file)
314
- // =============================
315
-
316
- // Preset configurations for comparison
317
- const PRESET_CONFIGS = {
318
- urls: {
319
- includeMethod: true,
320
- includeStatus: false,
321
- includeDuration: false,
322
- includeTimestamp: false,
323
- includeClient: false,
324
- includeSizes: false,
325
- includeErrors: false,
326
- includeRequestHeaders: false,
327
- includeResponseHeaders: false,
328
- includeRequestBody: false,
329
- includeResponseBody: false,
330
- bodySizeThreshold: 10,
331
- format: "plaintext",
332
- filterMode: "all"
333
- },
334
- llm: {
335
- includeMethod: true,
336
- includeStatus: true,
337
- includeDuration: true,
338
- includeTimestamp: true,
339
- includeClient: true,
340
- includeSizes: true,
341
- includeErrors: true,
342
- includeRequestHeaders: true,
343
- includeResponseHeaders: true,
344
- includeRequestBody: true,
345
- includeResponseBody: true,
346
- bodySizeThreshold: 10,
347
- format: "markdown",
348
- filterMode: "all"
349
- },
350
- json: {
351
- includeMethod: true,
352
- includeStatus: true,
353
- includeDuration: true,
354
- includeTimestamp: true,
355
- includeClient: true,
356
- includeSizes: true,
357
- includeErrors: true,
358
- includeRequestHeaders: true,
359
- includeResponseHeaders: true,
360
- includeRequestBody: true,
361
- includeResponseBody: true,
362
- bodySizeThreshold: -1,
363
- format: "json",
364
- filterMode: "all"
365
- },
366
- full: {
367
- includeMethod: true,
368
- includeStatus: true,
369
- includeDuration: true,
370
- includeTimestamp: true,
371
- includeClient: true,
372
- includeSizes: true,
373
- includeErrors: true,
374
- includeRequestHeaders: true,
375
- includeResponseHeaders: true,
376
- includeRequestBody: true,
377
- includeResponseBody: true,
378
- bodySizeThreshold: -1,
379
- format: "markdown",
380
- filterMode: "all"
381
- }
382
- };
383
- // Detect which preset matches current settings
384
- function detectActivePreset(settings) {
385
- for (const [presetName, presetConfig] of Object.entries(PRESET_CONFIGS)) {
386
- const matches = Object.keys(presetConfig).every(key => presetConfig[key] === settings[key]);
387
- if (matches) return presetName;
388
- }
389
- return null; // No preset matches = Custom
390
- }
391
-
392
- // Size thresholds for warnings
393
- const SIZE_WARNING_THRESHOLD = 100 * 1024; // 100KB - show warning
394
- const SIZE_DANGER_THRESHOLD = 500 * 1024; // 500KB - show danger warning
395
-
396
- // Helper to format bytes for display
397
- function formatBytes(bytes) {
398
- if (bytes < 1024) return `${bytes} B`;
399
- if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
400
- return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
401
- }
402
-
403
- // =============================
404
- // DynamicFilterView chrome twins for this config (provenance:
405
- // shared/src/ui/components/DynamicFilterView.tsx + SectionHeader.tsx)
406
- // =============================
407
-
408
- /** SectionHeader DOM twin — container row, 16/8 padding, minHeight 40. */
409
- function SectionHeaderRow({
410
- icon: Icon,
411
- iconColor,
412
- title,
413
- actions
414
- }) {
415
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
416
- style: styles.sectionHeader,
417
- children: [Icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
418
- style: styles.sectionHeaderIcon,
419
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
420
- size: 12,
421
- color: iconColor ?? buoyColors.primary
422
- })
423
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
424
- style: styles.sectionHeaderTitle,
425
- children: title
426
- }), actions ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
427
- style: styles.sectionHeaderActions,
428
- children: actions
429
- }) : null]
430
- });
431
- }
432
-
433
- /** DynamicFilterView's facet-card grid section for a `custom` section. */
434
- function FilterCardSection({
435
- title,
436
- options,
437
- onOptionPress
438
- }) {
439
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
440
- style: styles.section,
441
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SectionHeaderRow, {
442
- title: title
443
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
444
- style: styles.filterGrid,
445
- children: options.map(option => {
446
- const Icon = option.icon;
447
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
448
- type: "button",
449
- onClick: () => onOptionPress(option.id, option.value),
450
- style: {
451
- ...styles.filterCard,
452
- ...(option.isActive ? styles.activeFilterCard : null)
453
- },
454
- children: [Icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
455
- size: 24,
456
- color: option.color
457
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
458
- style: styles.filterLabelCompact,
459
- children: option.label
460
- })]
461
- }, option.id);
462
- })
463
- })]
464
- });
465
- }
466
-
467
- // =============================
468
- // View (structure + logic mirror the native file 1:1)
469
- // =============================
470
-
471
- function NetworkCopySettingsView({
472
- settings,
473
- onSettingsChange,
474
- events = []
475
- }) {
476
- // DEVIATION: native reads `useFeatureGate()`; license gating isn't part of
477
- // the web port, so the free-user ProFeatureBanner branch never renders.
478
- const isPro = true;
479
-
480
- // Use tick for updating relative time
481
- const tick = useSharedTick();
482
-
483
- // State for preview expansion - collapsed by default to prevent crashes
484
- const [isPreviewExpanded, setIsPreviewExpanded] = (0, _react.useState)(false);
485
-
486
- // Auto-detect if we have live data
487
- const hasLiveData = events.length > 0;
488
-
489
- // Get the most recent event timestamp for "last updated" display
490
- const lastEventTimestamp = (0, _react.useMemo)(() => {
491
- if (!hasLiveData) return null;
492
- const timestamps = events.map(e => typeof e.timestamp === "number" ? e.timestamp : new Date(e.timestamp).getTime());
493
- return Math.max(...timestamps);
494
- }, [events, hasLiveData]);
495
-
496
- // Detect active preset
497
- const activePreset = (0, _react.useMemo)(() => detectActivePreset(settings), [settings]);
498
-
499
- // Quick preset handlers
500
- const applyUrlsPreset = (0, _react.useCallback)(() => {
501
- onSettingsChange(PRESET_CONFIGS.urls);
502
- }, [onSettingsChange]);
503
- const applyLLMPreset = (0, _react.useCallback)(() => {
504
- onSettingsChange(PRESET_CONFIGS.llm);
505
- }, [onSettingsChange]);
506
- const applyJSONPreset = (0, _react.useCallback)(() => {
507
- onSettingsChange(PRESET_CONFIGS.json);
508
- }, [onSettingsChange]);
509
- const applyFullPreset = (0, _react.useCallback)(() => {
510
- onSettingsChange(PRESET_CONFIGS.full);
511
- }, [onSettingsChange]);
512
-
513
- // Handle individual option changes
514
- const handleOptionChange = (0, _react.useCallback)((optionId, value) => {
515
- const [group, key] = optionId.split("::");
516
- if (group === "preset") {
517
- switch (key) {
518
- case "urls":
519
- applyUrlsPreset();
520
- break;
521
- case "llm":
522
- applyLLMPreset();
523
- break;
524
- case "json":
525
- applyJSONPreset();
526
- break;
527
- case "full":
528
- applyFullPreset();
529
- break;
530
- }
531
- return;
532
- }
533
- if (group === "requestInfo") {
534
- // Toggle boolean value
535
- onSettingsChange({
536
- ...settings,
537
- [key]: !settings[key]
538
- });
539
- return;
540
- }
541
- if (group === "headers") {
542
- // Toggle boolean value
543
- onSettingsChange({
544
- ...settings,
545
- [key]: !settings[key]
546
- });
547
- return;
548
- }
549
- if (group === "body") {
550
- if (key === "bodySizeThreshold") {
551
- onSettingsChange({
552
- ...settings,
553
- bodySizeThreshold: value
554
- });
555
- } else {
556
- // Toggle boolean value
557
- onSettingsChange({
558
- ...settings,
559
- [key]: !settings[key]
560
- });
561
- }
562
- return;
563
- }
564
- if (group === "format") {
565
- onSettingsChange({
566
- ...settings,
567
- format: value
568
- });
569
- return;
570
- }
571
- if (group === "filter") {
572
- onSettingsChange({
573
- ...settings,
574
- filterMode: value
575
- });
576
- }
577
- }, [settings, onSettingsChange, applyUrlsPreset, applyLLMPreset, applyJSONPreset, applyFullPreset]);
578
-
579
- // Mock data for preview
580
- const mockRequestData = (0, _react.useMemo)(() => ({
581
- method: "POST",
582
- url: "https://api.example.com/v1/users",
583
- status: 201,
584
- duration: 342,
585
- timestamp: new Date().toISOString(),
586
- requestHeaders: {
587
- "Content-Type": "application/json",
588
- Authorization: "Bearer ***"
589
- },
590
- responseHeaders: {
591
- "Content-Type": "application/json",
592
- "X-Request-ID": "abc123"
593
- },
594
- requestBody: {
595
- name: "John Doe",
596
- email: "john@example.com"
597
- },
598
- responseBody: {
599
- id: "user_123",
600
- name: "John Doe",
601
- email: "john@example.com",
602
- createdAt: "2025-01-10T12:00:00Z"
603
- }
604
- }), []);
605
-
606
- // Estimate the size of the preview content to warn users about large payloads
607
- const estimatedSize = (0, _react.useMemo)(() => {
608
- const dataSource = hasLiveData ? events : [mockRequestData];
609
- let totalSize = 0;
610
- for (const eventData of dataSource) {
611
- // Estimate based on what's included
612
- if (settings.includeMethod) {
613
- totalSize += (eventData.url?.length || 0) + 10;
614
- }
615
- if (settings.includeStatus) {
616
- totalSize += 30;
617
- }
618
- if (settings.includeTimestamp) {
619
- totalSize += 30;
620
- }
621
- if (settings.includeRequestHeaders) {
622
- try {
623
- totalSize += JSON.stringify(eventData.requestHeaders || {}).length;
624
- } catch {
625
- totalSize += 100;
626
- }
627
- }
628
- if (settings.includeRequestBody) {
629
- const body = "requestBody" in eventData ? eventData.requestBody : eventData.requestData;
630
- try {
631
- totalSize += JSON.stringify(body || {}).length;
632
- } catch {
633
- totalSize += 100;
634
- }
635
- }
636
- if (settings.includeResponseBody) {
637
- const body = "responseBody" in eventData ? eventData.responseBody : eventData.responseData;
638
- try {
639
- totalSize += JSON.stringify(body || {}).length;
640
- } catch {
641
- totalSize += 100;
642
- }
643
- }
644
- }
645
- return totalSize;
646
- }, [hasLiveData, events, mockRequestData, settings]);
647
-
648
- // Determine warning level based on estimated size
649
- const sizeWarningLevel = (0, _react.useMemo)(() => {
650
- if (estimatedSize >= SIZE_DANGER_THRESHOLD) return "danger";
651
- if (estimatedSize >= SIZE_WARNING_THRESHOLD) return "warning";
652
- return "none";
653
- }, [estimatedSize]);
654
-
655
- // Generate copy text - should match preview content exactly
656
- const generateCopyText = (0, _react.useCallback)(() => {
657
- const dataSource = hasLiveData ? events : [mockRequestData];
658
- const {
659
- format,
660
- includeMethod,
661
- includeStatus,
662
- includeTimestamp,
663
- includeRequestHeaders,
664
- includeRequestBody,
665
- includeResponseBody
666
- } = settings;
667
-
668
- // Build filtered data for a single event
669
- const buildFilteredData = eventData => {
670
- const data = {};
671
- if (includeMethod) {
672
- data.method = eventData.method;
673
- data.url = eventData.url;
674
- }
675
- if (includeStatus) {
676
- data.status = eventData.status;
677
- data.duration = eventData.duration;
678
- }
679
- if (includeTimestamp) {
680
- data.timestamp = eventData.timestamp;
681
- }
682
- if (includeRequestHeaders) {
683
- data.requestHeaders = eventData.requestHeaders;
684
- }
685
- if (includeRequestBody) {
686
- data.requestBody = "requestBody" in eventData ? eventData.requestBody : eventData.requestData;
687
- }
688
- if (includeResponseBody) {
689
- data.responseBody = "responseBody" in eventData ? eventData.responseBody : eventData.responseData;
690
- }
691
- return data;
692
- };
693
- if (format === "json") {
694
- const allFilteredData = dataSource.map(buildFilteredData);
695
- return JSON.stringify(allFilteredData, null, 2);
696
- }
697
- if (format === "markdown") {
698
- const allRequests = dataSource.map((eventData, index) => {
699
- const sections = [];
700
- sections.push(`# Request ${index + 1}`);
701
- if (includeMethod) {
702
- sections.push(`\n**${eventData.method}** ${eventData.url}`);
703
- }
704
- const metaInfo = [];
705
- if (includeStatus) {
706
- metaInfo.push(`**Status:** ${eventData.status}`);
707
- metaInfo.push(`**Duration:** ${eventData.duration}ms`);
708
- }
709
- if (includeTimestamp) {
710
- metaInfo.push(`**Timestamp:** ${eventData.timestamp}`);
711
- }
712
- if (metaInfo.length > 0) {
713
- sections.push("\n" + metaInfo.join("\n"));
714
- }
715
- if (includeRequestHeaders) {
716
- const headers = eventData.requestHeaders || {};
717
- sections.push(`\n## Request Headers\n\`\`\`json\n${JSON.stringify(headers, null, 2)}\n\`\`\``);
718
- }
719
- if (includeRequestBody) {
720
- const body = "requestBody" in eventData ? eventData.requestBody : eventData.requestData;
721
- sections.push(`\n## Request Body\n\`\`\`json\n${JSON.stringify(body || {}, null, 2)}\n\`\`\``);
722
- }
723
- if (includeResponseBody) {
724
- const body = "responseBody" in eventData ? eventData.responseBody : eventData.responseData;
725
- sections.push(`\n## Response Body\n\`\`\`json\n${JSON.stringify(body || {}, null, 2)}\n\`\`\``);
726
- }
727
- return sections.join("\n");
728
- });
729
- return allRequests.join("\n\n---\n\n") || "No data included";
730
- }
731
-
732
- // Plaintext
733
- const allRequests = dataSource.map((eventData, index) => {
734
- const lines = [];
735
- lines.push(`Request ${index + 1}:`);
736
- if (includeMethod) {
737
- lines.push(`${eventData.method} ${eventData.url}`);
738
- }
739
- if (includeStatus) {
740
- lines.push(`Status: ${eventData.status}`);
741
- lines.push(`Duration: ${eventData.duration}ms`);
742
- }
743
- if (includeTimestamp) {
744
- lines.push(`Timestamp: ${eventData.timestamp}`);
745
- }
746
- if (includeRequestBody) {
747
- const body = "requestBody" in eventData ? eventData.requestBody : eventData.requestData;
748
- lines.push("\nRequest:");
749
- lines.push(JSON.stringify(body || {}, null, 2));
750
- }
751
- if (includeResponseBody) {
752
- const body = "responseBody" in eventData ? eventData.responseBody : eventData.responseData;
753
- lines.push("\nResponse:");
754
- lines.push(JSON.stringify(body || {}, null, 2));
755
- }
756
- return lines.join("\n");
757
- });
758
- return allRequests.join("\n\n---\n\n") || "No data included";
759
- }, [hasLiveData, events, mockRequestData, settings]);
760
-
761
- // Generate the expanded preview content (only called when expanded)
762
- const generateExpandedPreviewContent = (0, _react.useCallback)(() => {
763
- if (settings.format === "json") {
764
- const dataSource = hasLiveData ? events : [mockRequestData];
765
- const buildFilteredData = eventData => {
766
- const data = {};
767
- if (settings.includeMethod) {
768
- data.method = eventData.method;
769
- data.url = eventData.url;
770
- }
771
- if (settings.includeStatus) {
772
- data.status = eventData.status;
773
- data.duration = eventData.duration;
774
- }
775
- if (settings.includeTimestamp) {
776
- data.timestamp = eventData.timestamp;
777
- }
778
- if (settings.includeRequestHeaders) {
779
- data.requestHeaders = eventData.requestHeaders;
780
- }
781
- if (settings.includeRequestBody) {
782
- data.requestBody = "requestBody" in eventData ? eventData.requestBody : eventData.requestData;
783
- }
784
- if (settings.includeResponseBody) {
785
- data.responseBody = "responseBody" in eventData ? eventData.responseBody : eventData.responseData;
786
- }
787
- return data;
788
- };
789
- const allFilteredData = dataSource.map(buildFilteredData);
790
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DataViewer.DataViewer, {
791
- data: allFilteredData,
792
- title: "",
793
- showTypeFilter: false
794
- });
795
- }
796
-
797
- // Markdown / plaintext share the same monospace scroll box; the STRING is
798
- // exactly what `generateCopyText` produces for these formats (native
799
- // duplicates the builders — the outputs are identical, so the twin feeds
800
- // the preview from the one builder rather than carrying a second copy).
801
- const text = generateCopyText();
802
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
803
- style: styles.previewScroll,
804
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
805
- style: {
806
- ...(settings.format === "markdown" ? styles.markdownText : styles.plaintextText),
807
- // Native `selectable={isPro}` — constant-true on web (deviations).
808
- userSelect: isPro ? "text" : "none"
809
- },
810
- children: text || "No data included"
811
- })
812
- });
813
- }, [settings, hasLiveData, events, mockRequestData, generateCopyText, isPro]);
814
-
815
- // Generate formatted output for copying/preview - with collapsible support
816
- const renderPreviewContent = () => {
817
- const dataSource = hasLiveData ? events : [mockRequestData];
818
- const requestCount = dataSource.length;
819
-
820
- // Collapsed state - show summary with expand button
821
- if (!isPreviewExpanded) {
822
- const warningColor = sizeWarningLevel === "danger" ? macOSColors.semantic.error : sizeWarningLevel === "warning" ? macOSColors.semantic.warning : macOSColors.text.secondary;
823
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
824
- style: styles.collapsedPreview,
825
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
826
- type: "button",
827
- style: styles.expandButton,
828
- onClick: () => setIsPreviewExpanded(true),
829
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
830
- style: styles.expandButtonContent,
831
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Eye, {
832
- size: 16,
833
- color: macOSColors.semantic.info
834
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
835
- style: styles.expandButtonTextContainer,
836
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
837
- style: styles.expandButtonTitle,
838
- children: "Show Preview"
839
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
840
- style: styles.expandButtonSubtitle,
841
- children: [requestCount, " request", requestCount !== 1 ? "s" : "", " \u2022 ~", formatBytes(estimatedSize)]
842
- })]
843
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronDown, {
844
- size: 16,
845
- color: macOSColors.text.muted
846
- })]
847
- })
848
- }), sizeWarningLevel !== "none" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
849
- style: {
850
- ...styles.sizeWarning,
851
- ...(sizeWarningLevel === "danger" ? styles.sizeWarningDanger : null)
852
- },
853
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(AlertTriangle, {
854
- size: 12,
855
- color: warningColor
856
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
857
- style: {
858
- ...styles.sizeWarningText,
859
- color: warningColor
860
- },
861
- children: sizeWarningLevel === "danger" ? "Very large payload - may cause performance issues" : "Large payload - preview may be slow"
862
- })]
863
- })]
864
- });
865
- }
866
-
867
- // Expanded state - show collapse button + actual content
868
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
869
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
870
- type: "button",
871
- style: styles.collapseButton,
872
- onClick: () => setIsPreviewExpanded(false),
873
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
874
- style: styles.collapseButtonText,
875
- children: "Hide Preview"
876
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronUp, {
877
- size: 14,
878
- color: macOSColors.text.secondary
879
- })]
880
- }), generateExpandedPreviewContent()]
881
- });
882
- };
883
-
884
- // Preview header actions (status label and Copy button)
885
- const statusLabel = hasLiveData && lastEventTimestamp ? `Live data • Updated ${formatRelativeTime(lastEventTimestamp, tick)}` : "Mock data (no events captured)";
886
-
887
- // Section configs — ids/labels/icons/colors verbatim from the native
888
- // `dynamicFilterConfig` memo.
889
- const presetOptions = [{
890
- id: "preset::urls",
891
- label: "URLs",
892
- icon: Link,
893
- color: macOSColors.semantic.info,
894
- value: "urls",
895
- isActive: activePreset === "urls"
896
- }, {
897
- id: "preset::llm",
898
- label: "LLM",
899
- icon: Zap,
900
- color: macOSColors.semantic.success,
901
- value: "llm",
902
- isActive: activePreset === "llm"
903
- }, {
904
- id: "preset::json",
905
- label: "JSON",
906
- icon: FileCode,
907
- color: macOSColors.semantic.warning,
908
- value: "json",
909
- isActive: activePreset === "json"
910
- }, {
911
- id: "preset::full",
912
- label: "Full",
913
- icon: FileText,
914
- color: macOSColors.semantic.info,
915
- value: "full",
916
- isActive: activePreset === "full"
917
- }, {
918
- id: "preset::custom",
919
- label: "Custom",
920
- icon: Settings,
921
- color: macOSColors.text.secondary,
922
- value: "custom",
923
- isActive: activePreset === null
924
- }];
925
- const includeOptions = [{
926
- id: "requestInfo::includeMethod",
927
- label: "URL",
928
- value: "includeMethod",
929
- isActive: settings.includeMethod
930
- }, {
931
- id: "requestInfo::includeStatus",
932
- label: "Status",
933
- value: "includeStatus",
934
- isActive: settings.includeStatus
935
- }, {
936
- id: "requestInfo::includeTimestamp",
937
- label: "Time",
938
- value: "includeTimestamp",
939
- isActive: settings.includeTimestamp
940
- }, {
941
- id: "headers::includeRequestHeaders",
942
- label: "Headers",
943
- value: "includeRequestHeaders",
944
- isActive: settings.includeRequestHeaders
945
- }, {
946
- id: "body::includeRequestBody",
947
- label: "Req Body",
948
- value: "includeRequestBody",
949
- isActive: settings.includeRequestBody
950
- }, {
951
- id: "body::includeResponseBody",
952
- label: "Res Body",
953
- value: "includeResponseBody",
954
- isActive: settings.includeResponseBody
955
- }, {
956
- id: "requestInfo::includeErrors",
957
- label: "Errors",
958
- value: "includeErrors",
959
- isActive: settings.includeErrors
960
- }];
961
- const formatOptions = [{
962
- id: "format::markdown",
963
- label: "Markdown",
964
- icon: FileText,
965
- color: macOSColors.semantic.info,
966
- value: "markdown",
967
- isActive: settings.format === "markdown"
968
- }, {
969
- id: "format::json",
970
- label: "JSON",
971
- icon: FileCode,
972
- color: macOSColors.semantic.warning,
973
- value: "json",
974
- isActive: settings.format === "json"
975
- }, {
976
- id: "format::plaintext",
977
- label: "Text",
978
- icon: Hash,
979
- color: macOSColors.text.secondary,
980
- value: "plaintext",
981
- isActive: settings.format === "plaintext"
982
- }];
983
-
984
- // The DynamicFilterView subtree for this config: sections, then PREVIEW.
985
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
986
- style: styles.container,
987
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
988
- style: styles.scrollContent,
989
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(FilterCardSection, {
990
- title: "Presets",
991
- options: presetOptions,
992
- onOptionPress: handleOptionChange
993
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(FilterCardSection, {
994
- title: "Include",
995
- options: includeOptions,
996
- onOptionPress: handleOptionChange
997
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(FilterCardSection, {
998
- title: "Format",
999
- options: formatOptions,
1000
- onOptionPress: handleOptionChange
1001
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1002
- style: styles.previewSection,
1003
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SectionHeaderRow, {
1004
- icon: Eye,
1005
- title: "PREVIEW",
1006
- actions: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
1007
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
1008
- style: styles.statusLabel,
1009
- children: statusLabel
1010
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DataViewer.CopyButton, {
1011
- value: generateCopyText(),
1012
- size: 14,
1013
- "aria-label": "Copy preview"
1014
- })]
1015
- })
1016
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1017
- style: styles.previewContent,
1018
- children: renderPreviewContent()
1019
- })]
1020
- })]
1021
- })
1022
- });
1023
- }
1024
-
1025
- // Values mirror the native StyleSheet blocks (NetworkCopySettingsView.tsx +
1026
- // DynamicFilterView.tsx + SectionHeader.tsx) 1:1.
1027
- const styles = {
1028
- // DynamicFilterView `container` + `scrollContent`.
1029
- container: {
1030
- display: "flex",
1031
- flexDirection: "column",
1032
- flex: 1,
1033
- minHeight: 0,
1034
- backgroundColor: buoyColors.base,
1035
- overflowY: "auto"
1036
- },
1037
- scrollContent: {
1038
- padding: "16px 16px 24px"
1039
- },
1040
- // DynamicFilterView `section` + `filterGrid` + cards.
1041
- section: {
1042
- marginBottom: 8
1043
- },
1044
- filterGrid: {
1045
- display: "flex",
1046
- flexDirection: "row",
1047
- flexWrap: "wrap",
1048
- gap: 8,
1049
- marginTop: 8
1050
- },
1051
- filterCard: {
1052
- display: "flex",
1053
- backgroundColor: buoyColors.card,
1054
- borderRadius: 12,
1055
- padding: "10px 8px",
1056
- flexDirection: "column",
1057
- alignItems: "center",
1058
- justifyContent: "center",
1059
- border: `1px solid ${buoyColors.border}`,
1060
- width: 72,
1061
- minHeight: 68,
1062
- boxSizing: "border-box",
1063
- cursor: "pointer",
1064
- margin: 0,
1065
- fontFamily: "inherit",
1066
- gap: 0
1067
- },
1068
- activeFilterCard: {
1069
- backgroundColor: `${buoyColors.primary}33`,
1070
- border: `2px solid ${buoyColors.primary}`,
1071
- // Native: shadowColor primary, opacity 0.3, radius 8.
1072
- boxShadow: `0 0 8px ${buoyColors.primary}4D`
1073
- },
1074
- filterLabelCompact: {
1075
- fontSize: 10,
1076
- color: buoyColors.text,
1077
- fontWeight: 600,
1078
- textAlign: "center",
1079
- textTransform: "capitalize",
1080
- // Native textShadow 0/0.5/1 @ 0.3 black.
1081
- textShadow: "0 0.5px 1px rgba(0, 0, 0, 0.3)",
1082
- marginTop: 3
1083
- },
1084
- // SectionHeader.tsx values.
1085
- sectionHeader: {
1086
- display: "flex",
1087
- flexDirection: "row",
1088
- alignItems: "center",
1089
- padding: "8px 16px",
1090
- backgroundColor: buoyColors.base,
1091
- minHeight: 40,
1092
- boxSizing: "border-box"
1093
- },
1094
- sectionHeaderIcon: {
1095
- display: "inline-flex",
1096
- marginRight: 8
1097
- },
1098
- sectionHeaderTitle: {
1099
- flex: 1,
1100
- minWidth: 0,
1101
- fontSize: 14,
1102
- fontWeight: 600,
1103
- color: buoyColors.text,
1104
- whiteSpace: "nowrap",
1105
- overflow: "hidden",
1106
- textOverflow: "ellipsis",
1107
- textAlign: "left"
1108
- },
1109
- sectionHeaderActions: {
1110
- display: "inline-flex",
1111
- flexDirection: "row",
1112
- alignItems: "center",
1113
- gap: 8,
1114
- marginLeft: "auto"
1115
- },
1116
- // DynamicFilterView `previewSection`/`previewContent`.
1117
- previewSection: {
1118
- backgroundColor: buoyColors.hover,
1119
- borderRadius: 16,
1120
- border: `1px solid ${buoyColors.borderStrong}`,
1121
- marginTop: 16,
1122
- overflow: "hidden"
1123
- },
1124
- previewContent: {
1125
- padding: "12px 16px 16px",
1126
- backgroundColor: buoyColors.base,
1127
- margin: "0 12px 12px",
1128
- borderRadius: 8,
1129
- border: `1px solid ${buoyColors.border}`
1130
- },
1131
- // NetworkCopySettingsView.tsx values.
1132
- previewScroll: {
1133
- maxHeight: 300,
1134
- overflowY: "auto"
1135
- },
1136
- markdownText: {
1137
- fontFamily: "ui-monospace, Menlo, monospace",
1138
- fontSize: 11,
1139
- color: macOSColors.text.primary,
1140
- lineHeight: "18px",
1141
- whiteSpace: "pre-wrap",
1142
- wordBreak: "break-word",
1143
- userSelect: "text"
1144
- },
1145
- plaintextText: {
1146
- fontFamily: "ui-monospace, Menlo, monospace",
1147
- fontSize: 11,
1148
- color: macOSColors.text.primary,
1149
- lineHeight: "18px",
1150
- whiteSpace: "pre-wrap",
1151
- wordBreak: "break-word",
1152
- userSelect: "text"
1153
- },
1154
- statusLabel: {
1155
- fontSize: 11,
1156
- fontWeight: 600,
1157
- color: macOSColors.text.muted,
1158
- marginRight: 8
1159
- },
1160
- // Collapsible preview styles
1161
- collapsedPreview: {
1162
- display: "flex",
1163
- flexDirection: "column",
1164
- gap: 8
1165
- },
1166
- expandButton: {
1167
- display: "block",
1168
- width: "100%",
1169
- boxSizing: "border-box",
1170
- backgroundColor: macOSColors.background.input,
1171
- borderRadius: 8,
1172
- border: `1px solid ${macOSColors.border.default}`,
1173
- padding: 12,
1174
- cursor: "pointer",
1175
- margin: 0,
1176
- fontFamily: "inherit",
1177
- textAlign: "left"
1178
- },
1179
- expandButtonContent: {
1180
- display: "flex",
1181
- flexDirection: "row",
1182
- alignItems: "center",
1183
- gap: 10
1184
- },
1185
- expandButtonTextContainer: {
1186
- display: "flex",
1187
- flexDirection: "column",
1188
- flex: 1,
1189
- minWidth: 0
1190
- },
1191
- expandButtonTitle: {
1192
- fontSize: 13,
1193
- fontWeight: 600,
1194
- color: macOSColors.text.primary
1195
- },
1196
- expandButtonSubtitle: {
1197
- fontSize: 11,
1198
- color: macOSColors.text.secondary,
1199
- marginTop: 2
1200
- },
1201
- collapseButton: {
1202
- display: "flex",
1203
- width: "100%",
1204
- boxSizing: "border-box",
1205
- flexDirection: "row",
1206
- alignItems: "center",
1207
- justifyContent: "center",
1208
- gap: 6,
1209
- padding: "8px 0",
1210
- margin: "0 0 8px",
1211
- backgroundColor: macOSColors.background.hover,
1212
- borderRadius: 6,
1213
- border: `1px solid ${macOSColors.border.default}`,
1214
- cursor: "pointer",
1215
- fontFamily: "inherit"
1216
- },
1217
- collapseButtonText: {
1218
- fontSize: 12,
1219
- fontWeight: 500,
1220
- color: macOSColors.text.secondary
1221
- },
1222
- sizeWarning: {
1223
- display: "flex",
1224
- flexDirection: "row",
1225
- alignItems: "center",
1226
- gap: 6,
1227
- padding: "6px 10px",
1228
- backgroundColor: macOSColors.semantic.warningBackground,
1229
- borderRadius: 6,
1230
- border: `1px solid ${macOSColors.semantic.warning}30`
1231
- },
1232
- sizeWarningDanger: {
1233
- backgroundColor: macOSColors.semantic.errorBackground,
1234
- border: `1px solid ${macOSColors.semantic.error}30`
1235
- },
1236
- sizeWarningText: {
1237
- fontSize: 11,
1238
- fontWeight: 500,
1239
- flex: 1,
1240
- textAlign: "left"
1241
- }
1242
- };
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.DEFAULT_COPY_SETTINGS=void 0;exports.NetworkCopySettingsView=NetworkCopySettingsView;var _react=require("react");var _DataViewer=require("./DataViewer.web");var _jsxRuntime=require("react/jsx-runtime");const DEFAULT_COPY_SETTINGS=exports.DEFAULT_COPY_SETTINGS={includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:10,format:"markdown",filterMode:"all"};const buoyColors={base:"#121212",card:"#1A1A1A",hover:"#242424",border:"#333333",borderStrong:"#444444",text:"#E0E0E0",primary:"#20C997"};const macOSColors={background:{input:"#26262A",hover:"#1D1D1F"},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"}};function Svg({size:e=14,color:r="currentColor",children:s}){return(0,_jsxRuntime.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,display:"block"},children:s})}const FileText=e=>(0,_jsxRuntime.jsxs)(Svg,{...e,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 9H8"}),(0,_jsxRuntime.jsx)("path",{d:"M16 13H8"}),(0,_jsxRuntime.jsx)("path",{d:"M16 17H8"})]});const FileCode=e=>(0,_jsxRuntime.jsxs)(Svg,{...e,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 12.5 8 15l2 2.5"}),(0,_jsxRuntime.jsx)("path",{d:"m14 12.5 2 2.5-2 2.5"})]});const Link=e=>(0,_jsxRuntime.jsxs)(Svg,{...e,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 Zap=e=>(0,_jsxRuntime.jsx)(Svg,{...e,children:(0,_jsxRuntime.jsx)("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})});const Settings=e=>(0,_jsxRuntime.jsxs)(Svg,{...e,children:[(0,_jsxRuntime.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,_jsxRuntime.jsx)("circle",{cx:"12",cy:"12",r:"3"})]});const Hash=e=>(0,_jsxRuntime.jsxs)(Svg,{...e,children:[(0,_jsxRuntime.jsx)("line",{x1:"4",x2:"20",y1:"9",y2:"9"}),(0,_jsxRuntime.jsx)("line",{x1:"4",x2:"20",y1:"15",y2:"15"}),(0,_jsxRuntime.jsx)("line",{x1:"10",x2:"8",y1:"3",y2:"21"}),(0,_jsxRuntime.jsx)("line",{x1:"16",x2:"14",y1:"3",y2:"21"})]});const Eye=e=>(0,_jsxRuntime.jsxs)(Svg,{...e,children:[(0,_jsxRuntime.jsx)("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),(0,_jsxRuntime.jsx)("circle",{cx:"12",cy:"12",r:"3"})]});const ChevronDown=e=>(0,_jsxRuntime.jsx)(Svg,{...e,children:(0,_jsxRuntime.jsx)("path",{d:"m6 9 6 6 6-6"})});const ChevronUp=e=>(0,_jsxRuntime.jsx)(Svg,{...e,children:(0,_jsxRuntime.jsx)("path",{d:"m18 15-6-6-6 6"})});const AlertTriangle=e=>(0,_jsxRuntime.jsxs)(Svg,{...e,children:[(0,_jsxRuntime.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),(0,_jsxRuntime.jsx)("path",{d:"M12 9v4"}),(0,_jsxRuntime.jsx)("path",{d:"M12 17h.01"})]});const tickListeners=new Set;let tickInterval=null;function subscribeTick(e){tickListeners.add(e);if(tickInterval==null){tickInterval=setInterval(()=>{const r=Date.now();tickListeners.forEach(s=>s(r))},5e3)}return()=>{tickListeners.delete(e);if(tickListeners.size===0&&tickInterval!=null){clearInterval(tickInterval);tickInterval=null}}}function useSharedTick(){const[e,r]=(0,_react.useState)(()=>Date.now());(0,_react.useEffect)(()=>subscribeTick(r),[]);return e}function formatRelativeTime(e,r=Date.now()){const s=e instanceof Date?e.getTime():e;const l=Math.floor((r-s)/1e3);if(l<0){return"just now"}if(l<60){return l===0?"just now":`${l}s ago`}const x=Math.floor(l/60);if(x<60){return`${x}m ago`}const h=Math.floor(x/60);if(h<24){return`${h}h ago`}const B=Math.floor(h/24);return`${B}d ago`}const PRESET_CONFIGS={urls:{includeMethod:true,includeStatus:false,includeDuration:false,includeTimestamp:false,includeClient:false,includeSizes:false,includeErrors:false,includeRequestHeaders:false,includeResponseHeaders:false,includeRequestBody:false,includeResponseBody:false,bodySizeThreshold:10,format:"plaintext",filterMode:"all"},llm:{includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:10,format:"markdown",filterMode:"all"},json:{includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:-1,format:"json",filterMode:"all"},full:{includeMethod:true,includeStatus:true,includeDuration:true,includeTimestamp:true,includeClient:true,includeSizes:true,includeErrors:true,includeRequestHeaders:true,includeResponseHeaders:true,includeRequestBody:true,includeResponseBody:true,bodySizeThreshold:-1,format:"markdown",filterMode:"all"}};function detectActivePreset(e){for(const[r,s]of Object.entries(PRESET_CONFIGS)){const l=Object.keys(s).every(x=>s[x]===e[x]);if(l)return r}return null}const SIZE_WARNING_THRESHOLD=100*1024;const SIZE_DANGER_THRESHOLD=500*1024;function formatBytes(e){if(e<1024)return`${e} B`;if(e<1024*1024)return`${(e/1024).toFixed(1)} KB`;return`${(e/(1024*1024)).toFixed(1)} MB`}function SectionHeaderRow({icon:e,iconColor:r,title:s,actions:l}){return(0,_jsxRuntime.jsxs)("div",{style:styles.sectionHeader,children:[e?(0,_jsxRuntime.jsx)("span",{style:styles.sectionHeaderIcon,children:(0,_jsxRuntime.jsx)(e,{size:12,color:r??buoyColors.primary})}):null,(0,_jsxRuntime.jsx)("span",{style:styles.sectionHeaderTitle,children:s}),l?(0,_jsxRuntime.jsx)("span",{style:styles.sectionHeaderActions,children:l}):null]})}function FilterCardSection({title:e,options:r,onOptionPress:s}){return(0,_jsxRuntime.jsxs)("div",{style:styles.section,children:[(0,_jsxRuntime.jsx)(SectionHeaderRow,{title:e}),(0,_jsxRuntime.jsx)("div",{style:styles.filterGrid,children:r.map(l=>{const x=l.icon;return(0,_jsxRuntime.jsxs)("button",{type:"button",onClick:()=>s(l.id,l.value),style:{...styles.filterCard,...l.isActive?styles.activeFilterCard:null},children:[x?(0,_jsxRuntime.jsx)(x,{size:24,color:l.color}):null,(0,_jsxRuntime.jsx)("span",{style:styles.filterLabelCompact,children:l.label})]},l.id)})})]})}function NetworkCopySettingsView({settings:e,onSettingsChange:r,events:s=[]}){const l=true;const x=useSharedTick();const[h,B]=(0,_react.useState)(false);const m=s.length>0;const C=(0,_react.useMemo)(()=>{if(!m)return null;const u=s.map(o=>typeof o.timestamp==="number"?o.timestamp:new Date(o.timestamp).getTime());return Math.max(...u)},[s,m]);const b=(0,_react.useMemo)(()=>detectActivePreset(e),[e]);const H=(0,_react.useCallback)(()=>{r(PRESET_CONFIGS.urls)},[r]);const v=(0,_react.useCallback)(()=>{r(PRESET_CONFIGS.llm)},[r]);const M=(0,_react.useCallback)(()=>{r(PRESET_CONFIGS.json)},[r]);const z=(0,_react.useCallback)(()=>{r(PRESET_CONFIGS.full)},[r]);const R=(0,_react.useCallback)((u,o)=>{const[n,a]=u.split("::");if(n==="preset"){switch(a){case"urls":H();break;case"llm":v();break;case"json":M();break;case"full":z();break}return}if(n==="requestInfo"){r({...e,[a]:!e[a]});return}if(n==="headers"){r({...e,[a]:!e[a]});return}if(n==="body"){if(a==="bodySizeThreshold"){r({...e,bodySizeThreshold:o})}else{r({...e,[a]:!e[a]})}return}if(n==="format"){r({...e,format:o});return}if(n==="filter"){r({...e,filterMode:o})}},[e,r,H,v,M,z]);const y=(0,_react.useMemo)(()=>({method:"POST",url:"https://api.example.com/v1/users",status:201,duration:342,timestamp:new Date().toISOString(),requestHeaders:{"Content-Type":"application/json",Authorization:"Bearer ***"},responseHeaders:{"Content-Type":"application/json","X-Request-ID":"abc123"},requestBody:{name:"John Doe",email:"john@example.com"},responseBody:{id:"user_123",name:"John Doe",email:"john@example.com",createdAt:"2025-01-10T12:00:00Z"}}),[]);const g=(0,_react.useMemo)(()=>{const u=m?s:[y];let o=0;for(const n of u){if(e.includeMethod){o+=(n.url?.length||0)+10}if(e.includeStatus){o+=30}if(e.includeTimestamp){o+=30}if(e.includeRequestHeaders){try{o+=JSON.stringify(n.requestHeaders||{}).length}catch{o+=100}}if(e.includeRequestBody){const a="requestBody"in n?n.requestBody:n.requestData;try{o+=JSON.stringify(a||{}).length}catch{o+=100}}if(e.includeResponseBody){const a="responseBody"in n?n.responseBody:n.responseData;try{o+=JSON.stringify(a||{}).length}catch{o+=100}}}return o},[m,s,y,e]);const j=(0,_react.useMemo)(()=>{if(g>=SIZE_DANGER_THRESHOLD)return"danger";if(g>=SIZE_WARNING_THRESHOLD)return"warning";return"none"},[g]);const T=(0,_react.useCallback)(()=>{const u=m?s:[y];const{format:o,includeMethod:n,includeStatus:a,includeTimestamp:d,includeRequestHeaders:c,includeRequestBody:q,includeResponseBody:k}=e;const P=t=>{const i={};if(n){i.method=t.method;i.url=t.url}if(a){i.status=t.status;i.duration=t.duration}if(d){i.timestamp=t.timestamp}if(c){i.requestHeaders=t.requestHeaders}if(q){i.requestBody="requestBody"in t?t.requestBody:t.requestData}if(k){i.responseBody="responseBody"in t?t.responseBody:t.responseData}return i};if(o==="json"){const t=u.map(P);return JSON.stringify(t,null,2)}if(o==="markdown"){const t=u.map((i,p)=>{const f=[];f.push(`# Request ${p+1}`);if(n){f.push(`
2
+ **${i.method}** ${i.url}`)}const w=[];if(a){w.push(`**Status:** ${i.status}`);w.push(`**Duration:** ${i.duration}ms`)}if(d){w.push(`**Timestamp:** ${i.timestamp}`)}if(w.length>0){f.push("\n"+w.join("\n"))}if(c){const S=i.requestHeaders||{};f.push(`
3
+ ## Request Headers
4
+ \`\`\`json
5
+ ${JSON.stringify(S,null,2)}
6
+ \`\`\``)}if(q){const S="requestBody"in i?i.requestBody:i.requestData;f.push(`
7
+ ## Request Body
8
+ \`\`\`json
9
+ ${JSON.stringify(S||{},null,2)}
10
+ \`\`\``)}if(k){const S="responseBody"in i?i.responseBody:i.responseData;f.push(`
11
+ ## Response Body
12
+ \`\`\`json
13
+ ${JSON.stringify(S||{},null,2)}
14
+ \`\`\``)}return f.join("\n")});return t.join("\n\n---\n\n")||"No data included"}const L=u.map((t,i)=>{const p=[];p.push(`Request ${i+1}:`);if(n){p.push(`${t.method} ${t.url}`)}if(a){p.push(`Status: ${t.status}`);p.push(`Duration: ${t.duration}ms`)}if(d){p.push(`Timestamp: ${t.timestamp}`)}if(q){const f="requestBody"in t?t.requestBody:t.requestData;p.push("\nRequest:");p.push(JSON.stringify(f||{},null,2))}if(k){const f="responseBody"in t?t.responseBody:t.responseData;p.push("\nResponse:");p.push(JSON.stringify(f||{},null,2))}return p.join("\n")});return L.join("\n\n---\n\n")||"No data included"},[m,s,y,e]);const A=(0,_react.useCallback)(()=>{if(e.format==="json"){const o=m?s:[y];const n=d=>{const c={};if(e.includeMethod){c.method=d.method;c.url=d.url}if(e.includeStatus){c.status=d.status;c.duration=d.duration}if(e.includeTimestamp){c.timestamp=d.timestamp}if(e.includeRequestHeaders){c.requestHeaders=d.requestHeaders}if(e.includeRequestBody){c.requestBody="requestBody"in d?d.requestBody:d.requestData}if(e.includeResponseBody){c.responseBody="responseBody"in d?d.responseBody:d.responseData}return c};const a=o.map(n);return(0,_jsxRuntime.jsx)(_DataViewer.DataViewer,{data:a,title:"",showTypeFilter:false})}const u=T();return(0,_jsxRuntime.jsx)("div",{style:styles.previewScroll,children:(0,_jsxRuntime.jsx)("div",{style:{...e.format==="markdown"?styles.markdownText:styles.plaintextText,userSelect:l?"text":"none"},children:u||"No data included"})})},[e,m,s,y,T,l]);const E=()=>{const u=m?s:[y];const o=u.length;if(!h){const n=j==="danger"?macOSColors.semantic.error:j==="warning"?macOSColors.semantic.warning:macOSColors.text.secondary;return(0,_jsxRuntime.jsxs)("div",{style:styles.collapsedPreview,children:[(0,_jsxRuntime.jsx)("button",{type:"button",style:styles.expandButton,onClick:()=>B(true),children:(0,_jsxRuntime.jsxs)("span",{style:styles.expandButtonContent,children:[(0,_jsxRuntime.jsx)(Eye,{size:16,color:macOSColors.semantic.info}),(0,_jsxRuntime.jsxs)("span",{style:styles.expandButtonTextContainer,children:[(0,_jsxRuntime.jsx)("span",{style:styles.expandButtonTitle,children:"Show Preview"}),(0,_jsxRuntime.jsxs)("span",{style:styles.expandButtonSubtitle,children:[o," request",o!==1?"s":""," \u2022 ~",formatBytes(g)]})]}),(0,_jsxRuntime.jsx)(ChevronDown,{size:16,color:macOSColors.text.muted})]})}),j!=="none"&&(0,_jsxRuntime.jsxs)("div",{style:{...styles.sizeWarning,...j==="danger"?styles.sizeWarningDanger:null},children:[(0,_jsxRuntime.jsx)(AlertTriangle,{size:12,color:n}),(0,_jsxRuntime.jsx)("span",{style:{...styles.sizeWarningText,color:n},children:j==="danger"?"Very large payload - may cause performance issues":"Large payload - preview may be slow"})]})]})}return(0,_jsxRuntime.jsxs)("div",{children:[(0,_jsxRuntime.jsxs)("button",{type:"button",style:styles.collapseButton,onClick:()=>B(false),children:[(0,_jsxRuntime.jsx)("span",{style:styles.collapseButtonText,children:"Hide Preview"}),(0,_jsxRuntime.jsx)(ChevronUp,{size:14,color:macOSColors.text.secondary})]}),A()]})};const F=m&&C?`Live data \u2022 Updated ${formatRelativeTime(C,x)}`:"Mock data (no events captured)";const $=[{id:"preset::urls",label:"URLs",icon:Link,color:macOSColors.semantic.info,value:"urls",isActive:b==="urls"},{id:"preset::llm",label:"LLM",icon:Zap,color:macOSColors.semantic.success,value:"llm",isActive:b==="llm"},{id:"preset::json",label:"JSON",icon:FileCode,color:macOSColors.semantic.warning,value:"json",isActive:b==="json"},{id:"preset::full",label:"Full",icon:FileText,color:macOSColors.semantic.info,value:"full",isActive:b==="full"},{id:"preset::custom",label:"Custom",icon:Settings,color:macOSColors.text.secondary,value:"custom",isActive:b===null}];const O=[{id:"requestInfo::includeMethod",label:"URL",value:"includeMethod",isActive:e.includeMethod},{id:"requestInfo::includeStatus",label:"Status",value:"includeStatus",isActive:e.includeStatus},{id:"requestInfo::includeTimestamp",label:"Time",value:"includeTimestamp",isActive:e.includeTimestamp},{id:"headers::includeRequestHeaders",label:"Headers",value:"includeRequestHeaders",isActive:e.includeRequestHeaders},{id:"body::includeRequestBody",label:"Req Body",value:"includeRequestBody",isActive:e.includeRequestBody},{id:"body::includeResponseBody",label:"Res Body",value:"includeResponseBody",isActive:e.includeResponseBody},{id:"requestInfo::includeErrors",label:"Errors",value:"includeErrors",isActive:e.includeErrors}];const I=[{id:"format::markdown",label:"Markdown",icon:FileText,color:macOSColors.semantic.info,value:"markdown",isActive:e.format==="markdown"},{id:"format::json",label:"JSON",icon:FileCode,color:macOSColors.semantic.warning,value:"json",isActive:e.format==="json"},{id:"format::plaintext",label:"Text",icon:Hash,color:macOSColors.text.secondary,value:"plaintext",isActive:e.format==="plaintext"}];return(0,_jsxRuntime.jsx)("div",{style:styles.container,children:(0,_jsxRuntime.jsxs)("div",{style:styles.scrollContent,children:[(0,_jsxRuntime.jsx)(FilterCardSection,{title:"Presets",options:$,onOptionPress:R}),(0,_jsxRuntime.jsx)(FilterCardSection,{title:"Include",options:O,onOptionPress:R}),(0,_jsxRuntime.jsx)(FilterCardSection,{title:"Format",options:I,onOptionPress:R}),(0,_jsxRuntime.jsxs)("div",{style:styles.previewSection,children:[(0,_jsxRuntime.jsx)(SectionHeaderRow,{icon:Eye,title:"PREVIEW",actions:(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)("span",{style:styles.statusLabel,children:F}),(0,_jsxRuntime.jsx)(_DataViewer.CopyButton,{value:T(),size:14,"aria-label":"Copy preview"})]})}),(0,_jsxRuntime.jsx)("div",{style:styles.previewContent,children:E()})]})]})})}const styles={container:{display:"flex",flexDirection:"column",flex:1,minHeight:0,backgroundColor:buoyColors.base,overflowY:"auto"},scrollContent:{padding:"16px 16px 24px"},section:{marginBottom:8},filterGrid:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:8},filterCard:{display:"flex",backgroundColor:buoyColors.card,borderRadius:12,padding:"10px 8px",flexDirection:"column",alignItems:"center",justifyContent:"center",border:`1px solid ${buoyColors.border}`,width:72,minHeight:68,boxSizing:"border-box",cursor:"pointer",margin:0,fontFamily:"inherit",gap:0},activeFilterCard:{backgroundColor:`${buoyColors.primary}33`,border:`2px solid ${buoyColors.primary}`,boxShadow:`0 0 8px ${buoyColors.primary}4D`},filterLabelCompact:{fontSize:10,color:buoyColors.text,fontWeight:600,textAlign:"center",textTransform:"capitalize",textShadow:"0 0.5px 1px rgba(0, 0, 0, 0.3)",marginTop:3},sectionHeader:{display:"flex",flexDirection:"row",alignItems:"center",padding:"8px 16px",backgroundColor:buoyColors.base,minHeight:40,boxSizing:"border-box"},sectionHeaderIcon:{display:"inline-flex",marginRight:8},sectionHeaderTitle:{flex:1,minWidth:0,fontSize:14,fontWeight:600,color:buoyColors.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:"left"},sectionHeaderActions:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:8,marginLeft:"auto"},previewSection:{backgroundColor:buoyColors.hover,borderRadius:16,border:`1px solid ${buoyColors.borderStrong}`,marginTop:16,overflow:"hidden"},previewContent:{padding:"12px 16px 16px",backgroundColor:buoyColors.base,margin:"0 12px 12px",borderRadius:8,border:`1px solid ${buoyColors.border}`},previewScroll:{maxHeight:300,overflowY:"auto"},markdownText:{fontFamily:"ui-monospace, Menlo, monospace",fontSize:11,color:macOSColors.text.primary,lineHeight:"18px",whiteSpace:"pre-wrap",wordBreak:"break-word",userSelect:"text"},plaintextText:{fontFamily:"ui-monospace, Menlo, monospace",fontSize:11,color:macOSColors.text.primary,lineHeight:"18px",whiteSpace:"pre-wrap",wordBreak:"break-word",userSelect:"text"},statusLabel:{fontSize:11,fontWeight:600,color:macOSColors.text.muted,marginRight:8},collapsedPreview:{display:"flex",flexDirection:"column",gap:8},expandButton:{display:"block",width:"100%",boxSizing:"border-box",backgroundColor:macOSColors.background.input,borderRadius:8,border:`1px solid ${macOSColors.border.default}`,padding:12,cursor:"pointer",margin:0,fontFamily:"inherit",textAlign:"left"},expandButtonContent:{display:"flex",flexDirection:"row",alignItems:"center",gap:10},expandButtonTextContainer:{display:"flex",flexDirection:"column",flex:1,minWidth:0},expandButtonTitle:{fontSize:13,fontWeight:600,color:macOSColors.text.primary},expandButtonSubtitle:{fontSize:11,color:macOSColors.text.secondary,marginTop:2},collapseButton:{display:"flex",width:"100%",boxSizing:"border-box",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 0",margin:"0 0 8px",backgroundColor:macOSColors.background.hover,borderRadius:6,border:`1px solid ${macOSColors.border.default}`,cursor:"pointer",fontFamily:"inherit"},collapseButtonText:{fontSize:12,fontWeight:500,color:macOSColors.text.secondary},sizeWarning:{display:"flex",flexDirection:"row",alignItems:"center",gap:6,padding:"6px 10px",backgroundColor:macOSColors.semantic.warningBackground,borderRadius:6,border:`1px solid ${macOSColors.semantic.warning}30`},sizeWarningDanger:{backgroundColor:macOSColors.semantic.errorBackground,border:`1px solid ${macOSColors.semantic.error}30`},sizeWarningText:{fontSize:11,fontWeight:500,flex:1,textAlign:"left"}};