@p4code/cli 0.9.8 → 0.9.9
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-CLYknQ8Q.mjs → binCli-CQsXscQ2.mjs} +1878 -1663
- package/dist/client/.vite/manifest.json +2014 -1996
- package/dist/client/assets/{2NI2N5EU-D0DC_qzC.js → 2NI2N5EU-aTesTRUs.js} +2 -2
- package/dist/client/assets/{4UO7MD6I-CUZSFvTG.js → 4UO7MD6I-fOcXoLqw.js} +2 -2
- package/dist/client/assets/{5B3SVYGG-5ibYwkgG.js → 5B3SVYGG-CVlBycCk.js} +2 -2
- package/dist/client/assets/{5GK6JWQ2-DEtRbsDS.js → 5GK6JWQ2-UdJh1ROk.js} +2 -2
- package/dist/client/assets/{5N7A7DKN-CwQP1dKj.js → 5N7A7DKN-LpXLPis9.js} +2 -2
- package/dist/client/assets/{5OC2THR4-BriFYPQx.js → 5OC2THR4-pX1yQcrA.js} +2 -2
- package/dist/client/assets/{5S6HY5KT-BBNxENgt.js → 5S6HY5KT-CTBX-e9M.js} +2 -2
- package/dist/client/assets/{6IMQ5BUJ-xl7U-rLA.js → 6IMQ5BUJ-DL11cDPG.js} +2 -2
- package/dist/client/assets/{6OLKWJ4F-BGGDxoUW.js → 6OLKWJ4F-TXqcGdqI.js} +2 -2
- package/dist/client/assets/{74OO7NKP-9vkDTl8T.js → 74OO7NKP-DNrMi93b.js} +2 -2
- package/dist/client/assets/{75O6YZUN-B9ocscUs.js → 75O6YZUN-CwCbVMzG.js} +2 -2
- package/dist/client/assets/{77XECAW3-DQ3S_7U7.js → 77XECAW3-BuuKvNS0.js} +2 -2
- package/dist/client/assets/{ABYRPUBD-DFu3UszL.js → ABYRPUBD-BxNthVYO.js} +2 -2
- package/dist/client/assets/AlertDialogRoot-BDlDnUeW.js +2 -0
- package/dist/client/assets/{AnimatedHeight-DEH7bEtg.js → AnimatedHeight-Baj5Pa60.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-DDlvsg4m.js → AuthSurfaceShell-DCBmguf9.js} +2 -2
- package/dist/client/assets/{BB2UYUI2-DzdR7ZyB.js → BB2UYUI2-Bg3EJQg5.js} +2 -2
- package/dist/client/assets/{BUM34MOA-LkeHTV8a.js → BUM34MOA-CgVaLfn6.js} +2 -2
- package/dist/client/assets/{CEQABKGZ-BX1CWous.js → CEQABKGZ-BpDmef7u.js} +2 -2
- package/dist/client/assets/{CXAC5362-DMlUWuvv.js → CXAC5362-uHOdbo6J.js} +2 -2
- package/dist/client/assets/ChatGptUsageButton-CcLiWo0d.js +2 -0
- package/dist/client/assets/ChatMarkdown-DQk9NI7y.js +48 -0
- package/dist/client/assets/{CheckboxIndicator-DSA5Ujdj.js → CheckboxIndicator-CvUY7aCo.js} +2 -2
- package/dist/client/assets/{ClippedText-DlUFaCzw.js → ClippedText-Bz4usJaN.js} +2 -2
- package/dist/client/assets/CodexSetupSection.logic-fnotucae.js +2 -0
- package/dist/client/assets/{ComboboxClear-DkaA60b7.js → ComboboxClear-BWxvz8Y9.js} +2 -2
- package/dist/client/assets/{ComboboxGroupLabel-AEuoHUH8.js → ComboboxGroupLabel-B9uepPCe.js} +2 -2
- package/dist/client/assets/{CommandBlock-BUHVWYBr.js → CommandBlock-ConSzQ7T.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-zRTz5xec.js → ComposerPromptEditor-Dh9Y0crA.js} +11 -11
- package/dist/client/assets/{CompositeRoot-38NDvFsA.js → CompositeRoot-XnJ7Nzli.js} +2 -2
- package/dist/client/assets/{ConnectionDiagnosisDetails-WKkRENJB.js → ConnectionDiagnosisDetails-DIM-B35q.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-B-U5Wv6b.js → ConnectionStatusDot-CpPwqzkK.js} +2 -2
- package/dist/client/assets/{DRLTVNUE-CNkbJcIE.js → DRLTVNUE-9tvJLXhF.js} +2 -2
- package/dist/client/assets/{DYY6UVD2-Csqmb0Yg.js → DYY6UVD2-CXR9o7Qv.js} +2 -2
- package/dist/client/assets/{DevicePanel-B3G_KDJN.js → DevicePanel-Oy_RHjOo.js} +2 -2
- package/dist/client/assets/{DeviceSetup-DqTJRSli.js → DeviceSetup-ct6xlJYm.js} +2 -2
- package/dist/client/assets/{DialogTitle-Bz-7IYD8.js → DialogTitle-DdTujj5B.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-C3_yEiAB.js → DiffCommentAnnotation-C-L5yt6X.js} +2 -2
- package/dist/client/assets/{DiffFileTree-BJxoYt-I.js → DiffFileTree-C5oMLRG9.js} +2 -2
- package/dist/client/assets/DiffPanel-CE2e4NYA.js +2 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-DPfZNt42.js → DiffWorkerPoolProvider-K9JsvPrH.js} +3 -3
- package/dist/client/assets/{EmbeddedDesign-CsCt-RW1.js → EmbeddedDesign-xOusO8oo.js} +5 -5
- package/dist/client/assets/{EnvironmentMachineIcon-CKfntUmE.js → EnvironmentMachineIcon-BrGxJPP_.js} +2 -2
- package/dist/client/assets/{ExpandableText-DGu2RH_j.js → ExpandableText-auxbX5_6.js} +2 -2
- package/dist/client/assets/{FNOVOB4O-CH8BTfJM.js → FNOVOB4O-BmZ9pVZx.js} +2 -2
- package/dist/client/assets/{FieldControl-DAh0lUDV.js → FieldControl-DfaF5AW8.js} +2 -2
- package/dist/client/assets/{FileDiff-C1enHrMi.js → FileDiff-BTNP8QcY.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-67DQ3_gp.js → FilePreviewPanel-m6c5KXjS.js} +4 -4
- package/dist/client/assets/{FoldedSettingsSection-CILGGC6I.js → FoldedSettingsSection-BTB3Pbv2.js} +2 -2
- package/dist/client/assets/{FormContext-BdrDIRv0.js → FormContext-B_ZMFN7l.js} +2 -2
- package/dist/client/assets/{HDGCDEEZ-Ox1-cFjL.js → HDGCDEEZ-JiOhjq7U.js} +2 -2
- package/dist/client/assets/{HSJLKHB7-BEBG51eo.js → HSJLKHB7-Bd0iumEG.js} +2 -2
- package/dist/client/assets/{Icons-C-FXpOud.js → Icons-BP6jlahF.js} +2 -2
- package/dist/client/assets/Input-B9nob0l2.js +2 -0
- package/dist/client/assets/JZOYTAAL-0AVwCd1G.js +1 -0
- package/dist/client/assets/{K3MD6TGW-DhfhwRRq.js → K3MD6TGW-B2s2l_Ok.js} +2 -2
- package/dist/client/assets/{K7RP3OMA-DdE8zx2_.js → K7RP3OMA-DEvHDTPu.js} +2 -2
- package/dist/client/assets/{KeybindingsSettings.logic-Ddu7cDVA.js → KeybindingsSettings.logic-CkmobJKX.js} +2 -2
- package/dist/client/assets/{LHDIQX7Q-_CTEfstz.js → LHDIQX7Q-D06sm2YF.js} +2 -2
- package/dist/client/assets/{LUXOKEGN-BZTFKFlr.js → LUXOKEGN-A74rm75g.js} +2 -2
- package/dist/client/assets/{MathTypeset-hiZgZUOa.js → MathTypeset-Vm1FBYDj.js} +2 -2
- package/dist/client/assets/{N3JZAHOW-CC607oJ3.js → N3JZAHOW-BCbSRiUS.js} +2 -2
- package/dist/client/assets/{NUIALGQ3-YZiFnb1D.js → NUIALGQ3-DmGUeCU6.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-BaAbresy.js → NoProjectsHero-BBiWXq8t.js} +2 -2
- package/dist/client/assets/{O65XPQGZ-CJWG3hrr.js → O65XPQGZ-859wHUVg.js} +2 -2
- package/dist/client/assets/{O7XIQ6OM-CO58SxOd.js → O7XIQ6OM-BSsC7pLO.js} +2 -2
- package/dist/client/assets/{OFQON5FD-ZVCn5Afz.js → OFQON5FD-BjECyhxL.js} +2 -2
- package/dist/client/assets/{P4ConnectAccountPages-nuGk_jH6.js → P4ConnectAccountPages-Cqk-Frva.js} +2 -2
- package/dist/client/assets/{P4ConnectSidebarSignIn-DMU_ZGur.js → P4ConnectSidebarSignIn-wL7BP9rR.js} +2 -2
- package/dist/client/assets/{PJQHF43J-Dyo99try.js → PJQHF43J-CuSzd3x-.js} +2 -2
- package/dist/client/assets/PanelLayoutControls-DXgwWyzK.js +216 -0
- package/dist/client/assets/{PierreEntryIcon-BGnGqbZS.js → PierreEntryIcon-CDSrlZTw.js} +2 -2
- package/dist/client/assets/{PopoverHandle-BGTDdU32.js → PopoverHandle-Bf0PlJ6j.js} +2 -2
- package/dist/client/assets/PreviewPanel-B7EzPl1x.js +2 -0
- package/dist/client/assets/{ProjectDefaultsSettings-B8-DHhbT.js → ProjectDefaultsSettings-BRi9-O_X.js} +2 -2
- package/dist/client/assets/ProjectFavicon-Cf1XjP8U.js +3 -0
- package/dist/client/assets/{ProjectIconPickerDialog-D_7XapzM.js → ProjectIconPickerDialog-DSRXK7Zv.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-BRycZjMZ.js → ProjectMonogram-BJooqIM-.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-ejODeZci.js → ProviderAuthTerminal-8VrYkUNI.js} +2 -2
- package/dist/client/assets/ProviderModelPicker-mxdF5wUN.js +2 -0
- package/dist/client/assets/{ProviderSettingsForm-TxiFYWfI.js → ProviderSettingsForm-ByFYLn1K.js} +2 -2
- package/dist/client/assets/PullRequestCodeTab-DCUJxgcQ.js +6 -0
- package/dist/client/assets/{RHNBAITX-B2MpzGNB.js → RHNBAITX-Z04dR_uf.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-Clh1I7db.js → ReadOnlySourcePreview-CiVudVcz.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-UQ8iqwRx.js → RenderErrorBoundary-C8jlNO8Q.js} +3 -3
- package/dist/client/assets/{SLD4V6NK-DDlJ2xA8.js → SLD4V6NK-CTh_lt_F.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-VxM8-W1a.js → ScheduledTasksSettings-DfwR9Auj.js} +4 -4
- package/dist/client/assets/{ScopedSwitch-B9HsEBfG.js → ScopedSwitch-6K10bTo0.js} +2 -2
- package/dist/client/assets/{ScrollAreaCorner-DaAMqe_x.js → ScrollAreaCorner-Bstf_gNQ.js} +2 -2
- package/dist/client/assets/{SecretInput-Dfsqp38C.js → SecretInput-BTBcl8SC.js} +2 -2
- package/dist/client/assets/{SelectScrollUpArrow-CBbON2Cr.js → SelectScrollUpArrow-BAwxXUi-.js} +2 -2
- package/dist/client/assets/SelfImproveSettingsSection-DwtwZ9He.js +2 -0
- package/dist/client/assets/{SettingsPanels-D16J4fBs.js → SettingsPanels-BnfeCIPg.js} +7 -7
- package/dist/client/assets/{SettingsPanels.logic-DLPcHVw0.js → SettingsPanels.logic-BM52qF-a.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-CLuK5ZOQ.js → SettingsScopeNotice-CPP-_wXt.js} +2 -2
- package/dist/client/assets/{SidebarStageBackdrop-Bgae69g1.js → SidebarStageBackdrop-ClK_nT_C.js} +2 -2
- package/dist/client/assets/{T3PCR2KE-DQ6cSkUG.js → T3PCR2KE-O2OwSAZh.js} +2 -2
- package/dist/client/assets/{TKWO2OVW-DlInq0TH.js → TKWO2OVW-BxZ4r_GJ.js} +2 -2
- package/dist/client/assets/{TSHNXIZL-DL8cfasx.js → TSHNXIZL-6843lSfx.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-Dhd_0CzC.js → ThemeEditorPanel-B_Mpp-fO.js} +2 -2
- package/dist/client/assets/ThreadTerminalDrawer-3sb2Ksna.js +5 -0
- package/dist/client/assets/{TooltipViewport-UaR0JZsl.js → TooltipViewport-CEOeTVyb.js} +2 -2
- package/dist/client/assets/{UQJE5E4I-WMwM-nEH.js → UQJE5E4I-DIek-a8V.js} +2 -2
- package/dist/client/assets/{USNYFO5S-D-mgcpxb.js → USNYFO5S-l_vgf0I4.js} +2 -2
- package/dist/client/assets/{Virtualizer-CUj2Cqvm.js → Virtualizer-CttujTBW.js} +2 -2
- package/dist/client/assets/{WEVWDWVA-CiAqWYrx.js → WEVWDWVA-DASU9Cts.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-D8GTBuA5.js → WorkspaceBreadcrumb-CQH9TmFi.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-BKXvWv-9.js → WorkspacePageContainer-E5ZuTsSl.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-zMZD9Zz8.js → WorkspacePageHeader-DGopnQZ2.js} +2 -2
- package/dist/client/assets/{X5RFHQXM-YS48_sFp.js → X5RFHQXM-B52DJ-qb.js} +2 -2
- package/dist/client/assets/{X62E3GBT-C444MNd3.js → X62E3GBT-Ccgsn5Dj.js} +2 -2
- package/dist/client/assets/{XBNEOJTC-0O1bjE8y.js → XBNEOJTC-BRptYPNn.js} +2 -2
- package/dist/client/assets/{YHV2MVVZ-Coy_OiWg.js → YHV2MVVZ-D_wcLZ-W.js} +2 -2
- package/dist/client/assets/{YURCZMG2-Lc2Tv_HR.js → YURCZMG2-DP6lArrr.js} +2 -2
- package/dist/client/assets/{YVG2LODB-CWUTdxUc.js → YVG2LODB-CgFYuKDa.js} +2 -2
- package/dist/client/assets/_chat-Vh73A6rC.js +45 -0
- package/dist/client/assets/{_chat.design-CajRPBez.js → _chat.design-_0R3HMjq.js} +2 -2
- package/dist/client/assets/{_chat.index-OsM078CN.js → _chat.index-DhmrbSHU.js} +2 -2
- package/dist/client/assets/{_chat.new-BI8wuTGQ.js → _chat.new-Byb4mhMY.js} +2 -2
- package/dist/client/assets/_chat.pull-requests-BNzVcYEB.js +2 -0
- package/dist/client/assets/{alert-RktpFBv6.js → alert-CqueYfb9.js} +2 -2
- package/dist/client/assets/{assetUrls-COCOS1bm.js → assetUrls-d3y14MLX.js} +2 -2
- package/dist/client/assets/assets-FbkZMhUb.js +2 -0
- package/dist/client/assets/{browserHistoryStore-CBcm7bje.js → browserHistoryStore-CjWZgU2Q.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-D-M5yQc0.js → browserLinkTarget-IsSd9GTV.js} +2 -2
- package/dist/client/assets/{checkbox-vIS3kn6A.js → checkbox-BPr09F_k.js} +2 -2
- package/dist/client/assets/{color-picker-vozMHo5G.js → color-picker-roKqOkuS.js} +2 -2
- package/dist/client/assets/{combobox-CzEFd5LA.js → combobox-CEzOq8mg.js} +2 -2
- package/dist/client/assets/{command-CLf9yckl.js → command-i_eKJj3B.js} +2 -2
- package/dist/client/assets/{connect-BoLhf5rG.js → connect-DyZ-pjcy.js} +2 -2
- package/dist/client/assets/{connect-agent-BUjhhqbv.js → connect-agent-dJ-CRJsT.js} +2 -2
- package/dist/client/assets/{design-LeaOcSZl.js → design-CXl7HVrT.js} +2 -2
- package/dist/client/assets/device-MyE56wi2.js +2 -0
- package/dist/client/assets/{dialog-B69qrNtB.js → dialog-CKG1aUT3.js} +2 -2
- package/dist/client/assets/{diffRendering-DU37Uneg.js → diffRendering-COA7wG72.js} +2 -2
- package/dist/client/assets/{dist-CtnQm06p.js → dist-CYq41icZ.js} +3 -3
- package/dist/client/assets/{draft-input-BUsvwNIU.js → draft-input-DvNQZghL.js} +2 -2
- package/dist/client/assets/{duoViewer-CPd6U9x5.js → duoViewer-CjvM1rB0.js} +2 -2
- package/dist/client/assets/{dynamic-DDiw9bBP.js → dynamic-BZ3kW5ih.js} +2 -2
- package/dist/client/assets/{embeddedScripts-DjnGPWZd.js → embeddedScripts-BLmMNkyP.js} +2 -2
- package/dist/client/assets/{empty-B1FuCXoG.js → empty-D6SdnsPw.js} +2 -2
- package/dist/client/assets/entities-D8ZKPC2e.js +2 -0
- package/dist/client/assets/{fileLinks-DzCsEQpS.js → fileLinks-CNAL-7G6.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-eHhwnC6l.js → fileTreeExpansion-B_6v-e30.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-eC26FmPf.js → getDiffFileInput-DovUC0XJ.js} +2 -2
- package/dist/client/assets/{guideRunStore-CugTzRRn.js → guideRunStore-7uPQQ44U.js} +2 -2
- package/dist/client/assets/{htmlRender-CcVnPpcS.js → htmlRender-hlYiIm7u.js} +2 -2
- package/dist/client/assets/{index-CZlF3wQ9.js → index-DD6u-vDm.js} +3 -3
- package/dist/client/assets/{input-group-CevCumL6.js → input-group-APyqVexM.js} +2 -2
- package/dist/client/assets/{input-D8R-9BO3.js → input-yNgBXsRj.js} +2 -2
- package/dist/client/assets/{kbd-Fy-v90ND.js → kbd-Cr4XEhSh.js} +2 -2
- package/dist/client/assets/{keybindings-DMghyE3A.js → keybindings-hzk4_Sgu.js} +2 -2
- package/dist/client/assets/{lazy-BA6aXmZc.js → lazy-CXsQYM2D.js} +4 -4
- package/dist/client/assets/{lazyRouteComponent-DVNAnyiv.js → lazyRouteComponent-tnhWsSYX.js} +2 -2
- package/dist/client/assets/{link-ci_EPfAz.js → link-CmpZDWcG.js} +2 -2
- package/dist/client/assets/{linkedPrompt-CPHt2jcO.js → linkedPrompt-DgAytF6c.js} +2 -2
- package/dist/client/assets/main-CNcsYwUg.js +37 -0
- package/dist/client/assets/{mediaReference-CZmbKByR.js → mediaReference-DNNV5BY5.js} +2 -2
- package/dist/client/assets/{mediaSource-DX6oP8x9.js → mediaSource-DI8dP4uu.js} +2 -2
- package/dist/client/assets/{number-field-CmK8oJMM.js → number-field-DcRWl9B0.js} +2 -2
- package/dist/client/assets/{observeResize-YxzDUnDW.js → observeResize-DjqKtKLK.js} +2 -2
- package/dist/client/assets/{onboarding-eClefFKp.js → onboarding-CyFz37eL.js} +2 -2
- package/dist/client/assets/openFileInPreview-rYwhIeVk.js +2 -0
- package/dist/client/assets/{p4ProjectFile-BC2tSEs4.js → p4ProjectFile-CT0gLoXX.js} +2 -2
- package/dist/client/assets/{pair-BUZJqgA1.js → pair-BOq1UYDI.js} +2 -2
- package/dist/client/assets/{pendingSendStore-C5UcT8R0.js → pendingSendStore-BoFRcmy5.js} +2 -2
- package/dist/client/assets/{phoneViewer-fmWF20qy.js → phoneViewer-BtDABBh2.js} +2 -2
- package/dist/client/assets/{pierre-icons-DlYshDSm.js → pierre-icons-LoH9zCdH.js} +2 -2
- package/dist/client/assets/{popover-CtJuJW_f.js → popover-DVeZET9D.js} +2 -2
- package/dist/client/assets/{preview-D-Cm6hTR.js → preview-D9IkIo7q.js} +2 -2
- package/dist/client/assets/{preview-DtLn0r5X.js → preview-oweHYD4S.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-BQgCK2RM.js → previewMiniPlayerStore-DrP4x3Ce.js} +2 -2
- package/dist/client/assets/primary-DXTkE8Z6.js +2 -0
- package/dist/client/assets/primaryCloudLinkState-CZVS0Wwo.js +2 -0
- package/dist/client/assets/projectFilesQueryState-Cl_MU7SH.js +2 -0
- package/dist/client/assets/{projectScriptEditor-CwMYFrgO.js → projectScriptEditor-CfiaAaXj.js} +2 -2
- package/dist/client/assets/{providerSkills-DRtgduYo.js → providerSkills-CCJGD2Js.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-CqcRjGbR.js → pullRequestDetail.logic-4EhxvJSo.js} +4 -4
- package/dist/client/assets/{pullRequestIcons-Bk_-BZhA.js → pullRequestIcons-DyEIFm1n.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-Br0qNCn2.js → pullRequestReviewStore-B55CEHY9.js} +2 -2
- package/dist/client/assets/pullRequests-DRm4lwgc.js +2 -0
- package/dist/client/assets/queries-BGbR-fUx.js +2 -0
- package/dist/client/assets/query-D-IVadFI.js +2 -0
- package/dist/client/assets/{radio-group-CQTaM9n2.js → radio-group-DIOJb--u.js} +2 -2
- package/dist/client/assets/{renderScheduler-fJB2sQwM.js → renderScheduler-3p9xZuHR.js} +2 -2
- package/dist/client/assets/{rightPanelStore-C5nnGDev.js → rightPanelStore-CRQRe1Cp.js} +2 -2
- package/dist/client/assets/runtime-CdX0UBlL.js +3 -0
- package/dist/client/assets/runtime-S0tnrkvE.js +6 -0
- package/dist/client/assets/{runtimeModeConfig-Htoh7tJb.js → runtimeModeConfig-BAFMgMrE.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-DRYrMw8R.js → scheduledTasksSettings.logic-CrhQwOvr.js} +3 -3
- package/dist/client/assets/{scroll-area-DJaTwtcr.js → scroll-area-DTOm0CbX.js} +2 -2
- package/dist/client/assets/{select-BFALokxW.js → select-CML8G0wN.js} +2 -2
- package/dist/client/assets/{selfImproveFindings-H2XgphDi.js → selfImproveFindings-DuRaHmql.js} +2 -2
- package/dist/client/assets/server-ELSEsqtb.js +2 -0
- package/dist/client/assets/session-DCntd6Nl.js +2 -0
- package/dist/client/assets/session-logic-CbKDK1qZ.js +26 -0
- package/dist/client/assets/{settings-BkLvGwfm.js → settings-CbkRsZQ6.js} +2 -2
- package/dist/client/assets/{settings.appearance-OuApP6hX.js → settings.appearance-BGbKeD2q.js} +2 -2
- package/dist/client/assets/settings.archived-DNDOvbYT.js +2 -0
- package/dist/client/assets/{settings.computer-use-DbtSE70m.js → settings.computer-use-Cl0y_o-b.js} +2 -2
- package/dist/client/assets/settings.connections-xy7hhFa0.js +2 -0
- package/dist/client/assets/{settings.data-controls-DqM0dqdr.js → settings.data-controls-Boy0foov.js} +2 -2
- package/dist/client/assets/settings.decisions-DUCJDJZC.js +2 -0
- package/dist/client/assets/{settings.designs-BIB7y5ry.js → settings.designs-DYuankA7.js} +2 -2
- package/dist/client/assets/settings.diagnostics-DgYvj0_x.js +2 -0
- package/dist/client/assets/{settings.general-D73jxwiz.js → settings.general-CrvvO6VU.js} +2 -2
- package/dist/client/assets/settings.integrations-Do9x2dXf.js +2 -0
- package/dist/client/assets/{settings.keybindings-DMI2SOqT.js → settings.keybindings-Q_21VUQP.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-QRv0v3-V.js → settings.open-source-licenses-Cnz72Gu0.js} +2 -2
- package/dist/client/assets/settings.plugins-C9-DUFnM.js +5 -0
- package/dist/client/assets/{settings.projects-r-irj-Zr.js → settings.projects-BKMazKl9.js} +4 -4
- package/dist/client/assets/settings.providers-ouat2Ci1.js +3 -0
- package/dist/client/assets/{settings.scheduled-tasks-RWniN8Lw.js → settings.scheduled-tasks-DOmtQjNH.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-D6hiK4XK.js → settings.snap-shot-609BnJ2S.js} +2 -2
- package/dist/client/assets/{settings.source-control-GPOjx565.js → settings.source-control-D1LmFmrq.js} +2 -2
- package/dist/client/assets/{settings.storage-CZsmFyZ8.js → settings.storage-CXdZfPhF.js} +2 -2
- package/dist/client/assets/settingsLayout-aLGl3ZXu.js +3 -0
- package/dist/client/assets/{sidebar-BDFu5cf2.js → sidebar-DMJE0zUg.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-CURnoavN.js → sidebarProjectGrouping-BAN1mSDk.js} +2 -2
- package/dist/client/assets/{skeleton-CIpn5ufH.js → skeleton-eiJFH0l9.js} +2 -2
- package/dist/client/assets/{sourceControl-DjMIOzv1.js → sourceControl-ChrSdv6h.js} +2 -2
- package/dist/client/assets/{sourceControlClients-C2uvUFSM.js → sourceControlClients-BDwX0klQ.js} +2 -2
- package/dist/client/assets/{spinner-t32AzjJr.js → spinner-H4tz4lLc.js} +2 -2
- package/dist/client/assets/{terminal-links-D6dqW3h9.js → terminal-links-D7Hzce_h.js} +2 -2
- package/dist/client/assets/{terminalSessions-DoRkjVz9.js → terminalSessions-DdR_bXtX.js} +2 -2
- package/dist/client/assets/{textarea-EVmRNBWL.js → textarea-CkmpNgx5.js} +2 -2
- package/dist/client/assets/{themePalette-01TQqdkx.js → themePalette-pZ7Ys_kT.js} +3 -3
- package/dist/client/assets/toast-BNQWmVQ-.js +2 -0
- package/dist/client/assets/{toggle-Dqrwe7LT.js → toggle-BDixfqRe.js} +2 -2
- package/dist/client/assets/{toggle-group-DS75Gx6B.js → toggle-group-DV__8G6T.js} +2 -2
- package/dist/client/assets/{tooltip-B1rLXiVx.js → tooltip-DsRaXpYk.js} +2 -2
- package/dist/client/assets/{uiStateStore-_K2mvZYL.js → uiStateStore-Bo1Umjei.js} +2 -2
- package/dist/client/assets/{usage-DwGF-B0Q.js → usage-BPmOvYDv.js} +2 -2
- package/dist/client/assets/{usageAccess-YanE4PaX.js → usageAccess-BXUmTDe1.js} +2 -2
- package/dist/client/assets/{usageFormat-Bgm6YXnR.js → usageFormat-xrTYBhxI.js} +2 -2
- package/dist/client/assets/{usageShortcuts-D6H92HUx.js → usageShortcuts-CQcKqXkw.js} +2 -2
- package/dist/client/assets/{use-atom-command-BT7sz8Lx.js → use-atom-command-REOTdDAa.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-CCDZPAYX.js → useAriaLabelledBy-DVTboZ71.js} +2 -2
- package/dist/client/assets/useHandleNewThread-DYBNXS8y.js +2 -0
- package/dist/client/assets/{useLocation-CDlqpnf6.js → useLocation--dLSTvwv.js} +2 -2
- package/dist/client/assets/{useNavigate-mNhNGdvJ.js → useNavigate-DAhzXpNZ.js} +2 -2
- package/dist/client/assets/{useNavigateBack-zj9tpAPV.js → useNavigateBack-ClmMPFha.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-CkJyw_jV.js → useP4ConnectAuthPrompt-CGiX3TE7.js} +2 -2
- package/dist/client/assets/{useParams-CZ_VOC6E.js → useParams-D_0yPfYl.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-DFE8UnJC.js → usePermissionStatus-BGxDZxHH.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-CVcuaade.js → usePullRequestActions-BOUPI3Y5.js} +2 -2
- package/dist/client/assets/{useRegisterFieldControl-gW7DDA6v.js → useRegisterFieldControl-DnspXZl4.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-BCNsRHrC.js → useScopedModelAvailability-DD6NdaS0.js} +2 -2
- package/dist/client/assets/useSettings-BNjvPVd5.js +3 -0
- package/dist/client/assets/utils-D19Exirm.js +37 -0
- package/dist/client/assets/vcsRefInvalidation-BSyEzs8X.js +2 -0
- package/dist/client/assets/{welcome-CfpSLEhO.js → welcome-CJLDvQwx.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{renderer-B3Ia4LBS.mjs → renderer-DNRW9Bfa.mjs} +2 -2
- package/dist/{runtime-DvE0t3kv.mjs → runtime-KPwu-Er9.mjs} +89 -3
- package/package.json +1 -1
- package/dist/client/assets/AlertDialogRoot-Dxu9crTa.js +0 -2
- package/dist/client/assets/ChatGptUsageButton-CXEX1qrn.js +0 -2
- package/dist/client/assets/ChatMarkdown-yTbjRmgo.js +0 -48
- package/dist/client/assets/CodexSetupSection.logic-D3odRubx.js +0 -2
- package/dist/client/assets/DiffPanel-Bfxdj8td.js +0 -2
- package/dist/client/assets/Input-DWhR3WLZ.js +0 -2
- package/dist/client/assets/JZOYTAAL-K5yyV5fj.js +0 -1
- package/dist/client/assets/PanelLayoutControls-CwJW9Vo-.js +0 -216
- package/dist/client/assets/PreviewPanel-C914U2vc.js +0 -2
- package/dist/client/assets/ProjectFavicon-Bnd4lTxL.js +0 -3
- package/dist/client/assets/ProviderModelPicker-BigVoJfZ.js +0 -2
- package/dist/client/assets/PullRequestCodeTab-D99_acmK.js +0 -6
- package/dist/client/assets/ThreadTerminalDrawer-Bga-TMJR.js +0 -5
- package/dist/client/assets/_chat-BWNTWBCr.js +0 -45
- package/dist/client/assets/_chat.pull-requests-Alx1g9Xh.js +0 -2
- package/dist/client/assets/assets-B36wSN1M.js +0 -2
- package/dist/client/assets/device-D9IuUJmU.js +0 -2
- package/dist/client/assets/entities-Cd_YDhEa.js +0 -2
- package/dist/client/assets/main-om7hc1qE.js +0 -37
- package/dist/client/assets/openFileInPreview-H9M5FxLy.js +0 -2
- package/dist/client/assets/primary-CuSE-Dwp.js +0 -2
- package/dist/client/assets/primaryCloudLinkState-BsKyx6nh.js +0 -2
- package/dist/client/assets/projectFilesQueryState-FiXJc2AO.js +0 -2
- package/dist/client/assets/pullRequests-C9YbqDXl.js +0 -2
- package/dist/client/assets/queries-DMkaYL1H.js +0 -2
- package/dist/client/assets/query-B1dBedyO.js +0 -2
- package/dist/client/assets/runtime-B6yGAVz4.js +0 -6
- package/dist/client/assets/runtime-BhGr1QCf.js +0 -3
- package/dist/client/assets/server-Dc9414wM.js +0 -2
- package/dist/client/assets/session-B6T_Arzf.js +0 -2
- package/dist/client/assets/session-logic-BaSoFnqy.js +0 -26
- package/dist/client/assets/settings.archived-DLycLGH2.js +0 -2
- package/dist/client/assets/settings.connections-D8EmrGJK.js +0 -2
- package/dist/client/assets/settings.decisions-BNBjCRqL.js +0 -2
- package/dist/client/assets/settings.diagnostics-CZPZhIn-.js +0 -2
- package/dist/client/assets/settings.integrations-Vq3IT0_R.js +0 -2
- package/dist/client/assets/settings.plugins-Ddb8m4nE.js +0 -5
- package/dist/client/assets/settings.providers-Ce4kHZsP.js +0 -3
- package/dist/client/assets/settingsLayout-CthOqZyP.js +0 -3
- package/dist/client/assets/toast-UFTwkJWj.js +0 -2
- package/dist/client/assets/useHandleNewThread-nNF3Xnbt.js +0 -2
- package/dist/client/assets/useSettings-BAP_yCCK.js +0 -3
- package/dist/client/assets/utils-Dv1DrWoz.js +0 -37
- package/dist/client/assets/vcsRefInvalidation-BI3mMuIW.js +0 -2
package/dist/client/assets/{settings.keybindings-DMI2SOqT.js → settings.keybindings-Q_21VUQP.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{$n as i,Ad as a,Bm as o,Jn as s,Lc as c,Sp as l,Wd as u,X_ as d,Yn as f,Yp as p,af as m,dr as h,ff as g,lm as _,nv as v,rh as y,t as b,tr as x,ur as S}from"./utils-Dv1DrWoz.js";import{R as C,W as w}from"./runtime-B6yGAVz4.js";import{a as T,c as E,o as D,s as O,t as k}from"./select-BFALokxW.js";import{t as A}from"./useLocation-CDlqpnf6.js";import{i as j}from"./toast-UFTwkJWj.js";import{f as M}from"./server-Dc9414wM.js";import{i as ee,n as N,o as te}from"./session-B6T_Arzf.js";import{t as P}from"./use-atom-command-BT7sz8Lx.js";import{t as ne}from"./env-wK1YYxA8.js";import{a as F,n as I,t as L}from"./tooltip-B1rLXiVx.js";import{t as R}from"./toggle-Dqrwe7LT.js";import{t as re}from"./input-D8R-9BO3.js";import{i as ie}from"./keybindings-DMghyE3A.js";import{i as ae,o as oe,t as z}from"./popover-CtJuJW_f.js";import{n as se,r as ce,t as B}from"./input-group-CevCumL6.js";import{n as le,t as ue}from"./kbd-Fy-v90ND.js";import{G as de,V as fe,a as pe,i as me,s as he}from"./settingsLayout-CthOqZyP.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-Ddu7cDVA.js";import{_o as Ee,_r as De,vr as Oe}from"./main-om7hc1qE.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)(_,{"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,s=r===void 0||r?0:void 0,c;t[0]===i?c=t[1]:(c=b(`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]=c);let l;t[2]!==n||t[3]!==s||t[4]!==c?(l=(0,K.jsx)(`span`,{tabIndex:s,"aria-label":n,className:c}),t[2]=n,t[3]=s,t[4]=c,t[5]=l):l=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(o,{className:`size-3.5`}),t[6]=u):u=t[6];let d;t[7]===l?d=t[8]:(d=(0,K.jsx)(F,{render:l,children:u}),t[7]=l,t[8]=d);let f;t[9]===a?f=t[10]:(f=(0,K.jsx)(I,{side:`top`,children:a}),t[9]=a,t[10]=f);let p;return t[11]!==d||t[12]!==f?(p=(0,K.jsxs)(L,{children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13],p}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=b(`size-7`,r),t[0]=r,t[1]=a);let o;t[2]!==n||t[3]!==i||t[4]!==a?(o=(0,K.jsx)(h,{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)(l,{"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 u;t[9]===n?u=t[10]:(u=(0,K.jsx)(I,{side:`top`,children:n}),t[9]=n,t[10]=u);let d;return t[11]!==c||t[12]!==u?(d=(0,K.jsxs)(L,{children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13],d}function Z(e){let t=(0,W.c)(81),{node:n,variables:r,depth:i,onChange:a,onRemove:o}=e,s=i===void 0?0:i,c;if(t[0]!==s||t[1]!==n||t[2]!==a||t[3]!==o||t[4]!==r){c=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Me(n);if(e){let i=Ce(e.identifier)?[]:[e.identifier],l;t[6]!==n||t[7]!==a?(l=e=>a(Pe(n,e)),t[6]=n,t[7]=a,t[8]=l):l=t[8];let u=`Negate ${e.identifier}`,d;t[9]!==e||t[10]!==l||t[11]!==u?(d=(0,K.jsx)(R,{pressed:e.negated,onPressedChange:l,"aria-label":u,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[9]=e,t[10]=l,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]!==s||t[22]!==n||t[23]!==o?(m=o?(0,K.jsx)(Be,{label:H(n,s),onRemove:o}):null,t[21]=s,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],c=h;break bb0}}t[0]=s,t[1]=n,t[2]=a,t[3]=o,t[4]=r,t[5]=c}else c=t[5];if(c!==Symbol.for(`react.early_return_sentinel`))return c;if(n.type===`not`){let e=s>0&&`border-border/50 bg-background/50`,i;t[29]===e?i=t[30]:(i=b(`space-y-2 rounded-lg border border-border/70 bg-muted/20 p-2`,e),t[29]=e,t[30]=i);let c;t[31]!==n||t[32]!==a?(c=(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]=c):c=t[33];let l;t[34]!==s||t[35]!==n||t[36]!==o?(l=o?(0,K.jsx)(Be,{label:H(n,s),className:`ml-auto`,onRemove:o}):null,t[34]=s,t[35]=n,t[36]=o,t[37]=l):l=t[37];let u;t[38]!==c||t[39]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c,l]}),t[38]=c,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=s+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 l=n.type===`or`?`or`:`and`,u,d,f,m;if(t[54]!==s||t[55]!==n||t[56]!==a||t[57]!==o||t[58]!==l||t[59]!==r){let e=je(n,l),i=new Map,c=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),l);i&&a(i)},_=t=>{let n=!1,r=J(e.filter(e=>!n&&e===t?(n=!0,!1):!0),l);a(r||Y())},v=t=>{if(t===l)return;let n=J(e,t);n&&a(n)},y=()=>{let t=J([...e,Y()],l);t&&a(t)},x=()=>{let t={type:l===`and`?`or`:`and`,left:Y(),right:{type:`not`,node:Y()}},n=J([...e,t],l);n&&a(n)},S=s>0&&`border-border/70 bg-background/55`;t[64]===S?f=t[65]:(f=b(`space-y-2 rounded-lg border border-border/60 bg-muted/10 p-2`,S),t[64]=S,t[65]=f);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)(p,{className:`size-3.5`}),t[68]=A):A=t[68];let j;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,K.jsx)(p,{className:`size-3.5`}),t[69]=j):j=t[69];let M;t[70]!==s||t[71]!==n||t[72]!==o?(M=o?(0,K.jsx)(Be,{label:H(n,s),className:`ml-auto`,onRemove:o}):null,t[70]=s,t[71]=n,t[72]=o,t[73]=M):M=t[73],m=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(k,{value:l,onValueChange:e=>v(e),children:[C,w]}),(0,K.jsxs)(h,{type:`button`,variant:`outline`,size:`compact`,onClick:y,children:[A,`Condition`]}),(0,K.jsxs)(h,{type:`button`,variant:`outline`,size:`compact`,onClick:x,children:[j,`Group`]}),M]}),u=`space-y-2`,d=c.map(e=>{let{child:t,key:n}=e;return(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[(0,K.jsx)(`span`,{className:b(`absolute top-0 bottom-0 left-1.5 w-px`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(`span`,{className:b(`absolute top-4 left-1.5 h-px w-2.5`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(Z,{node:t,variables:r,depth:s+1,onChange:e=>g(t,e),onRemove:()=>_(t)})]},n)}),t[54]=s,t[55]=n,t[56]=a,t[57]=o,t[58]=l,t[59]=r,t[60]=u,t[61]=d,t[62]=f,t[63]=m}else u=t[60],d=t[61],f=t[62],m=t[63];let g;t[74]!==u||t[75]!==d?(g=(0,K.jsx)(`div`,{className:u,children:d}),t[74]=u,t[75]=d,t[76]=g):g=t[76];let _;return t[77]!==f||t[78]!==m||t[79]!==g?(_=(0,K.jsxs)(`div`,{className:f,children:[m,g]}),t[77]=f,t[78]=m,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[s,c]=(0,G.useState)(o),l;t[2]===s?l=t[3]:(l=Te(s),t[2]=s,t[3]=l);let d=l,f=d.ok?null:d.message,m;t[4]!==d.ok||t[5]!==d.value?(m=d.ok?_e(d.value):[],t[4]=d.ok,t[5]=d.value,t[6]=m):m=t[6];let g=m,_;t[7]!==i||t[8]!==a?(_=e=>{c(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=>{c(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=()=>{b(n?{type:`and`,left:n,right:Y()}: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`);b(n?{type:`and`,left:n,right:e}: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)(p,{className:`size-3.5`}),t[20]=E):E=t[20];let D;t[21]===S?D=t[22]:(D=(0,K.jsxs)(h,{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)(p,{className:`size-3.5`}),t[23]=O):O=t[23];let k;t[24]===w?k=t[25]:(k=(0,K.jsxs)(h,{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=!!f,ee;t[31]!==s||t[32]!==j||t[33]!==M?(ee=(0,K.jsx)(ce,{value:s,onChange:j,placeholder:`Always`,"aria-invalid":M,"aria-label":`When expression`,size:`compact`,font:`mono`}),t[31]=s,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]===f?P=t[41]:(P=f?(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-2xs text-destructive`,children:[(0,K.jsx)(u,{className:`size-3.5`}),f]}):null,t[40]=f,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)(h,{type:`button`,size:`compact`,onClick:S,children:[(0,K.jsx)(p,{className:`size-3.5`}),`Condition`]}),(0,K.jsxs)(h,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[(0,K.jsx)(p,{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]===f?I=t[52]:(I=f?(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]=f,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,m;t[0]!==c||t[1]!==i||t[2]!==l||t[3]!==o||t[4]!==d?(m=c?(0,K.jsx)(h,{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]=m):m=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:b(`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]!==m||t[17]!==g?(_=(0,K.jsxs)(K.Fragment,{children:[m,g]}),t[16]=m,t[17]=g,t[18]=_):_=t[18],_}function $(e){let t=(0,W.c)(17),{label:n,expression:r,value:i,variables:o,onChange:s,onValidityChange:c}=e,l=r?`ghost`:`ghost-muted`,u;t[0]===l?u=t[1]:(u=(0,K.jsx)(h,{variant:l,size:`micro`,className:`min-w-0 shrink`}),t[0]=l,t[1]=u);let d=`Edit when clause for ${n}`,f=r||`Always`,p;t[2]===f?p=t[3]:(p=(0,K.jsx)(`span`,{className:`truncate font-mono`,children:f}),t[2]=f,t[3]=p);let m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(a,{className:`size-3.5 shrink-0 opacity-60`}),t[4]=m):m=t[4];let g;t[5]!==u||t[6]!==d||t[7]!==p?(g=(0,K.jsxs)(oe,{render:u,"aria-label":d,children:[p,m]}),t[5]=u,t[6]=d,t[7]=p,t[8]=g):g=t[8];let _;t[9]!==s||t[10]!==c||t[11]!==i||t[12]!==o?(_=(0,K.jsx)(ae,{align:`start`,sideOffset:6,children:(0,K.jsx)(Ve,{value:i,variables:o,onChange:s,onValidityChange:c})}),t[9]=s,t[10]=c,t[11]=i,t[12]=o,t[13]=_):_=t[13];let v;return t[14]!==g||t[15]!==_?(v=(0,K.jsxs)(z,{children:[g,_]}),t[14]=g,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}`,d;t[2]!==r||t[3]!==u?(d=(0,K.jsx)(h,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:r,"aria-label":u}),t[2]=r,t[3]=u,t[4]=d):d=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(m,{className:`size-3.5`}),t[5]=p):p=t[5];let g;t[6]===d?g=t[7]:(g=(0,K.jsx)(S,{render:d,children:p}),t[6]=d,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 y;t[18]!==_||t[19]!==v?(y=(0,K.jsxs)(x,{align:`end`,children:[_,v]}),t[18]=_,t[19]=v,t[20]=y):y=t[20];let b;return t[21]!==g||t[22]!==y?(b=(0,K.jsxs)(f,{children:[g,y]}),t[21]=g,t[22]=y,t[23]=b):b=t[23],b}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)(s,{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)(h,{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)(y,{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 m;t[12]===l?m=t[13]:(m=(0,K.jsx)(tt,{draft:l,className:`w-44`}),t[12]=l,t[13]=m);let g=a||!l.canSave,_=a?`Saving`:`Save`,v;t[14]!==l.save||t[15]!==g||t[16]!==_?(v=(0,K.jsx)(h,{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]!==m||t[24]!==v||t[25]!==y?(b=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[f,p,m,v,y]}),t[21]=f,t[22]=p,t[23]=m,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)(h,{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)(o,{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}=fe(),r=ee(t?.environmentId??null,d),i=te(n,v),a;e[0]!==n||e[1]!==i?(a=n.length>0&&n.every(e=>i.has(e.environmentId)),e[0]=n,e[1]=i,e[2]=a):a=e[2];let o=a,s=t?.serverConfig?.keybindings,l;e[3]===s?l=e[4]:(l=s??[],e[3]=s,e[4]=l);let u;e[5]===l?u=e[6]:(u=c(l),e[5]=l,e[6]=u);let f=u,m=t?.serverConfig?.keybindingsConfigPath??null,_;e[7]===t?.serverConfig?.availableEditors?_=e[8]:(_=t?.serverConfig?.availableEditors??[],e[7]=t?.serverConfig?.availableEditors,e[8]=_);let y=_,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]!==f||e[12]!==D?(oe=Se(f,D),e[11]=f,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,De(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]===f?_e=e[20]:(_e=be(f),e[19]=f,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]!==m||e[23]!==E||e[24]!==t?(Ce=()=>{m&&t&&N(t.environmentId,`orchestration:operate`)&&(async()=>{let e=await E(m);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]=m,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);else 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=Oe(`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||!o,ze,Be;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>ae(!0),Be=(0,K.jsx)(p,{"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)(h,{type:`button`,variant:`outline`,disabled:Re,onClick:ze,children:[Be,`Add keybinding`]}),e[48]=Re,e[49]=Z);let Ve=!m||!r,He;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,K.jsx)(g,{"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)(h,{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]!==o||e[62]!==n?(Ke=o?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]=o,e[62]=n,e[63]=Ke):Ke=e[63];let qe=!o,Je;e[64]!==ye||e[65]!==ie||e[66]!==z||e[67]!==q||e[68]!==R?(Je=ie?(0,K.jsx)(de,{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)(de,{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,v)}function ut(e){return e._tag===`Failure`}function dt(e){return N(e.environmentId,v)}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-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{$n as i,Cp as a,Gd as o,Jn as s,Lc as c,Vm as l,Xp as u,Yn as d,Z_ as f,dr as p,ih as m,jd as h,of as g,pf as _,rv as v,t as y,tr as b,um as x,ur as S}from"./utils-D19Exirm.js";import{R as C,W as w}from"./runtime-S0tnrkvE.js";import{a as T,c as E,o as D,s as O,t as k}from"./select-CML8G0wN.js";import{t as A}from"./useLocation--dLSTvwv.js";import{i as j}from"./toast-BNQWmVQ-.js";import{f as M}from"./server-ELSEsqtb.js";import{i as ee,n as N,o as te}from"./session-DCntd6Nl.js";import{t as P}from"./use-atom-command-REOTdDAa.js";import{t as ne}from"./env-wK1YYxA8.js";import{a as F,n as I,t as L}from"./tooltip-DsRaXpYk.js";import{t as R}from"./toggle-BDixfqRe.js";import{t as re}from"./input-yNgBXsRj.js";import{i as ie}from"./keybindings-hzk4_Sgu.js";import{i as ae,o as oe,t as z}from"./popover-DVeZET9D.js";import{n as se,r as ce,t as B}from"./input-group-APyqVexM.js";import{n as le,t as ue}from"./kbd-Cr4XEhSh.js";import{G as de,V as fe,a as pe,i as me,s as he}from"./settingsLayout-aLGl3ZXu.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-CkmobJKX.js";import{_o as Ee,_r as De,vr as Oe}from"./main-CNcsYwUg.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)(x,{"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=y(`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 u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(l,{className:`size-3.5`}),t[6]=u):u=t[6];let d;t[7]===c?d=t[8]:(d=(0,K.jsx)(F,{render:c,children:u}),t[7]=c,t[8]=d);let f;t[9]===a?f=t[10]:(f=(0,K.jsx)(I,{side:`top`,children:a}),t[9]=a,t[10]=f);let p;return t[11]!==d||t[12]!==f?(p=(0,K.jsxs)(L,{children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13],p}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,o;t[0]===r?o=t[1]:(o=y(`size-7`,r),t[0]=r,t[1]=o);let s;t[2]!==n||t[3]!==i||t[4]!==o?(s=(0,K.jsx)(p,{type:`button`,variant:`ghost`,size:`icon-sm`,className:o,"aria-label":n,onClick:i}),t[2]=n,t[3]=i,t[4]=o,t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,K.jsx)(a,{"aria-hidden":!0,className:`size-3.5`}),t[6]=c):c=t[6];let l;t[7]===s?l=t[8]:(l=(0,K.jsx)(F,{delay:200,render:s,children:c}),t[7]=s,t[8]=l);let u;t[9]===n?u=t[10]:(u=(0,K.jsx)(I,{side:`top`,children:n}),t[9]=n,t[10]=u);let d;return t[11]!==l||t[12]!==u?(d=(0,K.jsxs)(L,{children:[l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function Z(e){let t=(0,W.c)(81),{node:n,variables:r,depth:i,onChange:a,onRemove:o}=e,s=i===void 0?0:i,c;if(t[0]!==s||t[1]!==n||t[2]!==a||t[3]!==o||t[4]!==r){c=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Me(n);if(e){let i=Ce(e.identifier)?[]:[e.identifier],l;t[6]!==n||t[7]!==a?(l=e=>a(Pe(n,e)),t[6]=n,t[7]=a,t[8]=l):l=t[8];let u=`Negate ${e.identifier}`,d;t[9]!==e||t[10]!==l||t[11]!==u?(d=(0,K.jsx)(R,{pressed:e.negated,onPressedChange:l,"aria-label":u,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[9]=e,t[10]=l,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]!==s||t[22]!==n||t[23]!==o?(m=o?(0,K.jsx)(Be,{label:H(n,s),onRemove:o}):null,t[21]=s,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],c=h;break bb0}}t[0]=s,t[1]=n,t[2]=a,t[3]=o,t[4]=r,t[5]=c}else c=t[5];if(c!==Symbol.for(`react.early_return_sentinel`))return c;if(n.type===`not`){let e=s>0&&`border-border/50 bg-background/50`,i;t[29]===e?i=t[30]:(i=y(`space-y-2 rounded-lg border border-border/70 bg-muted/20 p-2`,e),t[29]=e,t[30]=i);let c;t[31]!==n||t[32]!==a?(c=(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]=c):c=t[33];let l;t[34]!==s||t[35]!==n||t[36]!==o?(l=o?(0,K.jsx)(Be,{label:H(n,s),className:`ml-auto`,onRemove:o}):null,t[34]=s,t[35]=n,t[36]=o,t[37]=l):l=t[37];let u;t[38]!==c||t[39]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c,l]}),t[38]=c,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=s+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 l=n.type===`or`?`or`:`and`,d,f,m,h;if(t[54]!==s||t[55]!==n||t[56]!==a||t[57]!==o||t[58]!==l||t[59]!==r){let e=je(n,l),i=new Map,c=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),l);i&&a(i)},_=t=>{let n=!1,r=J(e.filter(e=>!n&&e===t?(n=!0,!1):!0),l);a(r||Y())},v=t=>{if(t===l)return;let n=J(e,t);n&&a(n)},b=()=>{let t=J([...e,Y()],l);t&&a(t)},x=()=>{let t={type:l===`and`?`or`:`and`,left:Y(),right:{type:`not`,node:Y()}},n=J([...e,t],l);n&&a(n)},S=s>0&&`border-border/70 bg-background/55`;t[64]===S?m=t[65]:(m=y(`space-y-2 rounded-lg border border-border/60 bg-muted/10 p-2`,S),t[64]=S,t[65]=m);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)(u,{className:`size-3.5`}),t[68]=A):A=t[68];let j;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,K.jsx)(u,{className:`size-3.5`}),t[69]=j):j=t[69];let M;t[70]!==s||t[71]!==n||t[72]!==o?(M=o?(0,K.jsx)(Be,{label:H(n,s),className:`ml-auto`,onRemove:o}):null,t[70]=s,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:l,onValueChange:e=>v(e),children:[C,w]}),(0,K.jsxs)(p,{type:`button`,variant:`outline`,size:`compact`,onClick:b,children:[A,`Condition`]}),(0,K.jsxs)(p,{type:`button`,variant:`outline`,size:`compact`,onClick:x,children:[j,`Group`]}),M]}),d=`space-y-2`,f=c.map(e=>{let{child:t,key:n}=e;return(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[(0,K.jsx)(`span`,{className:y(`absolute top-0 bottom-0 left-1.5 w-px`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(`span`,{className:y(`absolute top-4 left-1.5 h-px w-2.5`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(Z,{node:t,variables:r,depth:s+1,onChange:e=>g(t,e),onRemove:()=>_(t)})]},n)}),t[54]=s,t[55]=n,t[56]=a,t[57]=o,t[58]=l,t[59]=r,t[60]=d,t[61]=f,t[62]=m,t[63]=h}else d=t[60],f=t[61],m=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]!==m||t[78]!==h||t[79]!==g?(_=(0,K.jsxs)(`div`,{className:m,children:[h,g]}),t[77]=m,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,s;t[0]===n?s=t[1]:(s=U(n),t[0]=n,t[1]=s);let[c,l]=(0,G.useState)(s),d;t[2]===c?d=t[3]:(d=Te(c),t[2]=c,t[3]=d);let f=d,m=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=()=>{b(n?{type:`and`,left:n,right:Y()}: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`);b(n?{type:`and`,left:n,right:e}: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)(u,{className:`size-3.5`}),t[20]=E):E=t[20];let D;t[21]===S?D=t[22]:(D=(0,K.jsxs)(p,{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)(u,{className:`size-3.5`}),t[23]=O):O=t[23];let k;t[24]===w?k=t[25]:(k=(0,K.jsxs)(p,{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=!!m,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]===m?P=t[41]:(P=m?(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-2xs text-destructive`,children:[(0,K.jsx)(o,{className:`size-3.5`}),m]}):null,t[40]=m,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)(p,{type:`button`,size:`compact`,onClick:S,children:[(0,K.jsx)(u,{className:`size-3.5`}),`Condition`]}),(0,K.jsxs)(p,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[(0,K.jsx)(u,{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]===m?I=t[52]:(I=m?(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]=m,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,m=!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)(p,{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]!==m?(g=m?(0,K.jsx)(`button`,{type:`button`,onClick:()=>u({isRecording:!0}),"aria-label":`Edit shortcut for ${V(n.command)}: ${ie(n.binding.shortcut)}`,className:y(`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]=m,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)(p,{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 m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(h,{className:`size-3.5 shrink-0 opacity-60`}),t[4]=m):m=t[4];let g;t[5]!==l||t[6]!==u||t[7]!==f?(g=(0,K.jsxs)(oe,{render:l,"aria-label":u,children:[f,m]}),t[5]=l,t[6]=u,t[7]=f,t[8]=g):g=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]!==g||t[15]!==_?(v=(0,K.jsxs)(z,{children:[g,_]}),t[14]=g,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)(p,{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 m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(g,{className:`size-3.5`}),t[5]=m):m=t[5];let h;t[6]===f?h=t[7]:(h=(0,K.jsx)(S,{render:f,children:m}),t[6]=f,t[7]=h);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 y;t[18]!==_||t[19]!==v?(y=(0,K.jsxs)(b,{align:`end`,children:[_,v]}),t[18]=_,t[19]=v,t[20]=y):y=t[20];let x;return t[21]!==h||t[22]!==y?(x=(0,K.jsxs)(d,{children:[h,y]}),t[21]=h,t[22]=y,t[23]=x):x=t[23],x}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)(s,{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)(p,{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)(m,{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 m;t[10]===l.conflictLabels?m=t[11]:(m=(0,K.jsx)(X,{labels:l.conflictLabels}),t[10]=l.conflictLabels,t[11]=m);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)(p,{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]!==m||t[23]!==h||t[24]!==v||t[25]!==y?(b=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[f,m,h,v,y]}),t[21]=f,t[22]=m,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)(p,{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)(l,{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}=fe(),r=ee(t?.environmentId??null,f),i=te(n,v),a;e[0]!==n||e[1]!==i?(a=n.length>0&&n.every(e=>i.has(e.environmentId)),e[0]=n,e[1]=i,e[2]=a):a=e[2];let o=a,s=t?.serverConfig?.keybindings,l;e[3]===s?l=e[4]:(l=s??[],e[3]=s,e[4]=l);let d;e[5]===l?d=e[6]:(d=c(l),e[5]=l,e[6]=d);let m=d,h=t?.serverConfig?.keybindingsConfigPath??null,g;e[7]===t?.serverConfig?.availableEditors?g=e[8]:(g=t?.serverConfig?.availableEditors??[],e[7]=t?.serverConfig?.availableEditors,e[8]=g);let y=g,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]!==m||e[12]!==D?(oe=Se(m,D),e[11]=m,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,De(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]===m?_e=e[20]:(_e=be(m),e[19]=m,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]!==h||e[23]!==E||e[24]!==t?(Ce=()=>{h&&t&&N(t.environmentId,`orchestration:operate`)&&(async()=>{let e=await E(h);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]=h,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);else 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=Oe(`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||!o,ze,Be;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>ae(!0),Be=(0,K.jsx)(u,{"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)(p,{type:`button`,variant:`outline`,disabled:Re,onClick:ze,children:[Be,`Add keybinding`]}),e[48]=Re,e[49]=Z);let Ve=!h||!r,He;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,K.jsx)(_,{"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)(p,{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]!==o||e[62]!==n?(Ke=o?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]=o,e[62]=n,e[63]=Ke):Ke=e[63];let qe=!o,Je;e[64]!==ye||e[65]!==ie||e[66]!==z||e[67]!==q||e[68]!==R?(Je=ie?(0,K.jsx)(de,{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)(de,{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,v)}function ut(e){return e._tag===`Failure`}function dt(e){return N(e.environmentId,v)}function ft(e){return e.hash.replace(/^#/,``)}var pt=st;export{pt as component};
|
|
2
|
+
//# sourceMappingURL=settings.keybindings-Q_21VUQP.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{
|
|
2
|
-
//# sourceMappingURL=settings.open-source-licenses-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Nd as i,dr as a,sf as o,um as s}from"./utils-D19Exirm.js";import{a as c,n as l,t as u}from"./tooltip-DsRaXpYk.js";import{n as d,r as f,t as p}from"./input-group-APyqVexM.js";import{i as m,s as h}from"./settingsLayout-aLGl3ZXu.js";import{co as g,lo as _,so as v}from"./main-CNcsYwUg.js";var y=e(t(),1),b=n();function x(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function S(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function C(e){if(typeof e!=`string`)return!1;try{let t=new URL(e).protocol;return t===`http:`||t===`https:`}catch{return!1}}function w(e,t){if(!x(e))throw Error(`License entry ${String(t+1)} is not an object.`);if(!S(e.bundles)||e.bundles.length===0||e.kind!==`custom`&&e.kind!==`package`||typeof e.license!=`string`||typeof e.name!=`string`||typeof e.noticeText!=`string`||e.sourceUrl!==null&&!C(e.sourceUrl)||e.version!==null&&typeof e.version!=`string`)throw Error(`License entry ${String(t+1)} has an invalid shape.`);return{bundles:e.bundles,kind:e.kind,license:e.license,name:e.name,noticeText:e.noticeText,sourceUrl:e.sourceUrl,version:e.version}}function T(e){if(!x(e)||e.schemaVersion!==1||!Array.isArray(e.entries))throw Error(`The open-source license manifest has an unsupported format.`);let t=e.entries.map(w),n=new Set;for(let e of t){let t=k(e);if(n.has(t))throw Error(`The open-source license manifest contains a duplicate entry: ${t}`);n.add(t)}return{schemaVersion:1,entries:t}}function E(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0);return n.length===0?e:e.filter(e=>{let t=[e.name,e.version,e.license,...e.bundles].filter(e=>e!==null).join(` `).toLowerCase();return n.every(e=>t.includes(e))})}var D={android:`Android`,assets:`Assets`,desktop:`Desktop`,"device-tools":`Device tools`,ios:`iOS`,mobile:`Mobile`,server:`Server`,web:`Web`};function O(e){return e.map(e=>Object.prototype.hasOwnProperty.call(D,e)?D[e]:e).join(`, `)}function k(e){return encodeURIComponent(JSON.stringify([e.kind,e.name,e.version]))}var A=e(r(),1),j;async function M(){let e=AbortSignal.timeout(3e4);try{let t=await fetch(`${`/`.replace(/\/$/,``)}/third-party-licenses.json`,{signal:e});if(!t.ok)throw Error(`The license manifest request failed with status ${String(t.status)}.`);return T(await t.json())}catch(t){throw e.aborted?Error(`The license manifest took too long to load.`,{cause:t}):t}}function N(){return j??=M().catch(e=>{throw j=void 0,e}),j}function P(e){let t=(0,b.c)(34),{entry:n,open:r,onOpenChange:s}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,A.jsx)(i,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 group-data-panel-open:rotate-90`}),t[0]=c):c=t[0];let l;t[1]===n.name?l=t[2]:(l=(0,A.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:n.name}),t[1]=n.name,t[2]=l);let u;t[3]===n.version?u=t[4]:(u=n.version?(0,A.jsx)(`code`,{className:`shrink-0 text-xs text-muted-foreground`,children:n.version}):null,t[3]=n.version,t[4]=u);let d;t[5]!==l||t[6]!==u?(d=(0,A.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[l,u]}),t[5]=l,t[6]=u,t[7]=d):d=t[7];let f=n.license,p;t[8]===n.bundles?p=t[9]:(p=O(n.bundles),t[8]=n.bundles,t[9]=p);let m;t[10]!==n.license||t[11]!==p?(m=(0,A.jsxs)(`span`,{className:`max-w-[42%] shrink-0 truncate text-xs text-muted-foreground`,children:[f,` · `,p]}),t[10]=n.license,t[11]=p,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==m?(h=(0,A.jsxs)(_,{className:`group flex min-h-10 min-w-0 flex-1 items-center gap-2.5 px-3 text-left sm:min-h-9 sm:px-4`,children:[c,d,m]}),t[13]=d,t[14]=m,t[15]=h):h=t[15];let y;t[16]!==n.name||t[17]!==n.sourceUrl?(y=n.sourceUrl?(0,A.jsx)(a,{"aria-label":`View project source for ${n.name}`,className:`me-3 shrink-0 sm:me-4`,render:(0,A.jsx)(`a`,{href:n.sourceUrl,rel:`noreferrer noopener`,target:`_blank`}),size:`icon-micro`,title:`Project source`,variant:`ghost-muted`,children:(0,A.jsx)(o,{"aria-hidden":!0,className:`size-3`})}):null,t[16]=n.name,t[17]=n.sourceUrl,t[18]=y):y=t[18];let x;t[19]!==h||t[20]!==y?(x=(0,A.jsxs)(`div`,{className:`flex min-h-10 items-center hover:bg-muted/35 sm:min-h-9`,children:[h,y]}),t[19]=h,t[20]=y,t[21]=x):x=t[21];let S;t[22]!==n.noticeText||t[23]!==r?(S=r?(0,A.jsx)(`div`,{className:`px-9 pt-1 pb-4 sm:px-10`,children:(0,A.jsx)(`pre`,{className:`max-w-[76ch] whitespace-pre-wrap break-words font-mono text-xs/5 text-foreground/80`,children:n.noticeText})}):null,t[22]=n.noticeText,t[23]=r,t[24]=S):S=t[24];let C;t[25]===S?C=t[26]:(C=(0,A.jsx)(g,{children:S}),t[25]=S,t[26]=C);let w;t[27]!==x||t[28]!==C?(w=(0,A.jsxs)(`article`,{children:[x,C]}),t[27]=x,t[28]=C,t[29]=w):w=t[29];let T;return t[30]!==s||t[31]!==r||t[32]!==w?(T=(0,A.jsx)(v,{open:r,onOpenChange:s,children:w}),t[30]=s,t[31]=r,t[32]=w,t[33]=T):T=t[33],T}function F(e){let t=(0,b.c)(2),{filteredCount:n,totalCount:r}=e,i=n===r?`${String(r)} notices`:`${String(n)} of ${String(r)}`,a;return t[0]===i?a=t[1]:(a=(0,A.jsx)(`p`,{className:`whitespace-nowrap text-xs font-normal text-muted-foreground tabular-nums`,children:i}),t[0]=i,t[1]=a),a}function I(e){let t=(0,b.c)(34),{query:n,onQueryChange:r,searchOpen:i,onSearchOpenChange:o,filteredCount:m,totalCount:h}=e;if(!i){let e;t[0]!==m||t[1]!==h?(e=(0,A.jsx)(F,{filteredCount:m,totalCount:h}),t[0]=m,t[1]=h,t[2]=e):e=t[2];let n;t[3]===o?n=t[4]:(n=()=>o(!0),t[3]=o,t[4]=n);let r;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,A.jsx)(s,{className:`size-3`}),t[5]=r):r=t[5];let i;t[6]===n?i=t[7]:(i=(0,A.jsx)(c,{render:(0,A.jsx)(a,{"aria-label":`Search open-source licenses`,onClick:n,size:`icon-micro`,type:`button`,variant:`ghost-muted`,children:r})}),t[6]=n,t[7]=i);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,A.jsx)(l,{side:`top`,children:`Search licenses`}),t[8]=d):d=t[8];let f;t[9]===i?f=t[10]:(f=(0,A.jsxs)(u,{children:[i,d]}),t[9]=i,t[10]=f);let p;return t[11]!==e||t[12]!==f?(p=(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[e,f]}),t[11]=e,t[12]=f,t[13]=p):p=t[13],p}let g;t[14]!==m||t[15]!==h?(g=(0,A.jsx)(`div`,{className:`hidden sm:block`,children:(0,A.jsx)(F,{filteredCount:m,totalCount:h})}),t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,A.jsx)(d,{children:(0,A.jsx)(s,{"aria-hidden":!0,className:`size-3`})}),t[17]=_):_=t[17];let v;t[18]!==o||t[19]!==n.length?(v=()=>{n.length===0&&o(!1)},t[18]=o,t[19]=n.length,t[20]=v):v=t[20];let y;t[21]===r?y=t[22]:(y=e=>r(e.currentTarget.value),t[21]=r,t[22]=y);let x;t[23]!==r||t[24]!==o?(x=e=>{e.key===`Escape`&&(e.preventDefault(),r(``),o(!1))},t[23]=r,t[24]=o,t[25]=x):x=t[25];let S;t[26]!==n||t[27]!==v||t[28]!==y||t[29]!==x?(S=(0,A.jsxs)(p,{className:`w-36 sm:w-44`,children:[_,(0,A.jsx)(f,{"aria-label":`Search open-source licenses`,autoFocus:!0,onBlur:v,onChange:y,onKeyDown:x,placeholder:`Search licenses`,size:`sm`,type:`search`,value:n})]}),t[26]=n,t[27]=v,t[28]=y,t[29]=x,t[30]=S):S=t[30];let C;return t[31]!==g||t[32]!==S?(C=(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g,S]}),t[31]=g,t[32]=S,t[33]=C):C=t[33],C}function L(e){let t=(0,b.c)(8),{message:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,A.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Open-source notices are unavailable`}),t[0]=i):i=t[0];let o;t[1]===n?o=t[2]:(o=(0,A.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[i,(0,A.jsx)(`p`,{className:`max-w-[70ch] text-pretty text-xs leading-normal text-muted-foreground/80`,children:n})]}),t[1]=n,t[2]=o);let s;t[3]===r?s=t[4]:(s=(0,A.jsx)(a,{type:`button`,size:`xs`,variant:`outline`,onClick:r,children:`Try again`}),t[3]=r,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-3 px-3 py-5 sm:px-4`,children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function R(){let e=(0,b.c)(25),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`loading`},e[0]=t):t=e[0];let[n,r]=(0,y.useState)(t),[i,a]=(0,y.useState)(``),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(0),f;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=!1;return r({status:`loading`}),N().then(t=>{e||r({status:`ready`,manifest:t})},t=>{e||r({status:`error`,message:t instanceof Error?t.message:`The license manifest could not load.`})}),()=>{e=!0}},e[1]=f):f=e[1];let p;e[2]===u?p=e[3]:(p=[u],e[2]=u,e[3]=p),(0,y.useEffect)(f,p);let g;e[4]!==n.manifest||e[5]!==n.status?(g=n.status===`ready`?n.manifest.entries:[],e[4]=n.manifest,e[5]=n.status,e[6]=g):g=e[6];let _=g,v;e[7]!==_||e[8]!==i?(v=E(_,i),e[7]=_,e[8]=i,e[9]=v):v=e[9];let x=v,S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>d(z),e[10]=S):S=e[10];let C=S,w;e[11]!==_||e[12]!==x||e[13]!==i||e[14]!==o||e[15]!==n.status?(w=n.status===`ready`?(0,A.jsx)(I,{query:i,onQueryChange:a,searchOpen:o,onSearchOpenChange:s,filteredCount:x.length,totalCount:_.length}):null,e[11]=_,e[12]=x,e[13]=i,e[14]=o,e[15]=n.status,e[16]=w):w=e[16];let T;e[17]!==x||e[18]!==c||e[19]!==n.message||e[20]!==n.status?(T=n.status===`ready`?(0,A.jsx)(`div`,{className:`text-base sm:text-sm`,children:x.length>0?x.map(e=>{let t=k(e);return(0,A.jsx)(P,{entry:e,open:c===t,onOpenChange:e=>l(e?t:null)},t)}):(0,A.jsx)(`p`,{className:`px-3 py-8 text-center text-sm/6 text-muted-foreground sm:px-4`,children:`No licenses match that search.`})}):n.status===`error`?(0,A.jsx)(L,{message:n.message,onRetry:C}):(0,A.jsx)(`p`,{className:`px-3 py-5 text-sm/6 text-muted-foreground sm:px-4`,children:`Loading open-source notices…`}),e[17]=x,e[18]=c,e[19]=n.message,e[20]=n.status,e[21]=T):T=e[21];let D;return e[22]!==w||e[23]!==T?(D=(0,A.jsx)(m,{children:(0,A.jsx)(h,{title:`Third-party notices`,headerAction:w,children:T})}),e[22]=w,e[23]=T,e[24]=D):D=e[24],D}function z(e){return e+1}var B=R;export{B as component};
|
|
2
|
+
//# sourceMappingURL=settings.open-source-licenses-Cnz72Gu0.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{$n as i,$p as a,A_ as o,Ab as s,Ep as c,F_ as l,I_ as u,Jn as d,M_ as f,N_ as p,Os as m,P_ as h,Rm as g,Sd as _,Xp as v,Yn as y,Yp as b,aE as x,cd as S,dr as C,fl as w,im as T,j_ as E,jd as D,k_ as O,l as k,mm as A,nT as j,t as M,tr as N,ts as P,um as F,ur as I}from"./utils-D19Exirm.js";import{n as L}from"./ChatMarkdown-DQk9NI7y.js";import{a as R,c as z,o as B,s as V,t as H}from"./select-CML8G0wN.js";import{t as U}from"./spinner-H4tz4lLc.js";import{t as W}from"./useLocation--dLSTvwv.js";import{p as G}from"./toast-BNQWmVQ-.js";import{S as K}from"./useSettings-BNjvPVd5.js";import{f as q}from"./server-ELSEsqtb.js";import{n as ee}from"./query-D-IVadFI.js";import{t as J}from"./use-atom-command-REOTdDAa.js";import{s as te,u as ne}from"./providerSkills-CCJGD2Js.js";import{i as Y}from"./usageFormat-xrTYBhxI.js";import{a as re,n as ie,t as ae}from"./tooltip-DsRaXpYk.js";import{t as oe}from"./skeleton-eiJFH0l9.js";import{t as se}from"./textarea-CkmpNgx5.js";import{n as ce,t as le}from"./toggle-group-DV__8G6T.js";import{t as ue}from"./input-yNgBXsRj.js";import{c as de,r as fe,s as pe,t as me}from"./dialog-CKG1aUT3.js";import{i as he,o as ge,r as _e,t as ve}from"./empty-D6SdnsPw.js";import{n as ye,r as be,t as xe}from"./input-group-APyqVexM.js";import{a as Se}from"./projectFilesQueryState-Cl_MU7SH.js";import{F as Ce,G as we,V as Te,a as Ee,i as De,s as Oe}from"./settingsLayout-aLGl3ZXu.js";import{Gr as ke,Jr as Ae,Kr as je,Wr as Me,Xr as Ne,Yr as Pe,oa as X,qr as Fe,uo as Ie,vr as Le}from"./main-CNcsYwUg.js";import{i as Re}from"./selfImproveFindings-DuRaHmql.js";import{r as ze,t as Be}from"./SelfImproveSettingsSection-DwtwZ9He.js";import{t as Ve}from"./SecretInput-BTBcl8SC.js";var Z=n(),He={spawn:`Failed to start`,timeout:`Timed out`,protocol:`Not an MCP server`,http:`Can't connect`,auth:`Credentials rejected`};function Ue(e,t,n){if(!e.enabled)return{tone:`muted`,label:`Off`,needsSignIn:!1};if(n)return{tone:`muted`,label:`Checking…`,needsSignIn:!1};if(e.transport.type===`http`&&e.transport.auth===`oauth`&&t?.auth===`signed-out`)return{tone:`warning`,label:`Needs sign-in`,needsSignIn:!0};let r=t?.health;switch(r?.status){case`connected`:return{tone:`success`,label:`Connected · ${r.toolCount} ${r.toolCount===1?`tool`:`tools`}`,needsSignIn:!1};case`needs-auth`:return{tone:`warning`,label:`Needs sign-in`,needsSignIn:!0};case`error`:return{tone:`error`,label:He[r.category],detail:r.message,needsSignIn:!1};default:return t?.auth===`signed-in`?{tone:`success`,label:`Signed in`,needsSignIn:!1}:{tone:`muted`,label:`Not checked`,needsSignIn:!1}}}function We(e){let t=e.transport;if(t.type===`http`)try{let e=new URL(t.url);return`Remote · ${e.host}${e.pathname===`/`?``:e.pathname}`}catch{return`Remote`}return[t.command,...t.args].join(` `)}var Q=e(t(),1),Ge=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Ke=e=>typeof e==`string`&&e.trim()?e:void 0,qe=e=>{if(e!==null)try{let t=JSON.parse(e);return Ge(t)?t:void 0}catch{return}},Je=e=>{let t=Ke(e)?.replace(/^\.\//,``);if(t!==void 0&&t.toLowerCase().endsWith(`.svg`)&&!(t.startsWith(`/`)||t.split(/[\\/]/).includes(`..`)))return t};function Ye(e,t){let n=qe(e),r=qe(t),i=Ge(r?.interface)?r.interface:void 0,a=n?.author??r?.author,o={displayName:Ke(n?.displayName)??Ke(i?.displayName),description:Ke(n?.description)??Ke(r?.description),publisher:Ke(a)??(Ge(a)?Ke(a.name):void 0),iconPath:Je(n?.icon)??Je(i?.logo)??Je(i?.composerIcon)};return Object.fromEntries(Object.entries(o).filter(([,e])=>e!==void 0))}function Xe(e){let t=qe(e)?.userConfig;return Ge(t)?Object.entries(t).map(([e,t])=>{let n=Ge(t)?t:{},r=Ke(n.description);return{key:e,title:Ke(n.title)??e,...r===void 0?{}:{description:r},required:n.required===!0}}):[]}var $=e(r(),1),Ze=e=>{let t=x(m(e));return t&&!t.truncated?t.contents:null};function Qe(e){let t=(0,Z.c)(48),{environmentId:n,plugin:r,enabled:o,disabled:s,onDetails:l,onToggle:u}=e,d;t[0]!==n||t[1]!==r.path?(d=Se(n,r.path,`.claude-plugin/plugin.json`),t[0]=n,t[1]=r.path,t[2]=d):d=t[2];let f=P(d),p;t[3]!==n||t[4]!==r.path?(p=Se(n,r.path,`.codex-plugin/plugin.json`),t[3]=n,t[4]=r.path,t[5]=p):p=t[5];let m=P(p),{displayName:h,description:g,publisher:_,iconPath:v}=Ye(Ze(f),Ze(m)),b=Ze(P(Se(n,r.path,v??null))),x=v&&b?.trimStart().startsWith(`<`)?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(b)}`:null,S=ne(n),w;t[6]===x?w=t[7]:(w=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`flex size-10 shrink-0 items-center justify-center rounded-xl border border-border/60 bg-muted`,children:x?(0,$.jsx)(`img`,{src:x,alt:``,className:`size-6 object-contain`}):(0,$.jsx)(a,{className:`size-5 text-muted-foreground`})}),t[6]=x,t[7]=w);let T=h??r.name,E;t[8]===T?E=t[9]:(E=(0,$.jsx)(`span`,{className:`break-words text-sm font-medium`,children:T}),t[8]=T,t[9]=E);let D;t[10]===_?D=t[11]:(D=_?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:_}):null,t[10]=_,t[11]=D);let O;t[12]!==E||t[13]!==D?(O=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[E,D]}),t[12]=E,t[13]=D,t[14]=O):O=t[14];let k=g??`Local plugin`,A;t[15]===k?A=t[16]:(A=(0,$.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:k}),t[15]=k,t[16]=A);let j;t[17]!==O||t[18]!==A?(j=(0,$.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[O,A]}),t[17]=O,t[18]=A,t[19]=j):j=t[19];let M=`More for ${r.name}`,F;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(c,{"aria-hidden":!0}),t[20]=F):F=t[20];let L;t[21]===M?L=t[22]:(L=(0,$.jsx)(re,{render:(0,$.jsx)(I,{render:(0,$.jsx)(C,{variant:`ghost`,size:`icon-sm`,"aria-label":M,children:F})})}),t[21]=M,t[22]=L);let R;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(ie,{children:`Plugin actions`}),t[23]=R):R=t[23];let z;t[24]===L?z=t[25]:(z=(0,$.jsxs)(ae,{children:[L,R]}),t[24]=L,t[25]=z);let B;t[26]!==n||t[27]!==S||t[28]!==r.path?(B=S.capabilities.canOpenDefault?(0,$.jsx)(i,{onClick:()=>void S.activate(`open`,{environmentId:n,filePath:r.path,workspaceRoot:void 0}),children:`Open`}):null,t[26]=n,t[27]=S,t[28]=r.path,t[29]=B):B=t[29];let V;t[30]===l?V=t[31]:(V=(0,$.jsx)(i,{onClick:l,children:`Details`}),t[30]=l,t[31]=V);let H;t[32]!==B||t[33]!==V?(H=(0,$.jsxs)(N,{align:`end`,children:[B,V]}),t[32]=B,t[33]=V,t[34]=H):H=t[34];let U;t[35]!==z||t[36]!==H?(U=(0,$.jsxs)(y,{children:[z,H]}),t[35]=z,t[36]=H,t[37]=U):U=t[37];let W=`Load ${r.name}`,G;t[38]!==s||t[39]!==o||t[40]!==u||t[41]!==W?(G=(0,$.jsx)(Ie,{"aria-label":W,checked:o,disabled:s,onCheckedChange:u}),t[38]=s,t[39]=o,t[40]=u,t[41]=W,t[42]=G):G=t[42];let K;return t[43]!==j||t[44]!==U||t[45]!==G||t[46]!==w?(K=(0,$.jsxs)(`li`,{className:`flex items-center gap-4 py-4`,children:[w,j,U,G]}),t[43]=j,t[44]=U,t[45]=G,t[46]=w,t[47]=K):K=t[47],K}var $e=[`Personal`,`Built-in`,`Project`,`Plugins`,`Other`];function et(e){switch(te(e)){case`personal`:return`Personal`;case`system`:return`Built-in`;case`repo`:case`project`:return`Project`;case`app`:return`Plugins`;default:return`Other`}}var tt=[[`codex`,`Codex`],[`claudeAgent`,`Claude`],[`cursor`,`Cursor`],[`grok`,`Grok`],[`antigravity`,`Antigravity`],[`opencode`,`OpenCode`],[`muse`,`Muse`],[`pi`,`Pi`]],nt={remote:`Remote servers aren't supported by this provider`,"working-directory":`Servers with a working directory aren't supported here`,provider:`Not supported by this provider yet`};function rt(e){return tt.find(([t])=>t===e)?.[1]??e}function it(e){switch(e){case`signed-in`:return`Signed in`;case`signed-out`:return`Not signed in`;case`unavailable`:return`Add this server to the provider's own MCP config to sign in.`;case`unknown`:return`Sign-in status unknown`}}function at(e,t){if(!h(e))return`unavailable`;let n=t.filter(t=>t.driver===e);if(n.some(e=>e.status===`signed-in`))return`signed-in`;if(n.some(e=>e.status===`signed-out`))return`needs-sign-in`}function ot(e){return tt.map(([t,n])=>{let r=f(t,e.transport),i=u.make(t);return{driver:i,label:n,enabled:r.supported&&!e.disabledProviders.includes(i),...r.supported?{}:{unsupported:nt[r.reason]}}})}var st={name:``,type:`stdio`,command:``,args:``,cwd:``,url:``,auth:`none`,values:[]};function ct(e){let t=e.transport;return t.type===`stdio`?{...st,name:e.name,type:`stdio`,command:t.command,args:t.args.join(`
|
|
2
|
+
`),cwd:t.cwd??``,values:Object.entries(t.env).map(([e,t])=>({key:e,value:t}))}:{...st,name:e.name,type:`http`,url:t.url,auth:t.auth,values:Object.entries(t.headers).map(([e,t])=>({key:e,value:t}))}}var lt=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;function ut(e,t){let n=e.name.trim();if(!n)return`Enter a name.`;if(!lt.test(n)||n.length>64)return`Use letters, numbers, dashes, and underscores.`;if(n===`p4-code`)return`That name belongs to P4 Code's own server.`;if(t.has(n))return`Another server already uses that name.`;if(e.type===`stdio`&&!e.command.trim())return`Enter the command that starts it.`;if(e.type===`http`&&!/^https?:\/\/\S+$/i.test(e.url.trim()))return`Enter an http or https URL.`}function dt(e,t){let n=Object.fromEntries(e.values.map(e=>[e.key.trim(),e.value]).filter(([e])=>e.length>0)),r=e.type===`stdio`?{type:`stdio`,command:e.command.trim(),args:e.args.split(`
|
|
3
|
+
`).map(e=>e.trim()).filter(e=>e.length>0),env:n,...e.cwd.trim()?{cwd:e.cwd.trim()}:{}}:{type:`http`,url:e.url.trim(),headers:n,auth:e.auth};return{name:e.name.trim(),enabled:t?.enabled??!0,transport:r,disabledProviders:t?.disabledProviders??[],...t?.source===void 0?{}:{source:t.source}}}function ft(e){let t=new Map;for(let n of e){let e=n.displayName??n.driver;for(let r of n.skills){let n=`${r.scope??``}\u0000${r.name}`,i=t.get(n);i===void 0?t.set(n,{skill:r,providers:[e]}):i.providers.includes(e)||i.providers.push(e)}}return[...t.values()].toSorted((e,t)=>pt(e.skill).localeCompare(pt(t.skill)))}var pt=e=>e.displayName??e.name.split(/[-_\s]+/).filter(e=>e.length>0).map(e=>e[0].toUpperCase()+e.slice(1)).join(` `);function mt(e){switch(e){case void 0:return;case`user`:return`Personal`;case`project`:case`repo`:return`Project`;case`system`:return`Built-in`;default:return e[0].toUpperCase()+e.slice(1)}}function ht(e){let t=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/.exec(e);return(t===null?e:e.slice(t[0].length)).trimStart()}function gt(e){let t=(0,Z.c)(14),{title:n,onBack:r,onUninstall:i,children:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(S,{"aria-hidden":!0}),t[0]=o):o=t[0];let s;t[1]===r?s=t[2]:(s=(0,$.jsxs)(C,{size:`xs`,variant:`ghost`,className:`w-fit`,onClick:r,children:[o,`Back`]}),t[1]=r,t[2]=s);let c;t[3]===n?c=t[4]:(c=(0,$.jsx)(`h2`,{className:`min-w-0 truncate text-xl font-semibold text-foreground`,children:n}),t[3]=n,t[4]=c);let l;t[5]===i?l=t[6]:(l=i?(0,$.jsxs)(C,{size:`sm`,variant:`destructive-outline`,onClick:i,children:[(0,$.jsx)(g,{"aria-hidden":!0}),`Uninstall`]}):null,t[5]=i,t[6]=l);let u;t[7]!==c||t[8]!==l?(u=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9];let d;return t[10]!==a||t[11]!==s||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`grid gap-6`,children:[s,u,a]}),t[10]=a,t[11]=s,t[12]=u,t[13]=d):d=t[13],d}function _t(e){let t=(0,Z.c)(6),{label:n,htmlFor:r,children:i}=e,a;t[0]!==r||t[1]!==n?(a=(0,$.jsx)(X,{htmlFor:r,children:n}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=(0,$.jsxs)(`div`,{className:`grid gap-2 px-4 py-4`,children:[a,i]}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function vt(e){let t=(0,Z.c)(69),{server:n,takenNames:r,onSave:i}=e,a;t[0]===n?a=t[1]:(a=n===void 0?st:ct(n),t[0]=n,t[1]=a);let o=a,[s,c]=(0,Q.useState)(o),l;t[2]===o?l=t[3]:(l=JSON.stringify(o),t[2]=o,t[3]=l);let u=l,[d,f]=(0,Q.useState)(u);u!==d&&(f(u),c(o));let p;t[4]!==s||t[5]!==r?(p=ut(s,r),t[4]=s,t[5]=r,t[6]=p):p=t[6];let m=p,h;t[7]===s?h=t[8]:(h=JSON.stringify(s),t[7]=s,t[8]=h);let _=h!==u,y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>c(t=>({...t,...e})),t[9]=y):y=t[9];let b=y,x=s.type===`stdio`?`Environment variables`:`Headers`,S;t[10]===s.values?S=t[11]:(S=(e,t)=>b({values:s.values.map((n,r)=>r===e?{...n,...t}:n)}),t[10]=s.values,t[11]=S);let w=S,T;t[12]!==_||t[13]!==s||t[14]!==i||t[15]!==m||t[16]!==n?(T=e=>{e.preventDefault(),_&&m===void 0&&i(dt(s,n))},t[12]=_,t[13]=s,t[14]=i,t[15]=m,t[16]=n,t[17]=T):T=t[17];let E;t[18]===n?E=t[19]:(E=n===void 0?null:(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`To switch between a command and a URL, uninstall the server and add it again.`}),t[18]=n,t[19]=E);let D;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>b({name:e.target.value}),t[20]=D):D=t[20];let O;t[21]===s.name?O=t[22]:(O=(0,$.jsx)(_t,{label:`Name`,htmlFor:`mcp-server-name`,children:(0,$.jsx)(ue,{id:`mcp-server-name`,placeholder:`github`,value:s.name,onChange:D})}),t[21]=s.name,t[22]=O);let k;t[23]!==s.type||t[24]!==n?(k=n===void 0?(0,$.jsx)(_t,{label:`Type`,children:(0,$.jsxs)(ce,{"aria-label":`How P4 Code reaches the server`,value:[s.type],onValueChange:e=>{let t=e[0];(t===`stdio`||t===`http`)&&b({type:t,values:[]})},children:[(0,$.jsx)(le,{value:`stdio`,children:`Command`}),(0,$.jsx)(le,{value:`http`,children:`URL`})]})}):null,t[23]=s.type,t[24]=n,t[25]=k):k=t[25];let A;t[26]!==s.args||t[27]!==s.auth||t[28]!==s.command||t[29]!==s.cwd||t[30]!==s.type||t[31]!==s.url?(A=s.type===`stdio`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(_t,{label:`Command`,htmlFor:`mcp-server-command`,children:(0,$.jsx)(ue,{id:`mcp-server-command`,placeholder:`npx`,value:s.command,onChange:e=>b({command:e.target.value})})}),(0,$.jsx)(_t,{label:`Arguments, one per line`,htmlFor:`mcp-server-args`,children:(0,$.jsx)(se,{id:`mcp-server-args`,placeholder:`-y
|
|
4
|
+
@modelcontextprotocol/server-postgres`,value:s.args,onChange:e=>b({args:e.target.value})})}),(0,$.jsx)(_t,{label:`Working directory (optional)`,htmlFor:`mcp-server-cwd`,children:(0,$.jsx)(ue,{id:`mcp-server-cwd`,placeholder:`The session's project folder`,value:s.cwd,onChange:e=>b({cwd:e.target.value})})})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(_t,{label:`URL`,htmlFor:`mcp-server-url`,children:(0,$.jsx)(ue,{id:`mcp-server-url`,placeholder:`https://mcp.example.com/mcp`,value:s.url,onChange:e=>b({url:e.target.value})})}),(0,$.jsx)(_t,{label:`Authentication`,children:(0,$.jsxs)(H,{value:s.auth,onValueChange:e=>{(e===`none`||e===`oauth`)&&b({auth:e})},children:[(0,$.jsx)(V,{"aria-label":`Authentication`,children:(0,$.jsx)(z,{children:yt})}),(0,$.jsxs)(B,{alignItemWithTrigger:!1,children:[(0,$.jsx)(R,{value:`none`,children:`None or headers`}),(0,$.jsx)(R,{value:`oauth`,children:`OAuth (sign in after saving)`})]})]})})]}),t[26]=s.args,t[27]=s.auth,t[28]=s.command,t[29]=s.cwd,t[30]=s.type,t[31]=s.url,t[32]=A):A=t[32];let j;t[33]!==s.type||t[34]!==s.values||t[35]!==w||t[36]!==x?(j=s.values.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(ue,{"aria-label":`${x} name`,placeholder:s.type===`stdio`?`API_TOKEN`:`Authorization`,value:e.key,onChange:e=>w(t,{key:e.target.value})}),(0,$.jsx)(Ve,{"aria-label":`${x} value`,placeholder:`Value`,value:e.value,onChange:e=>w(t,{value:e.target.value})}),(0,$.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":`Remove ${e.key||`row`}`,onClick:()=>b({values:s.values.filter((e,n)=>n!==t)}),children:(0,$.jsx)(g,{"aria-hidden":!0})})]},t)),t[33]=s.type,t[34]=s.values,t[35]=w,t[36]=x,t[37]=j):j=t[37];let M;t[38]===s.values?M=t[39]:(M=()=>b({values:[...s.values,{key:``,value:``}]}),t[38]=s.values,t[39]=M);let N;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(v,{"aria-hidden":!0}),t[40]=N):N=t[40];let P=s.type===`stdio`?`variable`:`header`,F;t[41]!==M||t[42]!==P?(F=(0,$.jsxs)(C,{variant:`soft`,onClick:M,children:[N,`Add `,P]}),t[41]=M,t[42]=P,t[43]=F):F=t[43];let I;t[44]!==j||t[45]!==F?(I=(0,$.jsxs)(`div`,{className:`grid gap-2`,children:[j,F]}),t[44]=j,t[45]=F,t[46]=I):I=t[46];let L;t[47]!==I||t[48]!==x?(L=(0,$.jsx)(_t,{label:x,children:I}),t[47]=I,t[48]=x,t[49]=L):L=t[49];let U;t[50]!==O||t[51]!==k||t[52]!==A||t[53]!==L?(U=(0,$.jsxs)(we,{children:[O,k,A,L]}),t[50]=O,t[51]=k,t[52]=A,t[53]=L,t[54]=U):U=t[54];let W;t[55]!==_||t[56]!==m?(W=_&&m!==void 0?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:m}):null,t[55]=_,t[56]=m,t[57]=W):W=t[57];let G=!_||m!==void 0,K=n===void 0?`Add server`:`Save`,q;t[58]!==G||t[59]!==K?(q=(0,$.jsx)(C,{type:`submit`,disabled:G,children:K}),t[58]=G,t[59]=K,t[60]=q):q=t[60];let ee;t[61]!==W||t[62]!==q?(ee=(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[W,q]}),t[61]=W,t[62]=q,t[63]=ee):ee=t[63];let J;return t[64]!==U||t[65]!==ee||t[66]!==T||t[67]!==E?(J=(0,$.jsxs)(`form`,{className:`grid gap-3`,onSubmit:T,children:[E,U,ee]}),t[64]=U,t[65]=ee,t[66]=T,t[67]=E,t[68]=J):J=t[68],J}function yt(e){return e===`oauth`?`OAuth (sign in after saving)`:`None or headers`}function bt(e){let t=(0,Z.c)(55),{environmentId:n,plugin:r,environmentLabel:i,onSave:a}=e,o=r?.path??``,s=r===void 0?null:`.claude-plugin/plugin.json`,c;t[0]!==n||t[1]!==o||t[2]!==s?(c=Se(n,o,s),t[0]=n,t[1]=o,t[2]=s,t[3]=c):c=t[3];let l=x(m(P(c))),u=Xe(r!==void 0&&l!==null&&!l.truncated?l.contents:null),d;t[4]===r?.options?d=t[5]:(d=r?.options??{},t[4]=r?.options,t[5]=d);let f=d,p=[...u,...Object.keys(f).filter(e=>!u.some(t=>t.key===e)).map(St)],[h,g]=(0,Q.useState)(r?.name??``),[_,v]=(0,Q.useState)(r?.path??``),[y,b]=(0,Q.useState)(f),S;t[6]!==r?.name||t[7]!==r?.path||t[8]!==f?(S=JSON.stringify([r?.name??``,r?.path??``,f]),t[6]=r?.name,t[7]=r?.path,t[8]=f,t[9]=S):S=t[9];let w=S,[T,E]=(0,Q.useState)(w);w!==T&&(E(w),g(r?.name??``),v(r?.path??``),b(f));let D,O;t[10]!==h||t[11]!==y||t[12]!==_||t[13]!==r?.name||t[14]!==r?.path||t[15]!==f?(D=Object.fromEntries(Object.entries(y).filter(xt)),O=h!==(r?.name??``)||_!==(r?.path??``)||JSON.stringify(D)!==JSON.stringify(f),t[10]=h,t[11]=y,t[12]=_,t[13]=r?.name,t[14]=r?.path,t[15]=f,t[16]=D,t[17]=O):(D=t[16],O=t[17]);let k=O,A;t[18]!==h||t[19]!==_?(A=h.trim().length>0&&_.trim().startsWith(`/`),t[18]=h,t[19]=_,t[20]=A):A=t[20];let j=A,M;t[21]!==k||t[22]!==h||t[23]!==D||t[24]!==a||t[25]!==_||t[26]!==r?.enabled||t[27]!==j?(M=e=>{e.preventDefault(),k&&j&&a({name:h.trim(),path:_.trim(),enabled:r?.enabled??!0,options:D})},t[21]=k,t[22]=h,t[23]=D,t[24]=a,t[25]=_,t[26]=r?.enabled,t[27]=j,t[28]=M):M=t[28];let N;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>g(e.target.value),t[29]=N):N=t[29];let F;t[30]===h?F=t[31]:(F=(0,$.jsx)(_t,{label:`Name`,htmlFor:`plugin-name`,children:(0,$.jsx)(ue,{id:`plugin-name`,value:h,onChange:N})}),t[30]=h,t[31]=F);let I=`Folder on ${i}`,L;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>v(e.target.value),t[32]=L):L=t[32];let R;t[33]===_?R=t[34]:(R=(0,$.jsx)(ue,{id:`plugin-path`,placeholder:`/Users/me/plugins/my-plugin`,value:_,onChange:L}),t[33]=_,t[34]=R);let z;t[35]!==I||t[36]!==R?(z=(0,$.jsx)(_t,{label:I,htmlFor:`plugin-path`,children:R}),t[35]=I,t[36]=R,t[37]=z):z=t[37];let B=p.map(e=>(0,$.jsx)(_t,{label:e.required?e.title:`${e.title} (optional)`,htmlFor:`plugin-option-${e.key}`,children:(0,$.jsx)(Ve,{id:`plugin-option-${e.key}`,placeholder:`description`in e?e.description:void 0,value:y[e.key]??``,onChange:t=>b(n=>({...n,[e.key]:t.target.value}))})},e.key)),V;t[38]!==F||t[39]!==z||t[40]!==B?(V=(0,$.jsxs)(we,{children:[F,z,B]}),t[38]=F,t[39]=z,t[40]=B,t[41]=V):V=t[41];let H;t[42]!==k||t[43]!==j?(H=k&&!j?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:`Enter a name and the plugin folder's full path.`}):null,t[42]=k,t[43]=j,t[44]=H):H=t[44];let U=!k||!j,W=r===void 0?`Add plugin`:`Save`,G;t[45]!==U||t[46]!==W?(G=(0,$.jsx)(C,{type:`submit`,disabled:U,children:W}),t[45]=U,t[46]=W,t[47]=G):G=t[47];let K;t[48]!==H||t[49]!==G?(K=(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[H,G]}),t[48]=H,t[49]=G,t[50]=K):K=t[50];let q;return t[51]!==V||t[52]!==K||t[53]!==M?(q=(0,$.jsxs)(`form`,{className:`grid gap-3`,onSubmit:M,children:[V,K]}),t[51]=V,t[52]=K,t[53]=M,t[54]=q):q=t[54],q}function xt(e){let[,t]=e;return t}function St(e){return{key:e,title:e,required:!1}}var Ct=e=>e.replace(/[\\/][^\\/]*$/,``)||`/`;function wt(e){let t=(0,Z.c)(69),{entry:n,environmentId:r,onClose:a}=e,{skill:o,providers:s}=n,l,u,d;t[0]!==r||t[1]!==o.path?(l=Ct(o.path),u=P,d=Se(r,l,o.path),t[0]=r,t[1]=o.path,t[2]=l,t[3]=u,t[4]=d):(l=t[2],u=t[3],d=t[4]);let f=u(d),p;t[5]===f?p=t[6]:(p=x(m(f)),t[5]=f,t[6]=p);let h=p,g=ne(r),{copyToClipboard:v}=G(),b;t[7]!==r||t[8]!==o.path?(b={environmentId:r,filePath:o.path,workspaceRoot:void 0},t[7]=r,t[8]=o.path,t[9]=b):b=t[9];let S=b,w=o.shortDescription??o.description,T;t[10]===o.scope?T=t[11]:(T=mt(o.scope),t[10]=o.scope,t[11]=T);let E=T,D;t[12]===a?D=t[13]:(D=e=>!e&&a(),t[12]=a,t[13]=D);let O;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`flex size-12 shrink-0 items-center justify-center rounded-full border border-border/60 text-muted-foreground`,children:(0,$.jsx)(_,{className:`size-5`})}),t[14]=O):O=t[14];let k;t[15]===o?k=t[16]:(k=pt(o),t[15]=o,t[16]=k);let A=`More for ${k}`,j;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(c,{"aria-hidden":!0}),t[17]=j):j=t[17];let M;t[18]===A?M=t[19]:(M=(0,$.jsx)(I,{render:(0,$.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":A,children:j})}),t[18]=A,t[19]=M);let F;t[20]!==g||t[21]!==S?(F=g.capabilities.canOpenDefault?(0,$.jsx)(i,{onClick:()=>void g.activate(`open`,S),children:`Open`}):null,t[20]=g,t[21]=S,t[22]=F):F=t[22];let R;t[23]!==g||t[24]!==S?(R=g.capabilities.revealLabel?(0,$.jsx)(i,{onClick:()=>void g.activate(`reveal-in-folder`,S),children:g.capabilities.revealLabel}):null,t[23]=g,t[24]=S,t[25]=R):R=t[25];let z=h===null,B;t[26]!==v||t[27]!==h?(B=()=>h&&v(h.contents,void 0),t[26]=v,t[27]=h,t[28]=B):B=t[28];let V;t[29]!==z||t[30]!==B?(V=(0,$.jsx)(i,{disabled:z,onClick:B,children:`Copy Markdown`}),t[29]=z,t[30]=B,t[31]=V):V=t[31];let H;t[32]!==F||t[33]!==R||t[34]!==V?(H=(0,$.jsxs)(N,{align:`end`,children:[F,R,V]}),t[32]=F,t[33]=R,t[34]=V,t[35]=H):H=t[35];let U;t[36]!==M||t[37]!==H?(U=(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3 pe-8`,children:[O,(0,$.jsxs)(y,{children:[M,H]})]}),t[36]=M,t[37]=H,t[38]=U):U=t[38];let W;t[39]===o?W=t[40]:(W=pt(o),t[39]=o,t[40]=W);let K;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`Skill`}),t[41]=K):K=t[41];let q;t[42]===W?q=t[43]:(q=(0,$.jsxs)(de,{children:[W,` `,K]}),t[42]=W,t[43]=q);let ee;t[44]===w?ee=t[45]:(ee=w?(0,$.jsx)(fe,{children:w}):null,t[44]=w,t[45]=ee);let J;t[46]!==q||t[47]!==ee?(J=(0,$.jsxs)(`div`,{className:`grid gap-1.5`,children:[q,ee]}),t[46]=q,t[47]=ee,t[48]=J):J=t[48];let te;t[49]!==l||t[50]!==r||t[51]!==h||t[52]!==f?(te=(0,$.jsx)(`div`,{className:`max-h-[50vh] min-h-24 overflow-y-auto rounded-xl border border-border/60 bg-card/40 px-5 py-4`,children:h===null?f._tag===`Failure`?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This skill's file could not be read. It may have moved since the provider last scanned it.`}):(0,$.jsxs)(`div`,{className:`grid gap-2`,children:[(0,$.jsx)(oe,{className:`h-4 w-3/4`}),(0,$.jsx)(oe,{className:`h-4 w-full`}),(0,$.jsx)(oe,{className:`h-4 w-2/3`})]}):(0,$.jsx)(L,{text:ht(h.contents),cwd:l,environmentId:r})}),t[49]=l,t[50]=r,t[51]=h,t[52]=f,t[53]=te):te=t[53];let Y;t[54]===s?Y=t[55]:(Y=s.join(`, `),t[54]=s,t[55]=Y);let re=`Loaded by ${Y}`,ie;t[56]!==E||t[57]!==re?(ie=[E,re].filter(Boolean),t[56]=E,t[57]=re,t[58]=ie):ie=t[58];let ae=ie.join(` · `),se;t[59]===ae?se=t[60]:(se=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:ae}),t[59]=ae,t[60]=se);let ce;t[61]!==U||t[62]!==J||t[63]!==te||t[64]!==se?(ce=(0,$.jsx)(pe,{className:`max-w-2xl`,children:(0,$.jsxs)(`div`,{className:`grid min-h-0 gap-4 p-6`,children:[U,J,te,se]})}),t[61]=U,t[62]=J,t[63]=te,t[64]=se,t[65]=ce):ce=t[65];let le;return t[66]!==ce||t[67]!==D?(le=(0,$.jsx)(me,{open:!0,onOpenChange:D,children:ce}),t[66]=ce,t[67]=D,t[68]=le):le=t[68],le}var Tt={"edited-both-sides":`Changed here and on another machine since the last sync.`,"unmanaged-local-collision":`This machine has its own copy with the same name.`,"deleted-remotely-edited-locally":`Deleted on another machine, changed here.`,"mass-removal-held":`Most synced items vanished from the hub at once, so nothing was removed here.`,"hub-behind-manifest":`The hub has an older copy than this machine last synced.`,"not-writable-here":`This machine cannot hold this item.`,"write-failed":`Could not be written here. The next sync tries again.`};function Et(e){return Tt[e]??e}var Dt={skill:`Skill`,agent:`Subagent`,memory:`Memory`,mcp:`MCP server`,settings:`Settings`};function Ot(e){return`${Dt[e.kind]} ${e.name}`}function kt(e){if(e.running)return`Syncing…`;let t=e.lastRun;if(t===null)return`Not synced since the server started.`;let n=Y(t.finishedAt);if(t.outcome===`unavailable`)return`Couldn't reach the hub at ${n}.`;let r=[t.received>0?`${t.received} received`:null,t.published>0?`${t.published} shared`:null,t.removed>0?`${t.removed} removed`:null].filter(e=>e!==null);return`Synced ${n}${r.length>0?` · ${r.join(` · `)}`:` · no changes`}.`}function At(){let e=(0,Z.c)(4),{scope:t,environment:n}=Te(),r=t.environmentIds.length===1?n?.environmentId??null:null,i=n?.connection.phase===`connected`&&n.serverConfig!==null,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=Le(`hub-sync`),e[0]=a):a=e[0];let o;return e[1]!==i||e[2]!==r?(o=(0,$.jsx)(Oe,{...a,children:r&&i?(0,$.jsx)(Mt,{environmentId:r}):(0,$.jsx)(Ee,{title:`Hub`,description:`Pick a single connected environment to sync its skills, subagents and memory.`})}),e[1]=i,e[2]=r,e[3]=o):o=e[3],o}function jt(e,t){let n=Re(e,t);return n.ok?null:n.message}function Mt(e){let t=(0,Z.c)(95),{environmentId:n}=e,r;t[0]===n?r=t[1]:(r=q.hubSyncLive({environmentId:n,input:void 0}),t[0]=n,t[1]=r);let i=ee(r),a;t[2]===n?a=t[3]:(a=q.connectHubSync.permissionAtom(n),t[2]=n,t[3]=a);let o=P(a),s;t[4]===n?s=t[5]:(s=q.runHubSyncNow.permissionAtom(n),t[4]=n,t[5]=s);let c=P(s),l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[6]=l):l=t[6];let u=l,d=J(q.disconnectHubSync,u),f=J(q.setHubSyncMode,u),p=J(q.runHubSyncNow,u),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(null),v=i.data;if(!v){let e=i.error?`Couldn't load hub sync.`:`Loading…`,n;return t[7]===e?n=t[8]:(n=(0,$.jsx)(Ee,{title:`Hub`,status:e}),t[7]=e,t[8]=n),n}let y=v.source!==`none`,b=v.source===`environment`,x;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=async e=>{h(!0),_(await e()),h(!1)},t[9]=x):x=t[9];let S=x,w,T,E,D,O,k,A,j,M,N;if(t[10]!==o||t[11]!==c||t[12]!==d||t[13]!==n||t[14]!==g||t[15]!==b||t[16]!==y||t[17]!==m||t[18]!==p||t[19]!==f||t[20]!==v){let e=v.lastRun?.conflicts??[],r=v.lastRun?.refused??[],i=!y,a=!o||y,s;t[31]!==n||t[32]!==a?(s=(0,$.jsx)(Pt,{environmentId:n,disabled:a}),t[31]=n,t[32]=a,t[33]=s):s=t[33],t[34]!==i||t[35]!==s?(O=(0,$.jsx)(Be,{open:i,children:s}),t[34]=i,t[35]=s,t[36]=O):O=t[36],T=Be,M=y;let l=b?` · set by P4CODE_HUB_URL on the server`:null,u;t[37]===g?u=t[38]:(u=(0,$.jsx)(ze,{text:g}),t[37]=g,t[38]=u);let h;t[39]!==v.baseUrl||t[40]!==l||t[41]!==u?(h=(0,$.jsxs)($.Fragment,{children:[v.baseUrl,l,u]}),t[39]=v.baseUrl,t[40]=l,t[41]=u,t[42]=h):h=t[42];let _;t[43]!==o||t[44]!==d||t[45]!==n||t[46]!==b||t[47]!==y||t[48]!==m?(_=b?null:(0,$.jsx)(C,{size:`sm`,variant:`outline`,disabled:!o||m||!y,onClick:()=>void S(async()=>jt(await d({environmentId:n,input:void 0}),`Couldn't disconnect.`)),children:`Disconnect`}),t[43]=o,t[44]=d,t[45]=n,t[46]=b,t[47]=y,t[48]=m,t[49]=_):_=t[49],t[50]!==h||t[51]!==_?(N=(0,$.jsx)(Ee,{title:`Hub`,status:h,control:_}),t[50]=h,t[51]=_,t[52]=N):N=t[52];let x=`When the server starts and every ${v.intervalMinutes} minutes.`,P=v.syncMode===`auto`,F=!o||m||!y,I;t[53]!==n||t[54]!==f?(I=e=>void S(async()=>jt(await f({environmentId:n,input:{syncMode:e?`auto`:`paused`}}),`Couldn't change automatic sync.`)),t[53]=n,t[54]=f,t[55]=I):I=t[55];let L;t[56]!==P||t[57]!==F||t[58]!==I?(L=(0,$.jsx)(Ie,{"aria-label":`Sync automatically`,checked:P,disabled:F,onCheckedChange:I}),t[56]=P,t[57]=F,t[58]=I,t[59]=L):L=t[59],t[60]!==x||t[61]!==L?(E=(0,$.jsx)(Ee,{title:`Sync automatically`,description:x,control:L}),t[60]=x,t[61]=L,t[62]=E):E=t[62];let R;t[63]===v?R=t[64]:(R=kt(v),t[63]=v,t[64]=R);let z;t[65]===R?z=t[66]:(z=(0,$.jsx)(`span`,{role:`status`,"aria-live":`polite`,children:R}),t[65]=R,t[66]=z);let B=!c||m||v.running||!y,V;t[67]!==n||t[68]!==p?(V=()=>void S(async()=>jt(await p({environmentId:n,input:void 0}),`Couldn't start a sync.`)),t[67]=n,t[68]=p,t[69]=V):V=t[69];let H;t[70]===v.running?H=t[71]:(H=v.running?(0,$.jsx)(U,{size:`xs`}):null,t[70]=v.running,t[71]=H);let W;t[72]!==B||t[73]!==V||t[74]!==H?(W=(0,$.jsxs)(C,{size:`sm`,variant:`outline`,disabled:B,onClick:V,children:[H,`Sync now`]}),t[72]=B,t[73]=V,t[74]=H,t[75]=W):W=t[75],t[76]!==z||t[77]!==W?(D=(0,$.jsx)(Ee,{title:`Last sync`,status:z,control:W}),t[76]=z,t[77]=W,t[78]=D):D=t[78],w=Ft,k=n,A=[...e,...r],j=new Set(e.map(Nt)),t[10]=o,t[11]=c,t[12]=d,t[13]=n,t[14]=g,t[15]=b,t[16]=y,t[17]=m,t[18]=p,t[19]=f,t[20]=v,t[21]=w,t[22]=T,t[23]=E,t[24]=D,t[25]=O,t[26]=k,t[27]=A,t[28]=j,t[29]=M,t[30]=N}else w=t[21],T=t[22],E=t[23],D=t[24],O=t[25],k=t[26],A=t[27],j=t[28],M=t[29],N=t[30];let F=!c||v.running||!y,I;t[79]!==w||t[80]!==F||t[81]!==k||t[82]!==A||t[83]!==j?(I=(0,$.jsx)(w,{environmentId:k,issues:A,resolvable:j,disabled:F}),t[79]=w,t[80]=F,t[81]=k,t[82]=A,t[83]=j,t[84]=I):I=t[84];let L;t[85]!==T||t[86]!==E||t[87]!==D||t[88]!==I||t[89]!==M||t[90]!==N?(L=(0,$.jsxs)(T,{open:M,children:[N,E,D,I]}),t[85]=T,t[86]=E,t[87]=D,t[88]=I,t[89]=M,t[90]=N,t[91]=L):L=t[91];let R;return t[92]!==O||t[93]!==L?(R=(0,$.jsxs)($.Fragment,{children:[O,L]}),t[92]=O,t[93]=L,t[94]=R):R=t[94],R}var Nt=e=>`${e.kind}/${e.name}`;function Pt(e){let t=(0,Z.c)(34),[n,r]=(0,Q.useState)(``),[i,a]=(0,Q.useState)(``),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(null),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={reportFailure:!1},t[0]=u):u=t[0];let d=J(q.connectHubSync,u),f=e.disabled||o,p;t[1]!==n||t[2]!==i?(p=n.trim()!==``&&i.trim()!==``,t[1]=n,t[2]=i,t[3]=p):p=t[3];let m=p,h;t[4]===c?h=t[5]:(h=(0,$.jsx)(ze,{text:c}),t[4]=c,t[5]=h);let g;t[6]!==n||t[7]!==d||t[8]!==f||t[9]!==e.environmentId||t[10]!==m||t[11]!==i?(g=t=>{t.preventDefault(),m&&!f&&(s(!0),d({environmentId:e.environmentId,input:{baseUrl:n.trim(),token:i.trim()}}).then(e=>{let t=jt(e,`Couldn't link the hub.`);l(t),t===null&&a(``),s(!1)}))},t[6]=n,t[7]=d,t[8]=f,t[9]=e.environmentId,t[10]=m,t[11]=i,t[12]=g):g=t[12];let _;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>r(e.target.value),t[13]=_):_=t[13];let v;t[14]!==n||t[15]!==f?(v=(0,$.jsx)(`div`,{className:`min-w-48 flex-1`,children:(0,$.jsx)(ue,{"aria-label":`Hub URL`,autoComplete:`off`,value:n,disabled:f,placeholder:`https://hub.example.ts.net`,onChange:_})}),t[14]=n,t[15]=f,t[16]=v):v=t[16];let y;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>a(e.target.value),t[17]=y):y=t[17];let b;t[18]!==f||t[19]!==i?(b=(0,$.jsx)(`div`,{className:`min-w-40 flex-1`,children:(0,$.jsx)(ue,{"aria-label":`Hub token`,type:`password`,autoComplete:`off`,value:i,disabled:f,placeholder:`Token`,onChange:y})}),t[18]=f,t[19]=i,t[20]=b):b=t[20];let x=f||!m,S;t[21]===o?S=t[22]:(S=o?(0,$.jsx)(U,{size:`xs`}):null,t[21]=o,t[22]=S);let w;t[23]!==x||t[24]!==S?(w=(0,$.jsxs)(C,{type:`submit`,size:`sm`,disabled:x,children:[S,`Connect`]}),t[23]=x,t[24]=S,t[25]=w):w=t[25];let T;t[26]!==w||t[27]!==g||t[28]!==v||t[29]!==b?(T=(0,$.jsxs)(`form`,{className:`flex max-w-xl flex-wrap items-center gap-2 pb-2`,onSubmit:g,children:[v,b,w]}),t[26]=w,t[27]=g,t[28]=v,t[29]=b,t[30]=T):T=t[30];let E;return t[31]!==T||t[32]!==h?(E=(0,$.jsx)(Ee,{title:`Hub`,description:`Keep skills, subagents and memory the same on every machine linked to one hub. Mint a token on the hub host with p4c hub token add.`,status:h,children:T}),t[31]=T,t[32]=h,t[33]=E):E=t[33],E}function Ft(e){let t=(0,Z.c)(13),n;t[0]===e.issues?n=t[1]:(n=new Map(e.issues.map(It)),t[0]=e.issues,t[1]=n);let r=n,[i,a]=(0,Q.useState)(e.issues),o;if(t[2]!==e.issues||t[3]!==i){let n;t[5]===i?n=t[6]:(n=e=>!i.some(t=>Nt(t)===Nt(e)),t[5]=i,t[6]=n),o=[...i,...e.issues.filter(n)],t[2]=e.issues,t[3]=i,t[4]=o}else o=t[4];let s=o;s.length!==i.length&&a(s);let c;return t[7]!==r||t[8]!==s||t[9]!==e.disabled||t[10]!==e.environmentId||t[11]!==e.resolvable?(c=(0,$.jsx)($.Fragment,{children:s.map(t=>{let n=Nt(t),i=r.get(n);return(0,$.jsx)(`div`,{onTransitionEnd:e=>{e.target!==e.currentTarget.firstChild||i||a(e=>e.filter(e=>Nt(e)!==n))},children:(0,$.jsx)(Be,{open:i!==void 0,children:(0,$.jsx)(Lt,{environmentId:e.environmentId,issue:i??t,resolutions:e.resolvable.has(n)?w(t.reason):[],disabled:e.disabled||i===void 0})})},n)})}),t[7]=r,t[8]=s,t[9]=e.disabled,t[10]=e.environmentId,t[11]=e.resolvable,t[12]=c):c=t[12],c}function It(e){return[Nt(e),e]}function Lt(e){let t=(0,Z.c)(24),{issue:n}=e,[r,i]=(0,Q.useState)(!1),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(!1),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[0]=l):l=t[0];let u=J(q.resolveHubSyncConflict,l),d;t[1]===n?d=t[2]:(d=Ot(n),t[1]=n,t[2]=d);let f=d,p;t[3]!==n.kind||t[4]!==n.name||t[5]!==e.environmentId||t[6]!==u?(p=async t=>{i(!0),o(jt(await u({environmentId:e.environmentId,input:{kind:n.kind,name:n.name,resolution:t}}),`Couldn't apply that choice.`)),i(!1),c(!1)},t[3]=n.kind,t[4]=n.name,t[5]=e.environmentId,t[6]=u,t[7]=p):p=t[7];let m=p,h=e.disabled||r,g;t[8]===n.reason?g=t[9]:(g=Et(n.reason),t[8]=n.reason,t[9]=g);let _;t[10]===a?_=t[11]:(_=(0,$.jsx)(ze,{text:a}),t[10]=a,t[11]=_);let v;t[12]!==s||t[13]!==h||t[14]!==r||t[15]!==e.resolutions||t[16]!==m||t[17]!==f?(v=e.resolutions.length===0?null:(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[e.resolutions.includes(`keep-local`)?(0,$.jsx)(C,{size:`sm`,variant:`outline`,disabled:h,onClick:()=>void m(`keep-local`),children:`Keep this machine's`}):null,e.resolutions.includes(`use-hub`)?(0,$.jsxs)(Me,{open:s,onOpenChange:e=>{r||c(e)},children:[(0,$.jsx)(C,{size:`sm`,variant:`outline`,disabled:h,onClick:()=>c(!0),children:`Use hub's`}),(0,$.jsxs)(Pe,{children:[(0,$.jsxs)(Ae,{children:[(0,$.jsxs)(Ne,{children:[`Replace this machine's `,f,`?`]}),(0,$.jsx)(je,{children:`The hub's copy overwrites the one here. Changes made only on this machine are lost.`})]}),(0,$.jsxs)(Fe,{children:[(0,$.jsx)(ke,{disabled:r,render:(0,$.jsx)(C,{variant:`outline`,disabled:r}),children:`Cancel`}),(0,$.jsxs)(C,{variant:`destructive`,disabled:r,onClick:()=>void m(`use-hub`),children:[r?(0,$.jsx)(U,{size:`sm`}):null,`Replace`]})]})]})]}):null]}),t[12]=s,t[13]=h,t[14]=r,t[15]=e.resolutions,t[16]=m,t[17]=f,t[18]=v):v=t[18];let y;return t[19]!==g||t[20]!==_||t[21]!==v||t[22]!==f?(y=(0,$.jsx)(Ee,{title:f,description:g,status:_,control:v}),t[19]=g,t[20]=_,t[21]=v,t[22]=f,t[23]=y):y=t[23],y}var Rt={claude:`Claude`,codex:`Codex`,cursor:`Cursor`},zt={success:`bg-success`,warning:`bg-warning`,error:`bg-destructive`,muted:`bg-muted-foreground/40`},Bt={success:`text-success-foreground`,warning:`text-warning-foreground`,error:`text-destructive-foreground`,muted:`text-muted-foreground`},Vt=s(O);function Ht(e){let t=j(e);return Vt(t)&&t.reason===`rejected`?`This server only lets apps it has approved sign in, and it refused P4 Code. Sign in with a provider below instead.`:`Sign-in could not start. Check the server URL, then try again.`}function Ut(e,t,n){return e.transport.type===`http`&&(e.transport.auth===`oauth`||n?.auth===`signed-in`||t.needsSignIn)}function Wt(e){let t=(0,Z.c)(13),{status:n,className:r}=e,i=Bt[n.tone],a;t[0]!==r||t[1]!==i?(a=M(`flex min-w-0 items-center gap-1.5 text-xs`,i,r),t[0]=r,t[1]=i,t[2]=a):a=t[2];let o=zt[n.tone],s;t[3]===o?s=t[4]:(s=M(`size-1.5 shrink-0 rounded-full`,o),t[3]=o,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,$.jsx)(`span`,{"aria-hidden":!0,className:s}),t[5]=s,t[6]=c);let l;t[7]===n.label?l=t[8]:(l=(0,$.jsx)(`span`,{className:`truncate`,children:n.label}),t[7]=n.label,t[8]=l);let u;return t[9]!==a||t[10]!==c||t[11]!==l?(u=(0,$.jsxs)(`span`,{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function Gt(){let e=(0,Z.c)(11),{environment:t,scope:n}=Te(),r=t?.connection.phase===`connected`&&t.serverConfig!==null,i=r?t.environmentId:null,a=r&&t.serverConfig?.environment.capabilities.mcpRegistry===!0,o;e[0]!==r||e[1]!==t||e[2]!==i||e[3]!==n||e[4]!==a?(o=t===null||!r?(0,$.jsx)(ve,{children:(0,$.jsxs)(he,{children:[(0,$.jsx)(ge,{children:`Connect to manage plugins and MCP servers`}),(0,$.jsx)(_e,{children:`They live on each environment. Choose a connected one above.`})]})}):!a||i===null?(0,$.jsx)(ve,{children:(0,$.jsxs)(he,{children:[(0,$.jsxs)(ge,{children:[`Update `,t.label,` to manage plugins and MCP servers`]}),(0,$.jsx)(_e,{children:`This environment runs a version without them.`})]})}):(0,$.jsx)(Yt,{environmentId:i,environmentLabel:t.label,projectId:n.kind===`checkout`?n.checkout.id:n.kind===`project`?n.members.find(e=>e.environmentId===i)?.id:void 0,projectLabel:n.kind===`project`||n.kind===`checkout`?n.label:void 0},i),e[0]=r,e[1]=t,e[2]=i,e[3]=n,e[4]=a,e[5]=o):o=e[5];let s;e[6]===r?s=e[7]:(s=r?(0,$.jsx)(At,{}):null,e[6]=r,e[7]=s);let c;return e[8]!==o||e[9]!==s?(c=(0,$.jsxs)(De,{width:`wide`,children:[o,s]}),e[8]=o,e[9]=s,e[10]=c):c=e[10],c}var Kt={plugins:`Search plugins`,mcps:`Search MCP servers`,skills:`Search skills`},qt=(e,...t)=>e===``||t.some(t=>t.toLowerCase().includes(e));function Jt(e){let t=(0,Z.c)(9),{text:n}=e,r=(0,Q.useRef)(null),[i,a]=(0,Q.useState)(!1),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{let t=r.current;a(e&&t!==null&&t.scrollWidth>t.clientWidth)},t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`span`,{ref:r,tabIndex:0,className:`block truncate text-xs text-muted-foreground`}),t[1]=s):s=t[1];let c,l;t[2]===n?(c=t[3],l=t[4]):(c=(0,$.jsx)(re,{render:s,children:n}),l=(0,$.jsx)(ie,{children:n}),t[2]=n,t[3]=c,t[4]=l);let u;return t[5]!==i||t[6]!==c||t[7]!==l?(u=(0,$.jsxs)(ae,{open:i,onOpenChange:o,children:[c,l]}),t[5]=i,t[6]=c,t[7]=l,t[8]=u):u=t[8],u}function Yt({environmentId:e,environmentLabel:t,projectId:n,projectLabel:r}){let s=W({select:e=>e.hash}),[u,d]=(0,Q.useState)(()=>s.replace(/^#/,``)===`mcp-servers`?`mcps`:s.replace(/^#/,``)===`skills`?`skills`:`plugins`),[f,m]=(0,Q.useState)(``),[h,g]=(0,Q.useState)(`All categories`),v=P(q.configValueAtom(e))?.providers,x=(0,Q.useMemo)(()=>ft(v??[]),[v]),[S,w]=(0,Q.useState)(null),O=Ce(e=>e.mcpServers),j=Ce(e=>e.plugins),M=Ce(e=>e.projectSettingsOverrides),L=Ce(e=>e.skillOverrides),U=ne(e),G=P(q.updateSettings.permissionAtom(e)),[ee,te]=(0,Q.useState)(null),Y=P(q.mcpRegistryTest.permissionAtom(e)),oe=K(e),se=J(q.updateSettings,{label:`update MCP registry`,reportFailure:!0}),ue=J(q.mcpRegistryState,{reportFailure:!1}),de=J(q.mcpRegistryTest,{label:`check MCP server`,reportFailure:!0}),fe=J(q.mcpRegistryOAuthStart,{label:`start MCP sign-in`,reportFailure:!0}),pe=J(q.mcpRegistryOAuthSignOut,{label:`sign out of MCP server`,reportFailure:!0}),me=J(q.mcpRegistryDiscover,{reportFailure:!1}),he=J(q.mcpRegistryImport,{label:`import MCP servers`,reportFailure:!0}),[ge,_e]=(0,Q.useState)({}),[ve,Se]=(0,Q.useState)(new Set),[we,Te]=(0,Q.useState)([]),[Ee,De]=(0,Q.useState)({kind:`list`}),X=Ee.kind!==`list`&&Ee.id!==null&&(Ee.kind===`server`?O[Ee.id]===void 0:j[Ee.id]===void 0)?{kind:`list`}:Ee,[Re,ze]=(0,Q.useState)(s);if(s!==Re){ze(s);let e=s.replace(/^#/,``);(e===`mcp-servers`||e===`plugins`||e===`skills`)&&(d(e===`mcp-servers`?`mcps`:e),De({kind:`list`}))}let[Be,Ve]=(0,Q.useState)(null),Z=(0,Q.useRef)(new Map),[He,Ge]=(0,Q.useState)(null),[Ke,qe]=(0,Q.useState)({}),Je=(0,Q.useMemo)(()=>Object.entries(O).map(([e,t])=>[o.make(e),t]).toSorted(([,e],[,t])=>e.name.localeCompare(t.name)),[O]),Ye=(0,Q.useMemo)(()=>Object.entries(j).map(([e,t])=>[E.make(e),t]),[j]),Xe=(0,Q.useCallback)(async()=>{let t=await ue({environmentId:e,input:{}});t._tag===`Success`&&_e(t.value.servers)},[e,ue]),Ze=(0,Q.useCallback)(async()=>{if(!Y)return;let t=await me({environmentId:e,input:n===void 0?{}:{projectId:n}});t._tag===`Success`&&Te(t.value.servers)},[Y,me,e,n]);(0,Q.useEffect)(()=>{Xe(),Ze()},[Xe,Ze]);let tt=e=>{d(`mcps`),De({kind:`server`,id:e})},nt=e=>{d(`plugins`),De({kind:`plugin`,id:e})},rt=t=>se({environmentId:e,input:{patch:t}}),it=async t=>{Se(e=>new Set(e).add(t));let n=await de({environmentId:e,input:{serverId:t}});if(Se(e=>{let n=new Set(e);return n.delete(t),n}),n._tag===`Success`)return _e(e=>({...e,[t]:n.value})),n.value},at=(0,Q.useEffectEvent)(async e=>{(await it(e))?.health.status===`connected`&&Ge(null)});(0,Q.useEffect)(()=>{if(He===null)return;let e=()=>void at(He);return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[He]);let ot=async(e,t,n)=>{(await rt({mcpServers:{[e]:t}}))._tag===`Success`&&(n&&De({kind:`list`}),Ze(),t.enabled&&await it(e))},st=async(t,n=!1)=>{let r=Z.current.get(t);if(!n&&He===t&&r){window.open(r,`_blank`,`noopener,noreferrer`);return}let i=oe??window.location.origin;qe(e=>{let n={...e};return delete n[t],n});let a=await fe({environmentId:e,input:{serverId:t,origin:new URL(i,window.location.href).origin,...n?{reauthenticate:n}:{}}});a._tag===`Success`?a.value.authorizationUrl===null?await it(t):(Z.current.set(t,a.value.authorizationUrl),Ge(t),window.open(a.value.authorizationUrl,`_blank`,`noopener,noreferrer`)):a._tag===`Failure`&&qe(e=>({...e,[t]:Ht(a.cause)}))},ct=async t=>{let n=await pe({environmentId:e,input:{serverId:t}});n._tag===`Success`&&_e(e=>({...e,[t]:n.value}))},lt=(e,t,r)=>{if(n===void 0)return;let i=M[n]??{},a={...i[e]};r===void 0?delete a[t]:a[t]={enabled:r},rt({projectSettingsOverrides:{[n]:{...i,[e]:a}}})},ut=async()=>{let t=Be;if(Ve(null),t!==null){if(t.kind===`server`){let n=O[t.id];n?.transport.type===`http`&&n.transport.auth===`oauth`&&await pe({environmentId:e,input:{serverId:t.id}}),await rt({mcpServers:{[t.id]:null}})}else await rt({plugins:{[t.id]:null}});De({kind:`list`})}},dt=we.filter(e=>!e.alreadyAdded),mt=new Set(Je.filter(([e])=>X.kind!==`server`||e!==X.id).map(([,e])=>e.name)),ht=f.trim().toLowerCase(),_t=Je.filter(([,e])=>qt(ht,e.name,We(e))),yt=Ye.filter(([,e])=>qt(ht,e.name,e.path)),xt=dt.filter(e=>qt(ht,e.name,e.summary)),St=(e,t)=>p({mcpServers:O,plugins:j,projectSettingsOverrides:M},e,n??null,t),Ct=(e,t,r)=>{n===void 0?rt(e===`mcpServers`?{mcpServers:{[t]:{...O[t],enabled:r}}}:{plugins:{[t]:{...j[t],enabled:r}}}):lt(e,t,r)},Tt=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,$.jsxs)(`div`,{className:`grid gap-1`,children:[(0,$.jsx)(`h1`,{className:`text-2xl font-semibold text-foreground`,children:`Plugins`}),(0,$.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Manage plugins, skills, and MCP servers given to agents on `,t,`.`]})]}),Y?(0,$.jsxs)(y,{children:[(0,$.jsx)(I,{render:(0,$.jsxs)(C,{children:[`Add`,(0,$.jsx)(D,{"aria-hidden":!0})]})}),(0,$.jsxs)(N,{align:`end`,children:[(0,$.jsxs)(i,{onClick:()=>tt(null),children:[(0,$.jsx)(b,{"aria-hidden":!0}),`Add MCP server`]}),(0,$.jsxs)(i,{onClick:()=>nt(null),children:[(0,$.jsx)(a,{"aria-hidden":!0}),`Add plugin`]})]})]}):null]}),Et=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,$.jsxs)(ce,{"aria-label":`Show`,variant:`default`,value:[u],onValueChange:e=>{let t=e[0];(t===`plugins`||t===`mcps`||t===`skills`)&&(d(t),De({kind:`list`}))},children:[(0,$.jsxs)(le,{value:`plugins`,...Le(`plugins`),children:[`Plugins `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:Ye.length})]}),(0,$.jsxs)(le,{value:`mcps`,...Le(`mcp-servers`),children:[`MCPs `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:Je.length})]}),(0,$.jsxs)(le,{value:`skills`,...Le(`skills`),children:[`Skills `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:x.length})]})]}),(0,$.jsxs)(`div`,{className:`flex w-full gap-2 sm:w-auto`,children:[u===`skills`?(0,$.jsx)(`div`,{className:`w-fit shrink-0`,children:(0,$.jsxs)(H,{value:h,onValueChange:e=>e&&g(e),children:[(0,$.jsx)(V,{"aria-label":`Skill category`,children:(0,$.jsx)(z,{})}),(0,$.jsxs)(B,{children:[(0,$.jsx)(R,{value:`All categories`,children:`All categories`}),$e.filter(e=>e===`Personal`||e===`Built-in`||x.some(({skill:t})=>et(t)===e)).map(e=>(0,$.jsx)(R,{value:e,children:e},e))]})]})}):null,(0,$.jsxs)(xe,{className:`min-w-0 flex-1 sm:w-56`,children:[(0,$.jsx)(ye,{children:(0,$.jsx)(F,{"aria-hidden":!0})}),(0,$.jsx)(be,{"aria-label":Kt[u],placeholder:Kt[u],value:f,onChange:e=>m(e.currentTarget.value)})]})]})]}),Dt=(e,t)=>(0,$.jsxs)(ae,{children:[(0,$.jsx)(re,{render:(0,$.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":e,onClick:t,children:(0,$.jsx)(A,{"aria-hidden":!0})})}),(0,$.jsx)(ie,{children:e})]}),Ot=yt.length===0?(0,$.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:Ye.length===0?`No plugins yet. Add a Claude Code or Codex plugin folder to give its tools to your agents.`:`No plugins match your search.`}):(0,$.jsx)(`ul`,{className:`grid gap-1`,children:yt.map(([t,n])=>(0,$.jsx)(Qe,{environmentId:e,plugin:n,enabled:St(`plugins`,t),disabled:!G,onDetails:()=>nt(t),onToggle:e=>Ct(`plugins`,t,e)},t))}),kt=x.filter(({skill:e})=>(h===`All categories`||et(e)===h)&&qt(ht,pt(e),e.name,e.shortDescription??``,e.description??``)),At=kt.length===0?(0,$.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:x.length===0?`No skills found. Providers report the skills they load when they start.`:`No skills match these filters.`}):(0,$.jsxs)(`div`,{className:`grid gap-3`,children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Switches apply to new Claude and OpenCode sessions.`}),(0,$.jsx)(`ul`,{className:`grid gap-1`,children:kt.map(t=>{let r=et(t.skill),a=(v??[]).filter(e=>l(e.driver)&&e.skills.some(e=>e.name===t.skill.name)),o=a.length?a.map(e=>e.displayName??e.driver).join(`, `):`Native settings`;return(0,$.jsxs)(`li`,{className:`flex items-center gap-3 py-3`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`flex size-10 shrink-0 items-center justify-center rounded-full border border-border/60 text-muted-foreground`,children:(0,$.jsx)(_,{className:`size-4`})}),(0,$.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>w(t),className:`w-fit break-words text-left text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:pt(t.skill)}),(0,$.jsx)(Jt,{text:t.skill.shortDescription??t.skill.description??t.skill.path}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:[r,o].filter(Boolean).join(` · `)})]}),(0,$.jsxs)(y,{children:[(0,$.jsxs)(ae,{children:[(0,$.jsx)(re,{render:(0,$.jsx)(I,{render:(0,$.jsx)(C,{variant:`ghost`,size:`icon-sm`,"aria-label":`More for ${pt(t.skill)}`,children:(0,$.jsx)(c,{"aria-hidden":!0})})})}),(0,$.jsx)(ie,{children:`Skill actions`})]}),(0,$.jsxs)(N,{align:`end`,children:[U.capabilities.canOpenDefault?(0,$.jsx)(i,{onClick:()=>void U.activate(`open`,{environmentId:e,filePath:t.skill.path,workspaceRoot:void 0}),children:`Open`}):null,(0,$.jsx)(i,{onClick:()=>w(t),children:`Details`}),n!==void 0&&M[n]?.skillOverrides?.[t.skill.name]!==void 0?(0,$.jsx)(i,{onClick:()=>{let e=M[n]??{},r={...e.skillOverrides};delete r[t.skill.name],rt({projectSettingsOverrides:{[n]:{...e,skillOverrides:r}}})},children:`Use environment setting`}):null]})]}),(0,$.jsx)(Ie,{"aria-label":`Enable ${pt(t.skill)} for ${o}`,checked:(n===void 0?void 0:M[n]?.skillOverrides?.[t.skill.name])??L[t.skill.name]??t.skill.enabled,disabled:!G||ee!==null||a.length===0,onCheckedChange:e=>{te(t.skill.name),rt(n===void 0?{skillOverrides:{[t.skill.name]:e}}:{projectSettingsOverrides:{[n]:{...M[n],skillOverrides:{...M[n]?.skillOverrides,[t.skill.name]:e}}}}).finally(()=>te(null))}})]},t.skill.path)})})]}),jt=(0,$.jsxs)(`div`,{className:`grid gap-6`,children:[Je.length>0?(0,$.jsx)(Oe,{title:`Servers`,children:_t.length===0?(0,$.jsx)(`p`,{className:`px-3 text-sm text-muted-foreground sm:px-4`,children:`No MCP servers match your search.`}):(0,$.jsx)($.Fragment,{children:_t.map(([e,t])=>{let n=St(`mcpServers`,e),r=Ue({...t,enabled:n},ge[e],ve.has(e)),a=Ke[e],o=Ut(t,r,ge[e]);return(0,$.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,$.jsx)(`span`,{className:`break-words text-sm font-medium text-foreground`,children:t.name}),r.tone===`error`||o?(0,$.jsx)(Wt,{status:r}):null,a?(0,$.jsx)(`span`,{className:`text-xs text-destructive-foreground`,children:a}):null]}),r.needsSignIn&&Y?(0,$.jsx)(C,{size:`xs`,variant:`outline`,onClick:()=>void st(e),children:`Authenticate`}):null,o&&!r.needsSignIn&&Y?(0,$.jsxs)(y,{children:[(0,$.jsxs)(ae,{children:[(0,$.jsx)(re,{render:(0,$.jsx)(I,{render:(0,$.jsx)(C,{variant:`ghost`,size:`icon-sm`,"aria-label":`More for ${t.name}`,children:(0,$.jsx)(c,{"aria-hidden":!0})})})}),(0,$.jsx)(ie,{children:`Sign-in actions`})]}),(0,$.jsxs)(N,{align:`end`,children:[(0,$.jsx)(i,{onClick:()=>void st(e,!0),children:`Re-authenticate`}),ge[e]?.auth===`signed-in`?(0,$.jsx)(i,{onClick:()=>void ct(e),children:`Sign out`}):null]})]}):null,Dt(`Settings for ${t.name}`,()=>tt(e)),(0,$.jsx)(Ie,{"aria-label":`Give ${t.name} to agents`,checked:n,disabled:!Y,onCheckedChange:t=>Ct(`mcpServers`,e,t)})]},e)})})}):null,Y&&xt.length>0?(0,$.jsx)(Oe,{title:`Found in provider configs`,headerAction:(0,$.jsx)(C,{size:`icon-xs`,variant:`ghost`,"aria-label":`Look again`,onClick:()=>void Ze(),children:(0,$.jsx)(T,{"aria-hidden":!0})}),children:(0,$.jsx)($.Fragment,{children:xt.map(t=>(0,$.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,$.jsx)(`span`,{className:`break-words text-sm font-medium text-foreground`,children:t.name}),xt.filter(e=>e.name===t.name).length>1?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(t.providers??[t.provider]).map(e=>Rt[e]).join(`, `)}):null]}),(0,$.jsx)(C,{size:`xs`,variant:`outline`,onClick:async()=>{(await he({environmentId:e,input:{...n===void 0?{}:{projectId:n},servers:[{provider:t.provider,path:t.path,name:t.name}]}}))._tag===`Success`&&(Ze(),Xe())},children:`Import`})]},`${t.provider}:${t.path}:${t.name}`))})}):null]}),Mt=X.kind===`server`?(0,$.jsxs)(gt,{title:X.id===null?`Add MCP server`:`Update ${O[X.id]?.name??`server`} MCP`,onBack:()=>De({kind:`list`}),onUninstall:X.id!==null&&Y?()=>Ve({kind:`server`,id:X.id}):void 0,children:[(0,$.jsx)(vt,{server:X.id===null?void 0:O[X.id],takenNames:mt,onSave:e=>void ot(X.id??o.make(k()),e,X.id===null)},X.id??`new`),X.id!==null&&O[X.id]!==void 0?(0,$.jsx)(Zt,{environmentId:e,id:X.id,server:O[X.id],runtime:ge[X.id],checking:ve.has(X.id),canManage:Y,projectLabel:r,projectOverride:n===void 0?void 0:M[n]?.mcpServers?.[X.id],awaitingSignIn:He===X.id,onProviderToggle:(e,t)=>{let n=O[X.id],r=t?n.disabledProviders.filter(t=>t!==e):[...n.disabledProviders,e];rt({mcpServers:{[X.id]:{...n,disabledProviders:r}}})},onProjectOverride:n===void 0?void 0:e=>lt(`mcpServers`,X.id,e),signInError:Ke[X.id],onTest:()=>void it(X.id),onSignIn:()=>void st(X.id),onReauthenticate:()=>void st(X.id,!0),onSignOut:()=>void ct(X.id)},`${e}:${X.id}`):null]}):null,Nt=X.kind===`plugin`?(0,$.jsxs)(gt,{title:X.id===null?`Add plugin`:`Update ${j[X.id]?.name??`plugin`}`,onBack:()=>De({kind:`list`}),onUninstall:X.id!==null&&Y?()=>Ve({kind:`plugin`,id:X.id}):void 0,children:[(0,$.jsx)(bt,{environmentId:e,plugin:X.id===null?void 0:j[X.id],environmentLabel:t,onSave:async e=>{let t=X.id??E.make(k());(await rt({plugins:{[t]:e}}))._tag===`Success`&&X.id===null&&De({kind:`list`})}},X.id??`new`),X.id!==null&&j[X.id]!==void 0?(0,$.jsx)(on,{plugin:j[X.id],projectLabel:r,projectOverride:n===void 0?void 0:M[n]?.plugins?.[X.id],onProjectOverride:n===void 0?void 0:e=>lt(`plugins`,X.id,e)}):null]}):null;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`grid gap-6`,children:[Tt,Et,Mt??Nt??(u===`plugins`?Ot:u===`mcps`?jt:At)]}),S===null?null:(0,$.jsx)(wt,{entry:S,environmentId:e,onClose:()=>w(null)}),(0,$.jsx)(Me,{open:Be!==null,onOpenChange:e=>!e&&Ve(null),children:(0,$.jsxs)(Pe,{children:[(0,$.jsxs)(Ae,{children:[(0,$.jsxs)(Ne,{children:[`Remove`,` `,Be?.kind===`server`?O[Be.id]?.name??`server`:Be?.kind===`plugin`?j[Be.id]?.name??`plugin`:``,`?`]}),(0,$.jsxs)(je,{children:[`New sessions on `,t,` stop getting it. Its stored values and sign-in are deleted. Provider config files are not changed.`]})]}),(0,$.jsxs)(Fe,{children:[(0,$.jsx)(ke,{render:(0,$.jsx)(C,{variant:`outline`,children:`Cancel`})}),(0,$.jsx)(C,{variant:`destructive`,onClick:()=>void ut(),children:`Remove`})]})]})})]})}function Xt(e){let t=(0,Z.c)(16),{projectLabel:n,override:r,inherited:i,onChange:a}=e,o=r?.enabled!==void 0,s=`In ${n}`,c=o?`Set for this project.`:`Follows the environment (${i?`on`:`off`}).`,l;t[0]!==a||t[1]!==o?(l=o?(0,$.jsx)(C,{size:`xs`,variant:`ghost`,onClick:()=>a(void 0),children:`Reset`}):null,t[0]=a,t[1]=o,t[2]=l):l=t[2];let u=`Use in ${n}`,d=r?.enabled??i,f;t[3]===a?f=t[4]:(f=e=>a(e),t[3]=a,t[4]=f);let p;t[5]!==u||t[6]!==d||t[7]!==f?(p=(0,$.jsx)(Ie,{"aria-label":u,checked:d,onCheckedChange:f}),t[5]=u,t[6]=d,t[7]=f,t[8]=p):p=t[8];let m;t[9]!==l||t[10]!==p?(m=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l,p]}),t[9]=l,t[10]=p,t[11]=m):m=t[11];let h;return t[12]!==s||t[13]!==c||t[14]!==m?(h=(0,$.jsx)(Ee,{title:s,description:c,control:m}),t[12]=s,t[13]=c,t[14]=m,t[15]=h):h=t[15],h}function Zt(e){let t=(0,Z.c)(108),{environmentId:n,id:r,server:i,runtime:a,checking:o,canManage:s,projectLabel:c,projectOverride:l,awaitingSignIn:u,signInError:f,onProviderToggle:p,onProjectOverride:m,onTest:h,onSignIn:g,onReauthenticate:_,onSignOut:v}=e,y=s&&i.transport.type===`http`&&i.transport.auth===`oauth`&&a?.auth===`signed-out`,b=tn(n,r,y),x=b.entries,S;t[0]!==o||t[1]!==a||t[2]!==i?(S=Ue(i,a,o),t[0]=o,t[1]=a,t[2]=i,t[3]=S):S=t[3];let w=S,T;t[4]===x?T=t[5]:(T=x?.filter($t).length??0,t[4]=x,t[5]=T);let E=T,D;t[6]!==w||t[7]!==E||t[8]!==x||t[9]!==y?(D=y?{...w,tone:`muted`,label:x===null?`Checking providers…`:E>0?`Available to ${E} ${E===1?`provider`:`providers`}`:`No providers connected`}:w,t[6]=w,t[7]=E,t[8]=x,t[9]=y,t[10]=D):D=t[10];let O=D,k,A,j,M,N,P,F;if(t[11]!==u||t[12]!==s||t[13]!==o||t[14]!==x||t[15]!==r||t[16]!==p||t[17]!==_||t[18]!==g||t[19]!==v||t[20]!==h||t[21]!==a?.auth||t[22]!==i||t[23]!==f||t[24]!==b||t[25]!==O||t[26]!==y){let e;t[34]===x?e=t[35]:(e=e=>({...e,badge:x===null||e.unsupported!==void 0?void 0:at(e.driver,x)}),t[34]=x,t[35]=e);let n=ot(i).map(e),c=i.transport.type===`http`&&a?.auth===`signed-in`,l=f??O.detail;N=`grid gap-6`,P=r;let m;t[36]===O?m=t[37]:(m=(0,$.jsx)(Wt,{status:O,className:`flex-1 text-sm`}),t[36]=O,t[37]=m);let S;t[38]!==u||t[39]!==s||t[40]!==g||t[41]!==O.needsSignIn||t[42]!==y?(S=O.needsSignIn&&s&&!y?(0,$.jsx)(C,{size:`xs`,onClick:g,children:u?`Open sign-in again`:`Authenticate`}):null,t[38]=u,t[39]=s,t[40]=g,t[41]=O.needsSignIn,t[42]=y,t[43]=S):S=t[43];let w;t[44]!==s||t[45]!==_||t[46]!==c||t[47]!==O.needsSignIn?(w=c&&!O.needsSignIn&&s?(0,$.jsx)(C,{size:`xs`,variant:`outline`,onClick:_,children:`Re-authenticate`}):null,t[44]=s,t[45]=_,t[46]=c,t[47]=O.needsSignIn,t[48]=w):w=t[48];let T;t[49]!==s||t[50]!==v||t[51]!==c?(T=c&&s?(0,$.jsx)(C,{size:`xs`,variant:`ghost`,onClick:v,children:`Sign out`}):null,t[49]=s,t[50]=v,t[51]=c,t[52]=T):T=t[52];let E;t[53]!==s||t[54]!==o||t[55]!==h||t[56]!==i.enabled?(E=s&&i.enabled?(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:o,onClick:h,children:`Test connection`}):null,t[53]=s,t[54]=o,t[55]=h,t[56]=i.enabled,t[57]=E):E=t[57];let D;t[58]!==m||t[59]!==S||t[60]!==w||t[61]!==T||t[62]!==E?(D=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[m,S,w,T,E]}),t[58]=m,t[59]=S,t[60]=w,t[61]=T,t[62]=E,t[63]=D):D=t[63];let I;t[64]!==u||t[65]!==O.needsSignIn||t[66]!==y?(I=O.needsSignIn&&!y?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u?`Finish signing in in your browser, then come back here.`:y?`Sign in here to give it to every provider.`:`Agents can't reach this server until you sign in.`}):null,t[64]=u,t[65]=O.needsSignIn,t[66]=y,t[67]=I):I=t[67];let L;t[68]!==l||t[69]!==y?(L=l&&!y?(0,$.jsx)(`p`,{className:`rounded-md bg-destructive/8 px-2.5 py-1.5 text-xs text-destructive-foreground`,children:l}):null,t[68]=l,t[69]=y,t[70]=L):L=t[70];let R;t[71]!==u||t[72]!==l||t[73]!==g||t[74]!==y?(R=y?(0,$.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:l?`Shared sign-in unavailable`:`Shared sign-in`}),(0,$.jsxs)(`div`,{className:`grid gap-2 pt-2`,children:[(0,$.jsx)(`p`,{children:l??`Sign in through P4 Code to share access with every enabled provider.`}),(0,$.jsx)(`div`,{children:(0,$.jsx)(C,{size:`xs`,variant:`outline`,onClick:g,children:u?`Open browser`:l?`Retry shared sign-in`:`Sign in through P4 Code`})})]})]}):null,t[71]=u,t[72]=l,t[73]=g,t[74]=y,t[75]=R):R=t[75];let z;t[76]===i.source?z=t[77]:(z=i.source?(0,$.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:`Import source`}),(0,$.jsx)(`p`,{className:`break-all pt-2`,children:i.source.path})]}):null,t[76]=i.source,t[77]=z);let B=y?(0,$.jsx)(rn,{serverName:i.name,signIns:b,blocked:n.filter(Qt).length}):null;t[78]!==D||t[79]!==I||t[80]!==L||t[81]!==R||t[82]!==z||t[83]!==B?(F=(0,$.jsx)(Oe,{title:`Status`,children:(0,$.jsx)(we,{children:(0,$.jsxs)(`div`,{className:`grid gap-2 px-4 py-3`,children:[D,I,L,R,z,B]})})}),t[78]=D,t[79]=I,t[80]=L,t[81]=R,t[82]=z,t[83]=B,t[84]=F):F=t[84],A=Oe,M=`Providers`,k=we;let V;t[85]!==s||t[86]!==p||t[87]!==i.name?(V=e=>(0,$.jsx)(Ee,{title:e.label,...e.unsupported===void 0?{}:{description:e.unsupported},control:(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.badge===void 0?null:(0,$.jsx)(d,{variant:an[e.badge].variant,children:an[e.badge].label}),(0,$.jsx)(Ie,{"aria-label":`Give ${i.name} to ${e.label}`,checked:e.enabled&&e.badge!==`unavailable`,disabled:!s||e.unsupported!==void 0||e.badge===`unavailable`,onCheckedChange:t=>p(e.driver,t)})]})},e.driver),t[85]=s,t[86]=p,t[87]=i.name,t[88]=V):V=t[88],j=n.map(V),t[11]=u,t[12]=s,t[13]=o,t[14]=x,t[15]=r,t[16]=p,t[17]=_,t[18]=g,t[19]=v,t[20]=h,t[21]=a?.auth,t[22]=i,t[23]=f,t[24]=b,t[25]=O,t[26]=y,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N,t[32]=P,t[33]=F}else k=t[27],A=t[28],j=t[29],M=t[30],N=t[31],P=t[32],F=t[33];let I;t[89]!==k||t[90]!==j?(I=(0,$.jsx)(k,{children:j}),t[89]=k,t[90]=j,t[91]=I):I=t[91];let L;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(`p`,{className:`px-3 text-xs text-muted-foreground sm:px-4`,children:`A change reaches a thread when its provider session next starts.`}),t[92]=L):L=t[92];let R;t[93]!==A||t[94]!==M||t[95]!==I?(R=(0,$.jsxs)(A,{title:M,children:[I,L]}),t[93]=A,t[94]=M,t[95]=I,t[96]=R):R=t[96];let z;t[97]!==m||t[98]!==c||t[99]!==l||t[100]!==i.enabled?(z=c!==void 0&&m!==void 0?(0,$.jsx)(Oe,{title:`Project`,children:(0,$.jsx)(we,{children:(0,$.jsx)(Xt,{projectLabel:c,override:l,inherited:i.enabled,onChange:m})})}):null,t[97]=m,t[98]=c,t[99]=l,t[100]=i.enabled,t[101]=z):z=t[101];let B;return t[102]!==R||t[103]!==z||t[104]!==N||t[105]!==P||t[106]!==F?(B=(0,$.jsxs)(`div`,{className:N,"data-server-id":P,children:[F,R,z]}),t[102]=R,t[103]=z,t[104]=N,t[105]=P,t[106]=F,t[107]=B):B=t[107],B}function Qt(e){return e.enabled&&e.badge===`unavailable`}function $t(e){return e.status===`signed-in`}function en(e){let t=j(e);return Vt(t)&&t.detail!==void 0?t.detail:`Sign-in could not start. Try again.`}function tn(e,t,n){let r=J(q.mcpRegistryProviderSignInState,{reportFailure:!1}),i=J(q.mcpRegistryProviderSignInStart,{reportFailure:!1}),a=J(q.mcpRegistryProviderSignInWait,{reportFailure:!1}),o=J(q.mcpRegistryProviderSignInComplete,{reportFailure:!1}),s=J(q.mcpRegistryProviderSignInCancel,{reportFailure:!1}),c=J(q.mcpRegistryProviderSignOut,{reportFailure:!1}),l=P(q.mcpRegistryProviderSignInComplete.permissionAtom(e)),u=P(q.mcpRegistryProviderSignInCancel.permissionAtom(e)),[d,f]=(0,Q.useState)(null),[p,m]=(0,Q.useState)({}),[h,g]=(0,Q.useState)(new Set),_=(0,Q.useRef)(new Set),v=e=>f(t=>t?.map(t=>t.instanceId===e.instanceId?e:t)??null),y=(e,t)=>m(n=>{let r={...n};return t===void 0?delete r[e]:r[e]=t,r});return(0,Q.useEffect)(()=>{if(!n)return;let i=!1;return r({environmentId:e,input:{serverId:t}}).then(e=>{i||f(e._tag===`Success`?e.value.providers:[])}),()=>{i=!0}},[n,e,r,t]),(0,Q.useEffect)(()=>{if(!n)return;let r=!1;for(let n of d??[]){let i=n.pending;i&&a({environmentId:e,input:{serverId:t,instanceId:n.instanceId,flowId:i.flowId}}).then(e=>{r||(f(t=>t?.map(t=>{if(t.instanceId!==n.instanceId||t.pending?.flowId!==i.flowId)return t;if(e._tag===`Success`)return e.value;let{pending:r,...a}=t;return a})??null),e._tag===`Failure`?y(n.instanceId,en(e.cause)):e._tag===`Success`&&e.value.status!==`signed-in`&&!_.current.has(n.instanceId)&&y(n.instanceId,`Sign-in ended without connecting. Try again.`))})}return()=>{r=!0}},[n,d,e,t,a]),{entries:n?d:null,errors:p,busy:h,run:async(n,r,a)=>{if(!_.current.has(n.instanceId)){_.current.add(n.instanceId),g(new Set(_.current)),y(n.instanceId,void 0);try{let l={serverId:t,instanceId:n.instanceId};if(r===`start`){let t=await i({environmentId:e,input:l});t._tag===`Success`?(v({...n,pending:t.value}),window.open(t.value.authorizationUrl,`_blank`,`noopener,noreferrer`)):t._tag===`Failure`&&y(n.instanceId,en(t.cause));return}let u={...l,flowId:n.pending?.flowId??``},d=r===`complete`?await o({environmentId:e,input:{...u,callbackUrl:a.trim()}}):r===`cancel`?await s({environmentId:e,input:u}):await c({environmentId:e,input:l});d._tag===`Success`?v(d.value):d._tag===`Failure`&&y(n.instanceId,en(d.cause))}finally{_.current.delete(n.instanceId),g(new Set(_.current))}}},canComplete:l,canCancel:u}}function nn(e){let t=(0,Z.c)(39),{entry:n,signIns:r}=e,i;t[0]!==n.displayName||t[1]!==n.driver?(i=n.displayName??rt(n.driver),t[0]=n.displayName,t[1]=n.driver,t[2]=i):i=t[2];let a=i,[o,s]=(0,Q.useState)(``),c=n.pending,l;t[3]!==n.instanceId||t[4]!==r.busy?(l=r.busy.has(n.instanceId),t[3]=n.instanceId,t[4]=r.busy,t[5]=l):l=t[5];let u=l,d=r.errors[n.instanceId],f=`mcp-callback-${n.instanceId}`,p;t[6]===a?p=t[7]:(p=(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:a}),t[6]=a,t[7]=p);let m=c?`text-warning-foreground`:n.status===`signed-in`?`text-success-foreground`:`text-muted-foreground`,h;t[8]===m?h=t[9]:(h=M(`text-xs`,m),t[8]=m,t[9]=h);let g;t[10]!==n.status||t[11]!==c?(g=c?`Waiting for sign-in`:it(n.status),t[10]=n.status,t[11]=c,t[12]=g):g=t[12];let _;t[13]!==h||t[14]!==g?(_=(0,$.jsx)(`p`,{className:h,role:`status`,children:g}),t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]!==p||t[17]!==_?(v=(0,$.jsxs)(`div`,{className:`grid gap-1`,children:[p,_]}),t[16]=p,t[17]=_,t[18]=v):v=t[18];let y;t[19]!==u||t[20]!==n||t[21]!==d||t[22]!==c||t[23]!==r?(y=!c&&n.status!==`unavailable`?(0,$.jsx)(C,{size:`xs`,variant:n.status===`signed-in`?`outline`:`default`,disabled:u,onClick:()=>void r.run(n,n.status===`signed-in`?`signOut`:`start`),children:u?`Please wait…`:n.status===`signed-in`?`Sign out`:d?`Start over`:`Sign in`}):null,t[19]=u,t[20]=n,t[21]=d,t[22]=c,t[23]=r,t[24]=y):y=t[24];let b;t[25]!==v||t[26]!==y?(b=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[v,y]}),t[25]=v,t[26]=y,t[27]=b):b=t[27];let x;t[28]!==u||t[29]!==o||t[30]!==n||t[31]!==d||t[32]!==f||t[33]!==c||t[34]!==r?(x=c?(0,$.jsxs)(`form`,{className:`grid gap-2`,onSubmit:e=>{e.preventDefault(),o.trim()&&!u&&r.canComplete&&r.run(n,`complete`,o)},children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Approve in your browser. If it ends on a callback URL, paste that URL here.`}),(0,$.jsx)(`label`,{htmlFor:f,className:`text-xs font-medium`,children:`Callback URL`}),(0,$.jsx)(ue,{id:f,value:o,onChange:e=>s(e.target.value),placeholder:`http://localhost:…/callback?code=…&state=…`,autoComplete:`off`,spellCheck:!1,disabled:u||!r.canComplete,"aria-invalid":!!d,"aria-describedby":d?`${f}-error`:void 0}),d?(0,$.jsx)(`p`,{id:`${f}-error`,role:`alert`,className:`text-xs text-destructive-foreground`,children:d}):null,(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(C,{type:`submit`,size:`xs`,disabled:u||!o.trim()||!r.canComplete,children:u?`Please wait…`:`Finish sign-in`}),(0,$.jsx)(C,{type:`button`,size:`xs`,variant:`outline`,disabled:u,onClick:()=>window.open(c.authorizationUrl,`_blank`,`noopener,noreferrer`),children:`Open browser`}),(0,$.jsx)(C,{type:`button`,size:`xs`,variant:`ghost`,disabled:u||!r.canCancel,onClick:()=>void r.run(n,`cancel`),children:`Cancel`})]})]}):d?(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive-foreground`,children:d}):null,t[28]=u,t[29]=o,t[30]=n,t[31]=d,t[32]=f,t[33]=c,t[34]=r,t[35]=x):x=t[35];let S;return t[36]!==b||t[37]!==x?(S=(0,$.jsxs)(`div`,{className:`grid gap-2 border-t border-border pt-3`,children:[b,x]}),t[36]=b,t[37]=x,t[38]=S):S=t[38],S}function rn(e){let t=(0,Z.c)(8),{serverName:n,signIns:r,blocked:i}=e,a;t[0]===r?a=t[1]:(a=r.entries===null?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Checking providers…`}):r.entries.length===0?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No enabled provider here can sign in to MCP servers itself.`}):r.entries.map(e=>(0,$.jsx)(nn,{entry:e,signIns:r},`${e.instanceId}:${e.pending?.flowId??`idle`}`)),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n?(o=i>0?(0,$.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,$.jsxs)(`summary`,{className:`cursor-pointer`,children:[i,` other `,i===1?`provider`:`providers`,` unavailable`]}),(0,$.jsxs)(`p`,{className:`pt-2`,children:[`These providers need shared sign-in to use `,n,`.`]})]}):null,t[2]=i,t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(`div`,{className:`grid gap-3`,children:[a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}var an={"signed-in":{variant:`success`,label:`Signed in`},"needs-sign-in":{variant:`warning`,label:`Sign in needed`},unavailable:{variant:`secondary`,label:`Unavailable`}};function on(e){let t=(0,Z.c)(7),{plugin:n,projectLabel:r,projectOverride:i,onProjectOverride:a}=e,o;t[0]!==a||t[1]!==n||t[2]!==r||t[3]!==i?(o=r!==void 0&&a!==void 0?(0,$.jsx)(Oe,{title:`Project`,children:(0,$.jsx)(we,{children:(0,$.jsx)(Xt,{projectLabel:r,override:i,inherited:n.enabled,onChange:a})})}):null,t[0]=a,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s;return t[5]===o?s=t[6]:(s=(0,$.jsx)(`div`,{className:`grid gap-6`,children:o}),t[5]=o,t[6]=s),s}var sn=Gt;export{sn as component};
|
|
5
|
+
//# sourceMappingURL=settings.plugins-C9-DUFnM.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectIconPickerDialog-
|
|
2
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./index-CZlF3wQ9.js";import{n as r,t as i}from"./jsx-runtime-DJeoFXNw.js";import{$n as a,Ad as o,D as s,Ds as c,Fy as l,Lm as u,Lw as d,Mc as f,Qn as p,Qs as m,X_ as h,Yn as g,Yp as _,Zn as v,Zs as y,ar as b,bs as x,cv as S,dr as C,n as w,nv as T,on as E,pm as D,qf as O,r as k,tr as ee,ts as A,ur as te}from"./utils-Dv1DrWoz.js";import{R as ne,U as j,W as re,z as M}from"./runtime-B6yGAVz4.js";import{N,O as ie,S as P,U as F}from"./entities-Cd_YDhEa.js";import{An as I}from"./runtime-BhGr1QCf.js";import{t as L}from"./useNavigate-mNhNGdvJ.js";import{t as R}from"./useLocation-CDlqpnf6.js";import{i as z}from"./toast-UFTwkJWj.js";import{D as B,G as V,T as ae,q as oe}from"./useSettings-BAP_yCCK.js";import{f as H,s as U}from"./server-Dc9414wM.js";import{n as W,o as G}from"./session-B6T_Arzf.js";import{t as K}from"./use-atom-command-BT7sz8Lx.js";import{t as q}from"./toastHelpers-DxXYm50b.js";import{t as J}from"./input-D8R-9BO3.js";import{n as Y}from"./assetUrls-COCOS1bm.js";import{D as X,E as se,O as ce,j as le,y as ue}from"./keybindings-DMghyE3A.js";import{t as de}from"./PierreEntryIcon-BGnGqbZS.js";import{t as fe}from"./ProjectFavicon-Bnd4lTxL.js";import{d as pe}from"./projectFilesQueryState-FiXJc2AO.js";import{n as me}from"./p4ProjectFile-BC2tSEs4.js";import{r as he,t as ge}from"./alert-RktpFBv6.js";import{L as _e,V as ve,W as ye,a as Z,i as be,r as xe,s as Se}from"./settingsLayout-CthOqZyP.js";import{i as Ce,o as we,r as Te}from"./command-CLf9yckl.js";import{En as Ee,Ki as De,On as Oe,aa as ke,yn as Ae}from"./main-om7hc1qE.js";import{c as je,f as Me,i as Ne,n as Pe,o as Fe,r as Ie,s as Le,t as Re}from"./projectScriptEditor-CwMYFrgO.js";import{t as ze}from"./ProjectDefaultsSettings-B8-DHhbT.js";import{t as Be}from"./SettingsScopeNotice-CLuK5ZOQ.js";var Ve=r(),Q=e(t(),1),$=e(i(),1);function He(e){let t=(0,Ve.c)(14),n=(0,Q.useRef)(null),[r,i]=(0,Q.useState)(We),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),l,u;t[0]===r?(l=t[1],u=t[2]):(l=()=>{let e=n.current;if(r||!e)return;let t=new IntersectionObserver(e=>{e.some(Ue)&&i(!0)});return t.observe(e),()=>t.disconnect()},u=[r],t[0]=r,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d;t[3]!==r||t[4]!==e.cwd||t[5]!==e.path?(d=r?{_tag:`draft-workspace-file`,cwd:e.cwd,path:e.path}:null,t[3]=r,t[4]=e.cwd,t[5]=e.path,t[6]=d):d=t[6];let f=Y(e.environmentId,d),p=f._tag===`Success`?f.url:null,m=p!==null&&s!==p,h=m&&a===p,g=h?null:e.fallback,_;t[7]!==h||t[8]!==m||t[9]!==p?(_=m?(0,$.jsx)(`img`,{alt:``,className:`absolute max-h-8 max-w-8 rounded-sm object-contain${h?``:` invisible`}`,decoding:`async`,loading:`lazy`,onError:()=>c(p),onLoad:()=>o(p),src:p},p):null,t[7]=h,t[8]=m,t[9]=p,t[10]=_):_=t[10];let v;return t[11]!==g||t[12]!==_?(v=(0,$.jsxs)(`span`,{ref:n,className:`relative flex size-8 shrink-0 items-center justify-center`,children:[g,_]}),t[11]=g,t[12]=_,t[13]=v):v=t[13],v}function Ue(e){return e.isIntersecting}function We(){return typeof IntersectionObserver>`u`}function Ge(e,t,n){return t||(n?e.trim()?`Searching project files…`:`Indexing project files…`:e.trim()?`No matching image files.`:`No image files found.`)}function Ke(e,t){return!k(t)||I(e)}function qe(e){let[t,n]=(0,Q.useState)(``),[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),s=pe(e.environmentId,e.cwd,t,200,{imageOnly:!0}),{resolvedTheme:c}=V(),l=A(U),u=e.onPickExternal,d=w(typeof navigator>`u`?``:navigator.platform),f=(0,Q.useMemo)(()=>Ae(s.entries,s.matchedQuery).map(t=>({kind:`action`,value:`project-favicon:${t.path}`,searchTerms:[t.name,t.path],title:t.name,description:t.path,icon:(0,$.jsx)(He,{cwd:e.cwd,environmentId:e.environmentId,fallback:(0,$.jsx)(de,{pathValue:t.path,kind:`file`,theme:c}),path:t.path}),run:async()=>e.onSelect(t.path)})),[e.cwd,e.environmentId,e.onSelect,c,s.entries,s.matchedQuery]);return(0,$.jsx)(Te,{open:e.open,onOpenChange:e.onOpenChange,children:e.open?(0,$.jsx)(Ce,{"aria-label":`Choose project icon`,className:`overflow-hidden`,onBackdropPointerDown:()=>e.onOpenChange(!1),children:(0,$.jsx)(Oe,{"aria-label":`Choose project icon`,autoHighlight:`always`,escapeLabel:`Close`,footerActionLabel:`Select icon`,footerTrailing:u?(0,$.jsx)(we,{disabled:a,onClick:()=>{o(!0),u().then(t=>{t&&(e.onOpenChange(!1),e.onSelect(t))}).catch(e=>{z.add({type:`error`,title:`Could not open image picker`,description:e instanceof Error?e.message:`An error occurred.`})}).finally(()=>o(!1))},children:`Open in ${d}`}):null,inputProps:{placeholder:`Search image files…`},mode:`none`,onItemHighlighted:e=>{i(typeof e==`string`?e:null)},onValueChange:e=>{i(null),n(e)},panelSize:`tall-list`,testId:`project-favicon-picker`,value:t,children:(0,$.jsx)(Ee,{groups:f.length>0?[{value:`project-favicon-files`,label:e.projectName,items:f}]:[],highlightedItemValue:r,isActionsOnly:!1,keybindings:l,onExecuteItem:t=>{t.kind===`action`&&(e.onOpenChange(!1),t.run())},emptyStateMessage:Ge(t,s.error,s.isPending)})})}):null})}function Je(e){let t=(0,Ve.c)(10),{scripts:n,keybindings:r,disabled:i,onEdit:a}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`px-3 py-2 text-base text-muted-foreground sm:px-4 sm:text-sm`,children:`No actions configured.`}),t[0]=e):e=t[0],e}let o;if(t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==n){let e;t[6]!==i||t[7]!==r||t[8]!==a?(e=e=>{let t=ue(r,X(e.id));return(0,$.jsx)(Z,{className:`group py-2`,title:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Ie,{icon:e.icon,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),e.runOnWorktreeCreate?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground`,children:`setup`}):null,e.previewUrl?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground max-sm:hidden`,children:`preview · desktop only`}):null]}),description:(0,$.jsx)(`code`,{className:`block max-w-full truncate font-mono`,children:e.command}),control:(0,$.jsxs)($.Fragment,{children:[t?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t}):null,(0,$.jsx)(`span`,{className:`flex shrink-0 opacity-0 group-focus-within:opacity-100 group-hover:opacity-100`,children:(0,$.jsx)(C,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Edit ${e.name}`,disabled:i,onClick:()=>a(e),children:(0,$.jsx)(D,{className:`size-3.5`})})})]})},e.id)},t[6]=i,t[7]=r,t[8]=a,t[9]=e):e=t[9],o=n.map(e),t[1]=i,t[2]=r,t[3]=a,t[4]=n,t[5]=o}else o=t[5];return o}function Ye(e){if(e._tag===`Failure`&&!ne(e)){let t=re(e);z.add({type:`error`,title:`Failed to save project actions`,description:t instanceof Error?t.message:`An error occurred.`})}return M(e,()=>void 0)}function Xe(e){let t=P(),[n,r]=(0,Q.useState)(!1),i=(0,Q.useRef)(!1),a=K(H.updateSettings,`project actions update`),o=K(H.upsertKeybinding,`action shortcut update`),s=K(H.removeKeybinding,`action shortcut removal`);async function l(n,l,u){if(i.current||e.length===0){let e=`No available machine, or another action change is saving.`;return z.add({type:`error`,title:`Actions not saved`,description:e}),x(d(Error(e)))}if(e.some(({environmentId:e})=>!W(e,`settings:write`)))return Ye(x(d(new S({requiredScope:T,message:`This connection cannot change environment settings.`}))));i.current=!0,r(!0);try{for(let{environmentId:r,settings:i,keybindings:c,project:d}of e){let e=d?Me(i,d):i.defaultProjectScripts,f=n(e),p=f??i.defaultProjectScripts,m=await a({environmentId:r,input:{patch:d?{projectSettingsOverrides:{[d.id]:f===null?me(i,d.id,[`defaultProjectScripts`]):{...i.projectSettingsOverrides[d.id],defaultProjectScripts:f}}}:{defaultProjectScripts:f??[]}}});if(m._tag===`Failure`)return Ye(m);let h=l?[l]:e.filter(e=>!p.some(t=>t.id===e.id)).map(e=>e.id);for(let e of h){let n=X(e),a=je(c,n),l=a?Le({keybinding:a,command:n}):null,p=Le({keybinding:u,command:n}),m=!f?.some(t=>t.id===e)&&(d&&i.defaultProjectScripts.some(t=>t.id===e)||Object.entries(i.projectSettingsOverrides).some(([t,n])=>t!==d?.id&&n.defaultProjectScripts?.some(t=>t.id===e))||t.some(t=>t.environmentId===r&&t.id!==d?.id&&(d?Me(i,t):t.scripts).some(t=>t.id===e))),h=p?await o({environmentId:r,input:l&&l.key!==p.key?{...p,replace:l}:p}):l&&!m?await s({environmentId:r,input:l}):null;if(h?._tag===`Failure`)return Ye(h)}}return c(void 0)}finally{i.current=!1,r(!1)}}function u(n,r){let i=[...t.flatMap(e=>e.scripts.map(e=>e.id)),...e.flatMap(({settings:e,project:t})=>[...e.defaultProjectScripts,...Object.values(e.projectSettingsOverrides).flatMap(e=>e.defaultProjectScripts??[]),...t?.scripts??[]].map(e=>e.id))],a=n??ce(r.name,i),o=se(a,r);return l(e=>{let t=e.map(e=>e.id===a?o:le(e,r));return n===null?[...t,o]:t},a,r.keybinding)}return{saving:n,persist:l,submit:u}}function Ze(){let e=(0,Ve.c)(67),{scope:t,targets:n,target:r}=ve(),{environments:i}=ae(),s=t.kind===`project`||t.kind===`checkout`,c;e[0]!==i||e[1]!==r?(c=r?i.find(e=>e.environmentId===r.environmentId)?.serverConfig:void 0,e[0]=i,e[1]=r,e[2]=c):c=e[2];let u=c,d;e[3]===r?.settings.defaultProjectScripts?d=e[4]:(d=r?.settings.defaultProjectScripts??[],e[3]=r?.settings.defaultProjectScripts,e[4]=d);let m=d,h=u?.keybindings??f,y;if(e[5]!==m||e[6]!==n){let t;e[8]===m?t=e[9]:(t=e=>JSON.stringify(e.settings.defaultProjectScripts)!==JSON.stringify(m),e[8]=m,e[9]=t),y=n.some(t),e[5]=m,e[6]=n,e[7]=y}else y=e[7];let x=y,S=_e(),[w,T]=(0,Q.useState)(null),E,D,O;e[10]!==i||e[11]!==s||e[12]!==t.members||e[13]!==n?(E=new Map(s?t.members.map($e):[]),D=Xe,O=n.flatMap(e=>{let t=i.find(t=>t.environmentId===e.environmentId);if(!t?.serverConfig)return[];let n=e.projectId?E.get(e.projectId):void 0;return n&&t.serverConfig.environment?.capabilities.projectSettingsOverrides!==!0?[]:[{environmentId:e.environmentId,settings:t.serverConfig.settings,keybindings:t.serverConfig.keybindings,...n?{project:n}:{}}]}),e[10]=i,e[11]=s,e[12]=t.members,e[13]=n,e[14]=E,e[15]=D,e[16]=O):(E=e[14],D=e[15],O=e[16]);let{saving:k,persist:A,submit:j}=D(O),M;e[17]!==E||e[18]!==r?(M=r?.projectId?E.get(r.projectId):void 0,e[17]=E,e[18]=r,e[19]=M):M=e[19];let N=M,ie;e[20]===N?.environmentId?ie=e[21]:(ie=N?.environmentId??l.make(`none`),e[20]=N?.environmentId,e[21]=ie);let P=Fe(ie,N?.workspaceRoot??null),F;if(e[22]!==P.scripts||e[23]!==m){let t;e[25]===m?t=e[26]:(t=e=>!m.some(t=>t.command===e.command||t.name.toLowerCase()===e.name.toLowerCase()),e[25]=m,e[26]=t),F=P.scripts.filter(t),e[22]=P.scripts,e[23]=m,e[24]=F}else F=e[24];let I=F,L;e[27]===j?L=e[28]:(L=async e=>{let t={name:e.name,command:e.command,icon:e.icon??`play`,runOnWorktreeCreate:e.runOnWorktreeCreate??!1,waitForSetup:e.runOnWorktreeCreate===!0&&e.async===!1,keybinding:null,previewUrl:e.previewUrl??null,autoOpenPreview:e.previewUrl?e.autoOpenPreview??!1:!1},n=await j(null,t);if(n._tag===`Failure`&&!ne(n)){let e=re(n);T({scriptId:null,initial:t,error:e instanceof Error?e.message:`Failed to import action.`})}},e[27]=j,e[28]=L);let R=L,z;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(z=[`defaultProjectScripts`],e[29]=z):z=e[29];let B;e[30]===A?B=e[31]:(B=()=>void A(Qe),e[30]=A,e[31]=B);let V;e[32]!==S||e[33]!==R||e[34]!==I||e[35]!==k?(V=I.length>0?(0,$.jsxs)(g,{children:[(0,$.jsxs)(te,{render:(0,$.jsx)(C,{id:`import-scripts`,size:`xs`,variant:`ghost`,disabled:k||!S,type:`button`}),children:[`Import scripts`,(0,$.jsx)(o,{className:`size-3.5`})]}),(0,$.jsxs)(ee,{align:`end`,children:[(0,$.jsxs)(v,{children:[(0,$.jsx)(p,{children:`Import from p4.json`}),(0,$.jsx)(`p`,{className:`px-2 pb-2 text-pretty text-sm text-muted-foreground`,children:`Add actions declared by this checkout without editing them first.`})]}),(0,$.jsx)(b,{}),I.map(e=>(0,$.jsxs)(a,{onClick:()=>void R(e),children:[(0,$.jsx)(Ie,{icon:e.icon??`play`,className:`size-4 shrink-0`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-medium`,children:e.name}),(0,$.jsx)(`div`,{className:`truncate font-mono text-muted-foreground`,children:e.command})]})]},`${e.name} ${e.command}`))]})]}):null,e[32]=S,e[33]=R,e[34]=I,e[35]=k,e[36]=V):V=e[36];let oe=k||!S||n.length===0,H,U;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>T({scriptId:null,initial:Re}),U=(0,$.jsx)(_,{className:`size-3.5`}),e[37]=H,e[38]=U):(H=e[37],U=e[38]);let W;e[39]===oe?W=e[40]:(W=(0,$.jsxs)(C,{size:`xs`,variant:`outline`,disabled:oe,onClick:H,children:[U,`Add action`]}),e[39]=oe,e[40]=W);let G;e[41]!==V||e[42]!==W?(G=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[V,W]}),e[41]=V,e[42]=W,e[43]=G):G=e[43];let K;e[44]!==x||e[45]!==B||e[46]!==G?(K=(0,$.jsx)(Z,{serverScoped:!0,settingKeys:z,mixed:x,title:`Actions`,description:`Commands that run in this project's checkout or its worktree, with optional shortcuts.`,onResetOverride:B,control:G}),e[44]=x,e[45]=B,e[46]=G,e[47]=K):K=e[47];let q;e[48]!==S||e[49]!==h||e[50]!==x||e[51]!==k||e[52]!==m?(q=x?(0,$.jsx)(Z,{title:`Different actions across environments`,description:`Choose one environment to edit its list. Adding an action here adds it on every selected environment.`}):(0,$.jsx)(Je,{scripts:m,keybindings:h,disabled:k||!S,onEdit:e=>T(Ne(e,h))}),e[48]=S,e[49]=h,e[50]=x,e[51]=k,e[52]=m,e[53]=q):q=e[53];let J;e[54]===P.status?J=e[55]:(J=P.status===`invalid`?(0,$.jsx)(Z,{title:`p4.json is invalid`,description:`A p4.json exists in this checkout but fails to parse, so every action and icon it declares is ignored. Check the JSON syntax and icon values.`,className:`text-warning`}):null,e[54]=P.status,e[55]=J);let Y;e[56]!==A||e[57]!==w||e[58]!==m||e[59]!==j||e[60]!==r?(Y=r&&(0,$.jsx)(Pe,{environmentId:r.environmentId,editScope:`settings:write`,request:w,scripts:m,onSubmit:j,onDelete:e=>void A(t=>t.filter(t=>t.id!==e),e,null),onClose:()=>T(null)}),e[56]=A,e[57]=w,e[58]=m,e[59]=j,e[60]=r,e[61]=Y):Y=e[61];let X;return e[62]!==K||e[63]!==q||e[64]!==J||e[65]!==Y?(X=(0,$.jsxs)(Se,{id:`project-actions`,title:`Actions`,children:[K,q,J,Y]}),e[62]=K,e[63]=q,e[64]=J,e[65]=Y,e[66]=X):X=e[66],X}function Qe(){return null}function $e(e){return[e.id,e]}function et(e,t,n){return n&&e.some(e=>e!==t)}var tt=(0,Q.lazy)(()=>n(()=>import(`./ProjectIconPickerDialog-D_7XapzM.js`).then(e=>({default:e.ProjectIconPickerDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233])));function nt(e){return`${e.environmentId}:${e.id}`}function rt(e){let t=(0,Ve.c)(34),{projectKey:n,environmentId:r,checkoutKey:i}=e,a=r===void 0?null:r,o=i===void 0?null:i,s=ye(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={from:`/settings`},t[0]=c):c=t[0];let l=L(c),u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={select:at},t[1]=u):u=t[1];let d=R(u),f;t[2]!==s||t[3]!==n?(f=s.find(e=>e.projectKey===n)??null,t[2]=s,t[3]=n,t[4]=f):f=t[4];let p=f,m;t[5]!==o||t[6]!==a||t[7]!==p?.memberProjects?(m=p?.memberProjects.filter(e=>(a===null||e.environmentId===a)&&(o===null||e.physicalProjectKey===o))??[],t[5]=o,t[6]=a,t[7]=p?.memberProjects,t[8]=m):m=t[8];let h=m,g=(0,Q.useRef)(null),_,v;t[9]!==o||t[10]!==a||t[11]!==h||t[12]!==p?(_=()=>{p&&h.length!==0&&(g.current={key:p.projectKey,environmentId:a,checkoutKey:o,memberKeys:h.map(it)})},v=[p,h,a,o],t[9]=o,t[10]=a,t[11]=h,t[12]=p,t[13]=_,t[14]=v):(_=t[13],v=t[14]),(0,Q.useEffect)(_,v);let y,b;if(t[15]!==o||t[16]!==a||t[17]!==s||t[18]!==h.length||t[19]!==l||t[20]!==d||t[21]!==n?(b=()=>{if(h.length>0)return;let e=g.current;if(e?.key!==n||e.environmentId!==a||e.checkoutKey!==o)return;let t=s.find(t=>t.memberProjects.some(t=>e.memberKeys.includes(t.physicalProjectKey)));t&&l({to:d,search:()=>({project:t.projectKey,machine:a??void 0,checkout:o??void 0}),replace:!0,hashScrollIntoView:!1})},y=[s,l,d,n,h.length,a,o],t[15]=o,t[16]=a,t[17]=s,t[18]=h.length,t[19]=l,t[20]=d,t[21]=n,t[22]=y,t[23]=b):(y=t[22],b=t[23]),(0,Q.useEffect)(b,y),!p){let e=s.length===0?`Add a project from the sidebar to configure it here.`:`This project is no longer available.`,n;return t[24]===e?n=t[25]:(n=(0,$.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-muted-foreground`,children:e}),t[24]=e,t[25]=n),n}if(h.length===0){let e;return t[26]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`p-8 text-sm text-muted-foreground`,children:`This checkout is no longer available in the selected project and environment.`}),t[26]=e):e=t[26],e}let x;t[27]!==h||t[28]!==p?(x={...p,memberProjects:h,environmentId:h[0].environmentId,id:h[0].id},t[27]=h,t[28]=p,t[29]=x):x=t[29];let S=x,C=`${p.projectKey}:${a??`all`}:${o??`all`}`,w=h.length<p.memberProjects.length,T;return t[30]!==S||t[31]!==C||t[32]!==w?(T=(0,$.jsx)(ot,{group:S,hasOtherMembers:w},C),t[30]=S,t[31]=C,t[32]=w,t[33]=T):T=t[33],T}function it(e){return e.physicalProjectKey}function at(e){return e.pathname}function ot({group:e,hasOtherMembers:t}){let n=L({from:`/settings`}),r=B(),{environments:i}=ae(),a=(0,Q.useMemo)(()=>new Map(i.map(e=>[e.environmentId,e])),[i]),o=G(e.memberProjects,h),l=e.memberProjects.every(e=>o.has(e.environmentId)),f=e.memberProjects.find(e=>a.get(e.environmentId)?.serverConfig!=null)??e.memberProjects[0],p=ie(),g=ke(F.update,{reportFailure:!1}),_=ke(F.delete,{reportFailure:!1}),v=(0,Q.useRef)(!1),b=f.faviconPath??null,S=f.projectIcon??null,w=typeof window<`u`&&e.memberProjects.every(e=>e.environmentId===r&&Ke(e.workspaceRoot,navigator.platform))?window.desktopBridge?.pickProjectFavicon:void 0,T=(0,Q.useCallback)((e,t)=>{if(t._tag!==`Failure`||ne(t))return;let n=re(t);z.add(q({type:`error`,title:e,description:n instanceof Error?n.message:`An error occurred.`}))},[]),D=(0,Q.useCallback)((e,t)=>{let n=e.find(e=>!W(e.environmentId,h));if(!n)return null;let r=x(d(Error(`This connection cannot change projects in ${n.environmentLabel??`this environment`}.`)));return T(t,r),r},[T]),k=(0,Q.useCallback)(async(t,n)=>{let r=D(e.memberProjects,n);if(r)return r;let i=e.memberProjects.find(e=>{let t=a.get(e.environmentId);return t?.connection.phase!==`connected`||!t.serverConfig});if(i){let e=Error(`Connect ${i.environmentLabel??`the selected environment`} and try again.`),t=x(d(e));return T(n,t),t}for(let r of e.memberProjects){let i=D([r],n);if(i)return i;let a=M(await g({environmentId:r.environmentId,input:{projectId:r.id,...t}}),()=>void 0);if(a._tag===`Failure`)return T(e.memberProjects.length>1?`${n} on ${r.environmentLabel??`the current environment`}`:n,a),a}return c(void 0)},[D,a,e.memberProjects,T,g]),ee=(0,Q.useCallback)(async(t,n)=>{let r=t.trim();r?et(e.memberProjects.map(e=>e.title),r,n)&&await k({title:r},`Failed to rename project`):z.add({type:`warning`,title:`Project title cannot be empty`})},[e.memberProjects,k]),[A,te]=E(!l),[P,I]=E(!l),[R,V]=(0,Q.useState)(!1),H=(0,Q.useRef)(!1),U=(0,Q.useCallback)(async e=>{if(!H.current){H.current=!0,V(!0);try{await k(e,`Failed to update project icon`)}finally{H.current=!1,V(!1)}}},[k]),K=e.memberProjects.length>1,Y=(0,Q.useCallback)(async r=>{if(D(r,`Failed to remove project`))return;let i=oe();if(!i)return;let a=new Set(r.map(nt)),o=p.filter(e=>a.has(`${e.environmentId}:${e.projectId}`)),c=r.length===e.memberProjects.length,l=t||!c?`checkout`:`project`,u=r.length===1?r[0]:null,d=u?.title??e.displayName,f=await j(()=>i.dialogs.confirm([o.length>0?`Remove ${l} "${d}" and delete its ${o.length} thread${o.length===1?``:`s`}?`:`Remove ${l} "${d}"?`,...u?[`Path: ${u.workspaceRoot}`,...u.environmentLabel?[`Environment: ${u.environmentLabel}`]:[]]:[`This removes ${r.length} grouped project entries.`],...o.length>0?[`This permanently clears conversation history for those threads and any archived threads.`]:[`This permanently clears any archived conversation history.`],c&&!t?`This removes only the project entries, not the files on disk.`:`Other entries in this grouped project are unaffected.`,`This action cannot be undone.`].join(`
|
|
3
|
-
`),{variant:`destructive`}));if(
|
|
4
|
-
//# sourceMappingURL=settings.projects-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectIconPickerDialog-DSRXK7Zv.js","assets/react-BUfh6y28.js","assets/jsx-runtime-DJeoFXNw.js","assets/utils-D19Exirm.js","assets/activity-CbqMUSRC.js","assets/createLucideIcon-DDevWfFk.js","assets/Icon-DYn8279B.js","assets/alarm-clock-D3-pktbt.js","assets/app-window-DT4yrrS-.js","assets/archive-Cr7-RIjC.js","assets/arrow-down-up-CQvYrirj.js","assets/arrow-down-BKghgxKI.js","assets/arrow-left-BWI0-vRp.js","assets/arrow-right-left-DXmmhGuH.js","assets/arrow-right-BJPYbHTL.js","assets/arrow-up-down-BEa_lFuV.js","assets/arrow-up-left-DLNjxPfK.js","assets/arrow-up-right-B8xNcEXp.js","assets/arrow-up-DMEbfkKl.js","assets/battery-BNMPLne0.js","assets/bell-vGxw63Gg.js","assets/blocks-CpHzQlR2.js","assets/book-open-DKRWS47i.js","assets/bookmark-DfPbwgkW.js","assets/bot-Cp92syL6.js","assets/box-D-FyjNxy.js","assets/bug-DH2pu6U9.js","assets/calendar-arrow-down-WH0xj289.js","assets/calendar-arrow-up-Lk-Us3ba.js","assets/calendar-clock-BARV5L0a.js","assets/calendar-DHdDnhKF.js","assets/camera-8ozLiwCj.js","assets/chart-no-axes-column-CQLqBsxb.js","assets/check-CdrGo1Oa.js","assets/chevron-down-D0M7_175.js","assets/chevron-left-CEWOKn-e.js","assets/chevron-right-DPl-L-yL.js","assets/chevron-up-gyDnPot_.js","assets/chevrons-left-right-ellipsis-DEfsDjXt.js","assets/chevrons-up-down-DakHVkrx.js","assets/chromium-x91nZeen.js","assets/circle-alert-DsKXULDS.js","assets/circle-arrow-up-DCmGv6Tl.js","assets/circle-check-CZ31KO9m.js","assets/circle-dashed-DMw11mBM.js","assets/circle-dot-CWCBN-HY.js","assets/circle-slash-eIt5hG5T.js","assets/circle-x-DMkHWcTz.js","assets/circle-Doq0I3MA.js","assets/clock-3-C5l2rPxd.js","assets/clock-aK6BX5Ve.js","assets/cloud-download-Ddj2y2Q1.js","assets/cloud-upload-BzCXws1i.js","assets/cloud-BhcSs4Ie.js","assets/code-xml-DsmxIkJL.js","assets/code-Dfd-vS1O.js","assets/columns-2-CgvyvCTB.js","assets/copy-CO2RgESU.js","assets/corner-left-up-DUJ8nnVp.js","assets/corner-up-right-xmYx6v5O.js","assets/cpu-DBknwmfd.js","assets/database-D2y6m7fG.js","assets/download-S2u-tXaE.js","assets/earth-CDbKfFEl.js","assets/ellipsis-vertical-CY0vJAc8.js","assets/ellipsis-Zza4fevQ.js","assets/external-link-D1GSnnDW.js","assets/eye-off-CH68-9dO.js","assets/eye-C3U51ndb.js","assets/file-braces-BzATadbM.js","assets/file-code-corner-eTofF8xM.js","assets/file-diff-CNp_vbEN.js","assets/file-search-ymCSYDZx.js","assets/file-spreadsheet-GRfTgOTy.js","assets/file-text-Bfv40hwh.js","assets/file-Ksu7amJn.js","assets/files-DlNPWYbd.js","assets/film-BUU7xHiL.js","assets/flask-conical-Dsv3DUqc.js","assets/folder-closed-urrrH8hq.js","assets/folder-cog-Dph_MIqG.js","assets/folder-git-2-BNs-MyeS.js","assets/folder-git-CZrtjtbc.js","assets/folder-open-glqXjO8U.js","assets/folder-plus-hbrm_0zI.js","assets/folder-tree-DRc_6QzW.js","assets/folder-7OwzWKex.js","assets/gauge-Bn8T6vfX.js","assets/git-branch-plus-DHrV8m4V.js","assets/git-branch-fKUdZyoj.js","assets/git-commit-horizontal-BKUdfVpN.js","assets/git-fork-q7k7fP_a.js","assets/git-merge-B6FlDJ0L.js","assets/git-pull-request-arrow-C03R6MRd.js","assets/git-pull-request-closed-BmuvrrUt.js","assets/git-pull-request-draft-BiETgjOy.js","assets/globe-rqPSVFGf.js","assets/grip-vertical-CDZpgHdL.js","assets/hammer-D3FVtCT2.js","assets/hard-drive-BYq2E_is.js","assets/hat-glasses-Dr2HzrbT.js","assets/history-CdIQPf9A.js","assets/house-ClTLFcnB.js","assets/image-Dp6bFTt-.js","assets/inbox-CcvYrvdu.js","assets/info-D9JLmnlB.js","assets/keyboard-Cwz72Cn4.js","assets/laptop-BRe6y-6m.js","assets/layers-DnKM4R7R.js","assets/lightbulb-D4c0exHI.js","assets/link-2-LC4CLD9N.js","assets/link-BG0xfm4f.js","assets/list-checks-D4Mjxs0W.js","assets/list-filter-CT2YuCdg.js","assets/list-ordered-CmlribqV.js","assets/list-todo-C9Q41q8t.js","assets/list-DFOg7UCj.js","assets/loader-circle-C9YTWe0R.js","assets/lock-open-ZMNlBvF_.js","assets/lock-CUPWkQFd.js","assets/log-in-CmJt2PGl.js","assets/mail-DH8sy4L4.js","assets/maximize-2-Ci1M4n4b.js","assets/maximize--OpXUP-L.js","assets/memory-stick-BfRByDz7.js","assets/message-circle-question-mark-B1TZAw6J.js","assets/message-circle-CHd5kZQY.js","assets/message-square-dashed-Cdozx3vh.js","assets/message-square-off-CWEe8iPZ.js","assets/message-square-text-DqZTWyZK.js","assets/message-square-warning-BNloiEzN.js","assets/message-square-HrqKYo9g.js","assets/messages-square-CNMItvyI.js","assets/minimize-2-C4_6Xjo0.js","assets/minus-BIm_k5Zx.js","assets/monitor-Dsi2qeBw.js","assets/moon-CQPzCH_B.js","assets/mouse-pointer-2-4CaeeJnC.js","assets/mouse-pointer-click-BPbYQy6n.js","assets/octagon-alert-EzAYxsw5.js","assets/package-plus-B0kbli0A.js","assets/package-DgK3Panc.js","assets/paintbrush-CRnk3l4s.js","assets/palette-oisfBZwg.js","assets/panel-bottom-_VbUQKRM.js","assets/panel-left-7a6N5kup.js","assets/panel-right-BeNqPQu9.js","assets/paperclip-D4ApErSa.js","assets/panels-top-left-DWNysJ-h.js","assets/pen-line-dPqyqyP8.js","assets/pencil-ruler-DmVfcvOi.js","assets/pencil-CkBDbGEU.js","assets/picture-in-picture-2-CM4GLcBZ.js","assets/pilcrow-D4Yvx6IY.js","assets/pin-DXnYmcqx.js","assets/play-3I2EkmKd.js","assets/plug-2-s7zj7Hxq.js","assets/plus-B2sOrZDk.js","assets/plug-YkUyuPha.js","assets/power-Bvdrcoxh.js","assets/presentation-Dzj9KqNW.js","assets/puzzle-A0RiinH5.js","assets/qr-code-DliRXqLn.js","assets/quote-BVm0cRnP.js","assets/radio-tower-DUk4f2-O.js","assets/redo-2-BJ7l6vPt.js","assets/refresh-cw-D5OcXJqv.js","assets/rotate-ccw-DpwKQVbi.js","assets/rotate-cw--ORF2bp-.js","assets/route-VA8ojaMC.js","assets/rows-3-BtaOoWPd.js","assets/scale-CFZenX_z.js","assets/search-BXnNiPfE.js","assets/send-rvnCC0tk.js","assets/server-D1-mXw9_.js","assets/settings-2-Bv4a7vuX.js","assets/settings-DSIgI7hn.js","assets/shield-check-Dp6nEC76.js","assets/shield-question-mark-Ct8sQE8L.js","assets/shield-BffxaUbT.js","assets/sliders-horizontal-Cjgfn3-e.js","assets/smartphone-D_YX6TMp.js","assets/smile-plus-CCWLDL7I.js","assets/sparkles-cGzc0RFW.js","assets/square-arrow-out-up-right-BhjBGexN.js","assets/square-pen-D43PK7SU.js","assets/square-split-horizontal-1peTt3kF.js","assets/square-split-vertical-BiyS0VO4.js","assets/square-terminal-jbiJud2S.js","assets/square-ekoTCPwL.js","assets/star-DNOgk1Yn.js","assets/sun-Doo18Rp9.js","assets/tag-COKMM2Nu.js","assets/target-DINbFNKH.js","assets/terminal-B0APSOls.js","assets/text-align-start-CwrzoVmt.js","assets/text-search-CmRPmwd0.js","assets/text-wrap-CQL7aZBn.js","assets/ticket-DOLQqHse.js","assets/trash-2-PlYko97C.js","assets/trending-down-DVeDgUDE.js","assets/trending-up-DbEIgYu9.js","assets/triangle-alert-BoPMRm-g.js","assets/type-CjUvBO4t.js","assets/undo-2-BD9xLk2R.js","assets/unlink-2-D70rwDdQ.js","assets/unplug-BYib3V6l.js","assets/upload-Cra7ct3V.js","assets/user-check-CcyAu7dq.js","assets/user-lock--_mHRTC7.js","assets/user-plus-zMaVgV4o.js","assets/user-round-x-pYk-6fRI.js","assets/user-round-4JeqoQGO.js","assets/users-BZYEVbyz.js","assets/wifi-off-ODm5nCE4.js","assets/workflow-BefWgmas.js","assets/wrench-pR-6hpnb.js","assets/x-C35beONT.js","assets/zap-BIb9m3mg.js","assets/toggle-group-DV__8G6T.js","assets/CompositeRoot-XnJ7Nzli.js","assets/toggle-BDixfqRe.js","assets/input-yNgBXsRj.js","assets/Input-B9nob0l2.js","assets/FieldControl-DfaF5AW8.js","assets/useRegisterFieldControl-DnspXZl4.js","assets/scroll-area-DTOm0CbX.js","assets/ScrollAreaCorner-Bstf_gNQ.js","assets/CSPContext-jKZ42W4p.js","assets/dialog-CKG1aUT3.js","assets/DialogTitle-DdTujj5B.js","assets/ProjectMonogram-BJooqIM-.js","assets/dynamic-BZ3kW5ih.js","assets/index-DD6u-vDm.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./index-DD6u-vDm.js";import{n as r,t as i}from"./jsx-runtime-DJeoFXNw.js";import{$n as a,D as o,Ds as s,Iy as c,Jf as l,Mc as u,Qn as d,Qs as f,Rm as p,Rw as m,Xp as h,Yn as g,Z_ as _,Zn as v,Zs as y,ar as b,bs as x,dr as S,jd as C,lv as w,mm as T,n as E,on as D,r as O,rv as k,tr as ee,ts as A,ur as te}from"./utils-D19Exirm.js";import{R as ne,U as j,W as re,z as M}from"./runtime-S0tnrkvE.js";import{N,O as ie,S as P,U as F}from"./entities-D8ZKPC2e.js";import{An as I}from"./runtime-CdX0UBlL.js";import{t as L}from"./useNavigate-DAhzXpNZ.js";import{t as R}from"./useLocation--dLSTvwv.js";import{i as z}from"./toast-BNQWmVQ-.js";import{D as B,G as V,T as ae,q as oe}from"./useSettings-BNjvPVd5.js";import{f as H,s as U}from"./server-ELSEsqtb.js";import{n as W,o as G}from"./session-DCntd6Nl.js";import{t as K}from"./use-atom-command-REOTdDAa.js";import{t as q}from"./toastHelpers-DxXYm50b.js";import{t as J}from"./input-yNgBXsRj.js";import{n as Y}from"./assetUrls-d3y14MLX.js";import{D as X,E as se,O as ce,j as le,y as ue}from"./keybindings-hzk4_Sgu.js";import{t as de}from"./PierreEntryIcon-CDSrlZTw.js";import{t as fe}from"./ProjectFavicon-Cf1XjP8U.js";import{d as pe}from"./projectFilesQueryState-Cl_MU7SH.js";import{n as me}from"./p4ProjectFile-CT0gLoXX.js";import{r as he,t as ge}from"./alert-CqueYfb9.js";import{L as _e,V as ve,W as ye,a as Z,i as be,r as xe,s as Se}from"./settingsLayout-aLGl3ZXu.js";import{i as Ce,o as we,r as Te}from"./command-i_eKJj3B.js";import{En as Ee,Ki as De,On as Oe,aa as ke,yn as Ae}from"./main-CNcsYwUg.js";import{c as je,f as Me,i as Ne,n as Pe,o as Fe,r as Ie,s as Le,t as Re}from"./projectScriptEditor-CfiaAaXj.js";import{t as ze}from"./ProjectDefaultsSettings-BRi9-O_X.js";import{t as Be}from"./SettingsScopeNotice-CPP-_wXt.js";var Ve=r(),Q=e(t(),1),$=e(i(),1);function He(e){let t=(0,Ve.c)(14),n=(0,Q.useRef)(null),[r,i]=(0,Q.useState)(We),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),l,u;t[0]===r?(l=t[1],u=t[2]):(l=()=>{let e=n.current;if(r||!e)return;let t=new IntersectionObserver(e=>{e.some(Ue)&&i(!0)});return t.observe(e),()=>t.disconnect()},u=[r],t[0]=r,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d;t[3]!==r||t[4]!==e.cwd||t[5]!==e.path?(d=r?{_tag:`draft-workspace-file`,cwd:e.cwd,path:e.path}:null,t[3]=r,t[4]=e.cwd,t[5]=e.path,t[6]=d):d=t[6];let f=Y(e.environmentId,d),p=f._tag===`Success`?f.url:null,m=p!==null&&s!==p,h=m&&a===p,g=h?null:e.fallback,_;t[7]!==h||t[8]!==m||t[9]!==p?(_=m?(0,$.jsx)(`img`,{alt:``,className:`absolute max-h-8 max-w-8 rounded-sm object-contain${h?``:` invisible`}`,decoding:`async`,loading:`lazy`,onError:()=>c(p),onLoad:()=>o(p),src:p},p):null,t[7]=h,t[8]=m,t[9]=p,t[10]=_):_=t[10];let v;return t[11]!==g||t[12]!==_?(v=(0,$.jsxs)(`span`,{ref:n,className:`relative flex size-8 shrink-0 items-center justify-center`,children:[g,_]}),t[11]=g,t[12]=_,t[13]=v):v=t[13],v}function Ue(e){return e.isIntersecting}function We(){return typeof IntersectionObserver>`u`}function Ge(e,t,n){return t||(n?e.trim()?`Searching project files…`:`Indexing project files…`:e.trim()?`No matching image files.`:`No image files found.`)}function Ke(e,t){return!O(t)||I(e)}function qe(e){let[t,n]=(0,Q.useState)(``),[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),s=pe(e.environmentId,e.cwd,t,200,{imageOnly:!0}),{resolvedTheme:c}=V(),l=A(U),u=e.onPickExternal,d=E(typeof navigator>`u`?``:navigator.platform),f=(0,Q.useMemo)(()=>Ae(s.entries,s.matchedQuery).map(t=>({kind:`action`,value:`project-favicon:${t.path}`,searchTerms:[t.name,t.path],title:t.name,description:t.path,icon:(0,$.jsx)(He,{cwd:e.cwd,environmentId:e.environmentId,fallback:(0,$.jsx)(de,{pathValue:t.path,kind:`file`,theme:c}),path:t.path}),run:async()=>e.onSelect(t.path)})),[e.cwd,e.environmentId,e.onSelect,c,s.entries,s.matchedQuery]);return(0,$.jsx)(Te,{open:e.open,onOpenChange:e.onOpenChange,children:e.open?(0,$.jsx)(Ce,{"aria-label":`Choose project icon`,className:`overflow-hidden`,onBackdropPointerDown:()=>e.onOpenChange(!1),children:(0,$.jsx)(Oe,{"aria-label":`Choose project icon`,autoHighlight:`always`,escapeLabel:`Close`,footerActionLabel:`Select icon`,footerTrailing:u?(0,$.jsx)(we,{disabled:a,onClick:()=>{o(!0),u().then(t=>{t&&(e.onOpenChange(!1),e.onSelect(t))}).catch(e=>{z.add({type:`error`,title:`Could not open image picker`,description:e instanceof Error?e.message:`An error occurred.`})}).finally(()=>o(!1))},children:`Open in ${d}`}):null,inputProps:{placeholder:`Search image files…`},mode:`none`,onItemHighlighted:e=>{i(typeof e==`string`?e:null)},onValueChange:e=>{i(null),n(e)},panelSize:`tall-list`,testId:`project-favicon-picker`,value:t,children:(0,$.jsx)(Ee,{groups:f.length>0?[{value:`project-favicon-files`,label:e.projectName,items:f}]:[],highlightedItemValue:r,isActionsOnly:!1,keybindings:l,onExecuteItem:t=>{t.kind===`action`&&(e.onOpenChange(!1),t.run())},emptyStateMessage:Ge(t,s.error,s.isPending)})})}):null})}function Je(e){let t=(0,Ve.c)(10),{scripts:n,keybindings:r,disabled:i,onEdit:a}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`px-3 py-2 text-base text-muted-foreground sm:px-4 sm:text-sm`,children:`No actions configured.`}),t[0]=e):e=t[0],e}let o;if(t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==n){let e;t[6]!==i||t[7]!==r||t[8]!==a?(e=e=>{let t=ue(r,X(e.id));return(0,$.jsx)(Z,{className:`group py-2`,title:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Ie,{icon:e.icon,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),e.runOnWorktreeCreate?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground`,children:`setup`}):null,e.previewUrl?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground max-sm:hidden`,children:`preview · desktop only`}):null]}),description:(0,$.jsx)(`code`,{className:`block max-w-full truncate font-mono`,children:e.command}),control:(0,$.jsxs)($.Fragment,{children:[t?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t}):null,(0,$.jsx)(`span`,{className:`flex shrink-0 opacity-0 group-focus-within:opacity-100 group-hover:opacity-100`,children:(0,$.jsx)(S,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Edit ${e.name}`,disabled:i,onClick:()=>a(e),children:(0,$.jsx)(T,{className:`size-3.5`})})})]})},e.id)},t[6]=i,t[7]=r,t[8]=a,t[9]=e):e=t[9],o=n.map(e),t[1]=i,t[2]=r,t[3]=a,t[4]=n,t[5]=o}else o=t[5];return o}function Ye(e){if(e._tag===`Failure`&&!ne(e)){let t=re(e);z.add({type:`error`,title:`Failed to save project actions`,description:t instanceof Error?t.message:`An error occurred.`})}return M(e,()=>void 0)}function Xe(e){let t=P(),[n,r]=(0,Q.useState)(!1),i=(0,Q.useRef)(!1),a=K(H.updateSettings,`project actions update`),o=K(H.upsertKeybinding,`action shortcut update`),c=K(H.removeKeybinding,`action shortcut removal`);async function l(n,l,u){if(i.current||e.length===0){let e=`No available machine, or another action change is saving.`;return z.add({type:`error`,title:`Actions not saved`,description:e}),x(m(Error(e)))}if(e.some(({environmentId:e})=>!W(e,`settings:write`)))return Ye(x(m(new w({requiredScope:k,message:`This connection cannot change environment settings.`}))));i.current=!0,r(!0);try{for(let{environmentId:r,settings:i,keybindings:s,project:d}of e){let e=d?Me(i,d):i.defaultProjectScripts,f=n(e),p=f??i.defaultProjectScripts,m=await a({environmentId:r,input:{patch:d?{projectSettingsOverrides:{[d.id]:f===null?me(i,d.id,[`defaultProjectScripts`]):{...i.projectSettingsOverrides[d.id],defaultProjectScripts:f}}}:{defaultProjectScripts:f??[]}}});if(m._tag===`Failure`)return Ye(m);let h=l?[l]:e.filter(e=>!p.some(t=>t.id===e.id)).map(e=>e.id);for(let e of h){let n=X(e),a=je(s,n),l=a?Le({keybinding:a,command:n}):null,p=Le({keybinding:u,command:n}),m=!f?.some(t=>t.id===e)&&(d&&i.defaultProjectScripts.some(t=>t.id===e)||Object.entries(i.projectSettingsOverrides).some(([t,n])=>t!==d?.id&&n.defaultProjectScripts?.some(t=>t.id===e))||t.some(t=>t.environmentId===r&&t.id!==d?.id&&(d?Me(i,t):t.scripts).some(t=>t.id===e))),h=p?await o({environmentId:r,input:l&&l.key!==p.key?{...p,replace:l}:p}):l&&!m?await c({environmentId:r,input:l}):null;if(h?._tag===`Failure`)return Ye(h)}}return s(void 0)}finally{i.current=!1,r(!1)}}function u(n,r){let i=[...t.flatMap(e=>e.scripts.map(e=>e.id)),...e.flatMap(({settings:e,project:t})=>[...e.defaultProjectScripts,...Object.values(e.projectSettingsOverrides).flatMap(e=>e.defaultProjectScripts??[]),...t?.scripts??[]].map(e=>e.id))],a=n??ce(r.name,i),o=se(a,r);return l(e=>{let t=e.map(e=>e.id===a?o:le(e,r));return n===null?[...t,o]:t},a,r.keybinding)}return{saving:n,persist:l,submit:u}}function Ze(){let e=(0,Ve.c)(67),{scope:t,targets:n,target:r}=ve(),{environments:i}=ae(),o=t.kind===`project`||t.kind===`checkout`,s;e[0]!==i||e[1]!==r?(s=r?i.find(e=>e.environmentId===r.environmentId)?.serverConfig:void 0,e[0]=i,e[1]=r,e[2]=s):s=e[2];let l=s,f;e[3]===r?.settings.defaultProjectScripts?f=e[4]:(f=r?.settings.defaultProjectScripts??[],e[3]=r?.settings.defaultProjectScripts,e[4]=f);let p=f,m=l?.keybindings??u,_;if(e[5]!==p||e[6]!==n){let t;e[8]===p?t=e[9]:(t=e=>JSON.stringify(e.settings.defaultProjectScripts)!==JSON.stringify(p),e[8]=p,e[9]=t),_=n.some(t),e[5]=p,e[6]=n,e[7]=_}else _=e[7];let y=_,x=_e(),[w,T]=(0,Q.useState)(null),E,D,O;e[10]!==i||e[11]!==o||e[12]!==t.members||e[13]!==n?(E=new Map(o?t.members.map($e):[]),D=Xe,O=n.flatMap(e=>{let t=i.find(t=>t.environmentId===e.environmentId);if(!t?.serverConfig)return[];let n=e.projectId?E.get(e.projectId):void 0;return n&&t.serverConfig.environment?.capabilities.projectSettingsOverrides!==!0?[]:[{environmentId:e.environmentId,settings:t.serverConfig.settings,keybindings:t.serverConfig.keybindings,...n?{project:n}:{}}]}),e[10]=i,e[11]=o,e[12]=t.members,e[13]=n,e[14]=E,e[15]=D,e[16]=O):(E=e[14],D=e[15],O=e[16]);let{saving:k,persist:A,submit:j}=D(O),M;e[17]!==E||e[18]!==r?(M=r?.projectId?E.get(r.projectId):void 0,e[17]=E,e[18]=r,e[19]=M):M=e[19];let N=M,ie;e[20]===N?.environmentId?ie=e[21]:(ie=N?.environmentId??c.make(`none`),e[20]=N?.environmentId,e[21]=ie);let P=Fe(ie,N?.workspaceRoot??null),F;if(e[22]!==P.scripts||e[23]!==p){let t;e[25]===p?t=e[26]:(t=e=>!p.some(t=>t.command===e.command||t.name.toLowerCase()===e.name.toLowerCase()),e[25]=p,e[26]=t),F=P.scripts.filter(t),e[22]=P.scripts,e[23]=p,e[24]=F}else F=e[24];let I=F,L;e[27]===j?L=e[28]:(L=async e=>{let t={name:e.name,command:e.command,icon:e.icon??`play`,runOnWorktreeCreate:e.runOnWorktreeCreate??!1,waitForSetup:e.runOnWorktreeCreate===!0&&e.async===!1,keybinding:null,previewUrl:e.previewUrl??null,autoOpenPreview:e.previewUrl?e.autoOpenPreview??!1:!1},n=await j(null,t);if(n._tag===`Failure`&&!ne(n)){let e=re(n);T({scriptId:null,initial:t,error:e instanceof Error?e.message:`Failed to import action.`})}},e[27]=j,e[28]=L);let R=L,z;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(z=[`defaultProjectScripts`],e[29]=z):z=e[29];let B;e[30]===A?B=e[31]:(B=()=>void A(Qe),e[30]=A,e[31]=B);let V;e[32]!==x||e[33]!==R||e[34]!==I||e[35]!==k?(V=I.length>0?(0,$.jsxs)(g,{children:[(0,$.jsxs)(te,{render:(0,$.jsx)(S,{id:`import-scripts`,size:`xs`,variant:`ghost`,disabled:k||!x,type:`button`}),children:[`Import scripts`,(0,$.jsx)(C,{className:`size-3.5`})]}),(0,$.jsxs)(ee,{align:`end`,children:[(0,$.jsxs)(v,{children:[(0,$.jsx)(d,{children:`Import from p4.json`}),(0,$.jsx)(`p`,{className:`px-2 pb-2 text-pretty text-sm text-muted-foreground`,children:`Add actions declared by this checkout without editing them first.`})]}),(0,$.jsx)(b,{}),I.map(e=>(0,$.jsxs)(a,{onClick:()=>void R(e),children:[(0,$.jsx)(Ie,{icon:e.icon??`play`,className:`size-4 shrink-0`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-medium`,children:e.name}),(0,$.jsx)(`div`,{className:`truncate font-mono text-muted-foreground`,children:e.command})]})]},`${e.name} ${e.command}`))]})]}):null,e[32]=x,e[33]=R,e[34]=I,e[35]=k,e[36]=V):V=e[36];let oe=k||!x||n.length===0,H,U;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>T({scriptId:null,initial:Re}),U=(0,$.jsx)(h,{className:`size-3.5`}),e[37]=H,e[38]=U):(H=e[37],U=e[38]);let W;e[39]===oe?W=e[40]:(W=(0,$.jsxs)(S,{size:`xs`,variant:`outline`,disabled:oe,onClick:H,children:[U,`Add action`]}),e[39]=oe,e[40]=W);let G;e[41]!==V||e[42]!==W?(G=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[V,W]}),e[41]=V,e[42]=W,e[43]=G):G=e[43];let K;e[44]!==y||e[45]!==B||e[46]!==G?(K=(0,$.jsx)(Z,{serverScoped:!0,settingKeys:z,mixed:y,title:`Actions`,description:`Commands that run in this project's checkout or its worktree, with optional shortcuts.`,onResetOverride:B,control:G}),e[44]=y,e[45]=B,e[46]=G,e[47]=K):K=e[47];let q;e[48]!==x||e[49]!==m||e[50]!==y||e[51]!==k||e[52]!==p?(q=y?(0,$.jsx)(Z,{title:`Different actions across environments`,description:`Choose one environment to edit its list. Adding an action here adds it on every selected environment.`}):(0,$.jsx)(Je,{scripts:p,keybindings:m,disabled:k||!x,onEdit:e=>T(Ne(e,m))}),e[48]=x,e[49]=m,e[50]=y,e[51]=k,e[52]=p,e[53]=q):q=e[53];let J;e[54]===P.status?J=e[55]:(J=P.status===`invalid`?(0,$.jsx)(Z,{title:`p4.json is invalid`,description:`A p4.json exists in this checkout but fails to parse, so every action and icon it declares is ignored. Check the JSON syntax and icon values.`,className:`text-warning`}):null,e[54]=P.status,e[55]=J);let Y;e[56]!==A||e[57]!==w||e[58]!==p||e[59]!==j||e[60]!==r?(Y=r&&(0,$.jsx)(Pe,{environmentId:r.environmentId,editScope:`settings:write`,request:w,scripts:p,onSubmit:j,onDelete:e=>void A(t=>t.filter(t=>t.id!==e),e,null),onClose:()=>T(null)}),e[56]=A,e[57]=w,e[58]=p,e[59]=j,e[60]=r,e[61]=Y):Y=e[61];let X;return e[62]!==K||e[63]!==q||e[64]!==J||e[65]!==Y?(X=(0,$.jsxs)(Se,{id:`project-actions`,title:`Actions`,children:[K,q,J,Y]}),e[62]=K,e[63]=q,e[64]=J,e[65]=Y,e[66]=X):X=e[66],X}function Qe(){return null}function $e(e){return[e.id,e]}function et(e,t,n){return n&&e.some(e=>e!==t)}var tt=(0,Q.lazy)(()=>n(()=>import(`./ProjectIconPickerDialog-DSRXK7Zv.js`).then(e=>({default:e.ProjectIconPickerDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233])));function nt(e){return`${e.environmentId}:${e.id}`}function rt(e){let t=(0,Ve.c)(34),{projectKey:n,environmentId:r,checkoutKey:i}=e,a=r===void 0?null:r,o=i===void 0?null:i,s=ye(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={from:`/settings`},t[0]=c):c=t[0];let l=L(c),u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={select:at},t[1]=u):u=t[1];let d=R(u),f;t[2]!==s||t[3]!==n?(f=s.find(e=>e.projectKey===n)??null,t[2]=s,t[3]=n,t[4]=f):f=t[4];let p=f,m;t[5]!==o||t[6]!==a||t[7]!==p?.memberProjects?(m=p?.memberProjects.filter(e=>(a===null||e.environmentId===a)&&(o===null||e.physicalProjectKey===o))??[],t[5]=o,t[6]=a,t[7]=p?.memberProjects,t[8]=m):m=t[8];let h=m,g=(0,Q.useRef)(null),_,v;t[9]!==o||t[10]!==a||t[11]!==h||t[12]!==p?(_=()=>{p&&h.length!==0&&(g.current={key:p.projectKey,environmentId:a,checkoutKey:o,memberKeys:h.map(it)})},v=[p,h,a,o],t[9]=o,t[10]=a,t[11]=h,t[12]=p,t[13]=_,t[14]=v):(_=t[13],v=t[14]),(0,Q.useEffect)(_,v);let y,b;if(t[15]!==o||t[16]!==a||t[17]!==s||t[18]!==h.length||t[19]!==l||t[20]!==d||t[21]!==n?(b=()=>{if(h.length>0)return;let e=g.current;if(e?.key!==n||e.environmentId!==a||e.checkoutKey!==o)return;let t=s.find(t=>t.memberProjects.some(t=>e.memberKeys.includes(t.physicalProjectKey)));t&&l({to:d,search:()=>({project:t.projectKey,machine:a??void 0,checkout:o??void 0}),replace:!0,hashScrollIntoView:!1})},y=[s,l,d,n,h.length,a,o],t[15]=o,t[16]=a,t[17]=s,t[18]=h.length,t[19]=l,t[20]=d,t[21]=n,t[22]=y,t[23]=b):(y=t[22],b=t[23]),(0,Q.useEffect)(b,y),!p){let e=s.length===0?`Add a project from the sidebar to configure it here.`:`This project is no longer available.`,n;return t[24]===e?n=t[25]:(n=(0,$.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-muted-foreground`,children:e}),t[24]=e,t[25]=n),n}if(h.length===0){let e;return t[26]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`p-8 text-sm text-muted-foreground`,children:`This checkout is no longer available in the selected project and environment.`}),t[26]=e):e=t[26],e}let x;t[27]!==h||t[28]!==p?(x={...p,memberProjects:h,environmentId:h[0].environmentId,id:h[0].id},t[27]=h,t[28]=p,t[29]=x):x=t[29];let S=x,C=`${p.projectKey}:${a??`all`}:${o??`all`}`,w=h.length<p.memberProjects.length,T;return t[30]!==S||t[31]!==C||t[32]!==w?(T=(0,$.jsx)(ot,{group:S,hasOtherMembers:w},C),t[30]=S,t[31]=C,t[32]=w,t[33]=T):T=t[33],T}function it(e){return e.physicalProjectKey}function at(e){return e.pathname}function ot({group:e,hasOtherMembers:t}){let n=L({from:`/settings`}),r=B(),{environments:i}=ae(),a=(0,Q.useMemo)(()=>new Map(i.map(e=>[e.environmentId,e])),[i]),c=G(e.memberProjects,_),u=e.memberProjects.every(e=>c.has(e.environmentId)),d=e.memberProjects.find(e=>a.get(e.environmentId)?.serverConfig!=null)??e.memberProjects[0],h=ie(),g=ke(F.update,{reportFailure:!1}),v=ke(F.delete,{reportFailure:!1}),b=(0,Q.useRef)(!1),C=d.faviconPath??null,w=d.projectIcon??null,T=typeof window<`u`&&e.memberProjects.every(e=>e.environmentId===r&&Ke(e.workspaceRoot,navigator.platform))?window.desktopBridge?.pickProjectFavicon:void 0,E=(0,Q.useCallback)((e,t)=>{if(t._tag!==`Failure`||ne(t))return;let n=re(t);z.add(q({type:`error`,title:e,description:n instanceof Error?n.message:`An error occurred.`}))},[]),O=(0,Q.useCallback)((e,t)=>{let n=e.find(e=>!W(e.environmentId,_));if(!n)return null;let r=x(m(Error(`This connection cannot change projects in ${n.environmentLabel??`this environment`}.`)));return E(t,r),r},[E]),k=(0,Q.useCallback)(async(t,n)=>{let r=O(e.memberProjects,n);if(r)return r;let i=e.memberProjects.find(e=>{let t=a.get(e.environmentId);return t?.connection.phase!==`connected`||!t.serverConfig});if(i){let e=Error(`Connect ${i.environmentLabel??`the selected environment`} and try again.`),t=x(m(e));return E(n,t),t}for(let r of e.memberProjects){let i=O([r],n);if(i)return i;let a=M(await g({environmentId:r.environmentId,input:{projectId:r.id,...t}}),()=>void 0);if(a._tag===`Failure`)return E(e.memberProjects.length>1?`${n} on ${r.environmentLabel??`the current environment`}`:n,a),a}return s(void 0)},[O,a,e.memberProjects,E,g]),ee=(0,Q.useCallback)(async(t,n)=>{let r=t.trim();r?et(e.memberProjects.map(e=>e.title),r,n)&&await k({title:r},`Failed to rename project`):z.add({type:`warning`,title:`Project title cannot be empty`})},[e.memberProjects,k]),[A,te]=D(!u),[P,I]=D(!u),[R,V]=(0,Q.useState)(!1),H=(0,Q.useRef)(!1),U=(0,Q.useCallback)(async e=>{if(!H.current){H.current=!0,V(!0);try{await k(e,`Failed to update project icon`)}finally{H.current=!1,V(!1)}}},[k]),K=e.memberProjects.length>1,Y=(0,Q.useCallback)(async r=>{if(O(r,`Failed to remove project`))return;let i=oe();if(!i)return;let a=new Set(r.map(nt)),s=h.filter(e=>a.has(`${e.environmentId}:${e.projectId}`)),c=r.length===e.memberProjects.length,l=t||!c?`checkout`:`project`,u=r.length===1?r[0]:null,d=u?.title??e.displayName,p=await j(()=>i.dialogs.confirm([s.length>0?`Remove ${l} "${d}" and delete its ${s.length} thread${s.length===1?``:`s`}?`:`Remove ${l} "${d}"?`,...u?[`Path: ${u.workspaceRoot}`,...u.environmentLabel?[`Environment: ${u.environmentLabel}`]:[]]:[`This removes ${r.length} grouped project entries.`],...s.length>0?[`This permanently clears conversation history for those threads and any archived threads.`]:[`This permanently clears any archived conversation history.`],c&&!t?`This removes only the project entries, not the files on disk.`:`Other entries in this grouped project are unaffected.`,`This action cannot be undone.`].join(`
|
|
3
|
+
`),{variant:`destructive`}));if(p._tag===`Failure`||!p.value||O(r,`Failed to remove project`))return;let m=o.getState();for(let e of r){if(O([e],`Failed to remove project`))return;let t=s.filter(t=>t.environmentId===e.environmentId&&t.projectId===e.id),n=M(await v({environmentId:e.environmentId,input:{projectId:e.id,force:!0}}),()=>void 0);if(n._tag===`Failure`){E(`Failed to remove "${e.title}"`,n);return}let r=y(e.environmentId,e.id);await N(r),De(r,t.map(e=>f(e.environmentId,e.id)));let i=m.getDraftThreadByProjectRef(r);i&&m.clearDraftThread(i.draftId),m.clearProjectDraftThreadId(r)}c&&!t&&n({to:`/`,replace:!0})},[O,v,e.displayName,e.memberProjects.length,t,n,E,h]),X=(0,$.jsx)(Se,{title:`Checkouts`,children:e.memberProjects.map(e=>(0,$.jsx)(Z,{title:e.environmentLabel??`Environment`,description:e.workspaceRoot,control:(0,$.jsx)(S,{size:`sm`,variant:`outline`,disabled:!c.has(e.environmentId),onClick:()=>void Y([e]),"aria-label":`Remove checkout ${e.workspaceRoot}`,children:`Remove`})},e.physicalProjectKey))});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(be,{className:`gap-6`,children:[(0,$.jsxs)(ge,{variant:`info`,children:[(0,$.jsx)(l,{"aria-hidden":!0}),(0,$.jsx)(he,{children:`Can't find a setting? Keep this project picked above and hop to any other settings page.`})]}),(0,$.jsxs)(Se,{id:`project-overview`,title:`Project`,hideTitle:!0,children:[u?null:(0,$.jsx)(`p`,{className:`px-3 py-2 text-sm text-muted-foreground sm:px-4`,children:e.memberProjects.length>1?`Shared settings require permission to change every checkout in this group.`:`This connection cannot change this project.`}),(0,$.jsx)(Z,{title:`Name`,description:`The shared name for this project group in the sidebar and thread lists.`,control:(0,$.jsx)(J,{size:`sm`,className:`w-full sm:w-64`,"aria-label":`Project name`,disabled:!u,defaultValue:e.displayName,onChange:()=>{b.current=!0},onBlur:e=>{let t=b.current;b.current=!1,ee(e.currentTarget.value,t)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}},`${e.projectKey}:${e.displayName}`)}),(0,$.jsx)(Z,{title:`Project icon`,description:w?.kind===`lucide`?`${w.name} · ${w.color}`:w?.kind===`monogram`?`${w.text} · ${w.color}`:w?.kind===`emoji`?w.emoji:C??`Automatic`,resetAction:e.memberProjects.some(e=>e.faviconPath!=null||e.projectIcon!=null)?(0,$.jsx)(xe,{label:`project icon`,disabled:R||!u,onClick:()=>void U({faviconPath:null,projectIcon:null})}):null,control:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(fe,{project:d,className:`size-6`}),(0,$.jsx)(S,{size:`sm`,variant:`outline`,type:`button`,"aria-label":`Choose a project icon`,disabled:R||!u,onClick:()=>I(!0),children:`Choose icon`}),(0,$.jsx)(S,{size:`sm`,variant:`outline`,type:`button`,"aria-label":`Choose a project icon file`,disabled:R||!u,onClick:()=>te(!0),children:`Choose file`})]})})]}),(0,$.jsx)(ze,{category:`project`}),(0,$.jsx)(Ze,{}),K?X:null,(0,$.jsx)(Se,{title:`Danger`,children:(0,$.jsx)(Z,{title:t?`Remove checkout`:e.memberProjects.length>1?`Remove this project everywhere`:`Remove project`,description:t?`Deletes the selected machine's checkout entries and their threads. Other machines and files on disk are not touched.`:e.memberProjects.length>1?`Deletes all ${e.memberProjects.length} checkout entries and their threads on every machine. Files on disk are not touched.`:`Deletes the project entry and its threads. Files on disk are not touched.`,control:(0,$.jsxs)(S,{size:`sm`,variant:`destructive-outline`,disabled:!u,onClick:()=>void Y(e.memberProjects),children:[(0,$.jsx)(p,{}),t?`Remove checkout`:e.memberProjects.length>1?`Remove all entries`:`Remove project`]})})})]}),(0,$.jsx)(qe,{cwd:d.workspaceRoot,environmentId:d.environmentId,onOpenChange:te,...T?{onPickExternal:()=>T(d.workspaceRoot)}:{},onSelect:e=>void U({faviconPath:e,projectIcon:null}),open:A&&u,projectName:e.displayName},`${d.environmentId}:${d.workspaceRoot}:${A}`),P&&u?(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(tt,{current:w,projectName:d.title,open:!0,onOpenChange:I,onSelect:e=>void U({faviconPath:null,projectIcon:e})})}):null]})}function st(){let e=(0,Ve.c)(7),{search:t,scope:n}=ve(),r=n.kind===`project`||n.kind===`checkout`||n.kind===`unavailable`&&(n.reason===`project-missing`||n.reason===`checkout-missing`),i;return e[0]!==r||e[1]!==n.kind||e[2]!==n.message||e[3]!==t.checkout||e[4]!==t.machine||e[5]!==t.project?(i=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:t.project&&r?(0,$.jsx)(rt,{projectKey:t.project,environmentId:t.machine?c.make(t.machine):null,checkoutKey:t.checkout??null}):n.kind===`unavailable`?(0,$.jsx)(be,{children:(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.message})}):(0,$.jsx)(Be,{target:`project`,children:`Choose a project to manage its name, icon, checkouts and actions.`})}),e[0]=r,e[1]=n.kind,e[2]=n.message,e[3]=t.checkout,e[4]=t.machine,e[5]=t.project,e[6]=i):i=e[6],i}var ct=st;export{ct as component};
|
|
4
|
+
//# sourceMappingURL=settings.projects-BKMazKl9.js.map
|