@p4code/cli 0.8.2 → 0.8.3

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 (452) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-C1tFongj.mjs → binCli-DouSNynJ.mjs} +17297 -3439
  3. package/dist/client/.vite/manifest.json +2164 -2147
  4. package/dist/client/assets/{AnimatedHeight-PJxVEp27.js → AnimatedHeight-DoG4b7y8.js} +2 -2
  5. package/dist/client/assets/{AuthSurfaceShell-BrPHaco9.js → AuthSurfaceShell-DbeJoeXz.js} +2 -2
  6. package/dist/client/assets/{CSPContext-C7uwFl6f.js → CSPContext-DkFc4cYo.js} +2 -2
  7. package/dist/client/assets/ChatGptUsageButton-D93cMeTp.js +2 -0
  8. package/dist/client/assets/ChatMarkdown-CLD9Y6dg.js +65 -0
  9. package/dist/client/assets/CodexSetupSection.logic-DJw6xB7P.js +2 -0
  10. package/dist/client/assets/ComboboxClear-ZQvkAjz8.js +2 -0
  11. package/dist/client/assets/{CommandBlock-JrUX9e8E.js → CommandBlock-c98wFxMU.js} +2 -2
  12. package/dist/client/assets/{ComposerPromptEditor-Ba1dvqDN.js → ComposerPromptEditor-CBuOXkT9.js} +55 -55
  13. package/dist/client/assets/CompositeRoot-BMUI_bmJ.js +2 -0
  14. package/dist/client/assets/{ConnectionStatusDot-Cjh57o6i.js → ConnectionStatusDot-B69zfKRh.js} +2 -2
  15. package/dist/client/assets/DevicePanel-1xw7KQ15.js +2 -0
  16. package/dist/client/assets/{DeviceSetup-DccRVnjb.js → DeviceSetup-DemgUuG-.js} +2 -2
  17. package/dist/client/assets/DialogTitle-BXot7RA0.js +2 -0
  18. package/dist/client/assets/{DiffCommentAnnotation-DDBZcMFv.js → DiffCommentAnnotation-vAZP7JBy.js} +3 -3
  19. package/dist/client/assets/DiffFileTree-BhqF8nD5.js +2 -0
  20. package/dist/client/assets/DiffPanel-Dqh76p3E.js +2 -0
  21. package/dist/client/assets/{DiffWorkerPoolProvider-RcplgHGv.js → DiffWorkerPoolProvider-D4VIo5Vu.js} +3 -3
  22. package/dist/client/assets/{EnvironmentMachineIcon-DMZGa766.js → EnvironmentMachineIcon-DPQkDtvr.js} +2 -2
  23. package/dist/client/assets/{ExpandableText-DfY-qqRW.js → ExpandableText-EZ9C25tN.js} +3 -3
  24. package/dist/client/assets/{FieldControl-C9UnFGZn.js → FieldControl-C4IsJLMZ.js} +2 -2
  25. package/dist/client/assets/{FileDiff-BXlBWSxx.js → FileDiff-H9QHqXa0.js} +2 -2
  26. package/dist/client/assets/FilePreviewPanel-DGm_SU_e.js +34 -0
  27. package/dist/client/assets/FoldedSettingsSection-BSYFyChk.js +2 -0
  28. package/dist/client/assets/{FormContext-haYZgWIK.js → FormContext-DiXpMuU8.js} +2 -2
  29. package/dist/client/assets/{Icons-C12feMOO.js → Icons-DA4msgfR.js} +2 -2
  30. package/dist/client/assets/{KeybindingsSettings.logic-DhXMdk5O.js → KeybindingsSettings.logic-7EBA0xLE.js} +2 -2
  31. package/dist/client/assets/{NoProjectsHero-CDoSxJVV.js → NoProjectsHero-YjEc2OIw.js} +2 -2
  32. package/dist/client/assets/{PanelLayoutControls-CCKUTh1H.js → PanelLayoutControls-BfRIRM0o.js} +13 -13
  33. package/dist/client/assets/{PierreEntryIcon-7x50Pz_C.js → PierreEntryIcon-BxxykifK.js} +2 -2
  34. package/dist/client/assets/PreviewPanel-QkMfuC1J.js +2 -0
  35. package/dist/client/assets/ProjectDefaultsSettings-C6wxaRmJ.js +2 -0
  36. package/dist/client/assets/{ProjectFavicon-ExMHrN16.js → ProjectFavicon-CiauSitF.js} +3 -3
  37. package/dist/client/assets/ProjectIconPickerDialog-GDqk2LEH.js +2 -0
  38. package/dist/client/assets/{ProjectMonogram-um8sYqIi.js → ProjectMonogram-Bqe3OyZR.js} +2 -2
  39. package/dist/client/assets/{ProviderAuthTerminal-Tw3kH5vc.js → ProviderAuthTerminal-D_OC5vdS.js} +2 -2
  40. package/dist/client/assets/ProviderModelPicker-Bfpy_Rw1.js +2 -0
  41. package/dist/client/assets/ProviderSettingsForm-BA6yGdRn.js +2 -0
  42. package/dist/client/assets/PullRequestCodeTab-BOM7mgfd.js +6 -0
  43. package/dist/client/assets/{ReadOnlySourcePreview-Cw6lfMjA.js → ReadOnlySourcePreview-C3LnvSkA.js} +2 -2
  44. package/dist/client/assets/{RenderErrorBoundary-D21mPr47.js → RenderErrorBoundary-C-EIIrrq.js} +2 -2
  45. package/dist/client/assets/ScheduledTasksSettings-DFtwNfb8.js +4 -0
  46. package/dist/client/assets/ScopedSwitch-DsEcG6rk.js +2 -0
  47. package/dist/client/assets/SecretInput-Be5Akw8x.js +2 -0
  48. package/dist/client/assets/{SettingsPanels-DjzXV7Dm.js → SettingsPanels-CI-FknGh.js} +7 -7
  49. package/dist/client/assets/{SettingsPanels.logic-DpdMN_lX.js → SettingsPanels.logic-CLB8Pu-U.js} +2 -2
  50. package/dist/client/assets/{SettingsScopeNotice-CdNfxmW3.js → SettingsScopeNotice-CVoWG1oN.js} +2 -2
  51. package/dist/client/assets/T3ConnectAccountPages-ClNzwIQw.js +2 -0
  52. package/dist/client/assets/{T3ConnectSidebarSignIn-DewmE1PI.js → T3ConnectSidebarSignIn-BqM_Vqe1.js} +2 -2
  53. package/dist/client/assets/{ThemeEditorPanel-aEsLfkYx.js → ThemeEditorPanel-vVmQV_Vv.js} +3 -3
  54. package/dist/client/assets/ThreadTerminalDrawer-aLeVbe6g.js +5 -0
  55. package/dist/client/assets/{Virtualizer-B2BG0GB9.js → Virtualizer-DTOYU5Jp.js} +2 -2
  56. package/dist/client/assets/WorkspaceBreadcrumb-C9OPPGJE.js +2 -0
  57. package/dist/client/assets/WorkspacePageContainer-DtXJ5ept.js +2 -0
  58. package/dist/client/assets/{WorkspacePageHeader-BCZXPSxj.js → WorkspacePageHeader-5zzLFpEN.js} +2 -2
  59. package/dist/client/assets/_chat-BKcYL38S.js +45 -0
  60. package/dist/client/assets/{_chat.index-7o1_qjfU.js → _chat.index-BP1JWABB.js} +2 -2
  61. package/dist/client/assets/{_chat.new-W2E0MZ4y.js → _chat.new-BX5LyFum.js} +3 -3
  62. package/dist/client/assets/{_chat.pull-requests-DnQ-MKRG.js → _chat.pull-requests-B6-Vck8B.js} +2 -2
  63. package/dist/client/assets/{abnfDiagram-VCTEODGH-DJY5x2uS.js → abnfDiagram-VCTEODGH-BXvAfzAg.js} +2 -2
  64. package/dist/client/assets/{alert-yllEf0yh.js → alert-B-or1ble.js} +2 -2
  65. package/dist/client/assets/architecture-7GRP2DOG-DqzmsB35.js +1 -0
  66. package/dist/client/assets/{architectureDiagram-5GKGNRK7-6YiKazHv.js → architectureDiagram-5GKGNRK7-MEUA3QVe.js} +2 -2
  67. package/dist/client/assets/arrow-left-DI1Oo3nI.js +1 -0
  68. package/dist/client/assets/arrow-right-DRgAj8le.js +1 -0
  69. package/dist/client/assets/arrow-up-down-C6OEPUz7.js +1 -0
  70. package/dist/client/assets/assets-_CWIS9vb.js +2 -0
  71. package/dist/client/assets/bell-DW1iPWzH.js +1 -0
  72. package/dist/client/assets/{blockDiagram-I7D4REHJ-D_EURhbV.js → blockDiagram-I7D4REHJ-BOdLeYJh.js} +2 -2
  73. package/dist/client/assets/blocks-DKOyf4K4.js +1 -0
  74. package/dist/client/assets/bot-DYcBiSui.js +1 -0
  75. package/dist/client/assets/{browserHistoryStore-B-t3Vc_Z.js → browserHistoryStore-BJD0OPpb.js} +2 -2
  76. package/dist/client/assets/{browserLinkTarget-CiQS1wUg.js → browserLinkTarget-CoogLhhO.js} +2 -2
  77. package/dist/client/assets/{c4Diagram-7LVT6UL2-CmfPrrIj.js → c4Diagram-7LVT6UL2-COZrm1O8.js} +2 -2
  78. package/dist/client/assets/calendar-clock-BqL7OneL.js +1 -0
  79. package/dist/client/assets/channel-DbsUczqI.js +2 -0
  80. package/dist/client/assets/chart-no-axes-column-CtQ7A5KE.js +1 -0
  81. package/dist/client/assets/checkbox-CaZu1EKJ.js +2 -0
  82. package/dist/client/assets/{chunk-4HAMMTFA-BdvKUuii.js → chunk-4HAMMTFA-Bs-Fo0v1.js} +2 -2
  83. package/dist/client/assets/{chunk-75Z2AOVW-DXz8BlJz.js → chunk-75Z2AOVW-DpOWzc3R.js} +2 -2
  84. package/dist/client/assets/{chunk-DU6HZSFF-ebFBoLTT.js → chunk-DU6HZSFF-Bgpi4W6E.js} +2 -2
  85. package/dist/client/assets/{chunk-F27PBJKO-B1MlVcaX.js → chunk-F27PBJKO-CLxgnzXS.js} +2 -2
  86. package/dist/client/assets/{chunk-GMAD6QVW-CEXqem_-.js → chunk-GMAD6QVW-D98J5Pan.js} +2 -2
  87. package/dist/client/assets/{chunk-GVQU2GXP-wsgr7T0u.js → chunk-GVQU2GXP-VuCIOHGI.js} +2 -2
  88. package/dist/client/assets/{chunk-IMKFNOWR-Daxc_3WP.js → chunk-IMKFNOWR-DXIyBsaE.js} +2 -2
  89. package/dist/client/assets/{chunk-L3NEJ4N5-C4NnipZ0.js → chunk-L3NEJ4N5-CrMlU3ZU.js} +2 -2
  90. package/dist/client/assets/{chunk-OSK3NFVY-DDd2Ay5_.js → chunk-OSK3NFVY-V2__4gNB.js} +2 -2
  91. package/dist/client/assets/{chunk-P2QGCYS3-I9iEYMEJ.js → chunk-P2QGCYS3-BrPw6V5F.js} +2 -2
  92. package/dist/client/assets/{chunk-POPQ4Y6H-Cgwl0wkZ.js → chunk-POPQ4Y6H-DBQ9Y51x.js} +2 -2
  93. package/dist/client/assets/{chunk-PWAF6VOD-kBB0Jquc.js → chunk-PWAF6VOD-BN6AAbfF.js} +2 -2
  94. package/dist/client/assets/{chunk-SHT3W25Y-gtUoMWd0.js → chunk-SHT3W25Y-Vay44dCU.js} +2 -2
  95. package/dist/client/assets/{chunk-SVP7TREG-CbL5vJ0z.js → chunk-SVP7TREG-CcGlNErV.js} +2 -2
  96. package/dist/client/assets/{chunk-TICWLB2K-CMgrptzc.js → chunk-TICWLB2K-Dk1P_xkD.js} +2 -2
  97. package/dist/client/assets/classDiagram-ZZMXUADV-DotTjRcO.js +2 -0
  98. package/dist/client/assets/classDiagram-v2-VYDZK3BY-DotTjRcO.js +2 -0
  99. package/dist/client/assets/{color-picker-Cj2frYnP.js → color-picker-gBclRe5T.js} +2 -2
  100. package/dist/client/assets/{combobox-DixSlhgy.js → combobox-C81z_216.js} +2 -2
  101. package/dist/client/assets/{command-B45LRbFT.js → command-DnJZPOmf.js} +2 -2
  102. package/dist/client/assets/{connect-CYM5DIkv.js → connect-Am2IS-vZ.js} +2 -2
  103. package/dist/client/assets/{connect-agent-nn3QLMb4.js → connect-agent-Cw1s7hYt.js} +2 -2
  104. package/dist/client/assets/corner-left-up-BT-2gfvH.js +1 -0
  105. package/dist/client/assets/{cynefin-OW5HDTMX-CmLjrFzm.js → cynefin-OW5HDTMX-0s30RxOq.js} +1 -1
  106. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-xQBevUIj.js → cynefinDiagram-5FMLGOSQ-Drd0Msog.js} +2 -2
  107. package/dist/client/assets/{dagre-GXQ25YYZ-Ck8BwJaT.js → dagre-GXQ25YYZ-BMfu7T0o.js} +2 -2
  108. package/dist/client/assets/device-C_oIGJqy.js +2 -0
  109. package/dist/client/assets/{diagram-S7CK7UJ4-Bl0e661x.js → diagram-S7CK7UJ4-8egngY0E.js} +2 -2
  110. package/dist/client/assets/{diagram-UQ7AKVKN-TO9a3uQI.js → diagram-UQ7AKVKN-BALPQoDH.js} +2 -2
  111. package/dist/client/assets/{diagram-VSXAHHWV-BZ7xQ8wz.js → diagram-VSXAHHWV-BjyJZVGC.js} +2 -2
  112. package/dist/client/assets/{diagram-VX7I27RA-C4cA30qa.js → diagram-VX7I27RA-B9f6eKkq.js} +2 -2
  113. package/dist/client/assets/{diagram-Z3DM3KII-Hl3MmqeP.js → diagram-Z3DM3KII-CRUj2d3v.js} +2 -2
  114. package/dist/client/assets/{dialog-DhJeevKt.js → dialog-Bn1u_Xoc.js} +2 -2
  115. package/dist/client/assets/{diffRendering-QVeYVRDU.js → diffRendering-C26rfQBu.js} +2 -2
  116. package/dist/client/assets/{discovery-list-VoilmsP7.js → discovery-list-Fg_u6w-x.js} +2 -2
  117. package/dist/client/assets/{dist-CxgL3edJ.js → dist-DtKaGeij.js} +5 -5
  118. package/dist/client/assets/download-DNjijPHR.js +1 -0
  119. package/dist/client/assets/{draft-input-BrEXLyuj.js → draft-input-D8eUYug0.js} +2 -2
  120. package/dist/client/assets/{duoViewer-D-_bD3-L.js → duoViewer-CBoAg4hS.js} +2 -2
  121. package/dist/client/assets/dynamic-p5s8CQGu.js +3 -0
  122. package/dist/client/assets/earth-DGA4iwBJ.js +1 -0
  123. package/dist/client/assets/{ebnfDiagram-PWID7BFC-Bo_ALmgV.js → ebnfDiagram-PWID7BFC-BSbPiqg7.js} +2 -2
  124. package/dist/client/assets/ellipsis-Cbd-Ac19.js +1 -0
  125. package/dist/client/assets/{embeddedScripts-DKKE5k7D.js → embeddedScripts-Dsi0aZEx.js} +2 -2
  126. package/dist/client/assets/empty-C-gDaZ_z.js +2 -0
  127. package/dist/client/assets/entities-82m-Smm-.js +2 -0
  128. package/dist/client/assets/{erDiagram-RLTQ6QDP-B38FLl2U.js → erDiagram-RLTQ6QDP-sL_q0j_k.js} +2 -2
  129. package/dist/client/assets/eventmodeling-NTZA5JFV-OEIkdS25.js +1 -0
  130. package/dist/client/assets/eye-BUplLfz9.js +1 -0
  131. package/dist/client/assets/file-search-CcnLiCku.js +1 -0
  132. package/dist/client/assets/fileContextMenu-Dcs50sFI.js +2 -0
  133. package/dist/client/assets/{fileLinks-VfyxNu8P.js → fileLinks-DubkPNVt.js} +2 -2
  134. package/dist/client/assets/{fileTreeExpansion-BfMZMaRV.js → fileTreeExpansion-VtSAPhxL.js} +2 -2
  135. package/dist/client/assets/flowDiagram-HODETNUW-BDZPeVYD.js +1 -0
  136. package/dist/client/assets/fold-vertical-BMLbHh0a.js +2 -0
  137. package/dist/client/assets/folder-cog-BMK_9DOi.js +2 -0
  138. package/dist/client/assets/folder-git-2-5RczFn6m.js +1 -0
  139. package/dist/client/assets/folder-open-PwiT4lvQ.js +1 -0
  140. package/dist/client/assets/folder-plus--IokSBmG.js +1 -0
  141. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-Cj0Kstgh.js → ganttDiagram-EL5Y4UJY-DCiKb0rQ.js} +2 -2
  142. package/dist/client/assets/{getDiffFileInput-XUe1xsym.js → getDiffFileInput-DU5zpXo3.js} +2 -2
  143. package/dist/client/assets/git-branch-jf-x2c63.js +1 -0
  144. package/dist/client/assets/{gitGraph-4MIJSDKK-C84uaaYZ.js → gitGraph-4MIJSDKK-DfRe6ZT5.js} +1 -1
  145. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-CvyimLfZ.js → gitGraphDiagram-WWUBYQGX-Bt7diV1n.js} +2 -2
  146. package/dist/client/assets/grip-vertical-OASdudbE.js +1 -0
  147. package/dist/client/assets/{guideRunStore-DwmmS8D0.js → guideRunStore-CF9bByzk.js} +2 -2
  148. package/dist/client/assets/hard-drive-BxN5msOb.js +1 -0
  149. package/dist/client/assets/history-DdVU5lcf.js +1 -0
  150. package/dist/client/assets/house-mbks5FAa.js +1 -0
  151. package/dist/client/assets/{htmlRender-DRfZ8nFp.js → htmlRender-vOqAdlJH.js} +2 -2
  152. package/dist/client/assets/index-1HGbj0-7.js +3 -0
  153. package/dist/client/assets/{info-A6RAGUB7-AXJa674d.js → info-A6RAGUB7-0FtL6-Am.js} +1 -1
  154. package/dist/client/assets/{infoDiagram-27XIBGKW-CgaIIar7.js → infoDiagram-27XIBGKW-BPLvtPCc.js} +2 -2
  155. package/dist/client/assets/{input-u5qjnfMr.js → input-Cd_0h7h_.js} +2 -2
  156. package/dist/client/assets/{input-group-DIOgVvbV.js → input-group-CJ7ZOvDN.js} +2 -2
  157. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DSDzMD_t.js → ishikawaDiagram-5VMMS53U-DVcx0XTh.js} +2 -2
  158. package/dist/client/assets/{journeyDiagram-3NMN7TZE-Be6o5a7O.js → journeyDiagram-3NMN7TZE-w46bbjL2.js} +2 -2
  159. package/dist/client/assets/{kanban-definition-UXKFOSKX-Fpr0ne16.js → kanban-definition-UXKFOSKX-C41yE_yV.js} +2 -2
  160. package/dist/client/assets/kbd-c17EHIx1.js +2 -0
  161. package/dist/client/assets/keybindings-uYm_vnXl.js +2 -0
  162. package/dist/client/assets/keyboard-DckDn_SM.js +1 -0
  163. package/dist/client/assets/{lazyRouteComponent-dLOOuQ-r.js → lazyRouteComponent-CTVuEvaz.js} +2 -2
  164. package/dist/client/assets/{line-BXhbrPh0.js → line-tu9XZ0qp.js} +2 -2
  165. package/dist/client/assets/{link-YLDgrmSN.js → link-C4sEUNOK.js} +2 -2
  166. package/dist/client/assets/link-Dw3ue0Rm.js +1 -0
  167. package/dist/client/assets/{linkedPrompt-E32o3H76.js → linkedPrompt-VYl90REW.js} +2 -2
  168. package/dist/client/assets/list-1rglB5Lq.js +1 -0
  169. package/dist/client/assets/main-BB3F4O6Y.js +30 -0
  170. package/dist/client/assets/main-CnVegMVf.css +2 -0
  171. package/dist/client/assets/{mediaReference-C-grVzJf.js → mediaReference-BTVvzs2e.js} +2 -2
  172. package/dist/client/assets/{mediaSource-CxVHZYDj.js → mediaSource-DXHFWHMA.js} +2 -2
  173. package/dist/client/assets/{mermaid-parser.core-BFPy42Wg.js → mermaid-parser.core-DNd412Oc.js} +4 -4
  174. package/dist/client/assets/{mermaid.core-zK2u82e-.js → mermaid.core-CyE6QOQY.js} +5 -5
  175. package/dist/client/assets/message-circle-question-mark-CLPs5tYP.js +1 -0
  176. package/dist/client/assets/message-square-BInn4EwR.js +1 -0
  177. package/dist/client/assets/message-square-dashed-Dea7_sXv.js +1 -0
  178. package/dist/client/assets/{mindmap-definition-YA3MSWOX-RzkTvFrT.js → mindmap-definition-YA3MSWOX-DH1uxdTm.js} +2 -2
  179. package/dist/client/assets/mouse-pointer-2-BPl1Yb5N.js +1 -0
  180. package/dist/client/assets/number-field-CVtwAsLe.js +2 -0
  181. package/dist/client/assets/{observeResize-WQaFQjbx.js → observeResize-Csvw3hy4.js} +2 -2
  182. package/dist/client/assets/{onboarding-DNafmm6s.js → onboarding-CJPrQc71.js} +2 -2
  183. package/dist/client/assets/openFileInPreview-C3O_ayUT.js +2 -0
  184. package/dist/client/assets/{p4ProjectFile-BzCYJ8I-.js → p4ProjectFile-BWszgcDk.js} +2 -2
  185. package/dist/client/assets/{packet-AYTQ26CC-rDYSbNWh.js → packet-AYTQ26CC-DflCOkCN.js} +1 -1
  186. package/dist/client/assets/{pair-nG9A6oxp.js → pair-Dd_e1jxq.js} +2 -2
  187. package/dist/client/assets/palette-DC6st-Ld.js +1 -0
  188. package/dist/client/assets/panel-left-BxNE-mqR.js +1 -0
  189. package/dist/client/assets/panels-top-left-CpwWAaSX.js +1 -0
  190. package/dist/client/assets/{pegDiagram-XKGWAZYB-8wodyYDi.js → pegDiagram-XKGWAZYB-Cnx9j2xX.js} +2 -2
  191. package/dist/client/assets/{phoneViewer-Bei8FsYJ.js → phoneViewer-B9EUVDD2.js} +2 -2
  192. package/dist/client/assets/{pie-WAS4IAKB-Ce0_zpeP.js → pie-WAS4IAKB-CDwew7fN.js} +1 -1
  193. package/dist/client/assets/{pieDiagram-E7YTZNPT-C3QJYWCY.js → pieDiagram-E7YTZNPT-BxejSN6k.js} +2 -2
  194. package/dist/client/assets/{pierre-icons-CsjmRq9p.js → pierre-icons-C839Otpo.js} +2 -2
  195. package/dist/client/assets/plug-Cdxb0djR.js +2 -0
  196. package/dist/client/assets/popover-CKyetthu.js +2 -0
  197. package/dist/client/assets/{preview-DFDpDpup.js → preview-CEMnbqVB.js} +2 -2
  198. package/dist/client/assets/{preview-BpTu6A2K.js → preview-CjgXQQdj.js} +2 -2
  199. package/dist/client/assets/{previewMiniPlayerStore-BfMwexwO.js → previewMiniPlayerStore-B9Lqaaij.js} +2 -2
  200. package/dist/client/assets/primary-uszZTzpR.js +2 -0
  201. package/dist/client/assets/primaryCloudLinkState-CWT2YTBZ.js +2 -0
  202. package/dist/client/assets/projectFilesQueryState-ELgLflk5.js +2 -0
  203. package/dist/client/assets/projectScriptEditor-BAuP_HeU.js +2 -0
  204. package/dist/client/assets/{pullRequestDetail.logic-CE7fVOsp.js → pullRequestDetail.logic-DTxWqKoX.js} +4 -4
  205. package/dist/client/assets/{pullRequestReviewStore-BHEIYvsP.js → pullRequestReviewStore-C5gaoGaz.js} +2 -2
  206. package/dist/client/assets/pullRequests-DjbQ49mZ.js +2 -0
  207. package/dist/client/assets/puzzle-foT3lPUZ.js +1 -0
  208. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-Cqx4Dcqi.js → quadrantDiagram-AXDQQJYC-Bj4FEpOg.js} +2 -2
  209. package/dist/client/assets/queries-Cq5C9N-K.js +2 -0
  210. package/dist/client/assets/query-DpwJQzeq.js +2 -0
  211. package/dist/client/assets/{radar-RG4KPBEZ-DsccxBWq.js → radar-RG4KPBEZ-DEopr2Gv.js} +1 -1
  212. package/dist/client/assets/radio-group-fljQQ7Xp.js +2 -0
  213. package/dist/client/assets/{railroad-74A4TZTK-B-UN2mSQ.js → railroad-74A4TZTK-BSAOgUn6.js} +1 -1
  214. package/dist/client/assets/railroad-abnf-HS5TGJTU-C_4g8TOP.js +1 -0
  215. package/dist/client/assets/railroad-ebnf-LZEXJU2U-CHZB5YoP.js +1 -0
  216. package/dist/client/assets/railroad-peg-WCYAUIDC-B-PbMjlp.js +1 -0
  217. package/dist/client/assets/{railroadDiagram-O6MQD6OU-B_PdDy5r.js → railroadDiagram-O6MQD6OU-BSOJGJ6v.js} +2 -2
  218. package/dist/client/assets/{renderScheduler-D1ml_j--.js → renderScheduler-v8LIpnE2.js} +2 -2
  219. package/dist/client/assets/{requirementDiagram-BXWQKSXE-CKZ6HpQu.js → requirementDiagram-BXWQKSXE-Bp5TqEho.js} +2 -2
  220. package/dist/client/assets/rightPanelStore-DqMd0tFH.js +2 -0
  221. package/dist/client/assets/rotate-ccw-rssHZoOL.js +1 -0
  222. package/dist/client/assets/rotate-cw-D726GGah.js +1 -0
  223. package/dist/client/assets/runtime-BQJQC-Ny.js +6 -0
  224. package/dist/client/assets/runtime-C6FwphD-.js +2 -0
  225. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-BLF-VPcj.js → sankeyDiagram-P5KCCOFB-C7KUHrP7.js} +2 -2
  226. package/dist/client/assets/scheduledTasksSettings.logic-C3Mbc4mh.js +3 -0
  227. package/dist/client/assets/{scroll-area-CsrtHuL8.js → scroll-area-LhpLVf8r.js} +2 -2
  228. package/dist/client/assets/select-B4VvMEs2.js +2 -0
  229. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-BpJGkNAx.js → sequenceDiagram-WJ2MYXX4-Bs9mfTLC.js} +2 -2
  230. package/dist/client/assets/server-BD_Y5Gsn.js +2 -0
  231. package/dist/client/assets/session-DsbInyNV.js +2 -0
  232. package/dist/client/assets/session-logic-DneZDyPZ.js +26 -0
  233. package/dist/client/assets/settings-2-Qrnq-5XQ.js +1 -0
  234. package/dist/client/assets/settings-C8FiUQu0.js +2 -0
  235. package/dist/client/assets/settings-MUAsYy_j.js +1 -0
  236. package/dist/client/assets/settings.appearance-B5-X4oyX.js +2 -0
  237. package/dist/client/assets/settings.archived-DVUmF0nS.js +2 -0
  238. package/dist/client/assets/{settings.computer-use-DuW-mXPO.js → settings.computer-use-B3Ujc2AS.js} +2 -2
  239. package/dist/client/assets/settings.connections-EQYBOa7e.js +2 -0
  240. package/dist/client/assets/settings.decisions-C5UE4drK.js +2 -0
  241. package/dist/client/assets/{settings.diagnostics-DSw1QN-I.js → settings.diagnostics-CBcOEqPM.js} +2 -2
  242. package/dist/client/assets/settings.general-BOmr4mSV.js +2 -0
  243. package/dist/client/assets/settings.integrations-BCtpk2dY.js +2 -0
  244. package/dist/client/assets/{settings.keybindings-BeQmUtKv.js → settings.keybindings-DfFrYXxY.js} +2 -2
  245. package/dist/client/assets/settings.open-source-licenses-CqRM1gRd.js +2 -0
  246. package/dist/client/assets/settings.plugins-DC4js6dE.js +5 -0
  247. package/dist/client/assets/{settings.projects--jLA2A5b.js → settings.projects-CT-l0EfX.js} +4 -4
  248. package/dist/client/assets/settings.providers-CJuBTAiR.js +3 -0
  249. package/dist/client/assets/settings.scheduled-tasks-CvLNaadX.js +2 -0
  250. package/dist/client/assets/{settings.snap-shot-CUZNOX9M.js → settings.snap-shot-BMxV-ClC.js} +2 -2
  251. package/dist/client/assets/settings.source-control-DJWucVsM.js +2 -0
  252. package/dist/client/assets/settings.storage-DKm6BZ2r.js +2 -0
  253. package/dist/client/assets/settingsLayout-jP1a50ek.js +3 -0
  254. package/dist/client/assets/shield-question-mark-kKJBH4Uj.js +1 -0
  255. package/dist/client/assets/{sidebar-Dj0htG-5.js → sidebar-DI1ZJMkM.js} +2 -2
  256. package/dist/client/assets/{sidebarProjectGrouping-DxzT7QCQ.js → sidebarProjectGrouping-DXRKqrOP.js} +2 -2
  257. package/dist/client/assets/skeleton-BlMPaSbD.js +2 -0
  258. package/dist/client/assets/{sortable.esm-n8ce5zjO.js → sortable.esm-CnSn9HhJ.js} +2 -2
  259. package/dist/client/assets/{sourceControl-C3RSledt.js → sourceControl-ogZI3Qhj.js} +2 -2
  260. package/dist/client/assets/{spinner-BXr4m38K.js → spinner-I_NrXl2i.js} +2 -2
  261. package/dist/client/assets/square-menu-dCwciC39.js +2 -0
  262. package/dist/client/assets/square-pen-DilH8raK.js +1 -0
  263. package/dist/client/assets/square-plus-CeFmBUPF.js +2 -0
  264. package/dist/client/assets/{standalone-page-DSQDdNcR.js → standalone-page-C0mvdk0N.js} +2 -2
  265. package/dist/client/assets/{stateDiagram-D77RDMKH-DFGb4Fx3.js → stateDiagram-D77RDMKH-lcvbm4gc.js} +2 -2
  266. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DuLLhUia.js +2 -0
  267. package/dist/client/assets/{swimlanes-42K2YHIH-D0z9osG6.js → swimlanes-42K2YHIH-BftXRbCQ.js} +2 -2
  268. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BrHQKVnf.js +9 -0
  269. package/dist/client/assets/terminal-links-BWEpET__.js +2 -0
  270. package/dist/client/assets/terminalLabels-BgLOlb2G.js +2 -0
  271. package/dist/client/assets/{terminalSessions-3aynRXX1.js → terminalSessions-CQOPPXfy.js} +2 -2
  272. package/dist/client/assets/text-search-DpDcKspl.js +1 -0
  273. package/dist/client/assets/{textarea-DZLyhzuZ.js → textarea-Bu723jDd.js} +2 -2
  274. package/dist/client/assets/themePalette-CAxv2FDZ.js +5 -0
  275. package/dist/client/assets/threadSort-BoaTqeGH.js +2 -0
  276. package/dist/client/assets/{timeline-definition-24CTP7MA-oHM5IS4i.js → timeline-definition-24CTP7MA-_aV_EuqE.js} +2 -2
  277. package/dist/client/assets/toast-CjelgyqV.js +2 -0
  278. package/dist/client/assets/{toggle-BzIEPTf7.js → toggle-B5fidRv0.js} +2 -2
  279. package/dist/client/assets/{toggle-group-_C7nJPTT.js → toggle-group-DCQTLIPb.js} +2 -2
  280. package/dist/client/assets/tooltip-taOyJZax.js +2 -0
  281. package/dist/client/assets/{treeView-Q6P3EWNA-ONHv8oqx.js → treeView-Q6P3EWNA-ALGd5g_W.js} +1 -1
  282. package/dist/client/assets/{treemap-WGGIJYW6-Go2hwkyn.js → treemap-WGGIJYW6-CGQrkzMs.js} +1 -1
  283. package/dist/client/assets/unfold-vertical-BLnEY4R7.js +2 -0
  284. package/dist/client/assets/usage-DmGxFUdr.js +2 -0
  285. package/dist/client/assets/{usageAccess-BNLOTFbF.js → usageAccess-CY-JtQnU.js} +2 -2
  286. package/dist/client/assets/{usageFormat-DKCO_wk0.js → usageFormat-Cs-UHzLq.js} +2 -2
  287. package/dist/client/assets/{usageShortcuts-DxLRXv0W.js → usageShortcuts-CP952NDO.js} +2 -2
  288. package/dist/client/assets/use-atom-command-CQHjSXPR.js +2 -0
  289. package/dist/client/assets/{useAriaLabelledBy-CJjXf8Fd.js → useAriaLabelledBy-4I5xhNlP.js} +2 -2
  290. package/dist/client/assets/useHandleNewThread-Bzaf_PDE.js +2 -0
  291. package/dist/client/assets/{useLocation-9axGTsrg.js → useLocation-QINZoaPz.js} +2 -2
  292. package/dist/client/assets/useNavigate-4thj06GJ.js +2 -0
  293. package/dist/client/assets/{useNavigateBack-AIHPN0Oo.js → useNavigateBack-CbbWf0z6.js} +2 -2
  294. package/dist/client/assets/{useParams-CCV3vN4E.js → useParams-BTKEXLBT.js} +2 -2
  295. package/dist/client/assets/{usePermissionStatus-BnBF7CdE.js → usePermissionStatus-Zbsv_90x.js} +2 -2
  296. package/dist/client/assets/{usePullRequestActions-aKrHzIiJ.js → usePullRequestActions-DGTJ6ne6.js} +3 -3
  297. package/dist/client/assets/useRegisterFieldControl-Cr87Snzk.js +2 -0
  298. package/dist/client/assets/useScopedModelAvailability-BEfh0WXx.js +2 -0
  299. package/dist/client/assets/useSettings-CLtJrOYI.js +3 -0
  300. package/dist/client/assets/{useT3ConnectAuthPrompt-CK8il-7e.js → useT3ConnectAuthPrompt-BYqrzQIx.js} +2 -2
  301. package/dist/client/assets/utils-DmfMX1v5.js +37 -0
  302. package/dist/client/assets/vcsRefInvalidation-nP-qgsHs.js +2 -0
  303. package/dist/client/assets/{vennDiagram-4TSXK5OY-BwVRZPOj.js → vennDiagram-4TSXK5OY-9Jx7JrgE.js} +2 -2
  304. package/dist/client/assets/{wardley-WFR3VGLG-CYl4h3U-.js → wardley-WFR3VGLG-qG58RzFw.js} +1 -1
  305. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-yHMYVGhg.js → wardleyDiagram-VM6X3IG4-8Ml3tzfR.js} +2 -2
  306. package/dist/client/assets/welcome-CPcQsM9H.js +2 -0
  307. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-Td7MQ_xN.js → xychartDiagram-S5SC5T6Z-C-u_0wo0.js} +2 -2
  308. package/dist/client/index.html +11 -8
  309. package/package.json +1 -1
  310. package/dist/client/assets/ChatGptUsageButton-7IZqWaQq.js +0 -2
  311. package/dist/client/assets/ChatMarkdown-D3ITm4U-.js +0 -65
  312. package/dist/client/assets/CodexSetupSection.logic-DyTuN6tg.js +0 -2
  313. package/dist/client/assets/ComboboxClear-BXGqqvsR.js +0 -2
  314. package/dist/client/assets/CompositeRoot-CW06ANMY.js +0 -2
  315. package/dist/client/assets/DevicePanel-zG3feCFw.js +0 -2
  316. package/dist/client/assets/DialogTitle-7tvQYVxE.js +0 -2
  317. package/dist/client/assets/DiffFileTree-BhSPT6m_.js +0 -2
  318. package/dist/client/assets/DiffPanel-D7QMWq_A.js +0 -2
  319. package/dist/client/assets/FilePreviewPanel-CSKeM-xZ.js +0 -34
  320. package/dist/client/assets/FoldedSettingsSection-BJm8ZaTy.js +0 -2
  321. package/dist/client/assets/PreviewPanel-BEWZuH6o.js +0 -2
  322. package/dist/client/assets/ProjectDefaultsSettings-BRRQlvgR.js +0 -2
  323. package/dist/client/assets/ProjectIconPickerDialog-DXSyEGg8.js +0 -2
  324. package/dist/client/assets/ProviderModelPicker-CpgHpUCG.js +0 -2
  325. package/dist/client/assets/ProviderSettingsForm-CaNO8FYK.js +0 -2
  326. package/dist/client/assets/PullRequestCodeTab-DwqL4aAJ.js +0 -6
  327. package/dist/client/assets/RedactedSensitiveText-citJBx4E.js +0 -2
  328. package/dist/client/assets/ScheduledTasksSettings-BXOG7dPV.js +0 -4
  329. package/dist/client/assets/ScopedSwitch-2MBm4Srn.js +0 -2
  330. package/dist/client/assets/T3ConnectAccountPages-C6qHq26m.js +0 -2
  331. package/dist/client/assets/ThreadTerminalDrawer-C1NDkTSs.js +0 -5
  332. package/dist/client/assets/UsageLimits-BUS51Bjr.js +0 -2
  333. package/dist/client/assets/WorkspaceBreadcrumb-DX3xH6tC.js +0 -2
  334. package/dist/client/assets/WorkspacePageContainer-BFo6qTGJ.js +0 -2
  335. package/dist/client/assets/_chat-B3j3XTUJ.js +0 -58
  336. package/dist/client/assets/architecture-7GRP2DOG-nO5xG-8k.js +0 -1
  337. package/dist/client/assets/arrow-left-yEW5WFYj.js +0 -1
  338. package/dist/client/assets/arrow-right-BzVZfSb7.js +0 -1
  339. package/dist/client/assets/arrow-up-down-DjL7trCL.js +0 -1
  340. package/dist/client/assets/assets-BxSVuao2.js +0 -2
  341. package/dist/client/assets/bell-ue7A6JFg.js +0 -1
  342. package/dist/client/assets/blocks-De0WwZYY.js +0 -1
  343. package/dist/client/assets/bot-_T9E-nkd.js +0 -1
  344. package/dist/client/assets/calendar-clock-DXFNSdXM.js +0 -1
  345. package/dist/client/assets/channel-BE0ymtNV.js +0 -2
  346. package/dist/client/assets/chart-no-axes-column-Dx_cyfN9.js +0 -1
  347. package/dist/client/assets/checkbox-CIeee0-J.js +0 -2
  348. package/dist/client/assets/classDiagram-ZZMXUADV-YRduSbl9.js +0 -2
  349. package/dist/client/assets/classDiagram-v2-VYDZK3BY-YRduSbl9.js +0 -2
  350. package/dist/client/assets/collapsible-C3qenpEI.js +0 -2
  351. package/dist/client/assets/corner-left-up-DohBMTTI.js +0 -1
  352. package/dist/client/assets/device-BRhRKysY.js +0 -2
  353. package/dist/client/assets/download-B587khDU.js +0 -1
  354. package/dist/client/assets/dynamic-R3OtJZHK.js +0 -3
  355. package/dist/client/assets/earth-26IFbzWm.js +0 -1
  356. package/dist/client/assets/ellipsis-BScTTB_n.js +0 -1
  357. package/dist/client/assets/empty-uoiaKPHo.js +0 -2
  358. package/dist/client/assets/entities-DNKDCsf2.js +0 -2
  359. package/dist/client/assets/eventmodeling-NTZA5JFV-6XFarcvj.js +0 -1
  360. package/dist/client/assets/eye-DTlv8Vet.js +0 -1
  361. package/dist/client/assets/file-search-gFHOfI6S.js +0 -1
  362. package/dist/client/assets/flowDiagram-HODETNUW-DQXavjl4.js +0 -1
  363. package/dist/client/assets/fold-vertical-BNQMJ6gu.js +0 -1
  364. package/dist/client/assets/folder-cog-CYwPj2H1.js +0 -2
  365. package/dist/client/assets/folder-git-2-6ON-nxul.js +0 -1
  366. package/dist/client/assets/folder-open-Rja0vZjv.js +0 -1
  367. package/dist/client/assets/folder-plus-CfJ5c8wa.js +0 -1
  368. package/dist/client/assets/git-branch-BuWXMpmq.js +0 -1
  369. package/dist/client/assets/grip-vertical-qjSy6wXX.js +0 -1
  370. package/dist/client/assets/hard-drive-DAxFba08.js +0 -1
  371. package/dist/client/assets/history-CrY611k2.js +0 -1
  372. package/dist/client/assets/house-CKS51Vx8.js +0 -1
  373. package/dist/client/assets/index-G0rP4C-v.js +0 -3
  374. package/dist/client/assets/kbd-D4mDfHPa.js +0 -2
  375. package/dist/client/assets/keybindings-CzL-fWkh.js +0 -2
  376. package/dist/client/assets/keyboard-Y7zJXIRo.js +0 -1
  377. package/dist/client/assets/link-CbhoiCa8.js +0 -1
  378. package/dist/client/assets/list-Cq4wtMwR.js +0 -1
  379. package/dist/client/assets/main-D9nJEeym.css +0 -2
  380. package/dist/client/assets/main-D9z9rMK1.js +0 -27
  381. package/dist/client/assets/message-circle-question-mark-BwzHSg4C.js +0 -1
  382. package/dist/client/assets/message-square-DcSgYDZ6.js +0 -1
  383. package/dist/client/assets/message-square-dashed-Cu56tC0F.js +0 -1
  384. package/dist/client/assets/mouse-pointer-2-DxhF1Woc.js +0 -1
  385. package/dist/client/assets/number-field-BLz8W5SU.js +0 -2
  386. package/dist/client/assets/openFileInPreview-l6IXWIxV.js +0 -2
  387. package/dist/client/assets/palette-B79srcx1.js +0 -1
  388. package/dist/client/assets/panel-left-Bp59PK2R.js +0 -1
  389. package/dist/client/assets/panel-tab-close-button-B2GW1bDy.js +0 -2
  390. package/dist/client/assets/panels-top-left-CC3HCiIs.js +0 -1
  391. package/dist/client/assets/plug-B1ccrQcT.js +0 -2
  392. package/dist/client/assets/popover-6BYEGLLK.js +0 -2
  393. package/dist/client/assets/primary-Cc8Am8Ju.js +0 -2
  394. package/dist/client/assets/primaryCloudLinkState-N7pLty-_.js +0 -2
  395. package/dist/client/assets/projectFilesQueryState-CrGsc81w.js +0 -2
  396. package/dist/client/assets/projectScriptEditor-RR3KkKhh.js +0 -2
  397. package/dist/client/assets/pullRequests-KhjrMCa0.js +0 -2
  398. package/dist/client/assets/puzzle-Df6hPSJS.js +0 -2
  399. package/dist/client/assets/queries-Cn1FJB1_.js +0 -2
  400. package/dist/client/assets/query-CK8MOmXr.js +0 -2
  401. package/dist/client/assets/radio-group-CM6Ra-QS.js +0 -2
  402. package/dist/client/assets/railroad-abnf-HS5TGJTU-CIxA0Vp4.js +0 -1
  403. package/dist/client/assets/railroad-ebnf-LZEXJU2U-Czs81Kdn.js +0 -1
  404. package/dist/client/assets/railroad-peg-WCYAUIDC-B7O8OPsa.js +0 -1
  405. package/dist/client/assets/rightPanelStore-6LLb3GY0.js +0 -2
  406. package/dist/client/assets/rotate-ccw-dcahmZQ2.js +0 -1
  407. package/dist/client/assets/rotate-cw-CIep6yNT.js +0 -1
  408. package/dist/client/assets/runtime-BVgeNXTV.js +0 -2
  409. package/dist/client/assets/runtime-CCr9UADV.js +0 -6
  410. package/dist/client/assets/scheduledTasksSettings.logic-ozIaTRfT.js +0 -3
  411. package/dist/client/assets/select-BiARKKgd.js +0 -2
  412. package/dist/client/assets/server-B26doYv6.js +0 -2
  413. package/dist/client/assets/session-CQXL-cTI.js +0 -2
  414. package/dist/client/assets/session-logic-C0mrkZ0j.js +0 -13
  415. package/dist/client/assets/settings-2-C2dIdVBr.js +0 -1
  416. package/dist/client/assets/settings-B5Dj0jhP.js +0 -2
  417. package/dist/client/assets/settings-DiBtchmK.js +0 -1
  418. package/dist/client/assets/settings.appearance-Di8HZa2Q.js +0 -2
  419. package/dist/client/assets/settings.archived-By34XjbG.js +0 -2
  420. package/dist/client/assets/settings.connections-BJuKrJhl.js +0 -2
  421. package/dist/client/assets/settings.decisions-BO8hfyYm.js +0 -2
  422. package/dist/client/assets/settings.general-RyWWgxqp.js +0 -2
  423. package/dist/client/assets/settings.integrations--N8SMmw7.js +0 -2
  424. package/dist/client/assets/settings.open-source-licenses-BmgFSigO.js +0 -2
  425. package/dist/client/assets/settings.providers-Cvt1-bmr.js +0 -3
  426. package/dist/client/assets/settings.scheduled-tasks-D5IG4nj_.js +0 -2
  427. package/dist/client/assets/settings.source-control-R63Z9kEM.js +0 -2
  428. package/dist/client/assets/settings.storage-J1kthey9.js +0 -2
  429. package/dist/client/assets/settingsLayout-BzyY4qHt.js +0 -3
  430. package/dist/client/assets/shield-question-mark-l31p7uuJ.js +0 -1
  431. package/dist/client/assets/skeleton-CtSxs1y1.js +0 -2
  432. package/dist/client/assets/square-menu-Bq3HnG2U.js +0 -2
  433. package/dist/client/assets/square-pen-CxvvUOOt.js +0 -1
  434. package/dist/client/assets/square-plus-B9j2jkOq.js +0 -2
  435. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-BFcRJjAO.js +0 -2
  436. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-B7z2b1Qv.js +0 -9
  437. package/dist/client/assets/text-search-DsadxNJw.js +0 -1
  438. package/dist/client/assets/themePalette-BZeqG2Hu.js +0 -5
  439. package/dist/client/assets/threadSort-BvhI6zOp.js +0 -2
  440. package/dist/client/assets/toast-Bm36EaG6.js +0 -2
  441. package/dist/client/assets/tooltip-Df-4YKs5.js +0 -2
  442. package/dist/client/assets/unfold-vertical--twzQtvn.js +0 -1
  443. package/dist/client/assets/usage-B26GT0RK.js +0 -2
  444. package/dist/client/assets/use-atom-command-CiEeUGsC.js +0 -2
  445. package/dist/client/assets/useHandleNewThread-DTz3ztCG.js +0 -2
  446. package/dist/client/assets/useNavigate-BK_XZ1It.js +0 -2
  447. package/dist/client/assets/useRegisterFieldControl-Daf1iBkI.js +0 -2
  448. package/dist/client/assets/useScopedModelAvailability-IKTxpeQL.js +0 -2
  449. package/dist/client/assets/useSettings-CckatJFa.js +0 -3
  450. package/dist/client/assets/utils-DmS758az.js +0 -37
  451. package/dist/client/assets/vcsRefInvalidation-lkYjTxah.js +0 -2
  452. package/dist/client/assets/welcome-CGBWwWzE.js +0 -2
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Gb as n,Jb as r,Kb as i,Qb as a,Vo as o,_f as s,ay as c,ig as l,ma as u,or as d,sr as f,t as p,wf as m,wx as h,yf as g,zb as _}from"./utils-DmS758az.js";import{t as v}from"./activity-C1Y3O_v1.js";import{t as y}from"./battery-Bjbw2yxu.js";import{t as b}from"./copy-CoM62e83.js";import{t as x}from"./cpu-mffhvvYB.js";import{t as S}from"./database-DipbOz0U.js";import{t as ee}from"./gauge-C_4eEUrj.js";import{t as C}from"./info-BHB-83EA.js";import{t as te}from"./memory-stick-C7kBEkBW.js";import{t as w}from"./triangle-alert-BiHUyRl3.js";import{L as ne,U as re}from"./runtime-CCr9UADV.js";import{a as T,c as E,n as D,t as O,u as k}from"./tooltip-Df-4YKs5.js";import{i as A,p as j}from"./toast-Bm36EaG6.js";import{D as M,q as ie}from"./useSettings-CckatJFa.js";import{f as N}from"./server-B26doYv6.js";import{i as ae,n as oe,t as se}from"./session-CQXL-cTI.js";import{n as P}from"./query-CK8MOmXr.js";import{t as ce}from"./use-atom-command-CiEeUGsC.js";import{a as F,o as le,u as I}from"./timestampFormat-wac2e_Jz.js";import{n as L,t as ue}from"./toggle-group-_C7nJPTT.js";import{t as de}from"./input-u5qjnfMr.js";import{t as R}from"./scroll-area-CsrtHuL8.js";import{N as fe,i as pe,s as z,u as me,z as he}from"./settingsLayout-BzyY4qHt.js";import{t as ge}from"./ConnectionStatusDot-Cjh57o6i.js";import{Co as _e,Ia as ve,Na as ye,Ti as B,jo as be}from"./main-D9z9rMK1.js";import{t as xe}from"./usageAccess-BNLOTFbF.js";import{t as V}from"./ExpandableText-DfY-qqRW.js";import{t as H}from"./formatBytes-D8LhsSVR.js";import{t as Se}from"./SettingsScopeNotice-CdNfxmW3.js";var U=h(),W=e(u(),1);function G(e){let t=(0,U.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,W.jsx)(T,{render:(0,W.jsx)(f,{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,W.jsx)(D,{side:`top`,children:`Send SIGINT`}),t[5]=o):o=t[5];let s;t[6]===a?s=t[7]:(s=(0,W.jsxs)(O,{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,W.jsx)(T,{render:(0,W.jsx)(f,{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,W.jsx)(D,{side:`top`,children:`Send SIGKILL`}),t[13]=u):u=t[13];let d;t[14]===l?d=t[15]:(d=(0,W.jsxs)(O,{children:[l,u]}),t[14]=l,t[15]=d);let p;return t[16]!==s||t[17]!==d?(p=(0,W.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[s,d]}),t[16]=s,t[17]=d,t[18]=p):p=t[18],p}var K=e(t(),1),q=k();function Ce(e){let t=(0,U.c)(10),n=M(),r=e===void 0?n?.environmentId??null:e,i=ae(r,s),a;t[0]!==i||t[1]!==r?(a=r===null||!i?null:N.resourceTelemetry({environmentId:r,input:{}}),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o=P(a),l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[3]=l):l=t[3];let u=ce(N.retryResourceTelemetry,l),d;t[4]!==r||t[5]!==u?(d=async()=>{if(r===null)throw Error(`No environment is selected.`);if(!oe(r,`environment:maintain`)||!oe(r,`diagnostics:read`))throw Error(`This connection cannot restart the resource monitor.`);let e=await u({environmentId:r,input:{}});if(e._tag===`Failure`)throw c(e.cause);return e.value.snapshot},t[4]=r,t[5]=u,t[6]=d):d=t[6];let f=d,p;return t[7]!==o||t[8]!==f?(p={...o,retry:f},t[7]=o,t[8]=f,t[9]=p):p=t[9],p}function we(e,t){let n=(0,U.c)(4),r=M(),i=t===void 0?r?.environmentId??null:t,a=ae(i,s),o;return n[0]!==a||n[1]!==i||n[2]!==e?(o=i===null||!a?null:N.resourceTelemetryHistory({environmentId:i,input:e}),n[0]=a,n[1]=i,n[2]=e,n[3]=o):o=n[3],P(o)}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`${H(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-t3`: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,U.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=p(`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`,m=o==="default"&&`bg-success`,h=o===`warning`&&`bg-warning`,g=o===`danger`&&`bg-destructive`,_;t[8]!==g||t[9]!==f||t[10]!==m||t[11]!==h?(_=p(`size-1.5 rounded-full`,f,m,h,g),t[8]=g,t[9]=f,t[10]=m,t[11]=h,t[12]=_):_=t[12];let v;t[13]===_?v=t[14]:(v=(0,W.jsx)(`span`,{className:_}),t[13]=_,t[14]=v);let y=i?.label??r,b;return t[15]!==n||t[16]!==v||t[17]!==y||t[18]!==d?(b=(0,W.jsxs)(`span`,{className:d,children:[v,n,` `,y]}),t[15]=n,t[16]=v,t[17]=y,t[18]=d,t[19]=b):b=t[19],b}function He(e){let t=(0,U.c)(9),{sampledAt:n}=e;if(me(),!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.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=F(l(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,W.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,W.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,W.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,U.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,W.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,W.jsx)(`span`,{className:`truncate`,children:r}),t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,W.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`,m;t[7]!==d||t[8]!==f?(m=p(`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]=m):m=t[9];let h;t[10]!==m||t[11]!==i?(h=(0,W.jsx)(`div`,{className:m,children:i}),t[10]=m,t[11]=i,t[12]=h):h=t[12];let g;t[13]===a?g=t[14]:(g=a?(0,W.jsx)(`div`,{className:`mt-1.5 truncate text-3xs text-muted-foreground/60`,children:a}):null,t[13]=a,t[14]=g);let _;return t[15]!==u||t[16]!==h||t[17]!==g?(_=(0,W.jsxs)(`div`,{className:`group min-w-0 px-4 py-4 sm:px-5`,children:[u,h,g]}),t[15]=u,t[16]=h,t[17]=g,t[18]=_):_=t[18],_}function We(e){let t=(0,U.c)(37),{label:n,accentClass:r,aggregate:i}=e,a;t[0]===r?a=t[1]:(a=p(`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,W.jsx)(`span`,{className:a}),t[2]=a,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,W.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,W.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,W.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}%`,m;t[14]===f?m=t[15]:(m=(0,W.jsx)(Ge,{label:`CPU`,value:f}),t[14]=f,t[15]=m);let h;t[16]===i.currentRssBytes?h=t[17]:(h=H(i.currentRssBytes),t[16]=i.currentRssBytes,t[17]=h);let g;t[18]===h?g=t[19]:(g=(0,W.jsx)(Ge,{label:`Memory`,value:h}),t[18]=h,t[19]=g);let _;t[20]===i.ioReadBytesPerSecond?_=t[21]:(_=ke(i.ioReadBytesPerSecond),t[20]=i.ioReadBytesPerSecond,t[21]=_);let v;t[22]===_?v=t[23]:(v=(0,W.jsx)(Ge,{label:`Read`,value:_}),t[22]=_,t[23]=v);let y;t[24]===i.ioWriteBytesPerSecond?y=t[25]:(y=ke(i.ioWriteBytesPerSecond),t[24]=i.ioWriteBytesPerSecond,t[25]=y);let b;t[26]===y?b=t[27]:(b=(0,W.jsx)(Ge,{label:`Write`,value:y}),t[26]=y,t[27]=b);let x;t[28]!==g||t[29]!==v||t[30]!==b||t[31]!==m?(x=(0,W.jsxs)(`div`,{className:`mt-3.5 grid grid-cols-2 gap-x-4 gap-y-2.5`,children:[m,g,v,b]}),t[28]=g,t[29]=v,t[30]=b,t[31]=m,t[32]=x):x=t[32];let S;return t[33]!==x||t[34]!==o||t[35]!==u?(S=(0,W.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,x]}),t[33]=x,t[34]=o,t[35]=u,t[36]=S):S=t[36],S}function Ge(e){let t=(0,U.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,W.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,W.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,W.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,U.c)(21),{label:n,health:r}=e,i;t[0]!==r.lastError||t[1]!==r.status?(i=r.status===`unavailable`&&_(r.lastError,Ye),t[0]=r.lastError,t[1]=r.status,t[2]=i):i=t[2];let o=i,s;t[3]===n?s=t[4]:(s=(0,W.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:n}),t[3]=n,t[4]=s);let c;t[5]!==o||t[6]!==r.lastError?(c=o?`Available when this page runs inside the desktop app.`:a(r.lastError,{onNone:Je,onSome:qe}),t[5]=o,t[6]=r.lastError,t[7]=c):c=t[7];let l;t[8]===c?l=t[9]:(l=(0,W.jsx)(`div`,{className:`mt-1 text-2xs leading-relaxed text-muted-foreground/65`,children:c}),t[8]=c,t[9]=l);let u;t[10]!==s||t[11]!==l?(u=(0,W.jsxs)(`div`,{className:`min-w-0`,children:[s,l]}),t[10]=s,t[11]=l,t[12]=u):u=t[12];let d;t[13]===o?d=t[14]:(d=o?{label:`Desktop only`,tone:`neutral`}:void 0,t[13]=o,t[14]=d);let f;t[15]!==r.status||t[16]!==d?(f=(0,W.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,W.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,U.c)(10),{label:n,value:r,valueClassName:i}=e,a;t[0]===n?a=t[1]:(a=(0,W.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=p(`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,W.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,W.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,U.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,W.jsx)(L,{"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,W.jsx)(ue,{value:String(e.windowMs),children:e.label},e.windowMs)}function $e(e){let t=(0,U.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,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-foreground/70`}),` CPU average`]}),t[5]=c):c=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-info/70`}),` I/O reads`]}),t[6]=u):u=t[6],t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-3xs text-muted-foreground/65`,children:[c,u,(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.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,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsxs)(`div`,{className:`grid h-full min-w-1 flex-1 grid-cols-3 items-end gap-px`,children:[(0,W.jsx)(`span`,{className:`block rounded-t-sm bg-foreground/65`,style:{height:`${n}%`}}),(0,W.jsx)(`span`,{className:`block rounded-t-sm bg-info/70`,style:{height:`${r}%`}}),(0,W.jsx)(`span`,{className:`block rounded-t-sm bg-warning/80`,style:{height:`${i}%`}})]})}),(0,W.jsx)(D,{side:`top`,className:`text-left`,children:(0,W.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,W.jsxs)(`div`,{children:[`CPU avg `,t.avgCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`div`,{children:[`CPU peak `,t.maxCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`div`,{children:[`Read `,H(t.ioReadBytes)]}),(0,W.jsxs)(`div`,{children:[`Write `,H(t.ioWriteBytes)]})]})})]},l(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,W.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,W.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,U.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,W.jsx)(d,{size:`icon-micro`,variant:`ghost-muted`,onClick:()=>i(n),"aria-label":r?`Expand ${o}`:`Collapse ${o}`,children:(0,W.jsx)(E,{className:`size-3.5`,icon:r?q.ChevronRight:q.ChevronDown})}):(0,W.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 f;t[10]===n.category?f=t[11]:(f=p(`size-1.5 rounded-full`,Le(n.category)),t[10]=n.category,t[11]=f);let m;t[12]===f?m=t[13]:(m=(0,W.jsx)(`span`,{className:f}),t[12]=f,t[13]=m);let h;t[14]===o?h=t[15]:(h=(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[14]=o,t[15]=h);let g=n.command||n.name,_;t[16]===g?_=t[17]:(_=(0,W.jsx)(D,{side:`top`,variant:`code`,children:g}),t[16]=g,t[17]=_);let v;t[18]!==h||t[19]!==_?(v=(0,W.jsxs)(O,{children:[h,_]}),t[18]=h,t[19]=_,t[20]=v):v=t[20];let y;return t[21]!==v||t[22]!==l||t[23]!==u||t[24]!==m?(y=(0,W.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,m,v]}),t[21]=v,t[22]=l,t[23]=u,t[24]=m,t[25]=y):y=t[25],y}function nt(e){return e.category===`server-child`||e.category===`provider-root`||e.category===`terminal-root`}function rt(e){let t=(0,U.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,W.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,W.jsx)(G,{disabled:s,onSignal:c}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function it(e){let t=(0,U.c)(22),{processes:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e,[o,s]=(0,K.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,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[20%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[7%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[6%]`}),(0,W.jsx)(`col`,{className:`w-[4%]`})]}),t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,W.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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read/s`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write/s`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read Total`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write Total`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,W.jsx)(tt,{process:e,collapsed:o.has(Ne(e)),onToggle:d})}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Ie(e.category)}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:Ae(e.cpuTimeMs)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:H(e.residentBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:ke(e.ioReadBytesPerSecond)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:ke(e.ioWriteBytesPerSecond)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:H(e.ioReadBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{children:H(e.ioWriteBytes)})}),(0,W.jsx)(D,{side:`top`,children:Re(e.ioSemantics)})]})}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.identity.pid}),(0,W.jsx)(`td`,{className:`px-2 py-2 text-right sm:pr-4`,children:(0,W.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,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(R,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(68vh,48rem)] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[1320px] table-fixed text-left text-xs`,children:[f,p,(0,W.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,U.c)(9),{processes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[7%]`}),(0,W.jsx)(`col`,{className:`w-[5%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,W.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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak CPU`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak Mem`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Samples`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(R,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[28rem] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[1020px] table-fixed text-left text-xs`,children:[r,i,(0,W.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,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.name||e.command})}),(0,W.jsx)(D,{side:`top`,variant:`code`,children:e.command||e.name})]})}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Ie(e.category)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:Ae(e.cpuTimeMs)}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:H(e.peakRssBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:H(e.ioReadBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:H(e.ioWriteBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.sampleCount}),(0,W.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,U.c)(9),{entries:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[22%]`}),(0,W.jsx)(`col`,{className:`w-[28%]`}),(0,W.jsx)(`col`,{className:`w-[14%]`}),(0,W.jsx)(`col`,{className:`w-[14%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[12%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,W.jsx)(`thead`,{className:`border-b border-border/60 text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Component`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Operation`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Read`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Write`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Count`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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,W.jsx)(`div`,{className:`overflow-x-auto border-t border-border/60`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[720px] table-fixed text-left text-xs`,children:[r,i,(0,W.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,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`truncate px-4 py-2 font-medium text-foreground sm:pl-5`,children:e.component}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 text-muted-foreground`,children:e.operation}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:H(e.logicalReadBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:H(e.logicalWriteBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:e.count}),(0,W.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,U.c)(207),{environmentId:r}=e,[o,s]=(0,K.useState)(9e5),c;t[0]===o?c=t[1]:(c=Oe.find(e=>e.windowMs===o)??Oe[1],t[0]=o,t[1]=c);let l=c,u=ae(r,g),f=Ce(r),p=f.retry,m;t[2]!==l.bucketMs||t[3]!==l.windowMs?(m={windowMs:l.windowMs,bucketMs:l.bucketMs},t[2]=l.bucketMs,t[3]=l.windowMs,t[4]=m):m=t[4];let h=we(m,r),_;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_={reportFailure:!1},t[5]=_):_=t[5];let b=ce(N.signalProcess,_),[C,E]=(0,K.useState)(ht),k;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(k=new Set,t[6]=k):k=t[6];let j=(0,K.useRef)(k),M=(0,K.useRef)(r),se,P;t[7]===r?(se=t[8],P=t[9]):(se=()=>(M.current=r,()=>{M.current=null}),P=[r],t[7]=r,t[8]=se,t[9]=P),(0,K.useEffect)(se,P);let[F,le]=(0,K.useState)(!1),I=f.data,L=I?.groups.allT3,ue;t[10]===b?ue=t[11]:(ue=async(e,t)=>{let r=M.current;if(r===null||!oe(r,`environment:maintain`))return;let i=Ne(e);if(j.current.has(i))return;let a=new Set(j.current).add(i);j.current=a,E(a);let o=()=>{let e=new Set(j.current);e.delete(i),j.current=e,E(e)};if(t===`SIGKILL`){let n;try{n=await ie().dialogs.confirm(`Send SIGKILL to process ${e.identity.pid}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){let n=e;o(),A.add({type:`error`,title:`Could not confirm signal`,description:n instanceof Error?n.message:`Failed to send ${t}.`});return}if(!n){o();return}}if(M.current!==r||!oe(r,`environment:maintain`)){o();return}b({environmentId:r,input:{pid:e.identity.pid,startTimeMs:e.identity.startTimeMs,signal:t}}).then(r=>{if(r._tag===`Failure`){if(ne(r))return;throw re(r)}r.value.signaled||A.add({type:`error`,title:`Could not send ${t}`,description:n(r.value.message,()=>`Failed to send ${t} to process ${e.identity.pid}.`)})}).catch(e=>{A.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}).finally(()=>{o()})},t[10]=b,t[11]=ue);let de=ue,R;t[12]===p?R=t[13]:(R=()=>{let e=M.current;e!==null&&oe(e,`environment:maintain`)&&(le(!0),p().catch(mt).finally(()=>{le(!1)}))},t[12]=p,t[13]=R);let fe=R,pe,me,he,ge,ye,B,be,xe,V,Se,G,q,J,Te,Y,De,Pe,Fe,Ie;if(t[14]!==L||t[15]!==I||t[16]!==f.error||t[17]!==f.isPending||t[18]!==f.refresh){ye=I?i(I.speedLimitPercent):null;let e=I?.health.native.status??null,n;t[38]!==e||t[39]!==f.error?(n=Ee({nativeStatus:e,error:f.error}),t[38]=e,t[39]=f.error,t[40]=n):n=t[40],he=n,ge=I!==null&&(I.power.onBattery!==`unknown`||I.power.lowPowerMode!==`unknown`||I.power.idle!==`unknown`||I.power.locked!==`unknown`||I.power.thermalState!==`unknown`),me=z,De=`Resource monitor`,t[41]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,W.jsx)(v,{className:`size-4 text-muted-foreground`}),t[41]=Pe):Pe=t[41];let r;t[42]===I?r=t[43]:(r=I?(0,W.jsx)(Ve,{label:`Native`,status:I.health.native.status}):null,t[42]=I,t[43]=r);let a=I?.readAt??null,o;t[44]===a?o=t[45]:(o=(0,W.jsx)(He,{sampledAt:a}),t[44]=a,t[45]=o);let s;t[46]===f.isPending?s=t[47]:(s=(0,W.jsx)(ve,{size:`xs`,refreshing:f.isPending}),t[46]=f.isPending,t[47]=s);let c;t[48]!==s||t[49]!==f.isPending||t[50]!==f.refresh?(c=(0,W.jsx)(T,{render:(0,W.jsx)(d,{size:`icon-micro`,variant:`ghost`,disabled:f.isPending,onClick:f.refresh,"aria-label":`Refresh resource telemetry`,children:s})}),t[48]=s,t[49]=f.isPending,t[50]=f.refresh,t[51]=c):c=t[51];let l;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,W.jsx)(D,{side:`top`,children:`Refresh telemetry snapshot`}),t[52]=l):l=t[52];let u;t[53]===c?u=t[54]:(u=(0,W.jsxs)(O,{children:[c,l]}),t[53]=c,t[54]=u),t[55]!==r||t[56]!==o||t[57]!==u?(Fe=(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r,o,u]}),t[55]=r,t[56]=o,t[57]=u,t[58]=Fe):Fe=t[58],Te=`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-sm/5`;let p;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:`P4 system footprint`}),(0,W.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]=p):p=t[59];let m;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,W.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),t[60]=m):m=t[60];let h;t[61]===I?h=t[62]:(h=I?Me(I.sampleIntervalMs):`...`,t[61]=I,t[62]=h),t[63]===h?Y=t[64]:(Y=(0,W.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:[p,(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs text-muted-foreground/65`,children:[m,`Sampling every `,h]})]}),t[63]=h,t[64]=Y),xe=`grid grid-cols-2 divide-x divide-y divide-border/55 md:grid-cols-3`;let g;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,W.jsx)(x,{className:`size-3.5`}),t[65]=g):g=t[65];let _;t[66]===L?_=t[67]:(_=L?`${L.currentCpuPercent.toFixed(1)}%`:`...`,t[66]=L,t[67]=_);let y;t[68]===L?y=t[69]:(y=L?`${Ae(L.cpuTimeMs)} observed CPU time`:void 0,t[68]=L,t[69]=y),t[70]!==_||t[71]!==y?(V=(0,W.jsx)(Ue,{icon:g,label:`Current CPU`,value:_,detail:y}),t[70]=_,t[71]=y,t[72]=V):V=t[72];let b;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,W.jsx)(te,{className:`size-3.5`}),t[73]=b):b=t[73];let C;t[74]===L?C=t[75]:(C=L?H(L.currentRssBytes):`...`,t[74]=L,t[75]=C);let w;t[76]===L?w=t[77]:(w=L?`${H(L.peakRssBytes)} combined process peaks`:void 0,t[76]=L,t[77]=w),t[78]!==C||t[79]!==w?(Se=(0,W.jsx)(Ue,{icon:b,label:`Resident memory`,value:C,detail:w}),t[78]=C,t[79]=w,t[80]=Se):Se=t[80];let ne;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,W.jsx)(v,{className:`size-3.5`}),t[81]=ne):ne=t[81];let re=L?String(L.processCount):`...`,E=L?`${L.processStarts} starts · ${L.processExits} exits`:void 0;t[82]!==re||t[83]!==E?(G=(0,W.jsx)(Ue,{icon:ne,label:`Process count`,value:re,detail:E}),t[82]=re,t[83]=E,t[84]=G):G=t[84];let k;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,W.jsx)(_e,{className:`size-3.5`}),t[85]=k):k=t[85];let A;t[86]===L?A=t[87]:(A=L?ke(L.ioReadBytesPerSecond):`...`,t[86]=L,t[87]=A);let j;t[88]===L?j=t[89]:(j=L?`${H(L.ioReadBytes)} observed`:void 0,t[88]=L,t[89]=j),t[90]!==A||t[91]!==j?(q=(0,W.jsx)(Ue,{icon:k,label:`Read throughput`,value:A,detail:j}),t[90]=A,t[91]=j,t[92]=q):q=t[92];let M;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,W.jsx)(S,{className:`size-3.5`}),t[93]=M):M=t[93];let ie;t[94]===L?ie=t[95]:(ie=L?ke(L.ioWriteBytesPerSecond):`...`,t[94]=L,t[95]=ie);let N;t[96]===L?N=t[97]:(N=L?`${H(L.ioWriteBytes)} observed`:void 0,t[96]=L,t[97]=N);let ae=L&&L.ioWriteBytesPerSecond>=10485760?`danger`:L&&L.ioWriteBytesPerSecond>=1048576?`warning`:`default`;t[98]!==ie||t[99]!==N||t[100]!==ae?(J=(0,W.jsx)(Ue,{icon:M,label:`Write throughput`,value:ie,detail:N,tone:ae}),t[98]=ie,t[99]=N,t[100]=ae,t[101]=J):J=t[101],pe=Ue,t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,W.jsx)(ee,{className:`size-3.5`}),t[102]=Ie):Ie=t[102],B=`CPU speed limit`,be=I?ye===null?`Unknown`:`${ye.toFixed(0)}%`:`...`,t[14]=L,t[15]=I,t[16]=f.error,t[17]=f.isPending,t[18]=f.refresh,t[19]=pe,t[20]=me,t[21]=he,t[22]=ge,t[23]=ye,t[24]=B,t[25]=be,t[26]=xe,t[27]=V,t[28]=Se,t[29]=G,t[30]=q,t[31]=J,t[32]=Te,t[33]=Y,t[34]=De,t[35]=Pe,t[36]=Fe,t[37]=Ie}else pe=t[19],me=t[20],he=t[21],ge=t[22],ye=t[23],B=t[24],be=t[25],xe=t[26],V=t[27],Se=t[28],G=t[29],q=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=I?`${I.power.thermalState} thermal state`:void 0,Re=ye!==null&&ye<80?`warning`:`default`,Be;t[103]!==pe||t[104]!==B||t[105]!==be||t[106]!==Le||t[107]!==Re||t[108]!==Ie?(Be=(0,W.jsx)(pe,{icon:Ie,label:B,value:be,detail:Le,tone:Re}),t[103]=pe,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]!==V||t[112]!==Se||t[113]!==G||t[114]!==q||t[115]!==J||t[116]!==Be?(Ge=(0,W.jsxs)(`div`,{className:xe,children:[V,Se,G,q,J,Be]}),t[110]=xe,t[111]=V,t[112]=Se,t[113]=G,t[114]=q,t[115]=J,t[116]=Be,t[117]=Ge):Ge=t[117];let qe;t[118]===f.error?qe=t[119]:(qe=f.error?(0,W.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,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:f.error})]}):null,t[118]=f.error,t[119]=qe);let Je;t[120]===I?Je=t[121]:(Je=I?(0,W.jsxs)(`div`,{className:`grid border-t border-border/60 bg-muted/10 md:grid-cols-3`,children:[(0,W.jsx)(We,{label:`Backend + agents`,accentClass:`bg-success/80`,aggregate:I.groups.backend}),(0,W.jsx)(We,{label:`Desktop`,accentClass:`bg-info/80`,aggregate:I.groups.electron}),(0,W.jsx)(We,{label:`Monitor overhead`,accentClass:`bg-warning/80`,aggregate:I.groups.monitor})]}):null,t[120]=I,t[121]=Je);let Ye;t[122]!==Te||t[123]!==Y||t[124]!==Ge||t[125]!==qe||t[126]!==Je?(Ye=(0,W.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]!==me||t[129]!==De||t[130]!==Pe||t[131]!==Fe||t[132]!==Ye?(Qe=(0,W.jsx)(me,{title:De,icon:Pe,headerAction:Fe,children:Ye}),t[128]=me,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,W.jsx)(ee,{className:`size-4 text-muted-foreground`}),t[134]=et):et=t[134];let tt;t[135]!==he||t[136]!==F||t[137]!==fe?(tt=he?(0,W.jsxs)(d,{size:`xs`,variant:`outline`,disabled:F,onClick:fe,children:[(0,W.jsx)(ve,{size:`xs`,refreshing:F}),`Retry monitor`]}):null,t[135]=he,t[136]=F,t[137]=fe,t[138]=tt):tt=t[138];let nt;t[139]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,W.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,W.jsx)(y,{className:`size-3.5`})}),`Host state`]}),t[139]=nt):nt=t[139];let rt;t[140]!==ge||t[141]!==I?(rt=(0,W.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[nt,ge&&I?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Xe,{label:`Power source`,value:ze(I.power.onBattery,{true:`Battery`,false:`External power`})}),(0,W.jsx)(Xe,{label:`Low power mode`,value:ze(I.power.lowPowerMode,{true:`Enabled`,false:`Disabled`})}),(0,W.jsx)(Xe,{label:`Idle`,value:`${ze(I.power.idle,{true:`Idle`,false:`Active`})}${I.power.idleSeconds===null?``:` · ${Math.round(I.power.idleSeconds)}s`}`}),(0,W.jsx)(Xe,{label:`Session`,value:I.power.suspended?`Suspended`:ze(I.power.locked,{true:`Locked`,false:`Unlocked`})}),(0,W.jsx)(Xe,{label:`Thermal`,value:I.power.thermalState,valueClassName:I.power.thermalState===`serious`||I.power.thermalState===`critical`?`text-destructive`:void 0})]}):(0,W.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/70 bg-muted/20 px-4 py-5`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Desktop host signals not connected`}),(0,W.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]=ge,t[141]=I,t[142]=rt):rt=t[142];let at;t[143]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,W.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,W.jsx)(ee,{className:`size-3.5`})}),`Collection health`]}),t[143]=at):at=t[143];let st;t[144]===I?st=t[145]:(st=(0,W.jsxs)(`div`,{className:`border-t border-border/60 px-4 py-4 md:border-t-0 sm:px-5`,children:[at,I?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Ke,{label:`Native process monitor`,health:I.health.native}),(0,W.jsx)(Ke,{label:`Electron main process`,health:I.health.desktop}),(0,W.jsx)(Xe,{label:`Collection time`,value:je(I.health.collectionDurationMicros)}),(0,W.jsx)(Xe,{label:`Process scan`,value:`${I.health.retainedProcessCount}/${I.health.scannedProcessCount} retained`}),(0,W.jsx)(Xe,{label:`Inaccessible`,value:String(I.health.inaccessibleProcessCount),valueClassName:I.health.inaccessibleProcessCount>0?`text-warning-foreground`:void 0}),(0,W.jsx)(Xe,{label:`Sidecar`,value:a(I.health.sidecarVersion,{onNone:pt,onSome:e=>`${e}${a(I.health.sidecarPid,{onNone:ft,onSome:dt})}`})}),(0,W.jsx)(Xe,{label:`Restarts`,value:String(I.health.restartCount)})]}):(0,W.jsx)(`div`,{className:`py-4 text-xs text-muted-foreground`,children:`Waiting for collector health.`})]}),t[144]=I,t[145]=st);let lt;t[146]!==rt||t[147]!==st?(lt=(0,W.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,W.jsx)(z,{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,W.jsx)(_e,{className:`size-4 text-muted-foreground`}),t[152]=gt):gt=t[152];let _t;t[153]===o?_t=t[154]:(_t=(0,W.jsx)(Ze,{selectedWindowMs:o,onSelect:s}),t[153]=o,t[154]=_t);let vt;t[155]===h.isPending?vt=t[156]:(vt=(0,W.jsx)(ve,{size:`xs`,refreshing:h.isPending}),t[155]=h.isPending,t[156]=vt);let yt;t[157]!==h.isPending||t[158]!==h.refresh||t[159]!==vt?(yt=(0,W.jsx)(d,{size:`icon-micro`,variant:`ghost`,disabled:h.isPending,onClick:h.refresh,"aria-label":`Refresh resource history`,children:vt}),t[157]=h.isPending,t[158]=h.refresh,t[159]=vt,t[160]=yt):yt=t[160];let bt;t[161]!==_t||t[162]!==yt?(bt=(0,W.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]===h.error?xt=t[165]:(xt=h.error?(0,W.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,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:h.error})]}):null,t[164]=h.error,t[165]=xt);let X;t[166]===h.data?.buckets?X=t[167]:(X=h.data?.buckets??[],t[166]=h.data?.buckets,t[167]=X);let Z;t[168]===X?Z=t[169]:(Z=(0,W.jsx)($e,{buckets:X}),t[168]=X,t[169]=Z);let St;t[170]===h.data?.topProcesses?St=t[171]:(St=h.data?.topProcesses??[],t[170]=h.data?.topProcesses,t[171]=St);let Ct;t[172]===St?Ct=t[173]:(Ct=(0,W.jsx)(ot,{processes:St}),t[172]=St,t[173]=Ct);let wt;t[174]!==xt||t[175]!==Z||t[176]!==Ct?(wt=(0,W.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,W.jsx)(z,{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,W.jsx)(x,{className:`size-4 text-muted-foreground`}),t[181]=Et):Et=t[181];let Q;t[182]===I?Q=t[183]:(Q=I?(0,W.jsxs)(`span`,{className:`text-3xs text-muted-foreground/55`,children:[`Identity: `,(0,W.jsx)(`span`,{className:`font-mono`,children:`PID + start time`})]}):null,t[182]=I,t[183]=Q);let Dt;t[184]===I?.processes?Dt=t[185]:(Dt=I?.processes??[],t[184]=I?.processes,t[185]=Dt);let $;t[186]!==u||t[187]!==de||t[188]!==C||t[189]!==Dt?($=(0,W.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:(0,W.jsx)(it,{processes:Dt,canMaintainEnvironment:u,signalingKeys:C,onSignal:de})}),t[186]=u,t[187]=de,t[188]=C,t[189]=Dt,t[190]=$):$=t[190];let Ot;t[191]!==Q||t[192]!==$?(Ot=(0,W.jsx)(z,{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,W.jsx)(S,{className:`size-4 text-muted-foreground`}),At=(0,W.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,W.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]===I?.attribution.entries?Mt=t[198]:(Mt=I?.attribution.entries??[],t[197]=I?.attribution.entries,t[198]=Mt);let Nt;t[199]===Mt?Nt=t[200]:(Nt=(0,W.jsx)(z,{title:`Instrumented application I/O`,icon:kt,headerAction:At,children:(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[jt,(0,W.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,W.jsxs)(W.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){A.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,U.c)(3),{environment:t,scope:n}=he();if(n.kind!==`environment`||!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,W.jsx)(z,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,W.jsx)(Se,{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,W.jsx)(bt,{},t.environmentId),e[1]=t.environmentId,e[2]=r),r}function bt(){let{environment:e}=he(),t=fe(e=>e.observability),[n,r]=(0,K.useState)({}),[i,a]=(0,K.useState)(!1),[s,c]=(0,K.useState)(null),l=e?.environmentId,u=o(N.checkOtlpEndpoint.permissionAtom(l??null)),f=u&&e?.serverConfig?.environment.capabilities.otlpEndpointCheck===!0,[p,m]=(0,K.useState)(()=>Object.fromEntries(gt.filter(({key:e})=>_t(t[e])).map(({key:e})=>[e,{url:t[e],result:null}]))),h=ce(N.updateSettings,{reportFailure:!0}),g=ce(N.checkOtlpEndpoint),_={...t,...n},v=gt.filter(({key:e})=>_[e].trim()!==t[e]),y=v.length>0,b=e?.serverConfig?.observability,x=async(e,t,n)=>{if(!l)return;let r=await g({environmentId:l,input:{signal:t,url:n}});m(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})},S=(e,t,n)=>{_t(n)&&(m(t=>({...t,[e]:{url:n,result:null}})),x(e,t,n))},ee=(0,K.useEffectEvent)(()=>{for(let{key:e,signal:t}of gt){let n=p[e];n?.result===null&&x(e,t,n.url)}});return(0,K.useEffect)(()=>{f&&ee()},[f]),(0,W.jsx)(z,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,W.jsxs)(`form`,{className:`grid gap-4 px-4 py-4 sm:px-5`,onSubmit:async t=>{if(t.preventDefault(),e&&!i){a(!0),c(null);try{(await h({environmentId:e.environmentId,input:{patch:{observability:Object.fromEntries(v.map(({key:e})=>[e,_[e]]))}}}))._tag===`Success`&&(r({}),c(`Saved. Restart the server to apply.`))}finally{a(!1)}}},children:[(0,W.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.`}),!u&&(0,W.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=_[e].trim(),s=f?vt(o,p[e]):null;return(0,W.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[s&&(0,W.jsx)(ge,{dotClassName:s.dot}),(0,W.jsxs)(B,{htmlFor:e,children:[n,` endpoint`]})]}),s&&(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:s.label})]}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(de,{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:_[e],disabled:i||!u,onChange:n=>{let i=n.target.value;r(n=>{let r={...n,[e]:i};return i.trim()===t[e]&&delete r[e],r}),c(null)}}),f&&(0,W.jsx)(d,{type:`button`,size:`sm`,variant:`outline`,disabled:!_t(o)||p[e]?.result===null,onClick:()=>void S(e,a,o),children:`Test`})]}),t[e]!==(b?.[e]??``)&&(0,W.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[`Running: `,b?.[e]||`Disabled`]})]},e)}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:s}),(0,W.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,W.jsx)(d,{type:`button`,size:`xs`,variant:`outline`,disabled:!y||i||!u,onClick:()=>{if(r({}),c(null),f)for(let{key:e,signal:n}of gt)p[e]?.url!==t[e]&&S(e,n,t[e])},children:`Discard`}),(0,W.jsx)(d,{type:`submit`,size:`xs`,disabled:!y||i||!u,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?le(l(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,U.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,W.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,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.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,W.jsx)(C,{className:`size-3`})})}),(0,W.jsx)(D,{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,W.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=p(`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 m;t[11]!==f||t[12]!==r?(m=(0,W.jsx)(`div`,{className:f,children:r}),t[11]=f,t[12]=r,t[13]=m):m=t[13];let h;return t[14]!==l||t[15]!==m?(h=(0,W.jsxs)(`div`,{className:`min-w-0 border-border/60 px-4 py-3 sm:px-5`,children:[l,m]}),t[14]=l,t[15]=m,t[16]=h):h=t[16],h}function Dt(e){let t=(0,U.c)(6),{children:n}=e,r,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,W.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/2 w-px bg-border/60`,"aria-hidden":!0}),i=(0,W.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,W.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,W.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,W.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,U.c)(2),{label:n}=e,r;return t[0]===n?r=t[1]:(r=(0,W.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,U.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=p(`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,W.jsx)(`colgroup`,{children:n.map((e,t)=>(0,W.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,W.jsx)(`th`,{className:p(`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,W.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,W.jsx)(`tr`,{children:u})}),t[12]=u,t[13]=d);let f;t[14]===r?f=t[15]:(f=(0,W.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:r}),t[14]=r,t[15]=f);let m;return t[16]!==c||t[17]!==l||t[18]!==d||t[19]!==f?(m=(0,W.jsx)(R,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:c,children:[l,d,f]})}),t[16]=c,t[17]=l,t[18]=d,t[19]=f,t[20]=m):m=t[20],m}function kt(e){let t=(0,U.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:i,isCopied:a}=j(r),o;t[1]===n?o=t[2]:(o=Tt(n),t[1]=n,t[2]=o);let s;t[3]===o?s=t[4]:(s=(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-2xs`,children:o})}),t[3]=o,t[4]=s);let c;t[5]===n?c=t[6]:(c=(0,W.jsx)(D,{side:`top`,variant:`code`,children:n}),t[5]=n,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,W.jsxs)(O,{children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u=a?`Copied trace ID`:`Copy trace ID`,f;t[10]!==i||t[11]!==n?(f=()=>i(n),t[10]=i,t[11]=n,t[12]=f):f=t[12];let p;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,W.jsx)(b,{className:`size-3`}),t[13]=p):p=t[13];let m;t[14]!==u||t[15]!==f?(m=(0,W.jsx)(T,{render:(0,W.jsx)(d,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":u,onClick:f,children:p})}),t[14]=u,t[15]=f,t[16]=m):m=t[16];let h=a?`Copied`:`Copy full trace ID`,g;t[17]===h?g=t[18]:(g=(0,W.jsx)(D,{side:`top`,children:h}),t[17]=h,t[18]=g);let _;t[19]!==g||t[20]!==m?(_=(0,W.jsxs)(O,{children:[m,g]}),t[19]=g,t[20]=m,t[21]=_):_=t[21];let v;return t[22]!==_||t[23]!==l?(v=(0,W.jsxs)(`div`,{className:`flex w-full min-w-0 max-w-full items-center gap-2`,children:[l,_]}),t[22]=_,t[23]=l,t[24]=v):v=t[24],v}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,U.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,W.jsx)(d,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":r?`Collapse ${o}`:`Expand ${o}`,onClick:()=>i(n.pid),children:(0,W.jsx)(E,{className:`size-3.5`,icon:r?q.ChevronDown:q.ChevronRight})}):(0,W.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 f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,W.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-success/80`}),t[10]=f):f=t[10];let p;t[11]===o?p=t[12]:(p=(0,W.jsx)(T,{render:(0,W.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,W.jsx)(D,{side:`top`,variant:`code`,children:n.command}),t[13]=n.command,t[14]=m);let h;t[15]!==p||t[16]!==m?(h=(0,W.jsxs)(O,{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,W.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,f,h]}),t[18]=l,t[19]=u,t[20]=h,t[21]=g):g=t[21],g}function Nt(e){let t=(0,U.c)(18),{processes:n,canMaintainEnvironment:r,signalingPid:i,onSignal:a,emptyLabel:o}=e,[s,c]=(0,K.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,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[33%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[6%]`})]}),t[4]=p):p=t[4];let m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,W.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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Name`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Type`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,W.jsx)(Mt,{process:e,isExpanded:!s.has(e.pid),onToggle:f})}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:St(e.rssBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,W.jsx)(D,{side:`top`,variant:`code`,children:e.command})]})}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground`,children:e.pid}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 align-middle text-muted-foreground`,children:jt(e)}),(0,W.jsx)(`td`,{className:`p-2 align-middle sm:pr-4`,children:(0,W.jsx)(G,{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,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(R,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[1040px] table-fixed text-left text-xs`,children:[p,m,(0,W.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,U.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,W.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=p(`size-1.5 shrink-0 rounded-full`,u),t[5]=u,t[6]=d);let f;t[7]===d?f=t[8]:(f=(0,W.jsx)(`span`,{className:d}),t[7]=d,t[8]=f);let m;t[9]===a?m=t[10]:(m=(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:a})}),t[9]=a,t[10]=m);let h;t[11]===n.command?h=t[12]:(h=(0,W.jsx)(D,{side:`top`,variant:`code`,children:n.command}),t[11]=n.command,t[12]=h);let g;t[13]!==h||t[14]!==m?(g=(0,W.jsxs)(O,{children:[m,h]}),t[13]=h,t[14]=m,t[15]=g):g=t[15];let _;return t[16]!==g||t[17]!==s||t[18]!==c||t[19]!==f?(_=(0,W.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,g]}),t[16]=g,t[17]=s,t[18]=c,t[19]=f,t[20]=_):_=t[20],_}function zt(e){let t=(0,U.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,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`div`,{className:`flex h-full min-w-1 flex-1 items-end`,children:(0,W.jsxs)(`div`,{className:`relative h-full w-full`,"aria-label":`Average CPU ${e.avgCpuPercent.toFixed(1)}%, peak CPU ${e.maxCpuPercent.toFixed(1)}%`,children:[(0,W.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/15 transition-colors`,style:{height:`${t}%`}}),(0,W.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/60 transition-colors`,style:{height:`${n}%`}})]})})}),(0,W.jsxs)(D,{side:`top`,children:[`Avg `,e.avgCpuPercent.toFixed(1),`%, peak `,e.maxCpuPercent.toFixed(1),`%`]})]},l(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,W.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,W.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,U.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,W.jsx)(L,{"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,W.jsx)(ue,{value:String(e.windowMs),children:e.label},e.windowMs)}function Ut(e){let t=(0,U.c)(13),{processes:n,emptyLabel:r}=e,i=n.reduce(Wt,null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[16%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`})]}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,W.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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Current`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Average`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Max Mem`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,W.jsx)(Rt,{process:e,visualDepth:e.isServerRoot||i===null?0:Math.max(1,e.depth-i+1)})}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:It(e.cpuSecondsApprox)}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.currentCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.avgCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:St(e.maxRssBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,W.jsx)(D,{side:`top`,variant:`code`,children:e.command})]})}),(0,W.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,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(R,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[980px] table-fixed text-left text-xs`,children:[a,o,(0,W.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,U.c)(7),{checkedAt:n}=e;me();let r;t[0]===n?r=t[1]:(r=I(n?l(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,W.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,W.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,W.jsx)(`span`,{className:`text-2xs text-muted-foreground/60`,children:i.suffix?(0,W.jsxs)(W.Fragment,{children:[`Checked `,(0,W.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,W.jsxs)(W.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,U.c)(12),{isPending:n,label:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,W.jsx)(ve,{refreshing:n}),t[0]=n,t[1]=a);let o;t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a?(o=(0,W.jsx)(T,{render:(0,W.jsx)(d,{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,W.jsx)(D,{side:`top`,children:r}),t[7]=r,t[8]=s);let c;return t[9]!==o||t[10]!==s?(c=(0,W.jsxs)(O,{children:[o,s]}),t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function qt(){let{environment:e}=he(),t=e?.environmentId??null,a=ae(t,g),o=e?.serverConfig?.observability,s=e?.serverConfig?.availableEditors,c=ae(t,m),u=P(t===null?null:se.sessionStateAtom(t)),f=xe({connectionPhase:e?.connection.phase??`available`,session:u.data,hasSessionError:u.error!==null}),h=f.canReadDiagnostics,_=ce(N.signalProcess,{reportFailure:!1}),v=ye(t,s??[]),[y,b]=(0,K.useState)(9e5),x=Ft.find(e=>e.windowMs===y)??Ft[1],{data:S,error:ee,isPending:C,refresh:te}=P(t===null||!h?null:N.traceDiagnostics({environmentId:t,input:{}})),{data:E,error:k,isPending:j,refresh:M}=P(t===null||!h?null:N.processDiagnostics({environmentId:t,input:{}})),{data:F,error:le,isPending:I,refresh:L}=P(t===null||!h?null:N.processResourceHistory({environmentId:t,input:{windowMs:x.windowMs,bucketMs:x.bucketMs}})),[ue,de]=(0,K.useState)(!1),[fe,me]=(0,K.useState)(null),[ge,_e]=(0,K.useState)(null),ve=(0,K.useRef)(null),B=(0,K.useRef)(t),H=(0,K.useRef)(E);(0,K.useEffect)(()=>{H.current=E},[E]),(0,K.useEffect)(()=>(B.current=t,()=>{B.current=null}),[t]);let Se=(0,K.useCallback)(()=>{let e=o?.logsDirectoryPath??null;e&&t!==null&&oe(t,`orchestration:operate`)&&(de(!0),me(null),(async()=>{let t=await v(e);if(de(!1),t._tag===`Failure`&&!ne(t)){let e=re(t);me(e instanceof Error?e.message:`Unable to open logs folder.`)}})())},[t,o?.logsDirectoryPath,v]),U=C&&S===null,G=j&&E===null,q=I&&F===null,[Ce,we]=(0,K.useState)(null);Ce!==t&&h&&!U&&!G&&!q&&we(t);let J=(0,K.useCallback)(async(e,t)=>{let n=B.current,i=H.current?.processes.find(t=>t.pid===e);if(n===null||i===void 0||!oe(n,`environment:maintain`)||ve.current!==null)return;ve.current=e,_e(e);let a=()=>{ve.current=null,_e(null)};if(t===`SIGKILL`){let n=!1;try{n=await ie().dialogs.confirm(`Send SIGKILL to process ${e}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){a(),A.add({type:`error`,title:`Could not confirm signal`,description:e instanceof Error?e.message:`Failed to send ${t}.`});return}if(!n){a();return}}let o=B.current;if(o===null||o!==n||!oe(o,`environment:maintain`)){a();return}if(H.current?.processes.find(t=>t.pid===e)?.startTimeMs!==i.startTimeMs){a();return}try{let a=await _({environmentId:n,input:{pid:e,startTimeMs:i.startTimeMs,signal:t}});if(a._tag===`Failure`){if(!ne(a)){let e=re(a);A.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}return}if(!a.value.signaled){let e=r(a.value.message);if(M(),Et(e)){A.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}A.add({type:`error`,title:`Could not send ${t}`,description:e??`Failed to send ${t}.`});return}M()}finally{a()}},[M,_]),Te=E?i(E.error):null,Ee=F?i(F.error):null,Y=S?i(S.error):null,De=S?n(S.partialFailure,()=>!1):!1;return h?(0,W.jsxs)(pe,{width:`expanded`,className:`gap-10`,children:[(0,W.jsx)(ut,{environmentId:t}),(0,W.jsxs)(z,{title:`Live Processes`,headerAction:(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(Gt,{checkedAt:E?.readAt??null}),(0,W.jsx)(Kt,{isPending:j,label:`Refresh process diagnostics`,onClick:M})]}),children:[(0,W.jsxs)(Dt,{children:[(0,W.jsx)(Q,{label:`Child Processes`,value:E?X(E.processCount):`...`}),(0,W.jsx)(Q,{label:`CPU`,value:E?`${E.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,W.jsx)(Q,{label:`Memory`,value:E?St(E.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,W.jsx)(Q,{label:`Server PID`,value:E?String(E.serverPid):`...`})]}),Te||k?(0,W.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,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:Te.message})]}):null,k?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:k})]}):null]}):null,(0,W.jsx)(Nt,{processes:E?.processes??[],canMaintainEnvironment:a,signalingPid:ge,onSignal:J,emptyLabel:G?`Loading live processes...`:`No live descendant processes found.`})]}),(0,W.jsxs)(z,{title:`Resource History`,headerAction:(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(Vt,{selectedWindowMs:y,onSelect:b}),(0,W.jsx)(Gt,{checkedAt:F?.readAt??null}),(0,W.jsx)(Kt,{isPending:I,label:`Refresh resource history`,onClick:L})]}),children:[(0,W.jsxs)(Dt,{children:[(0,W.jsx)(Q,{label:`CPU Time`,value:F?It(F.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,W.jsx)(Q,{label:`Samples`,value:F?X(F.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,W.jsx)(Q,{label:`Interval`,value:F?F.sampleIntervalMs===0?`On demand`:Z(F.sampleIntervalMs):`...`}),(0,W.jsx)(Q,{label:`Processes`,value:F?X(F.topProcesses.length):`...`})]}),Ee||le?(0,W.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,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:Ee.message})]}):null,le?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:le})]}):null]}):null,(0,W.jsx)(zt,{buckets:F?.buckets??[]}),(0,W.jsx)(Ut,{processes:F?.topProcesses??[],emptyLabel:q?`Collecting process resource samples...`:`No process resource samples found for this window.`})]}),(0,W.jsxs)(z,{title:`Trace Diagnostics`,headerAction:(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(Gt,{checkedAt:S?.readAt??null}),(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(d,{size:`icon-xs`,variant:`ghost-muted`,disabled:!c||!o?.logsDirectoryPath||ue,onClick:Se,"aria-label":`Open logs folder`,children:(0,W.jsx)(be,{})})}),(0,W.jsx)(D,{side:`top`,children:`Open logs folder`})]}),(0,W.jsx)(Kt,{isPending:C,label:`Refresh trace diagnostics`,onClick:te})]}),children:[(0,W.jsxs)(Dt,{children:[(0,W.jsx)(Q,{label:`Spans`,value:S?X(S.recordCount):`...`}),(0,W.jsx)(Q,{label:`Failures`,value:S?X(S.failureCount):`...`,tone:S&&S.failureCount>0?`danger`:`default`}),(0,W.jsx)(Q,{label:`Slow Spans`,value:S?X(S.slowSpanCount):`...`,tooltip:S?`Spans with a duration of ${Z(S.slowSpanThresholdMs)} or longer.`:`Spans at or above the configured slow-span threshold.`,tone:S&&S.slowSpanCount>0?`warning`:`default`}),(0,W.jsx)(Q,{label:`Parse Errors`,value:S?X(S.parseErrorCount):`...`,tone:S&&S.parseErrorCount>0?`warning`:`default`})]}),fe||Y||ee?(0,W.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[fe?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:fe})]}):null,Y?(0,W.jsxs)(`div`,{className:p(`flex items-start gap-2`,De?`text-warning-foreground`:`text-destructive`),children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:De?`Some trace files could not be read, so diagnostics may be incomplete. ${Y.message}`:Y.message})]}):null,ee?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:ee})]}):null]}):null]}),(0,W.jsx)(z,{title:`Latest Failures`,children:S&&S.latestFailures.length>0?(0,W.jsx)(Ot,{headers:[`Span`,`Cause`,`Duration`,`Ended`],children:S.latestFailures.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,W.jsx)(V,{text:e.cause})}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.durationMs)}),(0,W.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,W.jsx)($,{label:U?`Loading failures...`:`No failed spans found.`})}),(0,W.jsx)(z,{title:`Most Common Failures`,children:S&&S.commonFailures.length>0?(0,W.jsx)(Ot,{headers:[`Span`,`Count`,`Cause`,`Last Seen`],minTableWidth:`min-w-[760px]`,children:S.commonFailures.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:X(e.count)}),(0,W.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,W.jsx)(V,{text:e.cause})}),(0,W.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,W.jsx)($,{label:U?`Loading failure groups...`:`No repeated failures found.`})}),(0,W.jsx)(z,{title:`Slowest Spans`,children:S&&S.slowestSpans.length>0?(0,W.jsx)(Ot,{headers:[`Span`,`Duration`,`Ended`,`Trace`],minTableWidth:`min-w-[900px]`,columnWidths:[`w-[44%]`,`w-[14%]`,`w-[12%]`,`w-[30%]`],children:S.slowestSpans.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.durationMs)}),(0,W.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,W.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground last:sm:pr-5`,children:(0,W.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}`))}):(0,W.jsx)($,{label:U?`Loading slow spans...`:`No spans found.`})}),(0,W.jsx)(z,{title:`Span Logs`,children:S&&S.latestWarningAndErrorLogs.length>0?(0,W.jsx)(R,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[920px] table-fixed text-left text-xs`,children:[(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[26%]`}),(0,W.jsx)(`col`,{className:`w-[30%]`})]}),(0,W.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pl-5`,children:`Time`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Level`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Span`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Message`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pr-5`,children:`Trace`})]})}),(0,W.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:S.latestWarningAndErrorLogs.map(e=>(0,W.jsxs)(`tr`,{className:`hover:bg-muted/15`,children:[(0,W.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,W.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,W.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,W.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,W.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:e.spanName})}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-muted-foreground`,children:(0,W.jsx)(V,{collapsedClassName:`line-clamp-2`,expandLabel:`Show full message`,text:e.message})}),(0,W.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground sm:pr-5`,children:(0,W.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}:${l(e.seenAt)}:${e.message}`))})]})}):(0,W.jsx)($,{label:U?`Loading recent logs...`:`No warnings or errors found.`})}),(0,W.jsx)(z,{title:`Top Span Names`,children:S&&S.topSpansByCount.length>0?(0,W.jsx)(Ot,{headers:[`Span`,`Count`,`Failures`,`Average`,`Max`],minTableWidth:`min-w-[760px]`,columnWidths:[`w-[48%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`],children:S.topSpansByCount.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:X(e.count)}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:X(e.failureCount)}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.averageDurationMs)}),(0,W.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,W.jsx)($,{label:U?`Loading span names...`:`No spans found.`})}),Ce===t&&(0,W.jsx)(yt,{})]}):(0,W.jsx)(pe,{children:(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t===null?`Connect an environment to see diagnostics.`:f.isPending?`Checking diagnostics access…`:f.error})})}var Jt=qt;export{Jt as component};
2
- //# sourceMappingURL=settings.diagnostics-DSw1QN-I.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Af as n,Ax as r,Cf as i,Gb as a,Ho as o,Qb as s,Tf as c,Zb as l,cr as u,dy as d,ex as f,ha as p,ix as m,sr as h,t as g,ug as _}from"./utils-DmfMX1v5.js";import{t as v}from"./activity-C1Y3O_v1.js";import{t as y}from"./battery-Bjbw2yxu.js";import{t as b}from"./copy-CoM62e83.js";import{t as x}from"./cpu-mffhvvYB.js";import{t as S}from"./database-DipbOz0U.js";import{t as ee}from"./gauge-C_4eEUrj.js";import{t as C}from"./info-BHB-83EA.js";import{t as te}from"./memory-stick-C7kBEkBW.js";import{t as w}from"./triangle-alert-BiHUyRl3.js";import{L as ne,U as re}from"./runtime-BQJQC-Ny.js";import{a as T,c as E,n as D,t as O,u as k}from"./tooltip-taOyJZax.js";import{i as A,p as j}from"./toast-CjelgyqV.js";import{D as M,q as ie}from"./useSettings-CLtJrOYI.js";import{f as N}from"./server-BD_Y5Gsn.js";import{i as ae,n as oe,t as se}from"./session-DsbInyNV.js";import{n as P}from"./query-DpwJQzeq.js";import{t as ce}from"./use-atom-command-CQHjSXPR.js";import{a as F,o as le,u as I}from"./timestampFormat-wac2e_Jz.js";import{n as L,t as ue}from"./toggle-group-DCQTLIPb.js";import{t as de}from"./input-Cd_0h7h_.js";import{t as R}from"./scroll-area-LhpLVf8r.js";import{B as fe,P as z,i as pe,s as B,u as me}from"./settingsLayout-jP1a50ek.js";import{t as he}from"./ConnectionStatusDot-B69zfKRh.js";import{Ho as ge,Ni as _e,Po as ve,Wa as ye,qa as be}from"./main-BB3F4O6Y.js";import{t as xe}from"./usageAccess-CY-JtQnU.js";import{t as V}from"./ExpandableText-EZ9C25tN.js";import{t as H}from"./formatBytes-D8LhsSVR.js";import{t as Se}from"./SettingsScopeNotice-CVoWG1oN.js";var U=r(),W=e(p(),1);function G(e){let t=(0,U.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,W.jsx)(T,{render:(0,W.jsx)(u,{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,W.jsx)(D,{side:`top`,children:`Send SIGINT`}),t[5]=o):o=t[5];let s;t[6]===a?s=t[7]:(s=(0,W.jsxs)(O,{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,W.jsx)(T,{render:(0,W.jsx)(u,{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 d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,W.jsx)(D,{side:`top`,children:`Send SIGKILL`}),t[13]=d):d=t[13];let f;t[14]===l?f=t[15]:(f=(0,W.jsxs)(O,{children:[l,d]}),t[14]=l,t[15]=f);let p;return t[16]!==s||t[17]!==f?(p=(0,W.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[s,f]}),t[16]=s,t[17]=f,t[18]=p):p=t[18],p}var K=e(t(),1),q=k();function Ce(e){let t=(0,U.c)(10),n=M(),r=e===void 0?n?.environmentId??null:e,a=ae(r,i),o;t[0]!==a||t[1]!==r?(o=r===null||!a?null:N.resourceTelemetry({environmentId:r,input:{}}),t[0]=a,t[1]=r,t[2]=o):o=t[2];let s=P(o),c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[3]=c):c=t[3];let l=ce(N.retryResourceTelemetry,c),u;t[4]!==r||t[5]!==l?(u=async()=>{if(r===null)throw Error(`No environment is selected.`);if(!oe(r,`environment:maintain`)||!oe(r,`diagnostics:read`))throw Error(`This connection cannot restart the resource monitor.`);let e=await l({environmentId:r,input:{}});if(e._tag===`Failure`)throw d(e.cause);return e.value.snapshot},t[4]=r,t[5]=l,t[6]=u):u=t[6];let f=u,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,U.c)(4),r=M(),a=t===void 0?r?.environmentId??null:t,o=ae(a,i),s;return n[0]!==o||n[1]!==a||n[2]!==e?(s=a===null||!o?null:N.resourceTelemetryHistory({environmentId:a,input:e}),n[0]=o,n[1]=a,n[2]=e,n[3]=s):s=n[3],P(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`${H(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-t3`: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,U.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=g(`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`,_;t[8]!==h||t[9]!==f||t[10]!==p||t[11]!==m?(_=g(`size-1.5 rounded-full`,f,p,m,h),t[8]=h,t[9]=f,t[10]=p,t[11]=m,t[12]=_):_=t[12];let v;t[13]===_?v=t[14]:(v=(0,W.jsx)(`span`,{className:_}),t[13]=_,t[14]=v);let y=i?.label??r,b;return t[15]!==n||t[16]!==v||t[17]!==y||t[18]!==d?(b=(0,W.jsxs)(`span`,{className:d,children:[v,n,` `,y]}),t[15]=n,t[16]=v,t[17]=y,t[18]=d,t[19]=b):b=t[19],b}function He(e){let t=(0,U.c)(9),{sampledAt:n}=e;if(me(),!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.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=F(_(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,W.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,W.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,W.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,U.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,W.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,W.jsx)(`span`,{className:`truncate`,children:r}),t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,W.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=g(`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,W.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,W.jsx)(`div`,{className:`mt-1.5 truncate text-3xs text-muted-foreground/60`,children:a}):null,t[13]=a,t[14]=h);let _;return t[15]!==u||t[16]!==m||t[17]!==h?(_=(0,W.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]=_):_=t[18],_}function We(e){let t=(0,U.c)(37),{label:n,accentClass:r,aggregate:i}=e,a;t[0]===r?a=t[1]:(a=g(`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,W.jsx)(`span`,{className:a}),t[2]=a,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,W.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,W.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,W.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,W.jsx)(Ge,{label:`CPU`,value:f}),t[14]=f,t[15]=p);let m;t[16]===i.currentRssBytes?m=t[17]:(m=H(i.currentRssBytes),t[16]=i.currentRssBytes,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,W.jsx)(Ge,{label:`Memory`,value:m}),t[18]=m,t[19]=h);let _;t[20]===i.ioReadBytesPerSecond?_=t[21]:(_=ke(i.ioReadBytesPerSecond),t[20]=i.ioReadBytesPerSecond,t[21]=_);let v;t[22]===_?v=t[23]:(v=(0,W.jsx)(Ge,{label:`Read`,value:_}),t[22]=_,t[23]=v);let y;t[24]===i.ioWriteBytesPerSecond?y=t[25]:(y=ke(i.ioWriteBytesPerSecond),t[24]=i.ioWriteBytesPerSecond,t[25]=y);let b;t[26]===y?b=t[27]:(b=(0,W.jsx)(Ge,{label:`Write`,value:y}),t[26]=y,t[27]=b);let x;t[28]!==h||t[29]!==v||t[30]!==b||t[31]!==p?(x=(0,W.jsxs)(`div`,{className:`mt-3.5 grid grid-cols-2 gap-x-4 gap-y-2.5`,children:[p,h,v,b]}),t[28]=h,t[29]=v,t[30]=b,t[31]=p,t[32]=x):x=t[32];let S;return t[33]!==x||t[34]!==o||t[35]!==u?(S=(0,W.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,x]}),t[33]=x,t[34]=o,t[35]=u,t[36]=S):S=t[36],S}function Ge(e){let t=(0,U.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,W.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,W.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,W.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,U.c)(21),{label:n,health:r}=e,i;t[0]!==r.lastError||t[1]!==r.status?(i=r.status===`unavailable`&&a(r.lastError,Ye),t[0]=r.lastError,t[1]=r.status,t[2]=i):i=t[2];let o=i,s;t[3]===n?s=t[4]:(s=(0,W.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:n}),t[3]=n,t[4]=s);let c;t[5]!==o||t[6]!==r.lastError?(c=o?`Available when this page runs inside the desktop app.`:m(r.lastError,{onNone:Je,onSome:qe}),t[5]=o,t[6]=r.lastError,t[7]=c):c=t[7];let l;t[8]===c?l=t[9]:(l=(0,W.jsx)(`div`,{className:`mt-1 text-2xs leading-relaxed text-muted-foreground/65`,children:c}),t[8]=c,t[9]=l);let u;t[10]!==s||t[11]!==l?(u=(0,W.jsxs)(`div`,{className:`min-w-0`,children:[s,l]}),t[10]=s,t[11]=l,t[12]=u):u=t[12];let d;t[13]===o?d=t[14]:(d=o?{label:`Desktop only`,tone:`neutral`}:void 0,t[13]=o,t[14]=d);let f;t[15]!==r.status||t[16]!==d?(f=(0,W.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,W.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,U.c)(10),{label:n,value:r,valueClassName:i}=e,a;t[0]===n?a=t[1]:(a=(0,W.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=g(`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,W.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,W.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,U.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,W.jsx)(L,{"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,W.jsx)(ue,{value:String(e.windowMs),children:e.label},e.windowMs)}function $e(e){let t=(0,U.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,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.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,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.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,W.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,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.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,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsxs)(`div`,{className:`grid h-full min-w-1 flex-1 grid-cols-3 items-end gap-px`,children:[(0,W.jsx)(`span`,{className:`block rounded-t-sm bg-foreground/65`,style:{height:`${n}%`}}),(0,W.jsx)(`span`,{className:`block rounded-t-sm bg-info/70`,style:{height:`${r}%`}}),(0,W.jsx)(`span`,{className:`block rounded-t-sm bg-warning/80`,style:{height:`${i}%`}})]})}),(0,W.jsx)(D,{side:`top`,className:`text-left`,children:(0,W.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,W.jsxs)(`div`,{children:[`CPU avg `,t.avgCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`div`,{children:[`CPU peak `,t.maxCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`div`,{children:[`Read `,H(t.ioReadBytes)]}),(0,W.jsxs)(`div`,{children:[`Write `,H(t.ioWriteBytes)]})]})})]},_(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,W.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,W.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,U.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,W.jsx)(h,{size:`icon-micro`,variant:`ghost-muted`,onClick:()=>i(n),"aria-label":r?`Expand ${o}`:`Collapse ${o}`,children:(0,W.jsx)(E,{className:`size-3.5`,icon:r?q.ChevronRight:q.ChevronDown})}):(0,W.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=g(`size-1.5 rounded-full`,Le(n.category)),t[10]=n.category,t[11]=d);let f;t[12]===d?f=t[13]:(f=(0,W.jsx)(`span`,{className:d}),t[12]=d,t[13]=f);let p;t[14]===o?p=t[15]:(p=(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[14]=o,t[15]=p);let m=n.command||n.name,_;t[16]===m?_=t[17]:(_=(0,W.jsx)(D,{side:`top`,variant:`code`,children:m}),t[16]=m,t[17]=_);let v;t[18]!==p||t[19]!==_?(v=(0,W.jsxs)(O,{children:[p,_]}),t[18]=p,t[19]=_,t[20]=v):v=t[20];let y;return t[21]!==v||t[22]!==l||t[23]!==u||t[24]!==f?(y=(0,W.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,f,v]}),t[21]=v,t[22]=l,t[23]=u,t[24]=f,t[25]=y):y=t[25],y}function nt(e){return e.category===`server-child`||e.category===`provider-root`||e.category===`terminal-root`}function rt(e){let t=(0,U.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,W.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,W.jsx)(G,{disabled:s,onSignal:c}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function it(e){let t=(0,U.c)(22),{processes:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e,[o,s]=(0,K.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,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[20%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[7%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[6%]`}),(0,W.jsx)(`col`,{className:`w-[4%]`})]}),t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,W.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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read/s`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write/s`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read Total`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write Total`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,W.jsx)(tt,{process:e,collapsed:o.has(Ne(e)),onToggle:d})}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Ie(e.category)}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:Ae(e.cpuTimeMs)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:H(e.residentBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:ke(e.ioReadBytesPerSecond)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:ke(e.ioWriteBytesPerSecond)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:H(e.ioReadBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{children:H(e.ioWriteBytes)})}),(0,W.jsx)(D,{side:`top`,children:Re(e.ioSemantics)})]})}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.identity.pid}),(0,W.jsx)(`td`,{className:`px-2 py-2 text-right sm:pr-4`,children:(0,W.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,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(R,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(68vh,48rem)] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[1320px] table-fixed text-left text-xs`,children:[f,p,(0,W.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,U.c)(9),{processes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[7%]`}),(0,W.jsx)(`col`,{className:`w-[5%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,W.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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak CPU`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak Mem`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Samples`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(R,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[28rem] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[1020px] table-fixed text-left text-xs`,children:[r,i,(0,W.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,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.name||e.command})}),(0,W.jsx)(D,{side:`top`,variant:`code`,children:e.command||e.name})]})}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Ie(e.category)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:Ae(e.cpuTimeMs)}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:H(e.peakRssBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:H(e.ioReadBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:H(e.ioWriteBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.sampleCount}),(0,W.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,U.c)(9),{entries:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[22%]`}),(0,W.jsx)(`col`,{className:`w-[28%]`}),(0,W.jsx)(`col`,{className:`w-[14%]`}),(0,W.jsx)(`col`,{className:`w-[14%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[12%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,W.jsx)(`thead`,{className:`border-b border-border/60 text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Component`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Operation`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Read`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Write`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Count`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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,W.jsx)(`div`,{className:`overflow-x-auto border-t border-border/60`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[720px] table-fixed text-left text-xs`,children:[r,i,(0,W.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,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`truncate px-4 py-2 font-medium text-foreground sm:pl-5`,children:e.component}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 text-muted-foreground`,children:e.operation}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:H(e.logicalReadBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:H(e.logicalWriteBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:e.count}),(0,W.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,U.c)(207),{environmentId:n}=e,[r,i]=(0,K.useState)(9e5),a;t[0]===r?a=t[1]:(a=Oe.find(e=>e.windowMs===r)??Oe[1],t[0]=r,t[1]=a);let o=a,u=ae(n,c),d=Ce(n),f=d.retry,p;t[2]!==o.bucketMs||t[3]!==o.windowMs?(p={windowMs:o.windowMs,bucketMs:o.bucketMs},t[2]=o.bucketMs,t[3]=o.windowMs,t[4]=p):p=t[4];let g=we(p,n),_;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_={reportFailure:!1},t[5]=_):_=t[5];let b=ce(N.signalProcess,_),[C,E]=(0,K.useState)(ht),k;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(k=new Set,t[6]=k):k=t[6];let j=(0,K.useRef)(k),M=(0,K.useRef)(n),se,P;t[7]===n?(se=t[8],P=t[9]):(se=()=>(M.current=n,()=>{M.current=null}),P=[n],t[7]=n,t[8]=se,t[9]=P),(0,K.useEffect)(se,P);let[F,le]=(0,K.useState)(!1),I=d.data,L=I?.groups.allT3,ue;t[10]===b?ue=t[11]:(ue=async(e,t)=>{let n=M.current;if(n===null||!oe(n,`environment:maintain`))return;let r=Ne(e);if(j.current.has(r))return;let i=new Set(j.current).add(r);j.current=i,E(i);let a=()=>{let e=new Set(j.current);e.delete(r),j.current=e,E(e)};if(t===`SIGKILL`){let n;try{n=await ie().dialogs.confirm(`Send SIGKILL to process ${e.identity.pid}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){let n=e;a(),A.add({type:`error`,title:`Could not confirm signal`,description:n instanceof Error?n.message:`Failed to send ${t}.`});return}if(!n){a();return}}if(M.current!==n||!oe(n,`environment:maintain`)){a();return}b({environmentId:n,input:{pid:e.identity.pid,startTimeMs:e.identity.startTimeMs,signal:t}}).then(n=>{if(n._tag===`Failure`){if(ne(n))return;throw re(n)}n.value.signaled||A.add({type:`error`,title:`Could not send ${t}`,description:l(n.value.message,()=>`Failed to send ${t} to process ${e.identity.pid}.`)})}).catch(e=>{A.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}).finally(()=>{a()})},t[10]=b,t[11]=ue);let de=ue,R;t[12]===f?R=t[13]:(R=()=>{let e=M.current;e!==null&&oe(e,`environment:maintain`)&&(le(!0),f().catch(mt).finally(()=>{le(!1)}))},t[12]=f,t[13]=R);let fe=R,z,pe,me,he,ge,_e,ye,xe,V,Se,G,q,J,Te,Y,De,Pe,Fe,Ie;if(t[14]!==L||t[15]!==I||t[16]!==d.error||t[17]!==d.isPending||t[18]!==d.refresh){ge=I?s(I.speedLimitPercent):null;let e=I?.health.native.status??null,n;t[38]!==e||t[39]!==d.error?(n=Ee({nativeStatus:e,error:d.error}),t[38]=e,t[39]=d.error,t[40]=n):n=t[40],me=n,he=I!==null&&(I.power.onBattery!==`unknown`||I.power.lowPowerMode!==`unknown`||I.power.idle!==`unknown`||I.power.locked!==`unknown`||I.power.thermalState!==`unknown`),pe=B,De=`Resource monitor`,t[41]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,W.jsx)(v,{className:`size-4 text-muted-foreground`}),t[41]=Pe):Pe=t[41];let r;t[42]===I?r=t[43]:(r=I?(0,W.jsx)(Ve,{label:`Native`,status:I.health.native.status}):null,t[42]=I,t[43]=r);let i=I?.readAt??null,a;t[44]===i?a=t[45]:(a=(0,W.jsx)(He,{sampledAt:i}),t[44]=i,t[45]=a);let o;t[46]===d.isPending?o=t[47]:(o=(0,W.jsx)(be,{size:`xs`,refreshing:d.isPending}),t[46]=d.isPending,t[47]=o);let c;t[48]!==o||t[49]!==d.isPending||t[50]!==d.refresh?(c=(0,W.jsx)(T,{render:(0,W.jsx)(h,{size:`icon-micro`,variant:`ghost`,disabled:d.isPending,onClick:d.refresh,"aria-label":`Refresh resource telemetry`,children:o})}),t[48]=o,t[49]=d.isPending,t[50]=d.refresh,t[51]=c):c=t[51];let l;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,W.jsx)(D,{side:`top`,children:`Refresh telemetry snapshot`}),t[52]=l):l=t[52];let u;t[53]===c?u=t[54]:(u=(0,W.jsxs)(O,{children:[c,l]}),t[53]=c,t[54]=u),t[55]!==r||t[56]!==a||t[57]!==u?(Fe=(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r,a,u]}),t[55]=r,t[56]=a,t[57]=u,t[58]=Fe):Fe=t[58],Te=`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-sm/5`;let f;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:`P4 system footprint`}),(0,W.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]=f):f=t[59];let p;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,W.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),t[60]=p):p=t[60];let m;t[61]===I?m=t[62]:(m=I?Me(I.sampleIntervalMs):`...`,t[61]=I,t[62]=m),t[63]===m?Y=t[64]:(Y=(0,W.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:[f,(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs text-muted-foreground/65`,children:[p,`Sampling every `,m]})]}),t[63]=m,t[64]=Y),xe=`grid grid-cols-2 divide-x divide-y divide-border/55 md:grid-cols-3`;let g;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,W.jsx)(x,{className:`size-3.5`}),t[65]=g):g=t[65];let _;t[66]===L?_=t[67]:(_=L?`${L.currentCpuPercent.toFixed(1)}%`:`...`,t[66]=L,t[67]=_);let y;t[68]===L?y=t[69]:(y=L?`${Ae(L.cpuTimeMs)} observed CPU time`:void 0,t[68]=L,t[69]=y),t[70]!==_||t[71]!==y?(V=(0,W.jsx)(Ue,{icon:g,label:`Current CPU`,value:_,detail:y}),t[70]=_,t[71]=y,t[72]=V):V=t[72];let b;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,W.jsx)(te,{className:`size-3.5`}),t[73]=b):b=t[73];let C;t[74]===L?C=t[75]:(C=L?H(L.currentRssBytes):`...`,t[74]=L,t[75]=C);let w;t[76]===L?w=t[77]:(w=L?`${H(L.peakRssBytes)} combined process peaks`:void 0,t[76]=L,t[77]=w),t[78]!==C||t[79]!==w?(Se=(0,W.jsx)(Ue,{icon:b,label:`Resident memory`,value:C,detail:w}),t[78]=C,t[79]=w,t[80]=Se):Se=t[80];let ne;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,W.jsx)(v,{className:`size-3.5`}),t[81]=ne):ne=t[81];let re=L?String(L.processCount):`...`,E=L?`${L.processStarts} starts · ${L.processExits} exits`:void 0;t[82]!==re||t[83]!==E?(G=(0,W.jsx)(Ue,{icon:ne,label:`Process count`,value:re,detail:E}),t[82]=re,t[83]=E,t[84]=G):G=t[84];let k;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,W.jsx)(ve,{className:`size-3.5`}),t[85]=k):k=t[85];let A;t[86]===L?A=t[87]:(A=L?ke(L.ioReadBytesPerSecond):`...`,t[86]=L,t[87]=A);let j;t[88]===L?j=t[89]:(j=L?`${H(L.ioReadBytes)} observed`:void 0,t[88]=L,t[89]=j),t[90]!==A||t[91]!==j?(q=(0,W.jsx)(Ue,{icon:k,label:`Read throughput`,value:A,detail:j}),t[90]=A,t[91]=j,t[92]=q):q=t[92];let M;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,W.jsx)(S,{className:`size-3.5`}),t[93]=M):M=t[93];let ie;t[94]===L?ie=t[95]:(ie=L?ke(L.ioWriteBytesPerSecond):`...`,t[94]=L,t[95]=ie);let N;t[96]===L?N=t[97]:(N=L?`${H(L.ioWriteBytes)} observed`:void 0,t[96]=L,t[97]=N);let ae=L&&L.ioWriteBytesPerSecond>=10485760?`danger`:L&&L.ioWriteBytesPerSecond>=1048576?`warning`:`default`;t[98]!==ie||t[99]!==N||t[100]!==ae?(J=(0,W.jsx)(Ue,{icon:M,label:`Write throughput`,value:ie,detail:N,tone:ae}),t[98]=ie,t[99]=N,t[100]=ae,t[101]=J):J=t[101],z=Ue,t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,W.jsx)(ee,{className:`size-3.5`}),t[102]=Ie):Ie=t[102],_e=`CPU speed limit`,ye=I?ge===null?`Unknown`:`${ge.toFixed(0)}%`:`...`,t[14]=L,t[15]=I,t[16]=d.error,t[17]=d.isPending,t[18]=d.refresh,t[19]=z,t[20]=pe,t[21]=me,t[22]=he,t[23]=ge,t[24]=_e,t[25]=ye,t[26]=xe,t[27]=V,t[28]=Se,t[29]=G,t[30]=q,t[31]=J,t[32]=Te,t[33]=Y,t[34]=De,t[35]=Pe,t[36]=Fe,t[37]=Ie}else z=t[19],pe=t[20],me=t[21],he=t[22],ge=t[23],_e=t[24],ye=t[25],xe=t[26],V=t[27],Se=t[28],G=t[29],q=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=I?`${I.power.thermalState} thermal state`:void 0,Re=ge!==null&&ge<80?`warning`:`default`,Be;t[103]!==z||t[104]!==_e||t[105]!==ye||t[106]!==Le||t[107]!==Re||t[108]!==Ie?(Be=(0,W.jsx)(z,{icon:Ie,label:_e,value:ye,detail:Le,tone:Re}),t[103]=z,t[104]=_e,t[105]=ye,t[106]=Le,t[107]=Re,t[108]=Ie,t[109]=Be):Be=t[109];let Ge;t[110]!==xe||t[111]!==V||t[112]!==Se||t[113]!==G||t[114]!==q||t[115]!==J||t[116]!==Be?(Ge=(0,W.jsxs)(`div`,{className:xe,children:[V,Se,G,q,J,Be]}),t[110]=xe,t[111]=V,t[112]=Se,t[113]=G,t[114]=q,t[115]=J,t[116]=Be,t[117]=Ge):Ge=t[117];let qe;t[118]===d.error?qe=t[119]:(qe=d.error?(0,W.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,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:d.error})]}):null,t[118]=d.error,t[119]=qe);let Je;t[120]===I?Je=t[121]:(Je=I?(0,W.jsxs)(`div`,{className:`grid border-t border-border/60 bg-muted/10 md:grid-cols-3`,children:[(0,W.jsx)(We,{label:`Backend + agents`,accentClass:`bg-success/80`,aggregate:I.groups.backend}),(0,W.jsx)(We,{label:`Desktop`,accentClass:`bg-info/80`,aggregate:I.groups.electron}),(0,W.jsx)(We,{label:`Monitor overhead`,accentClass:`bg-warning/80`,aggregate:I.groups.monitor})]}):null,t[120]=I,t[121]=Je);let Ye;t[122]!==Te||t[123]!==Y||t[124]!==Ge||t[125]!==qe||t[126]!==Je?(Ye=(0,W.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]!==pe||t[129]!==De||t[130]!==Pe||t[131]!==Fe||t[132]!==Ye?(Qe=(0,W.jsx)(pe,{title:De,icon:Pe,headerAction:Fe,children:Ye}),t[128]=pe,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,W.jsx)(ee,{className:`size-4 text-muted-foreground`}),t[134]=et):et=t[134];let tt;t[135]!==me||t[136]!==F||t[137]!==fe?(tt=me?(0,W.jsxs)(h,{size:`xs`,variant:`outline`,disabled:F,onClick:fe,children:[(0,W.jsx)(be,{size:`xs`,refreshing:F}),`Retry monitor`]}):null,t[135]=me,t[136]=F,t[137]=fe,t[138]=tt):tt=t[138];let nt;t[139]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,W.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,W.jsx)(y,{className:`size-3.5`})}),`Host state`]}),t[139]=nt):nt=t[139];let rt;t[140]!==he||t[141]!==I?(rt=(0,W.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[nt,he&&I?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Xe,{label:`Power source`,value:ze(I.power.onBattery,{true:`Battery`,false:`External power`})}),(0,W.jsx)(Xe,{label:`Low power mode`,value:ze(I.power.lowPowerMode,{true:`Enabled`,false:`Disabled`})}),(0,W.jsx)(Xe,{label:`Idle`,value:`${ze(I.power.idle,{true:`Idle`,false:`Active`})}${I.power.idleSeconds===null?``:` · ${Math.round(I.power.idleSeconds)}s`}`}),(0,W.jsx)(Xe,{label:`Session`,value:I.power.suspended?`Suspended`:ze(I.power.locked,{true:`Locked`,false:`Unlocked`})}),(0,W.jsx)(Xe,{label:`Thermal`,value:I.power.thermalState,valueClassName:I.power.thermalState===`serious`||I.power.thermalState===`critical`?`text-destructive`:void 0})]}):(0,W.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/70 bg-muted/20 px-4 py-5`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Desktop host signals not connected`}),(0,W.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]=he,t[141]=I,t[142]=rt):rt=t[142];let at;t[143]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,W.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,W.jsx)(ee,{className:`size-3.5`})}),`Collection health`]}),t[143]=at):at=t[143];let st;t[144]===I?st=t[145]:(st=(0,W.jsxs)(`div`,{className:`border-t border-border/60 px-4 py-4 md:border-t-0 sm:px-5`,children:[at,I?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Ke,{label:`Native process monitor`,health:I.health.native}),(0,W.jsx)(Ke,{label:`Electron main process`,health:I.health.desktop}),(0,W.jsx)(Xe,{label:`Collection time`,value:je(I.health.collectionDurationMicros)}),(0,W.jsx)(Xe,{label:`Process scan`,value:`${I.health.retainedProcessCount}/${I.health.scannedProcessCount} retained`}),(0,W.jsx)(Xe,{label:`Inaccessible`,value:String(I.health.inaccessibleProcessCount),valueClassName:I.health.inaccessibleProcessCount>0?`text-warning-foreground`:void 0}),(0,W.jsx)(Xe,{label:`Sidecar`,value:m(I.health.sidecarVersion,{onNone:pt,onSome:e=>`${e}${m(I.health.sidecarPid,{onNone:ft,onSome:dt})}`})}),(0,W.jsx)(Xe,{label:`Restarts`,value:String(I.health.restartCount)})]}):(0,W.jsx)(`div`,{className:`py-4 text-xs text-muted-foreground`,children:`Waiting for collector health.`})]}),t[144]=I,t[145]=st);let lt;t[146]!==rt||t[147]!==st?(lt=(0,W.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,W.jsx)(B,{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,W.jsx)(ve,{className:`size-4 text-muted-foreground`}),t[152]=gt):gt=t[152];let _t;t[153]===r?_t=t[154]:(_t=(0,W.jsx)(Ze,{selectedWindowMs:r,onSelect:i}),t[153]=r,t[154]=_t);let vt;t[155]===g.isPending?vt=t[156]:(vt=(0,W.jsx)(be,{size:`xs`,refreshing:g.isPending}),t[155]=g.isPending,t[156]=vt);let yt;t[157]!==g.isPending||t[158]!==g.refresh||t[159]!==vt?(yt=(0,W.jsx)(h,{size:`icon-micro`,variant:`ghost`,disabled:g.isPending,onClick:g.refresh,"aria-label":`Refresh resource history`,children:vt}),t[157]=g.isPending,t[158]=g.refresh,t[159]=vt,t[160]=yt):yt=t[160];let bt;t[161]!==_t||t[162]!==yt?(bt=(0,W.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]===g.error?xt=t[165]:(xt=g.error?(0,W.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,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:g.error})]}):null,t[164]=g.error,t[165]=xt);let X;t[166]===g.data?.buckets?X=t[167]:(X=g.data?.buckets??[],t[166]=g.data?.buckets,t[167]=X);let Z;t[168]===X?Z=t[169]:(Z=(0,W.jsx)($e,{buckets:X}),t[168]=X,t[169]=Z);let St;t[170]===g.data?.topProcesses?St=t[171]:(St=g.data?.topProcesses??[],t[170]=g.data?.topProcesses,t[171]=St);let Ct;t[172]===St?Ct=t[173]:(Ct=(0,W.jsx)(ot,{processes:St}),t[172]=St,t[173]=Ct);let wt;t[174]!==xt||t[175]!==Z||t[176]!==Ct?(wt=(0,W.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,W.jsx)(B,{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,W.jsx)(x,{className:`size-4 text-muted-foreground`}),t[181]=Et):Et=t[181];let Q;t[182]===I?Q=t[183]:(Q=I?(0,W.jsxs)(`span`,{className:`text-3xs text-muted-foreground/55`,children:[`Identity: `,(0,W.jsx)(`span`,{className:`font-mono`,children:`PID + start time`})]}):null,t[182]=I,t[183]=Q);let Dt;t[184]===I?.processes?Dt=t[185]:(Dt=I?.processes??[],t[184]=I?.processes,t[185]=Dt);let $;t[186]!==u||t[187]!==de||t[188]!==C||t[189]!==Dt?($=(0,W.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:(0,W.jsx)(it,{processes:Dt,canMaintainEnvironment:u,signalingKeys:C,onSignal:de})}),t[186]=u,t[187]=de,t[188]=C,t[189]=Dt,t[190]=$):$=t[190];let Ot;t[191]!==Q||t[192]!==$?(Ot=(0,W.jsx)(B,{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,W.jsx)(S,{className:`size-4 text-muted-foreground`}),At=(0,W.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,W.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]===I?.attribution.entries?Mt=t[198]:(Mt=I?.attribution.entries??[],t[197]=I?.attribution.entries,t[198]=Mt);let Nt;t[199]===Mt?Nt=t[200]:(Nt=(0,W.jsx)(B,{title:`Instrumented application I/O`,icon:kt,headerAction:At,children:(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[jt,(0,W.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,W.jsxs)(W.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){A.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,U.c)(3),{environment:t,scope:n}=fe();if(n.kind!==`environment`||!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,W.jsx)(B,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,W.jsx)(Se,{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,W.jsx)(bt,{},t.environmentId),e[1]=t.environmentId,e[2]=r),r}function bt(){let{environment:e}=fe(),t=z(e=>e.observability),[n,r]=(0,K.useState)({}),[i,a]=(0,K.useState)(!1),[s,c]=(0,K.useState)(null),l=e?.environmentId,u=o(N.checkOtlpEndpoint.permissionAtom(l??null)),d=u&&e?.serverConfig?.environment.capabilities.otlpEndpointCheck===!0,[f,p]=(0,K.useState)(()=>Object.fromEntries(gt.filter(({key:e})=>_t(t[e])).map(({key:e})=>[e,{url:t[e],result:null}]))),m=ce(N.updateSettings,{reportFailure:!0}),g=ce(N.checkOtlpEndpoint),_={...t,...n},v=gt.filter(({key:e})=>_[e].trim()!==t[e]),y=v.length>0,b=e?.serverConfig?.observability,x=async(e,t,n)=>{if(!l)return;let r=await g({environmentId:l,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})},S=(e,t,n)=>{_t(n)&&(p(t=>({...t,[e]:{url:n,result:null}})),x(e,t,n))},ee=(0,K.useEffectEvent)(()=>{for(let{key:e,signal:t}of gt){let n=f[e];n?.result===null&&x(e,t,n.url)}});return(0,K.useEffect)(()=>{d&&ee()},[d]),(0,W.jsx)(B,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,W.jsxs)(`form`,{className:`grid gap-4 px-4 py-4 sm:px-5`,onSubmit:async t=>{if(t.preventDefault(),e&&!i){a(!0),c(null);try{(await m({environmentId:e.environmentId,input:{patch:{observability:Object.fromEntries(v.map(({key:e})=>[e,_[e]]))}}}))._tag===`Success`&&(r({}),c(`Saved. Restart the server to apply.`))}finally{a(!1)}}},children:[(0,W.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.`}),!u&&(0,W.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=_[e].trim(),s=d?vt(o,f[e]):null;return(0,W.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[s&&(0,W.jsx)(he,{dotClassName:s.dot}),(0,W.jsxs)(_e,{htmlFor:e,children:[n,` endpoint`]})]}),s&&(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:s.label})]}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(de,{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:_[e],disabled:i||!u,onChange:n=>{let i=n.target.value;r(n=>{let r={...n,[e]:i};return i.trim()===t[e]&&delete r[e],r}),c(null)}}),d&&(0,W.jsx)(h,{type:`button`,size:`sm`,variant:`outline`,disabled:!_t(o)||f[e]?.result===null,onClick:()=>void S(e,a,o),children:`Test`})]}),t[e]!==(b?.[e]??``)&&(0,W.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[`Running: `,b?.[e]||`Disabled`]})]},e)}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:s}),(0,W.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,W.jsx)(h,{type:`button`,size:`xs`,variant:`outline`,disabled:!y||i||!u,onClick:()=>{if(r({}),c(null),d)for(let{key:e,signal:n}of gt)f[e]?.url!==t[e]&&S(e,n,t[e])},children:`Discard`}),(0,W.jsx)(h,{type:`submit`,size:`xs`,disabled:!y||i||!u,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?le(_(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,U.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,W.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,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.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,W.jsx)(C,{className:`size-3`})})}),(0,W.jsx)(D,{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,W.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=g(`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,W.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,W.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,U.c)(6),{children:n}=e,r,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,W.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/2 w-px bg-border/60`,"aria-hidden":!0}),i=(0,W.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,W.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,W.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,W.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,U.c)(2),{label:n}=e,r;return t[0]===n?r=t[1]:(r=(0,W.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,U.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=g(`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,W.jsx)(`colgroup`,{children:n.map((e,t)=>(0,W.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,W.jsx)(`th`,{className:g(`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,W.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,W.jsx)(`tr`,{children:u})}),t[12]=u,t[13]=d);let f;t[14]===r?f=t[15]:(f=(0,W.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,W.jsx)(R,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,W.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,U.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:i,isCopied:a}=j(r),o;t[1]===n?o=t[2]:(o=Tt(n),t[1]=n,t[2]=o);let s;t[3]===o?s=t[4]:(s=(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-2xs`,children:o})}),t[3]=o,t[4]=s);let c;t[5]===n?c=t[6]:(c=(0,W.jsx)(D,{side:`top`,variant:`code`,children:n}),t[5]=n,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,W.jsxs)(O,{children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u=a?`Copied trace ID`:`Copy trace ID`,d;t[10]!==i||t[11]!==n?(d=()=>i(n),t[10]=i,t[11]=n,t[12]=d):d=t[12];let f;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,W.jsx)(b,{className:`size-3`}),t[13]=f):f=t[13];let p;t[14]!==u||t[15]!==d?(p=(0,W.jsx)(T,{render:(0,W.jsx)(h,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":u,onClick:d,children:f})}),t[14]=u,t[15]=d,t[16]=p):p=t[16];let m=a?`Copied`:`Copy full trace ID`,g;t[17]===m?g=t[18]:(g=(0,W.jsx)(D,{side:`top`,children:m}),t[17]=m,t[18]=g);let _;t[19]!==g||t[20]!==p?(_=(0,W.jsxs)(O,{children:[p,g]}),t[19]=g,t[20]=p,t[21]=_):_=t[21];let v;return t[22]!==_||t[23]!==l?(v=(0,W.jsxs)(`div`,{className:`flex w-full min-w-0 max-w-full items-center gap-2`,children:[l,_]}),t[22]=_,t[23]=l,t[24]=v):v=t[24],v}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,U.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,W.jsx)(h,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":r?`Collapse ${o}`:`Expand ${o}`,onClick:()=>i(n.pid),children:(0,W.jsx)(E,{className:`size-3.5`,icon:r?q.ChevronDown:q.ChevronRight})}):(0,W.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,W.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-success/80`}),t[10]=d):d=t[10];let f;t[11]===o?f=t[12]:(f=(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[11]=o,t[12]=f);let p;t[13]===n.command?p=t[14]:(p=(0,W.jsx)(D,{side:`top`,variant:`code`,children:n.command}),t[13]=n.command,t[14]=p);let m;t[15]!==f||t[16]!==p?(m=(0,W.jsxs)(O,{children:[f,p]}),t[15]=f,t[16]=p,t[17]=m):m=t[17];let g;return t[18]!==l||t[19]!==u||t[20]!==m?(g=(0,W.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,m]}),t[18]=l,t[19]=u,t[20]=m,t[21]=g):g=t[21],g}function Nt(e){let t=(0,U.c)(18),{processes:n,canMaintainEnvironment:r,signalingPid:i,onSignal:a,emptyLabel:o}=e,[s,c]=(0,K.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,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[33%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[6%]`})]}),t[4]=p):p=t[4];let m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,W.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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Name`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Type`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,W.jsx)(Mt,{process:e,isExpanded:!s.has(e.pid),onToggle:f})}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:St(e.rssBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,W.jsx)(D,{side:`top`,variant:`code`,children:e.command})]})}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground`,children:e.pid}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 align-middle text-muted-foreground`,children:jt(e)}),(0,W.jsx)(`td`,{className:`p-2 align-middle sm:pr-4`,children:(0,W.jsx)(G,{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,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(R,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[1040px] table-fixed text-left text-xs`,children:[p,m,(0,W.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,U.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,W.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=g(`size-1.5 shrink-0 rounded-full`,u),t[5]=u,t[6]=d);let f;t[7]===d?f=t[8]:(f=(0,W.jsx)(`span`,{className:d}),t[7]=d,t[8]=f);let p;t[9]===a?p=t[10]:(p=(0,W.jsx)(T,{render:(0,W.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,W.jsx)(D,{side:`top`,variant:`code`,children:n.command}),t[11]=n.command,t[12]=m);let h;t[13]!==m||t[14]!==p?(h=(0,W.jsxs)(O,{children:[p,m]}),t[13]=m,t[14]=p,t[15]=h):h=t[15];let _;return t[16]!==h||t[17]!==s||t[18]!==c||t[19]!==f?(_=(0,W.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]=_):_=t[20],_}function zt(e){let t=(0,U.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,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`div`,{className:`flex h-full min-w-1 flex-1 items-end`,children:(0,W.jsxs)(`div`,{className:`relative h-full w-full`,"aria-label":`Average CPU ${e.avgCpuPercent.toFixed(1)}%, peak CPU ${e.maxCpuPercent.toFixed(1)}%`,children:[(0,W.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/15 transition-colors`,style:{height:`${t}%`}}),(0,W.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/60 transition-colors`,style:{height:`${n}%`}})]})})}),(0,W.jsxs)(D,{side:`top`,children:[`Avg `,e.avgCpuPercent.toFixed(1),`%, peak `,e.maxCpuPercent.toFixed(1),`%`]})]},_(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,W.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,W.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,U.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,W.jsx)(L,{"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,W.jsx)(ue,{value:String(e.windowMs),children:e.label},e.windowMs)}function Ut(e){let t=(0,U.c)(13),{processes:n,emptyLabel:r}=e,i=n.reduce(Wt,null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[16%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`})]}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,W.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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Current`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Average`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Max Mem`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,W.jsx)(Rt,{process:e,visualDepth:e.isServerRoot||i===null?0:Math.max(1,e.depth-i+1)})}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:It(e.cpuSecondsApprox)}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.currentCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.avgCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:St(e.maxRssBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,W.jsx)(D,{side:`top`,variant:`code`,children:e.command})]})}),(0,W.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,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(R,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[980px] table-fixed text-left text-xs`,children:[a,o,(0,W.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,U.c)(7),{checkedAt:n}=e;me();let r;t[0]===n?r=t[1]:(r=I(n?_(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,W.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,W.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,W.jsx)(`span`,{className:`text-2xs text-muted-foreground/60`,children:i.suffix?(0,W.jsxs)(W.Fragment,{children:[`Checked `,(0,W.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,W.jsxs)(W.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,U.c)(12),{isPending:n,label:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,W.jsx)(be,{refreshing:n}),t[0]=n,t[1]=a);let o;t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a?(o=(0,W.jsx)(T,{render:(0,W.jsx)(h,{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,W.jsx)(D,{side:`top`,children:r}),t[7]=r,t[8]=s);let c;return t[9]!==o||t[10]!==s?(c=(0,W.jsxs)(O,{children:[o,s]}),t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function qt(){let{environment:e}=fe(),t=e?.environmentId??null,r=ae(t,c),i=e?.serverConfig?.observability,a=e?.serverConfig?.availableEditors,o=ae(t,n),u=P(t===null?null:se.sessionStateAtom(t)),d=xe({connectionPhase:e?.connection.phase??`available`,session:u.data,hasSessionError:u.error!==null}),p=d.canReadDiagnostics,m=ce(N.signalProcess,{reportFailure:!1}),v=ye(t,a??[]),[y,b]=(0,K.useState)(9e5),x=Ft.find(e=>e.windowMs===y)??Ft[1],{data:S,error:ee,isPending:C,refresh:te}=P(t===null||!p?null:N.traceDiagnostics({environmentId:t,input:{}})),{data:E,error:k,isPending:j,refresh:M}=P(t===null||!p?null:N.processDiagnostics({environmentId:t,input:{}})),{data:F,error:le,isPending:I,refresh:L}=P(t===null||!p?null:N.processResourceHistory({environmentId:t,input:{windowMs:x.windowMs,bucketMs:x.bucketMs}})),[ue,de]=(0,K.useState)(!1),[z,me]=(0,K.useState)(null),[he,_e]=(0,K.useState)(null),ve=(0,K.useRef)(null),be=(0,K.useRef)(t),H=(0,K.useRef)(E);(0,K.useEffect)(()=>{H.current=E},[E]),(0,K.useEffect)(()=>(be.current=t,()=>{be.current=null}),[t]);let Se=(0,K.useCallback)(()=>{let e=i?.logsDirectoryPath??null;e&&t!==null&&oe(t,`orchestration:operate`)&&(de(!0),me(null),(async()=>{let t=await v(e);if(de(!1),t._tag===`Failure`&&!ne(t)){let e=re(t);me(e instanceof Error?e.message:`Unable to open logs folder.`)}})())},[t,i?.logsDirectoryPath,v]),U=C&&S===null,G=j&&E===null,q=I&&F===null,[Ce,we]=(0,K.useState)(null);Ce!==t&&p&&!U&&!G&&!q&&we(t);let J=(0,K.useCallback)(async(e,t)=>{let n=be.current,r=H.current?.processes.find(t=>t.pid===e);if(n===null||r===void 0||!oe(n,`environment:maintain`)||ve.current!==null)return;ve.current=e,_e(e);let i=()=>{ve.current=null,_e(null)};if(t===`SIGKILL`){let n=!1;try{n=await ie().dialogs.confirm(`Send SIGKILL to process ${e}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){i(),A.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=be.current;if(a===null||a!==n||!oe(a,`environment:maintain`)){i();return}if(H.current?.processes.find(t=>t.pid===e)?.startTimeMs!==r.startTimeMs){i();return}try{let i=await m({environmentId:n,input:{pid:e,startTimeMs:r.startTimeMs,signal:t}});if(i._tag===`Failure`){if(!ne(i)){let e=re(i);A.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=f(i.value.message);if(M(),Et(e)){A.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}A.add({type:`error`,title:`Could not send ${t}`,description:e??`Failed to send ${t}.`});return}M()}finally{i()}},[M,m]),Te=E?s(E.error):null,Ee=F?s(F.error):null,Y=S?s(S.error):null,De=S?l(S.partialFailure,()=>!1):!1;return p?(0,W.jsxs)(pe,{width:`expanded`,className:`gap-10`,children:[(0,W.jsx)(ut,{environmentId:t}),(0,W.jsxs)(B,{title:`Live Processes`,headerAction:(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(Gt,{checkedAt:E?.readAt??null}),(0,W.jsx)(Kt,{isPending:j,label:`Refresh process diagnostics`,onClick:M})]}),children:[(0,W.jsxs)(Dt,{children:[(0,W.jsx)(Q,{label:`Child Processes`,value:E?X(E.processCount):`...`}),(0,W.jsx)(Q,{label:`CPU`,value:E?`${E.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,W.jsx)(Q,{label:`Memory`,value:E?St(E.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,W.jsx)(Q,{label:`Server PID`,value:E?String(E.serverPid):`...`})]}),Te||k?(0,W.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,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:Te.message})]}):null,k?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:k})]}):null]}):null,(0,W.jsx)(Nt,{processes:E?.processes??[],canMaintainEnvironment:r,signalingPid:he,onSignal:J,emptyLabel:G?`Loading live processes...`:`No live descendant processes found.`})]}),(0,W.jsxs)(B,{title:`Resource History`,headerAction:(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(Vt,{selectedWindowMs:y,onSelect:b}),(0,W.jsx)(Gt,{checkedAt:F?.readAt??null}),(0,W.jsx)(Kt,{isPending:I,label:`Refresh resource history`,onClick:L})]}),children:[(0,W.jsxs)(Dt,{children:[(0,W.jsx)(Q,{label:`CPU Time`,value:F?It(F.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,W.jsx)(Q,{label:`Samples`,value:F?X(F.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,W.jsx)(Q,{label:`Interval`,value:F?F.sampleIntervalMs===0?`On demand`:Z(F.sampleIntervalMs):`...`}),(0,W.jsx)(Q,{label:`Processes`,value:F?X(F.topProcesses.length):`...`})]}),Ee||le?(0,W.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,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:Ee.message})]}):null,le?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:le})]}):null]}):null,(0,W.jsx)(zt,{buckets:F?.buckets??[]}),(0,W.jsx)(Ut,{processes:F?.topProcesses??[],emptyLabel:q?`Collecting process resource samples...`:`No process resource samples found for this window.`})]}),(0,W.jsxs)(B,{title:`Trace Diagnostics`,headerAction:(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(Gt,{checkedAt:S?.readAt??null}),(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(h,{size:`icon-xs`,variant:`ghost-muted`,disabled:!o||!i?.logsDirectoryPath||ue,onClick:Se,"aria-label":`Open logs folder`,children:(0,W.jsx)(ge,{})})}),(0,W.jsx)(D,{side:`top`,children:`Open logs folder`})]}),(0,W.jsx)(Kt,{isPending:C,label:`Refresh trace diagnostics`,onClick:te})]}),children:[(0,W.jsxs)(Dt,{children:[(0,W.jsx)(Q,{label:`Spans`,value:S?X(S.recordCount):`...`}),(0,W.jsx)(Q,{label:`Failures`,value:S?X(S.failureCount):`...`,tone:S&&S.failureCount>0?`danger`:`default`}),(0,W.jsx)(Q,{label:`Slow Spans`,value:S?X(S.slowSpanCount):`...`,tooltip:S?`Spans with a duration of ${Z(S.slowSpanThresholdMs)} or longer.`:`Spans at or above the configured slow-span threshold.`,tone:S&&S.slowSpanCount>0?`warning`:`default`}),(0,W.jsx)(Q,{label:`Parse Errors`,value:S?X(S.parseErrorCount):`...`,tone:S&&S.parseErrorCount>0?`warning`:`default`})]}),z||Y||ee?(0,W.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[z?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:z})]}):null,Y?(0,W.jsxs)(`div`,{className:g(`flex items-start gap-2`,De?`text-warning-foreground`:`text-destructive`),children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:De?`Some trace files could not be read, so diagnostics may be incomplete. ${Y.message}`:Y.message})]}):null,ee?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:ee})]}):null]}):null]}),(0,W.jsx)(B,{title:`Latest Failures`,children:S&&S.latestFailures.length>0?(0,W.jsx)(Ot,{headers:[`Span`,`Cause`,`Duration`,`Ended`],children:S.latestFailures.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,W.jsx)(V,{text:e.cause})}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.durationMs)}),(0,W.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,W.jsx)($,{label:U?`Loading failures...`:`No failed spans found.`})}),(0,W.jsx)(B,{title:`Most Common Failures`,children:S&&S.commonFailures.length>0?(0,W.jsx)(Ot,{headers:[`Span`,`Count`,`Cause`,`Last Seen`],minTableWidth:`min-w-[760px]`,children:S.commonFailures.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:X(e.count)}),(0,W.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,W.jsx)(V,{text:e.cause})}),(0,W.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,W.jsx)($,{label:U?`Loading failure groups...`:`No repeated failures found.`})}),(0,W.jsx)(B,{title:`Slowest Spans`,children:S&&S.slowestSpans.length>0?(0,W.jsx)(Ot,{headers:[`Span`,`Duration`,`Ended`,`Trace`],minTableWidth:`min-w-[900px]`,columnWidths:[`w-[44%]`,`w-[14%]`,`w-[12%]`,`w-[30%]`],children:S.slowestSpans.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.durationMs)}),(0,W.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,W.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground last:sm:pr-5`,children:(0,W.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}`))}):(0,W.jsx)($,{label:U?`Loading slow spans...`:`No spans found.`})}),(0,W.jsx)(B,{title:`Span Logs`,children:S&&S.latestWarningAndErrorLogs.length>0?(0,W.jsx)(R,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[920px] table-fixed text-left text-xs`,children:[(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[26%]`}),(0,W.jsx)(`col`,{className:`w-[30%]`})]}),(0,W.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pl-5`,children:`Time`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Level`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Span`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Message`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pr-5`,children:`Trace`})]})}),(0,W.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:S.latestWarningAndErrorLogs.map(e=>(0,W.jsxs)(`tr`,{className:`hover:bg-muted/15`,children:[(0,W.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,W.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,W.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,W.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,W.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:e.spanName})}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-muted-foreground`,children:(0,W.jsx)(V,{collapsedClassName:`line-clamp-2`,expandLabel:`Show full message`,text:e.message})}),(0,W.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground sm:pr-5`,children:(0,W.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}:${_(e.seenAt)}:${e.message}`))})]})}):(0,W.jsx)($,{label:U?`Loading recent logs...`:`No warnings or errors found.`})}),(0,W.jsx)(B,{title:`Top Span Names`,children:S&&S.topSpansByCount.length>0?(0,W.jsx)(Ot,{headers:[`Span`,`Count`,`Failures`,`Average`,`Max`],minTableWidth:`min-w-[760px]`,columnWidths:[`w-[48%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`],children:S.topSpansByCount.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:X(e.count)}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:X(e.failureCount)}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.averageDurationMs)}),(0,W.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,W.jsx)($,{label:U?`Loading span names...`:`No spans found.`})}),Ce===t&&(0,W.jsx)(yt,{})]}):(0,W.jsx)(pe,{children:(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t===null?`Connect an environment to see diagnostics.`:d.isPending?`Checking diagnostics access…`:d.error})})}var Jt=qt;export{Jt as component};
2
+ //# sourceMappingURL=settings.diagnostics-CBcOEqPM.js.map
@@ -0,0 +1,2 @@
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{Ax as t,ha as n}from"./utils-DmfMX1v5.js";import{r}from"./SettingsPanels-CI-FknGh.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-BOmr4mSV.js.map
@@ -0,0 +1,2 @@
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ax as n,Bc as r,Dl as i,Du as a,El as o,Gn as s,If as c,Jn as l,Ou as u,Tu as d,Wn as f,Xl as p,Yl as m,Yn as h,Zn as g,bh as _,cr as v,cy as y,eu as b,ha as x,ku as S,l as C,nu as w,nx as T,or as E,pu as D,qn as O,sr as k,t as A,tr as j,yl as M,zc as N}from"./utils-DmfMX1v5.js";import{t as P}from"./arrow-down-DvRecXuy.js";import{t as F}from"./check-Cmy7pM2Y.js";import{t as I}from"./ellipsis-vertical-fYTS1grT.js";import{t as L}from"./minus-C7W28oE7.js";import{t as ee}from"./monitor-Ddj8MK6z.js";import{t as R}from"./plus-Cr075-cy.js";import{t as z}from"./x-CSwbgjBe.js";import{U as te}from"./runtime-BQJQC-Ny.js";import{w as ne}from"./entities-82m-Smm-.js";import{a as B,n as re,t as ie}from"./tooltip-taOyJZax.js";import{a as V,r as ae,t as oe}from"./number-field-CVtwAsLe.js";import{a as H,c as U,i as se,o as W,r as ce,s as G,t as K}from"./select-B4VvMEs2.js";import{t as le}from"./spinner-I_NrXl2i.js";import{i as q}from"./toast-CjelgyqV.js";import{D as ue,E as de,J as fe,c as pe,o as me,r as he,s as J,x as Y}from"./useSettings-CLtJrOYI.js";import{f as ge}from"./server-BD_Y5Gsn.js";import{i as _e,n as ve}from"./session-DsbInyNV.js";import{t as ye}from"./use-atom-command-CQHjSXPR.js";import{t as be}from"./env-wK1YYxA8.js";import{t as xe}from"./input-Cd_0h7h_.js";import{a as Se,c as Ce,i as we,n as Te,o as Ee,r as De,s as Oe,t as ke}from"./dialog-Bn1u_Xoc.js";import{i as Ae,t as je}from"./device-C_oIGJqy.js";import{a as Me,c as Ne,i as Pe,n as Fe,o as Ie,s as Le,t as Re}from"./DeviceSetup-DemgUuG-.js";import{t as ze}from"./AnimatedHeight-DoG4b7y8.js";import{i as Be,n as Ve}from"./Icons-DA4msgfR.js";import{t as He}from"./preview-CEMnbqVB.js";import{a as Ue,i as We,o as Ge,t as Ke}from"./popover-CKyetthu.js";import{B as qe,C as Je,L as Ye,P as Xe,a as X,c as Ze,i as Qe,r as $e,s as et}from"./settingsLayout-jP1a50ek.js";import{Ar as tt,Fr as nt,Ir as rt,La as it,Mr as at,Nr as ot,Po as st,Pr as ct,aa as lt,fa as ut,gs as dt,ia as ft,ir as pt,jr as mt}from"./main-BB3F4O6Y.js";import{t as ht}from"./ProjectDefaultsSettings-C6wxaRmJ.js";import{t as gt}from"./draft-input-D8eUYug0.js";import{t as _t}from"./ScopedSwitch-DsEcG6rk.js";import{n as vt,r as yt,t as bt}from"./usePermissionStatus-Zbsv_90x.js";var Z=n(),Q=e(x(),1);function xt(e){let t=(0,Z.c)(27),{tools:n,action:r,kind:i,owner:a,error:o}=e,s=i?n?.[i]:void 0,c;t[0]===s?c=t[1]:(c=s?.runningVersion??(s?.installedVersions.includes(s.requiredVersion)?s.requiredVersion:s?.installedVersions.toSorted(St).at(-1)),t[0]=s,t[1]=c);let l=c,u=i===`hub`?`Device hub`:`Agent device`,d=i?`${u}: ${l?`version ${l}`:s?`not installed`:`version unknown`}. Show details`:void 0,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(v,{tone:`muted`}),t[2]=f):f=t[2];let p=i?l?`v${l}`:s?`Not installed`:`Version unknown`:o?`Versions unavailable`:`Versions`,m;t[3]!==d||t[4]!==p?(m=(0,Q.jsx)(Ge,{"aria-label":d,render:f,children:p}),t[3]=d,t[4]=p,t[5]=m):m=t[5];let h=i?u:`Device tools`,g;t[6]===h?g=t[7]:(g=(0,Q.jsx)(Ue,{children:h}),t[6]=h,t[7]=g);let _;t[8]!==i||t[9]!==u||t[10]!==n?(_=n?(0,Q.jsx)(`div`,{className:`mt-4 divide-y divide-border/50`,children:[[`Device hub`,n.hub],[`Agent device`,n.agent]].filter(e=>{let[t]=e;return!i||t===u}).map(e=>{let[t,n]=e;return(0,Q.jsxs)(`div`,{className:`space-y-2 py-3 first:pt-0 last:pb-0`,children:[i?null:(0,Q.jsx)(`p`,{className:`text-xs font-medium`,children:t}),(0,Q.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-6 gap-y-1 text-xs`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Running`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono`,children:n.runningVersion??`Not running`}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Required`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono`,children:n.requiredVersion}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Installed`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono break-words`,children:n.installedVersions.join(`, `)||`None`})]})]},t)})}):(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Versions have not been checked.`}),t[8]=i,t[9]=u,t[10]=n,t[11]=_):_=t[11];let y=a?`Managed by ${a}. `:``,b;t[12]===y?b=t[13]:(b=(0,Q.jsxs)(`p`,{className:`mt-4 border-t border-border/50 pt-3 text-xs text-muted-foreground`,children:[y,`Tools update automatically on this host when needed.`]}),t[12]=y,t[13]=b);let x;t[14]===o?x=t[15]:(x=o?(0,Q.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-destructive`,children:o}):null,t[14]=o,t[15]=x);let S;t[16]===r?S=t[17]:(S=r?(0,Q.jsx)(`div`,{className:`mt-3`,children:r}):null,t[16]=r,t[17]=S);let C;t[18]!==b||t[19]!==x||t[20]!==S||t[21]!==g||t[22]!==_?(C=(0,Q.jsxs)(We,{align:`end`,width:`md`,children:[g,_,b,x,S]}),t[18]=b,t[19]=x,t[20]=S,t[21]=g,t[22]=_,t[23]=C):C=t[23];let w;return t[24]!==C||t[25]!==m?(w=(0,Q.jsxs)(Ke,{children:[m,C]}),t[24]=C,t[25]=m,t[26]=w):w=t[26],w}function St(e,t){return e.localeCompare(t,void 0,{numeric:!0})}var $=e(t(),1);function Ct(e,t,n,r=t){let i=(e,t)=>e.target===t.target&&e.port===t.port&&e.identityFile===t.identityFile,a=t=>{let n=e.filter(e=>i(e,t));if(n.length>1)throw Error(`Multiple hosts match this SSH destination. Select the environment to edit its hosts.`);return n[0]},o=e.find(e=>e.id===r.id)??a(r)??(n?void 0:a(t));return n?e.filter(e=>e.id!==o?.id):o?e.map(e=>e.id===o.id?{...t,id:o.id}:e):[...e,t]}function wt(e){let t=(0,Z.c)(4),{platforms:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Tt),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:r}),t[2]=r,t[3]=i),i}function Tt(e){return(0,Q.jsxs)(ie,{children:[(0,Q.jsxs)(B,{render:(0,Q.jsx)(`span`,{tabIndex:0,className:`inline-flex items-center gap-1`}),children:[e.available?(0,Q.jsx)(F,{className:`size-3`}):(0,Q.jsx)(L,{className:`size-3`}),e.platform===`ios`?`iOS`:`Android`,` `,e.available?`available`:`unavailable`]}),(0,Q.jsx)(re,{children:e.reason??(e.platform===`ios`?`iOS available`:`Android available`)})]},e.platform)}var Et=_(D);function Dt(e){let{identityFile:t,...n}=e;return Et({...n,...t?.trim()?{identityFile:t.trim()}:{}})}function Ot(e){return JSON.stringify([e.target.trim(),e.port,e.identityFile?.trim()||void 0])}async function kt(e,t,n,r){await Promise.all(e.map(async e=>{r(e.environmentId,{status:`pending`});try{if(!e.connected)throw Error(`Environment disconnected`);let i=await n(e.environmentId,t);r(e.environmentId,i.kind===`local`?{status:`local`}:{status:`connected`,platforms:i.platforms,...i.tools?{tools:i.tools}:{}})}catch(t){r(e.environmentId,{status:`failed`,error:t instanceof Error?t.message:String(t)})}}))}function At(e){let t=ye(je.testHost,{reportFailure:!1}),[n,r]=(0,$.useState)({}),i=(0,$.useRef)(new Set);return{checks:n,testConnection:async n=>{let a=Ot(n);if(i.current.has(a))return;i.current.add(a),r(e=>({...e,[a]:{}}));let o={};try{return await kt(e,n,async(e,n)=>{if(!ve(e,`settings:write`))throw Error(`This connection cannot test device hosts.`);let r=await t({environmentId:e,input:n});if(r._tag===`Failure`)throw Error(y(r.cause));return r.value},(e,t)=>{o[e]=t,r(n=>({...n,[a]:{...n[a],[e]:t}}))}),o}finally{i.current.delete(a)}}}}function jt(e){let t=(0,Z.c)(107),{host:n,isNew:r,targets:i,busy:a,onSave:o,onClose:s}=e,[c,l]=(0,$.useState)(n),{checks:u,testConnection:d}=At(i),f=u[Ot(c)],p=Object.values(f??{}).some(Nt),m,h;t[0]===c?(m=t[1],h=t[2]):(m=Dt({...c,label:c.label.trim()||c.target}),h=T(m),t[0]=c,t[1]=m,t[2]=h);let g=h,_;t[3]===f?_=t[4]:(_=Object.values(f??{}).filter(Mt),t[3]=f,t[4]=_);let v=_.length,y;t[5]!==a||t[6]!==s?(y=e=>{!e&&!a&&s()},t[5]=a,t[6]=s,t[7]=y):y=t[7];let b=!a,x;t[8]!==a||t[9]!==p||t[10]!==c.label||t[11]!==m||t[12]!==o?(x=(0,Q.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),T(m)&&c.label.trim()&&!a&&!p&&o(m.value)}}),t[8]=a,t[9]=p,t[10]=c.label,t[11]=m,t[12]=o,t[13]=x):x=t[13];let S=r?`Add device host`:`Edit device host`,C;t[14]===S?C=t[15]:(C=(0,Q.jsx)(Ce,{children:S}),t[14]=S,t[15]=C);let w=i.length===1?`Connect from ${i[0]?.label}.`:`Connect from ${i.length} selected environments.`,E;t[16]===w?E=t[17]:(E=(0,Q.jsxs)(De,{children:[w,` `,`Hosts on the same machine are skipped.`]}),t[16]=w,t[17]=E);let D;t[18]!==C||t[19]!==E?(D=(0,Q.jsxs)(Se,{children:[C,E]}),t[18]=C,t[19]=E,t[20]=D):D=t[20];let O;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(`span`,{children:`Name`}),t[21]=O):O=t[21];let A;t[22]===c?A=t[23]:(A=e=>l({...c,label:e.target.value}),t[22]=c,t[23]=A);let j;t[24]!==a||t[25]!==c.label||t[26]!==A?(j=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[O,(0,Q.jsx)(xe,{autoFocus:!0,required:!0,value:c.label,disabled:a,onChange:A,placeholder:`Mac mini`})]}),t[24]=a,t[25]=c.label,t[26]=A,t[27]=j):j=t[27];let M;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(`span`,{children:`SSH target`}),t[28]=M):M=t[28];let N;t[29]===c?N=t[30]:(N=e=>l({...c,target:e.target.value}),t[29]=c,t[30]=N);let P;t[31]!==a||t[32]!==c.target||t[33]!==N?(P=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[M,(0,Q.jsx)(xe,{required:!0,value:c.target,disabled:a,onChange:N,placeholder:`user@host or SSH alias`})]}),t[31]=a,t[32]=c.target,t[33]=N,t[34]=P):P=t[34];let I=n.port!==void 0||n.identityFile!==void 0||void 0,L;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`SSH options`}),t[35]=L):L=t[35];let R;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(`span`,{children:`Identity file`}),t[36]=R):R=t[36];let te=c.identityFile??``,ne;t[37]===c?ne=t[38]:(ne=e=>{let{identityFile:t,...n}=c;l(e.target.value?{...n,identityFile:e.target.value}:n)},t[37]=c,t[38]=ne);let B;t[39]!==a||t[40]!==te||t[41]!==ne?(B=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[R,(0,Q.jsx)(xe,{value:te,disabled:a,onChange:ne,placeholder:`SSH config default`})]}),t[39]=a,t[40]=te,t[41]=ne,t[42]=B):B=t[42];let re;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Q.jsx)(`span`,{children:`Port`}),t[43]=re):re=t[43];let ie=c.port??``,V;t[44]===c?V=t[45]:(V=e=>{let{port:t,...n}=c;l(e.target.value?{...n,port:Number(e.target.value)}:n)},t[44]=c,t[45]=V);let ae;t[46]!==a||t[47]!==ie||t[48]!==V?(ae=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[re,(0,Q.jsx)(xe,{type:`number`,min:1,max:65535,value:ie,disabled:a,onChange:V,placeholder:`Default`})]}),t[46]=a,t[47]=ie,t[48]=V,t[49]=ae):ae=t[49];let oe;t[50]!==B||t[51]!==ae?(oe=(0,Q.jsxs)(`div`,{className:`mt-3 grid grid-cols-[minmax(0,1fr)_7rem] gap-3`,children:[B,ae]}),t[50]=B,t[51]=ae,t[52]=oe):oe=t[52];let H;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Optional. Resolved separately on each environment.`}),t[53]=H):H=t[53];let U;t[54]!==I||t[55]!==oe?(U=(0,Q.jsxs)(`details`,{open:I,className:`text-sm`,children:[L,oe,H]}),t[54]=I,t[55]=oe,t[56]=U):U=t[56];let se=p?`Checking environments…`:f?v?`${v} of ${i.length} failed`:`Connection checks passed`:`Check access before saving`,W;t[57]===se?W=t[58]:(W=(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:se}),t[57]=se,t[58]=W);let ce=a||p||!g,G;t[59]!==m||t[60]!==d?(G=()=>{T(m)&&d(m.value)},t[59]=m,t[60]=d,t[61]=G):G=t[61];let K;t[62]===p?K=t[63]:(K=p?(0,Q.jsx)(le,{size:`xs`}):null,t[62]=p,t[63]=K);let q;t[64]!==ce||t[65]!==G||t[66]!==K?(q=(0,Q.jsxs)(k,{type:`button`,size:`sm`,variant:`outline`,disabled:ce,onClick:G,children:[K,` Test connection`]}),t[64]=ce,t[65]=G,t[66]=K,t[67]=q):q=t[67];let ue;t[68]!==W||t[69]!==q?(ue=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,children:[W,q]}),t[68]=W,t[69]=q,t[70]=ue):ue=t[70];let de;t[71]!==f||t[72]!==i?(de=f?(0,Q.jsx)(`ul`,{className:`border-t border-border/60 divide-y divide-border/40`,children:i.map(e=>{let t=f[e.environmentId];return t?(0,Q.jsxs)(`li`,{className:`px-3 py-2.5 text-xs`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`truncate font-medium`,children:e.label}),(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5 ${t.status===`failed`?`text-destructive`:`text-muted-foreground`}`,children:t.status===`pending`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(le,{size:`xs`}),` Checking…`]}):t.status===`local`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ee,{className:`size-3`}),` Already available locally`]}):t.status===`failed`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(z,{className:`size-3`}),` Failed`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{className:`size-3`}),` Connected`]})})]}),t.status===`connected`?(0,Q.jsx)(`div`,{className:`mt-1.5`,children:(0,Q.jsx)(wt,{platforms:t.platforms})}):null,t.status===`failed`?(0,Q.jsxs)(`details`,{className:`mt-1.5 text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Show error`}),(0,Q.jsx)(`p`,{className:`mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words`,children:t.error})]}):null]},e.environmentId):null})}):null,t[71]=f,t[72]=i,t[73]=de):de=t[73];let fe;t[74]!==ue||t[75]!==de?(fe=(0,Q.jsxs)(`div`,{className:`rounded-lg border border-border/60`,children:[ue,de]}),t[74]=ue,t[75]=de,t[76]=fe):fe=t[76];let pe;t[77]!==j||t[78]!==P||t[79]!==U||t[80]!==fe?(pe=(0,Q.jsxs)(Ee,{children:[j,P,U,fe]}),t[77]=j,t[78]=P,t[79]=U,t[80]=fe,t[81]=pe):pe=t[81];let me;t[82]!==a||t[83]!==s?(me=(0,Q.jsx)(k,{type:`button`,variant:`ghost`,disabled:a,onClick:s,children:`Cancel`}),t[82]=a,t[83]=s,t[84]=me):me=t[84];let he;t[85]!==a||t[86]!==p||t[87]!==c.label||t[88]!==g?(he=a||p||!g||!c.label.trim(),t[85]=a,t[86]=p,t[87]=c.label,t[88]=g,t[89]=he):he=t[89];let J;t[90]===a?J=t[91]:(J=a?(0,Q.jsx)(le,{size:`xs`}):null,t[90]=a,t[91]=J);let Y;t[92]!==he||t[93]!==J?(Y=(0,Q.jsxs)(k,{type:`submit`,disabled:he,children:[J,` Save host`]}),t[92]=he,t[93]=J,t[94]=Y):Y=t[94];let ge;t[95]!==me||t[96]!==Y?(ge=(0,Q.jsxs)(we,{children:[me,Y]}),t[95]=me,t[96]=Y,t[97]=ge):ge=t[97];let _e;t[98]!==D||t[99]!==pe||t[100]!==b||t[101]!==ge||t[102]!==x?(_e=(0,Q.jsxs)(Oe,{showCloseButton:b,render:x,children:[D,pe,ge]}),t[98]=D,t[99]=pe,t[100]=b,t[101]=ge,t[102]=x,t[103]=_e):_e=t[103];let ve;return t[104]!==y||t[105]!==_e?(ve=(0,Q.jsx)(ke,{open:!0,onOpenChange:y,children:_e}),t[104]=y,t[105]=_e,t[106]=ve):ve=t[106],ve}function Mt(e){return e.status===`failed`}function Nt(e){return e.status===`pending`}function Pt(e){let{scope:t,environments:n,connectedEnvironments:r}=qe(),i=_e(e.environmentId,c),a=t.kind===`project`||t.kind===`checkout`,o=ye(ge.updateSettings,{reportFailure:!1}),[s,l]=(0,$.useState)(null),[u,d]=(0,$.useState)(null),[f,p]=(0,$.useState)(!1),m=n.map(e=>({environmentId:e.environmentId,label:e.label,connected:e.connection.phase===`connected`})),{checks:h,testConnection:g}=At(m),_=async(t,r=!1,i=t)=>{if(e.environmentId&&!a){p(!0);try{let e=await Promise.allSettled(n.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!ve(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return o({environmentId:e.environmentId,input:{patch:{deviceHosts:Ct(e.serverConfig.settings.deviceHosts,t,r,i)}}})})),a=n.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});a.length===0?l(null):q.add({type:`error`,title:`Device hosts not saved on all environments`,description:`Could not update ${a.map(e=>e.label).join(`, `)}.`})}finally{p(!1)}}};return(0,Q.jsx)(X,{id:`device-hosts`,title:`Device hosts`,serverScoped:!0,settingKeys:[`deviceHosts`],description:`Add remote machines with simulator or emulator runtimes installed, and the selected environments will connect over SSH and set up device tools automatically.`,control:(0,Q.jsxs)(k,{size:`sm`,variant:`outline`,disabled:!i||a||f||!e.environmentId||s!==null,onClick:()=>{d(null),l({id:C(),label:``,target:``})},children:[(0,Q.jsx)(R,{className:`size-3.5`}),` Add host`]}),children:(0,Q.jsx)(`div`,{className:`pt-3 pb-2`,children:e.environmentId?(0,Q.jsxs)(Q.Fragment,{children:[r.map(e=>(0,Q.jsxs)(`div`,{children:[r.length>1?(0,Q.jsx)(`p`,{className:`pt-3 pb-1 text-xs font-medium text-muted-foreground`,children:e.label}):null,(0,Q.jsx)(Ft,{environmentLabel:e.label,environmentId:e.environmentId,hosts:e.serverConfig?.settings.deviceHosts??[],busy:!i||a||f,checks:h,testConnection:async e=>{let t=await g(e);if(!t)return;let n=m.filter(e=>t[e.environmentId]?.status===`failed`);return q.add({type:n.length?`error`:`success`,title:n.length?`${e.label}: ${n.length} of ${m.length} environments failed`:`${e.label}: connection checks passed`,description:n.length?`Could not connect from ${n.map(e=>e.label).join(`, `)}.`:`Connected or already available locally on each selected environment.`}),t},onEdit:e=>{d(e),l(e)},onRemove:e=>void _(e,!0)})]},e.environmentId)),s?(0,Q.jsx)(jt,{host:s,isNew:u===null,targets:m,busy:f,onSave:e=>void _(e,!1,u??e),onClose:()=>l(null)},s.id):null]}):(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect a selected environment to manage device hosts.`})})})}function Ft(e){let t=(0,Z.c)(28),{environmentLabel:n,environmentId:r,hosts:i,busy:a,onEdit:o,onRemove:c,checks:l,testConnection:u}=e,{state:d}=Ae(r),f=ye(je.list),[p,m]=(0,$.useState)(null),_;t[0]===i.length?_=t[1]:(_=i.length===0?(0,Q.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:`No device hosts.`}):null,t[0]=i.length,t[1]=_);let v;if(t[2]!==a||t[3]!==l||t[4]!==r||t[5]!==n||t[6]!==i||t[7]!==o||t[8]!==c||t[9]!==f||t[10]!==p||t[11]!==d||t[12]!==u){let e;t[14]!==a||t[15]!==l||t[16]!==r||t[17]!==n||t[18]!==o||t[19]!==c||t[20]!==f||t[21]!==p||t[22]!==d||t[23]!==u?(e=e=>{let t=d.hostStatuses[e.id],i=l[Ot(e)]?.[r],_=(i?.status===`connected`?i.platforms:void 0)??d.hosts.find(t=>t.id===e.id)?.platforms??[],v=i?.status===`pending`?`Checking connection…`:t?.status===`installing`?`Installing device support…`:t?.status===`starting`?`Connecting…`:null,y=i?.status===`failed`?i.error:i?.status===`local`?void 0:t?.status===`failed`?t.detail:void 0;return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border/50 py-2.5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.label}),_.filter(Lt).map(It)]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.target}),(0,Q.jsx)(xt,{owner:n,error:d.hosts.find(t=>t.id===e.id)?.toolInspectionError,tools:d.hosts.find(t=>t.id===e.id)?.tools??(i?.status===`connected`?i.tools:void 0)}),i?.status===`local`?(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Already available locally`}):null,y?(0,Q.jsx)(`div`,{className:`mt-1`,role:`status`,children:(0,Q.jsxs)(`details`,{className:`text-xs text-destructive`,children:[(0,Q.jsx)(`summary`,{children:`Connection failed`}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words`,children:y})]})}):null]}),v?(0,Q.jsxs)(`span`,{role:`status`,className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(le,{size:`xs`}),v]}):null,(0,Q.jsxs)(s,{children:[(0,Q.jsx)(E,{render:(0,Q.jsx)(k,{size:`icon-sm`,variant:`ghost-muted`,disabled:a,"aria-label":e.label+` options`}),children:(0,Q.jsx)(I,{})}),(0,Q.jsxs)(g,{align:`end`,children:[(0,Q.jsx)(h,{onClick:()=>{o(e)},children:`Edit`}),(0,Q.jsx)(h,{variant:`destructive`,onClick:()=>c(e),children:`Remove`})]})]}),t?.status===`failed`&&d.supportsHostRetry&&d.hostStatus!==`disabled`?(0,Q.jsx)(k,{size:`sm`,variant:`outline`,disabled:a||p!==null,onClick:()=>{m(e.id),f({environmentId:r,input:{retryHostId:e.id}}).finally(()=>m(null))},children:p===e.id?`Retrying…`:`Retry`}):(0,Q.jsx)(k,{size:`sm`,variant:`outline`,disabled:a||v!==null,onClick:()=>void u(e),children:`Test connection`})]},e.id)},t[14]=a,t[15]=l,t[16]=r,t[17]=n,t[18]=o,t[19]=c,t[20]=f,t[21]=p,t[22]=d,t[23]=u,t[24]=e):e=t[24],v=i.map(e),t[2]=a,t[3]=l,t[4]=r,t[5]=n,t[6]=i,t[7]=o,t[8]=c,t[9]=f,t[10]=p,t[11]=d,t[12]=u,t[13]=v}else v=t[13];let y;return t[25]!==_||t[26]!==v?(y=(0,Q.jsxs)(Q.Fragment,{children:[_,v]}),t[25]=_,t[26]=v,t[27]=y):y=t[27],y}function It(e){return(0,Q.jsxs)(ie,{children:[(0,Q.jsx)(B,{render:(0,Q.jsx)(`span`,{tabIndex:0,role:`img`,"aria-label":e.platform===`ios`?`iOS available`:`Android available`,className:`shrink-0 text-muted-foreground`}),children:e.platform===`ios`?(0,Q.jsx)(Be,{className:`size-3.5 -translate-y-px`}):(0,Q.jsx)(Ve,{className:`size-3.5`})}),(0,Q.jsx)(re,{children:e.platform===`ios`?`iOS available`:`Android available`})]},e.platform)}function Lt(e){return e.available}function Rt(e,t){if(e)return{kind:`new`};let n=t[0];return n?{kind:`existing`,profileId:n.id}:{kind:`new`}}function zt(e,t,n){if(e.kind===`new`)return{kind:`new`,profileId:t};let r=n.find(t=>t.id===e.profileId);if(r!==void 0)return{kind:`existing`,profileId:e.profileId,name:r.name}}function Bt(e){return e.step!==`importing`}function Vt(e){return e.unavailable===`browserRunning`?{step:`quit`}:e.unavailable===`needsFullDiskAccess`?{step:`fullDiskAccess`,resume:`configure`}:e.unavailable===void 0?e.profiles.length===0?{step:`blocked`,reason:`unknownSourceProfile`}:{step:`configure`}:{step:`blocked`,reason:e.unavailable}}function Ht(e){return e.kind===`imported`?{step:`done`,imported:e.imported,skipped:e.skipped,skippedDomains:e.skippedDomains,targetName:e.targetName}:e.reason===`browserRunning`?{step:`quit`}:e.reason===`needsFullDiskAccess`?{step:`fullDiskAccess`,resume:`import`,checked:!0}:{step:`blocked`,reason:e.reason}}function Ut(e){return e===void 0?{step:`blocked`,reason:`unknownSource`}:Vt(e)}function Wt(e){let t=Ut(e);return t.step===`fullDiskAccess`?{...t,checked:!0}:t}function Gt(e,t){return t.profiles.some(t=>t.directory===e)?e:t.profiles[0]?.directory??``}function Kt(e){switch(e){case`needsKeychainApproval`:case`keychainItemMissing`:case`keychainUnavailable`:case`readFailed`:case`sessionUnavailable`:case`profileNotSaved`:return!0;default:return!1}}function qt(e){return e.length===0?``:e.length===1?e[0]:e.length<=3?`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`:`${e.slice(0,3).join(`, `)} and ${e.length-3} more`}function Jt(e){let t=(0,Z.c)(46),{source:n,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,onImport:o,onRefreshSource:s,onOpenFullDiskAccessSettings:c,onCheckFullDiskAccess:l,onClose:u}=e,[d,f]=(0,$.useState)(n),p;t[0]===n?p=t[1]:(p=()=>Vt(n),t[0]=n,t[1]=p);let[m,h]=(0,$.useState)(p),g;t[2]===n.profiles[0]?.directory?g=t[3]:(g=()=>n.profiles[0]?.directory??``,t[2]=n.profiles[0]?.directory,t[3]=g);let[_,v]=(0,$.useState)(g),y;t[4]!==a||t[5]!==i?(y=()=>Rt(a,i),t[4]=a,t[5]=i,t[6]=y):y=t[6];let[b,x]=(0,$.useState)(y),[S,w]=(0,$.useState)(),T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=C(),t[7]=T):T=t[7];let E=(0,$.useRef)(`profile-${T}`),D=(0,$.useRef)(!1),O;t[8]!==o||t[9]!==_||t[10]!==b||t[11]!==i?(O=()=>{if(D.current)return;let e=zt(b,E.current,i);if(e===void 0){w(`That profile is no longer available. Choose where to import these cookies.`),h({step:`configure`});return}w(void 0),D.current=!0,h({step:`importing`}),o({sourceProfileDirectory:_,target:e}).then(e=>h(Ht(e))).catch(()=>h({step:`blocked`,reason:`readFailed`})).finally(()=>{D.current=!1})},t[8]=o,t[9]=_,t[10]=b,t[11]=i,t[12]=O):O=t[12];let k=O,A;t[13]===s?A=t[14]:(A=(e,t)=>{h({step:`checking`,check:e}),s().then(e=>{e&&(f(e),v(t=>Gt(t,e))),h(t(e))}).catch(()=>h({step:`blocked`,reason:`readFailed`}))},t[13]=s,t[14]=A);let j=A,M;t[15]===j?M=t[16]:(M=()=>j(`browser`,Ut),t[15]=j,t[16]=M);let N=M,P;t[17]===j?P=t[18]:(P=()=>j(`fullDiskAccess`,Wt),t[17]=j,t[18]=P);let F=P,I;t[19]!==u||t[20]!==m?(I=e=>e||!Bt(m)?void 0:u(),t[19]=u,t[20]=m,t[21]=I):I=t[21];let L;t[22]===m?L=t[23]:(L=Bt(m),t[22]=m,t[23]=L);let ee;t[24]!==a||t[25]!==r||t[26]!==l||t[27]!==u||t[28]!==c||t[29]!==s||t[30]!==N||t[31]!==F||t[32]!==k||t[33]!==d||t[34]!==_||t[35]!==m||t[36]!==b||t[37]!==S||t[38]!==i?(ee=m.step===`quit`?(0,Q.jsx)(Yt,{source:d,onCancel:u,onRechecked:N}):m.step===`fullDiskAccess`?(0,Q.jsx)(Qt,{source:d,onCancel:u,onOpenSettings:c,onCheck:l??(async()=>{let e=await s();return e!==void 0&&e.unavailable===void 0}),onGranted:m.resume===`import`?k:F,stillRequired:m.checked===!0}):m.step===`importing`?(0,Q.jsx)(tn,{}):m.step===`checking`?(0,Q.jsx)(nn,{sourceName:d.name,check:m.check}):m.step===`done`?(0,Q.jsx)(rn,{...m,destinationEnvironmentName:r,onClose:u}):m.step===`blocked`?(0,Q.jsx)(an,{source:d,reason:m.reason,onClose:u,onRetry:Kt(m.reason)?k:void 0}):(0,Q.jsx)($t,{source:d,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:_,onSourceProfileChange:v,target:b,onTargetChange:e=>{x(e),w(void 0)},targetError:S,onCancel:u,onImport:k}),t[24]=a,t[25]=r,t[26]=l,t[27]=u,t[28]=c,t[29]=s,t[30]=N,t[31]=F,t[32]=k,t[33]=d,t[34]=_,t[35]=m,t[36]=b,t[37]=S,t[38]=i,t[39]=ee):ee=t[39];let R;t[40]!==L||t[41]!==ee?(R=(0,Q.jsx)(Oe,{className:`max-w-lg`,showCloseButton:L,children:ee}),t[40]=L,t[41]=ee,t[42]=R):R=t[42];let z;return t[43]!==R||t[44]!==I?(z=(0,Q.jsx)(ke,{open:!0,onOpenChange:I,children:R}),t[43]=R,t[44]=I,t[45]=z):z=t[45],z}function Yt(e){let t=(0,Z.c)(12),{source:n,onCancel:r,onRechecked:i}=e,a;t[0]===n.name?a=t[1]:(a=(0,Q.jsxs)(Se,{children:[(0,Q.jsxs)(Ce,{children:[`Quit `,n.name,` to import`]}),(0,Q.jsxs)(De,{children:[n.name,` is open, so its cookies can’t be read yet. Quit it, then continue.`]})]}),t[0]=n.name,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Q.jsx)(k,{variant:`outline`,onClick:r,children:`Cancel`}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(k,{onClick:i,children:`I’ve quit it`}),t[4]=i,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Q.jsxs)(we,{children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Q.jsxs)(Q.Fragment,{children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function Xt(e){if(e!==void 0)return e===0?`no cookies`:`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Zt(e){return`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Qt(e){let t=(0,Z.c)(43),{source:n,onCancel:r,onOpenSettings:i,onGranted:a,stillRequired:o,onCheck:s}=e,[c,l]=(0,$.useState)(!1),[u,d]=(0,$.useState)(null),f;t[0]===s?f=t[1]:(f=async()=>({fullDiskAccess:await s()}),t[0]=s,t[1]=f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p={fullDiskAccess:!1},t[2]=p):p=t[2];let m=bt(f,p),h;t[3]!==i||t[4]!==c?(h=()=>{c||(l(!0),d(null),Promise.resolve().then(i).catch(()=>d(`Could not open System Settings. Try Allow again.`)).finally(()=>l(!1)))},t[3]=i,t[4]=c,t[5]=h):h=t[5];let g=h,_;t[6]===n.name?_=t[7]:(_=(0,Q.jsxs)(Se,{children:[(0,Q.jsxs)(Ce,{children:[`Let P4 Code read `,n.name,`’s cookies`]}),(0,Q.jsxs)(De,{children:[`To import cookies from `,n.name,`, P4 Code needs Full Disk Access. Turn it on in System Settings, then come back to finish the import — you can revoke it again once the import is done.`]})]}),t[6]=n.name,t[7]=_);let v;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(st,{className:`size-8 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),t[8]=v):v=t[8];let y=`Read ${n.name}'s cookies for this import.`,b;t[9]===g?b=t[10]:(b=()=>void g(),t[9]=g,t[10]=b);let x;t[11]!==m.status.fullDiskAccess||t[12]!==y||t[13]!==b?(x=[{id:`fullDiskAccess`,icon:v,title:`Full Disk Access`,description:y,granted:m.status.fullDiskAccess,onAllow:b}],t[11]=m.status.fullDiskAccess,t[12]=y,t[13]=b,t[14]=x):x=t[14];let S;t[15]!==c||t[16]!==x?(S=(0,Q.jsx)(vt,{busy:c,permissions:x}),t[15]=c,t[16]=x,t[17]=S):S=t[17];let C;t[18]!==u||t[19]!==m.error?(C=u||m.error?(0,Q.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-muted-foreground`,children:u??m.error}):null,t[18]=u,t[19]=m.error,t[20]=C):C=t[20];let w;t[21]!==m||t[22]!==o?(w=m.isReady([`fullDiskAccess`])?null:(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:o?`Access is still required. Quit and reopen P4 Code if you just allowed it, then retry the import.`:`If access doesn't update after you allow it, quit and reopen P4 Code, then retry the import.`}),t[21]=m,t[22]=o,t[23]=w):w=t[23];let T;t[24]!==C||t[25]!==w||t[26]!==S?(T=(0,Q.jsxs)(Ee,{children:[S,C,w]}),t[24]=C,t[25]=w,t[26]=S,t[27]=T):T=t[27];let E;t[28]===r?E=t[29]:(E=(0,Q.jsx)(k,{variant:`outline`,onClick:r,children:`Cancel`}),t[28]=r,t[29]=E);let D;t[30]===m?D=t[31]:(D=m.isReady([`fullDiskAccess`]),t[30]=m,t[31]=D);let O;t[32]!==a||t[33]!==c||t[34]!==D?(O=(0,Q.jsx)(yt,{ready:D,busy:c,onClick:a,children:`Continue`}),t[32]=a,t[33]=c,t[34]=D,t[35]=O):O=t[35];let A;t[36]!==E||t[37]!==O?(A=(0,Q.jsxs)(we,{children:[E,O]}),t[36]=E,t[37]=O,t[38]=A):A=t[38];let j;return t[39]!==T||t[40]!==A||t[41]!==_?(j=(0,Q.jsxs)(Q.Fragment,{children:[_,T,A]}),t[39]=T,t[40]=A,t[41]=_,t[42]=j):j=t[42],j}function $t(e){let t=(0,Z.c)(59),{source:n,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:o,onSourceProfileChange:s,target:c,targetError:l,onTargetChange:u,onCancel:d,onImport:f}=e,p;t[0]!==c.kind||t[1]!==c.profileId||t[2]!==i?(p=c.kind===`existing`&&!i.some(e=>e.id===c.profileId),t[0]=c.kind,t[1]=c.profileId,t[2]=i,t[3]=p):p=t[3];let m=p,h=c.kind===`new`&&!a,g=l??(m?`That profile is no longer available. Choose where to import these cookies.`:h?`You've reached the profile limit. Choose an existing profile to import into.`:void 0),_;t[4]===n.name?_=t[5]:(_=(0,Q.jsxs)(Ce,{children:[`Import from `,n.name]}),t[4]=n.name,t[5]=_);let v;t[6]===r?v=t[7]:(v=(0,Q.jsxs)(De,{children:[`Choose which cookies to import for `,r,`.`]}),t[6]=r,t[7]=v);let y;t[8]!==_||t[9]!==v?(y=(0,Q.jsxs)(Se,{children:[_,v]}),t[8]=_,t[9]=v,t[10]=y):y=t[10];let b;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`From`}),t[11]=b):b=t[11];let x;if(t[12]!==s||t[13]!==n.profiles||t[14]!==o){let e;t[16]!==s||t[17]!==o?(e=e=>(0,Q.jsx)(en,{selected:o===e.directory,title:e.name,subtitle:Xt(e.cookieCount),onSelect:()=>s(e.directory)},e.directory),t[16]=s,t[17]=o,t[18]=e):e=t[18],x=n.profiles.map(e),t[12]=s,t[13]=n.profiles,t[14]=o,t[15]=x}else x=t[15];let S;t[19]===x?S=t[20]:(S=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[b,x]}),t[19]=x,t[20]=S);let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,Q.jsx)(P,{className:`size-4 sm:hidden`}),(0,Q.jsx)(dt,{className:`hidden size-4 sm:block`})]}),t[21]=C):C=t[21];let w;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Into`}),t[22]=w):w=t[22];let T;t[23]!==a||t[24]!==u||t[25]!==c.kind?(T=a?(0,Q.jsx)(en,{selected:c.kind===`new`,title:`New profile`,subtitle:`Created for these cookies`,onSelect:()=>u({kind:`new`})}):null,t[23]=a,t[24]=u,t[25]=c.kind,t[26]=T):T=t[26];let E;if(t[27]!==u||t[28]!==c.kind||t[29]!==c.profileId||t[30]!==i){let e;t[32]!==u||t[33]!==c.kind||t[34]!==c.profileId?(e=e=>(0,Q.jsx)(en,{selected:c.kind===`existing`&&c.profileId===e.id,title:e.name,subtitle:`Existing profile`,onSelect:()=>u({kind:`existing`,profileId:e.id})},e.id),t[32]=u,t[33]=c.kind,t[34]=c.profileId,t[35]=e):e=t[35],E=i.map(e),t[27]=u,t[28]=c.kind,t[29]=c.profileId,t[30]=i,t[31]=E}else E=t[31];let D;t[36]!==T||t[37]!==E?(D=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[w,T,E]}),t[36]=T,t[37]=E,t[38]=D):D=t[38];let O;t[39]!==D||t[40]!==S?(O=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4`,children:[S,C,D]}),t[39]=D,t[40]=S,t[41]=O):O=t[41];let A;t[42]===g?A=t[43]:(A=g?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-destructive`,children:g}):null,t[42]=g,t[43]=A);let j;t[44]!==O||t[45]!==A?(j=(0,Q.jsxs)(Ee,{children:[O,A]}),t[44]=O,t[45]=A,t[46]=j):j=t[46];let M;t[47]===d?M=t[48]:(M=(0,Q.jsx)(k,{variant:`outline`,onClick:d,children:`Cancel`}),t[47]=d,t[48]=M);let N=o===``||m||h,F;t[49]!==f||t[50]!==N?(F=(0,Q.jsx)(k,{disabled:N,onClick:f,children:`Import`}),t[49]=f,t[50]=N,t[51]=F):F=t[51];let I;t[52]!==M||t[53]!==F?(I=(0,Q.jsxs)(we,{children:[M,F]}),t[52]=M,t[53]=F,t[54]=I):I=t[54];let L;return t[55]!==j||t[56]!==I||t[57]!==y?(L=(0,Q.jsxs)(Q.Fragment,{children:[y,j,I]}),t[55]=j,t[56]=I,t[57]=y,t[58]=L):L=t[58],L}function en(e){let t=(0,Z.c)(22),{selected:n,title:r,subtitle:i,onSelect:a}=e,o=n?`border-primary bg-primary/8`:`border-border/60 hover:border-border hover:bg-muted/40`,s;t[0]===o?s=t[1]:(s=A(`flex w-full cursor-pointer items-center justify-between gap-3 rounded-lg border px-3 py-2 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,o),t[0]=o,t[1]=s);let c;t[2]===r?c=t[3]:(c=(0,Q.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground`,children:r}),t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=i?(0,Q.jsx)(`span`,{className:`block truncate text-xs tabular-nums text-muted-foreground`,children:i}):null,t[4]=i,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d=n?`border-primary bg-primary text-primary-foreground`:`border-input`,f;t[9]===d?f=t[10]:(f=A(`grid size-4 shrink-0 place-items-center rounded-full border`,d),t[9]=d,t[10]=f);let p;t[11]===n?p=t[12]:(p=n?(0,Q.jsx)(F,{className:`size-2.5`}):null,t[11]=n,t[12]=p);let m;t[13]!==f||t[14]!==p?(m=(0,Q.jsx)(`span`,{className:f,children:p}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;return t[16]!==a||t[17]!==n||t[18]!==s||t[19]!==u||t[20]!==m?(h=(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":n,onClick:a,className:s,children:[u,m]}),t[16]=a,t[17]=n,t[18]=s,t[19]=u,t[20]=m,t[21]=h):h=t[21],h}function tn(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(Se,{children:[(0,Q.jsx)(Ce,{children:`Importing cookies`}),(0,Q.jsx)(De,{children:`This may take a moment.`})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[t,(0,Q.jsx)(Ee,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,Q.jsx)(le,{size:`md`,tone:`muted`}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Importing…`})]})})]}),e[1]=n):n=e[1],n}function nn(e){let t=(0,Z.c)(13),{sourceName:n,check:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsxs)(Ce,{children:[`Checking `,n]}),t[0]=n,t[1]=i);let a=r===`fullDiskAccess`?`Checking Full Disk Access.`:`Checking whether the browser has closed.`,o;t[2]===a?o=t[3]:(o=(0,Q.jsx)(De,{children:a}),t[2]=a,t[3]=o);let s;t[4]!==i||t[5]!==o?(s=(0,Q.jsxs)(Se,{children:[i,o]}),t[4]=i,t[5]=o,t[6]=s):s=t[6];let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(le,{size:`md`,tone:`muted`}),t[7]=c):c=t[7];let l=r===`fullDiskAccess`?`Checking access…`:`Checking…`,u;t[8]===l?u=t[9]:(u=(0,Q.jsx)(Ee,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[c,(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:l})]})}),t[8]=l,t[9]=u);let d;return t[10]!==s||t[11]!==u?(d=(0,Q.jsxs)(Q.Fragment,{children:[s,u]}),t[10]=s,t[11]=u,t[12]=d):d=t[12],d}function rn(e){let t=(0,Z.c)(24),{imported:n,skipped:r,skippedDomains:i,targetName:a,destinationEnvironmentName:o,onClose:s}=e,c;t[0]!==n||t[1]!==r?(c=n>0?`Imported ${Zt(n)}`:r>0?`Skipped ${Zt(r)}`:`No cookies found`,t[0]=n,t[1]=r,t[2]=c):c=t[2];let l;t[3]===c?l=t[4]:(l=(0,Q.jsx)(Ce,{children:c}),t[3]=c,t[4]=l);let u;t[5]!==o||t[6]!==n||t[7]!==r||t[8]!==a?(u=n>0?`Added to ${a} for ${o}.${r>0?` ${Zt(r)} skipped.`:``}`:r>0?`No cookies were imported for ${o}.`:`There were no cookies to import for ${o}.`,t[5]=o,t[6]=n,t[7]=r,t[8]=a,t[9]=u):u=t[9];let d;t[10]===u?d=t[11]:(d=(0,Q.jsx)(De,{children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Q.jsxs)(Se,{children:[l,d]}),t[12]=l,t[13]=d,t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i.length>0?(0,Q.jsxs)(Ee,{children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Skipped`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,children:qt(i)})]}):null,t[15]=i,t[16]=p);let m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(k,{}),t[17]=m):m=t[17];let h;t[18]===s?h=t[19]:(h=(0,Q.jsx)(we,{children:(0,Q.jsx)(Te,{render:m,onClick:s,children:`Done`})}),t[18]=s,t[19]=h);let g;return t[20]!==f||t[21]!==p||t[22]!==h?(g=(0,Q.jsxs)(Q.Fragment,{children:[f,p,h]}),t[20]=f,t[21]=p,t[22]=h,t[23]=g):g=t[23],g}function an(e){let t=(0,Z.c)(17),{source:n,reason:r,onClose:i,onRetry:a}=e,o;t[0]===n.name?o=t[1]:(o=(0,Q.jsxs)(Ce,{children:[`Couldn’t import from `,n.name]}),t[0]=n.name,t[1]=o);let s=N[r],c;t[2]===s?c=t[3]:(c=(0,Q.jsx)(De,{children:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c?(l=(0,Q.jsxs)(Se,{children:[o,c]}),t[4]=o,t[5]=c,t[6]=l):l=t[6];let u;t[7]===i?u=t[8]:(u=(0,Q.jsx)(k,{variant:`outline`,onClick:i,children:`Close`}),t[7]=i,t[8]=u);let d;t[9]===a?d=t[10]:(d=a?(0,Q.jsx)(k,{onClick:a,children:`Try again`}):null,t[9]=a,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,Q.jsxs)(we,{children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==l||t[15]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16],p}var on=`fill`,sn=`responsive`;async function cn(e,t,n,r){let i=e===null?[]:t,a=r?.environmentIds??[];if(i.length===0&&a.length===0)throw Error(`Browser profile data is not available to clear.`);await Promise.all([...i.flatMap(t=>[e.clearCookies(t,n),e.clearCache(t,n)]),...a.map(e=>r.clear(e,n))])}function ln(e,t,n,r=0){return(e||r>0)&&t&&n>0}var un={width:1280,height:800},dn={useGrouping:!1},fn={system:`System`,light:`Light`,dark:`Dark`},pn=e=>`${Math.round(e*100)}%`,mn=class extends Error{constructor(){super(`Browser profile limit reached.`),this.name=`ProfileLimitReachedError`}},hn=e=>{let t=String(e?.message??``);return r.literals.find(e=>t.includes(`failed: ${e}.`))??`readFailed`},gn=e=>e._tag===`fill`?on:e._tag===`preset`&&lt.some(t=>t.id===e.presetId)?e.presetId:sn,_n=e=>{let t=gn(e);return t===on?`Fill panel`:t===sn?`Responsive`:lt.find(e=>e.id===t)?.label??`Responsive`},vn=e=>Number.isInteger(e)&&e>=240&&e<=3840,yn=e=>({...e,width:e.height,height:e.width});function bn(e){let t=(0,Z.c)(42),{disabled:n}=e,r=J(Sn),a=Y(),o=r._tag===`fill`?null:r,s=o?.width??un.width,c=o?.height??un.height,l;t[0]!==s||t[1]!==c?(l={width:s,height:c},t[0]=s,t[1]=c,t[2]=l):l=t[2];let u=l,d;t[3]!==o?.height||t[4]!==o?.width||t[5]!==a?(d=e=>{if(e===on){a({browserDefaultViewport:p});return}if(e===sn){a({browserDefaultViewport:{_tag:`freeform`,width:o?.width??un.width,height:o?.height??un.height}});return}let t=lt.find(t=>t.id===e);t&&a({browserDefaultViewport:{_tag:`preset`,width:t.width,height:t.height,presetId:t.id}})},t[3]=o?.height,t[4]=o?.width,t[5]=a,t[6]=d):d=t[6];let f=d,m;t[7]!==u||t[8]!==o||t[9]!==a?(m=(e,t)=>{if(t===null||!vn(t))return;let n={...u,[e]:t};n.width*n.height>8294400||o&&n.width===o.width&&n.height===o.height||a({browserDefaultViewport:{_tag:`freeform`,...n}})},t[7]=u,t[8]=o,t[9]=a,t[10]=m):m=t[10];let h=m,g;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(g=pt(`browser-default-viewport`),t[11]=g):g=t[11];let _;t[12]!==n||t[13]!==a||t[14]!==r._tag?(_=!n&&r._tag!==i._tag?(0,Q.jsx)($e,{label:`default browser viewport`,onClick:()=>a({browserDefaultViewport:i})}):null,t[12]=n,t[13]=a,t[14]=r._tag,t[15]=_):_=t[15];let v;t[16]===r?v=t[17]:(v=gn(r),t[16]=r,t[17]=v);let y;t[18]===r?y=t[19]:(y=_n(r),t[18]=r,t[19]=y);let x;t[20]===y?x=t[21]:(x=(0,Q.jsx)(G,{size:`sm`,className:`w-full min-w-0 sm:w-44`,"aria-label":`Default browser viewport`,children:(0,Q.jsx)(U,{children:y})}),t[20]=y,t[21]=x);let S,C;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(H,{value:on,children:`Fill panel`}),C=(0,Q.jsx)(H,{value:sn,children:`Responsive`}),t[22]=S,t[23]=C):(S=t[22],C=t[23]);let w;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsxs)(W,{align:`end`,alignItemWithTrigger:!1,children:[S,C,(0,Q.jsxs)(ce,{children:[(0,Q.jsx)(se,{children:`Standard`}),lt.map(xn)]})]}),t[24]=w):w=t[24];let T;t[25]!==n||t[26]!==f||t[27]!==x||t[28]!==v?(T=(0,Q.jsxs)(K,{value:v,onValueChange:f,disabled:n,children:[x,w]}),t[25]=n,t[26]=f,t[27]=x,t[28]=v,t[29]=T):T=t[29];let E;t[30]!==h||t[31]!==n||t[32]!==u||t[33]!==o||t[34]!==a?(E=o?(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(oe,{value:u.width,min:240,max:b,disabled:n,format:dn,size:`sm`,className:`w-20`,onValueCommitted:e=>h(`width`,e),children:(0,Q.jsx)(ae,{children:(0,Q.jsx)(V,{"aria-label":`Default viewport width`})})}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`×`}),(0,Q.jsx)(oe,{value:u.height,min:240,max:b,disabled:n,format:dn,size:`sm`,className:`w-20`,onValueCommitted:e=>h(`height`,e),children:(0,Q.jsx)(ae,{children:(0,Q.jsx)(V,{"aria-label":`Default viewport height`})})}),(0,Q.jsxs)(ie,{children:[(0,Q.jsx)(B,{render:(0,Q.jsx)(k,{size:`icon-sm`,variant:`ghost-muted`,disabled:n,"aria-label":`Rotate to ${u.height>=u.width?`landscape`:`portrait`}`,onClick:()=>a({browserDefaultViewport:yn(o)}),children:(0,Q.jsx)(ft,{})})}),(0,Q.jsx)(re,{side:`top`,children:`Rotate`})]})]}):null,t[30]=h,t[31]=n,t[32]=u,t[33]=o,t[34]=a,t[35]=E):E=t[35];let D;t[36]!==T||t[37]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto`,children:[T,E]}),t[36]=T,t[37]=E,t[38]=D):D=t[38];let O;return t[39]!==D||t[40]!==_?(O=(0,Q.jsx)(X,{...g,description:`Tab size for you and agents. Fill fits the panel; other sizes show the device toolbar.`,resetAction:_,control:D}),t[39]=D,t[40]=_,t[41]=O):O=t[41],O}function xn(e){return(0,Q.jsx)(H,{value:e.id,children:(0,Q.jsxs)(`span`,{className:`flex w-full items-center justify-between gap-5`,children:[(0,Q.jsx)(`span`,{children:e.label}),(0,Q.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:e.detail})]})},e.id)}function Sn(e){return e.browserDefaultViewport}function Cn(e){let t=(0,Z.c)(20),{disabled:n}=e,r=J(Tn),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=pt(`browser-default-zoom`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==i||t[3]!==r?(o=!n&&r!==1?(0,Q.jsx)($e,{label:`default browser zoom`,onClick:()=>i({browserDefaultZoomFactor:1})}):null,t[1]=n,t[2]=i,t[3]=r,t[4]=o):o=t[4];let s=String(r),c;t[5]===i?c=t[6]:(c=e=>{let t=w.find(t=>String(t)===e);t!==void 0&&i({browserDefaultZoomFactor:t})},t[5]=i,t[6]=c);let l;t[7]===r?l=t[8]:(l=pn(r),t[7]=r,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,Q.jsx)(G,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser zoom`,children:(0,Q.jsx)(U,{children:l})}),t[9]=l,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(W,{align:`end`,alignItemWithTrigger:!1,children:w.map(wn)}),t[11]=d):d=t[11];let f;t[12]!==n||t[13]!==s||t[14]!==c||t[15]!==u?(f=(0,Q.jsxs)(K,{disabled:n,value:s,onValueChange:c,children:[u,d]}),t[12]=n,t[13]=s,t[14]=c,t[15]=u,t[16]=f):f=t[16];let p;return t[17]!==o||t[18]!==f?(p=(0,Q.jsx)(X,{...a,description:`Page zoom applied to new browser tabs.`,resetAction:o,control:f}),t[17]=o,t[18]=f,t[19]=p):p=t[19],p}function wn(e){return(0,Q.jsx)(H,{hideIndicator:!0,value:String(e),children:pn(e)},e)}function Tn(e){return e.browserDefaultZoomFactor}function En(e){let t=(0,Z.c)(18),{disabled:n}=e,r=J(On),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=pt(`browser-default-appearance`),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==n||t[3]!==i?(o=!n&&r!==`system`?(0,Q.jsx)($e,{label:`default browser appearance`,onClick:()=>i({browserDefaultAppearance:m})}):null,t[1]=r,t[2]=n,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>{(e===`system`||e===`light`||e===`dark`)&&i({browserDefaultAppearance:e})},t[5]=i,t[6]=s);let c=fn[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(G,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser appearance`,children:(0,Q.jsx)(U,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(W,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(fn).map(Dn)}),t[9]=u):u=t[9];let d;t[10]!==r||t[11]!==n||t[12]!==s||t[13]!==l?(d=(0,Q.jsxs)(K,{disabled:n,value:r,onValueChange:s,children:[l,u]}),t[10]=r,t[11]=n,t[12]=s,t[13]=l,t[14]=d):d=t[14];let f;return t[15]!==o||t[16]!==d?(f=(0,Q.jsx)(X,{...a,description:`The color scheme pages are told to prefer. System follows your OS setting.`,resetAction:o,control:d}),t[15]=o,t[16]=d,t[17]=f):f=t[17],f}function Dn(e){let[t,n]=e;return(0,Q.jsx)(H,{hideIndicator:!0,value:t,children:n},t)}function On(e){return e.browserDefaultAppearance}function kn(e){let t=(0,Z.c)(17),{disabled:n}=e,r=J(jn),i=J(An),a=Y(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=pt(`browser-recording-key-presses`),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=e=>a({browserRecordingShowKeyPresses:!!e}),t[1]=a,t[2]=s);let c;t[3]!==n||t[4]!==r||t[5]!==s?(c=(0,Q.jsx)(X,{...o,description:`Show pressed keys and shortcuts in new recordings. Password fields are excluded.`,control:(0,Q.jsx)(it,{disabled:n,checked:r,"aria-label":`Show key presses in recordings`,onCheckedChange:s})}),t[3]=n,t[4]=r,t[5]=s,t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=pt(`browser-recording-mouse-presses`),t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=e=>a({browserRecordingShowMousePresses:!!e}),t[8]=a,t[9]=u);let d;t[10]!==n||t[11]!==i||t[12]!==u?(d=(0,Q.jsx)(X,{...l,description:`Highlight mouse presses and held buttons in new recordings.`,control:(0,Q.jsx)(it,{disabled:n,checked:i,"aria-label":`Show mouse presses in recordings`,onCheckedChange:u})}),t[10]=n,t[11]=i,t[12]=u,t[13]=d):d=t[13];let f;return t[14]!==c||t[15]!==d?(f=(0,Q.jsxs)(Q.Fragment,{children:[c,d]}),t[14]=c,t[15]=d,t[16]=f):f=t[16],f}function An(e){return e.browserRecordingShowMousePresses}function jn(e){return e.browserRecordingShowKeyPresses}function Mn(e){let t=(0,Z.c)(18),{disabled:n}=e,r=J(Pn),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=pt(`browser-recording-frame-rate`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==r||t[3]!==i?(o=!n&&r!==30?(0,Q.jsx)($e,{label:`browser recording frame rate`,onClick:()=>i({browserRecordingFrameRate:30})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s=String(r),c;t[5]===i?c=t[6]:(c=e=>{let t=M.find(t=>String(t)===e);t!==void 0&&i({browserRecordingFrameRate:t})},t[5]=i,t[6]=c);let l;t[7]===r?l=t[8]:(l=(0,Q.jsx)(G,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Browser recording frame rate`,children:(0,Q.jsxs)(U,{children:[r,` fps`]})}),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(W,{align:`end`,alignItemWithTrigger:!1,children:M.map(Nn)}),t[9]=u):u=t[9];let d;t[10]!==n||t[11]!==s||t[12]!==c||t[13]!==l?(d=(0,Q.jsxs)(K,{disabled:n,value:s,onValueChange:c,children:[l,u]}),t[10]=n,t[11]=s,t[12]=c,t[13]=l,t[14]=d):d=t[14];let f;return t[15]!==o||t[16]!==d?(f=(0,Q.jsx)(X,{...a,description:`Maximum recording rate. 30 fps saves CPU and storage; 60 fps is smoother.`,resetAction:o,control:d}),t[15]=o,t[16]=d,t[17]=f):f=t[17],f}function Nn(e){return(0,Q.jsxs)(H,{hideIndicator:!0,value:String(e),children:[e,` fps`]},e)}function Pn(e){return e.browserRecordingFrameRate}var Fn={system:`Your default browser`,app:`P4 Code`};function In(e){let t=(0,Z.c)(19),{disabled:n}=e,r=J(Rn),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=pt(`browser-link-target`),t[0]=a):a=t[0];let s;t[1]!==n||t[2]!==r||t[3]!==i?(s=!n&&r!==`system`?(0,Q.jsx)($e,{label:`link target`,onClick:()=>i({browserLinkTarget:o})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=s):s=t[4];let c;t[5]===i?c=t[6]:(c=e=>{(e===`system`||e===`app`)&&i({browserLinkTarget:e})},t[5]=i,t[6]=c);let l=Fn[r],u;t[7]===l?u=t[8]:(u=(0,Q.jsx)(G,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Open links in`,children:(0,Q.jsx)(U,{children:l})}),t[7]=l,t[8]=u);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=Object.keys(Fn),t[9]=d):d=t[9];let f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(W,{align:`end`,alignItemWithTrigger:!1,children:d.map(Ln)}),t[10]=f):f=t[10];let p;t[11]!==n||t[12]!==r||t[13]!==c||t[14]!==u?(p=(0,Q.jsxs)(K,{disabled:n,value:r,onValueChange:c,children:[u,f]}),t[11]=n,t[12]=r,t[13]=c,t[14]=u,t[15]=p):p=t[15];let m;return t[16]!==s||t[17]!==p?(m=(0,Q.jsx)(X,{...a,description:`Where links in the chat and terminal open. Hold ⌘ or Ctrl while clicking a link to open it in your default browser either way.`,resetAction:s,control:p}),t[16]=s,t[17]=p,t[18]=m):m=t[18],m}function Ln(e){return(0,Q.jsx)(H,{hideIndicator:!0,value:e,children:Fn[e]},e)}function Rn(e){return e.browserLinkTarget}function zn(){let e=(0,Z.c)(7),{search:t,environment:n}=qe(),r=Xe(),i=n?.connection.phase===`connected`&&n.serverConfig!==null?n.environmentId:null,a;e[0]===t?a=e[1]:(a=JSON.stringify(t),e[0]=t,e[1]=a);let o=`${i}:${a}`,s;return e[2]!==i||e[3]!==r.enableAgentDeviceAccess||e[4]!==r.enableDeviceSupport||e[5]!==o?(s=(0,Q.jsx)(et,{id:`devices`,title:`Devices`,children:(0,Q.jsx)(Bn,{environmentId:i,enabled:r.enableDeviceSupport,agentAccessEnabled:r.enableAgentDeviceAccess},o)}),e[2]=i,e[3]=r.enableAgentDeviceAccess,e[4]=r.enableDeviceSupport,e[5]=o,e[6]=s):s=e[6],s}function Bn({environmentId:e,enabled:t,agentAccessEnabled:n}){let r=_e(e,c),{state:i,loaded:a}=Ae(e),{scope:o,environments:s,connectedEnvironments:l}=qe(),u=Ye(),d=o.kind===`project`||o.kind===`checkout`,f=l.some(e=>e.serverConfig?.settings.enableDeviceSupport),p=ye(je.configure,{reportFailure:!1}),m=ye(je.list,{reportFailure:!1}),[h,g]=(0,$.useState)(null),_=i.hostStatus===`installing`||i.hostStatus===`starting`,v=i.hosts.some(e=>e.kind===`local`&&!e.platforms.some(e=>e.available)),[y,b]=(0,$.useState)(!1);y&&!t&&b(!1),t&&!y&&(i.hostStatus===`ready`||v)&&h!==`hub`&&b(!0);let x=async(t,n)=>{if(e&&ve(e,`settings:write`)){g(t);try{let e=await Promise.allSettled(s.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!ve(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return p({environmentId:e.environmentId,input:{...n,...n.enabled?{onboardingCompleted:!0}:{}}})})),t=s.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});t.length>0&&q.add({type:`error`,title:`Device settings not saved on all environments`,description:`Could not update ${t.map(e=>e.label).join(`, `)}.`})}finally{g(null)}}},[S,C]=(0,$.useState)(null),w=i.hosts.find(e=>e.kind===`local`)?.tools,T=t=>{let n=w?.[t],r=n&&!n.installedVersions.includes(n.requiredVersion);return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[i.supportsToolUpdate&&r?(0,Q.jsx)(k,{size:`sm`,disabled:!e||h!==null||_,onClick:()=>{e&&(C(null),g(`update-${t}`),m({environmentId:e,input:{updateTool:t}}).then(e=>{e._tag===`Failure`&&C({tool:t,message:`Update failed. Check this host's network connection and try again.`})}).finally(()=>g(null)))},children:h===`update-${t}`?`Updating…`:`Update to v${n.requiredVersion}`}):null,i.supportsToolInspection?(0,Q.jsx)(k,{size:`sm`,variant:`outline`,disabled:!e||h!==null||_,onClick:()=>{e&&(g(`check`),m({environmentId:e,input:{inspectOnly:!0}}).finally(()=>g(null)))},children:h===`check`?`Checking…`:`Check versions`}):null]}),S?.tool===t?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:S.message}):null]})};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(X,{...pt(`device-hub`),serverScoped:!0,settingKeys:[`enableDeviceSupport`],description:Ie,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xt,{action:T(`hub`),kind:`hub`,tools:i.hosts.find(e=>e.kind===`local`)?.tools}),h===`hub`?(0,Q.jsx)(Fe,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(_t,{settingKeys:[`enableDeviceSupport`],checked:t,disabled:!r||d||!a||!e||_||h!==null,"aria-label":`Device hub`,onCheckedChange:e=>void x(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]})}),(0,Q.jsx)(ze,{children:y?(0,Q.jsx)(X,{...pt(`device-platform-support`),description:l.length>1?`Status for ${l.find(t=>t.environmentId===e)?.label}. Select an environment to inspect its simulator support.`:void 0,status:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-2`,children:[(0,Q.jsx)(Pe,{compact:!0,platform:`iOS`,status:Le(i,`ios`)}),(0,Q.jsx)(Pe,{compact:!0,platform:`Android`,status:Le(i,`android`)})]}),control:(0,Q.jsx)(k,{size:`sm`,variant:`outline`,disabled:!e||!t||_||h!==null,onClick:()=>{e&&(g(`check`),m({environmentId:e,input:{}}).finally(()=>g(null)))},children:h===`check`?`Checking…`:`Refresh`})}):null}),(0,Q.jsx)(X,{...pt(`agent-device-access`),serverScoped:!0,settingKeys:[`enableAgentDeviceAccess`],description:Me,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xt,{action:T(`agent`),kind:`agent`,tools:i.hosts.find(e=>e.kind===`local`)?.tools}),h===`agent`?(0,Q.jsx)(Re,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(_t,{settingKeys:[`enableAgentDeviceAccess`],checked:n,disabled:!r||l.length===0||!d&&(!a||!f||_)||h!==null,"aria-label":`Agent device access`,onCheckedChange:e=>d?u({enableAgentDeviceAccess:!!e}):void x(`agent`,{agentAccessEnabled:!!e})})]})}),e?(0,Q.jsx)(Ne,{state:{...i,hosts:i.hosts.filter(e=>e.kind===`local`)},environmentId:e}):null,(0,Q.jsx)(Pt,{environmentId:e})]})}function Vn(e){let t=(0,Z.c)(14),{disabled:n}=e,r=J(Hn),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=pt(`browser-auto-show-floating-preview`),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==n||t[3]!==i?(o=!n&&r!==!0?(0,Q.jsx)($e,{label:`auto-show floating preview`,onClick:()=>i({browserAutoShowFloatingPreview:!0})}):null,t[1]=r,t[2]=n,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>i({browserAutoShowFloatingPreview:!!e}),t[5]=i,t[6]=s);let c;t[7]!==r||t[8]!==n||t[9]!==s?(c=(0,Q.jsx)(it,{disabled:n,checked:r,onCheckedChange:s,"aria-label":`Auto-show floating preview`}),t[7]=r,t[8]=n,t[9]=s,t[10]=c):c=t[10];let l;return t[11]!==o||t[12]!==c?(l=(0,Q.jsx)(X,{...a,description:`Show the floating preview when an agent opens a browser or device unless the agent says otherwise.`,resetAction:o,control:c}),t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function Hn(e){return e.browserAutoShowFloatingPreview}function Un({disabled:e}){let t=J(e=>e.browserProfiles),n=J(e=>e.browserDefaultProfileId),r=pe(),i=Y(),{environments:o,isReady:c}=de(),p=ue(),[m,_]=(0,$.useState)(null),[v,y]=(0,$.useState)(null),[b,x]=(0,$.useState)(null),[w,T]=(0,$.useState)(null),[D,M]=(0,$.useState)(null),[N,P]=(0,$.useState)(!1),F=ne(),L=ye(He.clearProfile,{reportFailure:!1}),ee={environmentIds:o.map(e=>e.environmentId).filter(e=>F.get(e)?.environment.capabilities.serverBrowser===!0),clear:async(e,t)=>{let n=await L({environmentId:e,input:{profileId:t}});if(n._tag===`Failure`)throw te(n)}},z=ln(ut!==null,c,o.length,ee.environmentIds.length),B=(0,$.useRef)(!1),[re,ie]=(0,$.useState)(!1),V=e||!r,ae=S(t).filter(e=>e.kind!==`incognito`),oe=a(ae,n)?.id??`default`,H=e=>{if(!r||B.current)return;let t=he().browserProfiles;if(t.length>=24)return;let n=S(t),a=new Set(n.map(e=>e.name)),o=e;for(let t=2;a.has(o);t+=1)o=`${e} ${t}`;let s={id:`profile-${C()}`,name:o,kind:`persistent`};return i({browserProfiles:[...t,s]}),s},U=(e,t)=>{if(!r||B.current)return;let n=t.trim().slice(0,48);if(n===``)return;let a=he().browserProfiles;i({browserProfiles:a.map(t=>t.id===e?{...t,name:n}:t)})},se=(e,t)=>{if(r&&!B.current){if(!z){q.add({type:`error`,title:`Could not clear ${t}'s data`,description:`You're not connected to a server yet.`});return}cn(ut,o.map(e=>e.environmentId),e,ee).then(()=>{q.add({type:`success`,title:`Cleared ${t}'s cookies and cache`})}).catch(()=>{q.add({type:`error`,title:`Could not clear ${t}'s data`})})}},W=async e=>{if(!r||B.current)return;if(!z){M(`Connect to an environment before removing this profile.`);return}M(null),P(!0);try{await cn(ut,c?o.map(e=>e.environmentId):[],e,ee)}catch{M(`Profile data could not be deleted. Try again.`),P(!1);return}let t=he();i({browserProfiles:t.browserProfiles.filter(t=>t.id!==e),...t.browserDefaultProfileId===e?{browserDefaultProfileId:d}:{}}),P(!1),x(null)},ce=(m??[]).filter(e=>e.unavailable!==`notInstalled`&&e.unavailable!==`unsupportedPlatform`),G=(0,$.useCallback)(()=>{ut&&ut.listBrowserImportSources().then(_).catch(()=>_(e=>e??[]))},[]),K=async(e,t,n)=>{if(!ut||!r)return{kind:`blocked`,reason:`sessionUnavailable`};if(n.target.kind===`existing`&&!S(he().browserProfiles).some(e=>e.id===n.target.profileId)||B.current)return{kind:`blocked`,reason:`readFailed`};B.current=!0,ie(!0);try{let r=await ut.importBrowserCookies({environmentId:t,sourceId:e.id,sourceProfileDirectory:n.sourceProfileDirectory,targetProfileId:n.target.profileId});if(n.target.kind===`existing`&&!S(he().browserProfiles).some(e=>e.id===n.target.profileId))return{kind:`blocked`,reason:`readFailed`};let i;if(n.target.kind===`new`){if(r.imported>0)try{i=(await me(t=>{if(t.browserProfiles.find(e=>e.id===n.target.profileId))return t;if(t.browserProfiles.length>=24)throw new mn;let r=new Set(S(t.browserProfiles).map(e=>e.name)),i=e.name;for(let t=2;r.has(i);t+=1)i=`${e.name} ${t}`;return{...t,browserProfiles:[...t.browserProfiles,{id:n.target.profileId,name:i,kind:`persistent`}]}})).browserProfiles.find(e=>e.id===n.target.profileId)?.name??e.name}catch(r){await cn(ut,[t],n.target.profileId).catch(()=>void 0);let i=r instanceof mn?`profileLimitReached`:`profileNotSaved`;throw Error(`Importing cookies from ${e.id} failed: ${i}.`,{cause:r})}else i=e.name}else i=n.target.name;return{kind:`imported`,imported:r.imported,skipped:r.skipped,skippedDomains:r.skippedDomains,targetName:i}}catch(e){return{kind:`blocked`,reason:hn(e)}}finally{B.current=!1,ie(!1)}},le=async e=>{if(ut)try{let t=await ut.listBrowserImportSources();return _(t),t.find(t=>t.id===e)}catch{return}},ge=t.length>=24;return(0,Q.jsxs)(X,{...pt(`browser-profiles`),description:`Profiles separate cookies and logins. Incognito data is cleared when the app closes.`,control:(0,Q.jsxs)(s,{onOpenChange:e=>e&&G(),children:[(0,Q.jsxs)(E,{render:(0,Q.jsx)(k,{size:`sm`,variant:`outline`,disabled:V||re}),children:[(0,Q.jsx)(R,{}),`Add profile`]}),(0,Q.jsxs)(g,{align:`end`,children:[(0,Q.jsx)(h,{disabled:!r||ge,onClick:()=>H(`New profile`),children:`Blank profile`}),ge?(0,Q.jsx)(h,{disabled:!0,children:`You’ve reached the profile limit`}):null,(0,Q.jsx)(j,{}),(0,Q.jsxs)(O,{children:[(0,Q.jsx)(l,{children:`Import from`}),m===null?(0,Q.jsx)(h,{disabled:!0,children:`Looking for browsers…`}):ce.length===0?(0,Q.jsx)(h,{disabled:!0,children:`No supported browsers found`}):(0,Q.jsxs)(Q.Fragment,{children:[ce.map(e=>(0,Q.jsx)(h,{disabled:!r||p==null,onClick:()=>{r&&p!=null&&y({source:e,environmentId:p.environmentId,environmentName:Je({isPrimary:!0,environmentId:p.environmentId,runtimeLabel:p.label})})},children:e.name},e.id)),p==null?(0,Q.jsx)(h,{disabled:!0,children:`Connect to an environment to import cookies`}):null]})]})]})]}),children:[(0,Q.jsx)(`div`,{className:`mt-2 mb-2 overflow-hidden rounded-lg border border-border/60`,children:ae.map((e,t)=>{let n=u(e.id),a=e.id===oe;return(0,Q.jsxs)(`div`,{className:A(`flex items-center gap-3 px-3 py-2`,t>0&&`border-t border-border/60`),children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[n?(0,Q.jsx)(`span`,{className:A(`truncate text-sm text-foreground`,V&&`opacity-64`),children:e.name}):(0,Q.jsx)(gt,{nativeInput:!0,size:`sm`,className:`w-full max-w-56`,"aria-label":`Rename ${e.name}`,disabled:V||re,maxLength:48,value:e.name,onCommit:t=>U(e.id,t)}),a?(0,Q.jsx)(`span`,{className:A(`flex`,V&&`opacity-64`),children:(0,Q.jsx)(f,{children:`Default`})}):null]}),(0,Q.jsxs)(s,{children:[(0,Q.jsx)(E,{render:(0,Q.jsx)(k,{size:`icon-xs`,variant:`ghost-muted`,disabled:V||re,"aria-label":`${e.name} options`}),children:(0,Q.jsx)(I,{})}),(0,Q.jsxs)(g,{align:`end`,children:[(0,Q.jsx)(h,{disabled:!r||a,onClick:()=>{r&&i({browserDefaultProfileId:e.id})},children:`Set as default`}),(0,Q.jsx)(h,{disabled:!r||!z,onClick:()=>{ee.environmentIds.length>0?T(e):se(e.id,e.name)},children:`Clear cookies and cache`}),n?null:(0,Q.jsx)(h,{variant:`destructive`,disabled:!r||!z,onClick:()=>{r&&x(e)},children:`Remove profile and data`}),z?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(j,{}),(0,Q.jsx)(h,{disabled:!0,children:c?`Connect to an environment to clear profile data`:`Checking environments…`})]})]})]})]},e.id)})}),(0,Q.jsx)(tt,{open:b!==null,onOpenChange:e=>{!e&&!N&&(x(null),M(null))},children:(0,Q.jsxs)(nt,{children:[(0,Q.jsxs)(ct,{children:[(0,Q.jsxs)(rt,{children:[`Remove “`,b?.name,`”?`]}),(0,Q.jsx)(at,{children:`Its cookies and logins are deleted. Desktop tabs already open in this profile stay open until you close them; server browser tabs close now.`}),D?(0,Q.jsx)(`p`,{"aria-live":`polite`,className:`text-sm text-destructive`,children:D}):null,z?null:(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect to an environment to remove this profile and its data.`})]}),(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(mt,{disabled:N,render:(0,Q.jsx)(k,{variant:`outline`,disabled:N}),children:`Cancel`}),(0,Q.jsx)(k,{variant:`destructive`,disabled:N||!r||!z,onClick:()=>{b&&r&&z&&W(b.id)},children:N?`Removing…`:`Remove profile`})]})]})}),(0,Q.jsx)(tt,{open:w!==null,onOpenChange:e=>{e||T(null)},children:(0,Q.jsxs)(nt,{children:[(0,Q.jsxs)(ct,{children:[(0,Q.jsxs)(rt,{children:[`Clear “`,w?.name,`”’s cookies and cache?`]}),(0,Q.jsx)(at,{children:`You are signed out of its sites. Server browser tabs open in this profile close now.`})]}),(0,Q.jsxs)(ot,{children:[(0,Q.jsx)(mt,{render:(0,Q.jsx)(k,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(k,{variant:`destructive`,onClick:()=>{w&&se(w.id,w.name),T(null)},children:`Clear data`})]})]})}),v?(0,Q.jsx)(Jt,{source:v.source,destinationEnvironmentName:v.environmentName,targetProfiles:ae.map(e=>({id:e.id,name:e.name})),canCreateProfile:r&&!ge,onImport:e=>K(v.source,v.environmentId,e),onRefreshSource:()=>le(v.source.id),onCheckFullDiskAccess:window.desktopBridge?.checkSystemPermission?()=>window.desktopBridge.checkSystemPermission(`full-disk-access`):void 0,onOpenFullDiskAccessSettings:async()=>{await fe()?.shell.openSystemSettings(`full-disk-access`).catch(()=>{q.add({type:`error`,title:`Could not open System Settings`,description:`Open Privacy & Security → Full Disk Access manually.`})})},onClose:()=>y(null)}):null]})}function Wn(){let e=(0,Z.c)(3),t=!be,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Un,{disabled:t}),(0,Q.jsx)(bn,{disabled:t}),(0,Q.jsx)(Cn,{disabled:t}),(0,Q.jsx)(En,{disabled:t}),(0,Q.jsx)(Mn,{disabled:t}),(0,Q.jsx)(kn,{disabled:t}),(0,Q.jsx)(In,{disabled:t}),(0,Q.jsx)(Vn,{disabled:t})]}),e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(ht,{category:`integrations`}),e[1]=i):i=e[1];let a;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsxs)(Qe,{children:[i,(0,Q.jsx)(et,{id:`browser`,title:`Browser`,children:t?(0,Q.jsx)(Ze,{message:`Only available in the desktop app.`,children:r}):r}),(0,Q.jsx)(zn,{})]}),e[2]=a):a=e[2],a}var Gn=Wn;export{Gn as component};
2
+ //# sourceMappingURL=settings.integrations-BCtpk2dY.js.map