@p4code/cli 0.9.9 → 0.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +1 -1
- package/dist/{binCli-CQsXscQ2.mjs → binCli-CYcCQdSE.mjs} +25 -3
- package/dist/client/.vite/manifest.json +1125 -1125
- package/dist/client/assets/{2NI2N5EU-aTesTRUs.js → 2NI2N5EU-CTGx9SqE.js} +2 -2
- package/dist/client/assets/{4UO7MD6I-fOcXoLqw.js → 4UO7MD6I-BjVL6foo.js} +2 -2
- package/dist/client/assets/{5B3SVYGG-CVlBycCk.js → 5B3SVYGG-Cs9CtCwM.js} +2 -2
- package/dist/client/assets/{5GK6JWQ2-UdJh1ROk.js → 5GK6JWQ2-uCqJ5b6P.js} +2 -2
- package/dist/client/assets/{5N7A7DKN-LpXLPis9.js → 5N7A7DKN-D8xYxzg8.js} +2 -2
- package/dist/client/assets/{5OC2THR4-pX1yQcrA.js → 5OC2THR4-B4_z8HL_.js} +2 -2
- package/dist/client/assets/{5S6HY5KT-CTBX-e9M.js → 5S6HY5KT-BQM1ruT_.js} +2 -2
- package/dist/client/assets/{6IMQ5BUJ-DL11cDPG.js → 6IMQ5BUJ-CkYA1m9F.js} +2 -2
- package/dist/client/assets/{6OLKWJ4F-TXqcGdqI.js → 6OLKWJ4F-B7EL2QRF.js} +2 -2
- package/dist/client/assets/{74OO7NKP-DNrMi93b.js → 74OO7NKP-3i4AYzMo.js} +2 -2
- package/dist/client/assets/{75O6YZUN-CwCbVMzG.js → 75O6YZUN-CFk80U2S.js} +2 -2
- package/dist/client/assets/{77XECAW3-BuuKvNS0.js → 77XECAW3-DUjtpBc8.js} +2 -2
- package/dist/client/assets/{ABYRPUBD-BxNthVYO.js → ABYRPUBD-BobiH6Ib.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-DCBmguf9.js → AuthSurfaceShell-PCmsqp7T.js} +2 -2
- package/dist/client/assets/{BB2UYUI2-Bg3EJQg5.js → BB2UYUI2-DnxMKjgT.js} +2 -2
- package/dist/client/assets/{BUM34MOA-CgVaLfn6.js → BUM34MOA-DNTynUxx.js} +2 -2
- package/dist/client/assets/{CEQABKGZ-BpDmef7u.js → CEQABKGZ-veHxvA1u.js} +2 -2
- package/dist/client/assets/{CXAC5362-uHOdbo6J.js → CXAC5362-BynYY6uD.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-CcLiWo0d.js → ChatGptUsageButton-D-N8-zk6.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-DQk9NI7y.js → ChatMarkdown-fdsQ0rQe.js} +5 -5
- package/dist/client/assets/{CodexSetupSection.logic-fnotucae.js → CodexSetupSection.logic-lS_hYW7M.js} +2 -2
- package/dist/client/assets/{CommandBlock-ConSzQ7T.js → CommandBlock-BFdf6yDf.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-Dh9Y0crA.js → ComposerPromptEditor--x6yGPiW.js} +4 -4
- package/dist/client/assets/{ConnectionDiagnosisDetails-DIM-B35q.js → ConnectionDiagnosisDetails-BiLziJiH.js} +2 -2
- package/dist/client/assets/{DRLTVNUE-9tvJLXhF.js → DRLTVNUE-BOhroau_.js} +2 -2
- package/dist/client/assets/{DYY6UVD2-CXR9o7Qv.js → DYY6UVD2-Bpmvecid.js} +2 -2
- package/dist/client/assets/{DevicePanel-Oy_RHjOo.js → DevicePanel-BgToYlYg.js} +2 -2
- package/dist/client/assets/{DeviceSetup-ct6xlJYm.js → DeviceSetup-CJ3rjcDw.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-C-L5yt6X.js → DiffCommentAnnotation-BkAROMry.js} +2 -2
- package/dist/client/assets/{DiffFileTree-C5oMLRG9.js → DiffFileTree-ERgpSLaE.js} +2 -2
- package/dist/client/assets/{DiffPanel-CE2e4NYA.js → DiffPanel-DwPk2swZ.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-K9JsvPrH.js → DiffWorkerPoolProvider-BrhQktrm.js} +2 -2
- package/dist/client/assets/{EmbeddedDesign-xOusO8oo.js → EmbeddedDesign-DpSkJYii.js} +2 -2
- package/dist/client/assets/{FNOVOB4O-BmZ9pVZx.js → FNOVOB4O-Mdzaj7g-.js} +2 -2
- package/dist/client/assets/{FileDiff-BTNP8QcY.js → FileDiff-sbzjIw4Y.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-m6c5KXjS.js → FilePreviewPanel-BOnzRmKq.js} +2 -2
- package/dist/client/assets/{FoldedSettingsSection-BTB3Pbv2.js → FoldedSettingsSection-DN1s3P5h.js} +2 -2
- package/dist/client/assets/{HDGCDEEZ-JiOhjq7U.js → HDGCDEEZ-Ylftf3gZ.js} +2 -2
- package/dist/client/assets/{HSJLKHB7-Bd0iumEG.js → HSJLKHB7-BQqIHFzA.js} +2 -2
- package/dist/client/assets/JZOYTAAL-5fSSCfug.js +1 -0
- package/dist/client/assets/{K3MD6TGW-B2s2l_Ok.js → K3MD6TGW-C-WMFQa2.js} +2 -2
- package/dist/client/assets/{K7RP3OMA-DEvHDTPu.js → K7RP3OMA-Bv01V4PC.js} +2 -2
- package/dist/client/assets/{LHDIQX7Q-D06sm2YF.js → LHDIQX7Q-NSQFT8t0.js} +2 -2
- package/dist/client/assets/{LUXOKEGN-A74rm75g.js → LUXOKEGN-URYU7c_t.js} +2 -2
- package/dist/client/assets/{MathTypeset-Vm1FBYDj.js → MathTypeset-vloBebae.js} +2 -2
- package/dist/client/assets/{N3JZAHOW-BCbSRiUS.js → N3JZAHOW-B9_qgeJe.js} +2 -2
- package/dist/client/assets/{NUIALGQ3-DmGUeCU6.js → NUIALGQ3-CgK-ZGa2.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-BBiWXq8t.js → NoProjectsHero-Bkfsk4qc.js} +2 -2
- package/dist/client/assets/{O65XPQGZ-859wHUVg.js → O65XPQGZ-DcczmOOs.js} +2 -2
- package/dist/client/assets/{O7XIQ6OM-BSsC7pLO.js → O7XIQ6OM-DBN8Ta1r.js} +2 -2
- package/dist/client/assets/{OFQON5FD-BjECyhxL.js → OFQON5FD-BAqD2M9W.js} +2 -2
- package/dist/client/assets/{P4ConnectAccountPages-Cqk-Frva.js → P4ConnectAccountPages-kTztZndM.js} +2 -2
- package/dist/client/assets/{P4ConnectSidebarSignIn-wL7BP9rR.js → P4ConnectSidebarSignIn-BLFNWeXr.js} +2 -2
- package/dist/client/assets/{PJQHF43J-CuSzd3x-.js → PJQHF43J-D1TwOPBO.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-DXgwWyzK.js → PanelLayoutControls-BL3qZRW6.js} +4 -4
- package/dist/client/assets/{PierreEntryIcon-CDSrlZTw.js → PierreEntryIcon-CcaKUQ_5.js} +2 -2
- package/dist/client/assets/{PreviewPanel-B7EzPl1x.js → PreviewPanel-CF9KdCOZ.js} +2 -2
- package/dist/client/assets/{ProjectDefaultsSettings-BRi9-O_X.js → ProjectDefaultsSettings-DC9sqe1A.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-Cf1XjP8U.js → ProjectFavicon-6uv-3a7b.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-DSRXK7Zv.js → ProjectIconPickerDialog-DrNrdWag.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-8VrYkUNI.js → ProviderAuthTerminal-BdestvKT.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-mxdF5wUN.js → ProviderModelPicker-Dx26TqdI.js} +2 -2
- package/dist/client/assets/{ProviderSettingsForm-ByFYLn1K.js → ProviderSettingsForm-B1ZiIcrJ.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-DCUJxgcQ.js → PullRequestCodeTab-5JEE8HsL.js} +2 -2
- package/dist/client/assets/{RHNBAITX-Z04dR_uf.js → RHNBAITX-AZ9q_QDP.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-CiVudVcz.js → ReadOnlySourcePreview-CSK6ee05.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-C8jlNO8Q.js → RenderErrorBoundary-ImTUJEbS.js} +2 -2
- package/dist/client/assets/{SLD4V6NK-CTh_lt_F.js → SLD4V6NK-uXoZZAB2.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-DfwR9Auj.js → ScheduledTasksSettings-BDkh7pCI.js} +2 -2
- package/dist/client/assets/{ScopedSwitch-6K10bTo0.js → ScopedSwitch-IyBzdLBa.js} +2 -2
- package/dist/client/assets/{SelfImproveSettingsSection-DwtwZ9He.js → SelfImproveSettingsSection-DGcoA36F.js} +2 -2
- package/dist/client/assets/{SettingsPanels-BnfeCIPg.js → SettingsPanels-BfzvtrNj.js} +2 -2
- package/dist/client/assets/{SettingsPanels.logic-BM52qF-a.js → SettingsPanels.logic-xcOt84aX.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-CPP-_wXt.js → SettingsScopeNotice-BSIkX2D-.js} +2 -2
- package/dist/client/assets/{SidebarStageBackdrop-ClK_nT_C.js → SidebarStageBackdrop-D7me9VdP.js} +2 -2
- package/dist/client/assets/{T3PCR2KE-O2OwSAZh.js → T3PCR2KE-B4buGw24.js} +2 -2
- package/dist/client/assets/{TKWO2OVW-BxZ4r_GJ.js → TKWO2OVW-B2GIBRnj.js} +2 -2
- package/dist/client/assets/{TSHNXIZL-6843lSfx.js → TSHNXIZL-CwVvoBmu.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-B_Mpp-fO.js → ThemeEditorPanel-Z1t7Xzva.js} +2 -2
- package/dist/client/assets/{ThreadTerminalDrawer-3sb2Ksna.js → ThreadTerminalDrawer-CnO3UVOq.js} +2 -2
- package/dist/client/assets/{UQJE5E4I-DIek-a8V.js → UQJE5E4I-Bzqu0vVG.js} +2 -2
- package/dist/client/assets/{USNYFO5S-l_vgf0I4.js → USNYFO5S-C4Z9b1ks.js} +2 -2
- package/dist/client/assets/{Virtualizer-CttujTBW.js → Virtualizer-saguDIDi.js} +2 -2
- package/dist/client/assets/{WEVWDWVA-DASU9Cts.js → WEVWDWVA-C5c2236d.js} +2 -2
- package/dist/client/assets/{X5RFHQXM-B52DJ-qb.js → X5RFHQXM-NygNPjev.js} +2 -2
- package/dist/client/assets/{X62E3GBT-Ccgsn5Dj.js → X62E3GBT-qvvfx8FL.js} +2 -2
- package/dist/client/assets/{XBNEOJTC-BRptYPNn.js → XBNEOJTC-DAgGRRGR.js} +2 -2
- package/dist/client/assets/{YHV2MVVZ-D_wcLZ-W.js → YHV2MVVZ-PIsz4H0c.js} +2 -2
- package/dist/client/assets/{YURCZMG2-DP6lArrr.js → YURCZMG2-CAQz8Kb8.js} +2 -2
- package/dist/client/assets/{YVG2LODB-CgFYuKDa.js → YVG2LODB-Crh6Gk8v.js} +2 -2
- package/dist/client/assets/{_chat-Vh73A6rC.js → _chat-BO5aRu-j.js} +5 -5
- package/dist/client/assets/{_chat.design-_0R3HMjq.js → _chat.design-1RXhKj_3.js} +2 -2
- package/dist/client/assets/{_chat.index-DhmrbSHU.js → _chat.index-ij31rX59.js} +2 -2
- package/dist/client/assets/{_chat.new-Byb4mhMY.js → _chat.new-QYOVVQAv.js} +2 -2
- package/dist/client/assets/{_chat.pull-requests-BNzVcYEB.js → _chat.pull-requests-B8-W4w8K.js} +2 -2
- package/dist/client/assets/{assetUrls-d3y14MLX.js → assetUrls-5u2VAW_2.js} +2 -2
- package/dist/client/assets/{assets-FbkZMhUb.js → assets-dVntMNKj.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-CjWZgU2Q.js → browserHistoryStore-AwPHr-9a.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-IsSd9GTV.js → browserLinkTarget-CUvZuS7D.js} +2 -2
- package/dist/client/assets/{connect-agent-dJ-CRJsT.js → connect-agent-BJCTM1nf.js} +2 -2
- package/dist/client/assets/{connect-DyZ-pjcy.js → connect-wndN2LD9.js} +2 -2
- package/dist/client/assets/{design-CXl7HVrT.js → design-Cve-RO6N.js} +2 -2
- package/dist/client/assets/{device-MyE56wi2.js → device-ZhgWJyBN.js} +2 -2
- package/dist/client/assets/{diffRendering-COA7wG72.js → diffRendering-Dyda4rX5.js} +2 -2
- package/dist/client/assets/{dist-CYq41icZ.js → dist-DP18jjts.js} +2 -2
- package/dist/client/assets/{duoViewer-CjvM1rB0.js → duoViewer-BnfAzuzK.js} +2 -2
- package/dist/client/assets/{dynamic-BZ3kW5ih.js → dynamic-DXn8DtfU.js} +2 -2
- package/dist/client/assets/{embeddedScripts-BLmMNkyP.js → embeddedScripts-BMILAsdP.js} +2 -2
- package/dist/client/assets/{entities-D8ZKPC2e.js → entities-DCgQUDZp.js} +2 -2
- package/dist/client/assets/{fileLinks-CNAL-7G6.js → fileLinks-BlBUc4i_.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-B_6v-e30.js → fileTreeExpansion-B8yevc-B.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-DovUC0XJ.js → getDiffFileInput-dJd1H35Q.js} +2 -2
- package/dist/client/assets/{guideRunStore-7uPQQ44U.js → guideRunStore-DksWd_Oc.js} +2 -2
- package/dist/client/assets/{index-DD6u-vDm.js → index-Bxk_RxGw.js} +3 -3
- package/dist/client/assets/{lazy-CXsQYM2D.js → lazy-DILJj7Gd.js} +4 -4
- package/dist/client/assets/{linkedPrompt-DgAytF6c.js → linkedPrompt-CE3amDef.js} +2 -2
- package/dist/client/assets/{main-CNcsYwUg.js → main-CVSzIqPv.js} +7 -7
- package/dist/client/assets/{mediaReference-DNNV5BY5.js → mediaReference-DMJ5Zay3.js} +2 -2
- package/dist/client/assets/{mediaSource-DI8dP4uu.js → mediaSource-UIArIbzY.js} +2 -2
- package/dist/client/assets/{onboarding-CyFz37eL.js → onboarding-pqbI8W1U.js} +2 -2
- package/dist/client/assets/{openFileInPreview-rYwhIeVk.js → openFileInPreview-x34grdQ6.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-CT0gLoXX.js → p4ProjectFile-xLwkLebE.js} +2 -2
- package/dist/client/assets/{pair-BOq1UYDI.js → pair-C4lVdDUz.js} +2 -2
- package/dist/client/assets/{phoneViewer-BtDABBh2.js → phoneViewer-Cotavx5y.js} +2 -2
- package/dist/client/assets/{pierre-icons-LoH9zCdH.js → pierre-icons-CBskVugi.js} +2 -2
- package/dist/client/assets/{preview-D9IkIo7q.js → preview-Bw-Ffmn4.js} +2 -2
- package/dist/client/assets/{primary-DXTkE8Z6.js → primary-CIcP7bEP.js} +2 -2
- package/dist/client/assets/{primaryCloudLinkState-CZVS0Wwo.js → primaryCloudLinkState-Dwi-D0I7.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-Cl_MU7SH.js → projectFilesQueryState-02nlfyzQ.js} +2 -2
- package/dist/client/assets/{projectScriptEditor-CfiaAaXj.js → projectScriptEditor-CIDcf-KL.js} +2 -2
- package/dist/client/assets/{providerSkills-CCJGD2Js.js → providerSkills-DTVLY34_.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-4EhxvJSo.js → pullRequestDetail.logic-BLe7zsLi.js} +2 -2
- package/dist/client/assets/{pullRequests-DRm4lwgc.js → pullRequests-mcrrz3SF.js} +2 -2
- package/dist/client/assets/{queries-BGbR-fUx.js → queries-ByCVdESa.js} +2 -2
- package/dist/client/assets/{renderScheduler-3p9xZuHR.js → renderScheduler-CNepEPa2.js} +2 -2
- package/dist/client/assets/{runtime-CdX0UBlL.js → runtime-CZnPVuwS.js} +3 -3
- package/dist/client/assets/{runtime-S0tnrkvE.js → runtime-DEFP_0P0.js} +3 -3
- package/dist/client/assets/{scheduledTasksSettings.logic-CrhQwOvr.js → scheduledTasksSettings.logic-CTJ1Zr8Z.js} +2 -2
- package/dist/client/assets/{server-ELSEsqtb.js → server-BuS35bSu.js} +2 -2
- package/dist/client/assets/{session-DCntd6Nl.js → session-DIw-RcNy.js} +2 -2
- package/dist/client/assets/{session-logic-CbKDK1qZ.js → session-logic-B5D2SdWr.js} +2 -2
- package/dist/client/assets/{settings-CbkRsZQ6.js → settings-CTpjG14a.js} +2 -2
- package/dist/client/assets/{settings.appearance-BGbKeD2q.js → settings.appearance-Cq56uRT4.js} +2 -2
- package/dist/client/assets/settings.archived-D2NDpNIY.js +2 -0
- package/dist/client/assets/{settings.computer-use-Cl0y_o-b.js → settings.computer-use-J2r1Wt55.js} +2 -2
- package/dist/client/assets/{settings.connections-xy7hhFa0.js → settings.connections-DDjl99g3.js} +2 -2
- package/dist/client/assets/{settings.data-controls-Boy0foov.js → settings.data-controls-Kotba8vC.js} +2 -2
- package/dist/client/assets/{settings.decisions-DUCJDJZC.js → settings.decisions-DghPRQ02.js} +2 -2
- package/dist/client/assets/{settings.designs-DYuankA7.js → settings.designs-D-0dwYo4.js} +2 -2
- package/dist/client/assets/{settings.diagnostics-DgYvj0_x.js → settings.diagnostics-C1H_Oj2r.js} +2 -2
- package/dist/client/assets/{settings.general-CrvvO6VU.js → settings.general-c-32Nudd.js} +2 -2
- package/dist/client/assets/{settings.integrations-Do9x2dXf.js → settings.integrations-BBvK_SX4.js} +2 -2
- package/dist/client/assets/{settings.keybindings-Q_21VUQP.js → settings.keybindings-BIfUzprR.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-Cnz72Gu0.js → settings.open-source-licenses-wmlqchzJ.js} +2 -2
- package/dist/client/assets/{settings.plugins-C9-DUFnM.js → settings.plugins-C1PnlzX1.js} +2 -2
- package/dist/client/assets/{settings.projects-BKMazKl9.js → settings.projects-BmJITbPY.js} +3 -3
- package/dist/client/assets/{settings.providers-ouat2Ci1.js → settings.providers-ELxTJwWk.js} +3 -3
- package/dist/client/assets/{settings.scheduled-tasks-DOmtQjNH.js → settings.scheduled-tasks-BGGcs-KK.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-609BnJ2S.js → settings.snap-shot-CvbNcoJx.js} +2 -2
- package/dist/client/assets/{settings.source-control-D1LmFmrq.js → settings.source-control-k2lVK3Ho.js} +2 -2
- package/dist/client/assets/{settings.storage-CXdZfPhF.js → settings.storage-CxA7PNjV.js} +2 -2
- package/dist/client/assets/{settingsLayout-aLGl3ZXu.js → settingsLayout-BWJVQUbK.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-BAN1mSDk.js → sidebarProjectGrouping-CPb438r8.js} +2 -2
- package/dist/client/assets/{sourceControl-ChrSdv6h.js → sourceControl-DzD_N8hv.js} +2 -2
- package/dist/client/assets/{sourceControlClients-BDwX0klQ.js → sourceControlClients-BG_kFh61.js} +2 -2
- package/dist/client/assets/{terminalSessions-DdR_bXtX.js → terminalSessions-BxTpBnAL.js} +2 -2
- package/dist/client/assets/{toast-BNQWmVQ-.js → toast-rcFdQept.js} +2 -2
- package/dist/client/assets/{uiStateStore-Bo1Umjei.js → uiStateStore-DKTSAGd0.js} +2 -2
- package/dist/client/assets/{usage-BPmOvYDv.js → usage-C-EgFB5m.js} +2 -2
- package/dist/client/assets/{use-atom-command-REOTdDAa.js → use-atom-command-BETKz9Hv.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-DYBNXS8y.js → useHandleNewThread-BoN4NqHy.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-CGiX3TE7.js → useP4ConnectAuthPrompt-BXoWBt0U.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-BOUPI3Y5.js → usePullRequestActions-D0-24Gox.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-DD6NdaS0.js → useScopedModelAvailability-C44gQf2k.js} +2 -2
- package/dist/client/assets/{useSettings-BNjvPVd5.js → useSettings-4JwtKUFC.js} +2 -2
- package/dist/client/assets/{vcsRefInvalidation-BSyEzs8X.js → vcsRefInvalidation-aUafFWy3.js} +2 -2
- package/dist/client/assets/{welcome-CJLDvQwx.js → welcome-DORffgtg.js} +2 -2
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/JZOYTAAL-0AVwCd1G.js +0 -1
- package/dist/client/assets/settings.archived-DNDOvbYT.js +0 -2
package/dist/client/assets/{PanelLayoutControls-DXgwWyzK.js → PanelLayoutControls-BL3qZRW6.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PullRequestCodeTab-DCUJxgcQ.js","assets/react-BUfh6y28.js","assets/jsx-runtime-DJeoFXNw.js","assets/utils-D19Exirm.js","assets/activity-CbqMUSRC.js","assets/createLucideIcon-DDevWfFk.js","assets/Icon-DYn8279B.js","assets/alarm-clock-D3-pktbt.js","assets/app-window-DT4yrrS-.js","assets/archive-Cr7-RIjC.js","assets/arrow-down-up-CQvYrirj.js","assets/arrow-down-BKghgxKI.js","assets/arrow-left-BWI0-vRp.js","assets/arrow-right-left-DXmmhGuH.js","assets/arrow-right-BJPYbHTL.js","assets/arrow-up-down-BEa_lFuV.js","assets/arrow-up-left-DLNjxPfK.js","assets/arrow-up-right-B8xNcEXp.js","assets/arrow-up-DMEbfkKl.js","assets/battery-BNMPLne0.js","assets/bell-vGxw63Gg.js","assets/blocks-CpHzQlR2.js","assets/book-open-DKRWS47i.js","assets/bookmark-DfPbwgkW.js","assets/bot-Cp92syL6.js","assets/box-D-FyjNxy.js","assets/bug-DH2pu6U9.js","assets/calendar-arrow-down-WH0xj289.js","assets/calendar-arrow-up-Lk-Us3ba.js","assets/calendar-clock-BARV5L0a.js","assets/calendar-DHdDnhKF.js","assets/camera-8ozLiwCj.js","assets/chart-no-axes-column-CQLqBsxb.js","assets/check-CdrGo1Oa.js","assets/chevron-down-D0M7_175.js","assets/chevron-left-CEWOKn-e.js","assets/chevron-right-DPl-L-yL.js","assets/chevron-up-gyDnPot_.js","assets/chevrons-left-right-ellipsis-DEfsDjXt.js","assets/chevrons-up-down-DakHVkrx.js","assets/chromium-x91nZeen.js","assets/circle-alert-DsKXULDS.js","assets/circle-arrow-up-DCmGv6Tl.js","assets/circle-check-CZ31KO9m.js","assets/circle-dashed-DMw11mBM.js","assets/circle-dot-CWCBN-HY.js","assets/circle-slash-eIt5hG5T.js","assets/circle-x-DMkHWcTz.js","assets/circle-Doq0I3MA.js","assets/clock-3-C5l2rPxd.js","assets/clock-aK6BX5Ve.js","assets/cloud-download-Ddj2y2Q1.js","assets/cloud-upload-BzCXws1i.js","assets/cloud-BhcSs4Ie.js","assets/code-xml-DsmxIkJL.js","assets/code-Dfd-vS1O.js","assets/columns-2-CgvyvCTB.js","assets/copy-CO2RgESU.js","assets/corner-left-up-DUJ8nnVp.js","assets/corner-up-right-xmYx6v5O.js","assets/cpu-DBknwmfd.js","assets/database-D2y6m7fG.js","assets/download-S2u-tXaE.js","assets/earth-CDbKfFEl.js","assets/ellipsis-vertical-CY0vJAc8.js","assets/ellipsis-Zza4fevQ.js","assets/external-link-D1GSnnDW.js","assets/eye-off-CH68-9dO.js","assets/eye-C3U51ndb.js","assets/file-braces-BzATadbM.js","assets/file-code-corner-eTofF8xM.js","assets/file-diff-CNp_vbEN.js","assets/file-search-ymCSYDZx.js","assets/file-spreadsheet-GRfTgOTy.js","assets/file-text-Bfv40hwh.js","assets/file-Ksu7amJn.js","assets/files-DlNPWYbd.js","assets/film-BUU7xHiL.js","assets/flask-conical-Dsv3DUqc.js","assets/folder-closed-urrrH8hq.js","assets/folder-cog-Dph_MIqG.js","assets/folder-git-2-BNs-MyeS.js","assets/folder-git-CZrtjtbc.js","assets/folder-open-glqXjO8U.js","assets/folder-plus-hbrm_0zI.js","assets/folder-tree-DRc_6QzW.js","assets/folder-7OwzWKex.js","assets/gauge-Bn8T6vfX.js","assets/git-branch-plus-DHrV8m4V.js","assets/git-branch-fKUdZyoj.js","assets/git-commit-horizontal-BKUdfVpN.js","assets/git-fork-q7k7fP_a.js","assets/git-merge-B6FlDJ0L.js","assets/git-pull-request-arrow-C03R6MRd.js","assets/git-pull-request-closed-BmuvrrUt.js","assets/git-pull-request-draft-BiETgjOy.js","assets/globe-rqPSVFGf.js","assets/grip-vertical-CDZpgHdL.js","assets/hammer-D3FVtCT2.js","assets/hard-drive-BYq2E_is.js","assets/hat-glasses-Dr2HzrbT.js","assets/history-CdIQPf9A.js","assets/house-ClTLFcnB.js","assets/image-Dp6bFTt-.js","assets/inbox-CcvYrvdu.js","assets/info-D9JLmnlB.js","assets/keyboard-Cwz72Cn4.js","assets/laptop-BRe6y-6m.js","assets/layers-DnKM4R7R.js","assets/lightbulb-D4c0exHI.js","assets/link-2-LC4CLD9N.js","assets/link-BG0xfm4f.js","assets/list-checks-D4Mjxs0W.js","assets/list-filter-CT2YuCdg.js","assets/list-ordered-CmlribqV.js","assets/list-todo-C9Q41q8t.js","assets/list-DFOg7UCj.js","assets/loader-circle-C9YTWe0R.js","assets/lock-open-ZMNlBvF_.js","assets/lock-CUPWkQFd.js","assets/log-in-CmJt2PGl.js","assets/mail-DH8sy4L4.js","assets/maximize-2-Ci1M4n4b.js","assets/maximize--OpXUP-L.js","assets/memory-stick-BfRByDz7.js","assets/message-circle-question-mark-B1TZAw6J.js","assets/message-circle-CHd5kZQY.js","assets/message-square-dashed-Cdozx3vh.js","assets/message-square-off-CWEe8iPZ.js","assets/message-square-text-DqZTWyZK.js","assets/message-square-warning-BNloiEzN.js","assets/message-square-HrqKYo9g.js","assets/messages-square-CNMItvyI.js","assets/minimize-2-C4_6Xjo0.js","assets/minus-BIm_k5Zx.js","assets/monitor-Dsi2qeBw.js","assets/moon-CQPzCH_B.js","assets/mouse-pointer-2-4CaeeJnC.js","assets/mouse-pointer-click-BPbYQy6n.js","assets/octagon-alert-EzAYxsw5.js","assets/package-plus-B0kbli0A.js","assets/package-DgK3Panc.js","assets/paintbrush-CRnk3l4s.js","assets/palette-oisfBZwg.js","assets/panel-bottom-_VbUQKRM.js","assets/panel-left-7a6N5kup.js","assets/panel-right-BeNqPQu9.js","assets/paperclip-D4ApErSa.js","assets/panels-top-left-DWNysJ-h.js","assets/pen-line-dPqyqyP8.js","assets/pencil-ruler-DmVfcvOi.js","assets/pencil-CkBDbGEU.js","assets/picture-in-picture-2-CM4GLcBZ.js","assets/pilcrow-D4Yvx6IY.js","assets/pin-DXnYmcqx.js","assets/play-3I2EkmKd.js","assets/plug-2-s7zj7Hxq.js","assets/plus-B2sOrZDk.js","assets/plug-YkUyuPha.js","assets/power-Bvdrcoxh.js","assets/presentation-Dzj9KqNW.js","assets/puzzle-A0RiinH5.js","assets/qr-code-DliRXqLn.js","assets/quote-BVm0cRnP.js","assets/radio-tower-DUk4f2-O.js","assets/redo-2-BJ7l6vPt.js","assets/refresh-cw-D5OcXJqv.js","assets/rotate-ccw-DpwKQVbi.js","assets/rotate-cw--ORF2bp-.js","assets/route-VA8ojaMC.js","assets/rows-3-BtaOoWPd.js","assets/scale-CFZenX_z.js","assets/search-BXnNiPfE.js","assets/send-rvnCC0tk.js","assets/server-D1-mXw9_.js","assets/settings-2-Bv4a7vuX.js","assets/settings-DSIgI7hn.js","assets/shield-check-Dp6nEC76.js","assets/shield-question-mark-Ct8sQE8L.js","assets/shield-BffxaUbT.js","assets/sliders-horizontal-Cjgfn3-e.js","assets/smartphone-D_YX6TMp.js","assets/smile-plus-CCWLDL7I.js","assets/sparkles-cGzc0RFW.js","assets/square-arrow-out-up-right-BhjBGexN.js","assets/square-pen-D43PK7SU.js","assets/square-split-horizontal-1peTt3kF.js","assets/square-split-vertical-BiyS0VO4.js","assets/square-terminal-jbiJud2S.js","assets/square-ekoTCPwL.js","assets/star-DNOgk1Yn.js","assets/sun-Doo18Rp9.js","assets/tag-COKMM2Nu.js","assets/target-DINbFNKH.js","assets/terminal-B0APSOls.js","assets/text-align-start-CwrzoVmt.js","assets/text-search-CmRPmwd0.js","assets/text-wrap-CQL7aZBn.js","assets/ticket-DOLQqHse.js","assets/trash-2-PlYko97C.js","assets/trending-down-DVeDgUDE.js","assets/trending-up-DbEIgYu9.js","assets/triangle-alert-BoPMRm-g.js","assets/type-CjUvBO4t.js","assets/undo-2-BD9xLk2R.js","assets/unlink-2-D70rwDdQ.js","assets/unplug-BYib3V6l.js","assets/upload-Cra7ct3V.js","assets/user-check-CcyAu7dq.js","assets/user-lock--_mHRTC7.js","assets/user-plus-zMaVgV4o.js","assets/user-round-x-pYk-6fRI.js","assets/user-round-4JeqoQGO.js","assets/users-BZYEVbyz.js","assets/wifi-off-ODm5nCE4.js","assets/workflow-BefWgmas.js","assets/wrench-pR-6hpnb.js","assets/x-C35beONT.js","assets/zap-BIb9m3mg.js","assets/runtime-S0tnrkvE.js","assets/runtime-CdX0UBlL.js","assets/TooltipViewport-CEOeTVyb.js","assets/toast-BNQWmVQ-.js","assets/spinner-H4tz4lLc.js","assets/useParams-D_0yPfYl.js","assets/DiffFileTree-C5oMLRG9.js","assets/useSettings-BNjvPVd5.js","assets/server-ELSEsqtb.js","assets/session-DCntd6Nl.js","assets/use-atom-command-REOTdDAa.js","assets/themePalette-pZ7Ys_kT.js","assets/diffRendering-COA7wG72.js","assets/index-DD6u-vDm.js","assets/fileTreeExpansion-B_6v-e30.js","assets/pierre-icons-LoH9zCdH.js","assets/query-D-IVadFI.js","assets/DiffCommentAnnotation-C-L5yt6X.js","assets/Virtualizer-CttujTBW.js","assets/getDiffFileInput-DovUC0XJ.js","assets/main-CNcsYwUg.js","assets/vcsRefInvalidation-BSyEzs8X.js","assets/entities-D8ZKPC2e.js","assets/number-field-DcRWl9B0.js","assets/useRegisterFieldControl-DnspXZl4.js","assets/FormContext-B_ZMFN7l.js","assets/CSPContext-jKZ42W4p.js","assets/select-CML8G0wN.js","assets/SelectScrollUpArrow-BAwxXUi-.js","assets/link-CmpZDWcG.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-tnhWsSYX.js","assets/useNavigate-DAhzXpNZ.js","assets/useLocation--dLSTvwv.js","assets/rightPanelStore-CRQRe1Cp.js","assets/toastHelpers-DxXYm50b.js","assets/queries-BGbR-fUx.js","assets/session-logic-CbKDK1qZ.js","assets/htmlRender-hlYiIm7u.js","assets/mediaSource-DI8dP4uu.js","assets/fileLinks-CNAL-7G6.js","assets/mediaReference-DNNV5BY5.js","assets/usageFormat-xrTYBhxI.js","assets/timestampFormat-wac2e_Jz.js","assets/env-wK1YYxA8.js","assets/tooltip-DsRaXpYk.js","assets/skeleton-eiJFH0l9.js","assets/useAriaLabelledBy-DVTboZ71.js","assets/toggle-BDixfqRe.js","assets/toggle-group-DV__8G6T.js","assets/CompositeRoot-XnJ7Nzli.js","assets/input-yNgBXsRj.js","assets/Input-B9nob0l2.js","assets/FieldControl-DfaF5AW8.js","assets/scroll-area-DTOm0CbX.js","assets/ScrollAreaCorner-Bstf_gNQ.js","assets/dist-CYq41icZ.js","assets/DialogTitle-DdTujj5B.js","assets/dialog-CKG1aUT3.js","assets/sidebar-DMJE0zUg.js","assets/useResizeDrag-CWrW8GV3.js","assets/observeResize-DjqKtKLK.js","assets/AnimatedHeight-Baj5Pa60.js","assets/assets-FbkZMhUb.js","assets/sourceControl-ChrSdv6h.js","assets/assetUrls-d3y14MLX.js","assets/browserHistoryStore-CjWZgU2Q.js","assets/preview-oweHYD4S.js","assets/openFileInPreview-rYwhIeVk.js","assets/keybindings-hzk4_Sgu.js","assets/Icons-BP6jlahF.js","assets/preview-D9IkIo7q.js","assets/PierreEntryIcon-CDSrlZTw.js","assets/RenderErrorBoundary-C8jlNO8Q.js","assets/sourceControlClients-BDwX0klQ.js","assets/browserLinkTarget-IsSd9GTV.js","assets/pullRequestIcons-DyEIFm1n.js","assets/pullRequests-DRm4lwgc.js","assets/threadSort-Bd2rijEy.js","assets/popover-DVeZET9D.js","assets/PopoverHandle-Bf0PlJ6j.js","assets/ProjectFavicon-Cf1XjP8U.js","assets/ProjectMonogram-BJooqIM-.js","assets/composerTrigger-BGi0iyhl.js","assets/projectFilesQueryState-Cl_MU7SH.js","assets/checkbox-BPr09F_k.js","assets/CheckboxIndicator-CvUY7aCo.js","assets/FieldItemContext-sr3mCd2v.js","assets/terminalSessions-DdR_bXtX.js","assets/AlertDialogRoot-BDlDnUeW.js","assets/useHandleNewThread-DYBNXS8y.js","assets/p4ProjectFile-CT0gLoXX.js","assets/uiStateStore-Bo1Umjei.js","assets/guideRunStore-7uPQQ44U.js","assets/pullRequestDetail.logic-4EhxvJSo.js","assets/pullRequestReviewStore-B55CEHY9.js","assets/sidebarProjectGrouping-BAN1mSDk.js","assets/EnvironmentMachineIcon-BrGxJPP_.js","assets/alert-CqueYfb9.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-CcLiWo0d.js","assets/kbd-Cr4XEhSh.js","assets/settingsLayout-aLGl3ZXu.js","assets/WorkspacePageContainer-E5ZuTsSl.js","assets/KeybindingsSettings.logic-CkmobJKX.js","assets/usageShortcuts-CQcKqXkw.js","assets/primaryCloudLinkState-CZVS0Wwo.js","assets/command-i_eKJj3B.js","assets/ComboboxClear-BWxvz8Y9.js","assets/ComboboxGroupLabel-B9uepPCe.js","assets/ConnectionStatusDot-CpPwqzkK.js","assets/standalone-page-DrNBm39d.js","assets/primary-DXTkE8Z6.js","assets/onboarding-CyFz37eL.js","assets/scheduledTasksSettings.logic-CrhQwOvr.js","assets/main-B-tAk2zT.css","assets/DiffWorkerPoolProvider-K9JsvPrH.js","assets/textarea-CkmpNgx5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PullRequestCodeTab-5JEE8HsL.js","assets/react-BUfh6y28.js","assets/jsx-runtime-DJeoFXNw.js","assets/utils-D19Exirm.js","assets/activity-CbqMUSRC.js","assets/createLucideIcon-DDevWfFk.js","assets/Icon-DYn8279B.js","assets/alarm-clock-D3-pktbt.js","assets/app-window-DT4yrrS-.js","assets/archive-Cr7-RIjC.js","assets/arrow-down-up-CQvYrirj.js","assets/arrow-down-BKghgxKI.js","assets/arrow-left-BWI0-vRp.js","assets/arrow-right-left-DXmmhGuH.js","assets/arrow-right-BJPYbHTL.js","assets/arrow-up-down-BEa_lFuV.js","assets/arrow-up-left-DLNjxPfK.js","assets/arrow-up-right-B8xNcEXp.js","assets/arrow-up-DMEbfkKl.js","assets/battery-BNMPLne0.js","assets/bell-vGxw63Gg.js","assets/blocks-CpHzQlR2.js","assets/book-open-DKRWS47i.js","assets/bookmark-DfPbwgkW.js","assets/bot-Cp92syL6.js","assets/box-D-FyjNxy.js","assets/bug-DH2pu6U9.js","assets/calendar-arrow-down-WH0xj289.js","assets/calendar-arrow-up-Lk-Us3ba.js","assets/calendar-clock-BARV5L0a.js","assets/calendar-DHdDnhKF.js","assets/camera-8ozLiwCj.js","assets/chart-no-axes-column-CQLqBsxb.js","assets/check-CdrGo1Oa.js","assets/chevron-down-D0M7_175.js","assets/chevron-left-CEWOKn-e.js","assets/chevron-right-DPl-L-yL.js","assets/chevron-up-gyDnPot_.js","assets/chevrons-left-right-ellipsis-DEfsDjXt.js","assets/chevrons-up-down-DakHVkrx.js","assets/chromium-x91nZeen.js","assets/circle-alert-DsKXULDS.js","assets/circle-arrow-up-DCmGv6Tl.js","assets/circle-check-CZ31KO9m.js","assets/circle-dashed-DMw11mBM.js","assets/circle-dot-CWCBN-HY.js","assets/circle-slash-eIt5hG5T.js","assets/circle-x-DMkHWcTz.js","assets/circle-Doq0I3MA.js","assets/clock-3-C5l2rPxd.js","assets/clock-aK6BX5Ve.js","assets/cloud-download-Ddj2y2Q1.js","assets/cloud-upload-BzCXws1i.js","assets/cloud-BhcSs4Ie.js","assets/code-xml-DsmxIkJL.js","assets/code-Dfd-vS1O.js","assets/columns-2-CgvyvCTB.js","assets/copy-CO2RgESU.js","assets/corner-left-up-DUJ8nnVp.js","assets/corner-up-right-xmYx6v5O.js","assets/cpu-DBknwmfd.js","assets/database-D2y6m7fG.js","assets/download-S2u-tXaE.js","assets/earth-CDbKfFEl.js","assets/ellipsis-vertical-CY0vJAc8.js","assets/ellipsis-Zza4fevQ.js","assets/external-link-D1GSnnDW.js","assets/eye-off-CH68-9dO.js","assets/eye-C3U51ndb.js","assets/file-braces-BzATadbM.js","assets/file-code-corner-eTofF8xM.js","assets/file-diff-CNp_vbEN.js","assets/file-search-ymCSYDZx.js","assets/file-spreadsheet-GRfTgOTy.js","assets/file-text-Bfv40hwh.js","assets/file-Ksu7amJn.js","assets/files-DlNPWYbd.js","assets/film-BUU7xHiL.js","assets/flask-conical-Dsv3DUqc.js","assets/folder-closed-urrrH8hq.js","assets/folder-cog-Dph_MIqG.js","assets/folder-git-2-BNs-MyeS.js","assets/folder-git-CZrtjtbc.js","assets/folder-open-glqXjO8U.js","assets/folder-plus-hbrm_0zI.js","assets/folder-tree-DRc_6QzW.js","assets/folder-7OwzWKex.js","assets/gauge-Bn8T6vfX.js","assets/git-branch-plus-DHrV8m4V.js","assets/git-branch-fKUdZyoj.js","assets/git-commit-horizontal-BKUdfVpN.js","assets/git-fork-q7k7fP_a.js","assets/git-merge-B6FlDJ0L.js","assets/git-pull-request-arrow-C03R6MRd.js","assets/git-pull-request-closed-BmuvrrUt.js","assets/git-pull-request-draft-BiETgjOy.js","assets/globe-rqPSVFGf.js","assets/grip-vertical-CDZpgHdL.js","assets/hammer-D3FVtCT2.js","assets/hard-drive-BYq2E_is.js","assets/hat-glasses-Dr2HzrbT.js","assets/history-CdIQPf9A.js","assets/house-ClTLFcnB.js","assets/image-Dp6bFTt-.js","assets/inbox-CcvYrvdu.js","assets/info-D9JLmnlB.js","assets/keyboard-Cwz72Cn4.js","assets/laptop-BRe6y-6m.js","assets/layers-DnKM4R7R.js","assets/lightbulb-D4c0exHI.js","assets/link-2-LC4CLD9N.js","assets/link-BG0xfm4f.js","assets/list-checks-D4Mjxs0W.js","assets/list-filter-CT2YuCdg.js","assets/list-ordered-CmlribqV.js","assets/list-todo-C9Q41q8t.js","assets/list-DFOg7UCj.js","assets/loader-circle-C9YTWe0R.js","assets/lock-open-ZMNlBvF_.js","assets/lock-CUPWkQFd.js","assets/log-in-CmJt2PGl.js","assets/mail-DH8sy4L4.js","assets/maximize-2-Ci1M4n4b.js","assets/maximize--OpXUP-L.js","assets/memory-stick-BfRByDz7.js","assets/message-circle-question-mark-B1TZAw6J.js","assets/message-circle-CHd5kZQY.js","assets/message-square-dashed-Cdozx3vh.js","assets/message-square-off-CWEe8iPZ.js","assets/message-square-text-DqZTWyZK.js","assets/message-square-warning-BNloiEzN.js","assets/message-square-HrqKYo9g.js","assets/messages-square-CNMItvyI.js","assets/minimize-2-C4_6Xjo0.js","assets/minus-BIm_k5Zx.js","assets/monitor-Dsi2qeBw.js","assets/moon-CQPzCH_B.js","assets/mouse-pointer-2-4CaeeJnC.js","assets/mouse-pointer-click-BPbYQy6n.js","assets/octagon-alert-EzAYxsw5.js","assets/package-plus-B0kbli0A.js","assets/package-DgK3Panc.js","assets/paintbrush-CRnk3l4s.js","assets/palette-oisfBZwg.js","assets/panel-bottom-_VbUQKRM.js","assets/panel-left-7a6N5kup.js","assets/panel-right-BeNqPQu9.js","assets/paperclip-D4ApErSa.js","assets/panels-top-left-DWNysJ-h.js","assets/pen-line-dPqyqyP8.js","assets/pencil-ruler-DmVfcvOi.js","assets/pencil-CkBDbGEU.js","assets/picture-in-picture-2-CM4GLcBZ.js","assets/pilcrow-D4Yvx6IY.js","assets/pin-DXnYmcqx.js","assets/play-3I2EkmKd.js","assets/plug-2-s7zj7Hxq.js","assets/plus-B2sOrZDk.js","assets/plug-YkUyuPha.js","assets/power-Bvdrcoxh.js","assets/presentation-Dzj9KqNW.js","assets/puzzle-A0RiinH5.js","assets/qr-code-DliRXqLn.js","assets/quote-BVm0cRnP.js","assets/radio-tower-DUk4f2-O.js","assets/redo-2-BJ7l6vPt.js","assets/refresh-cw-D5OcXJqv.js","assets/rotate-ccw-DpwKQVbi.js","assets/rotate-cw--ORF2bp-.js","assets/route-VA8ojaMC.js","assets/rows-3-BtaOoWPd.js","assets/scale-CFZenX_z.js","assets/search-BXnNiPfE.js","assets/send-rvnCC0tk.js","assets/server-D1-mXw9_.js","assets/settings-2-Bv4a7vuX.js","assets/settings-DSIgI7hn.js","assets/shield-check-Dp6nEC76.js","assets/shield-question-mark-Ct8sQE8L.js","assets/shield-BffxaUbT.js","assets/sliders-horizontal-Cjgfn3-e.js","assets/smartphone-D_YX6TMp.js","assets/smile-plus-CCWLDL7I.js","assets/sparkles-cGzc0RFW.js","assets/square-arrow-out-up-right-BhjBGexN.js","assets/square-pen-D43PK7SU.js","assets/square-split-horizontal-1peTt3kF.js","assets/square-split-vertical-BiyS0VO4.js","assets/square-terminal-jbiJud2S.js","assets/square-ekoTCPwL.js","assets/star-DNOgk1Yn.js","assets/sun-Doo18Rp9.js","assets/tag-COKMM2Nu.js","assets/target-DINbFNKH.js","assets/terminal-B0APSOls.js","assets/text-align-start-CwrzoVmt.js","assets/text-search-CmRPmwd0.js","assets/text-wrap-CQL7aZBn.js","assets/ticket-DOLQqHse.js","assets/trash-2-PlYko97C.js","assets/trending-down-DVeDgUDE.js","assets/trending-up-DbEIgYu9.js","assets/triangle-alert-BoPMRm-g.js","assets/type-CjUvBO4t.js","assets/undo-2-BD9xLk2R.js","assets/unlink-2-D70rwDdQ.js","assets/unplug-BYib3V6l.js","assets/upload-Cra7ct3V.js","assets/user-check-CcyAu7dq.js","assets/user-lock--_mHRTC7.js","assets/user-plus-zMaVgV4o.js","assets/user-round-x-pYk-6fRI.js","assets/user-round-4JeqoQGO.js","assets/users-BZYEVbyz.js","assets/wifi-off-ODm5nCE4.js","assets/workflow-BefWgmas.js","assets/wrench-pR-6hpnb.js","assets/x-C35beONT.js","assets/zap-BIb9m3mg.js","assets/runtime-DEFP_0P0.js","assets/runtime-CZnPVuwS.js","assets/TooltipViewport-CEOeTVyb.js","assets/toast-rcFdQept.js","assets/spinner-H4tz4lLc.js","assets/useParams-D_0yPfYl.js","assets/DiffFileTree-ERgpSLaE.js","assets/useSettings-4JwtKUFC.js","assets/server-BuS35bSu.js","assets/session-DIw-RcNy.js","assets/use-atom-command-BETKz9Hv.js","assets/themePalette-pZ7Ys_kT.js","assets/diffRendering-Dyda4rX5.js","assets/index-Bxk_RxGw.js","assets/fileTreeExpansion-B8yevc-B.js","assets/pierre-icons-CBskVugi.js","assets/query-D-IVadFI.js","assets/DiffCommentAnnotation-BkAROMry.js","assets/Virtualizer-saguDIDi.js","assets/getDiffFileInput-dJd1H35Q.js","assets/main-CVSzIqPv.js","assets/vcsRefInvalidation-aUafFWy3.js","assets/entities-DCgQUDZp.js","assets/number-field-DcRWl9B0.js","assets/useRegisterFieldControl-DnspXZl4.js","assets/FormContext-B_ZMFN7l.js","assets/CSPContext-jKZ42W4p.js","assets/select-CML8G0wN.js","assets/SelectScrollUpArrow-BAwxXUi-.js","assets/link-CmpZDWcG.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-tnhWsSYX.js","assets/useNavigate-DAhzXpNZ.js","assets/useLocation--dLSTvwv.js","assets/rightPanelStore-CRQRe1Cp.js","assets/toastHelpers-DxXYm50b.js","assets/queries-ByCVdESa.js","assets/session-logic-B5D2SdWr.js","assets/htmlRender-hlYiIm7u.js","assets/mediaSource-UIArIbzY.js","assets/fileLinks-BlBUc4i_.js","assets/mediaReference-DMJ5Zay3.js","assets/usageFormat-xrTYBhxI.js","assets/timestampFormat-wac2e_Jz.js","assets/env-wK1YYxA8.js","assets/tooltip-DsRaXpYk.js","assets/skeleton-eiJFH0l9.js","assets/useAriaLabelledBy-DVTboZ71.js","assets/toggle-BDixfqRe.js","assets/toggle-group-DV__8G6T.js","assets/CompositeRoot-XnJ7Nzli.js","assets/input-yNgBXsRj.js","assets/Input-B9nob0l2.js","assets/FieldControl-DfaF5AW8.js","assets/scroll-area-DTOm0CbX.js","assets/ScrollAreaCorner-Bstf_gNQ.js","assets/dist-DP18jjts.js","assets/DialogTitle-DdTujj5B.js","assets/dialog-CKG1aUT3.js","assets/sidebar-DMJE0zUg.js","assets/useResizeDrag-CWrW8GV3.js","assets/observeResize-DjqKtKLK.js","assets/AnimatedHeight-Baj5Pa60.js","assets/assets-dVntMNKj.js","assets/sourceControl-DzD_N8hv.js","assets/assetUrls-5u2VAW_2.js","assets/browserHistoryStore-AwPHr-9a.js","assets/preview-oweHYD4S.js","assets/openFileInPreview-x34grdQ6.js","assets/keybindings-hzk4_Sgu.js","assets/Icons-BP6jlahF.js","assets/preview-Bw-Ffmn4.js","assets/PierreEntryIcon-CcaKUQ_5.js","assets/RenderErrorBoundary-ImTUJEbS.js","assets/sourceControlClients-BG_kFh61.js","assets/browserLinkTarget-CUvZuS7D.js","assets/pullRequestIcons-DyEIFm1n.js","assets/pullRequests-mcrrz3SF.js","assets/threadSort-Bd2rijEy.js","assets/popover-DVeZET9D.js","assets/PopoverHandle-Bf0PlJ6j.js","assets/ProjectFavicon-6uv-3a7b.js","assets/ProjectMonogram-BJooqIM-.js","assets/composerTrigger-BGi0iyhl.js","assets/projectFilesQueryState-02nlfyzQ.js","assets/checkbox-BPr09F_k.js","assets/CheckboxIndicator-CvUY7aCo.js","assets/FieldItemContext-sr3mCd2v.js","assets/terminalSessions-BxTpBnAL.js","assets/AlertDialogRoot-BDlDnUeW.js","assets/useHandleNewThread-BoN4NqHy.js","assets/p4ProjectFile-xLwkLebE.js","assets/uiStateStore-DKTSAGd0.js","assets/guideRunStore-DksWd_Oc.js","assets/pullRequestDetail.logic-BLe7zsLi.js","assets/pullRequestReviewStore-B55CEHY9.js","assets/sidebarProjectGrouping-CPb438r8.js","assets/EnvironmentMachineIcon-BrGxJPP_.js","assets/alert-CqueYfb9.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-D-N8-zk6.js","assets/kbd-Cr4XEhSh.js","assets/settingsLayout-BWJVQUbK.js","assets/WorkspacePageContainer-E5ZuTsSl.js","assets/KeybindingsSettings.logic-CkmobJKX.js","assets/usageShortcuts-CQcKqXkw.js","assets/primaryCloudLinkState-Dwi-D0I7.js","assets/command-i_eKJj3B.js","assets/ComboboxClear-BWxvz8Y9.js","assets/ComboboxGroupLabel-B9uepPCe.js","assets/ConnectionStatusDot-CpPwqzkK.js","assets/standalone-page-DrNBm39d.js","assets/primary-CIcP7bEP.js","assets/onboarding-pqbI8W1U.js","assets/scheduledTasksSettings.logic-CTJ1Zr8Z.js","assets/main-B-tAk2zT.css","assets/DiffWorkerPoolProvider-BrhQktrm.js","assets/textarea-CkmpNgx5.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./index-Bxk_RxGw.js";import{n as r,t as i}from"./jsx-runtime-DJeoFXNw.js";import{$n as a,A as o,Ad as s,Am as c,Bp as l,D as u,Ep as d,F as f,Fp as p,Hd as m,Hp as h,Ip as g,Jn as _,Md as v,Ms as y,Nd as b,Nm as x,Pd as S,Qm as C,Qn as w,Qs as T,Rf as E,Rm as D,Rp as O,Sf as k,Vf as A,Vm as j,Xn as M,Xp as N,Ym as P,Yn as F,Z_ as I,Zn as L,Zo as R,Zs as z,Zy as B,_f as V,_p as H,am as ee,ar as te,bm as U,cd as ne,cf as re,df as ie,dm as ae,dr as W,ec as oe,ef as se,ep as ce,ff as le,fr as ue,hd as de,hp as fe,ih as pe,im as me,iv as he,jd as ge,jf as _e,js as ve,kf as ye,kl as be,ks as xe,ld as Se,mp as Ce,nh as we,np as Te,nr as Ee,of as De,or as Oe,qp as ke,qy as Ae,rh as je,rr as Me,sd as Ne,sf as Pe,t as G,tr as Fe,ts as Ie,ub as Le,uf as Re,ur as ze,wa as Be,xm as Ve,yd as He,yg as Ue,ym as We}from"./utils-D19Exirm.js";import{W as Ge}from"./runtime-DEFP_0P0.js";import{C as Ke,D as qe,O as Je,S as Ye}from"./entities-DCgQUDZp.js";import{_n as Xe,ln as Ze,mn as Qe,vn as $e,xn as et,yn as tt}from"./runtime-CZnPVuwS.js";import{F as nt,K as rt,P as it,V as at,_ as ot,l as st,q as ct,x as lt,y as ut}from"./TooltipViewport-CEOeTVyb.js";import{J as dt,L as ft,R as pt,n as mt}from"./ChatMarkdown-fdsQ0rQe.js";import{a as ht,o as gt,s as _t,t as vt}from"./select-CML8G0wN.js";import{t as yt}from"./spinner-H4tz4lLc.js";import{i as bt,m as xt,p as St}from"./toast-rcFdQept.js";import{G as Ct,T as wt,d as Tt,q as Et}from"./useSettings-4JwtKUFC.js";import{s as Dt}from"./server-BuS35bSu.js";import{i as Ot,n as kt}from"./session-DIw-RcNy.js";import{n as At}from"./query-D-IVadFI.js";import{t as jt}from"./use-atom-command-BETKz9Hv.js";import{t as K,u as Mt}from"./rightPanelStore-CRQRe1Cp.js";import{u as Nt}from"./queries-ByCVdESa.js";import{C as Pt,Q as Ft,Z as It,_ as Lt,at as Rt,c as zt,d as Bt,ft as Vt,l as Ht,lt as Ut,nt as Wt,ot as Gt,s as Kt,t as qt,tt as Jt,u as Yt,v as Xt,w as Zt}from"./diffRendering-Dyda4rX5.js";import{C as Qt,E as $t,G as en,H as tn,K as nn,U as rn,V as an,W as on,d as sn,i as cn,u as ln}from"./Virtualizer-saguDIDi.js";import{l as un,ut as dn}from"./getDiffFileInput-dJd1H35Q.js";import{i as fn,r as pn,t as mn}from"./DiffWorkerPoolProvider-BrhQktrm.js";import{t as hn}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{n as gn,r as _n,t as vn}from"./FileDiff-sbzjIw4Y.js";import{S as yn,a as bn,b as xn,i as Sn,n as Cn,r as wn,t as Tn}from"./DiffCommentAnnotation-BkAROMry.js";import{r as En}from"./mediaSource-UIArIbzY.js";import{o as Dn}from"./timestampFormat-wac2e_Jz.js";import{t as On}from"./env-wK1YYxA8.js";import{a as q,n as J,r as kn,t as Y}from"./tooltip-DsRaXpYk.js";import{t as An}from"./skeleton-eiJFH0l9.js";import{t as jn}from"./textarea-CkmpNgx5.js";import{t as Mn}from"./toggle-BDixfqRe.js";import{n as Nn,t as Pn}from"./toggle-group-DV__8G6T.js";import{i as Fn,l as In,o as Ln,r as Rn,s as zn,t as Bn}from"./combobox-CEzOq8mg.js";import{t as Vn}from"./input-yNgBXsRj.js";import{t as Hn}from"./scroll-area-DTOm0CbX.js";import{a as Un,c as Wn,i as Gn,o as Kn,r as qn,s as Jn,t as Yn}from"./dialog-CKG1aUT3.js";import{t as Xn}from"./useResizeDrag-CWrW8GV3.js";import{a as Zn,i as Qn,o as $n,r as er,t as tr}from"./empty-D6SdnsPw.js";import{i as nr}from"./device-ZhgWJyBN.js";import{t as rr}from"./observeResize-DjqKtKLK.js";import{n as ir,t as ar}from"./assetUrls-5u2VAW_2.js";import{f as or}from"./browserHistoryStore-AwPHr-9a.js";import{_ as sr,y as cr}from"./keybindings-hzk4_Sgu.js";import{i as lr,n as ur}from"./Icons-BP6jlahF.js";import{t as dr}from"./PierreEntryIcon-CcaKUQ_5.js";import{C as fr,S as pr,T as mr,_ as hr,a as gr,b as _r,c as vr,d as yr,g as br,h as xr,l as Sr,lt as Cr,m as wr,nt as Tr,o as Er,p as Dr,s as Or,u as kr,ut as Ar,v as jr,w as Mr,x as Nr,y as Pr}from"./RenderErrorBoundary-ImTUJEbS.js";import{n as Fr,r as Ir}from"./sourceControlClients-BG_kFh61.js";import{n as X}from"./pullRequestIcons-DyEIFm1n.js";import{D as Lr,a as Rr,c as zr,i as Br,k as Vr,n as Hr,r as Ur,u as Wr}from"./pullRequests-mcrrz3SF.js";import{a as Gr,i as Kr,n as qr,o as Jr,t as Yr}from"./popover-DVeZET9D.js";import{A as Xr,B as Zr,C as Qr,D as $r,E as ei,G as ti,H as ni,I as ri,J as ii,K as ai,L as oi,M as si,N as ci,O as li,P as ui,R as di,S as fi,T as pi,U as mi,V as hi,Y as gi,_ as _i,a as vi,b as yi,c as bi,d as xi,f as Si,g as Ci,i as wi,j as Ti,k as Ei,l as Di,o as Oi,p as ki,r as Ai,s as ji,t as Mi,v as Ni,w as Pi,y as Fi,z as Ii}from"./pullRequestDetail.logic-BLe7zsLi.js";import{i as Li,n as Ri,r as zi,t as Bi}from"./pullRequestReviewStore-B55CEHY9.js";import{t as Vi}from"./terminalLabels-BgLOlb2G.js";import{n as Hi}from"./useHandleNewThread-BoN4NqHy.js";import{r as Ui}from"./uiStateStore-DKTSAGd0.js";import{i as Wi,m as Gi,n as Ki,r as qi,t as Ji}from"./guideRunStore-DksWd_Oc.js";import{n as Yi}from"./EnvironmentMachineIcon-BrGxJPP_.js";import{i as Xi,n as Zi,r as Qi,t as $i}from"./alert-CqueYfb9.js";import{t as ea}from"./kbd-Cr4XEhSh.js";import{d as ta,l as na,t as ra,u as ia}from"./command-i_eKJj3B.js";import{Ai as aa,Ci as oa,Di as sa,La as ca,Mi as la,Ni as ua,Ti as da,_i as fa,bo as pa,co as ma,do as ha,ii as ga,ji as _a,ki as va,lo as ya,mn as ba,ri as xa,so as Sa,vi as Ca,xi as wa,za as Ta}from"./main-CVSzIqPv.js";import"./WorkspacePageHeader-DGopnQZ2.js";import{r as Ea,s as Da,t as Oa}from"./usePullRequestActions-D0-24Gox.js";function ka(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Aa(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:ja(e.items,t.items)}function ja(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r==null||i==null||r.id!==i.id||r.type!==i.type||r.element!==i.element||r.instance!==i.instance||r.version!==i.version)return!1}return!0}function Ma(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(Ft,``),t.before(r)):(r.setAttribute(It,``),t.after(r)),n?.observe(r),r}function Na(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var Pa=1e5,Fa=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,Ia=`data-diffs-search`,La=`:host {
|
|
3
3
|
display: block;
|
|
4
4
|
position: sticky;
|
|
5
5
|
z-index: 100;
|
|
@@ -211,6 +211,6 @@ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./index-DD6u-vDm.js
|
|
|
211
211
|
[data-code]::-webkit-scrollbar-thumb {
|
|
212
212
|
background-color: var(--diffs-bg-context);
|
|
213
213
|
}
|
|
214
|
-
`;function ud(e){let t=(0,Q.c)(60),{excerpt:n,file:r,loading:i,notes:a,commenting:s,loadDiffFiles:c,onOpenFile:l}=e,[u,d]=(0,Z.useState)(null),{resolvedTheme:p}=Ct(),m;if(t[0]!==n||t[1]!==r){bb0:{if(r===null){m=null;break bb0}let e=Zu(r),i=Qu(e,n);if(i.length===0){m=null;break bb0}let a=zt(ed(n.path,Bt(r),i),`pull-request-guide-excerpt:${n.path}:${n.side}:${n.start}-${n.end}`),o=a?.kind===`files`?a.files[0]:void 0;if(o===void 0){m=null;break bb0}let s={additions:new Set(i.flatMap(md)),deletions:new Set(i.flatMap(pd))},c;t[3]!==s||t[4]!==o||t[5]!==e||t[6]!==i?(c={fileDiff:o,rows:i,shown:i.length,total:e.length,drawn:s},t[3]=s,t[4]=o,t[5]=e,t[6]=i,t[7]=c):c=t[7],m=c}t[0]=n,t[1]=r,t[2]=m}else m=t[2];let h=m,g=h?.rows??null,_;bb1:{if(g===null||g.some(e=>e.hunk!==g[0]?.hunk)){_=null;break bb1}let e;t[8]!==n.end||t[9]!==n.side||t[10]!==n.start||t[11]!==c||t[12]!==g?(e=async e=>{let t=await c(e),r=td(t.newFile.contents,g);return r===null?t:{newFile:t.newFile,oldFile:{name:t.oldFile?.name??t.newFile.name,contents:r,cacheKey:`${t.newFile.cacheKey??t.newFile.name}:excerpt:${n.side}:${n.start}-${n.end}`}}},t[8]=n.end,t[9]=n.side,t[10]=n.start,t[11]=c,t[12]=g,t[13]=e):e=t[13],_=e}let v=_,y;t[14]!==s?.pending||t[15]!==u||t[16]!==n.path||t[17]!==n.side||t[18]!==a||t[19]!==h?.drawn?(y=()=>{let e=new Map,t=(t,n)=>{let r=`${t}:${n}`,i=e.get(r);if(i!==void 0)return i;let a={side:t,lineNumber:n,metadata:{markers:[],pending:[],draft:!1}};return e.set(r,a),a},r=(n,r,i)=>{let a=t(n,r);e.set(`${n}:${r}`,{...a,metadata:i(a.metadata)})},i=n.side===`new`?`additions`:`deletions`;for(let e of a)r(i,e.line,t=>({...t,markers:[...t.markers,...e.markers]}));for(let e of s?.pending??[]){if(e.path!==n.path)continue;let t=mc(e.position),i=pc(t.side);h?.drawn[i].has(t.line)&&r(i,t.line,t=>({...t,pending:[...t.pending,e]}))}if(u!==null){let e=mc(u.position);r(pc(e.side),e.line,fd)}return[...e.values()]},t[14]=s?.pending,t[15]=u,t[16]=n.path,t[17]=n.side,t[18]=a,t[19]=h?.drawn,t[20]=y):y=t[20],s?.pending;let b;t[21]===y?b=t[22]:(b=y(),t[21]=y,t[22]=b);let x=b,S;t[23]===r?S=t[24]:(S=e=>{if(e===null||r===null)return;let t=f(r,e.end,e.endSide??e.side);t!==null&&d({range:e,position:t})},t[23]=r,t[24]=S);let C=S,w=s!==null&&u===null,T=s?.onAskAgent??null,E;t[25]!==u||t[26]!==n.path||t[27]!==r||t[28]!==T?(E=e=>{if(u===null||r===null||T===null)return;let t=o({id:`pull-request-guide:${n.path}:${u.range.start}:${u.range.end}`,sectionId:`pull-request-guide:${n.path}`,sectionTitle:`Review guide`,filePath:n.path,fileDiff:r,range:u.range,text:e});d(null),t!==null&&T(t,e)},t[25]=u,t[26]=n.path,t[27]=r,t[28]=T,t[29]=E):E=t[29];let D=E,O;t[30]===p?O=t[31]:(O=Ht(p),t[30]=p,t[31]=O);let k;t[32]===v?k=t[33]:(k=v===null?{hunkSeparators:`simple`}:{loadDiffFiles:v},t[32]=v,t[33]=k);let A;t[34]!==C||t[35]!==w||t[36]!==p||t[37]!==O||t[38]!==k?(A={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,theme:O,themeType:p,preferredHighlighter:ha,unsafeCSS:ld,enableGutterUtility:w,enableLineSelection:w,onGutterUtilityClick:C,onLineSelectionEnd:C,...k},t[34]=C,t[35]=w,t[36]=p,t[37]=O,t[38]=k,t[39]=A):A=t[39];let j=A,M;t[40]===n.caption?M=t[41]:(M=n.caption.trim()===``?null:(0,$.jsx)(`figcaption`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(Ku,{text:n.caption,plain:!0})}),t[40]=n.caption,t[41]=M);let N;t[42]!==x||t[43]!==D||t[44]!==s||t[45]!==u||t[46]!==n.end||t[47]!==n.path||t[48]!==n.side||t[49]!==n.start||t[50]!==r||t[51]!==i||t[52]!==T||t[53]!==l||t[54]!==j||t[55]!==h?(N=h===null?i?(0,$.jsxs)(`p`,{className:`rounded-lg border border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[`Loading `,n.path,`...`]}):(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,$.jsx)(`span`,{className:`font-mono text-foreground`,children:n.path}),` lines `,n.start,`-`,n.end,` are not in the loaded diff.`]}),(0,$.jsx)(W,{size:`xs`,variant:`outline`,onClick:()=>l(n.path),children:`Open in Code`})]}):(0,$.jsx)(`div`,{className:`min-w-0 overflow-hidden rounded-lg border border-border/60`,children:(0,$.jsx)(vn,{fileDiff:h.fileDiff,options:j,lineAnnotations:x,selectedLines:u?.range??null,renderAnnotation:e=>(0,$.jsxs)(`div`,{className:`font-sans`,children:[e.metadata.markers.length>0?(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-1 text-xs`,children:e.metadata.markers.map(dd)}):null,e.metadata.pending.map(e=>(0,$.jsx)(hc,{comment:e,onRemove:()=>s?.onRemove(e.id)},e.id)),e.metadata.draft&&u!==null&&s!==null?(0,$.jsx)(Tn,{kind:`draft`,rangeLabel:`${n.path}:${mc(u.position).line}`,text:``,placeholder:s.canComment?`Add a comment…`:`Ask the agent about these lines…`,submitLabel:s.canComment?`Add to review`:`Ask agent`,...s.canComment&&T!==null?{secondaryAction:{label:`Ask agent`,onAction:e=>D(e)}}:{},onCancel:()=>d(null),onComment:e=>{s.canComment?(s.onComment({path:n.path,oldPath:r===null?null:hd(r,n.path),position:u.position,body:e}),d(null)):D(e)}}):null]}),renderHeaderMetadata:()=>(0,$.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[n.side===`old`?`removed code, `:``,`showing `,h.shown,` of`,` `,h.total,` diff lines`]}),(0,$.jsx)(W,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Open ${n.path} in Code`,onClick:()=>l(n.path),children:(0,$.jsx)(de,{"aria-hidden":!0})})]})})}),t[42]=x,t[43]=D,t[44]=s,t[45]=u,t[46]=n.end,t[47]=n.path,t[48]=n.side,t[49]=n.start,t[50]=r,t[51]=i,t[52]=T,t[53]=l,t[54]=j,t[55]=h,t[56]=N):N=t[56];let P;return t[57]!==M||t[58]!==N?(P=(0,$.jsxs)(`figure`,{className:`flex min-w-0 flex-col gap-1.5`,children:[M,N]}),t[57]=M,t[58]=N,t[59]=P):P=t[59],P}function dd(e){return(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)(od,{marker:e.marker}),(0,$.jsx)(`span`,{className:`text-foreground`,children:e.title})]},e.marker)}function fd(e){return{...e,draft:!0}}function pd(e){return e.oldLine===null?[]:[e.oldLine]}function md(e){return e.newLine===null?[]:[e.newLine]}function hd(e,t){let n=Bt(e);return n===t?null:n}function gd(e){let t=(0,Q.c)(11),{file:n,loadDiffFiles:r}=e,{resolvedTheme:i}=Ct(),a;t[0]===n?a=t[1]:(a=hn(n),t[0]=n,t[1]=a);let o=a,s;t[2]===i?s=t[3]:(s=Ht(i),t[2]=i,t[3]=s);let c;t[4]!==r||t[5]!==i||t[6]!==s?(c={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,disableFileHeader:!0,theme:s,themeType:i,preferredHighlighter:ha,unsafeCSS:Jo,loadDiffFiles:r},t[4]=r,t[5]=i,t[6]=s,t[7]=c):c=t[7];let l=c,u;return t[8]!==o||t[9]!==l?(u=(0,$.jsx)(`div`,{className:`border-t border-border/60`,children:(0,$.jsx)(vn,{fileDiff:o,options:l})}),t[8]=o,t[9]=l,t[10]=u):u=t[10],u}var _d={tradeoff:`A tradeoff to weigh`,contract:`A contract to check`,product:`A product call`,risk:`A risk to judge`,accessibility:`An accessibility call`};function vd(e){let t=(0,Q.c)(122),{stop:n,index:r,stopCount:i,railOpen:a,onRailOpenChange:o,stopList:s,nextTitle:c,files:l,loadDiffFiles:u,diffLoading:d,commenting:f,onStep:p,onAsk:m,onFinish:h,onOpenFile:g}=e,_;t[0]===n?_=t[1]:(_=nd(n),t[0]=n,t[1]=_);let{lettered:v,byExcerpt:y}=_,x;t[2]===n.excerpts?x=t[3]:(x=new Set(n.excerpts.map(yd)),t[2]=n.excerpts,t[3]=x);let C=x,w,T,E,D,O,k,A,j,M;if(t[4]!==y||t[5]!==f||t[6]!==d||t[7]!==C||t[8]!==l||t[9]!==r||t[10]!==v||t[11]!==u||t[12]!==g||t[13]!==o||t[14]!==p||t[15]!==a||t[16]!==n.attention||t[17]!==n.excerpts||t[18]!==n.files||t[19]!==n.summary||t[20]!==n.title||t[21]!==i||t[22]!==s){let e;t[32]===C?e=t[33]:(e=e=>!C.has(e.path),t[32]=C,t[33]=e);let c=n.files.filter(e);w=v.length>0;let m=w&&`@min-[90rem]/guide:grid-cols-[minmax(0,1fr)_20rem]`;t[34]===m?T=t[35]:(T=G(`grid gap-8`,m),t[34]=m,t[35]=T),E=`flex min-w-0 flex-col gap-5`;let h=r+1,_;t[36]!==i||t[37]!==h?(_=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums @max-[56rem]/guide:hidden`,children:[`Stop `,h,` of `,i]}),t[36]=i,t[37]=h,t[38]=_):_=t[38];let x;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(W,{size:`xs`,variant:`ghost-muted`,className:`@min-[56rem]/guide:hidden`}),t[39]=x):x=t[39];let N=r+1,P;t[40]!==i||t[41]!==N?(P=(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[`Stop `,N,` of `,i]}),t[40]=i,t[41]=N,t[42]=P):P=t[42];let F=a&&`rotate-180`,I;t[43]===F?I=t[44]:(I=G(F),t[43]=F,t[44]=I);let L;t[45]===I?L=t[46]:(L=(0,$.jsx)(ge,{"aria-hidden":!0,className:I}),t[45]=I,t[46]=L);let R;t[47]!==P||t[48]!==L?(R=(0,$.jsxs)(ya,{render:x,children:[P,L]}),t[47]=P,t[48]=L,t[49]=R):R=t[49];let z=r===0,B;t[50]===p?B=t[51]:(B=()=>p(-1),t[50]=p,t[51]=B);let V;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(S,{"aria-hidden":!0}),t[52]=V):V=t[52];let H;t[53]!==z||t[54]!==B?(H=(0,$.jsx)(W,{size:`icon-xs`,variant:`outline`,"aria-label":`Previous stop`,disabled:z,onClick:B,children:V}),t[53]=z,t[54]=B,t[55]=H):H=t[55];let ee=r===i-1,te;t[56]===p?te=t[57]:(te=()=>p(1),t[56]=p,t[57]=te);let U;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(ge,{"aria-hidden":!0}),t[58]=U):U=t[58];let ne;t[59]!==ee||t[60]!==te?(ne=(0,$.jsx)(W,{size:`icon-xs`,variant:`outline`,"aria-label":`Next stop`,disabled:ee,onClick:te,children:U}),t[59]=ee,t[60]=te,t[61]=ne):ne=t[61];let ie;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsxs)(`span`,{"aria-hidden":!0,className:`ml-1 flex items-center gap-0.5 @max-[30rem]/guide:hidden`,children:[(0,$.jsx)(ea,{children:`J`}),(0,$.jsx)(ea,{children:`K`})]}),t[62]=ie):ie=t[62];let ae;t[63]!==H||t[64]!==ne?(ae=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[H,ne,ie]}),t[63]=H,t[64]=ne,t[65]=ae):ae=t[65];let oe;t[66]!==_||t[67]!==R||t[68]!==ae?(oe=(0,$.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[_,R,ae]}),t[66]=_,t[67]=R,t[68]=ae,t[69]=oe):oe=t[69];let se;t[70]===s?se=t[71]:(se=(0,$.jsx)(ma,{className:`@min-[56rem]/guide:hidden`,children:(0,$.jsx)(`div`,{className:`pt-3`,children:s})}),t[70]=s,t[71]=se),t[72]!==o||t[73]!==a||t[74]!==oe||t[75]!==se?(D=(0,$.jsxs)(Sa,{open:a,onOpenChange:o,children:[oe,se]}),t[72]=o,t[73]=a,t[74]=oe,t[75]=se,t[76]=D):D=t[76];let ce;t[77]===n.title?ce=t[78]:(ce=(0,$.jsx)(`h2`,{className:`text-lg font-semibold text-foreground`,children:n.title}),t[77]=n.title,t[78]=ce);let ue;t[79]===n.summary?ue=t[80]:(ue=n.summary.trim()===``?null:(0,$.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(Ku,{text:n.summary})}),t[79]=n.summary,t[80]=ue),t[81]!==ce||t[82]!==ue?(O=(0,$.jsxs)(`div`,{className:`flex max-w-[60rem] flex-col gap-2`,children:[ce,ue]}),t[81]=ce,t[82]=ue,t[83]=O):O=t[83],t[84]===n.attention?k=t[85]:(k=n.attention===null?null:(0,$.jsxs)($i,{controlAlignment:`first-line`,children:[(0,$.jsx)(re,{}),(0,$.jsx)(Xi,{children:_d[n.attention.kind]}),(0,$.jsx)(Qi,{children:(0,$.jsx)(`div`,{children:(0,$.jsx)(Ku,{text:n.attention.note})})})]}),t[84]=n.attention,t[85]=k),t[86]!==y||t[87]!==f||t[88]!==d||t[89]!==l||t[90]!==u||t[91]!==g||t[92]!==n.excerpts?(A=n.excerpts.length>0?(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:(0,$.jsx)(mn,{children:n.excerpts.map((e,t)=>(0,$.jsx)(ud,{excerpt:e,file:l.get(e.path)??null,loading:d,notes:y[t]??[],commenting:f,loadDiffFiles:u,onOpenFile:g},`${e.path}:${e.side}:${e.start}-${e.end}`))})}):null,t[86]=y,t[87]=f,t[88]=d,t[89]=l,t[90]=u,t[91]=g,t[92]=n.excerpts,t[93]=A):A=t[93],t[94]===v?j=t[95]:(j=(0,$.jsx)(sd,{notes:v,className:`@min-[90rem]/guide:hidden`}),t[94]=v,t[95]=j),M=c.length>0?(0,$.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:n.excerpts.length>0?`Also in this stop`:`Files in this stop`}),(0,$.jsx)(mn,{children:(0,$.jsx)(`ul`,{className:`flex flex-col overflow-hidden rounded-lg border border-border/60`,children:c.map(e=>{let t=l.get(e.path),n=t===void 0?null:Kt([t]);return(0,$.jsx)(`li`,{className:`border-border/60 not-first:border-t`,children:(0,$.jsxs)(Sa,{children:[(0,$.jsxs)(ya,{className:`group flex w-full min-w-0 items-center gap-2 px-3 py-2 text-left text-xs outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,$.jsx)(b,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground group-data-panel-open:rotate-90`}),(0,$.jsx)(le,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate font-mono text-foreground`,children:e.path}),e.note!==void 0&&e.note.trim()!==``?(0,$.jsx)(`span`,{className:`ml-auto min-w-0 truncate text-muted-foreground @max-[30rem]/guide:hidden`,children:(0,$.jsx)(Ku,{text:e.note,plain:!0})}):null,n===null?null:(0,$.jsx)(Sr,{additions:n.additions,deletions:n.deletions,className:`shrink-0 font-mono`})]}),(0,$.jsx)(ma,{animate:!1,children:t===void 0?(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:d?`Loading the diff...`:`This file is not in the loaded diff.`}):(0,$.jsx)(gd,{file:t,loadDiffFiles:u})})]})},e.path)})})})]}):null,t[4]=y,t[5]=f,t[6]=d,t[7]=C,t[8]=l,t[9]=r,t[10]=v,t[11]=u,t[12]=g,t[13]=o,t[14]=p,t[15]=a,t[16]=n.attention,t[17]=n.excerpts,t[18]=n.files,t[19]=n.summary,t[20]=n.title,t[21]=i,t[22]=s,t[23]=w,t[24]=T,t[25]=E,t[26]=D,t[27]=O,t[28]=k,t[29]=A,t[30]=j,t[31]=M}else w=t[23],T=t[24],E=t[25],D=t[26],O=t[27],k=t[28],A=t[29],j=t[30],M=t[31];let N;t[96]!==m||t[97]!==n.questions?(N=n.questions.length>0||m!==null?(0,$.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[n.questions.length>0?(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Questions to consider`}):null,(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5`,children:[n.questions.map(e=>m===null?(0,$.jsx)(`div`,{className:`text-sm text-foreground`,children:(0,$.jsx)(Ku,{text:e})},e):(0,$.jsxs)(`button`,{type:`button`,onClick:()=>m(e),className:`flex min-w-0 items-start gap-2 rounded-lg border border-border/60 px-3 py-1.5 text-left text-sm text-foreground outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,$.jsx)(fe,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`sr-only`,children:`Ask an agent: `}),(0,$.jsx)(`span`,{children:(0,$.jsx)(Ku,{text:e,plain:!0})})]},e)),m===null?null:(0,$.jsxs)(W,{size:`sm`,variant:`ghost-muted`,onClick:()=>m(``),children:[(0,$.jsx)(fe,{"aria-hidden":!0}),`Ask about this stop`]})]})]}):null,t[96]=m,t[97]=n.questions,t[98]=N):N=t[98];let P;t[99]!==c||t[100]!==h||t[101]!==p?(P=c===null?h===null?null:(0,$.jsxs)(W,{onClick:h,children:[(0,$.jsx)(H,{"aria-hidden":!0}),`Finish review`]}):(0,$.jsxs)(W,{className:`min-w-0`,onClick:()=>p(1),children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Next: `,c]}),(0,$.jsx)(Se,{"aria-hidden":!0})]}),t[99]=c,t[100]=h,t[101]=p,t[102]=P):P=t[102];let F;t[103]===P?F=t[104]:(F=(0,$.jsx)(`footer`,{className:`flex flex-wrap items-center justify-end gap-3 border-t border-border/60 pt-4`,children:P}),t[103]=P,t[104]=F);let I;t[105]!==N||t[106]!==F||t[107]!==E||t[108]!==D||t[109]!==O||t[110]!==k||t[111]!==A||t[112]!==j||t[113]!==M?(I=(0,$.jsxs)(`article`,{className:E,children:[D,O,k,A,j,M,N,F]}),t[105]=N,t[106]=F,t[107]=E,t[108]=D,t[109]=O,t[110]=k,t[111]=A,t[112]=j,t[113]=M,t[114]=I):I=t[114];let L;t[115]!==w||t[116]!==v?(L=w?(0,$.jsx)(`aside`,{className:`hidden @min-[90rem]/guide:block @min-[90rem]/guide:sticky @min-[90rem]/guide:top-4 @min-[90rem]/guide:self-start`,children:(0,$.jsx)(sd,{notes:v})}):null,t[115]=w,t[116]=v,t[117]=L):L=t[117];let R;return t[118]!==T||t[119]!==I||t[120]!==L?(R=(0,$.jsxs)(`div`,{className:T,children:[I,L]}),t[118]=T,t[119]=I,t[120]=L,t[121]=R):R=t[121],R}function yd(e){return e.path}var bd=new Map;function xd(e){let t=(0,Q.c)(23),{environmentId:n,reference:r,headSha:i,wantedPaths:a}=e,o;t[0]===r?o=t[1]:(o=Ri(r),t[0]=r,t[1]=o);let s=`${n}:${o}:${i}`,c;t[2]===s?c=t[3]:(c={key:s,cursor:null,done:!1,files:bd},t[2]=s,t[3]=c);let[l,u]=(0,Z.useState)(c),d,f,p,m;t[4]!==n||t[5]!==s||t[6]!==l||t[7]!==r||t[8]!==a?(d=l.key===s?l:{key:s,cursor:null,done:!1,files:bd},f=a.some(e=>!d.files.has(e))&&!d.done,p=At,m=f?Ur.diff({environmentId:n,input:{...r,...d.cursor===null?{}:{cursor:d.cursor}}}):null,t[4]=n,t[5]=s,t[6]=l,t[7]=r,t[8]=a,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(d=t[9],f=t[10],p=t[11],m=t[12]);let h=p(m),g=h.data,_=d.cursor,v,y;t[13]!==_||t[14]!==g||t[15]!==s?(v=()=>{g!==null&&u(e=>{let t=e.key===s?e:{key:s,cursor:null,done:!1,files:bd};if(t.cursor!==_||t.done)return t;let n=zt(g.patch,`pull-request-guide:${s}:${_??`first`}`),r=new Map(t.files);if(n?.kind===`files`)for(let e of n.files)r.set(Yt(e),e);return{key:s,cursor:g.nextCursor,done:g.nextCursor===null,files:r}})},y=[_,g,s],t[13]=_,t[14]=g,t[15]=s,t[16]=v,t[17]=y):(v=t[16],y=t[17]),(0,Z.useEffect)(v,y);let b=f&&h.error===null,x=f?h.error:null,S;return t[18]!==d.files||t[19]!==h.refresh||t[20]!==b||t[21]!==x?(S={files:d.files,loading:b,error:x,retry:h.refresh},t[18]=d.files,t[19]=h.refresh,t[20]=b,t[21]=x,t[22]=S):S=t[22],S}function Sd(e){let t=(0,Q.c)(63),{environmentId:n,reference:r,guide:i,banner:a,active:o,commenting:s,onAsk:c,onFinish:l,onOpenFile:u}=e,d;t[0]!==n||t[1]!==i.headSha||t[2]!==r?(d=Ji(Ki(n,r),i.headSha),t[0]=n,t[1]=i.headSha,t[2]=r,t[3]=d):d=t[3];let f=d,p=qi(f),m;t[4]===f?m=t[5]:(m=e=>Wi.getState().setProgress(f,t=>({...t,...e(t)})),t[4]=f,t[5]=m);let h=m,[g,_]=(0,Z.useState)(!1),v=i.stops.length,y=Math.max(Math.min(p.position,v-1),0),b=i.stops[y]??null,x;t[6]===b?x=t[7]:(x=b===null?[]:Ju(b),t[6]=b,t[7]=x);let S=x,C;t[8]!==n||t[9]!==i.headSha||t[10]!==r||t[11]!==S?(C={environmentId:n,reference:r,headSha:i.headSha,wantedPaths:S},t[8]=n,t[9]=i.headSha,t[10]=r,t[11]=S,t[12]=C):C=t[12];let w=xd(C),T=jt(Ur.diffFileContents),E=`pull-request-guide:${f}`,D;t[13]!==n||t[14]!==T||t[15]!==r||t[16]!==E?(D=Qo(T,{environmentId:n,reference:r,commit:null,cacheKey:E}),t[13]=n,t[14]=T,t[15]=r,t[16]=E,t[17]=D):D=t[17];let O=D,k=(0,Z.useRef)(null),A;t[18]!==y||t[19]!==h?(A=e=>{h(t=>({position:e,seen:e>y?new Set(t.seen).add(y):t.seen})),_(!1),k.current?.scrollTo({top:0})},t[18]=y,t[19]=h,t[20]=A):A=t[20];let j=A,M;t[21]!==j||t[22]!==y||t[23]!==v?(M=e=>j(qu(y,e,v)),t[21]=j,t[22]=y,t[23]=v,t[24]=M):M=t[24];let N=M,P;t[25]===N?P=t[26]:(P=e=>{e.defaultPrevented||e.isComposing||xa()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key!==`j`&&e.key!==`k`||Gi(e.target)||(e.preventDefault(),N(e.key===`j`?1:-1))},t[25]=N,t[26]=P);let F=(0,Z.useEffectEvent)(P),I;t[27]!==o||t[28]!==F?(I=()=>{if(!o)return;let e=e=>F(e);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},t[27]=o,t[28]=F,t[29]=I):I=t[29];let L;t[30]===o?L=t[31]:(L=[o],t[30]=o,t[31]=L),(0,Z.useEffect)(I,L);let R;t[32]!==j||t[33]!==i.stops||t[34]!==y||t[35]!==p.seen?(R=(0,$.jsx)(`aside`,{className:`sticky top-4 self-start @max-[56rem]/guide:hidden`,children:(0,$.jsx)(rd,{stops:i.stops,position:y,seen:p.seen,onSelect:j})}),t[32]=j,t[33]=i.stops,t[34]=y,t[35]=p.seen,t[36]=R):R=t[36];let z;t[37]===w.error?z=t[38]:(z=w.error===null?null:(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`The diff could not be loaded, so excerpts are missing: `,w.error]}),t[37]=w.error,t[38]=z);let B;t[39]!==s||t[40]!==w.files||t[41]!==w.loading||t[42]!==j||t[43]!==i.stops||t[44]!==O||t[45]!==c||t[46]!==l||t[47]!==u||t[48]!==y||t[49]!==g||t[50]!==N||t[51]!==b||t[52]!==v||t[53]!==p.seen||t[54]!==h?(B=b===null?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This change has no files to tour.`}):(0,$.jsx)(vd,{stop:b,index:y,stopCount:v,railOpen:g,onRailOpenChange:_,stopList:(0,$.jsx)(rd,{stops:i.stops,position:y,seen:p.seen,onSelect:j}),nextTitle:i.stops[y+1]?.title??null,files:w.files,loadDiffFiles:O,diffLoading:w.loading,commenting:s,onStep:N,onAsk:c===null?null:e=>c(y,e),onFinish:l===null?null:()=>{h(e=>({seen:new Set(e.seen).add(y)})),l()},onOpenFile:u},y),t[39]=s,t[40]=w.files,t[41]=w.loading,t[42]=j,t[43]=i.stops,t[44]=O,t[45]=c,t[46]=l,t[47]=u,t[48]=y,t[49]=g,t[50]=N,t[51]=b,t[52]=v,t[53]=p.seen,t[54]=h,t[55]=B):B=t[55];let V;t[56]!==a||t[57]!==z||t[58]!==B?(V=(0,$.jsxs)(`main`,{className:`flex min-w-0 flex-col gap-4`,children:[a,z,B]}),t[56]=a,t[57]=z,t[58]=B,t[59]=V):V=t[59];let H;return t[60]!==R||t[61]!==V?(H=(0,$.jsx)(`div`,{ref:k,className:`@container/guide h-full overflow-y-auto scrollbar-gutter-both`,children:(0,$.jsxs)(`div`,{className:`mx-auto grid max-w-[100rem] gap-6 px-4 py-4 @min-[56rem]/guide:grid-cols-[16rem_minmax(0,1fr)] @min-[90rem]/guide:gap-8 @min-[90rem]/guide:px-6`,children:[R,V]})}),t[60]=R,t[61]=V,t[62]=H):H=t[62],H}function Cd(e){let t=(0,Q.c)(28),{environmentId:n,reference:r,title:i}=e,a;t[0]!==n||t[1]!==r?(a=Ur.reviewGuide({environmentId:n,input:r}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=At(a),s;t[3]===n?s=t[4]:(s=Ur.generateReviewGuide.permissionAtom(n),t[3]=n,t[4]=s);let c=Ie(s),l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[5]=l):l=t[5];let u=jt(Ur.generateReviewGuide,l),[d,f]=(0,Z.useState)(!1),p=o.data,m=d||p?.run?._tag===`Running`,h;t[6]!==p||t[7]!==n||t[8]!==r||t[9]!==i?(h=()=>Wi.getState().watch({environmentId:n,reference:r,title:i,previousGuideAt:p?.guide?.generatedAt??null,previousFailedAt:p?.run?._tag===`Failed`?p.run.failedAt:null,since:Date.now()}),t[6]=p,t[7]=n,t[8]=r,t[9]=i,t[10]=h):h=t[10];let g=(0,Z.useEffectEvent)(h),_;t[11]!==p?.run?._tag||t[12]!==g?(_=()=>{p?.run?._tag===`Running`&&g()},t[11]=p?.run?._tag,t[12]=g,t[13]=_):_=t[13];let v=p?.run?._tag,y;t[14]===v?y=t[15]:(y=[v],t[14]=v,t[15]=y),(0,Z.useEffect)(_,y);let b;t[16]!==n||t[17]!==u||t[18]!==r||t[19]!==m||t[20]!==g?(b=async()=>{if(m)return;f(!0),g();let e=await u({environmentId:n,input:r});f(!1),e._tag===`Failure`&&(Wi.getState().settle(Ki(n,r)),bt.add({type:`error`,title:`Could not start a review guide`,description:di(Ge(e),`Check the review guide model in Settings → Source Control.`)}))},t[16]=n,t[17]=u,t[18]=r,t[19]=m,t[20]=g,t[21]=b):b=t[21];let x=b,S;return t[22]!==c||t[23]!==p||t[24]!==o||t[25]!==m||t[26]!==x?(S={query:o,data:p,running:m,canWrite:c,write:x},t[22]=c,t[23]=p,t[24]=o,t[25]=m,t[26]=x,t[27]=S):S=t[27],S}function wd(e){let t=(0,Q.c)(68),{environmentId:n,reference:r,title:i,workspaceRoot:a,active:o,canComment:s,onAskAboutLines:c,onAskAboutStop:l,onFinishReview:u,onOpenFile:d,onTourShown:f}=e,p;t[0]!==n||t[1]!==r||t[2]!==i?(p={environmentId:n,reference:r,title:i},t[0]=n,t[1]=r,t[2]=i,t[3]=p):p=t[3];let{query:m,data:h,running:g,canWrite:_,write:v}=Cd(p),y;t[4]!==n||t[5]!==r?(y=Ki(n,r),t[4]=n,t[5]=r,t[6]=y):y=t[6];let b=y,x;t[7]===r?x=t[8]:(x=Ri(r),t[7]=r,t[8]=x);let S=x,C=zi(r),w=Li(Ed),T=Li(Td),E;t[9]!==w||t[10]!==s||t[11]!==c||t[12]!==C||t[13]!==T||t[14]!==S?(E=!s&&c===null?null:{canComment:s,pending:C,onComment:e=>{let{path:t,oldPath:n,position:r,body:i}=e;return w(S,{id:Bi(),path:t,...n===null?{}:{oldPath:n},position:r,body:i})},onRemove:e=>T(S,e),onAskAgent:c},t[9]=w,t[10]=s,t[11]=c,t[12]=C,t[13]=T,t[14]=S,t[15]=E):E=t[15];let D=E,O,k;t[16]!==o||t[17]!==b?(O=()=>{if(o)return Wi.getState().setShown(b),()=>{Wi.getState().shownKey===b&&Wi.getState().setShown(null)}},k=[o,b],t[16]=o,t[17]=b,t[18]=O,t[19]=k):(O=t[18],k=t[19]),(0,Z.useEffect)(O,k);let A=h?.guide??null,M=o&&A!==null,N;t[20]===f?N=t[21]:(N=()=>f?.(),t[20]=f,t[21]=N);let P=(0,Z.useEffectEvent)(N),F;t[22]!==P||t[23]!==M?(F=()=>{M&&P()},t[22]=P,t[23]=M,t[24]=F):F=t[24];let I;t[25]===M?I=t[26]:(I=[M],t[25]=M,t[26]=I),(0,Z.useEffect)(F,I);let L=h?.run??null,R=h?.currentHeadSha??null,z=A!==null&&R!==null&&R!==A.headSha,B=L?._tag===`Failed`&&L.headSha===R?L.detail:null,V;t[27]!==_||t[28]!==g||t[29]!==v?(V=(e,t)=>_?(0,$.jsxs)(W,{size:t,variant:`outline`,disabled:g,onClick:()=>void v(),children:[g?(0,$.jsx)(yt,{}):(0,$.jsx)(Ve,{"aria-hidden":!0,className:`size-3.5`}),g?`Reading the change...`:e]}):null,t[27]=_,t[28]=g,t[29]=v,t[30]=V):V=t[30];let H=V;if(A===null){if(m.isPending&&h===null){let e;return t[31]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-48 items-center justify-center`,children:(0,$.jsx)(yt,{})}),t[31]=e):e=t[31],e}let e=g?`Writing a review guide`:`No review guide yet`,n;t[32]===e?n=t[33]:(n=(0,$.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e}),t[32]=e,t[33]=n);let r=B??m.error??(g?`An agent is reading the change. A large one takes a few minutes. You can leave; you will be told when it is ready.`:`A guide is a tour of the change: stops through the code in reading order, with the calls only a maintainer can make.`),i;t[34]===r?i=t[35]:(i=(0,$.jsx)(`p`,{className:`max-w-md text-xs text-muted-foreground`,children:r}),t[34]=r,t[35]=i);let a=B===null?`Write guide`:`Try again`,o;t[36]!==a||t[37]!==H?(o=H(a,`sm`),t[36]=a,t[37]=H,t[38]=o):o=t[38];let s;return t[39]!==n||t[40]!==i||t[41]!==o?(s=(0,$.jsxs)(`div`,{className:`flex min-h-48 flex-col items-center justify-center gap-2 px-4 py-10 text-center`,children:[n,i,o]}),t[39]=n,t[40]=i,t[41]=o,t[42]=s):s=t[42],s}let ee;t[43]!==_||t[44]!==B||t[45]!==g||t[46]!==z||t[47]!==H?(ee=z||B!==null||g?(0,$.jsxs)($i,{variant:g?`info`:`warning`,children:[g?(0,$.jsx)(yt,{}):(0,$.jsx)(j,{}),(0,$.jsx)(Qi,{children:g?`Rewriting this guide. You will be told when the new one is ready.`:B??`Written before the latest push.`}),!g&&_?(0,$.jsx)(Zi,{children:H(`Rewrite`,`xs`)}):null]}):null,t[43]=_,t[44]=B,t[45]=g,t[46]=z,t[47]=H,t[48]=ee):ee=t[48];let te=ee,U;t[49]!==n||t[50]!==a?(U={environmentId:n,cwd:a},t[49]=n,t[50]=a,t[51]=U):U=t[51];let ne;t[52]!==A||t[53]!==l?(ne=l===null?null:(e,t)=>{let n=A.stops[e];n!==void 0&&l(n,e,t)},t[52]=A,t[53]=l,t[54]=ne):ne=t[54];let re;t[55]!==o||t[56]!==te||t[57]!==D||t[58]!==n||t[59]!==A||t[60]!==u||t[61]!==d||t[62]!==r||t[63]!==ne?(re=(0,$.jsx)(Sd,{environmentId:n,reference:r,guide:A,banner:te,active:o,commenting:D,onAsk:ne,onFinish:u,onOpenFile:d}),t[55]=o,t[56]=te,t[57]=D,t[58]=n,t[59]=A,t[60]=u,t[61]=d,t[62]=r,t[63]=ne,t[64]=re):re=t[64];let ie;return t[65]!==U||t[66]!==re?(ie=(0,$.jsx)(Gu,{value:U,children:re}),t[65]=U,t[66]=re,t[67]=ie):ie=t[67],ie}function Td(e){return e.removeComment}function Ed(e){return e.addComment}function Dd(e){let t=(0,Q.c)(12),[n,r]=(0,Z.useState)(null),i=n?.scopeKey===e?n:null,a,o;t[0]!==n||t[1]!==e?(a=()=>{if(!n)return;let t=()=>r(null);if(n.scopeKey!==e){t();return}let i=e=>{e.target instanceof Node&&!n.element.contains(e.target)&&t()},a=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),t())},o=window.setTimeout(t,3e3);return document.addEventListener(`pointerdown`,i,!0),window.addEventListener(`keydown`,a,!0),window.addEventListener(`blur`,t),()=>{window.clearTimeout(o),document.removeEventListener(`pointerdown`,i,!0),window.removeEventListener(`keydown`,a,!0),window.removeEventListener(`blur`,t)}},o=[n,e],t[0]=n,t[1]=e,t[2]=a,t[3]=o):(a=t[2],o=t[3]),(0,Z.useEffect)(a,o);let s;t[4]===i?.action?s=t[5]:(s=e=>i?.action===e,t[4]=i?.action,t[5]=s);let c;t[6]!==i||t[7]!==e?(c=(t,n)=>({onClick:a=>{i?.action===t&&i.element===a.currentTarget?(r(null),n()):r({scopeKey:e,action:t,element:a.currentTarget})},onBlur:()=>r(null)}),t[6]=i,t[7]=e,t[8]=c):c=t[8];let l;return t[9]!==s||t[10]!==c?(l={isArmed:s,props:c},t[9]=s,t[10]=c,t[11]=l):l=t[11],l}var Od={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 turn on auto-merge`,"disable-auto-merge":`Could not turn off auto-merge`,revert:`Could not open a revert pull request`,"delete-branch":`Could not delete this branch`,"approve-workflows":`Could not approve workflows`},kd={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 to the branch — one from a fork also needs its author to allow edits from maintainers — and that it does not conflict with the base.`,"enable-auto-merge":`The host refused it. Check that this repository allows auto-merge, that you have write access, and that there is something left for it to wait on.`,"disable-auto-merge":`The host refused it. Check that you have write access, and that the merge has not already happened.`,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.`},Ad=`The host refused it. A rebase stops at the first commit that does not apply cleanly; updating with a merge commit may still work.`,jd=[{value:`summary`,label:`Summary`},{value:`guide`,label:`Guide`},{value:`timeline`,label:`Timeline`},{value:`code`,label:`Code`}],Md=()=>n(()=>import(`./PullRequestCodeTab-DCUJxgcQ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336])),Nd=(0,Z.lazy)(Md),Pd=new Map,Fd=e=>typeof e==`string`?e:oe(e);function Id(e){let t=(0,Q.c)(12),{environments:n,value:r,onChange:i,disabled:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(te,{}),t[0]=o):o=t[0];let s;t[1]===i?s=t[2]:(s=e=>i(e),t[1]=i,t[2]=s);let c;if(t[3]!==a||t[4]!==n){let e;t[6]===a?e=t[7]:(e=e=>(0,$.jsx)(Me,{value:e.environmentId,disabled:a,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Yi,{kind:e.machine??`server`,className:`size-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.environmentId),t[6]=a,t[7]=e),c=n.map(e),t[3]=a,t[4]=n,t[5]=c}else c=t[5];let l;return t[8]!==s||t[9]!==c||t[10]!==r?(l=(0,$.jsxs)($.Fragment,{children:[o,(0,$.jsx)(Ee,{value:r,onValueChange:s,children:c})]}),t[8]=s,t[9]=c,t[10]=r,t[11]=l):l=t[11],l}var Ld=(e,t)=>{e.preventDefault(),e.stopPropagation(),jl({url:t.url,openLabel:kl(Fr.get(t.provider)),position:{x:e.clientX,y:e.clientY}})};function Rd(e){let t=(0,Q.c)(28),{baseBranch:n,freshness:r,pending:i,onUpdate:a,iconClassName:o,className:s,children:c}=e,l;t[0]===r.behindBy?l=t[1]:(l=r.behindBy===null?``:` by ${r.behindBy.toLocaleString()} ${r.behindBy===1?`commit`:`commits`}`,t[0]=r.behindBy,t[1]=l);let u=`This branch is out-of-date with ${n}${l}.`,d;t[2]===s?d=t[3]:(d=G(`inline-flex min-w-0 shrink-0 cursor-help items-center gap-1 rounded-sm text-warning-foreground outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,s),t[2]=s,t[3]=d);let f;t[4]!==u||t[5]!==d?(f=(0,$.jsx)(`button`,{type:`button`,"aria-label":u,className:d}),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=G(`size-3.5 shrink-0`,o),t[7]=o,t[8]=p);let m;t[9]===p?m=t[10]:(m=(0,$.jsx)(j,{"aria-hidden":!0,className:p}),t[9]=p,t[10]=m);let h;t[11]!==c||t[12]!==f||t[13]!==m?(h=(0,$.jsxs)(Jr,{openOnHover:!0,delay:0,closeDelay:120,render:f,children:[c,m]}),t[11]=c,t[12]=f,t[13]=m,t[14]=h):h=t[14];let g;t[15]===u?g=t[16]:(g=(0,$.jsx)(`p`,{className:`text-xs text-foreground`,children:u}),t[15]=u,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Changes can be cleanly merged.`}),t[17]=_):_=t[17];let v;t[18]!==r.methods||t[19]!==a||t[20]!==i?(v=r.methods.length>0?(0,$.jsx)(`span`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:r.methods.map(e=>(0,$.jsxs)(W,{size:`xs`,variant:`outline`,disabled:i,onClick:()=>a(e),children:[(0,$.jsx)(X.merged,{"aria-hidden":!0,className:`size-3`}),e===`rebase`?`Update with rebase`:`Update branch`]},e))}):null,t[18]=r.methods,t[19]=a,t[20]=i,t[21]=v):v=t[21];let y;t[22]!==g||t[23]!==v?(y=(0,$.jsxs)(Kr,{align:`start`,side:`bottom`,className:`max-w-80`,padding:`compact`,children:[g,_,v]}),t[22]=g,t[23]=v,t[24]=y):y=t[24];let b;return t[25]!==y||t[26]!==h?(b=(0,$.jsxs)(Yr,{children:[h,y]}),t[25]=y,t[26]=h,t[27]=b):b=t[27],b}function zd({environmentId:e,shortcutsEnabled:t,getShortcutContext:n,threadRef:r=null,reference:i,listEntry:o=null,refreshToken:c=0,onActed:l,onClose:f,context:p=`page`,composerDraftTarget:h,onBack:g,onSelectPullRequest:v,onGuideShown:y}){let b=Ke(),x=Ye(),S=x.find(t=>t.id===i.projectId&&t.environmentId===e),C=S?.repositoryIdentity,w=b.get(e)?.environment.capabilities.threadPullRequests===!0,E=(0,Z.useMemo)(()=>w?mi(i,C):{projectId:i.projectId,repository:i.repository,number:i.number},[i,C,w]),j=`${E.projectId}:${E.host??``}:${E.repository}#${E.number}`,M=o?.projectId===E.projectId&&o.repository.toLowerCase()===E.repository.toLowerCase()&&(E.host===void 0||o.host.toLowerCase()===E.host.toLowerCase())&&o.number===E.number?o:null,[N,P]=(0,Z.useState)(!1),[L,R]=(0,Z.useState)(0),[B,V]=(0,Z.useState)(`summary`),[U,re]=(0,Z.useState)(`newest`),[ae,oe]=(0,Z.useState)(()=>({pullRequestKey:j,oid:null})),le=ae.pullRequestKey===j?ae.oid:null,ue=e=>{oe({pullRequestKey:j,oid:e})},pe=e=>{ue(e),V(`code`)},[me,ve]=(0,Z.useState)(null),xe=e=>{ue(null),ve(t=>({path:e,nonce:(t?.nonce??0)+1})),Md(),V(`code`)},Se=Wi(t=>t.openRequestKey===Ki(e,E));Se&&B!==`guide`&&V(`guide`),(0,Z.useEffect)(()=>{Se&&Wi.getState().requestOpen(null)},[Se]);let Ce=`${e}:${j}`,[we,Te]=(0,Z.useState)(()=>({key:Ce,tabs:new Set([`summary`])})),De=we.key===Ce?we.tabs:new Set([B]);(0,Z.useEffect)(()=>{Te(e=>e.key===Ce?e.tabs.has(B)?e:{key:Ce,tabs:new Set(e.tabs).add(B)}:{key:Ce,tabs:new Set([B])})},[B,Ce]);let[Ae,je]=(0,Z.useState)(!1),Le=(0,Z.useRef)({});(0,Z.useEffect)(()=>{je(Le.current[B]??!1)},[B]);let Re=Ae,Be=(0,Z.useRef)({}),Ue=(0,Z.useMemo)(()=>({summary:e=>{Be.current.summary=e},timeline:e=>{Be.current.timeline=e},code:e=>{Be.current.code=e}}),[]),We=(0,Z.useRef)(null),qe=(0,Z.useRef)(null),Je=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{let e=Je.current;e!==null&&(Je.current=null,Re&&e.tab===B&&Be.current[B]===e.scroller&&(e.scroller.scrollTop=Math.max(0,e.scroller.scrollTop+e.delta)))},[Re,B]);let Xe=Ui(e=>e.pullRequestMergeMethod),Ze=Ui(e=>e.setPullRequestMergeMethod),Qe=Ea(e,E.projectId),nt=(0,Z.useMemo)(()=>Qe(),[Qe]),[rt,it]=(0,Z.useState)(null),at=e=>{it({pullRequestKey:j,method:e})},ot=Dd(j),[st,ct]=(0,Z.useState)(null),lt=Ot(e,he),ut=At(Ur.detail({environmentId:e,input:E})),dt=At(Ur.activity({environmentId:e,input:E})),ft=zr(e),[pt,mt]=(0,Z.useState)(()=>oi(typeof window>`u`?void 0:window.localStorage,e,E));(0,Z.useEffect)(()=>{mt(oi(typeof window>`u`?void 0:window.localStorage,e,E))},[e,j,E.projectId,E.repository,E.number]),(0,Z.useEffect)(()=>{ut.data!==null&&(gi(typeof window>`u`?void 0:window.localStorage,e,E,ut.data),mt(ut.data))},[ut.data,e,j,E.projectId,E.repository,E.number]);let ht=Zr({live:ut.data,cached:pt,reference:E}),gt=(0,Z.useMemo)(()=>M===null?null:Br(M),[M]),_t=(0,Z.useMemo)(()=>ut.data===null?null:{...ut.data,checksState:hr(ut.data.checks)},[ut.data]),vt=Wr(e,E,_t,ut.dataUpdatedAt),yt=(0,Z.useMemo)(()=>Hr(ht,Hr(vt,gt)),[ht,vt,gt]),xt=(0,Z.useMemo)(()=>ht===null||yt===null||yt===ht?ht:{...ht,title:yt.title,state:yt.state,headBranch:yt.headBranch,baseBranch:yt.baseBranch,updatedAt:yt.updatedAt,author:yt.author??ht.author,additions:yt.additions??ht.additions,deletions:yt.deletions??ht.deletions,changedFiles:yt.changedFiles??ht.changedFiles,mergeability:yt.mergeability??ht.mergeability,closedAt:yt.closedAt===void 0?ht.closedAt:yt.closedAt,mergedAt:yt.mergedAt===void 0?ht.mergedAt:yt.mergedAt,isDraft:yt.isDraft??ht.isDraft},[ht,yt]),Ct=dt.data,K=(0,Z.useMemo)(()=>xt===null?null:{...xt,capabilities:lt?xt.capabilities:{...xt.capabilities,reactions:!1,edit:{changeRequest:!1,comment:!1}},viewerPermissions:lt?xt.viewerPermissions:{...xt.viewerPermissions,actions:[],comment:!1,resolve:!1,verdicts:[],requestReviewers:!1,updateMethods:[],labels:!1},author:Ct?.author??xt.author,reviewers:Ct?.reviewers??xt.reviewers,comments:Ct?.comments??[],commentCount:Ct?.commentCount??0,commentsTruncated:Ct?.commentsTruncated??!1,reviewThreads:Ct?.reviewThreads??[],commits:Ct?.commits??[],reactions:Ct?.reactions??[]},[Ct,lt,xt]),Pt=K??yt,Ft=Ie(Dt),{copyToClipboard:It}=St({target:`pull request reference`,onCopy:e=>bt.add({type:`success`,title:`${e} copied`}),onError:(e,t)=>bt.add({type:`error`,title:`Failed to copy ${t}`,description:e.message})}),Lt=(0,Z.useEffectEvent)(e=>{!t||e.defaultPrevented||xa()||sr(e,Ft,{context:n()})===`pullRequest.copyNumber`&&(e.preventDefault(),e.stopPropagation(),e.repeat||It(`#${E.number}`,`PR number`))});(0,Z.useEffect)(()=>{let e=e=>Lt(e);return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,Z.useEffect)(()=>{K?.autoMergeMethod!==void 0&&at(K.autoMergeMethod)},[K?.autoMergeMethod,j]);let Rt=K===null?null:$e(K.url),zt=Fr.get(K?.provider),Bt=(0,Z.useMemo)(()=>({repositoryUrl:Rt===null?null:zt.referenceAutolinkRepositoryUrl(Rt),threadRef:r}),[zt,Rt,r]),Vt=K?.author&&Rt!==null?zt.authorProfileUrl(K.author.login,Rt):null,Ht=Pt?si(Pt.provider,Pt.number,Pt.headBranch,K?.headRepositoryNameWithOwner,$e(Pt.url)):ei(E,C),Ut=(0,Z.useCallback)(e=>{bt.add({type:`error`,title:`Could not copy checkout command`,description:e.message})},[]),Wt=At(K===null?null:Nt.listRefs({environmentId:e,input:{cwd:K.workspaceRoot,includeMatchingRemoteRefs:!0,limit:2}})),Gt=K!==null&&Pi(K.baseBranch,Wt.data?.refs??[]),Kt=Cc(e,(0,Z.useMemo)(()=>K===null||K.capabilities.stacks!==!0||!w?null:{...E,host:E.host??et(K.url)?.host},[K,E,w])),qt=Kt.data,Jt=w&&K?.capabilities.stacks===!0&&K.capabilities.stackActions===!0&&b.get(e)?.environment.capabilities.pullRequestStackActions===!0,Yt=Ai({supportsStackActions:Jt,hasStack:qt!==null,stackPending:!Kt.isFresh,stackError:Kt.error}),Xt=dt.isPending&&Ct===null,Zt=Ct===null?dt.error:null,Qt=(0,Z.useCallback)(()=>{ut.refresh(),dt.refresh(),Kt.refresh()},[dt.refresh,ut.refresh,Kt.refresh]),[$t,en]=(0,Z.useState)(0),tn=$t+(ft??0),nn=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(!xt)return;let e={key:Ce,updatedAt:xt.updatedAt};if(ti(nn.current,e)){if(dt.isPending)return;dt.refresh(),en(e=>e+1)}nn.current=e},[dt.isPending,dt.refresh,xt,Ce]),Lc(()=>{ut.refresh()},{key:`pull-request:${e}:${j}`});let rn=jt(Ur.invalidate,{reportFailure:!1}),[an,on]=(0,Z.useState)(!1),sn=an||ut.isPending,cn=(0,Z.useCallback)(async()=>{on(!0);try{await rn({environmentId:e,input:{reference:E}}),Qt(),en(e=>e+1)}finally{on(!1)}},[e,rn,E,Qt]),ln=(0,Z.useRef)(c);(0,Z.useEffect)(()=>{ln.current!==c&&(ln.current=c,cn())},[c,cn]);let un=jt(Ur.runAction,{reportFailure:!1}),dn=jt(Ur.comment,{reportFailure:!1}),[fn,pn]=(0,Z.useState)(null),mn=fn!==null,hn=jt(Ur.update,{reportFailure:!1}),[gn,_n]=(0,Z.useState)(null),vn=gn?.pullRequestKey===j?gn.text:null,[yn,bn]=(0,Z.useState)(!1),xn=Hi(),{environments:Sn}=wt(),Cn=(0,Z.useMemo)(()=>{let t=x.find(t=>t.id===E.projectId&&t.environmentId===e)?.repositoryIdentity;return tt(t,E.repository,E.number)},[e,x,E.number,E.projectId,E.repository]),wn=(0,Z.useMemo)(()=>p===`page`?bc({environmentId:e,projectId:E.projectId},x,Sn.map(e=>({environmentId:e.environmentId,label:e.label,machine:be(e.serverConfig)}))):[],[p,e,Sn,x,E.projectId]),[Tn,En]=(0,Z.useState)(null),On=Tn?.pullRequestKey===j?Tn.environmentId:e,An=wn.find(e=>e.environmentId===On)??null,jn=An?.environmentId??e,Mn=An?.workspaceRoot??K?.workspaceRoot??S?.workspaceRoot??null,Nn=Ot(jn,I),Pn=Da({environmentId:jn,cwd:Mn}),Fn=async(t,n,r)=>{l?.(t,`sent`);let i=await un({environmentId:e,input:{...E,action:t,...n?{mergeMethod:n}:{},...r?{updateMethod:r}:{}}});if(pn(null),i._tag===`Failure`){let e=Ge(i),n=r===`rebase`?Ad:kd[t];return bt.add({type:`error`,title:Od[t],description:di(e,n)}),l?.(t,`failed`),!1}return t===`revert`&&bt.add({type:`success`,title:`Revert pull request opened`}),t===`delete-branch`&&bt.add({type:`success`,title:`Branch deleted`}),Ti(t)?cn():Qt(),l?.(t,`done`),!0},In=async(e,t,n)=>!lt||fn!==null?!1:(pn(e),Fn(e,t,n)),Ln=async(t,n)=>!lt||fn!==null?{commentPosted:!1}:(pn(n),(await dn({environmentId:e,input:{...E,body:t}}))._tag===`Failure`?(pn(null),bt.add({type:`error`,title:`Could not post the comment`}),{commentPosted:!1}):(await Fn(n)||Qt(),{commentPosted:!0})),Rn=async t=>{let n=t.trim();if(!lt||K===null||yn)return;if(n.length===0||n===K.title){_n(null);return}bn(!0);let r=await hn({environmentId:e,input:{...E,title:n}});bn(!1),r._tag===`Failure`?bt.add({type:`error`,title:`The title could not be saved`,description:di(Ge(r),`The host refused the new title.`)}):(_n(null),Qt())},zn=h??null,Bn=Pn.isAllowed&&Nn,Hn=zn!==null||Bn,Un=ui(zn!==null),Wn=Cd({environmentId:e,reference:E,title:K?.title??null}),Gn=()=>{Wn.write(),Wn.data?.guide??V(`guide`)},Kn=(e,t)=>{let n=u.getState(),r=n.getComposerDraft(e),i=Fd(e),a=new Set((r?.reviewComments??[]).map(e=>e.id)),o=new Set((t.reviewComments??[]).filter(e=>a.has(e.id)).map(e=>e.id)),s=ai(r?.prompt??``,r?.reviewComments??[],o),c=Fi({prompt:s,lastHandoffPrompt:Pd.get(i)},t.prompt);Pd.set(i,t.prompt),n.setPrompt(e,c),n.setReviewComments(e,yi(r?.reviewComments??[],t.reviewComments??[]));for(let r of t.reviewComments??[])o.has(r.id)&&n.addReviewComment(e,r,{allowDuplicateReference:!0,insertAtCaret:!1})},qn=async(e,t,n)=>{let r=n??await xn(e).then(e=>e,()=>null);return r===null?null:(t===null||Kn(r.draftId,t),r)},Jn=async(t,n,r)=>{if(!K||st!==null)return;if(zn!==null){Kn(zn,n),bt.add({type:`success`,title:`Added to the composer`,description:n.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.`});return}ct(t);let i=z(jn,An?.projectId??K.projectId),a=await qn(i,n);if(ct(null),a!==null&&r?.keepGuide===!0){let t=u.getState().getDraftSession(a.draftId);t!==null&&(Mt.getState().openPullRequest(T(t.environmentId,t.threadId),{environmentId:e,projectId:E.projectId,...E.host===void 0?{}:{host:E.host},repository:E.repository,number:E.number,url:K.url}),Wi.getState().requestOpen(Ki(e,E)))}a===null?bt.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`}):bt.add({type:`success`,title:`Asked in a thread`,description:n.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.`})},Yn=async(e,t,n=`worktree`)=>{if(!Pt||st!==null)return;if(zn!==null&&t!==null){Kn(zn,t),bt.add({type:`success`,title:`Added to the composer`,description:`The task is in the composer — read it over, then send.`});return}if(Mn===null||!Pn.isAllowed||!kt(jn,`source-control:write`)||n===`worktree`&&!kt(jn,`orchestration:operate`))return;ct(e);let r=bt.add({type:`loading`,title:`Preparing the pull request checkout...`}),i=z(jn,An?.projectId??Pt.projectId),a=await xn(i).then(e=>e,()=>null);if(a===null){ct(null),bt.update(r,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let o=await Pn.run({reference:Pt.url,mode:n,threadId:a.threadId});if(o._tag===`Failure`){ct(null);let e=Pn.error instanceof Error?Pn.error.message:null;bt.update(r,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await xn(i,{branch:o.value.branch,worktreePath:o.value.worktreePath,envMode:o.value.worktreePath===null?`local`:`worktree`}).then(e=>e!==null,()=>!1)){ct(null),bt.update(r,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${o.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}ct(null);let s={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?bt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:n===`local`?`Checked out here`:`Checked out`,description:n===`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.`}:s):(await qn(i,t,a),bt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:s))},Xn=()=>{K&&Jn(`ask`,{...Oi({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft})})},Zn=()=>{K&&Jn(`explain`,{...ji({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft})})},Qn=(e,t,n)=>{K&&Jn(`guide-stop:${t}`,vi({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft,stop:{index:t,title:e.title,summary:e.summary,attention:e.attention?.note??null,excerpts:e.excerpts},question:n}),{keepGuide:!0})},$n=(e,t)=>{K&&Jn(`selection:${e.comment.id}`,wi({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft,comment:e.comment,request:e.request}),t)},er=e=>{Pt&&Yn(`checkout:${e}`,null,e)},tr=e=>{K&&Yn(ci(e),bi({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,finding:e}))},nr=()=>{K&&Yn(`findings`,Di({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,reviewThreads:K.reviewThreads,comments:K.comments,checks:kr?[]:K.checks,commentsTruncated:K.commentsTruncated}))},rr=()=>{Pt&&Yn(`conflicts`,{prompt:Si({number:Pt.number,url:Pt.url,headBranch:Pt.headBranch,baseBranch:Pt.baseBranch})})},ir=K?K.capabilities.mergeMethods.filter(e=>K.mergeCapabilities[e]):[],ar=rt?.pullRequestKey===j?rt.method:null,or=hi(ir,ar,nt,Xe),lr=Mi[or],ur=`Auto-merge (${lr.toLowerCase()})`,dr=K?.state===`open`&&K.mergeability===`conflicting`,mr=K?.state===`open`&&K.autoMergeEnabled===!0,gr=K?.autoMergeMethod,_r=gr?`Auto-merge (${Mi[gr].toLowerCase()})`:`Auto-merge`,vr=K?.state===`open`?K.workflowApprovalsRequired??0:0,br=K===null?null:Ii(K),xr=Tt(e,e=>e.reviewGuidesEnabled),Sr=jd.filter(e=>(e.value!==`code`||K===null||K.capabilities.diff)&&(e.value!==`guide`||xr));(0,Z.useEffect)(()=>{Sr.some(e=>e.value===B)||V(`summary`)},[B,Sr]);let Cr=e=>K?.capabilities.actions.includes(e)===!0&&K.viewerPermissions.actions.includes(e),Tr=K?hr(K.checks):null,Dr=yt?.checksState===void 0?Tr:yt.checksState,Or=Dr!==`failing`&&K?.checks.some(e=>e.status===`action-required`)?`pending`:Dr,kr=Or!==Tr,Ar=K?ni({state:K.state,isDraft:K.isDraft,mergeability:K.mergeability,checksState:Or,autoMergeEnabled:K.autoMergeEnabled,hasMergeMethod:ir.length>0,canMerge:Yt&&Cr(`merge`),canMarkReady:Cr(`ready`),canEnableAutoMerge:Yt&&Cr(`enable-auto-merge`)}):null,Nr=K?.state===`open`&&Cr(K.isDraft?`ready`:`draft`)&&!(K.isDraft&&Ar===`ready`),Pr=Yt&&K?.state===`open`&&(mr&&Cr(`disable-auto-merge`)||!mr&&Ar!==`enable-auto-merge`&&!K.isDraft&&!dr&&Cr(`enable-auto-merge`)&&ir.length>0),Ir=Yt&&K?.state===`open`&&(Ar===`enable-auto-merge`||Ar===`auto-merge-armed`)&&Cr(`merge`)&&!K.isDraft&&!dr&&ir.length>0,Lr=K?.state===`open`&&Cr(`merge`)&&!K.isDraft&&!dr&&ir.length>1,Rr=K?fr({state:K.state,isDraft:K.isDraft}):null,Vr=K!==null&&ki(K),Gr=Sn.some(t=>t.environmentId===e&&t.connection.phase===`connected`),Kr=async()=>{K!==null&&await Et()?.dialogs.confirm([`Delete branch ${K.headBranch}?`,`This deletes ${K.headBranch} from ${K.headRepositoryNameWithOwner??K.repository}. Local branches and worktrees are not changed.`].join(`
|
|
214
|
+
`;function ud(e){let t=(0,Q.c)(60),{excerpt:n,file:r,loading:i,notes:a,commenting:s,loadDiffFiles:c,onOpenFile:l}=e,[u,d]=(0,Z.useState)(null),{resolvedTheme:p}=Ct(),m;if(t[0]!==n||t[1]!==r){bb0:{if(r===null){m=null;break bb0}let e=Zu(r),i=Qu(e,n);if(i.length===0){m=null;break bb0}let a=zt(ed(n.path,Bt(r),i),`pull-request-guide-excerpt:${n.path}:${n.side}:${n.start}-${n.end}`),o=a?.kind===`files`?a.files[0]:void 0;if(o===void 0){m=null;break bb0}let s={additions:new Set(i.flatMap(md)),deletions:new Set(i.flatMap(pd))},c;t[3]!==s||t[4]!==o||t[5]!==e||t[6]!==i?(c={fileDiff:o,rows:i,shown:i.length,total:e.length,drawn:s},t[3]=s,t[4]=o,t[5]=e,t[6]=i,t[7]=c):c=t[7],m=c}t[0]=n,t[1]=r,t[2]=m}else m=t[2];let h=m,g=h?.rows??null,_;bb1:{if(g===null||g.some(e=>e.hunk!==g[0]?.hunk)){_=null;break bb1}let e;t[8]!==n.end||t[9]!==n.side||t[10]!==n.start||t[11]!==c||t[12]!==g?(e=async e=>{let t=await c(e),r=td(t.newFile.contents,g);return r===null?t:{newFile:t.newFile,oldFile:{name:t.oldFile?.name??t.newFile.name,contents:r,cacheKey:`${t.newFile.cacheKey??t.newFile.name}:excerpt:${n.side}:${n.start}-${n.end}`}}},t[8]=n.end,t[9]=n.side,t[10]=n.start,t[11]=c,t[12]=g,t[13]=e):e=t[13],_=e}let v=_,y;t[14]!==s?.pending||t[15]!==u||t[16]!==n.path||t[17]!==n.side||t[18]!==a||t[19]!==h?.drawn?(y=()=>{let e=new Map,t=(t,n)=>{let r=`${t}:${n}`,i=e.get(r);if(i!==void 0)return i;let a={side:t,lineNumber:n,metadata:{markers:[],pending:[],draft:!1}};return e.set(r,a),a},r=(n,r,i)=>{let a=t(n,r);e.set(`${n}:${r}`,{...a,metadata:i(a.metadata)})},i=n.side===`new`?`additions`:`deletions`;for(let e of a)r(i,e.line,t=>({...t,markers:[...t.markers,...e.markers]}));for(let e of s?.pending??[]){if(e.path!==n.path)continue;let t=mc(e.position),i=pc(t.side);h?.drawn[i].has(t.line)&&r(i,t.line,t=>({...t,pending:[...t.pending,e]}))}if(u!==null){let e=mc(u.position);r(pc(e.side),e.line,fd)}return[...e.values()]},t[14]=s?.pending,t[15]=u,t[16]=n.path,t[17]=n.side,t[18]=a,t[19]=h?.drawn,t[20]=y):y=t[20],s?.pending;let b;t[21]===y?b=t[22]:(b=y(),t[21]=y,t[22]=b);let x=b,S;t[23]===r?S=t[24]:(S=e=>{if(e===null||r===null)return;let t=f(r,e.end,e.endSide??e.side);t!==null&&d({range:e,position:t})},t[23]=r,t[24]=S);let C=S,w=s!==null&&u===null,T=s?.onAskAgent??null,E;t[25]!==u||t[26]!==n.path||t[27]!==r||t[28]!==T?(E=e=>{if(u===null||r===null||T===null)return;let t=o({id:`pull-request-guide:${n.path}:${u.range.start}:${u.range.end}`,sectionId:`pull-request-guide:${n.path}`,sectionTitle:`Review guide`,filePath:n.path,fileDiff:r,range:u.range,text:e});d(null),t!==null&&T(t,e)},t[25]=u,t[26]=n.path,t[27]=r,t[28]=T,t[29]=E):E=t[29];let D=E,O;t[30]===p?O=t[31]:(O=Ht(p),t[30]=p,t[31]=O);let k;t[32]===v?k=t[33]:(k=v===null?{hunkSeparators:`simple`}:{loadDiffFiles:v},t[32]=v,t[33]=k);let A;t[34]!==C||t[35]!==w||t[36]!==p||t[37]!==O||t[38]!==k?(A={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,theme:O,themeType:p,preferredHighlighter:ha,unsafeCSS:ld,enableGutterUtility:w,enableLineSelection:w,onGutterUtilityClick:C,onLineSelectionEnd:C,...k},t[34]=C,t[35]=w,t[36]=p,t[37]=O,t[38]=k,t[39]=A):A=t[39];let j=A,M;t[40]===n.caption?M=t[41]:(M=n.caption.trim()===``?null:(0,$.jsx)(`figcaption`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(Ku,{text:n.caption,plain:!0})}),t[40]=n.caption,t[41]=M);let N;t[42]!==x||t[43]!==D||t[44]!==s||t[45]!==u||t[46]!==n.end||t[47]!==n.path||t[48]!==n.side||t[49]!==n.start||t[50]!==r||t[51]!==i||t[52]!==T||t[53]!==l||t[54]!==j||t[55]!==h?(N=h===null?i?(0,$.jsxs)(`p`,{className:`rounded-lg border border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[`Loading `,n.path,`...`]}):(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,$.jsx)(`span`,{className:`font-mono text-foreground`,children:n.path}),` lines `,n.start,`-`,n.end,` are not in the loaded diff.`]}),(0,$.jsx)(W,{size:`xs`,variant:`outline`,onClick:()=>l(n.path),children:`Open in Code`})]}):(0,$.jsx)(`div`,{className:`min-w-0 overflow-hidden rounded-lg border border-border/60`,children:(0,$.jsx)(vn,{fileDiff:h.fileDiff,options:j,lineAnnotations:x,selectedLines:u?.range??null,renderAnnotation:e=>(0,$.jsxs)(`div`,{className:`font-sans`,children:[e.metadata.markers.length>0?(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-1 text-xs`,children:e.metadata.markers.map(dd)}):null,e.metadata.pending.map(e=>(0,$.jsx)(hc,{comment:e,onRemove:()=>s?.onRemove(e.id)},e.id)),e.metadata.draft&&u!==null&&s!==null?(0,$.jsx)(Tn,{kind:`draft`,rangeLabel:`${n.path}:${mc(u.position).line}`,text:``,placeholder:s.canComment?`Add a comment…`:`Ask the agent about these lines…`,submitLabel:s.canComment?`Add to review`:`Ask agent`,...s.canComment&&T!==null?{secondaryAction:{label:`Ask agent`,onAction:e=>D(e)}}:{},onCancel:()=>d(null),onComment:e=>{s.canComment?(s.onComment({path:n.path,oldPath:r===null?null:hd(r,n.path),position:u.position,body:e}),d(null)):D(e)}}):null]}),renderHeaderMetadata:()=>(0,$.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[n.side===`old`?`removed code, `:``,`showing `,h.shown,` of`,` `,h.total,` diff lines`]}),(0,$.jsx)(W,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Open ${n.path} in Code`,onClick:()=>l(n.path),children:(0,$.jsx)(de,{"aria-hidden":!0})})]})})}),t[42]=x,t[43]=D,t[44]=s,t[45]=u,t[46]=n.end,t[47]=n.path,t[48]=n.side,t[49]=n.start,t[50]=r,t[51]=i,t[52]=T,t[53]=l,t[54]=j,t[55]=h,t[56]=N):N=t[56];let P;return t[57]!==M||t[58]!==N?(P=(0,$.jsxs)(`figure`,{className:`flex min-w-0 flex-col gap-1.5`,children:[M,N]}),t[57]=M,t[58]=N,t[59]=P):P=t[59],P}function dd(e){return(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)(od,{marker:e.marker}),(0,$.jsx)(`span`,{className:`text-foreground`,children:e.title})]},e.marker)}function fd(e){return{...e,draft:!0}}function pd(e){return e.oldLine===null?[]:[e.oldLine]}function md(e){return e.newLine===null?[]:[e.newLine]}function hd(e,t){let n=Bt(e);return n===t?null:n}function gd(e){let t=(0,Q.c)(11),{file:n,loadDiffFiles:r}=e,{resolvedTheme:i}=Ct(),a;t[0]===n?a=t[1]:(a=hn(n),t[0]=n,t[1]=a);let o=a,s;t[2]===i?s=t[3]:(s=Ht(i),t[2]=i,t[3]=s);let c;t[4]!==r||t[5]!==i||t[6]!==s?(c={diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,disableFileHeader:!0,theme:s,themeType:i,preferredHighlighter:ha,unsafeCSS:Jo,loadDiffFiles:r},t[4]=r,t[5]=i,t[6]=s,t[7]=c):c=t[7];let l=c,u;return t[8]!==o||t[9]!==l?(u=(0,$.jsx)(`div`,{className:`border-t border-border/60`,children:(0,$.jsx)(vn,{fileDiff:o,options:l})}),t[8]=o,t[9]=l,t[10]=u):u=t[10],u}var _d={tradeoff:`A tradeoff to weigh`,contract:`A contract to check`,product:`A product call`,risk:`A risk to judge`,accessibility:`An accessibility call`};function vd(e){let t=(0,Q.c)(122),{stop:n,index:r,stopCount:i,railOpen:a,onRailOpenChange:o,stopList:s,nextTitle:c,files:l,loadDiffFiles:u,diffLoading:d,commenting:f,onStep:p,onAsk:m,onFinish:h,onOpenFile:g}=e,_;t[0]===n?_=t[1]:(_=nd(n),t[0]=n,t[1]=_);let{lettered:v,byExcerpt:y}=_,x;t[2]===n.excerpts?x=t[3]:(x=new Set(n.excerpts.map(yd)),t[2]=n.excerpts,t[3]=x);let C=x,w,T,E,D,O,k,A,j,M;if(t[4]!==y||t[5]!==f||t[6]!==d||t[7]!==C||t[8]!==l||t[9]!==r||t[10]!==v||t[11]!==u||t[12]!==g||t[13]!==o||t[14]!==p||t[15]!==a||t[16]!==n.attention||t[17]!==n.excerpts||t[18]!==n.files||t[19]!==n.summary||t[20]!==n.title||t[21]!==i||t[22]!==s){let e;t[32]===C?e=t[33]:(e=e=>!C.has(e.path),t[32]=C,t[33]=e);let c=n.files.filter(e);w=v.length>0;let m=w&&`@min-[90rem]/guide:grid-cols-[minmax(0,1fr)_20rem]`;t[34]===m?T=t[35]:(T=G(`grid gap-8`,m),t[34]=m,t[35]=T),E=`flex min-w-0 flex-col gap-5`;let h=r+1,_;t[36]!==i||t[37]!==h?(_=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums @max-[56rem]/guide:hidden`,children:[`Stop `,h,` of `,i]}),t[36]=i,t[37]=h,t[38]=_):_=t[38];let x;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(W,{size:`xs`,variant:`ghost-muted`,className:`@min-[56rem]/guide:hidden`}),t[39]=x):x=t[39];let N=r+1,P;t[40]!==i||t[41]!==N?(P=(0,$.jsxs)(`span`,{className:`tabular-nums`,children:[`Stop `,N,` of `,i]}),t[40]=i,t[41]=N,t[42]=P):P=t[42];let F=a&&`rotate-180`,I;t[43]===F?I=t[44]:(I=G(F),t[43]=F,t[44]=I);let L;t[45]===I?L=t[46]:(L=(0,$.jsx)(ge,{"aria-hidden":!0,className:I}),t[45]=I,t[46]=L);let R;t[47]!==P||t[48]!==L?(R=(0,$.jsxs)(ya,{render:x,children:[P,L]}),t[47]=P,t[48]=L,t[49]=R):R=t[49];let z=r===0,B;t[50]===p?B=t[51]:(B=()=>p(-1),t[50]=p,t[51]=B);let V;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(S,{"aria-hidden":!0}),t[52]=V):V=t[52];let H;t[53]!==z||t[54]!==B?(H=(0,$.jsx)(W,{size:`icon-xs`,variant:`outline`,"aria-label":`Previous stop`,disabled:z,onClick:B,children:V}),t[53]=z,t[54]=B,t[55]=H):H=t[55];let ee=r===i-1,te;t[56]===p?te=t[57]:(te=()=>p(1),t[56]=p,t[57]=te);let U;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(ge,{"aria-hidden":!0}),t[58]=U):U=t[58];let ne;t[59]!==ee||t[60]!==te?(ne=(0,$.jsx)(W,{size:`icon-xs`,variant:`outline`,"aria-label":`Next stop`,disabled:ee,onClick:te,children:U}),t[59]=ee,t[60]=te,t[61]=ne):ne=t[61];let ie;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsxs)(`span`,{"aria-hidden":!0,className:`ml-1 flex items-center gap-0.5 @max-[30rem]/guide:hidden`,children:[(0,$.jsx)(ea,{children:`J`}),(0,$.jsx)(ea,{children:`K`})]}),t[62]=ie):ie=t[62];let ae;t[63]!==H||t[64]!==ne?(ae=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[H,ne,ie]}),t[63]=H,t[64]=ne,t[65]=ae):ae=t[65];let oe;t[66]!==_||t[67]!==R||t[68]!==ae?(oe=(0,$.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[_,R,ae]}),t[66]=_,t[67]=R,t[68]=ae,t[69]=oe):oe=t[69];let se;t[70]===s?se=t[71]:(se=(0,$.jsx)(ma,{className:`@min-[56rem]/guide:hidden`,children:(0,$.jsx)(`div`,{className:`pt-3`,children:s})}),t[70]=s,t[71]=se),t[72]!==o||t[73]!==a||t[74]!==oe||t[75]!==se?(D=(0,$.jsxs)(Sa,{open:a,onOpenChange:o,children:[oe,se]}),t[72]=o,t[73]=a,t[74]=oe,t[75]=se,t[76]=D):D=t[76];let ce;t[77]===n.title?ce=t[78]:(ce=(0,$.jsx)(`h2`,{className:`text-lg font-semibold text-foreground`,children:n.title}),t[77]=n.title,t[78]=ce);let ue;t[79]===n.summary?ue=t[80]:(ue=n.summary.trim()===``?null:(0,$.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(Ku,{text:n.summary})}),t[79]=n.summary,t[80]=ue),t[81]!==ce||t[82]!==ue?(O=(0,$.jsxs)(`div`,{className:`flex max-w-[60rem] flex-col gap-2`,children:[ce,ue]}),t[81]=ce,t[82]=ue,t[83]=O):O=t[83],t[84]===n.attention?k=t[85]:(k=n.attention===null?null:(0,$.jsxs)($i,{controlAlignment:`first-line`,children:[(0,$.jsx)(re,{}),(0,$.jsx)(Xi,{children:_d[n.attention.kind]}),(0,$.jsx)(Qi,{children:(0,$.jsx)(`div`,{children:(0,$.jsx)(Ku,{text:n.attention.note})})})]}),t[84]=n.attention,t[85]=k),t[86]!==y||t[87]!==f||t[88]!==d||t[89]!==l||t[90]!==u||t[91]!==g||t[92]!==n.excerpts?(A=n.excerpts.length>0?(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:(0,$.jsx)(mn,{children:n.excerpts.map((e,t)=>(0,$.jsx)(ud,{excerpt:e,file:l.get(e.path)??null,loading:d,notes:y[t]??[],commenting:f,loadDiffFiles:u,onOpenFile:g},`${e.path}:${e.side}:${e.start}-${e.end}`))})}):null,t[86]=y,t[87]=f,t[88]=d,t[89]=l,t[90]=u,t[91]=g,t[92]=n.excerpts,t[93]=A):A=t[93],t[94]===v?j=t[95]:(j=(0,$.jsx)(sd,{notes:v,className:`@min-[90rem]/guide:hidden`}),t[94]=v,t[95]=j),M=c.length>0?(0,$.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:n.excerpts.length>0?`Also in this stop`:`Files in this stop`}),(0,$.jsx)(mn,{children:(0,$.jsx)(`ul`,{className:`flex flex-col overflow-hidden rounded-lg border border-border/60`,children:c.map(e=>{let t=l.get(e.path),n=t===void 0?null:Kt([t]);return(0,$.jsx)(`li`,{className:`border-border/60 not-first:border-t`,children:(0,$.jsxs)(Sa,{children:[(0,$.jsxs)(ya,{className:`group flex w-full min-w-0 items-center gap-2 px-3 py-2 text-left text-xs outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,$.jsx)(b,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground group-data-panel-open:rotate-90`}),(0,$.jsx)(le,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate font-mono text-foreground`,children:e.path}),e.note!==void 0&&e.note.trim()!==``?(0,$.jsx)(`span`,{className:`ml-auto min-w-0 truncate text-muted-foreground @max-[30rem]/guide:hidden`,children:(0,$.jsx)(Ku,{text:e.note,plain:!0})}):null,n===null?null:(0,$.jsx)(Sr,{additions:n.additions,deletions:n.deletions,className:`shrink-0 font-mono`})]}),(0,$.jsx)(ma,{animate:!1,children:t===void 0?(0,$.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:d?`Loading the diff...`:`This file is not in the loaded diff.`}):(0,$.jsx)(gd,{file:t,loadDiffFiles:u})})]})},e.path)})})})]}):null,t[4]=y,t[5]=f,t[6]=d,t[7]=C,t[8]=l,t[9]=r,t[10]=v,t[11]=u,t[12]=g,t[13]=o,t[14]=p,t[15]=a,t[16]=n.attention,t[17]=n.excerpts,t[18]=n.files,t[19]=n.summary,t[20]=n.title,t[21]=i,t[22]=s,t[23]=w,t[24]=T,t[25]=E,t[26]=D,t[27]=O,t[28]=k,t[29]=A,t[30]=j,t[31]=M}else w=t[23],T=t[24],E=t[25],D=t[26],O=t[27],k=t[28],A=t[29],j=t[30],M=t[31];let N;t[96]!==m||t[97]!==n.questions?(N=n.questions.length>0||m!==null?(0,$.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[n.questions.length>0?(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Questions to consider`}):null,(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5`,children:[n.questions.map(e=>m===null?(0,$.jsx)(`div`,{className:`text-sm text-foreground`,children:(0,$.jsx)(Ku,{text:e})},e):(0,$.jsxs)(`button`,{type:`button`,onClick:()=>m(e),className:`flex min-w-0 items-start gap-2 rounded-lg border border-border/60 px-3 py-1.5 text-left text-sm text-foreground outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,$.jsx)(fe,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`sr-only`,children:`Ask an agent: `}),(0,$.jsx)(`span`,{children:(0,$.jsx)(Ku,{text:e,plain:!0})})]},e)),m===null?null:(0,$.jsxs)(W,{size:`sm`,variant:`ghost-muted`,onClick:()=>m(``),children:[(0,$.jsx)(fe,{"aria-hidden":!0}),`Ask about this stop`]})]})]}):null,t[96]=m,t[97]=n.questions,t[98]=N):N=t[98];let P;t[99]!==c||t[100]!==h||t[101]!==p?(P=c===null?h===null?null:(0,$.jsxs)(W,{onClick:h,children:[(0,$.jsx)(H,{"aria-hidden":!0}),`Finish review`]}):(0,$.jsxs)(W,{className:`min-w-0`,onClick:()=>p(1),children:[(0,$.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Next: `,c]}),(0,$.jsx)(Se,{"aria-hidden":!0})]}),t[99]=c,t[100]=h,t[101]=p,t[102]=P):P=t[102];let F;t[103]===P?F=t[104]:(F=(0,$.jsx)(`footer`,{className:`flex flex-wrap items-center justify-end gap-3 border-t border-border/60 pt-4`,children:P}),t[103]=P,t[104]=F);let I;t[105]!==N||t[106]!==F||t[107]!==E||t[108]!==D||t[109]!==O||t[110]!==k||t[111]!==A||t[112]!==j||t[113]!==M?(I=(0,$.jsxs)(`article`,{className:E,children:[D,O,k,A,j,M,N,F]}),t[105]=N,t[106]=F,t[107]=E,t[108]=D,t[109]=O,t[110]=k,t[111]=A,t[112]=j,t[113]=M,t[114]=I):I=t[114];let L;t[115]!==w||t[116]!==v?(L=w?(0,$.jsx)(`aside`,{className:`hidden @min-[90rem]/guide:block @min-[90rem]/guide:sticky @min-[90rem]/guide:top-4 @min-[90rem]/guide:self-start`,children:(0,$.jsx)(sd,{notes:v})}):null,t[115]=w,t[116]=v,t[117]=L):L=t[117];let R;return t[118]!==T||t[119]!==I||t[120]!==L?(R=(0,$.jsxs)(`div`,{className:T,children:[I,L]}),t[118]=T,t[119]=I,t[120]=L,t[121]=R):R=t[121],R}function yd(e){return e.path}var bd=new Map;function xd(e){let t=(0,Q.c)(23),{environmentId:n,reference:r,headSha:i,wantedPaths:a}=e,o;t[0]===r?o=t[1]:(o=Ri(r),t[0]=r,t[1]=o);let s=`${n}:${o}:${i}`,c;t[2]===s?c=t[3]:(c={key:s,cursor:null,done:!1,files:bd},t[2]=s,t[3]=c);let[l,u]=(0,Z.useState)(c),d,f,p,m;t[4]!==n||t[5]!==s||t[6]!==l||t[7]!==r||t[8]!==a?(d=l.key===s?l:{key:s,cursor:null,done:!1,files:bd},f=a.some(e=>!d.files.has(e))&&!d.done,p=At,m=f?Ur.diff({environmentId:n,input:{...r,...d.cursor===null?{}:{cursor:d.cursor}}}):null,t[4]=n,t[5]=s,t[6]=l,t[7]=r,t[8]=a,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(d=t[9],f=t[10],p=t[11],m=t[12]);let h=p(m),g=h.data,_=d.cursor,v,y;t[13]!==_||t[14]!==g||t[15]!==s?(v=()=>{g!==null&&u(e=>{let t=e.key===s?e:{key:s,cursor:null,done:!1,files:bd};if(t.cursor!==_||t.done)return t;let n=zt(g.patch,`pull-request-guide:${s}:${_??`first`}`),r=new Map(t.files);if(n?.kind===`files`)for(let e of n.files)r.set(Yt(e),e);return{key:s,cursor:g.nextCursor,done:g.nextCursor===null,files:r}})},y=[_,g,s],t[13]=_,t[14]=g,t[15]=s,t[16]=v,t[17]=y):(v=t[16],y=t[17]),(0,Z.useEffect)(v,y);let b=f&&h.error===null,x=f?h.error:null,S;return t[18]!==d.files||t[19]!==h.refresh||t[20]!==b||t[21]!==x?(S={files:d.files,loading:b,error:x,retry:h.refresh},t[18]=d.files,t[19]=h.refresh,t[20]=b,t[21]=x,t[22]=S):S=t[22],S}function Sd(e){let t=(0,Q.c)(63),{environmentId:n,reference:r,guide:i,banner:a,active:o,commenting:s,onAsk:c,onFinish:l,onOpenFile:u}=e,d;t[0]!==n||t[1]!==i.headSha||t[2]!==r?(d=Ji(Ki(n,r),i.headSha),t[0]=n,t[1]=i.headSha,t[2]=r,t[3]=d):d=t[3];let f=d,p=qi(f),m;t[4]===f?m=t[5]:(m=e=>Wi.getState().setProgress(f,t=>({...t,...e(t)})),t[4]=f,t[5]=m);let h=m,[g,_]=(0,Z.useState)(!1),v=i.stops.length,y=Math.max(Math.min(p.position,v-1),0),b=i.stops[y]??null,x;t[6]===b?x=t[7]:(x=b===null?[]:Ju(b),t[6]=b,t[7]=x);let S=x,C;t[8]!==n||t[9]!==i.headSha||t[10]!==r||t[11]!==S?(C={environmentId:n,reference:r,headSha:i.headSha,wantedPaths:S},t[8]=n,t[9]=i.headSha,t[10]=r,t[11]=S,t[12]=C):C=t[12];let w=xd(C),T=jt(Ur.diffFileContents),E=`pull-request-guide:${f}`,D;t[13]!==n||t[14]!==T||t[15]!==r||t[16]!==E?(D=Qo(T,{environmentId:n,reference:r,commit:null,cacheKey:E}),t[13]=n,t[14]=T,t[15]=r,t[16]=E,t[17]=D):D=t[17];let O=D,k=(0,Z.useRef)(null),A;t[18]!==y||t[19]!==h?(A=e=>{h(t=>({position:e,seen:e>y?new Set(t.seen).add(y):t.seen})),_(!1),k.current?.scrollTo({top:0})},t[18]=y,t[19]=h,t[20]=A):A=t[20];let j=A,M;t[21]!==j||t[22]!==y||t[23]!==v?(M=e=>j(qu(y,e,v)),t[21]=j,t[22]=y,t[23]=v,t[24]=M):M=t[24];let N=M,P;t[25]===N?P=t[26]:(P=e=>{e.defaultPrevented||e.isComposing||xa()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key!==`j`&&e.key!==`k`||Gi(e.target)||(e.preventDefault(),N(e.key===`j`?1:-1))},t[25]=N,t[26]=P);let F=(0,Z.useEffectEvent)(P),I;t[27]!==o||t[28]!==F?(I=()=>{if(!o)return;let e=e=>F(e);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},t[27]=o,t[28]=F,t[29]=I):I=t[29];let L;t[30]===o?L=t[31]:(L=[o],t[30]=o,t[31]=L),(0,Z.useEffect)(I,L);let R;t[32]!==j||t[33]!==i.stops||t[34]!==y||t[35]!==p.seen?(R=(0,$.jsx)(`aside`,{className:`sticky top-4 self-start @max-[56rem]/guide:hidden`,children:(0,$.jsx)(rd,{stops:i.stops,position:y,seen:p.seen,onSelect:j})}),t[32]=j,t[33]=i.stops,t[34]=y,t[35]=p.seen,t[36]=R):R=t[36];let z;t[37]===w.error?z=t[38]:(z=w.error===null?null:(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`The diff could not be loaded, so excerpts are missing: `,w.error]}),t[37]=w.error,t[38]=z);let B;t[39]!==s||t[40]!==w.files||t[41]!==w.loading||t[42]!==j||t[43]!==i.stops||t[44]!==O||t[45]!==c||t[46]!==l||t[47]!==u||t[48]!==y||t[49]!==g||t[50]!==N||t[51]!==b||t[52]!==v||t[53]!==p.seen||t[54]!==h?(B=b===null?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This change has no files to tour.`}):(0,$.jsx)(vd,{stop:b,index:y,stopCount:v,railOpen:g,onRailOpenChange:_,stopList:(0,$.jsx)(rd,{stops:i.stops,position:y,seen:p.seen,onSelect:j}),nextTitle:i.stops[y+1]?.title??null,files:w.files,loadDiffFiles:O,diffLoading:w.loading,commenting:s,onStep:N,onAsk:c===null?null:e=>c(y,e),onFinish:l===null?null:()=>{h(e=>({seen:new Set(e.seen).add(y)})),l()},onOpenFile:u},y),t[39]=s,t[40]=w.files,t[41]=w.loading,t[42]=j,t[43]=i.stops,t[44]=O,t[45]=c,t[46]=l,t[47]=u,t[48]=y,t[49]=g,t[50]=N,t[51]=b,t[52]=v,t[53]=p.seen,t[54]=h,t[55]=B):B=t[55];let V;t[56]!==a||t[57]!==z||t[58]!==B?(V=(0,$.jsxs)(`main`,{className:`flex min-w-0 flex-col gap-4`,children:[a,z,B]}),t[56]=a,t[57]=z,t[58]=B,t[59]=V):V=t[59];let H;return t[60]!==R||t[61]!==V?(H=(0,$.jsx)(`div`,{ref:k,className:`@container/guide h-full overflow-y-auto scrollbar-gutter-both`,children:(0,$.jsxs)(`div`,{className:`mx-auto grid max-w-[100rem] gap-6 px-4 py-4 @min-[56rem]/guide:grid-cols-[16rem_minmax(0,1fr)] @min-[90rem]/guide:gap-8 @min-[90rem]/guide:px-6`,children:[R,V]})}),t[60]=R,t[61]=V,t[62]=H):H=t[62],H}function Cd(e){let t=(0,Q.c)(28),{environmentId:n,reference:r,title:i}=e,a;t[0]!==n||t[1]!==r?(a=Ur.reviewGuide({environmentId:n,input:r}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=At(a),s;t[3]===n?s=t[4]:(s=Ur.generateReviewGuide.permissionAtom(n),t[3]=n,t[4]=s);let c=Ie(s),l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[5]=l):l=t[5];let u=jt(Ur.generateReviewGuide,l),[d,f]=(0,Z.useState)(!1),p=o.data,m=d||p?.run?._tag===`Running`,h;t[6]!==p||t[7]!==n||t[8]!==r||t[9]!==i?(h=()=>Wi.getState().watch({environmentId:n,reference:r,title:i,previousGuideAt:p?.guide?.generatedAt??null,previousFailedAt:p?.run?._tag===`Failed`?p.run.failedAt:null,since:Date.now()}),t[6]=p,t[7]=n,t[8]=r,t[9]=i,t[10]=h):h=t[10];let g=(0,Z.useEffectEvent)(h),_;t[11]!==p?.run?._tag||t[12]!==g?(_=()=>{p?.run?._tag===`Running`&&g()},t[11]=p?.run?._tag,t[12]=g,t[13]=_):_=t[13];let v=p?.run?._tag,y;t[14]===v?y=t[15]:(y=[v],t[14]=v,t[15]=y),(0,Z.useEffect)(_,y);let b;t[16]!==n||t[17]!==u||t[18]!==r||t[19]!==m||t[20]!==g?(b=async()=>{if(m)return;f(!0),g();let e=await u({environmentId:n,input:r});f(!1),e._tag===`Failure`&&(Wi.getState().settle(Ki(n,r)),bt.add({type:`error`,title:`Could not start a review guide`,description:di(Ge(e),`Check the review guide model in Settings → Source Control.`)}))},t[16]=n,t[17]=u,t[18]=r,t[19]=m,t[20]=g,t[21]=b):b=t[21];let x=b,S;return t[22]!==c||t[23]!==p||t[24]!==o||t[25]!==m||t[26]!==x?(S={query:o,data:p,running:m,canWrite:c,write:x},t[22]=c,t[23]=p,t[24]=o,t[25]=m,t[26]=x,t[27]=S):S=t[27],S}function wd(e){let t=(0,Q.c)(68),{environmentId:n,reference:r,title:i,workspaceRoot:a,active:o,canComment:s,onAskAboutLines:c,onAskAboutStop:l,onFinishReview:u,onOpenFile:d,onTourShown:f}=e,p;t[0]!==n||t[1]!==r||t[2]!==i?(p={environmentId:n,reference:r,title:i},t[0]=n,t[1]=r,t[2]=i,t[3]=p):p=t[3];let{query:m,data:h,running:g,canWrite:_,write:v}=Cd(p),y;t[4]!==n||t[5]!==r?(y=Ki(n,r),t[4]=n,t[5]=r,t[6]=y):y=t[6];let b=y,x;t[7]===r?x=t[8]:(x=Ri(r),t[7]=r,t[8]=x);let S=x,C=zi(r),w=Li(Ed),T=Li(Td),E;t[9]!==w||t[10]!==s||t[11]!==c||t[12]!==C||t[13]!==T||t[14]!==S?(E=!s&&c===null?null:{canComment:s,pending:C,onComment:e=>{let{path:t,oldPath:n,position:r,body:i}=e;return w(S,{id:Bi(),path:t,...n===null?{}:{oldPath:n},position:r,body:i})},onRemove:e=>T(S,e),onAskAgent:c},t[9]=w,t[10]=s,t[11]=c,t[12]=C,t[13]=T,t[14]=S,t[15]=E):E=t[15];let D=E,O,k;t[16]!==o||t[17]!==b?(O=()=>{if(o)return Wi.getState().setShown(b),()=>{Wi.getState().shownKey===b&&Wi.getState().setShown(null)}},k=[o,b],t[16]=o,t[17]=b,t[18]=O,t[19]=k):(O=t[18],k=t[19]),(0,Z.useEffect)(O,k);let A=h?.guide??null,M=o&&A!==null,N;t[20]===f?N=t[21]:(N=()=>f?.(),t[20]=f,t[21]=N);let P=(0,Z.useEffectEvent)(N),F;t[22]!==P||t[23]!==M?(F=()=>{M&&P()},t[22]=P,t[23]=M,t[24]=F):F=t[24];let I;t[25]===M?I=t[26]:(I=[M],t[25]=M,t[26]=I),(0,Z.useEffect)(F,I);let L=h?.run??null,R=h?.currentHeadSha??null,z=A!==null&&R!==null&&R!==A.headSha,B=L?._tag===`Failed`&&L.headSha===R?L.detail:null,V;t[27]!==_||t[28]!==g||t[29]!==v?(V=(e,t)=>_?(0,$.jsxs)(W,{size:t,variant:`outline`,disabled:g,onClick:()=>void v(),children:[g?(0,$.jsx)(yt,{}):(0,$.jsx)(Ve,{"aria-hidden":!0,className:`size-3.5`}),g?`Reading the change...`:e]}):null,t[27]=_,t[28]=g,t[29]=v,t[30]=V):V=t[30];let H=V;if(A===null){if(m.isPending&&h===null){let e;return t[31]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-48 items-center justify-center`,children:(0,$.jsx)(yt,{})}),t[31]=e):e=t[31],e}let e=g?`Writing a review guide`:`No review guide yet`,n;t[32]===e?n=t[33]:(n=(0,$.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e}),t[32]=e,t[33]=n);let r=B??m.error??(g?`An agent is reading the change. A large one takes a few minutes. You can leave; you will be told when it is ready.`:`A guide is a tour of the change: stops through the code in reading order, with the calls only a maintainer can make.`),i;t[34]===r?i=t[35]:(i=(0,$.jsx)(`p`,{className:`max-w-md text-xs text-muted-foreground`,children:r}),t[34]=r,t[35]=i);let a=B===null?`Write guide`:`Try again`,o;t[36]!==a||t[37]!==H?(o=H(a,`sm`),t[36]=a,t[37]=H,t[38]=o):o=t[38];let s;return t[39]!==n||t[40]!==i||t[41]!==o?(s=(0,$.jsxs)(`div`,{className:`flex min-h-48 flex-col items-center justify-center gap-2 px-4 py-10 text-center`,children:[n,i,o]}),t[39]=n,t[40]=i,t[41]=o,t[42]=s):s=t[42],s}let ee;t[43]!==_||t[44]!==B||t[45]!==g||t[46]!==z||t[47]!==H?(ee=z||B!==null||g?(0,$.jsxs)($i,{variant:g?`info`:`warning`,children:[g?(0,$.jsx)(yt,{}):(0,$.jsx)(j,{}),(0,$.jsx)(Qi,{children:g?`Rewriting this guide. You will be told when the new one is ready.`:B??`Written before the latest push.`}),!g&&_?(0,$.jsx)(Zi,{children:H(`Rewrite`,`xs`)}):null]}):null,t[43]=_,t[44]=B,t[45]=g,t[46]=z,t[47]=H,t[48]=ee):ee=t[48];let te=ee,U;t[49]!==n||t[50]!==a?(U={environmentId:n,cwd:a},t[49]=n,t[50]=a,t[51]=U):U=t[51];let ne;t[52]!==A||t[53]!==l?(ne=l===null?null:(e,t)=>{let n=A.stops[e];n!==void 0&&l(n,e,t)},t[52]=A,t[53]=l,t[54]=ne):ne=t[54];let re;t[55]!==o||t[56]!==te||t[57]!==D||t[58]!==n||t[59]!==A||t[60]!==u||t[61]!==d||t[62]!==r||t[63]!==ne?(re=(0,$.jsx)(Sd,{environmentId:n,reference:r,guide:A,banner:te,active:o,commenting:D,onAsk:ne,onFinish:u,onOpenFile:d}),t[55]=o,t[56]=te,t[57]=D,t[58]=n,t[59]=A,t[60]=u,t[61]=d,t[62]=r,t[63]=ne,t[64]=re):re=t[64];let ie;return t[65]!==U||t[66]!==re?(ie=(0,$.jsx)(Gu,{value:U,children:re}),t[65]=U,t[66]=re,t[67]=ie):ie=t[67],ie}function Td(e){return e.removeComment}function Ed(e){return e.addComment}function Dd(e){let t=(0,Q.c)(12),[n,r]=(0,Z.useState)(null),i=n?.scopeKey===e?n:null,a,o;t[0]!==n||t[1]!==e?(a=()=>{if(!n)return;let t=()=>r(null);if(n.scopeKey!==e){t();return}let i=e=>{e.target instanceof Node&&!n.element.contains(e.target)&&t()},a=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),t())},o=window.setTimeout(t,3e3);return document.addEventListener(`pointerdown`,i,!0),window.addEventListener(`keydown`,a,!0),window.addEventListener(`blur`,t),()=>{window.clearTimeout(o),document.removeEventListener(`pointerdown`,i,!0),window.removeEventListener(`keydown`,a,!0),window.removeEventListener(`blur`,t)}},o=[n,e],t[0]=n,t[1]=e,t[2]=a,t[3]=o):(a=t[2],o=t[3]),(0,Z.useEffect)(a,o);let s;t[4]===i?.action?s=t[5]:(s=e=>i?.action===e,t[4]=i?.action,t[5]=s);let c;t[6]!==i||t[7]!==e?(c=(t,n)=>({onClick:a=>{i?.action===t&&i.element===a.currentTarget?(r(null),n()):r({scopeKey:e,action:t,element:a.currentTarget})},onBlur:()=>r(null)}),t[6]=i,t[7]=e,t[8]=c):c=t[8];let l;return t[9]!==s||t[10]!==c?(l={isArmed:s,props:c},t[9]=s,t[10]=c,t[11]=l):l=t[11],l}var Od={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 turn on auto-merge`,"disable-auto-merge":`Could not turn off auto-merge`,revert:`Could not open a revert pull request`,"delete-branch":`Could not delete this branch`,"approve-workflows":`Could not approve workflows`},kd={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 to the branch — one from a fork also needs its author to allow edits from maintainers — and that it does not conflict with the base.`,"enable-auto-merge":`The host refused it. Check that this repository allows auto-merge, that you have write access, and that there is something left for it to wait on.`,"disable-auto-merge":`The host refused it. Check that you have write access, and that the merge has not already happened.`,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.`},Ad=`The host refused it. A rebase stops at the first commit that does not apply cleanly; updating with a merge commit may still work.`,jd=[{value:`summary`,label:`Summary`},{value:`guide`,label:`Guide`},{value:`timeline`,label:`Timeline`},{value:`code`,label:`Code`}],Md=()=>n(()=>import(`./PullRequestCodeTab-5JEE8HsL.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336])),Nd=(0,Z.lazy)(Md),Pd=new Map,Fd=e=>typeof e==`string`?e:oe(e);function Id(e){let t=(0,Q.c)(12),{environments:n,value:r,onChange:i,disabled:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(te,{}),t[0]=o):o=t[0];let s;t[1]===i?s=t[2]:(s=e=>i(e),t[1]=i,t[2]=s);let c;if(t[3]!==a||t[4]!==n){let e;t[6]===a?e=t[7]:(e=e=>(0,$.jsx)(Me,{value:e.environmentId,disabled:a,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Yi,{kind:e.machine??`server`,className:`size-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.environmentId),t[6]=a,t[7]=e),c=n.map(e),t[3]=a,t[4]=n,t[5]=c}else c=t[5];let l;return t[8]!==s||t[9]!==c||t[10]!==r?(l=(0,$.jsxs)($.Fragment,{children:[o,(0,$.jsx)(Ee,{value:r,onValueChange:s,children:c})]}),t[8]=s,t[9]=c,t[10]=r,t[11]=l):l=t[11],l}var Ld=(e,t)=>{e.preventDefault(),e.stopPropagation(),jl({url:t.url,openLabel:kl(Fr.get(t.provider)),position:{x:e.clientX,y:e.clientY}})};function Rd(e){let t=(0,Q.c)(28),{baseBranch:n,freshness:r,pending:i,onUpdate:a,iconClassName:o,className:s,children:c}=e,l;t[0]===r.behindBy?l=t[1]:(l=r.behindBy===null?``:` by ${r.behindBy.toLocaleString()} ${r.behindBy===1?`commit`:`commits`}`,t[0]=r.behindBy,t[1]=l);let u=`This branch is out-of-date with ${n}${l}.`,d;t[2]===s?d=t[3]:(d=G(`inline-flex min-w-0 shrink-0 cursor-help items-center gap-1 rounded-sm text-warning-foreground outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,s),t[2]=s,t[3]=d);let f;t[4]!==u||t[5]!==d?(f=(0,$.jsx)(`button`,{type:`button`,"aria-label":u,className:d}),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=G(`size-3.5 shrink-0`,o),t[7]=o,t[8]=p);let m;t[9]===p?m=t[10]:(m=(0,$.jsx)(j,{"aria-hidden":!0,className:p}),t[9]=p,t[10]=m);let h;t[11]!==c||t[12]!==f||t[13]!==m?(h=(0,$.jsxs)(Jr,{openOnHover:!0,delay:0,closeDelay:120,render:f,children:[c,m]}),t[11]=c,t[12]=f,t[13]=m,t[14]=h):h=t[14];let g;t[15]===u?g=t[16]:(g=(0,$.jsx)(`p`,{className:`text-xs text-foreground`,children:u}),t[15]=u,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Changes can be cleanly merged.`}),t[17]=_):_=t[17];let v;t[18]!==r.methods||t[19]!==a||t[20]!==i?(v=r.methods.length>0?(0,$.jsx)(`span`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:r.methods.map(e=>(0,$.jsxs)(W,{size:`xs`,variant:`outline`,disabled:i,onClick:()=>a(e),children:[(0,$.jsx)(X.merged,{"aria-hidden":!0,className:`size-3`}),e===`rebase`?`Update with rebase`:`Update branch`]},e))}):null,t[18]=r.methods,t[19]=a,t[20]=i,t[21]=v):v=t[21];let y;t[22]!==g||t[23]!==v?(y=(0,$.jsxs)(Kr,{align:`start`,side:`bottom`,className:`max-w-80`,padding:`compact`,children:[g,_,v]}),t[22]=g,t[23]=v,t[24]=y):y=t[24];let b;return t[25]!==y||t[26]!==h?(b=(0,$.jsxs)(Yr,{children:[h,y]}),t[25]=y,t[26]=h,t[27]=b):b=t[27],b}function zd({environmentId:e,shortcutsEnabled:t,getShortcutContext:n,threadRef:r=null,reference:i,listEntry:o=null,refreshToken:c=0,onActed:l,onClose:f,context:p=`page`,composerDraftTarget:h,onBack:g,onSelectPullRequest:v,onGuideShown:y}){let b=Ke(),x=Ye(),S=x.find(t=>t.id===i.projectId&&t.environmentId===e),C=S?.repositoryIdentity,w=b.get(e)?.environment.capabilities.threadPullRequests===!0,E=(0,Z.useMemo)(()=>w?mi(i,C):{projectId:i.projectId,repository:i.repository,number:i.number},[i,C,w]),j=`${E.projectId}:${E.host??``}:${E.repository}#${E.number}`,M=o?.projectId===E.projectId&&o.repository.toLowerCase()===E.repository.toLowerCase()&&(E.host===void 0||o.host.toLowerCase()===E.host.toLowerCase())&&o.number===E.number?o:null,[N,P]=(0,Z.useState)(!1),[L,R]=(0,Z.useState)(0),[B,V]=(0,Z.useState)(`summary`),[U,re]=(0,Z.useState)(`newest`),[ae,oe]=(0,Z.useState)(()=>({pullRequestKey:j,oid:null})),le=ae.pullRequestKey===j?ae.oid:null,ue=e=>{oe({pullRequestKey:j,oid:e})},pe=e=>{ue(e),V(`code`)},[me,ve]=(0,Z.useState)(null),xe=e=>{ue(null),ve(t=>({path:e,nonce:(t?.nonce??0)+1})),Md(),V(`code`)},Se=Wi(t=>t.openRequestKey===Ki(e,E));Se&&B!==`guide`&&V(`guide`),(0,Z.useEffect)(()=>{Se&&Wi.getState().requestOpen(null)},[Se]);let Ce=`${e}:${j}`,[we,Te]=(0,Z.useState)(()=>({key:Ce,tabs:new Set([`summary`])})),De=we.key===Ce?we.tabs:new Set([B]);(0,Z.useEffect)(()=>{Te(e=>e.key===Ce?e.tabs.has(B)?e:{key:Ce,tabs:new Set(e.tabs).add(B)}:{key:Ce,tabs:new Set([B])})},[B,Ce]);let[Ae,je]=(0,Z.useState)(!1),Le=(0,Z.useRef)({});(0,Z.useEffect)(()=>{je(Le.current[B]??!1)},[B]);let Re=Ae,Be=(0,Z.useRef)({}),Ue=(0,Z.useMemo)(()=>({summary:e=>{Be.current.summary=e},timeline:e=>{Be.current.timeline=e},code:e=>{Be.current.code=e}}),[]),We=(0,Z.useRef)(null),qe=(0,Z.useRef)(null),Je=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{let e=Je.current;e!==null&&(Je.current=null,Re&&e.tab===B&&Be.current[B]===e.scroller&&(e.scroller.scrollTop=Math.max(0,e.scroller.scrollTop+e.delta)))},[Re,B]);let Xe=Ui(e=>e.pullRequestMergeMethod),Ze=Ui(e=>e.setPullRequestMergeMethod),Qe=Ea(e,E.projectId),nt=(0,Z.useMemo)(()=>Qe(),[Qe]),[rt,it]=(0,Z.useState)(null),at=e=>{it({pullRequestKey:j,method:e})},ot=Dd(j),[st,ct]=(0,Z.useState)(null),lt=Ot(e,he),ut=At(Ur.detail({environmentId:e,input:E})),dt=At(Ur.activity({environmentId:e,input:E})),ft=zr(e),[pt,mt]=(0,Z.useState)(()=>oi(typeof window>`u`?void 0:window.localStorage,e,E));(0,Z.useEffect)(()=>{mt(oi(typeof window>`u`?void 0:window.localStorage,e,E))},[e,j,E.projectId,E.repository,E.number]),(0,Z.useEffect)(()=>{ut.data!==null&&(gi(typeof window>`u`?void 0:window.localStorage,e,E,ut.data),mt(ut.data))},[ut.data,e,j,E.projectId,E.repository,E.number]);let ht=Zr({live:ut.data,cached:pt,reference:E}),gt=(0,Z.useMemo)(()=>M===null?null:Br(M),[M]),_t=(0,Z.useMemo)(()=>ut.data===null?null:{...ut.data,checksState:hr(ut.data.checks)},[ut.data]),vt=Wr(e,E,_t,ut.dataUpdatedAt),yt=(0,Z.useMemo)(()=>Hr(ht,Hr(vt,gt)),[ht,vt,gt]),xt=(0,Z.useMemo)(()=>ht===null||yt===null||yt===ht?ht:{...ht,title:yt.title,state:yt.state,headBranch:yt.headBranch,baseBranch:yt.baseBranch,updatedAt:yt.updatedAt,author:yt.author??ht.author,additions:yt.additions??ht.additions,deletions:yt.deletions??ht.deletions,changedFiles:yt.changedFiles??ht.changedFiles,mergeability:yt.mergeability??ht.mergeability,closedAt:yt.closedAt===void 0?ht.closedAt:yt.closedAt,mergedAt:yt.mergedAt===void 0?ht.mergedAt:yt.mergedAt,isDraft:yt.isDraft??ht.isDraft},[ht,yt]),Ct=dt.data,K=(0,Z.useMemo)(()=>xt===null?null:{...xt,capabilities:lt?xt.capabilities:{...xt.capabilities,reactions:!1,edit:{changeRequest:!1,comment:!1}},viewerPermissions:lt?xt.viewerPermissions:{...xt.viewerPermissions,actions:[],comment:!1,resolve:!1,verdicts:[],requestReviewers:!1,updateMethods:[],labels:!1},author:Ct?.author??xt.author,reviewers:Ct?.reviewers??xt.reviewers,comments:Ct?.comments??[],commentCount:Ct?.commentCount??0,commentsTruncated:Ct?.commentsTruncated??!1,reviewThreads:Ct?.reviewThreads??[],commits:Ct?.commits??[],reactions:Ct?.reactions??[]},[Ct,lt,xt]),Pt=K??yt,Ft=Ie(Dt),{copyToClipboard:It}=St({target:`pull request reference`,onCopy:e=>bt.add({type:`success`,title:`${e} copied`}),onError:(e,t)=>bt.add({type:`error`,title:`Failed to copy ${t}`,description:e.message})}),Lt=(0,Z.useEffectEvent)(e=>{!t||e.defaultPrevented||xa()||sr(e,Ft,{context:n()})===`pullRequest.copyNumber`&&(e.preventDefault(),e.stopPropagation(),e.repeat||It(`#${E.number}`,`PR number`))});(0,Z.useEffect)(()=>{let e=e=>Lt(e);return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,Z.useEffect)(()=>{K?.autoMergeMethod!==void 0&&at(K.autoMergeMethod)},[K?.autoMergeMethod,j]);let Rt=K===null?null:$e(K.url),zt=Fr.get(K?.provider),Bt=(0,Z.useMemo)(()=>({repositoryUrl:Rt===null?null:zt.referenceAutolinkRepositoryUrl(Rt),threadRef:r}),[zt,Rt,r]),Vt=K?.author&&Rt!==null?zt.authorProfileUrl(K.author.login,Rt):null,Ht=Pt?si(Pt.provider,Pt.number,Pt.headBranch,K?.headRepositoryNameWithOwner,$e(Pt.url)):ei(E,C),Ut=(0,Z.useCallback)(e=>{bt.add({type:`error`,title:`Could not copy checkout command`,description:e.message})},[]),Wt=At(K===null?null:Nt.listRefs({environmentId:e,input:{cwd:K.workspaceRoot,includeMatchingRemoteRefs:!0,limit:2}})),Gt=K!==null&&Pi(K.baseBranch,Wt.data?.refs??[]),Kt=Cc(e,(0,Z.useMemo)(()=>K===null||K.capabilities.stacks!==!0||!w?null:{...E,host:E.host??et(K.url)?.host},[K,E,w])),qt=Kt.data,Jt=w&&K?.capabilities.stacks===!0&&K.capabilities.stackActions===!0&&b.get(e)?.environment.capabilities.pullRequestStackActions===!0,Yt=Ai({supportsStackActions:Jt,hasStack:qt!==null,stackPending:!Kt.isFresh,stackError:Kt.error}),Xt=dt.isPending&&Ct===null,Zt=Ct===null?dt.error:null,Qt=(0,Z.useCallback)(()=>{ut.refresh(),dt.refresh(),Kt.refresh()},[dt.refresh,ut.refresh,Kt.refresh]),[$t,en]=(0,Z.useState)(0),tn=$t+(ft??0),nn=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(!xt)return;let e={key:Ce,updatedAt:xt.updatedAt};if(ti(nn.current,e)){if(dt.isPending)return;dt.refresh(),en(e=>e+1)}nn.current=e},[dt.isPending,dt.refresh,xt,Ce]),Lc(()=>{ut.refresh()},{key:`pull-request:${e}:${j}`});let rn=jt(Ur.invalidate,{reportFailure:!1}),[an,on]=(0,Z.useState)(!1),sn=an||ut.isPending,cn=(0,Z.useCallback)(async()=>{on(!0);try{await rn({environmentId:e,input:{reference:E}}),Qt(),en(e=>e+1)}finally{on(!1)}},[e,rn,E,Qt]),ln=(0,Z.useRef)(c);(0,Z.useEffect)(()=>{ln.current!==c&&(ln.current=c,cn())},[c,cn]);let un=jt(Ur.runAction,{reportFailure:!1}),dn=jt(Ur.comment,{reportFailure:!1}),[fn,pn]=(0,Z.useState)(null),mn=fn!==null,hn=jt(Ur.update,{reportFailure:!1}),[gn,_n]=(0,Z.useState)(null),vn=gn?.pullRequestKey===j?gn.text:null,[yn,bn]=(0,Z.useState)(!1),xn=Hi(),{environments:Sn}=wt(),Cn=(0,Z.useMemo)(()=>{let t=x.find(t=>t.id===E.projectId&&t.environmentId===e)?.repositoryIdentity;return tt(t,E.repository,E.number)},[e,x,E.number,E.projectId,E.repository]),wn=(0,Z.useMemo)(()=>p===`page`?bc({environmentId:e,projectId:E.projectId},x,Sn.map(e=>({environmentId:e.environmentId,label:e.label,machine:be(e.serverConfig)}))):[],[p,e,Sn,x,E.projectId]),[Tn,En]=(0,Z.useState)(null),On=Tn?.pullRequestKey===j?Tn.environmentId:e,An=wn.find(e=>e.environmentId===On)??null,jn=An?.environmentId??e,Mn=An?.workspaceRoot??K?.workspaceRoot??S?.workspaceRoot??null,Nn=Ot(jn,I),Pn=Da({environmentId:jn,cwd:Mn}),Fn=async(t,n,r)=>{l?.(t,`sent`);let i=await un({environmentId:e,input:{...E,action:t,...n?{mergeMethod:n}:{},...r?{updateMethod:r}:{}}});if(pn(null),i._tag===`Failure`){let e=Ge(i),n=r===`rebase`?Ad:kd[t];return bt.add({type:`error`,title:Od[t],description:di(e,n)}),l?.(t,`failed`),!1}return t===`revert`&&bt.add({type:`success`,title:`Revert pull request opened`}),t===`delete-branch`&&bt.add({type:`success`,title:`Branch deleted`}),Ti(t)?cn():Qt(),l?.(t,`done`),!0},In=async(e,t,n)=>!lt||fn!==null?!1:(pn(e),Fn(e,t,n)),Ln=async(t,n)=>!lt||fn!==null?{commentPosted:!1}:(pn(n),(await dn({environmentId:e,input:{...E,body:t}}))._tag===`Failure`?(pn(null),bt.add({type:`error`,title:`Could not post the comment`}),{commentPosted:!1}):(await Fn(n)||Qt(),{commentPosted:!0})),Rn=async t=>{let n=t.trim();if(!lt||K===null||yn)return;if(n.length===0||n===K.title){_n(null);return}bn(!0);let r=await hn({environmentId:e,input:{...E,title:n}});bn(!1),r._tag===`Failure`?bt.add({type:`error`,title:`The title could not be saved`,description:di(Ge(r),`The host refused the new title.`)}):(_n(null),Qt())},zn=h??null,Bn=Pn.isAllowed&&Nn,Hn=zn!==null||Bn,Un=ui(zn!==null),Wn=Cd({environmentId:e,reference:E,title:K?.title??null}),Gn=()=>{Wn.write(),Wn.data?.guide??V(`guide`)},Kn=(e,t)=>{let n=u.getState(),r=n.getComposerDraft(e),i=Fd(e),a=new Set((r?.reviewComments??[]).map(e=>e.id)),o=new Set((t.reviewComments??[]).filter(e=>a.has(e.id)).map(e=>e.id)),s=ai(r?.prompt??``,r?.reviewComments??[],o),c=Fi({prompt:s,lastHandoffPrompt:Pd.get(i)},t.prompt);Pd.set(i,t.prompt),n.setPrompt(e,c),n.setReviewComments(e,yi(r?.reviewComments??[],t.reviewComments??[]));for(let r of t.reviewComments??[])o.has(r.id)&&n.addReviewComment(e,r,{allowDuplicateReference:!0,insertAtCaret:!1})},qn=async(e,t,n)=>{let r=n??await xn(e).then(e=>e,()=>null);return r===null?null:(t===null||Kn(r.draftId,t),r)},Jn=async(t,n,r)=>{if(!K||st!==null)return;if(zn!==null){Kn(zn,n),bt.add({type:`success`,title:`Added to the composer`,description:n.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.`});return}ct(t);let i=z(jn,An?.projectId??K.projectId),a=await qn(i,n);if(ct(null),a!==null&&r?.keepGuide===!0){let t=u.getState().getDraftSession(a.draftId);t!==null&&(Mt.getState().openPullRequest(T(t.environmentId,t.threadId),{environmentId:e,projectId:E.projectId,...E.host===void 0?{}:{host:E.host},repository:E.repository,number:E.number,url:K.url}),Wi.getState().requestOpen(Ki(e,E)))}a===null?bt.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`}):bt.add({type:`success`,title:`Asked in a thread`,description:n.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.`})},Yn=async(e,t,n=`worktree`)=>{if(!Pt||st!==null)return;if(zn!==null&&t!==null){Kn(zn,t),bt.add({type:`success`,title:`Added to the composer`,description:`The task is in the composer — read it over, then send.`});return}if(Mn===null||!Pn.isAllowed||!kt(jn,`source-control:write`)||n===`worktree`&&!kt(jn,`orchestration:operate`))return;ct(e);let r=bt.add({type:`loading`,title:`Preparing the pull request checkout...`}),i=z(jn,An?.projectId??Pt.projectId),a=await xn(i).then(e=>e,()=>null);if(a===null){ct(null),bt.update(r,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let o=await Pn.run({reference:Pt.url,mode:n,threadId:a.threadId});if(o._tag===`Failure`){ct(null);let e=Pn.error instanceof Error?Pn.error.message:null;bt.update(r,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await xn(i,{branch:o.value.branch,worktreePath:o.value.worktreePath,envMode:o.value.worktreePath===null?`local`:`worktree`}).then(e=>e!==null,()=>!1)){ct(null),bt.update(r,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${o.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}ct(null);let s={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?bt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:n===`local`?`Checked out here`:`Checked out`,description:n===`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.`}:s):(await qn(i,t,a),bt.update(r,o.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:s))},Xn=()=>{K&&Jn(`ask`,{...Oi({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft})})},Zn=()=>{K&&Jn(`explain`,{...ji({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft})})},Qn=(e,t,n)=>{K&&Jn(`guide-stop:${t}`,vi({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft,stop:{index:t,title:e.title,summary:e.summary,attention:e.attention?.note??null,excerpts:e.excerpts},question:n}),{keepGuide:!0})},$n=(e,t)=>{K&&Jn(`selection:${e.comment.id}`,wi({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,state:K.state,isDraft:K.isDraft,comment:e.comment,request:e.request}),t)},er=e=>{Pt&&Yn(`checkout:${e}`,null,e)},tr=e=>{K&&Yn(ci(e),bi({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,finding:e}))},nr=()=>{K&&Yn(`findings`,Di({number:K.number,title:K.title,url:K.url,headBranch:K.headBranch,baseBranch:K.baseBranch,reviewThreads:K.reviewThreads,comments:K.comments,checks:kr?[]:K.checks,commentsTruncated:K.commentsTruncated}))},rr=()=>{Pt&&Yn(`conflicts`,{prompt:Si({number:Pt.number,url:Pt.url,headBranch:Pt.headBranch,baseBranch:Pt.baseBranch})})},ir=K?K.capabilities.mergeMethods.filter(e=>K.mergeCapabilities[e]):[],ar=rt?.pullRequestKey===j?rt.method:null,or=hi(ir,ar,nt,Xe),lr=Mi[or],ur=`Auto-merge (${lr.toLowerCase()})`,dr=K?.state===`open`&&K.mergeability===`conflicting`,mr=K?.state===`open`&&K.autoMergeEnabled===!0,gr=K?.autoMergeMethod,_r=gr?`Auto-merge (${Mi[gr].toLowerCase()})`:`Auto-merge`,vr=K?.state===`open`?K.workflowApprovalsRequired??0:0,br=K===null?null:Ii(K),xr=Tt(e,e=>e.reviewGuidesEnabled),Sr=jd.filter(e=>(e.value!==`code`||K===null||K.capabilities.diff)&&(e.value!==`guide`||xr));(0,Z.useEffect)(()=>{Sr.some(e=>e.value===B)||V(`summary`)},[B,Sr]);let Cr=e=>K?.capabilities.actions.includes(e)===!0&&K.viewerPermissions.actions.includes(e),Tr=K?hr(K.checks):null,Dr=yt?.checksState===void 0?Tr:yt.checksState,Or=Dr!==`failing`&&K?.checks.some(e=>e.status===`action-required`)?`pending`:Dr,kr=Or!==Tr,Ar=K?ni({state:K.state,isDraft:K.isDraft,mergeability:K.mergeability,checksState:Or,autoMergeEnabled:K.autoMergeEnabled,hasMergeMethod:ir.length>0,canMerge:Yt&&Cr(`merge`),canMarkReady:Cr(`ready`),canEnableAutoMerge:Yt&&Cr(`enable-auto-merge`)}):null,Nr=K?.state===`open`&&Cr(K.isDraft?`ready`:`draft`)&&!(K.isDraft&&Ar===`ready`),Pr=Yt&&K?.state===`open`&&(mr&&Cr(`disable-auto-merge`)||!mr&&Ar!==`enable-auto-merge`&&!K.isDraft&&!dr&&Cr(`enable-auto-merge`)&&ir.length>0),Ir=Yt&&K?.state===`open`&&(Ar===`enable-auto-merge`||Ar===`auto-merge-armed`)&&Cr(`merge`)&&!K.isDraft&&!dr&&ir.length>0,Lr=K?.state===`open`&&Cr(`merge`)&&!K.isDraft&&!dr&&ir.length>1,Rr=K?fr({state:K.state,isDraft:K.isDraft}):null,Vr=K!==null&&ki(K),Gr=Sn.some(t=>t.environmentId===e&&t.connection.phase===`connected`),Kr=async()=>{K!==null&&await Et()?.dialogs.confirm([`Delete branch ${K.headBranch}?`,`This deletes ${K.headBranch} from ${K.headRepositoryNameWithOwner??K.repository}. Local branches and worktrees are not changed.`].join(`
|
|
215
215
|
`),{variant:`destructive`})&&In(`delete-branch`)},qr=vr>0&&!kr&&Cr(`approve-workflows`),Jr=kr?Or===null?`No checks reported`:jr(Or).label:K?Mr(K.checks):null,Yr=K&&!K.commentsTruncated?pi(K.comments,K.commits).filter(e=>e.outcome===`approved`&&!e.stale).length:0,Qr=p===`page`?(0,$.jsxs)(F,{children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(ze,{disabled:st!==null||Mn===null,render:(0,$.jsxs)(W,{size:`xs`,variant:`outline`,"aria-label":st?.startsWith(`checkout`)?`Checking out...`:`Check out`,children:[(0,$.jsx)(ye,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[35rem]/pr-header:hidden`,children:st?.startsWith(`checkout`)?`Checking out...`:`Check out`}),(0,$.jsx)(ge,{"aria-hidden":!0,className:`size-3.5 text-muted-foreground`})]})})}),(0,$.jsx)(J,{children:`Check out this pull request`})]}),(0,$.jsxs)(Fe,{align:`end`,side:`bottom`,children:[(0,$.jsxs)(a,{disabled:!Bn,onClick:()=>er(`worktree`),children:[(0,$.jsx)(ye,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:`In a separate worktree`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Its own folder and thread. Nothing you have open moves.`})]})]}),(0,$.jsxs)(a,{disabled:!Pn.isAllowed,onClick:()=>er(`local`),children:[(0,$.jsx)(k,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:`In this repository`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:"Switches the branch you are working in, like `gh pr checkout`."})]})]}),wn.length>0?(0,$.jsx)(Id,{environments:wn,value:jn,onChange:e=>En({pullRequestKey:j,environmentId:e}),disabled:st!==null}):null]})]}):null,$r=(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(W,{size:`xs`,variant:`destructive-outline`,disabled:st!==null||zn===null&&Mn===null,onClick:rr,"aria-label":st===`conflicts`?`Preparing...`:`Resolve conflicts`,children:[(0,$.jsx)(X.conflicting,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:st===`conflicts`?`Preparing...`:`Resolve conflicts`})]})})}),(0,$.jsx)(J,{side:`top`,children:st===`conflicts`?`Preparing...`:`Resolve conflicts`})]});return ut.isPending&&!K?(0,$.jsx)(yl,{seed:M,summary:yt,checkoutCommand:Ht,onCheckoutError:Ut,number:E.number,tabs:Sr,activeTab:B,...g?{onBack:g}:{},...f?{onClose:f}:{},actions:Pt?(0,$.jsxs)(kn,{delay:150,closeDelay:150,timeout:400,children:[Pt.state===`open`&&Pt.mergeability===`conflicting`?$r:null,Qr]}):void 0}):(0,$.jsxs)(`div`,{className:`relative flex h-full min-h-0 w-full flex-col bg-background`,children:[N&&K?(0,$.jsx)(rl,{display:`picker`,environmentId:e,reference:E,url:K.url,threadRef:null,onPickerOpenChange:P},`${e}:${K.url}`):null,(0,$.jsxs)(`div`,{className:G(`@container/pr-header grid min-w-0 shrink-0 grid-cols-[minmax(0,1fr)_auto] items-start gap-x-2`,K&&`border-b border-border/60`,!K&&!f&&`hidden`),children:[(0,$.jsxs)(`div`,{className:`pl-4 grid h-7 min-w-0 items-center overflow-hidden`,children:[(0,$.jsx)(`div`,{"aria-hidden":Re,inert:Re,className:G(`col-start-1 row-start-1 flex min-w-0 items-center gap-1 text-sm text-muted-foreground transition-[opacity,transform] ease-out motion-reduce:transform-none motion-reduce:transition-none sm:text-xs`,Re?`pointer-events-none -translate-y-1 opacity-0 duration-100`:`translate-y-0 opacity-100 delay-50 duration-150`),children:K&&Rr?(0,$.jsxs)($.Fragment,{children:[g?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(W,{size:`icon-micro`,variant:`ghost-muted`,onClick:g,className:`-ml-1.5`,"aria-label":`Back to this thread's pull requests`,children:(0,$.jsx)(ne,{"aria-hidden":!0,className:`size-3.5`})})}),(0,$.jsx)(J,{side:`top`,children:`Back to pull requests`})]}):null,(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:Rt?(0,$.jsx)(`button`,{type:`button`,onClick:()=>void Et()?.shell.openExternal(Rt),className:`min-w-0 cursor-pointer truncate text-left font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,children:K.repository}):(0,$.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:K.repository})}),(0,$.jsx)(J,{side:`top`,children:Rt?`Open ${K.repository} repository`:K.repository})]}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>void Et()?.shell.openExternal(K.url),onContextMenu:e=>Ld(e,K),className:G(`inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 hover:underline`,Rr.toneClassName),"aria-label":`Open pull request #${K.number} on host`,children:[`#`,K.number,(0,$.jsx)(Pe,{"aria-hidden":!0,className:`size-2.5`})]})}),(0,$.jsx)(J,{side:`top`,children:kl(zt)})]})]}):null}),(0,$.jsx)(`div`,{"aria-hidden":!Re,inert:!Re,className:G(`col-start-1 row-start-1 flex min-w-0 items-center gap-1 text-sm text-muted-foreground transition-[opacity,transform] ease-out motion-reduce:transform-none motion-reduce:transition-none sm:text-xs`,Re?`translate-y-0 opacity-100 delay-50 duration-150`:`pointer-events-none translate-y-1 opacity-0 duration-100`),children:K&&Rr?(0,$.jsxs)($.Fragment,{children:[g?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(W,{size:`icon-micro`,variant:`ghost-muted`,tabIndex:Re?0:-1,onClick:g,className:`-ml-1.5`,"aria-label":`Back to this thread's pull requests`,children:(0,$.jsx)(ne,{"aria-hidden":!0,className:`size-3.5`})})}),(0,$.jsx)(J,{side:`top`,children:`Back to pull requests`})]}):null,(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`button`,{type:`button`,tabIndex:Re?0:-1,onClick:()=>void Et()?.shell.openExternal(K.url),onContextMenu:e=>Ld(e,K),className:G(`inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 hover:underline`,Rr.toneClassName),"aria-label":`Open pull request #${K.number} on host`,children:[`#`,K.number,(0,$.jsx)(Pe,{"aria-hidden":!0,className:`size-2.5`})]})}),(0,$.jsx)(J,{side:`top`,children:kl(zt)})]}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:K.title})}),(0,$.jsx)(J,{side:`top`,children:K.title})]})]}):null})]}),(0,$.jsxs)(`div`,{className:`mr-4 flex h-7 shrink-0 items-center justify-end gap-1`,children:[K?(0,$.jsxs)(kn,{delay:150,closeDelay:150,timeout:400,children:[!qt&&Jt&&Kt.error?(0,$.jsx)(W,{variant:`ghost`,size:`xs`,onClick:Kt.refresh,children:`Retry stack lookup`}):null,qt?(0,$.jsx)(Vc,{hostLabel:zt.label,stack:qt,notice:Kt.notice,onRetry:Kt.error?Kt.refresh:void 0,reference:E,environmentId:e,onSelect:v,mergeMethod:or,canMerge:Kt.isFresh&&Jt&&Cr(`merge`)&&ir.length>0,canRebase:Kt.isFresh&&Jt&&K.viewerPermissions.stackRebase===!0,onActed:()=>{Qt(),l?.()}}):null,p===`page`?(0,$.jsx)(rl,{display:`count`,environmentId:e,reference:E,url:K.url,threadRef:null}):null,mr&&Ar!==`auto-merge-armed`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(_,{size:`control`,variant:`info`,role:`img`,"aria-label":_r,children:[(0,$.jsx)(X.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:_r})]})}),(0,$.jsxs)(J,{side:`top`,children:[_r,`: the host will merge this on its own once its requirements are met`]})]}):null,Ar===`resolve`?$r:Ar===`ready`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(W,{size:`xs`,variant:`default`,disabled:mn,onClick:()=>void In(`ready`),"aria-label":`Ready for review`,children:[(0,$.jsx)(X.pullRequest,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:`Ready for review`})]})})}),(0,$.jsx)(J,{side:`top`,children:`Ready for review`})]}):Ar===`enable-auto-merge`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(W,{size:`xs`,variant:`default`,disabled:mn,...ot.props(`enable-auto-merge`,()=>void In(`enable-auto-merge`,or)),"aria-label":fn===`enable-auto-merge`?`Enabling...`:ot.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:ur,children:[ot.isArmed(`enable-auto-merge`)?(0,$.jsx)(s,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(X.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(Tc,{className:`@max-[30rem]/pr-header:hidden`,children:(0,$.jsxs)(`span`,{className:`grid`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:ur}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:fn===`enable-auto-merge`?`Enabling...`:ot.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:ur})]})})]})})}),(0,$.jsx)(J,{side:`top`,children:fn===`enable-auto-merge`?`Enabling...`:ot.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:ur})]}):Ar===`auto-merge-armed`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(_,{size:`control`,variant:`info`,role:`img`,"aria-label":_r,children:[(0,$.jsx)(X.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`@max-[30rem]/pr-header:hidden`,children:_r})]})}),(0,$.jsxs)(J,{side:`top`,children:[_r,`: the host will merge this on its own once its requirements are met`]})]}):Ar===`merge`?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,$.jsxs)(W,{size:`xs`,variant:`default`,disabled:mn,...ot.props(`merge`,()=>void In(`merge`,or)),"aria-label":fn===`merge`?`Merging...`:ot.isArmed(`merge`)?`Confirm merge?`:lr,children:[ot.isArmed(`merge`)?(0,$.jsx)(s,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(X.merged,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsx)(Tc,{className:`@max-[30rem]/pr-header:hidden`,children:(0,$.jsxs)(`span`,{className:`grid`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:lr}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:fn===`merge`?`Merging...`:ot.isArmed(`merge`)?`Confirm merge?`:lr})]})})]})})}),(0,$.jsx)(J,{side:`top`,children:fn===`merge`?`Merging...`:ot.isArmed(`merge`)?`Confirm merge?`:lr})]}):(Ar===`merged`||Ar===`closed`)&&Rr!==null?(0,$.jsx)(_,{size:`control`,variant:`outline`,children:(0,$.jsxs)(`span`,{className:G(`flex items-center gap-1`,Rr.toneClassName),children:[(0,$.jsx)(Rr.Icon,{className:`size-3.5`}),Rr.label]})}):null,Qr,(0,$.jsxs)(F,{children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(ze,{render:(0,$.jsx)(W,{"aria-label":sn?`Refreshing pull request`:`More pull request actions`,size:`icon-xs`,variant:`ghost-muted`}),children:sn?(0,$.jsx)(pa,{refreshing:!0,size:`md`}):(0,$.jsx)(d,{className:`size-4`})})}),(0,$.jsx)(J,{children:sn?`Refreshing pull request`:`More pull request actions`})]}),(0,$.jsxs)(Fe,{align:`end`,side:`bottom`,children:[(0,$.jsx)(rl,{display:`menu-item`,environmentId:e,reference:E,url:K.url,threadRef:r??(typeof h==`object`?h:null),onPickerOpenChange:P}),(0,$.jsxs)(a,{disabled:sn,onClick:()=>void cn(),children:[(0,$.jsx)(pa,{size:`sm`,refreshing:sn}),`Refresh`]}),(0,$.jsxs)(a,{disabled:st!==null,onClick:Xn,children:[(0,$.jsx)(fe,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:st===`ask`?`Opening...`:`Ask a question`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:zn===null?`Opens a thread that knows which pull request you mean.`:`Adds the pull request to this thread's composer.`})]})]}),(0,$.jsxs)(a,{disabled:st!==null,onClick:Zn,children:[(0,$.jsx)(He,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:st===`explain`?`Opening...`:`Explain this PR`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`A walk through the diff and what to read closely.`})]})]}),(0,$.jsxs)(a,{disabled:st!==null||!Hn,onClick:nr,children:[(0,$.jsx)(A,{className:`size-3.5`}),st===`findings`?`Preparing...`:Un.fixFindings]}),xr&&Wn.canWrite?(0,$.jsxs)(a,{disabled:Wn.running,onClick:Gn,children:[(0,$.jsx)(Ve,{className:`size-3.5`}),Wn.running?`Writing guide...`:Wn.data?.guide==null?`Write guide`:`Rewrite guide`]}):null,wn.length>0?(0,$.jsx)(Id,{environments:wn,value:jn,onChange:e=>En({pullRequestKey:j,environmentId:e}),disabled:st!==null}):null,(0,$.jsx)(te,{}),K.state===`open`?(0,$.jsxs)($.Fragment,{children:[Nr?(0,$.jsxs)(a,{disabled:mn,onClick:()=>void In(K.isDraft?`ready`:`draft`),children:[K.isDraft?(0,$.jsx)(X.pullRequest,{className:`size-3.5`}):(0,$.jsx)(X.draft,{className:`size-3.5`}),K.isDraft?`Ready for review`:`Convert to draft`]}):null,Ir?(0,$.jsxs)(a,{closeOnClick:ot.isArmed(`merge`),"aria-label":ot.isArmed(`merge`)?`Confirm merge?`:`Merge now`,disabled:mn,...ot.props(`merge`,()=>void In(`merge`,or)),children:[(0,$.jsx)(X.merged,{className:`size-3.5`}),ot.isArmed(`merge`)?`Confirm merge?`:`Merge now`]}):null,mr&&Cr(`disable-auto-merge`)?(0,$.jsxs)(a,{disabled:mn,onClick:()=>void In(`disable-auto-merge`),children:[(0,$.jsx)(X.merged,{className:`size-3.5`}),`Disable auto-merge`]}):Pr?(0,$.jsxs)(a,{closeOnClick:ot.isArmed(`enable-auto-merge`),"aria-label":ot.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:`Enable auto-merge`,disabled:mn,...ot.props(`enable-auto-merge`,()=>void In(`enable-auto-merge`,or)),children:[(0,$.jsx)(X.merged,{className:`size-3.5`}),ot.isArmed(`enable-auto-merge`)?`Confirm auto-merge?`:`Enable auto-merge`]}):null,Lr?(0,$.jsxs)($.Fragment,{children:[Nr||Ir||Pr?(0,$.jsx)(te,{}):null,(0,$.jsx)(Ee,{value:or,onValueChange:e=>{let t=e;at(t),Ze(t)},children:ir.map(e=>(0,$.jsx)(Me,{value:e,disabled:mn,closeOnClick:!0,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(X.merged,{className:`size-3.5`}),(0,$.jsx)(`span`,{children:Mi[e]})]})},e))})]}):null,Xr(Nr,Pr||Ir,Lr)?(0,$.jsx)(te,{}):null]}):null,(0,$.jsxs)(a,{onClick:()=>void Et()?.shell.openExternal(K.url),children:[(0,$.jsx)(de,{className:`size-3.5`}),kl(zt)]}),(0,$.jsxs)(a,{onClick:()=>It(K.url,`PR link`),children:[(0,$.jsx)(ce,{className:`size-3.5`}),`Copy link`,(0,$.jsx)(Oe,{children:cr(Ft,`thread.copyReference`)})]}),(0,$.jsxs)(a,{onClick:()=>It(`#${E.number}`,`PR number`),children:[(0,$.jsx)(se,{className:`size-3.5`}),`Copy PR number`,(0,$.jsx)(Oe,{children:cr(Ft,`pullRequest.copyNumber`)})]}),K.state===`open`&&Cr(`close`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(te,{}),(0,$.jsxs)(a,{closeOnClick:ot.isArmed(`close`),"aria-label":ot.isArmed(`close`)?`Confirm close?`:`Close pull request`,variant:`destructive`,disabled:mn,...ot.props(`close`,()=>void In(`close`)),children:[(0,$.jsx)(X.closed,{className:`size-3.5`}),ot.isArmed(`close`)?`Confirm close?`:`Close pull request`]})]}):K.state===`closed`&&Cr(`reopen`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(te,{}),(0,$.jsxs)(a,{disabled:mn,onClick:()=>void In(`reopen`),children:[(0,$.jsx)(X.reopen,{className:`size-3.5`}),`Reopen pull request`]})]}):K.state===`merged`&&Cr(`revert`)?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(te,{}),(0,$.jsxs)(a,{closeOnClick:ot.isArmed(`revert`),"aria-label":ot.isArmed(`revert`)?`Confirm revert?`:`Revert changes`,variant:ot.isArmed(`revert`)?`destructive`:`default`,disabled:mn,...ot.props(`revert`,()=>void In(`revert`)),children:[(0,$.jsx)(ee,{className:`size-3.5`}),ot.isArmed(`revert`)?`Confirm revert?`:`Revert changes`]})]}):null,Vr?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(te,{}),(0,$.jsxs)(a,{variant:`destructive`,disabled:mn||!Gr,onClick:()=>void Kr(),children:[(0,$.jsx)(D,{className:`mt-1 size-3.5 shrink-0 self-start`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{children:fn===`delete-branch`?`Deleting branch...`:`Delete branch`}),(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:Gr?K.headBranch:`Reconnect to delete this branch`})]})]})]}):null]})]})]}):null,f?(0,$.jsx)(W,{size:`icon-xs`,variant:`ghost`,"aria-label":`Collapse pull request panel`,onClick:f,children:(0,$.jsx)(O,{className:`size-3.5`})}):null]}),(0,$.jsx)(`div`,{className:G(`col-span-2 grid`,Re?`grid-rows-[1fr]`:`grid-rows-[0fr] transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`),children:(0,$.jsx)(`div`,{ref:qe,className:G(`min-h-0 overflow-hidden transition-[opacity,transform] duration-150 ease-out motion-reduce:transform-none motion-reduce:transition-none`,Re?`translate-y-0 opacity-100 delay-50`:`translate-y-1 opacity-0 duration-100`),inert:!Re,children:K?(0,$.jsx)(`div`,{className:`col-span-2 min-w-0 px-4 pb-2 pt-1`,children:(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 shrink items-center gap-1.5 overflow-hidden text-xs text-muted-foreground`,children:[(0,$.jsx)(Er,{actor:K.author,profileUrl:Vt,variant:`avatar`,className:`shrink-0`}),(0,$.jsx)(`span`,{className:`shrink-0`,children:Dn(K.updatedAt)})]}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-3 w-px shrink-0 bg-border/70`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 font-mono text-2xs text-muted-foreground/65`,children:[br?(0,$.jsxs)(Rd,{baseBranch:K.baseBranch,freshness:br,pending:mn,onUpdate:e=>void In(`update-branch`,void 0,e),iconClassName:`size-3`,className:`max-w-[40%]`,children:[Gt?(0,$.jsx)(X.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(ba,{value:K.baseBranch,showTitle:!1})})]}):(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-[40%] shrink-0 items-center gap-1`,children:[Gt?(0,$.jsx)(X.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(ba,{value:K.baseBranch,showTitle:!1})})]})}),(0,$.jsx)(J,{side:`top`,children:Gt?`Stacked on ${K.baseBranch}`:K.baseBranch})]}),(0,$.jsx)(ne,{"aria-label":`receives changes from`,className:`size-3 shrink-0 opacity-60`}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`code`,{className:`flex min-w-0 flex-1`,children:(0,$.jsx)(ba,{value:K.headBranch,showTitle:!1})})}),(0,$.jsx)(J,{side:`top`,children:K.headBranch})]})]}),(0,$.jsxs)(`span`,{className:`ml-auto inline-flex shrink-0 items-baseline justify-end gap-2 text-2xs`,children:[(0,$.jsxs)(`span`,{className:`inline-flex items-baseline gap-1 tabular-nums`,"aria-label":`${K.changedFiles.toLocaleString()} changed ${K.changedFiles===1?`file`:`files`}`,children:[(0,$.jsx)(ie,{"aria-hidden":!0,className:`size-3 self-center`}),K.changedFiles.toLocaleString()]}),(0,$.jsx)($c,{environmentId:e,reference:E,additions:K.additions,deletions:K.deletions,className:`shrink-0 font-mono text-2xs`,eager:!0})]})]})}):null})}),(0,$.jsx)(`div`,{className:G(`col-span-2 grid`,Re?`grid-rows-[0fr]`:`grid-rows-[1fr] transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`),children:(0,$.jsx)(`div`,{ref:We,className:G(`min-h-0 overflow-hidden transition-[opacity,transform] duration-150 ease-out motion-reduce:transform-none motion-reduce:transition-none`,Re?`-translate-y-1 opacity-0 duration-100`:`translate-y-0 opacity-100 delay-50`),inert:Re,children:K?(0,$.jsx)(cl,{title:vn===null?(0,$.jsxs)(ll,{className:`group gap-1`,children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`h1`,{className:`min-w-0 flex-1 truncate text-base font-semibold leading-snug`,children:K.title})}),(0,$.jsx)(J,{side:`top`,children:K.title})]}),Cs(K)?(0,$.jsx)(Es,{"aria-label":`Edit title`,onClick:()=>_n({pullRequestKey:j,text:K.title})}):null]}):(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(Vn,{autoFocus:!0,size:`sm`,disabled:yn,value:vn,"aria-label":`Pull request title`,onChange:e=>_n({pullRequestKey:j,text:e.target.value}),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),Rn(vn)):e.key===`Escape`&&(e.preventDefault(),_n(null))}}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(W,{size:`xs`,variant:`ghost`,disabled:yn,onClick:()=>_n(null),children:`Cancel`}),(0,$.jsx)(W,{size:`xs`,variant:`outline`,disabled:!lt||yn||vn.trim().length===0,onClick:()=>void Rn(vn),children:yn?`Saving...`:`Save`})]})]}),author:(0,$.jsx)(Er,{actor:K.author,profileUrl:Vt}),updated:(0,$.jsxs)(`span`,{children:[`updated `,Dn(K.updatedAt)]}),checkout:Ht?(0,$.jsx)(fl,{value:Ht,target:`pull request checkout command`,copyLabel:`Copy checkout command`,copiedLabel:`Checkout command copied`,className:`ml-auto font-mono`,tooltipSide:`bottom`,onError:Ut},Ht):null,base:br?(0,$.jsxs)(Rd,{baseBranch:K.baseBranch,freshness:br,pending:mn,onUpdate:e=>void In(`update-branch`,void 0,e),className:`max-w-[40%]`,children:[Gt?(0,$.jsx)(X.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(ba,{value:K.baseBranch,showTitle:!1})})]}):(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-[40%] shrink-0 items-center gap-1`,children:[Gt?(0,$.jsx)(X.stack,{"aria-label":`Stacked pull request`,className:`size-3 shrink-0`}):null,(0,$.jsx)(`code`,{className:`flex min-w-0`,children:(0,$.jsx)(ba,{value:K.baseBranch,showTitle:!1})})]})}),(0,$.jsx)(J,{side:`top`,children:Gt?`Stacked on ${K.baseBranch}`:K.baseBranch})]}),head:(0,$.jsx)(fl,{value:K.headBranch,target:`branch name`,copyLabel:`Copy pull request branch`,copiedLabel:`Branch name copied`},K.headBranch),files:`${K.changedFiles.toLocaleString()} ${K.changedFiles===1?`file`:`files`}`,diffStat:(0,$.jsx)($c,{environmentId:e,reference:E,additions:K.additions,deletions:K.deletions,className:`shrink-0 font-mono text-xs`,eager:!0})}):null})}),K?(0,$.jsx)(ul,{tabs:Sr,value:B,onValueChange:V,onTabIntent:e=>{e===`code`&&Md()},children:B===`summary`?qr?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`ml-auto inline-flex shrink-0`,children:(0,$.jsxs)(W,{size:`xs`,variant:`warning-outline`,disabled:mn,...ot.props(`approve-workflows`,()=>void In(`approve-workflows`)),"aria-label":fn===`approve-workflows`?`Approving...`:ot.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`,children:[(0,$.jsx)(ke,{"aria-hidden":!0,className:`size-3.5`}),(0,$.jsxs)(`span`,{className:`inline-grid`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:`Approve workflows to run`}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:`Confirm approve?`}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:fn===`approve-workflows`?`Approving...`:ot.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`})]})]})})}),(0,$.jsx)(J,{side:`top`,children:fn===`approve-workflows`?`Approving...`:ot.isArmed(`approve-workflows`)?`Confirm approve?`:`Approve workflows to run`})]}):(0,$.jsx)(dl,{className:`text-muted-foreground`,"aria-label":Jr?`Checks: ${Jr}`:`Checks`,icon:Or===null?(0,$.jsx)(m,{"aria-hidden":!0,className:`size-3.5`}):(0,$.jsx)(Vu,{checks:K.checks,stale:kr,checksState:Or,threadRef:r}),label:Jr}):B===`timeline`?(0,$.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsxs)(yr,{className:G(`whitespace-nowrap text-2xs transition-opacity`,(Xt||Zt)&&`opacity-35`),children:[(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1`,"aria-label":Zt?`Comments unavailable`:`${K.commentCount.toLocaleString()} ${K.commentCount===1?`comment`:`comments`}`,children:[(0,$.jsx)(H,{"aria-hidden":!0,className:`size-3`}),Zt?`—`:Xt?`…`:K.commentCount.toLocaleString()]}),(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1`,"aria-label":Zt?`Commits unavailable`:`${K.commits.length.toLocaleString()} ${K.commits.length===1?`commit`:`commits`}`,children:[(0,$.jsx)(_e,{"aria-hidden":!0,className:`size-3`}),Zt?`—`:Xt?`…`:K.commits.length.toLocaleString()]}),Yr>0?(0,$.jsxs)(`span`,{className:G(`inline-flex items-center gap-1`,pr(`approved`)),children:[(0,$.jsx)(wr,{outcome:`approved`,className:`size-3`}),Yr.toLocaleString(),(0,$.jsx)(`span`,{className:`sr-only`,children:Yr===1?`approval`:`approvals`})]}):null]}),(0,$.jsxs)(W,{size:`xs`,variant:`ghost-muted`,"aria-label":U===`newest`?`Show oldest activity first`:`Show newest activity first`,onClick:()=>re(e=>e===`newest`?`oldest`:`newest`),children:[(0,$.jsx)(Ne,{"aria-hidden":!0,className:`size-3`}),U===`newest`?`Newest first`:`Oldest first`]})]}):null}):null]}),(0,$.jsx)(`div`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,onScrollCapture:e=>{let t=Be.current[B];if(e.target!==t||t==null)return;let n=t.scrollTop;je(e=>{let r=e,i=We.current?.scrollHeight??0,a=i-(qe.current?.scrollHeight??0);return e?n<4&&i>0&&(r=!1):i>0&&n>i+32&&(Je.current={tab:B,scroller:t,delta:-a},r=!0),Le.current[B]=r,r})},children:ut.error&&!K?(0,$.jsx)(Ol,{...fi(ut.failure)?{title:`Pull request #${E.number} not found`,error:`It may be an issue rather than a pull request, or this account can't see it.`}:{error:ut.error},refreshing:ut.isPending,onRetry:Qt,...Cn?{gitHubUrl:Cn}:{}}):K?(0,$.jsxs)(qs,{value:Bt,children:[De.has(`summary`)?(0,$.jsx)(`div`,{className:G(`absolute inset-0`,B!==`summary`&&`invisible`),children:(0,$.jsx)(fu,{scrollerRef:Ue.summary,environmentId:e,threadRef:r,reference:E,detail:K,activityPending:Xt,checksStale:kr,activityError:Zt,pendingFinding:st,fixFindingLabel:Un.fixFinding,fixCheckLabel:Un.fixCheck,...Hn?{onFixFinding:tr}:{},onRefresh:Qt,onRefreshChecks:cn})}):null,De.has(`guide`)?(0,$.jsx)(`div`,{className:G(`absolute inset-0`,B!==`guide`&&`invisible`),children:(0,$.jsx)(wd,{environmentId:e,reference:E,active:B===`guide`,title:K.title,workspaceRoot:K.workspaceRoot,canComment:K.capabilities.review.inlineComment&&K.viewerPermissions.comment,onAskAboutLines:(e,t)=>$n({comment:e,request:t},{keepGuide:!0}),onAskAboutStop:Qn,onFinishReview:K.capabilities.review.verdicts.some(e=>K.viewerPermissions.verdicts.includes(e))?()=>R(e=>e+1):null,onOpenFile:xe,onTourShown:y})}):null,De.has(`timeline`)?(0,$.jsx)(`div`,{className:G(`absolute inset-0`,B!==`timeline`&&`invisible`),children:Xt?(0,$.jsx)(Cl,{}):Zt?(0,$.jsx)(Dl,{error:Zt,onRetry:dt.refresh}):(0,$.jsx)(Fu,{scrollerRef:Ue.timeline,detail:K,environmentId:e,threadRef:r,reference:E,order:U,onOpenCommit:pe,onRefresh:Qt})}):null,De.has(`code`)?(0,$.jsx)(`div`,{className:G(`absolute inset-0`,B!==`code`&&`invisible`),children:(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(Po,{label:`Loading pull request diff...`}),children:(0,$.jsx)(Nd,{scrollerRef:Ue.code,onAddToAgentSelection:$n,environmentId:e,reference:E,detail:K,selectedCommitOid:le,onSelectedCommitChange:ue,pendingFinding:st,fixFindingLabel:Un.fixFinding,...Hn?{onFixFinding:tr}:{},onRefresh:Qt,refreshToken:tn,revealRequest:me})})}):null]}):null}),K?(0,$.jsx)(`div`,{className:`absolute right-4 bottom-3 z-20`,children:(0,$.jsx)(Bl,{environmentId:e,reference:E,detail:K,actionPending:mn,onCommentAction:Ln,onCommented:Qt,onReviewSubmitted:Qt,openReviewRequest:L},JSON.stringify([e,E.projectId,E.host,E.repository,E.number]))}):null]})}function Bd(e){let t=(0,Q.c)(36),{entry:n,hostActions:r,visible:i,onActed:a,closing:o,sweeping:s,onCloseSweepStart:c}=e,l=o!==void 0&&o,u=s!==void 0&&s,d;t[0]===n.environmentId?d=t[1]:(d=Ur.runAction.permissionAtom(n.environmentId),t[0]=n.environmentId,t[1]=d);let f=Ie(d),p=Ea(n.environmentId,n.projectId),m;t[2]!==n.host||t[3]!==n.number||t[4]!==n.projectId||t[5]!==n.repository?(m={projectId:n.projectId,host:n.host,repository:n.repository,number:n.number},t[2]=n.host,t[3]=n.number,t[4]=n.projectId,t[5]=n.repository,t[6]=m):m=t[6];let h=m,g;t[7]!==n||t[8]!==a?(g=e=>a?.({entry:n,action:e}),t[7]=n,t[8]=a,t[9]=g):g=t[9];let _;t[10]===p?_=t[11]:(_=e=>{let t=e.capabilities.mergeMethods.filter(t=>e.mergeCapabilities[t]);if(t.length===0)throw Error(`No merge method is available for this repository.`);return hi(t,null,p(),Ui.getState().pullRequestMergeMethod)},t[10]=p,t[11]=_);let v;t[12]!==n.environmentId||t[13]!==h||t[14]!==g||t[15]!==_?(v={environmentId:n.environmentId,reference:h,onSuccess:g,resolveMergeMethod:_},t[12]=n.environmentId,t[13]=h,t[14]=g,t[15]=_,t[16]=v):v=t[16];let{actionPending:y,perform:b}=Oa(v),x,S;if(t[17]!==y||t[18]!==f||t[19]!==l||t[20]!==n||t[21]!==r||t[22]!==c||t[23]!==b||t[24]!==u||t[25]!==i){S=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Vr(n,r),a=y||l||u;if(e.length===0){S=null;break bb0}let o=i||a?`flex`:`none`,s;t[28]===o?s=t[29]:(s={display:o},t[28]=o,t[29]=s);let d;t[30]!==a||t[31]!==f||t[32]!==n||t[33]!==c||t[34]!==b?(d=e=>{let t=Vd[e].label,r=Vd[e].Icon;return(0,$.jsxs)(Y,{children:[(0,$.jsxs)(q,{render:(0,$.jsx)(W,{variant:e===`close`?`destructive-outline`:`outline`,size:`xs`,disabled:!f||a||e===`merge`&&n.stack!==void 0,"aria-label":`${t} #${n.number}`,onClick:()=>void b(e),onPointerDown:t=>{e===`close`&&t.isPrimary&&t.button===0&&(t.stopPropagation(),c?.(n,t.nativeEvent))}}),children:[a?(0,$.jsx)(yt,{size:`xs`}):(0,$.jsx)(r,{"aria-hidden":!0,className:`size-3`}),t]}),(0,$.jsx)(J,{children:e===`merge`&&n.stack?`Open this pull request to merge its stack`:e===`close`&&c?`Close immediately, or drag across rows to close several`:`${t} immediately`})]},e)},t[30]=a,t[31]=f,t[32]=n,t[33]=c,t[34]=b,t[35]=d):d=t[35],x=(0,$.jsx)(`div`,{className:`shrink-0 items-center gap-1 pr-3`,style:s,role:`group`,"aria-label":`Quick actions for pull request #${n.number}`,"data-pull-request-action-pending":y||l,children:e.map(d)})}t[17]=y,t[18]=f,t[19]=l,t[20]=n,t[21]=r,t[22]=c,t[23]=b,t[24]=u,t[25]=i,t[26]=x,t[27]=S}else x=t[26],S=t[27];return S===Symbol.for(`react.early_return_sentinel`)?x:S}var Vd={close:{label:`Close`,Icon:X.closed},merge:{label:`Merge`,Icon:X.merged},ready:{label:`Ready for review`,Icon:X.pullRequest},reopen:{label:`Reopen`,Icon:X.reopen}},Hd=`group/pr-row flex w-full items-center gap-2 rounded-md py-1 pr-1 text-left`,Ud=`shrink-0 font-mono text-xs tabular-nums text-muted-foreground`;function Wd(e){let t=(0,Q.c)(23),{state:n,isDraft:r,mergeability:i,baseBranch:a,below:o,className:s}=e,c;t[0]===s?c=t[1]:(c=G(`flex w-4 shrink-0 flex-col items-center gap-0.5`,s),t[0]=s,t[1]=c);let l;t[2]!==r||t[3]!==n?(l=(0,$.jsx)(xr,{state:n,isDraft:r}),t[2]=r,t[3]=n,t[4]=l):l=t[4];let u;t[5]===i?u=t[6]:(u=i===void 0?{}:{mergeability:i},t[5]=i,t[6]=u);let d;t[7]===a?d=t[8]:(d=a===void 0?{}:{baseBranch:a},t[7]=a,t[8]=d);let f;t[9]!==r||t[10]!==n||t[11]!==u||t[12]!==d?(f=(0,$.jsx)(`span`,{className:`absolute -right-1 -bottom-1 inline-flex`,children:(0,$.jsx)(vr,{state:n,isDraft:r,...u,...d,className:`size-3 fill-background [stroke-width:2.5]`})}),t[9]=r,t[10]=n,t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;t[14]!==l||t[15]!==f?(p=(0,$.jsxs)(`span`,{className:`relative inline-flex`,children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16];let m;t[17]===o?m=t[18]:(m=o?(0,$.jsx)(`span`,{className:`inline-flex text-2xs`,children:o}):null,t[17]=o,t[18]=m);let h;return t[19]!==c||t[20]!==p||t[21]!==m?(h=(0,$.jsxs)(`span`,{className:c,children:[p,m]}),t[19]=c,t[20]=p,t[21]=m,t[22]=h):h=t[22],h}function Gd(e){let t=(0,Q.c)(22),{number:n,title:r,status:i,signals:a,meta:o,metaClassName:s,updatedAt:c}=e,l;t[0]===r?l=t[1]:(l=(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm`,children:r}),t[0]=r,t[1]=l);let u;t[2]===a?u=t[3]:(u=a?(0,$.jsx)(`span`,{className:`flex shrink-0 items-center gap-1 text-2xs`,children:a}):null,t[2]=a,t[3]=u);let d;t[4]===i?d=t[5]:(d=i?(0,$.jsx)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5 text-2xs`,children:i}):null,t[4]=i,t[5]=d);let f;t[6]!==n||t[7]!==l||t[8]!==u||t[9]!==d?(f=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[n,l,u,d]}),t[6]=n,t[7]=l,t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]===s?p=t[12]:(p=G(`flex min-w-0 items-center gap-1.5 overflow-hidden text-2xs text-muted-foreground`,s),t[11]=s,t[12]=p);let m;t[13]===c?m=t[14]:(m=c?(0,$.jsx)(`span`,{className:`ml-auto shrink-0 whitespace-nowrap tabular-nums`,children:Dn(c)}):null,t[13]=c,t[14]=m);let h;t[15]!==o||t[16]!==p||t[17]!==m?(h=(0,$.jsxs)(`span`,{className:p,children:[o,m]}),t[15]=o,t[16]=p,t[17]=m,t[18]=h):h=t[18];let g;return t[19]!==f||t[20]!==h?(g=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[f,h]}),t[19]=f,t[20]=h,t[21]=g):g=t[21],g}function Kd(e){let t=(0,Q.c)(20),{actor:n,className:r,labelClassName:i}=e,a=n?.login??`ghost`,o;t[0]===r?o=t[1]:(o=G(`inline-flex min-w-0 items-center gap-1`,r),t[0]=r,t[1]=o);let s;t[2]===o?s=t[3]:(s=(0,$.jsx)(`span`,{className:o}),t[2]=o,t[3]=s);let c;t[4]===n?c=t[5]:(c=(0,$.jsx)(gr,{actor:n,className:`size-3.5`}),t[4]=n,t[5]=c);let l;t[6]===i?l=t[7]:(l=G(`truncate`,i),t[6]=i,t[7]=l);let u;t[8]!==a||t[9]!==l?(u=(0,$.jsx)(`span`,{className:l,children:a}),t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==s||t[12]!==c||t[13]!==u?(d=(0,$.jsxs)(q,{render:s,children:[c,u]}),t[11]=s,t[12]=c,t[13]=u,t[14]=d):d=t[14];let f=n?.name&&n.name!==a?`${n.name} (@${a})`:a,p;t[15]===f?p=t[16]:(p=(0,$.jsx)(J,{side:`top`,children:f}),t[15]=f,t[16]=p);let m;return t[17]!==d||t[18]!==p?(m=(0,$.jsxs)(Y,{children:[d,p]}),t[17]=d,t[18]=p,t[19]=m):m=t[19],m}function qd(e){let t=(0,Q.c)(8),{head:n,base:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(ba,{value:n}),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`span`,{className:`shrink-0`,children:`→`}),t[2]=a):a=t[2];let o;t[3]===r?o=t[4]:(o=(0,$.jsx)(ba,{value:r,className:`max-w-[45%] shrink-0`}),t[3]=r,t[4]=o);let s;return t[5]!==i||t[6]!==o?(s=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 font-mono`,children:[i,a,o]}),t[5]=i,t[6]=o,t[7]=s):s=t[7],s}var Jd=`[data-slot="dialog-popup"],[data-slot="alert-dialog-popup"],[data-slot="command-dialog-popup"],[data-slot="menu-popup"],[data-slot="select-popup"],[data-slot="popover-popup"],[data-slot="combobox-popup"],[data-slot="autocomplete-popup"]`,Yd={browser:`Only available in the desktop app.`,terminal:`Available when a project is open.`,files:`Available when a project is open.`,diff:`Available for Git repositories.`,pullRequest:`No pull request on this branch yet.`,pullRequests:`No linked pull requests available.`,device:`Available from a thread.`},Xd=1,Zd=[Ca,fa];function Qd(e){return e?.querySelector(`[data-slot="scroll-area-viewport"]`)??null}function $d(e,t){return e.kind!==`preview`||!e.resourceId?null:t[e.resourceId]?.tabId??null}function ef(e){return{label:e.overlay?.audioMuted??!1?`Unmute tab`:`Mute tab`,disabled:e.overlay===null||!e.canResolveRuntimeTabId}}function tf(e){return e?.audible?e.audioMuted?`muted`:`audible`:`none`}function nf(e,t){return t.defaultPrevented||t.isComposing||t.metaKey||t.ctrlKey||t.altKey?null:e.find(e=>e.available&&e.shortcut.toLowerCase()===t.key.toLowerCase())??null}function rf(e){return e?.closest(`input, textarea, select, [contenteditable]:not([contenteditable="false"])`)!=null}function af(e){let t=(0,Q.c)(7),n;t[0]===e.trigger?n=t[1]:(n=(0,$.jsx)(q,{render:e.trigger}),t[0]=e.trigger,t[1]=n);let r;t[2]===e.reason?r=t[3]:(r=(0,$.jsx)(J,{side:`top`,children:e.reason}),t[2]=e.reason,t[3]=r);let i;return t[4]!==n||t[5]!==r?(i=(0,$.jsxs)(Y,{children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6],i}function of(e){let t=(0,Q.c)(14),[n,r]=(0,Z.useState)(-1),i=[{label:`Browser`,icon:E,shortcut:`B`,available:e.browserAvailable,disabledReason:Yd.browser,onClick:e.onAddBrowser},{label:`Terminal`,icon:x,shortcut:`T`,available:e.terminalAvailable,disabledReason:Yd.terminal,onClick:e.onAddTerminal},{label:`Files`,icon:V,shortcut:`F`,available:e.filesAvailable,disabledReason:Yd.files,onClick:e.onAddFiles},...e.onAddDesign?[{label:`Design`,icon:p,shortcut:`G`,available:e.filesAvailable,disabledReason:`Open a project to use Design.`,onClick:e.onAddDesign}]:[],{label:`Diff`,icon:ie,shortcut:`D`,available:e.diffAvailable,disabledReason:Yd.diff,onClick:e.onAddDiff},{label:`Pull request`,icon:X.pullRequest,shortcut:`P`,available:e.pullRequestAvailable,disabledReason:Yd.pullRequest,onClick:e.onAddPullRequest},{label:`Linked pull requests`,icon:X.link,shortcut:`L`,available:e.pullRequestsAvailable,disabledReason:Yd.pullRequests,onClick:e.onAddPullRequests},{label:`Device`,description:`Watch an iOS Simulator or Android Emulator.`,icon:We,shortcut:`M`,available:e.deviceAvailable,disabledReason:Yd.device,onClick:e.onAddDevice}],o=i.filter(uf),s=o.length===0?-1:Math.min(n,o.length-1),c=(0,Z.useRef)(o);(0,Z.useEffect)(()=>{c.current=o});let l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=[],t[0]=l):l=t[0],(0,Z.useEffect)(()=>{let e=e=>{let t=nf(c.current,e);if(!t||document.querySelector(Jd))return;let n=e.composedPath()[0]??e.target;n instanceof Element&&rf(n)||(e.preventDefault(),e.stopPropagation(),t.onClick())};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},l);let u=e=>{if(!(e.defaultPrevented||e.metaKey||e.ctrlKey||e.altKey)&&o.length!==0){if(e.key===`ArrowDown`||e.key===`ArrowRight`)e.preventDefault(),r((s+1)%o.length);else if(e.key===`ArrowUp`||e.key===`ArrowLeft`)e.preventDefault(),r(s===-1?o.length-1:(s-1+o.length)%o.length);else if(e.key===`Enter`){if(e.target!==e.currentTarget)return;let t=o[s];if(!t)return;e.preventDefault(),t.onClick()}}},d=lf,f=e=>s!==-1&&o[s]===e,m=cf,h;t[1]===o?h=t[2]:(h=o.map(sf),t[1]=o,t[2]=h);let g=h.join(``),_;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`h3`,{className:`mb-3 font-medium text-foreground text-sm`,children:`Tools`}),t[3]=_):_=t[3];let v=i.map(t=>t.available?(0,$.jsxs)(`div`,{className:`group relative`,onMouseEnter:()=>r(o.indexOf(t)),onMouseLeave:()=>r(e=>e===o.indexOf(t)?-1:e),children:[(0,$.jsxs)(`button`,{type:`button`,onClick:t.onClick,className:G(`flex h-10 w-full cursor-pointer items-center gap-3 rounded-lg bg-card px-3.5 text-left text-sm transition-colors group-hover:bg-card/60`,f(t)&&`bg-card/60`),children:[m(t,`size-4`),(0,$.jsx)(`span`,{className:G(`min-w-0 flex-1 truncate`,t.label===`Browser`&&e.browserProfiles.length>1&&`pr-8`),children:t.label}),(0,$.jsx)(ea,{variant:`pill`,children:t.shortcut})]}),t.label===`Browser`&&e.browserProfiles.length>1?(0,$.jsxs)(F,{children:[(0,$.jsx)(ze,{render:(0,$.jsx)(W,{"aria-label":`Open browser in a profile`,className:`absolute top-1/2 right-10 -translate-y-1/2`,size:`icon-xs`,variant:`ghost-muted`}),children:(0,$.jsx)(ge,{className:`size-3.5`})}),(0,$.jsx)(Fe,{align:`end`,side:`bottom`,sideOffset:6,className:`max-w-56`,children:e.browserProfiles.map(t=>(0,$.jsx)(a,{onClick:()=>e.onAddBrowserInProfile(t.id),children:(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:t.name})},t.id))})]}):null]},t.label):(0,$.jsx)(af,{reason:t.disabledReason,trigger:(0,$.jsxs)(`div`,{tabIndex:0,"aria-disabled":`true`,className:`flex h-10 w-full cursor-default items-center gap-3 rounded-lg bg-card px-3.5 text-left text-sm opacity-50`,children:[m(t,`size-4`),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.label}),(0,$.jsx)(ea,{variant:`pill`,children:t.shortcut})]})},t.label)),y;t[4]===v?y=t[5]:(y=(0,$.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(14rem,1fr))] gap-x-3 gap-y-2`,children:v}),t[4]=v,t[5]=y);let b;t[6]!==y||t[7]!==_?(b=(0,$.jsxs)(`div`,{className:`w-full max-w-3xl`,children:[_,y]}),t[6]=y,t[7]=_,t[8]=b):b=t[8];let S;return t[9]!==d||t[10]!==u||t[11]!==b||t[12]!==g?(S=(0,$.jsx)(`div`,{ref:d,tabIndex:0,onKeyDown:u,"aria-label":`Open a surface`,"data-surface-launcher-keys":g,className:`scrollbar-gutter-both flex min-h-0 flex-1 flex-col overflow-y-auto bg-muted px-5 py-6 outline-none`,children:b}),t[9]=d,t[10]=u,t[11]=b,t[12]=g,t[13]=S):S=t[13],S}function sf(e){return e.shortcut}function cf(e,t){let n=t===void 0?`size-4`:t,r=e.icon;return(0,$.jsx)(`span`,{className:`relative inline-flex shrink-0 text-muted-foreground`,children:(0,$.jsx)(r,{className:n})})}function lf(e){e?.focus()}function uf(e){return e.available}function df(e,t,n,r){switch(e.kind){case`diff`:return`Diff`;case`design`:return`Design`;case`files`:return`Files`;case`file`:return e.relativePath.slice(Math.max(e.relativePath.lastIndexOf(`/`),e.relativePath.lastIndexOf(`\\`))+1);case`terminal`:return n.get(e.activeTerminalId)??Vi(e.activeTerminalId);case`pull-request`:return`#${e.number}`;case`pull-requests`:return`Pull requests`;case`tools`:return`Tools`;case`aside`:return r?.get(e.threadId)??`Side chat`;case`device`:return e.title??e.target?.name??`Device`;case`preview`:{let n=e.resourceId?t[e.resourceId]:null;if(!n||n.navStatus._tag===`Idle`)return`New tab`;if(n.navStatus.title.trim().length>0)return n.navStatus.title;try{return new URL(n.navStatus.url).host||`Browser`}catch{return`Browser`}}}}function ff(e){let t=(0,Q.c)(8),{capturedUrl:n,url:r}=e,i;t[0]===r?i=t[1]:(i=pt(r,32),t[0]=r,t[1]=i);let a=i,o;t[2]!==n||t[3]!==a?(o=[n,a],t[2]=n,t[3]=a,t[4]=o):o=t[4];let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(E,{className:`size-3 shrink-0`}),t[5]=s):s=t[5];let c;return t[6]===o?c=t[7]:(c=(0,$.jsx)(_s,{sources:o,fallback:s,className:`size-3 shrink-0 rounded-sm object-contain`}),t[6]=o,t[7]=c),c}function pf(e,t){try{return new URL(e).origin===new URL(t).origin}catch{return!1}}function mf(e){let t=(0,Q.c)(19),{surface:n,sessions:r,desktopByTabId:i,theme:a,environmentId:o,pullRequestStatusSeeds:s}=e;switch(n.kind){case`preview`:{let e=n.resourceId?r[n.resourceId]:null,a=!e||e.navStatus._tag===`Idle`?null:e.navStatus.url,o=e?i[e.tabId]?.favicon??null:null,s=o&&a&&pf(o.pageUrl,a)?o.dataUrl:null,c;return t[0]!==s||t[1]!==a?(c=(0,$.jsx)(ff,{capturedUrl:s,url:a}),t[0]=s,t[1]=a,t[2]=c):c=t[2],c}case`diff`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(ie,{className:`size-3 shrink-0`}),t[3]=e):e=t[3],e}case`design`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(p,{className:`size-3 shrink-0`}),t[4]=e):e=t[4],e}case`files`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(V,{className:`size-3 shrink-0`}),t[5]=e):e=t[5],e}case`file`:{let e;return t[6]!==n.relativePath||t[7]!==a?(e=(0,$.jsx)(dr,{pathValue:n.relativePath,kind:`file`,theme:a,className:`size-3`}),t[6]=n.relativePath,t[7]=a,t[8]=e):e=t[8],e}case`terminal`:{let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(x,{className:`size-3 shrink-0`}),t[9]=e):e=t[9],e}case`pull-request`:{let e=s?.[n.id],r;return t[10]!==o||t[11]!==n||t[12]!==e?(r=(0,$.jsx)(gf,{surface:n,environmentId:o,seed:e}),t[10]=o,t[11]=n,t[12]=e,t[13]=r):r=t[13],r}case`pull-requests`:{let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(X.link,{className:`size-3 shrink-0`}),t[14]=e):e=t[14],e}case`tools`:{let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(we,{className:`size-3 shrink-0`}),t[15]=e):e=t[15],e}case`aside`:{let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ce,{className:`size-3 shrink-0`}),t[16]=e):e=t[16],e}case`device`:{let e;return t[17]===n.target?.platform?e=t[18]:(e=n.target?.platform===`ios`?(0,$.jsx)(lr,{className:`size-3 shrink-0`}):n.target?.platform===`android`?(0,$.jsx)(ur,{className:`size-3 shrink-0`}):(0,$.jsx)(We,{className:`size-3 shrink-0`}),t[17]=n.target?.platform,t[18]=e),e}}}function hf(e,t,n,r){if(t===null||n===null)return;let i;for(let a of e)if(a.environmentId===t)for(let e of Xe(a.pullRequests))Qe(e,{host:n,repository:r.repository,number:r.number})&&(i===void 0||(e.snapshot?.syncedAt??``)>(i.snapshot?.syncedAt??``))&&(i=e);return i}function gf(e){let t=(0,Q.c)(11),{surface:n,environmentId:r,seed:i}=e,a=n.environmentId??r,o=Ye(),s=Je(),c;t[0]!==a||t[1]!==n.projectId?(c=e=>e.environmentId===a&&e.id===n.projectId,t[0]=a,t[1]=n.projectId,t[2]=c):c=t[2];let l=o.find(c)?.repositoryIdentity,u=n.host??(l?.provider?Ue(l,l.provider):null),d=Ke(),f=a===null?void 0:d.get(a)?.environment.capabilities,p=f?.threadPullRequests===!0?hf(s,a,u,n)?.snapshot??null:null,m=At(a===null||f?.pullRequests!==!0||p!==null?null:Ur.detail({environmentId:a,input:{projectId:n.projectId,...f?.threadPullRequests===!0&&n.host!==void 0?{host:n.host}:{},repository:n.repository,number:n.number}})).data,h=n.projectId,g;t[3]!==n.number||t[4]!==n.repository||t[5]!==h?(g={projectId:h,repository:n.repository,number:n.number},t[3]=n.number,t[4]=n.repository,t[5]=h,t[6]=g):g=t[6];let _=Wr(a,g,null),v=p??Hr(m,_)??i??null;if(v===null){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(X.pullRequest,{className:`size-3 shrink-0 text-muted-foreground`}),t[7]=e):e=t[7],e}let y=fr({state:v.state,isDraft:v.isDraft??m?.isDraft??i?.isDraft??!1}),b=y.Icon,x=G(`size-3 shrink-0`,y.toneClassName),S;return t[8]!==y||t[9]!==x?(S=(0,$.jsx)(b,{className:x}),t[8]=y,t[9]=x,t[10]=S):S=t[10],S}function _f(e){let t=(0,Q.c)(13),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={activationConstraint:{distance:6}},t[0]=n):n=t[0];let r=la(_a(va,n)),i;t[1]===e.surfaces?i=t[2]:(i=e.surfaces.map(vf),t[1]=e.surfaces,t[2]=i);let a=i,{onMove:o,surfaces:s}=e,c;t[3]!==o||t[4]!==s?(c=e=>{let{active:t,over:n}=e;if(!n||t.id===n.id)return;let r=s.findIndex(e=>e.id===n.id);r>=0&&o?.(String(t.id),r)},t[3]=o,t[4]=s,t[5]=c):c=t[5];let l=c,u;t[6]!==e.children||t[7]!==a?(u=(0,$.jsx)(wa,{items:a,strategy:oa,children:e.children}),t[6]=e.children,t[7]=a,t[8]=u):u=t[8];let d;return t[9]!==l||t[10]!==r||t[11]!==u?(d=(0,$.jsx)(sa,{sensors:r,collisionDetection:aa,modifiers:Zd,onDragEnd:l,children:u}),t[9]=l,t[10]=r,t[11]=u,t[12]=d):d=t[12],d}function vf(e){return e.id}function yf(e){let t=(0,Q.c)(22),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({surfaceId:a,disabled:r,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]!==r||t[6]!==a?(o={id:a,disabled:r},t[5]=r,t[6]=a,t[7]=o):o=t[7];let{listeners:s,setNodeRef:c,transform:l,transition:u,isDragging:d}=da(o),f;t[8]===l?f=t[9]:(f=ua.Translate.toString(l),t[8]=l,t[9]=f);let p;t[10]!==f||t[11]!==u?(p={transform:f,transition:u},t[10]=f,t[11]=u,t[12]=p):p=t[12];let m=d&&`relative z-10`,h;t[13]!==n||t[14]!==m?(h=G(n,m),t[13]=n,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==s||t[17]!==i||t[18]!==c||t[19]!==p||t[20]!==h?(g=(0,$.jsx)(`div`,{...i,...s,ref:c,style:p,className:h}),t[16]=s,t[17]=i,t[18]=c,t[19]=p,t[20]=h,t[21]=g):g=t[21],g}function bf(e){let t=(0,Q.c)(102),n=On&&e.mode===`inline`,r=or().profiles,{resolvedTheme:i}=Ct(),a=(0,Z.useRef)(null),[o,s]=(0,Z.useState)(null),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={hasOverflow:!1,canScrollLeft:!1,canScrollRight:!1},t[0]=c):c=t[0];let[l,u]=(0,Z.useState)(c),d=e.open!==!1&&e.surfaces.length>0,f=d&&e.onAddTools!==void 0,p;t[1]!==d||t[2]!==f||t[3]!==e?(p=t=>{t.defaultPrevented||t.isComposing||sr(t,e.keybindings,{context:{...e.getShortcutContext(),rightPanelOpen:!0}})===`rightPanel.new`&&(document.querySelector(Jd)||(!d||f&&e.browserAvailable)&&(t.preventDefault(),t.stopPropagation(),!t.repeat&&(f?e.onAddTools?.():document.querySelector(`[data-surface-launcher-keys]`)?.focus())))},t[1]=d,t[2]=f,t[3]=e,t[4]=p):p=t[4];let m=(0,Z.useEffectEvent)(p),h;t[5]!==m||t[6]!==e.open?(h=()=>{if(e.open!==!1)return document.addEventListener(`keydown`,m,!0),()=>document.removeEventListener(`keydown`,m,!0)},t[5]=m,t[6]=e.open,t[7]=h):h=t[7];let g;t[8]===e.open?g=t[9]:(g=[e.open],t[8]=e.open,t[9]=g),(0,Z.useEffect)(h,g);let _;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>{let e=Qd(a.current);if(!e)return;let t=e.scrollWidth-e.clientWidth>Xd,n=t&&e.scrollLeft>Xd,r=t&&e.scrollLeft+e.clientWidth<e.scrollWidth-Xd;u(e=>e.hasOverflow===t&&e.canScrollLeft===n&&e.canScrollRight===r?e:{hasOverflow:t,canScrollLeft:n,canScrollRight:r})},t[10]=_):_=t[10];let y=_,x;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{let t=Qd(a.current);if(!t)return;let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;t.scrollBy({left:e*Math.max(120,t.clientWidth*.75),behavior:n?`auto`:`smooth`})},t[11]=x):x=t[11];let S=x,C;t[12]===e?C=t[13]:(C=async(t,n)=>{t.preventDefault(),t.stopPropagation();let r=Et();if(!r)return;let i=e.surfaces.findIndex(e=>e.id===n.id);if(i<0)return;let a=[];n.kind===`device`&&e.onRenameDevice&&a.push({id:`rename`,label:`Rename`}),n.kind===`file`&&n.attachment===void 0&&a.push({id:`copy-path`,label:`Copy path`});let o=$d(n,e.previewSessions),c=o?e.desktopByTabId[o]??null:null,l=c?.audioMuted??!1;n.kind===`preview`&&a.push({id:`toggle-mute`,...ef({overlay:c,canResolveRuntimeTabId:e.previewRuntimeTabId!==void 0})}),a.push({id:`close`,label:`Close`},{id:`close-others`,label:`Close others`,disabled:e.surfaces.length<=1},{id:`close-to-right`,label:`Close to the right`,disabled:i>=e.surfaces.length-1},{id:`close-all`,label:`Close all`,disabled:e.surfaces.length===0});let u=await r.contextMenu.show(a,{x:t.clientX,y:t.clientY});bb134:switch(u){case`rename`:s(n.id);break bb134;case`copy-path`:n.kind===`file`&&n.attachment===void 0&&e.onCopyFilePath(n.relativePath);break bb134;case`toggle-mute`:{let t=o&&c?e.previewRuntimeTabId?.(o)??null:null;t&&Ta?.setAudioMuted(t,!l).catch(wf);break bb134}case`close`:e.onCloseSurface(n);break bb134;case`close-others`:e.onCloseOtherSurfaces(n);break bb134;case`close-to-right`:e.onCloseSurfacesToRight(n);break bb134;case`close-all`:e.onCloseAllSurfaces();break bb134}},t[12]=e,t[13]=C);let w=C,T=Cf,E;t[14]===e?E=t[15]:(E=(t,n)=>{t.button===1&&(t.preventDefault(),t.stopPropagation(),e.onCloseSurface(n))},t[14]=e,t[15]=E);let D=E,O,k;t[16]!==e.activeSurfaceId||t[17]!==l.hasOverflow?(O=()=>{e.activeSurfaceId&&l.hasOverflow&&(a.current?.querySelector(`[data-active-tab='true']`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},k=[e.activeSurfaceId,l.hasOverflow],t[16]=e.activeSurfaceId,t[17]=l.hasOverflow,t[18]=O,t[19]=k):(O=t[18],k=t[19]),(0,Z.useEffect)(O,k);let A,j;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{let e=Qd(a.current);if(!e)return;let t=e.firstElementChild,n=rr(t?[e,t]:e,y);return e.addEventListener(`scroll`,y,{passive:!0}),y(),()=>{n(),e.removeEventListener(`scroll`,y)}},j=[y],t[20]=A,t[21]=j):(A=t[20],j=t[21]),(0,Z.useEffect)(A,j);let M,P;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>{let e=Qd(a.current);if(!e)return;let t=t=>{if(t.ctrlKey)return;let n=Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY;if(t.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=16),t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=e.clientWidth),n===0)return;let r=e.scrollLeft;e.scrollLeft+=n,e.scrollLeft!==r&&(t.preventDefault(),y())};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},P=[y],t[22]=M,t[23]=P):(M=t[22],P=t[23]),(0,Z.useEffect)(M,P);let F=e.mode,I;t[24]===e.maximized?I=t[25]:(I=e.maximized===void 0?{}:{maximized:e.maximized},t[24]=e.maximized,t[25]=I);let L;t[26]===e.open?L=t[27]:(L=e.open===void 0?{}:{open:e.open},t[26]=e.open,t[27]=L);let R;t[28]===e.widthStorageKey?R=t[29]:(R=e.widthStorageKey===void 0?{}:{widthStorageKey:e.widthStorageKey},t[28]=e.widthStorageKey,t[29]=R);let z;t[30]===e.defaultWidth?z=t[31]:(z=e.defaultWidth===void 0?{}:{defaultWidth:e.defaultWidth},t[30]=e.defaultWidth,t[31]=z);let B;t[32]===e.inlineSize?B=t[33]:(B=e.inlineSize?{inlineSize:e.inlineSize}:{},t[32]=e.inlineSize,t[33]=B);let V=e.mode===`inline`&&!e.layoutControls?`pr-28`:`pr-3`,H=n&&`drag-region`,ee=n&&`wco:pr-(--workspace-native-controls-inset)`,te=e.mode===`inline`&&e.maximized&&`[[data-sidebar-state=collapsed]_&]:pl-[var(--workspace-titlebar-content-left)] max-md:[[data-sidebar-state=expanded]_&]:pl-[var(--workspace-titlebar-content-left)]`,U;t[34]!==V||t[35]!==H||t[36]!==ee||t[37]!==te?(U=G(`flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center gap-1 bg-(--app-chrome-background) pl-2`,V,H,ee,te),t[34]=V,t[35]=H,t[36]=ee,t[37]=te,t[38]=U):U=t[38];let ne=e.surfaces,re=e.onMoveSurface,ie;t[39]!==D||t[40]!==w||t[41]!==n||t[42]!==e||t[43]!==o||t[44]!==i?(ie=e.surfaces.map(t=>{let r=t.id===e.activeSurfaceId,a=e.pendingSurfaceIds.has(t.id),c=df(t,e.previewSessions,e.terminalLabelsById,e.asideTitlesByThreadId),l=$d(t,e.previewSessions),u=tf(l?e.desktopByTabId[l]??null:null),d=l?e.previewRuntimeTabId?.(l)??null:null;return(0,$.jsxs)(yf,{surfaceId:t.id,disabled:!e.onMoveSurface||o===t.id,"data-active-tab":r,onMouseDown:T,onAuxClick:e=>D(e,t),onContextMenu:e=>void w(e,t),className:G(`cursor-pointer group/tab flex h-7 w-52 shrink-0 items-center gap-2 rounded-md pr-1 pl-2.5 text-sm transition-colors duration-150`,n&&`[-webkit-app-region:no-drag]`,r?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:bg-accent/60 hover:text-foreground`),children:[(0,$.jsxs)(`span`,{className:`relative flex size-4 shrink-0 items-center justify-center [&_img]:size-3.5 [&_svg]:size-3.5`,children:[(0,$.jsx)(mf,{surface:t,sessions:e.previewSessions,desktopByTabId:e.desktopByTabId,theme:i,environmentId:e.environmentId,pullRequestStatusSeeds:e.pullRequestStatusSeeds}),a?(0,$.jsx)(`span`,{className:`absolute -right-0.5 -bottom-0.5 size-1.5 rounded-full bg-current`,"aria-hidden":!0}):null]}),u===`none`||!d?null:(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`button`,{type:`button`,className:`cursor-pointer flex size-4 shrink-0 items-center justify-center rounded-sm hover:bg-muted`,"aria-label":u===`muted`?`Unmute ${c}`:`Mute ${c}`,onClick:e=>{e.stopPropagation(),Ta?.setAudioMuted(d,u!==`muted`).catch(Sf)},children:(0,$.jsx)(st,{className:`size-3`,icon:u===`muted`?ct:rt})})}),(0,$.jsx)(J,{children:u===`muted`?`Unmute tab`:`Mute tab`})]}),o===t.id?(0,$.jsx)(`input`,{"aria-label":`Device tab name`,className:`min-w-0 flex-1 rounded-sm bg-background px-1 outline-none ring-1 ring-inset ring-ring`,defaultValue:c,ref:xf,onBlur:n=>{e.onRenameDevice?.(t.id,n.currentTarget.value),s(null)},onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(e.currentTarget.value=c,e.currentTarget.blur())}}):(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`button`,{type:`button`,onDoubleClick:()=>{t.kind===`device`&&e.onRenameDevice&&s(t.id)},className:`cursor-pointer flex h-full min-w-0 flex-1 items-center`,onClick:()=>e.onActivate(t),children:(0,$.jsx)(`span`,{className:`truncate`,children:c})})}),(0,$.jsx)(J,{children:t.kind===`device`?(0,$.jsx)(Tf,{surface:t,environmentId:e.environmentId,title:c}):c})]}),(0,$.jsx)(`button`,{type:`button`,"aria-label":`Close ${c}`,className:G(`cursor-pointer flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-opacity duration-150 hover:bg-muted hover:text-foreground focus-visible:opacity-100 pointer-coarse:opacity-100 motion-reduce:transition-none`,r?`opacity-100`:`opacity-0 group-hover/tab:opacity-100`),onClick:()=>e.onCloseSurface(t),children:(0,$.jsx)(pe,{className:`size-3.5`})})]},t.id)}),t[39]=D,t[40]=w,t[41]=n,t[42]=e,t[43]=o,t[44]=i,t[45]=ie):ie=t[45];let ae;t[46]!==e.onMoveSurface||t[47]!==e.surfaces||t[48]!==ie?(ae=(0,$.jsx)(Hn,{radius:`none`,ref:a,hideScrollbars:!0,scrollFade:!0,className:`w-fit min-w-0 flex-initial`,"data-right-panel-tab-list":!0,children:(0,$.jsx)(`div`,{className:`flex h-full w-max min-w-full items-center gap-1`,children:(0,$.jsx)(_f,{surfaces:ne,onMove:re,children:ie})})}),t[46]=e.onMoveSurface,t[47]=e.surfaces,t[48]=ie,t[49]=ae):ae=t[49];let oe;t[50]!==l.canScrollLeft||t[51]!==l.canScrollRight||t[52]!==l.hasOverflow?(oe=l.hasOverflow?(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 [-webkit-app-region:no-drag]`,role:`group`,"aria-label":`Scroll panel tabs`,children:[(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(W,{"aria-label":`Scroll tabs left`,disabled:!l.canScrollLeft,onClick:()=>S(-1),size:`icon-xs`,variant:`ghost`,children:(0,$.jsx)(v,{})})})}),(0,$.jsx)(J,{children:`Scroll tabs left`})]}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(W,{"aria-label":`Scroll tabs right`,disabled:!l.canScrollRight,onClick:()=>S(1),size:`icon-xs`,variant:`ghost`,children:(0,$.jsx)(b,{})})})}),(0,$.jsx)(J,{children:`Scroll tabs right`})]})]}):null,t[50]=l.canScrollLeft,t[51]=l.canScrollRight,t[52]=l.hasOverflow,t[53]=oe):oe=t[53];let se;t[54]!==f||t[55]!==e.onAddTools?(se=f?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(W,{"aria-label":`New tab`,className:`shrink-0 [-webkit-app-region:no-drag]`,onClick:e.onAddTools,size:`icon-xs`,variant:`ghost-muted`}),children:(0,$.jsx)(N,{className:`size-4`})}),(0,$.jsx)(J,{children:`New tab`})]}):null,t[54]=f,t[55]=e.onAddTools,t[56]=se):se=t[56];let ce;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`min-w-0 flex-1`}),t[57]=ce):ce=t[57];let le;t[58]!==n||t[59]!==e.layoutControls?(le=n&&!e.layoutControls?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`hidden w-24 shrink-0 wco:block`}):null,t[58]=n,t[59]=e.layoutControls,t[60]=le):le=t[60];let ue;t[61]===n?ue=t[62]:(ue=n?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none fixed top-[var(--workspace-controls-top)] right-[var(--workspace-controls-right)] h-[var(--workspace-topbar-height)] w-28 [-webkit-app-region:no-drag]`}):null,t[61]=n,t[62]=ue);let de;t[63]!==e.layoutControls||t[64]!==U||t[65]!==ae||t[66]!==oe||t[67]!==se||t[68]!==le||t[69]!==ue?(de=(0,$.jsxs)(`div`,{className:U,"data-right-panel-tabbar":!0,children:[ae,oe,se,ce,e.layoutControls,le,ue]}),t[63]=e.layoutControls,t[64]=U,t[65]=ae,t[66]=oe,t[67]=se,t[68]=le,t[69]=ue,t[70]=de):de=t[70];let fe;t[71]!==r||t[72]!==e.activeSurfaceId||t[73]!==e.browserAvailable||t[74]!==e.children||t[75]!==e.deviceAvailable||t[76]!==e.diffAvailable||t[77]!==e.filesAvailable||t[78]!==e.onAddBrowser||t[79]!==e.onAddBrowserInProfile||t[80]!==e.onAddDesign||t[81]!==e.onAddDevice||t[82]!==e.onAddDiff||t[83]!==e.onAddFiles||t[84]!==e.onAddPullRequest||t[85]!==e.onAddPullRequests||t[86]!==e.onAddTerminal||t[87]!==e.pullRequestAvailable||t[88]!==e.pullRequestsAvailable||t[89]!==e.terminalAvailable?(fe=e.activeSurfaceId===null||e.activeSurfaceId===`tools`?(0,$.jsx)(of,{onAddBrowser:e.onAddBrowser,onAddBrowserInProfile:e.onAddBrowserInProfile,browserProfiles:r,onAddTerminal:e.onAddTerminal,onAddDiff:e.onAddDiff,onAddFiles:e.onAddFiles,...e.onAddDesign?{onAddDesign:e.onAddDesign}:{},onAddPullRequest:e.onAddPullRequest,onAddPullRequests:e.onAddPullRequests,onAddDevice:e.onAddDevice,browserAvailable:e.browserAvailable,terminalAvailable:e.terminalAvailable,diffAvailable:e.diffAvailable,filesAvailable:e.filesAvailable,pullRequestAvailable:e.pullRequestAvailable,pullRequestsAvailable:e.pullRequestsAvailable,deviceAvailable:e.deviceAvailable}):e.children,t[71]=r,t[72]=e.activeSurfaceId,t[73]=e.browserAvailable,t[74]=e.children,t[75]=e.deviceAvailable,t[76]=e.diffAvailable,t[77]=e.filesAvailable,t[78]=e.onAddBrowser,t[79]=e.onAddBrowserInProfile,t[80]=e.onAddDesign,t[81]=e.onAddDevice,t[82]=e.onAddDiff,t[83]=e.onAddFiles,t[84]=e.onAddPullRequest,t[85]=e.onAddPullRequests,t[86]=e.onAddTerminal,t[87]=e.pullRequestAvailable,t[88]=e.pullRequestsAvailable,t[89]=e.terminalAvailable,t[90]=fe):fe=t[90];let me;t[91]===fe?me=t[92]:(me=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-right-panel-surface-content":!0,children:fe}),t[91]=fe,t[92]=me);let he;return t[93]!==e.mode||t[94]!==I||t[95]!==L||t[96]!==R||t[97]!==z||t[98]!==B||t[99]!==de||t[100]!==me?(he=(0,$.jsxs)(fs,{mode:F,...I,...L,...R,...z,...B,children:[de,me]}),t[93]=e.mode,t[94]=I,t[95]=L,t[96]=R,t[97]=z,t[98]=B,t[99]=de,t[100]=me,t[101]=he):he=t[101],he}function xf(e){e?.focus(),e?.select()}function Sf(){}function Cf(e){e.button===1&&e.preventDefault()}function wf(){}function Tf(e){let t=(0,Q.c)(15),n=e.surface.target,{state:r}=nr(n?e.environmentId:null),i;t[0]!==r||t[1]!==n?(i=n?r.devices.find(e=>e.hostId===n.hostId&&e.id===n.deviceId):void 0,t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]!==r||t[4]!==n?(o=n?r.hosts.find(e=>e.id===n.hostId):void 0,t[3]=r,t[4]=n,t[5]=o):o=t[5];let s=o,c;t[6]===e.title?c=t[7]:(c=(0,$.jsx)(`span`,{children:e.title}),t[6]=e.title,t[7]=c);let l;t[8]!==a?.version||t[9]!==s?.label||t[10]!==n?(l=n?(0,$.jsxs)(`span`,{className:`text-muted-foreground`,children:[s?.label??`Device host`,` ·`,` `,a?.version??(n.platform===`ios`?`iOS`:`Android`)]}):null,t[8]=a?.version,t[9]=s?.label,t[10]=n,t[11]=l):l=t[11];let u;return t[12]!==c||t[13]!==l?(u=(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[c,l]}),t[12]=c,t[13]=l,t[14]=u):u=t[14],u}var Ef=(0,Z.memo)(function(e){let t=(0,Q.c)(31),{showThreadPanelControl:n,showTerminalControl:r,showRightPanelControl:i,terminalAvailable:a,terminalOpen:o,terminalShortcutLabel:s,threadPanelOpen:c,threadPanelPresentation:l,threadPanelPopoverHandle:u,threadPanelShortcutLabel:d,rightPanelAvailable:f,rightPanelOpen:p,rightPanelShortcutLabel:m,rightPanelUnavailableLabel:h,rightPanelTabCount:_,onToggleTerminal:v,onToggleThreadPanel:y,onToggleRightPanel:b}=e,x=n===void 0||n,S=r===void 0||r,C=i===void 0||i,w=h===void 0?`Right panel is unavailable`:h,T=_===void 0?0:_,E;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(kf,{}),t[0]=E):E=t[0];let D;t[1]===c?D=t[2]:(D=(0,$.jsx)(Mn,{className:`relative shrink-0 [-webkit-app-region:no-drag]`,pressed:c,"aria-label":`Toggle thread details panel`,variant:`ghost`,size:`sm`,children:E}),t[1]=c,t[2]=D);let O=D,k;t[3]!==y||t[4]!==l||t[5]!==d?(k=e=>(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:e,...l===`popover`?{}:{onClick:y}}),(0,$.jsxs)(J,{side:`bottom`,children:[`Toggle thread details`,d?` (${d})`:``]})]}),t[3]=y,t[4]=l,t[5]=d,t[6]=k):k=t[6];let A=k,j;t[7]!==x||t[8]!==u||t[9]!==l||t[10]!==O||t[11]!==A?(j=x?A(l===`popover`?(0,$.jsx)(Jr,{handle:u,render:O}):O):null,t[7]=x,t[8]=u,t[9]=l,t[10]=O,t[11]=A,t[12]=j):j=t[12];let M;t[13]!==v||t[14]!==S||t[15]!==a||t[16]!==o||t[17]!==s?(M=S?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`flex shrink-0`}),children:(0,$.jsx)(Mn,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:o,onPressedChange:v,"aria-label":`Toggle terminal drawer`,variant:`ghost`,size:`sm`,disabled:!a,children:(0,$.jsx)(g,{className:`size-4`})})}),(0,$.jsx)(J,{side:`bottom`,children:a?`Toggle terminal drawer${s?` (${s})`:``}`:`Terminal drawer is unavailable`})]}):null,t[13]=v,t[14]=S,t[15]=a,t[16]=o,t[17]=s,t[18]=M):M=t[18];let N;t[19]!==b||t[20]!==f||t[21]!==p||t[22]!==m||t[23]!==T||t[24]!==w||t[25]!==C?(N=C?(0,$.jsxs)(Y,{children:[(0,$.jsx)(q,{render:(0,$.jsx)(`span`,{className:`flex shrink-0`}),children:(0,$.jsx)(Mn,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:p,onPressedChange:b,"aria-label":T>0?`Toggle right panel, ${T} ${T===1?`tab`:`tabs`}`:`Toggle right panel`,variant:`ghost`,size:`sm`,disabled:!f,children:T>0?(0,$.jsx)(Df,{count:T}):(0,$.jsx)(st,{className:`size-4`,icon:p?lt:at})})}),(0,$.jsx)(J,{side:`bottom`,children:f?`Toggle right panel${m?` (${m})`:``}`:w})]}):null,t[19]=b,t[20]=f,t[21]=p,t[22]=m,t[23]=T,t[24]=w,t[25]=C,t[26]=N):N=t[26];let P;return t[27]!==M||t[28]!==N||t[29]!==j?(P=(0,$.jsxs)(`div`,{className:`flex h-full shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,"data-panel-layout-controls":!0,children:[j,M,N]}),t[27]=M,t[28]=N,t[29]=j,t[30]=P):P=t[30],P});function Df(e){let t=(0,Q.c)(4),{count:n}=e,r=n>99?`∞`:String(n),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),t[0]=i):i=t[0];let a=r.length>1?11:13,o;return t[1]!==r||t[2]!==a?(o=(0,$.jsxs)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-4`,children:[i,(0,$.jsx)(`text`,{x:`12`,y:`12.5`,fill:`currentColor`,stroke:`none`,fontSize:a,fontWeight:600,textAnchor:`middle`,dominantBaseline:`central`,className:`tabular-nums`,children:r})]}),t[1]=r,t[2]=a,t[3]=o):o=t[3],o}var Of=(0,Z.memo)(function(e){let t=(0,Q.c)(12),{maximized:n,onToggle:r}=e,i=n?`Restore panel size`:`Maximize panel`,a=n?nt:it,o;t[0]===a?o=t[1]:(o=(0,$.jsx)(st,{className:`size-3.5`,icon:a}),t[0]=a,t[1]=o);let s;t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==o?(s=(0,$.jsx)(q,{render:(0,$.jsx)(Mn,{className:`shrink-0 [-webkit-app-region:no-drag]`,pressed:n,onPressedChange:r,"aria-label":i,variant:`ghost`,size:`sm`,children:o})}),t[2]=i,t[3]=n,t[4]=r,t[5]=o,t[6]=s):s=t[6];let c;t[7]===i?c=t[8]:(c=(0,$.jsx)(J,{side:`bottom`,children:i}),t[7]=i,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,$.jsxs)(Y,{children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l});function kf(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,className:`size-4`,children:[(0,$.jsx)(`circle`,{cx:`6`,cy:`7.5`,r:`2.5`}),(0,$.jsx)(`circle`,{cx:`6`,cy:`16.5`,r:`2.5`}),(0,$.jsx)(`path`,{d:`M12 7.5h8`}),(0,$.jsx)(`path`,{d:`M12 16.5h8`})]}),e[0]=t):t=e[0],t}export{Ts as A,Cc as C,mc as D,_c as E,Qo as F,Yo as I,Mo as L,fs as M,ss as N,pc as O,Zo as P,Po as R,Lc as S,hc as T,_l as _,Ud as a,Bc as b,Wd as c,zd as d,Vu as f,yl as g,Ol as h,Hd as i,xs as j,ws as k,Gd as l,jl as m,Of as n,Kd as o,kl as p,bf as r,qd as s,Ef as t,Bd as u,el as v,yc as w,zc as x,$c as y,jo as z};
|
|
216
|
-
//# sourceMappingURL=PanelLayoutControls-
|
|
216
|
+
//# sourceMappingURL=PanelLayoutControls-BL3qZRW6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Wc as i,ff as a,r_ as o,t as s,wf as c}from"./utils-D19Exirm.js";import{B as l,L as u,M as d,W as f}from"./runtime-
|
|
2
|
-
//# sourceMappingURL=PierreEntryIcon-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Wc as i,ff as a,r_ as o,t as s,wf as c}from"./utils-D19Exirm.js";import{B as l,L as u,M as d,W as f}from"./runtime-DEFP_0P0.js";import{a as p,r as m}from"./pierre-icons-CBskVugi.js";function h(e){return{createUploadUrl:d(e,{label:`environment-command:attachments:create-upload-url`,tag:i.attachmentsCreateUploadUrl}),remove:d(e,{label:`environment-command:attachments:delete`,tag:i.attachmentsDelete})}}function g(e){return typeof e==`object`&&!!e&&`_tag`in e&&e._tag===`AssetAttachmentNotFoundError`}async function _(e){let t=await u(e.registry,e.createAssetUrl({environmentId:e.environmentId,input:{resource:{_tag:`attachment`,attachmentId:e.attachmentId}}}),{reportFailure:!1,reportDefect:!1,refresh:!0});if(t._tag===`Success`)return{status:`verified`};let n=f(t);return g(n)?{status:`missing`}:{status:`failed`,error:n}}function v(e){l(e.registry,e.remove,{environmentId:e.environmentId,input:{attachmentId:e.attachmentId}},{reportFailure:!1,reportDefect:!1})}async function y(e){let t=await l(e.registry,e.createUploadUrl,{environmentId:e.environmentId,input:e.upload},{reportFailure:!1});if(t._tag!==`Success`)return{status:`failed`,step:`mint`,attachmentId:null,error:f(t)};let n=t.value.attachmentId;if(e.onMinted?.(n)===`cancel`)return v({registry:e.registry,remove:e.remove,environmentId:e.environmentId,attachmentId:n}),{status:`cancelled`,attachmentId:n};let r=e.resolveUploadUrl(t.value.relativeUrl);if(!r)return{status:`failed`,step:`resolve-url`,attachmentId:n,error:Error(`The environment is not connected.`)};let i=e.transport(r);e.onTransferStart?.(i.abort);try{await i.done}catch(e){return{status:`failed`,step:`transfer`,attachmentId:n,error:e}}return{status:`uploaded`,attachmentId:n}}function b(e){return Math.min(e,o)}function x(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.ceil(e/1024))} KB`}function S(e,t){return`'${e}' exceeds the ${t>=1048576&&t%1048576==0?`${t/1048576} MB`:t>=1024&&t%1024==0?`${t/1024} KB`:`${t} ${t===1?`byte`:`bytes`}`} attachment limit.`}var C=n(),w=e(t(),1),T=e(r(),1),E={astro:[`#a631be`,`#d568ea`],babel:[`#d5a910`,`#ffd452`],bash:[`#199f43`,`#5ecc71`],biome:[`#1a85d4`,`#69b1ff`],bootstrap:[`#693acf`,`#9d6afb`],browserslist:[`#d5a910`,`#ffd452`],bun:[`#594c5b`,`#79697b`],c:[`#1a85d4`,`#69b1ff`],claude:[`#d47628`,`#ffa359`],cpp:[`#1a85d4`,`#69b1ff`],css:[`#693acf`,`#9d6afb`],database:[`#a631be`,`#d568ea`],default:[`#84848a`,`#adadb1`],docker:[`#1a85d4`,`#69b1ff`],eslint:[`#693acf`,`#9d6afb`],git:[`#ff8c5b`,`#d5512f`],go:[`#1ca1c7`,`#68cdf2`],graphql:[`#d32a61`,`#ff678d`],html:[`#d47628`,`#ffa359`],image:[`#d32a61`,`#ff678d`],javascript:[`#d5a910`,`#ffd452`],json:[`#d47628`,`#ffa359`],markdown:[`#199f43`,`#5ecc71`],mcp:[`#17a5af`,`#64d1db`],nextjs:[`#84848a`,`#adadb1`],npm:[`#d52c36`,`#ff6762`],oxc:[`#1ca1c7`,`#68cdf2`],postcss:[`#d52c36`,`#ff6762`],prettier:[`#17a5af`,`#64d1db`],python:[`#1a85d4`,`#69b1ff`],react:[`#1ca1c7`,`#68cdf2`],ruby:[`#d52c36`,`#ff6762`],rust:[`#d47628`,`#ffa359`],sass:[`#d32a61`,`#ff678d`],stylelint:[`#84848a`,`#adadb1`],svelte:[`#d52c36`,`#ff6762`],svg:[`#d47628`,`#ffa359`],svgo:[`#199f43`,`#5ecc71`],swift:[`#d47628`,`#ffa359`],table:[`#17a5af`,`#64d1db`],tailwind:[`#1ca1c7`,`#68cdf2`],terraform:[`#693acf`,`#9d6afb`],text:[`#84848a`,`#adadb1`],typescript:[`#1a85d4`,`#69b1ff`],vite:[`#a631be`,`#d568ea`],vscode:[`#1a85d4`,`#69b1ff`],vue:[`#199f43`,`#5ecc71`],wasm:[`#693acf`,`#9d6afb`],webpack:[`#1a85d4`,`#69b1ff`],yml:[`#d52c36`,`#ff6762`],zig:[`#d47628`,`#ffa359`],zip:[`#d47628`,`#ffa359`]},D=(0,w.memo)(function(e){let t=(0,C.c)(20),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0],(0,w.useInsertionEffect)(m,n);let r;t[1]!==e.kind||t[2]!==e.mimeType||t[3]!==e.pathValue?(r=p(e.pathValue,e.kind,e.mimeType),t[1]=e.kind,t[2]=e.mimeType,t[3]=e.pathValue,t[4]=r):r=t[4];let i=r;if(!i){let n;return t[5]!==e.className||t[6]!==e.kind?(n=e.kind===`directory`?(0,T.jsx)(c,{className:s(`size-4 text-icon-muted`,e.className)}):(0,T.jsx)(a,{className:s(`size-4 text-icon-muted`,e.className)}),t[5]=e.className,t[6]=e.kind,t[7]=n):n=t[7],n}let o=E[i.token??`default`]??E.default,l=i.name,u=i.token,d;t[8]===e.className?d=t[9]:(d=s(`size-4 shrink-0`,e.className),t[8]=e.className,t[9]=d);let f=o?.[e.theme===`light`?0:1],h;t[10]===f?h=t[11]:(h={color:f},t[10]=f,t[11]=h);let g=`#${i.name}`,_;t[12]===g?_=t[13]:(_=(0,T.jsx)(`use`,{href:g}),t[12]=g,t[13]=_);let v;return t[14]!==i.name||t[15]!==i.token||t[16]!==d||t[17]!==h||t[18]!==_?(v=(0,T.jsx)(`svg`,{"aria-hidden":`true`,"data-pierre-icon":l,"data-icon-token":u,className:d,style:h,viewBox:`0 0 16 16`,children:_}),t[14]=i.name,t[15]=i.token,t[16]=d,t[17]=h,t[18]=_,t[19]=v):v=t[19],v});export{S as a,_ as c,v as i,b as n,x as o,h as r,y as s,D as t};
|
|
2
|
+
//# sourceMappingURL=PierreEntryIcon-CcaKUQ_5.js.map
|