@p4code/cli 0.9.14 → 0.9.15
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/{AcpMcpStdioBridge-z_p02VlR.mjs → AcpMcpStdioBridge-BPNHFfTr.mjs} +11 -4
- package/dist/AcpMcpStdioBridge-CtXfvrFO.mjs +3 -0
- package/dist/{Effect-Bwkv2ifD.mjs → Effect-COOccdaU.mjs} +2 -2
- package/dist/{Schema-CFgoTmE6.mjs → Schema-BXiVImR2.mjs} +2 -2
- package/dist/{Stream-B4Gds95A.mjs → Stream-D2XZdzH6.mjs} +45 -3
- package/dist/bin.mjs +15 -2
- package/dist/{binCli-BGRfVnO9.mjs → binCli-06acKUH_.mjs} +4146 -2094
- package/dist/claude-history-worker.mjs +1 -1
- package/dist/{claudeHistoryWorker-DVpahhef.mjs → claudeHistoryWorker-BJKXFgWC.mjs} +4 -4
- package/dist/client/.vite/manifest.json +2064 -2089
- package/dist/client/assets/{2NI2N5EU-Bk2qNhha.js → 2NI2N5EU-CzVcbH89.js} +2 -2
- package/dist/client/assets/{4UO7MD6I-CPV9277r.js → 4UO7MD6I-DS3UFSUE.js} +2 -2
- package/dist/client/assets/{5B3SVYGG-LgRjxbnj.js → 5B3SVYGG-lbor_c4_.js} +2 -2
- package/dist/client/assets/{5GK6JWQ2-9ndiKpIs.js → 5GK6JWQ2-DufacBFC.js} +2 -2
- package/dist/client/assets/{5N7A7DKN-DnUhiayz.js → 5N7A7DKN-B3iWX-TC.js} +2 -2
- package/dist/client/assets/{5OC2THR4-DxmpZihk.js → 5OC2THR4-DoDDWXtD.js} +2 -2
- package/dist/client/assets/{5S6HY5KT-C4cUz8RB.js → 5S6HY5KT-7n94quvm.js} +2 -2
- package/dist/client/assets/{6IMQ5BUJ-2G8Rrp9t.js → 6IMQ5BUJ-CqcR9lZq.js} +2 -2
- package/dist/client/assets/{6OLKWJ4F-CW3F_AM6.js → 6OLKWJ4F-BeCI6be_.js} +2 -2
- package/dist/client/assets/{74OO7NKP-z5ujM5KH.js → 74OO7NKP-XWvi4Kgp.js} +2 -2
- package/dist/client/assets/{75O6YZUN-CSeaYNtt.js → 75O6YZUN-BbbGiqdI.js} +2 -2
- package/dist/client/assets/{77XECAW3-DxL0AHyZ.js → 77XECAW3-BVGMXOi_.js} +2 -2
- package/dist/client/assets/{ABYRPUBD-DvBcJj7G.js → ABYRPUBD-D4oehH5y.js} +2 -2
- package/dist/client/assets/AlertDialogRoot-BI19p1Pb.js +2 -0
- package/dist/client/assets/{AnimatedHeight-DChvigzz.js → AnimatedHeight-DT585xP0.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-29ykag3m.js → AuthSurfaceShell-C312CXz7.js} +2 -2
- package/dist/client/assets/{BB2UYUI2-Cun87LIm.js → BB2UYUI2-BkFcdWkE.js} +2 -2
- package/dist/client/assets/{BUM34MOA-D6aIFnwf.js → BUM34MOA-DK6xDbTB.js} +2 -2
- package/dist/client/assets/{CEQABKGZ-DYzEk-9p.js → CEQABKGZ-rLn9wSBN.js} +2 -2
- package/dist/client/assets/{CXAC5362-CdQgNtpk.js → CXAC5362-C1eQCQMX.js} +2 -2
- package/dist/client/assets/ChatGptUsageButton-BldpBXxU.js +2 -0
- package/dist/client/assets/ChatMarkdown-BUoR67CT.js +49 -0
- package/dist/client/assets/CheckboxIndicator-C4iAbUMh.js +2 -0
- package/dist/client/assets/ClippedText-TtLeyAVc.js +2 -0
- package/dist/client/assets/CodexSetupSection.logic-BO6ZAijp.js +2 -0
- package/dist/client/assets/ComboboxClear-CtNsa8Al.js +2 -0
- package/dist/client/assets/ComboboxGroupLabel-vQ7y8c50.js +2 -0
- package/dist/client/assets/{CommandBlock-DBGDwDRu.js → CommandBlock-40eSIrOe.js} +2 -2
- package/dist/client/assets/CompositeRoot-CL7X20MU.js +2 -0
- package/dist/client/assets/ConnectAgentSurface-B_AYPHWs.js +2 -0
- package/dist/client/assets/{ConnectionStatusDot-C_9jtSee.js → ConnectionStatusDot-7Tjfknn6.js} +2 -2
- package/dist/client/assets/{DRLTVNUE-CftE6Aa3.js → DRLTVNUE-BPoomdQn.js} +2 -2
- package/dist/client/assets/{DYY6UVD2-DezK9sBO.js → DYY6UVD2-BVvdA84B.js} +2 -2
- package/dist/client/assets/DevicePanel-Cqexcbm2.js +2 -0
- package/dist/client/assets/DeviceSetup-Cdyw5Z9a.js +2 -0
- package/dist/client/assets/DialogTitle-CFYK6V6-.js +2 -0
- package/dist/client/assets/{DiffCommentAnnotation-QtrnUuSs.js → DiffCommentAnnotation-C28NAT6f.js} +3 -3
- package/dist/client/assets/{DiffFileTree-B_4bn5J8.js → DiffFileTree-DNP9E3To.js} +2 -2
- package/dist/client/assets/DiffPanel-CrswOKS6.js +2 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-CtpHksSf.js → DiffWorkerPoolProvider-TgqbZJCv.js} +3 -3
- package/dist/client/assets/{EmbeddedDesign-BU5m6_ou.js → EmbeddedDesign-Bdq5oAfI.js} +8 -8
- package/dist/client/assets/{EnvironmentMachineIcon-DTUBsEaI.js → EnvironmentMachineIcon-B81Bujkx.js} +2 -2
- package/dist/client/assets/{ExpandableText-Wij8nL6W.js → ExpandableText-CViqRFUp.js} +2 -2
- package/dist/client/assets/{FNOVOB4O-DHCmE6LN.js → FNOVOB4O-CmMgcKnc.js} +2 -2
- package/dist/client/assets/FieldControl-95mCsa0m.js +2 -0
- package/dist/client/assets/{FileDiff-CAtJtUC5.js → FileDiff-BnZVGRTP.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-CjKP3Q7G.js → FilePreviewPanel-BUTTBdpa.js} +5 -5
- package/dist/client/assets/{FoldedSettingsSection-CAZumPht.js → FoldedSettingsSection-CioXtXIT.js} +2 -2
- package/dist/client/assets/FormContext-BcA1kdFD.js +2 -0
- package/dist/client/assets/{HDGCDEEZ-DNHIctoG.js → HDGCDEEZ-BsN0BbNt.js} +2 -2
- package/dist/client/assets/{HSJLKHB7-BfNhUjhw.js → HSJLKHB7-Bn8VFRt5.js} +2 -2
- package/dist/client/assets/{Icons-DYaY7Otq.js → Icons-D_LFMxsj.js} +2 -2
- package/dist/client/assets/Input-C9KIhPlP.js +2 -0
- package/dist/client/assets/JZOYTAAL-B8H2VC7A.js +1 -0
- package/dist/client/assets/{K3MD6TGW-D-q4Z_68.js → K3MD6TGW-BEaTend7.js} +2 -2
- package/dist/client/assets/{K7RP3OMA-C5AEGeo9.js → K7RP3OMA-Ca837W6z.js} +2 -2
- package/dist/client/assets/KeybindingsSettings.logic-DwMUZYvv.js +2 -0
- package/dist/client/assets/{LHDIQX7Q-CY4nmSyZ.js → LHDIQX7Q-kLYZmy22.js} +2 -2
- package/dist/client/assets/{LUXOKEGN-BHmzrQMD.js → LUXOKEGN-C6-9ARpy.js} +2 -2
- package/dist/client/assets/LinkMachineSelect-BVNnYUBb.js +2 -0
- package/dist/client/assets/{MathTypeset-C1sAcsZE.js → MathTypeset-CO0wlzDm.js} +2 -2
- package/dist/client/assets/{N3JZAHOW-D1VvHXNc.js → N3JZAHOW-BFAKVTw8.js} +2 -2
- package/dist/client/assets/{NUIALGQ3-DKQw5Xvm.js → NUIALGQ3-DJg3tvBl.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-DVJOMY01.js → NoProjectsHero-ClDVFY0-.js} +2 -2
- package/dist/client/assets/{O65XPQGZ-B7xlpxd0.js → O65XPQGZ-C5dkxqix.js} +2 -2
- package/dist/client/assets/{O7XIQ6OM-D_yohKEz.js → O7XIQ6OM-BUT403yQ.js} +2 -2
- package/dist/client/assets/{OFQON5FD-Eb1UafMJ.js → OFQON5FD-BPK3FXUG.js} +2 -2
- package/dist/client/assets/P4ConnectAccountPages-ChT866qO.js +2 -0
- package/dist/client/assets/{P4ConnectSidebarSignIn-BarFXVdD.js → P4ConnectSidebarSignIn-D7BBbl_u.js} +2 -2
- package/dist/client/assets/{PJQHF43J-xu8MNrTl.js → PJQHF43J-DrfICuu-.js} +2 -2
- package/dist/client/assets/PanelLayoutControls-DMUv135M.js +216 -0
- package/dist/client/assets/PierreEntryIcon-DLXDEcqA.js +2 -0
- package/dist/client/assets/PopoverHandle-D8JhsX32.js +2 -0
- package/dist/client/assets/PreviewPanel-D7YWnWZS.js +2 -0
- package/dist/client/assets/ProjectDefaultsSettings-BZSw74tU.js +2 -0
- package/dist/client/assets/ProjectFavicon-BbtNdeB8.js +3 -0
- package/dist/client/assets/{ProjectIconPickerDialog-Ccwf3eo1.js → ProjectIconPickerDialog-7vur_TCX.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-Bui44V7z.js → ProjectMonogram-CjAGnMXr.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-DjIpg2-V.js → ProviderAuthTerminal-83vDClUK.js} +2 -2
- package/dist/client/assets/ProviderModelPicker-af7MWLPO.js +2 -0
- package/dist/client/assets/{ProviderSettingsForm-sjzQFb8p.js → ProviderSettingsForm-B4N4tsxv.js} +2 -2
- package/dist/client/assets/PullRequestCodeTab-B07M_QW4.js +6 -0
- package/dist/client/assets/{RHNBAITX-DWaFNhmX.js → RHNBAITX-CzAdLNMd.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-DDDARz8g.js → ReadOnlySourcePreview-CRy5hHfx.js} +2 -2
- package/dist/client/assets/{RedactedSensitiveText-BFwVjGRJ.js → RedactedSensitiveText-B-u4PB3I.js} +2 -2
- package/dist/client/assets/RenderErrorBoundary-BbxLD-66.js +23 -0
- package/dist/client/assets/{RightPanelResizeHandle-DstJn39I.js → RightPanelResizeHandle-BODMyZa6.js} +2 -2
- package/dist/client/assets/{SLD4V6NK-kuRIO20K.js → SLD4V6NK-DIFaAadw.js} +2 -2
- package/dist/client/assets/ScheduledTasksSettings-BTi69FRq.js +6 -0
- package/dist/client/assets/{ScopedSwitch-B7HEwool.js → ScopedSwitch-sSIKDf2q.js} +2 -2
- package/dist/client/assets/ScrollAreaCorner-CsKGemsf.js +2 -0
- package/dist/client/assets/{SecretInput-CxRazSuj.js → SecretInput-DxjaAnSE.js} +2 -2
- package/dist/client/assets/SelectScrollUpArrow-BMZtcPXM.js +2 -0
- package/dist/client/assets/{SelfImproveSettingsSection-BxPUr-AT.js → SelfImproveSettingsSection-Dx6spJXh.js} +2 -2
- package/dist/client/assets/SettingsPanels-DhuEF0_Y.js +46 -0
- package/dist/client/assets/{SettingsPanels.logic-B406HX50.js → SettingsPanels.logic-D5Fnq4gS.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-Dt7vuLO5.js → SettingsScopeNotice-B1JDmqM6.js} +2 -2
- package/dist/client/assets/{SidebarStageBackdrop-BzsUCj2G.js → SidebarStageBackdrop-Bbv3JBlJ.js} +2 -2
- package/dist/client/assets/{T3PCR2KE-C14xVwSj.js → T3PCR2KE-CACWvOHn.js} +2 -2
- package/dist/client/assets/{TKWO2OVW-CC_4uZad.js → TKWO2OVW-DpiGaVko.js} +2 -2
- package/dist/client/assets/{TSHNXIZL-Kizqv5oh.js → TSHNXIZL-Cs6g4gXN.js} +2 -2
- package/dist/client/assets/ThemeEditorPanel-w-RJEK3t.js +5 -0
- package/dist/client/assets/{ThreadDetailsItemsMenu-CSCIFtTP.js → ThreadDetailsItemsMenu-DEwUOoLt.js} +60 -60
- package/dist/client/assets/ThreadTerminalDrawer-CY2qHldP.js +5 -0
- package/dist/client/assets/TooltipProvider-Czzm7ro-.js +2 -0
- package/dist/client/assets/{UQJE5E4I-KUX5qtvS.js → UQJE5E4I-C2gKDRv_.js} +2 -2
- package/dist/client/assets/{USNYFO5S-XMF6TRXj.js → USNYFO5S-CQ8LfY6F.js} +2 -2
- package/dist/client/assets/{Virtualizer-CqFZ9IgG.js → Virtualizer-DsEq6qUF.js} +2 -2
- package/dist/client/assets/{WEVWDWVA-BNUvxLQd.js → WEVWDWVA-DK2GTAKk.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-DyZsM9TF.js → WorkspaceBreadcrumb-BImJJpuo.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-DFXSkFyh.js → WorkspacePageContainer-BlYFBUKE.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-FTc6UfB-.js → WorkspacePageHeader-B7O16593.js} +2 -2
- package/dist/client/assets/{X5RFHQXM-BtifjFQb.js → X5RFHQXM-sPxDCIwv.js} +2 -2
- package/dist/client/assets/{X62E3GBT-DT_qCIPw.js → X62E3GBT-DVWr270S.js} +2 -2
- package/dist/client/assets/{XBNEOJTC-7FdMX9IP.js → XBNEOJTC-C4ZNtSrU.js} +2 -2
- package/dist/client/assets/{YHV2MVVZ-D6KCo9Qp.js → YHV2MVVZ-aSYUfq9n.js} +2 -2
- package/dist/client/assets/{YURCZMG2-D0_CST6F.js → YURCZMG2-fnxZxUja.js} +2 -2
- package/dist/client/assets/{YVG2LODB-CRU4fKD2.js → YVG2LODB-DxaZKaXT.js} +2 -2
- package/dist/client/assets/_chat-BeJoXsdK.js +47 -0
- package/dist/client/assets/_chat.design-AJz30uXq.js +2 -0
- package/dist/client/assets/_chat.index-D1csjyRQ.js +2 -0
- package/dist/client/assets/_chat.new-IhhWgwNo.js +4 -0
- package/dist/client/assets/_chat.pull-requests-B84LUHIv.js +2 -0
- package/dist/client/assets/{alert-D0u2-4Zh.js → alert-D6MFRWZv.js} +2 -2
- package/dist/client/assets/{alert-dialog-DK40IDMO.js → alert-dialog-BCq0Qme9.js} +2 -2
- package/dist/client/assets/assetUrls-CpRsTTqn.js +2 -0
- package/dist/client/assets/assets-Dh1LFwqL.js +2 -0
- package/dist/client/assets/browserHistoryStore-BVEWgOnh.js +2 -0
- package/dist/client/assets/{browserLinkTarget-BOF3rlV5.js → browserLinkTarget-IOprEiHF.js} +2 -2
- package/dist/client/assets/{checkbox-bsJs8Zu-.js → checkbox-CGhJug34.js} +2 -2
- package/dist/client/assets/{color-picker-W4KTEgfL.js → color-picker-CRaqqL5F.js} +2 -2
- package/dist/client/assets/{combobox-UDn50qHb.js → combobox-5RzytEjd.js} +2 -2
- package/dist/client/assets/{command-C7CgDZ25.js → command-06bu9QoQ.js} +2 -2
- package/dist/client/assets/{connect-CguaBRtJ.js → connect-7OV1IEwO.js} +2 -2
- package/dist/client/assets/connect-agent-B6pgZuy8.js +2 -0
- package/dist/client/assets/design-DSoix9e1.js +2 -0
- package/dist/client/assets/device-DQmQm4GC.js +2 -0
- package/dist/client/assets/{dialog-BEXthTAp.js → dialog-DTVhbEqi.js} +2 -2
- package/dist/client/assets/{diffRendering-DosiBwUN.js → diffRendering-DAzPanqh.js} +3 -3
- package/dist/client/assets/{dist-p5OtQFc9.js → dist-BuxsAlG0.js} +3 -3
- package/dist/client/assets/draft-input-BTetoXSt.js +2 -0
- package/dist/client/assets/{duoViewer-BcsodgGy.js → duoViewer-DxmaOmHS.js} +2 -2
- package/dist/client/assets/{dynamic-XOmtS0-B.js → dynamic-wBSCLNxy.js} +2 -2
- package/dist/client/assets/{embeddedScripts-BQl_ld6u.js → embeddedScripts-ZebptRJ0.js} +2 -2
- package/dist/client/assets/{empty-CTv2Unxd.js → empty-B4h5DyMQ.js} +2 -2
- package/dist/client/assets/entities-CWtNgawi.js +2 -0
- package/dist/client/assets/{fileLinks-T2ko6Qmp.js → fileLinks-BfcK2bJU.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-BOutPxUH.js → fileTreeExpansion-DjiK1m5s.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-Do7OSxYn.js → getDiffFileInput-XE3jyXxK.js} +2 -2
- package/dist/client/assets/{guideRunStore-DGAK_XSV.js → guideRunStore-CzF0q6A8.js} +2 -2
- package/dist/client/assets/{htmlRender-DAhG7IlW.js → htmlRender-DGe3WaPg.js} +2 -2
- package/dist/client/assets/{index-4XHdM2Yx.js → index-CurDuwfz.js} +3 -3
- package/dist/client/assets/{input-BGKmQVHf.js → input-CQaedaQh.js} +2 -2
- package/dist/client/assets/{input-group-BdgWY0OZ.js → input-group-BQ_2ox-w.js} +2 -2
- package/dist/client/assets/{kbd-BIypvknl.js → kbd-DQRicdHu.js} +2 -2
- package/dist/client/assets/{keybindings-C0ntbKmL.js → keybindings-tgj8XFFz.js} +2 -2
- package/dist/client/assets/{lazy-DudfZwDr.js → lazy-DmPH_lNd.js} +4 -4
- package/dist/client/assets/{lazyRouteComponent-VtherrNw.js → lazyRouteComponent-CE6uW_5p.js} +2 -2
- package/dist/client/assets/{link--eZ8ZXuK.js → link-CKfckeju.js} +2 -2
- package/dist/client/assets/{linkedPrompt-DRNVlalr.js → linkedPrompt-68_t5vwh.js} +2 -2
- package/dist/client/assets/main-B1sXOjZZ.js +37 -0
- package/dist/client/assets/main-CbkvDRKP.css +2 -0
- package/dist/client/assets/{mediaReference-CMwg4kE3.js → mediaReference-DQ6GIZY7.js} +2 -2
- package/dist/client/assets/mediaSource-DfTsMdqm.js +2 -0
- package/dist/client/assets/number-field-xEi5ylvp.js +2 -0
- package/dist/client/assets/{observeResize-CV41SgJr.js → observeResize-BbXolq6K.js} +2 -2
- package/dist/client/assets/onboarding-CkdZxdNL.js +2 -0
- package/dist/client/assets/openFileInPreview-BHhDd-id.js +2 -0
- package/dist/client/assets/{p4ProjectFile-DqqWNGdD.js → p4ProjectFile-5VDI-yAx.js} +2 -2
- package/dist/client/assets/{pair-Wl7C9P9c.js → pair-BpCo33SH.js} +2 -2
- package/dist/client/assets/{pendingSendStore-CFKdq-QP.js → pendingSendStore-Ba--K6cH.js} +2 -2
- package/dist/client/assets/{phoneViewer-C1sFfV5x.js → phoneViewer-C1aGY-h1.js} +2 -2
- package/dist/client/assets/{pierre-icons-2mAt8csu.js → pierre-icons-BdcegjLq.js} +3 -3
- package/dist/client/assets/popover-BB2K1---.js +2 -0
- package/dist/client/assets/preview-B4_sjsUX.js +2 -0
- package/dist/client/assets/preview-DgXn94k5.js +2 -0
- package/dist/client/assets/{previewMiniPlayerStore-DwJUVJAq.js → previewMiniPlayerStore-DguWdL1f.js} +2 -2
- package/dist/client/assets/primary-BDoRkJqU.js +2 -0
- package/dist/client/assets/primaryCloudLinkState-Cc0Xobh6.js +2 -0
- package/dist/client/assets/projectFilesQueryState-BdfD5cZ2.js +2 -0
- package/dist/client/assets/projectScriptEditor-faOsFlds.js +2 -0
- package/dist/client/assets/{providerSkills-B9Q5OmXk.js → providerSkills-C8PrnHb-.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-CVJbFct1.js → pullRequestDetail.logic-kOhR5jr9.js} +4 -4
- package/dist/client/assets/{pullRequestIcons-ZE5MB0dW.js → pullRequestIcons-CbDg0o8q.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-CF0UmQoG.js → pullRequestReviewStore-0WIH92NQ.js} +2 -2
- package/dist/client/assets/pullRequests-Cf9E2kW-.js +2 -0
- package/dist/client/assets/queries-Cl508kPw.js +2 -0
- package/dist/client/assets/query-D3KVoW9G.js +2 -0
- package/dist/client/assets/radio-group-BnZVD-CO.js +2 -0
- package/dist/client/assets/relay-Do9UB5iT.js +2 -0
- package/dist/client/assets/{renderScheduler-BLYWx2Dl.js → renderScheduler-DsjkE3rh.js} +2 -2
- package/dist/client/assets/{rightPanelStore-BzpX6F8n.js → rightPanelStore-DB1OP4MT.js} +2 -2
- package/dist/client/assets/runtime-BBYIQ0f-.js +7 -0
- package/dist/client/assets/runtimeModeConfig-CRXk0H6e.js +2 -0
- package/dist/client/assets/scheduledTasksSettings.logic-Dw_swg_M.js +3 -0
- package/dist/client/assets/{scroll-area-BN4-XX3T.js → scroll-area-Cm9XZdHp.js} +2 -2
- package/dist/client/assets/{select-CHOl11x1.js → select-Cz_1ByI4.js} +2 -2
- package/dist/client/assets/{selfImproveFindings-BTdfhZ3z.js → selfImproveFindings-DtoTFNL_.js} +2 -2
- package/dist/client/assets/semver-BoU8Be_3.js +2 -0
- package/dist/client/assets/server-Dkj4NeYG.js +2 -0
- package/dist/client/assets/session-CBEVNHld.js +2 -0
- package/dist/client/assets/{session-logic-BwAELIPU.js → session-logic-DB_ei-pn.js} +5 -5
- package/dist/client/assets/{settings-fuKhbSed.js → settings-Yvo1RMvg.js} +2 -2
- package/dist/client/assets/{settings.appearance-K-0McYk9.js → settings.appearance-ONDNW-gc.js} +2 -2
- package/dist/client/assets/settings.archived-CjdyCMyi.js +2 -0
- package/dist/client/assets/{settings.computer-use-C8dDJqmo.js → settings.computer-use-97ffp9C_.js} +2 -2
- package/dist/client/assets/settings.connections-w3qKRKGa.js +2 -0
- package/dist/client/assets/settings.data-controls-C8ozSexu.js +2 -0
- package/dist/client/assets/{settings.decisions-C1RgAwXn.js → settings.decisions-BvR3_OTv.js} +2 -2
- package/dist/client/assets/{settings.designs-BgEqEGXM.js → settings.designs-CB8PWHwW.js} +2 -2
- package/dist/client/assets/settings.diagnostics-DdInPrq0.js +2 -0
- package/dist/client/assets/{settings.general-BeLPMggF.js → settings.general-Cf_bIbyH.js} +2 -2
- package/dist/client/assets/settings.integrations-pj9KVvtd.js +2 -0
- package/dist/client/assets/settings.keybindings-3diGciV1.js +2 -0
- package/dist/client/assets/{settings.open-source-licenses-DWVgu9MJ.js → settings.open-source-licenses-DlqO6HBa.js} +2 -2
- package/dist/client/assets/{settings.plugins-DsfEfMST.js → settings.plugins-DpaJJH_J.js} +4 -4
- package/dist/client/assets/settings.projects-Bfh3CJ1a.js +4 -0
- package/dist/client/assets/settings.providers-DNiEeQYT.js +3 -0
- package/dist/client/assets/{settings.scheduled-tasks-BJMUub-y.js → settings.scheduled-tasks-BIaHEXVF.js} +2 -2
- package/dist/client/assets/settings.secrets-BSNXem5A.js +2 -0
- package/dist/client/assets/{settings.snap-shot-6aF3J4Zd.js → settings.snap-shot-Ds0ywKhE.js} +2 -2
- package/dist/client/assets/settings.source-control-C41AVNSm.js +2 -0
- package/dist/client/assets/settings.storage-B-Hm5vEC.js +2 -0
- package/dist/client/assets/settingsLayout-BbEwQ6Fy.js +3 -0
- package/dist/client/assets/{sidebar-Dt9UYgk1.js → sidebar-B70J7v16.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-lpBYOlht.js → sidebarProjectGrouping-Cy06FqQF.js} +2 -2
- package/dist/client/assets/{skeleton-BiqtjWsk.js → skeleton-BavPX8IL.js} +2 -2
- package/dist/client/assets/sourceControl-De64nxc-.js +2 -0
- package/dist/client/assets/{sourceControlClients-Bcd4sqEi.js → sourceControlClients-BofXnV5S.js} +2 -2
- package/dist/client/assets/{spinner-C64jtA3m.js → spinner-BiCpg0TU.js} +2 -2
- package/dist/client/assets/terminal-links-DkNuyYrs.js +2 -0
- package/dist/client/assets/terminalSessions-BLnAzTpE.js +2 -0
- package/dist/client/assets/{textarea-DtceyvOF.js → textarea-DPWqoJRQ.js} +2 -2
- package/dist/client/assets/themePalette-1UQmJk98.js +5 -0
- package/dist/client/assets/{threadCheckpoints-BXz5LJLz.js → threadCheckpoints-C5aLz9nv.js} +2 -2
- package/dist/client/assets/{toggle-Be7gb_vD.js → toggle-DERKSGyC.js} +2 -2
- package/dist/client/assets/{toggle-group-Cz65VaLC.js → toggle-group-DYSJFIn3.js} +2 -2
- package/dist/client/assets/tooltip-C7NAkYG3.js +2 -0
- package/dist/client/assets/{uiStateStore-yyuUmO2M.js → uiStateStore-FYiLqqos.js} +2 -2
- package/dist/client/assets/usage-CtcqAwlu.js +2 -0
- package/dist/client/assets/{usageAccess-0MZ9DMCW.js → usageAccess-2Wks5kIN.js} +2 -2
- package/dist/client/assets/{usageFormat-4k8-70X2.js → usageFormat-BZJ9qCn4.js} +2 -2
- package/dist/client/assets/{usageShortcuts-C4Dhwzkz.js → usageShortcuts-BJyp1xT6.js} +2 -2
- package/dist/client/assets/use-atom-command-BbFDhw_c.js +2 -0
- package/dist/client/assets/useAriaLabelledBy-BJnK5b5h.js +2 -0
- package/dist/client/assets/useHandleNewThread-C6MtV3AM.js +2 -0
- package/dist/client/assets/{useLocation-_8If3LN3.js → useLocation-NTw9A5XQ.js} +2 -2
- package/dist/client/assets/{useNavigate-5WivMyAa.js → useNavigate-DV9bXnWr.js} +2 -2
- package/dist/client/assets/{useNavigateBack-DXfbYF86.js → useNavigateBack-D62rsj_4.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-D0Equ6mY.js → useP4ConnectAuthPrompt-Bj5GIxgy.js} +2 -2
- package/dist/client/assets/{useParams-DV-Nw6Lj.js → useParams-jklHVL7l.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-CIobAIHF.js → usePermissionStatus-DaCu90iN.js} +2 -2
- package/dist/client/assets/usePopupViewport-D1lXH2SQ.js +2 -0
- package/dist/client/assets/usePreviousValue-Dx4Nv0v8.js +2 -0
- package/dist/client/assets/usePullRequestActions-WFmep5Tm.js +3 -0
- package/dist/client/assets/useRegisterFieldControl-BtJcyaxh.js +2 -0
- package/dist/client/assets/{useScopedModelAvailability-Cc-bmdqn.js → useScopedModelAvailability-hsJL85Tg.js} +2 -2
- package/dist/client/assets/useSettings-EYJbJzT3.js +3 -0
- package/dist/client/assets/utils-DjbLtxuo.js +37 -0
- package/dist/client/assets/vcsRefInvalidation-DkXoQApH.js +2 -0
- package/dist/client/assets/welcome-uKSqaFeK.js +2 -0
- package/dist/client/index.html +1 -1
- package/dist/{renderer-D_KFqL06.mjs → renderer-D9dDeERN.mjs} +68 -13
- package/dist/{runtime-Tslhhp69.mjs → runtime-C3UJDGLb.mjs} +81 -11
- package/package.json +1 -1
- package/dist/AcpMcpStdioBridge-BinVfs5k.mjs +0 -3
- package/dist/client/assets/AlertDialogRoot-z7O2CaB2.js +0 -2
- package/dist/client/assets/ChatGptUsageButton-DQjnXjt6.js +0 -2
- package/dist/client/assets/ChatMarkdown-C7ocX514.js +0 -48
- package/dist/client/assets/CheckboxIndicator-D2jNOqVc.js +0 -2
- package/dist/client/assets/ClippedText-CDOkzr7r.js +0 -2
- package/dist/client/assets/CodexSetupSection.logic-BIpypa3y.js +0 -2
- package/dist/client/assets/ComboboxClear-CPvB2whi.js +0 -2
- package/dist/client/assets/ComboboxGroupLabel-DN75A_2f.js +0 -2
- package/dist/client/assets/CompositeRoot-Jf3zEGLN.js +0 -2
- package/dist/client/assets/ConnectAgentSurface-Cv2oB5Cw.js +0 -2
- package/dist/client/assets/DevicePanel-CKWUjHEE.js +0 -2
- package/dist/client/assets/DeviceSetup-BrOsu1Y4.js +0 -2
- package/dist/client/assets/DialogTitle-COHuuWBE.js +0 -2
- package/dist/client/assets/DiffPanel-CGIIHSDI.js +0 -2
- package/dist/client/assets/FieldControl-Yp1Yjlg7.js +0 -2
- package/dist/client/assets/FormContext-BEFZtJu9.js +0 -2
- package/dist/client/assets/Input-CVeLgfX4.js +0 -2
- package/dist/client/assets/JZOYTAAL-Bngs0npp.js +0 -1
- package/dist/client/assets/KeybindingsSettings.logic-A_266dBm.js +0 -2
- package/dist/client/assets/LinkMachineSelect-tm04n5mK.js +0 -2
- package/dist/client/assets/P4ConnectAccountPages-BkOCG7hq.js +0 -2
- package/dist/client/assets/PanelLayoutControls-amKHUz1V.js +0 -216
- package/dist/client/assets/PierreEntryIcon-CbhCWTjd.js +0 -2
- package/dist/client/assets/PopoverHandle-DbGxLy3d.js +0 -2
- package/dist/client/assets/PreviewPanel-B1KmgL5R.js +0 -2
- package/dist/client/assets/ProjectDefaultsSettings-D_2ixmme.js +0 -2
- package/dist/client/assets/ProjectFavicon-BXd2O1Gh.js +0 -3
- package/dist/client/assets/ProviderModelPicker-DJl5IM1n.js +0 -2
- package/dist/client/assets/PullRequestCodeTab-BcFFbURH.js +0 -6
- package/dist/client/assets/RenderErrorBoundary-DianZAsM.js +0 -23
- package/dist/client/assets/ScheduledTasksSettings-BHT9WAFD.js +0 -6
- package/dist/client/assets/ScrollAreaCorner-DW6lxPPn.js +0 -2
- package/dist/client/assets/SelectScrollUpArrow-DZfqWvZD.js +0 -2
- package/dist/client/assets/SettingsPanels-CrMsCqvq.js +0 -46
- package/dist/client/assets/ThemeEditorPanel-BuMI6s2A.js +0 -5
- package/dist/client/assets/ThreadTerminalDrawer-FZ0zyNm1.js +0 -5
- package/dist/client/assets/TooltipViewport-DjveMpIl.js +0 -2
- package/dist/client/assets/_chat-P2jEGe91.js +0 -47
- package/dist/client/assets/_chat.design-k56_YrCY.js +0 -2
- package/dist/client/assets/_chat.index-CUR_1FMo.js +0 -2
- package/dist/client/assets/_chat.new-7EgBpaGD.js +0 -4
- package/dist/client/assets/_chat.pull-requests-C97pdH91.js +0 -2
- package/dist/client/assets/assetUrls-ChygJppW.js +0 -2
- package/dist/client/assets/assets-Cv1qxio9.js +0 -2
- package/dist/client/assets/browserHistoryStore-PB9BBl0N.js +0 -2
- package/dist/client/assets/connect-agent-BitywHYq.js +0 -2
- package/dist/client/assets/design-NrL4Xyzh.js +0 -2
- package/dist/client/assets/device-DsIsK_g9.js +0 -2
- package/dist/client/assets/draft-input-Cp7zSsLs.js +0 -2
- package/dist/client/assets/entities-Ci9sZwRJ.js +0 -2
- package/dist/client/assets/main-CKOKCTSr.css +0 -2
- package/dist/client/assets/main-CRJyb41E.js +0 -37
- package/dist/client/assets/mediaSource-BQpgJ9hG.js +0 -2
- package/dist/client/assets/number-field-pjPmm2hH.js +0 -2
- package/dist/client/assets/onboarding-C7BynXti.js +0 -2
- package/dist/client/assets/openFileInPreview-Cs7GoIEO.js +0 -2
- package/dist/client/assets/popover-oNrAhEOs.js +0 -2
- package/dist/client/assets/preview-CAzlFJXG.js +0 -2
- package/dist/client/assets/preview-D8H2Itzr.js +0 -2
- package/dist/client/assets/primary-BdVzsWIK.js +0 -2
- package/dist/client/assets/primaryCloudLinkState-eu2avrjG.js +0 -2
- package/dist/client/assets/projectFilesQueryState-f8odJKc-.js +0 -2
- package/dist/client/assets/projectScriptEditor-D8Os7g21.js +0 -2
- package/dist/client/assets/pullRequests-p7FMtHTx.js +0 -2
- package/dist/client/assets/queries-C1_RUJ-8.js +0 -2
- package/dist/client/assets/query-DszcgUku.js +0 -2
- package/dist/client/assets/radio-group-Cb2KobOI.js +0 -2
- package/dist/client/assets/runtime-CcgzOADx.js +0 -6
- package/dist/client/assets/runtime-D2NRh41I.js +0 -3
- package/dist/client/assets/runtimeModeConfig-DTaQ5JjA.js +0 -2
- package/dist/client/assets/scheduledTasksSettings.logic-FST8Bc6V.js +0 -3
- package/dist/client/assets/semver-CFbvOQKc.js +0 -2
- package/dist/client/assets/server-C-cSQN_G.js +0 -2
- package/dist/client/assets/session-D6BRf77P.js +0 -2
- package/dist/client/assets/settings.archived-CalSrYkZ.js +0 -2
- package/dist/client/assets/settings.connections-D_XSkcFH.js +0 -2
- package/dist/client/assets/settings.data-controls-CTlXbRrO.js +0 -2
- package/dist/client/assets/settings.diagnostics-BxqI_9bx.js +0 -2
- package/dist/client/assets/settings.integrations-4rKfTDFW.js +0 -2
- package/dist/client/assets/settings.keybindings-DSavoJxs.js +0 -2
- package/dist/client/assets/settings.projects-CJzRAMVM.js +0 -4
- package/dist/client/assets/settings.providers-BoTCdGuy.js +0 -3
- package/dist/client/assets/settings.secrets-Ch_XS6ak.js +0 -2
- package/dist/client/assets/settings.source-control-B7PW3yi5.js +0 -2
- package/dist/client/assets/settings.storage-PmxiGFaE.js +0 -2
- package/dist/client/assets/settingsLayout-fG812pJ2.js +0 -3
- package/dist/client/assets/sourceControl-BUEFlHbW.js +0 -2
- package/dist/client/assets/terminal-links-DxE1mEi0.js +0 -2
- package/dist/client/assets/terminalSessions-Ceajv0BZ.js +0 -2
- package/dist/client/assets/themePalette-tZPF0oN0.js +0 -5
- package/dist/client/assets/toast-BYGaCmZu.js +0 -2
- package/dist/client/assets/tooltip-BYZIg_IY.js +0 -2
- package/dist/client/assets/usage-B6rUsIoY.js +0 -2
- package/dist/client/assets/use-atom-command-DEluSG6k.js +0 -2
- package/dist/client/assets/useAriaLabelledBy-Ca8fkLAD.js +0 -2
- package/dist/client/assets/useHandleNewThread-BOej8pJq.js +0 -2
- package/dist/client/assets/usePullRequestActions-Cf39XlVv.js +0 -3
- package/dist/client/assets/useRegisterFieldControl-Dmsxd6H8.js +0 -2
- package/dist/client/assets/useSettings-jZr_DfW0.js +0 -3
- package/dist/client/assets/utils-OWUgXvpr.js +0 -37
- package/dist/client/assets/vcsRefInvalidation-CRToBQE1.js +0 -2
- package/dist/client/assets/welcome-BcjbPbMq.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{C as r,D as i,Vh as a,ac as o,c as s,es as c,g as l,i as u,ic as d,is as f,rc as p,s as m,yl as h}from"./utils-DjbLtxuo.js";import{Bn as g,br as _,bt as v,jn as ee,pt as y,yr as b}from"./runtime-BBYIQ0f-.js";import{C as x,O as S,d as C,f as te,l as ne,u as re}from"./entities-CWtNgawi.js";import{a as ie,t as ae}from"./useParams-jklHVL7l.js";import{f as w}from"./relay-Do9UB5iT.js";import{s as T}from"./useSettings-EYJbJzT3.js";import{n as oe}from"./server-Dkj4NeYG.js";import{p as E}from"./session-logic-DB_ei-pn.js";import{a as D,i as O,n as k,o as A}from"./threadSort-Bd2rijEy.js";import{c as j,r as M}from"./projectFilesQueryState-BdfD5cZ2.js";import{d as N,f as P,i as F,r as se,s as ce,t as I}from"./p4ProjectFile-5VDI-yAx.js";import{r as L,t as R}from"./uiStateStore-FYiLqqos.js";var z=e(t(),1),B=n(),V=`[data-thread-item], [data-thread-selection-safe]`,H=3,U=160;function W(e){let t=(0,B.c)(6),[n,r]=z.useState(null),[i,a]=z.useState(e),o,s;t[0]!==e||t[1]!==n?(o=()=>{if(e){a(!0);return}if(n===null)return;if(typeof IntersectionObserver>`u`){a(!0);return}let t=n.closest(`[data-slot="scroll-area-viewport"]`),r=new IntersectionObserver(e=>{let[t]=e;return a(t?.isIntersecting===!0)},{root:t,rootMargin:`${U}px 0px`});return r.observe(n),()=>r.disconnect()},s=[e,n],t[0]=e,t[1]=n,t[2]=o,t[3]=s):(o=t[2],s=t[3]),z.useEffect(o,s);let c=e||i,l;return t[4]===c?l=t[5]:(l={leaseLiveStatus:c,rowRef:r},t[4]=c,t[5]=l),l}function G(e,t){let n=z.useRef(null);return e!==null&&t!==null&&(n.current={key:e,value:t}),t===null?e!==null&&n.current?.key===e?n.current.value:null:t}function K(e,t,n,r){let i=e.indexOf(t),a=e.indexOf(n);return i===-1||a===-1?[]:e.slice(Math.min(i,a),Math.max(i,a)+1).filter(r)}async function q(e){let t=new Set,n=null;for(let r of e.entries){let i=await e.delete(r,t);if(i!==null){if(i._tag===`Failure`){if(_(i))break;n??=i}else t.add(r.threadKey)}}return{deletedThreadKeys:t,firstFailure:n}}async function J(e){let t=[],n=[];for(let r of e.entries){let i=!1,a=await e.archive(r,()=>{i=!0});if((i||a._tag===`Success`)&&t.push(r.threadKey),a._tag===`Success`)continue;let o=a;if(i)n.push(o);else return{archivedThreadKeys:t,mutationFailure:o,followupFailures:n}}return{archivedThreadKeys:t,mutationFailure:null,followupFailures:n}}function Y(e){return[{id:`mark-unread`,label:`Mark unread (${e.count})`},{id:`archive`,label:`Archive (${e.count})`,disabled:e.hasRunningThread},{id:`delete`,label:`Delete (${e.count})`,destructive:!0}]}function le(e,t,n){let r=v(e);return e.filter(e=>e.archivedAt===null&&!y({environmentId:e.environmentId,threadId:e.id},e.lineage,n)&&r(e)&&(t===null||t.has(`${e.environmentId}:${e.projectId}`)))}var ue={"Pending Approval":5,"Awaiting Input":4,Working:3,Connecting:3,Waiting:2.5,"Plan Ready":2,Completed:1};function de(e){let t=e.setTimeoutFn??globalThis.setTimeout,n=e.clearTimeoutFn??globalThis.clearTimeout,r=!1,i=null,a=()=>{i!==null&&(n(i),i=null)};return{sync:n=>{n?r||i!==null||(i=t(()=>{i=null,r=!0,e.onVisibilityChange(!0)},e.delayMs)):(a(),r&&(r=!1,e.onVisibilityChange(!1)))},dispose:()=>{a()}}}function fe(){let e=(0,B.c)(5),[t,n]=z.useState(!1),r=z.useRef(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=de({delayMs:200,onVisibilityChange:e=>{n(e)},setTimeoutFn:window.setTimeout.bind(window),clearTimeoutFn:window.clearTimeout.bind(window)});return r.current=e,()=>{e.dispose(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),z.useEffect(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{r.current?.sync(e)},e[2]=o):o=e[2];let s=o,c;return e[3]===t?c=e[4]:(c={showThreadJumpHints:t,updateThreadJumpHintsVisibility:s},e[3]=t,e[4]=c),c}function pe(e,t){return e===void 0?t:e??void 0}function me(e){if(!e.latestRun?.completedAt)return!1;let t=Date.parse(e.latestRun.completedAt);if(Number.isNaN(t)||!e.lastVisitedAt)return!1;let n=Date.parse(e.lastVisitedAt);return Number.isNaN(n)?!0:t>n}function he(e){return e===null||!e.closest(V)}function ge(e){return e>1}function _e(e,t){return e===null||!(`closest`in e)||typeof e.closest!=`function`?null:e.closest(t)}function ve(e){return typeof e!=`object`||!e?!1:_e(e,`a[href]`)!==null||_e(`parentElement`in e&&e.parentElement!==null&&typeof e.parentElement==`object`?e.parentElement:null,`a[href]`)!==null}function ye(e){let{getId:t,getPreferenceIds:n,items:r,preferredIds:i}=e;if(i.length===0)return[...r];let a=new Map;for(let[e,i]of r.entries()){let r=n?.(i)??[t(i)];for(let t of new Set(r)){let n=a.get(t);n?n.push(e):a.set(t,[e])}}let o=new Set,s=i.flatMap(e=>{let t=a.get(e)?.find(e=>!o.has(e));return t===void 0?[]:(o.add(t),[r[t]])}),c=r.filter((e,t)=>!o.has(t));return[...s,...c]}function be(e,t=H){return e.slice(0,Math.max(0,t))}function xe(e){let{currentThreadId:t,direction:n,threadIds:r}=e;if(r.length===0)return null;if(t===null)return n===`previous`?r.at(-1)??null:r[0]??null;let i=r.indexOf(t);return i===-1?null:n===`previous`?i>0?r[i-1]??null:null:i<r.length-1?r[i+1]??null:null}function Se(e){return e.button===2||e.isMac&&e.button===0&&e.ctrlKey}function Ce(e){return e.hasPendingApprovals||e.pendingSubagentRequest===`approval`?`approval`:e.hasPendingUserInput||e.pendingSubagentRequest===`user_input`?`input`:e.runtime!==null&&[`preparing`,`queued`,`starting`,`running`,`waiting`].includes(e.runtime.status)?`working`:e.runtime?.status===`idle`?`waiting`:e.runtime?.status===`failed`?e.runtime.lastErrorClass===`usage_limit`?`limited`:`failed`:`ready`}function we(e,t){let n=D(e,t),r=n.filter(e=>e.pinnedAt!=null);return r.length===0?n:[...O(r),...n.filter(e=>e.pinnedAt==null)]}function Te(e,t){let n=s(t);if(n.length===0)return!1;let r=s(g(e).join(` `));return n.split(` `).every(e=>r.includes(e))}function Ee(e){let{thread:t}=e;return t.hasPendingApprovals||t.pendingSubagentRequest===`approval`?{label:`Pending Approval`,colorClass:`text-amber-600 dark:text-amber-300/90`,dotClass:`bg-amber-500 dark:bg-amber-300/90`,pulse:!1}:t.hasPendingUserInput||t.pendingSubagentRequest===`user_input`?{label:`Awaiting Input`,colorClass:`text-indigo-600 dark:text-indigo-300/90`,dotClass:`bg-indigo-500 dark:bg-indigo-300/90`,pulse:!1}:t.runtime?.status===`running`||t.runtime?.status===`waiting`?{label:`Working`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:t.runtime?.status===`preparing`||t.runtime?.status===`starting`||t.runtime?.status===`queued`?{label:`Connecting`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:ee(t.pendingBackgroundTasks??[])?{label:`Waiting`,colorClass:`text-sidebar-muted-foreground`,dotClass:`bg-sidebar-muted-foreground`,pulse:!1}:!t.hasPendingUserInput&&t.interactionMode===`plan`&&E(t.latestRun,t.runtime)&&t.hasActionableProposedPlan?{label:`Plan Ready`,colorClass:`text-violet-600 dark:text-violet-300/90`,dotClass:`bg-violet-500 dark:bg-violet-300/90`,pulse:!1}:me(t)?{label:`Completed`,colorClass:`text-emerald-600 dark:text-emerald-300/90`,dotClass:`bg-emerald-500 dark:bg-emerald-300/90`,pulse:!1}:null}function De(e){let t=null;for(let n of e)n!==null&&(t===null||ue[n.label]>ue[t.label])&&(t=n);return t}function Oe(e,t){return t.projectExpanded?t.isThreadListExpanded||e.length<=t.previewCount?e:e.slice(0,t.previewCount):[]}function ke(e){let{deletedThreadId:t,deletedThreadIds:n,sortOrder:r,threads:i}=e,a=i.find(e=>e.id===t);return a?D(i.filter(e=>e.projectId===a.projectId&&e.id!==t&&!n?.has(e.id)),r)[0]?.id??null:null}function Ae(e,t,n){return t.length>0?t.reduce((e,t)=>Math.max(e,k(t,n)),-1/0):n===`created_at`?A(e.createdAt)??-1/0:A(e.updatedAt??e.createdAt)??-1/0}function X(e,t,n,r){return t===`manual`?[...e]:e.map(e=>({project:e,timestamp:Ae(e,n(e),t)})).sort((e,t)=>(t.timestamp===e.timestamp?0:t.timestamp>e.timestamp?1:-1)||r(e.project,t.project)).map(({project:e})=>e)}function je(e,t,n){let r=new Map;for(let e of t){let t=r.get(e.projectId)??[];t.push(e),r.set(e.projectId,t)}return X(e,n,e=>r.get(e.id)??[],(e,t)=>e.title.localeCompare(t.title)||e.id.localeCompare(t.id))}function Me(e,t,n){let r=new Map(e.flatMap(e=>e.memberProjectRefs.map(t=>[`${t.environmentId}\0${t.projectId}`,e.projectKey]))),i=new Map;for(let e of t){if(e.archivedAt!==null)continue;let t=r.get(`${e.environmentId}\0${e.projectId}`);if(!t)continue;let n=i.get(t);n?n.push(e):i.set(t,[e])}return X(e,n,e=>i.get(e.projectKey)??[],(e,t)=>e.title.localeCompare(t.title)||e.projectKey.localeCompare(t.projectKey))}function Ne(e,t,n,r){return Me(e,le(t,null,r),n)}function Pe(e,t,n){let r=(e,t)=>`${e}\u0000${t}`,i=new Map;for(let e of t){if(e.archivedAt!==null)continue;let t=r(e.environmentId,e.projectId),n=i.get(t)??[];n.push(e),i.set(t,n)}return X(e,n,e=>i.get(r(e.environmentId,e.id))??[],(e,t)=>e.title.localeCompare(t.title)||e.environmentId.localeCompare(t.environmentId)||e.id.localeCompare(t.id))}function Z(e){return e.envMode!==`local`&&e.newWorktreesStartFromOrigin}function Fe(e){return e.projectDefaultSelection??(e.carrySourceDraftId===e.destinationDraftId?null:e.carrySelection)}function Ie(e){let t=e?.activeProvider;return e?.modelSelectionExplicit===!0&&t!=null&&e.modelSelectionByProvider[t]!==void 0}function Le(e){return e.activeThread?p(e.activeThread.environmentId,e.activeThread.projectId):e.activeDraftThread?p(e.activeDraftThread.environmentId,e.activeDraftThread.projectId):e.defaultProjectRef}async function Re(e){let t=Le(e);return t?(await e.handleNewThread(t),!0):!1}async function ze(e,t){let n=await b(c,M(e,t,h),{reportDefect:!1,reportFailure:!1}),r=j(e,t,h,j(e,t,n._tag===`Success`?n.value.relativePath:h,n._tag===`Success`?n.value:null));return r===null||r.truncated?null:I(r.contents)}function Q(e){return{...e?.branch===void 0?{}:{branch:e.branch},...e?.worktreePath===void 0?{}:{worktreePath:e.worktreePath},...e?.envMode===void 0?{}:{envMode:e.envMode},...e?.startFromOrigin===void 0?{}:{startFromOrigin:e.startFromOrigin}}}function $(){let e=(0,B.c)(7),t=f(oe),n=T(P),s=ie(),c;e[0]===s.state.matches?c=e[1]:(c=()=>{let e=s.state.matches[s.state.matches.length-1]?.params??{};return w(e)},e[0]=s.state.matches,e[1]=c);let p=c,h;return e[2]!==t||e[3]!==p||e[4]!==n||e[5]!==s?(h=(e,c)=>{let f=re(),h=t.get(e.environmentId)?.settings??a,{getComposerDraft:g,getDraftSessionByLogicalProjectKey:_,getDraftSession:v,getDraftThread:ee,applyStickyState:y,setDraftThreadContext:b,setLogicalProjectDraftThreadId:x,setModelSelection:S}=i.getState(),ie=s.state.location.href,ae=()=>s.state.location.href!==ie,w=p(),T=w?.kind===`server`?C(w.threadRef):null,oe=w?.kind===`draft`?v(w.draftId):null,E=w?g(w.kind===`server`?w.threadRef:w.draftId):null,D=E?.activeProvider??null,O=(D?E?.modelSelectionByProvider[D]??null:null)??T?.modelSelection??null,k=E?.interactionMode??T?.interactionMode??oe?.interactionMode??null,A=f.find(t=>t.id===e.projectId&&t.environmentId===e.environmentId),j=()=>ae()||A!==void 0&&ne(e)===null,M=F(h,A?.id??null,A),N=M.settings.defaultModelSelection,P=M.settings.defaultRuntimeMode,I=e=>Fe({projectDefaultSelection:N??null,carrySelection:O,carrySourceDraftId:w?.kind===`draft`?w.draftId:null,destinationDraftId:e}),L=async()=>{let n=A!==void 0&&M.settings.defaultThreadEnvMode===null?await ze(A.environmentId,A.workspaceRoot):null;return se({projectSettings:F(h,A?.id??null,A,n),workspaceRoot:A?.workspaceRoot??null,newProjectsRoot:t.get(e.environmentId)?.newProjectsRoot,projectHasThreads:te().some(t=>t.environmentId===e.environmentId&&t.projectId===e.projectId)})},R=A?ce(A,n):o(e),z=c?.branch!==void 0,B=c?.worktreePath!==void 0,V=c?.envMode!==void 0,H=c?.startFromOrigin!==void 0,U=_(R),W=U?d(U.environmentId,U.threadId):null,G=U!==null&&U.promotedTo==null&&W!==null&&C(W)===null?U:null;W&&G===null&&r(W);let K=G&&!l(g(G.draftId))?G:null,q=w?w.kind===`server`?ee(w.threadRef):v(w.draftId):null;if(K)return(async()=>{let t=w?.kind===`draft`&&w.draftId===K.draftId,n=z||B||V||H,r=null;if(n)r=Q(c);else if(!t){let e=await L();if(j())return null;let t=p(),n=t?.kind===`draft`&&t.draftId===K.draftId,i=W!==null&&C(W)!==null,a=_(R)?.draftId!==K.draftId,o=l(g(K.draftId));if(n||i||a||o)return null;r={branch:null,worktreePath:null,envMode:e,startFromOrigin:Z({envMode:e,newWorktreesStartFromOrigin:M.settings.newWorktreesStartFromOrigin})}}if(r&&b(K.draftId,{...r,...t?{}:{runtimeMode:P},...k?{interactionMode:k}:{}}),!Ie(g(K.draftId))){y(K.draftId);let e=I(K.draftId);e&&S(K.draftId,e,{replaceOptions:!0})}x(R,e,K.draftId,{threadId:K.threadId,...r,...t?{}:{runtimeMode:P},...k?{interactionMode:k}:{}});let i={draftId:K.draftId,threadId:K.threadId},a=p();return a?.kind===`draft`&&a.draftId===K.draftId||await s.navigate({to:`/draft/$draftId`,params:{draftId:K.draftId},replace:c?.replace??!1}),i})();if(q&&w?.kind===`draft`&&q.logicalProjectKey===R&&q.promotedTo==null&&!l(g(w.draftId)))return(z||B||V||H)&&b(w.draftId,Q(c)),x(R,e,w.draftId,{threadId:q.threadId,createdAt:q.createdAt,runtimeMode:q.runtimeMode,interactionMode:q.interactionMode,...Q(c)}),Promise.resolve({draftId:w.draftId,threadId:q.threadId});let J=u(),Y=m(),le=new Date().toISOString();return(async()=>{let t=c?.envMode??await L();if(j())return null;let n=_(R);if(n&&n.draftId!==U?.draftId&&C(d(n.environmentId,n.threadId))===null)return x(R,e,n.draftId,{threadId:n.threadId,createdAt:n.createdAt,runtimeMode:n.runtimeMode,interactionMode:n.interactionMode,...Q(c)}),await s.navigate({to:`/draft/$draftId`,params:{draftId:n.draftId},replace:c?.replace??!1}),{draftId:n.draftId,threadId:n.threadId};x(R,e,J,{threadId:Y,createdAt:le,branch:c?.branch??null,worktreePath:c?.worktreePath??null,envMode:t,startFromOrigin:c?.startFromOrigin??Z({envMode:t,newWorktreesStartFromOrigin:M.settings.newWorktreesStartFromOrigin}),runtimeMode:P,...k?{interactionMode:k}:{}}),y(J);let r=I(J);return r&&S(J,r,{replaceOptions:!0}),await s.navigate({to:`/draft/$draftId`,params:{draftId:J},replace:c?.replace??!1}),{draftId:J,threadId:Y}})()},e[2]=t,e[3]=p,e[4]=n,e[5]=s,e[6]=h):h=e[6],h}function Be(){let e=(0,B.c)(16),t=L(We),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={strict:!1,select:Ue},e[0]=n):n=e[0];let r=ae(n),a=r?.kind===`server`?r.threadRef:null,o=r?.kind===`draft`?r.draftId:null,s=S(a),c=i(He),l;e[1]!==c||e[2]!==r?(l=()=>r?r.kind===`server`?c(r.threadRef):i.getState().getDraftSession(r.draftId):null,e[1]=c,e[2]=r,e[3]=l):l=e[3];let u=i(l),d=x(),f;e[4]!==t||e[5]!==d?(f=ye({items:d,preferredIds:t,getId:N,getPreferenceIds:Ve}),e[4]=t,e[5]=d,e[6]=f):f=e[6];let m=f,h=$(),g;e[7]===m[0]?g=e[8]:(g=m[0]?p(m[0].environmentId,m[0].id):null,e[7]=m[0],e[8]=g);let _;return e[9]!==u||e[10]!==s||e[11]!==h||e[12]!==o||e[13]!==a||e[14]!==g?(_={activeDraftThread:u,activeThread:s,defaultProjectRef:g,handleNewThread:h,routeDraftId:o,routeThreadRef:a},e[9]=u,e[10]=s,e[11]=h,e[12]=o,e[13]=a,e[14]=g,e[15]=_):_=e[15],_}function Ve(e){return[N(e),R(e.workspaceRoot)]}function He(e){return e.getDraftThread}function Ue(e){return w(e)}function We(e){return e.projectOrder}export{G as A,Ee as C,Pe as D,je as E,fe as M,Ne as O,pe as S,Me as T,xe as _,Le as a,K as b,Y as c,be as d,Se as f,Te as g,ye as h,Z as i,W as j,we as k,q as l,ge as m,$ as n,Re as o,ve as p,Ie as r,J as s,Be as t,ke as u,De as v,he as w,Ce as x,Oe as y};
|
|
2
|
+
//# sourceMappingURL=useHandleNewThread-C6MtV3AM.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{a as n,r,x as i}from"./useParams-
|
|
2
|
-
//# sourceMappingURL=useLocation-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{a as n,r,x as i}from"./useParams-jklHVL7l.js";var a=e(t(),1);function o(e){let t=n(),o=(0,a.useRef)(void 0);return r(t.stores.location,n=>{let r=e?.select?e.select(n):n;if(e?.structuralSharing??t.options.defaultStructuralSharing){let e=i(o.current,r);return o.current=e,e}return r})}export{o as t};
|
|
2
|
+
//# sourceMappingURL=useLocation-NTw9A5XQ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{a as n}from"./useParams-
|
|
2
|
-
//# sourceMappingURL=useNavigate-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{a as n}from"./useParams-jklHVL7l.js";var r=e(t(),1);function i(e){let t=n();return r.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}export{i as t};
|
|
2
|
+
//# sourceMappingURL=useNavigate-DV9bXnWr.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{a as r,r as i}from"./useParams-
|
|
2
|
-
//# sourceMappingURL=useNavigateBack-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{a as r,r as i}from"./useParams-jklHVL7l.js";import{t as a}from"./useNavigate-DV9bXnWr.js";function o(){let e=r();return i(e.stores.location,e=>e.state.__TSR_index!==0)}var s=n(),c=e(t(),1);function l(){let e=(0,s.c)(3),t=a(),n=o(),r;return e[0]!==n||e[1]!==t?(r=()=>{n?window.history.back():t({to:`/`})},e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function u(e){let t=(0,s.c)(3),n=l(),r=e??n,i,a;t[0]===r?(i=t[1],a=t[2]):(i=()=>{let e=e=>{if(e.defaultPrevented||e.repeat||e.isComposing||e.key!==`Escape`)return;e.preventDefault();let t=document.activeElement;t instanceof HTMLElement&&t.blur(),r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},a=[r],t[0]=r,t[1]=i,t[2]=a),(0,c.useEffect)(i,a)}export{u as t};
|
|
2
|
+
//# sourceMappingURL=useNavigateBack-D62rsj_4.js.map
|
package/dist/client/assets/{useP4ConnectAuthPrompt-D0Equ6mY.js → useP4ConnectAuthPrompt-Bj5GIxgy.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{t}from"./env-BfPir1X4.js";import{i as n}from"./dist-
|
|
2
|
-
//# sourceMappingURL=useP4ConnectAuthPrompt-
|
|
1
|
+
import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{t}from"./env-BfPir1X4.js";import{i as n}from"./dist-BuxsAlG0.js";import{t as r}from"./authRedirect-DWE5a_T9.js";var i=e();function a(){let e=(0,i.c)(2),a=n(),o;return e[0]===a?o=e[1]:(o={authPrompt:null,openAuthPrompt:()=>{a.openSignIn(r(window.location.href,t))}},e[0]=a,e[1]=o),o}export{a as t};
|
|
2
|
+
//# sourceMappingURL=useP4ConnectAuthPrompt-Bj5GIxgy.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{
|
|
2
|
-
//# sourceMappingURL=useParams-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{Mi as n}from"./utils-DjbLtxuo.js";function r(e){return e[e.length-1]}function i(e){return typeof e==`function`}function a(e,t){return i(e)?e(t):e}var o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;function c(e){for(let t in e)if(o.call(e,t))return!0;return!1}var l=()=>Object.create(null),u=(e,t)=>d(e,t,l);function d(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=h(e)&&h(i);if(!a&&!(p(e)&&p(i)))return i;let s=a?e:f(e);if(!s)return i;let c=a?i:f(i);if(!c)return i;let l=s.length,u=c.length,m=a?Array(u):n(),g=0;for(let t=0;t<u;t++){let s=a?t:c[t],u=e[s],f=i[s];if(u===f){m[s]=u,(a?t<l:o.call(e,s))&&g++;continue}if(u===null||f===null||typeof u!=`object`||typeof f!=`object`){m[s]=f;continue}let p=d(u,f,n,r+1);m[s]=p,p===u&&g++}return l===u&&g===l?e:m}function f(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!s.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!s.call(e,t))return!1;r.push(t)}return r}function p(e){if(!m(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!m(n)||!n.hasOwnProperty(`isPrototypeOf`))}function m(e){return Object.prototype.toString.call(e)===`[object Object]`}function h(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function g(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!g(e[r],t[r],n))return!1;return!0}if(p(e)&&p(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!g(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!g(e[o],t[o],n)))return!1;return i===a}return!1}function _(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function v(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function y(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function b(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function x(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return b(t)}var S=[`http:`,`https:`,`mailto:`,`tel:`];function C(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function w(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=x(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=x(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function T(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function E(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function D(){throw Error(`Invariant failed`)}var O=n(),k=e(t(),1),A=k.createContext(null);function j(e){return k.useContext(A)}var M=k.createContext(void 0),N=k.createContext(void 0);function P(e,t){return e===t}function F(e,t,n=P){let r=(0,k.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,k.useCallback)(()=>e?.get(),[e]);return(0,O.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var I={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function L(e){let t=j(),n=k.useContext(e.from?N:M),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=k.useRef(void 0);return F(i??I,n=>{if((e.shouldThrow??!0)&&!n&&D(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=d(a.current,r);return a.current=e,e}return r})}function R(e){return L({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}export{v as _,j as a,u as b,S as c,w as d,g as f,C as g,c as h,M as i,E as l,a as m,L as n,A as o,T as p,F as r,D as s,R as t,_ as u,y as v,d as x,r as y};
|
|
2
|
+
//# sourceMappingURL=useParams-jklHVL7l.js.map
|
package/dist/client/assets/{usePermissionStatus-CIobAIHF.js → usePermissionStatus-DaCu90iN.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{
|
|
2
|
-
//# sourceMappingURL=usePermissionStatus-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Xd as i,mr as a}from"./utils-DjbLtxuo.js";var o=n(),s=e(r(),1);function c(e){let t=(0,o.c)(7),{permissions:n,busy:r}=e,c=r!==void 0&&r,l;if(t[0]!==c||t[1]!==n){let e;t[3]===c?e=t[4]:(e=e=>(0,s.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border px-3 py-2`,children:[e.icon,(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,s.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,s.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]}),e.granted?(0,s.jsxs)(`span`,{role:`status`,className:`flex items-center gap-1 text-xs text-success`,children:[(0,s.jsx)(i,{className:`size-4`,"aria-hidden":`true`}),`Allowed`]}):(0,s.jsx)(a,{size:`xs`,variant:`outline`,disabled:c,onClick:e.onAllow,children:`Allow`})]},e.id),t[3]=c,t[4]=e),l=n.map(e),t[0]=c,t[1]=n,t[2]=l}else l=t[2];let u;return t[5]===l?u=t[6]:(u=(0,s.jsx)(`div`,{className:`space-y-2`,children:l}),t[5]=l,t[6]=u),u}function l(e){let t=(0,o.c)(9),n,r,i,c;t[0]===e?(n=t[1],r=t[2],i=t[3],c=t[4]):({ready:r,busy:i,children:c,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=c);let l=i!==void 0&&i,u=c===void 0?`Continue`:c,d=!r||l,f;return t[5]!==u||t[6]!==n||t[7]!==d?(f=(0,s.jsx)(a,{...n,disabled:d,children:u}),t[5]=u,t[6]=n,t[7]=d,t[8]=f):f=t[8],f}var u=e(t(),1);function d(e,t,n){let r=(0,o.c)(12),i=n===void 0||n,[a,s]=(0,u.useState)(t),[c,l]=(0,u.useState)(null),d=(0,u.useEffectEvent)(e),f;r[0]!==d||r[1]!==i?(f=()=>{if(!i)return;let e=!1,t=!1,n=async()=>{if(!(e||t||document.visibilityState===`hidden`)){t=!0;try{let t=await d();e||(s(t),l(null))}catch{e||l(`Could not check permissions. We'll try again automatically.`)}t=!1}};n();let r=window.setInterval(()=>void n(),1500);return window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,n),()=>{e=!0,window.clearInterval(r),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,n)}},r[0]=d,r[1]=i,r[2]=f):f=r[2];let p;r[3]===i?p=r[4]:(p=[i],r[3]=i,r[4]=p),(0,u.useEffect)(f,p);let m;r[5]!==c||r[6]!==a?(m=e=>c===null&&e.every(e=>a[e]),r[5]=c,r[6]=a,r[7]=m):m=r[7];let h;return r[8]!==c||r[9]!==a||r[10]!==m?(h={status:a,error:c,isReady:m},r[8]=c,r[9]=a,r[10]=m,r[11]=h):h=r[11],h}export{c as n,l as r,d as t};
|
|
2
|
+
//# sourceMappingURL=usePermissionStatus-DaCu90iN.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Aa as r,Br as i,Da as a,Ea as o,Ga as s,Ka as c,Mo as l,Wa as u,Ya as d,jo as f,oa as p,ua as m,zr as h}from"./utils-DjbLtxuo.js";import{t as g}from"./usePreviousValue-Dx4Nv0v8.js";var _=e(t()),v=e(a());function y(e){let t=c(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=d(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(p(n)!==a||p(r)!==o)&&(n=a,r=o),{width:n,height:r}}var b=()=>!0;function x(e){let{popupElement:t,positionerElement:n,content:i,mounted:a,enabled:c=b,onMeasureLayout:d,onMeasureLayoutComplete:p,side:m,direction:h}=e,g=o(t,!0,!1),v=r(),x=_.useRef(null),E=_.useRef(null),D=_.useRef(!0),O=_.useRef(l),k=s(d),A=s(p),j=_.useMemo(()=>{let e=m===`top`,t=m===`left`;return h===`rtl`?(e||=m===`inline-end`,t||=m===`inline-end`):(e||=m===`inline-start`,t||=m===`inline-start`),e?{position:`absolute`,[m===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:f},[m,h]);u(()=>{if(!a||!c()||typeof ResizeObserver!=`function`){O.current=l,D.current=!0,x.current=null,E.current=null;return}if(!t||!n)return;O.current=C(t,j);let e=new ResizeObserver(e=>{let t=e[0];t&&(E.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)})});e.observe(t),w(t,`auto`);let r=S(t,`position`,`static`),i=S(t,`transform`,`none`),o=S(t,`scale`,`1`),s=C(n,{"--available-width":`max-content`,"--available-height":`max-content`});function u(){r(),i(),s()}function d(){u(),o()}if(k?.(),D.current||x.current===null){T(n,`max-content`);let r=y(t);return x.current=r,T(n,r),d(),A?.(null,r),D.current=!1,()=>{e.disconnect(),O.current(),O.current=l}}w(t,`auto`),T(n,`max-content`);let f=x.current??E.current,p=y(t);if(x.current=p,!f)return T(n,p),d(),A?.(null,p),()=>{e.disconnect(),v.cancel(),O.current(),O.current=l};w(t,f),d(),A?.(f,p),T(n,p);let m=new AbortController;return v.request(()=>{w(t,p),g(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},m.signal)}),()=>{e.disconnect(),m.abort(),v.cancel(),O.current(),O.current=l}},[i,t,n,g,v,c,a,k,A,j])}function S(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function C(e,t){let n=[];for(let[r,i]of Object.entries(t))n.push(S(e,r,i));return n.length?()=>{n.forEach(e=>e())}:l}function w(e,t){let n=t===`auto`?`auto`:`${t.width}px`,r=t===`auto`?`auto`:`${t.height}px`;e.style.setProperty(`--popup-width`,n),e.style.setProperty(`--popup-height`,r)}function T(e,t){let n=t===`max-content`?`max-content`:`${t.width}px`,r=t===`max-content`?`max-content`:`${t.height}px`;e.style.setProperty(`--positioner-width`,n),e.style.setProperty(`--positioner-height`,r)}var E=e(n());function D(e){let{store:t,side:n,cssVars:a,children:c}=e,l=h(),d=t.useState(`activeTriggerElement`),f=t.useState(`activeTriggerId`),p=t.useState(`open`),y=t.useState(`payload`),b=t.useState(`mounted`),S=t.useState(`popupElement`),C=t.useState(`positionerElement`),w=g(p?d:null),T=j(f,y),D=_.useRef(null),[k,M]=_.useState(null),[N,P]=_.useState(null),F=_.useRef(null),I=_.useRef(null),L=o(F,!0,!1),R=r(),[z,B]=_.useState(null),[V,H]=_.useState(!1);u(()=>(t.set(`hasViewport`,!0),()=>{t.set(`hasViewport`,!1)}),[t]);let U=s(()=>{F.current?.style.setProperty(`animation`,`none`),F.current?.style.setProperty(`transition`,`none`),I.current?.style.setProperty(`display`,`none`)}),W=s(e=>{F.current?.style.removeProperty(`animation`),F.current?.style.removeProperty(`transition`),I.current?.style.removeProperty(`display`),e&&B(e)}),G=_.useRef(null);u(()=>{if(d&&w&&d!==w&&G.current!==d&&D.current){M(D.current),H(!0);let e=A(w,d);P(e),R.request(()=>{v.flushSync(()=>{H(!1)}),L(()=>{M(null),B(null),D.current=null})}),G.current=d}},[d,w,k,L,R]),u(()=>{let e=F.current;if(!e)return;let t=m(e).createElement(`div`);for(let n of Array.from(e.childNodes))t.appendChild(n.cloneNode(!0));D.current=t});let K=k!=null,q;q=K?(0,E.jsxs)(_.Fragment,{children:[(0,E.jsx)(`div`,{"data-previous":!0,inert:i(!0),ref:I,style:{...z?{[a.popupWidth]:`${z.width}px`,[a.popupHeight]:`${z.height}px`}:null,position:`absolute`},"data-ending-style":V?void 0:``},`previous`),(0,E.jsx)(`div`,{"data-current":!0,ref:F,"data-starting-style":V?``:void 0,children:c},T)]}):(0,E.jsx)(`div`,{"data-current":!0,ref:F,children:c},T),u(()=>{let e=I.current;e&&k&&e.replaceChildren(...Array.from(k.childNodes))},[k]),x({popupElement:S,positionerElement:C,mounted:b,content:y,onMeasureLayout:U,onMeasureLayoutComplete:W,side:n,direction:l});let J={activationDirection:O(N),transitioning:K};return{children:q,state:J}}function O(e){if(e)return`${k(e.horizontal,5,`right`,`left`)} ${k(e.vertical,5,`down`,`up`)}`}function k(e,t,n,r){return e>t?n:e<-t?r:``}function A(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:n.left+n.width/2,y:n.top+n.height/2},a={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:a.x-i.x,vertical:a.y-i.y}}function j(e,t){let[n,r]=_.useState(0),i=_.useRef(e),a=_.useRef(t),o=_.useRef(!1);return u(()=>{let n=i.current,s=a.current,c=e!==n,l=t!==s;c?(r(e=>e+1),o.current=!l):o.current&&l&&(r(e=>e+1),o.current=!1),i.current=e,a.current=t},[e,t]),`${e??`current`}-${n}`}export{D as t};
|
|
2
|
+
//# sourceMappingURL=usePopupViewport-D1lXH2SQ.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{D as r,Es as i,Ev as a,OE as o,Ps as s,aT as c,el as l,es as u,is as d,js as f,mv as p,rc as m,xv as h}from"./utils-DjbLtxuo.js";import{Tr as g,hr as _,mr as v,t as y}from"./runtime-BBYIQ0f-.js";import{a as b,i as ee}from"./vcsRefInvalidation-DkXoQApH.js";import{C as te}from"./entities-CWtNgawi.js";import{a as x}from"./relay-Do9UB5iT.js";import{f as S,k as C,s as w}from"./useSettings-EYJbJzT3.js";import{i as T,n as E}from"./session-CBEVNHld.js";import{n as D}from"./query-D3KVoW9G.js";import{t as O}from"./use-atom-command-BbFDhw_c.js";import{d as k,l as A,u as j}from"./queries-Cl508kPw.js";import{t as M}from"./sourceControl-De64nxc-.js";import{C as N,r as P}from"./pullRequests-Cf9E2kW-.js";import{R as F,b as ne,y as re}from"./pullRequestDetail.logic-kOhR5jr9.js";import{n as ie}from"./useHandleNewThread-C6MtV3AM.js";import{c as ae,f as I,i as L,s as R}from"./p4ProjectFile-5VDI-yAx.js";import{t as z}from"./sidebarProjectGrouping-Cy06FqQF.js";var B=e(t(),1),V=n();function H(e){return{pullRequestResolution:_(e,{label:`environment-data:git:resolve-pull-request`,tag:l.gitResolvePullRequest}),preparePullRequestThread:v(e,{label:`environment-data:git:prepare-pull-request-thread`,tag:l.gitPreparePullRequestThread,scheduler:b,concurrency:ee})}}var U=H(y),W={init:`init`,pull:`pull`,publishRepository:`publish_repository`,runStackedAction:`run_change_request`,preparePullRequestThread:`prepare_pull_request_thread`};function G(e){let t=T(e.scope.environmentId,h),n=W[e.kind],r=d(A.stateAtom(e.scope)),o=r.operation===n,s=(0,B.useCallback)(()=>{A.resetError(u,e.scope,n)},[e.scope,n]),l=(0,B.useCallback)(async(...t)=>{if(e.scope.environmentId===null||!E(e.scope.environmentId,`source-control:write`))return i(c(new a({requiredScope:h,message:`This connection cannot change source control.`})));let r=async()=>{let n=await e.action(...t);return f(n)&&e.onSuccess?.(),n};return e.managedExternally===!0?r():A.track(u,e.scope,{operation:n,label:e.label},r)},[e.action,e.label,e.managedExternally,e.onSuccess,e.scope,n]);return{isAllowed:t,error:o?r.error:null,isPending:o&&r.isRunning,resetError:s,run:l}}function K(e){return e.environmentId===null||e.cwd===null?null:{environmentId:e.environmentId,cwd:e.cwd}}function q(e,t){let n=(0,V.c)(6),r;n[0]===e?r=n[1]:(r=A.stateAtom(e),n[0]=e,n[1]=r);let i=d(r),a;return n[2]!==t||n[3]!==i.isRunning||n[4]!==i.operation?(a=i.isRunning&&i.operation!==null&&t.some(e=>W[e]===i.operation),n[2]=t,n[3]=i.isRunning,n[4]=i.operation,n[5]=a):a=n[5],a}function J(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.init,n),a;t[1]!==r||t[2]!==e?(a=async()=>{let t=K(e);return t===null?i(c(new k({operation:`init`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[1]=r,t[2]=e,t[3]=a):a=t[3];let o=a,s;return t[4]!==o||t[5]!==e?(s={kind:`init`,label:`Initializing repository`,scope:e,action:o},t[4]=o,t[5]=e,t[6]=s):s=t[6],G(s)}function oe(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.pull,n),a;t[1]!==e.cwd||t[2]!==e.environmentId?(a=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=a):a=t[3];let o=D(a),s;t[4]!==r||t[5]!==e?(s=async()=>{let t=K(e);return t===null?i(c(new k({operation:`pull`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[4]=r,t[5]=e,t[6]=s):s=t[6];let l=s,u;return t[7]!==l||t[8]!==e||t[9]!==o.refresh?(u={kind:`pull`,label:`Pulling latest changes...`,scope:e,action:l,onSuccess:o.refresh},t[7]=l,t[8]=e,t[9]=o.refresh,t[10]=u):u=t[10],G(u)}function se(e){let t=(0,V.c)(13),n;t[0]===e?n=t[1]:(n=A.runStackedAction(e),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={reportFailure:!1},t[2]=r):r=t[2];let a=O(n,r),o;t[3]!==e.cwd||t[4]!==e.environmentId?(o=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[3]=e.cwd,t[4]=e.environmentId,t[5]=o):o=t[5];let s=D(o),l;t[6]!==a||t[7]!==e?(l=async t=>K(e)===null?i(c(new k({operation:`run_change_request`,environmentId:e.environmentId,cwd:e.cwd}))):a(t),t[6]=a,t[7]=e,t[8]=l):l=t[8];let u=l,d;return t[9]!==u||t[10]!==e||t[11]!==s.refresh?(d={kind:`runStackedAction`,label:`Running source control action`,scope:e,action:u,onSuccess:s.refresh,managedExternally:!0},t[9]=u,t[10]=e,t[11]=s.refresh,t[12]=d):d=t[12],G(d)}function ce(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(M.publishRepository,n),a;t[1]!==e.cwd||t[2]!==e.environmentId?(a=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=a):a=t[3];let o=D(a),s;t[4]!==r||t[5]!==e?(s=async t=>{let n=K(e);return n===null?i(c(new k({operation:`publish_repository`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,...t}})},t[4]=r,t[5]=e,t[6]=s):s=t[6];let l=s,u;return t[7]!==l||t[8]!==e||t[9]!==o.refresh?(u={kind:`publishRepository`,label:`Publishing repository`,scope:e,action:l,onSuccess:o.refresh},t[7]=l,t[8]=e,t[9]=o.refresh,t[10]=u):u=t[10],G(u)}function Y(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(U.preparePullRequestThread,n),o;t[1]!==r||t[2]!==e?(o=async t=>{let n=K(e);return n===null?i(c(new k({operation:`prepare_pull_request_thread`,environmentId:e.environmentId,cwd:e.cwd}))):t.mode===`worktree`&&t.threadId!==void 0&&!E(n.environmentId,`orchestration:operate`)?i(c(new a({requiredScope:p,message:`This connection cannot change threads.`}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,reference:t.reference,mode:t.mode,...t.threadId?{threadId:t.threadId}:{}}})},t[1]=r,t[2]=e,t[3]=o):o=t[3];let s=o,l;return t[4]!==s||t[5]!==e?(l={kind:`preparePullRequestThread`,label:`Preparing pull request thread`,scope:e,action:s},t[4]=s,t[5]=e,t[6]=l):l=t[6],G(l)}function X(e){return e.environmentId===null||e.cwd===null||e.reference===null?null:o(s(u.get(U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}))))}function le(e){let t=(0,V.c)(12),n;t[0]!==e.cwd||t[1]!==e.environmentId||t[2]!==e.reference?(n=e.environmentId!==null&&e.cwd!==null&&e.reference!==null?U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}):null,t[0]=e.cwd,t[1]=e.environmentId,t[2]=e.reference,t[3]=n):n=t[3];let r=D(n),i;t[4]===e?i=t[5]:(i=X(e),t[4]=e,t[5]=i);let a=i,o=r.data??a,s=r.isPending&&a===null,c;return t[6]!==r.error||t[7]!==r.isPending||t[8]!==r.refresh||t[9]!==o||t[10]!==s?(c={data:o,error:r.error,isPending:s,isFetching:r.isPending,refresh:r.refresh},t[6]=r.error,t[7]=r.isPending,t[8]=r.refresh,t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function ue(e,t){let n=(0,V.c)(10),r;n[0]===t?r=n[1]:(r=e=>L(e,t).settings.pullRequestMergeMethod,n[0]=t,n[1]=r);let i=S(e,r),a=w(de),o=w(I),s=te(),c=C(),l;return n[2]!==e||n[3]!==o||n[4]!==a||n[5]!==c||n[6]!==i||n[7]!==t||n[8]!==s?(l=()=>{if(i!=null)return i;if(Object.keys(a).length===0)return;let n=s.find(n=>n.environmentId===e&&n.id===t);if(!n)return;let r=z({projects:s,settings:o,primaryEnvironmentId:c}).get(ae(n))??R(n,o);return a[r]},n[2]=e,n[3]=o,n[4]=a,n[5]=c,n[6]=i,n[7]=t,n[8]=s,n[9]=l):l=n[9],l}function de(e){return e.pullRequestMergeMethodOverrides}var fe={merge:`Merge requested`,ready:`Marked ready for review`,draft:`Converted to draft`,close:`Pull request closed`,reopen:`Pull request reopened`,"update-branch":`Branch updated with the base branch`,"enable-auto-merge":`Auto-merge enabled`,"disable-auto-merge":`Auto-merge disabled`,revert:`Revert pull request opened`,"delete-branch":`Branch deleted`,"approve-workflows":`Workflows approved`},pe={merge:`Could not merge this pull request`,ready:`Could not mark this ready for review`,draft:`Could not convert this to a draft`,close:`Could not close this pull request`,reopen:`Could not reopen this pull request`,"update-branch":`Could not update this branch`,"enable-auto-merge":`Could not enable auto-merge`,"disable-auto-merge":`Could not disable auto-merge`,revert:`Could not open a revert pull request`,"delete-branch":`Could not delete this branch`,"approve-workflows":`Could not approve workflows`},Z={merge:`The host refused the merge. Check that you have write access, that the checks it requires have passed, and that the branch is not conflicting.`,ready:`The host refused it. Check that you have write access to this repository.`,draft:`The host refused it. Check that you have write access to this repository.`,close:`The host refused it. Check that you have write access, or that you opened it.`,reopen:`The host refused it. Check that you have write access, and that the branch still exists.`,"update-branch":`The host refused it. Check that you have write access, and that the base branch has not diverged in a way the host cannot merge.`,"enable-auto-merge":`The host refused it. Check that auto-merge is enabled for this repository and that you have write access.`,"disable-auto-merge":`The host refused it. Check that you have write access to this repository.`,revert:`The host refused it. Check that you have write access and that this pull request was merged on the host.`,"delete-branch":`The host refused it. Check that you have write access to the source repository and that the branch has not moved since this page loaded.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`};function me({environmentId:e,reference:t,onSuccess:n,resolveMergeMethod:r}){let i=O(P.runAction,{reportFailure:!1}),[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(!1);return{actionPending:a,perform:async(a,c)=>{if(!(s.current||t===null)){s.current=!0,o(!0);try{let o=await i({environmentId:e,input:{...t,action:a,...c?{mergeMethod:c}:r?{resolveMergeMethod:r}:{}}});if(o._tag===`Failure`)throw g(o);x.add({type:`success`,title:fe[a]}),n?.(a)}catch(e){x.add({type:`error`,title:pe[a],description:F(e,Z[a])})}finally{s.current=!1,o(!1)}}}}}function Q(e){let t=O(P.runAction,{reportFailure:!1}),n=(0,B.useRef)(new Set),[r,i]=(0,B.useState)(()=>new Set);return{close:(0,B.useCallback)(async r=>{let a=r.filter(e=>{let t=N(e);return e.state!==`open`||n.current.has(t)?!1:(n.current.add(t),!0)});if(a.length===0)return;i(new Set(n.current));let o=0,s=[];await Promise.all(a.map(async r=>{try{let n=await t({environmentId:r.environmentId,input:{projectId:r.projectId,host:r.host,repository:r.repository,number:r.number,action:`close`}});if(n._tag===`Failure`)throw g(n);o++,e(r)}catch(e){s.push(`#${r.number}: ${F(e,Z.close)}`)}finally{n.current.delete(N(r)),i(new Set(n.current))}})),x.add({type:s.length>0?`error`:`success`,title:s.length>0?`Closed ${o} of ${a.length} pull requests`:`Closed ${o} pull request${o===1?``:`s`}`,...s.length>0?{description:s.slice(0,3).join(`
|
|
2
|
+
`)}:{}})},[e,t]),closingKeys:r}}var $=new Map;function he(e){let t=(0,V.c)(21),{environmentId:n,detail:i}=e,a=ie(),o=i?.workspaceRoot??null,s;t[0]!==n||t[1]!==o?(s={environmentId:n,cwd:o},t[0]=n,t[1]=o,t[2]=s):s=t[2];let c=Y(s),[l,u]=(0,B.useState)(null),d;t[3]===a?d=t[4]:(d=async(e,t,n)=>{let i=n??await a(e).then(xe,be);if(i===null)return null;let o=r.getState();if(t===null)return i;let s=o.getComposerDraft(i.draftId),c=s?.reviewComments??[],l=re({prompt:s?.prompt??``,lastHandoffPrompt:$.get(i.draftId)},t.prompt);return $.set(i.draftId,t.prompt),o.setPrompt(i.draftId,l),o.setReviewComments(i.draftId,ne(c,t.reviewComments??[])),i},t[3]=a,t[4]=d);let f=d,p;t[5]!==i||t[6]!==n||t[7]!==l||t[8]!==f?(p=async(e,t)=>{if(!i||l!==null)return;u(e);let r=m(n,i.projectId),a=await f(r,t);u(null),a===null?x.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`}):x.add({type:`success`,title:`Asked in a thread`,description:t.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`})},t[5]=i,t[6]=n,t[7]=l,t[8]=f,t[9]=p):p=t[9];let h=p,g;t[10]!==i||t[11]!==n||t[12]!==l||t[13]!==a||t[14]!==f||t[15]!==c?(g=async(e,t,r)=>{let o=r===void 0?`worktree`:r;if(!i||l!==null)return;u(e);let s=x.add({type:`loading`,title:`Preparing the pull request checkout...`}),d=m(n,i.projectId),p=await a(d).then(ye,ve);if(p===null){u(null),x.update(s,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let h=await c.run({reference:i.url,mode:o,threadId:p.threadId});if(h._tag===`Failure`){u(null);let e=c.error instanceof Error?c.error.message:null;x.update(s,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await a(d,{branch:h.value.branch,worktreePath:h.value.worktreePath,envMode:h.value.worktreePath===null?`local`:`worktree`}).then(_e,ge)){u(null),x.update(s,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${h.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}u(null);let g={type:`warning`,title:`Checked out, but not on the latest commits`,description:`The checkout could not be moved onto the pull request's latest commits, so the code there is older than the pull request. Uncommitted work or local commits keep it where it is.`};t===null?x.update(s,h.value.isOnPullRequestHead?{type:`success`,title:o===`local`?`Checked out here`:`Checked out`,description:o===`local`?`This repository is on the pull request's branch, with a thread open on it.`:`The pull request is in its own worktree, with a thread open on it.`}:g):(await f(d,t,p),x.update(s,h.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:g))},t[10]=i,t[11]=n,t[12]=l,t[13]=a,t[14]=f,t[15]=c,t[16]=g):g=t[16];let _=g,v;return t[17]!==l||t[18]!==h||t[19]!==_?(v={handoff:l,startAsk:h,startHandoff:_},t[17]=l,t[18]=h,t[19]=_,t[20]=v):v=t[20],v}function ge(){return!1}function _e(e){return e!==null}function ve(){return null}function ye(e){return e}function be(){return null}function xe(e){return e}export{X as a,le as c,J as d,oe as f,he as i,q as l,Q as n,se as o,ue as r,Y as s,me as t,ce as u};
|
|
3
|
+
//# sourceMappingURL=usePullRequestActions-WFmep5Tm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{Un as n,Wa as r}from"./utils-DjbLtxuo.js";var i=e(t());function a(e,t,a,o,s=!0){let{registerFieldControl:c}=n(),l=i.useRef(null);l.current||=Symbol(),r(()=>{let n=l.current;if(n&&s)return c(n,{controlRef:e,getValue:o,id:t,value:a}),()=>{c(n,void 0)}},[e,s,o,t,c,a])}export{a as t};
|
|
2
|
+
//# sourceMappingURL=useRegisterFieldControl-BtJcyaxh.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{
|
|
2
|
-
//# sourceMappingURL=useScopedModelAvailability-
|
|
1
|
+
import{n as e}from"./jsx-runtime-DJeoFXNw.js";import{Ft as t,Ut as n,Wt as r}from"./utils-DjbLtxuo.js";import{D as i,i as a}from"./useSettings-EYJbJzT3.js";import{V as o}from"./settingsLayout-BbEwQ6Fy.js";var s=e();function c(e,c){let l=(0,s.c)(5),{targets:u}=o(),{environments:d}=i(),f;return l[0]!==c||l[1]!==d||l[2]!==e||l[3]!==u?(f=(i,o)=>{let s=c.find(e=>e.instanceId===i);for(let c of u){let l=d.find(e=>e.environmentId===c.environmentId),u=l?.serverConfig;if(!u)continue;let f=n(r(u.providers),c.settings,c.projectId).find(e=>e.instanceId===i),p=t(a(c.settings,e),u.providers).get(i);if(!f?.enabled||!f.isAvailable||f.driverKind!==s?.driverKind||!p?.some(e=>e.slug===o&&!e.isUnavailable))return`This model is unavailable on ${l?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},l[0]=c,l[1]=d,l[2]=e,l[3]=u,l[4]=f):f=l[4],f}export{c as t};
|
|
2
|
+
//# sourceMappingURL=useScopedModelAvailability-hsJL85Tg.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{$_ as r,A_ as i,Ab as a,Ah as o,Bh as s,Cx as c,DE as l,Eb as u,Ex as d,Fb as f,Fs as ee,HT as p,Hb as te,Il as ne,JS as re,Jb as ie,Lb as ae,Ll as oe,Ls as se,ME as ce,M_ as le,Nh as ue,OE as m,Ph as de,Ps as fe,Rh as pe,Sx as me,Tx as he,Vh as ge,WT as h,Wb as _e,Wc as ve,Xs as ye,Yb as be,Zh as xe,as as Se,bv as Ce,bx as we,cg as Te,dg as Ee,es as De,ev as Oe,fx as ke,ig as Ae,is as g,js as je,kv as Me,nx as Ne,pb as Pe,px as Fe,qT as _,qh as Ie,ss as Le,tv as Re,ug as ze,us as v,vb as Be,ys as Ve,zl as He}from"./utils-DjbLtxuo.js";import{Jt as Ue,Kr as We,Qt as Ge,T as Ke,Tr as qe,Vr as y,br as Je,ci as Ye}from"./runtime-BBYIQ0f-.js";import{a as b,t as Xe}from"./relay-Do9UB5iT.js";import{f as x,h as S,m as Ze,u as Qe}from"./server-Dkj4NeYG.js";import{i as $e,n as et,s as tt,t as nt}from"./session-CBEVNHld.js";import{t as rt}from"./use-atom-command-BbFDhw_c.js";import{B as it,C as at,F as ot,N as st,O as ct,P as lt,S as ut,V as dt,_ as ft,b as pt,c as mt,i as C,n as w,o as ht,r as gt,y as _t}from"./themePalette-1UQmJk98.js";var T=e(t(),1),E=n();function vt(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function yt(e){let t=Le(t=>v(n=>{let r=n(e.catalogValueAtom).entries.get(t);if(r===void 0)return null;let i=l(fe(n(e.stateAtom(t))),()=>Ye);return{entry:r,connection:r.unsupportedReason===void 0?i===Ye&&r.enabled?{phase:`connecting`,error:null,traceId:null}:Ge(i):{phase:`unsupported`,error:r.unsupportedReason,traceId:null},serverConfig:n(e.serverConfigValueAtom(t))}}).pipe(Ve(`environment-presentation:${t}`))),n=new Map;return{presentationAtom:t,presentationsAtom:v(r=>{let i=new Map;for(let n of r(e.catalogValueAtom).entries.keys()){let e=r(t(n));e!==null&&i.set(n,e)}return vt(n,i)||(n=i),n}).pipe(Ve(`environment-presentations`))}}function bt(e,t){return{environmentId:e,environmentLabel:t.entry.target.label,displayUrl:Ue(t.entry)??``,isRelayManaged:We(t.entry),isEnabled:t.entry.enabled,connectionState:t.connection.phase,connectionError:t.connection.error,connectionErrorTraceId:t.connection.traceId}}function xt(e){let t=v(t=>{let n=[...t(e.catalogValueAtom).entries.keys()],r=m(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),n=v(t=>{let n=[...t(e.catalogValueAtom).entries].map(([e,t])=>({environmentId:e,label:t.target.label})),r=m(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e.environmentId===r[t]?.environmentId&&e.label===r[t]?.label)?r:n}),r=Le(t=>v(n=>{let r=n(e.presentationAtom(t));if(r===null)return null;let i=bt(t,r),a=m(n.self());return a!==null&&a.environmentId===i.environmentId&&a.environmentLabel===i.environmentLabel&&a.displayUrl===i.displayUrl&&a.isRelayManaged===i.isRelayManaged&&a.isEnabled===i.isEnabled&&a.connectionState===i.connectionState&&a.connectionError===i.connectionError&&a.connectionErrorTraceId===i.connectionErrorTraceId?a:i})),i=v(t=>{let n=[];for(let i of t(e.catalogValueAtom).entries.keys()){let e=t(r(i));e!==null&&n.push(e)}let i=m(t.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}).pipe(Ve(`environment-connection-summaries`));return{environmentIdsAtom:t,connectedEnvironmentIdsAtom:v(e=>{let n=e(t).filter(t=>e(r(t))?.connectionState===`connected`),i=m(e.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}),identitiesAtom:n,environmentsAtom:i,machineByIdAtom:v(n=>{let r=new Map(n(t).map(t=>[t,He(n(e.presentationAtom(t))?.serverConfig??null)])),i=m(n.self());return i!==null&&vt(i,r)?i:r}),pullRequestsSupportedAtom:v(n=>n(t).some(t=>n(e.presentationAtom(t))?.serverConfig?.environment.capabilities.pullRequests===!0))}}var St=yt({catalogValueAtom:S.catalogValueAtom,stateAtom:S.stateAtom,serverConfigValueAtom:x.configValueAtom}),D=xt({catalogValueAtom:S.catalogValueAtom,presentationAtom:St.presentationAtom}),Ct=v(null).pipe(Ve(`web-environment-presentation:empty`));function wt(e){let t=(0,E.c)(5),n=g(S.catalogValueAtom),r;t[0]===e?r=t[1]:(r=e===null?Ct:St.presentationAtom(e),t[0]=e,t[1]=r);let i=g(r),a;return t[2]!==n.isReady||t[3]!==i?(a={isReady:n.isReady,presentation:i},t[2]=n.isReady,t[3]=i,t[4]=a):a=t[4],a}var Tt={status:`idle`},O=Tt,k=null,A=[],j=0,Et=new Set;function M(e){O=e;for(let e of Et)e()}function Dt(e){k?.resolve(e);for(let t of A)t.resolve(e);k=null,A=[]}function Ot(){return O}function kt(e){return Et.add(e),()=>{Et.delete(e)}}function At(){j+=1;let e=!0;return()=>{e&&(e=!1,j=Math.max(0,j-1),j===0&&(Dt(!1),M(Tt)))}}function jt(e,t){if(j!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};k||O.status===`closing`?A.push(r):(k=r,M({status:`confirming`,message:e,variant:r.variant}))})}function Mt(){return O.status!==`idle`||k!==null||A.length>0}function Nt(e){if(O.status!==`confirming`||!k)return;let t=k;k=null,t.resolve(e),M({status:`closing`,message:O.message,variant:O.variant})}function Pt(){if(O.status!==`closing`)return;let e=A.shift();e?(k=e,M({status:`confirming`,message:e.message,variant:e.variant})):M(Tt)}var Ft={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function It(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return ve(t)?`${n.map(e=>Ft[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var Lt=`http://www.w3.org/2000/svg`,Rt={archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],check:[{tag:`path`,attrs:{d:`M20 6 9 17l-5-5`}}],timer:[{tag:`line`,attrs:{x1:`10`,x2:`14`,y1:`2`,y2:`2`}},{tag:`line`,attrs:{x1:`12`,x2:`15`,y1:`14`,y2:`11`}},{tag:`circle`,attrs:{cx:`12`,cy:`14`,r:`8`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 19 7-7-7-7`}}],"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m9 12 2 2 4-4`}}],clock:[{tag:`path`,attrs:{d:`M12 6v6l4 2`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],folder:[{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"eye-off":[{tag:`path`,attrs:{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}},{tag:`path`,attrs:{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}},{tag:`path`,attrs:{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}},{tag:`path`,attrs:{d:`m2 2 20 20`}}],"app-window":[{tag:`rect`,attrs:{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}},{tag:`path`,attrs:{d:`M10 4v4`}},{tag:`path`,attrs:{d:`M2 8h20`}},{tag:`path`,attrs:{d:`M6 4v4`}}],"arrow-up-right":[{tag:`path`,attrs:{d:`M7 7h10v10`}},{tag:`path`,attrs:{d:`M7 17 17 7`}}],"external-link":[{tag:`path`,attrs:{d:`M15 3h6v6`}},{tag:`path`,attrs:{d:`M10 14 21 3`}},{tag:`path`,attrs:{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],list:[{tag:`path`,attrs:{d:`M3 5h.01`}},{tag:`path`,attrs:{d:`M3 12h.01`}},{tag:`path`,attrs:{d:`M3 19h.01`}},{tag:`path`,attrs:{d:`M8 5h13`}},{tag:`path`,attrs:{d:`M8 12h13`}},{tag:`path`,attrs:{d:`M8 19h13`}}],share:[{tag:`path`,attrs:{d:`M12 2v13`}},{tag:`path`,attrs:{d:`m16 6-4-4-4 4`}},{tag:`path`,attrs:{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`}}],x:[{tag:`path`,attrs:{d:`M18 6 6 18`}},{tag:`path`,attrs:{d:`m6 6 12 12`}}],hash:[{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`9`,y2:`9`}},{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`15`,y2:`15`}},{tag:`line`,attrs:{x1:`10`,x2:`8`,y1:`3`,y2:`21`}},{tag:`line`,attrs:{x1:`16`,x2:`14`,y1:`3`,y2:`21`}}],"mail-open":[{tag:`path`,attrs:{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`}},{tag:`path`,attrs:{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`}}],"message-square":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 8v6`}},{tag:`path`,attrs:{d:`M9 11h6`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],"pin-off":[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}},{tag:`path`,attrs:{d:`m2 2 20 20`}},{tag:`path`,attrs:{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}}],"refresh-cw":[{tag:`path`,attrs:{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}},{tag:`path`,attrs:{d:`M21 3v5h-5`}},{tag:`path`,attrs:{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}},{tag:`path`,attrs:{d:`M8 16H3v5`}}],settings:[{tag:`path`,attrs:{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"folder-plus":[{tag:`path`,attrs:{d:`M12 10v6`}},{tag:`path`,attrs:{d:`M9 13h6`}},{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],"text-search":[{tag:`path`,attrs:{d:`M21 5H3`}},{tag:`path`,attrs:{d:`M10 12H3`}},{tag:`path`,attrs:{d:`M10 19H3`}},{tag:`circle`,attrs:{cx:`17`,cy:`15`,r:`3`}},{tag:`path`,attrs:{d:`m21 19-1.9-1.9`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}]};function zt(e,t){let n=Rt[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(Lt,`svg`);r.setAttribute(`xmlns`,Lt),r.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,`2`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`class`,t===`destructive`?`size-4.5 shrink-0 sm:size-4`:`size-4.5 shrink-0 text-muted-foreground sm:size-4`);for(let e of n){let t=document.createElementNS(Lt,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Bt(e,t,n){let r=e.getBoundingClientRect(),i=Math.min(Math.max(4,t),Math.max(4,window.innerWidth-r.width-4)),a=Math.min(Math.max(4,n),Math.max(4,window.innerHeight-r.height-4));e.style.left=`${i}px`,e.style.top=`${a}px`}function Vt(e,t){if(typeof Node<`u`&&e instanceof Node)return t.some(t=>t.contains(e));if(!e||typeof e!=`object`)return!1;let n=e;for(;n&&typeof n==`object`;){if(t.includes(n))return!0;n=n.parent}return!1}var N=null;function Ht(){return N!==null}function Ut(){N?.(),N=null}function Wt(e,t){return new Promise(n=>{let r=document.activeElement;for(;r?.shadowRoot?.activeElement;)r=r.shadowRoot.activeElement;let i=r instanceof HTMLElement?r:null,a=[],o=[],s=!1,c=!1,l=()=>u(null),u=e=>{if(s)return;s=!0,N===l&&(N=null),document.removeEventListener(`keydown`,d),document.removeEventListener(`pointerdown`,f,!0),document.removeEventListener(`contextmenu`,ee,!0);let t=Vt(document.activeElement,a);for(let e of a)e.remove();t&&i?.isConnected&&i.focus({preventScroll:!0}),n(e)},d=e=>{e.key===`Escape`&&(e.preventDefault(),u(null))},f=e=>{c&&!Vt(e.target,a)&&u(null)},ee=e=>{c&&!Vt(e.target,a)&&(e.preventDefault(),u(null))},p=e=>{for(;a.length>e;)o.pop()?.setAttribute(`aria-expanded`,`false`),a.pop()?.remove()},te=(e,t,n,r,i)=>{p(r);let s=document.createElement(`div`);s.className=`dropdown-glass fixed z-[10000] min-w-56 max-w-sm overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,s.style.cssText=`position:fixed;z-index:10000;min-width:14rem;max-width:24rem;overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--contrast-popover-foreground);outline:none;pointer-events:auto;`,s.style.left=`${t}px`,s.style.top=`${n}px`,s.dataset.level=String(r);let l=document.createElement(`div`);l.className=`max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1`,l.style.cssText=`max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;`;for(let t of e){if(t.separatorBefore===!0&&l.children.length>0){let e=document.createElement(`div`);e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`height:1px;margin:0.25rem 0.5rem;background:var(--contrast-border);`,e.dataset.contextMenuSeparator=`true`,e.setAttribute(`role`,`separator`),l.appendChild(e)}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,l.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),i=document.createElement(`button`);i.type=`button`;let o=t.disabled===!0;i.disabled=o;let s=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(i.className=o?`${s} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${s} text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground`:`${s} text-foreground hover:bg-accent hover:text-accent-foreground`,i.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--contrast-foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(i.style.color=`var(--destructive-foreground)`),o&&(i.style.color=`var(--contrast-muted-foreground)`,i.style.opacity=`0.64`,i.style.pointerEvents=`none`),typeof t.checked==`boolean`){i.setAttribute(`role`,`menuitemradio`),i.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?zt(`check`,`neutral`):null;if(e)i.appendChild(e);else{let e=document.createElement(`span`);e.className=`size-4.5 shrink-0 sm:size-4`,e.style.cssText=`display:inline-block;width:1rem;height:1rem;flex-shrink:0;`,e.setAttribute(`aria-hidden`,`true`),i.appendChild(e)}}else if(typeof t.icon==`string`){let e=zt(t.icon,n?`destructive`:`neutral`);e&&i.appendChild(e)}let d=document.createElement(`span`);if(d.className=`min-w-0 flex-1 truncate`,d.textContent=t.label,i.appendChild(d),typeof t.accelerator==`string`){let e=document.createElement(`span`);e.className=`ms-6 shrink-0 text-muted-foreground text-xs tracking-widest`,e.style.cssText=`margin-inline-start:1.5rem;flex-shrink:0;color:var(--contrast-muted-foreground);font-size:0.75rem;letter-spacing:0.1em;`,e.textContent=It(t.accelerator),e.setAttribute(`aria-hidden`,`true`),i.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,ve(navigator.platform)?`Meta`:`Control`)),i.appendChild(e)}if(e){i.setAttribute(`aria-haspopup`,`menu`),i.setAttribute(`aria-expanded`,`false`);let e=zt(`chevron-right`,`neutral`);e&&(e.setAttribute(`class`,`-me-0.5 ms-auto size-4.5 shrink-0 text-muted-foreground opacity-80 sm:size-4`),e.setAttribute(`aria-hidden`,`true`),e.dataset.contextMenuChevron=`true`,i.appendChild(e))}if(!o){let o=!1,s=!1,l=()=>{let e=o||s;i.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,i.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(i.addEventListener(`mouseenter`,()=>{i.focus({preventScroll:!0}),o=!0,l()}),i.addEventListener(`mouseleave`,()=>{o=!1,l()}),i.addEventListener(`focus`,()=>{s=!0,l()}),i.addEventListener(`blur`,()=>{s=!1,l()}),e){let e=(e=!1)=>{let n=i.getBoundingClientRect(),o=n.right+4,s=n.top;te(t.children,o,s,r+1,i),i.setAttribute(`aria-expanded`,`true`);let c=a[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&Bt(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};i.addEventListener(`mouseenter`,()=>{e()}),i.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else i.addEventListener(`mouseenter`,()=>{p(r+1)}),i.addEventListener(`click`,()=>{c&&u(t.id)})}l.appendChild(i)}s.appendChild(l),s.addEventListener(`mouseenter`,()=>{p(r+1)}),document.body.appendChild(s),a[r]=s,o[r]=i,requestAnimationFrame(()=>{Bt(s,t,n)})};document.addEventListener(`keydown`,d),document.addEventListener(`pointerdown`,f,!0),document.addEventListener(`contextmenu`,ee,!0),te(e,t?.x??0,t?.y??0,0),N&&N(),N=l,requestAnimationFrame(()=>{c=!0})})}var Gt=`p4code:client-settings:v1`;function Kt(){return typeof window<`u`}function qt(){return Kt()?ee(Gt,o):null}function Jt(e){Kt()&&se(Gt,e,o)}var Yt;function Xt(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>jt(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`)}else window.open(e,`_blank`,`noopener,noreferrer`)},openSystemSettings:async e=>{if(!window.desktopBridge?.openSystemSettings||!await window.desktopBridge.openSystemSettings(e))throw Error(`Unable to open System Settings.`)}},contextMenu:{show:async(e,t)=>window.desktopBridge?window.desktopBridge.showContextMenu(e,t):Wt(e,t),close:async()=>{window.desktopBridge||Ut()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():qt(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);Jt(e)}}}}function Zt(){return Xt()}function Qt(){if(typeof window<`u`)return Yt||(Yt=Zt(),Yt)}function $t(){let e=Qt();if(!e)throw Error(`Local API not found`);return e}var P=`p4code:theme`,en=`(prefers-color-scheme: dark)`,F={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function tn(){return I()}function nn(){return typeof window>`u`?{}:rn()}function I(){if(typeof window>`u`)return null;try{return ct(window.localStorage.getItem(C))}catch{return null}}function rn(){try{let e=JSON.parse(window.localStorage.getItem(`p4code:theme-halves:v1`)??`null`);if(typeof e!=`object`||!e)return{};let t={};for(let n of[`light`,`dark`]){let r=e[n];typeof r==`string`&&(t[n]=r)}return t}catch{return{}}}function an(e){return`${e?.light??``}|${e?.dark??``}`}var on=`theme-color`,sn=`meta[name="${on}"][data-dynamic-theme-color="true"]`,L=class extends a()(`ThemeStorageError`,{operation:Be([`read`,`write`]),storageKey:u,theme:Ne(ht),cause:Pe()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},cn=be(L),ln=class extends a()(`DesktopThemeSyncError`,{theme:ht,cause:Pe()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},un=be(ln),R=[],z=null,dn=!0,fn=null,B=null,V=null;function H(){dn=!0;for(let e of R)e()}function pn(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(en).matches}function mn(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(gt);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function hn(e){return e===`light`||e===`dark`||e===`system`}function U(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(w);if(hn(e))return e}catch{}return mn(e)?`system`:_t(e)??`light`}function gn(e){if(typeof window<`u`)try{window.localStorage.setItem(w,e)}catch(e){throw new L({operation:`write`,storageKey:w,cause:e})}}function _n(){if(typeof window>`u`)return F.theme;let e;try{e=window.localStorage.getItem(P)}catch(e){throw new L({operation:`read`,storageKey:P,cause:e})}return e!==null&&at(e)?e:F.theme}function vn(e){if(typeof window<`u`)try{window.localStorage.setItem(P,e),V=null}catch(t){throw new L({operation:`write`,storageKey:P,theme:e,cause:t})}}function W(){if(V!==null)return F.theme;try{return _n()}catch(e){let t=cn(e)?e:new L({operation:`read`,storageKey:P,cause:e});return V=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...y(t)}),F.theme}}function yn(){let e=document.querySelector(sn);return e||(e=document.createElement(`meta`),e.name=on,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function bn(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function xn(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function Sn(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?bn(e.getPropertyValue(`--app-chrome-background`)):null,n=bn(getComputedStyle(xn()).backgroundColor),r=bn(getComputedStyle(document.body).backgroundColor),i=t??n??r;if(!i)return;document.documentElement.style.backgroundColor=i,document.body.style.backgroundColor=i;let a=document.querySelectorAll(`meta[name="${on}"]`);if(a.length===0)yn().setAttribute(`content`,i);else for(let e of a)e.setAttribute(`content`,i)}function G(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=U(e),i=r===`system`,a=i?pn():!1,o=I();if(B?.theme===e&&B.systemDark===a&&B.followSystem===i&&B.appearanceMode===r&&an(B.themeHalves)===an(o)){wn(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=lt(e,a,i,r,o);mt(ot(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),B={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},Sn(),wn(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function Cn(e,t,n,r,i=I()){try{await e.setTheme(st(t,n,r,i))}catch(e){throw new ln({theme:t,cause:e})}}function wn(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=I(),a=st(e,t,n,i);r&&typeof r.setTheme==`function`&&fn!==a&&(fn=a,Cn(r,e,t,n,i).catch(t=>{let n=un(t)?t:new ln({theme:e,cause:t});console.error(n.message,{theme:n.theme,...y(n)}),fn===a&&(fn=null)}))}typeof document<`u`&&typeof window<`u`&&G(W());function Tn(){if(typeof window>`u`)return F;if(!dn&&z)return z;dn=!1;let e=W(),t=U(e),n=t===`system`,r=n?pn():!1,i=I(),a=lt(e,r,n,t,i);return z&&z.theme===e&&z.resolvedTheme===a&&z.systemDark===r&&z.followSystem===n&&z.appearanceMode===t&&an(z.themeHalves)===an(i)||(z={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),z}function En(){return F}function Dn(){let e=W();U(e)===`system`&&G(e,{suppressTransitions:!0}),H()}function On(e){e.key===P?(V=null,G(W(),{suppressTransitions:!0}),H()):e.key===`p4code:theme-follow-system`||e.key===`p4code:theme-appearance-mode`||e.key===`p4code:theme-halves:v1`?(G(W(),{suppressTransitions:!0}),H()):(e.key===`p4code:themes:v1`||e.key===null)&&(e.key===null&&(V=null),ut(),B=null,G(W(),{suppressTransitions:!0}),H())}var kn=null;function An(e){if(typeof window>`u`)return()=>{};if(R.push(e),!kn){let e=typeof window.matchMedia==`function`?window.matchMedia(en):null;e?.addEventListener(`change`,Dn),window.addEventListener(`storage`,On),kn=()=>{e?.removeEventListener(`change`,Dn),window.removeEventListener(`storage`,On)}}return()=>{R=R.filter(t=>t!==e),R.length===0&&(kn?.(),kn=null)}}function jn(){let e=(0,T.useSyncExternalStore)(An,Tn,En),{theme:t,resolvedTheme:n}=e,r=(0,T.useCallback)(e=>{if(typeof window>`u`)return!1;try{gn(U(W()));let t=window.localStorage.getItem(C);window.localStorage.removeItem(C);try{vn(e)}catch(e){if(t!==null)try{window.localStorage.setItem(C,t)}catch{}throw e}}catch(t){let n=cn(t)?t:new L({operation:`write`,storageKey:P,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...y(n)}),!1}return G(e,{suppressTransitions:!0}),H(),!0},[]),i=(0,T.useCallback)(e=>{if(typeof window>`u`)return!1;try{gn(e)}catch(e){let t=cn(e)?e:new L({operation:`write`,storageKey:w,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...y(t)}),!1}return V=null,G(W(),{suppressTransitions:!0}),H(),!0},[]),a=(0,T.useCallback)(e=>{let n=U(t),r=e?`system`:n===`system`?_t(t)??`light`:n;return i(r)},[i,t]),o=(0,T.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...rn()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(C):window.localStorage.setItem(C,JSON.stringify(n))}catch(e){let t=new L({operation:`write`,storageKey:C,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...y(t)}),!1}return G(W(),{suppressTransitions:!0}),H(),!0},[]),s=(0,T.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(C)}catch(e){let t=new L({operation:`write`,storageKey:C,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...y(t)}),!1}return G(W(),{suppressTransitions:!0}),H(),!0},[]),c=(0,T.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(B=null,G(W(),{suppressTransitions:!0,preservePreview:e}),H())},[]);return(0,T.useEffect)(()=>{G(t)},[e.appearanceMode,t]),{theme:t,setTheme:r,setAppearanceMode:i,setFollowSystem:a,setThemeHalf:o,clearThemeHalves:s,refreshTheme:c,followSystem:e.followSystem,appearanceMode:e.appearanceMode,resolvedTheme:n,themeHalves:e.themeHalves}}var Mn=ae(ie(f)),Nn=d(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\r\n]*/g,(e,t)=>t?e:``);return t=t.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,(e,t)=>t?e:``),t=t.replace(/("(?:[^"\\]|\\.)*")|,(\s*[}\]])/g,(e,t,n)=>t?e:n??``),Mn(t).pipe(re(e=>e.issue))}),Pn=new we(Nn,he());c().pipe(me(he({space:2})));var Fn=e=>u.pipe(te(e,Pn)),In={performance:{profile:`performance`,automaticGitFetchInterval:h(15),providerHealthRefreshInterval:p(1),hostPowerMonitorActiveInterval:h(30),hostPowerMonitorIdleInterval:p(2),idleClientTtl:h(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:ue,providerHealthRefreshInterval:s,hostPowerMonitorActiveInterval:h(30),hostPowerMonitorIdleInterval:p(5),idleClientTtl:h(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:h(0),providerHealthRefreshInterval:p(15),hostPowerMonitorActiveInterval:p(1),hostPowerMonitorIdleInterval:p(10),idleClientTtl:h(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function K(e){return In[e]}function Ln(e){return e.profile===`custom`?e.baseProfile??`balanced`:e.profile}function Rn(e){let t=Ln(e),n=In[t],r=e.profile===`custom`?e.overrides:{};return{profile:t,automaticGitFetchInterval:r.automaticGitFetchInterval??n.automaticGitFetchInterval,providerHealthRefreshInterval:r.providerHealthRefreshInterval??n.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:r.hostPowerMonitorActiveInterval??n.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:r.hostPowerMonitorIdleInterval??n.hostPowerMonitorIdleInterval,idleClientTtl:r.idleClientTtl??n.idleClientTtl,pauseWhenHostLocked:r.pauseWhenHostLocked??n.pauseWhenHostLocked,pauseWhenHostLowPower:r.pauseWhenHostLowPower??n.pauseWhenHostLowPower,pauseWhenClientLowPower:r.pauseWhenClientLowPower??n.pauseWhenClientLowPower,pauseWhenOnBattery:r.pauseWhenOnBattery??n.pauseWhenOnBattery}}function q(e,t){return _(e)===_(t)}function zn(e,t){return q(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&q(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&q(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&q(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&q(e.idleClientTtl,t.idleClientTtl)&&e.pauseWhenHostLocked===t.pauseWhenHostLocked&&e.pauseWhenHostLowPower===t.pauseWhenHostLowPower&&e.pauseWhenClientLowPower===t.pauseWhenClientLowPower&&e.pauseWhenOnBattery===t.pauseWhenOnBattery}function Bn(e){if(e.profile!==`custom`)return{schemaVersion:1,profile:e.profile,overrides:{}};let t=Rn(e),n=[Ln(e),`balanced`,`performance`,`battery-saver`];for(let e of n)if(zn(t,In[e]))return{schemaVersion:1,profile:e,overrides:{}};let r=Ln(e),i=In[r];return{schemaVersion:1,profile:`custom`,baseProfile:r,overrides:{...q(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...q(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...q(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...q(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...q(t.idleClientTtl,i.idleClientTtl)?{}:{idleClientTtl:t.idleClientTtl},...t.pauseWhenHostLocked===i.pauseWhenHostLocked?{}:{pauseWhenHostLocked:t.pauseWhenHostLocked},...t.pauseWhenHostLowPower===i.pauseWhenHostLowPower?{}:{pauseWhenHostLowPower:t.pauseWhenHostLowPower},...t.pauseWhenClientLowPower===i.pauseWhenClientLowPower?{}:{pauseWhenClientLowPower:t.pauseWhenClientLowPower},...t.pauseWhenOnBattery===i.pauseWhenOnBattery?{}:{pauseWhenOnBattery:t.pauseWhenOnBattery}}}}function Vn(e){let t={schemaVersion:1,profile:de,overrides:{}},n=e.backgroundActivity.profile===t.profile&&e.backgroundActivity.baseProfile===void 0&&Object.keys(e.backgroundActivity.overrides).length===0,r=e.backgroundActivityProfile,i=r!==`balanced`||_(e.automaticGitFetchInterval)!==_(ue)||_(e.providerHealthRefreshInterval)!==_(s);return Rn(n&&i?{schemaVersion:1,profile:_(e.automaticGitFetchInterval)===_(K(r).automaticGitFetchInterval)&&_(e.providerHealthRefreshInterval)===_(K(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{..._(e.automaticGitFetchInterval)===_(K(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},..._(e.providerHealthRefreshInterval)===_(K(r).providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:e.providerHealthRefreshInterval}}}:e.backgroundActivity)}function Hn(e){let t=Vn(e);return Bn({schemaVersion:1,profile:`custom`,baseProfile:t.profile,overrides:{automaticGitFetchInterval:t.automaticGitFetchInterval,providerHealthRefreshInterval:t.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval,idleClientTtl:t.idleClientTtl,pauseWhenHostLocked:t.pauseWhenHostLocked,pauseWhenHostLowPower:t.pauseWhenHostLowPower,pauseWhenClientLowPower:t.pauseWhenClientLowPower,pauseWhenOnBattery:t.pauseWhenOnBattery}})}var Un=Fn(xe);_e(Un);function Wn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?Ae(t.instanceId):Ee(n)}var Gn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>r.make(e));function Kn(e,t,n){let r=[...Gn.map(e=>[Re(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Gn.includes(t.driver)?[[Oe.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(r===void 0)return null;let[a,o]=r,s=n?.defaultModelSelection,c=e[a]?.config;return s?.instanceId===a&&ye(c?.customModels).some(e=>e.slug===s.model)?s:{instanceId:a,model:le[o]??i[o]??`gpt-6-luna`}}function qn(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!ze(e,n,r.instanceId))return e.textGenerationModelSelection;if(t===void 0)return r;let i=t.find(e=>e.instanceId===r.instanceId);return i?.enabled===!0&&ne(i)&&oe(i)?r:e.textGenerationModelSelection}function Jn(e,t,n){let r=e.reviewGuideModelSelection;if(r&&ze(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&ne(e)&&oe(e))return r}return qn(e,t,n)}new Set(Object.keys(Ie.fields));function Yn(e,t={}){return{favorites:e.favorites??t.favorites??[],providerModelPreferences:e.providerModelPreferences??t.providerModelPreferences??{}}}function Xn(e,t){let n=e.favorites===null&&(t.favorites?.length??0)>0?t.favorites:void 0,r=e.providerModelPreferences===null&&Object.keys(t.providerModelPreferences??{}).length>0?t.providerModelPreferences:void 0;return n===void 0&&r===void 0?null:{migrateModelPreferences:{...n===void 0?{}:{favorites:n},...r===void 0?{}:{providerModelPreferences:r}}}}var Zn=new Set([`continueThreadsAfterServerUpdate`,`autoResumeLimitedThreads`,`snoozeLimitedThreads`,`newWorktreesStartFromOrigin`,`sourceControlWritingStyle`,`textGenerationModelSelection`]);function Qn(e){let t={},n={};for(let[r,i]of Object.entries(e))Zn.has(r)?t[r]=i:n[r]=i;return{sharedPatch:t,localPatch:n}}function $n(e,t,n,r=n,i=!1){let a=e.textGenerationModelSelection?.instanceId??r?.textGenerationModelSelection.instanceId;return!i&&e.textGenerationModelSelection&&(!n||a!==void 0&&(r?.providerInstances[a]?.driver??a)!==(n.providerInstances[a]?.driver??a)||!Wn(n,{...n.textGenerationModelSelection,...e.textGenerationModelSelection}))&&(e=Fe(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:Fe(e,[`continueThreadsAfterServerUpdate`])}function er(e){return e.connection.phase===`connected`&&e.serverConfig!==null}function tr(e,t){return{...t,environmentId:e,label:t.entry.target.label,displayUrl:Ue(t.entry),relayManaged:We(t.entry)}}function nr(){let e=(0,E.c)(7),t=g(S.catalogValueAtom),n=g(S.networkStatusValueAtom),r=g(St.presentationsAtom),i;e[0]===r?i=e[1]:(i=[...r.entries()].map(rr),e[0]=r,e[1]=i);let a=i,o;return e[2]!==t.isReady||e[3]!==a||e[4]!==n||e[5]!==r?(o={isReady:t.isReady,networkStatus:n,environments:a,presentationById:r},e[2]=t.isReady,e[3]=a,e[4]=n,e[5]=r,e[6]=o):o=e[6],o}function rr(e){let[t,n]=e;return tr(t,n)}function ir(){return g(Ze)}function ar(e){let t=(0,E.c)(3),{presentation:n}=wt(e),r;return t[0]!==e||t[1]!==n?(r=e===null||n===null?null:tr(e,n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function or(){return ar(ir())}function sr(e){let t=(0,E.c)(2),n=tt(e),r;return t[0]===n?r=t[1]:(r=ce(n)?n.value.httpBaseUrl:null,t[0]=n,t[1]=r),r}function cr(){return g(Xe.stateValueAtom)}function lr(){return g(D.environmentIdsAtom)}function ur(){return g(D.identitiesAtom)}function dr(){return g(D.pullRequestsSupportedAtom)}function fr(){return g(D.machineByIdAtom)}var pr=`[CLIENT_SETTINGS]`,mr=new Set,hr=new Set,gr=pe,J=`pending`,Y=null,_r=0,vr=Promise.resolve(),yr=0;function br(){for(let e of mr)e()}function xr(){for(let e of hr)e()}function X(){return gr}function Sr(e){gr=e,br()}function Cr(e){J!==e&&(J=e,xr())}function wr(e){return mr.add(e),Z().catch(()=>void 0),()=>{mr.delete(e)}}function Tr(){return J===`ready`}function Er(){return J}function Dr(e){return hr.add(e),Z().catch(()=>void 0),()=>{hr.delete(e)}}async function Z(){if(J===`ready`)return;if(Y)return Y;let e=_r;Cr(J===`failed`||J===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await $t().persistence.getClientSettings();if(e!==_r)return;t&&Sr({...pe,...t}),Cr(`ready`)}catch(t){throw e===_r&&Cr(`failed`),console.error(`${pr} hydrate failed`,{operation:`hydrate`,...y(t)}),t}})().finally(()=>{Y===t&&(Y=null)});return Y=t,Y}var Or=e=>$t().persistence.setClientSettings(e);function kr(e){let t=vr.then(e);return vr=t.then(()=>void 0,()=>void 0),t}function Ar(e,t=Or){let n=J!==`ready`||yr>0;return n?yr+=1:Sr({...X(),...e}),kr(async()=>{if(n)try{J!==`ready`&&await Z(),Sr({...X(),...e})}finally{--yr}await t(X())}).catch(e=>{console.error(`${pr} persist failed`,{operation:`persist`,...y(e)})})}async function jr(e,t=Or){return kr(async()=>{for(J!==`ready`&&await Z();;){let n=X(),r=e(n);if(await t(r),X()===n)return Sr(r),r}})}var Mr=new Set(ke(xe.fields));function Nr(e){let t={},n={};for(let[r,i]of Object.entries(e))Mr.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function Pr(){return X()}function Fr(){return Z()}function Ir(){return(0,T.useSyncExternalStore)(Dr,Tr,Lr)}function Lr(){return!1}function Rr(){return(0,T.useSyncExternalStore)(Dr,Er,zr)}function zr(){return`pending`}function Q(){return(0,T.useSyncExternalStore)(wr,X,Br)}function Br(){return pe}function Vr(e,t){return{...t,...e,...Yn(e,t)}}var Hr=new Set;function $(e,t){let n=(0,E.c)(8),r=Q(),i=Ir(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=rt(x.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||Hr.has(e))return;let n=Xn(t,r);n&&(Hr.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>Hr.delete(e)))},c=[r,e,i,o,t],n[1]=r,n[2]=e,n[3]=i,n[4]=o,n[5]=t,n[6]=s,n[7]=c):(s=n[6],c=n[7]),(0,T.useEffect)(s,c)}function Ur(e,t){let n=(0,E.c)(6),r=Q(),i;n[0]!==r||n[1]!==e?(i=Vr(e,r),n[0]=r,n[1]=e,n[2]=i):i=n[2];let a=i,o;return n[3]!==a||n[4]!==t?(o=t?t(a):a,n[3]=a,n[4]=t,n[5]=o):o=n[5],o}function Wr(e){let t=(0,E.c)(3),n=Q(),r;return t[0]!==e||t[1]!==n?(r=e?e(n):n,t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function Gr(e){return e.settingsHydrated?e.paletteThemeActive&&!e.paletteThemeAllowsArtwork&&e.mode===`artwork`?`pill`:e.mode:`none`}function Kr(){let e=(0,E.c)(7),t=Ir(),n=Q().environmentIdentificationMode,{resolvedTheme:r,theme:i,themeHalves:a}=jn(),o=(0,T.useSyncExternalStore)(it,pt,qr),s;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==i||e[5]!==a){let c=ot(i,a,r),l=ft(c);s=Gr({mode:n,settingsHydrated:t,paletteThemeActive:o!==null||l!==null,paletteThemeAllowsArtwork:o??dt(c)}),e[0]=n,e[1]=o,e[2]=r,e[3]=t,e[4]=i,e[5]=a,e[6]=s}else s=e[6];return s}function qr(){return null}async function Jr(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await Fr(),{...Xn(e,Pr()),...t}}function Yr(e){let t=(0,E.c)(6),n;t[0]===e?n=t[1]:(n=e?x.settingsValueAtom(e):Zr,t[0]=e,t[1]=n);let r=g(n),i=rt(x.updateSettings,`model preferences update`),a;return t[2]!==e||t[3]!==i||t[4]!==r?(a=async t=>{if(!e||!r)return;let n;try{n=await Jr(r,t)}catch{b.add({type:`error`,title:`Model preferences not saved`,description:`Could not load saved model preferences. Try again.`});return}return i({environmentId:e,input:{patch:n}})},t[2]=e,t[3]=i,t[4]=r,t[5]=a):a=t[5],a}function Xr(e){let t=(0,T.use)(Se),n=(0,T.useRef)(new Map),r=Yr(e);return(0,T.useCallback)(async(i,a)=>{if(!e)return;let o=x.settingsValueAtom(e),s=t.get(o);if(!s)return;if(s.favorites===null)try{await Fr()}catch{b.add({type:`error`,title:`Favorites not saved`,description:`Could not load saved model preferences. Try again.`});return}let c=t.get(o)??s,l=Yn(c,Pr()).favorites,u=JSON.stringify([e,i,a]),d=n.current.get(u),f={favorite:!(d&&(d.pending||d.settings.favorites===c.favorites)?d.favorite:l.some(e=>e.provider===i&&e.model===a)),settings:c,pending:!0};n.current.set(u,f);try{let e=await r({setModelFavorites:[{provider:i,model:a,favorite:f.favorite}]});e&&je(e)&&t.get(o)?.favorites===c.favorites&&(f.pending=!1)}finally{f.pending&&n.current.get(u)===f&&(d&&!d.pending&&t.get(o)?.favorites===d.settings.favorites?n.current.set(u,d):n.current.delete(u))}},[e,t,r])}var Zr=v(null);function Qr(e){let t=(0,E.c)(5),n;t[0]===e?n=t[1]:(n=e?x.settingsValueAtom(e):Zr,t[0]=e,t[1]=n);let r=g(n),i=Q();$(e,r);let a=r??ge,o;return t[2]!==i||t[3]!==a?(o=Yn(a,i),t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function $r(e,t){let n=(0,E.c)(2),r;n[0]===e?r=n[1]:(r=x.settingsValueAtom(e),n[0]=e,n[1]=r);let i=g(r);return $(e,i),Ur(i??ge,t)}function ei(e){let t=(0,E.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=rt(x.mutateProviderInstance,n),i;return t[1]!==e||t[2]!==r?(i=(t,n)=>r({environmentId:e,input:{patch:n===void 0?{}:n,providerInstanceMutation:t}}),t[1]=e,t[2]=r,t[3]=i):i=t[3],i}function ti(e){let t=or(),n=g(Qe);return $(t?.environmentId??null,t?.serverConfig?.settings??null),Ur(n,e)}var ni=`This setting is saved on a server, and the hosted app is not anchored to one. Change it from the desktop app or from the server's own address.`;function ri(){let e=(0,E.c)(2),t=or(),n;return e[0]===t?n=e[1]:(n=t!==null||!Ke(),e[0]=t,e[1]=n),n}function ii(e){let t=(0,E.c)(3),n=e!==void 0&&e,{environments:r}=nr(),i;return t[0]!==r||t[1]!==n?(i=v(e=>r.filter(er).flatMap(t=>{let r=e(nt.sessionStateAtom(t.environmentId));if(n&&r._tag===`Initial`)return[t.environmentId];let i=r._tag===`Failure`?null:m(fe(r));return i!==null&&Me(i,`settings:write`)?[t.environmentId]:[]})),t[0]=r,t[1]=n,t[2]=i):i=t[2],g(i)}function ai(e){let t=(0,E.c)(10);$e(e,Ce);let n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={label:`server settings update`,reportFailure:!1},t[0]=n):n=t[0];let r=rt(x.updateSettings,n),{environments:i}=nr(),a;t[1]!==i||t[2]!==r?(a=async e=>{let t=await r(e);if(t._tag===`Failure`&&!Je(t)){let n=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=qe(t);b.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${n}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return t},t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s=ii(!0),c;return t[4]!==e||t[5]!==i||t[6]!==r||t[7]!==o||t[8]!==s?(c=t=>{let{serverPatch:n,clientPatch:a}=Nr(t),c=e===null||Te(n).every(t=>et(e,t));if(Object.keys(n).length>0&&!c&&b.add({type:`warning`,title:`Setting not saved`,description:`This connection lacks permission to change settings on ${i.find(t=>t.environmentId===e)?.label??`the selected environment`}.`}),Object.keys(n).length>0&&c){let{sharedPatch:t,localPatch:a}=Qn(n),c=ui;if(Object.keys(a).length>0&&(e?o({environmentId:e,input:{patch:a}}):c()),Object.keys(t).length>0){let n=i.find(t=>t.environmentId===e)?.serverConfig?.settings,a=new Set(s);e&&a.add(e);let o=[],l=[];for(let r of a){let a=i.find(e=>e.environmentId===r),s=$n(t,a?.serverConfig?.environment.capabilities,a?.serverConfig?.settings,n,r===e);Object.keys(s).length!==0&&(De.get(nt.sessionStateAtom(r))._tag!==`Initial`&&!Te(t).every(e=>et(r,e))?l.push(a?.label??r):o.push({environmentId:r,input:{patch:s}}))}o.length===0?c(l.length>0?`This connection lacks permission to change settings on ${l.join(`, `)}.`:a.size>0?`Update older servers to save this setting.`:void 0):Promise.all(o.map(async e=>({label:i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await r(e)}))).then(oi)}}Object.keys(a).length>0&&Ar(a)},t[4]=e,t[5]=i,t[6]=r,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function oi(e){let t=e.flatMap(li);if(t.length===0)return;let n=e.filter(ci).map(si);b.add({type:`error`,title:n.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...n.length>0?[`Saved on ${n.join(`, `)}.`]:[]].join(`
|
|
2
|
+
`)})}function si(e){let{label:t}=e;return t}function ci(e){let{result:t}=e;return t._tag===`Success`}function li(e){let{label:t,result:n}=e;if(n._tag!==`Failure`||Je(n))return[];let r=qe(n);return[`Could not save on ${t}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`]}function ui(e){let t=e===void 0?ni:e;return b.add({type:`warning`,title:`Setting not saved`,description:t})}function di(e){return ai(e)}function fi(){return ai(or()?.environmentId??null)}function pi(){return mi}function mi(e){return Ar(e)}export{At as $,dr as A,Fn as B,sr as C,nr as D,fr as E,Ln as F,Sn as G,tn as H,K as I,Qt as J,jn as K,Bn as L,Kn as M,Jn as N,or as O,qn as P,Ot as Q,Hn as R,ar as S,lr as T,nn as U,U as V,_n as W,Pt as X,Ht as Y,Mt as Z,Xr as _,Ar as a,wt as at,di as b,Ir as c,Qr as d,jt as et,$r as f,ri as g,ti as h,Vr as i,D as it,cr as j,ir as k,Rr as l,ei as m,Fr as n,kt as nt,jr as o,$ as p,$t as q,Pr as r,St as rt,Wr as s,ni as t,Nt as tt,Kr as u,pi as v,ur as w,fi as x,Yr as y,Vn as z};
|
|
3
|
+
//# sourceMappingURL=useSettings-EYJbJzT3.js.map
|