@p4code/cli 0.8.33 → 0.8.34
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-CReSoYE2.mjs → binCli-CvWinVsO.mjs} +77 -21
- package/dist/client/.vite/manifest.json +2022 -2022
- package/dist/client/assets/{2NI2N5EU-Cq8AdBdr.js → 2NI2N5EU-Dlr3FZf7.js} +2 -2
- package/dist/client/assets/{4UO7MD6I-BtyHa2r8.js → 4UO7MD6I-Cy2sjs8O.js} +2 -2
- package/dist/client/assets/{5B3SVYGG-DJhrK_P7.js → 5B3SVYGG-DaCwFaTp.js} +2 -2
- package/dist/client/assets/{5GK6JWQ2-Di3oWVTL.js → 5GK6JWQ2-BVM9871F.js} +2 -2
- package/dist/client/assets/{5N7A7DKN-IYvb4i83.js → 5N7A7DKN-BVMU2dmG.js} +2 -2
- package/dist/client/assets/{5OC2THR4-C4L8eWnK.js → 5OC2THR4-2tkjJ38q.js} +2 -2
- package/dist/client/assets/{5S6HY5KT-CRP52QAR.js → 5S6HY5KT-BGTQzE2T.js} +2 -2
- package/dist/client/assets/{6IMQ5BUJ-CNHI0F6y.js → 6IMQ5BUJ-DMdx9ktL.js} +2 -2
- package/dist/client/assets/{6OLKWJ4F-B4vHLWw5.js → 6OLKWJ4F-B0TXT19U.js} +2 -2
- package/dist/client/assets/{74OO7NKP-Cy2GHTnO.js → 74OO7NKP-Cukz2OUS.js} +2 -2
- package/dist/client/assets/{75O6YZUN-DQlP5MhD.js → 75O6YZUN-D3k2sZNm.js} +2 -2
- package/dist/client/assets/{77XECAW3-DSSYRZCk.js → 77XECAW3-CjIq7P_x.js} +2 -2
- package/dist/client/assets/{ABYRPUBD-BKqULKA5.js → ABYRPUBD-hf0OeD7n.js} +2 -2
- package/dist/client/assets/AlertDialogRoot-BUODcEy9.js +2 -0
- package/dist/client/assets/{AnimatedHeight-CFR4EWDw.js → AnimatedHeight-CHpFDL1r.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-X2oPejN8.js → AuthSurfaceShell-whDvSlDA.js} +2 -2
- package/dist/client/assets/{BB2UYUI2-C2iBTfII.js → BB2UYUI2-RUQPN7sp.js} +2 -2
- package/dist/client/assets/{BUM34MOA-D8LFlnDQ.js → BUM34MOA-f5Ez9vSp.js} +2 -2
- package/dist/client/assets/{CEQABKGZ-D15ZAT0K.js → CEQABKGZ-C2ZheKpY.js} +2 -2
- package/dist/client/assets/{CXAC5362-CicOZ45Z.js → CXAC5362-B0KvwGJk.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-LQ3LzsF3.js → ChatGptUsageButton-CMIjZ66V.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-DfVVLQX2.js → ChatMarkdown-C2KOLN1s.js} +5 -5
- package/dist/client/assets/{CheckboxIndicator-IpoyLEZ-.js → CheckboxIndicator-zwVHomgm.js} +2 -2
- package/dist/client/assets/{ClippedText-DTOlMbAH.js → ClippedText-Cx9jjhQp.js} +2 -2
- package/dist/client/assets/{CodexSetupSection.logic-B5cbwzh2.js → CodexSetupSection.logic-150217tr.js} +2 -2
- package/dist/client/assets/{ComboboxClear-DsPTusk5.js → ComboboxClear-tzFhNwrk.js} +2 -2
- package/dist/client/assets/{ComboboxGroupLabel-DqaoaBhS.js → ComboboxGroupLabel-C1Icd2UF.js} +2 -2
- package/dist/client/assets/{CommandBlock-Da9iVEid.js → CommandBlock-D9QqOlDX.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-Bz4_w6ez.js → ComposerPromptEditor-D2ObH3Py.js} +4 -4
- package/dist/client/assets/{CompositeRoot-Dfl7FdSL.js → CompositeRoot-BD0GlRg8.js} +2 -2
- package/dist/client/assets/{ConnectionDiagnosisDetails-DCPX1JuG.js → ConnectionDiagnosisDetails-BQ3BFqRL.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-DVkDejK1.js → ConnectionStatusDot-DLQm_zZ7.js} +2 -2
- package/dist/client/assets/{DRLTVNUE-BEVEy9Nb.js → DRLTVNUE-vgHnaBR1.js} +2 -2
- package/dist/client/assets/{DYY6UVD2-DtPiS3Ow.js → DYY6UVD2-BQAAF_8A.js} +2 -2
- package/dist/client/assets/{DevicePanel-B8KdDbzD.js → DevicePanel-Yd3YuPQd.js} +2 -2
- package/dist/client/assets/{DeviceSetup-5wa1rPPZ.js → DeviceSetup-DW4g9NNK.js} +2 -2
- package/dist/client/assets/{DialogTitle-JDa7kdjH.js → DialogTitle-DCMYEIWZ.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-Bp1MeIVC.js → DiffCommentAnnotation-BLItJ7Ia.js} +2 -2
- package/dist/client/assets/{DiffFileTree-b24emCci.js → DiffFileTree-B1-D1WV6.js} +2 -2
- package/dist/client/assets/{DiffPanel-bEjr64Vx.js → DiffPanel-BGnRzWM8.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-BoEAlLkf.js → DiffWorkerPoolProvider-BzkGX7xm.js} +2 -2
- package/dist/client/assets/{EmbeddedDesign-DmRjhA9k.js → EmbeddedDesign-BV_FcJ4l.js} +2 -2
- package/dist/client/assets/{EnvironmentMachineIcon-Emg7F_9r.js → EnvironmentMachineIcon-5-erc8l_.js} +2 -2
- package/dist/client/assets/{ExpandableText-CK6tzx1k.js → ExpandableText-D2jzDgm7.js} +2 -2
- package/dist/client/assets/{FNOVOB4O-C31Sm0mF.js → FNOVOB4O-CE98DPML.js} +2 -2
- package/dist/client/assets/{FieldControl-7KI8YfqD.js → FieldControl-CBMzQqd5.js} +2 -2
- package/dist/client/assets/{FileDiff-CXJUPm2t.js → FileDiff-2qSm00aV.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-BMID-IVR.js → FilePreviewPanel-Drpn6NuE.js} +2 -2
- package/dist/client/assets/{FoldedSettingsSection-Dzi9RecU.js → FoldedSettingsSection-Db7e_9rd.js} +2 -2
- package/dist/client/assets/{FormContext-DAP0MupI.js → FormContext-BGRz6hhb.js} +2 -2
- package/dist/client/assets/{HDGCDEEZ-DZ2nNieb.js → HDGCDEEZ-C0-Zci_l.js} +2 -2
- package/dist/client/assets/{HSJLKHB7-DlFBBKjs.js → HSJLKHB7-4e5L-KC4.js} +2 -2
- package/dist/client/assets/{Icons-aTRNsMJy.js → Icons-DwLGuyWf.js} +2 -2
- package/dist/client/assets/Input-DLaKk0qb.js +2 -0
- package/dist/client/assets/JZOYTAAL-SLYGD65P.js +1 -0
- package/dist/client/assets/{K3MD6TGW-Drb40Qks.js → K3MD6TGW-Gi4s7ooz.js} +2 -2
- package/dist/client/assets/{K7RP3OMA-C0M5Zt3R.js → K7RP3OMA-BVc6P2bZ.js} +2 -2
- package/dist/client/assets/{KeybindingsSettings.logic-mOtug0lc.js → KeybindingsSettings.logic-CU23l8mP.js} +2 -2
- package/dist/client/assets/{LHDIQX7Q-CdTAxECn.js → LHDIQX7Q-DbBCFdJr.js} +2 -2
- package/dist/client/assets/{LUXOKEGN-DtIPjv1z.js → LUXOKEGN-C4n0-A1h.js} +2 -2
- package/dist/client/assets/{MathTypeset-DTaIJ55e.js → MathTypeset--azkeKic.js} +2 -2
- package/dist/client/assets/{N3JZAHOW-C8Pvhbkj.js → N3JZAHOW-2wC96xvZ.js} +2 -2
- package/dist/client/assets/{NUIALGQ3-DY7_VZ5G.js → NUIALGQ3-Di1L_kRJ.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-CDfuCTEv.js → NoProjectsHero-CC3oMKUV.js} +2 -2
- package/dist/client/assets/{O65XPQGZ-BH6EzDhm.js → O65XPQGZ-BeKB0m-p.js} +2 -2
- package/dist/client/assets/{O7XIQ6OM-BSPRvWV7.js → O7XIQ6OM-1wrcdCMc.js} +2 -2
- package/dist/client/assets/{OFQON5FD-VO8HiyY7.js → OFQON5FD-CsMmmhLT.js} +2 -2
- package/dist/client/assets/{P4ConnectAccountPages-Cbg00I7Q.js → P4ConnectAccountPages-BDxb29bY.js} +2 -2
- package/dist/client/assets/{P4ConnectSidebarSignIn-C9gBlkFF.js → P4ConnectSidebarSignIn-Dp5OsZBa.js} +2 -2
- package/dist/client/assets/{PJQHF43J-yTbK55y3.js → PJQHF43J-CY_GpbqJ.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-40ju6vkz.js → PanelLayoutControls-CqeL3uQz.js} +4 -4
- package/dist/client/assets/{PierreEntryIcon-HuUxlwtG.js → PierreEntryIcon-B5tjtDkE.js} +2 -2
- package/dist/client/assets/{PopoverHandle-CG975ng4.js → PopoverHandle-CZh3pqXt.js} +2 -2
- package/dist/client/assets/{PreviewPanel-Ljaq9IHA.js → PreviewPanel-CvBQAq3I.js} +2 -2
- package/dist/client/assets/{ProjectDefaultsSettings-DhwkzlK6.js → ProjectDefaultsSettings-DLJfUN7i.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-UXGwc_-W.js → ProjectFavicon-CkSteHLT.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-BAM7e1e5.js → ProjectIconPickerDialog-9heAZbVC.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-f16fmYcx.js → ProjectMonogram-DIqp1OmB.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-e0ZkNHAb.js → ProviderAuthTerminal-BSsraub7.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-BviWI2wX.js → ProviderModelPicker-AkULlCAn.js} +2 -2
- package/dist/client/assets/{ProviderSettingsForm-CXMFT8YA.js → ProviderSettingsForm-CAFBbrfr.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-Bm67cV34.js → PullRequestCodeTab-BamXVeZz.js} +2 -2
- package/dist/client/assets/{RHNBAITX-TQrYdbHC.js → RHNBAITX-BdiF8iR_.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-xMB_y284.js → ReadOnlySourcePreview-BXDLfPcr.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-C2ZkZ4DB.js → RenderErrorBoundary-CR2cHAQ5.js} +2 -2
- package/dist/client/assets/{SLD4V6NK-Bz1tyL2C.js → SLD4V6NK-Bo1z-c9S.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-D-GMMbJH.js → ScheduledTasksSettings-DF_KhqLx.js} +2 -2
- package/dist/client/assets/{ScopedSwitch-DBUAjY1n.js → ScopedSwitch-CX4FTGjy.js} +2 -2
- package/dist/client/assets/{ScrollAreaCorner-U1Zhpkdl.js → ScrollAreaCorner-BCdJHqsj.js} +2 -2
- package/dist/client/assets/{SecretInput-BxYmGvR5.js → SecretInput-BPPzPNI1.js} +2 -2
- package/dist/client/assets/{SelectScrollUpArrow-CJ4E0xi4.js → SelectScrollUpArrow-CR3Z6_pf.js} +2 -2
- package/dist/client/assets/{SettingsPanels-DRK5QQ04.js → SettingsPanels-DoJnxtp0.js} +2 -2
- package/dist/client/assets/{SettingsPanels.logic-Bdp6GzIj.js → SettingsPanels.logic-t7cG-B6z.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-DYiUHoov.js → SettingsScopeNotice-DD4QFo3v.js} +2 -2
- package/dist/client/assets/{T3PCR2KE-DJwqsK9f.js → T3PCR2KE-Cg6A465M.js} +2 -2
- package/dist/client/assets/{TKWO2OVW-CRU32th0.js → TKWO2OVW-CWeCEb5C.js} +2 -2
- package/dist/client/assets/{TSHNXIZL-dMhDuHVe.js → TSHNXIZL-DTjzxHgA.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-BIQc-w2Q.js → ThemeEditorPanel-BwydY72w.js} +2 -2
- package/dist/client/assets/{ThreadTerminalDrawer-BqO5rPzw.js → ThreadTerminalDrawer-QTFG89J_.js} +2 -2
- package/dist/client/assets/{TooltipViewport-Bz56sWCM.js → TooltipViewport-C14m3uB7.js} +2 -2
- package/dist/client/assets/{UQJE5E4I-DH2S3Hdw.js → UQJE5E4I-DS4MjKhw.js} +2 -2
- package/dist/client/assets/{USNYFO5S-Cfz4g-2W.js → USNYFO5S-Be1OZGok.js} +2 -2
- package/dist/client/assets/{Virtualizer-ChRGRE40.js → Virtualizer-BpizRoFL.js} +2 -2
- package/dist/client/assets/{WEVWDWVA-C55QWN7O.js → WEVWDWVA-oFS2VG1Y.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-8nBISaRF.js → WorkspaceBreadcrumb-ckARUoj9.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-BGE_kHaP.js → WorkspacePageContainer-D5yW7_av.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-D704geLh.js → WorkspacePageHeader-CTWcEH7d.js} +2 -2
- package/dist/client/assets/{X5RFHQXM-hmS6q1sh.js → X5RFHQXM-Bjw0rDxX.js} +2 -2
- package/dist/client/assets/{X62E3GBT-BhTtqjj4.js → X62E3GBT-BPHYY59t.js} +2 -2
- package/dist/client/assets/{XBNEOJTC-1paZyqxX.js → XBNEOJTC-W72qCYdc.js} +2 -2
- package/dist/client/assets/{YHV2MVVZ-DbfthGUh.js → YHV2MVVZ-DA_drdwk.js} +2 -2
- package/dist/client/assets/{YURCZMG2-D8tAzwGP.js → YURCZMG2-CsfrwNLG.js} +2 -2
- package/dist/client/assets/{YVG2LODB-DMSQWWQ_.js → YVG2LODB-dXCBipzg.js} +2 -2
- package/dist/client/assets/{_chat-CXVo1NVJ.js → _chat-BIqme2Hz.js} +5 -5
- package/dist/client/assets/{_chat.design-CdPf_wsA.js → _chat.design-KVMajkdX.js} +2 -2
- package/dist/client/assets/{_chat.index-BkTRJLOf.js → _chat.index-BknTP6QZ.js} +2 -2
- package/dist/client/assets/{_chat.new-CEmRJFEH.js → _chat.new-DLFV1XOJ.js} +2 -2
- package/dist/client/assets/{_chat.pull-requests-4M0tUrJ6.js → _chat.pull-requests-BDLRkW2A.js} +2 -2
- package/dist/client/assets/{alert-DiE1d01s.js → alert-Dh8AVuLe.js} +2 -2
- package/dist/client/assets/{assetUrls-BeScRf6b.js → assetUrls-C6W2_00u.js} +2 -2
- package/dist/client/assets/{assets-RdKoqY9e.js → assets-D-xsxvzf.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-hrG24FfH.js → browserHistoryStore-CeBJcpoN.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-D8HEmVsi.js → browserLinkTarget-D5ew8rLG.js} +2 -2
- package/dist/client/assets/{checkbox-CwFE3KXZ.js → checkbox-Y4v7A1IZ.js} +2 -2
- package/dist/client/assets/{color-picker-BKtR2mwD.js → color-picker-DEWeNc5K.js} +2 -2
- package/dist/client/assets/{combobox-DBUxcuwi.js → combobox-DGrx2JGy.js} +2 -2
- package/dist/client/assets/{command-NV0JEoGo.js → command-DR1GjC1a.js} +2 -2
- package/dist/client/assets/{composer-logic-BQdFVlkE.js → composer-logic-BW4G8aDL.js} +2 -2
- package/dist/client/assets/{composerDraftUploads-BmpBCVnP.js → composerDraftUploads-DK6jH0cB.js} +2 -2
- package/dist/client/assets/{connect-Bzgsrfe8.js → connect-B1NcR-kN.js} +2 -2
- package/dist/client/assets/{connect-agent-BCguLPkZ.js → connect-agent-BNrm24qs.js} +2 -2
- package/dist/client/assets/{design-BGLTZdWG.js → design-CbG6XJYX.js} +2 -2
- package/dist/client/assets/{device-D0-STSSP.js → device-6R-yC55P.js} +2 -2
- package/dist/client/assets/{dialog-pqqgtsKn.js → dialog-BwjzOzO6.js} +2 -2
- package/dist/client/assets/{diffRendering-eAJMSnXr.js → diffRendering-CG_sb5me.js} +2 -2
- package/dist/client/assets/{dist-KeWCSS5h.js → dist-CFar2AY1.js} +3 -3
- package/dist/client/assets/{draft-input-DrGl-qts.js → draft-input-CpqOZR5i.js} +2 -2
- package/dist/client/assets/{duoViewer-DKygyhUj.js → duoViewer-BhE8QUaC.js} +2 -2
- package/dist/client/assets/{dynamic-DKhgWyT6.js → dynamic-CIBySV57.js} +2 -2
- package/dist/client/assets/{embeddedScripts-WSYzbtcW.js → embeddedScripts-B0vXhhvs.js} +2 -2
- package/dist/client/assets/{empty-Du5F51Da.js → empty-C0oiFHy_.js} +2 -2
- package/dist/client/assets/{entities-n6SMnPE8.js → entities-Om5Klild.js} +2 -2
- package/dist/client/assets/{fileLinks-BEJjCE8r.js → fileLinks-CP5NWXaI.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-CCF3XVRn.js → fileTreeExpansion-BKVd4HrC.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-Dkc1Whpr.js → getDiffFileInput-CIK5OMl_.js} +2 -2
- package/dist/client/assets/{guideRunStore-CVyie1IJ.js → guideRunStore-CegZr43-.js} +2 -2
- package/dist/client/assets/{htmlRender-fSOuRG49.js → htmlRender-NqJI2UJ2.js} +2 -2
- package/dist/client/assets/{index-RvCv9K-x.js → index-Czsz7nXH.js} +3 -3
- package/dist/client/assets/{input-GkmNnHh7.js → input-BCWES8Y7.js} +2 -2
- package/dist/client/assets/{input-group-Cql1yQRL.js → input-group-CfPOCEuC.js} +2 -2
- package/dist/client/assets/{kbd-D2OGhJqG.js → kbd-EDrgCOls.js} +2 -2
- package/dist/client/assets/{keybindings-1XWkWeQB.js → keybindings-BG7j7M7S.js} +2 -2
- package/dist/client/assets/{lazy-BUyZ03gL.js → lazy-D6W01WxZ.js} +4 -4
- package/dist/client/assets/{lazyRouteComponent-BXmOK9bz.js → lazyRouteComponent-B8CSLurY.js} +2 -2
- package/dist/client/assets/{link-BGMNeg05.js → link-COzhJ6br.js} +2 -2
- package/dist/client/assets/{linkedPrompt-B3l4m_6D.js → linkedPrompt-X4NBlFef.js} +2 -2
- package/dist/client/assets/{main-Dcfxjdkd.js → main-BGaSDXjP.js} +7 -7
- package/dist/client/assets/{mediaReference-CsA5Lv5E.js → mediaReference-CKap6oNP.js} +2 -2
- package/dist/client/assets/{mediaSource-BbYoxHZJ.js → mediaSource-DG5l5-5f.js} +2 -2
- package/dist/client/assets/{number-field-jauVDwvy.js → number-field-DGdBjQD2.js} +2 -2
- package/dist/client/assets/{observeResize-CNtO3VS7.js → observeResize-BUAH1dvA.js} +2 -2
- package/dist/client/assets/{onboarding-KXMrOHsw.js → onboarding-CnVH7A6c.js} +2 -2
- package/dist/client/assets/{openFileInPreview-BKTnNQFl.js → openFileInPreview-B0i3eZpu.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-sAVjpCzn.js → p4ProjectFile-0RRo3hX4.js} +2 -2
- package/dist/client/assets/{pair-BIaVaT-B.js → pair-B4KNAPh5.js} +2 -2
- package/dist/client/assets/{pendingSendStore-CPz2p40W.js → pendingSendStore-Dzn7x7Cg.js} +2 -2
- package/dist/client/assets/{phoneViewer-DGKQHyy3.js → phoneViewer-RhpfiwR2.js} +2 -2
- package/dist/client/assets/{pierre-icons-6ByaxkH5.js → pierre-icons-Cisj4-__.js} +2 -2
- package/dist/client/assets/{popover-BIXQitBy.js → popover-BnqKHl4L.js} +2 -2
- package/dist/client/assets/{preview-BcEybEc8.js → preview-CiojYkh4.js} +2 -2
- package/dist/client/assets/{preview-C3ymkoAM.js → preview-Dwq2O7nm.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-DWw2A_gt.js → previewMiniPlayerStore-ByZNhmNc.js} +2 -2
- package/dist/client/assets/{primary-DD11poOa.js → primary-CMwTDEi1.js} +2 -2
- package/dist/client/assets/{primaryCloudLinkState-CD2_f6q-.js → primaryCloudLinkState-2j4MjqVh.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-C8dGr8oR.js → projectFilesQueryState-DXrTSOqg.js} +2 -2
- package/dist/client/assets/{projectScriptEditor-CNXQwWP8.js → projectScriptEditor-B4iSq27p.js} +2 -2
- package/dist/client/assets/{providerSkills-CNeLyiqf.js → providerSkills-C4Fu_qyq.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-BNpxef-3.js → pullRequestDetail.logic-BmYDDw_8.js} +2 -2
- package/dist/client/assets/{pullRequestIcons-CSs54zQk.js → pullRequestIcons-DFcQ9rtl.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-BawbGhnx.js → pullRequestReviewStore-BGzKslrq.js} +2 -2
- package/dist/client/assets/{pullRequests-jsc4Hq78.js → pullRequests-DT0oG7tF.js} +2 -2
- package/dist/client/assets/{queries-DZV2RDc9.js → queries-CXgT6mki.js} +2 -2
- package/dist/client/assets/{query-BV3IuYff.js → query-DlK0I8Jc.js} +2 -2
- package/dist/client/assets/{radio-group-yq5YEgUO.js → radio-group-DOHTpBxX.js} +2 -2
- package/dist/client/assets/{renderScheduler--3RDWz9Z.js → renderScheduler-Df4T8RWh.js} +2 -2
- package/dist/client/assets/{rightPanelStore-CeZBJCMI.js → rightPanelStore-DXw7-xK3.js} +2 -2
- package/dist/client/assets/{runtime-DTUiqO10.js → runtime-BL7IF4n-.js} +3 -3
- package/dist/client/assets/{runtime-DSZ2mWrf.js → runtime-Dm3Pi31_.js} +3 -3
- package/dist/client/assets/{runtimeModeConfig-BwioIXVs.js → runtimeModeConfig-_-kQoAWi.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-DefawCwN.js → scheduledTasksSettings.logic-7E0KSnA7.js} +2 -2
- package/dist/client/assets/{scroll-area-CfW8fzQ8.js → scroll-area-B9LorBFb.js} +2 -2
- package/dist/client/assets/{select-C10oXKGz.js → select-Ctq0UILH.js} +2 -2
- package/dist/client/assets/{server-ztj8tD38.js → server-BvxyePeo.js} +2 -2
- package/dist/client/assets/{session-yxXjF8AQ.js → session-C7ckxjAM.js} +2 -2
- package/dist/client/assets/{session-logic-w7gGMFHb.js → session-logic-P8gC-UQc.js} +2 -2
- package/dist/client/assets/{settings-CgshkEb_.js → settings-BqhxEPKC.js} +2 -2
- package/dist/client/assets/{settings.appearance-yicuncxz.js → settings.appearance-DljtCz6-.js} +2 -2
- package/dist/client/assets/settings.archived-SsFK0IFf.js +2 -0
- package/dist/client/assets/{settings.computer-use-lOJg1Jos.js → settings.computer-use-CVmc70Ib.js} +2 -2
- package/dist/client/assets/{settings.connections-DSPQOd-W.js → settings.connections-BrPlTKQ_.js} +2 -2
- package/dist/client/assets/{settings.data-controls-CZ5aXdyA.js → settings.data-controls-Cdccmn63.js} +2 -2
- package/dist/client/assets/{settings.decisions-C8qxQCjl.js → settings.decisions-pkwqjsKP.js} +2 -2
- package/dist/client/assets/{settings.designs-j9E6N2pN.js → settings.designs-TeCw-uLf.js} +2 -2
- package/dist/client/assets/{settings.diagnostics-yio3SGbE.js → settings.diagnostics-BZD1uMGP.js} +2 -2
- package/dist/client/assets/{settings.general-BCrYSHkU.js → settings.general-uxwywmhh.js} +2 -2
- package/dist/client/assets/{settings.integrations-Dl-vtiOS.js → settings.integrations-Du282Gn7.js} +2 -2
- package/dist/client/assets/{settings.keybindings-BQ-LrcTn.js → settings.keybindings-C0FBNk1_.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-BHiHgzgF.js → settings.open-source-licenses-wMwaYCss.js} +2 -2
- package/dist/client/assets/{settings.plugins-DavhWo4Q.js → settings.plugins-CFiDE3ms.js} +2 -2
- package/dist/client/assets/{settings.projects-uuJOwkSl.js → settings.projects-DN0n2td7.js} +3 -3
- package/dist/client/assets/{settings.providers-rZQTQdtf.js → settings.providers-DeUZZg7C.js} +3 -3
- package/dist/client/assets/{settings.scheduled-tasks-DoWHIDOp.js → settings.scheduled-tasks-uCL4Wgvt.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-ClKlVUUJ.js → settings.snap-shot-C4OHP0nR.js} +2 -2
- package/dist/client/assets/{settings.source-control-o8jFa_Cr.js → settings.source-control-pMBspYC4.js} +2 -2
- package/dist/client/assets/{settings.storage-Bb-cW0xG.js → settings.storage-QCydiEyw.js} +2 -2
- package/dist/client/assets/{settingsLayout-DzBeWTUO.js → settingsLayout-DFYjWgKN.js} +2 -2
- package/dist/client/assets/{sidebar-Bd6PzVyD.js → sidebar-CRr8B41y.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-C13IyN_p.js → sidebarProjectGrouping-miDXfjI3.js} +2 -2
- package/dist/client/assets/{skeleton-pd7m2J5F.js → skeleton-C9J-Xl06.js} +2 -2
- package/dist/client/assets/{sourceControl-Y9v_vyKt.js → sourceControl-C8nJMDiL.js} +2 -2
- package/dist/client/assets/{sourceControlClients-KQ5315mN.js → sourceControlClients-DKONtKbZ.js} +2 -2
- package/dist/client/assets/{spinner-CW23--q5.js → spinner-CNva85zM.js} +2 -2
- package/dist/client/assets/{terminal-links-Bd9AoAyA.js → terminal-links-BJzLp7ix.js} +2 -2
- package/dist/client/assets/{terminalSessions-CF7f4A-6.js → terminalSessions-BPc8sBGR.js} +2 -2
- package/dist/client/assets/{textarea-DSS-lavF.js → textarea-DjRGRzMg.js} +2 -2
- package/dist/client/assets/{themePalette-C_1pk_Mi.js → themePalette-fhKYLCuU.js} +2 -2
- package/dist/client/assets/{toast-BFuAqla3.js → toast-BcjbmUtS.js} +2 -2
- package/dist/client/assets/{toggle-Cpfo0sMT.js → toggle-Bbnow7xY.js} +2 -2
- package/dist/client/assets/{toggle-group-FrArhs7R.js → toggle-group-Cilo8czD.js} +2 -2
- package/dist/client/assets/{tooltip-CSzrAm8M.js → tooltip-T5ePvxsH.js} +2 -2
- package/dist/client/assets/{uiStateStore-VHQ8vDs5.js → uiStateStore-D9r3BNZ-.js} +2 -2
- package/dist/client/assets/{usage-uwswTMhu.js → usage-QBPLx2wr.js} +2 -2
- package/dist/client/assets/{usageAccess-BDwH_c8I.js → usageAccess-DUfVA8nU.js} +2 -2
- package/dist/client/assets/{usageFormat-CKgwjLMR.js → usageFormat-C-mTuUS7.js} +2 -2
- package/dist/client/assets/{usageShortcuts-lXBRgPmi.js → usageShortcuts-CB6TvooP.js} +2 -2
- package/dist/client/assets/{use-atom-command-CSWaAmR7.js → use-atom-command-BNkv9iyk.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-vgEmgPPR.js → useAriaLabelledBy-D5HM2KLM.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-BVFM3SUe.js → useHandleNewThread-DntRaFvm.js} +2 -2
- package/dist/client/assets/{useLocation-FEfJrgGU.js → useLocation-DbWity7H.js} +2 -2
- package/dist/client/assets/{useNavigate-Lp_S-tAl.js → useNavigate-Cxh24teV.js} +2 -2
- package/dist/client/assets/{useNavigateBack-BTJoRrRy.js → useNavigateBack-B5mTfIHJ.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-7Z8osIH2.js → useP4ConnectAuthPrompt-sjWWPvrn.js} +2 -2
- package/dist/client/assets/{useParams-8KxPyQmv.js → useParams-D9PdK0IA.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-CyvlYHNs.js → usePermissionStatus-D6i3IaCj.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-DfyxdDPg.js → usePullRequestActions-9274Vp3W.js} +2 -2
- package/dist/client/assets/{useRegisterFieldControl-Dj6RbECy.js → useRegisterFieldControl-DZyLTxKX.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-BfFbT2DU.js → useScopedModelAvailability-CmlQi7Iz.js} +2 -2
- package/dist/client/assets/{useSettings-CPPvBMmM.js → useSettings-BL4ZWGQV.js} +2 -2
- package/dist/client/assets/{utils-BE5iQuUP.js → utils-CrFJwxSd.js} +2 -2
- package/dist/client/assets/{vcsRefInvalidation-DCdd2BDA.js → vcsRefInvalidation-BPy1eoDi.js} +2 -2
- package/dist/client/assets/{welcome-CIETplg9.js → welcome-DVusCS_L.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{renderer-D8FhaVWU.mjs → renderer-CJXpJ36b.mjs} +2 -2
- package/dist/{runtime-a3PrAU7n.mjs → runtime-EqYv-lrV.mjs} +2 -2
- package/package.json +1 -1
- package/dist/client/assets/AlertDialogRoot-B--i3imS.js +0 -2
- package/dist/client/assets/Input-rVh9fuLP.js +0 -2
- package/dist/client/assets/JZOYTAAL-DXVzZiqj.js +0 -1
- package/dist/client/assets/settings.archived-ZXG8lJ_T.js +0 -2
package/dist/client/assets/{settings.integrations-Dl-vtiOS.js → settings.integrations-Du282Gn7.js}
RENAMED
|
@@ -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{t as i}from"./cloud-Cnpuf424.js";import{t as a}from"./plus-BFikiw2m.js";import{t as o}from"./x-CJgPyqpa.js";import{$n as s,Bf as c,Ch as l,Dg as u,Gg as d,Jg as f,Jn as p,Jp as m,Jw as h,Mg as g,Od as _,Og as v,Pg as y,Q_ as b,Qn as x,Sh as S,Sp as C,Tp as w,Ty as T,Yg as E,Yn as D,Zn as O,Zw as k,ar as A,bb as j,dh as M,dr as N,fh as P,fr as F,iE as I,il as L,l as ee,mh as R,nh as z,od as te,qg as ne,rd as re,rf as ie,rl as ae,t as B,tr as oe,ur as V,wy as se,xh as H,xp as ce}from"./utils-BE5iQuUP.js";import{W as le}from"./runtime-DSZ2mWrf.js";import{T as ue}from"./entities-n6SMnPE8.js";import{a as U,r as de,t as W}from"./number-field-jauVDwvy.js";import{a as G,c as fe,i as pe,o as me,r as he,s as ge,t as _e}from"./select-C10oXKGz.js";import{t as ve}from"./spinner-CW23--q5.js";import{i as K}from"./toast-BFuAqla3.js";import{D as ye,E as be,J as xe,c as Se,o as Ce,r as we,s as q,x as J}from"./useSettings-CPPvBMmM.js";import{f as Te}from"./server-ztj8tD38.js";import{i as Ee,n as De}from"./session-yxXjF8AQ.js";import{t as Oe}from"./query-BV3IuYff.js";import{t as ke}from"./use-atom-command-CSWaAmR7.js";import{t as Ae}from"./env-wK1YYxA8.js";import{a as je,n as Me,t as Ne}from"./tooltip-CSzrAm8M.js";import{t as Pe}from"./input-GkmNnHh7.js";import{a as Fe,c as Ie,i as Le,n as Re,o as ze,r as Be,s as Ve,t as He}from"./dialog-pqqgtsKn.js";import{i as Ue,t as We}from"./device-D0-STSSP.js";import{a as Ge,i as Ke,l as qe,n as Je,o as Ye,t as Xe,u as Ze}from"./DeviceSetup-5wa1rPPZ.js";import{t as Qe}from"./AnimatedHeight-CFR4EWDw.js";import{i as $e,n as et}from"./Icons-aTRNsMJy.js";import{t as tt}from"./preview-BcEybEc8.js";import{n as nt}from"./preview-C3ymkoAM.js";import{a as rt,i as it,o as at,t as ot}from"./popover-BIXQitBy.js";import{F as st,R as ct,V as lt,a as Y,c as ut,i as dt,r as ft,s as pt,w as mt}from"./settingsLayout-DzBeWTUO.js";import{Ar as ht,Bi as gt,Fr as _t,Ir as vt,Mr as yt,Nr as bt,Oa as xt,Pr as St,ir as X,jr as Ct,qi as wt,va as Tt,zi as Et}from"./main-Dcfxjdkd.js";import{t as Dt}from"./ProjectDefaultsSettings-DhwkzlK6.js";import{t as Ot}from"./draft-input-DrGl-qts.js";import{t as kt}from"./ScopedSwitch-DBUAjY1n.js";import{t as At}from"./SecretInput-BxYmGvR5.js";import{n as jt,r as Mt,t as Nt}from"./usePermissionStatus-CyvlYHNs.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)(F,{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)(at,{"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)(rt,{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)(it,{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)(ot,{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)(Ne,{children:[(0,Q.jsxs)(je,{render:(0,Q.jsx)(`span`,{tabIndex:0,className:`inline-flex items-center gap-1`}),children:[e.available?(0,Q.jsx)(_,{className:`size-3`}):(0,Q.jsx)(ce,{className:`size-3`}),e.platform===`ios`?`iOS`:`Android`,` `,e.available?`available`:`unavailable`]}),(0,Q.jsx)(Me,{children:e.reason??(e.platform===`ios`?`iOS available`:`Android available`)})]},e.platform)}var zt=j(T);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=ke(We.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(!De(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(h(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:u,testConnection:d}=Ut(i),f=u[Vt(c)],p=Object.values(f??{}).some(Kt),m,h;t[0]===c?(m=t[1],h=t[2]):(m=Bt({...c,label:c.label.trim()||c.target}),h=I(m),t[0]=c,t[1]=m,t[2]=h);let g=h,v;t[3]===f?v=t[4]:(v=Object.values(f??{}).filter(Gt),t[3]=f,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]!==p||t[10]!==c.label||t[11]!==m||t[12]!==o?(S=(0,Q.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),I(m)&&c.label.trim()&&!a&&!p&&o(m.value)}}),t[8]=a,t[9]=p,t[10]=c.label,t[11]=m,t[12]=o,t[13]=S):S=t[13];let w=r?`Add device host`:`Edit device host`,T;t[14]===w?T=t[15]:(T=(0,Q.jsx)(Ie,{children:w}),t[14]=w,t[15]=T);let E=i.length===1?`Connect from ${i[0]?.label}.`:`Connect from ${i.length} selected environments.`,D;t[16]===E?D=t[17]:(D=(0,Q.jsxs)(Be,{children:[E,` `,`Hosts on the same machine are skipped.`]}),t[16]=E,t[17]=D);let O;t[18]!==T||t[19]!==D?(O=(0,Q.jsxs)(Fe,{children:[T,D]}),t[18]=T,t[19]=D,t[20]=O):O=t[20];let k;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(`span`,{children:`Name`}),t[21]=k):k=t[21];let A;t[22]===c?A=t[23]:(A=e=>l({...c,label:e.target.value}),t[22]=c,t[23]=A);let j;t[24]!==a||t[25]!==c.label||t[26]!==A?(j=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[k,(0,Q.jsx)(Pe,{autoFocus:!0,required:!0,value:c.label,disabled:a,onChange:A,placeholder:`Mac mini`})]}),t[24]=a,t[25]=c.label,t[26]=A,t[27]=j):j=t[27];let M;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(`span`,{children:`SSH target`}),t[28]=M):M=t[28];let P;t[29]===c?P=t[30]:(P=e=>l({...c,target:e.target.value}),t[29]=c,t[30]=P);let F;t[31]!==a||t[32]!==c.target||t[33]!==P?(F=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[M,(0,Q.jsx)(Pe,{required:!0,value:c.target,disabled:a,onChange:P,placeholder:`user@host or SSH alias`})]}),t[31]=a,t[32]=c.target,t[33]=P,t[34]=F):F=t[34];let L=n.port!==void 0||n.identityFile!==void 0||void 0,ee;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`SSH options`}),t[35]=ee):ee=t[35];let R;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(`span`,{children:`Identity file`}),t[36]=R):R=t[36];let te=c.identityFile??``,ne;t[37]===c?ne=t[38]:(ne=e=>{let{identityFile:t,...n}=c;l(e.target.value?{...n,identityFile:e.target.value}:n)},t[37]=c,t[38]=ne);let re;t[39]!==a||t[40]!==te||t[41]!==ne?(re=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[R,(0,Q.jsx)(Pe,{value:te,disabled:a,onChange:ne,placeholder:`SSH config default`})]}),t[39]=a,t[40]=te,t[41]=ne,t[42]=re):re=t[42];let ie;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsx)(`span`,{children:`Port`}),t[43]=ie):ie=t[43];let ae=c.port??``,B;t[44]===c?B=t[45]:(B=e=>{let{port:t,...n}=c;l(e.target.value?{...n,port:Number(e.target.value)}:n)},t[44]=c,t[45]=B);let oe;t[46]!==a||t[47]!==ae||t[48]!==B?(oe=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[ie,(0,Q.jsx)(Pe,{type:`number`,min:1,max:65535,value:ae,disabled:a,onChange:B,placeholder:`Default`})]}),t[46]=a,t[47]=ae,t[48]=B,t[49]=oe):oe=t[49];let V;t[50]!==re||t[51]!==oe?(V=(0,Q.jsxs)(`div`,{className:`mt-3 grid grid-cols-[minmax(0,1fr)_7rem] gap-3`,children:[re,oe]}),t[50]=re,t[51]=oe,t[52]=V):V=t[52];let se;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Optional. Resolved separately on each environment.`}),t[53]=se):se=t[53];let H;t[54]!==L||t[55]!==V?(H=(0,Q.jsxs)(`details`,{open:L,className:`text-sm`,children:[ee,V,se]}),t[54]=L,t[55]=V,t[56]=H):H=t[56];let ce=p?`Checking environments…`:f?y?`${y} of ${i.length} failed`:`Connection checks passed`:`Check access before saving`,le;t[57]===ce?le=t[58]:(le=(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:ce}),t[57]=ce,t[58]=le);let ue=a||p||!g,U;t[59]!==m||t[60]!==d?(U=()=>{I(m)&&d(m.value)},t[59]=m,t[60]=d,t[61]=U):U=t[61];let de;t[62]===p?de=t[63]:(de=p?(0,Q.jsx)(ve,{size:`xs`}):null,t[62]=p,t[63]=de);let W;t[64]!==ue||t[65]!==U||t[66]!==de?(W=(0,Q.jsxs)(N,{type:`button`,size:`sm`,variant:`outline`,disabled:ue,onClick:U,children:[de,` Test connection`]}),t[64]=ue,t[65]=U,t[66]=de,t[67]=W):W=t[67];let G;t[68]!==le||t[69]!==W?(G=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,children:[le,W]}),t[68]=le,t[69]=W,t[70]=G):G=t[70];let fe;t[71]!==f||t[72]!==i?(fe=f?(0,Q.jsx)(`ul`,{className:`border-t border-border/60 divide-y divide-border/40`,children:i.map(e=>{let t=f[e.environmentId];return t?(0,Q.jsxs)(`li`,{className:`px-3 py-2.5 text-xs`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`truncate font-medium`,children:e.label}),(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5 ${t.status===`failed`?`text-destructive`:`text-muted-foreground`}`,children:t.status===`pending`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ve,{size:`xs`}),` Checking…`]}):t.status===`local`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(C,{className:`size-3`}),` Already available locally`]}):t.status===`failed`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(z,{className:`size-3`}),` Failed`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_,{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]=f,t[72]=i,t[73]=fe):fe=t[73];let pe;t[74]!==G||t[75]!==fe?(pe=(0,Q.jsxs)(`div`,{className:`rounded-lg border border-border/60`,children:[G,fe]}),t[74]=G,t[75]=fe,t[76]=pe):pe=t[76];let me;t[77]!==j||t[78]!==F||t[79]!==H||t[80]!==pe?(me=(0,Q.jsxs)(ze,{children:[j,F,H,pe]}),t[77]=j,t[78]=F,t[79]=H,t[80]=pe,t[81]=me):me=t[81];let he;t[82]!==a||t[83]!==s?(he=(0,Q.jsx)(N,{type:`button`,variant:`ghost`,disabled:a,onClick:s,children:`Cancel`}),t[82]=a,t[83]=s,t[84]=he):he=t[84];let ge;t[85]!==a||t[86]!==p||t[87]!==c.label||t[88]!==g?(ge=a||p||!g||!c.label.trim(),t[85]=a,t[86]=p,t[87]=c.label,t[88]=g,t[89]=ge):ge=t[89];let _e;t[90]===a?_e=t[91]:(_e=a?(0,Q.jsx)(ve,{size:`xs`}):null,t[90]=a,t[91]=_e);let K;t[92]!==ge||t[93]!==_e?(K=(0,Q.jsxs)(N,{type:`submit`,disabled:ge,children:[_e,` Save host`]}),t[92]=ge,t[93]=_e,t[94]=K):K=t[94];let ye;t[95]!==he||t[96]!==K?(ye=(0,Q.jsxs)(Le,{children:[he,K]}),t[95]=he,t[96]=K,t[97]=ye):ye=t[97];let be;t[98]!==O||t[99]!==me||t[100]!==x||t[101]!==ye||t[102]!==S?(be=(0,Q.jsxs)(Ve,{showCloseButton:x,render:S,children:[O,me,ye]}),t[98]=O,t[99]=me,t[100]=x,t[101]=ye,t[102]=S,t[103]=be):be=t[103];let xe;return t[104]!==b||t[105]!==be?(xe=(0,Q.jsx)(He,{open:!0,onOpenChange:b,children:be}),t[104]=b,t[105]=be,t[106]=xe):xe=t[106],xe}function Gt(e){return e.status===`failed`}function Kt(e){return e.status===`pending`}function qt(e){let{scope:t,environments:n,connectedEnvironments:r}=lt(),i=Ee(e.environmentId,b),a=t.kind===`project`||t.kind===`checkout`,o=ke(Te.updateSettings,{reportFailure:!1}),[s,c]=(0,$.useState)(null),[l,u]=(0,$.useState)(null),[d,f]=(0,$.useState)(!1),p=n.map(e=>({environmentId:e.environmentId,label:e.label,connected:e.connection.phase===`connected`})),{checks:h,testConnection:g}=Ut(p),_=async(t,r=!1,i=t)=>{if(e.environmentId&&!a){f(!0);try{let e=await Promise.allSettled(n.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!De(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?c(null):K.add({type:`error`,title:`Device hosts not saved on all environments`,description:`Could not update ${a.map(e=>e.label).join(`, `)}.`})}finally{f(!1)}}};return(0,Q.jsx)(Y,{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)(N,{size:`sm`,variant:`outline`,disabled:!i||a||d||!e.environmentId||s!==null,onClick:()=>{u(null),c({kind:`ssh`,id:ee(),label:``,target:``})},children:[(0,Q.jsx)(m,{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||d,checks:h,testConnection:async e=>{let t=await g(e);if(!t)return;let n=p.filter(e=>t[e.environmentId]?.status===`failed`);return K.add({type:n.length?`error`:`success`,title:n.length?`${e.label}: ${n.length} of ${p.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=>{u(e),c(e)},onRemove:e=>void _(e,!0)})]},e.environmentId)),s?(0,Q.jsx)(Wt,{host:s,isNew:l===null,targets:p,busy:d,onSave:e=>void _(e,!1,l??e),onClose:()=>c(null)},s.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:c,checks:l,testConnection:u}=e,{state:d}=Ue(r),f=ke(We.list),[p,m]=(0,$.useState)(null),h;t[0]===i.length?h=t[1]:(h=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]=h);let g;if(t[2]!==a||t[3]!==l||t[4]!==r||t[5]!==n||t[6]!==i||t[7]!==o||t[8]!==c||t[9]!==f||t[10]!==p||t[11]!==d||t[12]!==u){let e;t[14]!==a||t[15]!==l||t[16]!==r||t[17]!==n||t[18]!==o||t[19]!==c||t[20]!==f||t[21]!==p||t[22]!==d||t[23]!==u?(e=e=>{let t=d.hostStatuses[e.id],i=l[Vt(e)]?.[r],h=(i?.status===`connected`?i.platforms:void 0)??d.hosts.find(t=>t.id===e.id)?.platforms??[],g=i?.status===`pending`?`Checking connection…`:t?.status===`installing`?`Installing device support…`:t?.status===`starting`?`Connecting…`:null,_=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}),h.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:d.hosts.find(t=>t.id===e.id)?.toolInspectionError,tools:d.hosts.find(t=>t.id===e.id)?.tools??(i?.status===`connected`?i.tools:void 0)}),i?.status===`local`?(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Already available locally`}):null,_?(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:_})]})}):null]}),g?(0,Q.jsxs)(`span`,{role:`status`,className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(ve,{size:`xs`}),g]}):null,(0,Q.jsxs)(D,{children:[(0,Q.jsx)(V,{render:(0,Q.jsx)(N,{size:`icon-sm`,variant:`ghost-muted`,disabled:a,"aria-label":e.label+` options`}),children:(0,Q.jsx)(w,{})}),(0,Q.jsxs)(oe,{align:`end`,children:[(0,Q.jsx)(s,{onClick:()=>{o(e)},children:`Edit`}),(0,Q.jsx)(s,{variant:`destructive`,onClick:()=>c(e),children:`Remove`})]})]}),t?.status===`failed`&&d.supportsHostRetry&&d.hostStatus!==`disabled`?(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:a||p!==null,onClick:()=>{m(e.id),f({environmentId:r,input:{retryHostId:e.id}}).finally(()=>m(null))},children:p===e.id?`Retrying…`:`Retry`}):(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:a||g!==null,onClick:()=>void u(e),children:`Test connection`})]},e.id)},t[14]=a,t[15]=l,t[16]=r,t[17]=n,t[18]=o,t[19]=c,t[20]=f,t[21]=p,t[22]=d,t[23]=u,t[24]=e):e=t[24],g=i.map(e),t[2]=a,t[3]=l,t[4]=r,t[5]=n,t[6]=i,t[7]=o,t[8]=c,t[9]=f,t[10]=p,t[11]=d,t[12]=u,t[13]=g}else g=t[13];let _;return t[25]!==h||t[26]!==g?(_=(0,Q.jsxs)(Q.Fragment,{children:[h,g]}),t[25]=h,t[26]=g,t[27]=_):_=t[27],_}function Yt(e){return(0,Q.jsxs)(Ne,{children:[(0,Q.jsx)(je,{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)($e,{className:`size-3.5 -translate-y-px`}):(0,Q.jsx)(et,{className:`size-3.5`})}),(0,Q.jsx)(Me,{children:e.platform===`ios`?`iOS available`:`Android available`})]},e.platform)}function Xt(e){return e.available}var Zt=j(se),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=k(e);return t instanceof Error?t.message:String(t)};function an(e){let t=(0,Z.c)(24),{scope:n,connectedEnvironments:r}=lt(),o=Ee(e.environmentId,b),s=n.kind===`project`||n.kind===`checkout`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[0]=c):c=t[0];let l=ke(Te.updateSettings,c),u;t[1]===e.environmentId?u=t[2]:(u=t=>t.environmentId===e.environmentId,t[1]=e.environmentId,t[2]=u);let d=r.find(u)?.serverConfig?.settings.easDeviceHosts??[],[f,p]=(0,$.useState)(null),[m,h]=(0,$.useState)(!1),g=!o||s||m||!e.environmentId,_=async(t,n)=>{if(!e.environmentId||!De(e.environmentId,`settings:write`))return;h(!0);let r=await l({environmentId:e.environmentId,input:{patch:{easDeviceHosts:$t(d,t,n)}}});h(!1),r._tag===`Success`?p(null):K.add({type:`error`,title:n?`EAS host not removed`:`EAS host not saved`,description:rn(r.cause)})},v=Y,y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=[`easDeviceHosts`],t[3]=y):y=t[3];let x=g||f!==null,S;t[4]===p?S=t[5]:(S=()=>p({host:Qt(ee()),isNew:!0}),t[4]=p,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)(N,{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=d.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:d.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)(N,{size:`sm`,variant:`ghost`,disabled:g,onClick:()=>p({host:e,isNew:!1}),children:`Edit`}),(0,Q.jsx)(N,{size:`sm`,variant:`ghost-destructive`,disabled:g,onClick:()=>void _(e,!0),children:`Remove`})]})]},e.id))}),E;t[10]!==m||t[11]!==f||t[12]!==e.environmentId||t[13]!==_||t[14]!==p?(E=f&&e.environmentId?(0,Q.jsx)(on,{environmentId:e.environmentId,host:f.host,isNew:f.isNew,busy:m,onSave:e=>void _(e,!1),onClose:()=>p(null)},f.host.id):null,t[10]=m,t[11]=f,t[12]=e.environmentId,t[13]=_,t[14]=p,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]!==v||t[20]!==w||t[21]!==D||t[22]!==y?(O=(0,Q.jsx)(v,{id:`eas-device-hosts`,title:`EAS Simulator`,serverScoped:!0,settingKeys:y,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]=v,t[20]=w,t[21]=D,t[22]=y,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=ke(We.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=I(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 j;t[28]!==i||t[29]!==e.busy?(j=(t,n,r)=>(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,Q.jsx)(`span`,{children:n}),(0,Q.jsx)(Pe,{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]=j):j=t[30];let M=j,P;t[31]===e?P=t[32]:(P=t=>{!t&&!e.busy&&e.onClose()},t[31]=e,t[32]=P);let F=!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 ee=e.isNew?`Add EAS host`:`Edit EAS host`,R;t[37]===ee?R=t[38]:(R=(0,Q.jsx)(Ie,{children:ee}),t[37]=ee,t[38]=R);let z;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(Be,{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]=z):z=t[39];let te;t[40]===R?te=t[41]:(te=(0,Q.jsxs)(Fe,{children:[R,z]}),t[40]=R,t[41]=te);let ne;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(`span`,{children:`Name`}),t[42]=ne):ne=t[42];let re;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(re=e=>{let t=e.target.value;a(e=>({...e,label:t}))},t[43]=re):re=t[43];let ie;t[44]!==i.label||t[45]!==e.busy?(ie=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[ne,(0,Q.jsx)(Pe,{autoFocus:!0,required:!0,value:i.label,disabled:e.busy,onChange:re})]}),t[44]=i.label,t[45]=e.busy,t[46]=ie):ie=t[46];let ae;t[47]===s?ae=t[48]:(ae=(0,Q.jsx)(`label`,{htmlFor:s,className:`block`,children:`Expo access token`}),t[47]=s,t[48]=ae);let B=l.kind===`saved`,oe=l.kind===`new`?l.value:``,V;t[49]===e.host.accessToken?V=t[50]:(V=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]=V);let se;t[51]!==e.busy||t[52]!==B||t[53]!==oe||t[54]!==V||t[55]!==s?(se=(0,Q.jsx)(At,{id:s,className:`min-w-0 flex-1`,configured:B,value:oe,disabled:e.busy,placeholder:`Optional`,onChange:V}),t[51]=e.busy,t[52]=B,t[53]=oe,t[54]=V,t[55]=s,t[56]=se):se=t[56];let H;t[57]===l.kind?H=t[58]:(H=l.kind===`cleared`?null:(0,Q.jsx)(N,{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]=H);let ce;t[59]!==se||t[60]!==H?(ce=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[se,H]}),t[59]=se,t[60]=H,t[61]=ce):ce=t[61];let le;t[62]!==ae||t[63]!==ce?(le=(0,Q.jsxs)(`div`,{className:`space-y-1.5 text-sm`,children:[ae,ce]}),t[62]=ae,t[63]=ce,t[64]=le):le=t[64];let ue=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.`,U;t[65]===ue?U=t[66]:(U=(0,Q.jsx)(`p`,{role:`status`,className:`min-w-0 text-xs text-muted-foreground`,children:ue}),t[65]=ue,t[66]=U);let de=e.busy||f.status===`checking`,W;t[67]===E?W=t[68]:(W=()=>void E(),t[67]=E,t[68]=W);let pe;t[69]===f.status?pe=t[70]:(pe=f.status===`checking`?(0,Q.jsx)(ve,{size:`xs`}):null,t[69]=f.status,t[70]=pe);let he;t[71]!==de||t[72]!==W||t[73]!==pe?(he=(0,Q.jsxs)(N,{type:`button`,size:`sm`,variant:`outline`,disabled:de,onClick:W,children:[pe,` Check account`]}),t[71]=de,t[72]=W,t[73]=pe,t[74]=he):he=t[74];let K;t[75]!==U||t[76]!==he?(K=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2.5`,children:[U,he]}),t[75]=U,t[76]=he,t[77]=K):K=t[77];let ye;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,Q.jsx)(`span`,{children:`EAS project`}),t[78]=ye):ye=t[78];let be=i.appId??tn,xe=e.busy,Se;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(Se=e=>{typeof e==`string`&&a(t=>{let{appId:n,...r}=t;return e===tn?r:{...r,appId:e}})},t[79]=Se):Se=t[79];let Ce;t[80]===y?Ce=t[81]:(Ce=(0,Q.jsx)(ge,{size:`sm`,"aria-label":`EAS project`,children:(0,Q.jsx)(fe,{children:e=>e===tn?`From the thread's project`:y.find(t=>t.id===e)?.fullName??e})}),t[80]=y,t[81]=Ce);let we;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,Q.jsx)(G,{value:tn,children:`From the thread's project`}),t[82]=we):we=t[82];let q;t[83]!==y||t[84]!==i.appId?(q=i.appId&&!y.some(e=>e.id===i.appId)?(0,Q.jsx)(G,{value:i.appId,children:i.appId}):null,t[83]=y,t[84]=i.appId,t[85]=q):q=t[85];let J;t[86]===y?J=t[87]:(J=y.map(sn),t[86]=y,t[87]=J);let Te;t[88]!==q||t[89]!==J?(Te=(0,Q.jsxs)(me,{children:[we,q,J]}),t[88]=q,t[89]=J,t[90]=Te):Te=t[90];let Ee;t[91]!==e.busy||t[92]!==be||t[93]!==Ce||t[94]!==Te?(Ee=(0,Q.jsxs)(_e,{value:be,disabled:xe,onValueChange:Se,children:[Ce,Te]}),t[91]=e.busy,t[92]=be,t[93]=Ce,t[94]=Te,t[95]=Ee):Ee=t[95];let De;t[96]===Symbol.for(`react.memo_cache_sentinel`)?(De=(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]=De):De=t[96];let Oe;t[97]===Ee?Oe=t[98]:(Oe=(0,Q.jsxs)(`div`,{className:`space-y-1.5 text-sm`,children:[ye,Ee,De]}),t[97]=Ee,t[98]=Oe);let Ae;t[99]===M?Ae=t[100]:(Ae=(0,Q.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 text-sm`,children:[M(`maxConcurrentSessions`,`Sessions at once`,20),M(`maxSessionMinutes`,`Session minutes`,115),M(`idleMinutes`,`Idle minutes`,60)]}),t[99]=M,t[100]=Ae);let je=e.isNew?null:` Saving restarts this host, which stops its running sessions.`,Me;t[101]===je?Me=t[102]:(Me=(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.`,je]}),t[101]=je,t[102]=Me);let Ne;t[103]===_?Ne=t[104]:(Ne=_===null?null:(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:_}),t[103]=_,t[104]=Ne);let Re;t[105]!==ie||t[106]!==le||t[107]!==K||t[108]!==Oe||t[109]!==Ae||t[110]!==Me||t[111]!==Ne?(Re=(0,Q.jsxs)(ze,{children:[ie,le,K,Oe,Ae,Me,Ne]}),t[105]=ie,t[106]=le,t[107]=K,t[108]=Oe,t[109]=Ae,t[110]=Me,t[111]=Ne,t[112]=Re):Re=t[112];let Ue;t[113]!==e.busy||t[114]!==e.onClose?(Ue=(0,Q.jsx)(N,{type:`button`,variant:`ghost`,disabled:e.busy,onClick:e.onClose,children:`Cancel`}),t[113]=e.busy,t[114]=e.onClose,t[115]=Ue):Ue=t[115];let Ge=e.busy||!g,Ke;t[116]===e.busy?Ke=t[117]:(Ke=e.busy?(0,Q.jsx)(ve,{size:`xs`}):null,t[116]=e.busy,t[117]=Ke);let qe;t[118]!==Ge||t[119]!==Ke?(qe=(0,Q.jsxs)(N,{type:`submit`,disabled:Ge,children:[Ke,` Save host`]}),t[118]=Ge,t[119]=Ke,t[120]=qe):qe=t[120];let Je;t[121]!==Ue||t[122]!==qe?(Je=(0,Q.jsxs)(Le,{children:[Ue,qe]}),t[121]=Ue,t[122]=qe,t[123]=Je):Je=t[123];let Ye;t[124]!==L||t[125]!==te||t[126]!==Re||t[127]!==Je?(Ye=(0,Q.jsxs)(`form`,{className:`flex min-h-0 flex-col`,onSubmit:L,children:[te,Re,Je]}),t[124]=L,t[125]=te,t[126]=Re,t[127]=Je,t[128]=Ye):Ye=t[128];let Xe;t[129]!==F||t[130]!==Ye?(Xe=(0,Q.jsx)(Ve,{showCloseButton:F,children:Ye}),t[129]=F,t[130]=Ye,t[131]=Xe):Xe=t[131];let Ze;return t[132]!==P||t[133]!==Xe?(Ze=(0,Q.jsx)(He,{open:!0,onOpenChange:P,children:Xe}),t[132]=P,t[133]=Xe,t[134]=Ze):Ze=t[134],Ze}function sn(e){return(0,Q.jsx)(G,{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=ee(),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)(Ve,{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)(He,{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)(Fe,{children:[(0,Q.jsxs)(Ie,{children:[`Quit `,n.name,` to import`]}),(0,Q.jsxs)(Be,{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)(N,{variant:`outline`,onClick:r,children:`Cancel`}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(N,{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)(Le,{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,[l,u]=(0,$.useState)(!1),[d,f]=(0,$.useState)(null),p;t[0]===s?p=t[1]:(p=async()=>({fullDiskAccess:await s()}),t[0]=s,t[1]=p);let m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m={fullDiskAccess:!1},t[2]=m):m=t[2];let h=Nt(p,m),g;t[3]!==i||t[4]!==l?(g=()=>{l||(u(!0),f(null),Promise.resolve().then(i).catch(()=>f(`Could not open System Settings. Try Allow again.`)).finally(()=>u(!1)))},t[3]=i,t[4]=l,t[5]=g):g=t[5];let _=g,v;t[6]===n.name?v=t[7]:(v=(0,Q.jsxs)(Fe,{children:[(0,Q.jsxs)(Ie,{children:[`Let P4 Code read `,n.name,`’s cookies`]}),(0,Q.jsxs)(Be,{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]=v);let y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(c,{className:`size-8 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),t[8]=y):y=t[8];let b=`Read ${n.name}'s cookies for this import.`,x;t[9]===_?x=t[10]:(x=()=>void _(),t[9]=_,t[10]=x);let S;t[11]!==h.status.fullDiskAccess||t[12]!==b||t[13]!==x?(S=[{id:`fullDiskAccess`,icon:y,title:`Full Disk Access`,description:b,granted:h.status.fullDiskAccess,onAllow:x}],t[11]=h.status.fullDiskAccess,t[12]=b,t[13]=x,t[14]=S):S=t[14];let C;t[15]!==l||t[16]!==S?(C=(0,Q.jsx)(jt,{busy:l,permissions:S}),t[15]=l,t[16]=S,t[17]=C):C=t[17];let w;t[18]!==d||t[19]!==h.error?(w=d||h.error?(0,Q.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-muted-foreground`,children:d??h.error}):null,t[18]=d,t[19]=h.error,t[20]=w):w=t[20];let T;t[21]!==h||t[22]!==o?(T=h.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]=h,t[22]=o,t[23]=T):T=t[23];let E;t[24]!==w||t[25]!==T||t[26]!==C?(E=(0,Q.jsxs)(ze,{children:[C,w,T]}),t[24]=w,t[25]=T,t[26]=C,t[27]=E):E=t[27];let D;t[28]===r?D=t[29]:(D=(0,Q.jsx)(N,{variant:`outline`,onClick:r,children:`Cancel`}),t[28]=r,t[29]=D);let O;t[30]===h?O=t[31]:(O=h.isReady([`fullDiskAccess`]),t[30]=h,t[31]=O);let k;t[32]!==a||t[33]!==l||t[34]!==O?(k=(0,Q.jsx)(Mt,{ready:O,busy:l,onClick:a,children:`Continue`}),t[32]=a,t[33]=l,t[34]=O,t[35]=k):k=t[35];let A;t[36]!==D||t[37]!==k?(A=(0,Q.jsxs)(Le,{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]!==v?(j=(0,Q.jsxs)(Q.Fragment,{children:[v,E,A]}),t[39]=E,t[40]=A,t[41]=v,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)(Ie,{children:[`Import from `,n.name]}),t[4]=n.name,t[5]=_);let v;t[6]===r?v=t[7]:(v=(0,Q.jsxs)(Be,{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)(Fe,{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)(re,{className:`size-4 sm:hidden`}),(0,Q.jsx)(te,{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)(ze,{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)(N,{variant:`outline`,onClick:d,children:`Cancel`}),t[47]=d,t[48]=j);let M=o===``||m||h,P;t[49]!==f||t[50]!==M?(P=(0,Q.jsx)(N,{disabled:M,onClick:f,children:`Import`}),t[49]=f,t[50]=M,t[51]=P):P=t[51];let F;t[52]!==j||t[53]!==P?(F=(0,Q.jsxs)(Le,{children:[j,P]}),t[52]=j,t[53]=P,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=B(`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=B(`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)(_,{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)(Fe,{children:[(0,Q.jsx)(Ie,{children:`Importing cookies`}),(0,Q.jsx)(Be,{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)(ze,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,Q.jsx)(ve,{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)(Ie,{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)(Be,{children:a}),t[2]=a,t[3]=o);let s;t[4]!==i||t[5]!==o?(s=(0,Q.jsxs)(Fe,{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)(ve,{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)(ze,{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)(Ie,{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)(Be,{children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Q.jsxs)(Fe,{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)(ze,{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)(N,{}),t[17]=m):m=t[17];let h;t[18]===s?h=t[19]:(h=(0,Q.jsx)(Le,{children:(0,Q.jsx)(Re,{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)(Ie,{children:[`Couldn’t import from `,n.name]}),t[0]=n.name,t[1]=o);let s=ae[r],c;t[2]===s?c=t[3]:(c=(0,Q.jsx)(Be,{children:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c?(l=(0,Q.jsxs)(Fe,{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)(N,{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)(N,{onClick:a,children:`Try again`}):null,t[9]=a,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,Q.jsxs)(Le,{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 L.literals.find(e=>t.includes(`failed: ${e}.`))??`readFailed`},zn=e=>e._tag===`fill`?kn:e._tag===`preset`&>.some(t=>t.id===e.presetId)?e.presetId:An,Bn=e=>{let t=zn(e);return t===kn?`Fill panel`:t===An?`Responsive`:gt.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=q(Gn),i=J(),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 u=c,d;t[3]!==a?.height||t[4]!==a?.width||t[5]!==i?(d=e=>{if(e===kn){i({browserDefaultViewport:v});return}if(e===An){i({browserDefaultViewport:{_tag:`freeform`,width:a?.width??Nn.width,height:a?.height??Nn.height}});return}let t=gt.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]=d):d=t[6];let f=d,p;t[7]!==u||t[8]!==a||t[9]!==i?(p=(e,t)=>{if(t===null||!Vn(t))return;let n={...u,[e]:t};n.width*n.height>8294400||a&&n.width===a.width&&n.height===a.height||i({browserDefaultViewport:{_tag:`freeform`,...n}})},t[7]=u,t[8]=a,t[9]=i,t[10]=p):p=t[10];let m=p,h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=X(`browser-default-viewport`),t[11]=h):h=t[11];let _;t[12]!==n||t[13]!==i||t[14]!==r._tag?(_=!n&&r._tag!==l._tag?(0,Q.jsx)(ft,{label:`default browser viewport`,onClick:()=>i({browserDefaultViewport:l})}):null,t[12]=n,t[13]=i,t[14]=r._tag,t[15]=_):_=t[15];let y;t[16]===r?y=t[17]:(y=zn(r),t[16]=r,t[17]=y);let b;t[18]===r?b=t[19]:(b=Bn(r),t[18]=r,t[19]=b);let x;t[20]===b?x=t[21]:(x=(0,Q.jsx)(ge,{size:`sm`,className:`w-full min-w-0 sm:w-44`,"aria-label":`Default browser viewport`,children:(0,Q.jsx)(fe,{children:b})}),t[20]=b,t[21]=x);let S,C;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(G,{value:kn,children:`Fill panel`}),C=(0,Q.jsx)(G,{value:An,children:`Responsive`}),t[22]=S,t[23]=C):(S=t[22],C=t[23]);let w;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsxs)(me,{align:`end`,alignItemWithTrigger:!1,children:[S,C,(0,Q.jsxs)(he,{children:[(0,Q.jsx)(pe,{children:`Standard`}),gt.map(Wn)]})]}),t[24]=w):w=t[24];let T;t[25]!==n||t[26]!==f||t[27]!==x||t[28]!==y?(T=(0,Q.jsxs)(_e,{value:y,onValueChange:f,disabled:n,children:[x,w]}),t[25]=n,t[26]=f,t[27]=x,t[28]=y,t[29]=T):T=t[29];let E;t[30]!==m||t[31]!==n||t[32]!==u||t[33]!==a||t[34]!==i?(E=a?(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(W,{value:u.width,min:240,max:g,disabled:n,format:Pn,size:`sm`,className:`w-20`,onValueCommitted:e=>m(`width`,e),children:(0,Q.jsx)(de,{children:(0,Q.jsx)(U,{"aria-label":`Default viewport width`})})}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`×`}),(0,Q.jsx)(W,{value:u.height,min:240,max:g,disabled:n,format:Pn,size:`sm`,className:`w-20`,onValueCommitted:e=>m(`height`,e),children:(0,Q.jsx)(de,{children:(0,Q.jsx)(U,{"aria-label":`Default viewport height`})})}),(0,Q.jsxs)(Ne,{children:[(0,Q.jsx)(je,{render:(0,Q.jsx)(N,{size:`icon-sm`,variant:`ghost-muted`,disabled:n,"aria-label":`Rotate to ${u.height>=u.width?`landscape`:`portrait`}`,onClick:()=>i({browserDefaultViewport:Hn(a)}),children:(0,Q.jsx)(Et,{})})}),(0,Q.jsx)(Me,{side:`top`,children:`Rotate`})]})]}):null,t[30]=m,t[31]=n,t[32]=u,t[33]=a,t[34]=i,t[35]=E):E=t[35];let D;t[36]!==T||t[37]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto`,children:[T,E]}),t[36]=T,t[37]=E,t[38]=D):D=t[38];let O;return t[39]!==D||t[40]!==_?(O=(0,Q.jsx)(Y,{...h,description:`Tab size for you and agents. Fill fits the panel; other sizes show the device toolbar.`,resetAction:_,control:D}),t[39]=D,t[40]=_,t[41]=O):O=t[41],O}function Wn(e){return(0,Q.jsx)(G,{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=q(Jn),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`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)(ft,{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=y.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)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser zoom`,children:(0,Q.jsx)(fe,{children:l})}),t[9]=l,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(me,{align:`end`,alignItemWithTrigger:!1,children:y.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)(_e,{disabled:n,value:s,onValueChange:c,children:[u,d]}),t[12]=n,t[13]=s,t[14]=c,t[15]=u,t[16]=f):f=t[16];let p;return t[17]!==o||t[18]!==f?(p=(0,Q.jsx)(Y,{...a,description:`Page zoom applied to new browser tabs.`,resetAction:o,control:f}),t[17]=o,t[18]=f,t[19]=p):p=t[19],p}function qn(e){return(0,Q.jsx)(G,{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=q(Zn),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`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)(ft,{label:`default browser appearance`,onClick:()=>i({browserDefaultAppearance:u})}):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)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser appearance`,children:(0,Q.jsx)(fe,{children:c})}),t[7]=c,t[8]=l);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(me,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(Fn).map(Xn)}),t[9]=d):d=t[9];let f;t[10]!==r||t[11]!==n||t[12]!==s||t[13]!==l?(f=(0,Q.jsxs)(_e,{disabled:n,value:r,onValueChange:s,children:[l,d]}),t[10]=r,t[11]=n,t[12]=s,t[13]=l,t[14]=f):f=t[14];let p;return t[15]!==o||t[16]!==f?(p=(0,Q.jsx)(Y,{...a,description:`The color scheme pages are told to prefer. System follows your OS setting.`,resetAction:o,control:f}),t[15]=o,t[16]=f,t[17]=p):p=t[17],p}function Xn(e){let[t,n]=e;return(0,Q.jsx)(G,{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=q(er),i=q($n),a=J(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=X(`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)(Y,{...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=X(`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)(Y,{...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=q(rr),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`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)(ft,{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=P.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)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Browser recording frame rate`,children:(0,Q.jsxs)(fe,{children:[r,` fps`]})}),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(me,{align:`end`,alignItemWithTrigger:!1,children:P.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)(_e,{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)(Y,{...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)(G,{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=q(sr),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`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)(ft,{label:`link target`,onClick:()=>i({browserLinkTarget:H})}):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)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Open links in`,children:(0,Q.jsx)(fe,{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)(me,{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)(_e,{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)(Y,{...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)(G,{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=q(fr),n=q(dr),r=J(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=X(`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)(ft,{label:`search engine`,onClick:()=>r({browserSearchEngine:S,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=R.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)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Search engine`,children:(0,Q.jsx)(fe,{children:s})}),e[7]=s,e[8]=c);let l;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(me,{align:`end`,alignItemWithTrigger:!1,children:R.literals.map(ur)}),e[9]=l):l=e[9];let u;e[10]!==t||e[11]!==o||e[12]!==c?(u=(0,Q.jsxs)(_e,{value:t,onValueChange:o,children:[c,l]}),e[10]=t,e[11]=o,e[12]=c,e[13]=u):u=e[13];let d;e[14]!==a||e[15]!==u?(d=(0,Q.jsx)(Y,{...i,description:`What the address bar searches when you type something that isn't a URL.`,resetAction:a,control:u}),e[14]=a,e[15]=u,e[16]=d):d=e[16];let f;e[17]!==n||e[18]!==t||e[19]!==r?(f=t===`custom`?(0,Q.jsx)(Y,{title:`Custom search URL`,description:`Use %s where the search terms go.`,status:nt(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:M,value:n,onCommit:e=>r({browserCustomSearchUrl:e.trim()})})}):null,e[17]=n,e[18]=t,e[19]=r,e[20]=f):f=e[20];let p;return e[21]!==d||e[22]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[d,f]}),e[21]=d,e[22]=f,e[23]=p):p=e[23],p}function ur(e){return(0,Q.jsx)(G,{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=q(mr),n=J(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=X(`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)(ft,{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)(Y,{...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}=lt(),r=st(),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)(pt,{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=Ee(e,b),{state:i,loaded:a}=Ue(e),{scope:o,environments:s,connectedEnvironments:c}=lt(),l=ct(),u=o.kind===`project`||o.kind===`checkout`,d=c.some(e=>e.serverConfig?.settings.enableDeviceSupport),f=ke(We.configure,{reportFailure:!1}),p=ke(We.list,{reportFailure:!1}),[m,h]=(0,$.useState)(null),g=i.hostStatus===`installing`||i.hostStatus===`starting`,_=i.hosts.some(e=>e.kind===`local`&&!e.platforms.some(e=>e.available)),[v,y]=(0,$.useState)(!1);v&&!t&&y(!1),t&&!v&&(i.hostStatus===`ready`||_)&&m!==`hub`&&y(!0);let x=async(t,n)=>{if(e&&De(e,`settings:write`)){h(t);try{let e=await Promise.allSettled(s.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!De(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return f({environmentId:e.environmentId,input:{...n,...n.enabled?{onboardingCompleted:!0}:{}}})})),t=s.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});t.length>0&&K.add({type:`error`,title:`Device settings not saved on all environments`,description:`Could not update ${t.map(e=>e.label).join(`, `)}.`})}finally{h(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),h(`update-${t}`),p({environmentId:e,input:{updateTool:t}}).then(e=>{if(e._tag===`Failure`){let r=Oe(e.cause);C({tool:t,message:r}),n&&K.add({type:`error`,title:r})}}).finally(()=>h(null)))},D=t=>{e&&(h(t),p({environmentId:e,input:{inspectOnly:!0}}).finally(()=>h(null)))},O=t=>{let n=T(t);if(!n&&!i.supportsToolInspection)return null;let r=m===`update-${t}`||m===`check-${t}`,a=n?`Update to v${w?.[t].requiredVersion}`:`Check ${t===`hub`?`device hub`:`agent device`} version`;return(0,Q.jsxs)(Ne,{children:[(0,Q.jsx)(je,{render:(0,Q.jsx)(N,{size:`icon-xs`,variant:`ghost-muted`,disabled:!e||m!==null||g,"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)(ie,{"aria-hidden":!0})}),(0,Q.jsx)(`span`,{className:n&&!r?`scale-75 opacity-0`:void 0,children:(0,Q.jsx)(xt,{refreshing:r})})]})}),(0,Q.jsx)(Me,{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)(N,{size:`sm`,disabled:!e||m!==null||g,onClick:()=>E(t),children:m===`update-${t}`?`Updating…`:`Update to v${n.requiredVersion}`}):null,i.supportsToolInspection?(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:!e||m!==null||g,onClick:()=>D(`check`),children:m===`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)(Y,{...X(`device-hub`),serverScoped:!0,settingKeys:[`enableDeviceSupport`],description:Ye,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`),m===`hub`?(0,Q.jsx)(Je,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(kt,{settingKeys:[`enableDeviceSupport`],checked:t,disabled:!r||u||!a||!e||g||m!==null,"aria-label":`Device hub`,onCheckedChange:e=>void x(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]})}),(0,Q.jsx)(Qe,{children:v?(0,Q.jsx)(Y,{...X(`device-platform-support`),description:c.length>1?`Status for ${c.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)(Ke,{compact:!0,platform:`iOS`,status:qe(i,`ios`)}),(0,Q.jsx)(Ke,{compact:!0,platform:`Android`,status:qe(i,`android`)})]}),control:(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:!e||!t||g||m!==null,onClick:()=>{e&&(h(`check`),p({environmentId:e,input:{}}).finally(()=>h(null)))},children:m===`check`?`Checking…`:`Refresh`})}):null}),(0,Q.jsx)(Y,{...X(`agent-device-access`),serverScoped:!0,settingKeys:[`enableAgentDeviceAccess`],description:Ge,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`),m===`agent`?(0,Q.jsx)(Xe,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(kt,{settingKeys:[`enableAgentDeviceAccess`],checked:n,disabled:!r||c.length===0||!u&&(!a||!d||g)||m!==null,"aria-label":`Agent device access`,onCheckedChange:e=>u?l({enableAgentDeviceAccess:!!e}):void x(`agent`,{agentAccessEnabled:!!e})})]})}),e?(0,Q.jsx)(Ze,{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=q(vr),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`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)(ft,{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)(Y,{...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=q(e=>e.browserProfiles),n=q(e=>e.browserDefaultProfileId),r=Se(),i=J(),{environments:a,isReady:o}=be(),c=ye(),[l,u]=(0,$.useState)(null),[h,g]=(0,$.useState)(null),[_,v]=(0,$.useState)(null),[y,b]=(0,$.useState)(null),[S,C]=(0,$.useState)(null),[T,k]=(0,$.useState)(!1),j=ue(),M=ke(tt.clearProfile,{reportFailure:!1}),P={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 le(n)}},F=Mn(wt!==null,o,a.length,P.environmentIds.length),I=(0,$.useRef)(!1),[L,R]=(0,$.useState)(!1),z=e||!r,te=E(t).filter(e=>e.kind!==`incognito`),re=ne(te,n)?.id??`default`,ie=e=>{if(!r||I.current)return;let t=we().browserProfiles;if(t.length>=24)return;let n=E(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-${ee()}`,name:o,kind:`persistent`};return i({browserProfiles:[...t,s]}),s},ae=(e,t)=>{if(!r||I.current)return;let n=t.trim().slice(0,48);if(n===``)return;let a=we().browserProfiles;i({browserProfiles:a.map(t=>t.id===e?{...t,name:n}:t)})},se=(e,t)=>{if(r&&!I.current){if(!F){K.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,P).then(()=>{K.add({type:`success`,title:`Cleared ${t}'s cookies and cache`})}).catch(()=>{K.add({type:`error`,title:`Could not clear ${t}'s data`})})}},H=async e=>{if(!r||I.current)return;if(!F){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,P)}catch{C(`Profile data could not be deleted. Try again.`),k(!1);return}let t=we();i({browserProfiles:t.browserProfiles.filter(t=>t.id!==e),...t.browserDefaultProfileId===e?{browserDefaultProfileId:d}:{}}),k(!1),v(null)},ce=(l??[]).filter(e=>e.unavailable!==`notInstalled`&&e.unavailable!==`unsupportedPlatform`),U=(0,$.useCallback)(()=>{wt&&wt.listBrowserImportSources().then(u).catch(()=>u(e=>e??[]))},[]),de=async(e,t,n)=>{if(!wt||!r)return{kind:`blocked`,reason:`sessionUnavailable`};if(n.target.kind===`existing`&&!E(we().browserProfiles).some(e=>e.id===n.target.profileId)||I.current)return{kind:`blocked`,reason:`readFailed`};I.current=!0,R(!0);try{let r=await wt.importBrowserCookies({environmentId:t,sourceId:e.id,sourceProfileDirectory:n.sourceProfileDirectory,targetProfileId:n.target.profileId});if(n.target.kind===`existing`&&!E(we().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 Ce(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(E(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{I.current=!1,R(!1)}},W=async e=>{if(wt)try{let t=await wt.listBrowserImportSources();return u(t),t.find(t=>t.id===e)}catch{return}},G=t.length>=24;return(0,Q.jsxs)(Y,{...X(`browser-profiles`),description:`Profiles separate cookies and logins. Incognito data is cleared when the app closes.`,control:(0,Q.jsxs)(D,{onOpenChange:e=>e&&U(),children:[(0,Q.jsxs)(V,{render:(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:z||L}),children:[(0,Q.jsx)(m,{}),`Add profile`]}),(0,Q.jsxs)(oe,{align:`end`,children:[(0,Q.jsx)(s,{disabled:!r||G,onClick:()=>ie(`New profile`),children:`Blank profile`}),G?(0,Q.jsx)(s,{disabled:!0,children:`You’ve reached the profile limit`}):null,(0,Q.jsx)(A,{}),(0,Q.jsxs)(O,{children:[(0,Q.jsx)(x,{children:`Import from`}),l===null?(0,Q.jsx)(s,{disabled:!0,children:`Looking for browsers…`}):ce.length===0?(0,Q.jsx)(s,{disabled:!0,children:`No supported browsers found`}):(0,Q.jsxs)(Q.Fragment,{children:[ce.map(e=>(0,Q.jsx)(s,{disabled:!r||c==null,onClick:()=>{r&&c!=null&&g({source:e,environmentId:c.environmentId,environmentName:mt({isPrimary:!0,environmentId:c.environmentId,runtimeLabel:c.label})})},children:e.name},e.id)),c==null?(0,Q.jsx)(s,{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:te.map((e,t)=>{let n=f(e.id),a=e.id===re;return(0,Q.jsxs)(`div`,{className:B(`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:B(`truncate text-sm text-foreground`,z&&`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:z||L,maxLength:48,value:e.name,onCommit:t=>ae(e.id,t)}),a?(0,Q.jsx)(`span`,{className:B(`flex`,z&&`opacity-64`),children:(0,Q.jsx)(p,{children:`Default`})}):null]}),(0,Q.jsxs)(D,{children:[(0,Q.jsx)(V,{render:(0,Q.jsx)(N,{size:`icon-xs`,variant:`ghost-muted`,disabled:z||L,"aria-label":`${e.name} options`}),children:(0,Q.jsx)(w,{})}),(0,Q.jsxs)(oe,{align:`end`,children:[(0,Q.jsx)(s,{disabled:!r||a,onClick:()=>{r&&i({browserDefaultProfileId:e.id})},children:`Set as default`}),(0,Q.jsx)(s,{disabled:!r||!F,onClick:()=>{P.environmentIds.length>0?b(e):se(e.id,e.name)},children:`Clear cookies and cache`}),n?null:(0,Q.jsx)(s,{variant:`destructive`,disabled:!r||!F,onClick:()=>{r&&v(e)},children:`Remove profile and data`}),F?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(A,{}),(0,Q.jsx)(s,{disabled:!0,children:o?`Connect to an environment to clear profile data`:`Checking environments…`})]})]})]})]},e.id)})}),(0,Q.jsx)(ht,{open:_!==null,onOpenChange:e=>{!e&&!T&&(v(null),C(null))},children:(0,Q.jsxs)(_t,{children:[(0,Q.jsxs)(St,{children:[(0,Q.jsxs)(vt,{children:[`Remove “`,_?.name,`”?`]}),(0,Q.jsx)(yt,{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,F?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)(bt,{children:[(0,Q.jsx)(Ct,{disabled:T,render:(0,Q.jsx)(N,{variant:`outline`,disabled:T}),children:`Cancel`}),(0,Q.jsx)(N,{variant:`destructive`,disabled:T||!r||!F,onClick:()=>{_&&r&&F&&H(_.id)},children:T?`Removing…`:`Remove profile`})]})]})}),(0,Q.jsx)(ht,{open:y!==null,onOpenChange:e=>{e||b(null)},children:(0,Q.jsxs)(_t,{children:[(0,Q.jsxs)(St,{children:[(0,Q.jsxs)(vt,{children:[`Clear “`,y?.name,`”’s cookies and cache?`]}),(0,Q.jsx)(yt,{children:`You are signed out of its sites. Server browser tabs open in this profile close now.`})]}),(0,Q.jsxs)(bt,{children:[(0,Q.jsx)(Ct,{render:(0,Q.jsx)(N,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(N,{variant:`destructive`,onClick:()=>{y&&se(y.id,y.name),b(null)},children:`Clear data`})]})]})}),h?(0,Q.jsx)(vn,{source:h.source,destinationEnvironmentName:h.environmentName,targetProfiles:te.map(e=>({id:e.id,name:e.name})),canCreateProfile:r&&!G,onImport:e=>de(h.source,h.environmentId,e),onRefreshSource:()=>W(h.source.id),onCheckFullDiskAccess:window.desktopBridge?.checkSystemPermission?()=>window.desktopBridge.checkSystemPermission(`full-disk-access`):void 0,onOpenFullDiskAccessSettings:async()=>{await xe()?.shell.openSystemSettings(`full-disk-access`).catch(()=>{K.add({type:`error`,title:`Could not open System Settings`,description:`Open Privacy & Security → Full Disk Access manually.`})})},onClose:()=>g(null)}):null]})}function br(){let e=(0,Z.c)(3),t=!Ae,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)(dt,{children:[i,(0,Q.jsxs)(pt,{id:`browser`,title:`Browser`,children:[t?(0,Q.jsx)(ut,{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-
|
|
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{$n as s,Bf as c,Ch as l,Dg as u,Gg as d,Jg as f,Jn as p,Jp as m,Jw as h,Mg as g,Od as _,Og as v,Pg as y,Q_ as b,Qn as x,Sh as S,Sp as C,Tp as w,Ty as T,Yg as E,Yn as D,Zn as O,Zw as k,ar as A,bb as j,dh as M,dr as N,fh as P,fr as F,iE as I,il as L,l as ee,mh as R,nh as z,od as te,qg as ne,rd as re,rf as ie,rl as ae,t as B,tr as oe,ur as V,wy as se,xh as H,xp as ce}from"./utils-CrFJwxSd.js";import{W as le}from"./runtime-Dm3Pi31_.js";import{T as ue}from"./entities-Om5Klild.js";import{a as U,r as de,t as W}from"./number-field-DGdBjQD2.js";import{a as G,c as fe,i as pe,o as me,r as he,s as ge,t as _e}from"./select-Ctq0UILH.js";import{t as ve}from"./spinner-CNva85zM.js";import{i as K}from"./toast-BcjbmUtS.js";import{D as ye,E as be,J as xe,c as Se,o as Ce,r as we,s as q,x as J}from"./useSettings-BL4ZWGQV.js";import{f as Te}from"./server-BvxyePeo.js";import{i as Ee,n as De}from"./session-C7ckxjAM.js";import{t as Oe}from"./query-DlK0I8Jc.js";import{t as ke}from"./use-atom-command-BNkv9iyk.js";import{t as Ae}from"./env-wK1YYxA8.js";import{a as je,n as Me,t as Ne}from"./tooltip-T5ePvxsH.js";import{t as Pe}from"./input-BCWES8Y7.js";import{a as Fe,c as Ie,i as Le,n as Re,o as ze,r as Be,s as Ve,t as He}from"./dialog-BwjzOzO6.js";import{i as Ue,t as We}from"./device-6R-yC55P.js";import{a as Ge,i as Ke,l as qe,n as Je,o as Ye,t as Xe,u as Ze}from"./DeviceSetup-DW4g9NNK.js";import{t as Qe}from"./AnimatedHeight-CHpFDL1r.js";import{i as $e,n as et}from"./Icons-DwLGuyWf.js";import{t as tt}from"./preview-CiojYkh4.js";import{n as nt}from"./preview-Dwq2O7nm.js";import{a as rt,i as it,o as at,t as ot}from"./popover-BnqKHl4L.js";import{F as st,R as ct,V as lt,a as Y,c as ut,i as dt,r as ft,s as pt,w as mt}from"./settingsLayout-DFYjWgKN.js";import{Ar as ht,Bi as gt,Fr as _t,Ir as vt,Mr as yt,Nr as bt,Oa as xt,Pr as St,ir as X,jr as Ct,qi as wt,va as Tt,zi as Et}from"./main-BGaSDXjP.js";import{t as Dt}from"./ProjectDefaultsSettings-DLJfUN7i.js";import{t as Ot}from"./draft-input-CpqOZR5i.js";import{t as kt}from"./ScopedSwitch-CX4FTGjy.js";import{t as At}from"./SecretInput-BPPzPNI1.js";import{n as jt,r as Mt,t as Nt}from"./usePermissionStatus-D6i3IaCj.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)(F,{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)(at,{"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)(rt,{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)(it,{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)(ot,{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)(Ne,{children:[(0,Q.jsxs)(je,{render:(0,Q.jsx)(`span`,{tabIndex:0,className:`inline-flex items-center gap-1`}),children:[e.available?(0,Q.jsx)(_,{className:`size-3`}):(0,Q.jsx)(ce,{className:`size-3`}),e.platform===`ios`?`iOS`:`Android`,` `,e.available?`available`:`unavailable`]}),(0,Q.jsx)(Me,{children:e.reason??(e.platform===`ios`?`iOS available`:`Android available`)})]},e.platform)}var zt=j(T);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=ke(We.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(!De(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(h(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:u,testConnection:d}=Ut(i),f=u[Vt(c)],p=Object.values(f??{}).some(Kt),m,h;t[0]===c?(m=t[1],h=t[2]):(m=Bt({...c,label:c.label.trim()||c.target}),h=I(m),t[0]=c,t[1]=m,t[2]=h);let g=h,v;t[3]===f?v=t[4]:(v=Object.values(f??{}).filter(Gt),t[3]=f,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]!==p||t[10]!==c.label||t[11]!==m||t[12]!==o?(S=(0,Q.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),I(m)&&c.label.trim()&&!a&&!p&&o(m.value)}}),t[8]=a,t[9]=p,t[10]=c.label,t[11]=m,t[12]=o,t[13]=S):S=t[13];let w=r?`Add device host`:`Edit device host`,T;t[14]===w?T=t[15]:(T=(0,Q.jsx)(Ie,{children:w}),t[14]=w,t[15]=T);let E=i.length===1?`Connect from ${i[0]?.label}.`:`Connect from ${i.length} selected environments.`,D;t[16]===E?D=t[17]:(D=(0,Q.jsxs)(Be,{children:[E,` `,`Hosts on the same machine are skipped.`]}),t[16]=E,t[17]=D);let O;t[18]!==T||t[19]!==D?(O=(0,Q.jsxs)(Fe,{children:[T,D]}),t[18]=T,t[19]=D,t[20]=O):O=t[20];let k;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(`span`,{children:`Name`}),t[21]=k):k=t[21];let A;t[22]===c?A=t[23]:(A=e=>l({...c,label:e.target.value}),t[22]=c,t[23]=A);let j;t[24]!==a||t[25]!==c.label||t[26]!==A?(j=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[k,(0,Q.jsx)(Pe,{autoFocus:!0,required:!0,value:c.label,disabled:a,onChange:A,placeholder:`Mac mini`})]}),t[24]=a,t[25]=c.label,t[26]=A,t[27]=j):j=t[27];let M;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(`span`,{children:`SSH target`}),t[28]=M):M=t[28];let P;t[29]===c?P=t[30]:(P=e=>l({...c,target:e.target.value}),t[29]=c,t[30]=P);let F;t[31]!==a||t[32]!==c.target||t[33]!==P?(F=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[M,(0,Q.jsx)(Pe,{required:!0,value:c.target,disabled:a,onChange:P,placeholder:`user@host or SSH alias`})]}),t[31]=a,t[32]=c.target,t[33]=P,t[34]=F):F=t[34];let L=n.port!==void 0||n.identityFile!==void 0||void 0,ee;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`SSH options`}),t[35]=ee):ee=t[35];let R;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(`span`,{children:`Identity file`}),t[36]=R):R=t[36];let te=c.identityFile??``,ne;t[37]===c?ne=t[38]:(ne=e=>{let{identityFile:t,...n}=c;l(e.target.value?{...n,identityFile:e.target.value}:n)},t[37]=c,t[38]=ne);let re;t[39]!==a||t[40]!==te||t[41]!==ne?(re=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[R,(0,Q.jsx)(Pe,{value:te,disabled:a,onChange:ne,placeholder:`SSH config default`})]}),t[39]=a,t[40]=te,t[41]=ne,t[42]=re):re=t[42];let ie;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsx)(`span`,{children:`Port`}),t[43]=ie):ie=t[43];let ae=c.port??``,B;t[44]===c?B=t[45]:(B=e=>{let{port:t,...n}=c;l(e.target.value?{...n,port:Number(e.target.value)}:n)},t[44]=c,t[45]=B);let oe;t[46]!==a||t[47]!==ae||t[48]!==B?(oe=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[ie,(0,Q.jsx)(Pe,{type:`number`,min:1,max:65535,value:ae,disabled:a,onChange:B,placeholder:`Default`})]}),t[46]=a,t[47]=ae,t[48]=B,t[49]=oe):oe=t[49];let V;t[50]!==re||t[51]!==oe?(V=(0,Q.jsxs)(`div`,{className:`mt-3 grid grid-cols-[minmax(0,1fr)_7rem] gap-3`,children:[re,oe]}),t[50]=re,t[51]=oe,t[52]=V):V=t[52];let se;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Optional. Resolved separately on each environment.`}),t[53]=se):se=t[53];let H;t[54]!==L||t[55]!==V?(H=(0,Q.jsxs)(`details`,{open:L,className:`text-sm`,children:[ee,V,se]}),t[54]=L,t[55]=V,t[56]=H):H=t[56];let ce=p?`Checking environments…`:f?y?`${y} of ${i.length} failed`:`Connection checks passed`:`Check access before saving`,le;t[57]===ce?le=t[58]:(le=(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:ce}),t[57]=ce,t[58]=le);let ue=a||p||!g,U;t[59]!==m||t[60]!==d?(U=()=>{I(m)&&d(m.value)},t[59]=m,t[60]=d,t[61]=U):U=t[61];let de;t[62]===p?de=t[63]:(de=p?(0,Q.jsx)(ve,{size:`xs`}):null,t[62]=p,t[63]=de);let W;t[64]!==ue||t[65]!==U||t[66]!==de?(W=(0,Q.jsxs)(N,{type:`button`,size:`sm`,variant:`outline`,disabled:ue,onClick:U,children:[de,` Test connection`]}),t[64]=ue,t[65]=U,t[66]=de,t[67]=W):W=t[67];let G;t[68]!==le||t[69]!==W?(G=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,children:[le,W]}),t[68]=le,t[69]=W,t[70]=G):G=t[70];let fe;t[71]!==f||t[72]!==i?(fe=f?(0,Q.jsx)(`ul`,{className:`border-t border-border/60 divide-y divide-border/40`,children:i.map(e=>{let t=f[e.environmentId];return t?(0,Q.jsxs)(`li`,{className:`px-3 py-2.5 text-xs`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`truncate font-medium`,children:e.label}),(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5 ${t.status===`failed`?`text-destructive`:`text-muted-foreground`}`,children:t.status===`pending`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ve,{size:`xs`}),` Checking…`]}):t.status===`local`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(C,{className:`size-3`}),` Already available locally`]}):t.status===`failed`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(z,{className:`size-3`}),` Failed`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_,{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]=f,t[72]=i,t[73]=fe):fe=t[73];let pe;t[74]!==G||t[75]!==fe?(pe=(0,Q.jsxs)(`div`,{className:`rounded-lg border border-border/60`,children:[G,fe]}),t[74]=G,t[75]=fe,t[76]=pe):pe=t[76];let me;t[77]!==j||t[78]!==F||t[79]!==H||t[80]!==pe?(me=(0,Q.jsxs)(ze,{children:[j,F,H,pe]}),t[77]=j,t[78]=F,t[79]=H,t[80]=pe,t[81]=me):me=t[81];let he;t[82]!==a||t[83]!==s?(he=(0,Q.jsx)(N,{type:`button`,variant:`ghost`,disabled:a,onClick:s,children:`Cancel`}),t[82]=a,t[83]=s,t[84]=he):he=t[84];let ge;t[85]!==a||t[86]!==p||t[87]!==c.label||t[88]!==g?(ge=a||p||!g||!c.label.trim(),t[85]=a,t[86]=p,t[87]=c.label,t[88]=g,t[89]=ge):ge=t[89];let _e;t[90]===a?_e=t[91]:(_e=a?(0,Q.jsx)(ve,{size:`xs`}):null,t[90]=a,t[91]=_e);let K;t[92]!==ge||t[93]!==_e?(K=(0,Q.jsxs)(N,{type:`submit`,disabled:ge,children:[_e,` Save host`]}),t[92]=ge,t[93]=_e,t[94]=K):K=t[94];let ye;t[95]!==he||t[96]!==K?(ye=(0,Q.jsxs)(Le,{children:[he,K]}),t[95]=he,t[96]=K,t[97]=ye):ye=t[97];let be;t[98]!==O||t[99]!==me||t[100]!==x||t[101]!==ye||t[102]!==S?(be=(0,Q.jsxs)(Ve,{showCloseButton:x,render:S,children:[O,me,ye]}),t[98]=O,t[99]=me,t[100]=x,t[101]=ye,t[102]=S,t[103]=be):be=t[103];let xe;return t[104]!==b||t[105]!==be?(xe=(0,Q.jsx)(He,{open:!0,onOpenChange:b,children:be}),t[104]=b,t[105]=be,t[106]=xe):xe=t[106],xe}function Gt(e){return e.status===`failed`}function Kt(e){return e.status===`pending`}function qt(e){let{scope:t,environments:n,connectedEnvironments:r}=lt(),i=Ee(e.environmentId,b),a=t.kind===`project`||t.kind===`checkout`,o=ke(Te.updateSettings,{reportFailure:!1}),[s,c]=(0,$.useState)(null),[l,u]=(0,$.useState)(null),[d,f]=(0,$.useState)(!1),p=n.map(e=>({environmentId:e.environmentId,label:e.label,connected:e.connection.phase===`connected`})),{checks:h,testConnection:g}=Ut(p),_=async(t,r=!1,i=t)=>{if(e.environmentId&&!a){f(!0);try{let e=await Promise.allSettled(n.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!De(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?c(null):K.add({type:`error`,title:`Device hosts not saved on all environments`,description:`Could not update ${a.map(e=>e.label).join(`, `)}.`})}finally{f(!1)}}};return(0,Q.jsx)(Y,{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)(N,{size:`sm`,variant:`outline`,disabled:!i||a||d||!e.environmentId||s!==null,onClick:()=>{u(null),c({kind:`ssh`,id:ee(),label:``,target:``})},children:[(0,Q.jsx)(m,{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||d,checks:h,testConnection:async e=>{let t=await g(e);if(!t)return;let n=p.filter(e=>t[e.environmentId]?.status===`failed`);return K.add({type:n.length?`error`:`success`,title:n.length?`${e.label}: ${n.length} of ${p.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=>{u(e),c(e)},onRemove:e=>void _(e,!0)})]},e.environmentId)),s?(0,Q.jsx)(Wt,{host:s,isNew:l===null,targets:p,busy:d,onSave:e=>void _(e,!1,l??e),onClose:()=>c(null)},s.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:c,checks:l,testConnection:u}=e,{state:d}=Ue(r),f=ke(We.list),[p,m]=(0,$.useState)(null),h;t[0]===i.length?h=t[1]:(h=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]=h);let g;if(t[2]!==a||t[3]!==l||t[4]!==r||t[5]!==n||t[6]!==i||t[7]!==o||t[8]!==c||t[9]!==f||t[10]!==p||t[11]!==d||t[12]!==u){let e;t[14]!==a||t[15]!==l||t[16]!==r||t[17]!==n||t[18]!==o||t[19]!==c||t[20]!==f||t[21]!==p||t[22]!==d||t[23]!==u?(e=e=>{let t=d.hostStatuses[e.id],i=l[Vt(e)]?.[r],h=(i?.status===`connected`?i.platforms:void 0)??d.hosts.find(t=>t.id===e.id)?.platforms??[],g=i?.status===`pending`?`Checking connection…`:t?.status===`installing`?`Installing device support…`:t?.status===`starting`?`Connecting…`:null,_=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}),h.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:d.hosts.find(t=>t.id===e.id)?.toolInspectionError,tools:d.hosts.find(t=>t.id===e.id)?.tools??(i?.status===`connected`?i.tools:void 0)}),i?.status===`local`?(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Already available locally`}):null,_?(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:_})]})}):null]}),g?(0,Q.jsxs)(`span`,{role:`status`,className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(ve,{size:`xs`}),g]}):null,(0,Q.jsxs)(D,{children:[(0,Q.jsx)(V,{render:(0,Q.jsx)(N,{size:`icon-sm`,variant:`ghost-muted`,disabled:a,"aria-label":e.label+` options`}),children:(0,Q.jsx)(w,{})}),(0,Q.jsxs)(oe,{align:`end`,children:[(0,Q.jsx)(s,{onClick:()=>{o(e)},children:`Edit`}),(0,Q.jsx)(s,{variant:`destructive`,onClick:()=>c(e),children:`Remove`})]})]}),t?.status===`failed`&&d.supportsHostRetry&&d.hostStatus!==`disabled`?(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:a||p!==null,onClick:()=>{m(e.id),f({environmentId:r,input:{retryHostId:e.id}}).finally(()=>m(null))},children:p===e.id?`Retrying…`:`Retry`}):(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:a||g!==null,onClick:()=>void u(e),children:`Test connection`})]},e.id)},t[14]=a,t[15]=l,t[16]=r,t[17]=n,t[18]=o,t[19]=c,t[20]=f,t[21]=p,t[22]=d,t[23]=u,t[24]=e):e=t[24],g=i.map(e),t[2]=a,t[3]=l,t[4]=r,t[5]=n,t[6]=i,t[7]=o,t[8]=c,t[9]=f,t[10]=p,t[11]=d,t[12]=u,t[13]=g}else g=t[13];let _;return t[25]!==h||t[26]!==g?(_=(0,Q.jsxs)(Q.Fragment,{children:[h,g]}),t[25]=h,t[26]=g,t[27]=_):_=t[27],_}function Yt(e){return(0,Q.jsxs)(Ne,{children:[(0,Q.jsx)(je,{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)($e,{className:`size-3.5 -translate-y-px`}):(0,Q.jsx)(et,{className:`size-3.5`})}),(0,Q.jsx)(Me,{children:e.platform===`ios`?`iOS available`:`Android available`})]},e.platform)}function Xt(e){return e.available}var Zt=j(se),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=k(e);return t instanceof Error?t.message:String(t)};function an(e){let t=(0,Z.c)(24),{scope:n,connectedEnvironments:r}=lt(),o=Ee(e.environmentId,b),s=n.kind===`project`||n.kind===`checkout`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[0]=c):c=t[0];let l=ke(Te.updateSettings,c),u;t[1]===e.environmentId?u=t[2]:(u=t=>t.environmentId===e.environmentId,t[1]=e.environmentId,t[2]=u);let d=r.find(u)?.serverConfig?.settings.easDeviceHosts??[],[f,p]=(0,$.useState)(null),[m,h]=(0,$.useState)(!1),g=!o||s||m||!e.environmentId,_=async(t,n)=>{if(!e.environmentId||!De(e.environmentId,`settings:write`))return;h(!0);let r=await l({environmentId:e.environmentId,input:{patch:{easDeviceHosts:$t(d,t,n)}}});h(!1),r._tag===`Success`?p(null):K.add({type:`error`,title:n?`EAS host not removed`:`EAS host not saved`,description:rn(r.cause)})},v=Y,y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=[`easDeviceHosts`],t[3]=y):y=t[3];let x=g||f!==null,S;t[4]===p?S=t[5]:(S=()=>p({host:Qt(ee()),isNew:!0}),t[4]=p,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)(N,{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=d.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:d.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)(N,{size:`sm`,variant:`ghost`,disabled:g,onClick:()=>p({host:e,isNew:!1}),children:`Edit`}),(0,Q.jsx)(N,{size:`sm`,variant:`ghost-destructive`,disabled:g,onClick:()=>void _(e,!0),children:`Remove`})]})]},e.id))}),E;t[10]!==m||t[11]!==f||t[12]!==e.environmentId||t[13]!==_||t[14]!==p?(E=f&&e.environmentId?(0,Q.jsx)(on,{environmentId:e.environmentId,host:f.host,isNew:f.isNew,busy:m,onSave:e=>void _(e,!1),onClose:()=>p(null)},f.host.id):null,t[10]=m,t[11]=f,t[12]=e.environmentId,t[13]=_,t[14]=p,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]!==v||t[20]!==w||t[21]!==D||t[22]!==y?(O=(0,Q.jsx)(v,{id:`eas-device-hosts`,title:`EAS Simulator`,serverScoped:!0,settingKeys:y,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]=v,t[20]=w,t[21]=D,t[22]=y,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=ke(We.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=I(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 j;t[28]!==i||t[29]!==e.busy?(j=(t,n,r)=>(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,Q.jsx)(`span`,{children:n}),(0,Q.jsx)(Pe,{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]=j):j=t[30];let M=j,P;t[31]===e?P=t[32]:(P=t=>{!t&&!e.busy&&e.onClose()},t[31]=e,t[32]=P);let F=!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 ee=e.isNew?`Add EAS host`:`Edit EAS host`,R;t[37]===ee?R=t[38]:(R=(0,Q.jsx)(Ie,{children:ee}),t[37]=ee,t[38]=R);let z;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(Be,{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]=z):z=t[39];let te;t[40]===R?te=t[41]:(te=(0,Q.jsxs)(Fe,{children:[R,z]}),t[40]=R,t[41]=te);let ne;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(`span`,{children:`Name`}),t[42]=ne):ne=t[42];let re;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(re=e=>{let t=e.target.value;a(e=>({...e,label:t}))},t[43]=re):re=t[43];let ie;t[44]!==i.label||t[45]!==e.busy?(ie=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[ne,(0,Q.jsx)(Pe,{autoFocus:!0,required:!0,value:i.label,disabled:e.busy,onChange:re})]}),t[44]=i.label,t[45]=e.busy,t[46]=ie):ie=t[46];let ae;t[47]===s?ae=t[48]:(ae=(0,Q.jsx)(`label`,{htmlFor:s,className:`block`,children:`Expo access token`}),t[47]=s,t[48]=ae);let B=l.kind===`saved`,oe=l.kind===`new`?l.value:``,V;t[49]===e.host.accessToken?V=t[50]:(V=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]=V);let se;t[51]!==e.busy||t[52]!==B||t[53]!==oe||t[54]!==V||t[55]!==s?(se=(0,Q.jsx)(At,{id:s,className:`min-w-0 flex-1`,configured:B,value:oe,disabled:e.busy,placeholder:`Optional`,onChange:V}),t[51]=e.busy,t[52]=B,t[53]=oe,t[54]=V,t[55]=s,t[56]=se):se=t[56];let H;t[57]===l.kind?H=t[58]:(H=l.kind===`cleared`?null:(0,Q.jsx)(N,{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]=H);let ce;t[59]!==se||t[60]!==H?(ce=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[se,H]}),t[59]=se,t[60]=H,t[61]=ce):ce=t[61];let le;t[62]!==ae||t[63]!==ce?(le=(0,Q.jsxs)(`div`,{className:`space-y-1.5 text-sm`,children:[ae,ce]}),t[62]=ae,t[63]=ce,t[64]=le):le=t[64];let ue=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.`,U;t[65]===ue?U=t[66]:(U=(0,Q.jsx)(`p`,{role:`status`,className:`min-w-0 text-xs text-muted-foreground`,children:ue}),t[65]=ue,t[66]=U);let de=e.busy||f.status===`checking`,W;t[67]===E?W=t[68]:(W=()=>void E(),t[67]=E,t[68]=W);let pe;t[69]===f.status?pe=t[70]:(pe=f.status===`checking`?(0,Q.jsx)(ve,{size:`xs`}):null,t[69]=f.status,t[70]=pe);let he;t[71]!==de||t[72]!==W||t[73]!==pe?(he=(0,Q.jsxs)(N,{type:`button`,size:`sm`,variant:`outline`,disabled:de,onClick:W,children:[pe,` Check account`]}),t[71]=de,t[72]=W,t[73]=pe,t[74]=he):he=t[74];let K;t[75]!==U||t[76]!==he?(K=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2.5`,children:[U,he]}),t[75]=U,t[76]=he,t[77]=K):K=t[77];let ye;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,Q.jsx)(`span`,{children:`EAS project`}),t[78]=ye):ye=t[78];let be=i.appId??tn,xe=e.busy,Se;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(Se=e=>{typeof e==`string`&&a(t=>{let{appId:n,...r}=t;return e===tn?r:{...r,appId:e}})},t[79]=Se):Se=t[79];let Ce;t[80]===y?Ce=t[81]:(Ce=(0,Q.jsx)(ge,{size:`sm`,"aria-label":`EAS project`,children:(0,Q.jsx)(fe,{children:e=>e===tn?`From the thread's project`:y.find(t=>t.id===e)?.fullName??e})}),t[80]=y,t[81]=Ce);let we;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,Q.jsx)(G,{value:tn,children:`From the thread's project`}),t[82]=we):we=t[82];let q;t[83]!==y||t[84]!==i.appId?(q=i.appId&&!y.some(e=>e.id===i.appId)?(0,Q.jsx)(G,{value:i.appId,children:i.appId}):null,t[83]=y,t[84]=i.appId,t[85]=q):q=t[85];let J;t[86]===y?J=t[87]:(J=y.map(sn),t[86]=y,t[87]=J);let Te;t[88]!==q||t[89]!==J?(Te=(0,Q.jsxs)(me,{children:[we,q,J]}),t[88]=q,t[89]=J,t[90]=Te):Te=t[90];let Ee;t[91]!==e.busy||t[92]!==be||t[93]!==Ce||t[94]!==Te?(Ee=(0,Q.jsxs)(_e,{value:be,disabled:xe,onValueChange:Se,children:[Ce,Te]}),t[91]=e.busy,t[92]=be,t[93]=Ce,t[94]=Te,t[95]=Ee):Ee=t[95];let De;t[96]===Symbol.for(`react.memo_cache_sentinel`)?(De=(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]=De):De=t[96];let Oe;t[97]===Ee?Oe=t[98]:(Oe=(0,Q.jsxs)(`div`,{className:`space-y-1.5 text-sm`,children:[ye,Ee,De]}),t[97]=Ee,t[98]=Oe);let Ae;t[99]===M?Ae=t[100]:(Ae=(0,Q.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 text-sm`,children:[M(`maxConcurrentSessions`,`Sessions at once`,20),M(`maxSessionMinutes`,`Session minutes`,115),M(`idleMinutes`,`Idle minutes`,60)]}),t[99]=M,t[100]=Ae);let je=e.isNew?null:` Saving restarts this host, which stops its running sessions.`,Me;t[101]===je?Me=t[102]:(Me=(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.`,je]}),t[101]=je,t[102]=Me);let Ne;t[103]===_?Ne=t[104]:(Ne=_===null?null:(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:_}),t[103]=_,t[104]=Ne);let Re;t[105]!==ie||t[106]!==le||t[107]!==K||t[108]!==Oe||t[109]!==Ae||t[110]!==Me||t[111]!==Ne?(Re=(0,Q.jsxs)(ze,{children:[ie,le,K,Oe,Ae,Me,Ne]}),t[105]=ie,t[106]=le,t[107]=K,t[108]=Oe,t[109]=Ae,t[110]=Me,t[111]=Ne,t[112]=Re):Re=t[112];let Ue;t[113]!==e.busy||t[114]!==e.onClose?(Ue=(0,Q.jsx)(N,{type:`button`,variant:`ghost`,disabled:e.busy,onClick:e.onClose,children:`Cancel`}),t[113]=e.busy,t[114]=e.onClose,t[115]=Ue):Ue=t[115];let Ge=e.busy||!g,Ke;t[116]===e.busy?Ke=t[117]:(Ke=e.busy?(0,Q.jsx)(ve,{size:`xs`}):null,t[116]=e.busy,t[117]=Ke);let qe;t[118]!==Ge||t[119]!==Ke?(qe=(0,Q.jsxs)(N,{type:`submit`,disabled:Ge,children:[Ke,` Save host`]}),t[118]=Ge,t[119]=Ke,t[120]=qe):qe=t[120];let Je;t[121]!==Ue||t[122]!==qe?(Je=(0,Q.jsxs)(Le,{children:[Ue,qe]}),t[121]=Ue,t[122]=qe,t[123]=Je):Je=t[123];let Ye;t[124]!==L||t[125]!==te||t[126]!==Re||t[127]!==Je?(Ye=(0,Q.jsxs)(`form`,{className:`flex min-h-0 flex-col`,onSubmit:L,children:[te,Re,Je]}),t[124]=L,t[125]=te,t[126]=Re,t[127]=Je,t[128]=Ye):Ye=t[128];let Xe;t[129]!==F||t[130]!==Ye?(Xe=(0,Q.jsx)(Ve,{showCloseButton:F,children:Ye}),t[129]=F,t[130]=Ye,t[131]=Xe):Xe=t[131];let Ze;return t[132]!==P||t[133]!==Xe?(Ze=(0,Q.jsx)(He,{open:!0,onOpenChange:P,children:Xe}),t[132]=P,t[133]=Xe,t[134]=Ze):Ze=t[134],Ze}function sn(e){return(0,Q.jsx)(G,{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=ee(),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)(Ve,{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)(He,{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)(Fe,{children:[(0,Q.jsxs)(Ie,{children:[`Quit `,n.name,` to import`]}),(0,Q.jsxs)(Be,{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)(N,{variant:`outline`,onClick:r,children:`Cancel`}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(N,{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)(Le,{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,[l,u]=(0,$.useState)(!1),[d,f]=(0,$.useState)(null),p;t[0]===s?p=t[1]:(p=async()=>({fullDiskAccess:await s()}),t[0]=s,t[1]=p);let m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m={fullDiskAccess:!1},t[2]=m):m=t[2];let h=Nt(p,m),g;t[3]!==i||t[4]!==l?(g=()=>{l||(u(!0),f(null),Promise.resolve().then(i).catch(()=>f(`Could not open System Settings. Try Allow again.`)).finally(()=>u(!1)))},t[3]=i,t[4]=l,t[5]=g):g=t[5];let _=g,v;t[6]===n.name?v=t[7]:(v=(0,Q.jsxs)(Fe,{children:[(0,Q.jsxs)(Ie,{children:[`Let P4 Code read `,n.name,`’s cookies`]}),(0,Q.jsxs)(Be,{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]=v);let y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(c,{className:`size-8 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),t[8]=y):y=t[8];let b=`Read ${n.name}'s cookies for this import.`,x;t[9]===_?x=t[10]:(x=()=>void _(),t[9]=_,t[10]=x);let S;t[11]!==h.status.fullDiskAccess||t[12]!==b||t[13]!==x?(S=[{id:`fullDiskAccess`,icon:y,title:`Full Disk Access`,description:b,granted:h.status.fullDiskAccess,onAllow:x}],t[11]=h.status.fullDiskAccess,t[12]=b,t[13]=x,t[14]=S):S=t[14];let C;t[15]!==l||t[16]!==S?(C=(0,Q.jsx)(jt,{busy:l,permissions:S}),t[15]=l,t[16]=S,t[17]=C):C=t[17];let w;t[18]!==d||t[19]!==h.error?(w=d||h.error?(0,Q.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-muted-foreground`,children:d??h.error}):null,t[18]=d,t[19]=h.error,t[20]=w):w=t[20];let T;t[21]!==h||t[22]!==o?(T=h.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]=h,t[22]=o,t[23]=T):T=t[23];let E;t[24]!==w||t[25]!==T||t[26]!==C?(E=(0,Q.jsxs)(ze,{children:[C,w,T]}),t[24]=w,t[25]=T,t[26]=C,t[27]=E):E=t[27];let D;t[28]===r?D=t[29]:(D=(0,Q.jsx)(N,{variant:`outline`,onClick:r,children:`Cancel`}),t[28]=r,t[29]=D);let O;t[30]===h?O=t[31]:(O=h.isReady([`fullDiskAccess`]),t[30]=h,t[31]=O);let k;t[32]!==a||t[33]!==l||t[34]!==O?(k=(0,Q.jsx)(Mt,{ready:O,busy:l,onClick:a,children:`Continue`}),t[32]=a,t[33]=l,t[34]=O,t[35]=k):k=t[35];let A;t[36]!==D||t[37]!==k?(A=(0,Q.jsxs)(Le,{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]!==v?(j=(0,Q.jsxs)(Q.Fragment,{children:[v,E,A]}),t[39]=E,t[40]=A,t[41]=v,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)(Ie,{children:[`Import from `,n.name]}),t[4]=n.name,t[5]=_);let v;t[6]===r?v=t[7]:(v=(0,Q.jsxs)(Be,{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)(Fe,{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)(re,{className:`size-4 sm:hidden`}),(0,Q.jsx)(te,{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)(ze,{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)(N,{variant:`outline`,onClick:d,children:`Cancel`}),t[47]=d,t[48]=j);let M=o===``||m||h,P;t[49]!==f||t[50]!==M?(P=(0,Q.jsx)(N,{disabled:M,onClick:f,children:`Import`}),t[49]=f,t[50]=M,t[51]=P):P=t[51];let F;t[52]!==j||t[53]!==P?(F=(0,Q.jsxs)(Le,{children:[j,P]}),t[52]=j,t[53]=P,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=B(`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=B(`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)(_,{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)(Fe,{children:[(0,Q.jsx)(Ie,{children:`Importing cookies`}),(0,Q.jsx)(Be,{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)(ze,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,Q.jsx)(ve,{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)(Ie,{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)(Be,{children:a}),t[2]=a,t[3]=o);let s;t[4]!==i||t[5]!==o?(s=(0,Q.jsxs)(Fe,{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)(ve,{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)(ze,{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)(Ie,{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)(Be,{children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Q.jsxs)(Fe,{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)(ze,{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)(N,{}),t[17]=m):m=t[17];let h;t[18]===s?h=t[19]:(h=(0,Q.jsx)(Le,{children:(0,Q.jsx)(Re,{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)(Ie,{children:[`Couldn’t import from `,n.name]}),t[0]=n.name,t[1]=o);let s=ae[r],c;t[2]===s?c=t[3]:(c=(0,Q.jsx)(Be,{children:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c?(l=(0,Q.jsxs)(Fe,{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)(N,{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)(N,{onClick:a,children:`Try again`}):null,t[9]=a,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,Q.jsxs)(Le,{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 L.literals.find(e=>t.includes(`failed: ${e}.`))??`readFailed`},zn=e=>e._tag===`fill`?kn:e._tag===`preset`&>.some(t=>t.id===e.presetId)?e.presetId:An,Bn=e=>{let t=zn(e);return t===kn?`Fill panel`:t===An?`Responsive`:gt.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=q(Gn),i=J(),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 u=c,d;t[3]!==a?.height||t[4]!==a?.width||t[5]!==i?(d=e=>{if(e===kn){i({browserDefaultViewport:v});return}if(e===An){i({browserDefaultViewport:{_tag:`freeform`,width:a?.width??Nn.width,height:a?.height??Nn.height}});return}let t=gt.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]=d):d=t[6];let f=d,p;t[7]!==u||t[8]!==a||t[9]!==i?(p=(e,t)=>{if(t===null||!Vn(t))return;let n={...u,[e]:t};n.width*n.height>8294400||a&&n.width===a.width&&n.height===a.height||i({browserDefaultViewport:{_tag:`freeform`,...n}})},t[7]=u,t[8]=a,t[9]=i,t[10]=p):p=t[10];let m=p,h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=X(`browser-default-viewport`),t[11]=h):h=t[11];let _;t[12]!==n||t[13]!==i||t[14]!==r._tag?(_=!n&&r._tag!==l._tag?(0,Q.jsx)(ft,{label:`default browser viewport`,onClick:()=>i({browserDefaultViewport:l})}):null,t[12]=n,t[13]=i,t[14]=r._tag,t[15]=_):_=t[15];let y;t[16]===r?y=t[17]:(y=zn(r),t[16]=r,t[17]=y);let b;t[18]===r?b=t[19]:(b=Bn(r),t[18]=r,t[19]=b);let x;t[20]===b?x=t[21]:(x=(0,Q.jsx)(ge,{size:`sm`,className:`w-full min-w-0 sm:w-44`,"aria-label":`Default browser viewport`,children:(0,Q.jsx)(fe,{children:b})}),t[20]=b,t[21]=x);let S,C;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(G,{value:kn,children:`Fill panel`}),C=(0,Q.jsx)(G,{value:An,children:`Responsive`}),t[22]=S,t[23]=C):(S=t[22],C=t[23]);let w;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsxs)(me,{align:`end`,alignItemWithTrigger:!1,children:[S,C,(0,Q.jsxs)(he,{children:[(0,Q.jsx)(pe,{children:`Standard`}),gt.map(Wn)]})]}),t[24]=w):w=t[24];let T;t[25]!==n||t[26]!==f||t[27]!==x||t[28]!==y?(T=(0,Q.jsxs)(_e,{value:y,onValueChange:f,disabled:n,children:[x,w]}),t[25]=n,t[26]=f,t[27]=x,t[28]=y,t[29]=T):T=t[29];let E;t[30]!==m||t[31]!==n||t[32]!==u||t[33]!==a||t[34]!==i?(E=a?(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(W,{value:u.width,min:240,max:g,disabled:n,format:Pn,size:`sm`,className:`w-20`,onValueCommitted:e=>m(`width`,e),children:(0,Q.jsx)(de,{children:(0,Q.jsx)(U,{"aria-label":`Default viewport width`})})}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`×`}),(0,Q.jsx)(W,{value:u.height,min:240,max:g,disabled:n,format:Pn,size:`sm`,className:`w-20`,onValueCommitted:e=>m(`height`,e),children:(0,Q.jsx)(de,{children:(0,Q.jsx)(U,{"aria-label":`Default viewport height`})})}),(0,Q.jsxs)(Ne,{children:[(0,Q.jsx)(je,{render:(0,Q.jsx)(N,{size:`icon-sm`,variant:`ghost-muted`,disabled:n,"aria-label":`Rotate to ${u.height>=u.width?`landscape`:`portrait`}`,onClick:()=>i({browserDefaultViewport:Hn(a)}),children:(0,Q.jsx)(Et,{})})}),(0,Q.jsx)(Me,{side:`top`,children:`Rotate`})]})]}):null,t[30]=m,t[31]=n,t[32]=u,t[33]=a,t[34]=i,t[35]=E):E=t[35];let D;t[36]!==T||t[37]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto`,children:[T,E]}),t[36]=T,t[37]=E,t[38]=D):D=t[38];let O;return t[39]!==D||t[40]!==_?(O=(0,Q.jsx)(Y,{...h,description:`Tab size for you and agents. Fill fits the panel; other sizes show the device toolbar.`,resetAction:_,control:D}),t[39]=D,t[40]=_,t[41]=O):O=t[41],O}function Wn(e){return(0,Q.jsx)(G,{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=q(Jn),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`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)(ft,{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=y.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)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser zoom`,children:(0,Q.jsx)(fe,{children:l})}),t[9]=l,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(me,{align:`end`,alignItemWithTrigger:!1,children:y.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)(_e,{disabled:n,value:s,onValueChange:c,children:[u,d]}),t[12]=n,t[13]=s,t[14]=c,t[15]=u,t[16]=f):f=t[16];let p;return t[17]!==o||t[18]!==f?(p=(0,Q.jsx)(Y,{...a,description:`Page zoom applied to new browser tabs.`,resetAction:o,control:f}),t[17]=o,t[18]=f,t[19]=p):p=t[19],p}function qn(e){return(0,Q.jsx)(G,{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=q(Zn),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`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)(ft,{label:`default browser appearance`,onClick:()=>i({browserDefaultAppearance:u})}):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)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser appearance`,children:(0,Q.jsx)(fe,{children:c})}),t[7]=c,t[8]=l);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(me,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(Fn).map(Xn)}),t[9]=d):d=t[9];let f;t[10]!==r||t[11]!==n||t[12]!==s||t[13]!==l?(f=(0,Q.jsxs)(_e,{disabled:n,value:r,onValueChange:s,children:[l,d]}),t[10]=r,t[11]=n,t[12]=s,t[13]=l,t[14]=f):f=t[14];let p;return t[15]!==o||t[16]!==f?(p=(0,Q.jsx)(Y,{...a,description:`The color scheme pages are told to prefer. System follows your OS setting.`,resetAction:o,control:f}),t[15]=o,t[16]=f,t[17]=p):p=t[17],p}function Xn(e){let[t,n]=e;return(0,Q.jsx)(G,{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=q(er),i=q($n),a=J(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=X(`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)(Y,{...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=X(`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)(Y,{...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=q(rr),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`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)(ft,{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=P.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)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Browser recording frame rate`,children:(0,Q.jsxs)(fe,{children:[r,` fps`]})}),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(me,{align:`end`,alignItemWithTrigger:!1,children:P.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)(_e,{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)(Y,{...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)(G,{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=q(sr),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`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)(ft,{label:`link target`,onClick:()=>i({browserLinkTarget:H})}):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)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Open links in`,children:(0,Q.jsx)(fe,{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)(me,{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)(_e,{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)(Y,{...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)(G,{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=q(fr),n=q(dr),r=J(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=X(`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)(ft,{label:`search engine`,onClick:()=>r({browserSearchEngine:S,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=R.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)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Search engine`,children:(0,Q.jsx)(fe,{children:s})}),e[7]=s,e[8]=c);let l;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(me,{align:`end`,alignItemWithTrigger:!1,children:R.literals.map(ur)}),e[9]=l):l=e[9];let u;e[10]!==t||e[11]!==o||e[12]!==c?(u=(0,Q.jsxs)(_e,{value:t,onValueChange:o,children:[c,l]}),e[10]=t,e[11]=o,e[12]=c,e[13]=u):u=e[13];let d;e[14]!==a||e[15]!==u?(d=(0,Q.jsx)(Y,{...i,description:`What the address bar searches when you type something that isn't a URL.`,resetAction:a,control:u}),e[14]=a,e[15]=u,e[16]=d):d=e[16];let f;e[17]!==n||e[18]!==t||e[19]!==r?(f=t===`custom`?(0,Q.jsx)(Y,{title:`Custom search URL`,description:`Use %s where the search terms go.`,status:nt(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:M,value:n,onCommit:e=>r({browserCustomSearchUrl:e.trim()})})}):null,e[17]=n,e[18]=t,e[19]=r,e[20]=f):f=e[20];let p;return e[21]!==d||e[22]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[d,f]}),e[21]=d,e[22]=f,e[23]=p):p=e[23],p}function ur(e){return(0,Q.jsx)(G,{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=q(mr),n=J(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=X(`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)(ft,{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)(Y,{...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}=lt(),r=st(),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)(pt,{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=Ee(e,b),{state:i,loaded:a}=Ue(e),{scope:o,environments:s,connectedEnvironments:c}=lt(),l=ct(),u=o.kind===`project`||o.kind===`checkout`,d=c.some(e=>e.serverConfig?.settings.enableDeviceSupport),f=ke(We.configure,{reportFailure:!1}),p=ke(We.list,{reportFailure:!1}),[m,h]=(0,$.useState)(null),g=i.hostStatus===`installing`||i.hostStatus===`starting`,_=i.hosts.some(e=>e.kind===`local`&&!e.platforms.some(e=>e.available)),[v,y]=(0,$.useState)(!1);v&&!t&&y(!1),t&&!v&&(i.hostStatus===`ready`||_)&&m!==`hub`&&y(!0);let x=async(t,n)=>{if(e&&De(e,`settings:write`)){h(t);try{let e=await Promise.allSettled(s.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!De(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return f({environmentId:e.environmentId,input:{...n,...n.enabled?{onboardingCompleted:!0}:{}}})})),t=s.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});t.length>0&&K.add({type:`error`,title:`Device settings not saved on all environments`,description:`Could not update ${t.map(e=>e.label).join(`, `)}.`})}finally{h(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),h(`update-${t}`),p({environmentId:e,input:{updateTool:t}}).then(e=>{if(e._tag===`Failure`){let r=Oe(e.cause);C({tool:t,message:r}),n&&K.add({type:`error`,title:r})}}).finally(()=>h(null)))},D=t=>{e&&(h(t),p({environmentId:e,input:{inspectOnly:!0}}).finally(()=>h(null)))},O=t=>{let n=T(t);if(!n&&!i.supportsToolInspection)return null;let r=m===`update-${t}`||m===`check-${t}`,a=n?`Update to v${w?.[t].requiredVersion}`:`Check ${t===`hub`?`device hub`:`agent device`} version`;return(0,Q.jsxs)(Ne,{children:[(0,Q.jsx)(je,{render:(0,Q.jsx)(N,{size:`icon-xs`,variant:`ghost-muted`,disabled:!e||m!==null||g,"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)(ie,{"aria-hidden":!0})}),(0,Q.jsx)(`span`,{className:n&&!r?`scale-75 opacity-0`:void 0,children:(0,Q.jsx)(xt,{refreshing:r})})]})}),(0,Q.jsx)(Me,{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)(N,{size:`sm`,disabled:!e||m!==null||g,onClick:()=>E(t),children:m===`update-${t}`?`Updating…`:`Update to v${n.requiredVersion}`}):null,i.supportsToolInspection?(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:!e||m!==null||g,onClick:()=>D(`check`),children:m===`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)(Y,{...X(`device-hub`),serverScoped:!0,settingKeys:[`enableDeviceSupport`],description:Ye,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`),m===`hub`?(0,Q.jsx)(Je,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(kt,{settingKeys:[`enableDeviceSupport`],checked:t,disabled:!r||u||!a||!e||g||m!==null,"aria-label":`Device hub`,onCheckedChange:e=>void x(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]})}),(0,Q.jsx)(Qe,{children:v?(0,Q.jsx)(Y,{...X(`device-platform-support`),description:c.length>1?`Status for ${c.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)(Ke,{compact:!0,platform:`iOS`,status:qe(i,`ios`)}),(0,Q.jsx)(Ke,{compact:!0,platform:`Android`,status:qe(i,`android`)})]}),control:(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:!e||!t||g||m!==null,onClick:()=>{e&&(h(`check`),p({environmentId:e,input:{}}).finally(()=>h(null)))},children:m===`check`?`Checking…`:`Refresh`})}):null}),(0,Q.jsx)(Y,{...X(`agent-device-access`),serverScoped:!0,settingKeys:[`enableAgentDeviceAccess`],description:Ge,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`),m===`agent`?(0,Q.jsx)(Xe,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(kt,{settingKeys:[`enableAgentDeviceAccess`],checked:n,disabled:!r||c.length===0||!u&&(!a||!d||g)||m!==null,"aria-label":`Agent device access`,onCheckedChange:e=>u?l({enableAgentDeviceAccess:!!e}):void x(`agent`,{agentAccessEnabled:!!e})})]})}),e?(0,Q.jsx)(Ze,{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=q(vr),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`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)(ft,{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)(Y,{...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=q(e=>e.browserProfiles),n=q(e=>e.browserDefaultProfileId),r=Se(),i=J(),{environments:a,isReady:o}=be(),c=ye(),[l,u]=(0,$.useState)(null),[h,g]=(0,$.useState)(null),[_,v]=(0,$.useState)(null),[y,b]=(0,$.useState)(null),[S,C]=(0,$.useState)(null),[T,k]=(0,$.useState)(!1),j=ue(),M=ke(tt.clearProfile,{reportFailure:!1}),P={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 le(n)}},F=Mn(wt!==null,o,a.length,P.environmentIds.length),I=(0,$.useRef)(!1),[L,R]=(0,$.useState)(!1),z=e||!r,te=E(t).filter(e=>e.kind!==`incognito`),re=ne(te,n)?.id??`default`,ie=e=>{if(!r||I.current)return;let t=we().browserProfiles;if(t.length>=24)return;let n=E(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-${ee()}`,name:o,kind:`persistent`};return i({browserProfiles:[...t,s]}),s},ae=(e,t)=>{if(!r||I.current)return;let n=t.trim().slice(0,48);if(n===``)return;let a=we().browserProfiles;i({browserProfiles:a.map(t=>t.id===e?{...t,name:n}:t)})},se=(e,t)=>{if(r&&!I.current){if(!F){K.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,P).then(()=>{K.add({type:`success`,title:`Cleared ${t}'s cookies and cache`})}).catch(()=>{K.add({type:`error`,title:`Could not clear ${t}'s data`})})}},H=async e=>{if(!r||I.current)return;if(!F){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,P)}catch{C(`Profile data could not be deleted. Try again.`),k(!1);return}let t=we();i({browserProfiles:t.browserProfiles.filter(t=>t.id!==e),...t.browserDefaultProfileId===e?{browserDefaultProfileId:d}:{}}),k(!1),v(null)},ce=(l??[]).filter(e=>e.unavailable!==`notInstalled`&&e.unavailable!==`unsupportedPlatform`),U=(0,$.useCallback)(()=>{wt&&wt.listBrowserImportSources().then(u).catch(()=>u(e=>e??[]))},[]),de=async(e,t,n)=>{if(!wt||!r)return{kind:`blocked`,reason:`sessionUnavailable`};if(n.target.kind===`existing`&&!E(we().browserProfiles).some(e=>e.id===n.target.profileId)||I.current)return{kind:`blocked`,reason:`readFailed`};I.current=!0,R(!0);try{let r=await wt.importBrowserCookies({environmentId:t,sourceId:e.id,sourceProfileDirectory:n.sourceProfileDirectory,targetProfileId:n.target.profileId});if(n.target.kind===`existing`&&!E(we().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 Ce(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(E(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{I.current=!1,R(!1)}},W=async e=>{if(wt)try{let t=await wt.listBrowserImportSources();return u(t),t.find(t=>t.id===e)}catch{return}},G=t.length>=24;return(0,Q.jsxs)(Y,{...X(`browser-profiles`),description:`Profiles separate cookies and logins. Incognito data is cleared when the app closes.`,control:(0,Q.jsxs)(D,{onOpenChange:e=>e&&U(),children:[(0,Q.jsxs)(V,{render:(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:z||L}),children:[(0,Q.jsx)(m,{}),`Add profile`]}),(0,Q.jsxs)(oe,{align:`end`,children:[(0,Q.jsx)(s,{disabled:!r||G,onClick:()=>ie(`New profile`),children:`Blank profile`}),G?(0,Q.jsx)(s,{disabled:!0,children:`You’ve reached the profile limit`}):null,(0,Q.jsx)(A,{}),(0,Q.jsxs)(O,{children:[(0,Q.jsx)(x,{children:`Import from`}),l===null?(0,Q.jsx)(s,{disabled:!0,children:`Looking for browsers…`}):ce.length===0?(0,Q.jsx)(s,{disabled:!0,children:`No supported browsers found`}):(0,Q.jsxs)(Q.Fragment,{children:[ce.map(e=>(0,Q.jsx)(s,{disabled:!r||c==null,onClick:()=>{r&&c!=null&&g({source:e,environmentId:c.environmentId,environmentName:mt({isPrimary:!0,environmentId:c.environmentId,runtimeLabel:c.label})})},children:e.name},e.id)),c==null?(0,Q.jsx)(s,{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:te.map((e,t)=>{let n=f(e.id),a=e.id===re;return(0,Q.jsxs)(`div`,{className:B(`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:B(`truncate text-sm text-foreground`,z&&`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:z||L,maxLength:48,value:e.name,onCommit:t=>ae(e.id,t)}),a?(0,Q.jsx)(`span`,{className:B(`flex`,z&&`opacity-64`),children:(0,Q.jsx)(p,{children:`Default`})}):null]}),(0,Q.jsxs)(D,{children:[(0,Q.jsx)(V,{render:(0,Q.jsx)(N,{size:`icon-xs`,variant:`ghost-muted`,disabled:z||L,"aria-label":`${e.name} options`}),children:(0,Q.jsx)(w,{})}),(0,Q.jsxs)(oe,{align:`end`,children:[(0,Q.jsx)(s,{disabled:!r||a,onClick:()=>{r&&i({browserDefaultProfileId:e.id})},children:`Set as default`}),(0,Q.jsx)(s,{disabled:!r||!F,onClick:()=>{P.environmentIds.length>0?b(e):se(e.id,e.name)},children:`Clear cookies and cache`}),n?null:(0,Q.jsx)(s,{variant:`destructive`,disabled:!r||!F,onClick:()=>{r&&v(e)},children:`Remove profile and data`}),F?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(A,{}),(0,Q.jsx)(s,{disabled:!0,children:o?`Connect to an environment to clear profile data`:`Checking environments…`})]})]})]})]},e.id)})}),(0,Q.jsx)(ht,{open:_!==null,onOpenChange:e=>{!e&&!T&&(v(null),C(null))},children:(0,Q.jsxs)(_t,{children:[(0,Q.jsxs)(St,{children:[(0,Q.jsxs)(vt,{children:[`Remove “`,_?.name,`”?`]}),(0,Q.jsx)(yt,{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,F?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)(bt,{children:[(0,Q.jsx)(Ct,{disabled:T,render:(0,Q.jsx)(N,{variant:`outline`,disabled:T}),children:`Cancel`}),(0,Q.jsx)(N,{variant:`destructive`,disabled:T||!r||!F,onClick:()=>{_&&r&&F&&H(_.id)},children:T?`Removing…`:`Remove profile`})]})]})}),(0,Q.jsx)(ht,{open:y!==null,onOpenChange:e=>{e||b(null)},children:(0,Q.jsxs)(_t,{children:[(0,Q.jsxs)(St,{children:[(0,Q.jsxs)(vt,{children:[`Clear “`,y?.name,`”’s cookies and cache?`]}),(0,Q.jsx)(yt,{children:`You are signed out of its sites. Server browser tabs open in this profile close now.`})]}),(0,Q.jsxs)(bt,{children:[(0,Q.jsx)(Ct,{render:(0,Q.jsx)(N,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(N,{variant:`destructive`,onClick:()=>{y&&se(y.id,y.name),b(null)},children:`Clear data`})]})]})}),h?(0,Q.jsx)(vn,{source:h.source,destinationEnvironmentName:h.environmentName,targetProfiles:te.map(e=>({id:e.id,name:e.name})),canCreateProfile:r&&!G,onImport:e=>de(h.source,h.environmentId,e),onRefreshSource:()=>W(h.source.id),onCheckFullDiskAccess:window.desktopBridge?.checkSystemPermission?()=>window.desktopBridge.checkSystemPermission(`full-disk-access`):void 0,onOpenFullDiskAccessSettings:async()=>{await xe()?.shell.openSystemSettings(`full-disk-access`).catch(()=>{K.add({type:`error`,title:`Could not open System Settings`,description:`Open Privacy & Security → Full Disk Access manually.`})})},onClose:()=>g(null)}):null]})}function br(){let e=(0,Z.c)(3),t=!Ae,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)(dt,{children:[i,(0,Q.jsxs)(pt,{id:`browser`,title:`Browser`,children:[t?(0,Q.jsx)(ut,{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-Du282Gn7.js.map
|
package/dist/client/assets/{settings.keybindings-BQ-LrcTn.js → settings.keybindings-C0FBNk1_.js}
RENAMED
|
@@ -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{$n as i,Ic as a,Jn as o,Jp as s,K_ as c,Q_ as l,Ud as u,Yn as d,cm as f,df as p,dr as m,if as h,kd as g,nh as _,t as v,tr as y,ur as b,xp as x,zm as S}from"./utils-BE5iQuUP.js";import{R as C,W as w}from"./runtime-DSZ2mWrf.js";import{a as T,c as E,o as D,s as O,t as k}from"./select-C10oXKGz.js";import{t as A}from"./useLocation-FEfJrgGU.js";import{i as j}from"./toast-BFuAqla3.js";import{f as M}from"./server-ztj8tD38.js";import{i as ee,n as N,o as te}from"./session-yxXjF8AQ.js";import{t as P}from"./use-atom-command-CSWaAmR7.js";import{t as ne}from"./env-wK1YYxA8.js";import{a as F,n as I,t as L}from"./tooltip-CSzrAm8M.js";import{t as R}from"./toggle-Cpfo0sMT.js";import{t as re}from"./input-GkmNnHh7.js";import{i as ie}from"./keybindings-1XWkWeQB.js";import{i as ae,o as oe,t as z}from"./popover-BIXQitBy.js";import{n as se,r as ce,t as B}from"./input-group-Cql1yQRL.js";import{n as le,t as ue}from"./kbd-D2OGhJqG.js";import{V as de,W as fe,a as pe,i as me,s as he}from"./settingsLayout-DzBeWTUO.js";import{a as V,c as ge,f as _e,i as ve,l as ye,m as H,n as be,o as xe,p as U,r as Se,s as Ce,t as we,u as Te}from"./KeybindingsSettings.logic-mOtug0lc.js";import{Ta as Ee,ir as De,rr as Oe}from"./main-Dcfxjdkd.js";var W=n(),G=e(t(),1),K=e(r(),1);function q(e){let t=(0,W.c)(6),{value:n}=e,r,i;if(t[0]!==n){let e=new Map,a=n.split(`+`).map(t=>{let n=e.get(t)??0;return e.set(t,n+1),{part:t,key:n===0?t:`${t}-${n}`}});r=le,i=a.map(ke),t[0]=n,t[1]=r,t[2]=i}else r=t[1],i=t[2];let a;return t[3]!==r||t[4]!==i?(a=(0,K.jsx)(r,{children:i}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function ke(e){let{part:t,key:n}=e;return(0,K.jsx)(ue,{children:t===`mod`?navigator.platform.toLowerCase().includes(`mac`)?`⌘`:`Ctrl`:t===`shift`?`⇧`:t===`alt`?navigator.platform.toLowerCase().includes(`mac`)?`⌥`:`Alt`:t===`ctrl`?`⌃`:t.length===1?t.toUpperCase():t},n)}function Ae(e){let t=(0,W.c)(11),{query:n,onChange:r,inputRef:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(se,{children:(0,K.jsx)(f,{"aria-hidden":!0,className:`size-3.5`})}),t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=e=>r(e.currentTarget.value),t[1]=r,t[2]=o);let s;t[3]!==r||t[4]!==n?(s=e=>{e.key===`Escape`&&(e.preventDefault(),n.length>0?r(``):e.currentTarget.blur())},t[3]=r,t[4]=n,t[5]=s):s=t[5];let c;return t[6]!==i||t[7]!==n||t[8]!==o||t[9]!==s?(c=(0,K.jsxs)(B,{className:`min-w-0 basis-full **:[input]:h-9 sm:basis-0 sm:flex-1 sm:**:[input]:h-8`,children:[a,(0,K.jsx)(ce,{ref:i,type:`search`,value:n,onChange:o,onKeyDown:s,placeholder:`Search keybindings`,"aria-label":`Search keybindings`,size:`sm`})]}),t[6]=i,t[7]=n,t[8]=o,t[9]=s,t[10]=c):c=t[10],c}function je(e,t){return e.type===t?[...je(e.left,t),...je(e.right,t)]:[e]}function J(e,t){let n=e[0];if(n)return e.slice(1).reduce((e,n)=>({type:t,left:e,right:n}),n)}function Me(e){return e.type===`identifier`?{identifier:e.name,negated:!1}:e.type===`not`&&e.node.type===`identifier`?{identifier:e.node.name,negated:!0}:null}function Ne(e,t){let n=Me(e);if(!n)return e;let r={type:`identifier`,name:t};return n.negated?{type:`not`,node:r}:r}function Pe(e,t){let n=Me(e);if(!n)return t?{type:`not`,node:e}:e;let r={type:`identifier`,name:n.identifier};return t?{type:`not`,node:r}:r}function Y(){return{type:`identifier`,name:we}}function Fe(e=`and`){return{type:e,left:Y(),right:{type:`not`,node:Y()}}}function Ie(e){let t=(0,W.c)(14),{label:n,focusable:r,className:i,children:a}=e,o=r===void 0||r?0:void 0,s;t[0]===i?s=t[1]:(s=v(`inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-warning outline-none transition-colors hover:bg-warning/10 focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-warning/25`,i),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==o||t[4]!==s?(c=(0,K.jsx)(`span`,{tabIndex:o,"aria-label":n,className:s}),t[2]=n,t[3]=o,t[4]=s,t[5]=c):c=t[5];let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,K.jsx)(S,{className:`size-3.5`}),t[6]=l):l=t[6];let u;t[7]===c?u=t[8]:(u=(0,K.jsx)(F,{render:c,children:l}),t[7]=c,t[8]=u);let d;t[9]===a?d=t[10]:(d=(0,K.jsx)(I,{side:`top`,children:a}),t[9]=a,t[10]=d);let f;return t[11]!==u||t[12]!==d?(f=(0,K.jsxs)(L,{children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function Le(e){let t=(0,W.c)(5),{identifiers:n,focusable:r}=e,i=r===void 0||r;if(n.length===0)return null;let a;t[0]===n?a=t[1]:(a=n.length===1?`Unknown condition: ${n[0]}`:`Unknown conditions: ${n.join(`, `)}`,t[0]=n,t[1]=a);let o=a,s;return t[2]!==i||t[3]!==o?(s=(0,K.jsx)(Ie,{label:o,focusable:i,className:`size-4.5`,children:`P4 Code does not recognize this condition yet. It can still be saved, but it may not match unless the runtime provides it.`}),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}function X(e){let t=(0,W.c)(4),{labels:n}=e;if(n.length===0)return null;let r;t[0]===n?r=t[1]:(r=n.length===1?`Conflicts with ${n[0]}.`:`Conflicts with ${n.slice(0,3).join(`, `)}${n.length>3?`, and more`:``}.`,t[0]=n,t[1]=r);let i=r,a;return t[2]===i?a=t[3]:(a=(0,K.jsxs)(Ie,{label:i,children:[i,` The most recent matching binding wins when both conditions can apply.`]}),t[2]=i,t[3]=a),a}function Re(e){let t=(0,W.c)(25),{value:n,variables:r,unknownIdentifiers:i,onChange:a}=e,o;if(t[0]!==n||t[1]!==r){let e;t[3]===n?e=t[4]:(e=e=>e===n,t[3]=n,t[4]=e),o=r.find(e),t[0]=n,t[1]=r,t[2]=o}else o=t[2];let s=o,c;t[5]!==s||t[6]!==n||t[7]!==r?(c=s||r.some(e=>e===n)?r:[n,...r],t[5]=s,t[6]=n,t[7]=r,t[8]=c):c=t[8];let l=c,u;t[9]===a?u=t[10]:(u=e=>e&&a(e),t[9]=a,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(E,{placeholder:`Condition`}),t[11]=d):d=t[11];let f;t[12]===i?f=t[13]:(f=i&&i.length>0?(0,K.jsx)(Le,{identifiers:i,focusable:!1}):null,t[12]=i,t[13]=f);let p;t[14]===f?p=t[15]:(p=(0,K.jsxs)(O,{size:`compact`,className:`min-w-0 flex-1`,children:[d,f]}),t[14]=f,t[15]=p);let m;t[16]===l?m=t[17]:(m=l.map(ze),t[16]=l,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,K.jsx)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:m}),t[18]=m,t[19]=h);let g;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==n?(g=(0,K.jsxs)(k,{value:n,onValueChange:u,children:[p,h]}),t[20]=u,t[21]=p,t[22]=h,t[23]=n,t[24]=g):g=t[24],g}function ze(e){return(0,K.jsx)(T,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:e})},e)}function Be(e){let t=(0,W.c)(14),{label:n,className:r,onRemove:i}=e,a;t[0]===r?a=t[1]:(a=v(`size-7`,r),t[0]=r,t[1]=a);let o;t[2]!==n||t[3]!==i||t[4]!==a?(o=(0,K.jsx)(m,{type:`button`,variant:`ghost`,size:`icon-sm`,className:a,"aria-label":n,onClick:i}),t[2]=n,t[3]=i,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(x,{"aria-hidden":!0,className:`size-3.5`}),t[6]=s):s=t[6];let c;t[7]===o?c=t[8]:(c=(0,K.jsx)(F,{delay:200,render:o,children:s}),t[7]=o,t[8]=c);let l;t[9]===n?l=t[10]:(l=(0,K.jsx)(I,{side:`top`,children:n}),t[9]=n,t[10]=l);let u;return t[11]!==c||t[12]!==l?(u=(0,K.jsxs)(L,{children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function Z(e){let t=(0,W.c)(81),{node:n,variables:r,depth:i,onChange:a,onRemove:o}=e,c=i===void 0?0:i,l;if(t[0]!==c||t[1]!==n||t[2]!==a||t[3]!==o||t[4]!==r){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Me(n);if(e){let i=Ce(e.identifier)?[]:[e.identifier],s;t[6]!==n||t[7]!==a?(s=e=>a(Pe(n,e)),t[6]=n,t[7]=a,t[8]=s):s=t[8];let u=`Negate ${e.identifier}`,d;t[9]!==e||t[10]!==s||t[11]!==u?(d=(0,K.jsx)(R,{pressed:e.negated,onPressedChange:s,"aria-label":u,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[9]=e,t[10]=s,t[11]=u,t[12]=d):d=t[12];let f;t[13]!==n||t[14]!==a?(f=e=>a(Ne(n,e)),t[13]=n,t[14]=a,t[15]=f):f=t[15];let p;t[16]!==e||t[17]!==f||t[18]!==i||t[19]!==r?(p=(0,K.jsx)(Re,{value:e.identifier,variables:r,unknownIdentifiers:i,onChange:f}),t[16]=e,t[17]=f,t[18]=i,t[19]=r,t[20]=p):p=t[20];let m;t[21]!==c||t[22]!==n||t[23]!==o?(m=o?(0,K.jsx)(Be,{label:H(n,c),onRemove:o}):null,t[21]=c,t[22]=n,t[23]=o,t[24]=m):m=t[24];let h;t[25]!==d||t[26]!==p||t[27]!==m?(h=(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border/70 bg-background/60 px-2 py-2`,children:[d,p,m]}),t[25]=d,t[26]=p,t[27]=m,t[28]=h):h=t[28],l=h;break bb0}}t[0]=c,t[1]=n,t[2]=a,t[3]=o,t[4]=r,t[5]=l}else l=t[5];if(l!==Symbol.for(`react.early_return_sentinel`))return l;if(n.type===`not`){let e=c>0&&`border-border/50 bg-background/50`,i;t[29]===e?i=t[30]:(i=v(`space-y-2 rounded-lg border border-border/70 bg-muted/20 p-2`,e),t[29]=e,t[30]=i);let s;t[31]!==n||t[32]!==a?(s=(0,K.jsx)(R,{pressed:!0,onPressedChange:e=>a(e?n:n.node),"aria-label":`Negate group`,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[31]=n,t[32]=a,t[33]=s):s=t[33];let l;t[34]!==c||t[35]!==n||t[36]!==o?(l=o?(0,K.jsx)(Be,{label:H(n,c),className:`ml-auto`,onRemove:o}):null,t[34]=c,t[35]=n,t[36]=o,t[37]=l):l=t[37];let u;t[38]!==s||t[39]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s,l]}),t[38]=s,t[39]=l,t[40]=u):u=t[40];let d,f;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{className:`absolute top-0 bottom-0 left-1.5 w-px bg-border/70`,"aria-hidden":!0}),f=(0,K.jsx)(`span`,{className:`absolute top-4 left-1.5 h-px w-2.5 bg-border/70`,"aria-hidden":!0}),t[41]=d,t[42]=f):(d=t[41],f=t[42]);let p=c+1,m;t[43]===a?m=t[44]:(m=e=>a({type:`not`,node:e}),t[43]=a,t[44]=m);let h;t[45]!==n.node||t[46]!==p||t[47]!==m||t[48]!==r?(h=(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[d,f,(0,K.jsx)(Z,{node:n.node,variables:r,depth:p,onChange:m})]}),t[45]=n.node,t[46]=p,t[47]=m,t[48]=r,t[49]=h):h=t[49];let g;return t[50]!==h||t[51]!==i||t[52]!==u?(g=(0,K.jsxs)(`div`,{className:i,children:[u,h]}),t[50]=h,t[51]=i,t[52]=u,t[53]=g):g=t[53],g}let u=n.type===`or`?`or`:`and`,d,f,p,h;if(t[54]!==c||t[55]!==n||t[56]!==a||t[57]!==o||t[58]!==u||t[59]!==r){let e=je(n,u),i=new Map,l=e.map(e=>{let t=`${e.type}-${U(e)}`,n=i.get(t)??0;return i.set(t,n+1),{child:e,key:n===0?t:`${t}-${n}`}}),g=(t,n)=>{let r=!1,i=J(e.map(e=>!r&&e===t?(r=!0,n):e),u);i&&a(i)},_=t=>{let n=!1,r=J(e.filter(e=>!n&&e===t?(n=!0,!1):!0),u);a(r||Y())},y=t=>{if(t===u)return;let n=J(e,t);n&&a(n)},b=()=>{let t=J([...e,Y()],u);t&&a(t)},x=()=>{let t={type:u===`and`?`or`:`and`,left:Y(),right:{type:`not`,node:Y()}},n=J([...e,t],u);n&&a(n)},S=c>0&&`border-border/70 bg-background/55`;t[64]===S?p=t[65]:(p=v(`space-y-2 rounded-lg border border-border/60 bg-muted/10 p-2`,S),t[64]=S,t[65]=p);let C;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(O,{size:`compact`,className:`w-24`,children:(0,K.jsx)(E,{})}),t[66]=C):C=t[66];let w;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsxs)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,children:[(0,K.jsx)(T,{value:`and`,children:`and`}),(0,K.jsx)(T,{value:`or`,children:`or`})]}),t[67]=w):w=t[67];let A;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,K.jsx)(s,{className:`size-3.5`}),t[68]=A):A=t[68];let j;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,K.jsx)(s,{className:`size-3.5`}),t[69]=j):j=t[69];let M;t[70]!==c||t[71]!==n||t[72]!==o?(M=o?(0,K.jsx)(Be,{label:H(n,c),className:`ml-auto`,onRemove:o}):null,t[70]=c,t[71]=n,t[72]=o,t[73]=M):M=t[73],h=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(k,{value:u,onValueChange:e=>y(e),children:[C,w]}),(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:b,children:[A,`Condition`]}),(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:x,children:[j,`Group`]}),M]}),d=`space-y-2`,f=l.map(e=>{let{child:t,key:n}=e;return(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[(0,K.jsx)(`span`,{className:v(`absolute top-0 bottom-0 left-1.5 w-px`,c===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(`span`,{className:v(`absolute top-4 left-1.5 h-px w-2.5`,c===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(Z,{node:t,variables:r,depth:c+1,onChange:e=>g(t,e),onRemove:()=>_(t)})]},n)}),t[54]=c,t[55]=n,t[56]=a,t[57]=o,t[58]=u,t[59]=r,t[60]=d,t[61]=f,t[62]=p,t[63]=h}else d=t[60],f=t[61],p=t[62],h=t[63];let g;t[74]!==d||t[75]!==f?(g=(0,K.jsx)(`div`,{className:d,children:f}),t[74]=d,t[75]=f,t[76]=g):g=t[76];let _;return t[77]!==p||t[78]!==h||t[79]!==g?(_=(0,K.jsxs)(`div`,{className:p,children:[h,g]}),t[77]=p,t[78]=h,t[79]=g,t[80]=_):_=t[80],_}function Ve(e){let t=(0,W.c)(60),{value:n,variables:r,onChange:i,onValidityChange:a}=e,o;t[0]===n?o=t[1]:(o=U(n),t[0]=n,t[1]=o);let[c,l]=(0,G.useState)(o),d;t[2]===c?d=t[3]:(d=Te(c),t[2]=c,t[3]=d);let f=d,p=f.ok?null:f.message,h;t[4]!==f.ok||t[5]!==f.value?(h=f.ok?_e(f.value):[],t[4]=f.ok,t[5]=f.value,t[6]=h):h=t[6];let g=h,_;t[7]!==i||t[8]!==a?(_=e=>{l(e);let t=Te(e);a?.(t.ok),t.ok&&i(t.value)},t[7]=i,t[8]=a,t[9]=_):_=t[9];let v=_,y;t[10]!==i||t[11]!==a?(y=e=>{l(U(e)),a?.(!0),i(e)},t[10]=i,t[11]=a,t[12]=y):y=t[12];let b=y,x;t[13]!==b||t[14]!==n?(x=()=>{if(!n){b(Y());return}b({type:`and`,left:n,right:Y()})},t[13]=b,t[14]=n,t[15]=x):x=t[15];let S=x,C;t[16]!==b||t[17]!==n?(C=()=>{let e=Fe(`or`);if(!n){b(e);return}b({type:`and`,left:n,right:e})},t[16]=b,t[17]=n,t[18]=C):C=t[18];let w=C,T;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,K.jsx)(`div`,{className:`min-w-0`,children:(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`When`})}),t[19]=T):T=t[19];let E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,K.jsx)(s,{className:`size-3.5`}),t[20]=E):E=t[20];let D;t[21]===S?D=t[22]:(D=(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:S,children:[E,`Condition`]}),t[21]=S,t[22]=D);let O;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,K.jsx)(s,{className:`size-3.5`}),t[23]=O):O=t[23];let k;t[24]===w?k=t[25]:(k=(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[O,`Group`]}),t[24]=w,t[25]=k);let A;t[26]!==D||t[27]!==k?(A=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[T,(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[D,k]})]}),t[26]=D,t[27]=k,t[28]=A):A=t[28];let j;t[29]===v?j=t[30]:(j=e=>v(e.currentTarget.value),t[29]=v,t[30]=j);let M=!!p,ee;t[31]!==c||t[32]!==j||t[33]!==M?(ee=(0,K.jsx)(ce,{value:c,onChange:j,placeholder:`Always`,"aria-invalid":M,"aria-label":`When expression`,size:`compact`,font:`mono`}),t[31]=c,t[32]=j,t[33]=M,t[34]=ee):ee=t[34];let N;t[35]===g?N=t[36]:(N=g.length>0?(0,K.jsx)(se,{align:`inline-end`,children:(0,K.jsx)(Le,{identifiers:g})}):null,t[35]=g,t[36]=N);let te;t[37]!==ee||t[38]!==N?(te=(0,K.jsxs)(B,{children:[ee,N]}),t[37]=ee,t[38]=N,t[39]=te):te=t[39];let P;t[40]===p?P=t[41]:(P=p?(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-2xs text-destructive`,children:[(0,K.jsx)(u,{className:`size-3.5`}),p]}):null,t[40]=p,t[41]=P);let ne;t[42]!==te||t[43]!==P?(ne=(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[te,P]}),t[42]=te,t[43]=P,t[44]=ne):ne=t[44];let F;t[45]!==S||t[46]!==w||t[47]!==b||t[48]!==n||t[49]!==r?(F=n?(0,K.jsx)(Z,{node:n,variables:r,onChange:b,onRemove:()=>b(void 0)}):(0,K.jsx)(`div`,{className:`rounded-md border border-dashed border-border/80 bg-muted/15 p-3`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(m,{type:`button`,size:`compact`,onClick:S,children:[(0,K.jsx)(s,{className:`size-3.5`}),`Condition`]}),(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[(0,K.jsx)(s,{className:`size-3.5`}),`Group`]})]})}),t[45]=S,t[46]=w,t[47]=b,t[48]=n,t[49]=r,t[50]=F):F=t[50];let I;t[51]===p?I=t[52]:(I=p?(0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center rounded-lg border border-destructive/30 bg-background/75 p-4 text-center text-xs text-destructive backdrop-blur-xs`,children:`Fix the expression above to continue editing visually.`}):null,t[51]=p,t[52]=I);let L;t[53]!==F||t[54]!==I?(L=(0,K.jsxs)(`div`,{className:`relative`,children:[F,I]}),t[53]=F,t[54]=I,t[55]=L):L=t[55];let R;return t[56]!==A||t[57]!==ne||t[58]!==L?(R=(0,K.jsxs)(`div`,{className:`w-[min(34rem,calc(100vw-2rem))] space-y-3`,children:[A,ne,L]}),t[56]=A,t[57]=ne,t[58]=L,t[59]=R):R=t[59],R}function He(e){return{keyDraft:e.key,whenDraft:e.binding.whenAst,isRecording:!1,isWhenDraftValid:!0}}function Q(e,t){return{...e,...t}}function Ue(e){return{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}}function We(e){let t=(0,W.c)(27),{row:n,allRows:r,onSave:i}=e,[a,o]=(0,G.useReducer)(Q,n,He),{keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u}=a,d,f,p;t[0]!==r||t[1]!==s||t[2]!==n.id||t[3]!==n.key||t[4]!==n.when||t[5]!==c?(p=U(c),d=s!==n.key||p!==n.when,f=ge(r,{rowId:n.id,key:s,when:p}),t[0]=r,t[1]=s,t[2]=n.id,t[3]=n.key,t[4]=n.when,t[5]=c,t[6]=d,t[7]=f,t[8]=p):(d=t[6],f=t[7],p=t[8]);let m=f,h;t[9]!==s||t[10]!==i||t[11]!==n||t[12]!==p?(h=()=>{i({command:n.command,key:s,when:p.trim().length>0?p:void 0,replace:Ue(n)})},t[9]=s,t[10]=i,t[11]=n,t[12]=p,t[13]=h):h=t[13];let g=h,_;t[14]!==l||t[15]!==n.key?(_=e=>{if(e.key===`Tab`&&!l)return;if(e.preventDefault(),e.key===`Escape`){o({keyDraft:n.key,isRecording:!1});return}let t=ye(e.nativeEvent,navigator.platform);t&&o({keyDraft:t,isRecording:!1})},t[14]=l,t[15]=n.key,t[16]=_):_=t[16];let v=_,y;return t[17]!==v||t[18]!==m||t[19]!==d||t[20]!==l||t[21]!==u||t[22]!==s||t[23]!==g||t[24]!==c||t[25]!==p?(y={keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u,whenDraftExpression:p,isDirty:d,conflictLabels:m,setDraft:o,save:g,captureKeybinding:v},t[17]=v,t[18]=m,t[19]=d,t[20]=l,t[21]=u,t[22]=s,t[23]=g,t[24]=c,t[25]=p,t[26]=y):y=t[26],y}function Ge(e){let t=(0,W.c)(19),{row:n,editor:r,isSaving:i,pillClassName:a}=e,{keyDraft:o,isRecording:s,isDirty:c,isWhenDraftValid:l,setDraft:u,save:d,captureKeybinding:f}=r,p=!s&&o===n.key&&n.key.length>0&&!c,h;t[0]!==c||t[1]!==i||t[2]!==l||t[3]!==o||t[4]!==d?(h=c?(0,K.jsx)(m,{size:`sm`,disabled:i||o.trim().length===0||!l,onClick:d,children:i?`Saving`:`Save`}):null,t[0]=c,t[1]=i,t[2]=l,t[3]=o,t[4]=d,t[5]=h):h=t[5];let g;t[6]!==f||t[7]!==s||t[8]!==o||t[9]!==a||t[10]!==n.binding||t[11]!==n.command||t[12]!==n.key||t[13]!==u||t[14]!==p?(g=p?(0,K.jsx)(`button`,{type:`button`,onClick:()=>u({isRecording:!0}),"aria-label":`Edit shortcut for ${V(n.command)}: ${ie(n.binding.shortcut)}`,className:v(`inline-flex h-8 cursor-pointer items-center rounded-md border border-transparent px-1.5 sm:h-7 outline-none transition-colors hover:border-border/70 hover:bg-accent focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring/24`,a),children:(0,K.jsx)(q,{value:n.key})}):(0,K.jsx)(re,{"data-keybinding-capture":``,autoFocus:s,"aria-label":`Keybinding for ${V(n.command)}`,value:s?``:o,placeholder:s?`Press shortcut`:`Unassigned`,size:`sm`,font:`mono`,className:`w-44`,onFocus:()=>u({isRecording:!0}),onBlur:()=>u({isRecording:!1}),onChange:e=>u({keyDraft:e.currentTarget.value}),onKeyDown:f}),t[6]=f,t[7]=s,t[8]=o,t[9]=a,t[10]=n.binding,t[11]=n.command,t[12]=n.key,t[13]=u,t[14]=p,t[15]=g):g=t[15];let _;return t[16]!==h||t[17]!==g?(_=(0,K.jsxs)(K.Fragment,{children:[h,g]}),t[16]=h,t[17]=g,t[18]=_):_=t[18],_}function $(e){let t=(0,W.c)(17),{label:n,expression:r,value:i,variables:a,onChange:o,onValidityChange:s}=e,c=r?`ghost`:`ghost-muted`,l;t[0]===c?l=t[1]:(l=(0,K.jsx)(m,{variant:c,size:`micro`,className:`min-w-0 shrink`}),t[0]=c,t[1]=l);let u=`Edit when clause for ${n}`,d=r||`Always`,f;t[2]===d?f=t[3]:(f=(0,K.jsx)(`span`,{className:`truncate font-mono`,children:d}),t[2]=d,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(g,{className:`size-3.5 shrink-0 opacity-60`}),t[4]=p):p=t[4];let h;t[5]!==l||t[6]!==u||t[7]!==f?(h=(0,K.jsxs)(oe,{render:l,"aria-label":u,children:[f,p]}),t[5]=l,t[6]=u,t[7]=f,t[8]=h):h=t[8];let _;t[9]!==o||t[10]!==s||t[11]!==i||t[12]!==a?(_=(0,K.jsx)(ae,{align:`start`,sideOffset:6,children:(0,K.jsx)(Ve,{value:i,variables:a,onChange:o,onValidityChange:s})}),t[9]=o,t[10]=s,t[11]=i,t[12]=a,t[13]=_):_=t[13];let v;return t[14]!==h||t[15]!==_?(v=(0,K.jsxs)(z,{children:[h,_]}),t[14]=h,t[15]=_,t[16]=v):v=t[16],v}function Ke(e){let t=(0,W.c)(24),{row:n,isSaving:r,onReset:a,onRemove:o}=e,s=n.source===`Custom`&&n.defaultKey!==null,c=n.source!==`Default`;if(!s&&!c)return null;let l;t[0]===n.command?l=t[1]:(l=V(n.command),t[0]=n.command,t[1]=l);let u=`Actions for ${l}`,f;t[2]!==r||t[3]!==u?(f=(0,K.jsx)(m,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:r,"aria-label":u}),t[2]=r,t[3]=u,t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(h,{className:`size-3.5`}),t[5]=p):p=t[5];let g;t[6]===f?g=t[7]:(g=(0,K.jsx)(b,{render:f,children:p}),t[6]=f,t[7]=g);let _;t[8]!==s||t[9]!==r||t[10]!==a||t[11]!==n?(_=s?(0,K.jsx)(i,{disabled:r,onClick:()=>a(n),children:`Reset to default`}):null,t[8]=s,t[9]=r,t[10]=a,t[11]=n,t[12]=_):_=t[12];let v;t[13]!==c||t[14]!==r||t[15]!==o||t[16]!==n?(v=c?(0,K.jsx)(i,{variant:`destructive`,disabled:r,onClick:()=>o(n),children:`Remove`}):null,t[13]=c,t[14]=r,t[15]=o,t[16]=n,t[17]=v):v=t[17];let x;t[18]!==_||t[19]!==v?(x=(0,K.jsxs)(y,{align:`end`,children:[_,v]}),t[18]=_,t[19]=v,t[20]=x):x=t[20];let S;return t[21]!==g||t[22]!==x?(S=(0,K.jsxs)(d,{children:[g,x]}),t[21]=g,t[22]=x,t[23]=S):S=t[23],S}function qe(e){let t=(0,W.c)(2),{source:n}=e;if(n===`Default`)return null;let r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(o,{variant:`outline`,size:`sm`,children:n}),t[0]=n,t[1]=r),r}function Je(e){let t=(0,W.c)(13),{row:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(`span`,{className:`flex items-center gap-2`}),t[0]=r):r=t[0];let i;t[1]===n.command?i=t[2]:(i=V(n.command),t[1]=n.command,t[2]=i);let a;t[3]===n.source?a=t[4]:(a=(0,K.jsx)(qe,{source:n.source}),t[3]=n.source,t[4]=a);let o;t[5]!==i||t[6]!==a?(o=(0,K.jsxs)(F,{render:r,children:[i,a]}),t[5]=i,t[6]=a,t[7]=o):o=t[7];let s;t[8]===n.command?s=t[9]:(s=(0,K.jsx)(I,{side:`top`,children:n.command}),t[8]=n.command,t[9]=s);let c;return t[10]!==o||t[11]!==s?(c=(0,K.jsxs)(L,{children:[o,s]}),t[10]=o,t[11]=s,t[12]=c):c=t[12],c}function Ye(e){let t=(0,W.c)(13),{row:n,editor:r,variables:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[0]=a):a=t[0];let o;t[1]===n.command?o=t[2]:(o=V(n.command),t[1]=n.command,t[2]=o);let s,c;t[3]===r?(s=t[4],c=t[5]):(s=e=>r.setDraft({whenDraft:e}),c=e=>r.setDraft({isWhenDraftValid:e}),t[3]=r,t[4]=s,t[5]=c);let l;return t[6]!==r.whenDraft||t[7]!==r.whenDraftExpression||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==i?(l=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[a,(0,K.jsx)($,{label:o,expression:r.whenDraftExpression,value:r.whenDraft,variables:i,onChange:s,onValidityChange:c})]}),t[6]=r.whenDraft,t[7]=r.whenDraftExpression,t[8]=o,t[9]=s,t[10]=c,t[11]=i,t[12]=l):l=t[12],l}function Xe(e){let t=(0,W.c)(2),n;return t[0]===e?n=t[1]:(n=(0,K.jsx)(`span`,{className:`flex items-center opacity-0 transition-opacity group-focus-within/row:opacity-100 group-hover/row:opacity-100 has-data-popup-open:opacity-100 pointer-coarse:opacity-100`,children:(0,K.jsx)(Ke,{...e})}),t[0]=e,t[1]=n),n}function Ze(e){let t=(0,W.c)(30),{row:n,isSaving:r,anchorId:i,allRows:a,variables:o,onSave:s,onReset:c,onRemove:l}=e,u;t[0]!==a||t[1]!==s||t[2]!==n?(u={row:n,allRows:a,onSave:s},t[0]=a,t[1]=s,t[2]=n,t[3]=u):u=t[3];let d=We(u),f;t[4]===n?f=t[5]:(f=(0,K.jsx)(Je,{row:n}),t[4]=n,t[5]=f);let p;t[6]!==d||t[7]!==n||t[8]!==o?(p=(0,K.jsx)(Ye,{row:n,editor:d,variables:o}),t[6]=d,t[7]=n,t[8]=o,t[9]=p):p=t[9];let m;t[10]===d.conflictLabels?m=t[11]:(m=(0,K.jsx)(X,{labels:d.conflictLabels}),t[10]=d.conflictLabels,t[11]=m);let h;t[12]!==r||t[13]!==l||t[14]!==c||t[15]!==n?(h=(0,K.jsx)(Xe,{row:n,isSaving:r,onReset:c,onRemove:l}),t[12]=r,t[13]=l,t[14]=c,t[15]=n,t[16]=h):h=t[16];let g;t[17]!==d||t[18]!==r||t[19]!==n?(g=(0,K.jsx)(Ge,{row:n,editor:d,isSaving:r,pillClassName:`-mr-1.5`}),t[17]=d,t[18]=r,t[19]=n,t[20]=g):g=t[20];let _;t[21]!==m||t[22]!==h||t[23]!==g?(_=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[m,h,g]}),t[21]=m,t[22]=h,t[23]=g,t[24]=_):_=t[24];let v;return t[25]!==i||t[26]!==f||t[27]!==p||t[28]!==_?(v=(0,K.jsx)(pe,{id:i,className:`group/row rounded-none`,title:f,description:p,control:_}),t[25]=i,t[26]=f,t[27]=p,t[28]=_,t[29]=v):v=t[29],v}function Qe(e){let t=(0,W.c)(30),{allRows:n,onSave:r}=e,[i,a]=(0,G.useState)(``),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={keyDraft:``,whenDraft:void 0,isRecording:!1,isWhenDraftValid:!0},t[0]=o):o=t[0];let[s,c]=(0,G.useReducer)(Q,o),{keyDraft:l,whenDraft:u,isRecording:d,isWhenDraftValid:f}=s,p,m;t[1]!==n||t[2]!==l||t[3]!==u?(m=U(u),p=ge(n,{rowId:`new`,key:l,when:m}),t[1]=n,t[2]=l,t[3]=u,t[4]=p,t[5]=m):(p=t[4],m=t[5]);let h=p,g;t[6]===i?g=t[7]:(g=i?V(i):`new keybinding`,t[6]=i,t[7]=g);let _=g,v;t[8]!==i||t[9]!==f||t[10]!==l?(v=!!i&&l.trim().length>0&&f,t[8]=i,t[9]=f,t[10]=l,t[11]=v):v=t[11];let y=v,b;t[12]!==i||t[13]!==l||t[14]!==r||t[15]!==m?(b=()=>{i&&r({command:i,key:l,...m.trim().length>0?{when:m}:{}})},t[12]=i,t[13]=l,t[14]=r,t[15]=m,t[16]=b):b=t[16];let x=b,S;t[17]===d?S=t[18]:(S=e=>{if(e.key===`Tab`&&!d)return;if(e.preventDefault(),e.key===`Escape`){c({keyDraft:``,isRecording:!1});return}let t=ye(e.nativeEvent,navigator.platform);t&&c({keyDraft:t,isRecording:!1})},t[17]=d,t[18]=S);let C=S,w;return t[19]!==y||t[20]!==C||t[21]!==i||t[22]!==_||t[23]!==h||t[24]!==d||t[25]!==l||t[26]!==x||t[27]!==u||t[28]!==m?(w={commandDraft:i,setCommandDraft:a,keyDraft:l,whenDraft:u,whenDraftExpression:m,isRecording:d,conflictLabels:h,commandLabelText:_,canSave:y,setDraft:c,save:x,captureKeybinding:C},t[19]=y,t[20]=C,t[21]=i,t[22]=_,t[23]=h,t[24]=d,t[25]=l,t[26]=x,t[27]=u,t[28]=m,t[29]=w):w=t[29],w}function $e(e){let t=(0,W.c)(14),{draft:n,commandOptions:r,className:i}=e,a=n.commandDraft,o;t[0]===n?o=t[1]:(o=e=>n.setCommandDraft(e),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(E,{placeholder:`Command`}),t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=(0,K.jsx)(O,{size:`sm`,className:i,children:s}),t[3]=i,t[4]=c);let l;t[5]===r?l=t[6]:(l=r.map(et),t[5]=r,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,K.jsx)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:l}),t[7]=l,t[8]=u);let d;return t[9]!==n.commandDraft||t[10]!==o||t[11]!==c||t[12]!==u?(d=(0,K.jsxs)(k,{value:a,onValueChange:o,children:[c,u]}),t[9]=n.commandDraft,t[10]=o,t[11]=c,t[12]=u,t[13]=d):d=t[13],d}function et(e){return(0,K.jsx)(T,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:V(e)})},e)}function tt(e){let t=(0,W.c)(14),{draft:n,autoFocus:r,className:i}=e,a=r!==void 0&&r,o=`Keybinding for ${n.commandLabelText}`,s=n.isRecording?``:n.keyDraft,c=n.isRecording?`Press shortcut`:`Unassigned`,l,u,d;t[0]===n?(l=t[1],u=t[2],d=t[3]):(l=()=>n.setDraft({isRecording:!0}),u=()=>n.setDraft({isRecording:!1}),d=e=>n.setDraft({keyDraft:e.currentTarget.value}),t[0]=n,t[1]=l,t[2]=u,t[3]=d);let f;return t[4]!==a||t[5]!==i||t[6]!==n.captureKeybinding||t[7]!==o||t[8]!==s||t[9]!==c||t[10]!==l||t[11]!==u||t[12]!==d?(f=(0,K.jsx)(re,{"data-keybinding-capture":``,autoFocus:a,"aria-label":o,value:s,placeholder:c,size:`sm`,font:`mono`,className:i,onFocus:l,onBlur:u,onChange:d,onKeyDown:n.captureKeybinding}),t[4]=a,t[5]=i,t[6]=n.captureKeybinding,t[7]=o,t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function nt(e){let t=(0,W.c)(10),{draft:n,variables:r}=e,i,a;t[0]===n?(i=t[1],a=t[2]):(i=e=>n.setDraft({whenDraft:e}),a=e=>n.setDraft({isWhenDraftValid:e}),t[0]=n,t[1]=i,t[2]=a);let o;return t[3]!==n.commandLabelText||t[4]!==n.whenDraft||t[5]!==n.whenDraftExpression||t[6]!==i||t[7]!==a||t[8]!==r?(o=(0,K.jsx)($,{label:n.commandLabelText,expression:n.whenDraftExpression,value:n.whenDraft,variables:r,onChange:i,onValidityChange:a}),t[3]=n.commandLabelText,t[4]=n.whenDraft,t[5]=n.whenDraftExpression,t[6]=i,t[7]=a,t[8]=r,t[9]=o):o=t[9],o}function rt(e){let t=(0,W.c)(9),{isSaving:n,onCancel:r}=e,i;t[0]!==n||t[1]!==r?(i=(0,K.jsx)(m,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:n,"aria-label":`Cancel new keybinding`,onClick:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(_,{className:`size-3.5`}),t[3]=a):a=t[3];let o;t[4]===i?o=t[5]:(o=(0,K.jsx)(F,{render:i,children:a}),t[4]=i,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(I,{side:`top`,children:`Cancel`}),t[6]=s):s=t[6];let c;return t[7]===o?c=t[8]:(c=(0,K.jsxs)(L,{children:[o,s]}),t[7]=o,t[8]=c),c}function it(e){let t=(0,W.c)(30),{commandOptions:n,allRows:r,variables:i,isSaving:a,onSave:o,onCancel:s}=e,c;t[0]!==r||t[1]!==o?(c={allRows:r,onSave:o},t[0]=r,t[1]=o,t[2]=c):c=t[2];let l=Qe(c),u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[3]=u):u=t[3];let d;t[4]!==l||t[5]!==i?(d=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[u,(0,K.jsx)(nt,{draft:l,variables:i})]}),t[4]=l,t[5]=i,t[6]=d):d=t[6];let f;t[7]!==n||t[8]!==l?(f=(0,K.jsx)($e,{draft:l,commandOptions:n,className:`w-56`}),t[7]=n,t[8]=l,t[9]=f):f=t[9];let p;t[10]===l.conflictLabels?p=t[11]:(p=(0,K.jsx)(X,{labels:l.conflictLabels}),t[10]=l.conflictLabels,t[11]=p);let h;t[12]===l?h=t[13]:(h=(0,K.jsx)(tt,{draft:l,className:`w-44`}),t[12]=l,t[13]=h);let g=a||!l.canSave,_=a?`Saving`:`Save`,v;t[14]!==l.save||t[15]!==g||t[16]!==_?(v=(0,K.jsx)(m,{size:`sm`,disabled:g,onClick:l.save,children:_}),t[14]=l.save,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y;t[18]!==a||t[19]!==s?(y=(0,K.jsx)(rt,{isSaving:a,onCancel:s}),t[18]=a,t[19]=s,t[20]=y):y=t[20];let b;t[21]!==f||t[22]!==p||t[23]!==h||t[24]!==v||t[25]!==y?(b=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[f,p,h,v,y]}),t[21]=f,t[22]=p,t[23]=h,t[24]=v,t[25]=y,t[26]=b):b=t[26];let x;return t[27]!==b||t[28]!==d?(x=(0,K.jsx)(pe,{className:`bg-muted/15`,title:`New keybinding`,description:d,control:b}),t[27]=b,t[28]=d,t[29]=x):x=t[29],x}function at(e){let{groups:t,anchorIds:n,savingCommand:r,...i}=e;return t.map(e=>(0,K.jsx)(he,{id:`keybindings-${e.id}`,title:e.title,children:e.rows.map(e=>(0,K.jsx)(Ze,{row:e,anchorId:n.get(e.id),isSaving:r===e.command,...i},e.id))},e.id))}function ot(){let e=(0,W.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(L,{children:[(0,K.jsx)(F,{delay:200,render:(0,K.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`The browser may claim some shortcuts first. The desktop app receives them all.`,children:(0,K.jsx)(S,{className:`size-3.5 text-warning`})})}),(0,K.jsx)(I,{side:`top`,className:`max-w-72`,children:`The browser may claim some shortcuts first. The desktop app receives them all.`})]}),e[0]=t):t=e[0],t}function st(){let e=(0,W.c)(83),{environment:t,connectedEnvironments:n}=de(),r=ee(t?.environmentId??null,c),i=te(n,l),o;e[0]!==n||e[1]!==i?(o=n.length>0&&n.every(e=>i.has(e.environmentId)),e[0]=n,e[1]=i,e[2]=o):o=e[2];let u=o,d=t?.serverConfig?.keybindings,f;e[3]===d?f=e[4]:(f=d??[],e[3]=d,e[4]=f);let h;e[5]===f?h=e[6]:(h=a(f),e[5]=f,e[6]=h);let g=h,_=t?.serverConfig?.keybindingsConfigPath??null,v;e[7]===t?.serverConfig?.availableEditors?v=e[8]:(v=t?.serverConfig?.availableEditors??[],e[7]=t?.serverConfig?.availableEditors,e[8]=v);let y=v,b;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(b={reportFailure:!1},e[9]=b):b=e[9];let x=P(M.upsertKeybinding,b),S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S={reportFailure:!1},e[10]=S):S=e[10];let T=P(M.removeKeybinding,S),E=Ee(t?.environmentId??null,y),[D,O]=(0,G.useState)(``),k=(0,G.useRef)(null),[R,re]=(0,G.useState)(null),[ie,ae]=(0,G.useState)(!1),oe;e[11]!==g||e[12]!==D?(oe=Se(g,D),e[11]=g,e[12]=D,e[13]=oe):oe=e[13];let z=oe,se;e[14]===z?se=e[15]:(se=xe(z),e[14]=z,e[15]=se);let ce=se,B;if(e[16]!==z){B=new Map;let t=new Set;for(let e of z)t.has(e.command)||(t.add(e.command),B.set(e.id,Oe(e.command)));e[16]=z,e[17]=B}else B=e[17];let le=B,ue;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(ue={select:ft},e[18]=ue):ue=e[18];let pe=A(ue),[V,ge]=(0,G.useState)(pe);pe!==V&&(ge(pe),pe.startsWith(`keybinding-`)&&O(``));let _e;e[19]===g?_e=e[20]:(_e=be(g),e[19]=g,e[20]=_e);let ye=_e,H;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(H=ve(),e[21]=H):H=e[21];let U=H,Ce;e[22]!==_||e[23]!==E||e[24]!==t?(Ce=()=>{_&&t&&N(t.environmentId,`orchestration:operate`)&&(async()=>{let e=await E(_);if(e._tag===`Success`||C(e))return;let t=w(e);j.add({title:`Unable to open keybindings file`,description:t instanceof Error?t.message:`The keybindings file was not opened.`,type:`error`})})()},e[22]=_,e[23]=E,e[24]=t,e[25]=Ce):Ce=e[25];let we=Ce,Te;e[26]!==n||e[27]!==t||e[28]!==x?(Te=e=>{if(!t||!n.every(dt))return;re(e.command);let r={command:e.command,key:e.key.trim(),...e.when?.trim()?{when:e.when.trim()}:{},...e.replace?{replace:e.replace}:{}};(async()=>{let e=await Promise.all(n.map(e=>x({environmentId:e.environmentId,input:r})));re(null);let t=e.find(ut);if(!t){ae(!1);return}if(!C(t)){let e=w(t);j.add({title:`Unable to save keybinding`,description:e instanceof Error?e.message:`The keybinding was not saved.`,type:`error`})}})()},e[26]=n,e[27]=t,e[28]=x,e[29]=Te):Te=e[29];let q=Te,ke;e[30]!==n||e[31]!==t||e[32]!==T?(ke=e=>{t&&n.every(lt)&&(re(e.command),(async()=>{let t=await Promise.all(n.map(t=>T({environmentId:t.environmentId,input:Ue(e)})));re(null);let r=t.find(ct)??t[0];if(r?._tag===`Failure`&&!C(r)){let e=w(r);j.add({title:`Unable to remove keybinding`,description:e instanceof Error?e.message:`The keybinding was not removed.`,type:`error`})}})())},e[30]=n,e[31]=t,e[32]=T,e[33]=ke):ke=e[33];let je=ke,J;e[34]===q?J=e[35]:(J=e=>{e.defaultKey&&q({command:e.command,key:e.defaultKey,when:e.defaultWhen.trim().length>0?e.defaultWhen:void 0,replace:{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}})},e[34]=q,e[35]=J);let Me=J,Ne;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=()=>ae(!1),e[36]=Ne):Ne=e[36];let Pe=Ne,Y;e[37]!==je||e[38]!==Me||e[39]!==z||e[40]!==q?(Y={allRows:z,variables:U,onSave:q,onReset:Me,onRemove:je},e[37]=je,e[38]=Me,e[39]=z,e[40]=q,e[41]=Y):Y=e[41];let Fe=Y,Ie,Le;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=De(`keybindings`),Le=ne?null:(0,K.jsx)(ot,{}),e[42]=Ie,e[43]=Le):(Ie=e[42],Le=e[43]);let X;e[44]===D?X=e[45]:(X=(0,K.jsx)(Ae,{query:D,onChange:O,inputRef:k}),e[44]=D,e[45]=X);let Re=ie||!u,ze,Be;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>ae(!0),Be=(0,K.jsx)(s,{"aria-hidden":!0,className:`size-4`}),e[46]=ze,e[47]=Be):(ze=e[46],Be=e[47]);let Z;e[48]===Re?Z=e[49]:(Z=(0,K.jsxs)(m,{type:`button`,variant:`outline`,disabled:Re,onClick:ze,children:[Be,`Add keybinding`]}),e[48]=Re,e[49]=Z);let Ve=!_||!r,He;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,K.jsx)(p,{"aria-hidden":!0,className:`size-4`}),e[50]=He):He=e[50];let Q;e[51]!==we||e[52]!==Ve?(Q=(0,K.jsx)(F,{render:(0,K.jsx)(m,{type:`button`,variant:`outline`,size:`icon`,disabled:Ve,onClick:we,"aria-label":`Open keybindings.json`,children:He})}),e[51]=we,e[52]=Ve,e[53]=Q):Q=e[53];let We;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,K.jsx)(I,{side:`top`,children:`Open keybindings.json`}),e[54]=We):We=e[54];let Ge;e[55]===Q?Ge=e[56]:(Ge=(0,K.jsxs)(L,{children:[Q,We]}),e[55]=Q,e[56]=Ge);let $;e[57]!==X||e[58]!==Z||e[59]!==Ge?($=(0,K.jsx)(he,{...Ie,headerAction:Le,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-3 py-3 sm:px-4`,children:[X,Z,Ge]})}),e[57]=X,e[58]=Z,e[59]=Ge,e[60]=$):$=e[60];let Ke;e[61]!==u||e[62]!==n?(Ke=u?null:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.length===0?`Connect an environment to change keybindings.`:`This connection can view keybindings but cannot change them.`}),e[61]=u,e[62]=n,e[63]=Ke):Ke=e[63];let qe=!u,Je;e[64]!==ye||e[65]!==ie||e[66]!==z||e[67]!==q||e[68]!==R?(Je=ie?(0,K.jsx)(fe,{children:(0,K.jsx)(it,{commandOptions:ye,allRows:z,variables:U,isSaving:R!==null,onSave:q,onCancel:Pe})}):null,e[64]=ye,e[65]=ie,e[66]=z,e[67]=q,e[68]=R,e[69]=Je):Je=e[69];let Ye;e[70]!==le||e[71]!==ce||e[72]!==Fe||e[73]!==R?(Ye=ce.length>0?(0,K.jsx)(at,{groups:ce,anchorIds:le,savingCommand:R,...Fe}):(0,K.jsx)(fe,{children:(0,K.jsx)(`div`,{className:`px-4 py-12 text-center text-sm text-muted-foreground`,children:`No keybindings match your search.`})}),e[70]=le,e[71]=ce,e[72]=Fe,e[73]=R,e[74]=Ye):Ye=e[74];let Xe;e[75]!==qe||e[76]!==Je||e[77]!==Ye?(Xe=(0,K.jsxs)(`div`,{inert:qe,className:`flex flex-col gap-8`,children:[Je,Ye]}),e[75]=qe,e[76]=Je,e[77]=Ye,e[78]=Xe):Xe=e[78];let Ze;return e[79]!==$||e[80]!==Ke||e[81]!==Xe?(Ze=(0,K.jsxs)(me,{children:[$,Ke,Xe]}),e[79]=$,e[80]=Ke,e[81]=Xe,e[82]=Ze):Ze=e[82],Ze}function ct(e){return e._tag===`Failure`}function lt(e){return N(e.environmentId,l)}function ut(e){return e._tag===`Failure`}function dt(e){return N(e.environmentId,l)}function ft(e){return e.hash.replace(/^#/,``)}var pt=st;export{pt as component};
|
|
2
|
-
//# sourceMappingURL=settings.keybindings-
|
|
1
|
+
import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{$n as i,Ic as a,Jn as o,Jp as s,K_ as c,Q_ as l,Ud as u,Yn as d,cm as f,df as p,dr as m,if as h,kd as g,nh as _,t as v,tr as y,ur as b,xp as x,zm as S}from"./utils-CrFJwxSd.js";import{R as C,W as w}from"./runtime-Dm3Pi31_.js";import{a as T,c as E,o as D,s as O,t as k}from"./select-Ctq0UILH.js";import{t as A}from"./useLocation-DbWity7H.js";import{i as j}from"./toast-BcjbmUtS.js";import{f as M}from"./server-BvxyePeo.js";import{i as ee,n as N,o as te}from"./session-C7ckxjAM.js";import{t as P}from"./use-atom-command-BNkv9iyk.js";import{t as ne}from"./env-wK1YYxA8.js";import{a as F,n as I,t as L}from"./tooltip-T5ePvxsH.js";import{t as R}from"./toggle-Bbnow7xY.js";import{t as re}from"./input-BCWES8Y7.js";import{i as ie}from"./keybindings-BG7j7M7S.js";import{i as ae,o as oe,t as z}from"./popover-BnqKHl4L.js";import{n as se,r as ce,t as B}from"./input-group-CfPOCEuC.js";import{n as le,t as ue}from"./kbd-EDrgCOls.js";import{V as de,W as fe,a as pe,i as me,s as he}from"./settingsLayout-DFYjWgKN.js";import{a as V,c as ge,f as _e,i as ve,l as ye,m as H,n as be,o as xe,p as U,r as Se,s as Ce,t as we,u as Te}from"./KeybindingsSettings.logic-CU23l8mP.js";import{Ta as Ee,ir as De,rr as Oe}from"./main-BGaSDXjP.js";var W=n(),G=e(t(),1),K=e(r(),1);function q(e){let t=(0,W.c)(6),{value:n}=e,r,i;if(t[0]!==n){let e=new Map,a=n.split(`+`).map(t=>{let n=e.get(t)??0;return e.set(t,n+1),{part:t,key:n===0?t:`${t}-${n}`}});r=le,i=a.map(ke),t[0]=n,t[1]=r,t[2]=i}else r=t[1],i=t[2];let a;return t[3]!==r||t[4]!==i?(a=(0,K.jsx)(r,{children:i}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function ke(e){let{part:t,key:n}=e;return(0,K.jsx)(ue,{children:t===`mod`?navigator.platform.toLowerCase().includes(`mac`)?`⌘`:`Ctrl`:t===`shift`?`⇧`:t===`alt`?navigator.platform.toLowerCase().includes(`mac`)?`⌥`:`Alt`:t===`ctrl`?`⌃`:t.length===1?t.toUpperCase():t},n)}function Ae(e){let t=(0,W.c)(11),{query:n,onChange:r,inputRef:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(se,{children:(0,K.jsx)(f,{"aria-hidden":!0,className:`size-3.5`})}),t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=e=>r(e.currentTarget.value),t[1]=r,t[2]=o);let s;t[3]!==r||t[4]!==n?(s=e=>{e.key===`Escape`&&(e.preventDefault(),n.length>0?r(``):e.currentTarget.blur())},t[3]=r,t[4]=n,t[5]=s):s=t[5];let c;return t[6]!==i||t[7]!==n||t[8]!==o||t[9]!==s?(c=(0,K.jsxs)(B,{className:`min-w-0 basis-full **:[input]:h-9 sm:basis-0 sm:flex-1 sm:**:[input]:h-8`,children:[a,(0,K.jsx)(ce,{ref:i,type:`search`,value:n,onChange:o,onKeyDown:s,placeholder:`Search keybindings`,"aria-label":`Search keybindings`,size:`sm`})]}),t[6]=i,t[7]=n,t[8]=o,t[9]=s,t[10]=c):c=t[10],c}function je(e,t){return e.type===t?[...je(e.left,t),...je(e.right,t)]:[e]}function J(e,t){let n=e[0];if(n)return e.slice(1).reduce((e,n)=>({type:t,left:e,right:n}),n)}function Me(e){return e.type===`identifier`?{identifier:e.name,negated:!1}:e.type===`not`&&e.node.type===`identifier`?{identifier:e.node.name,negated:!0}:null}function Ne(e,t){let n=Me(e);if(!n)return e;let r={type:`identifier`,name:t};return n.negated?{type:`not`,node:r}:r}function Pe(e,t){let n=Me(e);if(!n)return t?{type:`not`,node:e}:e;let r={type:`identifier`,name:n.identifier};return t?{type:`not`,node:r}:r}function Y(){return{type:`identifier`,name:we}}function Fe(e=`and`){return{type:e,left:Y(),right:{type:`not`,node:Y()}}}function Ie(e){let t=(0,W.c)(14),{label:n,focusable:r,className:i,children:a}=e,o=r===void 0||r?0:void 0,s;t[0]===i?s=t[1]:(s=v(`inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-warning outline-none transition-colors hover:bg-warning/10 focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-warning/25`,i),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==o||t[4]!==s?(c=(0,K.jsx)(`span`,{tabIndex:o,"aria-label":n,className:s}),t[2]=n,t[3]=o,t[4]=s,t[5]=c):c=t[5];let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,K.jsx)(S,{className:`size-3.5`}),t[6]=l):l=t[6];let u;t[7]===c?u=t[8]:(u=(0,K.jsx)(F,{render:c,children:l}),t[7]=c,t[8]=u);let d;t[9]===a?d=t[10]:(d=(0,K.jsx)(I,{side:`top`,children:a}),t[9]=a,t[10]=d);let f;return t[11]!==u||t[12]!==d?(f=(0,K.jsxs)(L,{children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function Le(e){let t=(0,W.c)(5),{identifiers:n,focusable:r}=e,i=r===void 0||r;if(n.length===0)return null;let a;t[0]===n?a=t[1]:(a=n.length===1?`Unknown condition: ${n[0]}`:`Unknown conditions: ${n.join(`, `)}`,t[0]=n,t[1]=a);let o=a,s;return t[2]!==i||t[3]!==o?(s=(0,K.jsx)(Ie,{label:o,focusable:i,className:`size-4.5`,children:`P4 Code does not recognize this condition yet. It can still be saved, but it may not match unless the runtime provides it.`}),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}function X(e){let t=(0,W.c)(4),{labels:n}=e;if(n.length===0)return null;let r;t[0]===n?r=t[1]:(r=n.length===1?`Conflicts with ${n[0]}.`:`Conflicts with ${n.slice(0,3).join(`, `)}${n.length>3?`, and more`:``}.`,t[0]=n,t[1]=r);let i=r,a;return t[2]===i?a=t[3]:(a=(0,K.jsxs)(Ie,{label:i,children:[i,` The most recent matching binding wins when both conditions can apply.`]}),t[2]=i,t[3]=a),a}function Re(e){let t=(0,W.c)(25),{value:n,variables:r,unknownIdentifiers:i,onChange:a}=e,o;if(t[0]!==n||t[1]!==r){let e;t[3]===n?e=t[4]:(e=e=>e===n,t[3]=n,t[4]=e),o=r.find(e),t[0]=n,t[1]=r,t[2]=o}else o=t[2];let s=o,c;t[5]!==s||t[6]!==n||t[7]!==r?(c=s||r.some(e=>e===n)?r:[n,...r],t[5]=s,t[6]=n,t[7]=r,t[8]=c):c=t[8];let l=c,u;t[9]===a?u=t[10]:(u=e=>e&&a(e),t[9]=a,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(E,{placeholder:`Condition`}),t[11]=d):d=t[11];let f;t[12]===i?f=t[13]:(f=i&&i.length>0?(0,K.jsx)(Le,{identifiers:i,focusable:!1}):null,t[12]=i,t[13]=f);let p;t[14]===f?p=t[15]:(p=(0,K.jsxs)(O,{size:`compact`,className:`min-w-0 flex-1`,children:[d,f]}),t[14]=f,t[15]=p);let m;t[16]===l?m=t[17]:(m=l.map(ze),t[16]=l,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,K.jsx)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:m}),t[18]=m,t[19]=h);let g;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==n?(g=(0,K.jsxs)(k,{value:n,onValueChange:u,children:[p,h]}),t[20]=u,t[21]=p,t[22]=h,t[23]=n,t[24]=g):g=t[24],g}function ze(e){return(0,K.jsx)(T,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:e})},e)}function Be(e){let t=(0,W.c)(14),{label:n,className:r,onRemove:i}=e,a;t[0]===r?a=t[1]:(a=v(`size-7`,r),t[0]=r,t[1]=a);let o;t[2]!==n||t[3]!==i||t[4]!==a?(o=(0,K.jsx)(m,{type:`button`,variant:`ghost`,size:`icon-sm`,className:a,"aria-label":n,onClick:i}),t[2]=n,t[3]=i,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(x,{"aria-hidden":!0,className:`size-3.5`}),t[6]=s):s=t[6];let c;t[7]===o?c=t[8]:(c=(0,K.jsx)(F,{delay:200,render:o,children:s}),t[7]=o,t[8]=c);let l;t[9]===n?l=t[10]:(l=(0,K.jsx)(I,{side:`top`,children:n}),t[9]=n,t[10]=l);let u;return t[11]!==c||t[12]!==l?(u=(0,K.jsxs)(L,{children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function Z(e){let t=(0,W.c)(81),{node:n,variables:r,depth:i,onChange:a,onRemove:o}=e,c=i===void 0?0:i,l;if(t[0]!==c||t[1]!==n||t[2]!==a||t[3]!==o||t[4]!==r){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Me(n);if(e){let i=Ce(e.identifier)?[]:[e.identifier],s;t[6]!==n||t[7]!==a?(s=e=>a(Pe(n,e)),t[6]=n,t[7]=a,t[8]=s):s=t[8];let u=`Negate ${e.identifier}`,d;t[9]!==e||t[10]!==s||t[11]!==u?(d=(0,K.jsx)(R,{pressed:e.negated,onPressedChange:s,"aria-label":u,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[9]=e,t[10]=s,t[11]=u,t[12]=d):d=t[12];let f;t[13]!==n||t[14]!==a?(f=e=>a(Ne(n,e)),t[13]=n,t[14]=a,t[15]=f):f=t[15];let p;t[16]!==e||t[17]!==f||t[18]!==i||t[19]!==r?(p=(0,K.jsx)(Re,{value:e.identifier,variables:r,unknownIdentifiers:i,onChange:f}),t[16]=e,t[17]=f,t[18]=i,t[19]=r,t[20]=p):p=t[20];let m;t[21]!==c||t[22]!==n||t[23]!==o?(m=o?(0,K.jsx)(Be,{label:H(n,c),onRemove:o}):null,t[21]=c,t[22]=n,t[23]=o,t[24]=m):m=t[24];let h;t[25]!==d||t[26]!==p||t[27]!==m?(h=(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border/70 bg-background/60 px-2 py-2`,children:[d,p,m]}),t[25]=d,t[26]=p,t[27]=m,t[28]=h):h=t[28],l=h;break bb0}}t[0]=c,t[1]=n,t[2]=a,t[3]=o,t[4]=r,t[5]=l}else l=t[5];if(l!==Symbol.for(`react.early_return_sentinel`))return l;if(n.type===`not`){let e=c>0&&`border-border/50 bg-background/50`,i;t[29]===e?i=t[30]:(i=v(`space-y-2 rounded-lg border border-border/70 bg-muted/20 p-2`,e),t[29]=e,t[30]=i);let s;t[31]!==n||t[32]!==a?(s=(0,K.jsx)(R,{pressed:!0,onPressedChange:e=>a(e?n:n.node),"aria-label":`Negate group`,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[31]=n,t[32]=a,t[33]=s):s=t[33];let l;t[34]!==c||t[35]!==n||t[36]!==o?(l=o?(0,K.jsx)(Be,{label:H(n,c),className:`ml-auto`,onRemove:o}):null,t[34]=c,t[35]=n,t[36]=o,t[37]=l):l=t[37];let u;t[38]!==s||t[39]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s,l]}),t[38]=s,t[39]=l,t[40]=u):u=t[40];let d,f;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{className:`absolute top-0 bottom-0 left-1.5 w-px bg-border/70`,"aria-hidden":!0}),f=(0,K.jsx)(`span`,{className:`absolute top-4 left-1.5 h-px w-2.5 bg-border/70`,"aria-hidden":!0}),t[41]=d,t[42]=f):(d=t[41],f=t[42]);let p=c+1,m;t[43]===a?m=t[44]:(m=e=>a({type:`not`,node:e}),t[43]=a,t[44]=m);let h;t[45]!==n.node||t[46]!==p||t[47]!==m||t[48]!==r?(h=(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[d,f,(0,K.jsx)(Z,{node:n.node,variables:r,depth:p,onChange:m})]}),t[45]=n.node,t[46]=p,t[47]=m,t[48]=r,t[49]=h):h=t[49];let g;return t[50]!==h||t[51]!==i||t[52]!==u?(g=(0,K.jsxs)(`div`,{className:i,children:[u,h]}),t[50]=h,t[51]=i,t[52]=u,t[53]=g):g=t[53],g}let u=n.type===`or`?`or`:`and`,d,f,p,h;if(t[54]!==c||t[55]!==n||t[56]!==a||t[57]!==o||t[58]!==u||t[59]!==r){let e=je(n,u),i=new Map,l=e.map(e=>{let t=`${e.type}-${U(e)}`,n=i.get(t)??0;return i.set(t,n+1),{child:e,key:n===0?t:`${t}-${n}`}}),g=(t,n)=>{let r=!1,i=J(e.map(e=>!r&&e===t?(r=!0,n):e),u);i&&a(i)},_=t=>{let n=!1,r=J(e.filter(e=>!n&&e===t?(n=!0,!1):!0),u);a(r||Y())},y=t=>{if(t===u)return;let n=J(e,t);n&&a(n)},b=()=>{let t=J([...e,Y()],u);t&&a(t)},x=()=>{let t={type:u===`and`?`or`:`and`,left:Y(),right:{type:`not`,node:Y()}},n=J([...e,t],u);n&&a(n)},S=c>0&&`border-border/70 bg-background/55`;t[64]===S?p=t[65]:(p=v(`space-y-2 rounded-lg border border-border/60 bg-muted/10 p-2`,S),t[64]=S,t[65]=p);let C;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(O,{size:`compact`,className:`w-24`,children:(0,K.jsx)(E,{})}),t[66]=C):C=t[66];let w;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsxs)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,children:[(0,K.jsx)(T,{value:`and`,children:`and`}),(0,K.jsx)(T,{value:`or`,children:`or`})]}),t[67]=w):w=t[67];let A;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,K.jsx)(s,{className:`size-3.5`}),t[68]=A):A=t[68];let j;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,K.jsx)(s,{className:`size-3.5`}),t[69]=j):j=t[69];let M;t[70]!==c||t[71]!==n||t[72]!==o?(M=o?(0,K.jsx)(Be,{label:H(n,c),className:`ml-auto`,onRemove:o}):null,t[70]=c,t[71]=n,t[72]=o,t[73]=M):M=t[73],h=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(k,{value:u,onValueChange:e=>y(e),children:[C,w]}),(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:b,children:[A,`Condition`]}),(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:x,children:[j,`Group`]}),M]}),d=`space-y-2`,f=l.map(e=>{let{child:t,key:n}=e;return(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[(0,K.jsx)(`span`,{className:v(`absolute top-0 bottom-0 left-1.5 w-px`,c===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(`span`,{className:v(`absolute top-4 left-1.5 h-px w-2.5`,c===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(Z,{node:t,variables:r,depth:c+1,onChange:e=>g(t,e),onRemove:()=>_(t)})]},n)}),t[54]=c,t[55]=n,t[56]=a,t[57]=o,t[58]=u,t[59]=r,t[60]=d,t[61]=f,t[62]=p,t[63]=h}else d=t[60],f=t[61],p=t[62],h=t[63];let g;t[74]!==d||t[75]!==f?(g=(0,K.jsx)(`div`,{className:d,children:f}),t[74]=d,t[75]=f,t[76]=g):g=t[76];let _;return t[77]!==p||t[78]!==h||t[79]!==g?(_=(0,K.jsxs)(`div`,{className:p,children:[h,g]}),t[77]=p,t[78]=h,t[79]=g,t[80]=_):_=t[80],_}function Ve(e){let t=(0,W.c)(60),{value:n,variables:r,onChange:i,onValidityChange:a}=e,o;t[0]===n?o=t[1]:(o=U(n),t[0]=n,t[1]=o);let[c,l]=(0,G.useState)(o),d;t[2]===c?d=t[3]:(d=Te(c),t[2]=c,t[3]=d);let f=d,p=f.ok?null:f.message,h;t[4]!==f.ok||t[5]!==f.value?(h=f.ok?_e(f.value):[],t[4]=f.ok,t[5]=f.value,t[6]=h):h=t[6];let g=h,_;t[7]!==i||t[8]!==a?(_=e=>{l(e);let t=Te(e);a?.(t.ok),t.ok&&i(t.value)},t[7]=i,t[8]=a,t[9]=_):_=t[9];let v=_,y;t[10]!==i||t[11]!==a?(y=e=>{l(U(e)),a?.(!0),i(e)},t[10]=i,t[11]=a,t[12]=y):y=t[12];let b=y,x;t[13]!==b||t[14]!==n?(x=()=>{if(!n){b(Y());return}b({type:`and`,left:n,right:Y()})},t[13]=b,t[14]=n,t[15]=x):x=t[15];let S=x,C;t[16]!==b||t[17]!==n?(C=()=>{let e=Fe(`or`);if(!n){b(e);return}b({type:`and`,left:n,right:e})},t[16]=b,t[17]=n,t[18]=C):C=t[18];let w=C,T;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,K.jsx)(`div`,{className:`min-w-0`,children:(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`When`})}),t[19]=T):T=t[19];let E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,K.jsx)(s,{className:`size-3.5`}),t[20]=E):E=t[20];let D;t[21]===S?D=t[22]:(D=(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:S,children:[E,`Condition`]}),t[21]=S,t[22]=D);let O;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,K.jsx)(s,{className:`size-3.5`}),t[23]=O):O=t[23];let k;t[24]===w?k=t[25]:(k=(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[O,`Group`]}),t[24]=w,t[25]=k);let A;t[26]!==D||t[27]!==k?(A=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[T,(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[D,k]})]}),t[26]=D,t[27]=k,t[28]=A):A=t[28];let j;t[29]===v?j=t[30]:(j=e=>v(e.currentTarget.value),t[29]=v,t[30]=j);let M=!!p,ee;t[31]!==c||t[32]!==j||t[33]!==M?(ee=(0,K.jsx)(ce,{value:c,onChange:j,placeholder:`Always`,"aria-invalid":M,"aria-label":`When expression`,size:`compact`,font:`mono`}),t[31]=c,t[32]=j,t[33]=M,t[34]=ee):ee=t[34];let N;t[35]===g?N=t[36]:(N=g.length>0?(0,K.jsx)(se,{align:`inline-end`,children:(0,K.jsx)(Le,{identifiers:g})}):null,t[35]=g,t[36]=N);let te;t[37]!==ee||t[38]!==N?(te=(0,K.jsxs)(B,{children:[ee,N]}),t[37]=ee,t[38]=N,t[39]=te):te=t[39];let P;t[40]===p?P=t[41]:(P=p?(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-2xs text-destructive`,children:[(0,K.jsx)(u,{className:`size-3.5`}),p]}):null,t[40]=p,t[41]=P);let ne;t[42]!==te||t[43]!==P?(ne=(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[te,P]}),t[42]=te,t[43]=P,t[44]=ne):ne=t[44];let F;t[45]!==S||t[46]!==w||t[47]!==b||t[48]!==n||t[49]!==r?(F=n?(0,K.jsx)(Z,{node:n,variables:r,onChange:b,onRemove:()=>b(void 0)}):(0,K.jsx)(`div`,{className:`rounded-md border border-dashed border-border/80 bg-muted/15 p-3`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(m,{type:`button`,size:`compact`,onClick:S,children:[(0,K.jsx)(s,{className:`size-3.5`}),`Condition`]}),(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[(0,K.jsx)(s,{className:`size-3.5`}),`Group`]})]})}),t[45]=S,t[46]=w,t[47]=b,t[48]=n,t[49]=r,t[50]=F):F=t[50];let I;t[51]===p?I=t[52]:(I=p?(0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center rounded-lg border border-destructive/30 bg-background/75 p-4 text-center text-xs text-destructive backdrop-blur-xs`,children:`Fix the expression above to continue editing visually.`}):null,t[51]=p,t[52]=I);let L;t[53]!==F||t[54]!==I?(L=(0,K.jsxs)(`div`,{className:`relative`,children:[F,I]}),t[53]=F,t[54]=I,t[55]=L):L=t[55];let R;return t[56]!==A||t[57]!==ne||t[58]!==L?(R=(0,K.jsxs)(`div`,{className:`w-[min(34rem,calc(100vw-2rem))] space-y-3`,children:[A,ne,L]}),t[56]=A,t[57]=ne,t[58]=L,t[59]=R):R=t[59],R}function He(e){return{keyDraft:e.key,whenDraft:e.binding.whenAst,isRecording:!1,isWhenDraftValid:!0}}function Q(e,t){return{...e,...t}}function Ue(e){return{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}}function We(e){let t=(0,W.c)(27),{row:n,allRows:r,onSave:i}=e,[a,o]=(0,G.useReducer)(Q,n,He),{keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u}=a,d,f,p;t[0]!==r||t[1]!==s||t[2]!==n.id||t[3]!==n.key||t[4]!==n.when||t[5]!==c?(p=U(c),d=s!==n.key||p!==n.when,f=ge(r,{rowId:n.id,key:s,when:p}),t[0]=r,t[1]=s,t[2]=n.id,t[3]=n.key,t[4]=n.when,t[5]=c,t[6]=d,t[7]=f,t[8]=p):(d=t[6],f=t[7],p=t[8]);let m=f,h;t[9]!==s||t[10]!==i||t[11]!==n||t[12]!==p?(h=()=>{i({command:n.command,key:s,when:p.trim().length>0?p:void 0,replace:Ue(n)})},t[9]=s,t[10]=i,t[11]=n,t[12]=p,t[13]=h):h=t[13];let g=h,_;t[14]!==l||t[15]!==n.key?(_=e=>{if(e.key===`Tab`&&!l)return;if(e.preventDefault(),e.key===`Escape`){o({keyDraft:n.key,isRecording:!1});return}let t=ye(e.nativeEvent,navigator.platform);t&&o({keyDraft:t,isRecording:!1})},t[14]=l,t[15]=n.key,t[16]=_):_=t[16];let v=_,y;return t[17]!==v||t[18]!==m||t[19]!==d||t[20]!==l||t[21]!==u||t[22]!==s||t[23]!==g||t[24]!==c||t[25]!==p?(y={keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u,whenDraftExpression:p,isDirty:d,conflictLabels:m,setDraft:o,save:g,captureKeybinding:v},t[17]=v,t[18]=m,t[19]=d,t[20]=l,t[21]=u,t[22]=s,t[23]=g,t[24]=c,t[25]=p,t[26]=y):y=t[26],y}function Ge(e){let t=(0,W.c)(19),{row:n,editor:r,isSaving:i,pillClassName:a}=e,{keyDraft:o,isRecording:s,isDirty:c,isWhenDraftValid:l,setDraft:u,save:d,captureKeybinding:f}=r,p=!s&&o===n.key&&n.key.length>0&&!c,h;t[0]!==c||t[1]!==i||t[2]!==l||t[3]!==o||t[4]!==d?(h=c?(0,K.jsx)(m,{size:`sm`,disabled:i||o.trim().length===0||!l,onClick:d,children:i?`Saving`:`Save`}):null,t[0]=c,t[1]=i,t[2]=l,t[3]=o,t[4]=d,t[5]=h):h=t[5];let g;t[6]!==f||t[7]!==s||t[8]!==o||t[9]!==a||t[10]!==n.binding||t[11]!==n.command||t[12]!==n.key||t[13]!==u||t[14]!==p?(g=p?(0,K.jsx)(`button`,{type:`button`,onClick:()=>u({isRecording:!0}),"aria-label":`Edit shortcut for ${V(n.command)}: ${ie(n.binding.shortcut)}`,className:v(`inline-flex h-8 cursor-pointer items-center rounded-md border border-transparent px-1.5 sm:h-7 outline-none transition-colors hover:border-border/70 hover:bg-accent focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring/24`,a),children:(0,K.jsx)(q,{value:n.key})}):(0,K.jsx)(re,{"data-keybinding-capture":``,autoFocus:s,"aria-label":`Keybinding for ${V(n.command)}`,value:s?``:o,placeholder:s?`Press shortcut`:`Unassigned`,size:`sm`,font:`mono`,className:`w-44`,onFocus:()=>u({isRecording:!0}),onBlur:()=>u({isRecording:!1}),onChange:e=>u({keyDraft:e.currentTarget.value}),onKeyDown:f}),t[6]=f,t[7]=s,t[8]=o,t[9]=a,t[10]=n.binding,t[11]=n.command,t[12]=n.key,t[13]=u,t[14]=p,t[15]=g):g=t[15];let _;return t[16]!==h||t[17]!==g?(_=(0,K.jsxs)(K.Fragment,{children:[h,g]}),t[16]=h,t[17]=g,t[18]=_):_=t[18],_}function $(e){let t=(0,W.c)(17),{label:n,expression:r,value:i,variables:a,onChange:o,onValidityChange:s}=e,c=r?`ghost`:`ghost-muted`,l;t[0]===c?l=t[1]:(l=(0,K.jsx)(m,{variant:c,size:`micro`,className:`min-w-0 shrink`}),t[0]=c,t[1]=l);let u=`Edit when clause for ${n}`,d=r||`Always`,f;t[2]===d?f=t[3]:(f=(0,K.jsx)(`span`,{className:`truncate font-mono`,children:d}),t[2]=d,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(g,{className:`size-3.5 shrink-0 opacity-60`}),t[4]=p):p=t[4];let h;t[5]!==l||t[6]!==u||t[7]!==f?(h=(0,K.jsxs)(oe,{render:l,"aria-label":u,children:[f,p]}),t[5]=l,t[6]=u,t[7]=f,t[8]=h):h=t[8];let _;t[9]!==o||t[10]!==s||t[11]!==i||t[12]!==a?(_=(0,K.jsx)(ae,{align:`start`,sideOffset:6,children:(0,K.jsx)(Ve,{value:i,variables:a,onChange:o,onValidityChange:s})}),t[9]=o,t[10]=s,t[11]=i,t[12]=a,t[13]=_):_=t[13];let v;return t[14]!==h||t[15]!==_?(v=(0,K.jsxs)(z,{children:[h,_]}),t[14]=h,t[15]=_,t[16]=v):v=t[16],v}function Ke(e){let t=(0,W.c)(24),{row:n,isSaving:r,onReset:a,onRemove:o}=e,s=n.source===`Custom`&&n.defaultKey!==null,c=n.source!==`Default`;if(!s&&!c)return null;let l;t[0]===n.command?l=t[1]:(l=V(n.command),t[0]=n.command,t[1]=l);let u=`Actions for ${l}`,f;t[2]!==r||t[3]!==u?(f=(0,K.jsx)(m,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:r,"aria-label":u}),t[2]=r,t[3]=u,t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(h,{className:`size-3.5`}),t[5]=p):p=t[5];let g;t[6]===f?g=t[7]:(g=(0,K.jsx)(b,{render:f,children:p}),t[6]=f,t[7]=g);let _;t[8]!==s||t[9]!==r||t[10]!==a||t[11]!==n?(_=s?(0,K.jsx)(i,{disabled:r,onClick:()=>a(n),children:`Reset to default`}):null,t[8]=s,t[9]=r,t[10]=a,t[11]=n,t[12]=_):_=t[12];let v;t[13]!==c||t[14]!==r||t[15]!==o||t[16]!==n?(v=c?(0,K.jsx)(i,{variant:`destructive`,disabled:r,onClick:()=>o(n),children:`Remove`}):null,t[13]=c,t[14]=r,t[15]=o,t[16]=n,t[17]=v):v=t[17];let x;t[18]!==_||t[19]!==v?(x=(0,K.jsxs)(y,{align:`end`,children:[_,v]}),t[18]=_,t[19]=v,t[20]=x):x=t[20];let S;return t[21]!==g||t[22]!==x?(S=(0,K.jsxs)(d,{children:[g,x]}),t[21]=g,t[22]=x,t[23]=S):S=t[23],S}function qe(e){let t=(0,W.c)(2),{source:n}=e;if(n===`Default`)return null;let r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(o,{variant:`outline`,size:`sm`,children:n}),t[0]=n,t[1]=r),r}function Je(e){let t=(0,W.c)(13),{row:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(`span`,{className:`flex items-center gap-2`}),t[0]=r):r=t[0];let i;t[1]===n.command?i=t[2]:(i=V(n.command),t[1]=n.command,t[2]=i);let a;t[3]===n.source?a=t[4]:(a=(0,K.jsx)(qe,{source:n.source}),t[3]=n.source,t[4]=a);let o;t[5]!==i||t[6]!==a?(o=(0,K.jsxs)(F,{render:r,children:[i,a]}),t[5]=i,t[6]=a,t[7]=o):o=t[7];let s;t[8]===n.command?s=t[9]:(s=(0,K.jsx)(I,{side:`top`,children:n.command}),t[8]=n.command,t[9]=s);let c;return t[10]!==o||t[11]!==s?(c=(0,K.jsxs)(L,{children:[o,s]}),t[10]=o,t[11]=s,t[12]=c):c=t[12],c}function Ye(e){let t=(0,W.c)(13),{row:n,editor:r,variables:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[0]=a):a=t[0];let o;t[1]===n.command?o=t[2]:(o=V(n.command),t[1]=n.command,t[2]=o);let s,c;t[3]===r?(s=t[4],c=t[5]):(s=e=>r.setDraft({whenDraft:e}),c=e=>r.setDraft({isWhenDraftValid:e}),t[3]=r,t[4]=s,t[5]=c);let l;return t[6]!==r.whenDraft||t[7]!==r.whenDraftExpression||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==i?(l=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[a,(0,K.jsx)($,{label:o,expression:r.whenDraftExpression,value:r.whenDraft,variables:i,onChange:s,onValidityChange:c})]}),t[6]=r.whenDraft,t[7]=r.whenDraftExpression,t[8]=o,t[9]=s,t[10]=c,t[11]=i,t[12]=l):l=t[12],l}function Xe(e){let t=(0,W.c)(2),n;return t[0]===e?n=t[1]:(n=(0,K.jsx)(`span`,{className:`flex items-center opacity-0 transition-opacity group-focus-within/row:opacity-100 group-hover/row:opacity-100 has-data-popup-open:opacity-100 pointer-coarse:opacity-100`,children:(0,K.jsx)(Ke,{...e})}),t[0]=e,t[1]=n),n}function Ze(e){let t=(0,W.c)(30),{row:n,isSaving:r,anchorId:i,allRows:a,variables:o,onSave:s,onReset:c,onRemove:l}=e,u;t[0]!==a||t[1]!==s||t[2]!==n?(u={row:n,allRows:a,onSave:s},t[0]=a,t[1]=s,t[2]=n,t[3]=u):u=t[3];let d=We(u),f;t[4]===n?f=t[5]:(f=(0,K.jsx)(Je,{row:n}),t[4]=n,t[5]=f);let p;t[6]!==d||t[7]!==n||t[8]!==o?(p=(0,K.jsx)(Ye,{row:n,editor:d,variables:o}),t[6]=d,t[7]=n,t[8]=o,t[9]=p):p=t[9];let m;t[10]===d.conflictLabels?m=t[11]:(m=(0,K.jsx)(X,{labels:d.conflictLabels}),t[10]=d.conflictLabels,t[11]=m);let h;t[12]!==r||t[13]!==l||t[14]!==c||t[15]!==n?(h=(0,K.jsx)(Xe,{row:n,isSaving:r,onReset:c,onRemove:l}),t[12]=r,t[13]=l,t[14]=c,t[15]=n,t[16]=h):h=t[16];let g;t[17]!==d||t[18]!==r||t[19]!==n?(g=(0,K.jsx)(Ge,{row:n,editor:d,isSaving:r,pillClassName:`-mr-1.5`}),t[17]=d,t[18]=r,t[19]=n,t[20]=g):g=t[20];let _;t[21]!==m||t[22]!==h||t[23]!==g?(_=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[m,h,g]}),t[21]=m,t[22]=h,t[23]=g,t[24]=_):_=t[24];let v;return t[25]!==i||t[26]!==f||t[27]!==p||t[28]!==_?(v=(0,K.jsx)(pe,{id:i,className:`group/row rounded-none`,title:f,description:p,control:_}),t[25]=i,t[26]=f,t[27]=p,t[28]=_,t[29]=v):v=t[29],v}function Qe(e){let t=(0,W.c)(30),{allRows:n,onSave:r}=e,[i,a]=(0,G.useState)(``),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={keyDraft:``,whenDraft:void 0,isRecording:!1,isWhenDraftValid:!0},t[0]=o):o=t[0];let[s,c]=(0,G.useReducer)(Q,o),{keyDraft:l,whenDraft:u,isRecording:d,isWhenDraftValid:f}=s,p,m;t[1]!==n||t[2]!==l||t[3]!==u?(m=U(u),p=ge(n,{rowId:`new`,key:l,when:m}),t[1]=n,t[2]=l,t[3]=u,t[4]=p,t[5]=m):(p=t[4],m=t[5]);let h=p,g;t[6]===i?g=t[7]:(g=i?V(i):`new keybinding`,t[6]=i,t[7]=g);let _=g,v;t[8]!==i||t[9]!==f||t[10]!==l?(v=!!i&&l.trim().length>0&&f,t[8]=i,t[9]=f,t[10]=l,t[11]=v):v=t[11];let y=v,b;t[12]!==i||t[13]!==l||t[14]!==r||t[15]!==m?(b=()=>{i&&r({command:i,key:l,...m.trim().length>0?{when:m}:{}})},t[12]=i,t[13]=l,t[14]=r,t[15]=m,t[16]=b):b=t[16];let x=b,S;t[17]===d?S=t[18]:(S=e=>{if(e.key===`Tab`&&!d)return;if(e.preventDefault(),e.key===`Escape`){c({keyDraft:``,isRecording:!1});return}let t=ye(e.nativeEvent,navigator.platform);t&&c({keyDraft:t,isRecording:!1})},t[17]=d,t[18]=S);let C=S,w;return t[19]!==y||t[20]!==C||t[21]!==i||t[22]!==_||t[23]!==h||t[24]!==d||t[25]!==l||t[26]!==x||t[27]!==u||t[28]!==m?(w={commandDraft:i,setCommandDraft:a,keyDraft:l,whenDraft:u,whenDraftExpression:m,isRecording:d,conflictLabels:h,commandLabelText:_,canSave:y,setDraft:c,save:x,captureKeybinding:C},t[19]=y,t[20]=C,t[21]=i,t[22]=_,t[23]=h,t[24]=d,t[25]=l,t[26]=x,t[27]=u,t[28]=m,t[29]=w):w=t[29],w}function $e(e){let t=(0,W.c)(14),{draft:n,commandOptions:r,className:i}=e,a=n.commandDraft,o;t[0]===n?o=t[1]:(o=e=>n.setCommandDraft(e),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(E,{placeholder:`Command`}),t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=(0,K.jsx)(O,{size:`sm`,className:i,children:s}),t[3]=i,t[4]=c);let l;t[5]===r?l=t[6]:(l=r.map(et),t[5]=r,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,K.jsx)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:l}),t[7]=l,t[8]=u);let d;return t[9]!==n.commandDraft||t[10]!==o||t[11]!==c||t[12]!==u?(d=(0,K.jsxs)(k,{value:a,onValueChange:o,children:[c,u]}),t[9]=n.commandDraft,t[10]=o,t[11]=c,t[12]=u,t[13]=d):d=t[13],d}function et(e){return(0,K.jsx)(T,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:V(e)})},e)}function tt(e){let t=(0,W.c)(14),{draft:n,autoFocus:r,className:i}=e,a=r!==void 0&&r,o=`Keybinding for ${n.commandLabelText}`,s=n.isRecording?``:n.keyDraft,c=n.isRecording?`Press shortcut`:`Unassigned`,l,u,d;t[0]===n?(l=t[1],u=t[2],d=t[3]):(l=()=>n.setDraft({isRecording:!0}),u=()=>n.setDraft({isRecording:!1}),d=e=>n.setDraft({keyDraft:e.currentTarget.value}),t[0]=n,t[1]=l,t[2]=u,t[3]=d);let f;return t[4]!==a||t[5]!==i||t[6]!==n.captureKeybinding||t[7]!==o||t[8]!==s||t[9]!==c||t[10]!==l||t[11]!==u||t[12]!==d?(f=(0,K.jsx)(re,{"data-keybinding-capture":``,autoFocus:a,"aria-label":o,value:s,placeholder:c,size:`sm`,font:`mono`,className:i,onFocus:l,onBlur:u,onChange:d,onKeyDown:n.captureKeybinding}),t[4]=a,t[5]=i,t[6]=n.captureKeybinding,t[7]=o,t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function nt(e){let t=(0,W.c)(10),{draft:n,variables:r}=e,i,a;t[0]===n?(i=t[1],a=t[2]):(i=e=>n.setDraft({whenDraft:e}),a=e=>n.setDraft({isWhenDraftValid:e}),t[0]=n,t[1]=i,t[2]=a);let o;return t[3]!==n.commandLabelText||t[4]!==n.whenDraft||t[5]!==n.whenDraftExpression||t[6]!==i||t[7]!==a||t[8]!==r?(o=(0,K.jsx)($,{label:n.commandLabelText,expression:n.whenDraftExpression,value:n.whenDraft,variables:r,onChange:i,onValidityChange:a}),t[3]=n.commandLabelText,t[4]=n.whenDraft,t[5]=n.whenDraftExpression,t[6]=i,t[7]=a,t[8]=r,t[9]=o):o=t[9],o}function rt(e){let t=(0,W.c)(9),{isSaving:n,onCancel:r}=e,i;t[0]!==n||t[1]!==r?(i=(0,K.jsx)(m,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:n,"aria-label":`Cancel new keybinding`,onClick:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(_,{className:`size-3.5`}),t[3]=a):a=t[3];let o;t[4]===i?o=t[5]:(o=(0,K.jsx)(F,{render:i,children:a}),t[4]=i,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(I,{side:`top`,children:`Cancel`}),t[6]=s):s=t[6];let c;return t[7]===o?c=t[8]:(c=(0,K.jsxs)(L,{children:[o,s]}),t[7]=o,t[8]=c),c}function it(e){let t=(0,W.c)(30),{commandOptions:n,allRows:r,variables:i,isSaving:a,onSave:o,onCancel:s}=e,c;t[0]!==r||t[1]!==o?(c={allRows:r,onSave:o},t[0]=r,t[1]=o,t[2]=c):c=t[2];let l=Qe(c),u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[3]=u):u=t[3];let d;t[4]!==l||t[5]!==i?(d=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[u,(0,K.jsx)(nt,{draft:l,variables:i})]}),t[4]=l,t[5]=i,t[6]=d):d=t[6];let f;t[7]!==n||t[8]!==l?(f=(0,K.jsx)($e,{draft:l,commandOptions:n,className:`w-56`}),t[7]=n,t[8]=l,t[9]=f):f=t[9];let p;t[10]===l.conflictLabels?p=t[11]:(p=(0,K.jsx)(X,{labels:l.conflictLabels}),t[10]=l.conflictLabels,t[11]=p);let h;t[12]===l?h=t[13]:(h=(0,K.jsx)(tt,{draft:l,className:`w-44`}),t[12]=l,t[13]=h);let g=a||!l.canSave,_=a?`Saving`:`Save`,v;t[14]!==l.save||t[15]!==g||t[16]!==_?(v=(0,K.jsx)(m,{size:`sm`,disabled:g,onClick:l.save,children:_}),t[14]=l.save,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y;t[18]!==a||t[19]!==s?(y=(0,K.jsx)(rt,{isSaving:a,onCancel:s}),t[18]=a,t[19]=s,t[20]=y):y=t[20];let b;t[21]!==f||t[22]!==p||t[23]!==h||t[24]!==v||t[25]!==y?(b=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[f,p,h,v,y]}),t[21]=f,t[22]=p,t[23]=h,t[24]=v,t[25]=y,t[26]=b):b=t[26];let x;return t[27]!==b||t[28]!==d?(x=(0,K.jsx)(pe,{className:`bg-muted/15`,title:`New keybinding`,description:d,control:b}),t[27]=b,t[28]=d,t[29]=x):x=t[29],x}function at(e){let{groups:t,anchorIds:n,savingCommand:r,...i}=e;return t.map(e=>(0,K.jsx)(he,{id:`keybindings-${e.id}`,title:e.title,children:e.rows.map(e=>(0,K.jsx)(Ze,{row:e,anchorId:n.get(e.id),isSaving:r===e.command,...i},e.id))},e.id))}function ot(){let e=(0,W.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(L,{children:[(0,K.jsx)(F,{delay:200,render:(0,K.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`The browser may claim some shortcuts first. The desktop app receives them all.`,children:(0,K.jsx)(S,{className:`size-3.5 text-warning`})})}),(0,K.jsx)(I,{side:`top`,className:`max-w-72`,children:`The browser may claim some shortcuts first. The desktop app receives them all.`})]}),e[0]=t):t=e[0],t}function st(){let e=(0,W.c)(83),{environment:t,connectedEnvironments:n}=de(),r=ee(t?.environmentId??null,c),i=te(n,l),o;e[0]!==n||e[1]!==i?(o=n.length>0&&n.every(e=>i.has(e.environmentId)),e[0]=n,e[1]=i,e[2]=o):o=e[2];let u=o,d=t?.serverConfig?.keybindings,f;e[3]===d?f=e[4]:(f=d??[],e[3]=d,e[4]=f);let h;e[5]===f?h=e[6]:(h=a(f),e[5]=f,e[6]=h);let g=h,_=t?.serverConfig?.keybindingsConfigPath??null,v;e[7]===t?.serverConfig?.availableEditors?v=e[8]:(v=t?.serverConfig?.availableEditors??[],e[7]=t?.serverConfig?.availableEditors,e[8]=v);let y=v,b;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(b={reportFailure:!1},e[9]=b):b=e[9];let x=P(M.upsertKeybinding,b),S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S={reportFailure:!1},e[10]=S):S=e[10];let T=P(M.removeKeybinding,S),E=Ee(t?.environmentId??null,y),[D,O]=(0,G.useState)(``),k=(0,G.useRef)(null),[R,re]=(0,G.useState)(null),[ie,ae]=(0,G.useState)(!1),oe;e[11]!==g||e[12]!==D?(oe=Se(g,D),e[11]=g,e[12]=D,e[13]=oe):oe=e[13];let z=oe,se;e[14]===z?se=e[15]:(se=xe(z),e[14]=z,e[15]=se);let ce=se,B;if(e[16]!==z){B=new Map;let t=new Set;for(let e of z)t.has(e.command)||(t.add(e.command),B.set(e.id,Oe(e.command)));e[16]=z,e[17]=B}else B=e[17];let le=B,ue;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(ue={select:ft},e[18]=ue):ue=e[18];let pe=A(ue),[V,ge]=(0,G.useState)(pe);pe!==V&&(ge(pe),pe.startsWith(`keybinding-`)&&O(``));let _e;e[19]===g?_e=e[20]:(_e=be(g),e[19]=g,e[20]=_e);let ye=_e,H;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(H=ve(),e[21]=H):H=e[21];let U=H,Ce;e[22]!==_||e[23]!==E||e[24]!==t?(Ce=()=>{_&&t&&N(t.environmentId,`orchestration:operate`)&&(async()=>{let e=await E(_);if(e._tag===`Success`||C(e))return;let t=w(e);j.add({title:`Unable to open keybindings file`,description:t instanceof Error?t.message:`The keybindings file was not opened.`,type:`error`})})()},e[22]=_,e[23]=E,e[24]=t,e[25]=Ce):Ce=e[25];let we=Ce,Te;e[26]!==n||e[27]!==t||e[28]!==x?(Te=e=>{if(!t||!n.every(dt))return;re(e.command);let r={command:e.command,key:e.key.trim(),...e.when?.trim()?{when:e.when.trim()}:{},...e.replace?{replace:e.replace}:{}};(async()=>{let e=await Promise.all(n.map(e=>x({environmentId:e.environmentId,input:r})));re(null);let t=e.find(ut);if(!t){ae(!1);return}if(!C(t)){let e=w(t);j.add({title:`Unable to save keybinding`,description:e instanceof Error?e.message:`The keybinding was not saved.`,type:`error`})}})()},e[26]=n,e[27]=t,e[28]=x,e[29]=Te):Te=e[29];let q=Te,ke;e[30]!==n||e[31]!==t||e[32]!==T?(ke=e=>{t&&n.every(lt)&&(re(e.command),(async()=>{let t=await Promise.all(n.map(t=>T({environmentId:t.environmentId,input:Ue(e)})));re(null);let r=t.find(ct)??t[0];if(r?._tag===`Failure`&&!C(r)){let e=w(r);j.add({title:`Unable to remove keybinding`,description:e instanceof Error?e.message:`The keybinding was not removed.`,type:`error`})}})())},e[30]=n,e[31]=t,e[32]=T,e[33]=ke):ke=e[33];let je=ke,J;e[34]===q?J=e[35]:(J=e=>{e.defaultKey&&q({command:e.command,key:e.defaultKey,when:e.defaultWhen.trim().length>0?e.defaultWhen:void 0,replace:{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}})},e[34]=q,e[35]=J);let Me=J,Ne;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=()=>ae(!1),e[36]=Ne):Ne=e[36];let Pe=Ne,Y;e[37]!==je||e[38]!==Me||e[39]!==z||e[40]!==q?(Y={allRows:z,variables:U,onSave:q,onReset:Me,onRemove:je},e[37]=je,e[38]=Me,e[39]=z,e[40]=q,e[41]=Y):Y=e[41];let Fe=Y,Ie,Le;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=De(`keybindings`),Le=ne?null:(0,K.jsx)(ot,{}),e[42]=Ie,e[43]=Le):(Ie=e[42],Le=e[43]);let X;e[44]===D?X=e[45]:(X=(0,K.jsx)(Ae,{query:D,onChange:O,inputRef:k}),e[44]=D,e[45]=X);let Re=ie||!u,ze,Be;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>ae(!0),Be=(0,K.jsx)(s,{"aria-hidden":!0,className:`size-4`}),e[46]=ze,e[47]=Be):(ze=e[46],Be=e[47]);let Z;e[48]===Re?Z=e[49]:(Z=(0,K.jsxs)(m,{type:`button`,variant:`outline`,disabled:Re,onClick:ze,children:[Be,`Add keybinding`]}),e[48]=Re,e[49]=Z);let Ve=!_||!r,He;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,K.jsx)(p,{"aria-hidden":!0,className:`size-4`}),e[50]=He):He=e[50];let Q;e[51]!==we||e[52]!==Ve?(Q=(0,K.jsx)(F,{render:(0,K.jsx)(m,{type:`button`,variant:`outline`,size:`icon`,disabled:Ve,onClick:we,"aria-label":`Open keybindings.json`,children:He})}),e[51]=we,e[52]=Ve,e[53]=Q):Q=e[53];let We;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,K.jsx)(I,{side:`top`,children:`Open keybindings.json`}),e[54]=We):We=e[54];let Ge;e[55]===Q?Ge=e[56]:(Ge=(0,K.jsxs)(L,{children:[Q,We]}),e[55]=Q,e[56]=Ge);let $;e[57]!==X||e[58]!==Z||e[59]!==Ge?($=(0,K.jsx)(he,{...Ie,headerAction:Le,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-3 py-3 sm:px-4`,children:[X,Z,Ge]})}),e[57]=X,e[58]=Z,e[59]=Ge,e[60]=$):$=e[60];let Ke;e[61]!==u||e[62]!==n?(Ke=u?null:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.length===0?`Connect an environment to change keybindings.`:`This connection can view keybindings but cannot change them.`}),e[61]=u,e[62]=n,e[63]=Ke):Ke=e[63];let qe=!u,Je;e[64]!==ye||e[65]!==ie||e[66]!==z||e[67]!==q||e[68]!==R?(Je=ie?(0,K.jsx)(fe,{children:(0,K.jsx)(it,{commandOptions:ye,allRows:z,variables:U,isSaving:R!==null,onSave:q,onCancel:Pe})}):null,e[64]=ye,e[65]=ie,e[66]=z,e[67]=q,e[68]=R,e[69]=Je):Je=e[69];let Ye;e[70]!==le||e[71]!==ce||e[72]!==Fe||e[73]!==R?(Ye=ce.length>0?(0,K.jsx)(at,{groups:ce,anchorIds:le,savingCommand:R,...Fe}):(0,K.jsx)(fe,{children:(0,K.jsx)(`div`,{className:`px-4 py-12 text-center text-sm text-muted-foreground`,children:`No keybindings match your search.`})}),e[70]=le,e[71]=ce,e[72]=Fe,e[73]=R,e[74]=Ye):Ye=e[74];let Xe;e[75]!==qe||e[76]!==Je||e[77]!==Ye?(Xe=(0,K.jsxs)(`div`,{inert:qe,className:`flex flex-col gap-8`,children:[Je,Ye]}),e[75]=qe,e[76]=Je,e[77]=Ye,e[78]=Xe):Xe=e[78];let Ze;return e[79]!==$||e[80]!==Ke||e[81]!==Xe?(Ze=(0,K.jsxs)(me,{children:[$,Ke,Xe]}),e[79]=$,e[80]=Ke,e[81]=Xe,e[82]=Ze):Ze=e[82],Ze}function ct(e){return e._tag===`Failure`}function lt(e){return N(e.environmentId,l)}function ut(e){return e._tag===`Failure`}function dt(e){return N(e.environmentId,l)}function ft(e){return e.hash.replace(/^#/,``)}var pt=st;export{pt as component};
|
|
2
|
+
//# sourceMappingURL=settings.keybindings-C0FBNk1_.js.map
|