@p4code/cli 0.8.34 → 0.8.35
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.
- package/dist/bin.mjs +1 -1
- package/dist/{binCli-CvWinVsO.mjs → binCli-26z5sNBT.mjs} +2242 -1476
- package/dist/client/.vite/manifest.json +2038 -2023
- package/dist/client/assets/{2NI2N5EU-Dlr3FZf7.js → 2NI2N5EU-BLnY4aCF.js} +2 -2
- package/dist/client/assets/{4UO7MD6I-Cy2sjs8O.js → 4UO7MD6I-BApNVkfU.js} +2 -2
- package/dist/client/assets/{5B3SVYGG-DaCwFaTp.js → 5B3SVYGG-Y7V7NdZO.js} +2 -2
- package/dist/client/assets/{5GK6JWQ2-BVM9871F.js → 5GK6JWQ2-BSIhKcw-.js} +2 -2
- package/dist/client/assets/{5N7A7DKN-BVMU2dmG.js → 5N7A7DKN-CNUCnWLs.js} +2 -2
- package/dist/client/assets/{5OC2THR4-2tkjJ38q.js → 5OC2THR4-Bne-pf_A.js} +2 -2
- package/dist/client/assets/{5S6HY5KT-BGTQzE2T.js → 5S6HY5KT-7d4UMONz.js} +2 -2
- package/dist/client/assets/{6IMQ5BUJ-DMdx9ktL.js → 6IMQ5BUJ-BWW19n-D.js} +2 -2
- package/dist/client/assets/{6OLKWJ4F-B0TXT19U.js → 6OLKWJ4F-CxTUuvA6.js} +2 -2
- package/dist/client/assets/{74OO7NKP-Cukz2OUS.js → 74OO7NKP-DByVTRKE.js} +2 -2
- package/dist/client/assets/{75O6YZUN-D3k2sZNm.js → 75O6YZUN-CZanyedf.js} +2 -2
- package/dist/client/assets/{77XECAW3-CjIq7P_x.js → 77XECAW3-TL2w7pHK.js} +2 -2
- package/dist/client/assets/{ABYRPUBD-hf0OeD7n.js → ABYRPUBD-CJboH7Uz.js} +2 -2
- package/dist/client/assets/AlertDialogRoot-9jRALQXL.js +2 -0
- package/dist/client/assets/{AnimatedHeight-CHpFDL1r.js → AnimatedHeight-OxEbW01v.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-whDvSlDA.js → AuthSurfaceShell-KQXgPV4i.js} +2 -2
- package/dist/client/assets/{BB2UYUI2-RUQPN7sp.js → BB2UYUI2-BxW-R2h1.js} +2 -2
- package/dist/client/assets/{BUM34MOA-f5Ez9vSp.js → BUM34MOA-ngG-irUy.js} +2 -2
- package/dist/client/assets/{CEQABKGZ-C2ZheKpY.js → CEQABKGZ-C-u-W0bS.js} +2 -2
- package/dist/client/assets/{CXAC5362-B0KvwGJk.js → CXAC5362-DfFRkI7L.js} +2 -2
- package/dist/client/assets/ChatGptUsageButton-C3KgGt4z.js +2 -0
- package/dist/client/assets/{ChatMarkdown-C2KOLN1s.js → ChatMarkdown-9gWM0ED9.js} +9 -9
- package/dist/client/assets/{CheckboxIndicator-zwVHomgm.js → CheckboxIndicator-DbU3csPQ.js} +2 -2
- package/dist/client/assets/{ClippedText-Cx9jjhQp.js → ClippedText-CS_BYNco.js} +2 -2
- package/dist/client/assets/{CodexSetupSection.logic-150217tr.js → CodexSetupSection.logic-CNbTXxKb.js} +2 -2
- package/dist/client/assets/{ComboboxClear-tzFhNwrk.js → ComboboxClear-Bn_kslrf.js} +2 -2
- package/dist/client/assets/{ComboboxGroupLabel-C1Icd2UF.js → ComboboxGroupLabel-fL8lMA25.js} +2 -2
- package/dist/client/assets/{CommandBlock-D9QqOlDX.js → CommandBlock-DcQXu_lq.js} +2 -2
- package/dist/client/assets/ComposerPromptEditor-DQ9wFfKn.js +204 -0
- package/dist/client/assets/{CompositeRoot-BD0GlRg8.js → CompositeRoot-BuwzXGHT.js} +2 -2
- package/dist/client/assets/{ConnectionDiagnosisDetails-BQ3BFqRL.js → ConnectionDiagnosisDetails-DGbJY7Hw.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-DLQm_zZ7.js → ConnectionStatusDot-CixsTBXI.js} +2 -2
- package/dist/client/assets/{DRLTVNUE-vgHnaBR1.js → DRLTVNUE-Cbb71R0Y.js} +2 -2
- package/dist/client/assets/{DYY6UVD2-BQAAF_8A.js → DYY6UVD2-BZn5fuF5.js} +2 -2
- package/dist/client/assets/{DevicePanel-Yd3YuPQd.js → DevicePanel-JP__PY1s.js} +2 -2
- package/dist/client/assets/{DeviceSetup-DW4g9NNK.js → DeviceSetup-D8qb_qBj.js} +2 -2
- package/dist/client/assets/{DialogTitle-DCMYEIWZ.js → DialogTitle-B_9LEmy3.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-BLItJ7Ia.js → DiffCommentAnnotation-WMKzOwCh.js} +2 -2
- package/dist/client/assets/{DiffFileTree-B1-D1WV6.js → DiffFileTree-BSbsOOmA.js} +2 -2
- package/dist/client/assets/DiffPanel-BWFuiHvv.js +2 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-BzkGX7xm.js → DiffWorkerPoolProvider-BBk0lIX3.js} +2 -2
- package/dist/client/assets/EmbeddedDesign-B4RMmwTG.css +1 -0
- package/dist/client/assets/EmbeddedDesign-D5YUndkh.js +21 -0
- package/dist/client/assets/{EnvironmentMachineIcon-5-erc8l_.js → EnvironmentMachineIcon-Dpgx67FY.js} +2 -2
- package/dist/client/assets/{ExpandableText-D2jzDgm7.js → ExpandableText-Cpm1gOKG.js} +2 -2
- package/dist/client/assets/{FNOVOB4O-CE98DPML.js → FNOVOB4O-BkEIrB0k.js} +2 -2
- package/dist/client/assets/{FieldControl-CBMzQqd5.js → FieldControl-BHe6unoZ.js} +2 -2
- package/dist/client/assets/{FileDiff-2qSm00aV.js → FileDiff-C1vAOUga.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-Drpn6NuE.js → FilePreviewPanel-CbpNevZP.js} +4 -4
- package/dist/client/assets/{FoldedSettingsSection-Db7e_9rd.js → FoldedSettingsSection-DySTg20x.js} +2 -2
- package/dist/client/assets/{FormContext-BGRz6hhb.js → FormContext-CmvUzTS-.js} +2 -2
- package/dist/client/assets/{HDGCDEEZ-C0-Zci_l.js → HDGCDEEZ-CN-ckGDk.js} +2 -2
- package/dist/client/assets/{HSJLKHB7-4e5L-KC4.js → HSJLKHB7-B0BvmnZE.js} +2 -2
- package/dist/client/assets/{Icons-DwLGuyWf.js → Icons-B4l3TqYa.js} +2 -2
- package/dist/client/assets/Input-Cv-TKh6s.js +2 -0
- package/dist/client/assets/JZOYTAAL-CB_B_Rei.js +1 -0
- package/dist/client/assets/{K3MD6TGW-Gi4s7ooz.js → K3MD6TGW-IS0rWO1U.js} +2 -2
- package/dist/client/assets/{K7RP3OMA-BVc6P2bZ.js → K7RP3OMA-DcqjCOJO.js} +2 -2
- package/dist/client/assets/{KeybindingsSettings.logic-CU23l8mP.js → KeybindingsSettings.logic-mF9mJWrc.js} +2 -2
- package/dist/client/assets/{LHDIQX7Q-DbBCFdJr.js → LHDIQX7Q-CLMgIt4Y.js} +2 -2
- package/dist/client/assets/{LUXOKEGN-C4n0-A1h.js → LUXOKEGN-B1dkmN_M.js} +2 -2
- package/dist/client/assets/{MathTypeset--azkeKic.js → MathTypeset-qeRVy_bc.js} +2 -2
- package/dist/client/assets/{N3JZAHOW-2wC96xvZ.js → N3JZAHOW-C6sq5aqx.js} +2 -2
- package/dist/client/assets/{NUIALGQ3-Di1L_kRJ.js → NUIALGQ3-BG7xJ_qe.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-CC3oMKUV.js → NoProjectsHero-B0KzU91d.js} +2 -2
- package/dist/client/assets/{O65XPQGZ-BeKB0m-p.js → O65XPQGZ-BEfVfDlS.js} +2 -2
- package/dist/client/assets/{O7XIQ6OM-1wrcdCMc.js → O7XIQ6OM-BUiRjV87.js} +2 -2
- package/dist/client/assets/{OFQON5FD-CsMmmhLT.js → OFQON5FD-DTgVPbd-.js} +2 -2
- package/dist/client/assets/{P4ConnectAccountPages-BDxb29bY.js → P4ConnectAccountPages-C4KYM5XU.js} +2 -2
- package/dist/client/assets/{P4ConnectSidebarSignIn-Dp5OsZBa.js → P4ConnectSidebarSignIn-DNPUNJl_.js} +2 -2
- package/dist/client/assets/{PJQHF43J-CY_GpbqJ.js → PJQHF43J-QRnhQpHu.js} +2 -2
- package/dist/client/assets/PanelLayoutControls-4VFKEoHg.js +216 -0
- package/dist/client/assets/{PierreEntryIcon-B5tjtDkE.js → PierreEntryIcon-DeI-j_7w.js} +2 -2
- package/dist/client/assets/{PopoverHandle-CZh3pqXt.js → PopoverHandle-DMB4QSp6.js} +2 -2
- package/dist/client/assets/PreviewPanel-CO66mekh.js +2 -0
- package/dist/client/assets/ProjectDefaultsSettings-BF-iyQ8T.js +2 -0
- package/dist/client/assets/{ProjectFavicon-CkSteHLT.js → ProjectFavicon-_6hkSNzm.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-9heAZbVC.js → ProjectIconPickerDialog-DeL1rZxy.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-DIqp1OmB.js → ProjectMonogram-Cn4l-YGU.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-BSsraub7.js → ProviderAuthTerminal-qGeMxZDy.js} +2 -2
- package/dist/client/assets/ProviderModelPicker-DJQYH_Pp.js +2 -0
- package/dist/client/assets/{ProviderSettingsForm-CAFBbrfr.js → ProviderSettingsForm-BSVuPnR0.js} +2 -2
- package/dist/client/assets/PullRequestCodeTab-0OaJE6XS.js +6 -0
- package/dist/client/assets/{RHNBAITX-BdiF8iR_.js → RHNBAITX-ChqB7inB.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-BXDLfPcr.js → ReadOnlySourcePreview-B08Wms4m.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-CR2cHAQ5.js → RenderErrorBoundary-BsOuLEci.js} +3 -3
- package/dist/client/assets/{SLD4V6NK-Bo1z-c9S.js → SLD4V6NK-IkYRGtTH.js} +2 -2
- package/dist/client/assets/ScheduledTasksSettings-1UDkELZo.js +4 -0
- package/dist/client/assets/{ScopedSwitch-CX4FTGjy.js → ScopedSwitch-Bhp6-hCj.js} +2 -2
- package/dist/client/assets/{ScrollAreaCorner-BCdJHqsj.js → ScrollAreaCorner-BPMuWLbs.js} +2 -2
- package/dist/client/assets/{SecretInput-BPPzPNI1.js → SecretInput-RlOzrLKL.js} +2 -2
- package/dist/client/assets/{SelectScrollUpArrow-CR3Z6_pf.js → SelectScrollUpArrow-6kh66YCd.js} +2 -2
- package/dist/client/assets/{SettingsPanels-DoJnxtp0.js → SettingsPanels-BfBUSBAG.js} +6 -6
- package/dist/client/assets/{SettingsPanels.logic-t7cG-B6z.js → SettingsPanels.logic-BsFZYDgm.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-DD4QFo3v.js → SettingsScopeNotice-H7UzC9bb.js} +2 -2
- package/dist/client/assets/{T3PCR2KE-Cg6A465M.js → T3PCR2KE-BxaunvVy.js} +2 -2
- package/dist/client/assets/{TKWO2OVW-CWeCEb5C.js → TKWO2OVW-DFURsfqA.js} +2 -2
- package/dist/client/assets/{TSHNXIZL-DTjzxHgA.js → TSHNXIZL-CIukdyLy.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-BwydY72w.js → ThemeEditorPanel-otrA-nTg.js} +3 -3
- package/dist/client/assets/{ThreadTerminalDrawer-QTFG89J_.js → ThreadTerminalDrawer-BQKZCFAC.js} +4 -4
- package/dist/client/assets/TooltipViewport-ZmVCer7P.js +2 -0
- package/dist/client/assets/{UQJE5E4I-DS4MjKhw.js → UQJE5E4I-CfqCotH2.js} +2 -2
- package/dist/client/assets/{USNYFO5S-Be1OZGok.js → USNYFO5S-CctAAheU.js} +2 -2
- package/dist/client/assets/{Virtualizer-BpizRoFL.js → Virtualizer-CImHNxBq.js} +2 -2
- package/dist/client/assets/{WEVWDWVA-oFS2VG1Y.js → WEVWDWVA-DS9YO9IT.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-ckARUoj9.js → WorkspaceBreadcrumb-BW_omYU1.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-D5yW7_av.js → WorkspacePageContainer-BS8FWt_4.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-CTWcEH7d.js → WorkspacePageHeader-CE_94tTR.js} +2 -2
- package/dist/client/assets/{X5RFHQXM-Bjw0rDxX.js → X5RFHQXM-B0KbwoE1.js} +2 -2
- package/dist/client/assets/{X62E3GBT-BPHYY59t.js → X62E3GBT-wpz8X9Yh.js} +2 -2
- package/dist/client/assets/{XBNEOJTC-W72qCYdc.js → XBNEOJTC-DFRK5c6Y.js} +2 -2
- package/dist/client/assets/{YHV2MVVZ-DA_drdwk.js → YHV2MVVZ-1NnqTTZ2.js} +2 -2
- package/dist/client/assets/{YURCZMG2-CsfrwNLG.js → YURCZMG2-rnzWY5ij.js} +2 -2
- package/dist/client/assets/{YVG2LODB-dXCBipzg.js → YVG2LODB-Dxuuk2M-.js} +2 -2
- package/dist/client/assets/_chat-1QGQLbCc.js +45 -0
- package/dist/client/assets/{_chat.design-KVMajkdX.js → _chat.design-z2pu_9A5.js} +2 -2
- package/dist/client/assets/{_chat.index-BknTP6QZ.js → _chat.index-D8X9o5jY.js} +2 -2
- package/dist/client/assets/{_chat.new-DLFV1XOJ.js → _chat.new-CGJw8cpo.js} +3 -3
- package/dist/client/assets/_chat.pull-requests-BfW9qMU1.js +2 -0
- package/dist/client/assets/{alert-Dh8AVuLe.js → alert-DO06etEs.js} +2 -2
- package/dist/client/assets/{assetUrls-C6W2_00u.js → assetUrls-CmOUMX2M.js} +2 -2
- package/dist/client/assets/assets-aBpLf8r4.js +2 -0
- package/dist/client/assets/{browserHistoryStore-CeBJcpoN.js → browserHistoryStore-tYgeZygn.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-D5ew8rLG.js → browserLinkTarget-CQFfJKWJ.js} +2 -2
- package/dist/client/assets/{checkbox-Y4v7A1IZ.js → checkbox-BEQFb7GO.js} +2 -2
- package/dist/client/assets/{color-picker-DEWeNc5K.js → color-picker-CXfnfmuH.js} +2 -2
- package/dist/client/assets/{combobox-DGrx2JGy.js → combobox--XoXA5uu.js} +2 -2
- package/dist/client/assets/{command-DR1GjC1a.js → command-E2aLhsct.js} +2 -2
- package/dist/client/assets/composer-logic-BPTz1APL.js +6 -0
- package/dist/client/assets/{composerDraftUploads-DK6jH0cB.js → composerDraftUploads-b_0oxKs9.js} +2 -2
- package/dist/client/assets/{connect-B1NcR-kN.js → connect-CU9dNvTt.js} +2 -2
- package/dist/client/assets/{connect-agent-BNrm24qs.js → connect-agent-Byc9PCdW.js} +2 -2
- package/dist/client/assets/{design-CbG6XJYX.js → design-CoGbXd61.js} +2 -2
- package/dist/client/assets/{device-6R-yC55P.js → device-DmH6IHQ4.js} +2 -2
- package/dist/client/assets/{dialog-BwjzOzO6.js → dialog-CBBxT1gk.js} +2 -2
- package/dist/client/assets/{diffRendering-CG_sb5me.js → diffRendering-BOVFJuWd.js} +2 -2
- package/dist/client/assets/{dist-CFar2AY1.js → dist-B2P3f-0Q.js} +3 -3
- package/dist/client/assets/{draft-input-CpqOZR5i.js → draft-input-CSOOVntS.js} +2 -2
- package/dist/client/assets/{duoViewer-BhE8QUaC.js → duoViewer-BhHYrurM.js} +2 -2
- package/dist/client/assets/{dynamic-CIBySV57.js → dynamic-BhzrutAo.js} +2 -2
- package/dist/client/assets/{embeddedScripts-B0vXhhvs.js → embeddedScripts-43_R83vp.js} +2 -2
- package/dist/client/assets/{empty-C0oiFHy_.js → empty-FOL5U4KY.js} +2 -2
- package/dist/client/assets/entities-Bqo0n1Pb.js +2 -0
- package/dist/client/assets/{fileLinks-CP5NWXaI.js → fileLinks-D4GSqJYj.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-BKVd4HrC.js → fileTreeExpansion-BBT5F8P1.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-CIK5OMl_.js → getDiffFileInput-CGw09SPI.js} +2 -2
- package/dist/client/assets/{guideRunStore-CegZr43-.js → guideRunStore-DvIkVECt.js} +2 -2
- package/dist/client/assets/{htmlRender-NqJI2UJ2.js → htmlRender-CmEeFzCo.js} +2 -2
- package/dist/client/assets/{index-Czsz7nXH.js → index-B1djVqM4.js} +3 -3
- package/dist/client/assets/{input-BCWES8Y7.js → input-ekYqAkUx.js} +2 -2
- package/dist/client/assets/{input-group-CfPOCEuC.js → input-group-C3pxk97H.js} +2 -2
- package/dist/client/assets/{kbd-EDrgCOls.js → kbd-3FPzNikV.js} +2 -2
- package/dist/client/assets/{keybindings-BG7j7M7S.js → keybindings-B3oDRRkK.js} +2 -2
- package/dist/client/assets/{lazy-D6W01WxZ.js → lazy-DyNR0b0B.js} +4 -4
- package/dist/client/assets/{lazyRouteComponent-B8CSLurY.js → lazyRouteComponent-BPxq_G_s.js} +2 -2
- package/dist/client/assets/{link-COzhJ6br.js → link-B3B5a5Ju.js} +2 -2
- package/dist/client/assets/{linkedPrompt-X4NBlFef.js → linkedPrompt-BsCPMHxQ.js} +2 -2
- package/dist/client/assets/main-BWh6jqG2.js +29 -0
- package/dist/client/assets/main-DdVSHl80.css +2 -0
- package/dist/client/assets/{mediaReference-CKap6oNP.js → mediaReference-Bb8H-qbI.js} +2 -2
- package/dist/client/assets/{mediaSource-DG5l5-5f.js → mediaSource-C2MsZgy8.js} +2 -2
- package/dist/client/assets/number-field-SoHEiP55.js +2 -0
- package/dist/client/assets/{observeResize-BUAH1dvA.js → observeResize-3Vj9DYOV.js} +2 -2
- package/dist/client/assets/{onboarding-CnVH7A6c.js → onboarding-CPgiVEVK.js} +2 -2
- package/dist/client/assets/{openFileInPreview-B0i3eZpu.js → openFileInPreview-BBWCOLh_.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-0RRo3hX4.js → p4ProjectFile-qmvlbzKv.js} +2 -2
- package/dist/client/assets/{pair-B4KNAPh5.js → pair-CZnRGdd8.js} +2 -2
- package/dist/client/assets/{pendingSendStore-Dzn7x7Cg.js → pendingSendStore-L5KquCDf.js} +2 -2
- package/dist/client/assets/{phoneViewer-RhpfiwR2.js → phoneViewer-D-8v-sMf.js} +2 -2
- package/dist/client/assets/{pierre-icons-Cisj4-__.js → pierre-icons-jwqMPUxD.js} +2 -2
- package/dist/client/assets/{popover-BnqKHl4L.js → popover-OfG3wVsl.js} +2 -2
- package/dist/client/assets/{preview-CiojYkh4.js → preview-BYnEURcB.js} +2 -2
- package/dist/client/assets/{preview-Dwq2O7nm.js → preview-DGdQ5Ycc.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-ByZNhmNc.js → previewMiniPlayerStore-Dlbj5KrZ.js} +2 -2
- package/dist/client/assets/primary-B47ivN3o.js +2 -0
- package/dist/client/assets/primaryCloudLinkState-CreqR0gU.js +2 -0
- package/dist/client/assets/projectFilesQueryState-CanWrACx.js +2 -0
- package/dist/client/assets/{projectScriptEditor-B4iSq27p.js → projectScriptEditor-gWuw6vwd.js} +2 -2
- package/dist/client/assets/{providerSkills-C4Fu_qyq.js → providerSkills-C_Rxqah9.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-BmYDDw_8.js → pullRequestDetail.logic-RASi2EgP.js} +4 -4
- package/dist/client/assets/{pullRequestIcons-DFcQ9rtl.js → pullRequestIcons-ucGaXXG7.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-BGzKslrq.js → pullRequestReviewStore-CEr41DEl.js} +2 -2
- package/dist/client/assets/pullRequests-Bw3Ui6hK.js +2 -0
- package/dist/client/assets/queries-EslKFJTV.js +2 -0
- package/dist/client/assets/query-d1pQlqP0.js +2 -0
- package/dist/client/assets/{radio-group-DOHTpBxX.js → radio-group-Ciy_K5uE.js} +2 -2
- package/dist/client/assets/{renderScheduler-Df4T8RWh.js → renderScheduler-CP-JkmKx.js} +2 -2
- package/dist/client/assets/rightPanelStore-D3KOmuPa.js +2 -0
- package/dist/client/assets/runtime-DR7JxgbQ.js +6 -0
- package/dist/client/assets/runtime-d6B1vJeH.js +3 -0
- package/dist/client/assets/runtimeModeConfig-Rxeb1uGg.js +2 -0
- package/dist/client/assets/{scheduledTasksSettings.logic-7E0KSnA7.js → scheduledTasksSettings.logic-CVIC4Kpr.js} +3 -3
- package/dist/client/assets/{scroll-area-B9LorBFb.js → scroll-area-yyfi3ycu.js} +2 -2
- package/dist/client/assets/{select-Ctq0UILH.js → select-DaYjjw1q.js} +2 -2
- package/dist/client/assets/selfImproveFindings-1XIHD-7i.js +2 -0
- package/dist/client/assets/server-sXApTCjZ.js +2 -0
- package/dist/client/assets/{session-C7ckxjAM.js → session-C949OsEI.js} +2 -2
- package/dist/client/assets/session-logic-DkSfwnHl.js +26 -0
- package/dist/client/assets/{settings-BqhxEPKC.js → settings-B0O54Q3P.js} +2 -2
- package/dist/client/assets/{settings.appearance-DljtCz6-.js → settings.appearance-BesXhA1a.js} +2 -2
- package/dist/client/assets/settings.archived-FtcZf_Ug.js +2 -0
- package/dist/client/assets/settings.computer-use-BeKmLbNe.js +2 -0
- package/dist/client/assets/settings.connections-D1UxckE0.js +2 -0
- package/dist/client/assets/{settings.data-controls-Cdccmn63.js → settings.data-controls-lPiIwMgc.js} +2 -2
- package/dist/client/assets/settings.decisions-D97jIUyr.js +2 -0
- package/dist/client/assets/{settings.designs-TeCw-uLf.js → settings.designs-B473PRvt.js} +2 -2
- package/dist/client/assets/settings.diagnostics-DDOaOIDg.js +2 -0
- package/dist/client/assets/{settings.general-uxwywmhh.js → settings.general-qzEOE2zF.js} +2 -2
- package/dist/client/assets/settings.integrations-D6ctQ9WI.js +2 -0
- package/dist/client/assets/{settings.keybindings-C0FBNk1_.js → settings.keybindings-BL57H4sD.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-wMwaYCss.js → settings.open-source-licenses-DaS82UhN.js} +2 -2
- package/dist/client/assets/{settings.plugins-CFiDE3ms.js → settings.plugins-DnS3RrT2.js} +4 -4
- package/dist/client/assets/{settings.projects-DN0n2td7.js → settings.projects-D-ZICXey.js} +4 -4
- package/dist/client/assets/settings.providers-CFpCmv0o.js +3 -0
- package/dist/client/assets/{settings.scheduled-tasks-uCL4Wgvt.js → settings.scheduled-tasks-IEAC3STn.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-C4OHP0nR.js → settings.snap-shot-BaOFk9WR.js} +2 -2
- package/dist/client/assets/{settings.source-control-pMBspYC4.js → settings.source-control-BW16AA5z.js} +2 -2
- package/dist/client/assets/{settings.storage-QCydiEyw.js → settings.storage-D4vBYBRP.js} +2 -2
- package/dist/client/assets/settingsLayout-CFQx1XDM.js +3 -0
- package/dist/client/assets/{sidebar-CRr8B41y.js → sidebar-C1E4GqL6.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-miDXfjI3.js → sidebarProjectGrouping-9cUrCOXH.js} +2 -2
- package/dist/client/assets/{skeleton-C9J-Xl06.js → skeleton-BCpBrYxh.js} +2 -2
- package/dist/client/assets/{sourceControl-C8nJMDiL.js → sourceControl-DwJWPP0h.js} +2 -2
- package/dist/client/assets/{sourceControlClients-DKONtKbZ.js → sourceControlClients-BBJW7ra4.js} +2 -2
- package/dist/client/assets/{spinner-CNva85zM.js → spinner-CSTrcxhP.js} +2 -2
- package/dist/client/assets/{terminal-links-BJzLp7ix.js → terminal-links-D18LpQ1T.js} +2 -2
- package/dist/client/assets/{terminalSessions-BPc8sBGR.js → terminalSessions-C2NUFncF.js} +2 -2
- package/dist/client/assets/{textarea-DjRGRzMg.js → textarea-R4UQ47Ns.js} +2 -2
- package/dist/client/assets/{themePalette-fhKYLCuU.js → themePalette-neUNWCzK.js} +3 -3
- package/dist/client/assets/toast-B84QdqqM.js +2 -0
- package/dist/client/assets/{toggle-Bbnow7xY.js → toggle-BH5BGBcD.js} +2 -2
- package/dist/client/assets/{toggle-group-Cilo8czD.js → toggle-group-Di3SFV73.js} +2 -2
- package/dist/client/assets/{tooltip-T5ePvxsH.js → tooltip-D-GRl-oZ.js} +2 -2
- package/dist/client/assets/{uiStateStore-D9r3BNZ-.js → uiStateStore-xSkh4_PU.js} +2 -2
- package/dist/client/assets/{usage-QBPLx2wr.js → usage-DUdXloVo.js} +2 -2
- package/dist/client/assets/{usageAccess-DUfVA8nU.js → usageAccess-DSLF-sRE.js} +2 -2
- package/dist/client/assets/{usageFormat-C-mTuUS7.js → usageFormat-Bzyvr9m4.js} +2 -2
- package/dist/client/assets/{usageShortcuts-CB6TvooP.js → usageShortcuts-D6nQeRtx.js} +2 -2
- package/dist/client/assets/{use-atom-command-BNkv9iyk.js → use-atom-command-DA6OG-Qk.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-D5HM2KLM.js → useAriaLabelledBy-PLuOxvFb.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-DntRaFvm.js → useHandleNewThread-Dm0SCq59.js} +2 -2
- package/dist/client/assets/{useLocation-DbWity7H.js → useLocation-Bqc94klS.js} +2 -2
- package/dist/client/assets/{useNavigate-Cxh24teV.js → useNavigate-DdjG4MB_.js} +2 -2
- package/dist/client/assets/{useNavigateBack-B5mTfIHJ.js → useNavigateBack-sP0LsL3p.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-sjWWPvrn.js → useP4ConnectAuthPrompt-C9d7n33S.js} +2 -2
- package/dist/client/assets/{useParams-D9PdK0IA.js → useParams-DZQvRQLJ.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-D6i3IaCj.js → usePermissionStatus-BzfAUU9X.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-9274Vp3W.js → usePullRequestActions-DIjGLg1E.js} +3 -3
- package/dist/client/assets/{useRegisterFieldControl-DZyLTxKX.js → useRegisterFieldControl-CyBVe0G0.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-CmlQi7Iz.js → useScopedModelAvailability-D4n22Nmm.js} +2 -2
- package/dist/client/assets/useSettings-CaJMqrvF.js +3 -0
- package/dist/client/assets/utils-BoMYW9A3.js +37 -0
- package/dist/client/assets/vcsRefInvalidation-w_CQ3i43.js +2 -0
- package/dist/client/assets/{welcome-DVusCS_L.js → welcome-BIKH3rbU.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{renderer-CJXpJ36b.mjs → renderer-CveKT929.mjs} +26 -3
- package/dist/{runtime-EqYv-lrV.mjs → runtime-DGGSjC6Q.mjs} +148 -4
- package/package.json +1 -1
- package/dist/client/assets/AlertDialogRoot-BUODcEy9.js +0 -2
- package/dist/client/assets/ChatGptUsageButton-CMIjZ66V.js +0 -2
- package/dist/client/assets/ComposerPromptEditor-D2ObH3Py.js +0 -204
- package/dist/client/assets/DiffPanel-BGnRzWM8.js +0 -2
- package/dist/client/assets/EmbeddedDesign-BV_FcJ4l.js +0 -21
- package/dist/client/assets/EmbeddedDesign-Cud7UEy4.css +0 -1
- package/dist/client/assets/Input-DLaKk0qb.js +0 -2
- package/dist/client/assets/JZOYTAAL-SLYGD65P.js +0 -1
- package/dist/client/assets/PanelLayoutControls-CqeL3uQz.js +0 -216
- package/dist/client/assets/PreviewPanel-CvBQAq3I.js +0 -2
- package/dist/client/assets/ProjectDefaultsSettings-DLJfUN7i.js +0 -2
- package/dist/client/assets/ProviderModelPicker-AkULlCAn.js +0 -2
- package/dist/client/assets/PullRequestCodeTab-BamXVeZz.js +0 -6
- package/dist/client/assets/ScheduledTasksSettings-DF_KhqLx.js +0 -4
- package/dist/client/assets/TooltipViewport-C14m3uB7.js +0 -2
- package/dist/client/assets/_chat-BIqme2Hz.js +0 -46
- package/dist/client/assets/_chat.pull-requests-BDLRkW2A.js +0 -2
- package/dist/client/assets/assets-D-xsxvzf.js +0 -2
- package/dist/client/assets/composer-logic-BW4G8aDL.js +0 -6
- package/dist/client/assets/entities-Om5Klild.js +0 -2
- package/dist/client/assets/main-BGaSDXjP.js +0 -29
- package/dist/client/assets/main-BP1f3auf.css +0 -2
- package/dist/client/assets/number-field-DGdBjQD2.js +0 -2
- package/dist/client/assets/primary-CMwTDEi1.js +0 -2
- package/dist/client/assets/primaryCloudLinkState-2j4MjqVh.js +0 -2
- package/dist/client/assets/projectFilesQueryState-DXrTSOqg.js +0 -2
- package/dist/client/assets/pullRequests-DT0oG7tF.js +0 -2
- package/dist/client/assets/queries-CXgT6mki.js +0 -2
- package/dist/client/assets/query-DlK0I8Jc.js +0 -2
- package/dist/client/assets/rightPanelStore-DXw7-xK3.js +0 -2
- package/dist/client/assets/runtime-BL7IF4n-.js +0 -3
- package/dist/client/assets/runtime-Dm3Pi31_.js +0 -6
- package/dist/client/assets/runtimeModeConfig-_-kQoAWi.js +0 -2
- package/dist/client/assets/server-BvxyePeo.js +0 -2
- package/dist/client/assets/session-logic-P8gC-UQc.js +0 -26
- package/dist/client/assets/settings.archived-SsFK0IFf.js +0 -2
- package/dist/client/assets/settings.computer-use-CVmc70Ib.js +0 -2
- package/dist/client/assets/settings.connections-BrPlTKQ_.js +0 -2
- package/dist/client/assets/settings.decisions-pkwqjsKP.js +0 -2
- package/dist/client/assets/settings.diagnostics-BZD1uMGP.js +0 -2
- package/dist/client/assets/settings.integrations-Du282Gn7.js +0 -2
- package/dist/client/assets/settings.providers-DeUZZg7C.js +0 -3
- package/dist/client/assets/settingsLayout-DFYjWgKN.js +0 -3
- package/dist/client/assets/toast-BcjbmUtS.js +0 -2
- package/dist/client/assets/useSettings-BL4ZWGQV.js +0 -3
- package/dist/client/assets/utils-CrFJwxSd.js +0 -37
- package/dist/client/assets/vcsRefInvalidation-BPy1eoDi.js +0 -2
package/dist/client/assets/{settings.data-controls-Cdccmn63.js → settings.data-controls-lPiIwMgc.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-DH3P2YXY.js";import{t as n}from"./jsx-runtime-BnjsACtP.js";import{
|
|
2
|
-
//# sourceMappingURL=settings.data-controls-
|
|
1
|
+
import{a as e,t}from"./react-DH3P2YXY.js";import{t as n}from"./jsx-runtime-BnjsACtP.js";import{Qs as r,dr as i,q_ as a,ts as o}from"./utils-BoMYW9A3.js";import{W as s}from"./runtime-DR7JxgbQ.js";import{A as c,J as l,V as u,q as d}from"./entities-Bqo0n1Pb.js";import{Gt as f,Ht as p}from"./runtime-d6B1vJeH.js";import{t as m}from"./link-B3B5a5Ju.js";import{q as h}from"./useSettings-CaJMqrvF.js";import{o as g}from"./session-C949OsEI.js";import{g as _}from"./queries-EslKFJTV.js";import{r as v}from"./SettingsPanels-BfBUSBAG.js";import{i as y}from"./assetUrls-CmOUMX2M.js";import{_ as b,x}from"./composer-logic-BPTz1APL.js";import{h as S}from"./composerDraftUploads-b_0oxKs9.js";import{V as C,a as w,i as T,s as E}from"./settingsLayout-CFQx1XDM.js";import{t as D}from"./legalLinks-C4VP5hPh.js";var O=e(t(),1),k=e(n(),1);function A(){let{scope:e,search:t,connectedEnvironments:n}=C(),A=c(),j=o((0,O.useMemo)(()=>d({environmentIds:e.environmentIds,shellStateValueAtom:l.stateValueAtom}),[e.environmentIds])),M=x(e.environmentIds),N=g(n,a),{changedSettingLabels:P,restoreDefaults:F}=v(),I=S(u.archive,{reportFailure:!1}),{deleteThread:L}=b(),R=y(_.v2.threadProjection,{reportFailure:!1}),[z,B]=(0,O.useState)(null),V=(0,O.useRef)(!1),[H,U]=(0,O.useState)(null),[W,G]=(0,O.useState)(null),K=e.kind===`project`||e.kind===`checkout`?new Set(e.members.map(e=>`${e.environmentId}:${e.id}`)):null,q=[...new Map([...A,...M.snapshots.flatMap(({environmentId:e,snapshot:t})=>t.threads.map(t=>p(e,t)))].filter(t=>e.environmentIds.includes(t.environmentId)&&(K===null||K.has(`${t.environmentId}:${t.projectId}`))).map(e=>[`${e.environmentId}:${e.id}`,e])).values()],J=q.filter(e=>e.archivedAt===null&&f(e.runtime)),Y=j&&e.environmentIds.length>0&&!M.isLoading&&!M.error&&e.environmentIds.every(e=>n.some(t=>t.environmentId===e)&&M.snapshots.some(t=>t.environmentId===e)),X=Y&&e.environmentIds.every(e=>N.has(e)),Z=async t=>{if(V.current)return;V.current=!0,B(t===`export`?t:`confirm`),U(null),G(null);let n=t===`archive`?J:q,i=0;try{if(t!==`export`&&!await h().dialogs.confirm(t===`delete`?`Permanently delete all ${n.length} chats in ${e.label}, including archived chats? This cannot be undone.`:`Archive ${n.length} inactive chats in ${e.label}? Active chats stay open. You can restore archived chats later.`,{variant:t===`delete`?`destructive`:`default`}))return;B(t);let a=[];for(let e of n){let n=r(e.environmentId,e.id);if(t===`export`){let t=await R({environmentId:e.environmentId,input:{threadId:e.id}});if(t._tag===`Failure`)throw s(t);a.push({environmentId:e.environmentId,thread:t.value.thread,messages:t.value.messages})}else{let r=t===`archive`?await I({environmentId:e.environmentId,input:{threadId:e.id}}):await L(n);if(r._tag===`Failure`)throw s(r)}i++}if(t===`export`){let e=URL.createObjectURL(new Blob([JSON.stringify({version:1,exportedAt:new Date().toISOString(),conversations:a},null,2)],{type:`application/json`})),t=document.createElement(`a`);t.href=e,t.download=`p4-chats-${new Date().toISOString().slice(0,10)}.json`,t.click(),setTimeout(()=>URL.revokeObjectURL(e),1e3)}U(`${i} chats ${t===`archive`?`archived`:t===`delete`?`deleted`:`exported`}.`)}catch(e){G(`${i} of ${n.length} completed. ${e instanceof Error?e.message:`The action failed. Try again.`}`)}finally{M.refresh(),V.current=!1,B(null)}};return(0,k.jsxs)(T,{width:`wide`,children:[(0,k.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Data controls`}),(0,k.jsxs)(E,{title:`Data controls`,hideTitle:!0,id:`data-controls`,children:[(0,k.jsx)(w,{title:`Connected devices and access`,description:`Manage pairing links, devices, and access to your environments.`,control:(0,k.jsx)(i,{variant:`soft`,size:`sm`,render:(0,k.jsx)(m,{to:`/settings/connections`,search:t}),children:`Manage`})}),(0,k.jsx)(w,{title:`Model training`,description:`Your provider account controls how it uses your chats. P4 cannot change that preference for you.`,control:(0,k.jsx)(i,{variant:`soft`,size:`sm`,render:(0,k.jsx)(m,{to:`/settings/providers`,search:t}),children:`Providers`})}),(0,k.jsx)(w,{title:`Network access`,description:`Manage how devices connect to your P4 server.`,control:(0,k.jsx)(i,{variant:`soft`,size:`sm`,render:(0,k.jsx)(m,{to:`/settings/connections`,search:t}),children:`Manage`})}),(0,k.jsx)(w,{title:`Reset preferences`,description:`Restore default appearance and behavior settings. Your chats and provider credentials are kept.`,control:(0,k.jsx)(i,{variant:`destructive-outline`,size:`sm`,disabled:!!z||!P.length,onClick:()=>void F(),children:`Reset`})}),(0,k.jsx)(w,{title:`MCP access`,description:`Manage the MCP servers available to agents and their sign-ins.`,control:(0,k.jsx)(i,{variant:`soft`,size:`sm`,render:(0,k.jsx)(m,{to:`/settings/plugins`,hash:`mcp-servers`,search:t}),children:`Manage`})}),(0,k.jsx)(w,{title:`Archived chats`,control:(0,k.jsx)(i,{variant:`soft`,size:`sm`,render:(0,k.jsx)(m,{to:`/settings/archived`,search:t}),children:`Manage`})}),(0,k.jsx)(w,{title:`Archive all chats`,description:`Archives inactive chats in the selected scope.`,control:(0,k.jsx)(i,{variant:`soft`,size:`sm`,disabled:!!z||!X||!J.length,onClick:()=>void Z(`archive`),children:z===`archive`?`Archiving…`:`Archive all`})}),(0,k.jsx)(w,{title:`Delete all chats`,description:`Permanently deletes chats in the selected scope, including the archive.`,control:(0,k.jsx)(i,{variant:`destructive-outline`,size:`sm`,disabled:!!z||!X||!q.length,onClick:()=>void Z(`delete`),children:z===`delete`?`Deleting…`:`Delete all`})}),(0,k.jsx)(w,{title:`Export chat data`,description:`Download chat metadata and messages as JSON. Attachment files and tool output are not included.`,control:(0,k.jsx)(i,{variant:`soft`,size:`sm`,disabled:!!z||!Y||!q.length,onClick:()=>void Z(`export`),children:z===`export`?`Exporting…`:`Export`})}),(0,k.jsx)(w,{title:`Privacy policy`,control:(0,k.jsx)(i,{variant:`soft`,size:`sm`,render:(0,k.jsx)(`a`,{href:D,target:`_blank`,rel:`noreferrer`}),children:`Read`})})]}),W||M.error?(0,k.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:W??M.error}):null,H?(0,k.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:H}):null,Y?null:(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect all environments in this scope and wait for chats to load to use bulk actions.`})]})}var j=A;export{j as component};
|
|
2
|
+
//# sourceMappingURL=settings.data-controls-lPiIwMgc.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Dy as i,Eb as a,Ht as o,Jt as s,Nt as c,Oy as l,Vt as u,dr as d,qc as f,t as p,ts as m}from"./utils-BoMYW9A3.js";import{a as h,c as g,o as _,s as v,t as y}from"./select-DaYjjw1q.js";import{f as b,t as x}from"./server-sXApTCjZ.js";import{n as S}from"./query-d1pQlqP0.js";import{t as C}from"./use-atom-command-DA6OG-Qk.js";import{i as w}from"./usageFormat-Bzyvr9m4.js";import{t as T}from"./input-ekYqAkUx.js";import{F as E,L as D,R as O,V as k,a as A,i as j,n as M,s as N}from"./settingsLayout-CFQx1XDM.js";import{va as P}from"./main-BWh6jqG2.js";import{t as ee}from"./ProviderModelPicker-DJQYH_Pp.js";import{i as F}from"./selfImproveFindings-1XIHD-7i.js";var I=e(t(),1),L=n(),R={off:`Off`,shadow:`Record decisions only`,dispatch:`Review turns`},te={off:`Finished turns are not checked.`,shadow:`Decisions judges finished turns; nothing is reviewed.`,dispatch:`Reviewers suggest memories from turns Decisions judges worth a review.`};function ne(e){return e.checkedTurns===0||e.lastCheckedAt===null?null:`${`${e.checkedTurns} ${e.checkedTurns===1?`turn`:`turns`} checked`} · ${e.reviewTurns} worth a review · last ${w(e.lastCheckedAt)}`}function re(e){return e.mode===`off`?null:e.hasDecisionKey?e.mode===`dispatch`&&e.reviewerCount===0?`Choose a reviewer below. Without one, no review runs.`:null:`Needs an OpenRouter key above. No turn is judged until one is saved.`}function z(e,t,n){if(n===null)return e.filter((e,n)=>n!==t);let r=e[t],i=r&&r.instanceId===n.instanceId&&r.model===n.model?r:{instanceId:n.instanceId,model:n.model};return t<e.length?e.map((e,n)=>n===t?i:e):[...e,i]}var B=e(r(),1),ie=a(f);function V(e){let t=(0,L.c)(8),n=!e.open,r=e.open?`grid-rows-[1fr] opacity-100`:`grid-rows-[0fr] opacity-0`,i;t[0]===r?i=t[1]:(i=p(`grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-opacity`,r),t[0]=r,t[1]=i);let a;t[2]===e.children?a=t[3]:(a=(0,B.jsx)(`div`,{className:`min-h-0 overflow-hidden`,children:e.children}),t[2]=e.children,t[3]=a);let o;return t[4]!==n||t[5]!==i||t[6]!==a?(o=(0,B.jsx)(`div`,{inert:n,className:i,children:a}),t[4]=n,t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function H(e){let[t,n]=(0,I.useState)(e);return e!==null&&e!==t&&n(e),t}function U(e){let t=(0,L.c)(6),n=H(e.text),r=e.text!==null,i=e.text?`status`:void 0,a;t[0]!==n||t[1]!==i?(a=(0,B.jsx)(`p`,{role:i,className:`pt-0.5 text-xs text-warning`,children:n}),t[0]=n,t[1]=i,t[2]=a):a=t[2];let o;return t[3]!==r||t[4]!==a?(o=(0,B.jsx)(V,{open:r,children:a}),t[3]=r,t[4]=a,t[5]=o):o=t[5],o}function W(){let e=(0,L.c)(3),{scope:t,environment:n}=k(),r=t.environmentIds.length===1?n?.environmentId??null:null,i=n?.connection.phase===`connected`&&n.serverConfig!==null,a;return e[0]!==i||e[1]!==r?(a=(0,B.jsx)(N,{title:`Self-improvement`,children:r&&i?(0,B.jsx)(G,{environmentId:r}):(0,B.jsx)(A,{title:`Review finished turns`,description:`Pick a single connected environment to set up self-improvement for it.`})}),e[0]=i,e[1]=r,e[2]=a):a=e[2],a}function G(e){let t=(0,L.c)(57),{environmentId:n}=e,{environment:r,target:i}=k(),a=E(),l;t[0]===n?l=t[1]:(l=b.selfImproveSettingsLive({environmentId:n,input:{}}),t[0]=n,t[1]=l);let p=S(l),h;t[2]===n?h=t[3]:(h=b.updateSelfImproveSettings.permissionAtom(n),t[2]=n,t[3]=h);let w=m(h),T=C(b.updateSelfImproveSettings),[D,O]=(0,I.useState)(!1),j=p.data,N=r?.serverConfig?.providers??x,P,F,V,H;if(t[4]!==w||t[5]!==n||t[6]!==D||t[7]!==j||t[8]!==p.error||t[9]!==a||t[10]!==N||t[11]!==i?.projectId||t[12]!==T){H=Symbol.for(`react.early_return_sentinel`);bb0:{let e=N.filter(q),r=s(u(o(e),a,i?.projectId??null)),l=r.find(K);if(!j){let e=p.error?`Couldn't load self-improvement settings.`:`Loading…`,n;t[17]===e?n=t[18]:(n=(0,B.jsx)(A,{title:`Review finished turns`,status:e}),t[17]=e,t[18]=n),H=n;break bb0}let m=!w||D,h;t[19]!==n||t[20]!==T?(h=async e=>{O(!0),await T({environmentId:n,input:e}),O(!1)},t[19]=n,t[20]=T,t[21]=h):h=t[21];let b=h,x=j.mode===`dispatch`,S=j.mode,C=!!a.decisionOpenRouterKey,E;t[22]!==j.mode||t[23]!==j.reviewers.length||t[24]!==C?(E=re({mode:S,hasDecisionKey:C,reviewerCount:j.reviewers.length}),t[22]=j.mode,t[23]=j.reviewers.length,t[24]=C,t[25]=E):E=t[25];let k=E,I=t=>{let i=j.reviewers[t],o=t===0||j.reviewers.length>0,s=i?r.find(e=>e.instanceId===i.instanceId):void 0,u=i&&(!s||!s.enabled||!s.isAvailable)?`${s?.displayName??i.instanceId} is unavailable, so this reviewer is skipped.`:null,f=t===0?`First reviewer`:`Second reviewer`;return(0,B.jsx)(A,{title:f,"aria-disabled":!x||!o||void 0,className:`transition-opacity duration-200 ease-out motion-reduce:transition-none`,status:(0,B.jsx)(U,{text:x?u:null}),control:i||l?(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[(0,B.jsx)(ee,{environmentId:n,activeInstanceId:i?.instanceId??l.instanceId,model:i?.model??``,lockedProvider:null,instanceEntries:r,modelOptionsByInstance:c(a,e,i?.instanceId??null,i?.model??null),triggerClassName:M,triggerAriaLabel:f,...i?{}:{triggerLabel:`Choose model`},disabled:m||!x||!o,onInstanceModelChange:(e,n)=>void b({mode:j.mode,reviewers:z(j.reviewers,t,{instanceId:e,model:n})})}),i?(0,B.jsx)(d,{size:`sm`,variant:`outline`,disabled:m||!x,onClick:()=>void b({mode:j.mode,reviewers:z(j.reviewers,t,null)}),children:`Remove`}):null]}):(0,B.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No reviewer models available.`})},f)},L=te[j.mode],W;t[26]===j?W=t[27]:(W=ne(j),t[26]=j,t[27]=W);let G;t[28]===k?G=t[29]:(G=(0,B.jsx)(U,{text:k}),t[28]=k,t[29]=G);let J;t[30]!==W||t[31]!==G?(J=(0,B.jsxs)(B.Fragment,{children:[W,G]}),t[30]=W,t[31]=G,t[32]=J):J=t[32];let Y;t[33]!==j.mode||t[34]!==j.reviewers||t[35]!==b?(Y=e=>{ie(e)&&e!==j.mode&&b({mode:e,reviewers:j.reviewers})},t[33]=j.mode,t[34]=j.reviewers,t[35]=b,t[36]=Y):Y=t[36];let X=R[j.mode],Z;t[37]===X?Z=t[38]:(Z=(0,B.jsx)(v,{"aria-label":`Review finished turns`,children:(0,B.jsx)(g,{children:X})}),t[37]=X,t[38]=Z);let Q;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,B.jsx)(_,{children:f.literals.map(ae)}),t[39]=Q):Q=t[39];let $;t[40]!==m||t[41]!==j.mode||t[42]!==Y||t[43]!==Z?($=(0,B.jsxs)(y,{value:j.mode,disabled:m,onValueChange:Y,children:[Z,Q]}),t[40]=m,t[41]=j.mode,t[42]=Y,t[43]=Z,t[44]=$):$=t[44],t[45]!==L||t[46]!==J||t[47]!==$?(P=(0,B.jsx)(A,{id:`self-improve-mode`,title:`Review finished turns`,description:L,status:J,control:$}),t[45]=L,t[46]=J,t[47]=$,t[48]=P):P=t[48],F=I(0),V=I(1)}t[4]=w,t[5]=n,t[6]=D,t[7]=j,t[8]=p.error,t[9]=a,t[10]=N,t[11]=i?.projectId,t[12]=T,t[13]=P,t[14]=F,t[15]=V,t[16]=H}else P=t[13],F=t[14],V=t[15],H=t[16];if(H!==Symbol.for(`react.early_return_sentinel`))return H;let W;t[49]!==n||t[50]!==j.memoryMirror?(W=(0,B.jsx)(J,{environmentId:n,mirror:j.memoryMirror}),t[49]=n,t[50]=j.memoryMirror,t[51]=W):W=t[51];let G;return t[52]!==P||t[53]!==F||t[54]!==V||t[55]!==W?(G=(0,B.jsxs)(B.Fragment,{children:[P,F,V,W]}),t[52]=P,t[53]=F,t[54]=V,t[55]=W,t[56]=G):G=t[56],G}function ae(e){return(0,B.jsx)(h,{value:e,children:R[e]},e)}function K(e){return e.enabled&&e.isAvailable}function q(e){return e.supportsTextGeneration!==!1}function J(e){let t=(0,L.c)(37),[n,r]=(0,I.useState)(``),[i,a]=(0,I.useState)(!1),[o,s]=(0,I.useState)(null),c;t[0]===e.environmentId?c=t[1]:(c=b.setSelfImproveMemoryMirror.permissionAtom(e.environmentId),t[0]=e.environmentId,t[1]=c);let l=m(c),u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u={reportFailure:!1},t[2]=u):u=t[2];let f=C(b.setSelfImproveMemoryMirror,u),p=!l||i,h;t[3]!==e.environmentId||t[4]!==f?(h=async t=>{a(!0);let n=F(await f({environmentId:e.environmentId,input:{memoryMirror:t}}),`Couldn't set the mirror.`);s(n.ok?null:n.message),n.ok&&r(``),a(!1)},t[3]=e.environmentId,t[4]=f,t[5]=h):h=t[5];let g=h,_=e.mirror??`Not mirrored`,v;t[6]===o?v=t[7]:(v=(0,B.jsx)(U,{text:o}),t[6]=o,t[7]=v);let y;t[8]!==_||t[9]!==v?(y=(0,B.jsxs)(B.Fragment,{children:[_,v]}),t[8]=_,t[9]=v,t[10]=y):y=t[10];let x;t[11]!==p||t[12]!==g||t[13]!==n?(x=e=>{e.preventDefault(),n.trim()&&!p&&g(n.trim())},t[11]=p,t[12]=g,t[13]=n,t[14]=x):x=t[14];let S=e.mirror?`Replace repository path`:`/path/to/repository`,w;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>r(e.target.value),t[15]=w):w=t[15];let E;t[16]!==p||t[17]!==n||t[18]!==S?(E=(0,B.jsx)(`div`,{className:`min-w-40 flex-1`,children:(0,B.jsx)(T,{"aria-label":`Mirror saved memory`,autoComplete:`off`,value:n,disabled:p,placeholder:S,onChange:w})}),t[16]=p,t[17]=n,t[18]=S,t[19]=E):E=t[19];let D;t[20]!==p||t[21]!==n?(D=p||!n.trim(),t[20]=p,t[21]=n,t[22]=D):D=t[22];let O;t[23]===D?O=t[24]:(O=(0,B.jsx)(d,{type:`submit`,size:`sm`,disabled:D,children:`Save`}),t[23]=D,t[24]=O);let k;t[25]!==p||t[26]!==g||t[27]!==e.mirror?(k=e.mirror?(0,B.jsx)(d,{type:`button`,size:`sm`,variant:`outline`,disabled:p,onClick:()=>void g(null),children:`Remove`}):null,t[25]=p,t[26]=g,t[27]=e.mirror,t[28]=k):k=t[28];let j;t[29]!==O||t[30]!==k||t[31]!==x||t[32]!==E?(j=(0,B.jsxs)(`form`,{className:`flex max-w-lg flex-wrap items-center gap-2 pb-2`,onSubmit:x,children:[E,O,k]}),t[29]=O,t[30]=k,t[31]=x,t[32]=E,t[33]=j):j=t[33];let M;return t[34]!==j||t[35]!==y?(M=(0,B.jsx)(A,{title:`Mirror saved memory`,description:`A git checkout. Each save copies the changed files into its memory folder, commits them on the default branch, and pushes.`,status:y,children:j}),t[34]=j,t[35]=y,t[36]=M):M=t[36],M}function Y(){let e=(0,L.c)(28),t=E(X),n=O(),r=D(),[i,a]=(0,I.useState)(``),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[`decisionOpenRouterKey`],e[0]=o):o=e[0];let s;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,B.jsxs)(B.Fragment,{children:[`Used by Jev and Luna Decisions.`,` `,(0,B.jsx)(`a`,{href:`https://openrouter.ai/settings/keys`,target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2`,children:`Get an API key`})]}),e[1]=s):s=e[1];let c=t?`Key saved`:`No key saved`,l;e[2]!==r||e[3]!==i||e[4]!==n?(l=e=>{e.preventDefault(),i.trim()&&r&&(n({decisionOpenRouterKey:i.trim()}),a(``))},e[2]=r,e[3]=i,e[4]=n,e[5]=l):l=e[5];let u=!r,f=t?`Replace saved key`:`API key`,p;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>a(e.target.value),e[6]=p):p=e[6];let m;e[7]!==i||e[8]!==u||e[9]!==f?(m=(0,B.jsx)(`div`,{className:`min-w-40 flex-1`,children:(0,B.jsx)(T,{"aria-label":`OpenRouter API key`,type:`password`,autoComplete:`off`,value:i,disabled:u,placeholder:f,onChange:p})}),e[7]=i,e[8]=u,e[9]=f,e[10]=m):m=e[10];let h;e[11]!==r||e[12]!==i?(h=!r||!i.trim(),e[11]=r,e[12]=i,e[13]=h):h=e[13];let g;e[14]===h?g=e[15]:(g=(0,B.jsx)(d,{type:`submit`,size:`sm`,disabled:h,children:`Save`}),e[14]=h,e[15]=g);let _;e[16]!==r||e[17]!==t||e[18]!==n?(_=t&&(0,B.jsx)(d,{type:`button`,size:`sm`,variant:`outline`,disabled:!r,onClick:()=>n({decisionOpenRouterKey:``}),children:`Remove`}),e[16]=r,e[17]=t,e[18]=n,e[19]=_):_=e[19];let v;e[20]!==_||e[21]!==l||e[22]!==m||e[23]!==g?(v=(0,B.jsxs)(`form`,{className:`flex max-w-lg flex-wrap items-center gap-2`,onSubmit:l,children:[m,g,_]}),e[20]=_,e[21]=l,e[22]=m,e[23]=g,e[24]=v):v=e[24];let y;return e[25]!==v||e[26]!==c?(y=(0,B.jsx)(A,{title:`OpenRouter API key`,serverScoped:!0,settingKeys:o,description:s,status:c,children:v}),e[25]=v,e[26]=c,e[27]=y):y=e[27],y}function X(e){return!!e.decisionOpenRouterKey}function Z(){let e=(0,L.c)(26),t=E(),n=O(),r=D(),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[`decisionModel`],e[0]=o):o=e[0];let s=!r,c;e[1]===n?c=e[2]:(c=e=>{a(l)(e)&&n({decisionModel:e})},e[1]=n,e[2]=c);let u=i[t.decisionModel],d;e[3]===u?d=e[4]:(d=(0,B.jsx)(v,{"aria-label":`Decision model`,children:(0,B.jsx)(g,{children:u})}),e[3]=u,e[4]=d);let f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,B.jsx)(_,{children:l.literals.map(Q)}),e[5]=f):f=e[5];let p;e[6]!==t.decisionModel||e[7]!==s||e[8]!==c||e[9]!==d?(p=(0,B.jsx)(A,{id:`decision-model`,title:`Decision model`,serverScoped:!0,settingKeys:o,description:`Fast, structured answers for agents, fit scores on question options, and Computer Use navigation.`,control:(0,B.jsxs)(y,{value:t.decisionModel,disabled:s,onValueChange:c,children:[d,f]})}),e[6]=t.decisionModel,e[7]=s,e[8]=c,e[9]=d,e[10]=p):p=e[10];let m;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,B.jsx)(Y,{}),e[11]=m):m=e[11];let h;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(h=[`decisionVisionEnabled`],e[12]=h):h=e[12];let b=!r,x;e[13]===n?x=e[14]:(x=e=>n({decisionVisionEnabled:e}),e[13]=n,e[14]=x);let S;e[15]!==t.decisionVisionEnabled||e[16]!==x||e[17]!==b?(S=(0,B.jsx)(A,{title:`Computer Use vision`,serverScoped:!0,settingKeys:h,description:`Use screenshots with Decisions to suggest navigation targets. Jev vision is experimental.`,control:(0,B.jsx)(P,{"aria-label":`Computer Use vision`,checked:t.decisionVisionEnabled,disabled:b,onCheckedChange:x})}),e[15]=t.decisionVisionEnabled,e[16]=x,e[17]=b,e[18]=S):S=e[18];let C;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,B.jsx)(A,{title:`What is shared`,description:`Decision requests send their text and any included images to the selected service. Computer Use vision also sends screenshots. Keys stay in this environment's secret store.`}),e[19]=C):C=e[19];let w;e[20]!==S||e[21]!==p?(w=(0,B.jsxs)(N,{title:`Decisions`,children:[p,m,S,C]}),e[20]=S,e[21]=p,e[22]=w):w=e[22];let T;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,B.jsx)(W,{}),e[23]=T):T=e[23];let k;return e[24]===w?k=e[25]:(k=(0,B.jsxs)(j,{children:[w,T]}),e[24]=w,e[25]=k),k}function Q(e){return(0,B.jsx)(h,{value:e,children:i[e]},e)}var $=Z;export{$ as component};
|
|
2
|
+
//# sourceMappingURL=settings.decisions-D97jIUyr.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{
|
|
2
|
-
//# sourceMappingURL=settings.designs-
|
|
1
|
+
import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Jn as i,Lm as a,Os as o,Qs as s,Zs as c,as as l,dr as u,lm as d,tE as f,ts as p}from"./utils-BoMYW9A3.js";import{j as m,w as h}from"./entities-Bqo0n1Pb.js";import{a as g,c as _,o as v,s as y,t as b}from"./select-DaYjjw1q.js";import{t as x}from"./useNavigate-DdjG4MB_.js";import{q as S}from"./useSettings-CaJMqrvF.js";import{n as C}from"./query-d1pQlqP0.js";import{t as w}from"./use-atom-command-DA6OG-Qk.js";import{u as T}from"./rightPanelStore-D3KOmuPa.js";import{a as E,n as D,t as O}from"./tooltip-D-GRl-oZ.js";import{t as k}from"./ProjectFavicon-_6hkSNzm.js";import{n as A,r as j,t as M}from"./input-group-C3pxk97H.js";import{t as N}from"./DesignPageTile-rWwXWJ2J.js";import{a as P,l as F,n as I,r as L,s as R,u as z}from"./design-CoGbXd61.js";import{n as B}from"./useHandleNewThread-Dm0SCq59.js";import{V,i as H,s as U}from"./settingsLayout-CFQx1XDM.js";var W=n(),G=e(t(),1),K=e(r(),1),q={all:`All designs`,project:`Project designs`,other:`Other designs`};function J(){let e=(0,W.c)(57),{scope:t}=V(),n=h(),[r,i]=(0,G.useState)(``),[a,s]=(0,G.useState)(`all`),c;bb0:{if(t.kind===`unavailable`){let t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],c=t;break bb0}if(t.kind===`project`||t.kind===`checkout`){let r;e[1]===t.members?r=e[2]:(r=new Set(t.members.map(ee)),e[1]=t.members,e[2]=r);let i=r,a;if(e[3]!==n||e[4]!==i){let t;e[6]===i?t=e[7]:(t=e=>i.has(`${e.environmentId}:${e.id}`),e[6]=i,e[7]=t),a=n.filter(t),e[3]=n,e[4]=i,e[5]=a}else a=e[5];c=a;break bb0}if(t.kind===`environment`){let r;if(e[8]!==n||e[9]!==t.environmentId){let i;e[11]===t.environmentId?i=e[12]:(i=e=>e.environmentId===t.environmentId,e[11]=t.environmentId,e[12]=i),r=n.filter(i),e[8]=n,e[9]=t.environmentId,e[10]=r}else r=e[10];c=r;break bb0}c=n}let u=c,m;e[13]===u?m=e[14]:(m=l(e=>u.map(t=>{let n=e(I({environmentId:t.environmentId,projectId:t.id})),r=f(o(n));return{project:t,items:r?F({paths:r.paths,entries:r.entries??null,linkedPaths:[]}):[],loading:n.waiting&&!r,failed:n._tag===`Failure`}})),e[13]=u,e[14]=m);let g=p(m),x;e[15]===g?x=e[16]:(x=g.reduce($,0),e[15]=g,e[16]=x);let S=x,C,w,T,E,D,O,k;if(e[17]!==g||e[18]!==r||e[19]!==a){let t;e[27]!==r||e[28]!==a?(t=e=>{let t=e.items.filter(e=>(a===`all`||e.group===a)&&z(e,r));return t.length||e.failed?[{...e,items:t}]:[]},e[27]=r,e[28]=a,e[29]=t):t=e[29],k=g.flatMap(t);let n;e[30]===g?n=e[31]:(n=g.some(Q),e[30]=g,e[31]=n),w=n,C=H,T=`wide`,e[32]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,K.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Designs`}),e[32]=E):E=e[32];let o;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(A,{children:(0,K.jsx)(d,{"aria-hidden":!0})}),e[33]=o):o=e[33];let c;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>i(e.currentTarget.value),e[34]=c):c=e[34];let l;e[35]===r?l=e[36]:(l=(0,K.jsxs)(M,{children:[o,(0,K.jsx)(j,{type:`search`,"aria-label":`Search designs`,placeholder:`Search designs`,value:r,onChange:c})]}),e[35]=r,e[36]=l);let u;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>e&&s(e),e[37]=u):u=e[37];let f;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsx)(y,{"aria-label":`Filter designs`,children:(0,K.jsx)(_,{children:Z})}),e[38]=f):f=e[38];let p;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(p=Object.keys(q),e[39]=p):p=e[39];let m;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(v,{children:p.map(X)}),e[40]=m):m=e[40];let h;e[41]===a?h=e[42]:(h=(0,K.jsxs)(b,{value:a,onValueChange:u,children:[f,m]}),e[41]=a,e[42]=h),e[43]!==l||e[44]!==h?(D=(0,K.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-[minmax(0,1fr)_11rem]`,children:[l,h]}),e[43]=l,e[44]=h,e[45]=D):D=e[45],O=k.map(Y),e[17]=g,e[18]=r,e[19]=a,e[20]=C,e[21]=w,e[22]=T,e[23]=E,e[24]=D,e[25]=O,e[26]=k}else C=e[20],w=e[21],T=e[22],E=e[23],D=e[24],O=e[25],k=e[26];let N;e[46]!==w||e[47]!==S||e[48]!==k.length?(N=k.length?null:(0,K.jsx)(`p`,{id:`designs`,role:`status`,className:`py-8 text-center text-sm text-muted-foreground`,children:w?`Loading designs…`:S?`No designs match your filters.`:`No designs yet. Ask an agent in any thread to start one.`}),e[46]=w,e[47]=S,e[48]=k.length,e[49]=N):N=e[49];let P;return e[50]!==C||e[51]!==T||e[52]!==E||e[53]!==D||e[54]!==O||e[55]!==N?(P=(0,K.jsxs)(C,{width:T,children:[E,D,O,N]}),e[50]=C,e[51]=T,e[52]=E,e[53]=D,e[54]=O,e[55]=N,e[56]=P):P=e[56],P}function Y(e,t){let{project:n,items:r,failed:i}=e;return(0,K.jsx)(te,{id:t===0?`designs`:void 0,project:n,items:r,failed:i},`${n.environmentId}:${n.id}`)}function X(e){return(0,K.jsx)(g,{value:e,children:q[e]},e)}function Z(e){return q[e]}function Q(e){return e.loading}function $(e,t){return e+t.items.length}function ee(e){return`${e.environmentId}:${e.id}`}function te({id:e,project:t,items:n,failed:r}){let i=(0,G.useMemo)(()=>[c(t.environmentId,t.id)],[t.environmentId,t.id]),a=m(i),o=C(I({environmentId:t.environmentId,projectId:t.id})),s=p(L.permissionAtom(t.environmentId)),l=w(L,{reportFailure:!0}),[d,f]=(0,G.useState)(null),h=(0,G.useMemo)(()=>{let e=new Map;for(let t of a)if(!(t.archivedAt!==null||t.deletedAt!==null||t.worktreePath))for(let n of t.designs)e.set(n.path,[...e.get(n.path)??[],t]);return e},[a]),g=Date.now(),_=async e=>{if(await S().dialogs.confirm(`Delete ${e.path} and its assets folder from ${t.title}? This cannot be undone.`,{variant:`destructive`})){f(e.path);try{(await l({environmentId:t.environmentId,input:{projectId:t.id,documentPath:e.path}}))._tag===`Success`&&o.refresh()}finally{f(null)}}};return(0,K.jsxs)(U,{id:e,title:t.title,icon:(0,K.jsx)(k,{project:t}),headerAction:(0,K.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[n.length,` `,n.length===1?`design`:`designs`]}),children:[r?(0,K.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-3 px-4 py-4 text-sm text-destructive-foreground`,children:[(0,K.jsx)(`p`,{children:`Designs in this project could not be loaded.`}),(0,K.jsx)(u,{variant:`outline`,size:`sm`,onClick:o.refresh,children:`Retry`})]}):null,n.map(e=>(0,K.jsx)(ne,{project:t,item:e,meta:R(e,g),threads:h.get(e.path)??[],canDelete:s,deleting:d===e.path,onDelete:()=>void _(e)},e.path))]})}function ne(e){let t=(0,W.c)(48),{project:n,item:r,meta:o,threads:l,canDelete:d,deleting:f,onDelete:p}=e,m=x(),h=B(),g;t[0]!==r.modifiedAt||t[1]!==r.path||t[2]!==n.environmentId||t[3]!==n.id?(g=P({environmentId:n.environmentId,projectId:n.id},r.path,r.modifiedAt??``),t[0]=r.modifiedAt,t[1]=r.path,t[2]=n.environmentId,t[3]=n.id,t[4]=g):g=t[4];let _=C(g),v;t[5]===l?v=t[6]:(v=l.toSorted(re),t[5]=l,t[6]=v);let y=v[0],b;t[7]!==h||t[8]!==r.path||t[9]!==y||t[10]!==m||t[11]!==n.environmentId||t[12]!==n.id?(b=async()=>{if(y){let e=s(y.environmentId,y.id);T.getState().openFile(e,r.path),await m({to:`/$environmentId/$threadId`,params:{environmentId:e.environmentId,threadId:e.threadId}});return}let e=await h(c(n.environmentId,n.id),{envMode:`local`,worktreePath:null});e&&T.getState().openFile({environmentId:n.environmentId,threadId:e.threadId},r.path)},t[7]=h,t[8]=r.path,t[9]=y,t[10]=m,t[11]=n.environmentId,t[12]=n.id,t[13]=b):b=t[13];let S=b,w=_.error?null:_.data?.dataUrl,k;t[14]!==r.pageCount||t[15]!==w?(k=(0,K.jsx)(N,{size:`lg`,pageCount:r.pageCount,thumbnail:w}),t[14]=r.pageCount,t[15]=w,t[16]=k):k=t[16];let A;t[17]===r.name?A=t[18]:(A=(0,K.jsx)(`p`,{className:`truncate text-sm font-medium`,children:r.name}),t[17]=r.name,t[18]=A);let j;t[19]===r.group?j=t[20]:(j=r.group===`other`?(0,K.jsx)(i,{variant:`outline`,size:`sm`,children:`Other`}):null,t[19]=r.group,t[20]=j);let M;t[21]!==A||t[22]!==j?(M=(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[A,j]}),t[21]=A,t[22]=j,t[23]=M):M=t[23];let F;t[24]===o?F=t[25]:(F=(0,K.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:o}),t[24]=o,t[25]=F);let I;t[26]!==l[0]||t[27]!==l.length?(I=l.length?(0,K.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:l.length===1?`Linked to ${l[0].title||`Untitled chat`}`:`Linked to ${l.length} chats`}):null,t[26]=l[0],t[27]=l.length,t[28]=I):I=t[28];let L;t[29]!==I||t[30]!==M||t[31]!==F?(L=(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[M,F,I]}),t[29]=I,t[30]=M,t[31]=F,t[32]=L):L=t[32];let R=`Delete ${r.name}`,z=!d||f,V;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,K.jsx)(a,{"aria-hidden":!0}),t[33]=V):V=t[33];let H;t[34]!==p||t[35]!==R||t[36]!==z?(H=(0,K.jsx)(E,{render:(0,K.jsx)(u,{variant:`ghost-destructive`,size:`icon-sm`,"aria-label":R,disabled:z,onClick:p,children:V})}),t[34]=p,t[35]=R,t[36]=z,t[37]=H):H=t[37];let U;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,K.jsx)(D,{children:`Delete design`}),t[38]=U):U=t[38];let G;t[39]===H?G=t[40]:(G=(0,K.jsxs)(O,{children:[H,U]}),t[39]=H,t[40]=G);let q;t[41]===S?q=t[42]:(q=(0,K.jsx)(u,{variant:`soft`,size:`sm`,onClick:()=>void S(),children:`Open`}),t[41]=S,t[42]=q);let J;return t[43]!==L||t[44]!==G||t[45]!==q||t[46]!==k?(J=(0,K.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3`,children:[k,L,G,q]}),t[43]=L,t[44]=G,t[45]=q,t[46]=k,t[47]=J):J=t[47],J}function re(e,t){return t.updatedAt.localeCompare(e.updatedAt)}var ie=J;export{ie as component};
|
|
2
|
+
//# sourceMappingURL=settings.designs-B473PRvt.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{$d as i,$u as a,B_ as o,Df as s,H_ as c,JT as l,Qw as u,Vf as d,dr as f,dx as p,eE as m,fp as h,fr as g,md as _,nf as v,q_ as y,qf as b,rE as x,rf as ee,sE as te,t as S,tE as ne,td as C,ts as w,wf as re}from"./utils-BoMYW9A3.js";import{R as ie,W as ae}from"./runtime-DR7JxgbQ.js";import{f as T,l as E,p as D}from"./TooltipViewport-ZmVCer7P.js";import{i as O,p as k}from"./toast-B84QdqqM.js";import{D as A,q as oe}from"./useSettings-CaJMqrvF.js";import{f as j}from"./server-sXApTCjZ.js";import{i as se,n as ce,t as le}from"./session-C949OsEI.js";import{n as ue}from"./query-d1pQlqP0.js";import{t as de}from"./use-atom-command-DA6OG-Qk.js";import{a as M,o as N,u as fe}from"./timestampFormat-wac2e_Jz.js";import{a as P,n as F,t as I}from"./tooltip-D-GRl-oZ.js";import{n as pe,t as me}from"./toggle-group-Di3SFV73.js";import{t as he}from"./input-ekYqAkUx.js";import{t as L}from"./scroll-area-yyfi3ycu.js";import{F as ge,V as _e,i as ve,s as R,u as z}from"./settingsLayout-CFQx1XDM.js";import{t as B}from"./ConnectionStatusDot-CixsTBXI.js";import{Oa as ye,Ta as be,Zt as V,vi as xe}from"./main-BWh6jqG2.js";import{t as Se}from"./usageAccess-DSLF-sRE.js";import{t as H}from"./ExpandableText-Cpm1gOKG.js";import{t as U}from"./SettingsScopeNotice-H7UzC9bb.js";var W=n(),G=e(r(),1);function K(e){let t=(0,W.c)(19),{disabled:n,onSignal:r}=e,i;t[0]===r?i=t[1]:(i=()=>r(`SIGINT`),t[0]=r,t[1]=i);let a;t[2]!==n||t[3]!==i?(a=(0,G.jsx)(P,{render:(0,G.jsx)(g,{disabled:n,"aria-label":`Send SIGINT`,tone:`muted`,onClick:i,children:`INT`})}),t[2]=n,t[3]=i,t[4]=a):a=t[4];let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.jsx)(F,{side:`top`,children:`Send SIGINT`}),t[5]=o):o=t[5];let s;t[6]===a?s=t[7]:(s=(0,G.jsxs)(I,{children:[a,o]}),t[6]=a,t[7]=s);let c;t[8]===r?c=t[9]:(c=()=>r(`SIGKILL`),t[8]=r,t[9]=c);let l;t[10]!==n||t[11]!==c?(l=(0,G.jsx)(P,{render:(0,G.jsx)(g,{disabled:n,"aria-label":`Send SIGKILL`,tone:`destructive`,onClick:c,children:`KILL`})}),t[10]=n,t[11]=c,t[12]=l):l=t[12];let u;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,G.jsx)(F,{side:`top`,children:`Send SIGKILL`}),t[13]=u):u=t[13];let d;t[14]===l?d=t[15]:(d=(0,G.jsxs)(I,{children:[l,u]}),t[14]=l,t[15]=d);let f;return t[16]!==s||t[17]!==d?(f=(0,G.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[s,d]}),t[16]=s,t[17]=d,t[18]=f):f=t[18],f}var q=e(t(),1);function Ce(e){let t=(0,W.c)(10),n=A(),r=e===void 0?n?.environmentId??null:e,i=se(r,o),a;t[0]!==i||t[1]!==r?(a=r===null||!i?null:j.resourceTelemetry({environmentId:r,input:{}}),t[0]=i,t[1]=r,t[2]=a):a=t[2];let s=ue(a),c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[3]=c):c=t[3];let l=de(j.retryResourceTelemetry,c),d;t[4]!==r||t[5]!==l?(d=async()=>{if(r===null)throw Error(`No environment is selected.`);if(!ce(r,`environment:maintain`)||!ce(r,`diagnostics:read`))throw Error(`This connection cannot restart the resource monitor.`);let e=await l({environmentId:r,input:{}});if(e._tag===`Failure`)throw u(e.cause);return e.value.snapshot},t[4]=r,t[5]=l,t[6]=d):d=t[6];let f=d,p;return t[7]!==s||t[8]!==f?(p={...s,retry:f},t[7]=s,t[8]=f,t[9]=p):p=t[9],p}function we(e,t){let n=(0,W.c)(4),r=A(),i=t===void 0?r?.environmentId??null:t,a=se(i,o),s;return n[0]!==a||n[1]!==i||n[2]!==e?(s=i===null||!a?null:j.resourceTelemetryHistory({environmentId:i,input:e}),n[0]=a,n[1]=i,n[2]=e,n[3]=s):s=n[3],ue(s)}function J(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Te(e,t){let n=new Map;for(let t of e){let e=n.get(t.ppid)??[];e.push(t),n.set(t.ppid,e)}let r=new Set,i=e=>{for(let t of n.get(e)??[]){let e=J(t);r.has(e)||(r.add(e),i(t.identity.pid))}};for(let n of e)t.has(J(n))&&i(n.identity.pid);return e.filter(e=>!r.has(J(e)))}function Ee(e){return e.nativeStatus===null&&e.error!==null||e.nativeStatus===`degraded`||e.nativeStatus===`unavailable`||e.nativeStatus===`stopped`}function Y(e){return e.value<=0?0:Math.max(e.minimumVisiblePercent,e.value/Math.max(1,e.max)*100)}function De(e){return Math.max(1,...e.map(e=>e.avgCpuPercent))}var Oe=[{label:`5m`,windowMs:3e5,bucketMs:15e3},{label:`15m`,windowMs:9e5,bucketMs:3e4},{label:`30m`,windowMs:18e5,bucketMs:6e4},{label:`1h`,windowMs:36e5,bucketMs:12e4}];function ke(e){return`${V(e)}/s`}function Ae(e){let t=e/1e3;if(t<60)return`${t.toFixed(t>=10?1:2)}s`;let n=t/60;return n<60?`${n.toFixed(n>=10?1:2)}m`:`${(n/60).toFixed(2)}h`}function je(e){return e<1e3?`${Math.round(e)} µs`:e<1e6?`${(e/1e3).toFixed(2)} ms`:`${(e/1e6).toFixed(2)} s`}function Me(e){if(e<1e3)return`${Math.max(0,Math.round(e))} ms`;let t=e/1e3;return`${t.toLocaleString(void 0,{maximumFractionDigits:1})} ${t===1?`second`:`seconds`}`}function Ne(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Pe(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Fe(e){if(e.name.trim())return e.name;let t=(e.command.trim().split(/\s+/)[0]??e.command).replace(/^['"]|['"]$/g,``);return t.split(/[\\/]/).findLast(e=>e.length>0)??t}function Ie(e){switch(e){case`server`:return`Server`;case`server-child`:return`Backend child`;case`provider-root`:return`Provider`;case`terminal-root`:return`Terminal`;case`electron-main`:return`Electron main`;case`electron-renderer`:return`Renderer`;case`electron-gpu`:return`GPU`;case`electron-utility`:return`Electron utility`;case`resource-monitor`:return`Monitor`;case`unknown-p4`:return`P4 process`}}function Le(e){return e===`resource-monitor`?`bg-warning`:e.startsWith(`electron-`)?`bg-info`:e===`server`?`bg-violet-500`:`bg-success`}function Re(e){switch(e){case`storage`:return`Storage bytes`;case`logical`:return`Logical bytes`;case`all-io`:return`All I/O bytes`;case`unavailable`:return`Unavailable`}}function ze(e,t){return e===`true`?t.true:e===`false`?t.false:`Unknown`}function Be(e){return e===`healthy`?`default`:e===`starting`||e===`degraded`?`warning`:`danger`}function Ve(e){let t=(0,W.c)(20),{label:n,status:r,presentation:i}=e,a;t[0]!==i?.tone||t[1]!==r?(a=i?.tone??Be(r),t[0]=i?.tone,t[1]=r,t[2]=a):a=t[2];let o=a,s=o===`neutral`&&`border-border/70 bg-muted/45 text-muted-foreground`,c=o==="default"&&`border-success/25 bg-success/10 text-success-foreground`,l=o===`warning`&&`border-warning/30 bg-warning/10 text-warning-foreground`,u=o===`danger`&&`border-destructive/30 bg-destructive/10 text-destructive`,d;t[3]!==s||t[4]!==c||t[5]!==l||t[6]!==u?(d=S(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-3xs font-semibold uppercase tracking-widest`,s,c,l,u),t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d):d=t[7];let f=o===`neutral`&&`bg-muted-foreground/55`,p=o==="default"&&`bg-success`,m=o===`warning`&&`bg-warning`,h=o===`danger`&&`bg-destructive`,g;t[8]!==h||t[9]!==f||t[10]!==p||t[11]!==m?(g=S(`size-1.5 rounded-full`,f,p,m,h),t[8]=h,t[9]=f,t[10]=p,t[11]=m,t[12]=g):g=t[12];let _;t[13]===g?_=t[14]:(_=(0,G.jsx)(`span`,{className:g}),t[13]=g,t[14]=_);let v=i?.label??r,y;return t[15]!==n||t[16]!==_||t[17]!==v||t[18]!==d?(y=(0,G.jsxs)(`span`,{className:d,children:[_,n,` `,v]}),t[15]=n,t[16]=_,t[17]=v,t[18]=d,t[19]=y):y=t[19],y}function He(e){let t=(0,W.c)(9),{sampledAt:n}=e;if(z(),!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/55`,children:`Waiting for sample`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=M(p(n)),t[1]=n,t[2]=r);let i=r;if(!i){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/55`,children:`Waiting for sample`}),t[3]=e):e=t[3],e}let a;t[4]===i.value?a=t[5]:(a=(0,G.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),t[4]=i.value,t[5]=a);let o=i.suffix?` ${i.suffix}`:``,s;return t[6]!==a||t[7]!==o?(s=(0,G.jsxs)(`span`,{className:`text-2xs text-muted-foreground/60`,children:[`Updated `,a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function Ue(e){let t=(0,W.c)(19),{icon:n,label:r,value:i,detail:a,tone:o}=e,s=o===void 0?`default`:o,c;t[0]===n?c=t[1]:(c=(0,G.jsx)(`span`,{className:`text-muted-foreground/55 transition-colors group-hover:text-foreground/65`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=(0,G.jsx)(`span`,{className:`truncate`,children:r}),t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[c,l]}),t[4]=c,t[5]=l,t[6]=u):u=t[6];let d=s===`warning`&&`text-warning-foreground`,f=s===`danger`&&`text-destructive`,p;t[7]!==d||t[8]!==f?(p=S(`mt-2.5 truncate font-mono text-2xl font-semibold tracking-tighter tabular-nums text-foreground`,d,f),t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==p||t[11]!==i?(m=(0,G.jsx)(`div`,{className:p,children:i}),t[10]=p,t[11]=i,t[12]=m):m=t[12];let h;t[13]===a?h=t[14]:(h=a?(0,G.jsx)(`div`,{className:`mt-1.5 truncate text-3xs text-muted-foreground/60`,children:a}):null,t[13]=a,t[14]=h);let g;return t[15]!==u||t[16]!==m||t[17]!==h?(g=(0,G.jsxs)(`div`,{className:`group min-w-0 px-4 py-4 sm:px-5`,children:[u,m,h]}),t[15]=u,t[16]=m,t[17]=h,t[18]=g):g=t[18],g}function We(e){let t=(0,W.c)(37),{label:n,accentClass:r,aggregate:i}=e,a;t[0]===r?a=t[1]:(a=S(`absolute inset-x-5 top-0 h-0.5 rounded-full opacity-75`,r),t[0]=r,t[1]=a);let o;t[2]===a?o=t[3]:(o=(0,G.jsx)(`span`,{className:a}),t[2]=a,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,G.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/75`,children:n}),t[4]=n,t[5]=s);let c=i.processCount===1?`process`:`processes`,l;t[6]!==i.processCount||t[7]!==c?(l=(0,G.jsxs)(`div`,{className:`rounded-md bg-muted/55 px-1.5 py-0.5 font-mono text-3xs tabular-nums text-muted-foreground/70`,children:[i.processCount,` `,c]}),t[6]=i.processCount,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==s||t[10]!==l?(u=(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[s,l]}),t[9]=s,t[10]=l,t[11]=u):u=t[11];let d;t[12]===i.currentCpuPercent?d=t[13]:(d=i.currentCpuPercent.toFixed(1),t[12]=i.currentCpuPercent,t[13]=d);let f=`${d}%`,p;t[14]===f?p=t[15]:(p=(0,G.jsx)(Ge,{label:`CPU`,value:f}),t[14]=f,t[15]=p);let m;t[16]===i.currentRssBytes?m=t[17]:(m=V(i.currentRssBytes),t[16]=i.currentRssBytes,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,G.jsx)(Ge,{label:`Memory`,value:m}),t[18]=m,t[19]=h);let g;t[20]===i.ioReadBytesPerSecond?g=t[21]:(g=ke(i.ioReadBytesPerSecond),t[20]=i.ioReadBytesPerSecond,t[21]=g);let _;t[22]===g?_=t[23]:(_=(0,G.jsx)(Ge,{label:`Read`,value:g}),t[22]=g,t[23]=_);let v;t[24]===i.ioWriteBytesPerSecond?v=t[25]:(v=ke(i.ioWriteBytesPerSecond),t[24]=i.ioWriteBytesPerSecond,t[25]=v);let y;t[26]===v?y=t[27]:(y=(0,G.jsx)(Ge,{label:`Write`,value:v}),t[26]=v,t[27]=y);let b;t[28]!==h||t[29]!==_||t[30]!==y||t[31]!==p?(b=(0,G.jsxs)(`div`,{className:`mt-3.5 grid grid-cols-2 gap-x-4 gap-y-2.5`,children:[p,h,_,y]}),t[28]=h,t[29]=_,t[30]=y,t[31]=p,t[32]=b):b=t[32];let x;return t[33]!==b||t[34]!==o||t[35]!==u?(x=(0,G.jsxs)(`div`,{className:`relative overflow-hidden border-t border-border/60 px-4 py-4 first:border-t-0 md:border-t-0 md:border-l md:first:border-l-0 sm:px-5`,children:[o,u,b]}),t[33]=b,t[34]=o,t[35]=u,t[36]=x):x=t[36],x}function Ge(e){let t=(0,W.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,G.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/45`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,G.jsx)(`div`,{className:`truncate font-mono text-xs font-medium tabular-nums text-foreground/90`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,G.jsxs)(`div`,{className:`min-w-0`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Ke(e){let t=(0,W.c)(21),{label:n,health:r}=e,i;t[0]!==r.lastError||t[1]!==r.status?(i=r.status===`unavailable`&&l(r.lastError,Ye),t[0]=r.lastError,t[1]=r.status,t[2]=i):i=t[2];let a=i,o;t[3]===n?o=t[4]:(o=(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:n}),t[3]=n,t[4]=o);let s;t[5]!==a||t[6]!==r.lastError?(s=a?`Available when this page runs inside the desktop app.`:te(r.lastError,{onNone:Je,onSome:qe}),t[5]=a,t[6]=r.lastError,t[7]=s):s=t[7];let c;t[8]===s?c=t[9]:(c=(0,G.jsx)(`div`,{className:`mt-1 text-2xs leading-relaxed text-muted-foreground/65`,children:s}),t[8]=s,t[9]=c);let u;t[10]!==o||t[11]!==c?(u=(0,G.jsxs)(`div`,{className:`min-w-0`,children:[o,c]}),t[10]=o,t[11]=c,t[12]=u):u=t[12];let d;t[13]===a?d=t[14]:(d=a?{label:`Desktop only`,tone:`neutral`}:void 0,t[13]=a,t[14]=d);let f;t[15]!==r.status||t[16]!==d?(f=(0,G.jsx)(Ve,{label:``,status:r.status,presentation:d}),t[15]=r.status,t[16]=d,t[17]=f):f=t[17];let p;return t[18]!==u||t[19]!==f?(p=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-t border-border/50 py-3 first:border-t-0`,children:[u,f]}),t[18]=u,t[19]=f,t[20]=p):p=t[20],p}function qe(e){return e}function Je(){return`No reported errors`}function Ye(e){return e.includes(`'web' mode`)}function Xe(e){let t=(0,W.c)(10),{label:n,value:r,valueClassName:i}=e,a;t[0]===n?a=t[1]:(a=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/75`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=S(`min-w-0 truncate text-right font-mono text-2xs tabular-nums text-foreground/85`,i),t[2]=i,t[3]=o);let s;t[4]!==o||t[5]!==r?(s=(0,G.jsx)(`span`,{className:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==s?(c=(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-border/50 py-2.5 first:border-t-0`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function Ze(e){let t=(0,W.c)(8),{selectedWindowMs:n,onSelect:r}=e,i=String(n),a;t[0]===i?a=t[1]:(a=[i],t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=e=>{let t=Oe.find(t=>String(t.windowMs)===e[0]);t&&r(t.windowMs)},t[2]=r,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=Oe.map(Qe),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,G.jsx)(pe,{"aria-label":`Resource history period`,variant:`segmented`,value:a,onValueChange:o,children:s}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}function Qe(e){return(0,G.jsx)(me,{value:String(e.windowMs),children:e.label},e.windowMs)}function $e(e){let t=(0,W.c)(15),{buckets:n}=e,r,i,a,o;if(t[0]!==n){let e=De(n),s=Math.max(1,...n.map(et));a=`border-t border-border/60 px-4 py-4 sm:px-5`;let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-foreground/70`}),` CPU average`]}),t[5]=c):c=t[5];let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-info/70`}),` I/O reads`]}),t[6]=l):l=t[6],t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-3xs text-muted-foreground/65`,children:[c,l,(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-warning/80`}),` I/O writes`]})]}),t[7]=o):o=t[7],r=`flex h-32 items-end gap-1 overflow-hidden rounded-lg border border-border/40 bg-muted/8 px-2 pt-3 pb-2`,i=n.map(t=>{let n=Y({value:t.avgCpuPercent,max:e,minimumVisiblePercent:2}),r=Y({value:t.ioReadBytes,max:s,minimumVisiblePercent:1}),i=Y({value:t.ioWriteBytes,max:s,minimumVisiblePercent:1});return(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsxs)(`div`,{className:`grid h-full min-w-1 flex-1 grid-cols-3 items-end gap-px`,children:[(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-foreground/65`,style:{height:`${n}%`}}),(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-info/70`,style:{height:`${r}%`}}),(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-warning/80`,style:{height:`${i}%`}})]})}),(0,G.jsx)(F,{side:`top`,className:`text-left`,children:(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,G.jsxs)(`div`,{children:[`CPU avg `,t.avgCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`div`,{children:[`CPU peak `,t.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`div`,{children:[`Read `,V(t.ioReadBytes)]}),(0,G.jsxs)(`div`,{children:[`Write `,V(t.ioWriteBytes)]})]})})]},p(t.startedAt))}),t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];let s;t[8]!==r||t[9]!==i?(s=(0,G.jsx)(`div`,{className:r,children:i}),t[8]=r,t[9]=i,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==o||t[13]!==s?(c=(0,G.jsxs)(`div`,{className:a,children:[o,s]}),t[11]=a,t[12]=o,t[13]=s,t[14]=c):c=t[14],c}function et(e){return e.ioReadBytes+e.ioWriteBytes}function tt(e){let t=(0,W.c)(26),{process:n,collapsed:r,onToggle:i}=e,a;t[0]===n?a=t[1]:(a=Fe(n),t[0]=n,t[1]=a);let o=a,s=n.childPids.length>0,c=`${Math.min(n.depth,7)*10}px`,l;t[2]===c?l=t[3]:(l={paddingLeft:c},t[2]=c,t[3]=l);let u;t[4]!==r||t[5]!==s||t[6]!==o||t[7]!==i||t[8]!==n?(u=s?(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost-muted`,onClick:()=>i(n),"aria-label":r?`Expand ${o}`:`Collapse ${o}`,children:(0,G.jsx)(E,{className:`size-3.5`,icon:r?D:T})}):(0,G.jsx)(`span`,{className:`size-5`,"aria-hidden":!0}),t[4]=r,t[5]=s,t[6]=o,t[7]=i,t[8]=n,t[9]=u):u=t[9];let d;t[10]===n.category?d=t[11]:(d=S(`size-1.5 rounded-full`,Le(n.category)),t[10]=n.category,t[11]=d);let p;t[12]===d?p=t[13]:(p=(0,G.jsx)(`span`,{className:d}),t[12]=d,t[13]=p);let m;t[14]===o?m=t[15]:(m=(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[14]=o,t[15]=m);let h=n.command||n.name,g;t[16]===h?g=t[17]:(g=(0,G.jsx)(F,{side:`top`,variant:`code`,children:h}),t[16]=h,t[17]=g);let _;t[18]!==m||t[19]!==g?(_=(0,G.jsxs)(I,{children:[m,g]}),t[18]=m,t[19]=g,t[20]=_):_=t[20];let v;return t[21]!==_||t[22]!==l||t[23]!==u||t[24]!==p?(v=(0,G.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,p,_]}),t[21]=_,t[22]=l,t[23]=u,t[24]=p,t[25]=v):v=t[25],v}function nt(e){return e.category===`server-child`||e.category===`provider-root`||e.category===`terminal-root`}function rt(e){let t=(0,W.c)(10),{process:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e;if(!nt(n)){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-3xs text-muted-foreground/35`,children:`—`}),t[0]=e):e=t[0],e}let o;t[1]!==n||t[2]!==i?(o=i.has(Ne(n)),t[1]=n,t[2]=i,t[3]=o):o=t[3];let s=!r||o,c;t[4]!==a||t[5]!==n?(c=e=>a(n,e),t[4]=a,t[5]=n,t[6]=c):c=t[6];let l;return t[7]!==s||t[8]!==c?(l=(0,G.jsx)(K,{disabled:s,onSignal:c}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function it(e){let t=(0,W.c)(22),{processes:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e,[o,s]=(0,q.useState)(at),c;t[0]!==o||t[1]!==n?(c=Te(n,o),t[0]=o,t[1]=n,t[2]=c):c=t[2];let l=c,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{let t=Ne(e);s(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[20%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[7%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[6%]`}),(0,G.jsx)(`col`,{className:`w-[4%]`})]}),t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,G.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read/s`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write/s`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read Total`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write Total`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,G.jsx)(`th`,{className:`px-2 py-2 text-right font-semibold sm:pr-4`,children:`Kill`})]})}),t[5]=p):p=t[5];let m;t[6]===l.length?m=t[7]:(m=l.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:11,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`Waiting for the native process monitor.`})}):null,t[6]=l.length,t[7]=m);let h;if(t[8]!==r||t[9]!==o||t[10]!==a||t[11]!==i||t[12]!==l){let e;t[14]!==r||t[15]!==o||t[16]!==a||t[17]!==i?(e=e=>(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,G.jsx)(tt,{process:e,collapsed:o.has(Ne(e)),onToggle:d})}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Ie(e.category)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:Ae(e.cpuTimeMs)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:V(e.residentBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:ke(e.ioReadBytesPerSecond)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:ke(e.ioWriteBytesPerSecond)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:V(e.ioReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{children:V(e.ioWriteBytes)})}),(0,G.jsx)(F,{side:`top`,children:Re(e.ioSemantics)})]})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.identity.pid}),(0,G.jsx)(`td`,{className:`px-2 py-2 text-right sm:pr-4`,children:(0,G.jsx)(rt,{process:e,canMaintainEnvironment:r,signalingKeys:i,onSignal:a})})]},Ne(e)),t[14]=r,t[15]=o,t[16]=a,t[17]=i,t[18]=e):e=t[18],h=l.map(e),t[8]=r,t[9]=o,t[10]=a,t[11]=i,t[12]=l,t[13]=h}else h=t[13];let g;return t[19]!==m||t[20]!==h?(g=(0,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(L,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(68vh,48rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1320px] table-fixed text-left text-xs`,children:[f,p,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[m,h]})]})})}),t[19]=m,t[20]=h,t[21]=g):g=t[21],g}function at(){return new Set}function ot(e){let t=(0,W.c)(9),{processes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[7%]`}),(0,G.jsx)(`col`,{className:`w-[5%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak Mem`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Samples`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`PID`})]})}),t[1]=i):i=t[1];let a;t[2]===n.length?a=t[3]:(a=n.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:9,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`No retained process samples in this window.`})}):null,t[2]=n.length,t[3]=a);let o;t[4]===n?o=t[5]:(o=n.map(st),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==o?(s=(0,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(L,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[28rem] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1020px] table-fixed text-left text-xs`,children:[r,i,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[a,o]})]})})}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function st(e){return(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.name||e.command})}),(0,G.jsx)(F,{side:`top`,variant:`code`,children:e.command||e.name})]})}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Ie(e.category)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:Ae(e.cpuTimeMs)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:V(e.peakRssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:V(e.ioReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:V(e.ioWriteBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.sampleCount}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground sm:pr-5`,children:e.identity.pid})]},Pe(e))}function ct(e){let t=(0,W.c)(9),{entries:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[22%]`}),(0,G.jsx)(`col`,{className:`w-[28%]`}),(0,G.jsx)(`col`,{className:`w-[14%]`}),(0,G.jsx)(`col`,{className:`w-[14%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[12%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`thead`,{className:`border-b border-border/60 text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Component`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Operation`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Read`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Write`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Count`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`Time`})]})}),t[1]=i):i=t[1];let a;t[2]===n.length?a=t[3]:(a=n.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:6,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`No instrumented application I/O has been recorded yet.`})}):null,t[2]=n.length,t[3]=a);let o;t[4]===n?o=t[5]:(o=n.map(lt),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==o?(s=(0,G.jsx)(`div`,{className:`overflow-x-auto border-t border-border/60`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[720px] table-fixed text-left text-xs`,children:[r,i,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[a,o]})]})}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function lt(e){return(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`truncate px-4 py-2 font-medium text-foreground sm:pl-5`,children:e.component}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-muted-foreground`,children:e.operation}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:V(e.logicalReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:V(e.logicalWriteBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:e.count}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground sm:pr-5`,children:[(e.durationMs/1e3).toFixed(2),`s`]})]},`${e.component}:${e.operation}`)}function ut(e){let t=(0,W.c)(207),{environmentId:n}=e,[r,i]=(0,q.useState)(9e5),o;t[0]===r?o=t[1]:(o=Oe.find(e=>e.windowMs===r)??Oe[1],t[0]=r,t[1]=o);let l=o,u=se(n,c),p=Ce(n),g=p.retry,y;t[2]!==l.bucketMs||t[3]!==l.windowMs?(y={windowMs:l.windowMs,bucketMs:l.bucketMs},t[2]=l.bucketMs,t[3]=l.windowMs,t[4]=y):y=t[4];let b=we(y,n),x;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(x={reportFailure:!1},t[5]=x):x=t[5];let S=de(j.signalProcess,x),[w,re]=(0,q.useState)(ht),T;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(T=new Set,t[6]=T):T=t[6];let E=(0,q.useRef)(T),D=(0,q.useRef)(n),k,A;t[7]===n?(k=t[8],A=t[9]):(k=()=>(D.current=n,()=>{D.current=null}),A=[n],t[7]=n,t[8]=k,t[9]=A),(0,q.useEffect)(k,A);let[le,ue]=(0,q.useState)(!1),M=p.data,N=M?.groups.allP4,fe;t[10]===S?fe=t[11]:(fe=async(e,t)=>{let n=D.current;if(n===null||!ce(n,`environment:maintain`))return;let r=Ne(e);if(E.current.has(r))return;let i=new Set(E.current).add(r);E.current=i,re(i);let a=()=>{let e=new Set(E.current);e.delete(r),E.current=e,re(e)};if(t===`SIGKILL`){let n;try{n=await oe().dialogs.confirm(`Send SIGKILL to process ${e.identity.pid}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){let n=e;a(),O.add({type:`error`,title:`Could not confirm signal`,description:n instanceof Error?n.message:`Failed to send ${t}.`});return}if(!n){a();return}}if(D.current!==n||!ce(n,`environment:maintain`)){a();return}S({environmentId:n,input:{pid:e.identity.pid,startTimeMs:e.identity.startTimeMs,signal:t}}).then(n=>{if(n._tag===`Failure`){if(ie(n))return;throw ae(n)}n.value.signaled||O.add({type:`error`,title:`Could not send ${t}`,description:m(n.value.message,()=>`Failed to send ${t} to process ${e.identity.pid}.`)})}).catch(e=>{O.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}).finally(()=>{a()})},t[10]=S,t[11]=fe);let pe=fe,me;t[12]===g?me=t[13]:(me=()=>{let e=D.current;e!==null&&ce(e,`environment:maintain`)&&(ue(!0),g().catch(mt).finally(()=>{ue(!1)}))},t[12]=g,t[13]=me);let he=me,L,ge,_e,ve,z,B,be,xe,Se,H,U,K,J,Te,Y,De,Pe,Fe,Ie;if(t[14]!==N||t[15]!==M||t[16]!==p.error||t[17]!==p.isPending||t[18]!==p.refresh){z=M?ne(M.speedLimitPercent):null;let e=M?.health.native.status??null,n;t[38]!==e||t[39]!==p.error?(n=Ee({nativeStatus:e,error:p.error}),t[38]=e,t[39]=p.error,t[40]=n):n=t[40],_e=n,ve=M!==null&&(M.power.onBattery!==`unknown`||M.power.lowPowerMode!==`unknown`||M.power.idle!==`unknown`||M.power.locked!==`unknown`||M.power.thermalState!==`unknown`),ge=R,De=`Resource monitor`,t[41]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,G.jsx)(a,{className:`size-4 text-muted-foreground`}),t[41]=Pe):Pe=t[41];let r;t[42]===M?r=t[43]:(r=M?(0,G.jsx)(Ve,{label:`Native`,status:M.health.native.status}):null,t[42]=M,t[43]=r);let i=M?.readAt??null,o;t[44]===i?o=t[45]:(o=(0,G.jsx)(He,{sampledAt:i}),t[44]=i,t[45]=o);let c;t[46]===p.isPending?c=t[47]:(c=(0,G.jsx)(ye,{size:`xs`,refreshing:p.isPending}),t[46]=p.isPending,t[47]=c);let l;t[48]!==c||t[49]!==p.isPending||t[50]!==p.refresh?(l=(0,G.jsx)(P,{render:(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost`,disabled:p.isPending,onClick:p.refresh,"aria-label":`Refresh resource telemetry`,children:c})}),t[48]=c,t[49]=p.isPending,t[50]=p.refresh,t[51]=l):l=t[51];let u;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,G.jsx)(F,{side:`top`,children:`Refresh telemetry snapshot`}),t[52]=u):u=t[52];let m;t[53]===l?m=t[54]:(m=(0,G.jsxs)(I,{children:[l,u]}),t[53]=l,t[54]=m),t[55]!==r||t[56]!==o||t[57]!==m?(Fe=(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r,o,m]}),t[55]=r,t[56]=o,t[57]=m,t[58]=Fe):Fe=t[58],Te=`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-sm/5`;let g;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:`P4 system footprint`}),(0,G.jsx)(`p`,{className:`mt-1 max-w-xl text-xs leading-relaxed text-muted-foreground`,children:`Live native counters for the server, providers, terminals, desktop processes, and the monitor itself.`})]}),t[59]=g):g=t[59];let _;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),t[60]=_):_=t[60];let y;t[61]===M?y=t[62]:(y=M?Me(M.sampleIntervalMs):`...`,t[61]=M,t[62]=y),t[63]===y?Y=t[64]:(Y=(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-border/60 bg-linear-to-r from-muted/45 via-muted/20 to-transparent px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-5`,children:[g,(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs text-muted-foreground/65`,children:[_,`Sampling every `,y]})]}),t[63]=y,t[64]=Y),xe=`grid grid-cols-2 divide-x divide-y divide-border/55 md:grid-cols-3`;let b;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,G.jsx)(v,{className:`size-3.5`}),t[65]=b):b=t[65];let x;t[66]===N?x=t[67]:(x=N?`${N.currentCpuPercent.toFixed(1)}%`:`...`,t[66]=N,t[67]=x);let te;t[68]===N?te=t[69]:(te=N?`${Ae(N.cpuTimeMs)} observed CPU time`:void 0,t[68]=N,t[69]=te),t[70]!==x||t[71]!==te?(Se=(0,G.jsx)(Ue,{icon:b,label:`Current CPU`,value:x,detail:te}),t[70]=x,t[71]=te,t[72]=Se):Se=t[72];let S;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,G.jsx)(h,{className:`size-3.5`}),t[73]=S):S=t[73];let C;t[74]===N?C=t[75]:(C=N?V(N.currentRssBytes):`...`,t[74]=N,t[75]=C);let w;t[76]===N?w=t[77]:(w=N?`${V(N.peakRssBytes)} combined process peaks`:void 0,t[76]=N,t[77]=w),t[78]!==C||t[79]!==w?(H=(0,G.jsx)(Ue,{icon:S,label:`Resident memory`,value:C,detail:w}),t[78]=C,t[79]=w,t[80]=H):H=t[80];let re;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,G.jsx)(a,{className:`size-3.5`}),t[81]=re):re=t[81];let ie=N?String(N.processCount):`...`,ae=N?`${N.processStarts} starts · ${N.processExits} exits`:void 0;t[82]!==ie||t[83]!==ae?(U=(0,G.jsx)(Ue,{icon:re,label:`Process count`,value:ie,detail:ae}),t[82]=ie,t[83]=ae,t[84]=U):U=t[84];let T;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,G.jsx)(d,{className:`size-3.5`}),t[85]=T):T=t[85];let E;t[86]===N?E=t[87]:(E=N?ke(N.ioReadBytesPerSecond):`...`,t[86]=N,t[87]=E);let D;t[88]===N?D=t[89]:(D=N?`${V(N.ioReadBytes)} observed`:void 0,t[88]=N,t[89]=D),t[90]!==E||t[91]!==D?(K=(0,G.jsx)(Ue,{icon:T,label:`Read throughput`,value:E,detail:D}),t[90]=E,t[91]=D,t[92]=K):K=t[92];let O;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,G.jsx)(ee,{className:`size-3.5`}),t[93]=O):O=t[93];let k;t[94]===N?k=t[95]:(k=N?ke(N.ioWriteBytesPerSecond):`...`,t[94]=N,t[95]=k);let A;t[96]===N?A=t[97]:(A=N?`${V(N.ioWriteBytes)} observed`:void 0,t[96]=N,t[97]=A);let oe=N&&N.ioWriteBytesPerSecond>=10485760?`danger`:N&&N.ioWriteBytesPerSecond>=1048576?`warning`:`default`;t[98]!==k||t[99]!==A||t[100]!==oe?(J=(0,G.jsx)(Ue,{icon:O,label:`Write throughput`,value:k,detail:A,tone:oe}),t[98]=k,t[99]=A,t[100]=oe,t[101]=J):J=t[101],L=Ue,t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,G.jsx)(s,{className:`size-3.5`}),t[102]=Ie):Ie=t[102],B=`CPU speed limit`,be=M?z===null?`Unknown`:`${z.toFixed(0)}%`:`...`,t[14]=N,t[15]=M,t[16]=p.error,t[17]=p.isPending,t[18]=p.refresh,t[19]=L,t[20]=ge,t[21]=_e,t[22]=ve,t[23]=z,t[24]=B,t[25]=be,t[26]=xe,t[27]=Se,t[28]=H,t[29]=U,t[30]=K,t[31]=J,t[32]=Te,t[33]=Y,t[34]=De,t[35]=Pe,t[36]=Fe,t[37]=Ie}else L=t[19],ge=t[20],_e=t[21],ve=t[22],z=t[23],B=t[24],be=t[25],xe=t[26],Se=t[27],H=t[28],U=t[29],K=t[30],J=t[31],Te=t[32],Y=t[33],De=t[34],Pe=t[35],Fe=t[36],Ie=t[37];let Le=M?`${M.power.thermalState} thermal state`:void 0,Re=z!==null&&z<80?`warning`:`default`,Be;t[103]!==L||t[104]!==B||t[105]!==be||t[106]!==Le||t[107]!==Re||t[108]!==Ie?(Be=(0,G.jsx)(L,{icon:Ie,label:B,value:be,detail:Le,tone:Re}),t[103]=L,t[104]=B,t[105]=be,t[106]=Le,t[107]=Re,t[108]=Ie,t[109]=Be):Be=t[109];let Ge;t[110]!==xe||t[111]!==Se||t[112]!==H||t[113]!==U||t[114]!==K||t[115]!==J||t[116]!==Be?(Ge=(0,G.jsxs)(`div`,{className:xe,children:[Se,H,U,K,J,Be]}),t[110]=xe,t[111]=Se,t[112]=H,t[113]=U,t[114]=K,t[115]=J,t[116]=Be,t[117]=Ge):Ge=t[117];let qe;t[118]===p.error?qe=t[119]:(qe=p.error?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 border-t border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive sm:px-5`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:p.error})]}):null,t[118]=p.error,t[119]=qe);let Je;t[120]===M?Je=t[121]:(Je=M?(0,G.jsxs)(`div`,{className:`grid border-t border-border/60 bg-muted/10 md:grid-cols-3`,children:[(0,G.jsx)(We,{label:`Backend + agents`,accentClass:`bg-success/80`,aggregate:M.groups.backend}),(0,G.jsx)(We,{label:`Desktop`,accentClass:`bg-info/80`,aggregate:M.groups.electron}),(0,G.jsx)(We,{label:`Monitor overhead`,accentClass:`bg-warning/80`,aggregate:M.groups.monitor})]}):null,t[120]=M,t[121]=Je);let Ye;t[122]!==Te||t[123]!==Y||t[124]!==Ge||t[125]!==qe||t[126]!==Je?(Ye=(0,G.jsxs)(`div`,{className:Te,children:[Y,Ge,qe,Je]}),t[122]=Te,t[123]=Y,t[124]=Ge,t[125]=qe,t[126]=Je,t[127]=Ye):Ye=t[127];let Qe;t[128]!==ge||t[129]!==De||t[130]!==Pe||t[131]!==Fe||t[132]!==Ye?(Qe=(0,G.jsx)(ge,{title:De,icon:Pe,headerAction:Fe,children:Ye}),t[128]=ge,t[129]=De,t[130]=Pe,t[131]=Fe,t[132]=Ye,t[133]=Qe):Qe=t[133];let et;t[134]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,G.jsx)(s,{className:`size-4 text-muted-foreground`}),t[134]=et):et=t[134];let tt;t[135]!==_e||t[136]!==le||t[137]!==he?(tt=_e?(0,G.jsxs)(f,{size:`xs`,variant:`outline`,disabled:le,onClick:he,children:[(0,G.jsx)(ye,{size:`xs`,refreshing:le}),`Retry monitor`]}):null,t[135]=_e,t[136]=le,t[137]=he,t[138]=tt):tt=t[138];let nt;t[139]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,G.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,G.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,G.jsx)(_,{className:`size-3.5`})}),`Host state`]}),t[139]=nt):nt=t[139];let rt;t[140]!==ve||t[141]!==M?(rt=(0,G.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[nt,ve&&M?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Xe,{label:`Power source`,value:ze(M.power.onBattery,{true:`Battery`,false:`External power`})}),(0,G.jsx)(Xe,{label:`Low power mode`,value:ze(M.power.lowPowerMode,{true:`Enabled`,false:`Disabled`})}),(0,G.jsx)(Xe,{label:`Idle`,value:`${ze(M.power.idle,{true:`Idle`,false:`Active`})}${M.power.idleSeconds===null?``:` · ${Math.round(M.power.idleSeconds)}s`}`}),(0,G.jsx)(Xe,{label:`Session`,value:M.power.suspended?`Suspended`:ze(M.power.locked,{true:`Locked`,false:`Unlocked`})}),(0,G.jsx)(Xe,{label:`Thermal`,value:M.power.thermalState,valueClassName:M.power.thermalState===`serious`||M.power.thermalState===`critical`?`text-destructive`:void 0})]}):(0,G.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/70 bg-muted/20 px-4 py-5`,children:[(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Desktop host signals not connected`}),(0,G.jsx)(`p`,{className:`mt-1.5 max-w-sm text-2xs leading-relaxed text-muted-foreground/70`,children:`Power, idle, lock, and thermal state are supplied by the desktop host. Process telemetry remains fully active in this browser session.`})]})]}),t[140]=ve,t[141]=M,t[142]=rt):rt=t[142];let at;t[143]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,G.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,G.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,G.jsx)(s,{className:`size-3.5`})}),`Collection health`]}),t[143]=at):at=t[143];let st;t[144]===M?st=t[145]:(st=(0,G.jsxs)(`div`,{className:`border-t border-border/60 px-4 py-4 md:border-t-0 sm:px-5`,children:[at,M?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ke,{label:`Native process monitor`,health:M.health.native}),(0,G.jsx)(Ke,{label:`Electron main process`,health:M.health.desktop}),(0,G.jsx)(Xe,{label:`Collection time`,value:je(M.health.collectionDurationMicros)}),(0,G.jsx)(Xe,{label:`Process scan`,value:`${M.health.retainedProcessCount}/${M.health.scannedProcessCount} retained`}),(0,G.jsx)(Xe,{label:`Inaccessible`,value:String(M.health.inaccessibleProcessCount),valueClassName:M.health.inaccessibleProcessCount>0?`text-warning-foreground`:void 0}),(0,G.jsx)(Xe,{label:`Sidecar`,value:te(M.health.sidecarVersion,{onNone:pt,onSome:e=>`${e}${te(M.health.sidecarPid,{onNone:ft,onSome:dt})}`})}),(0,G.jsx)(Xe,{label:`Restarts`,value:String(M.health.restartCount)})]}):(0,G.jsx)(`div`,{className:`py-4 text-xs text-muted-foreground`,children:`Waiting for collector health.`})]}),t[144]=M,t[145]=st);let lt;t[146]!==rt||t[147]!==st?(lt=(0,G.jsxs)(`div`,{className:`grid overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5 md:grid-cols-2 md:divide-x md:divide-border/60`,children:[rt,st]}),t[146]=rt,t[147]=st,t[148]=lt):lt=t[148];let ut;t[149]!==tt||t[150]!==lt?(ut=(0,G.jsx)(R,{title:`Host & collection`,icon:et,headerAction:tt,children:lt}),t[149]=tt,t[150]=lt,t[151]=ut):ut=t[151];let gt;t[152]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,G.jsx)(d,{className:`size-4 text-muted-foreground`}),t[152]=gt):gt=t[152];let _t;t[153]===r?_t=t[154]:(_t=(0,G.jsx)(Ze,{selectedWindowMs:r,onSelect:i}),t[153]=r,t[154]=_t);let vt;t[155]===b.isPending?vt=t[156]:(vt=(0,G.jsx)(ye,{size:`xs`,refreshing:b.isPending}),t[155]=b.isPending,t[156]=vt);let yt;t[157]!==b.isPending||t[158]!==b.refresh||t[159]!==vt?(yt=(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost`,disabled:b.isPending,onClick:b.refresh,"aria-label":`Refresh resource history`,children:vt}),t[157]=b.isPending,t[158]=b.refresh,t[159]=vt,t[160]=yt):yt=t[160];let bt;t[161]!==_t||t[162]!==yt?(bt=(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_t,yt]}),t[161]=_t,t[162]=yt,t[163]=bt):bt=t[163];let xt;t[164]===b.error?xt=t[165]:(xt=b.error?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive sm:px-5`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:b.error})]}):null,t[164]=b.error,t[165]=xt);let X;t[166]===b.data?.buckets?X=t[167]:(X=b.data?.buckets??[],t[166]=b.data?.buckets,t[167]=X);let Z;t[168]===X?Z=t[169]:(Z=(0,G.jsx)($e,{buckets:X}),t[168]=X,t[169]=Z);let St;t[170]===b.data?.topProcesses?St=t[171]:(St=b.data?.topProcesses??[],t[170]=b.data?.topProcesses,t[171]=St);let Ct;t[172]===St?Ct=t[173]:(Ct=(0,G.jsx)(ot,{processes:St}),t[172]=St,t[173]=Ct);let wt;t[174]!==xt||t[175]!==Z||t[176]!==Ct?(wt=(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[xt,Z,Ct]}),t[174]=xt,t[175]=Z,t[176]=Ct,t[177]=wt):wt=t[177];let Tt;t[178]!==bt||t[179]!==wt?(Tt=(0,G.jsx)(R,{title:`Resource timeline`,icon:gt,headerAction:bt,children:wt}),t[178]=bt,t[179]=wt,t[180]=Tt):Tt=t[180];let Et;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(Et=(0,G.jsx)(v,{className:`size-4 text-muted-foreground`}),t[181]=Et):Et=t[181];let Q;t[182]===M?Q=t[183]:(Q=M?(0,G.jsxs)(`span`,{className:`text-3xs text-muted-foreground/55`,children:[`Identity: `,(0,G.jsx)(`span`,{className:`font-mono`,children:`PID + start time`})]}):null,t[182]=M,t[183]=Q);let Dt;t[184]===M?.processes?Dt=t[185]:(Dt=M?.processes??[],t[184]=M?.processes,t[185]=Dt);let $;t[186]!==u||t[187]!==pe||t[188]!==w||t[189]!==Dt?($=(0,G.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:(0,G.jsx)(it,{processes:Dt,canMaintainEnvironment:u,signalingKeys:w,onSignal:pe})}),t[186]=u,t[187]=pe,t[188]=w,t[189]=Dt,t[190]=$):$=t[190];let Ot;t[191]!==Q||t[192]!==$?(Ot=(0,G.jsx)(R,{title:`Live process tree`,icon:Et,headerAction:Q,children:$}),t[191]=Q,t[192]=$,t[193]=Ot):Ot=t[193];let kt,At;t[194]===Symbol.for(`react.memo_cache_sentinel`)?(kt=(0,G.jsx)(ee,{className:`size-4 text-muted-foreground`}),At=(0,G.jsx)(`span`,{className:`text-3xs text-muted-foreground/55`,children:`Logical bytes by operation`}),t[194]=kt,t[195]=At):(kt=t[194],At=t[195]);let jt;t[196]===Symbol.for(`react.memo_cache_sentinel`)?(jt=(0,G.jsx)(`div`,{className:`bg-muted/15 px-4 py-3 text-2xs leading-relaxed text-muted-foreground sm:px-5`,children:`Native counters identify which process is reading or writing. These application-level counters identify known P4 Code operations so process spikes can be correlated with specific persistence and logging paths.`}),t[196]=jt):jt=t[196];let Mt;t[197]===M?.attribution.entries?Mt=t[198]:(Mt=M?.attribution.entries??[],t[197]=M?.attribution.entries,t[198]=Mt);let Nt;t[199]===Mt?Nt=t[200]:(Nt=(0,G.jsx)(R,{title:`Instrumented application I/O`,icon:kt,headerAction:At,children:(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[jt,(0,G.jsx)(ct,{entries:Mt})]})}),t[199]=Mt,t[200]=Nt);let Pt;return t[201]!==Qe||t[202]!==ut||t[203]!==Tt||t[204]!==Ot||t[205]!==Nt?(Pt=(0,G.jsxs)(G.Fragment,{children:[Qe,ut,Tt,Ot,Nt]}),t[201]=Qe,t[202]=ut,t[203]=Tt,t[204]=Ot,t[205]=Nt,t[206]=Pt):Pt=t[206],Pt}function dt(e){return` · PID ${e}`}function ft(){return``}function pt(){return`Unavailable`}function mt(e){O.add({type:`error`,title:`Could not restart resource monitor`,description:e instanceof Error?e.message:`The resource monitor retry failed.`})}function ht(){return new Set}var gt=[{key:`otlpTracesUrl`,label:`Traces`,signal:`traces`},{key:`otlpMetricsUrl`,label:`Metrics`,signal:`metrics`},{key:`otlpLogsUrl`,label:`Logs`,signal:`logs`}],_t=e=>/^https?:\/\/./i.test(e);function vt(e,t){if(e===``)return{label:`Off`,dot:`bg-muted-foreground/40`};if(t?.url!==e)return{label:`Not checked`,dot:`bg-muted-foreground/40`};let{result:n}=t;if(n===null)return{label:`Checking…`,dot:`bg-warning`};switch(n._tag){case`Accepted`:return{label:`Connected · ${Math.round(n.latencyMs)} ms`,dot:`bg-success`};case`Rejected`:return{label:`Rejected · HTTP ${n.status}`,dot:`bg-destructive`};case`Unreachable`:return{label:n.timedOut?`Timed out`:`Unreachable`,dot:`bg-destructive`}}}function yt(){let e=(0,W.c)(3),{environment:t,scope:n}=_e();if(n.kind!==`environment`||!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(R,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,G.jsx)(U,{target:`environment`,children:`Choose one environment to configure its telemetry exports.`})}),e[0]=t):t=e[0],t}let r;return e[1]===t.environmentId?r=e[2]:(r=(0,G.jsx)(bt,{},t.environmentId),e[1]=t.environmentId,e[2]=r),r}function bt(){let{environment:e}=_e(),t=ge(e=>e.observability),[n,r]=(0,q.useState)({}),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(null),c=e?.environmentId,l=w(j.checkOtlpEndpoint.permissionAtom(c??null)),u=l&&e?.serverConfig?.environment.capabilities.otlpEndpointCheck===!0,[d,p]=(0,q.useState)(()=>Object.fromEntries(gt.filter(({key:e})=>_t(t[e])).map(({key:e})=>[e,{url:t[e],result:null}]))),m=de(j.updateSettings,{reportFailure:!0}),h=de(j.checkOtlpEndpoint),g={...t,...n},_=gt.filter(({key:e})=>g[e].trim()!==t[e]),v=_.length>0,y=e?.serverConfig?.observability,b=async(e,t,n)=>{if(!c)return;let r=await h({environmentId:c,input:{signal:t,url:n}});p(t=>{if(t[e]?.url!==n||t[e].result!==null)return t;let i={...t};return r._tag===`Success`?i[e]={url:n,result:r.value}:delete i[e],i})},x=(e,t,n)=>{_t(n)&&(p(t=>({...t,[e]:{url:n,result:null}})),b(e,t,n))},ee=(0,q.useEffectEvent)(()=>{for(let{key:e,signal:t}of gt){let n=d[e];n?.result===null&&b(e,t,n.url)}});return(0,q.useEffect)(()=>{u&&ee()},[u]),(0,G.jsx)(R,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,G.jsxs)(`form`,{className:`grid gap-4 px-4 py-4 sm:px-5`,onSubmit:async t=>{if(t.preventDefault(),e&&!i){a(!0),s(null);try{(await m({environmentId:e.environmentId,input:{patch:{observability:Object.fromEntries(_.map(({key:e})=>[e,g[e]]))}}}))._tag===`Success`&&(r({}),s(`Saved. Restart the server to apply.`))}finally{a(!1)}}},children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Send traces, metrics, and logs to an OTLP HTTP receiver. Restart the server to apply. Environment variables override these settings.`}),!l&&(0,G.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`This connection lacks permission to change settings on`,` `,e?.label??`the selected environment`,`.`]}),gt.map(({key:e,label:n,signal:a})=>{let o=g[e].trim(),c=u?vt(o,d[e]):null;return(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[c&&(0,G.jsx)(B,{dotClassName:c.dot}),(0,G.jsxs)(xe,{htmlFor:e,children:[n,` endpoint`]})]}),c&&(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c.label})]}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(he,{id:e,size:`sm`,type:`url`,pattern:`[Hh][Tt][Tt][Pp][Ss]?://.*`,title:`Enter an HTTP or HTTPS endpoint, or leave empty to disable export.`,placeholder:`http://localhost:4318/v1/${a}`,value:g[e],disabled:i||!l,onChange:n=>{let i=n.target.value;r(n=>{let r={...n,[e]:i};return i.trim()===t[e]&&delete r[e],r}),s(null)}}),u&&(0,G.jsx)(f,{type:`button`,size:`sm`,variant:`outline`,disabled:!_t(o)||d[e]?.result===null,onClick:()=>void x(e,a,o),children:`Test`})]}),t[e]!==(y?.[e]??``)&&(0,G.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[`Running: `,y?.[e]||`Disabled`]})]},e)}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:o}),(0,G.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,G.jsx)(f,{type:`button`,size:`xs`,variant:`outline`,disabled:!v||i||!l,onClick:()=>{if(r({}),s(null),u)for(let{key:e,signal:n}of gt)d[e]?.url!==t[e]&&x(e,n,t[e])},children:`Discard`}),(0,G.jsx)(f,{type:`submit`,size:`xs`,disabled:!v||i||!l,children:i?`Saving…`:`Save`})]})]})]})})}var xt=new Intl.NumberFormat;function X(e){return xt.format(e)}function Z(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e>=1e4?1:2)} s`}function St(e){if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`],n=-1,r=e;do r/=1024,n+=1;while(r>=1024&&n<t.length-1);return`${r.toFixed(r>=10?1:2)} ${t[n]}`}function Ct(e){return e?N(p(e)):`No trace records`}function wt(e){return Ct(e).replaceAll(` `,`\xA0`)}function Tt(e){return e.length<=32?e:`${e.slice(0,18)}...${e.slice(-10)}`}function Et(e){return e?.includes(`not a live descendant`)??!1}function Q(e){let t=(0,W.c)(17),{label:n,value:r,tooltip:i,tone:a}=e,o=a===void 0?`default`:a,s;t[0]===n?s=t[1]:(s=(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:n}),t[0]=n,t[1]=s);let c;t[2]!==n||t[3]!==i?(c=i?(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`button`,{type:`button`,className:`cursor-pointer inline-flex size-3.5 shrink-0 items-center justify-center rounded-sm text-muted-foreground/60 hover:text-foreground`,"aria-label":`${n} details`,children:(0,G.jsx)(b,{className:`size-3`})})}),(0,G.jsx)(F,{side:`top`,children:i})]}):null,t[2]=n,t[3]=i,t[4]=c):c=t[4];let l;t[5]!==s||t[6]!==c?(l=(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-2xs font-medium uppercase tracking-widest text-muted-foreground/70`,children:[s,c]}),t[5]=s,t[6]=c,t[7]=l):l=t[7];let u=o===`warning`&&`text-warning-foreground`,d=o===`danger`&&`text-destructive`,f;t[8]!==u||t[9]!==d?(f=S(`mt-1 truncate font-mono text-lg font-semibold tabular-nums text-foreground`,u,d),t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]!==f||t[12]!==r?(p=(0,G.jsx)(`div`,{className:f,children:r}),t[11]=f,t[12]=r,t[13]=p):p=t[13];let m;return t[14]!==l||t[15]!==p?(m=(0,G.jsxs)(`div`,{className:`min-w-0 border-border/60 px-4 py-3 sm:px-5`,children:[l,p]}),t[14]=l,t[15]=p,t[16]=m):m=t[16],m}function Dt(e){let t=(0,W.c)(6),{children:n}=e,r,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/2 w-px bg-border/60`,"aria-hidden":!0}),i=(0,G.jsx)(`span`,{className:`pointer-events-none absolute inset-x-0 top-1/2 h-px bg-border/60 sm:hidden`,"aria-hidden":!0}),a=(0,G.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/4 hidden w-px bg-border/60 sm:block`,"aria-hidden":!0}),o=(0,G.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-3/4 hidden w-px bg-border/60 sm:block`,"aria-hidden":!0}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):(r=t[0],i=t[1],a=t[2],o=t[3]);let s;return t[4]===n?s=t[5]:(s=(0,G.jsxs)(`div`,{className:`relative grid grid-cols-2 sm:grid-cols-4`,children:[r,i,a,o,n]}),t[4]=n,t[5]=s),s}function $(e){let t=(0,W.c)(2),{label:n}=e,r;return t[0]===n?r=t[1]:(r=(0,G.jsx)(`div`,{className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:n}),t[0]=n,t[1]=r),r}function Ot(e){let t=(0,W.c)(21),{headers:n,children:r,minTableWidth:i,columnWidths:a}=e,o=i===void 0?`min-w-[640px]`:i,s=a&&`table-fixed`,c;t[0]!==o||t[1]!==s?(c=S(`w-full text-left text-xs`,o,s),t[0]=o,t[1]=s,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==n?(l=a?(0,G.jsx)(`colgroup`,{children:n.map((e,t)=>(0,G.jsx)(`col`,{className:a[t]},e))}):null,t[3]=a,t[4]=n,t[5]=l):l=t[5];let u;if(t[6]!==a||t[7]!==n){let e;t[9]!==a||t[10]!==n.length?(e=(e,t)=>(0,G.jsx)(`th`,{className:S(`whitespace-nowrap px-4 py-2.5 font-semibold first:sm:pl-5 last:sm:pr-5`,!a&&t===n.length-1&&`w-px`),children:e.replaceAll(` `,`\xA0`)},e),t[9]=a,t[10]=n.length,t[11]=e):e=t[11],u=n.map(e),t[6]=a,t[7]=n,t[8]=u}else u=t[8];let d;t[12]===u?d=t[13]:(d=(0,G.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsx)(`tr`,{children:u})}),t[12]=u,t[13]=d);let f;t[14]===r?f=t[15]:(f=(0,G.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:r}),t[14]=r,t[15]=f);let p;return t[16]!==c||t[17]!==l||t[18]!==d||t[19]!==f?(p=(0,G.jsx)(L,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:c,children:[l,d,f]})}),t[16]=c,t[17]=l,t[18]=d,t[19]=f,t[20]=p):p=t[20],p}function kt(e){let t=(0,W.c)(25),{traceId:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={target:`trace ID`,timeout:1200},t[0]=r):r=t[0];let{copyToClipboard:a,isCopied:o}=k(r),s;t[1]===n?s=t[2]:(s=Tt(n),t[1]=n,t[2]=s);let c;t[3]===s?c=t[4]:(c=(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-2xs`,children:s})}),t[3]=s,t[4]=c);let l;t[5]===n?l=t[6]:(l=(0,G.jsx)(F,{side:`top`,variant:`code`,children:n}),t[5]=n,t[6]=l);let u;t[7]!==c||t[8]!==l?(u=(0,G.jsxs)(I,{children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9];let d=o?`Copied trace ID`:`Copy trace ID`,p;t[10]!==a||t[11]!==n?(p=()=>a(n),t[10]=a,t[11]=n,t[12]=p):p=t[12];let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,G.jsx)(i,{className:`size-3`}),t[13]=m):m=t[13];let h;t[14]!==d||t[15]!==p?(h=(0,G.jsx)(P,{render:(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":d,onClick:p,children:m})}),t[14]=d,t[15]=p,t[16]=h):h=t[16];let g=o?`Copied`:`Copy full trace ID`,_;t[17]===g?_=t[18]:(_=(0,G.jsx)(F,{side:`top`,children:g}),t[17]=g,t[18]=_);let v;t[19]!==_||t[20]!==h?(v=(0,G.jsxs)(I,{children:[h,_]}),t[19]=_,t[20]=h,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==u?(y=(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 max-w-full items-center gap-2`,children:[u,v]}),t[22]=v,t[23]=u,t[24]=y):y=t[24],y}function At(e){let t=e.trim().split(/\s+/)[0];if(!t)return e;let n=t.replace(/^['"]|['"]$/g,``);return n.split(/[\\/]/).filter(Boolean).at(-1)??n}function jt(e){return e.depth>0?`Subprocess`:/\b(codex|claude|opencode|cursor)\b/i.test(e.command)?`Agent`:`Process`}function Mt(e){let t=(0,W.c)(22),{process:n,isExpanded:r,onToggle:i}=e,a;t[0]===n.command?a=t[1]:(a=At(n.command),t[0]=n.command,t[1]=a);let o=a,s=n.childPids.length>0,c=`${Math.min(n.depth,6)*10}px`,l;t[2]===c?l=t[3]:(l={paddingLeft:c},t[2]=c,t[3]=l);let u;t[4]!==s||t[5]!==r||t[6]!==o||t[7]!==i||t[8]!==n.pid?(u=s?(0,G.jsx)(f,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":r?`Collapse ${o}`:`Expand ${o}`,onClick:()=>i(n.pid),children:(0,G.jsx)(E,{className:`size-3.5`,icon:r?T:D})}):(0,G.jsx)(`span`,{className:`size-5 shrink-0`,"aria-hidden":`true`}),t[4]=s,t[5]=r,t[6]=o,t[7]=i,t[8]=n.pid,t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,G.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-success/80`}),t[10]=d):d=t[10];let p;t[11]===o?p=t[12]:(p=(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[11]=o,t[12]=p);let m;t[13]===n.command?m=t[14]:(m=(0,G.jsx)(F,{side:`top`,variant:`code`,children:n.command}),t[13]=n.command,t[14]=m);let h;t[15]!==p||t[16]!==m?(h=(0,G.jsxs)(I,{children:[p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17];let g;return t[18]!==l||t[19]!==u||t[20]!==h?(g=(0,G.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,d,h]}),t[18]=l,t[19]=u,t[20]=h,t[21]=g):g=t[21],g}function Nt(e){let t=(0,W.c)(18),{processes:n,canMaintainEnvironment:r,signalingPid:i,onSignal:a,emptyLabel:o}=e,[s,c]=(0,q.useState)(Pt),l;if(t[0]!==s||t[1]!==n){l=[];let e=null;for(let t of n){if(e!==null){if(t.depth>e)continue;e=null}l.push(t),s.has(t.pid)&&(e=t.depth)}t[0]=s,t[1]=n,t[2]=l}else l=t[2];let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[3]=d):d=t[3];let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[33%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[6%]`})]}),t[4]=p):p=t[4];let m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,G.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Name`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Type`}),(0,G.jsx)(`th`,{className:`p-2 text-right font-semibold sm:pr-4`,children:`Kill`})]})}),t[5]=m):m=t[5];let h;t[6]!==o||t[7]!==u.length?(h=u.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:7,className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:o??`No live descendant processes found.`})}):null,t[6]=o,t[7]=u.length,t[8]=h):h=t[8];let g;t[9]!==r||t[10]!==s||t[11]!==a||t[12]!==i||t[13]!==u?(g=u.map(e=>(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,G.jsx)(Mt,{process:e,isExpanded:!s.has(e.pid),onToggle:f})}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:St(e.rssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,G.jsx)(F,{side:`top`,variant:`code`,children:e.command})]})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground`,children:e.pid}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 align-middle text-muted-foreground`,children:jt(e)}),(0,G.jsx)(`td`,{className:`p-2 align-middle sm:pr-4`,children:(0,G.jsx)(K,{disabled:!r||i===e.pid,onSignal:t=>a(e.pid,t)})})]},e.pid)),t[9]=r,t[10]=s,t[11]=a,t[12]=i,t[13]=u,t[14]=g):g=t[14];let _;return t[15]!==h||t[16]!==g?(_=(0,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(L,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1040px] table-fixed text-left text-xs`,children:[p,m,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[h,g]})]})})}),t[15]=h,t[16]=g,t[17]=_):_=t[17],_}function Pt(){return new Set}var Ft=[{label:`5m`,windowMs:3e5,bucketMs:3e4},{label:`15m`,windowMs:9e5,bucketMs:6e4},{label:`30m`,windowMs:18e5,bucketMs:12e4},{label:`1h`,windowMs:36e5,bucketMs:3e5}];function It(e){if(e<60)return`${e.toFixed(e>=10?1:2)}s`;let t=e/60;return t<60?`${t.toFixed(t>=10?1:2)}m`:`${(t/60).toFixed(2)}h`}function Lt(e){let t=At(e);return t.length>42?`${t.slice(0,39)}...`:t}function Rt(e){let t=(0,W.c)(21),{process:n,visualDepth:r}=e,i;t[0]===n.command?i=t[1]:(i=Lt(n.command),t[0]=n.command,t[1]=i);let a=i,o=`${Math.min(r,6)*10}px`,s;t[2]===o?s=t[3]:(s={paddingLeft:o},t[2]=o,t[3]=s);let c=`${n.isServerRoot?`Root`:`Child`} process ${a}`,l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,G.jsx)(`span`,{className:`size-5 shrink-0`,"aria-hidden":`true`}),t[4]=l):l=t[4];let u=n.isServerRoot?`bg-warning/90`:`bg-success/80`,d;t[5]===u?d=t[6]:(d=S(`size-1.5 shrink-0 rounded-full`,u),t[5]=u,t[6]=d);let f;t[7]===d?f=t[8]:(f=(0,G.jsx)(`span`,{className:d}),t[7]=d,t[8]=f);let p;t[9]===a?p=t[10]:(p=(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:a})}),t[9]=a,t[10]=p);let m;t[11]===n.command?m=t[12]:(m=(0,G.jsx)(F,{side:`top`,variant:`code`,children:n.command}),t[11]=n.command,t[12]=m);let h;t[13]!==m||t[14]!==p?(h=(0,G.jsxs)(I,{children:[p,m]}),t[13]=m,t[14]=p,t[15]=h):h=t[15];let g;return t[16]!==h||t[17]!==s||t[18]!==c||t[19]!==f?(g=(0,G.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:s,"aria-label":c,children:[l,f,h]}),t[16]=h,t[17]=s,t[18]=c,t[19]=f,t[20]=g):g=t[20],g}function zt(e){let t=(0,W.c)(9),{buckets:n}=e,r;t[0]===n?r=t[1]:(r=Math.max(1,...n.map(Bt)),t[0]=n,t[1]=r);let i=r,a;if(t[2]!==n||t[3]!==i){let e;t[5]===i?e=t[6]:(e=e=>{let t=Math.max(2,e.maxCpuPercent/i*100),n=Math.max(2,e.avgCpuPercent/i*100);return(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`div`,{className:`flex h-full min-w-1 flex-1 items-end`,children:(0,G.jsxs)(`div`,{className:`relative h-full w-full`,"aria-label":`Average CPU ${e.avgCpuPercent.toFixed(1)}%, peak CPU ${e.maxCpuPercent.toFixed(1)}%`,children:[(0,G.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/15 transition-colors`,style:{height:`${t}%`}}),(0,G.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/60 transition-colors`,style:{height:`${n}%`}})]})})}),(0,G.jsxs)(F,{side:`top`,children:[`Avg `,e.avgCpuPercent.toFixed(1),`%, peak `,e.maxCpuPercent.toFixed(1),`%`]})]},p(e.startedAt))},t[5]=i,t[6]=e),a=n.map(e),t[2]=n,t[3]=i,t[4]=a}else a=t[4];let o;return t[7]===a?o=t[8]:(o=(0,G.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,G.jsx)(`div`,{className:`flex h-28 items-end gap-1 overflow-hidden rounded-sm bg-muted/10 p-2`,children:a})}),t[7]=a,t[8]=o),o}function Bt(e){return e.maxCpuPercent}function Vt(e){let t=(0,W.c)(8),{selectedWindowMs:n,onSelect:r}=e,i=String(n),a;t[0]===i?a=t[1]:(a=[i],t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=e=>{let t=Ft.find(t=>String(t.windowMs)===e[0]);t&&r(t.windowMs)},t[2]=r,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=Ft.map(Ht),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,G.jsx)(pe,{"aria-label":`Process history period`,variant:`segmented`,value:a,onValueChange:o,children:s}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}function Ht(e){return(0,G.jsx)(me,{value:String(e.windowMs),children:e.label},e.windowMs)}function Ut(e){let t=(0,W.c)(13),{processes:n,emptyLabel:r}=e,i=n.reduce(Wt,null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[16%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`})]}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Current`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Average`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Max Mem`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`PID`})]})}),t[1]=o):o=t[1];let s;t[2]!==r||t[3]!==n.length?(s=n.length===0?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:8,className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:r})}):null,t[2]=r,t[3]=n.length,t[4]=s):s=t[4];let c;if(t[5]!==n||t[6]!==i){let e;t[8]===i?e=t[9]:(e=e=>(0,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,G.jsx)(Rt,{process:e,visualDepth:e.isServerRoot||i===null?0:Math.max(1,e.depth-i+1)})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:It(e.cpuSecondsApprox)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.currentCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.avgCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:St(e.maxRssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,G.jsx)(F,{side:`top`,variant:`code`,children:e.command})]})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground sm:pr-5`,children:e.pid})]},e.processKey),t[8]=i,t[9]=e),c=n.map(e),t[5]=n,t[6]=i,t[7]=c}else c=t[7];let l;return t[10]!==s||t[11]!==c?(l=(0,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(L,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[980px] table-fixed text-left text-xs`,children:[a,o,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[s,c]})]})})}),t[10]=s,t[11]=c,t[12]=l):l=t[12],l}function Wt(e,t){return t.isServerRoot?e:e===null?t.depth:Math.min(e,t.depth)}function Gt(e){let t=(0,W.c)(7),{checkedAt:n}=e;z();let r;t[0]===n?r=t[1]:(r=fe(n?p(n):null),t[0]=n,t[1]=r);let i=r;if(i.status===`missing`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/50`,children:`Checking`}),t[2]=e):e=t[2],e}if(i.status===`invalid`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/50`,children:`Checked unavailable`}),t[3]=e):e=t[3],e}let a;return t[4]!==i.suffix||t[5]!==i.value?(a=(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/60`,children:i.suffix?(0,G.jsxs)(G.Fragment,{children:[`Checked `,(0,G.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,G.jsxs)(G.Fragment,{children:[`Checked `,i.value]})}),t[4]=i.suffix,t[5]=i.value,t[6]=a):a=t[6],a}function Kt(e){let t=(0,W.c)(12),{isPending:n,label:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,G.jsx)(ye,{refreshing:n}),t[0]=n,t[1]=a);let o;t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a?(o=(0,G.jsx)(P,{render:(0,G.jsx)(f,{size:`icon-xs`,variant:`ghost-muted`,disabled:n,onClick:i,"aria-label":r,children:a})}),t[2]=n,t[3]=r,t[4]=i,t[5]=a,t[6]=o):o=t[6];let s;t[7]===r?s=t[8]:(s=(0,G.jsx)(F,{side:`top`,children:r}),t[7]=r,t[8]=s);let c;return t[9]!==o||t[10]!==s?(c=(0,G.jsxs)(I,{children:[o,s]}),t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function qt(){let{environment:e}=_e(),t=e?.environmentId??null,n=se(t,c),r=e?.serverConfig?.observability,i=e?.serverConfig?.availableEditors,a=se(t,y),o=ue(t===null?null:le.sessionStateAtom(t)),s=Se({connectionPhase:e?.connection.phase??`available`,session:o.data,hasSessionError:o.error!==null}),l=s.canReadDiagnostics,u=de(j.signalProcess,{reportFailure:!1}),d=be(t,i??[]),[h,g]=(0,q.useState)(9e5),_=Ft.find(e=>e.windowMs===h)??Ft[1],{data:v,error:b,isPending:ee,refresh:te}=ue(t===null||!l?null:j.traceDiagnostics({environmentId:t,input:{}})),{data:w,error:T,isPending:E,refresh:D}=ue(t===null||!l?null:j.processDiagnostics({environmentId:t,input:{}})),{data:k,error:A,isPending:M,refresh:N}=ue(t===null||!l?null:j.processResourceHistory({environmentId:t,input:{windowMs:_.windowMs,bucketMs:_.bucketMs}})),[fe,pe]=(0,q.useState)(!1),[me,he]=(0,q.useState)(null),[ge,z]=(0,q.useState)(null),B=(0,q.useRef)(null),ye=(0,q.useRef)(t),V=(0,q.useRef)(w);(0,q.useEffect)(()=>{V.current=w},[w]),(0,q.useEffect)(()=>(ye.current=t,()=>{ye.current=null}),[t]);let xe=(0,q.useCallback)(()=>{let e=r?.logsDirectoryPath??null;e&&t!==null&&ce(t,`orchestration:operate`)&&(pe(!0),he(null),(async()=>{let t=await d(e);if(pe(!1),t._tag===`Failure`&&!ie(t)){let e=ae(t);he(e instanceof Error?e.message:`Unable to open logs folder.`)}})())},[t,r?.logsDirectoryPath,d]),U=ee&&v===null,W=E&&w===null,K=M&&k===null,[Ce,we]=(0,q.useState)(null);Ce!==t&&l&&!U&&!W&&!K&&we(t);let J=(0,q.useCallback)(async(e,t)=>{let n=ye.current,r=V.current?.processes.find(t=>t.pid===e);if(n===null||r===void 0||!ce(n,`environment:maintain`)||B.current!==null)return;B.current=e,z(e);let i=()=>{B.current=null,z(null)};if(t===`SIGKILL`){let n=!1;try{n=await oe().dialogs.confirm(`Send SIGKILL to process ${e}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){i(),O.add({type:`error`,title:`Could not confirm signal`,description:e instanceof Error?e.message:`Failed to send ${t}.`});return}if(!n){i();return}}let a=ye.current;if(a===null||a!==n||!ce(a,`environment:maintain`)){i();return}if(V.current?.processes.find(t=>t.pid===e)?.startTimeMs!==r.startTimeMs){i();return}try{let i=await u({environmentId:n,input:{pid:e,startTimeMs:r.startTimeMs,signal:t}});if(i._tag===`Failure`){if(!ie(i)){let e=ae(i);O.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}return}if(!i.value.signaled){let e=x(i.value.message);if(D(),Et(e)){O.add({type:`info`,title:`Process already exited`,description:`The process is not a child of the P4 Code server. It might already have exited.`});return}O.add({type:`error`,title:`Could not send ${t}`,description:e??`Failed to send ${t}.`});return}D()}finally{i()}},[D,u]),Te=w?ne(w.error):null,Ee=k?ne(k.error):null,Y=v?ne(v.error):null,De=v?m(v.partialFailure,()=>!1):!1;return l?(0,G.jsxs)(ve,{width:`expanded`,className:`gap-10`,children:[(0,G.jsx)(ut,{environmentId:t}),(0,G.jsxs)(R,{title:`Live Processes`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Gt,{checkedAt:w?.readAt??null}),(0,G.jsx)(Kt,{isPending:E,label:`Refresh process diagnostics`,onClick:D})]}),children:[(0,G.jsxs)(Dt,{children:[(0,G.jsx)(Q,{label:`Child Processes`,value:w?X(w.processCount):`...`}),(0,G.jsx)(Q,{label:`CPU`,value:w?`${w.totalCpuPercent.toFixed(1)}%`:`...`,tooltip:`Total CPU across live child processes of the current server process. The desktop shell and other parent processes are not included.`}),(0,G.jsx)(Q,{label:`Memory`,value:w?St(w.totalRssBytes):`...`,tooltip:`Total resident memory across live child processes of the current server process. The desktop shell and other parent processes are not included.`}),(0,G.jsx)(Q,{label:`Server PID`,value:w?String(w.serverPid):`...`})]}),Te||T?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[Te?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:Te.message})]}):null,T?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:T})]}):null]}):null,(0,G.jsx)(Nt,{processes:w?.processes??[],canMaintainEnvironment:n,signalingPid:ge,onSignal:J,emptyLabel:W?`Loading live processes...`:`No live descendant processes found.`})]}),(0,G.jsxs)(R,{title:`Resource History`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Vt,{selectedWindowMs:h,onSelect:g}),(0,G.jsx)(Gt,{checkedAt:k?.readAt??null}),(0,G.jsx)(Kt,{isPending:M,label:`Refresh resource history`,onClick:N})]}),children:[(0,G.jsxs)(Dt,{children:[(0,G.jsx)(Q,{label:`CPU Time`,value:k?It(k.totalCpuSecondsApprox):`...`,tooltip:`Approximate active CPU time for the P4 Code server root process and its descendants during the selected window. It grows only while sampled processes use CPU and older samples leave as the window moves.`}),(0,G.jsx)(Q,{label:`Samples`,value:k?X(k.retainedSampleCount):`...`,tooltip:`In-memory process samples retained by the server. The server samples only while diagnostics is open, and this resets when the server restarts.`}),(0,G.jsx)(Q,{label:`Interval`,value:k?k.sampleIntervalMs===0?`On demand`:Z(k.sampleIntervalMs):`...`}),(0,G.jsx)(Q,{label:`Processes`,value:k?X(k.topProcesses.length):`...`})]}),Ee||A?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[Ee?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:Ee.message})]}):null,A?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:A})]}):null]}):null,(0,G.jsx)(zt,{buckets:k?.buckets??[]}),(0,G.jsx)(Ut,{processes:k?.topProcesses??[],emptyLabel:K?`Collecting process resource samples...`:`No process resource samples found for this window.`})]}),(0,G.jsxs)(R,{title:`Trace Diagnostics`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Gt,{checkedAt:v?.readAt??null}),(0,G.jsxs)(I,{children:[(0,G.jsx)(P,{render:(0,G.jsx)(f,{size:`icon-xs`,variant:`ghost-muted`,disabled:!a||!r?.logsDirectoryPath||fe,onClick:xe,"aria-label":`Open logs folder`,children:(0,G.jsx)(re,{})})}),(0,G.jsx)(F,{side:`top`,children:`Open logs folder`})]}),(0,G.jsx)(Kt,{isPending:ee,label:`Refresh trace diagnostics`,onClick:te})]}),children:[(0,G.jsxs)(Dt,{children:[(0,G.jsx)(Q,{label:`Spans`,value:v?X(v.recordCount):`...`}),(0,G.jsx)(Q,{label:`Failures`,value:v?X(v.failureCount):`...`,tone:v&&v.failureCount>0?`danger`:`default`}),(0,G.jsx)(Q,{label:`Slow Spans`,value:v?X(v.slowSpanCount):`...`,tooltip:v?`Spans with a duration of ${Z(v.slowSpanThresholdMs)} or longer.`:`Spans at or above the configured slow-span threshold.`,tone:v&&v.slowSpanCount>0?`warning`:`default`}),(0,G.jsx)(Q,{label:`Parse Errors`,value:v?X(v.parseErrorCount):`...`,tone:v&&v.parseErrorCount>0?`warning`:`default`})]}),me||Y||b?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[me?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:me})]}):null,Y?(0,G.jsxs)(`div`,{className:S(`flex items-start gap-2`,De?`text-warning-foreground`:`text-destructive`),children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:De?`Some trace files could not be read, so diagnostics may be incomplete. ${Y.message}`:Y.message})]}):null,b?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:b})]}):null]}):null]}),(0,G.jsx)(R,{title:`Latest Failures`,children:v&&v.latestFailures.length>0?(0,G.jsx)(Ot,{headers:[`Span`,`Cause`,`Duration`,`Ended`],children:v.latestFailures.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(H,{text:e.cause})}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.durationMs)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:wt(e.endedAt)})]},`${e.traceId}:${e.spanId}`))}):(0,G.jsx)($,{label:U?`Loading failures...`:`No failed spans found.`})}),(0,G.jsx)(R,{title:`Most Common Failures`,children:v&&v.commonFailures.length>0?(0,G.jsx)(Ot,{headers:[`Span`,`Count`,`Cause`,`Last Seen`],minTableWidth:`min-w-[760px]`,children:v.commonFailures.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:X(e.count)}),(0,G.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(H,{text:e.cause})}),(0,G.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:wt(e.lastSeenAt)})]},`${e.name}:${e.cause}`))}):(0,G.jsx)($,{label:U?`Loading failure groups...`:`No repeated failures found.`})}),(0,G.jsx)(R,{title:`Slowest Spans`,children:v&&v.slowestSpans.length>0?(0,G.jsx)(Ot,{headers:[`Span`,`Duration`,`Ended`,`Trace`],minTableWidth:`min-w-[900px]`,columnWidths:[`w-[44%]`,`w-[14%]`,`w-[12%]`,`w-[30%]`],children:v.slowestSpans.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.durationMs)}),(0,G.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground`,children:wt(e.endedAt)}),(0,G.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground last:sm:pr-5`,children:(0,G.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}`))}):(0,G.jsx)($,{label:U?`Loading slow spans...`:`No spans found.`})}),(0,G.jsx)(R,{title:`Span Logs`,children:v&&v.latestWarningAndErrorLogs.length>0?(0,G.jsx)(L,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[920px] table-fixed text-left text-xs`,children:[(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[26%]`}),(0,G.jsx)(`col`,{className:`w-[30%]`})]}),(0,G.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pl-5`,children:`Time`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Level`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Span`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Message`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pr-5`,children:`Trace`})]})}),(0,G.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:v.latestWarningAndErrorLogs.map(e=>(0,G.jsxs)(`tr`,{className:`hover:bg-muted/15`,children:[(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground sm:pl-5`,children:wt(e.seenAt)}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,G.jsx)(`span`,{className:`inline-flex rounded bg-muted px-1.5 py-0.5 font-mono text-2xs font-medium uppercase text-foreground/80`,children:e.level})}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,G.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:e.spanName})}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(H,{collapsedClassName:`line-clamp-2`,expandLabel:`Show full message`,text:e.message})}),(0,G.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground sm:pr-5`,children:(0,G.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}:${p(e.seenAt)}:${e.message}`))})]})}):(0,G.jsx)($,{label:U?`Loading recent logs...`:`No warnings or errors found.`})}),(0,G.jsx)(R,{title:`Top Span Names`,children:v&&v.topSpansByCount.length>0?(0,G.jsx)(Ot,{headers:[`Span`,`Count`,`Failures`,`Average`,`Max`],minTableWidth:`min-w-[760px]`,columnWidths:[`w-[48%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`],children:v.topSpansByCount.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:X(e.count)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:X(e.failureCount)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.averageDurationMs)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums last:sm:pr-5`,children:Z(e.maxDurationMs)})]},e.name))}):(0,G.jsx)($,{label:U?`Loading span names...`:`No spans found.`})}),Ce===t&&(0,G.jsx)(yt,{})]}):(0,G.jsx)(ve,{children:(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t===null?`Connect an environment to see diagnostics.`:s.isPending?`Checking diagnostics access…`:s.error})})}var Jt=qt;export{Jt as component};
|
|
2
|
+
//# sourceMappingURL=settings.diagnostics-DDOaOIDg.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./react-DH3P2YXY.js";import{n as t,t as n}from"./jsx-runtime-BnjsACtP.js";import{n as r}from"./SettingsPanels-
|
|
2
|
-
//# sourceMappingURL=settings.general-
|
|
1
|
+
import{a as e}from"./react-DH3P2YXY.js";import{n as t,t as n}from"./jsx-runtime-BnjsACtP.js";import{n as r}from"./SettingsPanels-BfBUSBAG.js";var i=t(),a=e(n());function o(){let e=(0,i.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsx)(r,{}),e[0]=t):t=e[0],t}export{o as component};
|
|
2
|
+
//# sourceMappingURL=settings.general-qzEOE2zF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{t as i}from"./cloud-Cnpuf424.js";import{t as a}from"./plus-BFikiw2m.js";import{t as o}from"./x-CJgPyqpa.js";import{$_ as s,$n as c,Ch as l,Cp as u,Ep as d,Ey as f,Fg as p,Jg as m,Jn as h,Kg as g,Ng as _,Og as v,Qn as y,Qw as b,Sh as x,Sp as S,Ty as C,Vf as w,Xg as T,Yg as E,Yn as D,Yp as O,Yw as k,Zn as A,aE as j,al as M,ar as N,dr as P,fh as F,fr as I,hh as L,id as R,if as z,il as B,kd as ee,kg as te,l as ne,ph as re,rh as ie,sd as ae,t as V,tr as H,ur as oe,wh as U,xb as se}from"./utils-BoMYW9A3.js";import{W as ce}from"./runtime-DR7JxgbQ.js";import{T as le}from"./entities-Bqo0n1Pb.js";import{a as W,r as ue,t as G}from"./number-field-SoHEiP55.js";import{a as K,c as de,i as fe,o as pe,r as me,s as he,t as ge}from"./select-DaYjjw1q.js";import{t as _e}from"./spinner-CSTrcxhP.js";import{i as q}from"./toast-B84QdqqM.js";import{D as ve,E as ye,J as be,c as xe,o as Se,r as Ce,s as J,x as Y}from"./useSettings-CaJMqrvF.js";import{f as we}from"./server-sXApTCjZ.js";import{i as Te,n as Ee}from"./session-C949OsEI.js";import{t as De}from"./query-d1pQlqP0.js";import{t as Oe}from"./use-atom-command-DA6OG-Qk.js";import{t as ke}from"./env-wK1YYxA8.js";import{a as Ae,n as je,t as Me}from"./tooltip-D-GRl-oZ.js";import{t as Ne}from"./input-ekYqAkUx.js";import{a as Pe,c as Fe,i as Ie,n as Le,o as Re,r as ze,s as Be,t as Ve}from"./dialog-CBBxT1gk.js";import{i as He,t as Ue}from"./device-DmH6IHQ4.js";import{a as We,i as Ge,l as Ke,n as qe,o as Je,t as Ye,u as Xe}from"./DeviceSetup-D8qb_qBj.js";import{t as Ze}from"./AnimatedHeight-OxEbW01v.js";import{i as Qe,n as $e}from"./Icons-B4l3TqYa.js";import{t as et}from"./preview-BYnEURcB.js";import{n as tt}from"./preview-DGdQ5Ycc.js";import{a as nt,i as rt,o as it,t as at}from"./popover-OfG3wVsl.js";import{F as ot,R as st,V as ct,a as X,c as lt,i as ut,r as dt,s as ft,w as pt}from"./settingsLayout-CFQx1XDM.js";import{Ar as mt,Bi as ht,Fr as gt,Ir as _t,Mr as vt,Nr as yt,Oa as bt,Pr as xt,ir as St,jr as Ct,qi as wt,va as Tt,zi as Et}from"./main-BWh6jqG2.js";import{t as Dt}from"./ProjectDefaultsSettings-BF-iyQ8T.js";import{t as Ot}from"./draft-input-CSOOVntS.js";import{t as kt}from"./ScopedSwitch-Bhp6-hCj.js";import{t as At}from"./SecretInput-RlOzrLKL.js";import{n as jt,r as Mt,t as Nt}from"./usePermissionStatus-BzfAUU9X.js";var Z=n(),Q=e(r(),1);function Pt(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(Ft).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)(I,{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)(it,{"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)(nt,{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 v=a?`Managed by ${a}. `:``,y;t[12]===v?y=t[13]:(y=(0,Q.jsxs)(`p`,{className:`mt-4 border-t border-border/50 pt-3 text-xs text-muted-foreground`,children:[v,`Tools update automatically on this host when needed.`]}),t[12]=v,t[13]=y);let b;t[14]===o?b=t[15]:(b=o?(0,Q.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-destructive`,children:o}):null,t[14]=o,t[15]=b);let x;t[16]===r?x=t[17]:(x=r?(0,Q.jsx)(`div`,{className:`mt-3`,children:r}):null,t[16]=r,t[17]=x);let S;t[18]!==y||t[19]!==b||t[20]!==x||t[21]!==g||t[22]!==_?(S=(0,Q.jsxs)(rt,{align:`end`,width:`md`,children:[g,_,y,b,x]}),t[18]=y,t[19]=b,t[20]=x,t[21]=g,t[22]=_,t[23]=S):S=t[23];let C;return t[24]!==S||t[25]!==m?(C=(0,Q.jsxs)(at,{children:[m,S]}),t[24]=S,t[25]=m,t[26]=C):C=t[26],C}function Ft(e,t){return e.localeCompare(t,void 0,{numeric:!0})}var $=e(t(),1);function It(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 Lt(e){let t=(0,Z.c)(4),{platforms:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Rt),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 Rt(e){return(0,Q.jsxs)(Me,{children:[(0,Q.jsxs)(Ae,{render:(0,Q.jsx)(`span`,{tabIndex:0,className:`inline-flex items-center gap-1`}),children:[e.available?(0,Q.jsx)(ee,{className:`size-3`}):(0,Q.jsx)(S,{className:`size-3`}),e.platform===`ios`?`iOS`:`Android`,` `,e.available?`available`:`unavailable`]}),(0,Q.jsx)(je,{children:e.reason??(e.platform===`ios`?`iOS available`:`Android available`)})]},e.platform)}var zt=se(f);function Bt(e){let{identityFile:t,...n}=e;return zt({...n,...t?.trim()?{identityFile:t.trim()}:{}})}function Vt(e){return JSON.stringify([e.target.trim(),e.port,e.identityFile?.trim()||void 0])}async function Ht(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 Ut(e){let t=Oe(Ue.testHost,{reportFailure:!1}),[n,r]=(0,$.useState)({}),i=(0,$.useRef)(new Set);return{checks:n,testConnection:async n=>{let a=Vt(n);if(i.current.has(a))return;i.current.add(a),r(e=>({...e,[a]:{}}));let o={};try{return await Ht(e,n,async(e,n)=>{if(!Ee(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(k(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 Wt(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:d,testConnection:f}=Ut(i),p=d[Vt(c)],m=Object.values(p??{}).some(Kt),h,g;t[0]===c?(h=t[1],g=t[2]):(h=Bt({...c,label:c.label.trim()||c.target}),g=j(h),t[0]=c,t[1]=h,t[2]=g);let _=g,v;t[3]===p?v=t[4]:(v=Object.values(p??{}).filter(Gt),t[3]=p,t[4]=v);let y=v.length,b;t[5]!==a||t[6]!==s?(b=e=>{!e&&!a&&s()},t[5]=a,t[6]=s,t[7]=b):b=t[7];let x=!a,S;t[8]!==a||t[9]!==m||t[10]!==c.label||t[11]!==h||t[12]!==o?(S=(0,Q.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),j(h)&&c.label.trim()&&!a&&!m&&o(h.value)}}),t[8]=a,t[9]=m,t[10]=c.label,t[11]=h,t[12]=o,t[13]=S):S=t[13];let C=r?`Add device host`:`Edit device host`,w;t[14]===C?w=t[15]:(w=(0,Q.jsx)(Fe,{children:C}),t[14]=C,t[15]=w);let T=i.length===1?`Connect from ${i[0]?.label}.`:`Connect from ${i.length} selected environments.`,E;t[16]===T?E=t[17]:(E=(0,Q.jsxs)(ze,{children:[T,` `,`Hosts on the same machine are skipped.`]}),t[16]=T,t[17]=E);let D;t[18]!==w||t[19]!==E?(D=(0,Q.jsxs)(Pe,{children:[w,E]}),t[18]=w,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 k;t[22]===c?k=t[23]:(k=e=>l({...c,label:e.target.value}),t[22]=c,t[23]=k);let A;t[24]!==a||t[25]!==c.label||t[26]!==k?(A=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[O,(0,Q.jsx)(Ne,{autoFocus:!0,required:!0,value:c.label,disabled:a,onChange:k,placeholder:`Mac mini`})]}),t[24]=a,t[25]=c.label,t[26]=k,t[27]=A):A=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 F;t[31]!==a||t[32]!==c.target||t[33]!==N?(F=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[M,(0,Q.jsx)(Ne,{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]=F):F=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 z=c.identityFile??``,B;t[37]===c?B=t[38]:(B=e=>{let{identityFile:t,...n}=c;l(e.target.value?{...n,identityFile:e.target.value}:n)},t[37]=c,t[38]=B);let te;t[39]!==a||t[40]!==z||t[41]!==B?(te=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[R,(0,Q.jsx)(Ne,{value:z,disabled:a,onChange:B,placeholder:`SSH config default`})]}),t[39]=a,t[40]=z,t[41]=B,t[42]=te):te=t[42];let ne;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(`span`,{children:`Port`}),t[43]=ne):ne=t[43];let re=c.port??``,ae;t[44]===c?ae=t[45]:(ae=e=>{let{port:t,...n}=c;l(e.target.value?{...n,port:Number(e.target.value)}:n)},t[44]=c,t[45]=ae);let V;t[46]!==a||t[47]!==re||t[48]!==ae?(V=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[ne,(0,Q.jsx)(Ne,{type:`number`,min:1,max:65535,value:re,disabled:a,onChange:ae,placeholder:`Default`})]}),t[46]=a,t[47]=re,t[48]=ae,t[49]=V):V=t[49];let H;t[50]!==te||t[51]!==V?(H=(0,Q.jsxs)(`div`,{className:`mt-3 grid grid-cols-[minmax(0,1fr)_7rem] gap-3`,children:[te,V]}),t[50]=te,t[51]=V,t[52]=H):H=t[52];let oe;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Optional. Resolved separately on each environment.`}),t[53]=oe):oe=t[53];let U;t[54]!==I||t[55]!==H?(U=(0,Q.jsxs)(`details`,{open:I,className:`text-sm`,children:[L,H,oe]}),t[54]=I,t[55]=H,t[56]=U):U=t[56];let se=m?`Checking environments…`:p?y?`${y} of ${i.length} failed`:`Connection checks passed`:`Check access before saving`,ce;t[57]===se?ce=t[58]:(ce=(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:se}),t[57]=se,t[58]=ce);let le=a||m||!_,W;t[59]!==h||t[60]!==f?(W=()=>{j(h)&&f(h.value)},t[59]=h,t[60]=f,t[61]=W):W=t[61];let ue;t[62]===m?ue=t[63]:(ue=m?(0,Q.jsx)(_e,{size:`xs`}):null,t[62]=m,t[63]=ue);let G;t[64]!==le||t[65]!==W||t[66]!==ue?(G=(0,Q.jsxs)(P,{type:`button`,size:`sm`,variant:`outline`,disabled:le,onClick:W,children:[ue,` Test connection`]}),t[64]=le,t[65]=W,t[66]=ue,t[67]=G):G=t[67];let K;t[68]!==ce||t[69]!==G?(K=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,children:[ce,G]}),t[68]=ce,t[69]=G,t[70]=K):K=t[70];let de;t[71]!==p||t[72]!==i?(de=p?(0,Q.jsx)(`ul`,{className:`border-t border-border/60 divide-y divide-border/40`,children:i.map(e=>{let t=p[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)(_e,{size:`xs`}),` Checking…`]}):t.status===`local`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(u,{className:`size-3`}),` Already available locally`]}):t.status===`failed`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ie,{className:`size-3`}),` Failed`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ee,{className:`size-3`}),` Connected`]})})]}),t.status===`connected`?(0,Q.jsx)(`div`,{className:`mt-1.5`,children:(0,Q.jsx)(Lt,{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]=p,t[72]=i,t[73]=de):de=t[73];let fe;t[74]!==K||t[75]!==de?(fe=(0,Q.jsxs)(`div`,{className:`rounded-lg border border-border/60`,children:[K,de]}),t[74]=K,t[75]=de,t[76]=fe):fe=t[76];let pe;t[77]!==A||t[78]!==F||t[79]!==U||t[80]!==fe?(pe=(0,Q.jsxs)(Re,{children:[A,F,U,fe]}),t[77]=A,t[78]=F,t[79]=U,t[80]=fe,t[81]=pe):pe=t[81];let me;t[82]!==a||t[83]!==s?(me=(0,Q.jsx)(P,{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]!==m||t[87]!==c.label||t[88]!==_?(he=a||m||!_||!c.label.trim(),t[85]=a,t[86]=m,t[87]=c.label,t[88]=_,t[89]=he):he=t[89];let ge;t[90]===a?ge=t[91]:(ge=a?(0,Q.jsx)(_e,{size:`xs`}):null,t[90]=a,t[91]=ge);let q;t[92]!==he||t[93]!==ge?(q=(0,Q.jsxs)(P,{type:`submit`,disabled:he,children:[ge,` Save host`]}),t[92]=he,t[93]=ge,t[94]=q):q=t[94];let ve;t[95]!==me||t[96]!==q?(ve=(0,Q.jsxs)(Ie,{children:[me,q]}),t[95]=me,t[96]=q,t[97]=ve):ve=t[97];let ye;t[98]!==D||t[99]!==pe||t[100]!==x||t[101]!==ve||t[102]!==S?(ye=(0,Q.jsxs)(Be,{showCloseButton:x,render:S,children:[D,pe,ve]}),t[98]=D,t[99]=pe,t[100]=x,t[101]=ve,t[102]=S,t[103]=ye):ye=t[103];let be;return t[104]!==b||t[105]!==ye?(be=(0,Q.jsx)(Ve,{open:!0,onOpenChange:b,children:ye}),t[104]=b,t[105]=ye,t[106]=be):be=t[106],be}function Gt(e){return e.status===`failed`}function Kt(e){return e.status===`pending`}function qt(e){let{scope:t,environments:n,connectedEnvironments:r}=ct(),i=Te(e.environmentId,s),a=t.kind===`project`||t.kind===`checkout`,o=Oe(we.updateSettings,{reportFailure:!1}),[c,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}=Ut(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(!Ee(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return o({environmentId:e.environmentId,input:{patch:{deviceHosts:It(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)(P,{size:`sm`,variant:`outline`,disabled:!i||a||f||!e.environmentId||c!==null,onClick:()=>{d(null),l({kind:`ssh`,id:ne(),label:``,target:``})},children:[(0,Q.jsx)(O,{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)(Jt,{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)),c?(0,Q.jsx)(Wt,{host:c,isNew:u===null,targets:m,busy:f,onSave:e=>void _(e,!1,u??e),onClose:()=>l(null)},c.id):null]}):(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect a selected environment to manage device hosts.`})})})}function Jt(e){let t=(0,Z.c)(28),{environmentLabel:n,environmentId:r,hosts:i,busy:a,onEdit:o,onRemove:s,checks:l,testConnection:u}=e,{state:f}=He(r),p=Oe(Ue.list),[m,h]=(0,$.useState)(null),g;t[0]===i.length?g=t[1]:(g=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]=g);let _;if(t[2]!==a||t[3]!==l||t[4]!==r||t[5]!==n||t[6]!==i||t[7]!==o||t[8]!==s||t[9]!==p||t[10]!==m||t[11]!==f||t[12]!==u){let e;t[14]!==a||t[15]!==l||t[16]!==r||t[17]!==n||t[18]!==o||t[19]!==s||t[20]!==p||t[21]!==m||t[22]!==f||t[23]!==u?(e=e=>{let t=f.hostStatuses[e.id],i=l[Vt(e)]?.[r],g=(i?.status===`connected`?i.platforms:void 0)??f.hosts.find(t=>t.id===e.id)?.platforms??[],_=i?.status===`pending`?`Checking connection…`:t?.status===`installing`?`Installing device support…`:t?.status===`starting`?`Connecting…`:null,v=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}),g.filter(Xt).map(Yt)]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.target}),(0,Q.jsx)(Pt,{owner:n,error:f.hosts.find(t=>t.id===e.id)?.toolInspectionError,tools:f.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,v?(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:v})]})}):null]}),_?(0,Q.jsxs)(`span`,{role:`status`,className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(_e,{size:`xs`}),_]}):null,(0,Q.jsxs)(D,{children:[(0,Q.jsx)(oe,{render:(0,Q.jsx)(P,{size:`icon-sm`,variant:`ghost-muted`,disabled:a,"aria-label":e.label+` options`}),children:(0,Q.jsx)(d,{})}),(0,Q.jsxs)(H,{align:`end`,children:[(0,Q.jsx)(c,{onClick:()=>{o(e)},children:`Edit`}),(0,Q.jsx)(c,{variant:`destructive`,onClick:()=>s(e),children:`Remove`})]})]}),t?.status===`failed`&&f.supportsHostRetry&&f.hostStatus!==`disabled`?(0,Q.jsx)(P,{size:`sm`,variant:`outline`,disabled:a||m!==null,onClick:()=>{h(e.id),p({environmentId:r,input:{retryHostId:e.id}}).finally(()=>h(null))},children:m===e.id?`Retrying…`:`Retry`}):(0,Q.jsx)(P,{size:`sm`,variant:`outline`,disabled:a||_!==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]=s,t[20]=p,t[21]=m,t[22]=f,t[23]=u,t[24]=e):e=t[24],_=i.map(e),t[2]=a,t[3]=l,t[4]=r,t[5]=n,t[6]=i,t[7]=o,t[8]=s,t[9]=p,t[10]=m,t[11]=f,t[12]=u,t[13]=_}else _=t[13];let v;return t[25]!==g||t[26]!==_?(v=(0,Q.jsxs)(Q.Fragment,{children:[g,_]}),t[25]=g,t[26]=_,t[27]=v):v=t[27],v}function Yt(e){return(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ae,{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)(Qe,{className:`size-3.5 -translate-y-px`}):(0,Q.jsx)($e,{className:`size-3.5`})}),(0,Q.jsx)(je,{children:e.platform===`ios`?`iOS available`:`Android available`})]},e.platform)}function Xt(e){return e.available}var Zt=se(C),Qt=e=>({kind:`eas`,id:e,label:`EAS Simulator`,accessToken:``,maxSessionMinutes:30,idleMinutes:10,maxConcurrentSessions:2});function $t(e,t,n){return n?e.filter(e=>e.id!==t.id):e.some(e=>e.id===t.id)?e.map(e=>e.id===t.id?t:e):[...e,t]}function en(e){return`Up to ${e.maxConcurrentSessions===1?`1 session`:`${e.maxConcurrentSessions} sessions`} at once, each stopped after ${e.maxSessionMinutes} min or ${e.idleMinutes} idle min`}var tn=`thread-project`,nn={settings:`the access token saved here`,env:`EXPO_TOKEN on the server`,"eas-login":`the server's eas login`},rn=e=>{let t=b(e);return t instanceof Error?t.message:String(t)};function an(e){let t=(0,Z.c)(24),{scope:n,connectedEnvironments:r}=ct(),o=Te(e.environmentId,s),c=n.kind===`project`||n.kind===`checkout`,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[0]=l):l=t[0];let u=Oe(we.updateSettings,l),d;t[1]===e.environmentId?d=t[2]:(d=t=>t.environmentId===e.environmentId,t[1]=e.environmentId,t[2]=d);let f=r.find(d)?.serverConfig?.settings.easDeviceHosts??[],[p,m]=(0,$.useState)(null),[h,g]=(0,$.useState)(!1),_=!o||c||h||!e.environmentId,v=async(t,n)=>{if(!e.environmentId||!Ee(e.environmentId,`settings:write`))return;g(!0);let r=await u({environmentId:e.environmentId,input:{patch:{easDeviceHosts:$t(f,t,n)}}});g(!1),r._tag===`Success`?m(null):q.add({type:`error`,title:n?`EAS host not removed`:`EAS host not saved`,description:rn(r.cause)})},y=X,b;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(b=[`easDeviceHosts`],t[3]=b):b=t[3];let x=_||p!==null,S;t[4]===m?S=t[5]:(S=()=>m({host:Qt(ne()),isNew:!0}),t[4]=m,t[5]=S);let C;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(a,{className:`size-3.5`}),t[6]=C):C=t[6];let w;t[7]!==x||t[8]!==S?(w=(0,Q.jsxs)(P,{size:`sm`,variant:`outline`,disabled:x,onClick:S,children:[C,` Add EAS host`]}),t[7]=x,t[8]=S,t[9]=w):w=t[9];let T=f.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No EAS hosts.`}):(0,Q.jsx)(`ul`,{className:`divide-y divide-border/40`,children:f.map(e=>(0,Q.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-2.5 text-sm`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-1.5 truncate font-medium`,children:[(0,Q.jsx)(i,{className:`size-3.5 shrink-0`}),` `,e.label]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:en(e)})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,Q.jsx)(P,{size:`sm`,variant:`ghost`,disabled:_,onClick:()=>m({host:e,isNew:!1}),children:`Edit`}),(0,Q.jsx)(P,{size:`sm`,variant:`ghost-destructive`,disabled:_,onClick:()=>void v(e,!0),children:`Remove`})]})]},e.id))}),E;t[10]!==h||t[11]!==p||t[12]!==e.environmentId||t[13]!==v||t[14]!==m?(E=p&&e.environmentId?(0,Q.jsx)(on,{environmentId:e.environmentId,host:p.host,isNew:p.isNew,busy:h,onSave:e=>void v(e,!1),onClose:()=>m(null)},p.host.id):null,t[10]=h,t[11]=p,t[12]=e.environmentId,t[13]=v,t[14]=m,t[15]=E):E=t[15];let D;t[16]!==T||t[17]!==E?(D=(0,Q.jsxs)(`div`,{className:`pt-3 pb-2`,children:[T,E]}),t[16]=T,t[17]=E,t[18]=D):D=t[18];let O;return t[19]!==y||t[20]!==w||t[21]!==D||t[22]!==b?(O=(0,Q.jsx)(y,{id:`eas-device-hosts`,title:`EAS Simulator`,serverScoped:!0,settingKeys:b,description:`Run iOS Simulators in Expo's cloud from this environment. Sessions bill the Expo account until they stop, so each host limits how many run and for how long. Editing or removing a host stops its running sessions.`,control:w,children:D}),t[19]=y,t[20]=w,t[21]=D,t[22]=b,t[23]=O):O=t[23],O}function on(e){let t=(0,Z.c)(135),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=Oe(Ue.easAccount,n),[i,a]=(0,$.useState)(e.host),s=(0,$.useId)(),c;t[1]===e.host.accessToken?c=t[2]:(c=e.host.accessToken?{kind:`saved`}:{kind:`cleared`},t[1]=e.host.accessToken,t[2]=c);let[l,u]=(0,$.useState)(c),d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={status:`checking`},t[3]=d):d=t[3];let[f,p]=(0,$.useState)(d),m,h;t[4]!==i||t[5]!==e.host.accessToken||t[6]!==l.kind||t[7]!==l.value?(m={...i,label:i.label.trim(),accessToken:l.kind===`saved`?e.host.accessToken:l.kind===`new`?l.value:``},h=j(Zt(m)),t[4]=i,t[5]=e.host.accessToken,t[6]=l.kind,t[7]=l.value,t[8]=m,t[9]=h):(m=t[8],h=t[9]);let g=h,_=g?null:i.maxSessionMinutes>0&&i.idleMinutes>=i.maxSessionMinutes?`Idle minutes must be smaller than session minutes.`:`Give the host a label and limits within the ranges shown.`,v;t[10]!==f.account||t[11]!==f.status?(v=f.status===`signed-in`?f.account.apps:[],t[10]=f.account,t[11]=f.status,t[12]=v):v=t[12];let y=v,b=(0,$.useRef)(0),x;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{b.current+=1,p({status:`idle`})},t[13]=x):x=t[13];let S=x,C;t[14]!==r||t[15]!==e.environmentId||t[16]!==e.host.id||t[17]!==e.isNew||t[18]!==l.kind||t[19]!==l.value?(C=async()=>{let t=b.current+=1,n=await r({environmentId:e.environmentId,input:{...l.kind===`saved`&&!e.isNew?{hostId:e.host.id}:{},...l.kind===`new`?{accessToken:l.value}:l.kind===`cleared`?{accessToken:``}:{}}});t===b.current&&p(n._tag===`Success`?{status:`signed-in`,account:n.value}:{status:`failed`,error:rn(n.cause)})},t[14]=r,t[15]=e.environmentId,t[16]=e.host.id,t[17]=e.isNew,t[18]=l.kind,t[19]=l.value,t[20]=C):C=t[20];let w=C,T;t[21]===w?T=t[22]:(T=()=>{p({status:`checking`}),w()},t[21]=w,t[22]=T);let E=T,D;t[23]===w?D=t[24]:(D=()=>void w(),t[23]=w,t[24]=D);let O=(0,$.useEffectEvent)(D),k;t[25]===O?k=t[26]:(k=()=>{O()},t[25]=O,t[26]=k);let A;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(A=[],t[27]=A):A=t[27],(0,$.useEffect)(k,A);let M;t[28]!==i||t[29]!==e.busy?(M=(t,n,r)=>(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,Q.jsx)(`span`,{children:n}),(0,Q.jsx)(Ne,{type:`number`,min:1,max:r,value:i[t],disabled:e.busy,onChange:e=>{let n=Number(e.target.value);a(e=>({...e,[t]:n}))}})]}),t[28]=i,t[29]=e.busy,t[30]=M):M=t[30];let N=M,F;t[31]===e?F=t[32]:(F=t=>{!t&&!e.busy&&e.onClose()},t[31]=e,t[32]=F);let I=!e.busy,L;t[33]!==m||t[34]!==e||t[35]!==g?(L=t=>{t.preventDefault(),g&&!e.busy&&e.onSave(m)},t[33]=m,t[34]=e,t[35]=g,t[36]=L):L=t[36];let R=e.isNew?`Add EAS host`:`Edit EAS host`,z;t[37]===R?z=t[38]:(z=(0,Q.jsx)(Fe,{children:R}),t[37]=R,t[38]=z);let B;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Q.jsx)(ze,{children:`The environment's server signs in to Expo and starts the sessions. Without a token here it uses EXPO_TOKEN, then its eas login.`}),t[39]=B):B=t[39];let ee;t[40]===z?ee=t[41]:(ee=(0,Q.jsxs)(Pe,{children:[z,B]}),t[40]=z,t[41]=ee);let te;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Q.jsx)(`span`,{children:`Name`}),t[42]=te):te=t[42];let ne;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ne=e=>{let t=e.target.value;a(e=>({...e,label:t}))},t[43]=ne):ne=t[43];let re;t[44]!==i.label||t[45]!==e.busy?(re=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[te,(0,Q.jsx)(Ne,{autoFocus:!0,required:!0,value:i.label,disabled:e.busy,onChange:ne})]}),t[44]=i.label,t[45]=e.busy,t[46]=re):re=t[46];let ie;t[47]===s?ie=t[48]:(ie=(0,Q.jsx)(`label`,{htmlFor:s,className:`block`,children:`Expo access token`}),t[47]=s,t[48]=ie);let ae=l.kind===`saved`,V=l.kind===`new`?l.value:``,H;t[49]===e.host.accessToken?H=t[50]:(H=t=>{let n=t.target.value;u(n?{kind:`new`,value:n}:e.host.accessToken?{kind:`saved`}:{kind:`cleared`}),S()},t[49]=e.host.accessToken,t[50]=H);let oe;t[51]!==e.busy||t[52]!==ae||t[53]!==V||t[54]!==H||t[55]!==s?(oe=(0,Q.jsx)(At,{id:s,className:`min-w-0 flex-1`,configured:ae,value:V,disabled:e.busy,placeholder:`Optional`,onChange:H}),t[51]=e.busy,t[52]=ae,t[53]=V,t[54]=H,t[55]=s,t[56]=oe):oe=t[56];let U;t[57]===l.kind?U=t[58]:(U=l.kind===`cleared`?null:(0,Q.jsx)(P,{type:`button`,size:`icon-sm`,variant:`ghost-destructive`,"aria-label":`Clear access token`,onClick:()=>{u({kind:`cleared`}),S()},children:(0,Q.jsx)(o,{className:`size-3.5`})}),t[57]=l.kind,t[58]=U);let se;t[59]!==oe||t[60]!==U?(se=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[oe,U]}),t[59]=oe,t[60]=U,t[61]=se):se=t[61];let ce;t[62]!==ie||t[63]!==se?(ce=(0,Q.jsxs)(`div`,{className:`space-y-1.5 text-sm`,children:[ie,se]}),t[62]=ie,t[63]=se,t[64]=ce):ce=t[64];let le=f.status===`signed-in`?`Signed in as ${f.account.signedInAs} with ${nn[f.account.credentialSource]}.`:f.status===`failed`?f.error:f.status===`checking`?`Checking the Expo account…`:`Check the Expo account before choosing a project.`,W;t[65]===le?W=t[66]:(W=(0,Q.jsx)(`p`,{role:`status`,className:`min-w-0 text-xs text-muted-foreground`,children:le}),t[65]=le,t[66]=W);let ue=e.busy||f.status===`checking`,G;t[67]===E?G=t[68]:(G=()=>void E(),t[67]=E,t[68]=G);let fe;t[69]===f.status?fe=t[70]:(fe=f.status===`checking`?(0,Q.jsx)(_e,{size:`xs`}):null,t[69]=f.status,t[70]=fe);let me;t[71]!==ue||t[72]!==G||t[73]!==fe?(me=(0,Q.jsxs)(P,{type:`button`,size:`sm`,variant:`outline`,disabled:ue,onClick:G,children:[fe,` Check account`]}),t[71]=ue,t[72]=G,t[73]=fe,t[74]=me):me=t[74];let q;t[75]!==W||t[76]!==me?(q=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2.5`,children:[W,me]}),t[75]=W,t[76]=me,t[77]=q):q=t[77];let ve;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Q.jsx)(`span`,{children:`EAS project`}),t[78]=ve):ve=t[78];let ye=i.appId??tn,be=e.busy,xe;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(xe=e=>{typeof e==`string`&&a(t=>{let{appId:n,...r}=t;return e===tn?r:{...r,appId:e}})},t[79]=xe):xe=t[79];let Se;t[80]===y?Se=t[81]:(Se=(0,Q.jsx)(he,{size:`sm`,"aria-label":`EAS project`,children:(0,Q.jsx)(de,{children:e=>e===tn?`From the thread's project`:y.find(t=>t.id===e)?.fullName??e})}),t[80]=y,t[81]=Se);let Ce;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Q.jsx)(K,{value:tn,children:`From the thread's project`}),t[82]=Ce):Ce=t[82];let J;t[83]!==y||t[84]!==i.appId?(J=i.appId&&!y.some(e=>e.id===i.appId)?(0,Q.jsx)(K,{value:i.appId,children:i.appId}):null,t[83]=y,t[84]=i.appId,t[85]=J):J=t[85];let Y;t[86]===y?Y=t[87]:(Y=y.map(sn),t[86]=y,t[87]=Y);let we;t[88]!==J||t[89]!==Y?(we=(0,Q.jsxs)(pe,{children:[Ce,J,Y]}),t[88]=J,t[89]=Y,t[90]=we):we=t[90];let Te;t[91]!==e.busy||t[92]!==ye||t[93]!==Se||t[94]!==we?(Te=(0,Q.jsxs)(ge,{value:ye,disabled:be,onValueChange:xe,children:[Se,we]}),t[91]=e.busy,t[92]=ye,t[93]=Se,t[94]=we,t[95]=Te):Te=t[95];let Ee;t[96]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Sessions bill the project's Expo account. "From the thread's project" reads extra.eas.projectId from the project's app config.`}),t[96]=Ee):Ee=t[96];let De;t[97]===Te?De=t[98]:(De=(0,Q.jsxs)(`div`,{className:`space-y-1.5 text-sm`,children:[ve,Te,Ee]}),t[97]=Te,t[98]=De);let ke;t[99]===N?ke=t[100]:(ke=(0,Q.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 text-sm`,children:[N(`maxConcurrentSessions`,`Sessions at once`,20),N(`maxSessionMinutes`,`Session minutes`,115),N(`idleMinutes`,`Idle minutes`,60)]}),t[99]=N,t[100]=ke);let Ae=e.isNew?null:` Saving restarts this host, which stops its running sessions.`,je;t[101]===Ae?je=t[102]:(je=(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Expo allows sessions of up to 40 minutes on free accounts and 115 on paid ones, and ends one after the idle minutes without activity, so idle minutes must be smaller than session minutes.`,Ae]}),t[101]=Ae,t[102]=je);let Me;t[103]===_?Me=t[104]:(Me=_===null?null:(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:_}),t[103]=_,t[104]=Me);let Le;t[105]!==re||t[106]!==ce||t[107]!==q||t[108]!==De||t[109]!==ke||t[110]!==je||t[111]!==Me?(Le=(0,Q.jsxs)(Re,{children:[re,ce,q,De,ke,je,Me]}),t[105]=re,t[106]=ce,t[107]=q,t[108]=De,t[109]=ke,t[110]=je,t[111]=Me,t[112]=Le):Le=t[112];let He;t[113]!==e.busy||t[114]!==e.onClose?(He=(0,Q.jsx)(P,{type:`button`,variant:`ghost`,disabled:e.busy,onClick:e.onClose,children:`Cancel`}),t[113]=e.busy,t[114]=e.onClose,t[115]=He):He=t[115];let We=e.busy||!g,Ge;t[116]===e.busy?Ge=t[117]:(Ge=e.busy?(0,Q.jsx)(_e,{size:`xs`}):null,t[116]=e.busy,t[117]=Ge);let Ke;t[118]!==We||t[119]!==Ge?(Ke=(0,Q.jsxs)(P,{type:`submit`,disabled:We,children:[Ge,` Save host`]}),t[118]=We,t[119]=Ge,t[120]=Ke):Ke=t[120];let qe;t[121]!==He||t[122]!==Ke?(qe=(0,Q.jsxs)(Ie,{children:[He,Ke]}),t[121]=He,t[122]=Ke,t[123]=qe):qe=t[123];let Je;t[124]!==L||t[125]!==ee||t[126]!==Le||t[127]!==qe?(Je=(0,Q.jsxs)(`form`,{className:`flex min-h-0 flex-col`,onSubmit:L,children:[ee,Le,qe]}),t[124]=L,t[125]=ee,t[126]=Le,t[127]=qe,t[128]=Je):Je=t[128];let Ye;t[129]!==I||t[130]!==Je?(Ye=(0,Q.jsx)(Be,{showCloseButton:I,children:Je}),t[129]=I,t[130]=Je,t[131]=Ye):Ye=t[131];let Xe;return t[132]!==F||t[133]!==Ye?(Xe=(0,Q.jsx)(Ve,{open:!0,onOpenChange:F,children:Ye}),t[132]=F,t[133]=Ye,t[134]=Xe):Xe=t[134],Xe}function sn(e){return(0,Q.jsx)(K,{value:e.id,children:e.fullName},e.id)}function cn(e,t){if(e)return{kind:`new`};let n=t[0];return n?{kind:`existing`,profileId:n.id}:{kind:`new`}}function ln(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 un(e){return e.step!==`importing`}function dn(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 fn(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 pn(e){return e===void 0?{step:`blocked`,reason:`unknownSource`}:dn(e)}function mn(e){let t=pn(e);return t.step===`fullDiskAccess`?{...t,checked:!0}:t}function hn(e,t){return t.profiles.some(t=>t.directory===e)?e:t.profiles[0]?.directory??``}function gn(e){switch(e){case`needsKeychainApproval`:case`keychainItemMissing`:case`keychainUnavailable`:case`readFailed`:case`sessionUnavailable`:case`profileNotSaved`:return!0;default:return!1}}function _n(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 vn(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=()=>dn(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=()=>cn(a,i),t[4]=a,t[5]=i,t[6]=y):y=t[6];let[b,x]=(0,$.useState)(y),[S,C]=(0,$.useState)(),w;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(w=ne(),t[7]=w):w=t[7];let T=(0,$.useRef)(`profile-${w}`),E=(0,$.useRef)(!1),D;t[8]!==o||t[9]!==_||t[10]!==b||t[11]!==i?(D=()=>{if(E.current)return;let e=ln(b,T.current,i);if(e===void 0){C(`That profile is no longer available. Choose where to import these cookies.`),h({step:`configure`});return}C(void 0),E.current=!0,h({step:`importing`}),o({sourceProfileDirectory:_,target:e}).then(e=>h(fn(e))).catch(()=>h({step:`blocked`,reason:`readFailed`})).finally(()=>{E.current=!1})},t[8]=o,t[9]=_,t[10]=b,t[11]=i,t[12]=D):D=t[12];let O=D,k;t[13]===s?k=t[14]:(k=(e,t)=>{h({step:`checking`,check:e}),s().then(e=>{e&&(f(e),v(t=>hn(t,e))),h(t(e))}).catch(()=>h({step:`blocked`,reason:`readFailed`}))},t[13]=s,t[14]=k);let A=k,j;t[15]===A?j=t[16]:(j=()=>A(`browser`,pn),t[15]=A,t[16]=j);let M=j,N;t[17]===A?N=t[18]:(N=()=>A(`fullDiskAccess`,mn),t[17]=A,t[18]=N);let P=N,F;t[19]!==u||t[20]!==m?(F=e=>e||!un(m)?void 0:u(),t[19]=u,t[20]=m,t[21]=F):F=t[21];let I;t[22]===m?I=t[23]:(I=un(m),t[22]=m,t[23]=I);let L;t[24]!==a||t[25]!==r||t[26]!==l||t[27]!==u||t[28]!==c||t[29]!==s||t[30]!==M||t[31]!==P||t[32]!==O||t[33]!==d||t[34]!==_||t[35]!==m||t[36]!==b||t[37]!==S||t[38]!==i?(L=m.step===`quit`?(0,Q.jsx)(yn,{source:d,onCancel:u,onRechecked:M}):m.step===`fullDiskAccess`?(0,Q.jsx)(Sn,{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`?O:P,stillRequired:m.checked===!0}):m.step===`importing`?(0,Q.jsx)(Tn,{}):m.step===`checking`?(0,Q.jsx)(En,{sourceName:d.name,check:m.check}):m.step===`done`?(0,Q.jsx)(Dn,{...m,destinationEnvironmentName:r,onClose:u}):m.step===`blocked`?(0,Q.jsx)(On,{source:d,reason:m.reason,onClose:u,onRetry:gn(m.reason)?O:void 0}):(0,Q.jsx)(Cn,{source:d,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:_,onSourceProfileChange:v,target:b,onTargetChange:e=>{x(e),C(void 0)},targetError:S,onCancel:u,onImport:O}),t[24]=a,t[25]=r,t[26]=l,t[27]=u,t[28]=c,t[29]=s,t[30]=M,t[31]=P,t[32]=O,t[33]=d,t[34]=_,t[35]=m,t[36]=b,t[37]=S,t[38]=i,t[39]=L):L=t[39];let R;t[40]!==I||t[41]!==L?(R=(0,Q.jsx)(Be,{className:`max-w-lg`,showCloseButton:I,children:L}),t[40]=I,t[41]=L,t[42]=R):R=t[42];let z;return t[43]!==R||t[44]!==F?(z=(0,Q.jsx)(Ve,{open:!0,onOpenChange:F,children:R}),t[43]=R,t[44]=F,t[45]=z):z=t[45],z}function yn(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)(Pe,{children:[(0,Q.jsxs)(Fe,{children:[`Quit `,n.name,` to import`]}),(0,Q.jsxs)(ze,{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)(P,{variant:`outline`,onClick:r,children:`Cancel`}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(P,{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)(Ie,{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 bn(e){if(e!==void 0)return e===0?`no cookies`:`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function xn(e){return`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Sn(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=Nt(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)(Pe,{children:[(0,Q.jsxs)(Fe,{children:[`Let P4 Code read `,n.name,`’s cookies`]}),(0,Q.jsxs)(ze,{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)(w,{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)(jt,{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 T;t[21]!==m||t[22]!==o?(T=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]=T):T=t[23];let E;t[24]!==C||t[25]!==T||t[26]!==S?(E=(0,Q.jsxs)(Re,{children:[S,C,T]}),t[24]=C,t[25]=T,t[26]=S,t[27]=E):E=t[27];let D;t[28]===r?D=t[29]:(D=(0,Q.jsx)(P,{variant:`outline`,onClick:r,children:`Cancel`}),t[28]=r,t[29]=D);let O;t[30]===m?O=t[31]:(O=m.isReady([`fullDiskAccess`]),t[30]=m,t[31]=O);let k;t[32]!==a||t[33]!==c||t[34]!==O?(k=(0,Q.jsx)(Mt,{ready:O,busy:c,onClick:a,children:`Continue`}),t[32]=a,t[33]=c,t[34]=O,t[35]=k):k=t[35];let A;t[36]!==D||t[37]!==k?(A=(0,Q.jsxs)(Ie,{children:[D,k]}),t[36]=D,t[37]=k,t[38]=A):A=t[38];let j;return t[39]!==E||t[40]!==A||t[41]!==_?(j=(0,Q.jsxs)(Q.Fragment,{children:[_,E,A]}),t[39]=E,t[40]=A,t[41]=_,t[42]=j):j=t[42],j}function Cn(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)(Fe,{children:[`Import from `,n.name]}),t[4]=n.name,t[5]=_);let v;t[6]===r?v=t[7]:(v=(0,Q.jsxs)(ze,{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)(Pe,{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)(wn,{selected:o===e.directory,title:e.name,subtitle:bn(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)(R,{className:`size-4 sm:hidden`}),(0,Q.jsx)(ae,{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)(wn,{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)(wn,{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 k;t[42]===g?k=t[43]:(k=g?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-destructive`,children:g}):null,t[42]=g,t[43]=k);let A;t[44]!==O||t[45]!==k?(A=(0,Q.jsxs)(Re,{children:[O,k]}),t[44]=O,t[45]=k,t[46]=A):A=t[46];let j;t[47]===d?j=t[48]:(j=(0,Q.jsx)(P,{variant:`outline`,onClick:d,children:`Cancel`}),t[47]=d,t[48]=j);let M=o===``||m||h,N;t[49]!==f||t[50]!==M?(N=(0,Q.jsx)(P,{disabled:M,onClick:f,children:`Import`}),t[49]=f,t[50]=M,t[51]=N):N=t[51];let F;t[52]!==j||t[53]!==N?(F=(0,Q.jsxs)(Ie,{children:[j,N]}),t[52]=j,t[53]=N,t[54]=F):F=t[54];let I;return t[55]!==A||t[56]!==F||t[57]!==y?(I=(0,Q.jsxs)(Q.Fragment,{children:[y,A,F]}),t[55]=A,t[56]=F,t[57]=y,t[58]=I):I=t[58],I}function wn(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=V(`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=V(`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)(ee,{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)(Pe,{children:[(0,Q.jsx)(Fe,{children:`Importing cookies`}),(0,Q.jsx)(ze,{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)(Re,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,Q.jsx)(_e,{size:`md`,tone:`muted`}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Importing…`})]})})]}),e[1]=n):n=e[1],n}function En(e){let t=(0,Z.c)(13),{sourceName:n,check:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsxs)(Fe,{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)(ze,{children:a}),t[2]=a,t[3]=o);let s;t[4]!==i||t[5]!==o?(s=(0,Q.jsxs)(Pe,{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)(_e,{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)(Re,{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 Dn(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 ${xn(n)}`:r>0?`Skipped ${xn(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)(Fe,{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?` ${xn(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)(ze,{children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Q.jsxs)(Pe,{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)(Re,{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:_n(i)})]}):null,t[15]=i,t[16]=p);let m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(P,{}),t[17]=m):m=t[17];let h;t[18]===s?h=t[19]:(h=(0,Q.jsx)(Ie,{children:(0,Q.jsx)(Le,{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 On(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)(Fe,{children:[`Couldn’t import from `,n.name]}),t[0]=n.name,t[1]=o);let s=B[r],c;t[2]===s?c=t[3]:(c=(0,Q.jsx)(ze,{children:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c?(l=(0,Q.jsxs)(Pe,{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)(P,{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)(P,{onClick:a,children:`Try again`}):null,t[9]=a,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,Q.jsxs)(Ie,{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 kn=`fill`,An=`responsive`;async function jn(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 Mn(e,t,n,r=0){return(e||r>0)&&t&&n>0}var Nn={width:1280,height:800},Pn={useGrouping:!1},Fn={system:`System`,light:`Light`,dark:`Dark`},In=e=>`${Math.round(e*100)}%`,Ln=class extends Error{constructor(){super(`Browser profile limit reached.`),this.name=`ProfileLimitReachedError`}},Rn=e=>{let t=String(e?.message??``);return M.literals.find(e=>t.includes(`failed: ${e}.`))??`readFailed`},zn=e=>e._tag===`fill`?kn:e._tag===`preset`&&ht.some(t=>t.id===e.presetId)?e.presetId:An,Bn=e=>{let t=zn(e);return t===kn?`Fill panel`:t===An?`Responsive`:ht.find(e=>e.id===t)?.label??`Responsive`},Vn=e=>Number.isInteger(e)&&e>=240&&e<=3840,Hn=e=>({...e,width:e.height,height:e.width});function Un(e){let t=(0,Z.c)(42),{disabled:n}=e,r=J(Gn),i=Y(),a=r._tag===`fill`?null:r,o=a?.width??Nn.width,s=a?.height??Nn.height,c;t[0]!==o||t[1]!==s?(c={width:o,height:s},t[0]=o,t[1]=s,t[2]=c):c=t[2];let l=c,u;t[3]!==a?.height||t[4]!==a?.width||t[5]!==i?(u=e=>{if(e===kn){i({browserDefaultViewport:te});return}if(e===An){i({browserDefaultViewport:{_tag:`freeform`,width:a?.width??Nn.width,height:a?.height??Nn.height}});return}let t=ht.find(t=>t.id===e);t&&i({browserDefaultViewport:{_tag:`preset`,width:t.width,height:t.height,presetId:t.id}})},t[3]=a?.height,t[4]=a?.width,t[5]=i,t[6]=u):u=t[6];let d=u,f;t[7]!==l||t[8]!==a||t[9]!==i?(f=(e,t)=>{if(t===null||!Vn(t))return;let n={...l,[e]:t};n.width*n.height>8294400||a&&n.width===a.width&&n.height===a.height||i({browserDefaultViewport:{_tag:`freeform`,...n}})},t[7]=l,t[8]=a,t[9]=i,t[10]=f):f=t[10];let p=f,m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=St(`browser-default-viewport`),t[11]=m):m=t[11];let h;t[12]!==n||t[13]!==i||t[14]!==r._tag?(h=!n&&r._tag!==U._tag?(0,Q.jsx)(dt,{label:`default browser viewport`,onClick:()=>i({browserDefaultViewport:U})}):null,t[12]=n,t[13]=i,t[14]=r._tag,t[15]=h):h=t[15];let g;t[16]===r?g=t[17]:(g=zn(r),t[16]=r,t[17]=g);let v;t[18]===r?v=t[19]:(v=Bn(r),t[18]=r,t[19]=v);let y;t[20]===v?y=t[21]:(y=(0,Q.jsx)(he,{size:`sm`,className:`w-full min-w-0 sm:w-44`,"aria-label":`Default browser viewport`,children:(0,Q.jsx)(de,{children:v})}),t[20]=v,t[21]=y);let b,x;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(K,{value:kn,children:`Fill panel`}),x=(0,Q.jsx)(K,{value:An,children:`Responsive`}),t[22]=b,t[23]=x):(b=t[22],x=t[23]);let S;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsxs)(pe,{align:`end`,alignItemWithTrigger:!1,children:[b,x,(0,Q.jsxs)(me,{children:[(0,Q.jsx)(fe,{children:`Standard`}),ht.map(Wn)]})]}),t[24]=S):S=t[24];let C;t[25]!==n||t[26]!==d||t[27]!==y||t[28]!==g?(C=(0,Q.jsxs)(ge,{value:g,onValueChange:d,disabled:n,children:[y,S]}),t[25]=n,t[26]=d,t[27]=y,t[28]=g,t[29]=C):C=t[29];let w;t[30]!==p||t[31]!==n||t[32]!==l||t[33]!==a||t[34]!==i?(w=a?(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(G,{value:l.width,min:240,max:_,disabled:n,format:Pn,size:`sm`,className:`w-20`,onValueCommitted:e=>p(`width`,e),children:(0,Q.jsx)(ue,{children:(0,Q.jsx)(W,{"aria-label":`Default viewport width`})})}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`×`}),(0,Q.jsx)(G,{value:l.height,min:240,max:_,disabled:n,format:Pn,size:`sm`,className:`w-20`,onValueCommitted:e=>p(`height`,e),children:(0,Q.jsx)(ue,{children:(0,Q.jsx)(W,{"aria-label":`Default viewport height`})})}),(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ae,{render:(0,Q.jsx)(P,{size:`icon-sm`,variant:`ghost-muted`,disabled:n,"aria-label":`Rotate to ${l.height>=l.width?`landscape`:`portrait`}`,onClick:()=>i({browserDefaultViewport:Hn(a)}),children:(0,Q.jsx)(Et,{})})}),(0,Q.jsx)(je,{side:`top`,children:`Rotate`})]})]}):null,t[30]=p,t[31]=n,t[32]=l,t[33]=a,t[34]=i,t[35]=w):w=t[35];let T;t[36]!==C||t[37]!==w?(T=(0,Q.jsxs)(`div`,{className:`flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto`,children:[C,w]}),t[36]=C,t[37]=w,t[38]=T):T=t[38];let E;return t[39]!==T||t[40]!==h?(E=(0,Q.jsx)(X,{...m,description:`Tab size for you and agents. Fill fits the panel; other sizes show the device toolbar.`,resetAction:h,control:T}),t[39]=T,t[40]=h,t[41]=E):E=t[41],E}function Wn(e){return(0,Q.jsx)(K,{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 Gn(e){return e.browserDefaultViewport}function Kn(e){let t=(0,Z.c)(20),{disabled:n}=e,r=J(Jn),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=St(`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)(dt,{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=p.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=In(r),t[7]=r,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,Q.jsx)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser zoom`,children:(0,Q.jsx)(de,{children:l})}),t[9]=l,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:p.map(qn)}),t[11]=d):d=t[11];let f;t[12]!==n||t[13]!==s||t[14]!==c||t[15]!==u?(f=(0,Q.jsxs)(ge,{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 m;return t[17]!==o||t[18]!==f?(m=(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]=m):m=t[19],m}function qn(e){return(0,Q.jsx)(K,{hideIndicator:!0,value:String(e),children:In(e)},e)}function Jn(e){return e.browserDefaultZoomFactor}function Yn(e){let t=(0,Z.c)(18),{disabled:n}=e,r=J(Zn),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=St(`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)(dt,{label:`default browser appearance`,onClick:()=>i({browserDefaultAppearance:v})}):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)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser appearance`,children:(0,Q.jsx)(de,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(Fn).map(Xn)}),t[9]=u):u=t[9];let d;t[10]!==r||t[11]!==n||t[12]!==s||t[13]!==l?(d=(0,Q.jsxs)(ge,{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 Xn(e){let[t,n]=e;return(0,Q.jsx)(K,{hideIndicator:!0,value:t,children:n},t)}function Zn(e){return e.browserDefaultAppearance}function Qn(e){let t=(0,Z.c)(17),{disabled:n}=e,r=J(er),i=J($n),a=Y(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=St(`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)(Tt,{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=St(`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)(Tt,{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 $n(e){return e.browserRecordingShowMousePresses}function er(e){return e.browserRecordingShowKeyPresses}function tr(e){let t=(0,Z.c)(18),{disabled:n}=e,r=J(rr),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=St(`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)(dt,{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=re.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)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Browser recording frame rate`,children:(0,Q.jsxs)(de,{children:[r,` fps`]})}),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:re.map(nr)}),t[9]=u):u=t[9];let d;t[10]!==n||t[11]!==s||t[12]!==c||t[13]!==l?(d=(0,Q.jsxs)(ge,{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 nr(e){return(0,Q.jsxs)(K,{hideIndicator:!0,value:String(e),children:[e,` fps`]},e)}function rr(e){return e.browserRecordingFrameRate}var ir={system:`Your default browser`,app:`P4 Code`};function ar(e){let t=(0,Z.c)(19),{disabled:n}=e,r=J(sr),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=St(`browser-link-target`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==r||t[3]!==i?(o=!n&&r!==`system`?(0,Q.jsx)(dt,{label:`link target`,onClick:()=>i({browserLinkTarget:x})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>{(e===`system`||e===`app`)&&i({browserLinkTarget:e})},t[5]=i,t[6]=s);let c=ir[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Open links in`,children:(0,Q.jsx)(de,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=Object.keys(ir),t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:u.map(or)}),t[10]=d):d=t[10];let f;t[11]!==n||t[12]!==r||t[13]!==s||t[14]!==l?(f=(0,Q.jsxs)(ge,{disabled:n,value:r,onValueChange:s,children:[l,d]}),t[11]=n,t[12]=r,t[13]=s,t[14]=l,t[15]=f):f=t[15];let p;return t[16]!==o||t[17]!==f?(p=(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:o,control:f}),t[16]=o,t[17]=f,t[18]=p):p=t[18],p}function or(e){return(0,Q.jsx)(K,{hideIndicator:!0,value:e,children:ir[e]},e)}function sr(e){return e.browserLinkTarget}var cr={duckduckgo:`DuckDuckGo`,google:`Google`,bing:`Bing`,brave:`Brave Search`,kagi:`Kagi`,ecosia:`Ecosia`,custom:`Custom`};function lr(){let e=(0,Z.c)(24),t=J(fr),n=J(dr),r=Y(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=St(`browser-search-engine`),e[0]=i):i=e[0];let a;e[1]!==n||e[2]!==t||e[3]!==r?(a=t!==`duckduckgo`||n!==``?(0,Q.jsx)(dt,{label:`search engine`,onClick:()=>r({browserSearchEngine:l,browserCustomSearchUrl:``})}):null,e[1]=n,e[2]=t,e[3]=r,e[4]=a):a=e[4];let o;e[5]===r?o=e[6]:(o=e=>{let t=L.literals.find(t=>t===e);t!==void 0&&r({browserSearchEngine:t})},e[5]=r,e[6]=o);let s=cr[t],c;e[7]===s?c=e[8]:(c=(0,Q.jsx)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Search engine`,children:(0,Q.jsx)(de,{children:s})}),e[7]=s,e[8]=c);let u;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:L.literals.map(ur)}),e[9]=u):u=e[9];let d;e[10]!==t||e[11]!==o||e[12]!==c?(d=(0,Q.jsxs)(ge,{value:t,onValueChange:o,children:[c,u]}),e[10]=t,e[11]=o,e[12]=c,e[13]=d):d=e[13];let f;e[14]!==a||e[15]!==d?(f=(0,Q.jsx)(X,{...i,description:`What the address bar searches when you type something that isn't a URL.`,resetAction:a,control:d}),e[14]=a,e[15]=d,e[16]=f):f=e[16];let p;e[17]!==n||e[18]!==t||e[19]!==r?(p=t===`custom`?(0,Q.jsx)(X,{title:`Custom search URL`,description:`Use %s where the search terms go.`,status:tt(n)?void 0:`Enter an http or https URL containing %s. Searches use DuckDuckGo until then.`,control:(0,Q.jsx)(Ot,{nativeInput:!0,size:`sm`,className:`w-full sm:w-64`,"aria-label":`Custom search URL`,placeholder:`https://example.com/search?q=%s`,autoCapitalize:`none`,spellCheck:!1,maxLength:F,value:n,onCommit:e=>r({browserCustomSearchUrl:e.trim()})})}):null,e[17]=n,e[18]=t,e[19]=r,e[20]=p):p=e[20];let m;return e[21]!==f||e[22]!==p?(m=(0,Q.jsxs)(Q.Fragment,{children:[f,p]}),e[21]=f,e[22]=p,e[23]=m):m=e[23],m}function ur(e){return(0,Q.jsx)(K,{hideIndicator:!0,value:e,children:cr[e]},e)}function dr(e){return e.browserCustomSearchUrl}function fr(e){return e.browserSearchEngine}function pr(){let e=(0,Z.c)(12),t=J(mr),n=Y(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=St(`pull-request-links-open-in-app`),e[0]=r):r=e[0];let i;e[1]!==t||e[2]!==n?(i=t?null:(0,Q.jsx)(dt,{label:`open pull requests in P4 Code`,onClick:()=>n({pullRequestLinksOpenInApp:!0})}),e[1]=t,e[2]=n,e[3]=i):i=e[3];let a;e[4]===n?a=e[5]:(a=e=>n({pullRequestLinksOpenInApp:!!e}),e[4]=n,e[5]=a);let o;e[6]!==t||e[7]!==a?(o=(0,Q.jsx)(Tt,{checked:t,onCheckedChange:a,"aria-label":`Open pull requests in P4 Code`}),e[6]=t,e[7]=a,e[8]=o):o=e[8];let s;return e[9]!==i||e[10]!==o?(s=(0,Q.jsx)(X,{...r,description:`Clicking a pull request link opens it in P4 Code. Turn off to open pull request links like any other link, on GitHub or your git host.`,resetAction:i,control:o}),e[9]=i,e[10]=o,e[11]=s):s=e[11],s}function mr(e){return e.pullRequestLinksOpenInApp}function hr(){let e=(0,Z.c)(7),{search:t,environment:n}=ct(),r=ot(),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)(ft,{id:`devices`,title:`Devices`,children:(0,Q.jsx)(gr,{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 gr({environmentId:e,enabled:t,agentAccessEnabled:n}){let r=Te(e,s),{state:i,loaded:a}=He(e),{scope:o,environments:c,connectedEnvironments:l}=ct(),u=st(),d=o.kind===`project`||o.kind===`checkout`,f=l.some(e=>e.serverConfig?.settings.enableDeviceSupport),p=Oe(Ue.configure,{reportFailure:!1}),m=Oe(Ue.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&&Ee(e,`settings:write`)){g(t);try{let e=await Promise.allSettled(c.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!Ee(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return p({environmentId:e.environmentId,input:{...n,...n.enabled?{onboardingCompleted:!0}:{}}})})),t=c.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=e=>{let t=w?.[e];return i.supportsToolUpdate&&t?!t.installedVersions.includes(t.requiredVersion):!1},E=(t,n=!1)=>{e&&(C(null),g(`update-${t}`),m({environmentId:e,input:{updateTool:t}}).then(e=>{if(e._tag===`Failure`){let r=De(e.cause);C({tool:t,message:r}),n&&q.add({type:`error`,title:r})}}).finally(()=>g(null)))},D=t=>{e&&(g(t),m({environmentId:e,input:{inspectOnly:!0}}).finally(()=>g(null)))},O=t=>{let n=T(t);if(!n&&!i.supportsToolInspection)return null;let r=h===`update-${t}`||h===`check-${t}`,a=n?`Update to v${w?.[t].requiredVersion}`:`Check ${t===`hub`?`device hub`:`agent device`} version`;return(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ae,{render:(0,Q.jsx)(P,{size:`icon-xs`,variant:`ghost-muted`,disabled:!e||h!==null||_,"aria-label":a,onClick:()=>n?E(t,!0):D(`check-${t}`)}),children:(0,Q.jsxs)(`span`,{className:`grid *:col-start-1 *:row-start-1 *:transition-[opacity,scale] *:duration-150 *:ease-out motion-reduce:*:transition-none`,children:[(0,Q.jsx)(`span`,{className:n&&!r?void 0:`scale-75 opacity-0`,children:(0,Q.jsx)(z,{"aria-hidden":!0})}),(0,Q.jsx)(`span`,{className:n&&!r?`scale-75 opacity-0`:void 0,children:(0,Q.jsx)(bt,{refreshing:r})})]})}),(0,Q.jsx)(je,{side:`top`,children:a})]})},k=t=>{let n=w?.[t];return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[n&&T(t)?(0,Q.jsx)(P,{size:`sm`,disabled:!e||h!==null||_,onClick:()=>E(t),children:h===`update-${t}`?`Updating…`:`Update to v${n.requiredVersion}`}):null,i.supportsToolInspection?(0,Q.jsx)(P,{size:`sm`,variant:`outline`,disabled:!e||h!==null||_,onClick:()=>D(`check`),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,{...St(`device-hub`),serverScoped:!0,settingKeys:[`enableDeviceSupport`],description:Je,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Pt,{action:k(`hub`),kind:`hub`,tools:i.hosts.find(e=>e.kind===`local`)?.tools}),O(`hub`),h===`hub`?(0,Q.jsx)(qe,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(kt,{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,{...St(`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)(Ge,{compact:!0,platform:`iOS`,status:Ke(i,`ios`)}),(0,Q.jsx)(Ge,{compact:!0,platform:`Android`,status:Ke(i,`android`)})]}),control:(0,Q.jsx)(P,{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,{...St(`agent-device-access`),serverScoped:!0,settingKeys:[`enableAgentDeviceAccess`],description:We,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Pt,{action:k(`agent`),kind:`agent`,tools:i.hosts.find(e=>e.kind===`local`)?.tools}),O(`agent`),h===`agent`?(0,Q.jsx)(Ye,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(kt,{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)(Xe,{state:{...i,hosts:i.hosts.filter(e=>e.kind===`local`)},environmentId:e}):null,(0,Q.jsx)(qt,{environmentId:e}),i.supportsEasHosts?(0,Q.jsx)(an,{environmentId:e}):null]})}function _r(e){let t=(0,Z.c)(14),{disabled:n}=e,r=J(vr),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=St(`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)(dt,{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)(Tt,{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 vr(e){return e.browserAutoShowFloatingPreview}function yr({disabled:e}){let t=J(e=>e.browserProfiles),n=J(e=>e.browserDefaultProfileId),r=xe(),i=Y(),{environments:a,isReady:o}=ye(),s=ve(),[l,u]=(0,$.useState)(null),[f,p]=(0,$.useState)(null),[_,v]=(0,$.useState)(null),[b,x]=(0,$.useState)(null),[S,C]=(0,$.useState)(null),[w,k]=(0,$.useState)(!1),j=le(),M=Oe(et.clearProfile,{reportFailure:!1}),F={environmentIds:a.map(e=>e.environmentId).filter(e=>j.get(e)?.environment.capabilities.serverBrowser===!0),clear:async(e,t)=>{let n=await M({environmentId:e,input:{profileId:t}});if(n._tag===`Failure`)throw ce(n)}},I=Mn(wt!==null,o,a.length,F.environmentIds.length),L=(0,$.useRef)(!1),[R,z]=(0,$.useState)(!1),B=e||!r,ee=T(t).filter(e=>e.kind!==`incognito`),te=m(ee,n)?.id??`default`,re=e=>{if(!r||L.current)return;let t=Ce().browserProfiles;if(t.length>=24)return;let n=T(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-${ne()}`,name:o,kind:`persistent`};return i({browserProfiles:[...t,s]}),s},ie=(e,t)=>{if(!r||L.current)return;let n=t.trim().slice(0,48);if(n===``)return;let a=Ce().browserProfiles;i({browserProfiles:a.map(t=>t.id===e?{...t,name:n}:t)})},ae=(e,t)=>{if(r&&!L.current){if(!I){q.add({type:`error`,title:`Could not clear ${t}'s data`,description:`You're not connected to a server yet.`});return}jn(wt,a.map(e=>e.environmentId),e,F).then(()=>{q.add({type:`success`,title:`Cleared ${t}'s cookies and cache`})}).catch(()=>{q.add({type:`error`,title:`Could not clear ${t}'s data`})})}},U=async e=>{if(!r||L.current)return;if(!I){C(`Connect to an environment before removing this profile.`);return}C(null),k(!0);try{await jn(wt,o?a.map(e=>e.environmentId):[],e,F)}catch{C(`Profile data could not be deleted. Try again.`),k(!1);return}let t=Ce();i({browserProfiles:t.browserProfiles.filter(t=>t.id!==e),...t.browserDefaultProfileId===e?{browserDefaultProfileId:g}:{}}),k(!1),v(null)},se=(l??[]).filter(e=>e.unavailable!==`notInstalled`&&e.unavailable!==`unsupportedPlatform`),W=(0,$.useCallback)(()=>{wt&&wt.listBrowserImportSources().then(u).catch(()=>u(e=>e??[]))},[]),ue=async(e,t,n)=>{if(!wt||!r)return{kind:`blocked`,reason:`sessionUnavailable`};if(n.target.kind===`existing`&&!T(Ce().browserProfiles).some(e=>e.id===n.target.profileId)||L.current)return{kind:`blocked`,reason:`readFailed`};L.current=!0,z(!0);try{let r=await wt.importBrowserCookies({environmentId:t,sourceId:e.id,sourceProfileDirectory:n.sourceProfileDirectory,targetProfileId:n.target.profileId});if(n.target.kind===`existing`&&!T(Ce().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 Se(t=>{if(t.browserProfiles.find(e=>e.id===n.target.profileId))return t;if(t.browserProfiles.length>=24)throw new Ln;let r=new Set(T(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 jn(wt,[t],n.target.profileId).catch(()=>void 0);let i=r instanceof Ln?`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:Rn(e)}}finally{L.current=!1,z(!1)}},G=async e=>{if(wt)try{let t=await wt.listBrowserImportSources();return u(t),t.find(t=>t.id===e)}catch{return}},K=t.length>=24;return(0,Q.jsxs)(X,{...St(`browser-profiles`),description:`Profiles separate cookies and logins. Incognito data is cleared when the app closes.`,control:(0,Q.jsxs)(D,{onOpenChange:e=>e&&W(),children:[(0,Q.jsxs)(oe,{render:(0,Q.jsx)(P,{size:`sm`,variant:`outline`,disabled:B||R}),children:[(0,Q.jsx)(O,{}),`Add profile`]}),(0,Q.jsxs)(H,{align:`end`,children:[(0,Q.jsx)(c,{disabled:!r||K,onClick:()=>re(`New profile`),children:`Blank profile`}),K?(0,Q.jsx)(c,{disabled:!0,children:`You’ve reached the profile limit`}):null,(0,Q.jsx)(N,{}),(0,Q.jsxs)(A,{children:[(0,Q.jsx)(y,{children:`Import from`}),l===null?(0,Q.jsx)(c,{disabled:!0,children:`Looking for browsers…`}):se.length===0?(0,Q.jsx)(c,{disabled:!0,children:`No supported browsers found`}):(0,Q.jsxs)(Q.Fragment,{children:[se.map(e=>(0,Q.jsx)(c,{disabled:!r||s==null,onClick:()=>{r&&s!=null&&p({source:e,environmentId:s.environmentId,environmentName:pt({isPrimary:!0,environmentId:s.environmentId,runtimeLabel:s.label})})},children:e.name},e.id)),s==null?(0,Q.jsx)(c,{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:ee.map((e,t)=>{let n=E(e.id),a=e.id===te;return(0,Q.jsxs)(`div`,{className:V(`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:V(`truncate text-sm text-foreground`,B&&`opacity-64`),children:e.name}):(0,Q.jsx)(Ot,{nativeInput:!0,size:`sm`,className:`w-full max-w-56`,"aria-label":`Rename ${e.name}`,disabled:B||R,maxLength:48,value:e.name,onCommit:t=>ie(e.id,t)}),a?(0,Q.jsx)(`span`,{className:V(`flex`,B&&`opacity-64`),children:(0,Q.jsx)(h,{children:`Default`})}):null]}),(0,Q.jsxs)(D,{children:[(0,Q.jsx)(oe,{render:(0,Q.jsx)(P,{size:`icon-xs`,variant:`ghost-muted`,disabled:B||R,"aria-label":`${e.name} options`}),children:(0,Q.jsx)(d,{})}),(0,Q.jsxs)(H,{align:`end`,children:[(0,Q.jsx)(c,{disabled:!r||a,onClick:()=>{r&&i({browserDefaultProfileId:e.id})},children:`Set as default`}),(0,Q.jsx)(c,{disabled:!r||!I,onClick:()=>{F.environmentIds.length>0?x(e):ae(e.id,e.name)},children:`Clear cookies and cache`}),n?null:(0,Q.jsx)(c,{variant:`destructive`,disabled:!r||!I,onClick:()=>{r&&v(e)},children:`Remove profile and data`}),I?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(N,{}),(0,Q.jsx)(c,{disabled:!0,children:o?`Connect to an environment to clear profile data`:`Checking environments…`})]})]})]})]},e.id)})}),(0,Q.jsx)(mt,{open:_!==null,onOpenChange:e=>{!e&&!w&&(v(null),C(null))},children:(0,Q.jsxs)(gt,{children:[(0,Q.jsxs)(xt,{children:[(0,Q.jsxs)(_t,{children:[`Remove “`,_?.name,`”?`]}),(0,Q.jsx)(vt,{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.`}),S?(0,Q.jsx)(`p`,{"aria-live":`polite`,className:`text-sm text-destructive`,children:S}):null,I?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)(yt,{children:[(0,Q.jsx)(Ct,{disabled:w,render:(0,Q.jsx)(P,{variant:`outline`,disabled:w}),children:`Cancel`}),(0,Q.jsx)(P,{variant:`destructive`,disabled:w||!r||!I,onClick:()=>{_&&r&&I&&U(_.id)},children:w?`Removing…`:`Remove profile`})]})]})}),(0,Q.jsx)(mt,{open:b!==null,onOpenChange:e=>{e||x(null)},children:(0,Q.jsxs)(gt,{children:[(0,Q.jsxs)(xt,{children:[(0,Q.jsxs)(_t,{children:[`Clear “`,b?.name,`”’s cookies and cache?`]}),(0,Q.jsx)(vt,{children:`You are signed out of its sites. Server browser tabs open in this profile close now.`})]}),(0,Q.jsxs)(yt,{children:[(0,Q.jsx)(Ct,{render:(0,Q.jsx)(P,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(P,{variant:`destructive`,onClick:()=>{b&&ae(b.id,b.name),x(null)},children:`Clear data`})]})]})}),f?(0,Q.jsx)(vn,{source:f.source,destinationEnvironmentName:f.environmentName,targetProfiles:ee.map(e=>({id:e.id,name:e.name})),canCreateProfile:r&&!K,onImport:e=>ue(f.source,f.environmentId,e),onRefreshSource:()=>G(f.source.id),onCheckFullDiskAccess:window.desktopBridge?.checkSystemPermission?()=>window.desktopBridge.checkSystemPermission(`full-disk-access`):void 0,onOpenFullDiskAccessSettings:async()=>{await be()?.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:()=>p(null)}):null]})}function br(){let e=(0,Z.c)(3),t=!ke,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(yr,{disabled:t}),(0,Q.jsx)(Un,{disabled:t}),(0,Q.jsx)(Kn,{disabled:t}),(0,Q.jsx)(Yn,{disabled:t}),(0,Q.jsx)(tr,{disabled:t}),(0,Q.jsx)(Qn,{disabled:t}),(0,Q.jsx)(ar,{disabled:t}),(0,Q.jsx)(_r,{disabled:t})]}),e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Dt,{category:`integrations`}),e[1]=i):i=e[1];let a;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsxs)(ut,{children:[i,(0,Q.jsxs)(ft,{id:`browser`,title:`Browser`,children:[t?(0,Q.jsx)(lt,{message:`Only available in the desktop app.`,children:r}):r,(0,Q.jsx)(lr,{}),(0,Q.jsx)(pr,{})]}),(0,Q.jsx)(hr,{})]}),e[2]=a):a=e[2],a}var xr=br;export{xr as component};
|
|
2
|
+
//# sourceMappingURL=settings.integrations-D6ctQ9WI.js.map
|