@p4code/cli 0.8.35 → 0.8.37

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 (263) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-26z5sNBT.mjs → binCli-mInzhqSL.mjs} +5 -5
  3. package/dist/client/.vite/manifest.json +2031 -2031
  4. package/dist/client/assets/{2NI2N5EU-BLnY4aCF.js → 2NI2N5EU-DVsZziQ3.js} +2 -2
  5. package/dist/client/assets/{4UO7MD6I-BApNVkfU.js → 4UO7MD6I-Cs3yBe-m.js} +2 -2
  6. package/dist/client/assets/{5B3SVYGG-Y7V7NdZO.js → 5B3SVYGG-CxW0L1iX.js} +2 -2
  7. package/dist/client/assets/{5GK6JWQ2-BSIhKcw-.js → 5GK6JWQ2-Cb25PEnx.js} +2 -2
  8. package/dist/client/assets/{5N7A7DKN-CNUCnWLs.js → 5N7A7DKN-udLyT643.js} +2 -2
  9. package/dist/client/assets/{5OC2THR4-Bne-pf_A.js → 5OC2THR4-DqD-reis.js} +2 -2
  10. package/dist/client/assets/{5S6HY5KT-7d4UMONz.js → 5S6HY5KT-Cy7mIKKq.js} +2 -2
  11. package/dist/client/assets/{6IMQ5BUJ-BWW19n-D.js → 6IMQ5BUJ-Qu9PVsT7.js} +2 -2
  12. package/dist/client/assets/{6OLKWJ4F-CxTUuvA6.js → 6OLKWJ4F-BYzZS9mf.js} +2 -2
  13. package/dist/client/assets/{74OO7NKP-DByVTRKE.js → 74OO7NKP-h3ga2-vb.js} +2 -2
  14. package/dist/client/assets/{75O6YZUN-CZanyedf.js → 75O6YZUN-ByAK3P56.js} +2 -2
  15. package/dist/client/assets/{77XECAW3-TL2w7pHK.js → 77XECAW3-D_lZqaZv.js} +2 -2
  16. package/dist/client/assets/{ABYRPUBD-CJboH7Uz.js → ABYRPUBD-BPWfXZyu.js} +2 -2
  17. package/dist/client/assets/AlertDialogRoot-BSP6M0Mu.js +2 -0
  18. package/dist/client/assets/{AnimatedHeight-OxEbW01v.js → AnimatedHeight-D0-6CAPr.js} +2 -2
  19. package/dist/client/assets/{AuthSurfaceShell-KQXgPV4i.js → AuthSurfaceShell-30QvY1bI.js} +2 -2
  20. package/dist/client/assets/{BB2UYUI2-BxW-R2h1.js → BB2UYUI2-CGgafKC2.js} +2 -2
  21. package/dist/client/assets/{BUM34MOA-ngG-irUy.js → BUM34MOA-Cn4iaSBT.js} +2 -2
  22. package/dist/client/assets/{CEQABKGZ-C-u-W0bS.js → CEQABKGZ-CmBEfzh3.js} +2 -2
  23. package/dist/client/assets/{CXAC5362-DfFRkI7L.js → CXAC5362-xibpmz3Y.js} +2 -2
  24. package/dist/client/assets/{ChatGptUsageButton-C3KgGt4z.js → ChatGptUsageButton-DU3PVHJW.js} +2 -2
  25. package/dist/client/assets/{ChatMarkdown-9gWM0ED9.js → ChatMarkdown-D-cNSjFn.js} +5 -5
  26. package/dist/client/assets/{CheckboxIndicator-DbU3csPQ.js → CheckboxIndicator-CZCy38xt.js} +2 -2
  27. package/dist/client/assets/{ClippedText-CS_BYNco.js → ClippedText-D_rM_XDj.js} +2 -2
  28. package/dist/client/assets/{CodexSetupSection.logic-CNbTXxKb.js → CodexSetupSection.logic-g6_GE4bw.js} +2 -2
  29. package/dist/client/assets/{ComboboxClear-Bn_kslrf.js → ComboboxClear-tOmMpuVi.js} +2 -2
  30. package/dist/client/assets/{ComboboxGroupLabel-fL8lMA25.js → ComboboxGroupLabel-CgZZIHwV.js} +2 -2
  31. package/dist/client/assets/{CommandBlock-DcQXu_lq.js → CommandBlock-6rjypfVF.js} +2 -2
  32. package/dist/client/assets/{ComposerPromptEditor-DQ9wFfKn.js → ComposerPromptEditor-Dxfhec2W.js} +4 -4
  33. package/dist/client/assets/{CompositeRoot-BuwzXGHT.js → CompositeRoot-Bsb8efI6.js} +2 -2
  34. package/dist/client/assets/{ConnectionDiagnosisDetails-DGbJY7Hw.js → ConnectionDiagnosisDetails-Q0M5gCCf.js} +2 -2
  35. package/dist/client/assets/{ConnectionStatusDot-CixsTBXI.js → ConnectionStatusDot-DAuD0jkU.js} +2 -2
  36. package/dist/client/assets/{DRLTVNUE-Cbb71R0Y.js → DRLTVNUE-BVseXOzv.js} +2 -2
  37. package/dist/client/assets/{DYY6UVD2-BZn5fuF5.js → DYY6UVD2-Bz33D3dq.js} +2 -2
  38. package/dist/client/assets/{DevicePanel-JP__PY1s.js → DevicePanel-CsSQr7vQ.js} +2 -2
  39. package/dist/client/assets/{DeviceSetup-D8qb_qBj.js → DeviceSetup-Cl7L9wsi.js} +2 -2
  40. package/dist/client/assets/{DialogTitle-B_9LEmy3.js → DialogTitle-bcvBtKP-.js} +2 -2
  41. package/dist/client/assets/{DiffCommentAnnotation-WMKzOwCh.js → DiffCommentAnnotation-bhzNqujM.js} +2 -2
  42. package/dist/client/assets/{DiffFileTree-BSbsOOmA.js → DiffFileTree-BySeJqhq.js} +2 -2
  43. package/dist/client/assets/{DiffPanel-BWFuiHvv.js → DiffPanel-CCFas4eA.js} +2 -2
  44. package/dist/client/assets/{DiffWorkerPoolProvider-BBk0lIX3.js → DiffWorkerPoolProvider-CkkqWbz-.js} +2 -2
  45. package/dist/client/assets/{EmbeddedDesign-D5YUndkh.js → EmbeddedDesign-iuThcPT3.js} +2 -2
  46. package/dist/client/assets/{EnvironmentMachineIcon-Dpgx67FY.js → EnvironmentMachineIcon-iUmoTUYt.js} +2 -2
  47. package/dist/client/assets/{ExpandableText-Cpm1gOKG.js → ExpandableText-ByCx68yv.js} +2 -2
  48. package/dist/client/assets/{FNOVOB4O-BkEIrB0k.js → FNOVOB4O-DK3iet1g.js} +2 -2
  49. package/dist/client/assets/{FieldControl-BHe6unoZ.js → FieldControl-DtsEariK.js} +2 -2
  50. package/dist/client/assets/{FileDiff-C1vAOUga.js → FileDiff-Bu2BSqBV.js} +2 -2
  51. package/dist/client/assets/{FilePreviewPanel-CbpNevZP.js → FilePreviewPanel-8cI8gciT.js} +2 -2
  52. package/dist/client/assets/{FoldedSettingsSection-DySTg20x.js → FoldedSettingsSection-RYq8GTvV.js} +2 -2
  53. package/dist/client/assets/{FormContext-CmvUzTS-.js → FormContext-CIK8MKa2.js} +2 -2
  54. package/dist/client/assets/{HDGCDEEZ-CN-ckGDk.js → HDGCDEEZ-B_J1N6RY.js} +2 -2
  55. package/dist/client/assets/{HSJLKHB7-B0BvmnZE.js → HSJLKHB7-B2SbZQUf.js} +2 -2
  56. package/dist/client/assets/{Icons-B4l3TqYa.js → Icons-xsXA_L6w.js} +2 -2
  57. package/dist/client/assets/Input-D3Qi4jCN.js +2 -0
  58. package/dist/client/assets/JZOYTAAL-BlxFvoz4.js +1 -0
  59. package/dist/client/assets/{K3MD6TGW-IS0rWO1U.js → K3MD6TGW-VU68yYxr.js} +2 -2
  60. package/dist/client/assets/{K7RP3OMA-DcqjCOJO.js → K7RP3OMA-zaD_NBVC.js} +2 -2
  61. package/dist/client/assets/{KeybindingsSettings.logic-mF9mJWrc.js → KeybindingsSettings.logic-BJe27xmi.js} +2 -2
  62. package/dist/client/assets/{LHDIQX7Q-CLMgIt4Y.js → LHDIQX7Q-DCLqoRGy.js} +2 -2
  63. package/dist/client/assets/{LUXOKEGN-B1dkmN_M.js → LUXOKEGN-CmxZpSzC.js} +2 -2
  64. package/dist/client/assets/{MathTypeset-qeRVy_bc.js → MathTypeset-Hhqwg4PF.js} +2 -2
  65. package/dist/client/assets/{N3JZAHOW-C6sq5aqx.js → N3JZAHOW-Cev8Cn9M.js} +2 -2
  66. package/dist/client/assets/{NUIALGQ3-BG7xJ_qe.js → NUIALGQ3-CV92Kt25.js} +2 -2
  67. package/dist/client/assets/{NoProjectsHero-B0KzU91d.js → NoProjectsHero-CMqIlSNl.js} +2 -2
  68. package/dist/client/assets/{O65XPQGZ-BEfVfDlS.js → O65XPQGZ-bGyTGMsB.js} +2 -2
  69. package/dist/client/assets/{O7XIQ6OM-BUiRjV87.js → O7XIQ6OM-DVdEfB1N.js} +2 -2
  70. package/dist/client/assets/{OFQON5FD-DTgVPbd-.js → OFQON5FD-Ca_CNS26.js} +2 -2
  71. package/dist/client/assets/{P4ConnectAccountPages-C4KYM5XU.js → P4ConnectAccountPages-Buss2oTL.js} +2 -2
  72. package/dist/client/assets/{P4ConnectSidebarSignIn-DNPUNJl_.js → P4ConnectSidebarSignIn-D1n4y6Gq.js} +2 -2
  73. package/dist/client/assets/{PJQHF43J-QRnhQpHu.js → PJQHF43J-B__IdKwP.js} +2 -2
  74. package/dist/client/assets/{PanelLayoutControls-4VFKEoHg.js → PanelLayoutControls-EIunk_2Q.js} +4 -4
  75. package/dist/client/assets/{PierreEntryIcon-DeI-j_7w.js → PierreEntryIcon-GQImyog1.js} +2 -2
  76. package/dist/client/assets/{PopoverHandle-DMB4QSp6.js → PopoverHandle-Cj5egwXv.js} +2 -2
  77. package/dist/client/assets/{PreviewPanel-CO66mekh.js → PreviewPanel-BkFeksTl.js} +2 -2
  78. package/dist/client/assets/{ProjectDefaultsSettings-BF-iyQ8T.js → ProjectDefaultsSettings-DX2Kf-tx.js} +2 -2
  79. package/dist/client/assets/{ProjectFavicon-_6hkSNzm.js → ProjectFavicon-OMOnEzVu.js} +3 -3
  80. package/dist/client/assets/{ProjectIconPickerDialog-DeL1rZxy.js → ProjectIconPickerDialog-Q4GkqwDs.js} +2 -2
  81. package/dist/client/assets/{ProjectMonogram-Cn4l-YGU.js → ProjectMonogram-Br5sgd24.js} +2 -2
  82. package/dist/client/assets/{ProviderAuthTerminal-qGeMxZDy.js → ProviderAuthTerminal-Q584HoOn.js} +2 -2
  83. package/dist/client/assets/{ProviderModelPicker-DJQYH_Pp.js → ProviderModelPicker-JNM9nJs_.js} +2 -2
  84. package/dist/client/assets/{ProviderSettingsForm-BSVuPnR0.js → ProviderSettingsForm-CdiKhrJE.js} +2 -2
  85. package/dist/client/assets/{PullRequestCodeTab-0OaJE6XS.js → PullRequestCodeTab-Co76Qf6Z.js} +2 -2
  86. package/dist/client/assets/{RHNBAITX-ChqB7inB.js → RHNBAITX-Oryl0UiR.js} +2 -2
  87. package/dist/client/assets/{ReadOnlySourcePreview-B08Wms4m.js → ReadOnlySourcePreview-aUjexBVb.js} +2 -2
  88. package/dist/client/assets/{RenderErrorBoundary-BsOuLEci.js → RenderErrorBoundary-Oe5BzG3n.js} +2 -2
  89. package/dist/client/assets/{SLD4V6NK-IkYRGtTH.js → SLD4V6NK-DbsINoTD.js} +2 -2
  90. package/dist/client/assets/{ScheduledTasksSettings-1UDkELZo.js → ScheduledTasksSettings-1uXNtcPA.js} +2 -2
  91. package/dist/client/assets/{ScopedSwitch-Bhp6-hCj.js → ScopedSwitch-D8-FelRH.js} +2 -2
  92. package/dist/client/assets/{ScrollAreaCorner-BPMuWLbs.js → ScrollAreaCorner-nnFi-Ecx.js} +2 -2
  93. package/dist/client/assets/{SecretInput-RlOzrLKL.js → SecretInput-CqAhFuNO.js} +2 -2
  94. package/dist/client/assets/{SelectScrollUpArrow-6kh66YCd.js → SelectScrollUpArrow-BQJrvk31.js} +2 -2
  95. package/dist/client/assets/{SettingsPanels-BfBUSBAG.js → SettingsPanels-CNgY_ZPe.js} +4 -4
  96. package/dist/client/assets/{SettingsPanels.logic-BsFZYDgm.js → SettingsPanels.logic-Dr_NyHjE.js} +2 -2
  97. package/dist/client/assets/{SettingsScopeNotice-H7UzC9bb.js → SettingsScopeNotice-BFxCBOnl.js} +2 -2
  98. package/dist/client/assets/{T3PCR2KE-BxaunvVy.js → T3PCR2KE-2R1FY5zG.js} +2 -2
  99. package/dist/client/assets/{TKWO2OVW-DFURsfqA.js → TKWO2OVW-BjhIZzCe.js} +2 -2
  100. package/dist/client/assets/{TSHNXIZL-CIukdyLy.js → TSHNXIZL-B_cvoUct.js} +2 -2
  101. package/dist/client/assets/{ThemeEditorPanel-otrA-nTg.js → ThemeEditorPanel-B7MiqZ90.js} +2 -2
  102. package/dist/client/assets/{ThreadTerminalDrawer-BQKZCFAC.js → ThreadTerminalDrawer-DHoyxd6-.js} +2 -2
  103. package/dist/client/assets/{TooltipViewport-ZmVCer7P.js → TooltipViewport-ThbbZQDo.js} +2 -2
  104. package/dist/client/assets/{UQJE5E4I-CfqCotH2.js → UQJE5E4I-2r98lr05.js} +2 -2
  105. package/dist/client/assets/{USNYFO5S-CctAAheU.js → USNYFO5S-CvTI5t_o.js} +2 -2
  106. package/dist/client/assets/{Virtualizer-CImHNxBq.js → Virtualizer-BgcEI5KE.js} +2 -2
  107. package/dist/client/assets/{WEVWDWVA-DS9YO9IT.js → WEVWDWVA-U7ygIdf3.js} +2 -2
  108. package/dist/client/assets/{WorkspaceBreadcrumb-BW_omYU1.js → WorkspaceBreadcrumb-_zND61qF.js} +2 -2
  109. package/dist/client/assets/{WorkspacePageContainer-BS8FWt_4.js → WorkspacePageContainer-LYv_7Qc0.js} +2 -2
  110. package/dist/client/assets/{WorkspacePageHeader-CE_94tTR.js → WorkspacePageHeader-B_0ute56.js} +2 -2
  111. package/dist/client/assets/{X5RFHQXM-B0KbwoE1.js → X5RFHQXM-D4S0_b0W.js} +2 -2
  112. package/dist/client/assets/{X62E3GBT-wpz8X9Yh.js → X62E3GBT-CrIC4h9P.js} +2 -2
  113. package/dist/client/assets/{XBNEOJTC-DFRK5c6Y.js → XBNEOJTC-D2_RQZjM.js} +2 -2
  114. package/dist/client/assets/{YHV2MVVZ-1NnqTTZ2.js → YHV2MVVZ-BmAcJLBt.js} +2 -2
  115. package/dist/client/assets/{YURCZMG2-rnzWY5ij.js → YURCZMG2-RCCTu3bv.js} +2 -2
  116. package/dist/client/assets/{YVG2LODB-Dxuuk2M-.js → YVG2LODB-Cvp0Ei-1.js} +2 -2
  117. package/dist/client/assets/{_chat-1QGQLbCc.js → _chat-CwO3_WVM.js} +5 -5
  118. package/dist/client/assets/{_chat.design-z2pu_9A5.js → _chat.design-DX1VqYkX.js} +2 -2
  119. package/dist/client/assets/{_chat.index-D8X9o5jY.js → _chat.index-Dzh3d42S.js} +2 -2
  120. package/dist/client/assets/{_chat.new-CGJw8cpo.js → _chat.new-BHRvXFPr.js} +2 -2
  121. package/dist/client/assets/{_chat.pull-requests-BfW9qMU1.js → _chat.pull-requests-BZilN1TK.js} +2 -2
  122. package/dist/client/assets/{alert-DO06etEs.js → alert-BN-r9V4f.js} +2 -2
  123. package/dist/client/assets/{assetUrls-CmOUMX2M.js → assetUrls-B6vsSVWR.js} +2 -2
  124. package/dist/client/assets/{assets-aBpLf8r4.js → assets-CID0y4Uv.js} +2 -2
  125. package/dist/client/assets/{browserHistoryStore-tYgeZygn.js → browserHistoryStore-CK4YsfkQ.js} +2 -2
  126. package/dist/client/assets/{browserLinkTarget-CQFfJKWJ.js → browserLinkTarget-BJ30b4-s.js} +2 -2
  127. package/dist/client/assets/{checkbox-BEQFb7GO.js → checkbox-BJhN1L_L.js} +2 -2
  128. package/dist/client/assets/{color-picker-CXfnfmuH.js → color-picker-D2LwMwlZ.js} +2 -2
  129. package/dist/client/assets/{combobox--XoXA5uu.js → combobox-Cw2-7qyI.js} +2 -2
  130. package/dist/client/assets/{command-E2aLhsct.js → command-BIELTYJu.js} +2 -2
  131. package/dist/client/assets/{composer-logic-BPTz1APL.js → composer-logic-P-jVPXi4.js} +2 -2
  132. package/dist/client/assets/{composerDraftUploads-b_0oxKs9.js → composerDraftUploads-S66xDlS0.js} +2 -2
  133. package/dist/client/assets/{connect-CU9dNvTt.js → connect-D4llmZsa.js} +2 -2
  134. package/dist/client/assets/{connect-agent-Byc9PCdW.js → connect-agent-BlR0FAbF.js} +2 -2
  135. package/dist/client/assets/{design-CoGbXd61.js → design-Cdl1XCBU.js} +2 -2
  136. package/dist/client/assets/{device-DmH6IHQ4.js → device-Bc5H3PTz.js} +2 -2
  137. package/dist/client/assets/{dialog-CBBxT1gk.js → dialog-BRtKKGzk.js} +2 -2
  138. package/dist/client/assets/{diffRendering-BOVFJuWd.js → diffRendering-DtBTalAD.js} +2 -2
  139. package/dist/client/assets/{dist-B2P3f-0Q.js → dist-oE_MNxpZ.js} +3 -3
  140. package/dist/client/assets/{draft-input-CSOOVntS.js → draft-input-vviXwx5Q.js} +2 -2
  141. package/dist/client/assets/{duoViewer-BhHYrurM.js → duoViewer-kcp00m8a.js} +2 -2
  142. package/dist/client/assets/{dynamic-BhzrutAo.js → dynamic-C8_ODyue.js} +2 -2
  143. package/dist/client/assets/{embeddedScripts-43_R83vp.js → embeddedScripts-skldQmE1.js} +2 -2
  144. package/dist/client/assets/{empty-FOL5U4KY.js → empty-rC3eYvxq.js} +2 -2
  145. package/dist/client/assets/{entities-Bqo0n1Pb.js → entities-B8Vupv5g.js} +2 -2
  146. package/dist/client/assets/{fileLinks-D4GSqJYj.js → fileLinks-BoyzENAX.js} +2 -2
  147. package/dist/client/assets/{fileTreeExpansion-BBT5F8P1.js → fileTreeExpansion-DndrZZAD.js} +2 -2
  148. package/dist/client/assets/{getDiffFileInput-CGw09SPI.js → getDiffFileInput-C1QBFdFu.js} +2 -2
  149. package/dist/client/assets/{guideRunStore-DvIkVECt.js → guideRunStore-BgFFILxA.js} +2 -2
  150. package/dist/client/assets/{htmlRender-CmEeFzCo.js → htmlRender-ddkOIEbT.js} +2 -2
  151. package/dist/client/assets/{index-B1djVqM4.js → index-BwdieRvq.js} +3 -3
  152. package/dist/client/assets/{input-ekYqAkUx.js → input-BYd74ook.js} +2 -2
  153. package/dist/client/assets/{input-group-C3pxk97H.js → input-group-DMFlSk_7.js} +2 -2
  154. package/dist/client/assets/{kbd-3FPzNikV.js → kbd-rp5mX21h.js} +2 -2
  155. package/dist/client/assets/{keybindings-B3oDRRkK.js → keybindings-B_kRk5Fi.js} +2 -2
  156. package/dist/client/assets/{lazy-DyNR0b0B.js → lazy-CeaQ3-Fj.js} +4 -4
  157. package/dist/client/assets/{lazyRouteComponent-BPxq_G_s.js → lazyRouteComponent-COYyJY2H.js} +2 -2
  158. package/dist/client/assets/{link-B3B5a5Ju.js → link-CsXnX9WM.js} +2 -2
  159. package/dist/client/assets/{linkedPrompt-BsCPMHxQ.js → linkedPrompt-B5iI7U8H.js} +2 -2
  160. package/dist/client/assets/{main-BWh6jqG2.js → main-VfCRP294.js} +7 -7
  161. package/dist/client/assets/{mediaReference-Bb8H-qbI.js → mediaReference-ZW7gfO5X.js} +2 -2
  162. package/dist/client/assets/{mediaSource-C2MsZgy8.js → mediaSource-DsT6G6Wm.js} +2 -2
  163. package/dist/client/assets/{number-field-SoHEiP55.js → number-field-CEA6qXbs.js} +2 -2
  164. package/dist/client/assets/{observeResize-3Vj9DYOV.js → observeResize-DSyLC8QK.js} +2 -2
  165. package/dist/client/assets/{onboarding-CPgiVEVK.js → onboarding-BPkAEHBV.js} +2 -2
  166. package/dist/client/assets/{openFileInPreview-BBWCOLh_.js → openFileInPreview-CGM83ICx.js} +2 -2
  167. package/dist/client/assets/{p4ProjectFile-qmvlbzKv.js → p4ProjectFile-CwpteA7b.js} +2 -2
  168. package/dist/client/assets/{pair-CZnRGdd8.js → pair-D9v8gc0o.js} +2 -2
  169. package/dist/client/assets/{pendingSendStore-L5KquCDf.js → pendingSendStore-BuEVrrEM.js} +2 -2
  170. package/dist/client/assets/{phoneViewer-D-8v-sMf.js → phoneViewer-CNE0SVmy.js} +2 -2
  171. package/dist/client/assets/{pierre-icons-jwqMPUxD.js → pierre-icons-ChDlOt-h.js} +2 -2
  172. package/dist/client/assets/{popover-OfG3wVsl.js → popover-BjUpdrKu.js} +2 -2
  173. package/dist/client/assets/{preview-BYnEURcB.js → preview-3EscFepc.js} +2 -2
  174. package/dist/client/assets/{preview-DGdQ5Ycc.js → preview-DHLYKEKb.js} +2 -2
  175. package/dist/client/assets/{previewMiniPlayerStore-Dlbj5KrZ.js → previewMiniPlayerStore-DHjQeV1U.js} +2 -2
  176. package/dist/client/assets/{primary-B47ivN3o.js → primary-NcsmRI6j.js} +2 -2
  177. package/dist/client/assets/{primaryCloudLinkState-CreqR0gU.js → primaryCloudLinkState-DkXIVBHW.js} +2 -2
  178. package/dist/client/assets/{projectFilesQueryState-CanWrACx.js → projectFilesQueryState-0jxJ50Qq.js} +2 -2
  179. package/dist/client/assets/{projectScriptEditor-gWuw6vwd.js → projectScriptEditor-CMGXoIEJ.js} +2 -2
  180. package/dist/client/assets/{providerSkills-C_Rxqah9.js → providerSkills-4hnESoi_.js} +2 -2
  181. package/dist/client/assets/{pullRequestDetail.logic-RASi2EgP.js → pullRequestDetail.logic-sbOM8yDW.js} +2 -2
  182. package/dist/client/assets/{pullRequestIcons-ucGaXXG7.js → pullRequestIcons-B7Om_B_D.js} +2 -2
  183. package/dist/client/assets/{pullRequestReviewStore-CEr41DEl.js → pullRequestReviewStore-CIL8WfOG.js} +2 -2
  184. package/dist/client/assets/{pullRequests-Bw3Ui6hK.js → pullRequests-CMTRCOu7.js} +2 -2
  185. package/dist/client/assets/{queries-EslKFJTV.js → queries-hhl_J8u9.js} +2 -2
  186. package/dist/client/assets/{query-d1pQlqP0.js → query-CfGzD8v6.js} +2 -2
  187. package/dist/client/assets/{radio-group-Ciy_K5uE.js → radio-group-up2QNXjf.js} +2 -2
  188. package/dist/client/assets/{renderScheduler-CP-JkmKx.js → renderScheduler-Dgqqs-EX.js} +2 -2
  189. package/dist/client/assets/{rightPanelStore-D3KOmuPa.js → rightPanelStore-CGF0-d-1.js} +2 -2
  190. package/dist/client/assets/{runtime-d6B1vJeH.js → runtime-Ca_Z-vg5.js} +3 -3
  191. package/dist/client/assets/{runtime-DR7JxgbQ.js → runtime-OeWFs5Hf.js} +3 -3
  192. package/dist/client/assets/{runtimeModeConfig-Rxeb1uGg.js → runtimeModeConfig-BTG9FTYe.js} +2 -2
  193. package/dist/client/assets/{scheduledTasksSettings.logic-CVIC4Kpr.js → scheduledTasksSettings.logic-BeuOnCov.js} +2 -2
  194. package/dist/client/assets/{scroll-area-yyfi3ycu.js → scroll-area-BNQKEZbp.js} +2 -2
  195. package/dist/client/assets/{select-DaYjjw1q.js → select-D_zHR42Y.js} +2 -2
  196. package/dist/client/assets/{selfImproveFindings-1XIHD-7i.js → selfImproveFindings-CAZ0j1GD.js} +2 -2
  197. package/dist/client/assets/{server-sXApTCjZ.js → server-6nKYyc8r.js} +2 -2
  198. package/dist/client/assets/{session-C949OsEI.js → session-BxUdP61p.js} +2 -2
  199. package/dist/client/assets/{session-logic-DkSfwnHl.js → session-logic-Dr1plzXe.js} +2 -2
  200. package/dist/client/assets/{settings-B0O54Q3P.js → settings-DE_hSu0q.js} +2 -2
  201. package/dist/client/assets/{settings.appearance-BesXhA1a.js → settings.appearance-C--uy4It.js} +2 -2
  202. package/dist/client/assets/settings.archived-D-55XnxQ.js +2 -0
  203. package/dist/client/assets/{settings.computer-use-BeKmLbNe.js → settings.computer-use-DhnqPqMm.js} +2 -2
  204. package/dist/client/assets/{settings.connections-D1UxckE0.js → settings.connections-BPVLazeK.js} +2 -2
  205. package/dist/client/assets/{settings.data-controls-lPiIwMgc.js → settings.data-controls-CIzGvqCI.js} +2 -2
  206. package/dist/client/assets/{settings.decisions-D97jIUyr.js → settings.decisions-CU-6rIpn.js} +2 -2
  207. package/dist/client/assets/{settings.designs-B473PRvt.js → settings.designs-DHYhhG4k.js} +2 -2
  208. package/dist/client/assets/{settings.diagnostics-DDOaOIDg.js → settings.diagnostics-csgW1_E8.js} +2 -2
  209. package/dist/client/assets/{settings.general-qzEOE2zF.js → settings.general-CeBkrL9-.js} +2 -2
  210. package/dist/client/assets/{settings.integrations-D6ctQ9WI.js → settings.integrations-DqSYBosl.js} +2 -2
  211. package/dist/client/assets/{settings.keybindings-BL57H4sD.js → settings.keybindings-C7D1i238.js} +2 -2
  212. package/dist/client/assets/{settings.open-source-licenses-DaS82UhN.js → settings.open-source-licenses-6oFDgAt7.js} +2 -2
  213. package/dist/client/assets/{settings.plugins-DnS3RrT2.js → settings.plugins-DfM65Xio.js} +2 -2
  214. package/dist/client/assets/{settings.projects-D-ZICXey.js → settings.projects-CeoZzdMW.js} +3 -3
  215. package/dist/client/assets/{settings.providers-CFpCmv0o.js → settings.providers-BBgppyE3.js} +3 -3
  216. package/dist/client/assets/{settings.scheduled-tasks-IEAC3STn.js → settings.scheduled-tasks-Csi8wfij.js} +2 -2
  217. package/dist/client/assets/{settings.snap-shot-BaOFk9WR.js → settings.snap-shot-BdVdSIJy.js} +2 -2
  218. package/dist/client/assets/{settings.source-control-BW16AA5z.js → settings.source-control-Bme3qg7j.js} +2 -2
  219. package/dist/client/assets/{settings.storage-D4vBYBRP.js → settings.storage-DTcg-0aj.js} +2 -2
  220. package/dist/client/assets/{settingsLayout-CFQx1XDM.js → settingsLayout-4ySvFdXb.js} +2 -2
  221. package/dist/client/assets/{sidebar-C1E4GqL6.js → sidebar-CHDwV4Ca.js} +2 -2
  222. package/dist/client/assets/{sidebarProjectGrouping-9cUrCOXH.js → sidebarProjectGrouping-BcOVY8p-.js} +2 -2
  223. package/dist/client/assets/{skeleton-BCpBrYxh.js → skeleton-BcLPbojY.js} +2 -2
  224. package/dist/client/assets/{sourceControl-DwJWPP0h.js → sourceControl-CPrl7cyO.js} +2 -2
  225. package/dist/client/assets/{sourceControlClients-BBJW7ra4.js → sourceControlClients-oNOd36Cq.js} +2 -2
  226. package/dist/client/assets/{spinner-CSTrcxhP.js → spinner-_ourbdVb.js} +2 -2
  227. package/dist/client/assets/{terminal-links-D18LpQ1T.js → terminal-links-DuZi4b83.js} +2 -2
  228. package/dist/client/assets/{terminalSessions-C2NUFncF.js → terminalSessions-D0vbdqqx.js} +2 -2
  229. package/dist/client/assets/{textarea-R4UQ47Ns.js → textarea-DlXXDHPJ.js} +2 -2
  230. package/dist/client/assets/{themePalette-neUNWCzK.js → themePalette-VIM7Gehx.js} +2 -2
  231. package/dist/client/assets/{toast-B84QdqqM.js → toast-DXWclCrr.js} +2 -2
  232. package/dist/client/assets/{toggle-BH5BGBcD.js → toggle-Dofc34s2.js} +2 -2
  233. package/dist/client/assets/{toggle-group-Di3SFV73.js → toggle-group-CYKsfBbD.js} +2 -2
  234. package/dist/client/assets/{tooltip-D-GRl-oZ.js → tooltip-CY3W5y-f.js} +2 -2
  235. package/dist/client/assets/{uiStateStore-xSkh4_PU.js → uiStateStore-CdkBStdp.js} +2 -2
  236. package/dist/client/assets/{usage-DUdXloVo.js → usage-DQcgd75_.js} +2 -2
  237. package/dist/client/assets/{usageAccess-DSLF-sRE.js → usageAccess-CCSxXl9X.js} +2 -2
  238. package/dist/client/assets/{usageFormat-Bzyvr9m4.js → usageFormat-ByjmRjTe.js} +2 -2
  239. package/dist/client/assets/{usageShortcuts-D6nQeRtx.js → usageShortcuts-DOWm0Vo9.js} +2 -2
  240. package/dist/client/assets/{use-atom-command-DA6OG-Qk.js → use-atom-command-vqjL7n-x.js} +2 -2
  241. package/dist/client/assets/{useAriaLabelledBy-PLuOxvFb.js → useAriaLabelledBy-B7FNFpmO.js} +2 -2
  242. package/dist/client/assets/{useHandleNewThread-Dm0SCq59.js → useHandleNewThread-BYNZXzR_.js} +2 -2
  243. package/dist/client/assets/{useLocation-Bqc94klS.js → useLocation-B_XV0lDx.js} +2 -2
  244. package/dist/client/assets/{useNavigate-DdjG4MB_.js → useNavigate-BWqAWfiZ.js} +2 -2
  245. package/dist/client/assets/{useNavigateBack-sP0LsL3p.js → useNavigateBack-C52nbvbb.js} +2 -2
  246. package/dist/client/assets/{useP4ConnectAuthPrompt-C9d7n33S.js → useP4ConnectAuthPrompt-DKhdNYj8.js} +2 -2
  247. package/dist/client/assets/{useParams-DZQvRQLJ.js → useParams-ekGanxxb.js} +2 -2
  248. package/dist/client/assets/{usePermissionStatus-BzfAUU9X.js → usePermissionStatus-CWV_yoZe.js} +2 -2
  249. package/dist/client/assets/{usePullRequestActions-DIjGLg1E.js → usePullRequestActions-DxtkLQ5D.js} +2 -2
  250. package/dist/client/assets/{useRegisterFieldControl-CyBVe0G0.js → useRegisterFieldControl-BAJIcFiO.js} +2 -2
  251. package/dist/client/assets/{useScopedModelAvailability-D4n22Nmm.js → useScopedModelAvailability-815e0x20.js} +2 -2
  252. package/dist/client/assets/{useSettings-CaJMqrvF.js → useSettings-gPlpTIWi.js} +2 -2
  253. package/dist/client/assets/{utils-BoMYW9A3.js → utils-DhUt689t.js} +2 -2
  254. package/dist/client/assets/{vcsRefInvalidation-w_CQ3i43.js → vcsRefInvalidation-CW_MIqdt.js} +2 -2
  255. package/dist/client/assets/{welcome-BIKH3rbU.js → welcome-k7S47hyM.js} +2 -2
  256. package/dist/client/index.html +1 -1
  257. package/dist/{renderer-CveKT929.mjs → renderer-Ay-1ojn7.mjs} +2 -2
  258. package/dist/{runtime-DGGSjC6Q.mjs → runtime-bP6MSuMS.mjs} +3 -1
  259. package/package.json +2 -2
  260. package/dist/client/assets/AlertDialogRoot-9jRALQXL.js +0 -2
  261. package/dist/client/assets/Input-Cv-TKh6s.js +0 -2
  262. package/dist/client/assets/JZOYTAAL-CB_B_Rei.js +0 -1
  263. package/dist/client/assets/settings.archived-FtcZf_Ug.js +0 -2
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Dy as i,Eb as a,Ht as o,Jt as s,Nt as c,Oy as l,Vt as u,dr as d,qc as f,t as p,ts as m}from"./utils-BoMYW9A3.js";import{a as h,c as g,o as _,s as v,t as y}from"./select-DaYjjw1q.js";import{f as b,t as x}from"./server-sXApTCjZ.js";import{n as S}from"./query-d1pQlqP0.js";import{t as C}from"./use-atom-command-DA6OG-Qk.js";import{i as w}from"./usageFormat-Bzyvr9m4.js";import{t as T}from"./input-ekYqAkUx.js";import{F as E,L as D,R as O,V as k,a as A,i as j,n as M,s as N}from"./settingsLayout-CFQx1XDM.js";import{va as P}from"./main-BWh6jqG2.js";import{t as ee}from"./ProviderModelPicker-DJQYH_Pp.js";import{i as F}from"./selfImproveFindings-1XIHD-7i.js";var I=e(t(),1),L=n(),R={off:`Off`,shadow:`Record decisions only`,dispatch:`Review turns`},te={off:`Finished turns are not checked.`,shadow:`Decisions judges finished turns; nothing is reviewed.`,dispatch:`Reviewers suggest memories from turns Decisions judges worth a review.`};function ne(e){return e.checkedTurns===0||e.lastCheckedAt===null?null:`${`${e.checkedTurns} ${e.checkedTurns===1?`turn`:`turns`} checked`} · ${e.reviewTurns} worth a review · last ${w(e.lastCheckedAt)}`}function re(e){return e.mode===`off`?null:e.hasDecisionKey?e.mode===`dispatch`&&e.reviewerCount===0?`Choose a reviewer below. Without one, no review runs.`:null:`Needs an OpenRouter key above. No turn is judged until one is saved.`}function z(e,t,n){if(n===null)return e.filter((e,n)=>n!==t);let r=e[t],i=r&&r.instanceId===n.instanceId&&r.model===n.model?r:{instanceId:n.instanceId,model:n.model};return t<e.length?e.map((e,n)=>n===t?i:e):[...e,i]}var B=e(r(),1),ie=a(f);function V(e){let t=(0,L.c)(8),n=!e.open,r=e.open?`grid-rows-[1fr] opacity-100`:`grid-rows-[0fr] opacity-0`,i;t[0]===r?i=t[1]:(i=p(`grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-opacity`,r),t[0]=r,t[1]=i);let a;t[2]===e.children?a=t[3]:(a=(0,B.jsx)(`div`,{className:`min-h-0 overflow-hidden`,children:e.children}),t[2]=e.children,t[3]=a);let o;return t[4]!==n||t[5]!==i||t[6]!==a?(o=(0,B.jsx)(`div`,{inert:n,className:i,children:a}),t[4]=n,t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function H(e){let[t,n]=(0,I.useState)(e);return e!==null&&e!==t&&n(e),t}function U(e){let t=(0,L.c)(6),n=H(e.text),r=e.text!==null,i=e.text?`status`:void 0,a;t[0]!==n||t[1]!==i?(a=(0,B.jsx)(`p`,{role:i,className:`pt-0.5 text-xs text-warning`,children:n}),t[0]=n,t[1]=i,t[2]=a):a=t[2];let o;return t[3]!==r||t[4]!==a?(o=(0,B.jsx)(V,{open:r,children:a}),t[3]=r,t[4]=a,t[5]=o):o=t[5],o}function W(){let e=(0,L.c)(3),{scope:t,environment:n}=k(),r=t.environmentIds.length===1?n?.environmentId??null:null,i=n?.connection.phase===`connected`&&n.serverConfig!==null,a;return e[0]!==i||e[1]!==r?(a=(0,B.jsx)(N,{title:`Self-improvement`,children:r&&i?(0,B.jsx)(G,{environmentId:r}):(0,B.jsx)(A,{title:`Review finished turns`,description:`Pick a single connected environment to set up self-improvement for it.`})}),e[0]=i,e[1]=r,e[2]=a):a=e[2],a}function G(e){let t=(0,L.c)(57),{environmentId:n}=e,{environment:r,target:i}=k(),a=E(),l;t[0]===n?l=t[1]:(l=b.selfImproveSettingsLive({environmentId:n,input:{}}),t[0]=n,t[1]=l);let p=S(l),h;t[2]===n?h=t[3]:(h=b.updateSelfImproveSettings.permissionAtom(n),t[2]=n,t[3]=h);let w=m(h),T=C(b.updateSelfImproveSettings),[D,O]=(0,I.useState)(!1),j=p.data,N=r?.serverConfig?.providers??x,P,F,V,H;if(t[4]!==w||t[5]!==n||t[6]!==D||t[7]!==j||t[8]!==p.error||t[9]!==a||t[10]!==N||t[11]!==i?.projectId||t[12]!==T){H=Symbol.for(`react.early_return_sentinel`);bb0:{let e=N.filter(q),r=s(u(o(e),a,i?.projectId??null)),l=r.find(K);if(!j){let e=p.error?`Couldn't load self-improvement settings.`:`Loading…`,n;t[17]===e?n=t[18]:(n=(0,B.jsx)(A,{title:`Review finished turns`,status:e}),t[17]=e,t[18]=n),H=n;break bb0}let m=!w||D,h;t[19]!==n||t[20]!==T?(h=async e=>{O(!0),await T({environmentId:n,input:e}),O(!1)},t[19]=n,t[20]=T,t[21]=h):h=t[21];let b=h,x=j.mode===`dispatch`,S=j.mode,C=!!a.decisionOpenRouterKey,E;t[22]!==j.mode||t[23]!==j.reviewers.length||t[24]!==C?(E=re({mode:S,hasDecisionKey:C,reviewerCount:j.reviewers.length}),t[22]=j.mode,t[23]=j.reviewers.length,t[24]=C,t[25]=E):E=t[25];let k=E,I=t=>{let i=j.reviewers[t],o=t===0||j.reviewers.length>0,s=i?r.find(e=>e.instanceId===i.instanceId):void 0,u=i&&(!s||!s.enabled||!s.isAvailable)?`${s?.displayName??i.instanceId} is unavailable, so this reviewer is skipped.`:null,f=t===0?`First reviewer`:`Second reviewer`;return(0,B.jsx)(A,{title:f,"aria-disabled":!x||!o||void 0,className:`transition-opacity duration-200 ease-out motion-reduce:transition-none`,status:(0,B.jsx)(U,{text:x?u:null}),control:i||l?(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[(0,B.jsx)(ee,{environmentId:n,activeInstanceId:i?.instanceId??l.instanceId,model:i?.model??``,lockedProvider:null,instanceEntries:r,modelOptionsByInstance:c(a,e,i?.instanceId??null,i?.model??null),triggerClassName:M,triggerAriaLabel:f,...i?{}:{triggerLabel:`Choose model`},disabled:m||!x||!o,onInstanceModelChange:(e,n)=>void b({mode:j.mode,reviewers:z(j.reviewers,t,{instanceId:e,model:n})})}),i?(0,B.jsx)(d,{size:`sm`,variant:`outline`,disabled:m||!x,onClick:()=>void b({mode:j.mode,reviewers:z(j.reviewers,t,null)}),children:`Remove`}):null]}):(0,B.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No reviewer models available.`})},f)},L=te[j.mode],W;t[26]===j?W=t[27]:(W=ne(j),t[26]=j,t[27]=W);let G;t[28]===k?G=t[29]:(G=(0,B.jsx)(U,{text:k}),t[28]=k,t[29]=G);let J;t[30]!==W||t[31]!==G?(J=(0,B.jsxs)(B.Fragment,{children:[W,G]}),t[30]=W,t[31]=G,t[32]=J):J=t[32];let Y;t[33]!==j.mode||t[34]!==j.reviewers||t[35]!==b?(Y=e=>{ie(e)&&e!==j.mode&&b({mode:e,reviewers:j.reviewers})},t[33]=j.mode,t[34]=j.reviewers,t[35]=b,t[36]=Y):Y=t[36];let X=R[j.mode],Z;t[37]===X?Z=t[38]:(Z=(0,B.jsx)(v,{"aria-label":`Review finished turns`,children:(0,B.jsx)(g,{children:X})}),t[37]=X,t[38]=Z);let Q;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,B.jsx)(_,{children:f.literals.map(ae)}),t[39]=Q):Q=t[39];let $;t[40]!==m||t[41]!==j.mode||t[42]!==Y||t[43]!==Z?($=(0,B.jsxs)(y,{value:j.mode,disabled:m,onValueChange:Y,children:[Z,Q]}),t[40]=m,t[41]=j.mode,t[42]=Y,t[43]=Z,t[44]=$):$=t[44],t[45]!==L||t[46]!==J||t[47]!==$?(P=(0,B.jsx)(A,{id:`self-improve-mode`,title:`Review finished turns`,description:L,status:J,control:$}),t[45]=L,t[46]=J,t[47]=$,t[48]=P):P=t[48],F=I(0),V=I(1)}t[4]=w,t[5]=n,t[6]=D,t[7]=j,t[8]=p.error,t[9]=a,t[10]=N,t[11]=i?.projectId,t[12]=T,t[13]=P,t[14]=F,t[15]=V,t[16]=H}else P=t[13],F=t[14],V=t[15],H=t[16];if(H!==Symbol.for(`react.early_return_sentinel`))return H;let W;t[49]!==n||t[50]!==j.memoryMirror?(W=(0,B.jsx)(J,{environmentId:n,mirror:j.memoryMirror}),t[49]=n,t[50]=j.memoryMirror,t[51]=W):W=t[51];let G;return t[52]!==P||t[53]!==F||t[54]!==V||t[55]!==W?(G=(0,B.jsxs)(B.Fragment,{children:[P,F,V,W]}),t[52]=P,t[53]=F,t[54]=V,t[55]=W,t[56]=G):G=t[56],G}function ae(e){return(0,B.jsx)(h,{value:e,children:R[e]},e)}function K(e){return e.enabled&&e.isAvailable}function q(e){return e.supportsTextGeneration!==!1}function J(e){let t=(0,L.c)(37),[n,r]=(0,I.useState)(``),[i,a]=(0,I.useState)(!1),[o,s]=(0,I.useState)(null),c;t[0]===e.environmentId?c=t[1]:(c=b.setSelfImproveMemoryMirror.permissionAtom(e.environmentId),t[0]=e.environmentId,t[1]=c);let l=m(c),u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u={reportFailure:!1},t[2]=u):u=t[2];let f=C(b.setSelfImproveMemoryMirror,u),p=!l||i,h;t[3]!==e.environmentId||t[4]!==f?(h=async t=>{a(!0);let n=F(await f({environmentId:e.environmentId,input:{memoryMirror:t}}),`Couldn't set the mirror.`);s(n.ok?null:n.message),n.ok&&r(``),a(!1)},t[3]=e.environmentId,t[4]=f,t[5]=h):h=t[5];let g=h,_=e.mirror??`Not mirrored`,v;t[6]===o?v=t[7]:(v=(0,B.jsx)(U,{text:o}),t[6]=o,t[7]=v);let y;t[8]!==_||t[9]!==v?(y=(0,B.jsxs)(B.Fragment,{children:[_,v]}),t[8]=_,t[9]=v,t[10]=y):y=t[10];let x;t[11]!==p||t[12]!==g||t[13]!==n?(x=e=>{e.preventDefault(),n.trim()&&!p&&g(n.trim())},t[11]=p,t[12]=g,t[13]=n,t[14]=x):x=t[14];let S=e.mirror?`Replace repository path`:`/path/to/repository`,w;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>r(e.target.value),t[15]=w):w=t[15];let E;t[16]!==p||t[17]!==n||t[18]!==S?(E=(0,B.jsx)(`div`,{className:`min-w-40 flex-1`,children:(0,B.jsx)(T,{"aria-label":`Mirror saved memory`,autoComplete:`off`,value:n,disabled:p,placeholder:S,onChange:w})}),t[16]=p,t[17]=n,t[18]=S,t[19]=E):E=t[19];let D;t[20]!==p||t[21]!==n?(D=p||!n.trim(),t[20]=p,t[21]=n,t[22]=D):D=t[22];let O;t[23]===D?O=t[24]:(O=(0,B.jsx)(d,{type:`submit`,size:`sm`,disabled:D,children:`Save`}),t[23]=D,t[24]=O);let k;t[25]!==p||t[26]!==g||t[27]!==e.mirror?(k=e.mirror?(0,B.jsx)(d,{type:`button`,size:`sm`,variant:`outline`,disabled:p,onClick:()=>void g(null),children:`Remove`}):null,t[25]=p,t[26]=g,t[27]=e.mirror,t[28]=k):k=t[28];let j;t[29]!==O||t[30]!==k||t[31]!==x||t[32]!==E?(j=(0,B.jsxs)(`form`,{className:`flex max-w-lg flex-wrap items-center gap-2 pb-2`,onSubmit:x,children:[E,O,k]}),t[29]=O,t[30]=k,t[31]=x,t[32]=E,t[33]=j):j=t[33];let M;return t[34]!==j||t[35]!==y?(M=(0,B.jsx)(A,{title:`Mirror saved memory`,description:`A git checkout. Each save copies the changed files into its memory folder, commits them on the default branch, and pushes.`,status:y,children:j}),t[34]=j,t[35]=y,t[36]=M):M=t[36],M}function Y(){let e=(0,L.c)(28),t=E(X),n=O(),r=D(),[i,a]=(0,I.useState)(``),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[`decisionOpenRouterKey`],e[0]=o):o=e[0];let s;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,B.jsxs)(B.Fragment,{children:[`Used by Jev and Luna Decisions.`,` `,(0,B.jsx)(`a`,{href:`https://openrouter.ai/settings/keys`,target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2`,children:`Get an API key`})]}),e[1]=s):s=e[1];let c=t?`Key saved`:`No key saved`,l;e[2]!==r||e[3]!==i||e[4]!==n?(l=e=>{e.preventDefault(),i.trim()&&r&&(n({decisionOpenRouterKey:i.trim()}),a(``))},e[2]=r,e[3]=i,e[4]=n,e[5]=l):l=e[5];let u=!r,f=t?`Replace saved key`:`API key`,p;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>a(e.target.value),e[6]=p):p=e[6];let m;e[7]!==i||e[8]!==u||e[9]!==f?(m=(0,B.jsx)(`div`,{className:`min-w-40 flex-1`,children:(0,B.jsx)(T,{"aria-label":`OpenRouter API key`,type:`password`,autoComplete:`off`,value:i,disabled:u,placeholder:f,onChange:p})}),e[7]=i,e[8]=u,e[9]=f,e[10]=m):m=e[10];let h;e[11]!==r||e[12]!==i?(h=!r||!i.trim(),e[11]=r,e[12]=i,e[13]=h):h=e[13];let g;e[14]===h?g=e[15]:(g=(0,B.jsx)(d,{type:`submit`,size:`sm`,disabled:h,children:`Save`}),e[14]=h,e[15]=g);let _;e[16]!==r||e[17]!==t||e[18]!==n?(_=t&&(0,B.jsx)(d,{type:`button`,size:`sm`,variant:`outline`,disabled:!r,onClick:()=>n({decisionOpenRouterKey:``}),children:`Remove`}),e[16]=r,e[17]=t,e[18]=n,e[19]=_):_=e[19];let v;e[20]!==_||e[21]!==l||e[22]!==m||e[23]!==g?(v=(0,B.jsxs)(`form`,{className:`flex max-w-lg flex-wrap items-center gap-2`,onSubmit:l,children:[m,g,_]}),e[20]=_,e[21]=l,e[22]=m,e[23]=g,e[24]=v):v=e[24];let y;return e[25]!==v||e[26]!==c?(y=(0,B.jsx)(A,{title:`OpenRouter API key`,serverScoped:!0,settingKeys:o,description:s,status:c,children:v}),e[25]=v,e[26]=c,e[27]=y):y=e[27],y}function X(e){return!!e.decisionOpenRouterKey}function Z(){let e=(0,L.c)(26),t=E(),n=O(),r=D(),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[`decisionModel`],e[0]=o):o=e[0];let s=!r,c;e[1]===n?c=e[2]:(c=e=>{a(l)(e)&&n({decisionModel:e})},e[1]=n,e[2]=c);let u=i[t.decisionModel],d;e[3]===u?d=e[4]:(d=(0,B.jsx)(v,{"aria-label":`Decision model`,children:(0,B.jsx)(g,{children:u})}),e[3]=u,e[4]=d);let f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,B.jsx)(_,{children:l.literals.map(Q)}),e[5]=f):f=e[5];let p;e[6]!==t.decisionModel||e[7]!==s||e[8]!==c||e[9]!==d?(p=(0,B.jsx)(A,{id:`decision-model`,title:`Decision model`,serverScoped:!0,settingKeys:o,description:`Fast, structured answers for agents, fit scores on question options, and Computer Use navigation.`,control:(0,B.jsxs)(y,{value:t.decisionModel,disabled:s,onValueChange:c,children:[d,f]})}),e[6]=t.decisionModel,e[7]=s,e[8]=c,e[9]=d,e[10]=p):p=e[10];let m;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,B.jsx)(Y,{}),e[11]=m):m=e[11];let h;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(h=[`decisionVisionEnabled`],e[12]=h):h=e[12];let b=!r,x;e[13]===n?x=e[14]:(x=e=>n({decisionVisionEnabled:e}),e[13]=n,e[14]=x);let S;e[15]!==t.decisionVisionEnabled||e[16]!==x||e[17]!==b?(S=(0,B.jsx)(A,{title:`Computer Use vision`,serverScoped:!0,settingKeys:h,description:`Use screenshots with Decisions to suggest navigation targets. Jev vision is experimental.`,control:(0,B.jsx)(P,{"aria-label":`Computer Use vision`,checked:t.decisionVisionEnabled,disabled:b,onCheckedChange:x})}),e[15]=t.decisionVisionEnabled,e[16]=x,e[17]=b,e[18]=S):S=e[18];let C;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,B.jsx)(A,{title:`What is shared`,description:`Decision requests send their text and any included images to the selected service. Computer Use vision also sends screenshots. Keys stay in this environment's secret store.`}),e[19]=C):C=e[19];let w;e[20]!==S||e[21]!==p?(w=(0,B.jsxs)(N,{title:`Decisions`,children:[p,m,S,C]}),e[20]=S,e[21]=p,e[22]=w):w=e[22];let T;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,B.jsx)(W,{}),e[23]=T):T=e[23];let k;return e[24]===w?k=e[25]:(k=(0,B.jsxs)(j,{children:[w,T]}),e[24]=w,e[25]=k),k}function Q(e){return(0,B.jsx)(h,{value:e,children:i[e]},e)}var $=Z;export{$ as component};
2
- //# sourceMappingURL=settings.decisions-D97jIUyr.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Dy as i,Eb as a,Ht as o,Jt as s,Nt as c,Oy as l,Vt as u,dr as d,qc as f,t as p,ts as m}from"./utils-DhUt689t.js";import{a as h,c as g,o as _,s as v,t as y}from"./select-D_zHR42Y.js";import{f as b,t as x}from"./server-6nKYyc8r.js";import{n as S}from"./query-CfGzD8v6.js";import{t as C}from"./use-atom-command-vqjL7n-x.js";import{i as w}from"./usageFormat-ByjmRjTe.js";import{t as T}from"./input-BYd74ook.js";import{F as E,L as D,R as O,V as k,a as A,i as j,n as M,s as N}from"./settingsLayout-4ySvFdXb.js";import{va as P}from"./main-VfCRP294.js";import{t as ee}from"./ProviderModelPicker-JNM9nJs_.js";import{i as F}from"./selfImproveFindings-CAZ0j1GD.js";var I=e(t(),1),L=n(),R={off:`Off`,shadow:`Record decisions only`,dispatch:`Review turns`},te={off:`Finished turns are not checked.`,shadow:`Decisions judges finished turns; nothing is reviewed.`,dispatch:`Reviewers suggest memories from turns Decisions judges worth a review.`};function ne(e){return e.checkedTurns===0||e.lastCheckedAt===null?null:`${`${e.checkedTurns} ${e.checkedTurns===1?`turn`:`turns`} checked`} · ${e.reviewTurns} worth a review · last ${w(e.lastCheckedAt)}`}function re(e){return e.mode===`off`?null:e.hasDecisionKey?e.mode===`dispatch`&&e.reviewerCount===0?`Choose a reviewer below. Without one, no review runs.`:null:`Needs an OpenRouter key above. No turn is judged until one is saved.`}function z(e,t,n){if(n===null)return e.filter((e,n)=>n!==t);let r=e[t],i=r&&r.instanceId===n.instanceId&&r.model===n.model?r:{instanceId:n.instanceId,model:n.model};return t<e.length?e.map((e,n)=>n===t?i:e):[...e,i]}var B=e(r(),1),ie=a(f);function V(e){let t=(0,L.c)(8),n=!e.open,r=e.open?`grid-rows-[1fr] opacity-100`:`grid-rows-[0fr] opacity-0`,i;t[0]===r?i=t[1]:(i=p(`grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-opacity`,r),t[0]=r,t[1]=i);let a;t[2]===e.children?a=t[3]:(a=(0,B.jsx)(`div`,{className:`min-h-0 overflow-hidden`,children:e.children}),t[2]=e.children,t[3]=a);let o;return t[4]!==n||t[5]!==i||t[6]!==a?(o=(0,B.jsx)(`div`,{inert:n,className:i,children:a}),t[4]=n,t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function H(e){let[t,n]=(0,I.useState)(e);return e!==null&&e!==t&&n(e),t}function U(e){let t=(0,L.c)(6),n=H(e.text),r=e.text!==null,i=e.text?`status`:void 0,a;t[0]!==n||t[1]!==i?(a=(0,B.jsx)(`p`,{role:i,className:`pt-0.5 text-xs text-warning`,children:n}),t[0]=n,t[1]=i,t[2]=a):a=t[2];let o;return t[3]!==r||t[4]!==a?(o=(0,B.jsx)(V,{open:r,children:a}),t[3]=r,t[4]=a,t[5]=o):o=t[5],o}function W(){let e=(0,L.c)(3),{scope:t,environment:n}=k(),r=t.environmentIds.length===1?n?.environmentId??null:null,i=n?.connection.phase===`connected`&&n.serverConfig!==null,a;return e[0]!==i||e[1]!==r?(a=(0,B.jsx)(N,{title:`Self-improvement`,children:r&&i?(0,B.jsx)(G,{environmentId:r}):(0,B.jsx)(A,{title:`Review finished turns`,description:`Pick a single connected environment to set up self-improvement for it.`})}),e[0]=i,e[1]=r,e[2]=a):a=e[2],a}function G(e){let t=(0,L.c)(57),{environmentId:n}=e,{environment:r,target:i}=k(),a=E(),l;t[0]===n?l=t[1]:(l=b.selfImproveSettingsLive({environmentId:n,input:{}}),t[0]=n,t[1]=l);let p=S(l),h;t[2]===n?h=t[3]:(h=b.updateSelfImproveSettings.permissionAtom(n),t[2]=n,t[3]=h);let w=m(h),T=C(b.updateSelfImproveSettings),[D,O]=(0,I.useState)(!1),j=p.data,N=r?.serverConfig?.providers??x,P,F,V,H;if(t[4]!==w||t[5]!==n||t[6]!==D||t[7]!==j||t[8]!==p.error||t[9]!==a||t[10]!==N||t[11]!==i?.projectId||t[12]!==T){H=Symbol.for(`react.early_return_sentinel`);bb0:{let e=N.filter(q),r=s(u(o(e),a,i?.projectId??null)),l=r.find(K);if(!j){let e=p.error?`Couldn't load self-improvement settings.`:`Loading…`,n;t[17]===e?n=t[18]:(n=(0,B.jsx)(A,{title:`Review finished turns`,status:e}),t[17]=e,t[18]=n),H=n;break bb0}let m=!w||D,h;t[19]!==n||t[20]!==T?(h=async e=>{O(!0),await T({environmentId:n,input:e}),O(!1)},t[19]=n,t[20]=T,t[21]=h):h=t[21];let b=h,x=j.mode===`dispatch`,S=j.mode,C=!!a.decisionOpenRouterKey,E;t[22]!==j.mode||t[23]!==j.reviewers.length||t[24]!==C?(E=re({mode:S,hasDecisionKey:C,reviewerCount:j.reviewers.length}),t[22]=j.mode,t[23]=j.reviewers.length,t[24]=C,t[25]=E):E=t[25];let k=E,I=t=>{let i=j.reviewers[t],o=t===0||j.reviewers.length>0,s=i?r.find(e=>e.instanceId===i.instanceId):void 0,u=i&&(!s||!s.enabled||!s.isAvailable)?`${s?.displayName??i.instanceId} is unavailable, so this reviewer is skipped.`:null,f=t===0?`First reviewer`:`Second reviewer`;return(0,B.jsx)(A,{title:f,"aria-disabled":!x||!o||void 0,className:`transition-opacity duration-200 ease-out motion-reduce:transition-none`,status:(0,B.jsx)(U,{text:x?u:null}),control:i||l?(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[(0,B.jsx)(ee,{environmentId:n,activeInstanceId:i?.instanceId??l.instanceId,model:i?.model??``,lockedProvider:null,instanceEntries:r,modelOptionsByInstance:c(a,e,i?.instanceId??null,i?.model??null),triggerClassName:M,triggerAriaLabel:f,...i?{}:{triggerLabel:`Choose model`},disabled:m||!x||!o,onInstanceModelChange:(e,n)=>void b({mode:j.mode,reviewers:z(j.reviewers,t,{instanceId:e,model:n})})}),i?(0,B.jsx)(d,{size:`sm`,variant:`outline`,disabled:m||!x,onClick:()=>void b({mode:j.mode,reviewers:z(j.reviewers,t,null)}),children:`Remove`}):null]}):(0,B.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No reviewer models available.`})},f)},L=te[j.mode],W;t[26]===j?W=t[27]:(W=ne(j),t[26]=j,t[27]=W);let G;t[28]===k?G=t[29]:(G=(0,B.jsx)(U,{text:k}),t[28]=k,t[29]=G);let J;t[30]!==W||t[31]!==G?(J=(0,B.jsxs)(B.Fragment,{children:[W,G]}),t[30]=W,t[31]=G,t[32]=J):J=t[32];let Y;t[33]!==j.mode||t[34]!==j.reviewers||t[35]!==b?(Y=e=>{ie(e)&&e!==j.mode&&b({mode:e,reviewers:j.reviewers})},t[33]=j.mode,t[34]=j.reviewers,t[35]=b,t[36]=Y):Y=t[36];let X=R[j.mode],Z;t[37]===X?Z=t[38]:(Z=(0,B.jsx)(v,{"aria-label":`Review finished turns`,children:(0,B.jsx)(g,{children:X})}),t[37]=X,t[38]=Z);let Q;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,B.jsx)(_,{children:f.literals.map(ae)}),t[39]=Q):Q=t[39];let $;t[40]!==m||t[41]!==j.mode||t[42]!==Y||t[43]!==Z?($=(0,B.jsxs)(y,{value:j.mode,disabled:m,onValueChange:Y,children:[Z,Q]}),t[40]=m,t[41]=j.mode,t[42]=Y,t[43]=Z,t[44]=$):$=t[44],t[45]!==L||t[46]!==J||t[47]!==$?(P=(0,B.jsx)(A,{id:`self-improve-mode`,title:`Review finished turns`,description:L,status:J,control:$}),t[45]=L,t[46]=J,t[47]=$,t[48]=P):P=t[48],F=I(0),V=I(1)}t[4]=w,t[5]=n,t[6]=D,t[7]=j,t[8]=p.error,t[9]=a,t[10]=N,t[11]=i?.projectId,t[12]=T,t[13]=P,t[14]=F,t[15]=V,t[16]=H}else P=t[13],F=t[14],V=t[15],H=t[16];if(H!==Symbol.for(`react.early_return_sentinel`))return H;let W;t[49]!==n||t[50]!==j.memoryMirror?(W=(0,B.jsx)(J,{environmentId:n,mirror:j.memoryMirror}),t[49]=n,t[50]=j.memoryMirror,t[51]=W):W=t[51];let G;return t[52]!==P||t[53]!==F||t[54]!==V||t[55]!==W?(G=(0,B.jsxs)(B.Fragment,{children:[P,F,V,W]}),t[52]=P,t[53]=F,t[54]=V,t[55]=W,t[56]=G):G=t[56],G}function ae(e){return(0,B.jsx)(h,{value:e,children:R[e]},e)}function K(e){return e.enabled&&e.isAvailable}function q(e){return e.supportsTextGeneration!==!1}function J(e){let t=(0,L.c)(37),[n,r]=(0,I.useState)(``),[i,a]=(0,I.useState)(!1),[o,s]=(0,I.useState)(null),c;t[0]===e.environmentId?c=t[1]:(c=b.setSelfImproveMemoryMirror.permissionAtom(e.environmentId),t[0]=e.environmentId,t[1]=c);let l=m(c),u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u={reportFailure:!1},t[2]=u):u=t[2];let f=C(b.setSelfImproveMemoryMirror,u),p=!l||i,h;t[3]!==e.environmentId||t[4]!==f?(h=async t=>{a(!0);let n=F(await f({environmentId:e.environmentId,input:{memoryMirror:t}}),`Couldn't set the mirror.`);s(n.ok?null:n.message),n.ok&&r(``),a(!1)},t[3]=e.environmentId,t[4]=f,t[5]=h):h=t[5];let g=h,_=e.mirror??`Not mirrored`,v;t[6]===o?v=t[7]:(v=(0,B.jsx)(U,{text:o}),t[6]=o,t[7]=v);let y;t[8]!==_||t[9]!==v?(y=(0,B.jsxs)(B.Fragment,{children:[_,v]}),t[8]=_,t[9]=v,t[10]=y):y=t[10];let x;t[11]!==p||t[12]!==g||t[13]!==n?(x=e=>{e.preventDefault(),n.trim()&&!p&&g(n.trim())},t[11]=p,t[12]=g,t[13]=n,t[14]=x):x=t[14];let S=e.mirror?`Replace repository path`:`/path/to/repository`,w;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>r(e.target.value),t[15]=w):w=t[15];let E;t[16]!==p||t[17]!==n||t[18]!==S?(E=(0,B.jsx)(`div`,{className:`min-w-40 flex-1`,children:(0,B.jsx)(T,{"aria-label":`Mirror saved memory`,autoComplete:`off`,value:n,disabled:p,placeholder:S,onChange:w})}),t[16]=p,t[17]=n,t[18]=S,t[19]=E):E=t[19];let D;t[20]!==p||t[21]!==n?(D=p||!n.trim(),t[20]=p,t[21]=n,t[22]=D):D=t[22];let O;t[23]===D?O=t[24]:(O=(0,B.jsx)(d,{type:`submit`,size:`sm`,disabled:D,children:`Save`}),t[23]=D,t[24]=O);let k;t[25]!==p||t[26]!==g||t[27]!==e.mirror?(k=e.mirror?(0,B.jsx)(d,{type:`button`,size:`sm`,variant:`outline`,disabled:p,onClick:()=>void g(null),children:`Remove`}):null,t[25]=p,t[26]=g,t[27]=e.mirror,t[28]=k):k=t[28];let j;t[29]!==O||t[30]!==k||t[31]!==x||t[32]!==E?(j=(0,B.jsxs)(`form`,{className:`flex max-w-lg flex-wrap items-center gap-2 pb-2`,onSubmit:x,children:[E,O,k]}),t[29]=O,t[30]=k,t[31]=x,t[32]=E,t[33]=j):j=t[33];let M;return t[34]!==j||t[35]!==y?(M=(0,B.jsx)(A,{title:`Mirror saved memory`,description:`A git checkout. Each save copies the changed files into its memory folder, commits them on the default branch, and pushes.`,status:y,children:j}),t[34]=j,t[35]=y,t[36]=M):M=t[36],M}function Y(){let e=(0,L.c)(28),t=E(X),n=O(),r=D(),[i,a]=(0,I.useState)(``),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[`decisionOpenRouterKey`],e[0]=o):o=e[0];let s;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,B.jsxs)(B.Fragment,{children:[`Used by Jev and Luna Decisions.`,` `,(0,B.jsx)(`a`,{href:`https://openrouter.ai/settings/keys`,target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2`,children:`Get an API key`})]}),e[1]=s):s=e[1];let c=t?`Key saved`:`No key saved`,l;e[2]!==r||e[3]!==i||e[4]!==n?(l=e=>{e.preventDefault(),i.trim()&&r&&(n({decisionOpenRouterKey:i.trim()}),a(``))},e[2]=r,e[3]=i,e[4]=n,e[5]=l):l=e[5];let u=!r,f=t?`Replace saved key`:`API key`,p;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>a(e.target.value),e[6]=p):p=e[6];let m;e[7]!==i||e[8]!==u||e[9]!==f?(m=(0,B.jsx)(`div`,{className:`min-w-40 flex-1`,children:(0,B.jsx)(T,{"aria-label":`OpenRouter API key`,type:`password`,autoComplete:`off`,value:i,disabled:u,placeholder:f,onChange:p})}),e[7]=i,e[8]=u,e[9]=f,e[10]=m):m=e[10];let h;e[11]!==r||e[12]!==i?(h=!r||!i.trim(),e[11]=r,e[12]=i,e[13]=h):h=e[13];let g;e[14]===h?g=e[15]:(g=(0,B.jsx)(d,{type:`submit`,size:`sm`,disabled:h,children:`Save`}),e[14]=h,e[15]=g);let _;e[16]!==r||e[17]!==t||e[18]!==n?(_=t&&(0,B.jsx)(d,{type:`button`,size:`sm`,variant:`outline`,disabled:!r,onClick:()=>n({decisionOpenRouterKey:``}),children:`Remove`}),e[16]=r,e[17]=t,e[18]=n,e[19]=_):_=e[19];let v;e[20]!==_||e[21]!==l||e[22]!==m||e[23]!==g?(v=(0,B.jsxs)(`form`,{className:`flex max-w-lg flex-wrap items-center gap-2`,onSubmit:l,children:[m,g,_]}),e[20]=_,e[21]=l,e[22]=m,e[23]=g,e[24]=v):v=e[24];let y;return e[25]!==v||e[26]!==c?(y=(0,B.jsx)(A,{title:`OpenRouter API key`,serverScoped:!0,settingKeys:o,description:s,status:c,children:v}),e[25]=v,e[26]=c,e[27]=y):y=e[27],y}function X(e){return!!e.decisionOpenRouterKey}function Z(){let e=(0,L.c)(26),t=E(),n=O(),r=D(),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[`decisionModel`],e[0]=o):o=e[0];let s=!r,c;e[1]===n?c=e[2]:(c=e=>{a(l)(e)&&n({decisionModel:e})},e[1]=n,e[2]=c);let u=i[t.decisionModel],d;e[3]===u?d=e[4]:(d=(0,B.jsx)(v,{"aria-label":`Decision model`,children:(0,B.jsx)(g,{children:u})}),e[3]=u,e[4]=d);let f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,B.jsx)(_,{children:l.literals.map(Q)}),e[5]=f):f=e[5];let p;e[6]!==t.decisionModel||e[7]!==s||e[8]!==c||e[9]!==d?(p=(0,B.jsx)(A,{id:`decision-model`,title:`Decision model`,serverScoped:!0,settingKeys:o,description:`Fast, structured answers for agents, fit scores on question options, and Computer Use navigation.`,control:(0,B.jsxs)(y,{value:t.decisionModel,disabled:s,onValueChange:c,children:[d,f]})}),e[6]=t.decisionModel,e[7]=s,e[8]=c,e[9]=d,e[10]=p):p=e[10];let m;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,B.jsx)(Y,{}),e[11]=m):m=e[11];let h;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(h=[`decisionVisionEnabled`],e[12]=h):h=e[12];let b=!r,x;e[13]===n?x=e[14]:(x=e=>n({decisionVisionEnabled:e}),e[13]=n,e[14]=x);let S;e[15]!==t.decisionVisionEnabled||e[16]!==x||e[17]!==b?(S=(0,B.jsx)(A,{title:`Computer Use vision`,serverScoped:!0,settingKeys:h,description:`Use screenshots with Decisions to suggest navigation targets. Jev vision is experimental.`,control:(0,B.jsx)(P,{"aria-label":`Computer Use vision`,checked:t.decisionVisionEnabled,disabled:b,onCheckedChange:x})}),e[15]=t.decisionVisionEnabled,e[16]=x,e[17]=b,e[18]=S):S=e[18];let C;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,B.jsx)(A,{title:`What is shared`,description:`Decision requests send their text and any included images to the selected service. Computer Use vision also sends screenshots. Keys stay in this environment's secret store.`}),e[19]=C):C=e[19];let w;e[20]!==S||e[21]!==p?(w=(0,B.jsxs)(N,{title:`Decisions`,children:[p,m,S,C]}),e[20]=S,e[21]=p,e[22]=w):w=e[22];let T;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,B.jsx)(W,{}),e[23]=T):T=e[23];let k;return e[24]===w?k=e[25]:(k=(0,B.jsxs)(j,{children:[w,T]}),e[24]=w,e[25]=k),k}function Q(e){return(0,B.jsx)(h,{value:e,children:i[e]},e)}var $=Z;export{$ as component};
2
+ //# sourceMappingURL=settings.decisions-CU-6rIpn.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Jn as i,Lm as a,Os as o,Qs as s,Zs as c,as as l,dr as u,lm as d,tE as f,ts as p}from"./utils-BoMYW9A3.js";import{j as m,w as h}from"./entities-Bqo0n1Pb.js";import{a as g,c as _,o as v,s as y,t as b}from"./select-DaYjjw1q.js";import{t as x}from"./useNavigate-DdjG4MB_.js";import{q as S}from"./useSettings-CaJMqrvF.js";import{n as C}from"./query-d1pQlqP0.js";import{t as w}from"./use-atom-command-DA6OG-Qk.js";import{u as T}from"./rightPanelStore-D3KOmuPa.js";import{a as E,n as D,t as O}from"./tooltip-D-GRl-oZ.js";import{t as k}from"./ProjectFavicon-_6hkSNzm.js";import{n as A,r as j,t as M}from"./input-group-C3pxk97H.js";import{t as N}from"./DesignPageTile-rWwXWJ2J.js";import{a as P,l as F,n as I,r as L,s as R,u as z}from"./design-CoGbXd61.js";import{n as B}from"./useHandleNewThread-Dm0SCq59.js";import{V,i as H,s as U}from"./settingsLayout-CFQx1XDM.js";var W=n(),G=e(t(),1),K=e(r(),1),q={all:`All designs`,project:`Project designs`,other:`Other designs`};function J(){let e=(0,W.c)(57),{scope:t}=V(),n=h(),[r,i]=(0,G.useState)(``),[a,s]=(0,G.useState)(`all`),c;bb0:{if(t.kind===`unavailable`){let t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],c=t;break bb0}if(t.kind===`project`||t.kind===`checkout`){let r;e[1]===t.members?r=e[2]:(r=new Set(t.members.map(ee)),e[1]=t.members,e[2]=r);let i=r,a;if(e[3]!==n||e[4]!==i){let t;e[6]===i?t=e[7]:(t=e=>i.has(`${e.environmentId}:${e.id}`),e[6]=i,e[7]=t),a=n.filter(t),e[3]=n,e[4]=i,e[5]=a}else a=e[5];c=a;break bb0}if(t.kind===`environment`){let r;if(e[8]!==n||e[9]!==t.environmentId){let i;e[11]===t.environmentId?i=e[12]:(i=e=>e.environmentId===t.environmentId,e[11]=t.environmentId,e[12]=i),r=n.filter(i),e[8]=n,e[9]=t.environmentId,e[10]=r}else r=e[10];c=r;break bb0}c=n}let u=c,m;e[13]===u?m=e[14]:(m=l(e=>u.map(t=>{let n=e(I({environmentId:t.environmentId,projectId:t.id})),r=f(o(n));return{project:t,items:r?F({paths:r.paths,entries:r.entries??null,linkedPaths:[]}):[],loading:n.waiting&&!r,failed:n._tag===`Failure`}})),e[13]=u,e[14]=m);let g=p(m),x;e[15]===g?x=e[16]:(x=g.reduce($,0),e[15]=g,e[16]=x);let S=x,C,w,T,E,D,O,k;if(e[17]!==g||e[18]!==r||e[19]!==a){let t;e[27]!==r||e[28]!==a?(t=e=>{let t=e.items.filter(e=>(a===`all`||e.group===a)&&z(e,r));return t.length||e.failed?[{...e,items:t}]:[]},e[27]=r,e[28]=a,e[29]=t):t=e[29],k=g.flatMap(t);let n;e[30]===g?n=e[31]:(n=g.some(Q),e[30]=g,e[31]=n),w=n,C=H,T=`wide`,e[32]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,K.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Designs`}),e[32]=E):E=e[32];let o;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(A,{children:(0,K.jsx)(d,{"aria-hidden":!0})}),e[33]=o):o=e[33];let c;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>i(e.currentTarget.value),e[34]=c):c=e[34];let l;e[35]===r?l=e[36]:(l=(0,K.jsxs)(M,{children:[o,(0,K.jsx)(j,{type:`search`,"aria-label":`Search designs`,placeholder:`Search designs`,value:r,onChange:c})]}),e[35]=r,e[36]=l);let u;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>e&&s(e),e[37]=u):u=e[37];let f;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsx)(y,{"aria-label":`Filter designs`,children:(0,K.jsx)(_,{children:Z})}),e[38]=f):f=e[38];let p;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(p=Object.keys(q),e[39]=p):p=e[39];let m;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(v,{children:p.map(X)}),e[40]=m):m=e[40];let h;e[41]===a?h=e[42]:(h=(0,K.jsxs)(b,{value:a,onValueChange:u,children:[f,m]}),e[41]=a,e[42]=h),e[43]!==l||e[44]!==h?(D=(0,K.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-[minmax(0,1fr)_11rem]`,children:[l,h]}),e[43]=l,e[44]=h,e[45]=D):D=e[45],O=k.map(Y),e[17]=g,e[18]=r,e[19]=a,e[20]=C,e[21]=w,e[22]=T,e[23]=E,e[24]=D,e[25]=O,e[26]=k}else C=e[20],w=e[21],T=e[22],E=e[23],D=e[24],O=e[25],k=e[26];let N;e[46]!==w||e[47]!==S||e[48]!==k.length?(N=k.length?null:(0,K.jsx)(`p`,{id:`designs`,role:`status`,className:`py-8 text-center text-sm text-muted-foreground`,children:w?`Loading designs…`:S?`No designs match your filters.`:`No designs yet. Ask an agent in any thread to start one.`}),e[46]=w,e[47]=S,e[48]=k.length,e[49]=N):N=e[49];let P;return e[50]!==C||e[51]!==T||e[52]!==E||e[53]!==D||e[54]!==O||e[55]!==N?(P=(0,K.jsxs)(C,{width:T,children:[E,D,O,N]}),e[50]=C,e[51]=T,e[52]=E,e[53]=D,e[54]=O,e[55]=N,e[56]=P):P=e[56],P}function Y(e,t){let{project:n,items:r,failed:i}=e;return(0,K.jsx)(te,{id:t===0?`designs`:void 0,project:n,items:r,failed:i},`${n.environmentId}:${n.id}`)}function X(e){return(0,K.jsx)(g,{value:e,children:q[e]},e)}function Z(e){return q[e]}function Q(e){return e.loading}function $(e,t){return e+t.items.length}function ee(e){return`${e.environmentId}:${e.id}`}function te({id:e,project:t,items:n,failed:r}){let i=(0,G.useMemo)(()=>[c(t.environmentId,t.id)],[t.environmentId,t.id]),a=m(i),o=C(I({environmentId:t.environmentId,projectId:t.id})),s=p(L.permissionAtom(t.environmentId)),l=w(L,{reportFailure:!0}),[d,f]=(0,G.useState)(null),h=(0,G.useMemo)(()=>{let e=new Map;for(let t of a)if(!(t.archivedAt!==null||t.deletedAt!==null||t.worktreePath))for(let n of t.designs)e.set(n.path,[...e.get(n.path)??[],t]);return e},[a]),g=Date.now(),_=async e=>{if(await S().dialogs.confirm(`Delete ${e.path} and its assets folder from ${t.title}? This cannot be undone.`,{variant:`destructive`})){f(e.path);try{(await l({environmentId:t.environmentId,input:{projectId:t.id,documentPath:e.path}}))._tag===`Success`&&o.refresh()}finally{f(null)}}};return(0,K.jsxs)(U,{id:e,title:t.title,icon:(0,K.jsx)(k,{project:t}),headerAction:(0,K.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[n.length,` `,n.length===1?`design`:`designs`]}),children:[r?(0,K.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-3 px-4 py-4 text-sm text-destructive-foreground`,children:[(0,K.jsx)(`p`,{children:`Designs in this project could not be loaded.`}),(0,K.jsx)(u,{variant:`outline`,size:`sm`,onClick:o.refresh,children:`Retry`})]}):null,n.map(e=>(0,K.jsx)(ne,{project:t,item:e,meta:R(e,g),threads:h.get(e.path)??[],canDelete:s,deleting:d===e.path,onDelete:()=>void _(e)},e.path))]})}function ne(e){let t=(0,W.c)(48),{project:n,item:r,meta:o,threads:l,canDelete:d,deleting:f,onDelete:p}=e,m=x(),h=B(),g;t[0]!==r.modifiedAt||t[1]!==r.path||t[2]!==n.environmentId||t[3]!==n.id?(g=P({environmentId:n.environmentId,projectId:n.id},r.path,r.modifiedAt??``),t[0]=r.modifiedAt,t[1]=r.path,t[2]=n.environmentId,t[3]=n.id,t[4]=g):g=t[4];let _=C(g),v;t[5]===l?v=t[6]:(v=l.toSorted(re),t[5]=l,t[6]=v);let y=v[0],b;t[7]!==h||t[8]!==r.path||t[9]!==y||t[10]!==m||t[11]!==n.environmentId||t[12]!==n.id?(b=async()=>{if(y){let e=s(y.environmentId,y.id);T.getState().openFile(e,r.path),await m({to:`/$environmentId/$threadId`,params:{environmentId:e.environmentId,threadId:e.threadId}});return}let e=await h(c(n.environmentId,n.id),{envMode:`local`,worktreePath:null});e&&T.getState().openFile({environmentId:n.environmentId,threadId:e.threadId},r.path)},t[7]=h,t[8]=r.path,t[9]=y,t[10]=m,t[11]=n.environmentId,t[12]=n.id,t[13]=b):b=t[13];let S=b,w=_.error?null:_.data?.dataUrl,k;t[14]!==r.pageCount||t[15]!==w?(k=(0,K.jsx)(N,{size:`lg`,pageCount:r.pageCount,thumbnail:w}),t[14]=r.pageCount,t[15]=w,t[16]=k):k=t[16];let A;t[17]===r.name?A=t[18]:(A=(0,K.jsx)(`p`,{className:`truncate text-sm font-medium`,children:r.name}),t[17]=r.name,t[18]=A);let j;t[19]===r.group?j=t[20]:(j=r.group===`other`?(0,K.jsx)(i,{variant:`outline`,size:`sm`,children:`Other`}):null,t[19]=r.group,t[20]=j);let M;t[21]!==A||t[22]!==j?(M=(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[A,j]}),t[21]=A,t[22]=j,t[23]=M):M=t[23];let F;t[24]===o?F=t[25]:(F=(0,K.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:o}),t[24]=o,t[25]=F);let I;t[26]!==l[0]||t[27]!==l.length?(I=l.length?(0,K.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:l.length===1?`Linked to ${l[0].title||`Untitled chat`}`:`Linked to ${l.length} chats`}):null,t[26]=l[0],t[27]=l.length,t[28]=I):I=t[28];let L;t[29]!==I||t[30]!==M||t[31]!==F?(L=(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[M,F,I]}),t[29]=I,t[30]=M,t[31]=F,t[32]=L):L=t[32];let R=`Delete ${r.name}`,z=!d||f,V;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,K.jsx)(a,{"aria-hidden":!0}),t[33]=V):V=t[33];let H;t[34]!==p||t[35]!==R||t[36]!==z?(H=(0,K.jsx)(E,{render:(0,K.jsx)(u,{variant:`ghost-destructive`,size:`icon-sm`,"aria-label":R,disabled:z,onClick:p,children:V})}),t[34]=p,t[35]=R,t[36]=z,t[37]=H):H=t[37];let U;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,K.jsx)(D,{children:`Delete design`}),t[38]=U):U=t[38];let G;t[39]===H?G=t[40]:(G=(0,K.jsxs)(O,{children:[H,U]}),t[39]=H,t[40]=G);let q;t[41]===S?q=t[42]:(q=(0,K.jsx)(u,{variant:`soft`,size:`sm`,onClick:()=>void S(),children:`Open`}),t[41]=S,t[42]=q);let J;return t[43]!==L||t[44]!==G||t[45]!==q||t[46]!==k?(J=(0,K.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3`,children:[k,L,G,q]}),t[43]=L,t[44]=G,t[45]=q,t[46]=k,t[47]=J):J=t[47],J}function re(e,t){return t.updatedAt.localeCompare(e.updatedAt)}var ie=J;export{ie as component};
2
- //# sourceMappingURL=settings.designs-B473PRvt.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Jn as i,Lm as a,Os as o,Qs as s,Zs as c,as as l,dr as u,lm as d,tE as f,ts as p}from"./utils-DhUt689t.js";import{j as m,w as h}from"./entities-B8Vupv5g.js";import{a as g,c as _,o as v,s as y,t as b}from"./select-D_zHR42Y.js";import{t as x}from"./useNavigate-BWqAWfiZ.js";import{q as S}from"./useSettings-gPlpTIWi.js";import{n as C}from"./query-CfGzD8v6.js";import{t as w}from"./use-atom-command-vqjL7n-x.js";import{u as T}from"./rightPanelStore-CGF0-d-1.js";import{a as E,n as D,t as O}from"./tooltip-CY3W5y-f.js";import{t as k}from"./ProjectFavicon-OMOnEzVu.js";import{n as A,r as j,t as M}from"./input-group-DMFlSk_7.js";import{t as N}from"./DesignPageTile-rWwXWJ2J.js";import{a as P,l as F,n as I,r as L,s as R,u as z}from"./design-Cdl1XCBU.js";import{n as B}from"./useHandleNewThread-BYNZXzR_.js";import{V,i as H,s as U}from"./settingsLayout-4ySvFdXb.js";var W=n(),G=e(t(),1),K=e(r(),1),q={all:`All designs`,project:`Project designs`,other:`Other designs`};function J(){let e=(0,W.c)(57),{scope:t}=V(),n=h(),[r,i]=(0,G.useState)(``),[a,s]=(0,G.useState)(`all`),c;bb0:{if(t.kind===`unavailable`){let t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],c=t;break bb0}if(t.kind===`project`||t.kind===`checkout`){let r;e[1]===t.members?r=e[2]:(r=new Set(t.members.map(ee)),e[1]=t.members,e[2]=r);let i=r,a;if(e[3]!==n||e[4]!==i){let t;e[6]===i?t=e[7]:(t=e=>i.has(`${e.environmentId}:${e.id}`),e[6]=i,e[7]=t),a=n.filter(t),e[3]=n,e[4]=i,e[5]=a}else a=e[5];c=a;break bb0}if(t.kind===`environment`){let r;if(e[8]!==n||e[9]!==t.environmentId){let i;e[11]===t.environmentId?i=e[12]:(i=e=>e.environmentId===t.environmentId,e[11]=t.environmentId,e[12]=i),r=n.filter(i),e[8]=n,e[9]=t.environmentId,e[10]=r}else r=e[10];c=r;break bb0}c=n}let u=c,m;e[13]===u?m=e[14]:(m=l(e=>u.map(t=>{let n=e(I({environmentId:t.environmentId,projectId:t.id})),r=f(o(n));return{project:t,items:r?F({paths:r.paths,entries:r.entries??null,linkedPaths:[]}):[],loading:n.waiting&&!r,failed:n._tag===`Failure`}})),e[13]=u,e[14]=m);let g=p(m),x;e[15]===g?x=e[16]:(x=g.reduce($,0),e[15]=g,e[16]=x);let S=x,C,w,T,E,D,O,k;if(e[17]!==g||e[18]!==r||e[19]!==a){let t;e[27]!==r||e[28]!==a?(t=e=>{let t=e.items.filter(e=>(a===`all`||e.group===a)&&z(e,r));return t.length||e.failed?[{...e,items:t}]:[]},e[27]=r,e[28]=a,e[29]=t):t=e[29],k=g.flatMap(t);let n;e[30]===g?n=e[31]:(n=g.some(Q),e[30]=g,e[31]=n),w=n,C=H,T=`wide`,e[32]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,K.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Designs`}),e[32]=E):E=e[32];let o;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(A,{children:(0,K.jsx)(d,{"aria-hidden":!0})}),e[33]=o):o=e[33];let c;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>i(e.currentTarget.value),e[34]=c):c=e[34];let l;e[35]===r?l=e[36]:(l=(0,K.jsxs)(M,{children:[o,(0,K.jsx)(j,{type:`search`,"aria-label":`Search designs`,placeholder:`Search designs`,value:r,onChange:c})]}),e[35]=r,e[36]=l);let u;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>e&&s(e),e[37]=u):u=e[37];let f;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsx)(y,{"aria-label":`Filter designs`,children:(0,K.jsx)(_,{children:Z})}),e[38]=f):f=e[38];let p;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(p=Object.keys(q),e[39]=p):p=e[39];let m;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(v,{children:p.map(X)}),e[40]=m):m=e[40];let h;e[41]===a?h=e[42]:(h=(0,K.jsxs)(b,{value:a,onValueChange:u,children:[f,m]}),e[41]=a,e[42]=h),e[43]!==l||e[44]!==h?(D=(0,K.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-[minmax(0,1fr)_11rem]`,children:[l,h]}),e[43]=l,e[44]=h,e[45]=D):D=e[45],O=k.map(Y),e[17]=g,e[18]=r,e[19]=a,e[20]=C,e[21]=w,e[22]=T,e[23]=E,e[24]=D,e[25]=O,e[26]=k}else C=e[20],w=e[21],T=e[22],E=e[23],D=e[24],O=e[25],k=e[26];let N;e[46]!==w||e[47]!==S||e[48]!==k.length?(N=k.length?null:(0,K.jsx)(`p`,{id:`designs`,role:`status`,className:`py-8 text-center text-sm text-muted-foreground`,children:w?`Loading designs…`:S?`No designs match your filters.`:`No designs yet. Ask an agent in any thread to start one.`}),e[46]=w,e[47]=S,e[48]=k.length,e[49]=N):N=e[49];let P;return e[50]!==C||e[51]!==T||e[52]!==E||e[53]!==D||e[54]!==O||e[55]!==N?(P=(0,K.jsxs)(C,{width:T,children:[E,D,O,N]}),e[50]=C,e[51]=T,e[52]=E,e[53]=D,e[54]=O,e[55]=N,e[56]=P):P=e[56],P}function Y(e,t){let{project:n,items:r,failed:i}=e;return(0,K.jsx)(te,{id:t===0?`designs`:void 0,project:n,items:r,failed:i},`${n.environmentId}:${n.id}`)}function X(e){return(0,K.jsx)(g,{value:e,children:q[e]},e)}function Z(e){return q[e]}function Q(e){return e.loading}function $(e,t){return e+t.items.length}function ee(e){return`${e.environmentId}:${e.id}`}function te({id:e,project:t,items:n,failed:r}){let i=(0,G.useMemo)(()=>[c(t.environmentId,t.id)],[t.environmentId,t.id]),a=m(i),o=C(I({environmentId:t.environmentId,projectId:t.id})),s=p(L.permissionAtom(t.environmentId)),l=w(L,{reportFailure:!0}),[d,f]=(0,G.useState)(null),h=(0,G.useMemo)(()=>{let e=new Map;for(let t of a)if(!(t.archivedAt!==null||t.deletedAt!==null||t.worktreePath))for(let n of t.designs)e.set(n.path,[...e.get(n.path)??[],t]);return e},[a]),g=Date.now(),_=async e=>{if(await S().dialogs.confirm(`Delete ${e.path} and its assets folder from ${t.title}? This cannot be undone.`,{variant:`destructive`})){f(e.path);try{(await l({environmentId:t.environmentId,input:{projectId:t.id,documentPath:e.path}}))._tag===`Success`&&o.refresh()}finally{f(null)}}};return(0,K.jsxs)(U,{id:e,title:t.title,icon:(0,K.jsx)(k,{project:t}),headerAction:(0,K.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[n.length,` `,n.length===1?`design`:`designs`]}),children:[r?(0,K.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-3 px-4 py-4 text-sm text-destructive-foreground`,children:[(0,K.jsx)(`p`,{children:`Designs in this project could not be loaded.`}),(0,K.jsx)(u,{variant:`outline`,size:`sm`,onClick:o.refresh,children:`Retry`})]}):null,n.map(e=>(0,K.jsx)(ne,{project:t,item:e,meta:R(e,g),threads:h.get(e.path)??[],canDelete:s,deleting:d===e.path,onDelete:()=>void _(e)},e.path))]})}function ne(e){let t=(0,W.c)(48),{project:n,item:r,meta:o,threads:l,canDelete:d,deleting:f,onDelete:p}=e,m=x(),h=B(),g;t[0]!==r.modifiedAt||t[1]!==r.path||t[2]!==n.environmentId||t[3]!==n.id?(g=P({environmentId:n.environmentId,projectId:n.id},r.path,r.modifiedAt??``),t[0]=r.modifiedAt,t[1]=r.path,t[2]=n.environmentId,t[3]=n.id,t[4]=g):g=t[4];let _=C(g),v;t[5]===l?v=t[6]:(v=l.toSorted(re),t[5]=l,t[6]=v);let y=v[0],b;t[7]!==h||t[8]!==r.path||t[9]!==y||t[10]!==m||t[11]!==n.environmentId||t[12]!==n.id?(b=async()=>{if(y){let e=s(y.environmentId,y.id);T.getState().openFile(e,r.path),await m({to:`/$environmentId/$threadId`,params:{environmentId:e.environmentId,threadId:e.threadId}});return}let e=await h(c(n.environmentId,n.id),{envMode:`local`,worktreePath:null});e&&T.getState().openFile({environmentId:n.environmentId,threadId:e.threadId},r.path)},t[7]=h,t[8]=r.path,t[9]=y,t[10]=m,t[11]=n.environmentId,t[12]=n.id,t[13]=b):b=t[13];let S=b,w=_.error?null:_.data?.dataUrl,k;t[14]!==r.pageCount||t[15]!==w?(k=(0,K.jsx)(N,{size:`lg`,pageCount:r.pageCount,thumbnail:w}),t[14]=r.pageCount,t[15]=w,t[16]=k):k=t[16];let A;t[17]===r.name?A=t[18]:(A=(0,K.jsx)(`p`,{className:`truncate text-sm font-medium`,children:r.name}),t[17]=r.name,t[18]=A);let j;t[19]===r.group?j=t[20]:(j=r.group===`other`?(0,K.jsx)(i,{variant:`outline`,size:`sm`,children:`Other`}):null,t[19]=r.group,t[20]=j);let M;t[21]!==A||t[22]!==j?(M=(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[A,j]}),t[21]=A,t[22]=j,t[23]=M):M=t[23];let F;t[24]===o?F=t[25]:(F=(0,K.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:o}),t[24]=o,t[25]=F);let I;t[26]!==l[0]||t[27]!==l.length?(I=l.length?(0,K.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:l.length===1?`Linked to ${l[0].title||`Untitled chat`}`:`Linked to ${l.length} chats`}):null,t[26]=l[0],t[27]=l.length,t[28]=I):I=t[28];let L;t[29]!==I||t[30]!==M||t[31]!==F?(L=(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[M,F,I]}),t[29]=I,t[30]=M,t[31]=F,t[32]=L):L=t[32];let R=`Delete ${r.name}`,z=!d||f,V;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,K.jsx)(a,{"aria-hidden":!0}),t[33]=V):V=t[33];let H;t[34]!==p||t[35]!==R||t[36]!==z?(H=(0,K.jsx)(E,{render:(0,K.jsx)(u,{variant:`ghost-destructive`,size:`icon-sm`,"aria-label":R,disabled:z,onClick:p,children:V})}),t[34]=p,t[35]=R,t[36]=z,t[37]=H):H=t[37];let U;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,K.jsx)(D,{children:`Delete design`}),t[38]=U):U=t[38];let G;t[39]===H?G=t[40]:(G=(0,K.jsxs)(O,{children:[H,U]}),t[39]=H,t[40]=G);let q;t[41]===S?q=t[42]:(q=(0,K.jsx)(u,{variant:`soft`,size:`sm`,onClick:()=>void S(),children:`Open`}),t[41]=S,t[42]=q);let J;return t[43]!==L||t[44]!==G||t[45]!==q||t[46]!==k?(J=(0,K.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3`,children:[k,L,G,q]}),t[43]=L,t[44]=G,t[45]=q,t[46]=k,t[47]=J):J=t[47],J}function re(e,t){return t.updatedAt.localeCompare(e.updatedAt)}var ie=J;export{ie as component};
2
+ //# sourceMappingURL=settings.designs-DHYhhG4k.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{$d as i,$u as a,B_ as o,Df as s,H_ as c,JT as l,Qw as u,Vf as d,dr as f,dx as p,eE as m,fp as h,fr as g,md as _,nf as v,q_ as y,qf as b,rE as x,rf as ee,sE as te,t as S,tE as ne,td as C,ts as w,wf as re}from"./utils-BoMYW9A3.js";import{R as ie,W as ae}from"./runtime-DR7JxgbQ.js";import{f as T,l as E,p as D}from"./TooltipViewport-ZmVCer7P.js";import{i as O,p as k}from"./toast-B84QdqqM.js";import{D as A,q as oe}from"./useSettings-CaJMqrvF.js";import{f as j}from"./server-sXApTCjZ.js";import{i as se,n as ce,t as le}from"./session-C949OsEI.js";import{n as ue}from"./query-d1pQlqP0.js";import{t as de}from"./use-atom-command-DA6OG-Qk.js";import{a as M,o as N,u as fe}from"./timestampFormat-wac2e_Jz.js";import{a as P,n as F,t as I}from"./tooltip-D-GRl-oZ.js";import{n as pe,t as me}from"./toggle-group-Di3SFV73.js";import{t as he}from"./input-ekYqAkUx.js";import{t as L}from"./scroll-area-yyfi3ycu.js";import{F as ge,V as _e,i as ve,s as R,u as z}from"./settingsLayout-CFQx1XDM.js";import{t as B}from"./ConnectionStatusDot-CixsTBXI.js";import{Oa as ye,Ta as be,Zt as V,vi as xe}from"./main-BWh6jqG2.js";import{t as Se}from"./usageAccess-DSLF-sRE.js";import{t as H}from"./ExpandableText-Cpm1gOKG.js";import{t as U}from"./SettingsScopeNotice-H7UzC9bb.js";var W=n(),G=e(r(),1);function K(e){let t=(0,W.c)(19),{disabled:n,onSignal:r}=e,i;t[0]===r?i=t[1]:(i=()=>r(`SIGINT`),t[0]=r,t[1]=i);let a;t[2]!==n||t[3]!==i?(a=(0,G.jsx)(P,{render:(0,G.jsx)(g,{disabled:n,"aria-label":`Send SIGINT`,tone:`muted`,onClick:i,children:`INT`})}),t[2]=n,t[3]=i,t[4]=a):a=t[4];let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.jsx)(F,{side:`top`,children:`Send SIGINT`}),t[5]=o):o=t[5];let s;t[6]===a?s=t[7]:(s=(0,G.jsxs)(I,{children:[a,o]}),t[6]=a,t[7]=s);let c;t[8]===r?c=t[9]:(c=()=>r(`SIGKILL`),t[8]=r,t[9]=c);let l;t[10]!==n||t[11]!==c?(l=(0,G.jsx)(P,{render:(0,G.jsx)(g,{disabled:n,"aria-label":`Send SIGKILL`,tone:`destructive`,onClick:c,children:`KILL`})}),t[10]=n,t[11]=c,t[12]=l):l=t[12];let u;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,G.jsx)(F,{side:`top`,children:`Send SIGKILL`}),t[13]=u):u=t[13];let d;t[14]===l?d=t[15]:(d=(0,G.jsxs)(I,{children:[l,u]}),t[14]=l,t[15]=d);let f;return t[16]!==s||t[17]!==d?(f=(0,G.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[s,d]}),t[16]=s,t[17]=d,t[18]=f):f=t[18],f}var q=e(t(),1);function Ce(e){let t=(0,W.c)(10),n=A(),r=e===void 0?n?.environmentId??null:e,i=se(r,o),a;t[0]!==i||t[1]!==r?(a=r===null||!i?null:j.resourceTelemetry({environmentId:r,input:{}}),t[0]=i,t[1]=r,t[2]=a):a=t[2];let s=ue(a),c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[3]=c):c=t[3];let l=de(j.retryResourceTelemetry,c),d;t[4]!==r||t[5]!==l?(d=async()=>{if(r===null)throw Error(`No environment is selected.`);if(!ce(r,`environment:maintain`)||!ce(r,`diagnostics:read`))throw Error(`This connection cannot restart the resource monitor.`);let e=await l({environmentId:r,input:{}});if(e._tag===`Failure`)throw u(e.cause);return e.value.snapshot},t[4]=r,t[5]=l,t[6]=d):d=t[6];let f=d,p;return t[7]!==s||t[8]!==f?(p={...s,retry:f},t[7]=s,t[8]=f,t[9]=p):p=t[9],p}function we(e,t){let n=(0,W.c)(4),r=A(),i=t===void 0?r?.environmentId??null:t,a=se(i,o),s;return n[0]!==a||n[1]!==i||n[2]!==e?(s=i===null||!a?null:j.resourceTelemetryHistory({environmentId:i,input:e}),n[0]=a,n[1]=i,n[2]=e,n[3]=s):s=n[3],ue(s)}function J(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Te(e,t){let n=new Map;for(let t of e){let e=n.get(t.ppid)??[];e.push(t),n.set(t.ppid,e)}let r=new Set,i=e=>{for(let t of n.get(e)??[]){let e=J(t);r.has(e)||(r.add(e),i(t.identity.pid))}};for(let n of e)t.has(J(n))&&i(n.identity.pid);return e.filter(e=>!r.has(J(e)))}function Ee(e){return e.nativeStatus===null&&e.error!==null||e.nativeStatus===`degraded`||e.nativeStatus===`unavailable`||e.nativeStatus===`stopped`}function Y(e){return e.value<=0?0:Math.max(e.minimumVisiblePercent,e.value/Math.max(1,e.max)*100)}function De(e){return Math.max(1,...e.map(e=>e.avgCpuPercent))}var Oe=[{label:`5m`,windowMs:3e5,bucketMs:15e3},{label:`15m`,windowMs:9e5,bucketMs:3e4},{label:`30m`,windowMs:18e5,bucketMs:6e4},{label:`1h`,windowMs:36e5,bucketMs:12e4}];function ke(e){return`${V(e)}/s`}function Ae(e){let t=e/1e3;if(t<60)return`${t.toFixed(t>=10?1:2)}s`;let n=t/60;return n<60?`${n.toFixed(n>=10?1:2)}m`:`${(n/60).toFixed(2)}h`}function je(e){return e<1e3?`${Math.round(e)} µs`:e<1e6?`${(e/1e3).toFixed(2)} ms`:`${(e/1e6).toFixed(2)} s`}function Me(e){if(e<1e3)return`${Math.max(0,Math.round(e))} ms`;let t=e/1e3;return`${t.toLocaleString(void 0,{maximumFractionDigits:1})} ${t===1?`second`:`seconds`}`}function Ne(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Pe(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Fe(e){if(e.name.trim())return e.name;let t=(e.command.trim().split(/\s+/)[0]??e.command).replace(/^['"]|['"]$/g,``);return t.split(/[\\/]/).findLast(e=>e.length>0)??t}function Ie(e){switch(e){case`server`:return`Server`;case`server-child`:return`Backend child`;case`provider-root`:return`Provider`;case`terminal-root`:return`Terminal`;case`electron-main`:return`Electron main`;case`electron-renderer`:return`Renderer`;case`electron-gpu`:return`GPU`;case`electron-utility`:return`Electron utility`;case`resource-monitor`:return`Monitor`;case`unknown-p4`:return`P4 process`}}function Le(e){return e===`resource-monitor`?`bg-warning`:e.startsWith(`electron-`)?`bg-info`:e===`server`?`bg-violet-500`:`bg-success`}function Re(e){switch(e){case`storage`:return`Storage bytes`;case`logical`:return`Logical bytes`;case`all-io`:return`All I/O bytes`;case`unavailable`:return`Unavailable`}}function ze(e,t){return e===`true`?t.true:e===`false`?t.false:`Unknown`}function Be(e){return e===`healthy`?`default`:e===`starting`||e===`degraded`?`warning`:`danger`}function Ve(e){let t=(0,W.c)(20),{label:n,status:r,presentation:i}=e,a;t[0]!==i?.tone||t[1]!==r?(a=i?.tone??Be(r),t[0]=i?.tone,t[1]=r,t[2]=a):a=t[2];let o=a,s=o===`neutral`&&`border-border/70 bg-muted/45 text-muted-foreground`,c=o==="default"&&`border-success/25 bg-success/10 text-success-foreground`,l=o===`warning`&&`border-warning/30 bg-warning/10 text-warning-foreground`,u=o===`danger`&&`border-destructive/30 bg-destructive/10 text-destructive`,d;t[3]!==s||t[4]!==c||t[5]!==l||t[6]!==u?(d=S(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-3xs font-semibold uppercase tracking-widest`,s,c,l,u),t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d):d=t[7];let f=o===`neutral`&&`bg-muted-foreground/55`,p=o==="default"&&`bg-success`,m=o===`warning`&&`bg-warning`,h=o===`danger`&&`bg-destructive`,g;t[8]!==h||t[9]!==f||t[10]!==p||t[11]!==m?(g=S(`size-1.5 rounded-full`,f,p,m,h),t[8]=h,t[9]=f,t[10]=p,t[11]=m,t[12]=g):g=t[12];let _;t[13]===g?_=t[14]:(_=(0,G.jsx)(`span`,{className:g}),t[13]=g,t[14]=_);let v=i?.label??r,y;return t[15]!==n||t[16]!==_||t[17]!==v||t[18]!==d?(y=(0,G.jsxs)(`span`,{className:d,children:[_,n,` `,v]}),t[15]=n,t[16]=_,t[17]=v,t[18]=d,t[19]=y):y=t[19],y}function He(e){let t=(0,W.c)(9),{sampledAt:n}=e;if(z(),!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/55`,children:`Waiting for sample`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=M(p(n)),t[1]=n,t[2]=r);let i=r;if(!i){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/55`,children:`Waiting for sample`}),t[3]=e):e=t[3],e}let a;t[4]===i.value?a=t[5]:(a=(0,G.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),t[4]=i.value,t[5]=a);let o=i.suffix?` ${i.suffix}`:``,s;return t[6]!==a||t[7]!==o?(s=(0,G.jsxs)(`span`,{className:`text-2xs text-muted-foreground/60`,children:[`Updated `,a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function Ue(e){let t=(0,W.c)(19),{icon:n,label:r,value:i,detail:a,tone:o}=e,s=o===void 0?`default`:o,c;t[0]===n?c=t[1]:(c=(0,G.jsx)(`span`,{className:`text-muted-foreground/55 transition-colors group-hover:text-foreground/65`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=(0,G.jsx)(`span`,{className:`truncate`,children:r}),t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[c,l]}),t[4]=c,t[5]=l,t[6]=u):u=t[6];let d=s===`warning`&&`text-warning-foreground`,f=s===`danger`&&`text-destructive`,p;t[7]!==d||t[8]!==f?(p=S(`mt-2.5 truncate font-mono text-2xl font-semibold tracking-tighter tabular-nums text-foreground`,d,f),t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==p||t[11]!==i?(m=(0,G.jsx)(`div`,{className:p,children:i}),t[10]=p,t[11]=i,t[12]=m):m=t[12];let h;t[13]===a?h=t[14]:(h=a?(0,G.jsx)(`div`,{className:`mt-1.5 truncate text-3xs text-muted-foreground/60`,children:a}):null,t[13]=a,t[14]=h);let g;return t[15]!==u||t[16]!==m||t[17]!==h?(g=(0,G.jsxs)(`div`,{className:`group min-w-0 px-4 py-4 sm:px-5`,children:[u,m,h]}),t[15]=u,t[16]=m,t[17]=h,t[18]=g):g=t[18],g}function We(e){let t=(0,W.c)(37),{label:n,accentClass:r,aggregate:i}=e,a;t[0]===r?a=t[1]:(a=S(`absolute inset-x-5 top-0 h-0.5 rounded-full opacity-75`,r),t[0]=r,t[1]=a);let o;t[2]===a?o=t[3]:(o=(0,G.jsx)(`span`,{className:a}),t[2]=a,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,G.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/75`,children:n}),t[4]=n,t[5]=s);let c=i.processCount===1?`process`:`processes`,l;t[6]!==i.processCount||t[7]!==c?(l=(0,G.jsxs)(`div`,{className:`rounded-md bg-muted/55 px-1.5 py-0.5 font-mono text-3xs tabular-nums text-muted-foreground/70`,children:[i.processCount,` `,c]}),t[6]=i.processCount,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==s||t[10]!==l?(u=(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[s,l]}),t[9]=s,t[10]=l,t[11]=u):u=t[11];let d;t[12]===i.currentCpuPercent?d=t[13]:(d=i.currentCpuPercent.toFixed(1),t[12]=i.currentCpuPercent,t[13]=d);let f=`${d}%`,p;t[14]===f?p=t[15]:(p=(0,G.jsx)(Ge,{label:`CPU`,value:f}),t[14]=f,t[15]=p);let m;t[16]===i.currentRssBytes?m=t[17]:(m=V(i.currentRssBytes),t[16]=i.currentRssBytes,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,G.jsx)(Ge,{label:`Memory`,value:m}),t[18]=m,t[19]=h);let g;t[20]===i.ioReadBytesPerSecond?g=t[21]:(g=ke(i.ioReadBytesPerSecond),t[20]=i.ioReadBytesPerSecond,t[21]=g);let _;t[22]===g?_=t[23]:(_=(0,G.jsx)(Ge,{label:`Read`,value:g}),t[22]=g,t[23]=_);let v;t[24]===i.ioWriteBytesPerSecond?v=t[25]:(v=ke(i.ioWriteBytesPerSecond),t[24]=i.ioWriteBytesPerSecond,t[25]=v);let y;t[26]===v?y=t[27]:(y=(0,G.jsx)(Ge,{label:`Write`,value:v}),t[26]=v,t[27]=y);let b;t[28]!==h||t[29]!==_||t[30]!==y||t[31]!==p?(b=(0,G.jsxs)(`div`,{className:`mt-3.5 grid grid-cols-2 gap-x-4 gap-y-2.5`,children:[p,h,_,y]}),t[28]=h,t[29]=_,t[30]=y,t[31]=p,t[32]=b):b=t[32];let x;return t[33]!==b||t[34]!==o||t[35]!==u?(x=(0,G.jsxs)(`div`,{className:`relative overflow-hidden border-t border-border/60 px-4 py-4 first:border-t-0 md:border-t-0 md:border-l md:first:border-l-0 sm:px-5`,children:[o,u,b]}),t[33]=b,t[34]=o,t[35]=u,t[36]=x):x=t[36],x}function Ge(e){let t=(0,W.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,G.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/45`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,G.jsx)(`div`,{className:`truncate font-mono text-xs font-medium tabular-nums text-foreground/90`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,G.jsxs)(`div`,{className:`min-w-0`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Ke(e){let t=(0,W.c)(21),{label:n,health:r}=e,i;t[0]!==r.lastError||t[1]!==r.status?(i=r.status===`unavailable`&&l(r.lastError,Ye),t[0]=r.lastError,t[1]=r.status,t[2]=i):i=t[2];let a=i,o;t[3]===n?o=t[4]:(o=(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:n}),t[3]=n,t[4]=o);let s;t[5]!==a||t[6]!==r.lastError?(s=a?`Available when this page runs inside the desktop app.`:te(r.lastError,{onNone:Je,onSome:qe}),t[5]=a,t[6]=r.lastError,t[7]=s):s=t[7];let c;t[8]===s?c=t[9]:(c=(0,G.jsx)(`div`,{className:`mt-1 text-2xs leading-relaxed text-muted-foreground/65`,children:s}),t[8]=s,t[9]=c);let u;t[10]!==o||t[11]!==c?(u=(0,G.jsxs)(`div`,{className:`min-w-0`,children:[o,c]}),t[10]=o,t[11]=c,t[12]=u):u=t[12];let d;t[13]===a?d=t[14]:(d=a?{label:`Desktop only`,tone:`neutral`}:void 0,t[13]=a,t[14]=d);let f;t[15]!==r.status||t[16]!==d?(f=(0,G.jsx)(Ve,{label:``,status:r.status,presentation:d}),t[15]=r.status,t[16]=d,t[17]=f):f=t[17];let p;return t[18]!==u||t[19]!==f?(p=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-t border-border/50 py-3 first:border-t-0`,children:[u,f]}),t[18]=u,t[19]=f,t[20]=p):p=t[20],p}function qe(e){return e}function Je(){return`No reported errors`}function Ye(e){return e.includes(`'web' mode`)}function Xe(e){let t=(0,W.c)(10),{label:n,value:r,valueClassName:i}=e,a;t[0]===n?a=t[1]:(a=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/75`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=S(`min-w-0 truncate text-right font-mono text-2xs tabular-nums text-foreground/85`,i),t[2]=i,t[3]=o);let s;t[4]!==o||t[5]!==r?(s=(0,G.jsx)(`span`,{className:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==s?(c=(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-border/50 py-2.5 first:border-t-0`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function Ze(e){let t=(0,W.c)(8),{selectedWindowMs:n,onSelect:r}=e,i=String(n),a;t[0]===i?a=t[1]:(a=[i],t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=e=>{let t=Oe.find(t=>String(t.windowMs)===e[0]);t&&r(t.windowMs)},t[2]=r,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=Oe.map(Qe),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,G.jsx)(pe,{"aria-label":`Resource history period`,variant:`segmented`,value:a,onValueChange:o,children:s}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}function Qe(e){return(0,G.jsx)(me,{value:String(e.windowMs),children:e.label},e.windowMs)}function $e(e){let t=(0,W.c)(15),{buckets:n}=e,r,i,a,o;if(t[0]!==n){let e=De(n),s=Math.max(1,...n.map(et));a=`border-t border-border/60 px-4 py-4 sm:px-5`;let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-foreground/70`}),` CPU average`]}),t[5]=c):c=t[5];let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-info/70`}),` I/O reads`]}),t[6]=l):l=t[6],t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-3xs text-muted-foreground/65`,children:[c,l,(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-warning/80`}),` I/O writes`]})]}),t[7]=o):o=t[7],r=`flex h-32 items-end gap-1 overflow-hidden rounded-lg border border-border/40 bg-muted/8 px-2 pt-3 pb-2`,i=n.map(t=>{let n=Y({value:t.avgCpuPercent,max:e,minimumVisiblePercent:2}),r=Y({value:t.ioReadBytes,max:s,minimumVisiblePercent:1}),i=Y({value:t.ioWriteBytes,max:s,minimumVisiblePercent:1});return(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsxs)(`div`,{className:`grid h-full min-w-1 flex-1 grid-cols-3 items-end gap-px`,children:[(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-foreground/65`,style:{height:`${n}%`}}),(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-info/70`,style:{height:`${r}%`}}),(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-warning/80`,style:{height:`${i}%`}})]})}),(0,G.jsx)(F,{side:`top`,className:`text-left`,children:(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,G.jsxs)(`div`,{children:[`CPU avg `,t.avgCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`div`,{children:[`CPU peak `,t.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`div`,{children:[`Read `,V(t.ioReadBytes)]}),(0,G.jsxs)(`div`,{children:[`Write `,V(t.ioWriteBytes)]})]})})]},p(t.startedAt))}),t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];let s;t[8]!==r||t[9]!==i?(s=(0,G.jsx)(`div`,{className:r,children:i}),t[8]=r,t[9]=i,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==o||t[13]!==s?(c=(0,G.jsxs)(`div`,{className:a,children:[o,s]}),t[11]=a,t[12]=o,t[13]=s,t[14]=c):c=t[14],c}function et(e){return e.ioReadBytes+e.ioWriteBytes}function tt(e){let t=(0,W.c)(26),{process:n,collapsed:r,onToggle:i}=e,a;t[0]===n?a=t[1]:(a=Fe(n),t[0]=n,t[1]=a);let o=a,s=n.childPids.length>0,c=`${Math.min(n.depth,7)*10}px`,l;t[2]===c?l=t[3]:(l={paddingLeft:c},t[2]=c,t[3]=l);let u;t[4]!==r||t[5]!==s||t[6]!==o||t[7]!==i||t[8]!==n?(u=s?(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost-muted`,onClick:()=>i(n),"aria-label":r?`Expand ${o}`:`Collapse ${o}`,children:(0,G.jsx)(E,{className:`size-3.5`,icon:r?D:T})}):(0,G.jsx)(`span`,{className:`size-5`,"aria-hidden":!0}),t[4]=r,t[5]=s,t[6]=o,t[7]=i,t[8]=n,t[9]=u):u=t[9];let d;t[10]===n.category?d=t[11]:(d=S(`size-1.5 rounded-full`,Le(n.category)),t[10]=n.category,t[11]=d);let p;t[12]===d?p=t[13]:(p=(0,G.jsx)(`span`,{className:d}),t[12]=d,t[13]=p);let m;t[14]===o?m=t[15]:(m=(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[14]=o,t[15]=m);let h=n.command||n.name,g;t[16]===h?g=t[17]:(g=(0,G.jsx)(F,{side:`top`,variant:`code`,children:h}),t[16]=h,t[17]=g);let _;t[18]!==m||t[19]!==g?(_=(0,G.jsxs)(I,{children:[m,g]}),t[18]=m,t[19]=g,t[20]=_):_=t[20];let v;return t[21]!==_||t[22]!==l||t[23]!==u||t[24]!==p?(v=(0,G.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,p,_]}),t[21]=_,t[22]=l,t[23]=u,t[24]=p,t[25]=v):v=t[25],v}function nt(e){return e.category===`server-child`||e.category===`provider-root`||e.category===`terminal-root`}function rt(e){let t=(0,W.c)(10),{process:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e;if(!nt(n)){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-3xs text-muted-foreground/35`,children:`—`}),t[0]=e):e=t[0],e}let o;t[1]!==n||t[2]!==i?(o=i.has(Ne(n)),t[1]=n,t[2]=i,t[3]=o):o=t[3];let s=!r||o,c;t[4]!==a||t[5]!==n?(c=e=>a(n,e),t[4]=a,t[5]=n,t[6]=c):c=t[6];let l;return t[7]!==s||t[8]!==c?(l=(0,G.jsx)(K,{disabled:s,onSignal:c}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function it(e){let t=(0,W.c)(22),{processes:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e,[o,s]=(0,q.useState)(at),c;t[0]!==o||t[1]!==n?(c=Te(n,o),t[0]=o,t[1]=n,t[2]=c):c=t[2];let l=c,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{let t=Ne(e);s(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[20%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[7%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[6%]`}),(0,G.jsx)(`col`,{className:`w-[4%]`})]}),t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,G.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read/s`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write/s`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read Total`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write Total`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,G.jsx)(`th`,{className:`px-2 py-2 text-right font-semibold sm:pr-4`,children:`Kill`})]})}),t[5]=p):p=t[5];let m;t[6]===l.length?m=t[7]:(m=l.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:11,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`Waiting for the native process monitor.`})}):null,t[6]=l.length,t[7]=m);let h;if(t[8]!==r||t[9]!==o||t[10]!==a||t[11]!==i||t[12]!==l){let e;t[14]!==r||t[15]!==o||t[16]!==a||t[17]!==i?(e=e=>(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,G.jsx)(tt,{process:e,collapsed:o.has(Ne(e)),onToggle:d})}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Ie(e.category)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:Ae(e.cpuTimeMs)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:V(e.residentBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:ke(e.ioReadBytesPerSecond)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:ke(e.ioWriteBytesPerSecond)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:V(e.ioReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{children:V(e.ioWriteBytes)})}),(0,G.jsx)(F,{side:`top`,children:Re(e.ioSemantics)})]})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.identity.pid}),(0,G.jsx)(`td`,{className:`px-2 py-2 text-right sm:pr-4`,children:(0,G.jsx)(rt,{process:e,canMaintainEnvironment:r,signalingKeys:i,onSignal:a})})]},Ne(e)),t[14]=r,t[15]=o,t[16]=a,t[17]=i,t[18]=e):e=t[18],h=l.map(e),t[8]=r,t[9]=o,t[10]=a,t[11]=i,t[12]=l,t[13]=h}else h=t[13];let g;return t[19]!==m||t[20]!==h?(g=(0,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(L,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(68vh,48rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1320px] table-fixed text-left text-xs`,children:[f,p,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[m,h]})]})})}),t[19]=m,t[20]=h,t[21]=g):g=t[21],g}function at(){return new Set}function ot(e){let t=(0,W.c)(9),{processes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[7%]`}),(0,G.jsx)(`col`,{className:`w-[5%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak Mem`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Samples`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`PID`})]})}),t[1]=i):i=t[1];let a;t[2]===n.length?a=t[3]:(a=n.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:9,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`No retained process samples in this window.`})}):null,t[2]=n.length,t[3]=a);let o;t[4]===n?o=t[5]:(o=n.map(st),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==o?(s=(0,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(L,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[28rem] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1020px] table-fixed text-left text-xs`,children:[r,i,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[a,o]})]})})}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function st(e){return(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.name||e.command})}),(0,G.jsx)(F,{side:`top`,variant:`code`,children:e.command||e.name})]})}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Ie(e.category)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:Ae(e.cpuTimeMs)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:V(e.peakRssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:V(e.ioReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:V(e.ioWriteBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.sampleCount}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground sm:pr-5`,children:e.identity.pid})]},Pe(e))}function ct(e){let t=(0,W.c)(9),{entries:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[22%]`}),(0,G.jsx)(`col`,{className:`w-[28%]`}),(0,G.jsx)(`col`,{className:`w-[14%]`}),(0,G.jsx)(`col`,{className:`w-[14%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[12%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`thead`,{className:`border-b border-border/60 text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Component`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Operation`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Read`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Write`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Count`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`Time`})]})}),t[1]=i):i=t[1];let a;t[2]===n.length?a=t[3]:(a=n.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:6,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`No instrumented application I/O has been recorded yet.`})}):null,t[2]=n.length,t[3]=a);let o;t[4]===n?o=t[5]:(o=n.map(lt),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==o?(s=(0,G.jsx)(`div`,{className:`overflow-x-auto border-t border-border/60`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[720px] table-fixed text-left text-xs`,children:[r,i,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[a,o]})]})}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function lt(e){return(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`truncate px-4 py-2 font-medium text-foreground sm:pl-5`,children:e.component}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-muted-foreground`,children:e.operation}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:V(e.logicalReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:V(e.logicalWriteBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:e.count}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground sm:pr-5`,children:[(e.durationMs/1e3).toFixed(2),`s`]})]},`${e.component}:${e.operation}`)}function ut(e){let t=(0,W.c)(207),{environmentId:n}=e,[r,i]=(0,q.useState)(9e5),o;t[0]===r?o=t[1]:(o=Oe.find(e=>e.windowMs===r)??Oe[1],t[0]=r,t[1]=o);let l=o,u=se(n,c),p=Ce(n),g=p.retry,y;t[2]!==l.bucketMs||t[3]!==l.windowMs?(y={windowMs:l.windowMs,bucketMs:l.bucketMs},t[2]=l.bucketMs,t[3]=l.windowMs,t[4]=y):y=t[4];let b=we(y,n),x;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(x={reportFailure:!1},t[5]=x):x=t[5];let S=de(j.signalProcess,x),[w,re]=(0,q.useState)(ht),T;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(T=new Set,t[6]=T):T=t[6];let E=(0,q.useRef)(T),D=(0,q.useRef)(n),k,A;t[7]===n?(k=t[8],A=t[9]):(k=()=>(D.current=n,()=>{D.current=null}),A=[n],t[7]=n,t[8]=k,t[9]=A),(0,q.useEffect)(k,A);let[le,ue]=(0,q.useState)(!1),M=p.data,N=M?.groups.allP4,fe;t[10]===S?fe=t[11]:(fe=async(e,t)=>{let n=D.current;if(n===null||!ce(n,`environment:maintain`))return;let r=Ne(e);if(E.current.has(r))return;let i=new Set(E.current).add(r);E.current=i,re(i);let a=()=>{let e=new Set(E.current);e.delete(r),E.current=e,re(e)};if(t===`SIGKILL`){let n;try{n=await oe().dialogs.confirm(`Send SIGKILL to process ${e.identity.pid}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){let n=e;a(),O.add({type:`error`,title:`Could not confirm signal`,description:n instanceof Error?n.message:`Failed to send ${t}.`});return}if(!n){a();return}}if(D.current!==n||!ce(n,`environment:maintain`)){a();return}S({environmentId:n,input:{pid:e.identity.pid,startTimeMs:e.identity.startTimeMs,signal:t}}).then(n=>{if(n._tag===`Failure`){if(ie(n))return;throw ae(n)}n.value.signaled||O.add({type:`error`,title:`Could not send ${t}`,description:m(n.value.message,()=>`Failed to send ${t} to process ${e.identity.pid}.`)})}).catch(e=>{O.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}).finally(()=>{a()})},t[10]=S,t[11]=fe);let pe=fe,me;t[12]===g?me=t[13]:(me=()=>{let e=D.current;e!==null&&ce(e,`environment:maintain`)&&(ue(!0),g().catch(mt).finally(()=>{ue(!1)}))},t[12]=g,t[13]=me);let he=me,L,ge,_e,ve,z,B,be,xe,Se,H,U,K,J,Te,Y,De,Pe,Fe,Ie;if(t[14]!==N||t[15]!==M||t[16]!==p.error||t[17]!==p.isPending||t[18]!==p.refresh){z=M?ne(M.speedLimitPercent):null;let e=M?.health.native.status??null,n;t[38]!==e||t[39]!==p.error?(n=Ee({nativeStatus:e,error:p.error}),t[38]=e,t[39]=p.error,t[40]=n):n=t[40],_e=n,ve=M!==null&&(M.power.onBattery!==`unknown`||M.power.lowPowerMode!==`unknown`||M.power.idle!==`unknown`||M.power.locked!==`unknown`||M.power.thermalState!==`unknown`),ge=R,De=`Resource monitor`,t[41]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,G.jsx)(a,{className:`size-4 text-muted-foreground`}),t[41]=Pe):Pe=t[41];let r;t[42]===M?r=t[43]:(r=M?(0,G.jsx)(Ve,{label:`Native`,status:M.health.native.status}):null,t[42]=M,t[43]=r);let i=M?.readAt??null,o;t[44]===i?o=t[45]:(o=(0,G.jsx)(He,{sampledAt:i}),t[44]=i,t[45]=o);let c;t[46]===p.isPending?c=t[47]:(c=(0,G.jsx)(ye,{size:`xs`,refreshing:p.isPending}),t[46]=p.isPending,t[47]=c);let l;t[48]!==c||t[49]!==p.isPending||t[50]!==p.refresh?(l=(0,G.jsx)(P,{render:(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost`,disabled:p.isPending,onClick:p.refresh,"aria-label":`Refresh resource telemetry`,children:c})}),t[48]=c,t[49]=p.isPending,t[50]=p.refresh,t[51]=l):l=t[51];let u;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,G.jsx)(F,{side:`top`,children:`Refresh telemetry snapshot`}),t[52]=u):u=t[52];let m;t[53]===l?m=t[54]:(m=(0,G.jsxs)(I,{children:[l,u]}),t[53]=l,t[54]=m),t[55]!==r||t[56]!==o||t[57]!==m?(Fe=(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r,o,m]}),t[55]=r,t[56]=o,t[57]=m,t[58]=Fe):Fe=t[58],Te=`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-sm/5`;let g;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:`P4 system footprint`}),(0,G.jsx)(`p`,{className:`mt-1 max-w-xl text-xs leading-relaxed text-muted-foreground`,children:`Live native counters for the server, providers, terminals, desktop processes, and the monitor itself.`})]}),t[59]=g):g=t[59];let _;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),t[60]=_):_=t[60];let y;t[61]===M?y=t[62]:(y=M?Me(M.sampleIntervalMs):`...`,t[61]=M,t[62]=y),t[63]===y?Y=t[64]:(Y=(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-border/60 bg-linear-to-r from-muted/45 via-muted/20 to-transparent px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-5`,children:[g,(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs text-muted-foreground/65`,children:[_,`Sampling every `,y]})]}),t[63]=y,t[64]=Y),xe=`grid grid-cols-2 divide-x divide-y divide-border/55 md:grid-cols-3`;let b;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,G.jsx)(v,{className:`size-3.5`}),t[65]=b):b=t[65];let x;t[66]===N?x=t[67]:(x=N?`${N.currentCpuPercent.toFixed(1)}%`:`...`,t[66]=N,t[67]=x);let te;t[68]===N?te=t[69]:(te=N?`${Ae(N.cpuTimeMs)} observed CPU time`:void 0,t[68]=N,t[69]=te),t[70]!==x||t[71]!==te?(Se=(0,G.jsx)(Ue,{icon:b,label:`Current CPU`,value:x,detail:te}),t[70]=x,t[71]=te,t[72]=Se):Se=t[72];let S;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,G.jsx)(h,{className:`size-3.5`}),t[73]=S):S=t[73];let C;t[74]===N?C=t[75]:(C=N?V(N.currentRssBytes):`...`,t[74]=N,t[75]=C);let w;t[76]===N?w=t[77]:(w=N?`${V(N.peakRssBytes)} combined process peaks`:void 0,t[76]=N,t[77]=w),t[78]!==C||t[79]!==w?(H=(0,G.jsx)(Ue,{icon:S,label:`Resident memory`,value:C,detail:w}),t[78]=C,t[79]=w,t[80]=H):H=t[80];let re;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,G.jsx)(a,{className:`size-3.5`}),t[81]=re):re=t[81];let ie=N?String(N.processCount):`...`,ae=N?`${N.processStarts} starts · ${N.processExits} exits`:void 0;t[82]!==ie||t[83]!==ae?(U=(0,G.jsx)(Ue,{icon:re,label:`Process count`,value:ie,detail:ae}),t[82]=ie,t[83]=ae,t[84]=U):U=t[84];let T;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,G.jsx)(d,{className:`size-3.5`}),t[85]=T):T=t[85];let E;t[86]===N?E=t[87]:(E=N?ke(N.ioReadBytesPerSecond):`...`,t[86]=N,t[87]=E);let D;t[88]===N?D=t[89]:(D=N?`${V(N.ioReadBytes)} observed`:void 0,t[88]=N,t[89]=D),t[90]!==E||t[91]!==D?(K=(0,G.jsx)(Ue,{icon:T,label:`Read throughput`,value:E,detail:D}),t[90]=E,t[91]=D,t[92]=K):K=t[92];let O;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,G.jsx)(ee,{className:`size-3.5`}),t[93]=O):O=t[93];let k;t[94]===N?k=t[95]:(k=N?ke(N.ioWriteBytesPerSecond):`...`,t[94]=N,t[95]=k);let A;t[96]===N?A=t[97]:(A=N?`${V(N.ioWriteBytes)} observed`:void 0,t[96]=N,t[97]=A);let oe=N&&N.ioWriteBytesPerSecond>=10485760?`danger`:N&&N.ioWriteBytesPerSecond>=1048576?`warning`:`default`;t[98]!==k||t[99]!==A||t[100]!==oe?(J=(0,G.jsx)(Ue,{icon:O,label:`Write throughput`,value:k,detail:A,tone:oe}),t[98]=k,t[99]=A,t[100]=oe,t[101]=J):J=t[101],L=Ue,t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,G.jsx)(s,{className:`size-3.5`}),t[102]=Ie):Ie=t[102],B=`CPU speed limit`,be=M?z===null?`Unknown`:`${z.toFixed(0)}%`:`...`,t[14]=N,t[15]=M,t[16]=p.error,t[17]=p.isPending,t[18]=p.refresh,t[19]=L,t[20]=ge,t[21]=_e,t[22]=ve,t[23]=z,t[24]=B,t[25]=be,t[26]=xe,t[27]=Se,t[28]=H,t[29]=U,t[30]=K,t[31]=J,t[32]=Te,t[33]=Y,t[34]=De,t[35]=Pe,t[36]=Fe,t[37]=Ie}else L=t[19],ge=t[20],_e=t[21],ve=t[22],z=t[23],B=t[24],be=t[25],xe=t[26],Se=t[27],H=t[28],U=t[29],K=t[30],J=t[31],Te=t[32],Y=t[33],De=t[34],Pe=t[35],Fe=t[36],Ie=t[37];let Le=M?`${M.power.thermalState} thermal state`:void 0,Re=z!==null&&z<80?`warning`:`default`,Be;t[103]!==L||t[104]!==B||t[105]!==be||t[106]!==Le||t[107]!==Re||t[108]!==Ie?(Be=(0,G.jsx)(L,{icon:Ie,label:B,value:be,detail:Le,tone:Re}),t[103]=L,t[104]=B,t[105]=be,t[106]=Le,t[107]=Re,t[108]=Ie,t[109]=Be):Be=t[109];let Ge;t[110]!==xe||t[111]!==Se||t[112]!==H||t[113]!==U||t[114]!==K||t[115]!==J||t[116]!==Be?(Ge=(0,G.jsxs)(`div`,{className:xe,children:[Se,H,U,K,J,Be]}),t[110]=xe,t[111]=Se,t[112]=H,t[113]=U,t[114]=K,t[115]=J,t[116]=Be,t[117]=Ge):Ge=t[117];let qe;t[118]===p.error?qe=t[119]:(qe=p.error?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 border-t border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive sm:px-5`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:p.error})]}):null,t[118]=p.error,t[119]=qe);let Je;t[120]===M?Je=t[121]:(Je=M?(0,G.jsxs)(`div`,{className:`grid border-t border-border/60 bg-muted/10 md:grid-cols-3`,children:[(0,G.jsx)(We,{label:`Backend + agents`,accentClass:`bg-success/80`,aggregate:M.groups.backend}),(0,G.jsx)(We,{label:`Desktop`,accentClass:`bg-info/80`,aggregate:M.groups.electron}),(0,G.jsx)(We,{label:`Monitor overhead`,accentClass:`bg-warning/80`,aggregate:M.groups.monitor})]}):null,t[120]=M,t[121]=Je);let Ye;t[122]!==Te||t[123]!==Y||t[124]!==Ge||t[125]!==qe||t[126]!==Je?(Ye=(0,G.jsxs)(`div`,{className:Te,children:[Y,Ge,qe,Je]}),t[122]=Te,t[123]=Y,t[124]=Ge,t[125]=qe,t[126]=Je,t[127]=Ye):Ye=t[127];let Qe;t[128]!==ge||t[129]!==De||t[130]!==Pe||t[131]!==Fe||t[132]!==Ye?(Qe=(0,G.jsx)(ge,{title:De,icon:Pe,headerAction:Fe,children:Ye}),t[128]=ge,t[129]=De,t[130]=Pe,t[131]=Fe,t[132]=Ye,t[133]=Qe):Qe=t[133];let et;t[134]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,G.jsx)(s,{className:`size-4 text-muted-foreground`}),t[134]=et):et=t[134];let tt;t[135]!==_e||t[136]!==le||t[137]!==he?(tt=_e?(0,G.jsxs)(f,{size:`xs`,variant:`outline`,disabled:le,onClick:he,children:[(0,G.jsx)(ye,{size:`xs`,refreshing:le}),`Retry monitor`]}):null,t[135]=_e,t[136]=le,t[137]=he,t[138]=tt):tt=t[138];let nt;t[139]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,G.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,G.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,G.jsx)(_,{className:`size-3.5`})}),`Host state`]}),t[139]=nt):nt=t[139];let rt;t[140]!==ve||t[141]!==M?(rt=(0,G.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[nt,ve&&M?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Xe,{label:`Power source`,value:ze(M.power.onBattery,{true:`Battery`,false:`External power`})}),(0,G.jsx)(Xe,{label:`Low power mode`,value:ze(M.power.lowPowerMode,{true:`Enabled`,false:`Disabled`})}),(0,G.jsx)(Xe,{label:`Idle`,value:`${ze(M.power.idle,{true:`Idle`,false:`Active`})}${M.power.idleSeconds===null?``:` · ${Math.round(M.power.idleSeconds)}s`}`}),(0,G.jsx)(Xe,{label:`Session`,value:M.power.suspended?`Suspended`:ze(M.power.locked,{true:`Locked`,false:`Unlocked`})}),(0,G.jsx)(Xe,{label:`Thermal`,value:M.power.thermalState,valueClassName:M.power.thermalState===`serious`||M.power.thermalState===`critical`?`text-destructive`:void 0})]}):(0,G.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/70 bg-muted/20 px-4 py-5`,children:[(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Desktop host signals not connected`}),(0,G.jsx)(`p`,{className:`mt-1.5 max-w-sm text-2xs leading-relaxed text-muted-foreground/70`,children:`Power, idle, lock, and thermal state are supplied by the desktop host. Process telemetry remains fully active in this browser session.`})]})]}),t[140]=ve,t[141]=M,t[142]=rt):rt=t[142];let at;t[143]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,G.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,G.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,G.jsx)(s,{className:`size-3.5`})}),`Collection health`]}),t[143]=at):at=t[143];let st;t[144]===M?st=t[145]:(st=(0,G.jsxs)(`div`,{className:`border-t border-border/60 px-4 py-4 md:border-t-0 sm:px-5`,children:[at,M?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ke,{label:`Native process monitor`,health:M.health.native}),(0,G.jsx)(Ke,{label:`Electron main process`,health:M.health.desktop}),(0,G.jsx)(Xe,{label:`Collection time`,value:je(M.health.collectionDurationMicros)}),(0,G.jsx)(Xe,{label:`Process scan`,value:`${M.health.retainedProcessCount}/${M.health.scannedProcessCount} retained`}),(0,G.jsx)(Xe,{label:`Inaccessible`,value:String(M.health.inaccessibleProcessCount),valueClassName:M.health.inaccessibleProcessCount>0?`text-warning-foreground`:void 0}),(0,G.jsx)(Xe,{label:`Sidecar`,value:te(M.health.sidecarVersion,{onNone:pt,onSome:e=>`${e}${te(M.health.sidecarPid,{onNone:ft,onSome:dt})}`})}),(0,G.jsx)(Xe,{label:`Restarts`,value:String(M.health.restartCount)})]}):(0,G.jsx)(`div`,{className:`py-4 text-xs text-muted-foreground`,children:`Waiting for collector health.`})]}),t[144]=M,t[145]=st);let lt;t[146]!==rt||t[147]!==st?(lt=(0,G.jsxs)(`div`,{className:`grid overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5 md:grid-cols-2 md:divide-x md:divide-border/60`,children:[rt,st]}),t[146]=rt,t[147]=st,t[148]=lt):lt=t[148];let ut;t[149]!==tt||t[150]!==lt?(ut=(0,G.jsx)(R,{title:`Host & collection`,icon:et,headerAction:tt,children:lt}),t[149]=tt,t[150]=lt,t[151]=ut):ut=t[151];let gt;t[152]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,G.jsx)(d,{className:`size-4 text-muted-foreground`}),t[152]=gt):gt=t[152];let _t;t[153]===r?_t=t[154]:(_t=(0,G.jsx)(Ze,{selectedWindowMs:r,onSelect:i}),t[153]=r,t[154]=_t);let vt;t[155]===b.isPending?vt=t[156]:(vt=(0,G.jsx)(ye,{size:`xs`,refreshing:b.isPending}),t[155]=b.isPending,t[156]=vt);let yt;t[157]!==b.isPending||t[158]!==b.refresh||t[159]!==vt?(yt=(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost`,disabled:b.isPending,onClick:b.refresh,"aria-label":`Refresh resource history`,children:vt}),t[157]=b.isPending,t[158]=b.refresh,t[159]=vt,t[160]=yt):yt=t[160];let bt;t[161]!==_t||t[162]!==yt?(bt=(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_t,yt]}),t[161]=_t,t[162]=yt,t[163]=bt):bt=t[163];let xt;t[164]===b.error?xt=t[165]:(xt=b.error?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive sm:px-5`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:b.error})]}):null,t[164]=b.error,t[165]=xt);let X;t[166]===b.data?.buckets?X=t[167]:(X=b.data?.buckets??[],t[166]=b.data?.buckets,t[167]=X);let Z;t[168]===X?Z=t[169]:(Z=(0,G.jsx)($e,{buckets:X}),t[168]=X,t[169]=Z);let St;t[170]===b.data?.topProcesses?St=t[171]:(St=b.data?.topProcesses??[],t[170]=b.data?.topProcesses,t[171]=St);let Ct;t[172]===St?Ct=t[173]:(Ct=(0,G.jsx)(ot,{processes:St}),t[172]=St,t[173]=Ct);let wt;t[174]!==xt||t[175]!==Z||t[176]!==Ct?(wt=(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[xt,Z,Ct]}),t[174]=xt,t[175]=Z,t[176]=Ct,t[177]=wt):wt=t[177];let Tt;t[178]!==bt||t[179]!==wt?(Tt=(0,G.jsx)(R,{title:`Resource timeline`,icon:gt,headerAction:bt,children:wt}),t[178]=bt,t[179]=wt,t[180]=Tt):Tt=t[180];let Et;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(Et=(0,G.jsx)(v,{className:`size-4 text-muted-foreground`}),t[181]=Et):Et=t[181];let Q;t[182]===M?Q=t[183]:(Q=M?(0,G.jsxs)(`span`,{className:`text-3xs text-muted-foreground/55`,children:[`Identity: `,(0,G.jsx)(`span`,{className:`font-mono`,children:`PID + start time`})]}):null,t[182]=M,t[183]=Q);let Dt;t[184]===M?.processes?Dt=t[185]:(Dt=M?.processes??[],t[184]=M?.processes,t[185]=Dt);let $;t[186]!==u||t[187]!==pe||t[188]!==w||t[189]!==Dt?($=(0,G.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:(0,G.jsx)(it,{processes:Dt,canMaintainEnvironment:u,signalingKeys:w,onSignal:pe})}),t[186]=u,t[187]=pe,t[188]=w,t[189]=Dt,t[190]=$):$=t[190];let Ot;t[191]!==Q||t[192]!==$?(Ot=(0,G.jsx)(R,{title:`Live process tree`,icon:Et,headerAction:Q,children:$}),t[191]=Q,t[192]=$,t[193]=Ot):Ot=t[193];let kt,At;t[194]===Symbol.for(`react.memo_cache_sentinel`)?(kt=(0,G.jsx)(ee,{className:`size-4 text-muted-foreground`}),At=(0,G.jsx)(`span`,{className:`text-3xs text-muted-foreground/55`,children:`Logical bytes by operation`}),t[194]=kt,t[195]=At):(kt=t[194],At=t[195]);let jt;t[196]===Symbol.for(`react.memo_cache_sentinel`)?(jt=(0,G.jsx)(`div`,{className:`bg-muted/15 px-4 py-3 text-2xs leading-relaxed text-muted-foreground sm:px-5`,children:`Native counters identify which process is reading or writing. These application-level counters identify known P4 Code operations so process spikes can be correlated with specific persistence and logging paths.`}),t[196]=jt):jt=t[196];let Mt;t[197]===M?.attribution.entries?Mt=t[198]:(Mt=M?.attribution.entries??[],t[197]=M?.attribution.entries,t[198]=Mt);let Nt;t[199]===Mt?Nt=t[200]:(Nt=(0,G.jsx)(R,{title:`Instrumented application I/O`,icon:kt,headerAction:At,children:(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[jt,(0,G.jsx)(ct,{entries:Mt})]})}),t[199]=Mt,t[200]=Nt);let Pt;return t[201]!==Qe||t[202]!==ut||t[203]!==Tt||t[204]!==Ot||t[205]!==Nt?(Pt=(0,G.jsxs)(G.Fragment,{children:[Qe,ut,Tt,Ot,Nt]}),t[201]=Qe,t[202]=ut,t[203]=Tt,t[204]=Ot,t[205]=Nt,t[206]=Pt):Pt=t[206],Pt}function dt(e){return` · PID ${e}`}function ft(){return``}function pt(){return`Unavailable`}function mt(e){O.add({type:`error`,title:`Could not restart resource monitor`,description:e instanceof Error?e.message:`The resource monitor retry failed.`})}function ht(){return new Set}var gt=[{key:`otlpTracesUrl`,label:`Traces`,signal:`traces`},{key:`otlpMetricsUrl`,label:`Metrics`,signal:`metrics`},{key:`otlpLogsUrl`,label:`Logs`,signal:`logs`}],_t=e=>/^https?:\/\/./i.test(e);function vt(e,t){if(e===``)return{label:`Off`,dot:`bg-muted-foreground/40`};if(t?.url!==e)return{label:`Not checked`,dot:`bg-muted-foreground/40`};let{result:n}=t;if(n===null)return{label:`Checking…`,dot:`bg-warning`};switch(n._tag){case`Accepted`:return{label:`Connected · ${Math.round(n.latencyMs)} ms`,dot:`bg-success`};case`Rejected`:return{label:`Rejected · HTTP ${n.status}`,dot:`bg-destructive`};case`Unreachable`:return{label:n.timedOut?`Timed out`:`Unreachable`,dot:`bg-destructive`}}}function yt(){let e=(0,W.c)(3),{environment:t,scope:n}=_e();if(n.kind!==`environment`||!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(R,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,G.jsx)(U,{target:`environment`,children:`Choose one environment to configure its telemetry exports.`})}),e[0]=t):t=e[0],t}let r;return e[1]===t.environmentId?r=e[2]:(r=(0,G.jsx)(bt,{},t.environmentId),e[1]=t.environmentId,e[2]=r),r}function bt(){let{environment:e}=_e(),t=ge(e=>e.observability),[n,r]=(0,q.useState)({}),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(null),c=e?.environmentId,l=w(j.checkOtlpEndpoint.permissionAtom(c??null)),u=l&&e?.serverConfig?.environment.capabilities.otlpEndpointCheck===!0,[d,p]=(0,q.useState)(()=>Object.fromEntries(gt.filter(({key:e})=>_t(t[e])).map(({key:e})=>[e,{url:t[e],result:null}]))),m=de(j.updateSettings,{reportFailure:!0}),h=de(j.checkOtlpEndpoint),g={...t,...n},_=gt.filter(({key:e})=>g[e].trim()!==t[e]),v=_.length>0,y=e?.serverConfig?.observability,b=async(e,t,n)=>{if(!c)return;let r=await h({environmentId:c,input:{signal:t,url:n}});p(t=>{if(t[e]?.url!==n||t[e].result!==null)return t;let i={...t};return r._tag===`Success`?i[e]={url:n,result:r.value}:delete i[e],i})},x=(e,t,n)=>{_t(n)&&(p(t=>({...t,[e]:{url:n,result:null}})),b(e,t,n))},ee=(0,q.useEffectEvent)(()=>{for(let{key:e,signal:t}of gt){let n=d[e];n?.result===null&&b(e,t,n.url)}});return(0,q.useEffect)(()=>{u&&ee()},[u]),(0,G.jsx)(R,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,G.jsxs)(`form`,{className:`grid gap-4 px-4 py-4 sm:px-5`,onSubmit:async t=>{if(t.preventDefault(),e&&!i){a(!0),s(null);try{(await m({environmentId:e.environmentId,input:{patch:{observability:Object.fromEntries(_.map(({key:e})=>[e,g[e]]))}}}))._tag===`Success`&&(r({}),s(`Saved. Restart the server to apply.`))}finally{a(!1)}}},children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Send traces, metrics, and logs to an OTLP HTTP receiver. Restart the server to apply. Environment variables override these settings.`}),!l&&(0,G.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`This connection lacks permission to change settings on`,` `,e?.label??`the selected environment`,`.`]}),gt.map(({key:e,label:n,signal:a})=>{let o=g[e].trim(),c=u?vt(o,d[e]):null;return(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[c&&(0,G.jsx)(B,{dotClassName:c.dot}),(0,G.jsxs)(xe,{htmlFor:e,children:[n,` endpoint`]})]}),c&&(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c.label})]}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(he,{id:e,size:`sm`,type:`url`,pattern:`[Hh][Tt][Tt][Pp][Ss]?://.*`,title:`Enter an HTTP or HTTPS endpoint, or leave empty to disable export.`,placeholder:`http://localhost:4318/v1/${a}`,value:g[e],disabled:i||!l,onChange:n=>{let i=n.target.value;r(n=>{let r={...n,[e]:i};return i.trim()===t[e]&&delete r[e],r}),s(null)}}),u&&(0,G.jsx)(f,{type:`button`,size:`sm`,variant:`outline`,disabled:!_t(o)||d[e]?.result===null,onClick:()=>void x(e,a,o),children:`Test`})]}),t[e]!==(y?.[e]??``)&&(0,G.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[`Running: `,y?.[e]||`Disabled`]})]},e)}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:o}),(0,G.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,G.jsx)(f,{type:`button`,size:`xs`,variant:`outline`,disabled:!v||i||!l,onClick:()=>{if(r({}),s(null),u)for(let{key:e,signal:n}of gt)d[e]?.url!==t[e]&&x(e,n,t[e])},children:`Discard`}),(0,G.jsx)(f,{type:`submit`,size:`xs`,disabled:!v||i||!l,children:i?`Saving…`:`Save`})]})]})]})})}var xt=new Intl.NumberFormat;function X(e){return xt.format(e)}function Z(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e>=1e4?1:2)} s`}function St(e){if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`],n=-1,r=e;do r/=1024,n+=1;while(r>=1024&&n<t.length-1);return`${r.toFixed(r>=10?1:2)} ${t[n]}`}function Ct(e){return e?N(p(e)):`No trace records`}function wt(e){return Ct(e).replaceAll(` `,`\xA0`)}function Tt(e){return e.length<=32?e:`${e.slice(0,18)}...${e.slice(-10)}`}function Et(e){return e?.includes(`not a live descendant`)??!1}function Q(e){let t=(0,W.c)(17),{label:n,value:r,tooltip:i,tone:a}=e,o=a===void 0?`default`:a,s;t[0]===n?s=t[1]:(s=(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:n}),t[0]=n,t[1]=s);let c;t[2]!==n||t[3]!==i?(c=i?(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`button`,{type:`button`,className:`cursor-pointer inline-flex size-3.5 shrink-0 items-center justify-center rounded-sm text-muted-foreground/60 hover:text-foreground`,"aria-label":`${n} details`,children:(0,G.jsx)(b,{className:`size-3`})})}),(0,G.jsx)(F,{side:`top`,children:i})]}):null,t[2]=n,t[3]=i,t[4]=c):c=t[4];let l;t[5]!==s||t[6]!==c?(l=(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-2xs font-medium uppercase tracking-widest text-muted-foreground/70`,children:[s,c]}),t[5]=s,t[6]=c,t[7]=l):l=t[7];let u=o===`warning`&&`text-warning-foreground`,d=o===`danger`&&`text-destructive`,f;t[8]!==u||t[9]!==d?(f=S(`mt-1 truncate font-mono text-lg font-semibold tabular-nums text-foreground`,u,d),t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]!==f||t[12]!==r?(p=(0,G.jsx)(`div`,{className:f,children:r}),t[11]=f,t[12]=r,t[13]=p):p=t[13];let m;return t[14]!==l||t[15]!==p?(m=(0,G.jsxs)(`div`,{className:`min-w-0 border-border/60 px-4 py-3 sm:px-5`,children:[l,p]}),t[14]=l,t[15]=p,t[16]=m):m=t[16],m}function Dt(e){let t=(0,W.c)(6),{children:n}=e,r,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/2 w-px bg-border/60`,"aria-hidden":!0}),i=(0,G.jsx)(`span`,{className:`pointer-events-none absolute inset-x-0 top-1/2 h-px bg-border/60 sm:hidden`,"aria-hidden":!0}),a=(0,G.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/4 hidden w-px bg-border/60 sm:block`,"aria-hidden":!0}),o=(0,G.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-3/4 hidden w-px bg-border/60 sm:block`,"aria-hidden":!0}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):(r=t[0],i=t[1],a=t[2],o=t[3]);let s;return t[4]===n?s=t[5]:(s=(0,G.jsxs)(`div`,{className:`relative grid grid-cols-2 sm:grid-cols-4`,children:[r,i,a,o,n]}),t[4]=n,t[5]=s),s}function $(e){let t=(0,W.c)(2),{label:n}=e,r;return t[0]===n?r=t[1]:(r=(0,G.jsx)(`div`,{className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:n}),t[0]=n,t[1]=r),r}function Ot(e){let t=(0,W.c)(21),{headers:n,children:r,minTableWidth:i,columnWidths:a}=e,o=i===void 0?`min-w-[640px]`:i,s=a&&`table-fixed`,c;t[0]!==o||t[1]!==s?(c=S(`w-full text-left text-xs`,o,s),t[0]=o,t[1]=s,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==n?(l=a?(0,G.jsx)(`colgroup`,{children:n.map((e,t)=>(0,G.jsx)(`col`,{className:a[t]},e))}):null,t[3]=a,t[4]=n,t[5]=l):l=t[5];let u;if(t[6]!==a||t[7]!==n){let e;t[9]!==a||t[10]!==n.length?(e=(e,t)=>(0,G.jsx)(`th`,{className:S(`whitespace-nowrap px-4 py-2.5 font-semibold first:sm:pl-5 last:sm:pr-5`,!a&&t===n.length-1&&`w-px`),children:e.replaceAll(` `,`\xA0`)},e),t[9]=a,t[10]=n.length,t[11]=e):e=t[11],u=n.map(e),t[6]=a,t[7]=n,t[8]=u}else u=t[8];let d;t[12]===u?d=t[13]:(d=(0,G.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsx)(`tr`,{children:u})}),t[12]=u,t[13]=d);let f;t[14]===r?f=t[15]:(f=(0,G.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:r}),t[14]=r,t[15]=f);let p;return t[16]!==c||t[17]!==l||t[18]!==d||t[19]!==f?(p=(0,G.jsx)(L,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:c,children:[l,d,f]})}),t[16]=c,t[17]=l,t[18]=d,t[19]=f,t[20]=p):p=t[20],p}function kt(e){let t=(0,W.c)(25),{traceId:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={target:`trace ID`,timeout:1200},t[0]=r):r=t[0];let{copyToClipboard:a,isCopied:o}=k(r),s;t[1]===n?s=t[2]:(s=Tt(n),t[1]=n,t[2]=s);let c;t[3]===s?c=t[4]:(c=(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-2xs`,children:s})}),t[3]=s,t[4]=c);let l;t[5]===n?l=t[6]:(l=(0,G.jsx)(F,{side:`top`,variant:`code`,children:n}),t[5]=n,t[6]=l);let u;t[7]!==c||t[8]!==l?(u=(0,G.jsxs)(I,{children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9];let d=o?`Copied trace ID`:`Copy trace ID`,p;t[10]!==a||t[11]!==n?(p=()=>a(n),t[10]=a,t[11]=n,t[12]=p):p=t[12];let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,G.jsx)(i,{className:`size-3`}),t[13]=m):m=t[13];let h;t[14]!==d||t[15]!==p?(h=(0,G.jsx)(P,{render:(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":d,onClick:p,children:m})}),t[14]=d,t[15]=p,t[16]=h):h=t[16];let g=o?`Copied`:`Copy full trace ID`,_;t[17]===g?_=t[18]:(_=(0,G.jsx)(F,{side:`top`,children:g}),t[17]=g,t[18]=_);let v;t[19]!==_||t[20]!==h?(v=(0,G.jsxs)(I,{children:[h,_]}),t[19]=_,t[20]=h,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==u?(y=(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 max-w-full items-center gap-2`,children:[u,v]}),t[22]=v,t[23]=u,t[24]=y):y=t[24],y}function At(e){let t=e.trim().split(/\s+/)[0];if(!t)return e;let n=t.replace(/^['"]|['"]$/g,``);return n.split(/[\\/]/).filter(Boolean).at(-1)??n}function jt(e){return e.depth>0?`Subprocess`:/\b(codex|claude|opencode|cursor)\b/i.test(e.command)?`Agent`:`Process`}function Mt(e){let t=(0,W.c)(22),{process:n,isExpanded:r,onToggle:i}=e,a;t[0]===n.command?a=t[1]:(a=At(n.command),t[0]=n.command,t[1]=a);let o=a,s=n.childPids.length>0,c=`${Math.min(n.depth,6)*10}px`,l;t[2]===c?l=t[3]:(l={paddingLeft:c},t[2]=c,t[3]=l);let u;t[4]!==s||t[5]!==r||t[6]!==o||t[7]!==i||t[8]!==n.pid?(u=s?(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":r?`Collapse ${o}`:`Expand ${o}`,onClick:()=>i(n.pid),children:(0,G.jsx)(E,{className:`size-3.5`,icon:r?T:D})}):(0,G.jsx)(`span`,{className:`size-5 shrink-0`,"aria-hidden":`true`}),t[4]=s,t[5]=r,t[6]=o,t[7]=i,t[8]=n.pid,t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,G.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-success/80`}),t[10]=d):d=t[10];let p;t[11]===o?p=t[12]:(p=(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[11]=o,t[12]=p);let m;t[13]===n.command?m=t[14]:(m=(0,G.jsx)(F,{side:`top`,variant:`code`,children:n.command}),t[13]=n.command,t[14]=m);let h;t[15]!==p||t[16]!==m?(h=(0,G.jsxs)(I,{children:[p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17];let g;return t[18]!==l||t[19]!==u||t[20]!==h?(g=(0,G.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,d,h]}),t[18]=l,t[19]=u,t[20]=h,t[21]=g):g=t[21],g}function Nt(e){let t=(0,W.c)(18),{processes:n,canMaintainEnvironment:r,signalingPid:i,onSignal:a,emptyLabel:o}=e,[s,c]=(0,q.useState)(Pt),l;if(t[0]!==s||t[1]!==n){l=[];let e=null;for(let t of n){if(e!==null){if(t.depth>e)continue;e=null}l.push(t),s.has(t.pid)&&(e=t.depth)}t[0]=s,t[1]=n,t[2]=l}else l=t[2];let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[3]=d):d=t[3];let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[33%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[6%]`})]}),t[4]=p):p=t[4];let m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,G.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Name`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Type`}),(0,G.jsx)(`th`,{className:`p-2 text-right font-semibold sm:pr-4`,children:`Kill`})]})}),t[5]=m):m=t[5];let h;t[6]!==o||t[7]!==u.length?(h=u.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:7,className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:o??`No live descendant processes found.`})}):null,t[6]=o,t[7]=u.length,t[8]=h):h=t[8];let g;t[9]!==r||t[10]!==s||t[11]!==a||t[12]!==i||t[13]!==u?(g=u.map(e=>(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,G.jsx)(Mt,{process:e,isExpanded:!s.has(e.pid),onToggle:f})}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:St(e.rssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,G.jsx)(F,{side:`top`,variant:`code`,children:e.command})]})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground`,children:e.pid}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 align-middle text-muted-foreground`,children:jt(e)}),(0,G.jsx)(`td`,{className:`p-2 align-middle sm:pr-4`,children:(0,G.jsx)(K,{disabled:!r||i===e.pid,onSignal:t=>a(e.pid,t)})})]},e.pid)),t[9]=r,t[10]=s,t[11]=a,t[12]=i,t[13]=u,t[14]=g):g=t[14];let _;return t[15]!==h||t[16]!==g?(_=(0,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(L,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1040px] table-fixed text-left text-xs`,children:[p,m,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[h,g]})]})})}),t[15]=h,t[16]=g,t[17]=_):_=t[17],_}function Pt(){return new Set}var Ft=[{label:`5m`,windowMs:3e5,bucketMs:3e4},{label:`15m`,windowMs:9e5,bucketMs:6e4},{label:`30m`,windowMs:18e5,bucketMs:12e4},{label:`1h`,windowMs:36e5,bucketMs:3e5}];function It(e){if(e<60)return`${e.toFixed(e>=10?1:2)}s`;let t=e/60;return t<60?`${t.toFixed(t>=10?1:2)}m`:`${(t/60).toFixed(2)}h`}function Lt(e){let t=At(e);return t.length>42?`${t.slice(0,39)}...`:t}function Rt(e){let t=(0,W.c)(21),{process:n,visualDepth:r}=e,i;t[0]===n.command?i=t[1]:(i=Lt(n.command),t[0]=n.command,t[1]=i);let a=i,o=`${Math.min(r,6)*10}px`,s;t[2]===o?s=t[3]:(s={paddingLeft:o},t[2]=o,t[3]=s);let c=`${n.isServerRoot?`Root`:`Child`} process ${a}`,l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,G.jsx)(`span`,{className:`size-5 shrink-0`,"aria-hidden":`true`}),t[4]=l):l=t[4];let u=n.isServerRoot?`bg-warning/90`:`bg-success/80`,d;t[5]===u?d=t[6]:(d=S(`size-1.5 shrink-0 rounded-full`,u),t[5]=u,t[6]=d);let f;t[7]===d?f=t[8]:(f=(0,G.jsx)(`span`,{className:d}),t[7]=d,t[8]=f);let p;t[9]===a?p=t[10]:(p=(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:a})}),t[9]=a,t[10]=p);let m;t[11]===n.command?m=t[12]:(m=(0,G.jsx)(F,{side:`top`,variant:`code`,children:n.command}),t[11]=n.command,t[12]=m);let h;t[13]!==m||t[14]!==p?(h=(0,G.jsxs)(I,{children:[p,m]}),t[13]=m,t[14]=p,t[15]=h):h=t[15];let g;return t[16]!==h||t[17]!==s||t[18]!==c||t[19]!==f?(g=(0,G.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:s,"aria-label":c,children:[l,f,h]}),t[16]=h,t[17]=s,t[18]=c,t[19]=f,t[20]=g):g=t[20],g}function zt(e){let t=(0,W.c)(9),{buckets:n}=e,r;t[0]===n?r=t[1]:(r=Math.max(1,...n.map(Bt)),t[0]=n,t[1]=r);let i=r,a;if(t[2]!==n||t[3]!==i){let e;t[5]===i?e=t[6]:(e=e=>{let t=Math.max(2,e.maxCpuPercent/i*100),n=Math.max(2,e.avgCpuPercent/i*100);return(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`div`,{className:`flex h-full min-w-1 flex-1 items-end`,children:(0,G.jsxs)(`div`,{className:`relative h-full w-full`,"aria-label":`Average CPU ${e.avgCpuPercent.toFixed(1)}%, peak CPU ${e.maxCpuPercent.toFixed(1)}%`,children:[(0,G.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/15 transition-colors`,style:{height:`${t}%`}}),(0,G.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/60 transition-colors`,style:{height:`${n}%`}})]})})}),(0,G.jsxs)(F,{side:`top`,children:[`Avg `,e.avgCpuPercent.toFixed(1),`%, peak `,e.maxCpuPercent.toFixed(1),`%`]})]},p(e.startedAt))},t[5]=i,t[6]=e),a=n.map(e),t[2]=n,t[3]=i,t[4]=a}else a=t[4];let o;return t[7]===a?o=t[8]:(o=(0,G.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,G.jsx)(`div`,{className:`flex h-28 items-end gap-1 overflow-hidden rounded-sm bg-muted/10 p-2`,children:a})}),t[7]=a,t[8]=o),o}function Bt(e){return e.maxCpuPercent}function Vt(e){let t=(0,W.c)(8),{selectedWindowMs:n,onSelect:r}=e,i=String(n),a;t[0]===i?a=t[1]:(a=[i],t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=e=>{let t=Ft.find(t=>String(t.windowMs)===e[0]);t&&r(t.windowMs)},t[2]=r,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=Ft.map(Ht),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,G.jsx)(pe,{"aria-label":`Process history period`,variant:`segmented`,value:a,onValueChange:o,children:s}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}function Ht(e){return(0,G.jsx)(me,{value:String(e.windowMs),children:e.label},e.windowMs)}function Ut(e){let t=(0,W.c)(13),{processes:n,emptyLabel:r}=e,i=n.reduce(Wt,null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[16%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`})]}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Current`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Average`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Max Mem`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`PID`})]})}),t[1]=o):o=t[1];let s;t[2]!==r||t[3]!==n.length?(s=n.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:8,className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:r})}):null,t[2]=r,t[3]=n.length,t[4]=s):s=t[4];let c;if(t[5]!==n||t[6]!==i){let e;t[8]===i?e=t[9]:(e=e=>(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,G.jsx)(Rt,{process:e,visualDepth:e.isServerRoot||i===null?0:Math.max(1,e.depth-i+1)})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:It(e.cpuSecondsApprox)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.currentCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.avgCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:St(e.maxRssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,G.jsx)(F,{side:`top`,variant:`code`,children:e.command})]})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground sm:pr-5`,children:e.pid})]},e.processKey),t[8]=i,t[9]=e),c=n.map(e),t[5]=n,t[6]=i,t[7]=c}else c=t[7];let l;return t[10]!==s||t[11]!==c?(l=(0,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(L,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[980px] table-fixed text-left text-xs`,children:[a,o,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[s,c]})]})})}),t[10]=s,t[11]=c,t[12]=l):l=t[12],l}function Wt(e,t){return t.isServerRoot?e:e===null?t.depth:Math.min(e,t.depth)}function Gt(e){let t=(0,W.c)(7),{checkedAt:n}=e;z();let r;t[0]===n?r=t[1]:(r=fe(n?p(n):null),t[0]=n,t[1]=r);let i=r;if(i.status===`missing`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/50`,children:`Checking`}),t[2]=e):e=t[2],e}if(i.status===`invalid`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/50`,children:`Checked unavailable`}),t[3]=e):e=t[3],e}let a;return t[4]!==i.suffix||t[5]!==i.value?(a=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/60`,children:i.suffix?(0,G.jsxs)(G.Fragment,{children:[`Checked `,(0,G.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,G.jsxs)(G.Fragment,{children:[`Checked `,i.value]})}),t[4]=i.suffix,t[5]=i.value,t[6]=a):a=t[6],a}function Kt(e){let t=(0,W.c)(12),{isPending:n,label:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,G.jsx)(ye,{refreshing:n}),t[0]=n,t[1]=a);let o;t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a?(o=(0,G.jsx)(P,{render:(0,G.jsx)(f,{size:`icon-xs`,variant:`ghost-muted`,disabled:n,onClick:i,"aria-label":r,children:a})}),t[2]=n,t[3]=r,t[4]=i,t[5]=a,t[6]=o):o=t[6];let s;t[7]===r?s=t[8]:(s=(0,G.jsx)(F,{side:`top`,children:r}),t[7]=r,t[8]=s);let c;return t[9]!==o||t[10]!==s?(c=(0,G.jsxs)(I,{children:[o,s]}),t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function qt(){let{environment:e}=_e(),t=e?.environmentId??null,n=se(t,c),r=e?.serverConfig?.observability,i=e?.serverConfig?.availableEditors,a=se(t,y),o=ue(t===null?null:le.sessionStateAtom(t)),s=Se({connectionPhase:e?.connection.phase??`available`,session:o.data,hasSessionError:o.error!==null}),l=s.canReadDiagnostics,u=de(j.signalProcess,{reportFailure:!1}),d=be(t,i??[]),[h,g]=(0,q.useState)(9e5),_=Ft.find(e=>e.windowMs===h)??Ft[1],{data:v,error:b,isPending:ee,refresh:te}=ue(t===null||!l?null:j.traceDiagnostics({environmentId:t,input:{}})),{data:w,error:T,isPending:E,refresh:D}=ue(t===null||!l?null:j.processDiagnostics({environmentId:t,input:{}})),{data:k,error:A,isPending:M,refresh:N}=ue(t===null||!l?null:j.processResourceHistory({environmentId:t,input:{windowMs:_.windowMs,bucketMs:_.bucketMs}})),[fe,pe]=(0,q.useState)(!1),[me,he]=(0,q.useState)(null),[ge,z]=(0,q.useState)(null),B=(0,q.useRef)(null),ye=(0,q.useRef)(t),V=(0,q.useRef)(w);(0,q.useEffect)(()=>{V.current=w},[w]),(0,q.useEffect)(()=>(ye.current=t,()=>{ye.current=null}),[t]);let xe=(0,q.useCallback)(()=>{let e=r?.logsDirectoryPath??null;e&&t!==null&&ce(t,`orchestration:operate`)&&(pe(!0),he(null),(async()=>{let t=await d(e);if(pe(!1),t._tag===`Failure`&&!ie(t)){let e=ae(t);he(e instanceof Error?e.message:`Unable to open logs folder.`)}})())},[t,r?.logsDirectoryPath,d]),U=ee&&v===null,W=E&&w===null,K=M&&k===null,[Ce,we]=(0,q.useState)(null);Ce!==t&&l&&!U&&!W&&!K&&we(t);let J=(0,q.useCallback)(async(e,t)=>{let n=ye.current,r=V.current?.processes.find(t=>t.pid===e);if(n===null||r===void 0||!ce(n,`environment:maintain`)||B.current!==null)return;B.current=e,z(e);let i=()=>{B.current=null,z(null)};if(t===`SIGKILL`){let n=!1;try{n=await oe().dialogs.confirm(`Send SIGKILL to process ${e}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){i(),O.add({type:`error`,title:`Could not confirm signal`,description:e instanceof Error?e.message:`Failed to send ${t}.`});return}if(!n){i();return}}let a=ye.current;if(a===null||a!==n||!ce(a,`environment:maintain`)){i();return}if(V.current?.processes.find(t=>t.pid===e)?.startTimeMs!==r.startTimeMs){i();return}try{let i=await u({environmentId:n,input:{pid:e,startTimeMs:r.startTimeMs,signal:t}});if(i._tag===`Failure`){if(!ie(i)){let e=ae(i);O.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}return}if(!i.value.signaled){let e=x(i.value.message);if(D(),Et(e)){O.add({type:`info`,title:`Process already exited`,description:`The process is not a child of the P4 Code server. It might already have exited.`});return}O.add({type:`error`,title:`Could not send ${t}`,description:e??`Failed to send ${t}.`});return}D()}finally{i()}},[D,u]),Te=w?ne(w.error):null,Ee=k?ne(k.error):null,Y=v?ne(v.error):null,De=v?m(v.partialFailure,()=>!1):!1;return l?(0,G.jsxs)(ve,{width:`expanded`,className:`gap-10`,children:[(0,G.jsx)(ut,{environmentId:t}),(0,G.jsxs)(R,{title:`Live Processes`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Gt,{checkedAt:w?.readAt??null}),(0,G.jsx)(Kt,{isPending:E,label:`Refresh process diagnostics`,onClick:D})]}),children:[(0,G.jsxs)(Dt,{children:[(0,G.jsx)(Q,{label:`Child Processes`,value:w?X(w.processCount):`...`}),(0,G.jsx)(Q,{label:`CPU`,value:w?`${w.totalCpuPercent.toFixed(1)}%`:`...`,tooltip:`Total CPU across live child processes of the current server process. The desktop shell and other parent processes are not included.`}),(0,G.jsx)(Q,{label:`Memory`,value:w?St(w.totalRssBytes):`...`,tooltip:`Total resident memory across live child processes of the current server process. The desktop shell and other parent processes are not included.`}),(0,G.jsx)(Q,{label:`Server PID`,value:w?String(w.serverPid):`...`})]}),Te||T?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[Te?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:Te.message})]}):null,T?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:T})]}):null]}):null,(0,G.jsx)(Nt,{processes:w?.processes??[],canMaintainEnvironment:n,signalingPid:ge,onSignal:J,emptyLabel:W?`Loading live processes...`:`No live descendant processes found.`})]}),(0,G.jsxs)(R,{title:`Resource History`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Vt,{selectedWindowMs:h,onSelect:g}),(0,G.jsx)(Gt,{checkedAt:k?.readAt??null}),(0,G.jsx)(Kt,{isPending:M,label:`Refresh resource history`,onClick:N})]}),children:[(0,G.jsxs)(Dt,{children:[(0,G.jsx)(Q,{label:`CPU Time`,value:k?It(k.totalCpuSecondsApprox):`...`,tooltip:`Approximate active CPU time for the P4 Code server root process and its descendants during the selected window. It grows only while sampled processes use CPU and older samples leave as the window moves.`}),(0,G.jsx)(Q,{label:`Samples`,value:k?X(k.retainedSampleCount):`...`,tooltip:`In-memory process samples retained by the server. The server samples only while diagnostics is open, and this resets when the server restarts.`}),(0,G.jsx)(Q,{label:`Interval`,value:k?k.sampleIntervalMs===0?`On demand`:Z(k.sampleIntervalMs):`...`}),(0,G.jsx)(Q,{label:`Processes`,value:k?X(k.topProcesses.length):`...`})]}),Ee||A?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[Ee?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:Ee.message})]}):null,A?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:A})]}):null]}):null,(0,G.jsx)(zt,{buckets:k?.buckets??[]}),(0,G.jsx)(Ut,{processes:k?.topProcesses??[],emptyLabel:K?`Collecting process resource samples...`:`No process resource samples found for this window.`})]}),(0,G.jsxs)(R,{title:`Trace Diagnostics`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Gt,{checkedAt:v?.readAt??null}),(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(f,{size:`icon-xs`,variant:`ghost-muted`,disabled:!a||!r?.logsDirectoryPath||fe,onClick:xe,"aria-label":`Open logs folder`,children:(0,G.jsx)(re,{})})}),(0,G.jsx)(F,{side:`top`,children:`Open logs folder`})]}),(0,G.jsx)(Kt,{isPending:ee,label:`Refresh trace diagnostics`,onClick:te})]}),children:[(0,G.jsxs)(Dt,{children:[(0,G.jsx)(Q,{label:`Spans`,value:v?X(v.recordCount):`...`}),(0,G.jsx)(Q,{label:`Failures`,value:v?X(v.failureCount):`...`,tone:v&&v.failureCount>0?`danger`:`default`}),(0,G.jsx)(Q,{label:`Slow Spans`,value:v?X(v.slowSpanCount):`...`,tooltip:v?`Spans with a duration of ${Z(v.slowSpanThresholdMs)} or longer.`:`Spans at or above the configured slow-span threshold.`,tone:v&&v.slowSpanCount>0?`warning`:`default`}),(0,G.jsx)(Q,{label:`Parse Errors`,value:v?X(v.parseErrorCount):`...`,tone:v&&v.parseErrorCount>0?`warning`:`default`})]}),me||Y||b?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[me?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:me})]}):null,Y?(0,G.jsxs)(`div`,{className:S(`flex items-start gap-2`,De?`text-warning-foreground`:`text-destructive`),children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:De?`Some trace files could not be read, so diagnostics may be incomplete. ${Y.message}`:Y.message})]}):null,b?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:b})]}):null]}):null]}),(0,G.jsx)(R,{title:`Latest Failures`,children:v&&v.latestFailures.length>0?(0,G.jsx)(Ot,{headers:[`Span`,`Cause`,`Duration`,`Ended`],children:v.latestFailures.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(H,{text:e.cause})}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.durationMs)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:wt(e.endedAt)})]},`${e.traceId}:${e.spanId}`))}):(0,G.jsx)($,{label:U?`Loading failures...`:`No failed spans found.`})}),(0,G.jsx)(R,{title:`Most Common Failures`,children:v&&v.commonFailures.length>0?(0,G.jsx)(Ot,{headers:[`Span`,`Count`,`Cause`,`Last Seen`],minTableWidth:`min-w-[760px]`,children:v.commonFailures.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:X(e.count)}),(0,G.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(H,{text:e.cause})}),(0,G.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:wt(e.lastSeenAt)})]},`${e.name}:${e.cause}`))}):(0,G.jsx)($,{label:U?`Loading failure groups...`:`No repeated failures found.`})}),(0,G.jsx)(R,{title:`Slowest Spans`,children:v&&v.slowestSpans.length>0?(0,G.jsx)(Ot,{headers:[`Span`,`Duration`,`Ended`,`Trace`],minTableWidth:`min-w-[900px]`,columnWidths:[`w-[44%]`,`w-[14%]`,`w-[12%]`,`w-[30%]`],children:v.slowestSpans.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.durationMs)}),(0,G.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground`,children:wt(e.endedAt)}),(0,G.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground last:sm:pr-5`,children:(0,G.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}`))}):(0,G.jsx)($,{label:U?`Loading slow spans...`:`No spans found.`})}),(0,G.jsx)(R,{title:`Span Logs`,children:v&&v.latestWarningAndErrorLogs.length>0?(0,G.jsx)(L,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[920px] table-fixed text-left text-xs`,children:[(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[26%]`}),(0,G.jsx)(`col`,{className:`w-[30%]`})]}),(0,G.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pl-5`,children:`Time`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Level`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Span`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Message`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pr-5`,children:`Trace`})]})}),(0,G.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:v.latestWarningAndErrorLogs.map(e=>(0,G.jsxs)(`tr`,{className:`hover:bg-muted/15`,children:[(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground sm:pl-5`,children:wt(e.seenAt)}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,G.jsx)(`span`,{className:`inline-flex rounded bg-muted px-1.5 py-0.5 font-mono text-2xs font-medium uppercase text-foreground/80`,children:e.level})}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,G.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:e.spanName})}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(H,{collapsedClassName:`line-clamp-2`,expandLabel:`Show full message`,text:e.message})}),(0,G.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground sm:pr-5`,children:(0,G.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}:${p(e.seenAt)}:${e.message}`))})]})}):(0,G.jsx)($,{label:U?`Loading recent logs...`:`No warnings or errors found.`})}),(0,G.jsx)(R,{title:`Top Span Names`,children:v&&v.topSpansByCount.length>0?(0,G.jsx)(Ot,{headers:[`Span`,`Count`,`Failures`,`Average`,`Max`],minTableWidth:`min-w-[760px]`,columnWidths:[`w-[48%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`],children:v.topSpansByCount.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:X(e.count)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:X(e.failureCount)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.averageDurationMs)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums last:sm:pr-5`,children:Z(e.maxDurationMs)})]},e.name))}):(0,G.jsx)($,{label:U?`Loading span names...`:`No spans found.`})}),Ce===t&&(0,G.jsx)(yt,{})]}):(0,G.jsx)(ve,{children:(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t===null?`Connect an environment to see diagnostics.`:s.isPending?`Checking diagnostics access…`:s.error})})}var Jt=qt;export{Jt as component};
2
- //# sourceMappingURL=settings.diagnostics-DDOaOIDg.js.map
1
+ import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{$d as i,$u as a,B_ as o,Df as s,H_ as c,JT as l,Qw as u,Vf as d,dr as f,dx as p,eE as m,fp as h,fr as g,md as _,nf as v,q_ as y,qf as b,rE as x,rf as ee,sE as te,t as S,tE as ne,td as C,ts as w,wf as re}from"./utils-DhUt689t.js";import{R as ie,W as ae}from"./runtime-OeWFs5Hf.js";import{f as T,l as E,p as D}from"./TooltipViewport-ThbbZQDo.js";import{i as O,p as k}from"./toast-DXWclCrr.js";import{D as A,q as oe}from"./useSettings-gPlpTIWi.js";import{f as j}from"./server-6nKYyc8r.js";import{i as se,n as ce,t as le}from"./session-BxUdP61p.js";import{n as ue}from"./query-CfGzD8v6.js";import{t as de}from"./use-atom-command-vqjL7n-x.js";import{a as M,o as N,u as fe}from"./timestampFormat-wac2e_Jz.js";import{a as P,n as F,t as I}from"./tooltip-CY3W5y-f.js";import{n as pe,t as me}from"./toggle-group-CYKsfBbD.js";import{t as he}from"./input-BYd74ook.js";import{t as L}from"./scroll-area-BNQKEZbp.js";import{F as ge,V as _e,i as ve,s as R,u as z}from"./settingsLayout-4ySvFdXb.js";import{t as B}from"./ConnectionStatusDot-DAuD0jkU.js";import{Oa as ye,Ta as be,Zt as V,vi as xe}from"./main-VfCRP294.js";import{t as Se}from"./usageAccess-CCSxXl9X.js";import{t as H}from"./ExpandableText-ByCx68yv.js";import{t as U}from"./SettingsScopeNotice-BFxCBOnl.js";var W=n(),G=e(r(),1);function K(e){let t=(0,W.c)(19),{disabled:n,onSignal:r}=e,i;t[0]===r?i=t[1]:(i=()=>r(`SIGINT`),t[0]=r,t[1]=i);let a;t[2]!==n||t[3]!==i?(a=(0,G.jsx)(P,{render:(0,G.jsx)(g,{disabled:n,"aria-label":`Send SIGINT`,tone:`muted`,onClick:i,children:`INT`})}),t[2]=n,t[3]=i,t[4]=a):a=t[4];let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.jsx)(F,{side:`top`,children:`Send SIGINT`}),t[5]=o):o=t[5];let s;t[6]===a?s=t[7]:(s=(0,G.jsxs)(I,{children:[a,o]}),t[6]=a,t[7]=s);let c;t[8]===r?c=t[9]:(c=()=>r(`SIGKILL`),t[8]=r,t[9]=c);let l;t[10]!==n||t[11]!==c?(l=(0,G.jsx)(P,{render:(0,G.jsx)(g,{disabled:n,"aria-label":`Send SIGKILL`,tone:`destructive`,onClick:c,children:`KILL`})}),t[10]=n,t[11]=c,t[12]=l):l=t[12];let u;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,G.jsx)(F,{side:`top`,children:`Send SIGKILL`}),t[13]=u):u=t[13];let d;t[14]===l?d=t[15]:(d=(0,G.jsxs)(I,{children:[l,u]}),t[14]=l,t[15]=d);let f;return t[16]!==s||t[17]!==d?(f=(0,G.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[s,d]}),t[16]=s,t[17]=d,t[18]=f):f=t[18],f}var q=e(t(),1);function Ce(e){let t=(0,W.c)(10),n=A(),r=e===void 0?n?.environmentId??null:e,i=se(r,o),a;t[0]!==i||t[1]!==r?(a=r===null||!i?null:j.resourceTelemetry({environmentId:r,input:{}}),t[0]=i,t[1]=r,t[2]=a):a=t[2];let s=ue(a),c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[3]=c):c=t[3];let l=de(j.retryResourceTelemetry,c),d;t[4]!==r||t[5]!==l?(d=async()=>{if(r===null)throw Error(`No environment is selected.`);if(!ce(r,`environment:maintain`)||!ce(r,`diagnostics:read`))throw Error(`This connection cannot restart the resource monitor.`);let e=await l({environmentId:r,input:{}});if(e._tag===`Failure`)throw u(e.cause);return e.value.snapshot},t[4]=r,t[5]=l,t[6]=d):d=t[6];let f=d,p;return t[7]!==s||t[8]!==f?(p={...s,retry:f},t[7]=s,t[8]=f,t[9]=p):p=t[9],p}function we(e,t){let n=(0,W.c)(4),r=A(),i=t===void 0?r?.environmentId??null:t,a=se(i,o),s;return n[0]!==a||n[1]!==i||n[2]!==e?(s=i===null||!a?null:j.resourceTelemetryHistory({environmentId:i,input:e}),n[0]=a,n[1]=i,n[2]=e,n[3]=s):s=n[3],ue(s)}function J(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Te(e,t){let n=new Map;for(let t of e){let e=n.get(t.ppid)??[];e.push(t),n.set(t.ppid,e)}let r=new Set,i=e=>{for(let t of n.get(e)??[]){let e=J(t);r.has(e)||(r.add(e),i(t.identity.pid))}};for(let n of e)t.has(J(n))&&i(n.identity.pid);return e.filter(e=>!r.has(J(e)))}function Ee(e){return e.nativeStatus===null&&e.error!==null||e.nativeStatus===`degraded`||e.nativeStatus===`unavailable`||e.nativeStatus===`stopped`}function Y(e){return e.value<=0?0:Math.max(e.minimumVisiblePercent,e.value/Math.max(1,e.max)*100)}function De(e){return Math.max(1,...e.map(e=>e.avgCpuPercent))}var Oe=[{label:`5m`,windowMs:3e5,bucketMs:15e3},{label:`15m`,windowMs:9e5,bucketMs:3e4},{label:`30m`,windowMs:18e5,bucketMs:6e4},{label:`1h`,windowMs:36e5,bucketMs:12e4}];function ke(e){return`${V(e)}/s`}function Ae(e){let t=e/1e3;if(t<60)return`${t.toFixed(t>=10?1:2)}s`;let n=t/60;return n<60?`${n.toFixed(n>=10?1:2)}m`:`${(n/60).toFixed(2)}h`}function je(e){return e<1e3?`${Math.round(e)} µs`:e<1e6?`${(e/1e3).toFixed(2)} ms`:`${(e/1e6).toFixed(2)} s`}function Me(e){if(e<1e3)return`${Math.max(0,Math.round(e))} ms`;let t=e/1e3;return`${t.toLocaleString(void 0,{maximumFractionDigits:1})} ${t===1?`second`:`seconds`}`}function Ne(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Pe(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Fe(e){if(e.name.trim())return e.name;let t=(e.command.trim().split(/\s+/)[0]??e.command).replace(/^['"]|['"]$/g,``);return t.split(/[\\/]/).findLast(e=>e.length>0)??t}function Ie(e){switch(e){case`server`:return`Server`;case`server-child`:return`Backend child`;case`provider-root`:return`Provider`;case`terminal-root`:return`Terminal`;case`electron-main`:return`Electron main`;case`electron-renderer`:return`Renderer`;case`electron-gpu`:return`GPU`;case`electron-utility`:return`Electron utility`;case`resource-monitor`:return`Monitor`;case`unknown-p4`:return`P4 process`}}function Le(e){return e===`resource-monitor`?`bg-warning`:e.startsWith(`electron-`)?`bg-info`:e===`server`?`bg-violet-500`:`bg-success`}function Re(e){switch(e){case`storage`:return`Storage bytes`;case`logical`:return`Logical bytes`;case`all-io`:return`All I/O bytes`;case`unavailable`:return`Unavailable`}}function ze(e,t){return e===`true`?t.true:e===`false`?t.false:`Unknown`}function Be(e){return e===`healthy`?`default`:e===`starting`||e===`degraded`?`warning`:`danger`}function Ve(e){let t=(0,W.c)(20),{label:n,status:r,presentation:i}=e,a;t[0]!==i?.tone||t[1]!==r?(a=i?.tone??Be(r),t[0]=i?.tone,t[1]=r,t[2]=a):a=t[2];let o=a,s=o===`neutral`&&`border-border/70 bg-muted/45 text-muted-foreground`,c=o==="default"&&`border-success/25 bg-success/10 text-success-foreground`,l=o===`warning`&&`border-warning/30 bg-warning/10 text-warning-foreground`,u=o===`danger`&&`border-destructive/30 bg-destructive/10 text-destructive`,d;t[3]!==s||t[4]!==c||t[5]!==l||t[6]!==u?(d=S(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-3xs font-semibold uppercase tracking-widest`,s,c,l,u),t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d):d=t[7];let f=o===`neutral`&&`bg-muted-foreground/55`,p=o==="default"&&`bg-success`,m=o===`warning`&&`bg-warning`,h=o===`danger`&&`bg-destructive`,g;t[8]!==h||t[9]!==f||t[10]!==p||t[11]!==m?(g=S(`size-1.5 rounded-full`,f,p,m,h),t[8]=h,t[9]=f,t[10]=p,t[11]=m,t[12]=g):g=t[12];let _;t[13]===g?_=t[14]:(_=(0,G.jsx)(`span`,{className:g}),t[13]=g,t[14]=_);let v=i?.label??r,y;return t[15]!==n||t[16]!==_||t[17]!==v||t[18]!==d?(y=(0,G.jsxs)(`span`,{className:d,children:[_,n,` `,v]}),t[15]=n,t[16]=_,t[17]=v,t[18]=d,t[19]=y):y=t[19],y}function He(e){let t=(0,W.c)(9),{sampledAt:n}=e;if(z(),!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/55`,children:`Waiting for sample`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=M(p(n)),t[1]=n,t[2]=r);let i=r;if(!i){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/55`,children:`Waiting for sample`}),t[3]=e):e=t[3],e}let a;t[4]===i.value?a=t[5]:(a=(0,G.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),t[4]=i.value,t[5]=a);let o=i.suffix?` ${i.suffix}`:``,s;return t[6]!==a||t[7]!==o?(s=(0,G.jsxs)(`span`,{className:`text-2xs text-muted-foreground/60`,children:[`Updated `,a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function Ue(e){let t=(0,W.c)(19),{icon:n,label:r,value:i,detail:a,tone:o}=e,s=o===void 0?`default`:o,c;t[0]===n?c=t[1]:(c=(0,G.jsx)(`span`,{className:`text-muted-foreground/55 transition-colors group-hover:text-foreground/65`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=(0,G.jsx)(`span`,{className:`truncate`,children:r}),t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[c,l]}),t[4]=c,t[5]=l,t[6]=u):u=t[6];let d=s===`warning`&&`text-warning-foreground`,f=s===`danger`&&`text-destructive`,p;t[7]!==d||t[8]!==f?(p=S(`mt-2.5 truncate font-mono text-2xl font-semibold tracking-tighter tabular-nums text-foreground`,d,f),t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==p||t[11]!==i?(m=(0,G.jsx)(`div`,{className:p,children:i}),t[10]=p,t[11]=i,t[12]=m):m=t[12];let h;t[13]===a?h=t[14]:(h=a?(0,G.jsx)(`div`,{className:`mt-1.5 truncate text-3xs text-muted-foreground/60`,children:a}):null,t[13]=a,t[14]=h);let g;return t[15]!==u||t[16]!==m||t[17]!==h?(g=(0,G.jsxs)(`div`,{className:`group min-w-0 px-4 py-4 sm:px-5`,children:[u,m,h]}),t[15]=u,t[16]=m,t[17]=h,t[18]=g):g=t[18],g}function We(e){let t=(0,W.c)(37),{label:n,accentClass:r,aggregate:i}=e,a;t[0]===r?a=t[1]:(a=S(`absolute inset-x-5 top-0 h-0.5 rounded-full opacity-75`,r),t[0]=r,t[1]=a);let o;t[2]===a?o=t[3]:(o=(0,G.jsx)(`span`,{className:a}),t[2]=a,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,G.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/75`,children:n}),t[4]=n,t[5]=s);let c=i.processCount===1?`process`:`processes`,l;t[6]!==i.processCount||t[7]!==c?(l=(0,G.jsxs)(`div`,{className:`rounded-md bg-muted/55 px-1.5 py-0.5 font-mono text-3xs tabular-nums text-muted-foreground/70`,children:[i.processCount,` `,c]}),t[6]=i.processCount,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==s||t[10]!==l?(u=(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[s,l]}),t[9]=s,t[10]=l,t[11]=u):u=t[11];let d;t[12]===i.currentCpuPercent?d=t[13]:(d=i.currentCpuPercent.toFixed(1),t[12]=i.currentCpuPercent,t[13]=d);let f=`${d}%`,p;t[14]===f?p=t[15]:(p=(0,G.jsx)(Ge,{label:`CPU`,value:f}),t[14]=f,t[15]=p);let m;t[16]===i.currentRssBytes?m=t[17]:(m=V(i.currentRssBytes),t[16]=i.currentRssBytes,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,G.jsx)(Ge,{label:`Memory`,value:m}),t[18]=m,t[19]=h);let g;t[20]===i.ioReadBytesPerSecond?g=t[21]:(g=ke(i.ioReadBytesPerSecond),t[20]=i.ioReadBytesPerSecond,t[21]=g);let _;t[22]===g?_=t[23]:(_=(0,G.jsx)(Ge,{label:`Read`,value:g}),t[22]=g,t[23]=_);let v;t[24]===i.ioWriteBytesPerSecond?v=t[25]:(v=ke(i.ioWriteBytesPerSecond),t[24]=i.ioWriteBytesPerSecond,t[25]=v);let y;t[26]===v?y=t[27]:(y=(0,G.jsx)(Ge,{label:`Write`,value:v}),t[26]=v,t[27]=y);let b;t[28]!==h||t[29]!==_||t[30]!==y||t[31]!==p?(b=(0,G.jsxs)(`div`,{className:`mt-3.5 grid grid-cols-2 gap-x-4 gap-y-2.5`,children:[p,h,_,y]}),t[28]=h,t[29]=_,t[30]=y,t[31]=p,t[32]=b):b=t[32];let x;return t[33]!==b||t[34]!==o||t[35]!==u?(x=(0,G.jsxs)(`div`,{className:`relative overflow-hidden border-t border-border/60 px-4 py-4 first:border-t-0 md:border-t-0 md:border-l md:first:border-l-0 sm:px-5`,children:[o,u,b]}),t[33]=b,t[34]=o,t[35]=u,t[36]=x):x=t[36],x}function Ge(e){let t=(0,W.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,G.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/45`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,G.jsx)(`div`,{className:`truncate font-mono text-xs font-medium tabular-nums text-foreground/90`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,G.jsxs)(`div`,{className:`min-w-0`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Ke(e){let t=(0,W.c)(21),{label:n,health:r}=e,i;t[0]!==r.lastError||t[1]!==r.status?(i=r.status===`unavailable`&&l(r.lastError,Ye),t[0]=r.lastError,t[1]=r.status,t[2]=i):i=t[2];let a=i,o;t[3]===n?o=t[4]:(o=(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:n}),t[3]=n,t[4]=o);let s;t[5]!==a||t[6]!==r.lastError?(s=a?`Available when this page runs inside the desktop app.`:te(r.lastError,{onNone:Je,onSome:qe}),t[5]=a,t[6]=r.lastError,t[7]=s):s=t[7];let c;t[8]===s?c=t[9]:(c=(0,G.jsx)(`div`,{className:`mt-1 text-2xs leading-relaxed text-muted-foreground/65`,children:s}),t[8]=s,t[9]=c);let u;t[10]!==o||t[11]!==c?(u=(0,G.jsxs)(`div`,{className:`min-w-0`,children:[o,c]}),t[10]=o,t[11]=c,t[12]=u):u=t[12];let d;t[13]===a?d=t[14]:(d=a?{label:`Desktop only`,tone:`neutral`}:void 0,t[13]=a,t[14]=d);let f;t[15]!==r.status||t[16]!==d?(f=(0,G.jsx)(Ve,{label:``,status:r.status,presentation:d}),t[15]=r.status,t[16]=d,t[17]=f):f=t[17];let p;return t[18]!==u||t[19]!==f?(p=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-t border-border/50 py-3 first:border-t-0`,children:[u,f]}),t[18]=u,t[19]=f,t[20]=p):p=t[20],p}function qe(e){return e}function Je(){return`No reported errors`}function Ye(e){return e.includes(`'web' mode`)}function Xe(e){let t=(0,W.c)(10),{label:n,value:r,valueClassName:i}=e,a;t[0]===n?a=t[1]:(a=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/75`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=S(`min-w-0 truncate text-right font-mono text-2xs tabular-nums text-foreground/85`,i),t[2]=i,t[3]=o);let s;t[4]!==o||t[5]!==r?(s=(0,G.jsx)(`span`,{className:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==s?(c=(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-border/50 py-2.5 first:border-t-0`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function Ze(e){let t=(0,W.c)(8),{selectedWindowMs:n,onSelect:r}=e,i=String(n),a;t[0]===i?a=t[1]:(a=[i],t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=e=>{let t=Oe.find(t=>String(t.windowMs)===e[0]);t&&r(t.windowMs)},t[2]=r,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=Oe.map(Qe),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,G.jsx)(pe,{"aria-label":`Resource history period`,variant:`segmented`,value:a,onValueChange:o,children:s}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}function Qe(e){return(0,G.jsx)(me,{value:String(e.windowMs),children:e.label},e.windowMs)}function $e(e){let t=(0,W.c)(15),{buckets:n}=e,r,i,a,o;if(t[0]!==n){let e=De(n),s=Math.max(1,...n.map(et));a=`border-t border-border/60 px-4 py-4 sm:px-5`;let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-foreground/70`}),` CPU average`]}),t[5]=c):c=t[5];let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-info/70`}),` I/O reads`]}),t[6]=l):l=t[6],t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-3xs text-muted-foreground/65`,children:[c,l,(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-warning/80`}),` I/O writes`]})]}),t[7]=o):o=t[7],r=`flex h-32 items-end gap-1 overflow-hidden rounded-lg border border-border/40 bg-muted/8 px-2 pt-3 pb-2`,i=n.map(t=>{let n=Y({value:t.avgCpuPercent,max:e,minimumVisiblePercent:2}),r=Y({value:t.ioReadBytes,max:s,minimumVisiblePercent:1}),i=Y({value:t.ioWriteBytes,max:s,minimumVisiblePercent:1});return(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsxs)(`div`,{className:`grid h-full min-w-1 flex-1 grid-cols-3 items-end gap-px`,children:[(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-foreground/65`,style:{height:`${n}%`}}),(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-info/70`,style:{height:`${r}%`}}),(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-warning/80`,style:{height:`${i}%`}})]})}),(0,G.jsx)(F,{side:`top`,className:`text-left`,children:(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,G.jsxs)(`div`,{children:[`CPU avg `,t.avgCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`div`,{children:[`CPU peak `,t.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`div`,{children:[`Read `,V(t.ioReadBytes)]}),(0,G.jsxs)(`div`,{children:[`Write `,V(t.ioWriteBytes)]})]})})]},p(t.startedAt))}),t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];let s;t[8]!==r||t[9]!==i?(s=(0,G.jsx)(`div`,{className:r,children:i}),t[8]=r,t[9]=i,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==o||t[13]!==s?(c=(0,G.jsxs)(`div`,{className:a,children:[o,s]}),t[11]=a,t[12]=o,t[13]=s,t[14]=c):c=t[14],c}function et(e){return e.ioReadBytes+e.ioWriteBytes}function tt(e){let t=(0,W.c)(26),{process:n,collapsed:r,onToggle:i}=e,a;t[0]===n?a=t[1]:(a=Fe(n),t[0]=n,t[1]=a);let o=a,s=n.childPids.length>0,c=`${Math.min(n.depth,7)*10}px`,l;t[2]===c?l=t[3]:(l={paddingLeft:c},t[2]=c,t[3]=l);let u;t[4]!==r||t[5]!==s||t[6]!==o||t[7]!==i||t[8]!==n?(u=s?(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost-muted`,onClick:()=>i(n),"aria-label":r?`Expand ${o}`:`Collapse ${o}`,children:(0,G.jsx)(E,{className:`size-3.5`,icon:r?D:T})}):(0,G.jsx)(`span`,{className:`size-5`,"aria-hidden":!0}),t[4]=r,t[5]=s,t[6]=o,t[7]=i,t[8]=n,t[9]=u):u=t[9];let d;t[10]===n.category?d=t[11]:(d=S(`size-1.5 rounded-full`,Le(n.category)),t[10]=n.category,t[11]=d);let p;t[12]===d?p=t[13]:(p=(0,G.jsx)(`span`,{className:d}),t[12]=d,t[13]=p);let m;t[14]===o?m=t[15]:(m=(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[14]=o,t[15]=m);let h=n.command||n.name,g;t[16]===h?g=t[17]:(g=(0,G.jsx)(F,{side:`top`,variant:`code`,children:h}),t[16]=h,t[17]=g);let _;t[18]!==m||t[19]!==g?(_=(0,G.jsxs)(I,{children:[m,g]}),t[18]=m,t[19]=g,t[20]=_):_=t[20];let v;return t[21]!==_||t[22]!==l||t[23]!==u||t[24]!==p?(v=(0,G.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,p,_]}),t[21]=_,t[22]=l,t[23]=u,t[24]=p,t[25]=v):v=t[25],v}function nt(e){return e.category===`server-child`||e.category===`provider-root`||e.category===`terminal-root`}function rt(e){let t=(0,W.c)(10),{process:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e;if(!nt(n)){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-3xs text-muted-foreground/35`,children:`—`}),t[0]=e):e=t[0],e}let o;t[1]!==n||t[2]!==i?(o=i.has(Ne(n)),t[1]=n,t[2]=i,t[3]=o):o=t[3];let s=!r||o,c;t[4]!==a||t[5]!==n?(c=e=>a(n,e),t[4]=a,t[5]=n,t[6]=c):c=t[6];let l;return t[7]!==s||t[8]!==c?(l=(0,G.jsx)(K,{disabled:s,onSignal:c}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function it(e){let t=(0,W.c)(22),{processes:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e,[o,s]=(0,q.useState)(at),c;t[0]!==o||t[1]!==n?(c=Te(n,o),t[0]=o,t[1]=n,t[2]=c):c=t[2];let l=c,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{let t=Ne(e);s(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[20%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[7%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[6%]`}),(0,G.jsx)(`col`,{className:`w-[4%]`})]}),t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,G.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read/s`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write/s`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read Total`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write Total`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,G.jsx)(`th`,{className:`px-2 py-2 text-right font-semibold sm:pr-4`,children:`Kill`})]})}),t[5]=p):p=t[5];let m;t[6]===l.length?m=t[7]:(m=l.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:11,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`Waiting for the native process monitor.`})}):null,t[6]=l.length,t[7]=m);let h;if(t[8]!==r||t[9]!==o||t[10]!==a||t[11]!==i||t[12]!==l){let e;t[14]!==r||t[15]!==o||t[16]!==a||t[17]!==i?(e=e=>(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,G.jsx)(tt,{process:e,collapsed:o.has(Ne(e)),onToggle:d})}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Ie(e.category)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:Ae(e.cpuTimeMs)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:V(e.residentBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:ke(e.ioReadBytesPerSecond)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:ke(e.ioWriteBytesPerSecond)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:V(e.ioReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{children:V(e.ioWriteBytes)})}),(0,G.jsx)(F,{side:`top`,children:Re(e.ioSemantics)})]})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.identity.pid}),(0,G.jsx)(`td`,{className:`px-2 py-2 text-right sm:pr-4`,children:(0,G.jsx)(rt,{process:e,canMaintainEnvironment:r,signalingKeys:i,onSignal:a})})]},Ne(e)),t[14]=r,t[15]=o,t[16]=a,t[17]=i,t[18]=e):e=t[18],h=l.map(e),t[8]=r,t[9]=o,t[10]=a,t[11]=i,t[12]=l,t[13]=h}else h=t[13];let g;return t[19]!==m||t[20]!==h?(g=(0,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(L,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(68vh,48rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1320px] table-fixed text-left text-xs`,children:[f,p,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[m,h]})]})})}),t[19]=m,t[20]=h,t[21]=g):g=t[21],g}function at(){return new Set}function ot(e){let t=(0,W.c)(9),{processes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[7%]`}),(0,G.jsx)(`col`,{className:`w-[5%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak Mem`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Samples`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`PID`})]})}),t[1]=i):i=t[1];let a;t[2]===n.length?a=t[3]:(a=n.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:9,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`No retained process samples in this window.`})}):null,t[2]=n.length,t[3]=a);let o;t[4]===n?o=t[5]:(o=n.map(st),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==o?(s=(0,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(L,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[28rem] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1020px] table-fixed text-left text-xs`,children:[r,i,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[a,o]})]})})}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function st(e){return(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.name||e.command})}),(0,G.jsx)(F,{side:`top`,variant:`code`,children:e.command||e.name})]})}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Ie(e.category)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:Ae(e.cpuTimeMs)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:V(e.peakRssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:V(e.ioReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:V(e.ioWriteBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.sampleCount}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground sm:pr-5`,children:e.identity.pid})]},Pe(e))}function ct(e){let t=(0,W.c)(9),{entries:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[22%]`}),(0,G.jsx)(`col`,{className:`w-[28%]`}),(0,G.jsx)(`col`,{className:`w-[14%]`}),(0,G.jsx)(`col`,{className:`w-[14%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[12%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`thead`,{className:`border-b border-border/60 text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Component`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Operation`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Read`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Write`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Count`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`Time`})]})}),t[1]=i):i=t[1];let a;t[2]===n.length?a=t[3]:(a=n.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:6,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`No instrumented application I/O has been recorded yet.`})}):null,t[2]=n.length,t[3]=a);let o;t[4]===n?o=t[5]:(o=n.map(lt),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==o?(s=(0,G.jsx)(`div`,{className:`overflow-x-auto border-t border-border/60`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[720px] table-fixed text-left text-xs`,children:[r,i,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[a,o]})]})}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function lt(e){return(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`truncate px-4 py-2 font-medium text-foreground sm:pl-5`,children:e.component}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-muted-foreground`,children:e.operation}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:V(e.logicalReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:V(e.logicalWriteBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:e.count}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground sm:pr-5`,children:[(e.durationMs/1e3).toFixed(2),`s`]})]},`${e.component}:${e.operation}`)}function ut(e){let t=(0,W.c)(207),{environmentId:n}=e,[r,i]=(0,q.useState)(9e5),o;t[0]===r?o=t[1]:(o=Oe.find(e=>e.windowMs===r)??Oe[1],t[0]=r,t[1]=o);let l=o,u=se(n,c),p=Ce(n),g=p.retry,y;t[2]!==l.bucketMs||t[3]!==l.windowMs?(y={windowMs:l.windowMs,bucketMs:l.bucketMs},t[2]=l.bucketMs,t[3]=l.windowMs,t[4]=y):y=t[4];let b=we(y,n),x;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(x={reportFailure:!1},t[5]=x):x=t[5];let S=de(j.signalProcess,x),[w,re]=(0,q.useState)(ht),T;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(T=new Set,t[6]=T):T=t[6];let E=(0,q.useRef)(T),D=(0,q.useRef)(n),k,A;t[7]===n?(k=t[8],A=t[9]):(k=()=>(D.current=n,()=>{D.current=null}),A=[n],t[7]=n,t[8]=k,t[9]=A),(0,q.useEffect)(k,A);let[le,ue]=(0,q.useState)(!1),M=p.data,N=M?.groups.allP4,fe;t[10]===S?fe=t[11]:(fe=async(e,t)=>{let n=D.current;if(n===null||!ce(n,`environment:maintain`))return;let r=Ne(e);if(E.current.has(r))return;let i=new Set(E.current).add(r);E.current=i,re(i);let a=()=>{let e=new Set(E.current);e.delete(r),E.current=e,re(e)};if(t===`SIGKILL`){let n;try{n=await oe().dialogs.confirm(`Send SIGKILL to process ${e.identity.pid}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){let n=e;a(),O.add({type:`error`,title:`Could not confirm signal`,description:n instanceof Error?n.message:`Failed to send ${t}.`});return}if(!n){a();return}}if(D.current!==n||!ce(n,`environment:maintain`)){a();return}S({environmentId:n,input:{pid:e.identity.pid,startTimeMs:e.identity.startTimeMs,signal:t}}).then(n=>{if(n._tag===`Failure`){if(ie(n))return;throw ae(n)}n.value.signaled||O.add({type:`error`,title:`Could not send ${t}`,description:m(n.value.message,()=>`Failed to send ${t} to process ${e.identity.pid}.`)})}).catch(e=>{O.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}).finally(()=>{a()})},t[10]=S,t[11]=fe);let pe=fe,me;t[12]===g?me=t[13]:(me=()=>{let e=D.current;e!==null&&ce(e,`environment:maintain`)&&(ue(!0),g().catch(mt).finally(()=>{ue(!1)}))},t[12]=g,t[13]=me);let he=me,L,ge,_e,ve,z,B,be,xe,Se,H,U,K,J,Te,Y,De,Pe,Fe,Ie;if(t[14]!==N||t[15]!==M||t[16]!==p.error||t[17]!==p.isPending||t[18]!==p.refresh){z=M?ne(M.speedLimitPercent):null;let e=M?.health.native.status??null,n;t[38]!==e||t[39]!==p.error?(n=Ee({nativeStatus:e,error:p.error}),t[38]=e,t[39]=p.error,t[40]=n):n=t[40],_e=n,ve=M!==null&&(M.power.onBattery!==`unknown`||M.power.lowPowerMode!==`unknown`||M.power.idle!==`unknown`||M.power.locked!==`unknown`||M.power.thermalState!==`unknown`),ge=R,De=`Resource monitor`,t[41]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,G.jsx)(a,{className:`size-4 text-muted-foreground`}),t[41]=Pe):Pe=t[41];let r;t[42]===M?r=t[43]:(r=M?(0,G.jsx)(Ve,{label:`Native`,status:M.health.native.status}):null,t[42]=M,t[43]=r);let i=M?.readAt??null,o;t[44]===i?o=t[45]:(o=(0,G.jsx)(He,{sampledAt:i}),t[44]=i,t[45]=o);let c;t[46]===p.isPending?c=t[47]:(c=(0,G.jsx)(ye,{size:`xs`,refreshing:p.isPending}),t[46]=p.isPending,t[47]=c);let l;t[48]!==c||t[49]!==p.isPending||t[50]!==p.refresh?(l=(0,G.jsx)(P,{render:(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost`,disabled:p.isPending,onClick:p.refresh,"aria-label":`Refresh resource telemetry`,children:c})}),t[48]=c,t[49]=p.isPending,t[50]=p.refresh,t[51]=l):l=t[51];let u;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,G.jsx)(F,{side:`top`,children:`Refresh telemetry snapshot`}),t[52]=u):u=t[52];let m;t[53]===l?m=t[54]:(m=(0,G.jsxs)(I,{children:[l,u]}),t[53]=l,t[54]=m),t[55]!==r||t[56]!==o||t[57]!==m?(Fe=(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r,o,m]}),t[55]=r,t[56]=o,t[57]=m,t[58]=Fe):Fe=t[58],Te=`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-sm/5`;let g;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:`P4 system footprint`}),(0,G.jsx)(`p`,{className:`mt-1 max-w-xl text-xs leading-relaxed text-muted-foreground`,children:`Live native counters for the server, providers, terminals, desktop processes, and the monitor itself.`})]}),t[59]=g):g=t[59];let _;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),t[60]=_):_=t[60];let y;t[61]===M?y=t[62]:(y=M?Me(M.sampleIntervalMs):`...`,t[61]=M,t[62]=y),t[63]===y?Y=t[64]:(Y=(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-border/60 bg-linear-to-r from-muted/45 via-muted/20 to-transparent px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-5`,children:[g,(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs text-muted-foreground/65`,children:[_,`Sampling every `,y]})]}),t[63]=y,t[64]=Y),xe=`grid grid-cols-2 divide-x divide-y divide-border/55 md:grid-cols-3`;let b;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,G.jsx)(v,{className:`size-3.5`}),t[65]=b):b=t[65];let x;t[66]===N?x=t[67]:(x=N?`${N.currentCpuPercent.toFixed(1)}%`:`...`,t[66]=N,t[67]=x);let te;t[68]===N?te=t[69]:(te=N?`${Ae(N.cpuTimeMs)} observed CPU time`:void 0,t[68]=N,t[69]=te),t[70]!==x||t[71]!==te?(Se=(0,G.jsx)(Ue,{icon:b,label:`Current CPU`,value:x,detail:te}),t[70]=x,t[71]=te,t[72]=Se):Se=t[72];let S;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,G.jsx)(h,{className:`size-3.5`}),t[73]=S):S=t[73];let C;t[74]===N?C=t[75]:(C=N?V(N.currentRssBytes):`...`,t[74]=N,t[75]=C);let w;t[76]===N?w=t[77]:(w=N?`${V(N.peakRssBytes)} combined process peaks`:void 0,t[76]=N,t[77]=w),t[78]!==C||t[79]!==w?(H=(0,G.jsx)(Ue,{icon:S,label:`Resident memory`,value:C,detail:w}),t[78]=C,t[79]=w,t[80]=H):H=t[80];let re;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,G.jsx)(a,{className:`size-3.5`}),t[81]=re):re=t[81];let ie=N?String(N.processCount):`...`,ae=N?`${N.processStarts} starts · ${N.processExits} exits`:void 0;t[82]!==ie||t[83]!==ae?(U=(0,G.jsx)(Ue,{icon:re,label:`Process count`,value:ie,detail:ae}),t[82]=ie,t[83]=ae,t[84]=U):U=t[84];let T;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,G.jsx)(d,{className:`size-3.5`}),t[85]=T):T=t[85];let E;t[86]===N?E=t[87]:(E=N?ke(N.ioReadBytesPerSecond):`...`,t[86]=N,t[87]=E);let D;t[88]===N?D=t[89]:(D=N?`${V(N.ioReadBytes)} observed`:void 0,t[88]=N,t[89]=D),t[90]!==E||t[91]!==D?(K=(0,G.jsx)(Ue,{icon:T,label:`Read throughput`,value:E,detail:D}),t[90]=E,t[91]=D,t[92]=K):K=t[92];let O;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,G.jsx)(ee,{className:`size-3.5`}),t[93]=O):O=t[93];let k;t[94]===N?k=t[95]:(k=N?ke(N.ioWriteBytesPerSecond):`...`,t[94]=N,t[95]=k);let A;t[96]===N?A=t[97]:(A=N?`${V(N.ioWriteBytes)} observed`:void 0,t[96]=N,t[97]=A);let oe=N&&N.ioWriteBytesPerSecond>=10485760?`danger`:N&&N.ioWriteBytesPerSecond>=1048576?`warning`:`default`;t[98]!==k||t[99]!==A||t[100]!==oe?(J=(0,G.jsx)(Ue,{icon:O,label:`Write throughput`,value:k,detail:A,tone:oe}),t[98]=k,t[99]=A,t[100]=oe,t[101]=J):J=t[101],L=Ue,t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,G.jsx)(s,{className:`size-3.5`}),t[102]=Ie):Ie=t[102],B=`CPU speed limit`,be=M?z===null?`Unknown`:`${z.toFixed(0)}%`:`...`,t[14]=N,t[15]=M,t[16]=p.error,t[17]=p.isPending,t[18]=p.refresh,t[19]=L,t[20]=ge,t[21]=_e,t[22]=ve,t[23]=z,t[24]=B,t[25]=be,t[26]=xe,t[27]=Se,t[28]=H,t[29]=U,t[30]=K,t[31]=J,t[32]=Te,t[33]=Y,t[34]=De,t[35]=Pe,t[36]=Fe,t[37]=Ie}else L=t[19],ge=t[20],_e=t[21],ve=t[22],z=t[23],B=t[24],be=t[25],xe=t[26],Se=t[27],H=t[28],U=t[29],K=t[30],J=t[31],Te=t[32],Y=t[33],De=t[34],Pe=t[35],Fe=t[36],Ie=t[37];let Le=M?`${M.power.thermalState} thermal state`:void 0,Re=z!==null&&z<80?`warning`:`default`,Be;t[103]!==L||t[104]!==B||t[105]!==be||t[106]!==Le||t[107]!==Re||t[108]!==Ie?(Be=(0,G.jsx)(L,{icon:Ie,label:B,value:be,detail:Le,tone:Re}),t[103]=L,t[104]=B,t[105]=be,t[106]=Le,t[107]=Re,t[108]=Ie,t[109]=Be):Be=t[109];let Ge;t[110]!==xe||t[111]!==Se||t[112]!==H||t[113]!==U||t[114]!==K||t[115]!==J||t[116]!==Be?(Ge=(0,G.jsxs)(`div`,{className:xe,children:[Se,H,U,K,J,Be]}),t[110]=xe,t[111]=Se,t[112]=H,t[113]=U,t[114]=K,t[115]=J,t[116]=Be,t[117]=Ge):Ge=t[117];let qe;t[118]===p.error?qe=t[119]:(qe=p.error?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 border-t border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive sm:px-5`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:p.error})]}):null,t[118]=p.error,t[119]=qe);let Je;t[120]===M?Je=t[121]:(Je=M?(0,G.jsxs)(`div`,{className:`grid border-t border-border/60 bg-muted/10 md:grid-cols-3`,children:[(0,G.jsx)(We,{label:`Backend + agents`,accentClass:`bg-success/80`,aggregate:M.groups.backend}),(0,G.jsx)(We,{label:`Desktop`,accentClass:`bg-info/80`,aggregate:M.groups.electron}),(0,G.jsx)(We,{label:`Monitor overhead`,accentClass:`bg-warning/80`,aggregate:M.groups.monitor})]}):null,t[120]=M,t[121]=Je);let Ye;t[122]!==Te||t[123]!==Y||t[124]!==Ge||t[125]!==qe||t[126]!==Je?(Ye=(0,G.jsxs)(`div`,{className:Te,children:[Y,Ge,qe,Je]}),t[122]=Te,t[123]=Y,t[124]=Ge,t[125]=qe,t[126]=Je,t[127]=Ye):Ye=t[127];let Qe;t[128]!==ge||t[129]!==De||t[130]!==Pe||t[131]!==Fe||t[132]!==Ye?(Qe=(0,G.jsx)(ge,{title:De,icon:Pe,headerAction:Fe,children:Ye}),t[128]=ge,t[129]=De,t[130]=Pe,t[131]=Fe,t[132]=Ye,t[133]=Qe):Qe=t[133];let et;t[134]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,G.jsx)(s,{className:`size-4 text-muted-foreground`}),t[134]=et):et=t[134];let tt;t[135]!==_e||t[136]!==le||t[137]!==he?(tt=_e?(0,G.jsxs)(f,{size:`xs`,variant:`outline`,disabled:le,onClick:he,children:[(0,G.jsx)(ye,{size:`xs`,refreshing:le}),`Retry monitor`]}):null,t[135]=_e,t[136]=le,t[137]=he,t[138]=tt):tt=t[138];let nt;t[139]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,G.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,G.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,G.jsx)(_,{className:`size-3.5`})}),`Host state`]}),t[139]=nt):nt=t[139];let rt;t[140]!==ve||t[141]!==M?(rt=(0,G.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[nt,ve&&M?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Xe,{label:`Power source`,value:ze(M.power.onBattery,{true:`Battery`,false:`External power`})}),(0,G.jsx)(Xe,{label:`Low power mode`,value:ze(M.power.lowPowerMode,{true:`Enabled`,false:`Disabled`})}),(0,G.jsx)(Xe,{label:`Idle`,value:`${ze(M.power.idle,{true:`Idle`,false:`Active`})}${M.power.idleSeconds===null?``:` · ${Math.round(M.power.idleSeconds)}s`}`}),(0,G.jsx)(Xe,{label:`Session`,value:M.power.suspended?`Suspended`:ze(M.power.locked,{true:`Locked`,false:`Unlocked`})}),(0,G.jsx)(Xe,{label:`Thermal`,value:M.power.thermalState,valueClassName:M.power.thermalState===`serious`||M.power.thermalState===`critical`?`text-destructive`:void 0})]}):(0,G.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/70 bg-muted/20 px-4 py-5`,children:[(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Desktop host signals not connected`}),(0,G.jsx)(`p`,{className:`mt-1.5 max-w-sm text-2xs leading-relaxed text-muted-foreground/70`,children:`Power, idle, lock, and thermal state are supplied by the desktop host. Process telemetry remains fully active in this browser session.`})]})]}),t[140]=ve,t[141]=M,t[142]=rt):rt=t[142];let at;t[143]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,G.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,G.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,G.jsx)(s,{className:`size-3.5`})}),`Collection health`]}),t[143]=at):at=t[143];let st;t[144]===M?st=t[145]:(st=(0,G.jsxs)(`div`,{className:`border-t border-border/60 px-4 py-4 md:border-t-0 sm:px-5`,children:[at,M?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ke,{label:`Native process monitor`,health:M.health.native}),(0,G.jsx)(Ke,{label:`Electron main process`,health:M.health.desktop}),(0,G.jsx)(Xe,{label:`Collection time`,value:je(M.health.collectionDurationMicros)}),(0,G.jsx)(Xe,{label:`Process scan`,value:`${M.health.retainedProcessCount}/${M.health.scannedProcessCount} retained`}),(0,G.jsx)(Xe,{label:`Inaccessible`,value:String(M.health.inaccessibleProcessCount),valueClassName:M.health.inaccessibleProcessCount>0?`text-warning-foreground`:void 0}),(0,G.jsx)(Xe,{label:`Sidecar`,value:te(M.health.sidecarVersion,{onNone:pt,onSome:e=>`${e}${te(M.health.sidecarPid,{onNone:ft,onSome:dt})}`})}),(0,G.jsx)(Xe,{label:`Restarts`,value:String(M.health.restartCount)})]}):(0,G.jsx)(`div`,{className:`py-4 text-xs text-muted-foreground`,children:`Waiting for collector health.`})]}),t[144]=M,t[145]=st);let lt;t[146]!==rt||t[147]!==st?(lt=(0,G.jsxs)(`div`,{className:`grid overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5 md:grid-cols-2 md:divide-x md:divide-border/60`,children:[rt,st]}),t[146]=rt,t[147]=st,t[148]=lt):lt=t[148];let ut;t[149]!==tt||t[150]!==lt?(ut=(0,G.jsx)(R,{title:`Host & collection`,icon:et,headerAction:tt,children:lt}),t[149]=tt,t[150]=lt,t[151]=ut):ut=t[151];let gt;t[152]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,G.jsx)(d,{className:`size-4 text-muted-foreground`}),t[152]=gt):gt=t[152];let _t;t[153]===r?_t=t[154]:(_t=(0,G.jsx)(Ze,{selectedWindowMs:r,onSelect:i}),t[153]=r,t[154]=_t);let vt;t[155]===b.isPending?vt=t[156]:(vt=(0,G.jsx)(ye,{size:`xs`,refreshing:b.isPending}),t[155]=b.isPending,t[156]=vt);let yt;t[157]!==b.isPending||t[158]!==b.refresh||t[159]!==vt?(yt=(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost`,disabled:b.isPending,onClick:b.refresh,"aria-label":`Refresh resource history`,children:vt}),t[157]=b.isPending,t[158]=b.refresh,t[159]=vt,t[160]=yt):yt=t[160];let bt;t[161]!==_t||t[162]!==yt?(bt=(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_t,yt]}),t[161]=_t,t[162]=yt,t[163]=bt):bt=t[163];let xt;t[164]===b.error?xt=t[165]:(xt=b.error?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive sm:px-5`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:b.error})]}):null,t[164]=b.error,t[165]=xt);let X;t[166]===b.data?.buckets?X=t[167]:(X=b.data?.buckets??[],t[166]=b.data?.buckets,t[167]=X);let Z;t[168]===X?Z=t[169]:(Z=(0,G.jsx)($e,{buckets:X}),t[168]=X,t[169]=Z);let St;t[170]===b.data?.topProcesses?St=t[171]:(St=b.data?.topProcesses??[],t[170]=b.data?.topProcesses,t[171]=St);let Ct;t[172]===St?Ct=t[173]:(Ct=(0,G.jsx)(ot,{processes:St}),t[172]=St,t[173]=Ct);let wt;t[174]!==xt||t[175]!==Z||t[176]!==Ct?(wt=(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[xt,Z,Ct]}),t[174]=xt,t[175]=Z,t[176]=Ct,t[177]=wt):wt=t[177];let Tt;t[178]!==bt||t[179]!==wt?(Tt=(0,G.jsx)(R,{title:`Resource timeline`,icon:gt,headerAction:bt,children:wt}),t[178]=bt,t[179]=wt,t[180]=Tt):Tt=t[180];let Et;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(Et=(0,G.jsx)(v,{className:`size-4 text-muted-foreground`}),t[181]=Et):Et=t[181];let Q;t[182]===M?Q=t[183]:(Q=M?(0,G.jsxs)(`span`,{className:`text-3xs text-muted-foreground/55`,children:[`Identity: `,(0,G.jsx)(`span`,{className:`font-mono`,children:`PID + start time`})]}):null,t[182]=M,t[183]=Q);let Dt;t[184]===M?.processes?Dt=t[185]:(Dt=M?.processes??[],t[184]=M?.processes,t[185]=Dt);let $;t[186]!==u||t[187]!==pe||t[188]!==w||t[189]!==Dt?($=(0,G.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:(0,G.jsx)(it,{processes:Dt,canMaintainEnvironment:u,signalingKeys:w,onSignal:pe})}),t[186]=u,t[187]=pe,t[188]=w,t[189]=Dt,t[190]=$):$=t[190];let Ot;t[191]!==Q||t[192]!==$?(Ot=(0,G.jsx)(R,{title:`Live process tree`,icon:Et,headerAction:Q,children:$}),t[191]=Q,t[192]=$,t[193]=Ot):Ot=t[193];let kt,At;t[194]===Symbol.for(`react.memo_cache_sentinel`)?(kt=(0,G.jsx)(ee,{className:`size-4 text-muted-foreground`}),At=(0,G.jsx)(`span`,{className:`text-3xs text-muted-foreground/55`,children:`Logical bytes by operation`}),t[194]=kt,t[195]=At):(kt=t[194],At=t[195]);let jt;t[196]===Symbol.for(`react.memo_cache_sentinel`)?(jt=(0,G.jsx)(`div`,{className:`bg-muted/15 px-4 py-3 text-2xs leading-relaxed text-muted-foreground sm:px-5`,children:`Native counters identify which process is reading or writing. These application-level counters identify known P4 Code operations so process spikes can be correlated with specific persistence and logging paths.`}),t[196]=jt):jt=t[196];let Mt;t[197]===M?.attribution.entries?Mt=t[198]:(Mt=M?.attribution.entries??[],t[197]=M?.attribution.entries,t[198]=Mt);let Nt;t[199]===Mt?Nt=t[200]:(Nt=(0,G.jsx)(R,{title:`Instrumented application I/O`,icon:kt,headerAction:At,children:(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[jt,(0,G.jsx)(ct,{entries:Mt})]})}),t[199]=Mt,t[200]=Nt);let Pt;return t[201]!==Qe||t[202]!==ut||t[203]!==Tt||t[204]!==Ot||t[205]!==Nt?(Pt=(0,G.jsxs)(G.Fragment,{children:[Qe,ut,Tt,Ot,Nt]}),t[201]=Qe,t[202]=ut,t[203]=Tt,t[204]=Ot,t[205]=Nt,t[206]=Pt):Pt=t[206],Pt}function dt(e){return` · PID ${e}`}function ft(){return``}function pt(){return`Unavailable`}function mt(e){O.add({type:`error`,title:`Could not restart resource monitor`,description:e instanceof Error?e.message:`The resource monitor retry failed.`})}function ht(){return new Set}var gt=[{key:`otlpTracesUrl`,label:`Traces`,signal:`traces`},{key:`otlpMetricsUrl`,label:`Metrics`,signal:`metrics`},{key:`otlpLogsUrl`,label:`Logs`,signal:`logs`}],_t=e=>/^https?:\/\/./i.test(e);function vt(e,t){if(e===``)return{label:`Off`,dot:`bg-muted-foreground/40`};if(t?.url!==e)return{label:`Not checked`,dot:`bg-muted-foreground/40`};let{result:n}=t;if(n===null)return{label:`Checking…`,dot:`bg-warning`};switch(n._tag){case`Accepted`:return{label:`Connected · ${Math.round(n.latencyMs)} ms`,dot:`bg-success`};case`Rejected`:return{label:`Rejected · HTTP ${n.status}`,dot:`bg-destructive`};case`Unreachable`:return{label:n.timedOut?`Timed out`:`Unreachable`,dot:`bg-destructive`}}}function yt(){let e=(0,W.c)(3),{environment:t,scope:n}=_e();if(n.kind!==`environment`||!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(R,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,G.jsx)(U,{target:`environment`,children:`Choose one environment to configure its telemetry exports.`})}),e[0]=t):t=e[0],t}let r;return e[1]===t.environmentId?r=e[2]:(r=(0,G.jsx)(bt,{},t.environmentId),e[1]=t.environmentId,e[2]=r),r}function bt(){let{environment:e}=_e(),t=ge(e=>e.observability),[n,r]=(0,q.useState)({}),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(null),c=e?.environmentId,l=w(j.checkOtlpEndpoint.permissionAtom(c??null)),u=l&&e?.serverConfig?.environment.capabilities.otlpEndpointCheck===!0,[d,p]=(0,q.useState)(()=>Object.fromEntries(gt.filter(({key:e})=>_t(t[e])).map(({key:e})=>[e,{url:t[e],result:null}]))),m=de(j.updateSettings,{reportFailure:!0}),h=de(j.checkOtlpEndpoint),g={...t,...n},_=gt.filter(({key:e})=>g[e].trim()!==t[e]),v=_.length>0,y=e?.serverConfig?.observability,b=async(e,t,n)=>{if(!c)return;let r=await h({environmentId:c,input:{signal:t,url:n}});p(t=>{if(t[e]?.url!==n||t[e].result!==null)return t;let i={...t};return r._tag===`Success`?i[e]={url:n,result:r.value}:delete i[e],i})},x=(e,t,n)=>{_t(n)&&(p(t=>({...t,[e]:{url:n,result:null}})),b(e,t,n))},ee=(0,q.useEffectEvent)(()=>{for(let{key:e,signal:t}of gt){let n=d[e];n?.result===null&&b(e,t,n.url)}});return(0,q.useEffect)(()=>{u&&ee()},[u]),(0,G.jsx)(R,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,G.jsxs)(`form`,{className:`grid gap-4 px-4 py-4 sm:px-5`,onSubmit:async t=>{if(t.preventDefault(),e&&!i){a(!0),s(null);try{(await m({environmentId:e.environmentId,input:{patch:{observability:Object.fromEntries(_.map(({key:e})=>[e,g[e]]))}}}))._tag===`Success`&&(r({}),s(`Saved. Restart the server to apply.`))}finally{a(!1)}}},children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Send traces, metrics, and logs to an OTLP HTTP receiver. Restart the server to apply. Environment variables override these settings.`}),!l&&(0,G.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`This connection lacks permission to change settings on`,` `,e?.label??`the selected environment`,`.`]}),gt.map(({key:e,label:n,signal:a})=>{let o=g[e].trim(),c=u?vt(o,d[e]):null;return(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[c&&(0,G.jsx)(B,{dotClassName:c.dot}),(0,G.jsxs)(xe,{htmlFor:e,children:[n,` endpoint`]})]}),c&&(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c.label})]}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(he,{id:e,size:`sm`,type:`url`,pattern:`[Hh][Tt][Tt][Pp][Ss]?://.*`,title:`Enter an HTTP or HTTPS endpoint, or leave empty to disable export.`,placeholder:`http://localhost:4318/v1/${a}`,value:g[e],disabled:i||!l,onChange:n=>{let i=n.target.value;r(n=>{let r={...n,[e]:i};return i.trim()===t[e]&&delete r[e],r}),s(null)}}),u&&(0,G.jsx)(f,{type:`button`,size:`sm`,variant:`outline`,disabled:!_t(o)||d[e]?.result===null,onClick:()=>void x(e,a,o),children:`Test`})]}),t[e]!==(y?.[e]??``)&&(0,G.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[`Running: `,y?.[e]||`Disabled`]})]},e)}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:o}),(0,G.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,G.jsx)(f,{type:`button`,size:`xs`,variant:`outline`,disabled:!v||i||!l,onClick:()=>{if(r({}),s(null),u)for(let{key:e,signal:n}of gt)d[e]?.url!==t[e]&&x(e,n,t[e])},children:`Discard`}),(0,G.jsx)(f,{type:`submit`,size:`xs`,disabled:!v||i||!l,children:i?`Saving…`:`Save`})]})]})]})})}var xt=new Intl.NumberFormat;function X(e){return xt.format(e)}function Z(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e>=1e4?1:2)} s`}function St(e){if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`],n=-1,r=e;do r/=1024,n+=1;while(r>=1024&&n<t.length-1);return`${r.toFixed(r>=10?1:2)} ${t[n]}`}function Ct(e){return e?N(p(e)):`No trace records`}function wt(e){return Ct(e).replaceAll(` `,`\xA0`)}function Tt(e){return e.length<=32?e:`${e.slice(0,18)}...${e.slice(-10)}`}function Et(e){return e?.includes(`not a live descendant`)??!1}function Q(e){let t=(0,W.c)(17),{label:n,value:r,tooltip:i,tone:a}=e,o=a===void 0?`default`:a,s;t[0]===n?s=t[1]:(s=(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:n}),t[0]=n,t[1]=s);let c;t[2]!==n||t[3]!==i?(c=i?(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`button`,{type:`button`,className:`cursor-pointer inline-flex size-3.5 shrink-0 items-center justify-center rounded-sm text-muted-foreground/60 hover:text-foreground`,"aria-label":`${n} details`,children:(0,G.jsx)(b,{className:`size-3`})})}),(0,G.jsx)(F,{side:`top`,children:i})]}):null,t[2]=n,t[3]=i,t[4]=c):c=t[4];let l;t[5]!==s||t[6]!==c?(l=(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-2xs font-medium uppercase tracking-widest text-muted-foreground/70`,children:[s,c]}),t[5]=s,t[6]=c,t[7]=l):l=t[7];let u=o===`warning`&&`text-warning-foreground`,d=o===`danger`&&`text-destructive`,f;t[8]!==u||t[9]!==d?(f=S(`mt-1 truncate font-mono text-lg font-semibold tabular-nums text-foreground`,u,d),t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]!==f||t[12]!==r?(p=(0,G.jsx)(`div`,{className:f,children:r}),t[11]=f,t[12]=r,t[13]=p):p=t[13];let m;return t[14]!==l||t[15]!==p?(m=(0,G.jsxs)(`div`,{className:`min-w-0 border-border/60 px-4 py-3 sm:px-5`,children:[l,p]}),t[14]=l,t[15]=p,t[16]=m):m=t[16],m}function Dt(e){let t=(0,W.c)(6),{children:n}=e,r,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/2 w-px bg-border/60`,"aria-hidden":!0}),i=(0,G.jsx)(`span`,{className:`pointer-events-none absolute inset-x-0 top-1/2 h-px bg-border/60 sm:hidden`,"aria-hidden":!0}),a=(0,G.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/4 hidden w-px bg-border/60 sm:block`,"aria-hidden":!0}),o=(0,G.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-3/4 hidden w-px bg-border/60 sm:block`,"aria-hidden":!0}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):(r=t[0],i=t[1],a=t[2],o=t[3]);let s;return t[4]===n?s=t[5]:(s=(0,G.jsxs)(`div`,{className:`relative grid grid-cols-2 sm:grid-cols-4`,children:[r,i,a,o,n]}),t[4]=n,t[5]=s),s}function $(e){let t=(0,W.c)(2),{label:n}=e,r;return t[0]===n?r=t[1]:(r=(0,G.jsx)(`div`,{className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:n}),t[0]=n,t[1]=r),r}function Ot(e){let t=(0,W.c)(21),{headers:n,children:r,minTableWidth:i,columnWidths:a}=e,o=i===void 0?`min-w-[640px]`:i,s=a&&`table-fixed`,c;t[0]!==o||t[1]!==s?(c=S(`w-full text-left text-xs`,o,s),t[0]=o,t[1]=s,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==n?(l=a?(0,G.jsx)(`colgroup`,{children:n.map((e,t)=>(0,G.jsx)(`col`,{className:a[t]},e))}):null,t[3]=a,t[4]=n,t[5]=l):l=t[5];let u;if(t[6]!==a||t[7]!==n){let e;t[9]!==a||t[10]!==n.length?(e=(e,t)=>(0,G.jsx)(`th`,{className:S(`whitespace-nowrap px-4 py-2.5 font-semibold first:sm:pl-5 last:sm:pr-5`,!a&&t===n.length-1&&`w-px`),children:e.replaceAll(` `,`\xA0`)},e),t[9]=a,t[10]=n.length,t[11]=e):e=t[11],u=n.map(e),t[6]=a,t[7]=n,t[8]=u}else u=t[8];let d;t[12]===u?d=t[13]:(d=(0,G.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsx)(`tr`,{children:u})}),t[12]=u,t[13]=d);let f;t[14]===r?f=t[15]:(f=(0,G.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:r}),t[14]=r,t[15]=f);let p;return t[16]!==c||t[17]!==l||t[18]!==d||t[19]!==f?(p=(0,G.jsx)(L,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:c,children:[l,d,f]})}),t[16]=c,t[17]=l,t[18]=d,t[19]=f,t[20]=p):p=t[20],p}function kt(e){let t=(0,W.c)(25),{traceId:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={target:`trace ID`,timeout:1200},t[0]=r):r=t[0];let{copyToClipboard:a,isCopied:o}=k(r),s;t[1]===n?s=t[2]:(s=Tt(n),t[1]=n,t[2]=s);let c;t[3]===s?c=t[4]:(c=(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-2xs`,children:s})}),t[3]=s,t[4]=c);let l;t[5]===n?l=t[6]:(l=(0,G.jsx)(F,{side:`top`,variant:`code`,children:n}),t[5]=n,t[6]=l);let u;t[7]!==c||t[8]!==l?(u=(0,G.jsxs)(I,{children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9];let d=o?`Copied trace ID`:`Copy trace ID`,p;t[10]!==a||t[11]!==n?(p=()=>a(n),t[10]=a,t[11]=n,t[12]=p):p=t[12];let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,G.jsx)(i,{className:`size-3`}),t[13]=m):m=t[13];let h;t[14]!==d||t[15]!==p?(h=(0,G.jsx)(P,{render:(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":d,onClick:p,children:m})}),t[14]=d,t[15]=p,t[16]=h):h=t[16];let g=o?`Copied`:`Copy full trace ID`,_;t[17]===g?_=t[18]:(_=(0,G.jsx)(F,{side:`top`,children:g}),t[17]=g,t[18]=_);let v;t[19]!==_||t[20]!==h?(v=(0,G.jsxs)(I,{children:[h,_]}),t[19]=_,t[20]=h,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==u?(y=(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 max-w-full items-center gap-2`,children:[u,v]}),t[22]=v,t[23]=u,t[24]=y):y=t[24],y}function At(e){let t=e.trim().split(/\s+/)[0];if(!t)return e;let n=t.replace(/^['"]|['"]$/g,``);return n.split(/[\\/]/).filter(Boolean).at(-1)??n}function jt(e){return e.depth>0?`Subprocess`:/\b(codex|claude|opencode|cursor)\b/i.test(e.command)?`Agent`:`Process`}function Mt(e){let t=(0,W.c)(22),{process:n,isExpanded:r,onToggle:i}=e,a;t[0]===n.command?a=t[1]:(a=At(n.command),t[0]=n.command,t[1]=a);let o=a,s=n.childPids.length>0,c=`${Math.min(n.depth,6)*10}px`,l;t[2]===c?l=t[3]:(l={paddingLeft:c},t[2]=c,t[3]=l);let u;t[4]!==s||t[5]!==r||t[6]!==o||t[7]!==i||t[8]!==n.pid?(u=s?(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":r?`Collapse ${o}`:`Expand ${o}`,onClick:()=>i(n.pid),children:(0,G.jsx)(E,{className:`size-3.5`,icon:r?T:D})}):(0,G.jsx)(`span`,{className:`size-5 shrink-0`,"aria-hidden":`true`}),t[4]=s,t[5]=r,t[6]=o,t[7]=i,t[8]=n.pid,t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,G.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-success/80`}),t[10]=d):d=t[10];let p;t[11]===o?p=t[12]:(p=(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[11]=o,t[12]=p);let m;t[13]===n.command?m=t[14]:(m=(0,G.jsx)(F,{side:`top`,variant:`code`,children:n.command}),t[13]=n.command,t[14]=m);let h;t[15]!==p||t[16]!==m?(h=(0,G.jsxs)(I,{children:[p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17];let g;return t[18]!==l||t[19]!==u||t[20]!==h?(g=(0,G.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,d,h]}),t[18]=l,t[19]=u,t[20]=h,t[21]=g):g=t[21],g}function Nt(e){let t=(0,W.c)(18),{processes:n,canMaintainEnvironment:r,signalingPid:i,onSignal:a,emptyLabel:o}=e,[s,c]=(0,q.useState)(Pt),l;if(t[0]!==s||t[1]!==n){l=[];let e=null;for(let t of n){if(e!==null){if(t.depth>e)continue;e=null}l.push(t),s.has(t.pid)&&(e=t.depth)}t[0]=s,t[1]=n,t[2]=l}else l=t[2];let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[3]=d):d=t[3];let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[33%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[6%]`})]}),t[4]=p):p=t[4];let m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,G.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Name`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Type`}),(0,G.jsx)(`th`,{className:`p-2 text-right font-semibold sm:pr-4`,children:`Kill`})]})}),t[5]=m):m=t[5];let h;t[6]!==o||t[7]!==u.length?(h=u.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:7,className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:o??`No live descendant processes found.`})}):null,t[6]=o,t[7]=u.length,t[8]=h):h=t[8];let g;t[9]!==r||t[10]!==s||t[11]!==a||t[12]!==i||t[13]!==u?(g=u.map(e=>(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,G.jsx)(Mt,{process:e,isExpanded:!s.has(e.pid),onToggle:f})}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:St(e.rssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,G.jsx)(F,{side:`top`,variant:`code`,children:e.command})]})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground`,children:e.pid}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 align-middle text-muted-foreground`,children:jt(e)}),(0,G.jsx)(`td`,{className:`p-2 align-middle sm:pr-4`,children:(0,G.jsx)(K,{disabled:!r||i===e.pid,onSignal:t=>a(e.pid,t)})})]},e.pid)),t[9]=r,t[10]=s,t[11]=a,t[12]=i,t[13]=u,t[14]=g):g=t[14];let _;return t[15]!==h||t[16]!==g?(_=(0,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(L,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1040px] table-fixed text-left text-xs`,children:[p,m,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[h,g]})]})})}),t[15]=h,t[16]=g,t[17]=_):_=t[17],_}function Pt(){return new Set}var Ft=[{label:`5m`,windowMs:3e5,bucketMs:3e4},{label:`15m`,windowMs:9e5,bucketMs:6e4},{label:`30m`,windowMs:18e5,bucketMs:12e4},{label:`1h`,windowMs:36e5,bucketMs:3e5}];function It(e){if(e<60)return`${e.toFixed(e>=10?1:2)}s`;let t=e/60;return t<60?`${t.toFixed(t>=10?1:2)}m`:`${(t/60).toFixed(2)}h`}function Lt(e){let t=At(e);return t.length>42?`${t.slice(0,39)}...`:t}function Rt(e){let t=(0,W.c)(21),{process:n,visualDepth:r}=e,i;t[0]===n.command?i=t[1]:(i=Lt(n.command),t[0]=n.command,t[1]=i);let a=i,o=`${Math.min(r,6)*10}px`,s;t[2]===o?s=t[3]:(s={paddingLeft:o},t[2]=o,t[3]=s);let c=`${n.isServerRoot?`Root`:`Child`} process ${a}`,l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,G.jsx)(`span`,{className:`size-5 shrink-0`,"aria-hidden":`true`}),t[4]=l):l=t[4];let u=n.isServerRoot?`bg-warning/90`:`bg-success/80`,d;t[5]===u?d=t[6]:(d=S(`size-1.5 shrink-0 rounded-full`,u),t[5]=u,t[6]=d);let f;t[7]===d?f=t[8]:(f=(0,G.jsx)(`span`,{className:d}),t[7]=d,t[8]=f);let p;t[9]===a?p=t[10]:(p=(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:a})}),t[9]=a,t[10]=p);let m;t[11]===n.command?m=t[12]:(m=(0,G.jsx)(F,{side:`top`,variant:`code`,children:n.command}),t[11]=n.command,t[12]=m);let h;t[13]!==m||t[14]!==p?(h=(0,G.jsxs)(I,{children:[p,m]}),t[13]=m,t[14]=p,t[15]=h):h=t[15];let g;return t[16]!==h||t[17]!==s||t[18]!==c||t[19]!==f?(g=(0,G.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:s,"aria-label":c,children:[l,f,h]}),t[16]=h,t[17]=s,t[18]=c,t[19]=f,t[20]=g):g=t[20],g}function zt(e){let t=(0,W.c)(9),{buckets:n}=e,r;t[0]===n?r=t[1]:(r=Math.max(1,...n.map(Bt)),t[0]=n,t[1]=r);let i=r,a;if(t[2]!==n||t[3]!==i){let e;t[5]===i?e=t[6]:(e=e=>{let t=Math.max(2,e.maxCpuPercent/i*100),n=Math.max(2,e.avgCpuPercent/i*100);return(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`div`,{className:`flex h-full min-w-1 flex-1 items-end`,children:(0,G.jsxs)(`div`,{className:`relative h-full w-full`,"aria-label":`Average CPU ${e.avgCpuPercent.toFixed(1)}%, peak CPU ${e.maxCpuPercent.toFixed(1)}%`,children:[(0,G.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/15 transition-colors`,style:{height:`${t}%`}}),(0,G.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/60 transition-colors`,style:{height:`${n}%`}})]})})}),(0,G.jsxs)(F,{side:`top`,children:[`Avg `,e.avgCpuPercent.toFixed(1),`%, peak `,e.maxCpuPercent.toFixed(1),`%`]})]},p(e.startedAt))},t[5]=i,t[6]=e),a=n.map(e),t[2]=n,t[3]=i,t[4]=a}else a=t[4];let o;return t[7]===a?o=t[8]:(o=(0,G.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,G.jsx)(`div`,{className:`flex h-28 items-end gap-1 overflow-hidden rounded-sm bg-muted/10 p-2`,children:a})}),t[7]=a,t[8]=o),o}function Bt(e){return e.maxCpuPercent}function Vt(e){let t=(0,W.c)(8),{selectedWindowMs:n,onSelect:r}=e,i=String(n),a;t[0]===i?a=t[1]:(a=[i],t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=e=>{let t=Ft.find(t=>String(t.windowMs)===e[0]);t&&r(t.windowMs)},t[2]=r,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=Ft.map(Ht),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,G.jsx)(pe,{"aria-label":`Process history period`,variant:`segmented`,value:a,onValueChange:o,children:s}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}function Ht(e){return(0,G.jsx)(me,{value:String(e.windowMs),children:e.label},e.windowMs)}function Ut(e){let t=(0,W.c)(13),{processes:n,emptyLabel:r}=e,i=n.reduce(Wt,null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[16%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`})]}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Current`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Average`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Max Mem`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`PID`})]})}),t[1]=o):o=t[1];let s;t[2]!==r||t[3]!==n.length?(s=n.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:8,className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:r})}):null,t[2]=r,t[3]=n.length,t[4]=s):s=t[4];let c;if(t[5]!==n||t[6]!==i){let e;t[8]===i?e=t[9]:(e=e=>(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,G.jsx)(Rt,{process:e,visualDepth:e.isServerRoot||i===null?0:Math.max(1,e.depth-i+1)})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:It(e.cpuSecondsApprox)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.currentCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.avgCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:St(e.maxRssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,G.jsx)(F,{side:`top`,variant:`code`,children:e.command})]})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground sm:pr-5`,children:e.pid})]},e.processKey),t[8]=i,t[9]=e),c=n.map(e),t[5]=n,t[6]=i,t[7]=c}else c=t[7];let l;return t[10]!==s||t[11]!==c?(l=(0,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(L,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[980px] table-fixed text-left text-xs`,children:[a,o,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[s,c]})]})})}),t[10]=s,t[11]=c,t[12]=l):l=t[12],l}function Wt(e,t){return t.isServerRoot?e:e===null?t.depth:Math.min(e,t.depth)}function Gt(e){let t=(0,W.c)(7),{checkedAt:n}=e;z();let r;t[0]===n?r=t[1]:(r=fe(n?p(n):null),t[0]=n,t[1]=r);let i=r;if(i.status===`missing`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/50`,children:`Checking`}),t[2]=e):e=t[2],e}if(i.status===`invalid`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/50`,children:`Checked unavailable`}),t[3]=e):e=t[3],e}let a;return t[4]!==i.suffix||t[5]!==i.value?(a=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/60`,children:i.suffix?(0,G.jsxs)(G.Fragment,{children:[`Checked `,(0,G.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,G.jsxs)(G.Fragment,{children:[`Checked `,i.value]})}),t[4]=i.suffix,t[5]=i.value,t[6]=a):a=t[6],a}function Kt(e){let t=(0,W.c)(12),{isPending:n,label:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,G.jsx)(ye,{refreshing:n}),t[0]=n,t[1]=a);let o;t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a?(o=(0,G.jsx)(P,{render:(0,G.jsx)(f,{size:`icon-xs`,variant:`ghost-muted`,disabled:n,onClick:i,"aria-label":r,children:a})}),t[2]=n,t[3]=r,t[4]=i,t[5]=a,t[6]=o):o=t[6];let s;t[7]===r?s=t[8]:(s=(0,G.jsx)(F,{side:`top`,children:r}),t[7]=r,t[8]=s);let c;return t[9]!==o||t[10]!==s?(c=(0,G.jsxs)(I,{children:[o,s]}),t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function qt(){let{environment:e}=_e(),t=e?.environmentId??null,n=se(t,c),r=e?.serverConfig?.observability,i=e?.serverConfig?.availableEditors,a=se(t,y),o=ue(t===null?null:le.sessionStateAtom(t)),s=Se({connectionPhase:e?.connection.phase??`available`,session:o.data,hasSessionError:o.error!==null}),l=s.canReadDiagnostics,u=de(j.signalProcess,{reportFailure:!1}),d=be(t,i??[]),[h,g]=(0,q.useState)(9e5),_=Ft.find(e=>e.windowMs===h)??Ft[1],{data:v,error:b,isPending:ee,refresh:te}=ue(t===null||!l?null:j.traceDiagnostics({environmentId:t,input:{}})),{data:w,error:T,isPending:E,refresh:D}=ue(t===null||!l?null:j.processDiagnostics({environmentId:t,input:{}})),{data:k,error:A,isPending:M,refresh:N}=ue(t===null||!l?null:j.processResourceHistory({environmentId:t,input:{windowMs:_.windowMs,bucketMs:_.bucketMs}})),[fe,pe]=(0,q.useState)(!1),[me,he]=(0,q.useState)(null),[ge,z]=(0,q.useState)(null),B=(0,q.useRef)(null),ye=(0,q.useRef)(t),V=(0,q.useRef)(w);(0,q.useEffect)(()=>{V.current=w},[w]),(0,q.useEffect)(()=>(ye.current=t,()=>{ye.current=null}),[t]);let xe=(0,q.useCallback)(()=>{let e=r?.logsDirectoryPath??null;e&&t!==null&&ce(t,`orchestration:operate`)&&(pe(!0),he(null),(async()=>{let t=await d(e);if(pe(!1),t._tag===`Failure`&&!ie(t)){let e=ae(t);he(e instanceof Error?e.message:`Unable to open logs folder.`)}})())},[t,r?.logsDirectoryPath,d]),U=ee&&v===null,W=E&&w===null,K=M&&k===null,[Ce,we]=(0,q.useState)(null);Ce!==t&&l&&!U&&!W&&!K&&we(t);let J=(0,q.useCallback)(async(e,t)=>{let n=ye.current,r=V.current?.processes.find(t=>t.pid===e);if(n===null||r===void 0||!ce(n,`environment:maintain`)||B.current!==null)return;B.current=e,z(e);let i=()=>{B.current=null,z(null)};if(t===`SIGKILL`){let n=!1;try{n=await oe().dialogs.confirm(`Send SIGKILL to process ${e}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){i(),O.add({type:`error`,title:`Could not confirm signal`,description:e instanceof Error?e.message:`Failed to send ${t}.`});return}if(!n){i();return}}let a=ye.current;if(a===null||a!==n||!ce(a,`environment:maintain`)){i();return}if(V.current?.processes.find(t=>t.pid===e)?.startTimeMs!==r.startTimeMs){i();return}try{let i=await u({environmentId:n,input:{pid:e,startTimeMs:r.startTimeMs,signal:t}});if(i._tag===`Failure`){if(!ie(i)){let e=ae(i);O.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}return}if(!i.value.signaled){let e=x(i.value.message);if(D(),Et(e)){O.add({type:`info`,title:`Process already exited`,description:`The process is not a child of the P4 Code server. It might already have exited.`});return}O.add({type:`error`,title:`Could not send ${t}`,description:e??`Failed to send ${t}.`});return}D()}finally{i()}},[D,u]),Te=w?ne(w.error):null,Ee=k?ne(k.error):null,Y=v?ne(v.error):null,De=v?m(v.partialFailure,()=>!1):!1;return l?(0,G.jsxs)(ve,{width:`expanded`,className:`gap-10`,children:[(0,G.jsx)(ut,{environmentId:t}),(0,G.jsxs)(R,{title:`Live Processes`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Gt,{checkedAt:w?.readAt??null}),(0,G.jsx)(Kt,{isPending:E,label:`Refresh process diagnostics`,onClick:D})]}),children:[(0,G.jsxs)(Dt,{children:[(0,G.jsx)(Q,{label:`Child Processes`,value:w?X(w.processCount):`...`}),(0,G.jsx)(Q,{label:`CPU`,value:w?`${w.totalCpuPercent.toFixed(1)}%`:`...`,tooltip:`Total CPU across live child processes of the current server process. The desktop shell and other parent processes are not included.`}),(0,G.jsx)(Q,{label:`Memory`,value:w?St(w.totalRssBytes):`...`,tooltip:`Total resident memory across live child processes of the current server process. The desktop shell and other parent processes are not included.`}),(0,G.jsx)(Q,{label:`Server PID`,value:w?String(w.serverPid):`...`})]}),Te||T?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[Te?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:Te.message})]}):null,T?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:T})]}):null]}):null,(0,G.jsx)(Nt,{processes:w?.processes??[],canMaintainEnvironment:n,signalingPid:ge,onSignal:J,emptyLabel:W?`Loading live processes...`:`No live descendant processes found.`})]}),(0,G.jsxs)(R,{title:`Resource History`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Vt,{selectedWindowMs:h,onSelect:g}),(0,G.jsx)(Gt,{checkedAt:k?.readAt??null}),(0,G.jsx)(Kt,{isPending:M,label:`Refresh resource history`,onClick:N})]}),children:[(0,G.jsxs)(Dt,{children:[(0,G.jsx)(Q,{label:`CPU Time`,value:k?It(k.totalCpuSecondsApprox):`...`,tooltip:`Approximate active CPU time for the P4 Code server root process and its descendants during the selected window. It grows only while sampled processes use CPU and older samples leave as the window moves.`}),(0,G.jsx)(Q,{label:`Samples`,value:k?X(k.retainedSampleCount):`...`,tooltip:`In-memory process samples retained by the server. The server samples only while diagnostics is open, and this resets when the server restarts.`}),(0,G.jsx)(Q,{label:`Interval`,value:k?k.sampleIntervalMs===0?`On demand`:Z(k.sampleIntervalMs):`...`}),(0,G.jsx)(Q,{label:`Processes`,value:k?X(k.topProcesses.length):`...`})]}),Ee||A?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[Ee?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:Ee.message})]}):null,A?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:A})]}):null]}):null,(0,G.jsx)(zt,{buckets:k?.buckets??[]}),(0,G.jsx)(Ut,{processes:k?.topProcesses??[],emptyLabel:K?`Collecting process resource samples...`:`No process resource samples found for this window.`})]}),(0,G.jsxs)(R,{title:`Trace Diagnostics`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Gt,{checkedAt:v?.readAt??null}),(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(f,{size:`icon-xs`,variant:`ghost-muted`,disabled:!a||!r?.logsDirectoryPath||fe,onClick:xe,"aria-label":`Open logs folder`,children:(0,G.jsx)(re,{})})}),(0,G.jsx)(F,{side:`top`,children:`Open logs folder`})]}),(0,G.jsx)(Kt,{isPending:ee,label:`Refresh trace diagnostics`,onClick:te})]}),children:[(0,G.jsxs)(Dt,{children:[(0,G.jsx)(Q,{label:`Spans`,value:v?X(v.recordCount):`...`}),(0,G.jsx)(Q,{label:`Failures`,value:v?X(v.failureCount):`...`,tone:v&&v.failureCount>0?`danger`:`default`}),(0,G.jsx)(Q,{label:`Slow Spans`,value:v?X(v.slowSpanCount):`...`,tooltip:v?`Spans with a duration of ${Z(v.slowSpanThresholdMs)} or longer.`:`Spans at or above the configured slow-span threshold.`,tone:v&&v.slowSpanCount>0?`warning`:`default`}),(0,G.jsx)(Q,{label:`Parse Errors`,value:v?X(v.parseErrorCount):`...`,tone:v&&v.parseErrorCount>0?`warning`:`default`})]}),me||Y||b?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[me?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:me})]}):null,Y?(0,G.jsxs)(`div`,{className:S(`flex items-start gap-2`,De?`text-warning-foreground`:`text-destructive`),children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:De?`Some trace files could not be read, so diagnostics may be incomplete. ${Y.message}`:Y.message})]}):null,b?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:b})]}):null]}):null]}),(0,G.jsx)(R,{title:`Latest Failures`,children:v&&v.latestFailures.length>0?(0,G.jsx)(Ot,{headers:[`Span`,`Cause`,`Duration`,`Ended`],children:v.latestFailures.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(H,{text:e.cause})}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.durationMs)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:wt(e.endedAt)})]},`${e.traceId}:${e.spanId}`))}):(0,G.jsx)($,{label:U?`Loading failures...`:`No failed spans found.`})}),(0,G.jsx)(R,{title:`Most Common Failures`,children:v&&v.commonFailures.length>0?(0,G.jsx)(Ot,{headers:[`Span`,`Count`,`Cause`,`Last Seen`],minTableWidth:`min-w-[760px]`,children:v.commonFailures.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:X(e.count)}),(0,G.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(H,{text:e.cause})}),(0,G.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:wt(e.lastSeenAt)})]},`${e.name}:${e.cause}`))}):(0,G.jsx)($,{label:U?`Loading failure groups...`:`No repeated failures found.`})}),(0,G.jsx)(R,{title:`Slowest Spans`,children:v&&v.slowestSpans.length>0?(0,G.jsx)(Ot,{headers:[`Span`,`Duration`,`Ended`,`Trace`],minTableWidth:`min-w-[900px]`,columnWidths:[`w-[44%]`,`w-[14%]`,`w-[12%]`,`w-[30%]`],children:v.slowestSpans.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.durationMs)}),(0,G.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground`,children:wt(e.endedAt)}),(0,G.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground last:sm:pr-5`,children:(0,G.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}`))}):(0,G.jsx)($,{label:U?`Loading slow spans...`:`No spans found.`})}),(0,G.jsx)(R,{title:`Span Logs`,children:v&&v.latestWarningAndErrorLogs.length>0?(0,G.jsx)(L,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[920px] table-fixed text-left text-xs`,children:[(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[26%]`}),(0,G.jsx)(`col`,{className:`w-[30%]`})]}),(0,G.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pl-5`,children:`Time`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Level`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Span`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Message`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pr-5`,children:`Trace`})]})}),(0,G.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:v.latestWarningAndErrorLogs.map(e=>(0,G.jsxs)(`tr`,{className:`hover:bg-muted/15`,children:[(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground sm:pl-5`,children:wt(e.seenAt)}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,G.jsx)(`span`,{className:`inline-flex rounded bg-muted px-1.5 py-0.5 font-mono text-2xs font-medium uppercase text-foreground/80`,children:e.level})}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,G.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:e.spanName})}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(H,{collapsedClassName:`line-clamp-2`,expandLabel:`Show full message`,text:e.message})}),(0,G.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground sm:pr-5`,children:(0,G.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}:${p(e.seenAt)}:${e.message}`))})]})}):(0,G.jsx)($,{label:U?`Loading recent logs...`:`No warnings or errors found.`})}),(0,G.jsx)(R,{title:`Top Span Names`,children:v&&v.topSpansByCount.length>0?(0,G.jsx)(Ot,{headers:[`Span`,`Count`,`Failures`,`Average`,`Max`],minTableWidth:`min-w-[760px]`,columnWidths:[`w-[48%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`],children:v.topSpansByCount.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:X(e.count)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:X(e.failureCount)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.averageDurationMs)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums last:sm:pr-5`,children:Z(e.maxDurationMs)})]},e.name))}):(0,G.jsx)($,{label:U?`Loading span names...`:`No spans found.`})}),Ce===t&&(0,G.jsx)(yt,{})]}):(0,G.jsx)(ve,{children:(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t===null?`Connect an environment to see diagnostics.`:s.isPending?`Checking diagnostics access…`:s.error})})}var Jt=qt;export{Jt as component};
2
+ //# sourceMappingURL=settings.diagnostics-csgW1_E8.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./react-DH3P2YXY.js";import{n as t,t as n}from"./jsx-runtime-BnjsACtP.js";import{n as r}from"./SettingsPanels-BfBUSBAG.js";var i=t(),a=e(n());function o(){let e=(0,i.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsx)(r,{}),e[0]=t):t=e[0],t}export{o as component};
2
- //# sourceMappingURL=settings.general-qzEOE2zF.js.map
1
+ import{a as e}from"./react-DH3P2YXY.js";import{n as t,t as n}from"./jsx-runtime-BnjsACtP.js";import{n as r}from"./SettingsPanels-CNgY_ZPe.js";var i=t(),a=e(n());function o(){let e=(0,i.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsx)(r,{}),e[0]=t):t=e[0],t}export{o as component};
2
+ //# sourceMappingURL=settings.general-CeBkrL9-.js.map