ryco-cli 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AcpNativeLogging-vLtnq5f1.cjs → AcpNativeLogging-OhEq3XNp.cjs} +1 -1
- package/dist/{AcpNativeLogging-D3fe64a6.mjs → AcpNativeLogging-qZgtIa5K.mjs} +2 -2
- package/dist/{AzureDevOpsSourceControlProvider-WNUDtsur.mjs → AzureDevOpsSourceControlProvider-B0YsaJyI.mjs} +3 -3
- package/dist/{AzureDevOpsSourceControlProvider-BtezW57t.cjs → AzureDevOpsSourceControlProvider-Dyu8KQ_S.cjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-BWzNM0jW.cjs → BitbucketSourceControlProvider-3VHGKSl1.cjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-tbbUFKz3.mjs → BitbucketSourceControlProvider-B8IPx2Ad.mjs} +3 -3
- package/dist/{ClaudeDriver-BTvdJvam.cjs → ClaudeDriver-CBCy0_WX.cjs} +8 -6
- package/dist/{ClaudeDriver-CG5ngU5z.mjs → ClaudeDriver-DsW8yDj9.mjs} +9 -7
- package/dist/{CodexDriver-CFxwJNXx.cjs → CodexDriver-3TZPgrGk.cjs} +3 -3
- package/dist/{CodexDriver-49o7TA-C.mjs → CodexDriver-DLwPz5sk.mjs} +4 -4
- package/dist/{CodexTextGeneration-C0t4xcPO.mjs → CodexTextGeneration-D1vV8grr.mjs} +2 -2
- package/dist/{CodexTextGeneration-CedcXf9a.cjs → CodexTextGeneration-DLHSW4Mz.cjs} +1 -1
- package/dist/{CopilotDriver-B8J_ovCX.cjs → CopilotDriver-C7a8IhyK.cjs} +3 -3
- package/dist/{CopilotDriver-Cu1B1skB.mjs → CopilotDriver-DXvGBv-s.mjs} +4 -4
- package/dist/{CursorDriver-P_A8uQki.mjs → CursorDriver-CeB_vMKJ.mjs} +4 -4
- package/dist/{CursorDriver-zlKHPy1_.cjs → CursorDriver-uNsDetA3.cjs} +3 -3
- package/dist/{ForgejoSourceControlProvider-szJ-dvsD.cjs → ForgejoSourceControlProvider-CJLksvL_.cjs} +2 -2
- package/dist/{ForgejoSourceControlProvider-DLhJZtq9.mjs → ForgejoSourceControlProvider-Ds0rU_PN.mjs} +3 -3
- package/dist/{GitHubSourceControlProvider-D5MQQPCJ.mjs → GitHubSourceControlProvider-C7CJAslU.mjs} +3 -3
- package/dist/{GitHubSourceControlProvider-3ofb6HsF.cjs → GitHubSourceControlProvider-CrYNFu8S.cjs} +2 -2
- package/dist/{GitLabSourceControlProvider-DkupZH5G.cjs → GitLabSourceControlProvider-jbX5M34A.cjs} +2 -2
- package/dist/{GitLabSourceControlProvider-DLkxeob5.mjs → GitLabSourceControlProvider-u-Y-e8PV.mjs} +3 -3
- package/dist/{GrokDriver-CTUNclwp.cjs → GrokDriver-BJ00ZiYg.cjs} +3 -3
- package/dist/{GrokDriver-D8KoMY76.mjs → GrokDriver-CFgjwnvE.mjs} +4 -4
- package/dist/{OpenCodeDriver-pXM8bSct.cjs → OpenCodeDriver-BTxd2Q3Q.cjs} +424 -209
- package/dist/{OpenCodeDriver-B7htxutj.mjs → OpenCodeDriver-DNApoGdu.mjs} +424 -209
- package/dist/{SourceControlProviderDiscoveryCatalog-Bj_sZfmB.cjs → SourceControlProviderDiscoveryCatalog-CPO3a9_U.cjs} +1 -1
- package/dist/{SourceControlProviderDiscoveryCatalog-C6Fn7rZE.mjs → SourceControlProviderDiscoveryCatalog-hXWNwRMn.mjs} +1 -1
- package/dist/bin.cjs +226 -43
- package/dist/bin.mjs +225 -44
- package/dist/client/assets/{AccountSettings-CinnQaX-.js → AccountSettings-Cey-16wq.js} +1 -1
- package/dist/client/assets/{AiFocusSettings-UbXOywZg.js → AiFocusSettings-CaHQXDaQ.js} +1 -1
- package/dist/client/assets/{AnimatedHeight-DCad8EQ2.js → AnimatedHeight-BC-qaTJY.js} +1 -1
- package/dist/client/assets/{AppearanceSettings-CTh8Z8nz.js → AppearanceSettings-B6UaU-_a.js} +1 -1
- package/dist/client/assets/{BranchToolbar.logic-37EnknDD.js → BranchToolbar.logic-DILAA3Cz.js} +1 -1
- package/dist/client/assets/{ChatRightPanel-DUwLYKbp.js → ChatRightPanel-D-AL07IU.js} +6 -6
- package/dist/client/assets/{ChatThreadRouteView-C43W0PEz.js → ChatThreadRouteView-tEo-zoCf.js} +1 -1
- package/dist/client/assets/{CommandPaletteDialog-IHOe0hOG.js → CommandPaletteDialog-s7yf5Y2S.js} +1 -1
- package/dist/client/assets/{CompositeItem-ClLCuzeJ.js → CompositeItem-97y1QiiT.js} +1 -1
- package/dist/client/assets/{CompositeRoot-Bdsr9eHn.js → CompositeRoot-C7Mz4Y_2.js} +1 -1
- package/dist/client/assets/{ConnectionsSettings-tmBjGOPj.js → ConnectionsSettings-B0-Hkwof.js} +1 -1
- package/dist/client/assets/{DiagnosticsSettings-CbCEgaau.js → DiagnosticsSettings-DX5LH9Bt.js} +1 -1
- package/dist/client/assets/{DialogHandle-CitVLvYq.js → DialogHandle-Cl9dQBJp.js} +1 -1
- package/dist/client/assets/{DialogPopup-CfaEr9jv.js → DialogPopup-a1M74u16.js} +1 -1
- package/dist/client/assets/DialogRoot-C_DO1gtO.js +1 -0
- package/dist/client/assets/{DialogTitle-BUkU0qXf.js → DialogTitle-Bk-w3xLJ.js} +1 -1
- package/dist/client/assets/{DialogTrigger-CEjWue7M.js → DialogTrigger-D9nkMFu2.js} +1 -1
- package/dist/client/assets/{DialogViewport-Cyc_ye5w.js → DialogViewport-tgJz2Lwn.js} +1 -1
- package/dist/client/assets/{DraftChatThreadRouteView-BSA67nKa.js → DraftChatThreadRouteView-BU2IGTR6.js} +1 -1
- package/dist/client/assets/{ExternalIdentityWeb.logic-BqdBjAua.js → ExternalIdentityWeb.logic-Bn1HigS9.js} +1 -1
- package/dist/client/assets/{GlassSurface-B3cq28tB.js → GlassSurface-CDok2tTN.js} +1 -1
- package/dist/client/assets/{HostedConnectionControls-S2Wr9fiZ.js → HostedConnectionControls-Cux_sRCM.js} +1 -1
- package/dist/client/assets/{HostedHubRoot-DK9zP4tJ.js → HostedHubRoot-CyySCdJV.js} +1 -1
- package/dist/client/assets/{HostedNativeAuthorizationRoute-CKnLbCOH.js → HostedNativeAuthorizationRoute-490iDXmk.js} +1 -1
- package/dist/client/assets/{HostedRelayTrustNotice-CbF_SOpf.js → HostedRelayTrustNotice-CcDOAwgS.js} +1 -1
- package/dist/client/assets/{Icons-DZpTOLIb.js → Icons-BEtED8P8.js} +1 -1
- package/dist/client/assets/{IntegrationsSettingsPanel-BdBEGIyL.js → IntegrationsSettingsPanel-BFTAvxtn.js} +1 -1
- package/dist/client/assets/{KeybindingsSettings-Bye1H9Sx.js → KeybindingsSettings-VYgbhiZF.js} +1 -1
- package/dist/client/assets/{McpServersSettings-D0U0g2q7.js → McpServersSettings-DSDCjoTn.js} +1 -1
- package/dist/client/assets/{MobileSheet-BPvuTPR6.js → MobileSheet-BDvnUC5W.js} +1 -1
- package/dist/client/assets/{NewWorktreeDialog-C_xJCZWF.js → NewWorktreeDialog-C65Aifeb.js} +1 -1
- package/dist/client/assets/{NoActiveThreadState-Cfn_Wwnf.js → NoActiveThreadState-DehHNgAp.js} +1 -1
- package/dist/client/assets/{NodeSecuritySettings-DUQNZJqJ.js → NodeSecuritySettings-DW9GJ-kU.js} +1 -1
- package/dist/client/assets/{OpinionatedPluginsSettings-D44efcv7.js → OpinionatedPluginsSettings-DbxPOokL.js} +1 -1
- package/dist/client/assets/{PhoneGetAppInterstitial-CzduFI4-.js → PhoneGetAppInterstitial-CbyVrtDn.js} +1 -1
- package/dist/client/assets/{PhoneGetAppInterstitialBackdrop-CJ44QRCp.js → PhoneGetAppInterstitialBackdrop-BA4R225F.js} +1 -1
- package/dist/client/assets/{PhoneHome-BLEJm5TG.js → PhoneHome-c0j_TBEC.js} +1 -1
- package/dist/client/assets/{PhoneSettingsSurface-CqetLTIm.js → PhoneSettingsSurface-5LFRIx_5.js} +1 -1
- package/dist/client/assets/{ProjectFavicon-DrBXI2cH.js → ProjectFavicon-CeVJCQCy.js} +1 -1
- package/dist/client/assets/{ProviderModelPicker-CyID3P1C.js → ProviderModelPicker-MFRYAv_3.js} +1 -1
- package/dist/client/assets/{ProviderUpdateLaunchNotification.logic-C6VoLD-w.js → ProviderUpdateLaunchNotification.logic-CywRitn3.js} +1 -1
- package/dist/client/assets/{ProvidersSettingsPanel-BHmpXUIM.js → ProvidersSettingsPanel-FYBEqSr_.js} +1 -1
- package/dist/client/assets/{RedactedSensitiveText-CZwFEoNn.js → RedactedSensitiveText-BuWSWty8.js} +1 -1
- package/dist/client/assets/{RootAppShell-BVXRShhe.js → RootAppShell-5HrP6N8H.js} +2 -2
- package/dist/client/assets/{RycoLetterMark-C-fvI9UB.js → RycoLetterMark-CZYntY8t.js} +1 -1
- package/dist/client/assets/{SettingsDialog-CnETTu23.js → SettingsDialog-CpwoqGS8.js} +1 -1
- package/dist/client/assets/{SettingsPanels-C3HDrmQq.js → SettingsPanels-COWRB29-.js} +1 -1
- package/dist/client/assets/{SettingsPanels.editor-DI8Z5rsl.js → SettingsPanels.editor-lbLEbllb.js} +1 -1
- package/dist/client/assets/{SourceControlSettings-BG4tsvql.js → SourceControlSettings-DvBNelcO.js} +1 -1
- package/dist/client/assets/{StatisticsPage-dy_aYqvS.js → StatisticsPage-DxAKqvVX.js} +1 -1
- package/dist/client/assets/{StatisticsPanel-CeRJBu65.js → StatisticsPanel-C0xGLlMA.js} +1 -1
- package/dist/client/assets/{StatisticsSettingsLink-ChlwCDG0.js → StatisticsSettingsLink-B7SZerf3.js} +1 -1
- package/dist/client/assets/{ThreadStatusIndicators-D-ioX09X.js → ThreadStatusIndicators-CIOM98q2.js} +0 -0
- package/dist/client/assets/{ThreadTerminalDrawer-BvGaRxBP.js → ThreadTerminalDrawer-DRelLlEP.js} +1 -1
- package/dist/client/assets/{ThreadWorkspacePanel-BAWm7mGl.js → ThreadWorkspacePanel-CktVSliZ.js} +2 -2
- package/dist/client/assets/{ToolbarRootContext-k-_m5nCN.js → ToolbarRootContext-B1g8IP6k.js} +1 -1
- package/dist/client/assets/{WorkItemsTab-Q2V2EuvK.js → WorkItemsTab-CahU_t_S.js} +1 -1
- package/dist/client/assets/{alert-BymbRVPf.js → alert-DomE7dAt.js} +1 -1
- package/dist/client/assets/{alert-dialog-Gym8_p4Q.js → alert-dialog-9Jyh0e8u.js} +1 -1
- package/dist/client/assets/{authorization-BwQZHweJ.js → authorization-D8lJzXTE.js} +1 -1
- package/dist/client/assets/{badge-BQI7J3Sg.js → badge-w43sx8eF.js} +1 -1
- package/dist/client/assets/{branding-DqHDcyzW.js → branding-B7DcCXjn.js} +1 -1
- package/dist/client/assets/{button-Wf_1nfeu.js → button-DG8WqjNn.js} +1 -1
- package/dist/client/assets/{capabilities-BrllgEYz.js → capabilities-B1FHGoov.js} +1 -1
- package/dist/client/assets/{chatThreadActions-BGkJmj6T.js → chatThreadActions-BZvyhfKr.js} +1 -1
- package/dist/client/assets/{collapsible-GOpRckDq.js → collapsible-EhAEe5S9.js} +1 -1
- package/dist/client/assets/{command-Dx5YM54H.js → command-Cyn6yIEa.js} +1 -1
- package/dist/client/assets/{composerDraftStore-DC2r8dcu.js → composerDraftStore-TYv9j3vY.js} +2 -2
- package/dist/client/assets/{data-list-BSiCZBKn.js → data-list-DTdqWMGN.js} +1 -1
- package/dist/client/assets/{desktopUpdateAtoms-DkmoIGr0.js → desktopUpdateAtoms-CPlZiFRm.js} +1 -1
- package/dist/client/assets/{desktopWorkspace-Ddm531g5.js → desktopWorkspace-DEZ30LlY.js} +1 -1
- package/dist/client/assets/device-CHdXzvhB.js +168 -0
- package/dist/client/assets/{dialog-CUxw5AxI.js → dialog-BNmFD6Nh.js} +1 -1
- package/dist/client/assets/{draft-input-CpfrGQ1h.js → draft-input-dP7F8odz.js} +1 -1
- package/dist/client/assets/{editorPreferences-SOMXdQpi.js → editorPreferences-B4GvqMiF.js} +1 -1
- package/dist/client/assets/{empty-D420OZA9.js → empty-Ccxhyvdf.js} +1 -1
- package/dist/client/assets/{env-Bf33qXdb.js → env-Bcq9YR3B.js} +1 -1
- package/dist/client/assets/{getPseudoElementBounds-nDGTWECG.js → getPseudoElementBounds-CO5HJT7x.js} +1 -1
- package/dist/client/assets/{group-Cq4Llttm.js → group-CzdKmc45.js} +1 -1
- package/dist/client/assets/{index-BL8_ra0g.js → index-Gre6bNC8.js} +2 -2
- package/dist/client/assets/{input-Dl4N9ZfE.js → input-BZz4eLRl.js} +1 -1
- package/dist/client/assets/{kbd-CqoZVQfv.js → kbd-DbvN3zTb.js} +1 -1
- package/dist/client/assets/{keybindings-DQzcPjMv.js → keybindings-BPE3eEAM.js} +1 -1
- package/dist/client/assets/{label-x5DgpBI_.js → label-DZf4lbNF.js} +1 -1
- package/dist/client/assets/{lib-BXIqHSZx.js → lib-DgOYoged.js} +1 -1
- package/dist/client/assets/{logging-CZlHfeu2.js → logging-81iP6Hps.js} +1 -1
- package/dist/client/assets/main-DlGNPwsH.css +2 -0
- package/dist/client/assets/{main-J4YlUJad.js → main-Dz0zookE.js} +2 -2
- package/dist/client/assets/{menu-BuDpxm_Q.js → menu-B6UEFcn0.js} +1 -1
- package/dist/client/assets/{popover-DuprDUaB.js → popover-BuYzXGwl.js} +1 -1
- package/dist/client/assets/{primary-CJx2nSkc.js → primary-CiDY2oUi.js} +1 -1
- package/dist/client/assets/{projectPaths-DrelgodZ.js → projectPaths-D6fHIU1b.js} +1 -1
- package/dist/client/assets/{providerDriverMeta-D27Koh7Q.js → providerDriverMeta-sBwZhQoN.js} +1 -1
- package/dist/client/assets/{providerIconUtils-CtOHwjWL.js → providerIconUtils-DiDJeNtT.js} +1 -1
- package/dist/client/assets/providerInstances-vd2eZtHx.js +1 -0
- package/dist/client/assets/providerModels-vd2eZtHx.js +1 -0
- package/dist/client/assets/{qr-code-BVfzPOP3.js → qr-code-Ie92aZvE.js} +1 -1
- package/dist/client/assets/{radio-group-rgmJqPI7.js → radio-group-BuuTEtdC.js} +1 -1
- package/dist/client/assets/{resolveAriaLabelledBy-l4SuqStl.js → resolveAriaLabelledBy-0FA0k4xp.js} +1 -1
- package/dist/client/assets/{rightPanelRouteSearch-DmpObL1z.js → rightPanelRouteSearch-BS8CkNS6.js} +1 -1
- package/dist/client/assets/{runtime-DYzjhL5M.js → runtime-CPM0EUhb.js} +1 -1
- package/dist/client/assets/{scroll-area-DMs8l4bb.js → scroll-area-C0yF015F.js} +1 -1
- package/dist/client/assets/{scrollEdges-DWTOweRb.js → scrollEdges-DI5Y3mtR.js} +1 -1
- package/dist/client/assets/{select-Djwp8HDm.js → select-CZukJlTn.js} +1 -1
- package/dist/client/assets/{separator-rjtf5Q3V.js → separator-D4ckGtPe.js} +1 -1
- package/dist/client/assets/session-logic-BalPN1Sc.js +4 -0
- package/dist/client/assets/{settingsDialogStore-Dbykwvfs.js → settingsDialogStore-LxRFC5hh.js} +1 -1
- package/dist/client/assets/{settingsLayout-C7bl9Xi4.js → settingsLayout-CHJT5wtl.js} +1 -1
- package/dist/client/assets/{sheet-CQIQYfOM.js → sheet-BNfImQ-7.js} +1 -1
- package/dist/client/assets/{sidebar-BdDOvXe8.js → sidebar-CFGg5Tkr.js} +1 -1
- package/dist/client/assets/{sidebarProjectFolders-D_Me0oJ8.js → sidebarProjectFolders-bhNsO9Z_.js} +1 -1
- package/dist/client/assets/{sidebarStatusText-BF6odB03.js → sidebarStatusText-C8QBhZhZ.js} +1 -1
- package/dist/client/assets/{skeleton-Mgh4Gx9x.js → skeleton-DOgQaVXv.js} +1 -1
- package/dist/client/assets/{spinner-CzzUdFeE.js → spinner-ClQu8SdC.js} +1 -1
- package/dist/client/assets/{src-Ca7Gag3m.js → src-DmPIm3ie.js} +1 -1
- package/dist/client/assets/storeSelectors-Cf2WDMfx.js +1 -0
- package/dist/client/assets/{switch-CntUxI1A.js → switch-BZjA7VT9.js} +1 -1
- package/dist/client/assets/{terminal-links-CUFISn8U.js → terminal-links-CzJomeox.js} +1 -1
- package/dist/client/assets/{textarea-C8QxddDb.js → textarea-DHdmRD1r.js} +1 -1
- package/dist/client/assets/{threadPinning-BIV4KXZU.js → threadPinning-BLqwZebi.js} +1 -1
- package/dist/client/assets/{threadPriorityRefreshRuntime-B-pVYK_y.js → threadPriorityRefreshRuntime-BoNAlBXK.js} +1 -1
- package/dist/client/assets/{toast-Cw7bXJzg.js → toast-C-0Ft2jD.js} +1 -1
- package/dist/client/assets/{toggle-Bi9uP4Hb.js → toggle-DsnOFDbJ.js} +1 -1
- package/dist/client/assets/{toggle-group-LcgyMgj5.js → toggle-group-Chxh9G6t.js} +1 -1
- package/dist/client/assets/{tooltip-t3Nrleyq.js → tooltip-C_-9XEfA.js} +1 -1
- package/dist/client/assets/types-Cf2WDMfx.js +1 -0
- package/dist/client/assets/{uiStateStore-BW2WnK4k.js → uiStateStore-DzUrk2GS.js} +1 -1
- package/dist/client/assets/{useAtlassian-a-MaAd0k.js → useAtlassian-CoHKzu-e.js} +0 -0
- package/dist/client/assets/{useButton-DUuWgIMw.js → useButton-BmvYhoMC.js} +1 -1
- package/dist/client/assets/{useCompositeListItem-CL5mJqCb.js → useCompositeListItem-D0PvH4nv.js} +1 -1
- package/dist/client/assets/{useDebouncedValue-jDDWNjgt.js → useDebouncedValue-s0BC8Yyp.js} +1 -1
- package/dist/client/assets/{useFloatingRootContext-C4I8IxtL.js → useFloatingRootContext-CLCaQEJk.js} +1 -1
- package/dist/client/assets/{useHandleNewThread-820pBJCC.js → useHandleNewThread-Bw460iXT.js} +1 -1
- package/dist/client/assets/{useLabelableId-KX33mhBC.js → useLabelableId-CB_9OReR.js} +1 -1
- package/dist/client/assets/{useLocation-B4QlXdMt.js → useLocation-DGJMt6gP.js} +1 -1
- package/dist/client/assets/{useOpenInteractionType-DjM9MBY7.js → useOpenInteractionType-BSSI2GzS.js} +1 -1
- package/dist/client/assets/{usePhoneThreadActions-DxxWMYgC.js → usePhoneThreadActions-BIDUSWSI.js} +1 -1
- package/dist/client/assets/{usePopupViewport-CAMlnyaP.js → usePopupViewport-8F-J1h5f.js} +1 -1
- package/dist/client/assets/{useScrollLock-CAPfesBT.js → useScrollLock-CBz-5_MX.js} +1 -1
- package/dist/client/assets/{useStatistics-CWasDzsV.js → useStatistics-B91973jb.js} +1 -1
- package/dist/client/assets/{useSwipeDismiss-BZsYSBgq.js → useSwipeDismiss-D22_vuiH.js} +1 -1
- package/dist/client/assets/{useThreadActions-MOjDrEnS.js → useThreadActions-BCH01d6u.js} +1 -1
- package/dist/client/assets/{useTriggerFocusGuards-D5z439rn.js → useTriggerFocusGuards-f7afwACm.js} +1 -1
- package/dist/client/assets/{useValueChanged-D0CHQQwP.js → useValueChanged-EkWF0C3k.js} +1 -1
- package/dist/client/assets/{utils-B76_2Yk7.js → utils-CV2fJJxC.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/{collectUint8StreamText-B9B7bGv9.cjs → collectUint8StreamText-Dsbmrw73.cjs} +2 -0
- package/dist/{collectUint8StreamText-RzKEq2NY.mjs → collectUint8StreamText-oFvWyN3_.mjs} +2 -0
- package/dist/{makeManagedServerProvider-BF1eBatf.cjs → makeManagedServerProvider-CANTNAsz.cjs} +9 -2
- package/dist/{makeManagedServerProvider-BuG2fLP8.mjs → makeManagedServerProvider-PLtJj7EV.mjs} +10 -3
- package/package.json +1 -1
- package/dist/client/assets/DialogRoot-CyEOjgGH.js +0 -1
- package/dist/client/assets/device-B0aqBYM1.js +0 -168
- package/dist/client/assets/main-B7T7on1T.css +0 -2
- package/dist/client/assets/providerInstances-BPwEwwpF.js +0 -1
- package/dist/client/assets/providerModels-BPwEwwpF.js +0 -1
- package/dist/client/assets/session-logic-DLEAZb3K.js +0 -4
- package/dist/client/assets/storeSelectors-D7HbqO4E.js +0 -1
- package/dist/client/assets/types-D7HbqO4E.js +0 -1
package/dist/client/assets/{ThreadWorkspacePanel-BAWm7mGl.js → ThreadWorkspacePanel-CktVSliZ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{_ as r,g as i,t as a,y as o}from"./env-Bf33qXdb.js";import{oi as s}from"./src-Ca7Gag3m.js";import{$t as c,Et as l,In as u,Jt as d,Ot as f,Pt as p,Qt as m,Rn as h,Sn as g,St as _,Un as v,Zn as y,Zt as b,en as x,f as S,hn as C,mn as w,nn as T,tn as E,wt as D}from"./runtime-DYzjhL5M.js";import{Dt as O,_t as k,ht as A}from"./primary-CJx2nSkc.js";import{t as j}from"./useDebouncedValue-jDDWNjgt.js";import{It as M,P as ee,_t as N,i as te,vt as P}from"./composerDraftStore-DC2r8dcu.js";import{c as ne,d as re,l as ie}from"./useSwipeDismiss-BZsYSBgq.js";import{t as ae}from"./useRouter-CcIDS3PN.js";import{_ as oe,a as se,c as F,d as ce,f as le,g as ue,i as de,l as I,m as fe,o as L,p as R,r as pe,s as z,t as me,u as he}from"./rightPanelRouteSearch-DmpObL1z.js";import{t as ge}from"./useNavigate-2tVq4iZ2.js";import{f as B}from"./useRenderElement-DchFnsR8.js";import{t as _e}from"./arrow-left-Dtj9PfsA.js";import{t as ve}from"./bot-DJp0cuhK.js";import{n as ye,t as be}from"./loader-circle-CrtHFAvM.js";import{t as xe}from"./chevron-down-B7C6FKzM.js";import{c as Se,o as Ce}from"./tabSwitchInstrumentation-CLDM7g1_.js";import{t as we}from"./chevron-right-BWYGybX9.js";import{n as Te}from"./useFloatingRootContext-C4I8IxtL.js";import{t as Ee}from"./circle-alert-BWvs6IOn.js";import{i as De}from"./toast-Cw7bXJzg.js";import{t as V}from"./clock-3-r12DkpRj.js";import{C as Oe}from"./lib-BXIqHSZx.js";import{t as ke}from"./folder-closed-CsvKfC6X.js";import{t as Ae}from"./folder-open-GqwNTbSV.js";import{t as H}from"./folder-DtsQoI9_.js";import{$ as U,$t as je,A as Me,At as Ne,B as Pe,Bt as Fe,Ct as Ie,Dt as Le,Et as Re,F as ze,Ft as W,G as Be,Gt as Ve,H as He,Ht as Ue,I as We,It as Ge,J as Ke,Jt as qe,K as Je,Kt as Ye,L as Xe,Lt as Ze,M as Qe,Mt as $e,N as et,Nt as tt,Ot as nt,P as rt,Pt as it,Q as at,Qt as ot,R as G,Rt as st,St as ct,Tt as lt,U as ut,Ut as dt,V as ft,Vt as pt,W as mt,Wt as ht,X as gt,Xt as _t,Y as vt,Yt as yt,Z as bt,Zt as xt,_t as St,at as Ct,bt as wt,c as Tt,ct as Et,d as Dt,dt as Ot,en as kt,et as At,ft as jt,g as Mt,gt as Nt,h as Pt,ht as Ft,in as It,it as Lt,j as Rt,jt as zt,k as Bt,kt as Vt,l as Ht,lt as Ut,m as Wt,mt as Gt,n as Kt,nn as qt,nt as Jt,ot as Yt,p as Xt,pt as Zt,q as Qt,qt as $t,r as en,rn as tn,rt as nn,s as rn,st as an,t as on,tn as sn,tt as cn,u as ln,ut as un,vt as dn,wt as fn,xt as K,yt as pn,z as mn,zt as hn}from"./device-B0aqBYM1.js";import{t as gn}from"./minimize-2-C33mL7LT.js";import{t as _n}from"./plus-B2h-VEqh.js";import{t as vn}from"./refresh-cw-DopCMrtR.js";import{t as yn}from"./save-Bh36JIv6.js";import{t as bn}from"./search-BGQsenCM.js";import{t as xn}from"./smartphone-gNe1ynB8.js";import{t as Sn}from"./ThreadTerminalDrawer-BvGaRxBP.js";import{i as Cn}from"./terminal-links-CUFISn8U.js";import{t as wn}from"./terminal-C_CyIsDD.js";import{t as Tn}from"./triangle-alert-RL_T3KLo.js";import{t as En}from"./unplug-Cw8iawyX.js";import{t as Dn}from"./x-C1Cemsov.js";import{l as On,t as q}from"./utils-B76_2Yk7.js";import{_ as kn,a as An,g as jn,m as Mn,n as Nn,t as Pn,v as Fn,y as In}from"./session-logic-DLEAZb3K.js";import"./storeSelectors-D7HbqO4E.js";import{o as Ln}from"./timestampFormat-8uPXS812.js";import{_ as Rn}from"./keybindings-DQzcPjMv.js";import{i as zn,n as Bn,t as Vn}from"./tooltip-t3Nrleyq.js";import{t as Hn}from"./scroll-area-DMs8l4bb.js";import{t as Un}from"./button-Wf_1nfeu.js";import{n as Wn}from"./composerHandleContext-BrQ6d8r9.js";import{i as Gn,r as Kn,t as qn}from"./alert-BymbRVPf.js";import{n as Jn,t as Yn}from"./sidebarStatusText-BF6odB03.js";import{a as Xn,i as Zn,o as Qn,r as $n,s as er,t as tr}from"./alert-dialog-Gym8_p4Q.js";import{n as nr}from"./editorPreferences-SOMXdQpi.js";import{t as rr}from"./badge-BQI7J3Sg.js";import{t as ir}from"./useTheme-By1kfyiU.js";import{n as ar,t as or}from"./toggle-group-LcgyMgj5.js";import{t as sr}from"./toggle-Bi9uP4Hb.js";var J=e(t(),1);function cr(e,t){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if(`shouldBlockFn`in e)return e;if(typeof e==`function`){let n=!!(t??!0);return{shouldBlockFn:async()=>n?await e():!1,enableBeforeUnload:n,withResolver:!1}}let n=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>n&&r!==void 0?await r():n,enableBeforeUnload:n,withResolver:r===void 0}}function lr(e,t){let{shouldBlockFn:n,enableBeforeUnload:r=!0,disabled:i=!1,withResolver:a=!1}=cr(e,t),o=ae(),{history:s}=o,[c,l]=J.useState({status:`idle`,current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return J.useEffect(()=>i?void 0:s.block({blockerFn:async e=>{function t(e){let t=o.parseLocation(e),[,n,r]=o.getMatchedRoutes(t.pathname);return r===void 0?{routeId:`__notFound__`,fullPath:t.pathname,pathname:t.pathname,params:n,search:o.options.parseSearch(e.search)}:{routeId:r.id,fullPath:r.fullPath,pathname:t.pathname,params:n,search:o.options.parseSearch(e.search)}}let r=t(e.currentLocation),i=t(e.nextLocation);if(r.routeId===`__notFound__`&&i.routeId!==`__notFound__`)return!1;let s=await n({action:e.action,current:r,next:i});if(!a)return s;if(!s)return!1;let c=await new Promise(t=>{l({status:`blocked`,current:r,next:i,action:e.action,proceed:()=>t(!1),reset:()=>t(!0)})});return l({status:`idle`,current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),c},enableBeforeUnload:r}),[n,r,i,a,s,o]),c}var ur=B(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),dr=B(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),fr=B(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),pr=B(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),mr=B(`disc-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M6 12c0-1.7.7-3.2 1.8-4.2`,key:`oqkarx`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M18 12c0 1.7-.7 3.2-1.8 4.2`,key:`1eah9h`}]]),hr=B(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),gr=B(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),_r=B(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),vr=B(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),yr=B(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),br=B(`monitor-off`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M17 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 1.184-1.826`,key:`cv7jms`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`path`,{d:`M8.656 3H20a2 2 0 0 1 2 2v10a2 2 0 0 1-.293 1.042`,key:`z8ni2w`}]]),xr=B(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Sr=B(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),Cr=B(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),wr=B(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Tr=B(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),Er=B(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),Dr=B(`volume-1`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}]]),Or=B(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),Y=n(),X=M(),kr={pending:{dotClass:`bg-info`,label:`Working`},running:{dotClass:`bg-info`,label:`Working`},waiting:{dotClass:`bg-info`,label:`Working`},idle:{dotClass:`bg-muted-foreground/50`,label:`Idle · resumable`},completed:{dotClass:`bg-success`,label:`Completed`},failed:{dotClass:`bg-destructive`,label:`Failed`},cancelled:{dotClass:`bg-muted-foreground/60`,label:`Stopped`},interrupted:{dotClass:`bg-muted-foreground/60`,label:`Stopped`}},Ar=(0,J.createContext)({identities:new Map,onOpenAgent:null});function jr(e){let t=(0,Y.c)(4),{status:n}=e,r=kr[n],i;t[0]===r.dotClass?i=t[1]:(i=q(`size-1.5 shrink-0 rounded-full`,r.dotClass),t[0]=r.dotClass,t[1]=i);let a;return t[2]===i?a=t[3]:(a=(0,X.jsx)(`span`,{"aria-hidden":!0,className:i}),t[2]=i,t[3]=a),a}function Mr(e){let t=Math.max(0,Math.floor(e)),n=Math.floor(t/60);if(n===0)return`${t}s`;let r=Math.floor(n/60);return r===0?`${n}m ${String(t%60).padStart(2,`0`)}s`:`${r}h ${String(n%60).padStart(2,`0`)}m`}function Nr(e,t){let n=Date.parse(e),r=t?Date.parse(t):Date.now();return Number.isNaN(n)||Number.isNaN(r)?``:Mr((r-n)/1e3)}function Pr(e){return e.usage?.durationMs===void 0?e.startedAt&&e.completedAt?Nr(e.startedAt,e.completedAt):null:Mr(e.usage.durationMs/1e3)}function Fr(e){let t=(0,Y.c)(12),{agent:n}=e,r=(0,J.useRef)(null),i=n.status===`running`||n.status===`waiting`,a=n.startedAt,o,s;if(t[0]!==i||t[1]!==a?(o=()=>{if(!i||!a)return;let e=()=>{r.current&&(r.current.textContent=Nr(a,null))};e();let t=setInterval(e,1e3);return()=>clearInterval(t)},s=[i,a],t[0]=i,t[1]=a,t[2]=o,t[3]=s):(o=t[2],s=t[3]),(0,J.useEffect)(o,s),!i){let e;t[4]===n?e=t[5]:(e=Pr(n),t[4]=n,t[5]=e);let r=e,i;return t[6]===r?i=t[7]:(i=r?(0,X.jsx)(`span`,{className:`tabular-nums`,children:r}):null,t[6]=r,t[7]=i),i}if(!a)return null;let c;t[8]===a?c=t[9]:(c=Nr(a,null),t[8]=a,t[9]=c);let l;return t[10]===c?l=t[11]:(l=(0,X.jsx)(`span`,{ref:r,className:`tabular-nums`,children:c}),t[10]=c,t[11]=l),l}function Ir(e,t){return/^structured[\s_-]?output$/i.test(e)?t?`Delivering result`:`Delivered result`:t?`Using ${e}`:e}function Lr(e){return e.status===`running`||e.status===`pending`||e.status===`waiting`?e.progress??(e.lastToolName?Ir(e.lastToolName,!0):null)??e.result??e.error:e.error??e.result??e.progress??(e.lastToolName?Ir(e.lastToolName,!1):null)}function Rr(e){let t=(0,Y.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`div`,{className:`divide-y divide-border/30`,children:n}),t[0]=n,t[1]=r),r}function zr(e){let t=(0,Y.c)(11),{title:n}=e,r=`${n} pending`,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex size-7 items-center justify-center rounded-lg border border-dashed border-border/60 bg-background/30 text-muted-foreground/55`,children:(0,X.jsx)(V,{className:`size-3.5`})}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,X.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground/75`,children:n}),t[1]=n,t[2]=a);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground/65`,children:`Waiting for this stage to start`}),t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=(0,X.jsxs)(`span`,{className:`min-w-0`,children:[a,o]}),t[4]=a,t[5]=s);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono text-[.68rem] text-muted-foreground/65`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-muted-foreground/40`}),`Pending`]}),t[6]=c):c=t[6];let l;return t[7]!==r||t[8]!==s||t[9]!==n?(l=(0,X.jsxs)(`div`,{"data-workflow-pending-step":!0,"data-phase-title":n,"aria-label":r,className:`grid h-14 grid-cols-[1.75rem_minmax(0,1fr)_auto] items-center gap-x-2 rounded-md px-1.5 py-1 text-left`,children:[i,s,c]}),t[7]=r,t[8]=s,t[9]=n,t[10]=l):l=t[10],l}function Br(e){let t=(0,Y.c)(69),{agent:n}=e,{identities:r,onOpenAgent:i}=(0,J.use)(Ar),a=kr[n.status],o;t[0]===n?o=t[1]:(o=Lr(n),t[0]=n,t[1]=o);let s=o,c;t[2]!==n.effort||t[3]!==n.model?(c=jn(n.model,n.effort),t[2]=n.effort,t[3]=n.model,t[4]=c):c=t[4];let l=c,u,d,f;t[5]!==n.id||t[6]!==n.title||t[7]!==r?(d=r.get(n.id),u=d?.codename??n.title,f=d?.role&&!In(d.role,u)&&!In(d.role,n.title)?d.role:null,t[5]=n.id,t[6]=n.title,t[7]=r,t[8]=u,t[9]=d,t[10]=f):(u=t[8],d=t[9],f=t[10]);let p=f,m=d?.taskLabel??n.title,h;t[11]===n.usage?h=t[12]:(h=n.usage?`${kn(n.usage.totalTokens)} tok`:`— tok`,t[11]=n.usage,t[12]=h);let g=n.usage?.toolUses===void 0?null:`${n.usage.toolUses} tools`,_=n.activationCount>1?`run ${n.activationCount}`:null,v;t[13]!==l||t[14]!==h||t[15]!==g||t[16]!==_?(v=[l,h,g,_].filter(Vr),t[13]=l,t[14]=h,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y=v,b=d?.avatarKey??n.id,x;t[18]===b?x=t[19]:(x=(0,X.jsx)(kt,{name:b,className:`size-5`}),t[18]=b,t[19]=x);let S;t[20]===n.status?S=t[21]:(S=(0,X.jsx)(`span`,{className:`absolute -right-0.5 -bottom-0.5 grid size-2.5 place-items-center rounded-full bg-background ring-1 ring-background`,children:(0,X.jsx)(jr,{status:n.status})}),t[20]=n.status,t[21]=S);let C;t[22]!==S||t[23]!==x?(C=(0,X.jsxs)(`span`,{"aria-hidden":!0,className:`relative col-start-1 row-span-3 row-start-1 mt-0.5 flex size-7 items-center justify-center rounded-lg border border-border/45 bg-background/45`,children:[x,S]}),t[22]=S,t[23]=x,t[24]=C):C=t[24];let w;t[25]===u?w=t[26]:(w=(0,X.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold tracking-[-0.01em]`,children:u}),t[25]=u,t[26]=w);let T;t[27]===p?T=t[28]:(T=p?(0,X.jsx)(`span`,{className:`max-w-32 shrink-0 truncate rounded-sm border border-border/60 bg-background/40 px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:p}):null,t[27]=p,t[28]=T);let E;t[29]!==w||t[30]!==T?(E=(0,X.jsxs)(`span`,{className:`col-start-2 row-start-1 flex min-w-0 items-center gap-1.5`,children:[w,T]}),t[29]=w,t[30]=T,t[31]=E):E=t[31];let D;t[32]===n?D=t[33]:(D=(0,X.jsx)(Fr,{agent:n}),t[32]=n,t[33]=D);let O;t[34]===n.status?O=t[35]:(O=n.status===`completed`?(0,X.jsx)(ye,{"aria-hidden":!0,className:`size-3 text-success`}):null,t[34]=n.status,t[35]=O);let k;t[36]!==D||t[37]!==O?(k=(0,X.jsx)(`span`,{className:`col-start-3 row-start-1 min-w-14 text-right font-mono text-[.7rem] text-muted-foreground/80`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[D,O]})}),t[36]=D,t[37]=O,t[38]=k):k=t[38];let A;t[39]===m?A=t[40]:(A=(0,X.jsx)(`span`,{className:`col-start-2 col-end-4 row-start-2 block truncate text-[11px] text-foreground/65`,title:m,children:m}),t[39]=m,t[40]=A);let j=n.status===`failed`?`text-destructive-foreground`:`text-muted-foreground`,M;t[41]===j?M=t[42]:(M=q(`col-start-2 row-start-3 block min-w-0 truncate text-xs`,j),t[41]=j,t[42]=M);let ee=s??a.label,N=s??a.label,te;t[43]!==M||t[44]!==ee||t[45]!==N?(te=(0,X.jsx)(`span`,{className:M,title:ee,children:N}),t[43]=M,t[44]=ee,t[45]=N,t[46]=te):te=t[46];let P=y.join(` · `),ne;t[47]===P?ne=t[48]:(ne=(0,X.jsx)(`span`,{className:`col-start-3 row-start-3 max-w-40 truncate text-right font-mono text-[.68rem] tabular-nums text-muted-foreground/65`,children:P}),t[47]=P,t[48]=ne);let re;t[49]===a.label?re=t[50]:(re=(0,X.jsx)(`span`,{className:`sr-only`,children:a.label}),t[49]=a.label,t[50]=re);let ie;t[51]!==C||t[52]!==E||t[53]!==k||t[54]!==A||t[55]!==te||t[56]!==ne||t[57]!==re?(ie=(0,X.jsxs)(X.Fragment,{children:[C,E,k,A,te,ne,re]}),t[51]=C,t[52]=E,t[53]=k,t[54]=A,t[55]=te,t[56]=ne,t[57]=re,t[58]=ie):ie=t[58];let ae=ie,oe=i&&`hover:bg-accent/35 focus-visible:ring-2 focus-visible:ring-ring/50`,se;t[59]===oe?se=t[60]:(se=q(`grid h-[4.5rem] w-full grid-cols-[1.75rem_minmax(0,1fr)_auto] grid-rows-[1.375rem_1.125rem_1rem] items-center gap-x-2 rounded-md px-1.5 py-1 text-left outline-none transition-colors`,oe),t[59]=oe,t[60]=se);let F=se,ce;return t[61]!==n.id||t[62]!==F||t[63]!==u||t[64]!==ae||t[65]!==i||t[66]!==p||t[67]!==a.label?(ce=i?(0,X.jsx)(`button`,{type:`button`,className:F,"data-agent-row":!0,"data-agent-id":n.id,onClick:()=>i(n.id),"aria-label":`Open ${u}${p?`, ${p}`:``} transcript. ${a.label}.`,children:ae}):(0,X.jsx)(`div`,{className:F,"data-agent-row":!0,"data-agent-id":n.id,children:ae}),t[61]=n.id,t[62]=F,t[63]=u,t[64]=ae,t[65]=i,t[66]=p,t[67]=a.label,t[68]=ce):ce=t[68],ce}function Vr(e){return e!==null}function Hr(e){let t=e.workflow.status;return t!==`completed`&&t!==`failed`&&t!==`cancelled`&&t!==`interrupted`}function Ur(e){return[...e.phases.flatMap(e=>e.members),...e.unphasedMembers]}function Wr(e){let t=(0,Y.c)(4),{group:n}=e;if(n.phases.length===0)return null;let r;t[0]===n.phases?r=t[1]:(r=n.phases.map(Gr),t[0]=n.phases,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,X.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-1 gap-y-1 px-1.5 pb-1 pt-1.5`,children:r}),t[2]=r,t[3]=i),i}function Gr(e,t){return(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t>0?(0,X.jsx)(we,{"aria-hidden":!0,className:`size-3 text-muted-foreground/40`}):null,(0,X.jsxs)(`div`,{className:q(`flex items-center gap-1 rounded-sm border px-1.5 py-0.5`,e.state===`running`?`border-info/40`:e.state===`done`?`border-success/30`:`border-border/50`),children:[(0,X.jsxs)(`span`,{className:q(`font-mono text-[.65rem]`,e.state===`running`?`text-info-foreground`:e.state===`done`?`text-success-foreground`:`text-muted-foreground/70`),children:[e.state===`done`?`✓ `:``,e.title]}),(0,X.jsx)(`span`,{className:`flex items-center gap-0.5`,children:e.members.length===0?(0,X.jsx)(`span`,{className:`font-mono text-[.6rem] text-muted-foreground/50`,children:`–`}):e.members.map(Kr)})]})]},e.index)}function Kr(e){return(0,X.jsx)(jr,{status:e.status},e.id)}var qr=15e3;function Jr(e){let t=(0,Y.c)(28),{environmentId:n,threadId:r,scriptPath:i,onClose:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={state:`loading`},t[0]=o):o=t[0];let[s,c]=(0,J.useState)(o),[l,u]=(0,J.useState)(0),d;t[1]!==n||t[2]!==i||t[3]!==r?(d=()=>{let e=!1,t;c({state:`loading`});let a=C(n)?.orchestration.getWorkflowScript;if(!a){c({state:`failed`});return}let o=new Promise((e,n)=>{t=setTimeout(()=>n(Error(`workflow script fetch timed out`)),qr)});return Promise.race([a({threadId:r,scriptPath:i}),o]).then(t=>{e||c({state:`loaded`,contents:t.contents,truncated:t.truncated})}).catch(()=>{e||c({state:`failed`})}).finally(()=>{t!==void 0&&clearTimeout(t)}),()=>{e=!0,t!==void 0&&clearTimeout(t)}},t[1]=n,t[2]=i,t[3]=r,t[4]=d):d=t[4];let f;t[5]!==l||t[6]!==n||t[7]!==i||t[8]!==r?(f=[n,r,i,l],t[5]=l,t[6]=n,t[7]=i,t[8]=r,t[9]=f):f=t[9],(0,J.useEffect)(d,f);let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,X.jsx)(ur,{"aria-hidden":!0,className:`size-3 text-muted-foreground`}),t[10]=p):p=t[10];let m;t[11]===i?m=t[12]:(m=i.split(`/`).at(-1),t[11]=i,t[12]=m);let h;t[13]===m?h=t[14]:(h=(0,X.jsx)(`span`,{className:`truncate font-mono text-[.65rem] text-muted-foreground`,children:m}),t[13]=m,t[14]=h);let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,X.jsx)(Dn,{"aria-hidden":!0,className:`size-3`}),t[15]=g):g=t[15];let _;t[16]===a?_=t[17]:(_=(0,X.jsx)(`button`,{type:`button`,onClick:a,"aria-label":`Close script`,className:`ml-auto text-muted-foreground hover:text-foreground`,children:g}),t[16]=a,t[17]=_);let v;t[18]!==h||t[19]!==_?(v=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/50 px-2 py-1`,children:[p,h,_]}),t[18]=h,t[19]=_,t[20]=v):v=t[20];let y;t[21]!==s.contents||t[22]!==s.state||t[23]!==s.truncated?(y=(0,X.jsx)(`div`,{className:`max-h-72 overflow-auto p-2`,children:s.state===`loaded`?(0,X.jsxs)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-[.7rem] leading-relaxed text-foreground/90`,children:[s.contents,s.truncated?`
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{_ as r,g as i,t as a,y as o}from"./env-Bcq9YR3B.js";import{oi as s}from"./src-DmPIm3ie.js";import{$t as c,Et as l,In as u,Jt as d,Ot as f,Pt as p,Qt as m,Rn as h,Sn as g,St as _,Un as v,Zn as y,Zt as b,en as x,f as S,hn as C,mn as w,nn as T,tn as E,wt as D}from"./runtime-CPM0EUhb.js";import{Dt as O,_t as k,ht as A}from"./primary-CiDY2oUi.js";import{t as j}from"./useDebouncedValue-s0BC8Yyp.js";import{It as M,P as ee,_t as N,i as te,vt as P}from"./composerDraftStore-TYv9j3vY.js";import{c as ne,d as re,l as ie}from"./useSwipeDismiss-D22_vuiH.js";import{t as ae}from"./useRouter-CcIDS3PN.js";import{_ as oe,a as se,c as F,d as ce,f as le,g as ue,i as de,l as I,m as fe,o as L,p as R,r as pe,s as z,t as me,u as he}from"./rightPanelRouteSearch-BS8CkNS6.js";import{t as ge}from"./useNavigate-2tVq4iZ2.js";import{f as B}from"./useRenderElement-DchFnsR8.js";import{t as _e}from"./arrow-left-Dtj9PfsA.js";import{t as ve}from"./bot-DJp0cuhK.js";import{n as ye,t as be}from"./loader-circle-CrtHFAvM.js";import{t as xe}from"./chevron-down-B7C6FKzM.js";import{c as Se,o as Ce}from"./tabSwitchInstrumentation-CLDM7g1_.js";import{t as we}from"./chevron-right-BWYGybX9.js";import{n as Te}from"./useFloatingRootContext-CLCaQEJk.js";import{t as Ee}from"./circle-alert-BWvs6IOn.js";import{i as De}from"./toast-C-0Ft2jD.js";import{t as V}from"./clock-3-r12DkpRj.js";import{C as Oe}from"./lib-DgOYoged.js";import{t as ke}from"./folder-closed-CsvKfC6X.js";import{t as Ae}from"./folder-open-GqwNTbSV.js";import{t as H}from"./folder-DtsQoI9_.js";import{$ as U,$t as je,A as Me,At as Ne,B as Pe,Bt as Fe,Ct as Ie,Dt as Le,Et as Re,F as ze,Ft as W,G as Be,Gt as Ve,H as He,Ht as Ue,I as We,It as Ge,J as Ke,Jt as qe,K as Je,Kt as Ye,L as Xe,Lt as Ze,M as Qe,Mt as $e,N as et,Nt as tt,Ot as nt,P as rt,Pt as it,Q as at,Qt as ot,R as G,Rt as st,St as ct,Tt as lt,U as ut,Ut as dt,V as ft,Vt as pt,W as mt,Wt as ht,X as gt,Xt as _t,Y as vt,Yt as yt,Z as bt,Zt as xt,_t as St,at as Ct,bt as wt,c as Tt,ct as Et,d as Dt,dt as Ot,en as kt,et as At,ft as jt,g as Mt,gt as Nt,h as Pt,ht as Ft,in as It,it as Lt,j as Rt,jt as zt,k as Bt,kt as Vt,l as Ht,lt as Ut,m as Wt,mt as Gt,n as Kt,nn as qt,nt as Jt,ot as Yt,p as Xt,pt as Zt,q as Qt,qt as $t,r as en,rn as tn,rt as nn,s as rn,st as an,t as on,tn as sn,tt as cn,u as ln,ut as un,vt as dn,wt as fn,xt as K,yt as pn,z as mn,zt as hn}from"./device-CHdXzvhB.js";import{t as gn}from"./minimize-2-C33mL7LT.js";import{t as _n}from"./plus-B2h-VEqh.js";import{t as vn}from"./refresh-cw-DopCMrtR.js";import{t as yn}from"./save-Bh36JIv6.js";import{t as bn}from"./search-BGQsenCM.js";import{t as xn}from"./smartphone-gNe1ynB8.js";import{t as Sn}from"./ThreadTerminalDrawer-DRelLlEP.js";import{i as Cn}from"./terminal-links-CzJomeox.js";import{t as wn}from"./terminal-C_CyIsDD.js";import{t as Tn}from"./triangle-alert-RL_T3KLo.js";import{t as En}from"./unplug-Cw8iawyX.js";import{t as Dn}from"./x-C1Cemsov.js";import{l as On,t as q}from"./utils-CV2fJJxC.js";import{_ as kn,a as An,g as jn,m as Mn,n as Nn,t as Pn,v as Fn,y as In}from"./session-logic-BalPN1Sc.js";import"./storeSelectors-Cf2WDMfx.js";import{o as Ln}from"./timestampFormat-8uPXS812.js";import{_ as Rn}from"./keybindings-BPE3eEAM.js";import{i as zn,n as Bn,t as Vn}from"./tooltip-C_-9XEfA.js";import{t as Hn}from"./scroll-area-C0yF015F.js";import{t as Un}from"./button-DG8WqjNn.js";import{n as Wn}from"./composerHandleContext-BrQ6d8r9.js";import{i as Gn,r as Kn,t as qn}from"./alert-DomE7dAt.js";import{n as Jn,t as Yn}from"./sidebarStatusText-C8QBhZhZ.js";import{a as Xn,i as Zn,o as Qn,r as $n,s as er,t as tr}from"./alert-dialog-9Jyh0e8u.js";import{n as nr}from"./editorPreferences-B4GvqMiF.js";import{t as rr}from"./badge-w43sx8eF.js";import{t as ir}from"./useTheme-By1kfyiU.js";import{n as ar,t as or}from"./toggle-group-Chxh9G6t.js";import{t as sr}from"./toggle-DsnOFDbJ.js";var J=e(t(),1);function cr(e,t){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if(`shouldBlockFn`in e)return e;if(typeof e==`function`){let n=!!(t??!0);return{shouldBlockFn:async()=>n?await e():!1,enableBeforeUnload:n,withResolver:!1}}let n=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>n&&r!==void 0?await r():n,enableBeforeUnload:n,withResolver:r===void 0}}function lr(e,t){let{shouldBlockFn:n,enableBeforeUnload:r=!0,disabled:i=!1,withResolver:a=!1}=cr(e,t),o=ae(),{history:s}=o,[c,l]=J.useState({status:`idle`,current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return J.useEffect(()=>i?void 0:s.block({blockerFn:async e=>{function t(e){let t=o.parseLocation(e),[,n,r]=o.getMatchedRoutes(t.pathname);return r===void 0?{routeId:`__notFound__`,fullPath:t.pathname,pathname:t.pathname,params:n,search:o.options.parseSearch(e.search)}:{routeId:r.id,fullPath:r.fullPath,pathname:t.pathname,params:n,search:o.options.parseSearch(e.search)}}let r=t(e.currentLocation),i=t(e.nextLocation);if(r.routeId===`__notFound__`&&i.routeId!==`__notFound__`)return!1;let s=await n({action:e.action,current:r,next:i});if(!a)return s;if(!s)return!1;let c=await new Promise(t=>{l({status:`blocked`,current:r,next:i,action:e.action,proceed:()=>t(!1),reset:()=>t(!0)})});return l({status:`idle`,current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),c},enableBeforeUnload:r}),[n,r,i,a,s,o]),c}var ur=B(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),dr=B(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),fr=B(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),pr=B(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),mr=B(`disc-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M6 12c0-1.7.7-3.2 1.8-4.2`,key:`oqkarx`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M18 12c0 1.7-.7 3.2-1.8 4.2`,key:`1eah9h`}]]),hr=B(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),gr=B(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),_r=B(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),vr=B(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),yr=B(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),br=B(`monitor-off`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M17 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 1.184-1.826`,key:`cv7jms`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`path`,{d:`M8.656 3H20a2 2 0 0 1 2 2v10a2 2 0 0 1-.293 1.042`,key:`z8ni2w`}]]),xr=B(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Sr=B(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),Cr=B(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),wr=B(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Tr=B(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),Er=B(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),Dr=B(`volume-1`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}]]),Or=B(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),Y=n(),X=M(),kr={pending:{dotClass:`bg-info`,label:`Working`},running:{dotClass:`bg-info`,label:`Working`},waiting:{dotClass:`bg-info`,label:`Working`},idle:{dotClass:`bg-muted-foreground/50`,label:`Idle · resumable`},completed:{dotClass:`bg-success`,label:`Completed`},failed:{dotClass:`bg-destructive`,label:`Failed`},cancelled:{dotClass:`bg-muted-foreground/60`,label:`Stopped`},interrupted:{dotClass:`bg-muted-foreground/60`,label:`Stopped`}},Ar=(0,J.createContext)({identities:new Map,onOpenAgent:null});function jr(e){let t=(0,Y.c)(4),{status:n}=e,r=kr[n],i;t[0]===r.dotClass?i=t[1]:(i=q(`size-1.5 shrink-0 rounded-full`,r.dotClass),t[0]=r.dotClass,t[1]=i);let a;return t[2]===i?a=t[3]:(a=(0,X.jsx)(`span`,{"aria-hidden":!0,className:i}),t[2]=i,t[3]=a),a}function Mr(e){let t=Math.max(0,Math.floor(e)),n=Math.floor(t/60);if(n===0)return`${t}s`;let r=Math.floor(n/60);return r===0?`${n}m ${String(t%60).padStart(2,`0`)}s`:`${r}h ${String(n%60).padStart(2,`0`)}m`}function Nr(e,t){let n=Date.parse(e),r=t?Date.parse(t):Date.now();return Number.isNaN(n)||Number.isNaN(r)?``:Mr((r-n)/1e3)}function Pr(e){return e.usage?.durationMs===void 0?e.startedAt&&e.completedAt?Nr(e.startedAt,e.completedAt):null:Mr(e.usage.durationMs/1e3)}function Fr(e){let t=(0,Y.c)(12),{agent:n}=e,r=(0,J.useRef)(null),i=n.status===`running`||n.status===`waiting`,a=n.startedAt,o,s;if(t[0]!==i||t[1]!==a?(o=()=>{if(!i||!a)return;let e=()=>{r.current&&(r.current.textContent=Nr(a,null))};e();let t=setInterval(e,1e3);return()=>clearInterval(t)},s=[i,a],t[0]=i,t[1]=a,t[2]=o,t[3]=s):(o=t[2],s=t[3]),(0,J.useEffect)(o,s),!i){let e;t[4]===n?e=t[5]:(e=Pr(n),t[4]=n,t[5]=e);let r=e,i;return t[6]===r?i=t[7]:(i=r?(0,X.jsx)(`span`,{className:`tabular-nums`,children:r}):null,t[6]=r,t[7]=i),i}if(!a)return null;let c;t[8]===a?c=t[9]:(c=Nr(a,null),t[8]=a,t[9]=c);let l;return t[10]===c?l=t[11]:(l=(0,X.jsx)(`span`,{ref:r,className:`tabular-nums`,children:c}),t[10]=c,t[11]=l),l}function Ir(e,t){return/^structured[\s_-]?output$/i.test(e)?t?`Delivering result`:`Delivered result`:t?`Using ${e}`:e}function Lr(e){return e.status===`running`||e.status===`pending`||e.status===`waiting`?e.progress??(e.lastToolName?Ir(e.lastToolName,!0):null)??e.result??e.error:e.error??e.result??e.progress??(e.lastToolName?Ir(e.lastToolName,!1):null)}function Rr(e){let t=(0,Y.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`div`,{className:`divide-y divide-border/30`,children:n}),t[0]=n,t[1]=r),r}function zr(e){let t=(0,Y.c)(11),{title:n}=e,r=`${n} pending`,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex size-7 items-center justify-center rounded-lg border border-dashed border-border/60 bg-background/30 text-muted-foreground/55`,children:(0,X.jsx)(V,{className:`size-3.5`})}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,X.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground/75`,children:n}),t[1]=n,t[2]=a);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground/65`,children:`Waiting for this stage to start`}),t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=(0,X.jsxs)(`span`,{className:`min-w-0`,children:[a,o]}),t[4]=a,t[5]=s);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono text-[.68rem] text-muted-foreground/65`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-muted-foreground/40`}),`Pending`]}),t[6]=c):c=t[6];let l;return t[7]!==r||t[8]!==s||t[9]!==n?(l=(0,X.jsxs)(`div`,{"data-workflow-pending-step":!0,"data-phase-title":n,"aria-label":r,className:`grid h-14 grid-cols-[1.75rem_minmax(0,1fr)_auto] items-center gap-x-2 rounded-md px-1.5 py-1 text-left`,children:[i,s,c]}),t[7]=r,t[8]=s,t[9]=n,t[10]=l):l=t[10],l}function Br(e){let t=(0,Y.c)(69),{agent:n}=e,{identities:r,onOpenAgent:i}=(0,J.use)(Ar),a=kr[n.status],o;t[0]===n?o=t[1]:(o=Lr(n),t[0]=n,t[1]=o);let s=o,c;t[2]!==n.effort||t[3]!==n.model?(c=jn(n.model,n.effort),t[2]=n.effort,t[3]=n.model,t[4]=c):c=t[4];let l=c,u,d,f;t[5]!==n.id||t[6]!==n.title||t[7]!==r?(d=r.get(n.id),u=d?.codename??n.title,f=d?.role&&!In(d.role,u)&&!In(d.role,n.title)?d.role:null,t[5]=n.id,t[6]=n.title,t[7]=r,t[8]=u,t[9]=d,t[10]=f):(u=t[8],d=t[9],f=t[10]);let p=f,m=d?.taskLabel??n.title,h;t[11]===n.usage?h=t[12]:(h=n.usage?`${kn(n.usage.totalTokens)} tok`:`— tok`,t[11]=n.usage,t[12]=h);let g=n.usage?.toolUses===void 0?null:`${n.usage.toolUses} tools`,_=n.activationCount>1?`run ${n.activationCount}`:null,v;t[13]!==l||t[14]!==h||t[15]!==g||t[16]!==_?(v=[l,h,g,_].filter(Vr),t[13]=l,t[14]=h,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y=v,b=d?.avatarKey??n.id,x;t[18]===b?x=t[19]:(x=(0,X.jsx)(kt,{name:b,className:`size-5`}),t[18]=b,t[19]=x);let S;t[20]===n.status?S=t[21]:(S=(0,X.jsx)(`span`,{className:`absolute -right-0.5 -bottom-0.5 grid size-2.5 place-items-center rounded-full bg-background ring-1 ring-background`,children:(0,X.jsx)(jr,{status:n.status})}),t[20]=n.status,t[21]=S);let C;t[22]!==S||t[23]!==x?(C=(0,X.jsxs)(`span`,{"aria-hidden":!0,className:`relative col-start-1 row-span-3 row-start-1 mt-0.5 flex size-7 items-center justify-center rounded-lg border border-border/45 bg-background/45`,children:[x,S]}),t[22]=S,t[23]=x,t[24]=C):C=t[24];let w;t[25]===u?w=t[26]:(w=(0,X.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold tracking-[-0.01em]`,children:u}),t[25]=u,t[26]=w);let T;t[27]===p?T=t[28]:(T=p?(0,X.jsx)(`span`,{className:`max-w-32 shrink-0 truncate rounded-sm border border-border/60 bg-background/40 px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:p}):null,t[27]=p,t[28]=T);let E;t[29]!==w||t[30]!==T?(E=(0,X.jsxs)(`span`,{className:`col-start-2 row-start-1 flex min-w-0 items-center gap-1.5`,children:[w,T]}),t[29]=w,t[30]=T,t[31]=E):E=t[31];let D;t[32]===n?D=t[33]:(D=(0,X.jsx)(Fr,{agent:n}),t[32]=n,t[33]=D);let O;t[34]===n.status?O=t[35]:(O=n.status===`completed`?(0,X.jsx)(ye,{"aria-hidden":!0,className:`size-3 text-success`}):null,t[34]=n.status,t[35]=O);let k;t[36]!==D||t[37]!==O?(k=(0,X.jsx)(`span`,{className:`col-start-3 row-start-1 min-w-14 text-right font-mono text-[.7rem] text-muted-foreground/80`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[D,O]})}),t[36]=D,t[37]=O,t[38]=k):k=t[38];let A;t[39]===m?A=t[40]:(A=(0,X.jsx)(`span`,{className:`col-start-2 col-end-4 row-start-2 block truncate text-[11px] text-foreground/65`,title:m,children:m}),t[39]=m,t[40]=A);let j=n.status===`failed`?`text-destructive-foreground`:`text-muted-foreground`,M;t[41]===j?M=t[42]:(M=q(`col-start-2 row-start-3 block min-w-0 truncate text-xs`,j),t[41]=j,t[42]=M);let ee=s??a.label,N=s??a.label,te;t[43]!==M||t[44]!==ee||t[45]!==N?(te=(0,X.jsx)(`span`,{className:M,title:ee,children:N}),t[43]=M,t[44]=ee,t[45]=N,t[46]=te):te=t[46];let P=y.join(` · `),ne;t[47]===P?ne=t[48]:(ne=(0,X.jsx)(`span`,{className:`col-start-3 row-start-3 max-w-40 truncate text-right font-mono text-[.68rem] tabular-nums text-muted-foreground/65`,children:P}),t[47]=P,t[48]=ne);let re;t[49]===a.label?re=t[50]:(re=(0,X.jsx)(`span`,{className:`sr-only`,children:a.label}),t[49]=a.label,t[50]=re);let ie;t[51]!==C||t[52]!==E||t[53]!==k||t[54]!==A||t[55]!==te||t[56]!==ne||t[57]!==re?(ie=(0,X.jsxs)(X.Fragment,{children:[C,E,k,A,te,ne,re]}),t[51]=C,t[52]=E,t[53]=k,t[54]=A,t[55]=te,t[56]=ne,t[57]=re,t[58]=ie):ie=t[58];let ae=ie,oe=i&&`hover:bg-accent/35 focus-visible:ring-2 focus-visible:ring-ring/50`,se;t[59]===oe?se=t[60]:(se=q(`grid h-[4.5rem] w-full grid-cols-[1.75rem_minmax(0,1fr)_auto] grid-rows-[1.375rem_1.125rem_1rem] items-center gap-x-2 rounded-md px-1.5 py-1 text-left outline-none transition-colors`,oe),t[59]=oe,t[60]=se);let F=se,ce;return t[61]!==n.id||t[62]!==F||t[63]!==u||t[64]!==ae||t[65]!==i||t[66]!==p||t[67]!==a.label?(ce=i?(0,X.jsx)(`button`,{type:`button`,className:F,"data-agent-row":!0,"data-agent-id":n.id,onClick:()=>i(n.id),"aria-label":`Open ${u}${p?`, ${p}`:``} transcript. ${a.label}.`,children:ae}):(0,X.jsx)(`div`,{className:F,"data-agent-row":!0,"data-agent-id":n.id,children:ae}),t[61]=n.id,t[62]=F,t[63]=u,t[64]=ae,t[65]=i,t[66]=p,t[67]=a.label,t[68]=ce):ce=t[68],ce}function Vr(e){return e!==null}function Hr(e){let t=e.workflow.status;return t!==`completed`&&t!==`failed`&&t!==`cancelled`&&t!==`interrupted`}function Ur(e){return[...e.phases.flatMap(e=>e.members),...e.unphasedMembers]}function Wr(e){let t=(0,Y.c)(4),{group:n}=e;if(n.phases.length===0)return null;let r;t[0]===n.phases?r=t[1]:(r=n.phases.map(Gr),t[0]=n.phases,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,X.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-1 gap-y-1 px-1.5 pb-1 pt-1.5`,children:r}),t[2]=r,t[3]=i),i}function Gr(e,t){return(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t>0?(0,X.jsx)(we,{"aria-hidden":!0,className:`size-3 text-muted-foreground/40`}):null,(0,X.jsxs)(`div`,{className:q(`flex items-center gap-1 rounded-sm border px-1.5 py-0.5`,e.state===`running`?`border-info/40`:e.state===`done`?`border-success/30`:`border-border/50`),children:[(0,X.jsxs)(`span`,{className:q(`font-mono text-[.65rem]`,e.state===`running`?`text-info-foreground`:e.state===`done`?`text-success-foreground`:`text-muted-foreground/70`),children:[e.state===`done`?`✓ `:``,e.title]}),(0,X.jsx)(`span`,{className:`flex items-center gap-0.5`,children:e.members.length===0?(0,X.jsx)(`span`,{className:`font-mono text-[.6rem] text-muted-foreground/50`,children:`–`}):e.members.map(Kr)})]})]},e.index)}function Kr(e){return(0,X.jsx)(jr,{status:e.status},e.id)}var qr=15e3;function Jr(e){let t=(0,Y.c)(28),{environmentId:n,threadId:r,scriptPath:i,onClose:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={state:`loading`},t[0]=o):o=t[0];let[s,c]=(0,J.useState)(o),[l,u]=(0,J.useState)(0),d;t[1]!==n||t[2]!==i||t[3]!==r?(d=()=>{let e=!1,t;c({state:`loading`});let a=C(n)?.orchestration.getWorkflowScript;if(!a){c({state:`failed`});return}let o=new Promise((e,n)=>{t=setTimeout(()=>n(Error(`workflow script fetch timed out`)),qr)});return Promise.race([a({threadId:r,scriptPath:i}),o]).then(t=>{e||c({state:`loaded`,contents:t.contents,truncated:t.truncated})}).catch(()=>{e||c({state:`failed`})}).finally(()=>{t!==void 0&&clearTimeout(t)}),()=>{e=!0,t!==void 0&&clearTimeout(t)}},t[1]=n,t[2]=i,t[3]=r,t[4]=d):d=t[4];let f;t[5]!==l||t[6]!==n||t[7]!==i||t[8]!==r?(f=[n,r,i,l],t[5]=l,t[6]=n,t[7]=i,t[8]=r,t[9]=f):f=t[9],(0,J.useEffect)(d,f);let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,X.jsx)(ur,{"aria-hidden":!0,className:`size-3 text-muted-foreground`}),t[10]=p):p=t[10];let m;t[11]===i?m=t[12]:(m=i.split(`/`).at(-1),t[11]=i,t[12]=m);let h;t[13]===m?h=t[14]:(h=(0,X.jsx)(`span`,{className:`truncate font-mono text-[.65rem] text-muted-foreground`,children:m}),t[13]=m,t[14]=h);let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,X.jsx)(Dn,{"aria-hidden":!0,className:`size-3`}),t[15]=g):g=t[15];let _;t[16]===a?_=t[17]:(_=(0,X.jsx)(`button`,{type:`button`,onClick:a,"aria-label":`Close script`,className:`ml-auto text-muted-foreground hover:text-foreground`,children:g}),t[16]=a,t[17]=_);let v;t[18]!==h||t[19]!==_?(v=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/50 px-2 py-1`,children:[p,h,_]}),t[18]=h,t[19]=_,t[20]=v):v=t[20];let y;t[21]!==s.contents||t[22]!==s.state||t[23]!==s.truncated?(y=(0,X.jsx)(`div`,{className:`max-h-72 overflow-auto p-2`,children:s.state===`loaded`?(0,X.jsxs)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-[.7rem] leading-relaxed text-foreground/90`,children:[s.contents,s.truncated?`
|
|
2
2
|
… (truncated)`:``]}):s.state===`failed`?(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:`Could not load the script.`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>u(Yr),className:`text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground`,children:`Retry`})]}):(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading…`})}),t[21]=s.contents,t[22]=s.state,t[23]=s.truncated,t[24]=y):y=t[24];let b;return t[25]!==y||t[26]!==v?(b=(0,X.jsxs)(`div`,{className:`mx-1.5 mb-1 rounded-md border border-border/60 bg-background/60`,children:[v,y]}),t[25]=y,t[26]=v,t[27]=b):b=t[27],b}function Yr(e){return e+1}function Xr(e){let t=(0,Y.c)(33),{phase:n,defaultOpen:r}=e,[i,a]=(0,J.useState)(r!==void 0&&r||n.state===`running`),o=(0,J.useRef)(n.state),s,c;t[0]===n.state?(s=t[1],c=t[2]):(s=()=>{o.current!==`running`&&n.state===`running`&&a(!0),o.current=n.state},c=[n.state],t[0]=n.state,t[1]=s,t[2]=c),(0,J.useEffect)(s,c);let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>a($r),t[3]=l):l=t[3];let u=n.state===`done`?`text-success-foreground`:n.state===`running`?`text-info-foreground`:`text-muted-foreground/70`,d;t[4]===u?d=t[5]:(d=q(`mt-2 flex w-full items-center gap-1.5 rounded-sm px-1.5 text-left text-[.65rem] font-medium uppercase tracking-wider hover:bg-accent/40`,u),t[4]=u,t[5]=d);let f;t[6]===i?f=t[7]:(f=i?(0,X.jsx)(xe,{"aria-hidden":!0,className:`size-3 shrink-0`}):(0,X.jsx)(we,{"aria-hidden":!0,className:`size-3 shrink-0`}),t[6]=i,t[7]=f);let p;t[8]===n.state?p=t[9]:(p=n.state===`done`?(0,X.jsx)(ye,{"aria-hidden":!0,className:`size-3`}):null,t[8]=n.state,t[9]=p);let m;t[10]===n.title?m=t[11]:(m=(0,X.jsx)(`span`,{children:n.title}),t[10]=n.title,t[11]=m);let h=n.state===`pending`&&n.members.length===0?`pending`:n.state===`done`?`${n.settledCount} done`:`${n.activeCount} active · ${n.settledCount} done`,g;t[12]===h?g=t[13]:(g=(0,X.jsx)(`span`,{className:`font-normal normal-case text-muted-foreground/70`,children:h}),t[12]=h,t[13]=g);let _;t[14]!==i||t[15]!==n.members?(_=!i&&n.members.length>0?(0,X.jsx)(`span`,{className:`ml-auto flex items-center gap-0.5`,children:n.members.map(Qr)}):null,t[14]=i,t[15]=n.members,t[16]=_):_=t[16];let v;t[17]!==i||t[18]!==g||t[19]!==_||t[20]!==d||t[21]!==f||t[22]!==p||t[23]!==m?(v=(0,X.jsxs)(`button`,{type:`button`,onClick:l,"aria-expanded":i,className:d,children:[f,p,m,g,_]}),t[17]=i,t[18]=g,t[19]=_,t[20]=d,t[21]=f,t[22]=p,t[23]=m,t[24]=v):v=t[24];let y;t[25]!==i||t[26]!==n.members||t[27]!==n.state||t[28]!==n.title?(y=i?(0,X.jsx)(Rr,{children:n.members.length===0&&n.state===`pending`?(0,X.jsx)(zr,{title:n.title}):n.members.map(Zr)}):null,t[25]=i,t[26]=n.members,t[27]=n.state,t[28]=n.title,t[29]=y):y=t[29];let b;return t[30]!==v||t[31]!==y?(b=(0,X.jsxs)(`div`,{children:[v,y]}),t[30]=v,t[31]=y,t[32]=b):b=t[32],b}function Zr(e){return(0,X.jsx)(Br,{agent:e},e.id)}function Qr(e){return(0,X.jsx)(jr,{status:e.status},e.id)}function $r(e){return!e}function ei(e){let t=(0,Y.c)(47),{group:n,environmentId:r,threadId:i,onCollapse:a}=e,[o,s]=(0,J.useState)(!1),c,l;t[0]===n?(c=t[1],l=t[2]):(c=Ur(n),l=c.filter(ii),t[0]=n,t[1]=c,t[2]=l);let u=l.length,d=n.workflow.runHandles?.scriptPath,f=d!==void 0&&r!==null&&i!==null,p;t[3]===n.workflow.status?p=t[4]:(p=(0,X.jsx)(jr,{status:n.workflow.status}),t[3]=n.workflow.status,t[4]=p);let m=n.workflow.workflowName??n.workflow.title,h;t[5]===m?h=t[6]:(h=(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:m}),t[5]=m,t[6]=h);let g;t[7]!==f||t[8]!==o?(g=f?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>s(ri),className:q(`rounded-sm border border-border/60 px-1 font-mono normal-case hover:text-foreground`,o&&`text-foreground`),"aria-expanded":o,children:[`{}`,` script`]}):null,t[7]=f,t[8]=o,t[9]=g):g=t[9];let _;t[10]!==c.length||t[11]!==u?(_=(0,X.jsxs)(`span`,{className:`ml-auto font-mono normal-case text-muted-foreground/80`,children:[u,`/`,c.length,` settled`]}),t[10]=c.length,t[11]=u,t[12]=_):_=t[12];let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(xe,{"aria-hidden":!0,className:`size-3`}),t[13]=v):v=t[13];let y;t[14]===a?y=t[15]:(y=(0,X.jsx)(`button`,{type:`button`,onClick:a,"aria-label":`Collapse workflow`,className:`rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:v}),t[14]=a,t[15]=y);let b;t[16]!==p||t[17]!==h||t[18]!==g||t[19]!==_||t[20]!==y?(b=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-1.5 pt-0.5 text-[.65rem] font-medium uppercase tracking-wider text-muted-foreground`,children:[p,h,g,_,y]}),t[16]=p,t[17]=h,t[18]=g,t[19]=_,t[20]=y,t[21]=b):b=t[21];let x;t[22]===n?x=t[23]:(x=(0,X.jsx)(Wr,{group:n}),t[22]=n,t[23]=x);let S;t[24]!==f||t[25]!==r||t[26]!==o||t[27]!==d||t[28]!==i?(S=o&&f?(0,X.jsx)(Jr,{environmentId:r,threadId:i,scriptPath:d,onClose:()=>s(!1)}):null,t[24]=f,t[25]=r,t[26]=o,t[27]=d,t[28]=i,t[29]=S):S=t[29];let C;t[30]===n.phases?C=t[31]:(C=n.phases.map(ni),t[30]=n.phases,t[31]=C);let w;t[32]===n.unphasedMembers?w=t[33]:(w=n.unphasedMembers.map(ti),t[32]=n.unphasedMembers,t[33]=w);let T;t[34]===w?T=t[35]:(T=(0,X.jsx)(Rr,{children:w}),t[34]=w,t[35]=T);let E;t[36]!==n.phases.length||t[37]!==n.unphasedMembers.length||t[38]!==n.workflow?(E=n.phases.length===0&&n.unphasedMembers.length===0?(0,X.jsx)(Br,{agent:n.workflow}):null,t[36]=n.phases.length,t[37]=n.unphasedMembers.length,t[38]=n.workflow,t[39]=E):E=t[39];let D;return t[40]!==x||t[41]!==S||t[42]!==C||t[43]!==T||t[44]!==E||t[45]!==b?(D=(0,X.jsxs)(`section`,{className:`rounded-lg border border-border/50 bg-card/30 p-1.5`,children:[b,x,S,C,T,E]}),t[40]=x,t[41]=S,t[42]=C,t[43]=T,t[44]=E,t[45]=b,t[46]=D):D=t[46],D}function ti(e){return(0,X.jsx)(Br,{agent:e},e.id)}function ni(e){return(0,X.jsx)(Xr,{phase:e,defaultOpen:!0},e.index)}function ri(e){return!e}function ii(e){return e.status===`completed`||e.status===`failed`||e.status===`cancelled`||e.status===`interrupted`}function ai(e){let t=(0,Y.c)(45),{group:n,onExpand:r}=e,i,a,o,s,c,l,u,d,f,p,m,h,g;if(t[0]!==n||t[1]!==r){let e=Ur(n),_=e.filter(si).length,v=e.reduce(oi,e.length===0?n.workflow.usage?.totalTokens??0:0),y;t[15]!==n.workflow.completedAt||t[16]!==n.workflow.startedAt?(y=n.workflow.startedAt&&n.workflow.completedAt?Nr(n.workflow.startedAt,n.workflow.completedAt):null,t[15]=n.workflow.completedAt,t[16]=n.workflow.startedAt,t[17]=y):y=t[17],i=y,m=`button`,h=r,g=`flex w-full items-center gap-2 rounded-md px-1.5 py-1 text-left outline-none hover:bg-accent/40 focus-visible:ring-2 focus-visible:ring-ring/50`,o=!1;let b=_>0?`failed`:n.workflow.status;t[18]===b?s=t[19]:(s=(0,X.jsx)(jr,{status:b}),t[18]=b,t[19]=s);let x=n.workflow.workflowName??n.workflow.title;t[20]===x?c=t[21]:(c=(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:x}),t[20]=x,t[21]=c),d=`flex shrink-0 items-center gap-1.5 font-mono text-[.7rem] text-muted-foreground/80`,t[22]===_?f=t[23]:(f=_>0?(0,X.jsxs)(`span`,{className:`text-destructive-foreground`,children:[_,` failed`]}):null,t[22]=_,t[23]=f),p=(0,X.jsxs)(`span`,{children:[e.length,` agents`]}),a=`tabular-nums`,l=`· `,u=kn(v),t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h,t[14]=g}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14];let _;t[24]!==a||t[25]!==l||t[26]!==u?(_=(0,X.jsxs)(`span`,{className:a,children:[l,u,` tok`]}),t[24]=a,t[25]=l,t[26]=u,t[27]=_):_=t[27];let v;t[28]===i?v=t[29]:(v=i?(0,X.jsxs)(`span`,{className:`tabular-nums`,children:[`· `,i]}):null,t[28]=i,t[29]=v);let y;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(we,{"aria-hidden":!0,className:`size-3`}),t[30]=y):y=t[30];let b;t[31]!==_||t[32]!==v||t[33]!==d||t[34]!==f||t[35]!==p?(b=(0,X.jsxs)(`span`,{className:d,children:[f,p,_,v,y]}),t[31]=_,t[32]=v,t[33]=d,t[34]=f,t[35]=p,t[36]=b):b=t[36];let x;return t[37]!==o||t[38]!==s||t[39]!==c||t[40]!==b||t[41]!==m||t[42]!==h||t[43]!==g?(x=(0,X.jsx)(`section`,{children:(0,X.jsxs)(`button`,{type:m,onClick:h,className:g,"aria-expanded":o,children:[s,c,b]})}),t[37]=o,t[38]=s,t[39]=c,t[40]=b,t[41]=m,t[42]=h,t[43]=g,t[44]=x):x=t[44],x}function oi(e,t){return e+(t.usage?.totalTokens??0)}function si(e){return e.status===`failed`}function ci(e){let t=(0,Y.c)(7),{group:n,environmentId:r,threadId:i}=e,a;t[0]===n?a=t[1]:(a=()=>Hr(n),t[0]=n,t[1]=a);let[o,s]=(0,J.useState)(a),c;return t[2]!==r||t[3]!==n||t[4]!==o||t[5]!==i?(c=o?(0,X.jsx)(ei,{group:n,environmentId:r,threadId:i,onCollapse:()=>s(!1)}):(0,X.jsx)(ai,{group:n,onExpand:()=>s(!0)}),t[2]=r,t[3]=n,t[4]=o,t[5]=i,t[6]=c):c=t[6],c}function li(e){let t=(0,Y.c)(43),{model:n,environmentId:r,threadId:i,onOpenAgent:a}=e,o=r===void 0?null:r,s=i===void 0?null:i,c=a===void 0?null:a,l;if(t[0]!==n.directAgents||t[1]!==n.workflows){let e=new Map;for(let t of n.workflows){e.set(t.workflow.id,t.workflow);for(let n of Ur(t))e.set(n.id,n)}for(let t of n.directAgents)e.set(t.id,t);l=Fn([...e.values()].map(di)),t[0]=n.directAgents,t[1]=n.workflows,t[2]=l}else l=t[2];let u;t[3]!==c||t[4]!==l?(u={identities:l,onOpenAgent:c},t[3]=c,t[4]=l,t[5]=u):u=t[5];let d=u;if(!n.hasAgents){let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 p-6 text-center`,children:[(0,X.jsx)(ve,{"aria-hidden":!0,className:`size-6 text-muted-foreground/60`}),(0,X.jsx)(`p`,{className:`text-sm font-medium`,children:`No agents yet`}),(0,X.jsx)(`p`,{className:`max-w-56 text-xs text-muted-foreground`,children:`When this thread spawns subagents or runs a workflow, they show up here with live status, activity, and token usage.`})]}),t[6]=e):e=t[6],e}let f;if(t[7]!==o||t[8]!==n.workflows||t[9]!==s){let e;t[11]!==o||t[12]!==s?(e=e=>(0,X.jsx)(ci,{group:e,environmentId:o,threadId:s},e.workflow.id),t[11]=o,t[12]=s,t[13]=e):e=t[13],f=n.workflows.map(e),t[7]=o,t[8]=n.workflows,t[9]=s,t[10]=f}else f=t[10];let p;t[14]===n.directAgents?p=t[15]:(p=n.directAgents.length>0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`div`,{className:`px-1.5 pt-1 text-[.65rem] font-medium uppercase tracking-wider text-muted-foreground`,children:`Direct spawns`}),(0,X.jsx)(Rr,{children:n.directAgents.map(ui)})]}):null,t[14]=n.directAgents,t[15]=p);let m;t[16]!==f||t[17]!==p?(m=(0,X.jsx)(Hn,{className:`min-h-0 flex-1`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 p-2`,children:[f,p]})}),t[16]=f,t[17]=p,t[18]=m):m=t[18];let h;t[19]!==n.runningCount||t[20]!==n.waitingCount?(h=n.runningCount+n.waitingCount>0?(0,X.jsxs)(`span`,{className:`text-info-foreground`,children:[`● `,n.runningCount+n.waitingCount,` working`]}):null,t[19]=n.runningCount,t[20]=n.waitingCount,t[21]=h):h=t[21];let g;t[22]===n.idleCount?g=t[23]:(g=n.idleCount>0?(0,X.jsxs)(`span`,{children:[n.idleCount,` idle`]}):null,t[22]=n.idleCount,t[23]=g);let _;t[24]===n.settledCount?_=t[25]:(_=n.settledCount>0?(0,X.jsxs)(`span`,{children:[n.settledCount,` settled`]}):null,t[24]=n.settledCount,t[25]=_);let v;t[26]!==g||t[27]!==_||t[28]!==h?(v=(0,X.jsxs)(`span`,{className:`flex items-center gap-2`,children:[h,g,_]}),t[26]=g,t[27]=_,t[28]=h,t[29]=v):v=t[29];let y;t[30]===n.totalTokens?y=t[31]:(y=kn(n.totalTokens),t[30]=n.totalTokens,t[31]=y);let b;t[32]===y?b=t[33]:(b=(0,X.jsxs)(`span`,{className:`tabular-nums`,children:[`Σ `,y,` tok`]}),t[32]=y,t[33]=b);let x;t[34]!==v||t[35]!==b?(x=(0,X.jsxs)(`footer`,{className:`flex items-center justify-between border-t border-border/60 px-3 py-1.5 font-mono text-[.7rem] text-muted-foreground`,children:[v,b]}),t[34]=v,t[35]=b,t[36]=x):x=t[36];let S;t[37]!==x||t[38]!==m?(S=(0,X.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[m,x]}),t[37]=x,t[38]=m,t[39]=S):S=t[39];let C;return t[40]!==d||t[41]!==S?(C=(0,X.jsx)(Ar.Provider,{value:d,children:S}),t[40]=d,t[41]=S,t[42]=C):C=t[42],C}function ui(e){return(0,X.jsx)(Br,{agent:e},e.id)}function di(e){return{key:e.id,role:e.role,taskLabel:e.title}}function fi(e){let t=[],n=new Set(e.openedPanelModes);n.has(`files`)&&t.push({key:`files`,label:`Files`,mode:`files`}),n.has(`review`)&&t.push({key:`review`,label:`Review`,mode:`review`}),n.has(`terminal`)&&t.push({key:`terminal`,label:`Terminal`,mode:`terminal`}),n.has(`simulator`)&&t.push({key:`simulator`,label:`Simulator`,mode:`simulator`}),n.has(`agents`)&&t.push({key:`agents`,label:`Agents`,mode:`agents`});let r=[...new Set([...e.openedAgentKeys,...e.activeAgentKey?[e.activeAgentKey]:[]])];for(let n of r){let r=Nn(e.subagents,n)??{key:n,name:`Subagent`,status:`idle`,origin:null,capability:null,tool:null,detail:null,providerThreadIds:[],providerSessionIds:[],startedAt:``,updatedAt:``,entries:[],messages:[]};t.push({key:r.key,label:r.name,mode:`agent`,agentKey:r.key,status:r.status,avatarKey:r.avatarKey??r.key})}return t}var pi=new Set,mi=null;function hi(e){pi.add(e),mi??=requestAnimationFrame(_i)}function gi(e){pi.delete(e)&&pi.size===0&&mi!=null&&(cancelAnimationFrame(mi),mi=null)}function _i(e){let t=new Set(pi);pi.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}mi=pi.size>0?requestAnimationFrame(_i):null}function vi(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function yi(e,t){let n=e?.theme??W,r=t?.theme??W,i=bi(e),a=bi(t);return Vt(n,r)&&vi(e,t,[`theme`,`parseDiffOptions`])&&vi(i,a)}function bi(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function xi(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Si({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}var Ci=new TextEncoder,wi=new TextDecoder(`utf-8`,{ignoreBOM:!0}),Ti=/[\uD800-\uDFFF]/,Ei=1024,Di=new Uint8Array(Ei);function Oi(){Di.length!==Ei&&(Di=new Uint8Array(Ei))}function ki(e){if(e.length===0)return e;if(Ti.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;Di.length<t&&(Di=new Uint8Array(t));let{written:n}=Ci.encodeInto(e,Di);return wi.decode(Di.subarray(0,n))}var Ai=4096,ji=.5;function Mi(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let r=t.hunkContent[n];if(r.type!==`change`)continue;let i=Pi(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}Ni(t,e)}}function Ni(e,t){let{hunkContent:n}=e;for(let e=1;e<n.length;e++){let r=n[e],i=n[e-1];if(r.type!==`change`||r.additions>0&&r.deletions>0||i.type!==`context`)continue;let a=r.additions>0,o=a?t.additionLines:t.deletionLines,s=a?r.additionLineIndex:r.deletionLineIndex,c=a?r.additions:r.deletions,l=o[s]??``;if(l.trim()!==``)continue;let u=!0;for(let e=1;e<c;e++)if(o[s+e]!==l){u=!1;break}if(!u)continue;let d=0;for(;d<i.lines&&t.additionLines[i.additionLineIndex+i.lines-1-d]===l;)d++;if(d===0||e===1&&d===i.lines)continue;r.additionLineIndex-=d,r.deletionLineIndex-=d;let f=r.additionLineIndex+r.additions,p=r.deletionLineIndex+r.deletions,m=n[e+1];m?.type===`context`?(m.lines+=d,m.additionLineIndex=f,m.deletionLineIndex=p):n.splice(e+1,0,{type:`context`,lines:d,additionLineIndex:f,deletionLineIndex:p}),i.lines-=d,i.lines===0&&(n.splice(e-1,1),e--)}}function Pi(e,t){let{deletions:n,additions:r,deletionLineIndex:i,additionLineIndex:a}=t,o=Math.min(n,r),s=Math.abs(r-n);if(o===0||s===0||o*(s+1)>Ai)return null;let c=[];for(let t=0;t<n;t++)c.push(Ii(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(Ii(e.additionLines[a+t]??``));let u=r>n,d=0,f=-1;for(let e=0;e<=s;e++){let t=0;for(let n=0;n<o;n++)t+=Li(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*ji:t>f&&(f=t,d=e)}if(d===0)return null;let p=[],m=(e,t,n,r)=>{(e>0||t>0)&&p.push({type:`change`,deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:r})};return u?(m(0,d,i,a),m(o,o,i,a+d),m(0,r-o-d,i+o,a+d+o)):(m(d,0,i,a),m(o,o,i+d,a),m(n-o-d,0,i+d+o,a+o)),p}var Fi=/\s+/g;function Ii(e){return e.replace(Fi,``)}function Li(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let i=0;for(;i<r&&e[i]===t[i];)i++;let a=0;for(;a<r-i&&e[e.length-1-a]===t[t.length-1-a];)a++;return(i+a)/n}function Ri(e,t,n){try{return zi(e,t,n)}finally{Oi()}}function zi(e,t,n=!1){let r=ra(e),i=r?Ki(e):qi(e),a,o=[];for(let e of i){if(r&&!ht.test(e)){if(a==null)a=ki(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}if(!r&&!Ji(e)){if(a==null)a=ki(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let i=Vi(e,{cacheKey:t==null?void 0:`${t}-${o.length}`,isGitDiff:r,throwOnError:n});i!=null&&o.push(i)}return{patchMetadata:a,files:o}}function Bi(e,t){try{return Vi(e,t)}finally{Oi()}}function Vi(e,{cacheKey:t,isGitDiff:n=ht.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=ia(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=Gi(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=ea(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?Wi(i.contents):[],deletionLines:!l&&r!=null&&i!=null?Wi(r.contents):[],cacheKey:oa(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(Ne),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=ki(r.trim()),n!==r&&(c.prevName=ki(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?dt:Ue):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=ki(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=ki(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=ki(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=ki(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=ki(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=ki(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(qe)??[];t!=null&&(c.prevObjectId=ki(t)),n!=null&&(c.newObjectId=ki(n)),r!=null&&(c.mode=ki(r))}e.startsWith(`rename from `)&&(c.prevName=ki(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=ki(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
|
|
3
3
|
`||s[s.length-1]===`\r`||s[s.length-1]===`\r
|
|
4
4
|
`||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:oa(p.hunkContext),hunkSpecs:ki(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<s.length;e++){let t=s[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(a&&Qi(t)&&!$i(t))throw Error(`parsePatchContent: hunk has more lines than expected`);break}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=sa(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=ca(t);(g==null||g.type!==`change`)&&(g=la(`change`,u,d),b.hunkContent.push(g)),d++,x++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=ca(t);(g==null||g.type!==`change`)&&(g=la(`change`,u,d),b.hunkContent.push(g)),u++,S++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=ca(t);(g==null||g.type!==`context`)&&(g=la(`context`,u,d),b.hunkContent.push(g)),d++,u++,x++,S++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=nt(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=nt(c.deletionLines[e]))}}}if(a&&(x!==b.additionCount||S!==b.deletionCount))throw Error(`parsePatchContent: hunk line count mismatch`);b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(Le(b.additionStart,b.additionCount)-o,0),c.hunks.push(b),o=Re(b.additionStart,b.additionCount);for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=Re(e.additionStart,e.additionCount),n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),Mi(c),c}}function Hi(e,t,n=!1){let r=[],i=Ui(e)?e.split(zt):[e];for(let e of i)try{r.push(Ri(e,t==null?void 0:`${t}-${r.length}`,n))}catch(e){if(n)throw e;console.error(e)}return r}function Ui(e){return e.startsWith(`From `)||e.includes(`
|
|
@@ -2005,5 +2005,5 @@ diff --git`)}function ia(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
|
|
|
2005
2005
|
margin-left: auto;
|
|
2006
2006
|
}
|
|
2007
2007
|
}
|
|
2008
|
-
`;function zh(e,t){let n=Math.max(Fh,Math.floor(t*Lh));return Math.max(Fh,Math.min(e,n))}function Bh(e,t,n){let r=e.startX-n;return zh(e.startWidth+r,t)}function Vh(e){if(!e)return!1;let t=e.toLowerCase();return t.includes(`enoent`)||t.includes(`no such file`)||t.includes(`file not found`)||t.includes(`cannot find the file`)}function Hh(e,t){return`preview:${e}:${t.length}:${Pt(t).toString(36)}`}var Uh=[];function Wh(e){let t=(0,Y.c)(24),[n,r]=(0,J.useState)(e.open),i,a;t[0]===e.open?(i=t[1],a=t[2]):(i=()=>{if(!e.open){r(!1);return}let t=window.requestAnimationFrame(()=>r(!0));return()=>window.cancelAnimationFrame(t)},a=[e.open],t[0]=e.open,t[1]=i,t[2]=a),(0,J.useEffect)(i,a);let o=e.open&&n,s=!e.open||void 0,c=!e.open||void 0,l=e.open?`border-l border-border/70`:`border-l-0`,u=e.resizing?`transition-none`:`transition-[width,opacity] duration-[360ms] ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none`,d=e.open?`opacity-100`:`opacity-0`,f;t[3]!==l||t[4]!==u||t[5]!==d?(f=q(`min-h-0 shrink-0 overflow-hidden bg-card/20`,l,u,d),t[3]=l,t[4]=u,t[5]=d,t[6]=f):f=t[6];let p=e.open?`${e.width}px`:`0px`,m;t[7]===p?m=t[8]:(m={width:p,maxWidth:`55%`},t[7]=p,t[8]=m);let h=e.resizing?`transition-none`:null,g=o?`translate-x-0 opacity-100`:`translate-x-4 opacity-0`,_;t[9]!==h||t[10]!==g?(_=q(`h-full min-h-0 transition-[translate,opacity] duration-[360ms] ease-[cubic-bezier(0.16,1,0.3,1)] will-change-transform motion-reduce:transition-none`,h,g),t[9]=h,t[10]=g,t[11]=_):_=t[11];let v=`${e.width}px`,y;t[12]===v?y=t[13]:(y={width:v,maxWidth:`100%`},t[12]=v,t[13]=y);let b;t[14]!==e.children||t[15]!==_||t[16]!==y?(b=(0,X.jsx)(`div`,{className:_,style:y,children:e.children}),t[14]=e.children,t[15]=_,t[16]=y,t[17]=b):b=t[17];let x;return t[18]!==b||t[19]!==s||t[20]!==c||t[21]!==f||t[22]!==m?(x=(0,X.jsx)(`div`,{"data-preview-file-rail":!0,"aria-hidden":s,inert:c,className:f,style:m,children:b}),t[18]=b,t[19]=s,t[20]=c,t[21]=f,t[22]=m,t[23]=x):x=t[23],x}function Gh(){let e=(0,Y.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(Ae,{className:`size-8 text-muted-foreground/65`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center`,children:(0,X.jsxs)(`div`,{className:`flex max-w-xs flex-col items-center gap-3`,children:[t,(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Open file`}),(0,X.jsx)(`div`,{className:`text-xs leading-5 text-muted-foreground/70`,children:`Select a file from the workspace tree.`})]})]})}),e[1]=n):n=e[1],n}function Kh({mode:e=`inline`}){let{resolvedTheme:t}=ir(),n=h(),r=e===`phone`,i=re({strict:!1,select:e=>ie(e)}),a=re({strict:!1,select:e=>typeof e.draftId==`string`?ee.make(e.draftId):null}),o=oe({strict:!1,select:e=>le(e)}),c=d((0,J.useMemo)(()=>f(i),[i])),l=te(e=>c?null:a?e.getDraftSession(a):i?e.getDraftThreadByRef(i):null),u=(0,J.useMemo)(()=>{if(c)return{id:c.id,environmentId:c.environmentId,projectId:c.projectId,worktreePath:c.worktreePath,turnDiffSummaries:c.turnDiffSummaries};if(l)return{id:l.threadId,environmentId:l.environmentId,projectId:l.projectId,worktreePath:l.worktreePath,turnDiffSummaries:Uh}},[c,l]),m=u?.projectId??null,g=d(e=>u&&m?p(e,{environmentId:u.environmentId,projectId:m}):void 0),_=u?.worktreePath??g?.cwd??null,[v,y]=(0,J.useState)(null),[b,x]=(0,J.useState)(null),S=(0,J.useRef)(null),[C,T]=(0,J.useState)(null),[E,D]=(0,J.useState)(``),[O,k]=(0,J.useState)(!0),[A,j]=(0,J.useState)(r?!0:n.diffWordWrap),M=(0,J.useRef)(null),[ne,ae]=(0,J.useState)(()=>typeof window>`u`?Ih:N(Ph,s)??Ih),[se,F]=(0,J.useState)(!1),ce=(0,J.useRef)(null),ue=(0,J.useRef)(o.preview===`1`),de=(0,J.useRef)(null),I=(0,J.useRef)(null),fe=(0,J.useRef)(null),L=(0,J.useCallback)(e=>{S.current=e,x(e)},[]);(0,J.useEffect)(()=>{j(r?!0:n.diffWordWrap)},[r,n.diffWordWrap]),(0,J.useEffect)(()=>{y(null),L(null),T(null),k(!0)},[u?.environmentId,u?.id,L]);let R=(0,J.useMemo)(()=>{let e=(u?.turnDiffSummaries??[]).toReversed().find(e=>e.files.length>0);return e?`${e.turnId}:${e.completedAt}`:null},[u?.turnDiffSummaries]),pe=(0,J.useMemo)(()=>{if(!v)return null;let e=(u?.turnDiffSummaries??[]).toReversed().find(e=>e.files.some(e=>e.path===v));return e?`${e.turnId}:${e.completedAt}`:null},[u?.turnDiffSummaries,v]),z=ad({environmentId:u?.environmentId??null,cwd:_,enabled:!!(u?.environmentId&&_&&o.preview===`1`)}),me=z.error instanceof Error?z.error.message:z.error?`Failed to load the workspace tree.`:null,he=z.data,ge=z.data?.truncated===!0,B=z.isFetching,ve=z.refetch,ye=(0,J.useMemo)(()=>Nh(he?.entries??[],E),[E,he?.entries]),xe=E.trim().length>0;(0,J.useEffect)(()=>{if(he){if(he.entries.length===0){dh(S.current)||(y(null),L(null));return}v&&!he.entries.some(e=>e.path===v)&&(dh(S.current)||(y(null),L(null)))}},[L,he,v]),(0,J.useEffect)(()=>{if(o.preview!==`1`){de.current=R;return}if(de.current===null){de.current=R;return}de.current!==R&&(de.current=R,ve())},[R,o.preview,ve]),(0,J.useEffect)(()=>{let e=o.preview===`1`;e&&!ue.current&&y(null),ue.current=e},[o.preview]);let Se=v?he?.entries.find(e=>e.path===v):void 0,Ce=typeof Se?.sizeBytes==`number`?Oh(Se.sizeBytes):null,we=cd({environmentId:u?.environmentId??null,cwd:_,relativePath:v,enabled:!!(u?.environmentId&&_&&v&&o.preview===`1`&&(Ce?.shouldFetch??!0))}),Te=we.data?.relativePath===v?we.data:null,De=Te,V=De?.mimeType??Se?.mimeType??null,Oe=v?Dh({filePath:v,mimeType:V}):`text`,ke=we.error instanceof Error?we.error.message:we.error?`Failed to load file preview.`:null,Ae=we.refetch;(0,J.useEffect)(()=>{if(!v||o.preview!==`1`){I.current=pe;return}if(I.current===null){I.current=pe;return}I.current!==pe&&(I.current=pe,Ae())},[pe,o.preview,Ae,v]),(0,J.useEffect)(()=>{if(!v||!Vh(ke)){fe.current=null;return}let e=`${_??``}\u0000${v}\u0000${ke}`;fe.current!==e&&(fe.current=e,ve().then(e=>{if(!e.data?.entries.some(e=>e.path===v)){let e=S.current;e?.relativePath===v&&dh(e)?L(hh(e,{reason:`deleted`,message:`This file was removed from disk after it was opened. Explorer will not recreate it.`})):(y(e=>e===v?null:e),e?.relativePath===v&&L(null))}}).catch(()=>void 0))},[_,L,ve,ke,v]);let H=(0,J.useMemo)(()=>!u?.environmentId||!_||!Te||Te.relativePath!==v?null:lh({environmentId:u.environmentId,cwd:_},Te),[_,u?.environmentId,Te,v]);(0,J.useEffect)(()=>{H&&L(_h(S.current,H))},[L,H]);let U=H&&b?.key===H.key?b:null,je=dh(U),Me=!!(!r&&Oe===`text`&&H&&H.lineEnding!==`mixed`),Ne=lr({shouldBlockFn:(0,J.useCallback)(()=>je,[je]),disabled:!je,enableBeforeUnload:je,withResolver:!0}),Pe=(0,J.useCallback)(e=>{L(null),y(e)},[L]),Fe=(0,J.useCallback)(e=>{if(e!==v){if(dh(S.current)){T(e);return}Pe(e)}},[Pe,v]),Ie=(0,J.useCallback)(e=>{let t=S.current;!t||t.key!==H?.key||L(fh(t,e))},[L,H?.key]),Le=(0,J.useCallback)(async()=>{if(!u?.environmentId||!_||!v)return!1;try{let e=await w(u.environmentId).projects.readFile({cwd:_,relativePath:v});return id({environmentId:u.environmentId,cwd:_,relativePath:v},e),L(uh(lh({environmentId:u.environmentId,cwd:_},e))),!0}catch(e){let t=S.current;return t&&L(hh(t,{reason:Vh(e instanceof Error?e.message:String(e))?`deleted`:`failed`,message:e instanceof Error?e.message:`Failed to reload this file.`})),!1}},[_,u?.environmentId,L,v]),Re=(0,J.useCallback)(()=>{let e=S.current;if(!(!e||e.key!==H?.key)){if(e.errorReason===`deleted`){L(null),y(null),ve();return}if(e.saveStatus===`conflict`){Le();return}L(gh(e))}},[L,ve,Le,H?.key]),ze=(0,J.useCallback)(async()=>{let e=S.current;if(!e||!u?.environmentId||!_||e.relativePath!==v||e.lineEnding===`mixed`||e.saveStatus===`saving`||e.saveStatus===`conflict`||!dh(e))return!1;let t=e.key,n=e.contents;L(ph(e));try{let r=await w(u.environmentId).projects.writeFile({cwd:_,relativePath:e.relativePath,contents:n,expectedVersion:e.version,encoding:e.encoding,lineEnding:e.lineEnding});id({environmentId:u.environmentId,cwd:_,relativePath:e.relativePath},{relativePath:e.relativePath,contents:n,version:r.version,encoding:e.encoding,lineEnding:e.lineEnding});let i=S.current;if(!i||i.key!==t)return!1;let a=mh(i,n,r.version);return L(a),!dh(a)}catch(e){let n=S.current;return n?.key===t&&L(hh(n,vh(e))),!1}},[_,u?.environmentId,L,v]),W=U?.saveStatus===`conflict`||U?.errorReason===`unsupported`,Be=!!(Me&&je&&U?.saveStatus!==`saving`&&!W);(0,J.useEffect)(()=>{if(!Me||!je)return;let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),Be&&ze())};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},[Be,je,Me,ze]);let Ve=(0,J.useMemo)(()=>{let e=De?.contents;return!v||Oe!==`text`||e===void 0?null:{name:v,contents:e,lang:Eh(v),cacheKey:Hh(v,e)}},[De?.contents,Oe,v]),He=(0,J.useMemo)(()=>({disableFileHeader:!0,overflow:A?`wrap`:`scroll`,theme:Mt(t),themeType:t,unsafeCSS:ch,tokenizeMaxLineLength:1e3}),[t,A]),Ue=(0,J.useCallback)(e=>{if(e.button!==0||!O)return;let t=M.current?.querySelector(`[data-preview-file-rail]`)?.getBoundingClientRect().width??ne;ce.current={pointerId:e.pointerId,startWidth:t,startX:e.clientX},e.currentTarget.setPointerCapture(e.pointerId),F(!0),document.body.style.cursor=`ew-resize`,document.body.style.userSelect=`none`},[O,ne]),We=(0,J.useCallback)(e=>{let t=ce.current,n=M.current;if(!t||!n||t.pointerId!==e.pointerId)return;e.preventDefault();let r=Bh(t,n.clientWidth,e.clientX);ae(r)},[]),Ge=(0,J.useCallback)(e=>{let t=ce.current;if(!t||t.pointerId!==e.pointerId)return;let n=M.current,r=n?Bh(t,n.clientWidth,e.clientX):t.startWidth;ce.current=null,F(!1),ae(r),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`),typeof window<`u`&&P(Ph,r,s)},[]);(0,J.useEffect)(()=>()=>{document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`)},[]);let Ke=(0,J.useCallback)(()=>{ve()},[ve]),qe=(0,J.useCallback)(()=>{O&&(ce.current=null,F(!1),document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`)),k(e=>!e)},[O]),Je=C!==null||Ne.status===`blocked`,Ye=(0,J.useCallback)(()=>{T(null),Ne.status===`blocked`&&Ne.reset()},[Ne]),Xe=(0,J.useCallback)(()=>{let e=C;if(T(null),L(null),e){y(e);return}Ne.status===`blocked`&&Ne.proceed()},[L,Ne,C]),Ze=(0,J.useCallback)(async()=>{await ze()&&Xe()},[Xe,ze]),Qe=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`min-w-0 flex-1 px-1 [-webkit-app-region:no-drag]`,children:[(0,X.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:`File Preview`}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] uppercase tracking-[0.12em] text-muted-foreground/65`,children:[(0,X.jsx)(`span`,{children:`Workspace tree`}),ge?(0,X.jsx)(rr,{variant:`warning`,size:`sm`,className:`rounded-md px-1.5 py-0 text-[9px]`,children:`Truncated`}):null]})]}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[r?null:(0,X.jsx)(Un,{"aria-label":O?`Hide workspace tree`:`Show workspace tree`,"aria-pressed":O,title:O?`Hide workspace tree`:`Show workspace tree`,variant:`outline`,size:`icon-xs`,className:`shrink-0`,onClick:qe,children:O?(0,X.jsx)(xr,{className:`size-3`}):(0,X.jsx)(Sr,{className:`size-3`})}),(0,X.jsx)(Un,{"aria-label":`Refresh workspace tree`,title:`Refresh workspace tree`,variant:`outline`,size:`icon-xs`,className:`shrink-0`,disabled:!u?.environmentId||!_||B,onClick:Ke,children:(0,X.jsx)(vn,{className:q(`size-3`,B&&`animate-spin`)})}),(0,X.jsx)(sr,{"aria-label":A?`Disable preview line wrapping`:`Enable preview line wrapping`,title:A?`Disable line wrapping`:`Enable line wrapping`,variant:`outline`,size:`xs`,pressed:A,onPressedChange:e=>{j(!!e)},children:(0,X.jsx)(Er,{className:`size-3`})})]})]}),$e=Ce?.state===`too-large`?(0,X.jsxs)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:[`File is too large to preview (`,Ce.sizeBytes,` bytes). Limit is`,` `,Ce.limitBytes,` bytes.`]}):we.isLoading&&!Te?(0,X.jsx)(rn,{label:`Loading file preview...`}):ke&&!Te?(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:ke}):(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 p-2`,children:[(0,X.jsx)(`style`,{children:Rh}),(0,X.jsxs)(`div`,{className:`preview-panel-file-card flex h-full min-h-0 flex-col overflow-hidden rounded-md border border-border/70 bg-[color:color-mix(in_srgb,var(--card)_90%,var(--background))]`,children:[(0,X.jsxs)(`div`,{className:`preview-panel-file-toolbar flex min-h-10 shrink-0 items-center gap-3 border-b border-border/70 bg-[color:color-mix(in_srgb,var(--card)_94%,var(--foreground))] px-3 py-1.5 text-foreground`,children:[(0,X.jsxs)(`div`,{className:`preview-panel-file-identity flex min-w-0 flex-1 items-center gap-2`,children:[(0,X.jsx)(`div`,{className:`truncate font-mono text-[12px] font-medium`,children:v}),je?(0,X.jsx)(`span`,{"aria-label":`Unsaved changes`,className:`size-1.5 shrink-0 rounded-full bg-primary`,title:`Unsaved changes`}):null,U?.saveStatus===`saving`?(0,X.jsxs)(`span`,{"aria-live":`polite`,className:`flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,X.jsx)(be,{className:`size-3 animate-spin`}),` Saving`]}):null,!r&&H?.lineEnding===`mixed`?(0,X.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground`,children:`Read-only · mixed line endings`}):null]}),Me&&U?(0,X.jsxs)(`div`,{className:`preview-panel-file-actions flex shrink-0 items-center gap-1`,children:[(0,X.jsx)(Un,{"aria-label":`Discard file changes`,disabled:!je||U.saveStatus===`saving`,onClick:Re,size:`xs`,variant:`ghost`,children:`Discard`}),(0,X.jsxs)(Un,{"aria-label":`Save file`,disabled:!Be,onClick:()=>void ze(),size:`xs`,title:`Save file (Ctrl/⌘ S)`,children:[U.saveStatus===`saving`?(0,X.jsx)(be,{className:`animate-spin`}):(0,X.jsx)(yn,{}),`Save`,(0,X.jsx)(`span`,{className:`ml-0.5 text-[9px] opacity-70`,children:`⌘S`})]})]}):null]}),U?.errorMessage?(0,X.jsx)(`div`,{className:`shrink-0 border-b border-border/60 p-2`,children:(0,X.jsxs)(qn,{variant:U.saveStatus===`conflict`?`warning`:`error`,className:`rounded-lg px-3 py-2 text-[11px]`,children:[U.saveStatus===`conflict`?(0,X.jsx)(Tn,{className:`size-3.5`}):(0,X.jsx)(Ee,{className:`size-3.5`}),(0,X.jsx)(Gn,{className:`text-[11px]`,children:U.errorReason===`deleted`?`File removed on disk`:U.saveStatus===`conflict`?`File changed on disk`:`Couldn’t save file`}),(0,X.jsxs)(Kn,{className:`gap-2 text-[11px] leading-4`,children:[(0,X.jsx)(`span`,{children:U.errorMessage}),U.saveStatus===`conflict`?(0,X.jsx)(Un,{className:`self-start`,onClick:U.errorReason===`deleted`?Re:()=>void Le(),size:`xs`,variant:`outline`,children:U.errorReason===`deleted`?`Close file`:`Reload`}):null]})]})}):ke?(0,X.jsxs)(`div`,{className:`shrink-0 border-b border-border/60 px-3 py-2 text-[11px] text-destructive`,children:[`Refresh failed: `,ke]}):null,Oe===`image`&&De?.base64?(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 justify-center overflow-auto bg-background/70 p-3`,children:(0,X.jsx)(`img`,{alt:v??void 0,className:`max-h-full max-w-full object-contain`,src:`data:${V??`image/png`};base64,${De.base64}`})}):Me&&U?(0,X.jsx)(oh,{cacheKey:U.key,className:`preview-panel-diffs-file`,contents:U.contents,filePath:U.relativePath,language:Eh(U.relativePath),onChange:Ie,options:He}):Ve?(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,X.jsx)(zl,{file:Ve,className:`preview-panel-diffs-file`,options:He})}):(0,X.jsx)(`pre`,{className:q(`min-h-0 flex-1 bg-transparent p-3 font-mono text-[11px] leading-5 text-muted-foreground/90`,A?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:De?.contents??``})]})]}),et=(0,X.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,X.jsx)(`div`,{className:`shrink-0 border-b border-border/60 p-2`,children:(0,X.jsxs)(`label`,{className:`relative block`,children:[(0,X.jsx)(bn,{className:`pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground/65`}),(0,X.jsx)(`input`,{type:`text`,value:E,onChange:e=>D(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(D(``),e.currentTarget.blur())},placeholder:`Filter files...`,"aria-label":`Filter files`,className:`h-8 w-full rounded-md border border-border/70 bg-background/65 pl-8 pr-3 text-xs text-foreground outline-none transition-[border-color,background-color,box-shadow] placeholder:text-muted-foreground/55 focus:border-ring/60 focus:bg-background focus:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_18%,transparent)]`})]})}),(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:[me||ge?(0,X.jsxs)(qn,{variant:me?`error`:`warning`,className:`mb-2 rounded-lg border-border/70 px-3 py-2 text-[11px]`,children:[me?(0,X.jsx)(Ee,{className:`size-3.5`}):(0,X.jsx)(Tn,{className:`size-3.5`}),(0,X.jsx)(Gn,{className:`text-[11px]`,children:me?`Workspace tree refresh failed`:`Workspace tree is truncated`}),(0,X.jsx)(Kn,{className:`gap-1 text-[11px] leading-4`,children:me?(0,X.jsx)(`span`,{children:me}):(0,X.jsx)(`span`,{children:`Only the first indexed workspace entries are shown here, so some files may be omitted from preview.`})})]}):null,ye.length===0?(0,X.jsx)(`div`,{className:`px-2 py-6 text-center text-xs leading-5 text-muted-foreground/70`,children:`No files match this filter.`}):(0,X.jsx)(ud,{files:ye,allDirectoriesExpanded:xe,resolvedTheme:t,onSelectFile:Fe,selectedFilePath:v,showStats:!1})]})]});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Tt,{mode:e,header:Qe,children:u?z.isLoading&&!z.data?(0,X.jsx)(rn,{label:`Loading project tree...`}):me&&!z.data?(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:me}):(z.data?.entries.length??0)===0?(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`No project files available yet.`}):r?(0,X.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:v?(0,X.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex min-h-12 shrink-0 items-center gap-1 border-b border-border/60 px-1.5`,children:[(0,X.jsx)(Un,{size:`icon`,variant:`ghost`,"aria-label":`Back to workspace tree`,className:`shrink-0`,onClick:()=>y(null),children:(0,X.jsx)(_e,{})}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground`,children:v})]}),$e]}):et}):(0,X.jsxs)(`div`,{ref:M,className:`flex min-h-0 min-w-0 flex-1 overflow-hidden`,children:[(0,X.jsx)(`div`,{"data-preview-content-panel":!0,className:`flex min-h-0 min-w-0 flex-1 flex-col transition-[min-width] duration-[320ms] ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none`,children:v?$e:(0,X.jsx)(Gh,{})}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Resize workspace tree`,"aria-hidden":!O||void 0,className:q(`group relative shrink-0 overflow-hidden bg-background transition-[width,opacity,background-color] duration-[360ms] ease-[cubic-bezier(0.16,1,0.3,1)] hover:bg-accent/40 motion-reduce:transition-none`,O?`w-2 cursor-ew-resize opacity-100`:`w-0 opacity-0`),disabled:!O,onPointerDown:Ue,onPointerMove:We,onPointerUp:Ge,onPointerCancel:Ge,children:(0,X.jsx)(`span`,{className:`absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-border/80 group-hover:bg-border`})}),(0,X.jsx)(Wh,{width:ne,open:O,resizing:se,children:et})]}):(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Select a thread to preview files.`})}),(0,X.jsx)(tr,{open:Je,onOpenChange:e=>{e||Ye()},children:(0,X.jsxs)(Qn,{children:[(0,X.jsxs)(Xn,{children:[(0,X.jsx)(er,{children:`Save changes before continuing?`}),(0,X.jsx)($n,{children:v?`${v} has unsaved changes.`:`This file has unsaved changes.`})]}),(0,X.jsxs)(Zn,{children:[(0,X.jsx)(Un,{onClick:Ye,variant:`outline`,children:`Cancel`}),(0,X.jsx)(Un,{disabled:U?.saveStatus===`saving`,onClick:Xe,variant:`destructive-outline`,children:C?`Discard & Open`:`Discard & Continue`}),(0,X.jsxs)(Un,{disabled:!Be,onClick:()=>void Ze(),children:[U?.saveStatus===`saving`?(0,X.jsx)(be,{className:`animate-spin`}):(0,X.jsx)(yn,{}),C?`Save & Open`:`Save & Continue`]})]})]})})]})}function qh(){return{phase:`awaiting-config`,lastSequence:null}}var Jh=2**32,Yh=1024;function Xh(e,t,n){if(t.deviceId!==n)return{state:e,action:{kind:`ignore`},requestKeyframe:!1};if(t.codecConfig)return{state:{phase:`awaiting-keyframe`,lastSequence:t.sequence},action:{kind:`configure`},requestKeyframe:!1};if(e.phase===`awaiting-config`)return{state:e,action:{kind:`drop`},requestKeyframe:!1};if(e.lastSequence!==null){let n=(t.sequence-e.lastSequence+Jh)%Jh;if(n===0||n>Yh)return{state:e,action:{kind:`drop`},requestKeyframe:!1};if(n>1&&!t.keyframe&&e.phase===`streaming`)return{state:{phase:`awaiting-keyframe`,lastSequence:t.sequence},action:{kind:`drop`},requestKeyframe:!0}}return e.phase===`awaiting-keyframe`&&!t.keyframe?{state:{...e,lastSequence:t.sequence},action:{kind:`drop`},requestKeyframe:!1}:{state:{phase:`streaming`,lastSequence:t.sequence},action:{kind:`decode`,keyframe:t.keyframe},requestKeyframe:!1}}function Zh(e,t,n){let r=Math.min(e.displayWidth/e.frameWidth,e.displayHeight/e.frameHeight);if(!Number.isFinite(r)||r<=0)return null;let i=e.frameWidth*r,a=e.frameHeight*r,o=t-(e.displayWidth-i)/2,s=n-(e.displayHeight-a)/2;return o<0||s<0||o>i||s>a?null:{x:Math.round(o/i*e.pointWidth),y:Math.round(s/a*e.pointHeight)}}function Qh(e){let t={Enter:40,Escape:41,Backspace:42,Tab:43," ":44,ArrowRight:79,ArrowLeft:80,ArrowDown:81,ArrowUp:82},n=e.toLowerCase();return n>=`a`&&n<=`z`&&n.length===1?4+n.charCodeAt(0)-97:n===`0`?39:n>=`1`&&n<=`9`&&n.length===1?30+n.charCodeAt(0)-49:t[e]??null}function $h(e){for(let t=0;t+7<e.byteLength;t+=1){let n=e[t]===0&&e[t+1]===0&&e[t+2]===0&&e[t+3]===1,r=e[t]===0&&e[t+1]===0&&e[t+2]===1;if(!n&&!r)continue;let i=t+(n?4:3);if(((e[i]??0)&31)==7)return`avc1.${[e[i+1],e[i+2],e[i+3]].map(e=>(e??0).toString(16).padStart(2,`0`)).join(``)}`}return null}function eg(e){let{canvasRef:t,udid:n,openFrameSource:r}=e,[i,a]=(0,J.useState)(`idle`),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(null),u=(0,J.useRef)(0);return(0,J.useEffect)(()=>{if(!n||!r){a(`idle`),s(null);return}if(typeof globalThis.VideoDecoder!=`function`||typeof globalThis.EncodedVideoChunk!=`function`){a(`unsupported`);return}let e=++u.current,i=qh(),o=null,c=null,d=null,f=()=>e===u.current;a(`connecting`),s(null);let p=()=>{d=null;try{o?.state!==`closed`&&o?.close()}catch{}o=null},m=e=>{f()&&(p(),i=qh(),s(e),a(`error`))},h=e=>{let n=$h(e.payload);if(!n){m(`The simulator sent video parameters Ryco could not read.`),c?.requestResync();return}p();let r=new VideoDecoder({output:e=>{try{if(!f())return;let n=t.current;if(!n)return;(n.width!==e.displayWidth||n.height!==e.displayHeight)&&(n.width=e.displayWidth,n.height=e.displayHeight,l({width:e.displayWidth,height:e.displayHeight})),n.getContext(`2d`)?.drawImage(e,0,0),a(`streaming`),s(null)}finally{e.close()}},error:e=>{m(e.message||`The simulator video decoder failed.`),c?.requestResync()}});try{r.configure({codec:n,optimizeForLatency:!0}),o=r,d=e.payload.slice()}catch(e){m(e instanceof Error?e.message:`Video decoder setup failed.`)}},g=(e,t)=>{if(!o||o.state!==`configured`)return;let n=e.payload;if(t&&d){let e=new Uint8Array(d.byteLength+n.byteLength);e.set(d),e.set(n,d.byteLength),n=e,d=null}try{o.decode(new EncodedVideoChunk({type:t?`key`:`delta`,timestamp:Math.round(e.header.timestampMs*1e3),data:n}))}catch(e){m(e instanceof Error?e.message:`A simulator frame could not be decoded.`),c?.requestResync()}};return c=r(n,{onFrame:e=>{if(!f())return;let t=Xh(i,e.header,n);i=t.state,t.requestKeyframe&&c?.requestResync(),t.action.kind===`configure`&&h(e),t.action.kind===`decode`&&g(e,t.action.keyframe)},onReset:e=>{f()&&(p(),i=qh(),e===`decode-failed`&&s(`The simulator sent a malformed frame.`),a(`recovering`))}}),()=>{u.current+=1,c?.close(),p()}},[t,r,n]),{status:i,error:o,dimensions:c}}var tg=750,ng=524288,rg=15e3;function ig(e){let t=Math.ceil(Math.max(0,e)/ng*1e3);return Math.min(rg,Math.max(tg,t))}function ag(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)n[e]=t.charCodeAt(e);return n}function og(e){let t=ag(e);return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}function sg(e){let{canvasRef:t,enabled:n,screenshot:r,udid:i}=e,[a,o]=(0,J.useState)(`idle`),[s,c]=(0,J.useState)(null),[l,u]=(0,J.useState)(null);return(0,J.useEffect)(()=>{if(!n||!i||!r){o(`idle`),c(null);return}let e=!0,a=null,s=document.visibilityState!==`hidden`,l=!0,d=!1;o(`connecting`);let f=()=>{a!==null&&(clearTimeout(a),a=null)},p=()=>e&&s&&l,m=e=>{f(),!(!p()||d)&&(a=setTimeout(()=>{a=null,h()},e))},h=async()=>{if(!p()||d)return;d=!0;let n=tg;try{let e=await r({udid:i});if(n=ig(e.bytesBase64.length),!p())return;let a=await createImageBitmap(new Blob([og(e.bytesBase64)],{type:e.mimeType}));try{if(!p())return;let e=t.current;if(!e)return;(e.width!==a.width||e.height!==a.height)&&(e.width=a.width,e.height=a.height,u({width:a.width,height:a.height})),e.getContext(`2d`)?.drawImage(a,0,0),o(`streaming`),c(null)}finally{a.close()}}catch(t){if(!e)return;o(`recovering`),c(t instanceof Error?t.message:`The hosted simulator preview disconnected.`)}finally{d=!1,p()&&m(n)}},g=()=>{s=document.visibilityState!==`hidden`,s?m(0):f()};document.addEventListener(`visibilitychange`,g);let _=t.current,v=_&&typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{l=e.some(e=>e.isIntersecting),l?m(0):f()}):null;return v?.observe(_),m(0),()=>{e=!1,f(),v?.disconnect(),document.removeEventListener(`visibilitychange`,g)}},[t,n,r,i]),{status:a,error:s,dimensions:l}}var cg=5e3;function lg(e,t){return e instanceof Error&&e.message.trim()?e.message:t}function ug(e){return e===`booted`?`Booted`:e===`booting`?`Booting`:e===`shutting-down`?`Shutting down`:`Shut down`}function dg(e,t){return t===`waiting-for-display`?`Waiting for the display…`:t===`connecting`?`Connecting the live screen…`:t===`booting`||e.state===`booting`?`Starting the simulator…`:`Connecting…`}function fg(e){let t=[];return e.metaKey&&t.push(`command`),e.shiftKey&&t.push(`shift`),e.altKey&&t.push(`option`),e.ctrlKey&&t.push(`control`),t}function pg(e){let t=(0,Y.c)(15),n=e.availability;if(!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:[(0,X.jsx)(be,{className:`size-5 animate-spin text-muted-foreground`}),(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Checking simulator support…`})]}),t[0]=e):e=t[0],e}if(n.kind===`unsupported-platform`){let e,r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(br,{className:`size-7 text-muted-foreground`}),r=(0,X.jsx)(`p`,{className:`mt-4 text-sm font-medium`,children:`iOS Simulator needs a Mac`}),t[1]=e,t[2]=r):(e=t[1],r=t[2]);let i;return t[3]===n.platform?i=t[4]:(i=(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center p-8 text-center`,children:[e,r,(0,X.jsxs)(`p`,{className:`mt-1 max-w-sm text-xs leading-relaxed text-muted-foreground`,children:[`This environment runs on `,n.platform,`. Connect Ryco to a macOS environment with Xcode to use the simulator workspace.`]})]}),t[3]=n.platform,t[4]=i),i}if(n.kind===`helper-unavailable`){let e,r;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(br,{className:`size-7 text-amber-500`}),r=(0,X.jsx)(`p`,{className:`mt-4 text-sm font-medium`,children:`Simulator helper could not start`}),t[5]=e,t[6]=r):(e=t[5],r=t[6]);let i;return t[7]===n.message?i=t[8]:(i=(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center p-8 text-center`,children:[e,r,(0,X.jsx)(`p`,{className:`mt-1 max-w-sm text-xs leading-relaxed text-muted-foreground`,children:n.message})]}),t[7]=n.message,t[8]=i),i}if(n.kind!==`setup-required`||n.steps.filter(gg).every(hg))return null;let r,i;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(`p`,{className:`text-sm font-medium`,children:`Set up the iOS Simulator`}),i=(0,X.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Ryco checks these steps automatically every few seconds.`}),t[9]=r,t[10]=i):(r=t[9],i=t[10]);let a;t[11]===n.steps?a=t[12]:(a=n.steps.map(mg),t[11]=n.steps,t[12]=a);let o;return t[13]===a?o=t[14]:(o=(0,X.jsx)(`div`,{className:`flex flex-1 flex-col items-center justify-center p-8`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-md`,children:[r,i,(0,X.jsx)(`div`,{className:`mt-5 space-y-2`,children:a})]})}),t[13]=a,t[14]=o),o}function mg(e){return(0,X.jsxs)(`div`,{className:`flex gap-3 rounded-md border border-border/60 p-3`,children:[(0,X.jsx)(`span`,{className:q(`mt-0.5 size-2 shrink-0 rounded-full`,e.done?`bg-emerald-500`:`bg-amber-500`)}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-xs font-medium`,children:e.label}),e.detail?(0,X.jsx)(`p`,{className:`mt-1 break-words font-mono text-[10px] text-muted-foreground`,children:e.detail}):null]})]},e.id)}function hg(e){return e.id===`build-device-helper`}function gg(e){return!e.done}function _g(e){let{environmentId:t,threadId:n}=e,i=(0,J.useRef)(null),a=(0,J.useMemo)(()=>t&&n?o(r(t,n)):null,[t,n]),s=O(e=>t?e.environmentById[t]:void 0),c=O(e=>a?e.threadByKey[a]:void 0),[l,u]=(0,J.useState)(!1),[d,f]=(0,J.useState)(null),[p,m]=(0,J.useState)({kind:`idle`}),[h,g]=(0,J.useState)(null),_=t?C(t)?.device:void 0,v=t?S(t)?.client.device:void 0,y=s?.generation??0,b=O(e=>e.applyThreadSnapshot),x=O(e=>e.applyInventory),w=(0,J.useCallback)(async()=>{if(!t||!n||!_)return;let[e,r]=await Promise.all([_.list({includeShutdown:!0}),_.getThreadState({threadId:n})]);x(t,y,e.devices,e.availability),b(t,y,r)},[_,x,b,t,y,n]),T=s?.availability?.kind===`setup-required`||s?.availability?.kind===`helper-unavailable`;(0,J.useEffect)(()=>{if(w().catch(()=>void 0),!T)return;let e=setInterval(()=>void w().catch(()=>void 0),cg);return()=>clearInterval(e)},[T,w]);let E=s?.devices??c?.devices??[],D=E.find(e=>e.udid===c?.attachedDeviceUdid)??E.find(e=>e.udid===d)??null;(0,J.useEffect)(()=>{d&&c?.attachedDeviceUdid===d&&f(null)},[d,c?.attachedDeviceUdid]);let k=(0,J.useCallback)(async(e,t)=>{u(!0);try{await e()}catch(e){De.add({type:`error`,title:t,description:lg(e,`The simulator did not respond.`)})}finally{u(!1)}},[]),A=(0,J.useCallback)(e=>{!_||!n||(f(e.udid),k(async()=>{if(e.state===`shutdown`){let t=await _.boot({udid:e.udid});if(t.kind===`boot-limit-reached`){f(null),g({requested:e,candidates:t.rycoBooted,limit:t.limit});return}}b(t,y,await _.attach({threadId:n,udid:e.udid}))},`Could not open that simulator`))},[_,b,t,y,k,n]),j=(0,J.useCallback)(e=>{if(!h||!_||!n||!t)return;let r=h;g(null),f(r.requested.udid),k(async()=>{await _.shutdown({udid:e.udid});let i=await _.boot({udid:r.requested.udid});if(i.kind===`boot-limit-reached`){f(null),g({...r,candidates:i.rycoBooted,limit:i.limit});return}b(t,y,await _.attach({threadId:n,udid:r.requested.udid}))},`Could not free a simulator slot`)},[_,b,h,t,y,k,n]),M=eg({canvasRef:i,udid:D?.state===`booted`?D.udid:null,...v?.openFrameSource?{openFrameSource:v.openFrameSource}:{}}),ee=sg({canvasRef:i,udid:D?.state===`booted`?D.udid:null,enabled:!v?.openFrameSource,screenshot:_?e=>_.screenshot(e):null}),N=v?.openFrameSource?M.status:ee.status,te=v?.openFrameSource?M.error:ee.error,P=v?.openFrameSource?M.dimensions:ee.dimensions,ne=(0,J.useRef)(null),re=(0,J.useCallback)(e=>{let t=i.current;if(!t||!P)return null;let n=t.getBoundingClientRect(),r=D?.geometry?.scale??(P.width>1400?2:3);return Zh({frameWidth:P.width,frameHeight:P.height,displayWidth:n.width,displayHeight:n.height,pointWidth:D?.geometry?.pointWidth??P.width/r,pointHeight:D?.geometry?.pointHeight??P.height/r},e.clientX-n.left,e.clientY-n.top)},[D?.geometry,P]),ie=(0,J.useCallback)(e=>{e.currentTarget.focus(),e.currentTarget.setPointerCapture(e.pointerId),ne.current={point:re(e),at:performance.now()}},[re]),ae=(0,J.useCallback)(e=>{let t=ne.current;if(ne.current=null,!t||!D||!_)return;let n=re(e);!t.point||!n||(Math.hypot(n.x-t.point.x,n.y-t.point.y)<=8?_.tap({udid:D.udid,x:n.x,y:n.y}):_.swipe({udid:D.udid,fromX:t.point.x,fromY:t.point.y,toX:n.x,toY:n.y,durationMs:Math.max(16,Math.round(performance.now()-t.at))})).catch(e=>De.add({type:`error`,title:`Simulator input failed`,description:lg(e,`The input could not be delivered.`)}))},[_,D,re]),oe=(0,J.useCallback)((e,t)=>{if(!D||!_||e.metaKey||e.ctrlKey)return;let n=Qh(e.key);n!==null&&(e.preventDefault(),_.keyEvent({udid:D.udid,keyCode:n,modifiers:fg(e),direction:t}).catch(()=>void 0))},[_,D]),se=(0,J.useCallback)(e=>{!D||!_||k(()=>_.pressButton({udid:D.udid,button:e}),`Simulator button failed`)},[_,D,k]),F=(0,J.useCallback)(()=>{!D||!_||k(async()=>{let e=await _.screenshot({udid:D.udid,save:!0});De.add({type:`success`,title:`Screenshot saved`,description:e.path??e.name})},`Could not save the screenshot`)},[_,D,k]),ce=(0,J.useCallback)(()=>{if(!(!D||!_||p.kind===`starting`||p.kind===`stopping`)){if(p.kind===`idle`){m({kind:`starting`}),_.startRecording({udid:D.udid}).then(e=>m({kind:`recording`,path:e.path}),e=>{m({kind:`idle`}),De.add({type:`error`,title:`Could not start recording`,description:lg(e,`Recording failed.`)})});return}m({kind:`stopping`}),_.stopRecording({udid:D.udid}).then(e=>{m({kind:`idle`}),De.add({type:`success`,title:`Recording saved`,description:e.path})},e=>{m({kind:`idle`}),De.add({type:`error`,title:`Could not stop recording`,description:lg(e,`The recording may be incomplete.`)})})}},[_,D,p]);if(!t||!n||!_)return(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center p-8 text-center`,children:[(0,X.jsx)(br,{className:`size-7 text-muted-foreground`}),(0,X.jsx)(`p`,{className:`mt-4 text-sm font-medium`,children:`Simulator unavailable`}),(0,X.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`This thread has no device connection.`})]});let le=(0,X.jsx)(pg,{availability:s?.availability??null});if(!s?.availability||s.availability.kind===`unsupported-platform`||s.availability.kind===`helper-unavailable`||s.availability.kind===`setup-required`&&s.availability.steps.some(e=>!e.done&&e.id!==`build-device-helper`))return le;let ue=s.availability?.kind===`degraded`?s.availability.capabilities.filter(e=>!e.ok):[];return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-background`,children:[(0,X.jsxs)(`div`,{className:`flex min-h-11 shrink-0 items-center gap-2 border-b border-border/60 px-3`,children:[(0,X.jsx)(xn,{className:`size-4 text-muted-foreground`}),(0,X.jsxs)(`select`,{"aria-label":`Choose an iOS Simulator`,className:`min-w-0 max-w-72 flex-1 bg-transparent text-xs font-medium outline-none`,disabled:l,value:D?.udid??``,onChange:e=>{let t=E.find(t=>t.udid===e.target.value);t&&A(t)},children:[(0,X.jsx)(`option`,{value:``,disabled:!0,children:`Choose a simulator`}),E.toSorted((e,t)=>Number(t.state===`booted`)-Number(e.state===`booted`)||e.name.localeCompare(t.name)).map(e=>(0,X.jsxs)(`option`,{value:e.udid,disabled:e.state===`booting`||e.state===`shutting-down`,children:[e.name,` — `,e.runtime,` · `,ug(e.state)]},e.udid))]}),c?.agentActive?(0,X.jsx)(`span`,{className:`rounded-full bg-sky-500/15 px-2 py-0.5 text-[10px] font-medium text-sky-500`,children:`Agent controlling`}):null,(0,X.jsx)(Un,{size:`icon-xs`,variant:`ghost`,"aria-label":`Refresh simulators`,onClick:()=>void w(),children:(0,X.jsx)(vn,{className:`size-3.5`})})]}),ue.length>0?(0,X.jsxs)(`div`,{className:`border-b border-amber-500/20 bg-amber-500/8 px-3 py-1.5 text-[10px] text-amber-700 dark:text-amber-300`,children:[`Limited by this Xcode: `,ue.map(e=>e.id).join(`, `),`.`]}):null,(0,X.jsx)(`div`,{className:`relative flex min-h-0 flex-1 items-center justify-center overflow-hidden bg-muted/25 p-4 sm:p-6`,children:D?(0,X.jsxs)(`div`,{className:q(`relative flex max-h-full max-w-full overflow-hidden border-[7px] border-zinc-900 bg-black shadow-xl`,D.family===`tablet`||D.name.toLowerCase().includes(`ipad`)?`aspect-[4/3] w-[min(88%,52rem)] rounded-[1.8rem]`:`aspect-[9/19.5] h-full max-h-[min(100%,58rem)] rounded-[2.4rem]`),children:[(0,X.jsx)(`canvas`,{ref:i,tabIndex:0,"aria-label":`${D.name} screen`,className:`h-full w-full touch-none object-contain outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sky-400`,onPointerDown:ie,onPointerUp:ae,onPointerCancel:()=>{ne.current=null},onKeyDown:e=>oe(e,`down`),onKeyUp:e=>oe(e,`up`)}),N===`streaming`?null:(0,X.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 flex flex-col items-center justify-center bg-black/75 p-6 text-center text-white`,children:[(0,X.jsx)(be,{className:`size-5 animate-spin text-white/60`}),(0,X.jsx)(`p`,{className:`mt-3 text-xs font-medium`,children:N===`unsupported`?`This browser does not support WebCodecs.`:N===`recovering`?`Reconnecting the live screen…`:dg(D,c?.attachPhase)}),te?(0,X.jsx)(`p`,{className:`mt-2 max-w-52 text-[10px] text-white/60`,children:te}):null]})]}):(0,X.jsxs)(`div`,{className:`max-w-xs text-center`,children:[(0,X.jsx)(xn,{className:`mx-auto size-8 text-muted-foreground/60`}),(0,X.jsx)(`p`,{className:`mt-4 text-sm font-medium`,children:`Choose a simulator`}),(0,X.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:`Boot a device or attach one that is already running. Its screen will stay beside your conversation.`})]})}),(0,X.jsxs)(`div`,{className:`flex min-h-12 shrink-0 items-center justify-center gap-0.5 border-t border-border/60 bg-card/40 px-2`,children:[(0,X.jsx)(vg,{icon:gr,label:`Home`,disabled:!D||l,onClick:()=>se(`home`)}),(0,X.jsx)(vg,{icon:tn,label:`Lock`,disabled:!D||l,onClick:()=>se(`lock`)}),(0,X.jsx)(vg,{icon:Dr,label:`Volume down`,disabled:!D||l,onClick:()=>se(`volume-down`)}),(0,X.jsx)(vg,{icon:Or,label:`Volume up`,disabled:!D||l,onClick:()=>se(`volume-up`)}),(0,X.jsx)(`span`,{className:`mx-1 h-5 w-px bg-border`}),(0,X.jsx)(vg,{icon:dr,label:`Screenshot`,disabled:!D||l,onClick:F}),(0,X.jsx)(vg,{icon:p.kind===`recording`||p.kind===`stopping`?fr:mr,label:p.kind===`recording`?`Stop recording`:`Record screen`,active:p.kind!==`idle`,disabled:!D||p.kind===`starting`||p.kind===`stopping`,onClick:ce}),(0,X.jsx)(`span`,{className:`mx-1 h-5 w-px bg-border`}),(0,X.jsx)(vg,{icon:En,label:`Detach`,disabled:!D||l,onClick:()=>void k(async()=>b(t,y,await _.detach({threadId:n})),`Could not detach the simulator`)}),(0,X.jsx)(vg,{icon:wr,label:`Shut down`,disabled:!D||l,onClick:()=>{D&&k(()=>_.shutdown({udid:D.udid}),`Could not shut down the simulator`)}})]}),h?(0,X.jsx)(`div`,{className:`absolute inset-0 z-20 flex items-center justify-center bg-background/75 p-6 backdrop-blur-sm`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-sm rounded-xl border border-border bg-card p-5 shadow-xl`,children:[(0,X.jsx)(`p`,{className:`text-sm font-semibold`,children:`Simulator boot limit reached`}),(0,X.jsxs)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:[`Ryco keeps at most `,h.limit,` simulators it booted running. Shut down one to open `,h.requested.name,`.`]}),(0,X.jsx)(`div`,{className:`mt-4 space-y-2`,children:h.candidates.map(e=>(0,X.jsxs)(Un,{variant:`outline`,className:`w-full justify-between`,onClick:()=>j(e),children:[(0,X.jsxs)(`span`,{className:`truncate`,children:[`Shut down `,e.name]}),(0,X.jsx)(wr,{className:`size-3.5`})]},e.udid))}),(0,X.jsx)(Un,{variant:`ghost`,className:`mt-3 w-full`,onClick:()=>g(null),children:`Cancel`})]})}):null]})}function vg(e){let t=(0,Y.c)(11),n=e.icon,r=e.label,i=e.label,a=e.active,o=e.disabled,s=e.active&&`text-red-500`,c;t[0]===s?c=t[1]:(c=q(s),t[0]=s,t[1]=c);let l;t[2]===n?l=t[3]:(l=(0,X.jsx)(n,{className:`size-4`}),t[2]=n,t[3]=l);let u;return t[4]!==e.active||t[5]!==e.disabled||t[6]!==e.label||t[7]!==e.onClick||t[8]!==c||t[9]!==l?(u=(0,X.jsx)(Un,{size:`icon-sm`,variant:`ghost`,title:r,"aria-label":i,"aria-pressed":a,disabled:o,className:c,onClick:e.onClick,children:l}),t[4]=e.active,t[5]=e.disabled,t[6]=e.label,t[7]=e.onClick,t[8]=c,t[9]=l,t[10]=u):u=t[10],u}function yg(e){return e===`running`?`in_progress`:e===`failed`?`review`:e===`finished`?`done`:`idle`}function bg(e){return e===`running`?`Working`:e===`failed`?`Needs review`:e===`finished`?`Finished`:e===`interrupted`?`Stopped`:`Idle`}function xg(e){return encodeURIComponent(e??`none`).replace(/%/g,`_`)}function Sg(e){return`thread-workspace-tab-${xg(e)}`}function Cg(e){return`thread-workspace-panel-${xg(e)}`}function wg(e){let t=(0,Y.c)(17),n=e.active?`text-foreground`:`text-muted-foreground`,r;t[0]===n?r=t[1]:(r=q(`size-3.5 shrink-0`,n),t[0]=n,t[1]=r);let i=r;if(e.tab.mode===`agent`){let n=e.tab.avatarKey??e.tab.agentKey,r=!e.active&&`opacity-70`,i;t[2]===r?i=t[3]:(i=q(`size-3.5 shrink-0`,r),t[2]=r,t[3]=i);let a;return t[4]!==n||t[5]!==i?(a=(0,X.jsx)(kt,{name:n,className:i}),t[4]=n,t[5]=i,t[6]=a):a=t[6],a}if(e.tab.key===`review`){let e;return t[7]===i?e=t[8]:(e=(0,X.jsx)(hr,{className:i}),t[7]=i,t[8]=e),e}if(e.tab.key===`terminal`){let e;return t[9]===i?e=t[10]:(e=(0,X.jsx)(wn,{className:i}),t[9]=i,t[10]=e),e}if(e.tab.key===`simulator`){let e;return t[11]===i?e=t[12]:(e=(0,X.jsx)(xn,{className:i}),t[11]=i,t[12]=e),e}if(e.tab.key===`agents`){let e;return t[13]===i?e=t[14]:(e=(0,X.jsx)(ve,{className:i}),t[13]=i,t[14]=e),e}let a;return t[15]===i?a=t[16]:(a=(0,X.jsx)(Oe,{className:i}),t[15]=i,t[16]=a),a}function Tg(e){let t=(0,Y.c)(8),n;if(t[0]!==e.agent.status){let r=yg(e.agent.status);n=Yn(r,`truncate`),t[0]=e.agent.status,t[1]=n}else n=t[1];let r;t[2]===e.agent.name?r=t[3]:(r=Jn(e.agent.name,{durationSeconds:2.2}),t[2]=e.agent.name,t[3]=r);let i;return t[4]!==e.agent.name||t[5]!==n||t[6]!==r?(i=(0,X.jsx)(`span`,{className:n,style:r,children:e.agent.name}),t[4]=e.agent.name,t[5]=n,t[6]=r,t[7]=i):i=t[7],i}function Eg(e){let t=(0,Y.c)(43);if(!e.subagent){let n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(`div`,{className:`mx-auto flex size-10 items-center justify-center rounded-md border border-border/70 bg-card/60 text-muted-foreground`,children:(0,X.jsx)(yr,{className:`size-4`})}),r=(0,X.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:`Subagent unavailable`}),i=(0,X.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:`This tab points to a subagent that is no longer present in the current thread activity.`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;t[3]===e.agentKey?a=t[4]:(a=e.agentKey?(0,X.jsx)(`p`,{className:`mt-2 truncate font-mono text-[11px] text-muted-foreground/60`,children:e.agentKey}):null,t[3]=e.agentKey,t[4]=a);let o;return t[5]===a?o=t[6]:(o=(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-6 text-center`,children:(0,X.jsxs)(`div`,{className:`max-w-72`,children:[n,r,i,a]})}),t[5]=a,t[6]=o),o}let n=e.subagent.avatarKey??e.subagent.key,r;t[7]===n?r=t[8]:(r=(0,X.jsx)(kt,{name:n,className:`size-4`}),t[7]=n,t[8]=r);let i;t[9]===e.subagent?i=t[10]:(i=(0,X.jsx)(`p`,{className:`min-w-0 flex-1 text-sm font-medium`,children:(0,X.jsx)(Tg,{agent:e.subagent})}),t[9]=e.subagent,t[10]=i);let a;t[11]===e.subagent.role?a=t[12]:(a=e.subagent.role?(0,X.jsx)(`span`,{className:`max-w-36 shrink-0 truncate rounded-sm border border-border/60 bg-background/40 px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:e.subagent.role}):null,t[11]=e.subagent.role,t[12]=a);let o;t[13]===e.subagent.status?o=t[14]:(o=bg(e.subagent.status),t[13]=e.subagent.status,t[14]=o);let s;t[15]===o?s=t[16]:(s=(0,X.jsx)(`span`,{className:`shrink-0 rounded-md border border-border/70 px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:o}),t[15]=o,t[16]=s);let c;t[17]!==r||t[18]!==i||t[19]!==a||t[20]!==s?(c=(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[r,i,a,s]}),t[17]=r,t[18]=i,t[19]=a,t[20]=s,t[21]=c):c=t[21];let l;t[22]===e.subagent.detail?l=t[23]:(l=e.subagent.detail?(0,X.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:e.subagent.detail}):null,t[22]=e.subagent.detail,t[23]=l);let u;t[24]!==e.subagent.providerThreadIds||t[25]!==e.subagent.tool?(u=e.subagent.tool||e.subagent.providerThreadIds.length>0?(0,X.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap items-center gap-1.5`,children:[e.subagent.tool?(0,X.jsx)(`span`,{className:`rounded-md border border-border/60 px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:e.subagent.tool}):null,e.subagent.providerThreadIds.slice(0,2).map(Og)]}):null,t[24]=e.subagent.providerThreadIds,t[25]=e.subagent.tool,t[26]=u):u=t[26];let d;t[27]!==c||t[28]!==l||t[29]!==u?(d=(0,X.jsxs)(`div`,{className:`border-b border-border/60 px-4 py-3`,children:[c,l,u]}),t[27]=c,t[28]=l,t[29]=u,t[30]=d):d=t[30];let f;t[31]===e.subagent.messages?f=t[32]:(f=e.subagent.messages.length>0?e.subagent.messages.map(Dg):null,t[31]=e.subagent.messages,t[32]=f);let p;t[33]!==e.subagent.entries||t[34]!==e.subagent.messages.length||t[35]!==e.subagent.status?(p=e.subagent.entries.length>0?e.subagent.entries.map(t=>(0,X.jsxs)(`div`,{className:`rounded-md border border-border/60 bg-card/40 p-3`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`span`,{className:q(`size-2 shrink-0 rounded-full`,t.tone===`error`?`bg-destructive`:e.subagent?.status===`running`?`bg-sky-400`:e.subagent?.status===`interrupted`?`bg-muted-foreground/60`:`bg-emerald-400`)}),(0,X.jsx)(`p`,{className:`min-w-0 truncate text-xs font-medium text-foreground`,children:t.toolTitle??t.label})]}),t.detail?(0,X.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:t.detail}):null,t.output&&t.output!==t.detail?(0,X.jsx)(`div`,{className:`mt-3 rounded-md border border-border/50 bg-background/60 p-2`,children:(0,X.jsx)(Dt,{text:t.output,cwd:void 0,isStreaming:!1})}):null]},t.id)):e.subagent.messages.length===0?(0,X.jsxs)(`div`,{className:`flex min-h-48 flex-col items-center justify-center rounded-md border border-dashed border-border/70 bg-card/20 p-6 text-center`,children:[(0,X.jsx)(yr,{className:`size-5 text-muted-foreground/60`}),(0,X.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:`No transcript captured yet`}),(0,X.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:`The subagent is visible from lifecycle events. Detailed messages will appear here when the provider exposes them.`})]}):null,t[33]=e.subagent.entries,t[34]=e.subagent.messages.length,t[35]=e.subagent.status,t[36]=p):p=t[36];let m;t[37]!==f||t[38]!==p?(m=(0,X.jsx)(Hn,{className:`min-h-0 flex-1`,children:(0,X.jsxs)(`div`,{className:`space-y-3 p-4`,children:[f,p]})}),t[37]=f,t[38]=p,t[39]=m):m=t[39];let h;return t[40]!==m||t[41]!==d?(h=(0,X.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[d,m]}),t[40]=m,t[41]=d,t[42]=h):h=t[42],h}function Dg(e){return(0,X.jsxs)(`div`,{className:`rounded-md border border-border/60 bg-card/40 p-3`,children:[(0,X.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center justify-between gap-2`,children:[(0,X.jsx)(`p`,{className:`truncate text-xs font-medium text-foreground`,children:`Subagent`}),e.providerThreadId?(0,X.jsx)(`span`,{className:`truncate font-mono text-[10px] text-muted-foreground/55`,children:e.providerThreadId}):null]}),(0,X.jsx)(Dt,{text:e.text,cwd:void 0,isStreaming:!1})]},e.id)}function Og(e){return(0,X.jsx)(`span`,{className:`max-w-40 truncate rounded-md border border-border/60 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground/70`,children:e},e)}function kg(e){let t=(0,Y.c)(8),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(`div`,{className:`mx-auto flex size-10 items-center justify-center rounded-md border border-border/70 bg-card/60 text-muted-foreground`,children:(0,X.jsx)(wn,{className:`size-4`})}),t[0]=n):n=t[0];let r;t[1]===e.title?r=t[2]:(r=(0,X.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:e.title}),t[1]=e.title,t[2]=r);let i;t[3]===e.description?i=t[4]:(i=(0,X.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:e.description}),t[3]=e.description,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-6 text-center`,children:(0,X.jsxs)(`div`,{className:`max-w-72`,children:[n,r,i]})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ag(){let e=(0,Y.c)(89),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={strict:!1},e[0]=t):t=e[0];let n=re(t),a;e[1]===n?a=e[2]:(a=ie(n),e[1]=n,e[2]=a);let s=a,c;e[3]===n.draftId?c=e[4]:(c=n.draftId?ee.make(n.draftId):null,e[3]=n.draftId,e[4]=c);let u=c,p;e[5]===u?p=e[6]:(p=e=>u?e.getDraftSession(u):null,e[5]=u,e[6]=p);let m=te(p),h;bb0:{if(s){h=s;break bb0}if(!m){h=null;break bb0}let t;e[7]!==m.environmentId||e[8]!==m.threadId?(t=r(m.environmentId,m.threadId),e[7]=m.environmentId,e[8]=m.threadId,e[9]=t):t=e[9],h=t}let g=h,y;e[10]===g?y=e[11]:(y=f(g),e[10]=g,e[11]=y);let b=d(y),x;e[12]===g?x=e[13]:(x=e=>g?e.getDraftThreadByRef(g):null,e[12]=g,e[13]=x);let S=te(x),w;e[14]!==S||e[15]!==b?(w=b?i(b.environmentId,b.projectId):S?i(S.environmentId,S.projectId):null,e[14]=S,e[15]=b,e[16]=w):w=e[16];let T=w,E;e[17]===T?E=e[18]:(E=l(T),e[17]=T,e[18]=E);let O=d(E),k;e[19]===g?k=e[20]:(k=e=>D(e.terminalStateByThreadKey,g),e[19]=g,e[20]=k);let A=_(k),j;e[21]===g?j=e[22]:(j=e=>g?e.terminalLaunchContextByThreadKey[o(g)]??null:null,e[21]=g,e[22]=j);let M=_(j),N=_(zg),P=_(Rg),ne=_(Lg),ae=_(Ig),oe=_(Fg),se=_(Pg),F=v(),ce=Wn(),[le,ue]=(0,J.useState)(0),de=b?.worktreePath??S?.worktreePath??null,I=M?.worktreePath??de;M?.cwd;let fe;e[23]!==I||e[24]!==O||e[25]!==M?.cwd?(fe=M?.cwd??(O?sn({project:{cwd:O.cwd},worktreePath:I}):null),e[23]=I,e[24]=O,e[25]=M?.cwd,e[26]=fe):fe=e[26];let L=fe,R;e[27]!==I||e[28]!==O?(R=O?qt({project:{cwd:O.cwd},worktreePath:I}):{},e[27]=I,e[28]=O,e[29]=R):R=e[29];let pe=R,z;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(z={context:{terminalFocus:!0,terminalOpen:!0}},e[30]=z):z=e[30];let me=z,he;e[31]===F?he=e[32]:(he=Rn(F,`terminal.split`,me),e[31]=F,e[32]=he);let ge=he,B;e[33]===F?B=e[34]:(B=Rn(F,`terminal.new`,me),e[33]=F,e[34]=B);let _e=B,ve;e[35]===F?ve=e[36]:(ve=Rn(F,`terminal.close`,me),e[35]=F,e[36]=ve);let ye=ve,be,xe;e[37]!==N||e[38]!==A.terminalOpen||e[39]!==g?(be=()=>{!g||!A.terminalOpen||N(g,!1)},xe=[N,A.terminalOpen,g],e[37]=N,e[38]=A.terminalOpen,e[39]=g,e[40]=be,e[41]=xe):(be=e[40],xe=e[41]),(0,J.useEffect)(be,xe);let Se;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Se=()=>{ue(Ng)},e[42]=Se):Se=e[42];let Ce=Se,we;e[43]!==N||e[44]!==ne||e[45]!==g?(we=()=>{g&&(ne(g,`terminal-${On()}`),N(g,!1),Ce())},e[43]=N,e[44]=ne,e[45]=g,e[46]=we):we=e[46];let Te=we,Ee;e[47]!==ae||e[48]!==N||e[49]!==g?(Ee=()=>{g&&(ae(g,`terminal-${On()}`),N(g,!1),Ce())},e[47]=ae,e[48]=N,e[49]=g,e[50]=Ee):Ee=e[50];let De=Ee,V;e[51]!==oe||e[52]!==g?(V=e=>{g&&(oe(g,e),Ce())},e[51]=oe,e[52]=g,e[53]=V):V=e[53];let Oe=V,ke;e[54]!==P||e[55]!==g?(ke=e=>{g&&P(g,e)},e[54]=P,e[55]=g,e[56]=ke):ke=e[56];let Ae=ke,H;e[57]!==se||e[58]!==N||e[59]!==A.terminalIds.length||e[60]!==g?(H=e=>{if(!g)return;let t=C(g.environmentId);if(!t)return;let n=A.terminalIds.length<=1,r=()=>t.terminal.write({threadId:g.threadId,terminalId:e,data:`exit
|
|
2008
|
+
`;function zh(e,t){let n=Math.max(Fh,Math.floor(t*Lh));return Math.max(Fh,Math.min(e,n))}function Bh(e,t,n){let r=e.startX-n;return zh(e.startWidth+r,t)}function Vh(e){if(!e)return!1;let t=e.toLowerCase();return t.includes(`enoent`)||t.includes(`no such file`)||t.includes(`file not found`)||t.includes(`cannot find the file`)}function Hh(e,t){return`preview:${e}:${t.length}:${Pt(t).toString(36)}`}var Uh=[];function Wh(e){let t=(0,Y.c)(24),[n,r]=(0,J.useState)(e.open),i,a;t[0]===e.open?(i=t[1],a=t[2]):(i=()=>{if(!e.open){r(!1);return}let t=window.requestAnimationFrame(()=>r(!0));return()=>window.cancelAnimationFrame(t)},a=[e.open],t[0]=e.open,t[1]=i,t[2]=a),(0,J.useEffect)(i,a);let o=e.open&&n,s=!e.open||void 0,c=!e.open||void 0,l=e.open?`border-l border-border/70`:`border-l-0`,u=e.resizing?`transition-none`:`transition-[width,opacity] duration-[360ms] ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none`,d=e.open?`opacity-100`:`opacity-0`,f;t[3]!==l||t[4]!==u||t[5]!==d?(f=q(`min-h-0 shrink-0 overflow-hidden bg-card/20`,l,u,d),t[3]=l,t[4]=u,t[5]=d,t[6]=f):f=t[6];let p=e.open?`${e.width}px`:`0px`,m;t[7]===p?m=t[8]:(m={width:p,maxWidth:`55%`},t[7]=p,t[8]=m);let h=e.resizing?`transition-none`:null,g=o?`translate-x-0 opacity-100`:`translate-x-4 opacity-0`,_;t[9]!==h||t[10]!==g?(_=q(`h-full min-h-0 transition-[translate,opacity] duration-[360ms] ease-[cubic-bezier(0.16,1,0.3,1)] will-change-transform motion-reduce:transition-none`,h,g),t[9]=h,t[10]=g,t[11]=_):_=t[11];let v=`${e.width}px`,y;t[12]===v?y=t[13]:(y={width:v,maxWidth:`100%`},t[12]=v,t[13]=y);let b;t[14]!==e.children||t[15]!==_||t[16]!==y?(b=(0,X.jsx)(`div`,{className:_,style:y,children:e.children}),t[14]=e.children,t[15]=_,t[16]=y,t[17]=b):b=t[17];let x;return t[18]!==b||t[19]!==s||t[20]!==c||t[21]!==f||t[22]!==m?(x=(0,X.jsx)(`div`,{"data-preview-file-rail":!0,"aria-hidden":s,inert:c,className:f,style:m,children:b}),t[18]=b,t[19]=s,t[20]=c,t[21]=f,t[22]=m,t[23]=x):x=t[23],x}function Gh(){let e=(0,Y.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(Ae,{className:`size-8 text-muted-foreground/65`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center`,children:(0,X.jsxs)(`div`,{className:`flex max-w-xs flex-col items-center gap-3`,children:[t,(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Open file`}),(0,X.jsx)(`div`,{className:`text-xs leading-5 text-muted-foreground/70`,children:`Select a file from the workspace tree.`})]})]})}),e[1]=n):n=e[1],n}function Kh({mode:e=`inline`}){let{resolvedTheme:t}=ir(),n=h(),r=e===`phone`,i=re({strict:!1,select:e=>ie(e)}),a=re({strict:!1,select:e=>typeof e.draftId==`string`?ee.make(e.draftId):null}),o=oe({strict:!1,select:e=>le(e)}),c=d((0,J.useMemo)(()=>f(i),[i])),l=te(e=>c?null:a?e.getDraftSession(a):i?e.getDraftThreadByRef(i):null),u=(0,J.useMemo)(()=>{if(c)return{id:c.id,environmentId:c.environmentId,projectId:c.projectId,worktreePath:c.worktreePath,turnDiffSummaries:c.turnDiffSummaries};if(l)return{id:l.threadId,environmentId:l.environmentId,projectId:l.projectId,worktreePath:l.worktreePath,turnDiffSummaries:Uh}},[c,l]),m=u?.projectId??null,g=d(e=>u&&m?p(e,{environmentId:u.environmentId,projectId:m}):void 0),_=u?.worktreePath??g?.cwd??null,[v,y]=(0,J.useState)(null),[b,x]=(0,J.useState)(null),S=(0,J.useRef)(null),[C,T]=(0,J.useState)(null),[E,D]=(0,J.useState)(``),[O,k]=(0,J.useState)(!0),[A,j]=(0,J.useState)(r?!0:n.diffWordWrap),M=(0,J.useRef)(null),[ne,ae]=(0,J.useState)(()=>typeof window>`u`?Ih:N(Ph,s)??Ih),[se,F]=(0,J.useState)(!1),ce=(0,J.useRef)(null),ue=(0,J.useRef)(o.preview===`1`),de=(0,J.useRef)(null),I=(0,J.useRef)(null),fe=(0,J.useRef)(null),L=(0,J.useCallback)(e=>{S.current=e,x(e)},[]);(0,J.useEffect)(()=>{j(r?!0:n.diffWordWrap)},[r,n.diffWordWrap]),(0,J.useEffect)(()=>{y(null),L(null),T(null),k(!0)},[u?.environmentId,u?.id,L]);let R=(0,J.useMemo)(()=>{let e=(u?.turnDiffSummaries??[]).toReversed().find(e=>e.files.length>0);return e?`${e.turnId}:${e.completedAt}`:null},[u?.turnDiffSummaries]),pe=(0,J.useMemo)(()=>{if(!v)return null;let e=(u?.turnDiffSummaries??[]).toReversed().find(e=>e.files.some(e=>e.path===v));return e?`${e.turnId}:${e.completedAt}`:null},[u?.turnDiffSummaries,v]),z=ad({environmentId:u?.environmentId??null,cwd:_,enabled:!!(u?.environmentId&&_&&o.preview===`1`)}),me=z.error instanceof Error?z.error.message:z.error?`Failed to load the workspace tree.`:null,he=z.data,ge=z.data?.truncated===!0,B=z.isFetching,ve=z.refetch,ye=(0,J.useMemo)(()=>Nh(he?.entries??[],E),[E,he?.entries]),xe=E.trim().length>0;(0,J.useEffect)(()=>{if(he){if(he.entries.length===0){dh(S.current)||(y(null),L(null));return}v&&!he.entries.some(e=>e.path===v)&&(dh(S.current)||(y(null),L(null)))}},[L,he,v]),(0,J.useEffect)(()=>{if(o.preview!==`1`){de.current=R;return}if(de.current===null){de.current=R;return}de.current!==R&&(de.current=R,ve())},[R,o.preview,ve]),(0,J.useEffect)(()=>{let e=o.preview===`1`;e&&!ue.current&&y(null),ue.current=e},[o.preview]);let Se=v?he?.entries.find(e=>e.path===v):void 0,Ce=typeof Se?.sizeBytes==`number`?Oh(Se.sizeBytes):null,we=cd({environmentId:u?.environmentId??null,cwd:_,relativePath:v,enabled:!!(u?.environmentId&&_&&v&&o.preview===`1`&&(Ce?.shouldFetch??!0))}),Te=we.data?.relativePath===v?we.data:null,De=Te,V=De?.mimeType??Se?.mimeType??null,Oe=v?Dh({filePath:v,mimeType:V}):`text`,ke=we.error instanceof Error?we.error.message:we.error?`Failed to load file preview.`:null,Ae=we.refetch;(0,J.useEffect)(()=>{if(!v||o.preview!==`1`){I.current=pe;return}if(I.current===null){I.current=pe;return}I.current!==pe&&(I.current=pe,Ae())},[pe,o.preview,Ae,v]),(0,J.useEffect)(()=>{if(!v||!Vh(ke)){fe.current=null;return}let e=`${_??``}\u0000${v}\u0000${ke}`;fe.current!==e&&(fe.current=e,ve().then(e=>{if(!e.data?.entries.some(e=>e.path===v)){let e=S.current;e?.relativePath===v&&dh(e)?L(hh(e,{reason:`deleted`,message:`This file was removed from disk after it was opened. Explorer will not recreate it.`})):(y(e=>e===v?null:e),e?.relativePath===v&&L(null))}}).catch(()=>void 0))},[_,L,ve,ke,v]);let H=(0,J.useMemo)(()=>!u?.environmentId||!_||!Te||Te.relativePath!==v?null:lh({environmentId:u.environmentId,cwd:_},Te),[_,u?.environmentId,Te,v]);(0,J.useEffect)(()=>{H&&L(_h(S.current,H))},[L,H]);let U=H&&b?.key===H.key?b:null,je=dh(U),Me=!!(!r&&Oe===`text`&&H&&H.lineEnding!==`mixed`),Ne=lr({shouldBlockFn:(0,J.useCallback)(()=>je,[je]),disabled:!je,enableBeforeUnload:je,withResolver:!0}),Pe=(0,J.useCallback)(e=>{L(null),y(e)},[L]),Fe=(0,J.useCallback)(e=>{if(e!==v){if(dh(S.current)){T(e);return}Pe(e)}},[Pe,v]),Ie=(0,J.useCallback)(e=>{let t=S.current;!t||t.key!==H?.key||L(fh(t,e))},[L,H?.key]),Le=(0,J.useCallback)(async()=>{if(!u?.environmentId||!_||!v)return!1;try{let e=await w(u.environmentId).projects.readFile({cwd:_,relativePath:v});return id({environmentId:u.environmentId,cwd:_,relativePath:v},e),L(uh(lh({environmentId:u.environmentId,cwd:_},e))),!0}catch(e){let t=S.current;return t&&L(hh(t,{reason:Vh(e instanceof Error?e.message:String(e))?`deleted`:`failed`,message:e instanceof Error?e.message:`Failed to reload this file.`})),!1}},[_,u?.environmentId,L,v]),Re=(0,J.useCallback)(()=>{let e=S.current;if(!(!e||e.key!==H?.key)){if(e.errorReason===`deleted`){L(null),y(null),ve();return}if(e.saveStatus===`conflict`){Le();return}L(gh(e))}},[L,ve,Le,H?.key]),ze=(0,J.useCallback)(async()=>{let e=S.current;if(!e||!u?.environmentId||!_||e.relativePath!==v||e.lineEnding===`mixed`||e.saveStatus===`saving`||e.saveStatus===`conflict`||!dh(e))return!1;let t=e.key,n=e.contents;L(ph(e));try{let r=await w(u.environmentId).projects.writeFile({cwd:_,relativePath:e.relativePath,contents:n,expectedVersion:e.version,encoding:e.encoding,lineEnding:e.lineEnding});id({environmentId:u.environmentId,cwd:_,relativePath:e.relativePath},{relativePath:e.relativePath,contents:n,version:r.version,encoding:e.encoding,lineEnding:e.lineEnding});let i=S.current;if(!i||i.key!==t)return!1;let a=mh(i,n,r.version);return L(a),!dh(a)}catch(e){let n=S.current;return n?.key===t&&L(hh(n,vh(e))),!1}},[_,u?.environmentId,L,v]),W=U?.saveStatus===`conflict`||U?.errorReason===`unsupported`,Be=!!(Me&&je&&U?.saveStatus!==`saving`&&!W);(0,J.useEffect)(()=>{if(!Me||!je)return;let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),Be&&ze())};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},[Be,je,Me,ze]);let Ve=(0,J.useMemo)(()=>{let e=De?.contents;return!v||Oe!==`text`||e===void 0?null:{name:v,contents:e,lang:Eh(v),cacheKey:Hh(v,e)}},[De?.contents,Oe,v]),He=(0,J.useMemo)(()=>({disableFileHeader:!0,overflow:A?`wrap`:`scroll`,theme:Mt(t),themeType:t,unsafeCSS:ch,tokenizeMaxLineLength:1e3}),[t,A]),Ue=(0,J.useCallback)(e=>{if(e.button!==0||!O)return;let t=M.current?.querySelector(`[data-preview-file-rail]`)?.getBoundingClientRect().width??ne;ce.current={pointerId:e.pointerId,startWidth:t,startX:e.clientX},e.currentTarget.setPointerCapture(e.pointerId),F(!0),document.body.style.cursor=`ew-resize`,document.body.style.userSelect=`none`},[O,ne]),We=(0,J.useCallback)(e=>{let t=ce.current,n=M.current;if(!t||!n||t.pointerId!==e.pointerId)return;e.preventDefault();let r=Bh(t,n.clientWidth,e.clientX);ae(r)},[]),Ge=(0,J.useCallback)(e=>{let t=ce.current;if(!t||t.pointerId!==e.pointerId)return;let n=M.current,r=n?Bh(t,n.clientWidth,e.clientX):t.startWidth;ce.current=null,F(!1),ae(r),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`),typeof window<`u`&&P(Ph,r,s)},[]);(0,J.useEffect)(()=>()=>{document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`)},[]);let Ke=(0,J.useCallback)(()=>{ve()},[ve]),qe=(0,J.useCallback)(()=>{O&&(ce.current=null,F(!1),document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`)),k(e=>!e)},[O]),Je=C!==null||Ne.status===`blocked`,Ye=(0,J.useCallback)(()=>{T(null),Ne.status===`blocked`&&Ne.reset()},[Ne]),Xe=(0,J.useCallback)(()=>{let e=C;if(T(null),L(null),e){y(e);return}Ne.status===`blocked`&&Ne.proceed()},[L,Ne,C]),Ze=(0,J.useCallback)(async()=>{await ze()&&Xe()},[Xe,ze]),Qe=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`min-w-0 flex-1 px-1 [-webkit-app-region:no-drag]`,children:[(0,X.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:`File Preview`}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] uppercase tracking-[0.12em] text-muted-foreground/65`,children:[(0,X.jsx)(`span`,{children:`Workspace tree`}),ge?(0,X.jsx)(rr,{variant:`warning`,size:`sm`,className:`rounded-md px-1.5 py-0 text-[9px]`,children:`Truncated`}):null]})]}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[r?null:(0,X.jsx)(Un,{"aria-label":O?`Hide workspace tree`:`Show workspace tree`,"aria-pressed":O,title:O?`Hide workspace tree`:`Show workspace tree`,variant:`outline`,size:`icon-xs`,className:`shrink-0`,onClick:qe,children:O?(0,X.jsx)(xr,{className:`size-3`}):(0,X.jsx)(Sr,{className:`size-3`})}),(0,X.jsx)(Un,{"aria-label":`Refresh workspace tree`,title:`Refresh workspace tree`,variant:`outline`,size:`icon-xs`,className:`shrink-0`,disabled:!u?.environmentId||!_||B,onClick:Ke,children:(0,X.jsx)(vn,{className:q(`size-3`,B&&`animate-spin`)})}),(0,X.jsx)(sr,{"aria-label":A?`Disable preview line wrapping`:`Enable preview line wrapping`,title:A?`Disable line wrapping`:`Enable line wrapping`,variant:`outline`,size:`xs`,pressed:A,onPressedChange:e=>{j(!!e)},children:(0,X.jsx)(Er,{className:`size-3`})})]})]}),$e=Ce?.state===`too-large`?(0,X.jsxs)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:[`File is too large to preview (`,Ce.sizeBytes,` bytes). Limit is`,` `,Ce.limitBytes,` bytes.`]}):we.isLoading&&!Te?(0,X.jsx)(rn,{label:`Loading file preview...`}):ke&&!Te?(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:ke}):(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 p-2`,children:[(0,X.jsx)(`style`,{children:Rh}),(0,X.jsxs)(`div`,{className:`preview-panel-file-card flex h-full min-h-0 flex-col overflow-hidden rounded-md border border-border/70 bg-[color:color-mix(in_srgb,var(--card)_90%,var(--background))]`,children:[(0,X.jsxs)(`div`,{className:`preview-panel-file-toolbar flex min-h-10 shrink-0 items-center gap-3 border-b border-border/70 bg-[color:color-mix(in_srgb,var(--card)_94%,var(--foreground))] px-3 py-1.5 text-foreground`,children:[(0,X.jsxs)(`div`,{className:`preview-panel-file-identity flex min-w-0 flex-1 items-center gap-2`,children:[(0,X.jsx)(`div`,{className:`truncate font-mono text-[12px] font-medium`,children:v}),je?(0,X.jsx)(`span`,{"aria-label":`Unsaved changes`,className:`size-1.5 shrink-0 rounded-full bg-primary`,title:`Unsaved changes`}):null,U?.saveStatus===`saving`?(0,X.jsxs)(`span`,{"aria-live":`polite`,className:`flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,X.jsx)(be,{className:`size-3 animate-spin`}),` Saving`]}):null,!r&&H?.lineEnding===`mixed`?(0,X.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground`,children:`Read-only · mixed line endings`}):null]}),Me&&U?(0,X.jsxs)(`div`,{className:`preview-panel-file-actions flex shrink-0 items-center gap-1`,children:[(0,X.jsx)(Un,{"aria-label":`Discard file changes`,disabled:!je||U.saveStatus===`saving`,onClick:Re,size:`xs`,variant:`ghost`,children:`Discard`}),(0,X.jsxs)(Un,{"aria-label":`Save file`,disabled:!Be,onClick:()=>void ze(),size:`xs`,title:`Save file (Ctrl/⌘ S)`,children:[U.saveStatus===`saving`?(0,X.jsx)(be,{className:`animate-spin`}):(0,X.jsx)(yn,{}),`Save`,(0,X.jsx)(`span`,{className:`ml-0.5 text-[9px] opacity-70`,children:`⌘S`})]})]}):null]}),U?.errorMessage?(0,X.jsx)(`div`,{className:`shrink-0 border-b border-border/60 p-2`,children:(0,X.jsxs)(qn,{variant:U.saveStatus===`conflict`?`warning`:`error`,className:`rounded-lg px-3 py-2 text-[11px]`,children:[U.saveStatus===`conflict`?(0,X.jsx)(Tn,{className:`size-3.5`}):(0,X.jsx)(Ee,{className:`size-3.5`}),(0,X.jsx)(Gn,{className:`text-[11px]`,children:U.errorReason===`deleted`?`File removed on disk`:U.saveStatus===`conflict`?`File changed on disk`:`Couldn’t save file`}),(0,X.jsxs)(Kn,{className:`gap-2 text-[11px] leading-4`,children:[(0,X.jsx)(`span`,{children:U.errorMessage}),U.saveStatus===`conflict`?(0,X.jsx)(Un,{className:`self-start`,onClick:U.errorReason===`deleted`?Re:()=>void Le(),size:`xs`,variant:`outline`,children:U.errorReason===`deleted`?`Close file`:`Reload`}):null]})]})}):ke?(0,X.jsxs)(`div`,{className:`shrink-0 border-b border-border/60 px-3 py-2 text-[11px] text-destructive`,children:[`Refresh failed: `,ke]}):null,Oe===`image`&&De?.base64?(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 justify-center overflow-auto bg-background/70 p-3`,children:(0,X.jsx)(`img`,{alt:v??void 0,className:`max-h-full max-w-full object-contain`,src:`data:${V??`image/png`};base64,${De.base64}`})}):Me&&U?(0,X.jsx)(oh,{cacheKey:U.key,className:`preview-panel-diffs-file`,contents:U.contents,filePath:U.relativePath,language:Eh(U.relativePath),onChange:Ie,options:He}):Ve?(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,X.jsx)(zl,{file:Ve,className:`preview-panel-diffs-file`,options:He})}):(0,X.jsx)(`pre`,{className:q(`min-h-0 flex-1 bg-transparent p-3 font-mono text-[11px] leading-5 text-muted-foreground/90`,A?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:De?.contents??``})]})]}),et=(0,X.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,X.jsx)(`div`,{className:`shrink-0 border-b border-border/60 p-2`,children:(0,X.jsxs)(`label`,{className:`relative block`,children:[(0,X.jsx)(bn,{className:`pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground/65`}),(0,X.jsx)(`input`,{type:`text`,value:E,onChange:e=>D(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(D(``),e.currentTarget.blur())},placeholder:`Filter files...`,"aria-label":`Filter files`,className:`h-8 w-full rounded-md border border-border/70 bg-background/65 pl-8 pr-3 text-xs text-foreground outline-none transition-[border-color,background-color,box-shadow] placeholder:text-muted-foreground/55 focus:border-ring/60 focus:bg-background focus:shadow-[0_0_0_3px_color-mix(in_srgb,var(--ring)_18%,transparent)]`})]})}),(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:[me||ge?(0,X.jsxs)(qn,{variant:me?`error`:`warning`,className:`mb-2 rounded-lg border-border/70 px-3 py-2 text-[11px]`,children:[me?(0,X.jsx)(Ee,{className:`size-3.5`}):(0,X.jsx)(Tn,{className:`size-3.5`}),(0,X.jsx)(Gn,{className:`text-[11px]`,children:me?`Workspace tree refresh failed`:`Workspace tree is truncated`}),(0,X.jsx)(Kn,{className:`gap-1 text-[11px] leading-4`,children:me?(0,X.jsx)(`span`,{children:me}):(0,X.jsx)(`span`,{children:`Only the first indexed workspace entries are shown here, so some files may be omitted from preview.`})})]}):null,ye.length===0?(0,X.jsx)(`div`,{className:`px-2 py-6 text-center text-xs leading-5 text-muted-foreground/70`,children:`No files match this filter.`}):(0,X.jsx)(ud,{files:ye,allDirectoriesExpanded:xe,resolvedTheme:t,onSelectFile:Fe,selectedFilePath:v,showStats:!1})]})]});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Tt,{mode:e,header:Qe,children:u?z.isLoading&&!z.data?(0,X.jsx)(rn,{label:`Loading project tree...`}):me&&!z.data?(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:me}):(z.data?.entries.length??0)===0?(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`No project files available yet.`}):r?(0,X.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:v?(0,X.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex min-h-12 shrink-0 items-center gap-1 border-b border-border/60 px-1.5`,children:[(0,X.jsx)(Un,{size:`icon`,variant:`ghost`,"aria-label":`Back to workspace tree`,className:`shrink-0`,onClick:()=>y(null),children:(0,X.jsx)(_e,{})}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground`,children:v})]}),$e]}):et}):(0,X.jsxs)(`div`,{ref:M,className:`flex min-h-0 min-w-0 flex-1 overflow-hidden`,children:[(0,X.jsx)(`div`,{"data-preview-content-panel":!0,className:`flex min-h-0 min-w-0 flex-1 flex-col transition-[min-width] duration-[320ms] ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none`,children:v?$e:(0,X.jsx)(Gh,{})}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Resize workspace tree`,"aria-hidden":!O||void 0,className:q(`group relative shrink-0 overflow-hidden bg-background transition-[width,opacity,background-color] duration-[360ms] ease-[cubic-bezier(0.16,1,0.3,1)] hover:bg-accent/40 motion-reduce:transition-none`,O?`w-2 cursor-ew-resize opacity-100`:`w-0 opacity-0`),disabled:!O,onPointerDown:Ue,onPointerMove:We,onPointerUp:Ge,onPointerCancel:Ge,children:(0,X.jsx)(`span`,{className:`absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-border/80 group-hover:bg-border`})}),(0,X.jsx)(Wh,{width:ne,open:O,resizing:se,children:et})]}):(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Select a thread to preview files.`})}),(0,X.jsx)(tr,{open:Je,onOpenChange:e=>{e||Ye()},children:(0,X.jsxs)(Qn,{children:[(0,X.jsxs)(Xn,{children:[(0,X.jsx)(er,{children:`Save changes before continuing?`}),(0,X.jsx)($n,{children:v?`${v} has unsaved changes.`:`This file has unsaved changes.`})]}),(0,X.jsxs)(Zn,{children:[(0,X.jsx)(Un,{onClick:Ye,variant:`outline`,children:`Cancel`}),(0,X.jsx)(Un,{disabled:U?.saveStatus===`saving`,onClick:Xe,variant:`destructive-outline`,children:C?`Discard & Open`:`Discard & Continue`}),(0,X.jsxs)(Un,{disabled:!Be,onClick:()=>void Ze(),children:[U?.saveStatus===`saving`?(0,X.jsx)(be,{className:`animate-spin`}):(0,X.jsx)(yn,{}),C?`Save & Open`:`Save & Continue`]})]})]})})]})}function qh(){return{phase:`awaiting-config`,lastSequence:null}}var Jh=2**32,Yh=1024;function Xh(e,t,n){if(t.deviceId!==n)return{state:e,action:{kind:`ignore`},requestKeyframe:!1};if(t.codecConfig)return{state:{phase:`awaiting-keyframe`,lastSequence:t.sequence},action:{kind:`configure`},requestKeyframe:!1};if(e.phase===`awaiting-config`)return{state:e,action:{kind:`drop`},requestKeyframe:!1};if(e.lastSequence!==null){let n=(t.sequence-e.lastSequence+Jh)%Jh;if(n===0||n>Yh)return{state:e,action:{kind:`drop`},requestKeyframe:!1};if(n>1&&!t.keyframe&&e.phase===`streaming`)return{state:{phase:`awaiting-keyframe`,lastSequence:t.sequence},action:{kind:`drop`},requestKeyframe:!0}}return e.phase===`awaiting-keyframe`&&!t.keyframe?{state:{...e,lastSequence:t.sequence},action:{kind:`drop`},requestKeyframe:!1}:{state:{phase:`streaming`,lastSequence:t.sequence},action:{kind:`decode`,keyframe:t.keyframe},requestKeyframe:!1}}function Zh(e,t,n){let r=Math.min(e.displayWidth/e.frameWidth,e.displayHeight/e.frameHeight);if(!Number.isFinite(r)||r<=0)return null;let i=e.frameWidth*r,a=e.frameHeight*r,o=t-(e.displayWidth-i)/2,s=n-(e.displayHeight-a)/2;return o<0||s<0||o>i||s>a?null:{x:Math.round(o/i*e.pointWidth),y:Math.round(s/a*e.pointHeight)}}function Qh(e){let t={Enter:40,Escape:41,Backspace:42,Tab:43," ":44,ArrowRight:79,ArrowLeft:80,ArrowDown:81,ArrowUp:82},n=e.toLowerCase();return n>=`a`&&n<=`z`&&n.length===1?4+n.charCodeAt(0)-97:n===`0`?39:n>=`1`&&n<=`9`&&n.length===1?30+n.charCodeAt(0)-49:t[e]??null}function $h(e){for(let t=0;t+7<e.byteLength;t+=1){let n=e[t]===0&&e[t+1]===0&&e[t+2]===0&&e[t+3]===1,r=e[t]===0&&e[t+1]===0&&e[t+2]===1;if(!n&&!r)continue;let i=t+(n?4:3);if(((e[i]??0)&31)==7)return`avc1.${[e[i+1],e[i+2],e[i+3]].map(e=>(e??0).toString(16).padStart(2,`0`)).join(``)}`}return null}function eg(e){let{canvasRef:t,udid:n,openFrameSource:r}=e,[i,a]=(0,J.useState)(`idle`),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(null),u=(0,J.useRef)(0);return(0,J.useEffect)(()=>{if(!n||!r){a(`idle`),s(null);return}if(typeof globalThis.VideoDecoder!=`function`||typeof globalThis.EncodedVideoChunk!=`function`){a(`unsupported`);return}let e=++u.current,i=qh(),o=null,c=null,d=null,f=()=>e===u.current;a(`connecting`),s(null);let p=()=>{d=null;try{o?.state!==`closed`&&o?.close()}catch{}o=null},m=e=>{f()&&(p(),i=qh(),s(e),a(`error`))},h=e=>{let n=$h(e.payload);if(!n){m(`The simulator sent video parameters Ryco could not read.`),c?.requestResync();return}p();let r=new VideoDecoder({output:e=>{try{if(!f())return;let n=t.current;if(!n)return;(n.width!==e.displayWidth||n.height!==e.displayHeight)&&(n.width=e.displayWidth,n.height=e.displayHeight,l({width:e.displayWidth,height:e.displayHeight})),n.getContext(`2d`)?.drawImage(e,0,0),a(`streaming`),s(null)}finally{e.close()}},error:e=>{m(e.message||`The simulator video decoder failed.`),c?.requestResync()}});try{r.configure({codec:n,optimizeForLatency:!0}),o=r,d=e.payload.slice()}catch(e){m(e instanceof Error?e.message:`Video decoder setup failed.`)}},g=(e,t)=>{if(!o||o.state!==`configured`)return;let n=e.payload;if(t&&d){let e=new Uint8Array(d.byteLength+n.byteLength);e.set(d),e.set(n,d.byteLength),n=e,d=null}try{o.decode(new EncodedVideoChunk({type:t?`key`:`delta`,timestamp:Math.round(e.header.timestampMs*1e3),data:n}))}catch(e){m(e instanceof Error?e.message:`A simulator frame could not be decoded.`),c?.requestResync()}};return c=r(n,{onFrame:e=>{if(!f())return;let t=Xh(i,e.header,n);i=t.state,t.requestKeyframe&&c?.requestResync(),t.action.kind===`configure`&&h(e),t.action.kind===`decode`&&g(e,t.action.keyframe)},onReset:e=>{f()&&(p(),i=qh(),e===`decode-failed`&&s(`The simulator sent a malformed frame.`),a(`recovering`))}}),()=>{u.current+=1,c?.close(),p()}},[t,r,n]),{status:i,error:o,dimensions:c}}var tg=750,ng=524288,rg=15e3;function ig(e){let t=Math.ceil(Math.max(0,e)/ng*1e3);return Math.min(rg,Math.max(tg,t))}function ag(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)n[e]=t.charCodeAt(e);return n}function og(e){let t=ag(e);return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}function sg(e){let{canvasRef:t,enabled:n,screenshot:r,udid:i}=e,[a,o]=(0,J.useState)(`idle`),[s,c]=(0,J.useState)(null),[l,u]=(0,J.useState)(null);return(0,J.useEffect)(()=>{if(!n||!i||!r){o(`idle`),c(null);return}let e=!0,a=null,s=document.visibilityState!==`hidden`,l=!0,d=!1;o(`connecting`);let f=()=>{a!==null&&(clearTimeout(a),a=null)},p=()=>e&&s&&l,m=e=>{f(),!(!p()||d)&&(a=setTimeout(()=>{a=null,h()},e))},h=async()=>{if(!p()||d)return;d=!0;let n=tg;try{let e=await r({udid:i});if(n=ig(e.bytesBase64.length),!p())return;let a=await createImageBitmap(new Blob([og(e.bytesBase64)],{type:e.mimeType}));try{if(!p())return;let e=t.current;if(!e)return;(e.width!==a.width||e.height!==a.height)&&(e.width=a.width,e.height=a.height,u({width:a.width,height:a.height})),e.getContext(`2d`)?.drawImage(a,0,0),o(`streaming`),c(null)}finally{a.close()}}catch(t){if(!e)return;o(`recovering`),c(t instanceof Error?t.message:`The hosted simulator preview disconnected.`)}finally{d=!1,p()&&m(n)}},g=()=>{s=document.visibilityState!==`hidden`,s?m(0):f()};document.addEventListener(`visibilitychange`,g);let _=t.current,v=_&&typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{l=e.some(e=>e.isIntersecting),l?m(0):f()}):null;return v?.observe(_),m(0),()=>{e=!1,f(),v?.disconnect(),document.removeEventListener(`visibilitychange`,g)}},[t,n,r,i]),{status:a,error:s,dimensions:l}}var cg=5e3;function lg(e,t){return e instanceof Error&&e.message.trim()?e.message:t}function ug(e){return e===`booted`?`Booted`:e===`booting`?`Booting`:e===`shutting-down`?`Shutting down`:`Shut down`}function dg(e,t){return t===`waiting-for-display`?`Waiting for the display…`:t===`connecting`?`Connecting the live screen…`:t===`booting`||e.state===`booting`?`Starting the simulator…`:`Connecting…`}function fg(e){let t=[];return e.metaKey&&t.push(`command`),e.shiftKey&&t.push(`shift`),e.altKey&&t.push(`option`),e.ctrlKey&&t.push(`control`),t}function pg(e){let t=(0,Y.c)(15),n=e.availability;if(!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:[(0,X.jsx)(be,{className:`size-5 animate-spin text-muted-foreground`}),(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Checking simulator support…`})]}),t[0]=e):e=t[0],e}if(n.kind===`unsupported-platform`){let e,r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(br,{className:`size-7 text-muted-foreground`}),r=(0,X.jsx)(`p`,{className:`mt-4 text-sm font-medium`,children:`iOS Simulator needs a Mac`}),t[1]=e,t[2]=r):(e=t[1],r=t[2]);let i;return t[3]===n.platform?i=t[4]:(i=(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center p-8 text-center`,children:[e,r,(0,X.jsxs)(`p`,{className:`mt-1 max-w-sm text-xs leading-relaxed text-muted-foreground`,children:[`This environment runs on `,n.platform,`. Connect Ryco to a macOS environment with Xcode to use the simulator workspace.`]})]}),t[3]=n.platform,t[4]=i),i}if(n.kind===`helper-unavailable`){let e,r;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(br,{className:`size-7 text-amber-500`}),r=(0,X.jsx)(`p`,{className:`mt-4 text-sm font-medium`,children:`Simulator helper could not start`}),t[5]=e,t[6]=r):(e=t[5],r=t[6]);let i;return t[7]===n.message?i=t[8]:(i=(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center p-8 text-center`,children:[e,r,(0,X.jsx)(`p`,{className:`mt-1 max-w-sm text-xs leading-relaxed text-muted-foreground`,children:n.message})]}),t[7]=n.message,t[8]=i),i}if(n.kind!==`setup-required`||n.steps.filter(gg).every(hg))return null;let r,i;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(`p`,{className:`text-sm font-medium`,children:`Set up the iOS Simulator`}),i=(0,X.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Ryco checks these steps automatically every few seconds.`}),t[9]=r,t[10]=i):(r=t[9],i=t[10]);let a;t[11]===n.steps?a=t[12]:(a=n.steps.map(mg),t[11]=n.steps,t[12]=a);let o;return t[13]===a?o=t[14]:(o=(0,X.jsx)(`div`,{className:`flex flex-1 flex-col items-center justify-center p-8`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-md`,children:[r,i,(0,X.jsx)(`div`,{className:`mt-5 space-y-2`,children:a})]})}),t[13]=a,t[14]=o),o}function mg(e){return(0,X.jsxs)(`div`,{className:`flex gap-3 rounded-md border border-border/60 p-3`,children:[(0,X.jsx)(`span`,{className:q(`mt-0.5 size-2 shrink-0 rounded-full`,e.done?`bg-emerald-500`:`bg-amber-500`)}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-xs font-medium`,children:e.label}),e.detail?(0,X.jsx)(`p`,{className:`mt-1 break-words font-mono text-[10px] text-muted-foreground`,children:e.detail}):null]})]},e.id)}function hg(e){return e.id===`build-device-helper`}function gg(e){return!e.done}function _g(e){let{environmentId:t,threadId:n}=e,i=(0,J.useRef)(null),a=(0,J.useMemo)(()=>t&&n?o(r(t,n)):null,[t,n]),s=O(e=>t?e.environmentById[t]:void 0),c=O(e=>a?e.threadByKey[a]:void 0),[l,u]=(0,J.useState)(!1),[d,f]=(0,J.useState)(null),[p,m]=(0,J.useState)({kind:`idle`}),[h,g]=(0,J.useState)(null),_=t?C(t)?.device:void 0,v=t?S(t)?.client.device:void 0,y=s?.generation??0,b=O(e=>e.applyThreadSnapshot),x=O(e=>e.applyInventory),w=(0,J.useCallback)(async()=>{if(!t||!n||!_)return;let[e,r]=await Promise.all([_.list({includeShutdown:!0}),_.getThreadState({threadId:n})]);x(t,y,e.devices,e.availability),b(t,y,r)},[_,x,b,t,y,n]),T=s?.availability?.kind===`setup-required`||s?.availability?.kind===`helper-unavailable`;(0,J.useEffect)(()=>{if(w().catch(()=>void 0),!T)return;let e=setInterval(()=>void w().catch(()=>void 0),cg);return()=>clearInterval(e)},[T,w]);let E=s?.devices??c?.devices??[],D=E.find(e=>e.udid===c?.attachedDeviceUdid)??E.find(e=>e.udid===d)??null;(0,J.useEffect)(()=>{d&&c?.attachedDeviceUdid===d&&f(null)},[d,c?.attachedDeviceUdid]);let k=(0,J.useCallback)(async(e,t)=>{u(!0);try{await e()}catch(e){De.add({type:`error`,title:t,description:lg(e,`The simulator did not respond.`)})}finally{u(!1)}},[]),A=(0,J.useCallback)(e=>{!_||!n||(f(e.udid),k(async()=>{if(e.state===`shutdown`){let t=await _.boot({udid:e.udid});if(t.kind===`boot-limit-reached`){f(null),g({requested:e,candidates:t.rycoBooted,limit:t.limit});return}}b(t,y,await _.attach({threadId:n,udid:e.udid}))},`Could not open that simulator`))},[_,b,t,y,k,n]),j=(0,J.useCallback)(e=>{if(!h||!_||!n||!t)return;let r=h;g(null),f(r.requested.udid),k(async()=>{await _.shutdown({udid:e.udid});let i=await _.boot({udid:r.requested.udid});if(i.kind===`boot-limit-reached`){f(null),g({...r,candidates:i.rycoBooted,limit:i.limit});return}b(t,y,await _.attach({threadId:n,udid:r.requested.udid}))},`Could not free a simulator slot`)},[_,b,h,t,y,k,n]),M=eg({canvasRef:i,udid:D?.state===`booted`?D.udid:null,...v?.openFrameSource?{openFrameSource:v.openFrameSource}:{}}),ee=sg({canvasRef:i,udid:D?.state===`booted`?D.udid:null,enabled:!v?.openFrameSource,screenshot:_?e=>_.screenshot(e):null}),N=v?.openFrameSource?M.status:ee.status,te=v?.openFrameSource?M.error:ee.error,P=v?.openFrameSource?M.dimensions:ee.dimensions,ne=(0,J.useRef)(null),re=(0,J.useCallback)(e=>{let t=i.current;if(!t||!P)return null;let n=t.getBoundingClientRect(),r=D?.geometry?.scale??(P.width>1400?2:3);return Zh({frameWidth:P.width,frameHeight:P.height,displayWidth:n.width,displayHeight:n.height,pointWidth:D?.geometry?.pointWidth??P.width/r,pointHeight:D?.geometry?.pointHeight??P.height/r},e.clientX-n.left,e.clientY-n.top)},[D?.geometry,P]),ie=(0,J.useCallback)(e=>{e.currentTarget.focus(),e.currentTarget.setPointerCapture(e.pointerId),ne.current={point:re(e),at:performance.now()}},[re]),ae=(0,J.useCallback)(e=>{let t=ne.current;if(ne.current=null,!t||!D||!_)return;let n=re(e);!t.point||!n||(Math.hypot(n.x-t.point.x,n.y-t.point.y)<=8?_.tap({udid:D.udid,x:n.x,y:n.y}):_.swipe({udid:D.udid,fromX:t.point.x,fromY:t.point.y,toX:n.x,toY:n.y,durationMs:Math.max(16,Math.round(performance.now()-t.at))})).catch(e=>De.add({type:`error`,title:`Simulator input failed`,description:lg(e,`The input could not be delivered.`)}))},[_,D,re]),oe=(0,J.useCallback)((e,t)=>{if(!D||!_||e.metaKey||e.ctrlKey)return;let n=Qh(e.key);n!==null&&(e.preventDefault(),_.keyEvent({udid:D.udid,keyCode:n,modifiers:fg(e),direction:t}).catch(()=>void 0))},[_,D]),se=(0,J.useCallback)(e=>{!D||!_||k(()=>_.pressButton({udid:D.udid,button:e}),`Simulator button failed`)},[_,D,k]),F=(0,J.useCallback)(()=>{!D||!_||k(async()=>{let e=await _.screenshot({udid:D.udid,save:!0});De.add({type:`success`,title:`Screenshot saved`,description:e.path??e.name})},`Could not save the screenshot`)},[_,D,k]),ce=(0,J.useCallback)(()=>{if(!(!D||!_||p.kind===`starting`||p.kind===`stopping`)){if(p.kind===`idle`){m({kind:`starting`}),_.startRecording({udid:D.udid}).then(e=>m({kind:`recording`,path:e.path}),e=>{m({kind:`idle`}),De.add({type:`error`,title:`Could not start recording`,description:lg(e,`Recording failed.`)})});return}m({kind:`stopping`}),_.stopRecording({udid:D.udid}).then(e=>{m({kind:`idle`}),De.add({type:`success`,title:`Recording saved`,description:e.path})},e=>{m({kind:`idle`}),De.add({type:`error`,title:`Could not stop recording`,description:lg(e,`The recording may be incomplete.`)})})}},[_,D,p]);if(!t||!n||!_)return(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center p-8 text-center`,children:[(0,X.jsx)(br,{className:`size-7 text-muted-foreground`}),(0,X.jsx)(`p`,{className:`mt-4 text-sm font-medium`,children:`Simulator unavailable`}),(0,X.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`This thread has no device connection.`})]});let le=(0,X.jsx)(pg,{availability:s?.availability??null});if(!s?.availability||s.availability.kind===`unsupported-platform`||s.availability.kind===`helper-unavailable`||s.availability.kind===`setup-required`&&s.availability.steps.some(e=>!e.done&&e.id!==`build-device-helper`))return le;let ue=s.availability?.kind===`degraded`?s.availability.capabilities.filter(e=>!e.ok):[];return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-background`,children:[(0,X.jsxs)(`div`,{className:`flex min-h-11 shrink-0 items-center gap-2 border-b border-border/60 px-3`,children:[(0,X.jsx)(xn,{className:`size-4 text-muted-foreground`}),(0,X.jsxs)(`select`,{"aria-label":`Choose an iOS Simulator`,className:`min-w-0 max-w-72 flex-1 bg-transparent text-xs font-medium outline-none`,disabled:l,value:D?.udid??``,onChange:e=>{let t=E.find(t=>t.udid===e.target.value);t&&A(t)},children:[(0,X.jsx)(`option`,{value:``,disabled:!0,children:`Choose a simulator`}),E.toSorted((e,t)=>Number(t.state===`booted`)-Number(e.state===`booted`)||e.name.localeCompare(t.name)).map(e=>(0,X.jsxs)(`option`,{value:e.udid,disabled:e.state===`booting`||e.state===`shutting-down`,children:[e.name,` — `,e.runtime,` · `,ug(e.state)]},e.udid))]}),c?.agentActive?(0,X.jsx)(`span`,{className:`rounded-full bg-sky-500/15 px-2 py-0.5 text-[10px] font-medium text-sky-500`,children:`Agent controlling`}):null,(0,X.jsx)(Un,{size:`icon-xs`,variant:`ghost`,"aria-label":`Refresh simulators`,onClick:()=>void w(),children:(0,X.jsx)(vn,{className:`size-3.5`})})]}),ue.length>0?(0,X.jsxs)(`div`,{className:`border-b border-amber-500/20 bg-amber-500/8 px-3 py-1.5 text-[10px] text-amber-700 dark:text-amber-300`,children:[`Limited by this Xcode: `,ue.map(e=>e.id).join(`, `),`.`]}):null,(0,X.jsx)(`div`,{className:`relative flex min-h-0 flex-1 items-center justify-center overflow-hidden bg-muted/25 p-4 sm:p-6`,children:D?(0,X.jsxs)(`div`,{className:q(`relative flex max-h-full max-w-full overflow-hidden border-[7px] border-zinc-900 bg-black shadow-xl`,D.family===`tablet`||D.name.toLowerCase().includes(`ipad`)?`aspect-[4/3] w-[min(88%,52rem)] rounded-[1.8rem]`:`aspect-[9/19.5] h-full max-h-[min(100%,58rem)] rounded-[2.4rem]`),children:[(0,X.jsx)(`canvas`,{ref:i,tabIndex:0,"aria-label":`${D.name} screen`,className:`h-full w-full touch-none object-contain outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sky-400`,onPointerDown:ie,onPointerUp:ae,onPointerCancel:()=>{ne.current=null},onKeyDown:e=>oe(e,`down`),onKeyUp:e=>oe(e,`up`)}),N===`streaming`?null:(0,X.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 flex flex-col items-center justify-center bg-black/75 p-6 text-center text-white`,children:[(0,X.jsx)(be,{className:`size-5 animate-spin text-white/60`}),(0,X.jsx)(`p`,{className:`mt-3 text-xs font-medium`,children:N===`unsupported`?`This browser does not support WebCodecs.`:N===`recovering`?`Reconnecting the live screen…`:dg(D,c?.attachPhase)}),te?(0,X.jsx)(`p`,{className:`mt-2 max-w-52 text-[10px] text-white/60`,children:te}):null]})]}):(0,X.jsxs)(`div`,{className:`max-w-xs text-center`,children:[(0,X.jsx)(xn,{className:`mx-auto size-8 text-muted-foreground/60`}),(0,X.jsx)(`p`,{className:`mt-4 text-sm font-medium`,children:`Choose a simulator`}),(0,X.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:`Boot a device or attach one that is already running. Its screen will stay beside your conversation.`})]})}),(0,X.jsxs)(`div`,{className:`flex min-h-12 shrink-0 items-center justify-center gap-0.5 border-t border-border/60 bg-card/40 px-2`,children:[(0,X.jsx)(vg,{icon:gr,label:`Home`,disabled:!D||l,onClick:()=>se(`home`)}),(0,X.jsx)(vg,{icon:tn,label:`Lock`,disabled:!D||l,onClick:()=>se(`lock`)}),(0,X.jsx)(vg,{icon:Dr,label:`Volume down`,disabled:!D||l,onClick:()=>se(`volume-down`)}),(0,X.jsx)(vg,{icon:Or,label:`Volume up`,disabled:!D||l,onClick:()=>se(`volume-up`)}),(0,X.jsx)(`span`,{className:`mx-1 h-5 w-px bg-border`}),(0,X.jsx)(vg,{icon:dr,label:`Screenshot`,disabled:!D||l,onClick:F}),(0,X.jsx)(vg,{icon:p.kind===`recording`||p.kind===`stopping`?fr:mr,label:p.kind===`recording`?`Stop recording`:`Record screen`,active:p.kind!==`idle`,disabled:!D||p.kind===`starting`||p.kind===`stopping`,onClick:ce}),(0,X.jsx)(`span`,{className:`mx-1 h-5 w-px bg-border`}),(0,X.jsx)(vg,{icon:En,label:`Detach`,disabled:!D||l,onClick:()=>void k(async()=>b(t,y,await _.detach({threadId:n})),`Could not detach the simulator`)}),(0,X.jsx)(vg,{icon:wr,label:`Shut down`,disabled:!D||l,onClick:()=>{D&&k(()=>_.shutdown({udid:D.udid}),`Could not shut down the simulator`)}})]}),h?(0,X.jsx)(`div`,{className:`absolute inset-0 z-20 flex items-center justify-center bg-background/75 p-6 backdrop-blur-sm`,children:(0,X.jsxs)(`div`,{className:`w-full max-w-sm rounded-xl border border-border bg-card p-5 shadow-xl`,children:[(0,X.jsx)(`p`,{className:`text-sm font-semibold`,children:`Simulator boot limit reached`}),(0,X.jsxs)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:[`Ryco keeps at most `,h.limit,` simulators it booted running. Shut down one to open `,h.requested.name,`.`]}),(0,X.jsx)(`div`,{className:`mt-4 space-y-2`,children:h.candidates.map(e=>(0,X.jsxs)(Un,{variant:`outline`,className:`w-full justify-between`,onClick:()=>j(e),children:[(0,X.jsxs)(`span`,{className:`truncate`,children:[`Shut down `,e.name]}),(0,X.jsx)(wr,{className:`size-3.5`})]},e.udid))}),(0,X.jsx)(Un,{variant:`ghost`,className:`mt-3 w-full`,onClick:()=>g(null),children:`Cancel`})]})}):null]})}function vg(e){let t=(0,Y.c)(11),n=e.icon,r=e.label,i=e.label,a=e.active,o=e.disabled,s=e.active&&`text-red-500`,c;t[0]===s?c=t[1]:(c=q(s),t[0]=s,t[1]=c);let l;t[2]===n?l=t[3]:(l=(0,X.jsx)(n,{className:`size-4`}),t[2]=n,t[3]=l);let u;return t[4]!==e.active||t[5]!==e.disabled||t[6]!==e.label||t[7]!==e.onClick||t[8]!==c||t[9]!==l?(u=(0,X.jsx)(Un,{size:`icon-sm`,variant:`ghost`,title:r,"aria-label":i,"aria-pressed":a,disabled:o,className:c,onClick:e.onClick,children:l}),t[4]=e.active,t[5]=e.disabled,t[6]=e.label,t[7]=e.onClick,t[8]=c,t[9]=l,t[10]=u):u=t[10],u}function yg(e){return e===`running`?`in_progress`:e===`failed`?`review`:e===`finished`?`done`:`idle`}function bg(e){return e===`running`?`Working`:e===`failed`?`Needs review`:e===`finished`?`Finished`:e===`interrupted`?`Stopped`:`Idle`}function xg(e){return encodeURIComponent(e??`none`).replace(/%/g,`_`)}function Sg(e){return`thread-workspace-tab-${xg(e)}`}function Cg(e){return`thread-workspace-panel-${xg(e)}`}function wg(e){let t=(0,Y.c)(17),n=e.active?`text-foreground`:`text-muted-foreground`,r;t[0]===n?r=t[1]:(r=q(`size-3.5 shrink-0`,n),t[0]=n,t[1]=r);let i=r;if(e.tab.mode===`agent`){let n=e.tab.avatarKey??e.tab.agentKey,r=!e.active&&`opacity-70`,i;t[2]===r?i=t[3]:(i=q(`size-3.5 shrink-0`,r),t[2]=r,t[3]=i);let a;return t[4]!==n||t[5]!==i?(a=(0,X.jsx)(kt,{name:n,className:i}),t[4]=n,t[5]=i,t[6]=a):a=t[6],a}if(e.tab.key===`review`){let e;return t[7]===i?e=t[8]:(e=(0,X.jsx)(hr,{className:i}),t[7]=i,t[8]=e),e}if(e.tab.key===`terminal`){let e;return t[9]===i?e=t[10]:(e=(0,X.jsx)(wn,{className:i}),t[9]=i,t[10]=e),e}if(e.tab.key===`simulator`){let e;return t[11]===i?e=t[12]:(e=(0,X.jsx)(xn,{className:i}),t[11]=i,t[12]=e),e}if(e.tab.key===`agents`){let e;return t[13]===i?e=t[14]:(e=(0,X.jsx)(ve,{className:i}),t[13]=i,t[14]=e),e}let a;return t[15]===i?a=t[16]:(a=(0,X.jsx)(Oe,{className:i}),t[15]=i,t[16]=a),a}function Tg(e){let t=(0,Y.c)(8),n;if(t[0]!==e.agent.status){let r=yg(e.agent.status);n=Yn(r,`truncate`),t[0]=e.agent.status,t[1]=n}else n=t[1];let r;t[2]===e.agent.name?r=t[3]:(r=Jn(e.agent.name,{durationSeconds:2.2}),t[2]=e.agent.name,t[3]=r);let i;return t[4]!==e.agent.name||t[5]!==n||t[6]!==r?(i=(0,X.jsx)(`span`,{className:n,style:r,children:e.agent.name}),t[4]=e.agent.name,t[5]=n,t[6]=r,t[7]=i):i=t[7],i}function Eg(e){let t=(0,Y.c)(45);if(!e.subagent){let n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(`div`,{className:`mx-auto flex size-10 items-center justify-center rounded-md border border-border/70 bg-card/60 text-muted-foreground`,children:(0,X.jsx)(yr,{className:`size-4`})}),r=(0,X.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:`Subagent unavailable`}),i=(0,X.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:`This tab points to a subagent that is no longer present in the current thread activity.`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;t[3]===e.agentKey?a=t[4]:(a=e.agentKey?(0,X.jsx)(`p`,{className:`mt-2 truncate font-mono text-[11px] text-muted-foreground/60`,children:e.agentKey}):null,t[3]=e.agentKey,t[4]=a);let o;return t[5]===a?o=t[6]:(o=(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-6 text-center`,children:(0,X.jsxs)(`div`,{className:`max-w-72`,children:[n,r,i,a]})}),t[5]=a,t[6]=o),o}let n=e.subagent.avatarKey??e.subagent.key,r;t[7]===n?r=t[8]:(r=(0,X.jsx)(kt,{name:n,className:`size-4`}),t[7]=n,t[8]=r);let i;t[9]===e.subagent?i=t[10]:(i=(0,X.jsx)(`p`,{className:`min-w-0 flex-1 text-sm font-medium`,children:(0,X.jsx)(Tg,{agent:e.subagent})}),t[9]=e.subagent,t[10]=i);let a;t[11]===e.subagent.role?a=t[12]:(a=e.subagent.role?(0,X.jsx)(`span`,{className:`max-w-36 shrink-0 truncate rounded-sm border border-border/60 bg-background/40 px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:e.subagent.role}):null,t[11]=e.subagent.role,t[12]=a);let o;t[13]===e.subagent.status?o=t[14]:(o=bg(e.subagent.status),t[13]=e.subagent.status,t[14]=o);let s;t[15]===o?s=t[16]:(s=(0,X.jsx)(`span`,{className:`shrink-0 rounded-md border border-border/70 px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:o}),t[15]=o,t[16]=s);let c;t[17]!==r||t[18]!==i||t[19]!==a||t[20]!==s?(c=(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[r,i,a,s]}),t[17]=r,t[18]=i,t[19]=a,t[20]=s,t[21]=c):c=t[21];let l;t[22]===e.subagent.detail?l=t[23]:(l=e.subagent.detail?(0,X.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:e.subagent.detail}):null,t[22]=e.subagent.detail,t[23]=l);let u;t[24]!==e.subagent.effort||t[25]!==e.subagent.model||t[26]!==e.subagent.providerThreadIds||t[27]!==e.subagent.tool?(u=e.subagent.model||e.subagent.tool||e.subagent.providerThreadIds.length>0?(0,X.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap items-center gap-1.5`,children:[e.subagent.model?(0,X.jsxs)(`span`,{className:`rounded-md border border-border/60 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:[e.subagent.model,e.subagent.effort?` · ${e.subagent.effort}`:``]}):null,e.subagent.tool?(0,X.jsx)(`span`,{className:`rounded-md border border-border/60 px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:e.subagent.tool}):null,e.subagent.providerThreadIds.slice(0,2).map(Og)]}):null,t[24]=e.subagent.effort,t[25]=e.subagent.model,t[26]=e.subagent.providerThreadIds,t[27]=e.subagent.tool,t[28]=u):u=t[28];let d;t[29]!==c||t[30]!==l||t[31]!==u?(d=(0,X.jsxs)(`div`,{className:`border-b border-border/60 px-4 py-3`,children:[c,l,u]}),t[29]=c,t[30]=l,t[31]=u,t[32]=d):d=t[32];let f;t[33]===e.subagent.messages?f=t[34]:(f=e.subagent.messages.length>0?e.subagent.messages.map(Dg):null,t[33]=e.subagent.messages,t[34]=f);let p;t[35]!==e.subagent.entries||t[36]!==e.subagent.messages.length||t[37]!==e.subagent.status?(p=e.subagent.entries.length>0?e.subagent.entries.map(t=>(0,X.jsxs)(`div`,{className:`rounded-md border border-border/60 bg-card/40 p-3`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`span`,{className:q(`size-2 shrink-0 rounded-full`,t.tone===`error`?`bg-destructive`:e.subagent?.status===`running`?`bg-sky-400`:e.subagent?.status===`interrupted`?`bg-muted-foreground/60`:`bg-emerald-400`)}),(0,X.jsx)(`p`,{className:`min-w-0 truncate text-xs font-medium text-foreground`,children:t.toolTitle??t.label})]}),t.detail?(0,X.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:t.detail}):null,t.output&&t.output!==t.detail?(0,X.jsx)(`div`,{className:`mt-3 rounded-md border border-border/50 bg-background/60 p-2`,children:(0,X.jsx)(Dt,{text:t.output,cwd:void 0,isStreaming:!1})}):null]},t.id)):e.subagent.messages.length===0?(0,X.jsxs)(`div`,{className:`flex min-h-48 flex-col items-center justify-center rounded-md border border-dashed border-border/70 bg-card/20 p-6 text-center`,children:[(0,X.jsx)(yr,{className:`size-5 text-muted-foreground/60`}),(0,X.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:`No transcript captured yet`}),(0,X.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:`The subagent is visible from lifecycle events. Detailed messages will appear here when the provider exposes them.`})]}):null,t[35]=e.subagent.entries,t[36]=e.subagent.messages.length,t[37]=e.subagent.status,t[38]=p):p=t[38];let m;t[39]!==f||t[40]!==p?(m=(0,X.jsx)(Hn,{className:`min-h-0 flex-1`,children:(0,X.jsxs)(`div`,{className:`space-y-3 p-4`,children:[f,p]})}),t[39]=f,t[40]=p,t[41]=m):m=t[41];let h;return t[42]!==m||t[43]!==d?(h=(0,X.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[d,m]}),t[42]=m,t[43]=d,t[44]=h):h=t[44],h}function Dg(e){return(0,X.jsxs)(`div`,{className:`rounded-md border border-border/60 bg-card/40 p-3`,children:[(0,X.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center justify-between gap-2`,children:[(0,X.jsx)(`p`,{className:`truncate text-xs font-medium text-foreground`,children:`Subagent`}),e.providerThreadId?(0,X.jsx)(`span`,{className:`truncate font-mono text-[10px] text-muted-foreground/55`,children:e.providerThreadId}):null]}),(0,X.jsx)(Dt,{text:e.text,cwd:void 0,isStreaming:!1})]},e.id)}function Og(e){return(0,X.jsx)(`span`,{className:`max-w-40 truncate rounded-md border border-border/60 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground/70`,children:e},e)}function kg(e){let t=(0,Y.c)(8),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(`div`,{className:`mx-auto flex size-10 items-center justify-center rounded-md border border-border/70 bg-card/60 text-muted-foreground`,children:(0,X.jsx)(wn,{className:`size-4`})}),t[0]=n):n=t[0];let r;t[1]===e.title?r=t[2]:(r=(0,X.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:e.title}),t[1]=e.title,t[2]=r);let i;t[3]===e.description?i=t[4]:(i=(0,X.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:e.description}),t[3]=e.description,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-6 text-center`,children:(0,X.jsxs)(`div`,{className:`max-w-72`,children:[n,r,i]})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ag(){let e=(0,Y.c)(89),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={strict:!1},e[0]=t):t=e[0];let n=re(t),a;e[1]===n?a=e[2]:(a=ie(n),e[1]=n,e[2]=a);let s=a,c;e[3]===n.draftId?c=e[4]:(c=n.draftId?ee.make(n.draftId):null,e[3]=n.draftId,e[4]=c);let u=c,p;e[5]===u?p=e[6]:(p=e=>u?e.getDraftSession(u):null,e[5]=u,e[6]=p);let m=te(p),h;bb0:{if(s){h=s;break bb0}if(!m){h=null;break bb0}let t;e[7]!==m.environmentId||e[8]!==m.threadId?(t=r(m.environmentId,m.threadId),e[7]=m.environmentId,e[8]=m.threadId,e[9]=t):t=e[9],h=t}let g=h,y;e[10]===g?y=e[11]:(y=f(g),e[10]=g,e[11]=y);let b=d(y),x;e[12]===g?x=e[13]:(x=e=>g?e.getDraftThreadByRef(g):null,e[12]=g,e[13]=x);let S=te(x),w;e[14]!==S||e[15]!==b?(w=b?i(b.environmentId,b.projectId):S?i(S.environmentId,S.projectId):null,e[14]=S,e[15]=b,e[16]=w):w=e[16];let T=w,E;e[17]===T?E=e[18]:(E=l(T),e[17]=T,e[18]=E);let O=d(E),k;e[19]===g?k=e[20]:(k=e=>D(e.terminalStateByThreadKey,g),e[19]=g,e[20]=k);let A=_(k),j;e[21]===g?j=e[22]:(j=e=>g?e.terminalLaunchContextByThreadKey[o(g)]??null:null,e[21]=g,e[22]=j);let M=_(j),N=_(zg),P=_(Rg),ne=_(Lg),ae=_(Ig),oe=_(Fg),se=_(Pg),F=v(),ce=Wn(),[le,ue]=(0,J.useState)(0),de=b?.worktreePath??S?.worktreePath??null,I=M?.worktreePath??de;M?.cwd;let fe;e[23]!==I||e[24]!==O||e[25]!==M?.cwd?(fe=M?.cwd??(O?sn({project:{cwd:O.cwd},worktreePath:I}):null),e[23]=I,e[24]=O,e[25]=M?.cwd,e[26]=fe):fe=e[26];let L=fe,R;e[27]!==I||e[28]!==O?(R=O?qt({project:{cwd:O.cwd},worktreePath:I}):{},e[27]=I,e[28]=O,e[29]=R):R=e[29];let pe=R,z;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(z={context:{terminalFocus:!0,terminalOpen:!0}},e[30]=z):z=e[30];let me=z,he;e[31]===F?he=e[32]:(he=Rn(F,`terminal.split`,me),e[31]=F,e[32]=he);let ge=he,B;e[33]===F?B=e[34]:(B=Rn(F,`terminal.new`,me),e[33]=F,e[34]=B);let _e=B,ve;e[35]===F?ve=e[36]:(ve=Rn(F,`terminal.close`,me),e[35]=F,e[36]=ve);let ye=ve,be,xe;e[37]!==N||e[38]!==A.terminalOpen||e[39]!==g?(be=()=>{!g||!A.terminalOpen||N(g,!1)},xe=[N,A.terminalOpen,g],e[37]=N,e[38]=A.terminalOpen,e[39]=g,e[40]=be,e[41]=xe):(be=e[40],xe=e[41]),(0,J.useEffect)(be,xe);let Se;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Se=()=>{ue(Ng)},e[42]=Se):Se=e[42];let Ce=Se,we;e[43]!==N||e[44]!==ne||e[45]!==g?(we=()=>{g&&(ne(g,`terminal-${On()}`),N(g,!1),Ce())},e[43]=N,e[44]=ne,e[45]=g,e[46]=we):we=e[46];let Te=we,Ee;e[47]!==ae||e[48]!==N||e[49]!==g?(Ee=()=>{g&&(ae(g,`terminal-${On()}`),N(g,!1),Ce())},e[47]=ae,e[48]=N,e[49]=g,e[50]=Ee):Ee=e[50];let De=Ee,V;e[51]!==oe||e[52]!==g?(V=e=>{g&&(oe(g,e),Ce())},e[51]=oe,e[52]=g,e[53]=V):V=e[53];let Oe=V,ke;e[54]!==P||e[55]!==g?(ke=e=>{g&&P(g,e)},e[54]=P,e[55]=g,e[56]=ke):ke=e[56];let Ae=ke,H;e[57]!==se||e[58]!==N||e[59]!==A.terminalIds.length||e[60]!==g?(H=e=>{if(!g)return;let t=C(g.environmentId);if(!t)return;let n=A.terminalIds.length<=1,r=()=>t.terminal.write({threadId:g.threadId,terminalId:e,data:`exit
|
|
2009
2009
|
`}).catch(Mg);`close`in t.terminal&&typeof t.terminal.close==`function`?(async()=>{n&&await t.terminal.clear({threadId:g.threadId,terminalId:e}).catch(jg),await t.terminal.close({threadId:g.threadId,terminalId:e,deleteHistory:!0})})().catch(()=>r()):r(),se(g,e),N(g,!1),Ce()},e[57]=se,e[58]=N,e[59]=A.terminalIds.length,e[60]=g,e[61]=H):H=e[61];let U=H,je;e[62]===ce?je=e[63]:(je=e=>{ce?.current?.addTerminalContext(e)},e[62]=ce,e[63]=je);let Me=je;if(!g){let t;return e[64]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(kg,{title:`Terminal unavailable`,description:`No active thread is available for this workspace terminal.`}),e[64]=t):t=e[64],t}if(!O||!L){let t;return e[65]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(kg,{title:`Terminal unavailable`,description:`This thread does not have a resolved project directory.`}),e[65]=t):t=e[65],t}let Ne=g.threadId,Pe=ge??void 0,Fe=_e??void 0,Ie=ye??void 0,Le;return e[66]!==Oe||e[67]!==Me||e[68]!==U||e[69]!==De||e[70]!==L||e[71]!==I||e[72]!==le||e[73]!==F||e[74]!==pe||e[75]!==Ae||e[76]!==Te||e[77]!==Ne||e[78]!==Pe||e[79]!==Fe||e[80]!==Ie||e[81]!==A.activeTerminalGroupId||e[82]!==A.activeTerminalId||e[83]!==A.runningTerminalIds||e[84]!==A.terminalGroups||e[85]!==A.terminalHeight||e[86]!==A.terminalIds||e[87]!==g?(Le=(0,X.jsx)(Sn,{threadRef:g,threadId:Ne,cwd:L,worktreePath:I,runtimeEnv:pe,layout:`panel`,visible:!0,height:A.terminalHeight,terminalIds:A.terminalIds,runningTerminalIds:A.runningTerminalIds,activeTerminalId:A.activeTerminalId,terminalGroups:A.terminalGroups,activeTerminalGroupId:A.activeTerminalGroupId,focusRequestId:le,onSplitTerminal:Te,onNewTerminal:De,splitShortcutLabel:Pe,newShortcutLabel:Fe,closeShortcutLabel:Ie,keybindings:F,onActiveTerminalChange:Oe,onCloseTerminal:U,onHeightChange:Ae,onAddTerminalContext:Me}),e[66]=Oe,e[67]=Me,e[68]=U,e[69]=De,e[70]=L,e[71]=I,e[72]=le,e[73]=F,e[74]=pe,e[75]=Ae,e[76]=Te,e[77]=Ne,e[78]=Pe,e[79]=Fe,e[80]=Ie,e[81]=A.activeTerminalGroupId,e[82]=A.activeTerminalId,e[83]=A.runningTerminalIds,e[84]=A.terminalGroups,e[85]=A.terminalHeight,e[86]=A.terminalIds,e[87]=g,e[88]=Le):Le=e[88],Le}function jg(){}function Mg(){}function Ng(e){return e+1}function Pg(e){return e.closeTerminal}function Fg(e){return e.setActiveTerminal}function Ig(e){return e.newTerminal}function Lg(e){return e.splitTerminal}function Rg(e){return e.setTerminalHeight}function zg(e){return e.setTerminalOpen}function Bg(e){let t=(0,Y.c)(38),n=e.icon,r=e.disabled,i=e.onClick,a=e.compact?`min-h-0 px-1 py-1 @sm/workspace-launcher:px-4 @sm/workspace-launcher:py-3`:`min-h-32 px-5 py-6`,o=e.disabled?`cursor-not-allowed opacity-45`:`hover:border-border hover:bg-card/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,s;t[0]!==a||t[1]!==o?(s=q(`group flex w-full flex-col items-center justify-center rounded-lg border border-border/50 bg-card/35 text-center transition-colors`,a,o),t[0]=a,t[1]=o,t[2]=s):s=t[2];let c=e.compact?`size-4 @sm/workspace-launcher:size-6`:`size-6`,l=!e.disabled&&`group-hover:text-foreground`,u;t[3]!==c||t[4]!==l?(u=q(`text-muted-foreground transition-colors`,c,l),t[3]=c,t[4]=l,t[5]=u):u=t[5];let d;t[6]!==n||t[7]!==u?(d=(0,X.jsx)(n,{className:u}),t[6]=n,t[7]=u,t[8]=d):d=t[8];let f=e.badgeCount??0,p;t[9]===f?p=t[10]:(p=(0,X.jsx)(ot,{count:f,className:`-top-2 -right-3 h-4 min-w-4 px-1 text-[9px]`}),t[9]=f,t[10]=p);let m;t[11]!==p||t[12]!==d?(m=(0,X.jsxs)(`span`,{className:`relative inline-flex`,children:[d,p]}),t[11]=p,t[12]=d,t[13]=m):m=t[13];let h;t[14]===e.badgeCount?h=t[15]:(h=(e.badgeCount??0)>0?(0,X.jsx)(`span`,{className:`sr-only`,children:je(e.badgeCount??0)}):null,t[14]=e.badgeCount,t[15]=h);let g=e.compact?`mt-1 text-xs @sm/workspace-launcher:mt-3 @sm/workspace-launcher:text-base`:`mt-4 text-base`,_;t[16]===g?_=t[17]:(_=q(`font-semibold text-foreground`,g),t[16]=g,t[17]=_);let v;t[18]!==e.label||t[19]!==_?(v=(0,X.jsx)(`span`,{className:_,children:e.label}),t[18]=e.label,t[19]=_,t[20]=v):v=t[20];let y=e.compact?`mt-0.5 hidden text-xs @sm/workspace-launcher:block`:`mt-1 text-sm`,b;t[21]===y?b=t[22]:(b=q(`text-muted-foreground`,y),t[21]=y,t[22]=b);let x;t[23]!==e.description||t[24]!==b?(x=(0,X.jsx)(`span`,{className:b,children:e.description}),t[23]=e.description,t[24]=b,t[25]=x):x=t[25];let S;t[26]!==e.compact||t[27]!==e.shortcutLabel?(S=e.shortcutLabel?(0,X.jsx)(`span`,{className:q(`rounded-md bg-muted px-1.5 py-0.5 font-medium text-[11px] text-muted-foreground`,e.compact?`mt-2 hidden @sm/workspace-launcher:inline-flex`:`mt-3`),children:e.shortcutLabel}):null,t[26]=e.compact,t[27]=e.shortcutLabel,t[28]=S):S=t[28];let C;return t[29]!==e.disabled||t[30]!==e.onClick||t[31]!==m||t[32]!==h||t[33]!==v||t[34]!==x||t[35]!==S||t[36]!==s?(C=(0,X.jsxs)(`button`,{type:`button`,disabled:r,onClick:i,"data-slot":`workspace-launcher-card`,className:s,children:[m,h,v,x,S]}),t[29]=e.disabled,t[30]=e.onClick,t[31]=m,t[32]=h,t[33]=v,t[34]=x,t[35]=S,t[36]=s,t[37]=C):C=t[37],C}function Vg(e){let t=(0,Y.c)(60),n=v(),r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={key:`files`,label:`Files`,mode:`files`},t[0]=r):r=t[0];let i=r,a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a={key:`review`,label:`Review`,mode:`review`},t[1]=a):a=t[1];let o=a,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s={key:`terminal`,label:`Terminal`,mode:`terminal`},t[2]=s):s=t[2];let c=s,l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l={key:`simulator`,label:`Simulator`,mode:`simulator`},t[3]=l):l=t[3];let u=l,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d={key:`agents`,label:`Agents`,mode:`agents`},t[4]=d):d=t[4];let f=d,p;t[5]===n?p=t[6]:(p=Rn(n,`workspace.files`),t[5]=n,t[6]=p);let m=p,h;t[7]===n?h=t[8]:(h=Rn(n,`workspace.review`),t[7]=n,t[8]=h);let g=h,_;t[9]===n?_=t[10]:(_=Rn(n,`workspace.terminal`),t[9]=n,t[10]=_);let y=_,b;t[11]===n?b=t[12]:(b=Rn(n,`workspace.simulator`),t[11]=n,t[12]=b);let x=b,S,C;if(t[13]!==m||t[14]!==e||t[15]!==g||t[16]!==x||t[17]!==y){let n=e.tabs.filter(Hg),r=!e.isPhoneSurface,a;t[20]===e?a=t[21]:(a=()=>e.onSelectTab(i),t[20]=e,t[21]=a);let s;t[22]!==r||t[23]!==m||t[24]!==a?(s=(0,X.jsx)(Bg,{label:`Files`,description:`Browse project files`,icon:H,shortcutLabel:m,compact:r,onClick:a}),t[22]=r,t[23]=m,t[24]=a,t[25]=s):s=t[25];let l,d;t[26]===r?(l=t[27],d=t[28]):(l=(0,X.jsx)(Bg,{label:`Side chat`,description:`Start a side conversation`,icon:vr,compact:r,disabled:!0}),d=(0,X.jsx)(Bg,{label:`Browser`,description:`Open a website`,icon:It,compact:r,disabled:!0}),t[26]=r,t[27]=l,t[28]=d);let p;t[29]===e?p=t[30]:(p=()=>e.onSelectTab(o),t[29]=e,t[30]=p);let h;t[31]!==r||t[32]!==g||t[33]!==p?(h=(0,X.jsx)(Bg,{label:`Review`,description:`View code changes`,icon:hr,shortcutLabel:g,compact:r,onClick:p}),t[31]=r,t[32]=g,t[33]=p,t[34]=h):h=t[34];let _;t[35]===e?_=t[36]:(_=()=>e.onSelectTab(c),t[35]=e,t[36]=_);let v;t[37]!==r||t[38]!==_||t[39]!==y?(v=(0,X.jsx)(Bg,{label:`Terminal`,description:`Start an interactive shell`,icon:wn,shortcutLabel:y,compact:r,onClick:_}),t[37]=r,t[38]=_,t[39]=y,t[40]=v):v=t[40];let b;t[41]!==r||t[42]!==e||t[43]!==x?(b=e.showSimulator?(0,X.jsx)(Bg,{label:`Simulator`,description:`Run and control an iOS app`,icon:xn,shortcutLabel:x,compact:r,onClick:()=>e.onSelectTab(u)}):null,t[41]=r,t[42]=e,t[43]=x,t[44]=b):b=t[44];let w;t[45]!==r||t[46]!==e?(w=e.showAgents?(0,X.jsx)(Bg,{label:`Agents`,description:`Watch subagents and workflows run`,icon:ve,badgeCount:e.liveAgentCount,compact:r,onClick:()=>e.onSelectTab(f)}):null,t[45]=r,t[46]=e,t[47]=w):w=t[47];let T;t[48]!==s||t[49]!==l||t[50]!==d||t[51]!==h||t[52]!==v||t[53]!==b||t[54]!==w?(T=(0,X.jsxs)(X.Fragment,{children:[s,l,d,h,v,b,w]}),t[48]=s,t[49]=l,t[50]=d,t[51]=h,t[52]=v,t[53]=b,t[54]=w,t[55]=T):T=t[55],S=T,C=n.length>0?(0,X.jsx)(`div`,{className:`mx-auto w-full max-w-lg space-y-2 pt-1`,children:n.map(t=>(0,X.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 items-center gap-3 rounded-lg border border-border/50 bg-card/35 px-4 py-3 text-left transition-colors hover:border-border hover:bg-card/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>e.onSelectTab(t),children:[(0,X.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg border border-border/50 bg-background/50 text-muted-foreground`,children:(0,X.jsx)(kt,{name:t.avatarKey??t.agentKey,className:`size-5`})}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`span`,{className:q(`block truncate text-sm font-medium`,Yn(yg(t.status))),style:Jn(t.label,{durationSeconds:2.2}),children:t.label}),(0,X.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:bg(t.status)})]})]},t.key))}):null,t[13]=m,t[14]=e,t[15]=g,t[16]=x,t[17]=y,t[18]=S,t[19]=C}else S=t[18],C=t[19];let w=C,T;return t[56]!==w||t[57]!==S||t[58]!==e.isPhoneSurface?(T=(0,X.jsx)(Hn,{className:`h-full`,children:e.isPhoneSurface?(0,X.jsx)(`div`,{className:`flex min-h-full p-5 sm:p-6`,children:(0,X.jsxs)(`div`,{className:`m-auto w-full max-w-lg space-y-4`,children:[S,w]})}):(0,X.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3 p-4 sm:p-5`,"data-slot":`workspace-launcher`,children:[(0,X.jsx)(`div`,{className:`@container/workspace-launcher flex min-h-0 flex-1 items-center justify-center`,children:(0,X.jsx)(`div`,{className:`grid aspect-square grid-cols-3 grid-rows-3 gap-2 @sm/workspace-launcher:gap-3`,"data-slot":`workspace-launcher-grid`,style:{inlineSize:`min(100cqw, 100cqh, 32rem)`},children:S})}),w]})}),t[56]=w,t[57]=S,t[58]=e.isPhoneSurface,t[59]=T):T=t[59],T}function Hg(e){return e.mode===`agent`}function Ug(e){let t=(0,Y.c)(125),{onClosePanelTab:n,onToggleMaximized:i}=e,o=e.maximized??!1,s=e.mode===`phone`,c=ge(),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={strict:!1},t[0]=l):l=t[0];let u=re(l),p;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(p={strict:!1,select:Qg},t[1]=p):p=t[1];let m=oe(p),h;t[2]===u?h=t[3]:(h=ie(u),t[2]=u,t[3]=h);let g=h,_;t[4]===u.draftId?_=t[5]:(_=u.draftId?ee.make(u.draftId):null,t[4]=u.draftId,t[5]=_);let v=_,y;t[6]===v?y=t[7]:(y=e=>v?e.getDraftSession(v):null,t[6]=v,t[7]=y);let b=te(y),x;t[8]!==g||t[9]!==b?(x=g??(b?r(b.environmentId,b.threadId):null),t[8]=g,t[9]=b,t[10]=x):x=t[10];let S=x,w;t[11]===S?w=t[12]:(w=f(S),t[11]=S,t[12]=w);let T=d(w),E;t[13]===T?.session?E=t[14]:(E=An(T?.session??null)!==`disconnected`&&T?.session?.orchestrationStatus!==`stopped`&&T?.session?.orchestrationStatus!==`interrupted`&&T?.session?.orchestrationStatus!==`error`,t[13]=T?.session,t[14]=E);let D=E;T?.activities,T?.latestTurn?.state;let O;t[15]!==T?.activities||t[16]!==T?.latestTurn?.state||t[17]!==D?(O=Pn(T?.activities??[],{sessionLive:D,parentTurnState:T?.latestTurn?.state??null}),t[15]=T?.activities,t[16]=T?.latestTurn?.state,t[17]=D,t[18]=O):O=t[18];let k=O,A=m.workspaceTab===`agent`&&m.workspaceAgentKey?m.workspaceAgentKey:null,j;t[19]!==A||t[20]!==k?(j=Nn(k,A),t[19]=A,t[20]=k,t[21]=j):j=t[21];let M=j,N;t[22]!==e.panelMode||t[23]!==m?(N=me(m)??e.panelMode,t[22]=e.panelMode,t[23]=m,t[24]=N):N=t[24];let P=N;T?.activities;let ae;t[25]!==T?.activities||t[26]!==D||t[27]!==k?(ae=Mn({activities:T?.activities??[],transcriptSubagents:k,sessionLive:D}),t[25]=T?.activities,t[26]=D,t[27]=k,t[28]=ae):ae=t[28];let se=ae,F;bb0:{if(P===`files`||P===`review`||P===`terminal`||P===`simulator`||P===`agents`){let n;t[29]!==P||t[30]!==e.openedPanelModes?(n=e.openedPanelModes.includes(P)?e.openedPanelModes:[...e.openedPanelModes,P],t[29]=P,t[30]=e.openedPanelModes,t[31]=n):n=t[31],F=n;break bb0}F=e.openedPanelModes}let ce=F,le;if(t[32]!==A||t[33]!==s||t[34]!==ce||t[35]!==e.openedAgentKeys||t[36]!==k){let n=fi({subagents:k,activeAgentKey:A,openedAgentKeys:e.openedAgentKeys,openedPanelModes:ce});le=s?n.filter(Zg):n,t[32]=A,t[33]=s,t[34]=ce,t[35]=e.openedAgentKeys,t[36]=k,t[37]=le}else le=t[37];let I=le,fe=P===`agent`?A:s&&P===`agents`?null:P,L;t[38]!==c||t[39]!==u.draftId||t[40]!==g?(L=e=>{if(u.draftId){c({to:`/draft/$draftId`,params:{draftId:ee.make(u.draftId)},replace:!0,search:e});return}g&&c({to:`/$environmentId/$threadId`,params:ne(g),replace:!0,search:e})},t[38]=c,t[39]=u.draftId,t[40]=g,t[41]=L):L=t[41];let R=L,pe;t[42]===R?pe=t[43]:(pe=e=>{if(e.mode===`review`){R(Xg);return}if(e.mode===`files`){R(Yg);return}if(e.mode===`terminal`){R(Jg);return}if(e.mode===`simulator`){R(qg);return}if(e.mode===`agents`){R(Kg);return}e.mode===`agent`&&R(t=>de(t,e.agentKey))},t[42]=R,t[43]=pe);let z=pe,he;t[44]===R?he=t[45]:(he=()=>{R(Gg)},t[44]=R,t[45]=he);let B=he,ve;t[46]===R?ve=t[47]:(ve=e=>{let t=e.startsWith(`subagent:`)?e:`subagent:${e}`;R(e=>de(e,t))},t[46]=R,t[47]=ve);let ye=ve,be;t[48]===n?be=t[49]:(be=e=>{n({mode:e.mode,...e.mode===`agent`?{agentKey:e.agentKey}:{}})},t[48]=n,t[49]=be);let xe=be,Se;t[50]!==z||t[51]!==I?(Se=(e,t)=>{let n=I.findIndex(t=>t.key===e.key);if(n<0)return;let r=e=>{let t=I[(e+I.length)%I.length];t&&z(t)};switch(t.key){case`ArrowRight`:case`ArrowDown`:t.preventDefault(),r(n+1);return;case`ArrowLeft`:case`ArrowUp`:t.preventDefault(),r(n-1);return;case`Home`:t.preventDefault(),r(0);return;case`End`:t.preventDefault(),r(I.length-1);return}},t[50]=z,t[51]=I,t[52]=Se):Se=t[52];let Ce=Se,we;t[53]===R?we=t[54]:(we=()=>{R(Wg)},t[53]=R,t[54]=we);let Te=we,Ee=s?`h-14`:`h-12`,De=!s&&`transition-[padding-left] duration-200 ease-linear motion-reduce:transition-none`,V=e.reserveChromeInset&&ue,Oe=o&&a&&`drag-region wco:pr-[calc(100vw-env(titlebar-area-width)-env(titlebar-area-x)+1em)]`,ke;t[55]!==Ee||t[56]!==De||t[57]!==V||t[58]!==Oe?(ke=q(`flex shrink-0 items-center gap-1 border-b border-border bg-card/40 px-2`,Ee,De,V,Oe),t[55]=Ee,t[56]=De,t[57]=V,t[58]=Oe,t[59]=ke):ke=t[59];let Ae;t[60]!==Te||t[61]!==s?(Ae=s?(0,X.jsx)(Un,{size:`icon`,variant:`ghost`,"aria-label":`Back to thread`,className:`shrink-0`,onClick:Te,children:(0,X.jsx)(_e,{})}):null,t[60]=Te,t[61]=s,t[62]=Ae):Ae=t[62];let H;if(t[63]!==fe||t[64]!==xe||t[65]!==s||t[66]!==Ce||t[67]!==z||t[68]!==I){let e;t[70]!==fe||t[71]!==xe||t[72]!==s||t[73]!==Ce||t[74]!==z?(e=e=>{let t=fe===e.key;return(0,X.jsxs)(`div`,{className:q(`flex min-w-0 shrink-0 items-center rounded-md text-sm transition-colors`,s?`h-11`:`h-8`,t?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/60 hover:text-foreground`),children:[(0,X.jsxs)(`button`,{type:`button`,id:Sg(e.key),role:`tab`,"aria-selected":t,"aria-controls":Cg(e.key),tabIndex:t?0:-1,className:q(`flex h-full min-w-0 items-center gap-1.5`,s?`pl-3 pr-1.5`:`pl-2.5 pr-1`),onClick:()=>z(e),onKeyDown:t=>Ce(e,t),children:[(0,X.jsx)(wg,{tab:e,active:t}),(0,X.jsx)(`span`,{className:q(`max-w-32 truncate`,e.mode===`agent`&&Yn(yg(e.status))),style:e.mode===`agent`?Jn(e.label,{durationSeconds:2.2}):void 0,children:e.label})]}),(0,X.jsx)(`button`,{type:`button`,className:q(`mr-1 flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-background/60 hover:text-foreground`,s&&`relative after:absolute after:top-1/2 after:left-1/2 after:size-11 after:-translate-x-1/2 after:-translate-y-1/2`),"aria-label":`Close ${e.label} tab`,onClick:()=>xe(e),children:(0,X.jsx)(Dn,{className:`size-3`})})]},e.key)},t[70]=fe,t[71]=xe,t[72]=s,t[73]=Ce,t[74]=z,t[75]=e):e=t[75],H=I.map(e),t[63]=fe,t[64]=xe,t[65]=s,t[66]=Ce,t[67]=z,t[68]=I,t[69]=H}else H=t[69];let U=s?`size-11`:`size-6`,je=!P&&`bg-muted text-foreground`,Me;t[76]!==U||t[77]!==je?(Me=q(`flex shrink-0 items-center justify-center rounded-md text-muted-foreground/70 transition-colors hover:bg-muted/60 hover:text-foreground`,U,je),t[76]=U,t[77]=je,t[78]=Me):Me=t[78];let Ne=!P,Pe;t[79]!==B||t[80]!==Me||t[81]!==Ne?(Pe=(0,X.jsx)(`button`,{type:`button`,className:Me,"aria-label":`Workspace launcher`,"aria-pressed":Ne,onClick:B}),t[79]=B,t[80]=Me,t[81]=Ne,t[82]=Pe):Pe=t[82];let Fe;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,X.jsx)(_n,{className:`size-3.5`}),t[83]=Fe):Fe=t[83];let Ie;t[84]===Pe?Ie=t[85]:(Ie=(0,X.jsx)(zn,{render:Pe,children:Fe}),t[84]=Pe,t[85]=Ie);let Le;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,X.jsx)(Bn,{side:`bottom`,children:`Workspace launcher`}),t[86]=Le):Le=t[86];let Re;t[87]===Ie?Re=t[88]:(Re=(0,X.jsxs)(Vn,{children:[Ie,Le]}),t[87]=Ie,t[88]=Re);let ze;t[89]!==H||t[90]!==Re?(ze=(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 overflow-x-auto`,role:`tablist`,"aria-label":`Workspace tabs`,children:[H,Re]}),t[89]=H,t[90]=Re,t[91]=ze):ze=t[91];let W;t[92]!==Te||t[93]!==s||t[94]!==o||t[95]!==i?(W=s?null:(0,X.jsxs)(X.Fragment,{children:[i?(0,X.jsxs)(Vn,{children:[(0,X.jsx)(zn,{render:(0,X.jsx)(Un,{size:`icon-xs`,variant:`ghost`,className:`shrink-0 text-muted-foreground/70 hover:text-foreground`,onClick:i,"aria-pressed":o,"aria-label":o?`Restore workspace panel`:`Maximize workspace panel`,children:o?(0,X.jsx)(gn,{className:`size-3.5`}):(0,X.jsx)(_r,{className:`size-3.5`})})}),(0,X.jsx)(Bn,{side:`bottom`,children:o?`Restore workspace panel`:`Maximize workspace panel`})]}):null,(0,X.jsx)(Un,{size:`icon-xs`,variant:`ghost`,className:`shrink-0 text-muted-foreground/70 hover:text-foreground`,onClick:Te,"aria-label":`Close workspace panel`,children:(0,X.jsx)(Dn,{className:`size-3.5`})})]}),t[92]=Te,t[93]=s,t[94]=o,t[95]=i,t[96]=W):W=t[96];let Be;t[97]!==ke||t[98]!==Ae||t[99]!==ze||t[100]!==W?(Be=(0,X.jsxs)(`div`,{className:ke,children:[Ae,ze,W]}),t[97]=ke,t[98]=Ae,t[99]=ze,t[100]=W,t[101]=Be):Be=t[101];let Ve;t[102]===fe?Ve=t[103]:(Ve=Cg(fe),t[102]=fe,t[103]=Ve);let He;t[104]===fe?He=t[105]:(He=fe?Sg(fe):void 0,t[104]=fe,t[105]=He);let Ue;t[106]!==M||t[107]!==P||t[108]!==T||t[109]!==A||t[110]!==se||t[111]!==s||t[112]!==ye||t[113]!==e.mode||t[114]!==z||t[115]!==I||t[116]!==S?(Ue=P===`review`?(0,X.jsx)(Iu,{mode:e.mode}):P===`files`?(0,X.jsx)(Kh,{mode:e.mode}):P===`terminal`?(0,X.jsx)(Ag,{}):P===`simulator`&&!s?(0,X.jsx)(_g,{environmentId:S?.environmentId??null,threadId:S?.threadId??null}):P===`agents`&&!s?(0,X.jsx)(li,{model:se,environmentId:S?.environmentId??null,threadId:S?S.threadId:null,onOpenAgent:ye}):P===`agent`?(0,X.jsx)(Eg,{subagent:M,agentKey:A}):(0,X.jsx)(Vg,{tabs:I,activeThread:T,onSelectTab:z,showAgents:!s,showSimulator:!s&&!!(S&&C(S.environmentId)?.device),isPhoneSurface:s,liveAgentCount:se.liveCount}),t[106]=M,t[107]=P,t[108]=T,t[109]=A,t[110]=se,t[111]=s,t[112]=ye,t[113]=e.mode,t[114]=z,t[115]=I,t[116]=S,t[117]=Ue):Ue=t[117];let We;t[118]!==Ve||t[119]!==He||t[120]!==Ue?(We=(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,id:Ve,role:`tabpanel`,"aria-labelledby":He,children:Ue}),t[118]=Ve,t[119]=He,t[120]=Ue,t[121]=We):We=t[121];let Ge;return t[122]!==Be||t[123]!==We?(Ge=(0,X.jsxs)(`div`,{className:`flex h-full min-w-0 flex-1 flex-col bg-background w-full`,children:[Be,We]}),t[122]=Be,t[123]=We,t[124]=Ge):Ge=t[124],Ge}function Wg(e){return{...ce(e),diff:void 0,diffTurnId:void 0,diffFilePath:void 0,preview:void 0,workspaceOpen:void 0,workspaceTab:void 0,workspaceAgentKey:void 0}}function Gg(e){return he(e)}function Kg(e){return se(e)}function qg(e){return F(e)}function Jg(e){return I(e)}function Yg(e){return L(e)}function Xg(e){return z(e)}function Zg(e){return e.mode!==`agents`&&e.mode!==`simulator`}function Qg(e){return pe(e)}export{Eg as AgentThreadPanel,Ug as default};
|
package/dist/client/assets/{ToolbarRootContext-k-_m5nCN.js → ToolbarRootContext-B1g8IP6k.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{Mn as n,jn as r}from"./usePopupViewport-
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{Mn as n,jn as r}from"./usePopupViewport-8F-J1h5f.js";import{d as i}from"./useRenderElement-DchFnsR8.js";import{t as a}from"./useScrollLock-CBz-5_MX.js";var o=e(t(),1),s=20;function c(e,t,i,c){let[l,u]=o.useState(!1);n(()=>{if(!e||!t||i==null){u(!1);return}let n=r(i).documentElement.clientWidth,a=i.offsetWidth;u(n>0&&a>0&&a>=n-s)},[e,t,i]),a(e&&(!t||l),c)}var l=o.createContext(void 0);function u(e){let t=o.useContext(l);if(t===void 0&&!e)throw Error(i(69));return t}export{c as n,u as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{_ as r,g as i,v as a,y as o}from"./env-Bf33qXdb.js";import{Ea as s,Jc as c,Qc as l,Zc as u,gi as d,mi as f,ni as p,wa as m,zi as h}from"./src-Ca7Gag3m.js";import{Jt as g,L as _,Rn as v,Sn as y,Ut as b,Vt as x,bt as S,f as C,h as w,hn as T,vt as E}from"./runtime-DYzjhL5M.js";import{t as D}from"./useDebouncedValue-jDDWNjgt.js";import{It as O,_t as k,i as A,vt as j}from"./composerDraftStore-DC2r8dcu.js";import{c as M,u as N}from"./useSwipeDismiss-BZsYSBgq.js";import{B as P,D as F,M as I,N as L,S as ee,V as te,z as R}from"./useHandleNewThread-820pBJCC.js";import{A as z,C as ne,D as re,E as ie,F as ae,I as oe,J as se,K as ce,M as le,N as ue,O as de,P as fe,R as pe,S as me,T as he,V as ge,W as _e,X as ve,_ as ye,b as be,c as xe,h as Se,j as Ce,k as we,l as Te,v as Ee,w as De,x as Oe,y as ke,z as Ae}from"./ThreadStatusIndicators-D-ioX09X.js";import{i as je}from"./uiStateStore-BW2WnK4k.js";import{f as Me}from"./useRenderElement-DchFnsR8.js";import{n as Ne,t as Pe}from"./arrow-up-CTcWIlqV.js";import{t as Fe}from"./arrow-left-Dtj9PfsA.js";import{t as Ie}from"./loader-circle-CrtHFAvM.js";import{t as Le}from"./chevron-right-BWYGybX9.js";import{t as Re}from"./circle-alert-BWvs6IOn.js";import{i as ze,o as Be}from"./toast-Cw7bXJzg.js";import{n as Ve,t as He}from"./external-link-fbvzDWM7.js";import{t as Ue}from"./clock-3-r12DkpRj.js";import{t as We}from"./eye-CUSPj-gd.js";import{C as Ge,S as Ke,_ as qe,a as Je,b as Ye,c as Xe,d as Ze,f as Qe,g as $e,h as et,i as tt,l as nt,m as rt,o as it,p as at,r as ot,s as st,t as ct,u as lt,y as ut}from"./lib-BXIqHSZx.js";import{t as dt}from"./git-branch-BKr-Ij4u.js";import{t as ft}from"./git-pull-request-DIYyPsg5.js";import{t as pt}from"./messages-square-DiMgWzoq.js";import{t as mt}from"./pencil-B69ERoVM.js";import{t as ht}from"./plus-B2h-VEqh.js";import{t as gt}from"./search-BGQsenCM.js";import{t as _t}from"./sparkles-CAf3oJ5S.js";import{t as vt}from"./triangle-alert-RL_T3KLo.js";import{t as yt}from"./shallow-DWZCFNun.js";import{i as bt,n as xt,t as B}from"./utils-B76_2Yk7.js";import{i as St,n as Ct,t as wt}from"./tooltip-t3Nrleyq.js";import{t as Tt}from"./input-Dl4N9ZfE.js";import{r as Et}from"./Icons-DZpTOLIb.js";import{t as V}from"./button-Wf_1nfeu.js";import{t as Dt}from"./useCopyToClipboard-BTpWxumf.js";import{t as Ot}from"./toastHelpers-CSQRKo4F.js";import{t as kt}from"./threadPinning-BIV4KXZU.js";import{t as At}from"./skeleton-Mgh4Gx9x.js";import{a as jt,c as Mt,i as Nt,o as Pt,r as Ft,s as It,t as Lt}from"./dialog-CUxw5AxI.js";import{c as Rt,i as zt,p as Bt,s as Vt}from"./menu-BuDpxm_Q.js";import{t as Ht}from"./spinner-CzzUdFeE.js";import{t as Ut}from"./textarea-C8QxddDb.js";import{a as Wt,i as Gt,n as Kt,o as qt,r as Jt,s as Yt,t as Xt}from"./alert-dialog-Gym8_p4Q.js";import{a as Zt,i as Qt,o as $t,s as en,t as tn}from"./select-Djwp8HDm.js";import{n as nn,r as rn,t as an}from"./popover-DuprDUaB.js";import{a as on,c as sn,d as cn,f as ln,g as un,h as dn,l as fn,m as pn,o as mn,p as hn,r as gn,s as _n,t as vn,u as yn}from"./useAtlassian-a-MaAd0k.js";import{t as bn}from"./badge-BQI7J3Sg.js";import{t as xn}from"./label-x5DgpBI_.js";var Sn=Me(`chevrons-down`,[[`path`,{d:`m7 6 5 5 5-5`,key:`1lc07p`}],[`path`,{d:`m7 13 5 5 5-5`,key:`1d48rs`}]]),Cn=Me(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),wn=Me(`circle-pause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),Tn=Me(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),En=Me(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Dn=Me(`face-slightly-smiling`,[[`path`,{d:`M15 10V9`,key:`4dkmfx`}],[`path`,{d:`M16.472 15a6 6 0 01-8.943 0`,key:`7qomzy`}],[`path`,{d:`M9 10V9`,key:`1lazqi`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),On=Me(`flag`,[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]),kn=Me(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),An=Me(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),jn=Me(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),Mn=Me(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Nn=Me(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Pn=Me(`party-popper`,[[`path`,{d:`M5.8 11.3 2 22l10.7-3.79`,key:`gwxi1d`}],[`path`,{d:`M4 3h.01`,key:`1vcuye`}],[`path`,{d:`M22 8h.01`,key:`1mrtc2`}],[`path`,{d:`M15 2h.01`,key:`1cjtqr`}],[`path`,{d:`M22 20h.01`,key:`1mrys2`}],[`path`,{d:`m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10`,key:`hbicv8`}],[`path`,{d:`m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17`,key:`1i94pl`}],[`path`,{d:`m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7`,key:`1cofks`}],[`path`,{d:`M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z`,key:`4kbmks`}]]),Fn=Me(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),In=Me(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),Ln=Me(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Rn=Me(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),zn=Me(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Bn=Me(`skip-forward`,[[`path`,{d:`M21 4v16`,key:`7j8fe9`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`zs4d6`}]]),Vn=Me(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),Hn=Me(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),Un=Me(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Wn=Me(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),H=e(t(),1),U=n();function Gn(e){if(!(`detail`in e)||typeof e.detail!=`string`)return null;let t=e.detail.trim();return t.length>0?t:null}function Kn(e,t){if(e instanceof Error){let t=e.message.trim();if(t.length>0)return t;let n=Gn(e);if(n)return n}if(typeof e==`object`&&e){let t=Gn(e);if(t)return t}if(typeof e==`string`){let t=e.trim();if(t.length>0)return t}return t}var qn=`unknown`;function Jn(e){let t=e.trim();return t.length===0||t===qn?null:`https://github.com/${encodeURIComponent(t)}.png?size=80`}var Yn={OWNER:`Owner`,MEMBER:`Member`,COLLABORATOR:`Collaborator`,MEMBER_OF_REPOSITORY:`Maintainer`,MEMBER_OF_ORG:`Maintainer`,CONTRIBUTOR:`Contributor`,FIRST_TIME_CONTRIBUTOR:`First-time contributor`,FIRST_TIMER:`First-time contributor`};function Xn(e){return e===void 0||e.length===0?null:Yn[e]??null}function Zn(e){let t=e?.trim()??``;return t.length>0?t.toUpperCase():null}function Qn(e){return e===`OWNER`?`owner`:e===`MEMBER`||e===`COLLABORATOR`||e===`MEMBER_OF_REPOSITORY`||e===`MEMBER_OF_ORG`?`maintainer`:null}function $n(e,t=!1,n){if(t||e?.primary===`author`||e?.isOriginalAuthor===!0)return`author`;if(e?.primary===`owner`||e?.isRepositoryOwner===!0)return`owner`;if(e?.primary===`maintainer`||e?.isRepositoryMaintainer===!0)return`maintainer`;let r=Qn(Zn(n));return r===null?`participant`:r}function er(e){let t=[],n=Zn(e.association);if((e.isOriginalPost||e.role?.isOriginalAuthor===!0)&&t.push({label:`Author`,tone:`author`}),e.role?.isRepositoryOwner===!0&&t.push({label:`Owner`,tone:`owner`}),e.role?.isRepositoryMaintainer===!0&&t.push({label:`Maintainer`,tone:`maintainer`}),t.length>0){if(n!==null&&n!==`OWNER`&&n!==`MEMBER`&&n!==`COLLABORATOR`&&n!==`NONE`){let e=Xn(n);e!==null&&t.push({label:e,tone:`default`})}return t}let r=Xn(n??void 0);return r===null?[]:n===`OWNER`?[{label:r,tone:`owner`}]:Qn(n)===`maintainer`?[{label:`Maintainer`,tone:`maintainer`}]:[{label:r,tone:`default`}]}function tr(e){let t=e.author??`unknown`;return{author:t,role:se({commentAuthor:t,itemAuthor:e.author,repositoryOwner:ve(e.url)})}}function nr(e){let t=e.length===0?`@anon@`:e,n=0;for(let e=0;e<t.length;e+=1)n=n*31+t.charCodeAt(e)>>>0;return n%360}function rr(e){let t=e.trim();return t.length===0||t===qn?`unknown author`:`@${t}`}function ir(e){return`${s(e).toISOString().slice(0,16).replace(`T`,` `)} UTC`}function ar(e){let t=e.replace(/\r\n?/gu,`
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{_ as r,g as i,v as a,y as o}from"./env-Bcq9YR3B.js";import{Ea as s,Jc as c,Qc as l,Zc as u,gi as d,mi as f,ni as p,wa as m,zi as h}from"./src-DmPIm3ie.js";import{Jt as g,L as _,Rn as v,Sn as y,Ut as b,Vt as x,bt as S,f as C,h as w,hn as T,vt as E}from"./runtime-CPM0EUhb.js";import{t as D}from"./useDebouncedValue-s0BC8Yyp.js";import{It as O,_t as k,i as A,vt as j}from"./composerDraftStore-TYv9j3vY.js";import{c as M,u as N}from"./useSwipeDismiss-D22_vuiH.js";import{B as P,D as F,M as I,N as L,S as ee,V as te,z as R}from"./useHandleNewThread-Bw460iXT.js";import{A as z,C as ne,D as re,E as ie,F as ae,I as oe,J as se,K as ce,M as le,N as ue,O as de,P as fe,R as pe,S as me,T as he,V as ge,W as _e,X as ve,_ as ye,b as be,c as xe,h as Se,j as Ce,k as we,l as Te,v as Ee,w as De,x as Oe,y as ke,z as Ae}from"./ThreadStatusIndicators-CIOM98q2.js";import{i as je}from"./uiStateStore-DzUrk2GS.js";import{f as Me}from"./useRenderElement-DchFnsR8.js";import{n as Ne,t as Pe}from"./arrow-up-CTcWIlqV.js";import{t as Fe}from"./arrow-left-Dtj9PfsA.js";import{t as Ie}from"./loader-circle-CrtHFAvM.js";import{t as Le}from"./chevron-right-BWYGybX9.js";import{t as Re}from"./circle-alert-BWvs6IOn.js";import{i as ze,o as Be}from"./toast-C-0Ft2jD.js";import{n as Ve,t as He}from"./external-link-fbvzDWM7.js";import{t as Ue}from"./clock-3-r12DkpRj.js";import{t as We}from"./eye-CUSPj-gd.js";import{C as Ge,S as Ke,_ as qe,a as Je,b as Ye,c as Xe,d as Ze,f as Qe,g as $e,h as et,i as tt,l as nt,m as rt,o as it,p as at,r as ot,s as st,t as ct,u as lt,y as ut}from"./lib-DgOYoged.js";import{t as dt}from"./git-branch-BKr-Ij4u.js";import{t as ft}from"./git-pull-request-DIYyPsg5.js";import{t as pt}from"./messages-square-DiMgWzoq.js";import{t as mt}from"./pencil-B69ERoVM.js";import{t as ht}from"./plus-B2h-VEqh.js";import{t as gt}from"./search-BGQsenCM.js";import{t as _t}from"./sparkles-CAf3oJ5S.js";import{t as vt}from"./triangle-alert-RL_T3KLo.js";import{t as yt}from"./shallow-DWZCFNun.js";import{i as bt,n as xt,t as B}from"./utils-CV2fJJxC.js";import{i as St,n as Ct,t as wt}from"./tooltip-C_-9XEfA.js";import{t as Tt}from"./input-BZz4eLRl.js";import{r as Et}from"./Icons-BEtED8P8.js";import{t as V}from"./button-DG8WqjNn.js";import{t as Dt}from"./useCopyToClipboard-BTpWxumf.js";import{t as Ot}from"./toastHelpers-CSQRKo4F.js";import{t as kt}from"./threadPinning-BLqwZebi.js";import{t as At}from"./skeleton-DOgQaVXv.js";import{a as jt,c as Mt,i as Nt,o as Pt,r as Ft,s as It,t as Lt}from"./dialog-BNmFD6Nh.js";import{c as Rt,i as zt,p as Bt,s as Vt}from"./menu-B6UEFcn0.js";import{t as Ht}from"./spinner-ClQu8SdC.js";import{t as Ut}from"./textarea-DHdmRD1r.js";import{a as Wt,i as Gt,n as Kt,o as qt,r as Jt,s as Yt,t as Xt}from"./alert-dialog-9Jyh0e8u.js";import{a as Zt,i as Qt,o as $t,s as en,t as tn}from"./select-CZukJlTn.js";import{n as nn,r as rn,t as an}from"./popover-BuYzXGwl.js";import{a as on,c as sn,d as cn,f as ln,g as un,h as dn,l as fn,m as pn,o as mn,p as hn,r as gn,s as _n,t as vn,u as yn}from"./useAtlassian-CoHKzu-e.js";import{t as bn}from"./badge-w43sx8eF.js";import{t as xn}from"./label-DZf4lbNF.js";var Sn=Me(`chevrons-down`,[[`path`,{d:`m7 6 5 5 5-5`,key:`1lc07p`}],[`path`,{d:`m7 13 5 5 5-5`,key:`1d48rs`}]]),Cn=Me(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),wn=Me(`circle-pause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),Tn=Me(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),En=Me(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Dn=Me(`face-slightly-smiling`,[[`path`,{d:`M15 10V9`,key:`4dkmfx`}],[`path`,{d:`M16.472 15a6 6 0 01-8.943 0`,key:`7qomzy`}],[`path`,{d:`M9 10V9`,key:`1lazqi`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),On=Me(`flag`,[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]),kn=Me(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),An=Me(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),jn=Me(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),Mn=Me(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Nn=Me(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Pn=Me(`party-popper`,[[`path`,{d:`M5.8 11.3 2 22l10.7-3.79`,key:`gwxi1d`}],[`path`,{d:`M4 3h.01`,key:`1vcuye`}],[`path`,{d:`M22 8h.01`,key:`1mrtc2`}],[`path`,{d:`M15 2h.01`,key:`1cjtqr`}],[`path`,{d:`M22 20h.01`,key:`1mrys2`}],[`path`,{d:`m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10`,key:`hbicv8`}],[`path`,{d:`m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17`,key:`1i94pl`}],[`path`,{d:`m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7`,key:`1cofks`}],[`path`,{d:`M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z`,key:`4kbmks`}]]),Fn=Me(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),In=Me(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),Ln=Me(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Rn=Me(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),zn=Me(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Bn=Me(`skip-forward`,[[`path`,{d:`M21 4v16`,key:`7j8fe9`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`zs4d6`}]]),Vn=Me(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),Hn=Me(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),Un=Me(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Wn=Me(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),H=e(t(),1),U=n();function Gn(e){if(!(`detail`in e)||typeof e.detail!=`string`)return null;let t=e.detail.trim();return t.length>0?t:null}function Kn(e,t){if(e instanceof Error){let t=e.message.trim();if(t.length>0)return t;let n=Gn(e);if(n)return n}if(typeof e==`object`&&e){let t=Gn(e);if(t)return t}if(typeof e==`string`){let t=e.trim();if(t.length>0)return t}return t}var qn=`unknown`;function Jn(e){let t=e.trim();return t.length===0||t===qn?null:`https://github.com/${encodeURIComponent(t)}.png?size=80`}var Yn={OWNER:`Owner`,MEMBER:`Member`,COLLABORATOR:`Collaborator`,MEMBER_OF_REPOSITORY:`Maintainer`,MEMBER_OF_ORG:`Maintainer`,CONTRIBUTOR:`Contributor`,FIRST_TIME_CONTRIBUTOR:`First-time contributor`,FIRST_TIMER:`First-time contributor`};function Xn(e){return e===void 0||e.length===0?null:Yn[e]??null}function Zn(e){let t=e?.trim()??``;return t.length>0?t.toUpperCase():null}function Qn(e){return e===`OWNER`?`owner`:e===`MEMBER`||e===`COLLABORATOR`||e===`MEMBER_OF_REPOSITORY`||e===`MEMBER_OF_ORG`?`maintainer`:null}function $n(e,t=!1,n){if(t||e?.primary===`author`||e?.isOriginalAuthor===!0)return`author`;if(e?.primary===`owner`||e?.isRepositoryOwner===!0)return`owner`;if(e?.primary===`maintainer`||e?.isRepositoryMaintainer===!0)return`maintainer`;let r=Qn(Zn(n));return r===null?`participant`:r}function er(e){let t=[],n=Zn(e.association);if((e.isOriginalPost||e.role?.isOriginalAuthor===!0)&&t.push({label:`Author`,tone:`author`}),e.role?.isRepositoryOwner===!0&&t.push({label:`Owner`,tone:`owner`}),e.role?.isRepositoryMaintainer===!0&&t.push({label:`Maintainer`,tone:`maintainer`}),t.length>0){if(n!==null&&n!==`OWNER`&&n!==`MEMBER`&&n!==`COLLABORATOR`&&n!==`NONE`){let e=Xn(n);e!==null&&t.push({label:e,tone:`default`})}return t}let r=Xn(n??void 0);return r===null?[]:n===`OWNER`?[{label:r,tone:`owner`}]:Qn(n)===`maintainer`?[{label:`Maintainer`,tone:`maintainer`}]:[{label:r,tone:`default`}]}function tr(e){let t=e.author??`unknown`;return{author:t,role:se({commentAuthor:t,itemAuthor:e.author,repositoryOwner:ve(e.url)})}}function nr(e){let t=e.length===0?`@anon@`:e,n=0;for(let e=0;e<t.length;e+=1)n=n*31+t.charCodeAt(e)>>>0;return n%360}function rr(e){let t=e.trim();return t.length===0||t===qn?`unknown author`:`@${t}`}function ir(e){return`${s(e).toISOString().slice(0,16).replace(`T`,` `)} UTC`}function ar(e){let t=e.replace(/\r\n?/gu,`
|
|
2
2
|
`).replace(/\n+$/u,``);return t.trim().length===0?[`> _No comment body._`]:t.split(`
|
|
3
3
|
`).map(e=>e.length>0?`> ${e}`:`>`)}function or(e){let t=e.contextLabel?.trim(),n=t?` in ${t}`:``;return[`> ${rr(e.author)} wrote${n} on ${ir(e.createdAt)}:`,`>`,...ar(e.body)].join(`
|
|
4
4
|
`)}function sr(e,t){let n=t.trimEnd();return n.length===0?e:`${e}${e.length===0||e.endsWith(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{It as t}from"./composerDraftStore-
|
|
1
|
+
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{It as t}from"./composerDraftStore-TYv9j3vY.js";import{t as n,u as r}from"./utils-CV2fJJxC.js";var i=e(),a=t(),o=r(`relative grid w-full items-start gap-x-2 gap-y-0.5 rounded-xl border px-3.5 py-3 text-card-foreground text-sm has-[>svg]:has-data-[slot=alert-action]:grid-cols-[calc(var(--spacing)*4)_1fr_auto] has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-data-[slot=alert-action]:grid-cols-[1fr_auto] has-[>svg]:gap-x-2 [&>svg]:h-lh [&>svg]:w-4`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-transparent dark:bg-input/32 [&>svg]:text-muted-foreground`,error:`border-destructive/32 bg-destructive/4 [&>svg]:text-destructive`,info:`border-info/32 bg-info/4 [&>svg]:text-info`,success:`border-success/32 bg-success/4 [&>svg]:text-success`,warning:`border-warning/32 bg-warning/4 [&>svg]:text-warning`}}});function s(e){let t=(0,i.c)(10),r,s,c;t[0]===e?(r=t[1],s=t[2],c=t[3]):({className:r,variant:c,...s}=e,t[0]=e,t[1]=r,t[2]=s,t[3]=c);let l;t[4]!==r||t[5]!==c?(l=n(o({variant:c}),r),t[4]=r,t[5]=c,t[6]=l):l=t[6];let u;return t[7]!==s||t[8]!==l?(u=(0,a.jsx)(`div`,{className:l,"data-slot":`alert`,role:`alert`,...s}),t[7]=s,t[8]=l,t[9]=u):u=t[9],u}function c(e){let t=(0,i.c)(8),r,o;t[0]===e?(r=t[1],o=t[2]):({className:r,...o}=e,t[0]=e,t[1]=r,t[2]=o);let s;t[3]===r?s=t[4]:(s=n(`font-medium [svg~&]:col-start-2`,r),t[3]=r,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,a.jsx)(`div`,{className:s,"data-slot":`alert-title`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function l(e){let t=(0,i.c)(8),r,o;t[0]===e?(r=t[1],o=t[2]):({className:r,...o}=e,t[0]=e,t[1]=r,t[2]=o);let s;t[3]===r?s=t[4]:(s=n(`flex flex-col gap-2.5 text-muted-foreground [svg~&]:col-start-2`,r),t[3]=r,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,a.jsx)(`div`,{className:s,"data-slot":`alert-description`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function u(e){let t=(0,i.c)(8),r,o;t[0]===e?(r=t[1],o=t[2]):({className:r,...o}=e,t[0]=e,t[1]=r,t[2]=o);let s;t[3]===r?s=t[4]:(s=n(`flex gap-1 max-sm:col-start-2 max-sm:mt-2 sm:row-start-1 sm:row-end-3 sm:self-center sm:[[data-slot=alert-description]~&]:col-start-2 sm:[[data-slot=alert-title]~&]:col-start-2 sm:[svg~&]:col-start-2 sm:[svg~[data-slot=alert-description]~&]:col-start-3 sm:[svg~[data-slot=alert-title]~&]:col-start-3`,r),t[3]=r,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,a.jsx)(`div`,{className:s,"data-slot":`alert-action`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}export{c as i,u as n,l as r,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{It as t}from"./composerDraftStore-
|
|
1
|
+
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{It as t}from"./composerDraftStore-TYv9j3vY.js";import{t as n}from"./utils-CV2fJJxC.js";import{i as r,n as i,t as a}from"./DialogViewport-tgJz2Lwn.js";import{n as o,t as s}from"./DialogPopup-a1M74u16.js";import{n as c,r as l,t as u}from"./DialogTitle-Bk-w3xLJ.js";import"./DialogHandle-Cl9dQBJp.js";function d(e){return i(`alert-dialog`,e)}var f=e(),p=t(),m=d,h=r;function g(e){let t=(0,f.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;t[3]===r?a=t[4]:(a=n(`fixed inset-0 z-50 transition-all duration-[240ms] data-ending-style:opacity-0 data-starting-style:opacity-0`,r),t[3]=r,t[4]=a);let s;return t[5]!==i||t[6]!==a?(s=(0,p.jsx)(o,{className:a,"data-slot":`alert-dialog-backdrop`,...i}),t[5]=i,t[6]=a,t[7]=s):s=t[7],s}function _(e){let t=(0,f.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let o;t[3]===r?o=t[4]:(o=n(`app-dialog-viewport-scrim pointer-events-auto fixed inset-0 z-50 grid grid-rows-[1fr_auto_3fr] justify-items-center p-4 pb-[calc(--spacing(4)+var(--app-keyboard-inset,0px))] backdrop-blur-[2px]`,r),t[3]=r,t[4]=o);let s;return t[5]!==i||t[6]!==o?(s=(0,p.jsx)(a,{className:o,"data-slot":`alert-dialog-viewport`,...i}),t[5]=i,t[6]=o,t[7]=s):s=t[7],s}function v(e){let t=(0,f.c)(20),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:r,onKeyDown:i,bottomStickOnMobile:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let c=o===void 0||o,l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,p.jsx)(g,{}),t[5]=l):l=t[5];let u=c&&`phone:grid-rows-[1fr_auto] phone:p-0 phone:pt-12 phone:pb-[var(--app-keyboard-inset,0px)]`,d;t[6]===u?d=t[7]:(d=n(u),t[6]=u,t[7]=d);let m=c&&`phone:max-w-none phone:rounded-none phone:border-x-0 phone:border-t phone:border-b-0 phone:opacity-[calc(1-min(var(--nested-dialogs),1))] phone:data-ending-style:translate-y-4 phone:data-starting-style:translate-y-4 phone:before:hidden phone:before:rounded-none`,v;t[8]!==r||t[9]!==m?(v=n(`app-surface pointer-events-auto -translate-y-[calc(1.25rem*var(--nested-dialogs))] relative row-start-2 flex max-h-full min-h-0 w-full min-w-0 max-w-lg scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border not-dark:bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg/5 transition-[scale,opacity,translate] duration-[240ms] ease-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:translate-y-2 data-starting-style:translate-y-3 data-ending-style:scale-97 data-starting-style:scale-96 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,m,r),t[8]=r,t[9]=m,t[10]=v):v=t[10];let y;t[11]===i?y=t[12]:(y=e=>{i?.(e),e.stopPropagation()},t[11]=i,t[12]=y);let b;t[13]!==a||t[14]!==v||t[15]!==y?(b=(0,p.jsx)(s,{className:v,"data-slot":`alert-dialog-popup`,onKeyDown:y,...a}),t[13]=a,t[14]=v,t[15]=y,t[16]=b):b=t[16];let x;return t[17]!==d||t[18]!==b?(x=(0,p.jsxs)(h,{children:[l,(0,p.jsx)(_,{className:d,children:b})]}),t[17]=d,t[18]=b,t[19]=x):x=t[19],x}function y(e){let t=(0,f.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;t[3]===r?a=t[4]:(a=n(`flex flex-col gap-2 p-6 text-center max-sm:pb-4 sm:text-left`,r),t[3]=r,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,p.jsx)(`div`,{className:a,"data-slot":`alert-dialog-header`,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function b(e){let t=(0,f.c)(11),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({className:r,variant:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let o=a===void 0?`default`:a,s=o==="default"&&`app-muted-surface border-t py-4`,c=o===`bare`&&`pb-6`,l;t[4]!==r||t[5]!==s||t[6]!==c?(l=n(`flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]`,s,c,r),t[4]=r,t[5]=s,t[6]=c,t[7]=l):l=t[7];let u;return t[8]!==i||t[9]!==l?(u=(0,p.jsx)(`div`,{className:l,"data-slot":`alert-dialog-footer`,...i}),t[8]=i,t[9]=l,t[10]=u):u=t[10],u}function x(e){let t=(0,f.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;t[3]===r?a=t[4]:(a=n(`font-heading font-semibold text-xl leading-none`,r),t[3]=r,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,p.jsx)(u,{className:a,"data-slot":`alert-dialog-title`,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function S(e){let t=(0,f.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;t[3]===r?a=t[4]:(a=n(`text-muted-foreground text-sm`,r),t[3]=r,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,p.jsx)(c,{className:a,"data-slot":`alert-dialog-description`,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function C(e){let t=(0,f.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(l,{"data-slot":`alert-dialog-close`,...e}),t[0]=e,t[1]=n),n}export{y as a,b as i,C as n,v as o,S as r,x as s,m as t};
|