ryco-cli 0.1.13 → 0.1.14

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.
Files changed (215) hide show
  1. package/dist/{AcpNativeLogging-Ba9Nn9Re.mjs → AcpNativeLogging-D3fe64a6.mjs} +1 -1
  2. package/dist/{AcpNativeLogging-Be1KGJfF.cjs → AcpNativeLogging-vLtnq5f1.cjs} +1 -1
  3. package/dist/{AzureDevOpsSourceControlProvider-CVj-F-pW.cjs → AzureDevOpsSourceControlProvider-BtezW57t.cjs} +2 -2
  4. package/dist/{AzureDevOpsSourceControlProvider-CGlK6M0b.mjs → AzureDevOpsSourceControlProvider-WNUDtsur.mjs} +2 -2
  5. package/dist/{BitbucketSourceControlProvider-CEZEd4PX.cjs → BitbucketSourceControlProvider-BWzNM0jW.cjs} +2 -2
  6. package/dist/{BitbucketSourceControlProvider-BV6iRDi7.mjs → BitbucketSourceControlProvider-tbbUFKz3.mjs} +2 -2
  7. package/dist/{ClaudeDriver-lBU7EyUX.cjs → ClaudeDriver-BTvdJvam.cjs} +170 -7
  8. package/dist/{ClaudeDriver-rooMNrJz.mjs → ClaudeDriver-CG5ngU5z.mjs} +171 -8
  9. package/dist/{CodexDriver-DBz2rPXb.mjs → CodexDriver-49o7TA-C.mjs} +4 -4
  10. package/dist/{CodexDriver-CZCIJSLV.cjs → CodexDriver-CFxwJNXx.cjs} +3 -3
  11. package/dist/{CodexTextGeneration-BeG7ymPC.mjs → CodexTextGeneration-C0t4xcPO.mjs} +2 -2
  12. package/dist/{CodexTextGeneration-BvIcyD1P.cjs → CodexTextGeneration-CedcXf9a.cjs} +1 -1
  13. package/dist/{CopilotDriver-CX5zhEdZ.cjs → CopilotDriver-B8J_ovCX.cjs} +20 -16
  14. package/dist/{CopilotDriver-D36vbGbn.mjs → CopilotDriver-Cu1B1skB.mjs} +21 -17
  15. package/dist/{CursorDriver-DWuuOSkJ.mjs → CursorDriver-P_A8uQki.mjs} +4 -4
  16. package/dist/{CursorDriver-CPBVeesr.cjs → CursorDriver-zlKHPy1_.cjs} +3 -3
  17. package/dist/{ForgejoSourceControlProvider-CeN7Snfr.mjs → ForgejoSourceControlProvider-DLhJZtq9.mjs} +2 -2
  18. package/dist/{ForgejoSourceControlProvider-CzmmcAZO.cjs → ForgejoSourceControlProvider-szJ-dvsD.cjs} +2 -2
  19. package/dist/{GitHubSourceControlProvider-DfFR9O2o.cjs → GitHubSourceControlProvider-3ofb6HsF.cjs} +2 -2
  20. package/dist/{GitHubSourceControlProvider-Dmz1LJct.mjs → GitHubSourceControlProvider-D5MQQPCJ.mjs} +2 -2
  21. package/dist/{GitLabSourceControlProvider-C21lwphV.mjs → GitLabSourceControlProvider-DLkxeob5.mjs} +2 -2
  22. package/dist/{GitLabSourceControlProvider-DGoelNmL.cjs → GitLabSourceControlProvider-DkupZH5G.cjs} +2 -2
  23. package/dist/{GrokDriver-CIXj_4ry.cjs → GrokDriver-CTUNclwp.cjs} +3 -3
  24. package/dist/{GrokDriver-qKX1a63G.mjs → GrokDriver-D8KoMY76.mjs} +4 -4
  25. package/dist/{OpenCodeDriver-CbdswhqU.mjs → OpenCodeDriver-B7htxutj.mjs} +92 -27
  26. package/dist/{OpenCodeDriver-DDEuwtXl.cjs → OpenCodeDriver-pXM8bSct.cjs} +91 -26
  27. package/dist/{SourceControlProviderDiscoveryCatalog-DJWDCoup.cjs → SourceControlProviderDiscoveryCatalog-Bj_sZfmB.cjs} +1 -1
  28. package/dist/{SourceControlProviderDiscoveryCatalog-4_4yahsa.mjs → SourceControlProviderDiscoveryCatalog-C6Fn7rZE.mjs} +1 -1
  29. package/dist/bin.cjs +1113 -312
  30. package/dist/bin.mjs +1115 -315
  31. package/dist/client/assets/{AccountSettings-Be5_48k0.js → AccountSettings-CinnQaX-.js} +1 -1
  32. package/dist/client/assets/{AiFocusSettings-DIpQXLW2.js → AiFocusSettings-UbXOywZg.js} +1 -1
  33. package/dist/client/assets/{AnimatedHeight-BIsV_Z3J.js → AnimatedHeight-DCad8EQ2.js} +1 -1
  34. package/dist/client/assets/AppearanceSettings-CTh8Z8nz.js +1 -0
  35. package/dist/client/assets/{BranchToolbar.logic-D7slG_zJ.js → BranchToolbar.logic-37EnknDD.js} +1 -1
  36. package/dist/client/assets/ChatRightPanel-DUwLYKbp.js +27 -0
  37. package/dist/client/assets/{ChatThreadRouteView-CocRstME.js → ChatThreadRouteView-C43W0PEz.js} +1 -1
  38. package/dist/client/assets/CommandPaletteDialog-IHOe0hOG.js +1 -0
  39. package/dist/client/assets/{CompositeItem-F3NGn6aG.js → CompositeItem-ClLCuzeJ.js} +1 -1
  40. package/dist/client/assets/{CompositeRoot-CmJGfRtc.js → CompositeRoot-Bdsr9eHn.js} +1 -1
  41. package/dist/client/assets/{ConnectionsSettings-CXabxSaH.js → ConnectionsSettings-tmBjGOPj.js} +2 -2
  42. package/dist/client/assets/{DiagnosticsSettings-CZ3vY43G.js → DiagnosticsSettings-CbCEgaau.js} +1 -1
  43. package/dist/client/assets/{DialogHandle-C4uSr9wX.js → DialogHandle-CitVLvYq.js} +1 -1
  44. package/dist/client/assets/{DialogPopup-Dck8r8Hn.js → DialogPopup-CfaEr9jv.js} +1 -1
  45. package/dist/client/assets/DialogRoot-CyEOjgGH.js +1 -0
  46. package/dist/client/assets/{DialogTitle-CCedPAjV.js → DialogTitle-BUkU0qXf.js} +1 -1
  47. package/dist/client/assets/{DialogTrigger-CYJ7_YcV.js → DialogTrigger-CEjWue7M.js} +1 -1
  48. package/dist/client/assets/{DialogViewport-D-CrTM-P.js → DialogViewport-Cyc_ye5w.js} +1 -1
  49. package/dist/client/assets/{DraftChatThreadRouteView-D8Bt3Qnq.js → DraftChatThreadRouteView-BSA67nKa.js} +1 -1
  50. package/dist/client/assets/{ExternalIdentityWeb.logic-D64j70NH.js → ExternalIdentityWeb.logic-BqdBjAua.js} +1 -1
  51. package/dist/client/assets/GlassSurface-B3cq28tB.js +1 -0
  52. package/dist/client/assets/{HostedConnectionControls-DxAXv0Hd.js → HostedConnectionControls-S2Wr9fiZ.js} +1 -1
  53. package/dist/client/assets/HostedHubRoot-DK9zP4tJ.js +1 -0
  54. package/dist/client/assets/{HostedNativeAuthorizationRoute-CTQe7Vjt.js → HostedNativeAuthorizationRoute-CKnLbCOH.js} +1 -1
  55. package/dist/client/assets/{HostedRelayTrustNotice-BldMySVi.js → HostedRelayTrustNotice-CbF_SOpf.js} +1 -1
  56. package/dist/client/assets/{Icons-CT3nd2MA.js → Icons-DZpTOLIb.js} +1 -1
  57. package/dist/client/assets/{IntegrationsSettingsPanel-D6f3KoqM.js → IntegrationsSettingsPanel-BdBEGIyL.js} +1 -1
  58. package/dist/client/assets/KeybindingsSettings-Bye1H9Sx.js +7 -0
  59. package/dist/client/assets/{McpServersSettings-B7YqVvV4.js → McpServersSettings-D0U0g2q7.js} +1 -1
  60. package/dist/client/assets/{MobileSheet-CkeG6_SP.js → MobileSheet-BPvuTPR6.js} +1 -1
  61. package/dist/client/assets/{NewWorktreeDialog-CKr2ioue.js → NewWorktreeDialog-C_xJCZWF.js} +1 -1
  62. package/dist/client/assets/{NoActiveThreadState-BD-eNmfn.js → NoActiveThreadState-Cfn_Wwnf.js} +1 -1
  63. package/dist/client/assets/{NodeSecuritySettings-FWM_SeDi.js → NodeSecuritySettings-DUQNZJqJ.js} +1 -1
  64. package/dist/client/assets/{OpinionatedPluginsSettings-BtZQF4Ze.js → OpinionatedPluginsSettings-D44efcv7.js} +1 -1
  65. package/dist/client/assets/{PhoneGetAppInterstitial-CooQgpSw.js → PhoneGetAppInterstitial-CzduFI4-.js} +1 -1
  66. package/dist/client/assets/{PhoneGetAppInterstitialBackdrop-B8vfJdZd.js → PhoneGetAppInterstitialBackdrop-CJ44QRCp.js} +1 -1
  67. package/dist/client/assets/PhoneHome-BLEJm5TG.js +1 -0
  68. package/dist/client/assets/PhoneSettingsSurface-CqetLTIm.js +1 -0
  69. package/dist/client/assets/{ProjectFavicon-qZGdjYCM.js → ProjectFavicon-DrBXI2cH.js} +1 -1
  70. package/dist/client/assets/{ProviderModelPicker-D0w23uWo.js → ProviderModelPicker-CyID3P1C.js} +1 -1
  71. package/dist/client/assets/{ProviderUpdateLaunchNotification.logic-BkoRegCn.js → ProviderUpdateLaunchNotification.logic-C6VoLD-w.js} +1 -1
  72. package/dist/client/assets/ProvidersSettingsPanel-BHmpXUIM.js +1 -0
  73. package/dist/client/assets/{RedactedSensitiveText-CxtaUiKH.js → RedactedSensitiveText-CZwFEoNn.js} +1 -1
  74. package/dist/client/assets/RootAppShell-BVXRShhe.js +6 -0
  75. package/dist/client/assets/{RycoLetterMark-Bk0kvGJ_.js → RycoLetterMark-C-fvI9UB.js} +1 -1
  76. package/dist/client/assets/SettingsDialog-CnETTu23.js +1 -0
  77. package/dist/client/assets/{SettingsPanels-Dr4f2y9l.js → SettingsPanels-C3HDrmQq.js} +3 -3
  78. package/dist/client/assets/{SettingsPanels.editor-B2x4U4rW.js → SettingsPanels.editor-DI8Z5rsl.js} +1 -1
  79. package/dist/client/assets/SourceControlSettings-BG4tsvql.js +1 -0
  80. package/dist/client/assets/{StatisticsPage-Bjouapmf.js → StatisticsPage-dy_aYqvS.js} +1 -1
  81. package/dist/client/assets/{StatisticsPanel-D_khPph6.js → StatisticsPanel-CeRJBu65.js} +1 -1
  82. package/dist/client/assets/{StatisticsSettingsLink-Cx43bOeo.js → StatisticsSettingsLink-ChlwCDG0.js} +1 -1
  83. package/dist/client/assets/ThreadStatusIndicators-D-ioX09X.js +0 -0
  84. package/dist/client/assets/{ThreadTerminalDrawer-DDHEuRGB.js → ThreadTerminalDrawer-BvGaRxBP.js} +1 -1
  85. package/dist/client/assets/{ThreadWorkspacePanel-QF3KwbGm.js → ThreadWorkspacePanel-BAWm7mGl.js} +2 -2
  86. package/dist/client/assets/{ToolbarRootContext-BgqqXVly.js → ToolbarRootContext-k-_m5nCN.js} +1 -1
  87. package/dist/client/assets/{WorkItemsTab-AOVwVvb7.js → WorkItemsTab-Q2V2EuvK.js} +12 -12
  88. package/dist/client/assets/{alert-LqMhbdE9.js → alert-BymbRVPf.js} +1 -1
  89. package/dist/client/assets/{alert-dialog-DxoA6ky8.js → alert-dialog-Gym8_p4Q.js} +1 -1
  90. package/dist/client/assets/appearancePreferences-BhNRCg6W.js +1 -0
  91. package/dist/client/assets/authorization-BwQZHweJ.js +1 -0
  92. package/dist/client/assets/{badge-CXw6fWrB.js → badge-BQI7J3Sg.js} +1 -1
  93. package/dist/client/assets/{branding-BDfN6Spd.js → branding-DqHDcyzW.js} +1 -1
  94. package/dist/client/assets/{button-BAbJxRzt.js → button-Wf_1nfeu.js} +1 -1
  95. package/dist/client/assets/{capabilities-3zgirmmI.js → capabilities-BrllgEYz.js} +1 -1
  96. package/dist/client/assets/{chatThreadActions-DQ8aOQ1g.js → chatThreadActions-BGkJmj6T.js} +1 -1
  97. package/dist/client/assets/{collapsible-dxy6kc2k.js → collapsible-GOpRckDq.js} +1 -1
  98. package/dist/client/assets/{command-CGNKG_Oe.js → command-Dx5YM54H.js} +1 -1
  99. package/dist/client/assets/composerDraftStore-DC2r8dcu.js +11 -0
  100. package/dist/client/assets/{data-list-CYKBxN62.js → data-list-BSiCZBKn.js} +1 -1
  101. package/dist/client/assets/{desktopUpdateAtoms-CyfPW2jg.js → desktopUpdateAtoms-DkmoIGr0.js} +1 -1
  102. package/dist/client/assets/{desktopWorkspace-DHUZEpfy.js → desktopWorkspace-Ddm531g5.js} +1 -1
  103. package/dist/client/assets/{device-B_qvyvtW.js → device-B0aqBYM1.js} +1 -1
  104. package/dist/client/assets/{dialog-DQsYchqu.js → dialog-CUxw5AxI.js} +1 -1
  105. package/dist/client/assets/{draft-input-CkzOk8BY.js → draft-input-CpfrGQ1h.js} +1 -1
  106. package/dist/client/assets/editorPreferences-SOMXdQpi.js +1 -0
  107. package/dist/client/assets/{empty-DwzqNgCP.js → empty-D420OZA9.js} +1 -1
  108. package/dist/client/assets/{env-B4arEvJg.js → env-Bf33qXdb.js} +1 -1
  109. package/dist/client/assets/{getPseudoElementBounds-X62ElHN8.js → getPseudoElementBounds-nDGTWECG.js} +1 -1
  110. package/dist/client/assets/{group-D9ER9giz.js → group-Cq4Llttm.js} +1 -1
  111. package/dist/client/assets/{index-CQmEMMQH.js → index-BL8_ra0g.js} +2 -2
  112. package/dist/client/assets/{input-CHEwW3oH.js → input-Dl4N9ZfE.js} +1 -1
  113. package/dist/client/assets/{kbd-DCGQZk18.js → kbd-CqoZVQfv.js} +1 -1
  114. package/dist/client/assets/{keybindings-CWJ7E9ZI.js → keybindings-DQzcPjMv.js} +1 -1
  115. package/dist/client/assets/{label-CVFHsLFO.js → label-x5DgpBI_.js} +1 -1
  116. package/dist/client/assets/{lib-qiiNMGgU.js → lib-BXIqHSZx.js} +1 -1
  117. package/dist/client/assets/{liquidGlass-CPsvmaF0.js → liquidGlass-yFkZrRk5.js} +1 -1
  118. package/dist/client/assets/{logging-M8H3z7rQ.js → logging-CZlHfeu2.js} +1 -1
  119. package/dist/client/assets/main-B7T7on1T.css +2 -0
  120. package/dist/client/assets/main-J4YlUJad.js +9 -0
  121. package/dist/client/assets/{menu-Dvxh8sD5.js → menu-BuDpxm_Q.js} +1 -1
  122. package/dist/client/assets/{popover-CuH9Yrj3.js → popover-DuprDUaB.js} +1 -1
  123. package/dist/client/assets/primary-CJx2nSkc.js +2 -0
  124. package/dist/client/assets/projectPaths-DrelgodZ.js +1 -0
  125. package/dist/client/assets/{providerDriverMeta-I0TSo-QI.js → providerDriverMeta-D27Koh7Q.js} +1 -1
  126. package/dist/client/assets/{providerIconUtils-X0Z3EK-Q.js → providerIconUtils-CtOHwjWL.js} +1 -1
  127. package/dist/client/assets/providerInstances-BPwEwwpF.js +1 -0
  128. package/dist/client/assets/providerModels-BPwEwwpF.js +1 -0
  129. package/dist/client/assets/{qr-code-Bddq6K7S.js → qr-code-BVfzPOP3.js} +1 -1
  130. package/dist/client/assets/{radio-group-CBZFr4C8.js → radio-group-rgmJqPI7.js} +1 -1
  131. package/dist/client/assets/{resolveAriaLabelledBy-CD_ugzhJ.js → resolveAriaLabelledBy-l4SuqStl.js} +1 -1
  132. package/dist/client/assets/{rightPanelRouteSearch-DB5gQGHK.js → rightPanelRouteSearch-DmpObL1z.js} +1 -1
  133. package/dist/client/assets/runtime-DYzjhL5M.js +1 -0
  134. package/dist/client/assets/{scroll-area-Drsa8bNB.js → scroll-area-DMs8l4bb.js} +1 -1
  135. package/dist/client/assets/{scrollEdges-B-cqxY4l.js → scrollEdges-DWTOweRb.js} +1 -1
  136. package/dist/client/assets/{select-BYbVr-yg.js → select-Djwp8HDm.js} +1 -1
  137. package/dist/client/assets/{separator-CdS5bi4Z.js → separator-rjtf5Q3V.js} +1 -1
  138. package/dist/client/assets/{session-logic-GZix7S2I.js → session-logic-DLEAZb3K.js} +2 -2
  139. package/dist/client/assets/{settingsDialogStore-ygYoScKe.js → settingsDialogStore-Dbykwvfs.js} +1 -1
  140. package/dist/client/assets/{settingsLayout-D8glO7f1.js → settingsLayout-C7bl9Xi4.js} +1 -1
  141. package/dist/client/assets/{sheet-BO78gIKZ.js → sheet-CQIQYfOM.js} +1 -1
  142. package/dist/client/assets/{sidebar-Dm6l2GA6.js → sidebar-BdDOvXe8.js} +1 -1
  143. package/dist/client/assets/sidebarProjectFolders-D_Me0oJ8.js +4 -0
  144. package/dist/client/assets/{sidebarStatusText-D0HT0fek.js → sidebarStatusText-BF6odB03.js} +1 -1
  145. package/dist/client/assets/{skeleton-CvQSeJbw.js → skeleton-Mgh4Gx9x.js} +1 -1
  146. package/dist/client/assets/{spinner-ClF0jOcX.js → spinner-CzzUdFeE.js} +1 -1
  147. package/dist/client/assets/{src-Vf4LVnMX.js → src-Ca7Gag3m.js} +1 -1
  148. package/dist/client/assets/storeSelectors-D7HbqO4E.js +1 -0
  149. package/dist/client/assets/{switch-BTGo9Yip.js → switch-CntUxI1A.js} +1 -1
  150. package/dist/client/assets/{terminal-links-CZ3c9AbA.js → terminal-links-CUFISn8U.js} +1 -1
  151. package/dist/client/assets/{textarea-RFPODxWW.js → textarea-C8QxddDb.js} +1 -1
  152. package/dist/client/assets/threadPinning-BIV4KXZU.js +1 -0
  153. package/dist/client/assets/{threadPriorityRefreshRuntime-Ct5pnIbX.js → threadPriorityRefreshRuntime-B-pVYK_y.js} +1 -1
  154. package/dist/client/assets/{toast-CcSCAm4B.js → toast-Cw7bXJzg.js} +1 -1
  155. package/dist/client/assets/{toggle-I6h33Cu5.js → toggle-Bi9uP4Hb.js} +1 -1
  156. package/dist/client/assets/{toggle-group-mLIkiJtU.js → toggle-group-LcgyMgj5.js} +1 -1
  157. package/dist/client/assets/{tooltip-C8sAONBj.js → tooltip-t3Nrleyq.js} +1 -1
  158. package/dist/client/assets/types-D7HbqO4E.js +1 -0
  159. package/dist/client/assets/{uiStateStore-B6pjzSjj.js → uiStateStore-BW2WnK4k.js} +1 -1
  160. package/dist/client/assets/useAtlassian-a-MaAd0k.js +0 -0
  161. package/dist/client/assets/{useButton-D__1LqCF.js → useButton-DUuWgIMw.js} +1 -1
  162. package/dist/client/assets/{useCompositeListItem-Cmr_nuuG.js → useCompositeListItem-CL5mJqCb.js} +1 -1
  163. package/dist/client/assets/{useDebouncedValue-DHjoudTq.js → useDebouncedValue-jDDWNjgt.js} +1 -1
  164. package/dist/client/assets/{useFloatingRootContext-D5EZmrCa.js → useFloatingRootContext-C4I8IxtL.js} +1 -1
  165. package/dist/client/assets/{useHandleNewThread-DX2FtXcP.js → useHandleNewThread-820pBJCC.js} +1 -1
  166. package/dist/client/assets/{useLabelableId-DnQJ7amm.js → useLabelableId-KX33mhBC.js} +1 -1
  167. package/dist/client/assets/{useLocation-CDeYzWW6.js → useLocation-B4QlXdMt.js} +1 -1
  168. package/dist/client/assets/{useOpenInteractionType-CjtpACKR.js → useOpenInteractionType-DjM9MBY7.js} +1 -1
  169. package/dist/client/assets/{usePhoneThreadActions-BEa3VzGG.js → usePhoneThreadActions-DxxWMYgC.js} +1 -1
  170. package/dist/client/assets/{usePopupViewport-BuhsNdVy.js → usePopupViewport-CAMlnyaP.js} +1 -1
  171. package/dist/client/assets/{useScrollLock-D3tMGsRk.js → useScrollLock-CAPfesBT.js} +1 -1
  172. package/dist/client/assets/{useStatistics-CtunoTE-.js → useStatistics-CWasDzsV.js} +2 -2
  173. package/dist/client/assets/{useSwipeDismiss-CbgDJvw1.js → useSwipeDismiss-BZsYSBgq.js} +1 -1
  174. package/dist/client/assets/{useTheme-DiC-5xCb.js → useTheme-By1kfyiU.js} +1 -1
  175. package/dist/client/assets/{useThreadActions-fN-Al13y.js → useThreadActions-MOjDrEnS.js} +1 -1
  176. package/dist/client/assets/{useTriggerFocusGuards-CrugmkhX.js → useTriggerFocusGuards-D5z439rn.js} +1 -1
  177. package/dist/client/assets/{useValueChanged-MQtIzPIU.js → useValueChanged-D0CHQQwP.js} +1 -1
  178. package/dist/client/assets/{utils-BofFIn5Y.js → utils-B76_2Yk7.js} +1 -1
  179. package/dist/client/index.html +1 -1
  180. package/dist/{collectUint8StreamText-Bb52hlpd.cjs → collectUint8StreamText-B9B7bGv9.cjs} +46 -10
  181. package/dist/{collectUint8StreamText-EDg4F0TU.mjs → collectUint8StreamText-RzKEq2NY.mjs} +35 -11
  182. package/dist/{makeManagedServerProvider-itynW7xv.cjs → makeManagedServerProvider-BF1eBatf.cjs} +1 -1
  183. package/dist/{makeManagedServerProvider-Cf8bNWwc.mjs → makeManagedServerProvider-BuG2fLP8.mjs} +1 -1
  184. package/package.json +1 -1
  185. package/dist/client/assets/AppearanceSettings-CYbSApl4.js +0 -1
  186. package/dist/client/assets/ChatRightPanel-BIS1DPGa.js +0 -27
  187. package/dist/client/assets/CommandPaletteDialog-C5xAo65V.js +0 -1
  188. package/dist/client/assets/DialogRoot-BpIvUdm7.js +0 -1
  189. package/dist/client/assets/GlassSurface-C3IIWMu9.js +0 -1
  190. package/dist/client/assets/HostedHubRoot-Cc8GYcK6.js +0 -1
  191. package/dist/client/assets/KeybindingsSettings-D2bNQPI-.js +0 -7
  192. package/dist/client/assets/PhoneHome-BtPE7bQn.js +0 -1
  193. package/dist/client/assets/PhoneSettingsSurface-tcFCccEL.js +0 -1
  194. package/dist/client/assets/ProvidersSettingsPanel-B3aBKY--.js +0 -1
  195. package/dist/client/assets/RootAppShell-C-0ChFVJ.js +0 -6
  196. package/dist/client/assets/SettingsDialog-Bbuoh793.js +0 -1
  197. package/dist/client/assets/SourceControlSettings-CkiYR4lR.js +0 -1
  198. package/dist/client/assets/ThreadStatusIndicators-ZImeLExQ.js +0 -0
  199. package/dist/client/assets/appearancePreferences-COvj0WMT.js +0 -1
  200. package/dist/client/assets/authorization-mIJKV2yp.js +0 -1
  201. package/dist/client/assets/composerDraftStore-CdJJZe42.js +0 -11
  202. package/dist/client/assets/editorPreferences-DHIJntKF.js +0 -1
  203. package/dist/client/assets/main-BKS5Nf2_.js +0 -9
  204. package/dist/client/assets/main-DaYHZt-J.css +0 -2
  205. package/dist/client/assets/panel-right-BodNpkM9.js +0 -1
  206. package/dist/client/assets/primary-BzLEg2w1.js +0 -2
  207. package/dist/client/assets/projectPaths-BAd6NFcE.js +0 -1
  208. package/dist/client/assets/providerInstances-BJcfB_9E.js +0 -1
  209. package/dist/client/assets/providerModels-BJcfB_9E.js +0 -1
  210. package/dist/client/assets/runtime-CXut_g4p.js +0 -1
  211. package/dist/client/assets/sidebarProjectFolders-cnmz3B_-.js +0 -4
  212. package/dist/client/assets/storeSelectors-DYekgeHu.js +0 -1
  213. package/dist/client/assets/types-DYekgeHu.js +0 -1
  214. package/dist/client/assets/useAppearancePreference-BlLlxQl7.js +0 -1
  215. package/dist/client/assets/useAtlassian-9-hy2f8z.js +0 -0
@@ -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-B4arEvJg.js";import{ii as s}from"./src-Vf4LVnMX.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-CXut_g4p.js";import{Tt as O,_t as k,ht as A}from"./primary-BzLEg2w1.js";import{t as j}from"./useDebouncedValue-DHjoudTq.js";import{It as M,P as ee,_t as N,i as te,vt as P}from"./composerDraftStore-CdJJZe42.js";import{c as ne,d as re,l as ie}from"./useSwipeDismiss-CbgDJvw1.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-DB5gQGHK.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-D5EZmrCa.js";import{t as Ee}from"./circle-alert-BWvs6IOn.js";import{i as De}from"./toast-CcSCAm4B.js";import{t as V}from"./clock-3-r12DkpRj.js";import{C as Oe}from"./lib-qiiNMGgU.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-B_qvyvtW.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-DDHEuRGB.js";import{i as Cn}from"./terminal-links-CZ3c9AbA.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-BofFIn5Y.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-GZix7S2I.js";import"./storeSelectors-DYekgeHu.js";import{o as Ln}from"./timestampFormat-8uPXS812.js";import{_ as Rn}from"./keybindings-CWJ7E9ZI.js";import{i as zn,n as Bn,t as Vn}from"./tooltip-C8sAONBj.js";import{t as Hn}from"./scroll-area-Drsa8bNB.js";import{t as Un}from"./button-BAbJxRzt.js";import{n as Wn}from"./composerHandleContext-BrQ6d8r9.js";import{i as Gn,r as Kn,t as qn}from"./alert-LqMhbdE9.js";import{n as Jn,t as Yn}from"./sidebarStatusText-D0HT0fek.js";import{a as Xn,i as Zn,o as Qn,r as $n,s as er,t as tr}from"./alert-dialog-DxoA6ky8.js";import{n as nr}from"./editorPreferences-DHIJntKF.js";import{t as rr}from"./badge-CXw6fWrB.js";import{t as ir}from"./useTheme-DiC-5xCb.js";import{n as ar,t as or}from"./toggle-group-mLIkiJtU.js";import{t as sr}from"./toggle-I6h33Cu5.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-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?`
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(`
@@ -1433,7 +1433,7 @@ diff --git`)}function ia(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
1433
1433
  background-color: color-mix(in srgb, var(--warning) 60%, transparent);
1434
1434
  color: var(--foreground);
1435
1435
  }
1436
- `,gu=`${pu}${mu}${hu}`,_u=`${pu}${hu}`;function vu(e,t=`diff-panel`){if(!e)return null;let n=e.trim();if(n.length===0)return null;try{let e=Hi(n,Wt(n,t)).flatMap(e=>e.files);return e.length>0?{kind:`files`,files:e}:{kind:`raw`,text:n,reason:`Unsupported diff format. Showing raw patch.`}}catch{return{kind:`raw`,text:n,reason:`Failed to parse patch. Showing raw patch.`}}}function yu(e){return Xl(e)}function bu(e){return!e||e.kind!==`files`?[]:e.files.toSorted((e,t)=>yu(e).localeCompare(yu(t),void 0,{numeric:!0,sensitivity:`base`}))}var xu=new Yl;function Su(e){return e.cacheKey??`${e.prevName??`none`}:${e.name}`}var Cu=`ryco-diff-search-match`,wu=150,Tu=80,Eu=1600;function Du(){return typeof CSS<`u`&&CSS.highlights!==void 0&&globalThis.Highlight!==void 0}function Ou(e,t,n=Eu){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();return r.bottom>=i.top-n&&r.top<=i.bottom+n&&r.right>=i.left-n&&r.left<=i.right+n}function ku(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(e){let t=e.parentElement;return t&&t.closest(`[data-line-number-content]`)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),r=n.nextNode(),i=0;for(;r;){let e=r,a=i+e.data.length;t.push({node:e,start:i,end:a}),i=a,r=n.nextNode()}return{offsets:t,textLength:i}}function Au(e,t,n){for(let r of e)if(!(t<r.start||t>r.end)&&(t!==r.end||n!==`start`))return{node:r.node,offset:t-r.start};return null}function ju(e,t,n){let{offsets:r,textLength:i}=ku(e);if(r.length===0||t.start<0||t.end>i||t.start>=t.end)return;let a=Au(r,t.start,`start`),o=Au(r,t.end,`end`);if(!a||!o)return;let s=document.createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset),n.push(s)}function Mu(e){let t=uu(e.lineIndexAttr);return t?e.matches.filter(n=>du(n,{renderMode:e.renderMode,lineIndexes:t,lineType:e.lineType})):[]}function Nu(e){if(cu(e.match,e.renderMode)===null)return null;let t=e.fileElement.querySelectorAll(`diffs-container`);for(let n of t){let t=n.shadowRoot?.querySelectorAll(`[data-line][data-line-index]`);for(let n of t??[]){let t=uu(n.getAttribute(`data-line-index`));if(t&&du(e.match,{renderMode:e.renderMode,lineIndexes:t,lineType:n.getAttribute(`data-line-type`)}))return n}}return null}function Pu(e){let t=[],n=e.rootElement.querySelectorAll(`[data-diff-file-index]`);for(let r of n){if(!Ou(r,e.viewportElement))continue;let n=r.dataset.diffFileIndex,i=n?Number.parseInt(n,10):NaN;if(!Number.isFinite(i))continue;let a=e.matchesByFileIndex.get(i);if(!a||a.length===0)continue;let o=r.querySelectorAll(`diffs-container`);for(let n of o){let r=n.shadowRoot?.querySelectorAll(`[data-line][data-line-index]`);for(let n of r??[]){if(!Ou(n,e.viewportElement))continue;let r=Mu({matches:a,renderMode:e.renderMode,lineIndexAttr:n.getAttribute(`data-line-index`),lineType:n.getAttribute(`data-line-type`)});for(let e of r)ju(n,e,t)}}}return t}function Fu(e){switch(e.type){case`new`:return`text-[var(--diffs-addition-base)]`;case`deleted`:return`text-[var(--diffs-deletion-base)]`;case`change`:case`rename-pure`:case`rename-changed`:return`text-[var(--diffs-modified-base)]`;default:return`text-muted-foreground/80`}}function Iu(e){let t=(0,Y.c)(219),{mode:n}=e,i=n===void 0?`inline`:n;Ce(`DiffPanel`);let a=ge(),{resolvedTheme:o}=ir(),s=h(),c=i===`phone`,[l,m]=(0,J.useState)(`stacked`),[_,v]=(0,J.useState)(c?!0:s.diffWordWrap),[y,b]=(0,J.useState)(s.diffIgnoreWhitespace),[x,S]=(0,J.useState)(Ku),[C,w]=(0,J.useState)(``),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T={wait:wu},t[0]=T):T=t[0];let[E]=j(C,T),D;t[1]!==E||t[2]!==C?(D=C.trim().length===0?``:E,t[1]=E,t[2]=C,t[3]=D):D=t[3];let O=D,[k,A]=(0,J.useState)(0),M=(0,J.useRef)(null),ee=(0,J.useRef)(null),N=(0,J.useRef)(null),te=(0,J.useRef)(!1),[P,ie]=(0,J.useState)(!1),[ae,se]=(0,J.useState)(!1),F;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(F={strict:!1,select:Gu},t[4]=F):F=t[4];let ce=re(F),le;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(le={strict:!1,select:Wu},t[5]=le):le=t[5];let ue=oe(le),de=ue.diff===`1`,I=ce?.threadId??null,L;t[6]===ce?L=t[7]:(L=f(ce),t[6]=ce,t[7]=L);let R=d(L),pe=R?.projectId??null,z;t[8]!==pe||t[9]!==R?(z=e=>R&&pe?p(e,{environmentId:R.environmentId,projectId:pe}):void 0,t[8]=pe,t[9]=R,t[10]=z):z=t[10];let me=d(z),he=R?.worktreePath??me?.cwd,B=R?.environmentId??null,_e=he??null,ve;t[11]!==B||t[12]!==_e?(ve={environmentId:B,cwd:_e},t[11]=B,t[12]=_e,t[13]=ve):ve=t[13];let ye=u(ve).data?.isRepo??!0,{turnDiffSummaries:be,inferredCheckpointTurnCountByTurnId:Ee}=Ht(R),De;if(t[14]!==Ee||t[15]!==be){let e;t[17]===Ee?e=t[18]:(e=(e,t)=>{let n=e.checkpointTurnCount??Ee[e.turnId]??0,r=t.checkpointTurnCount??Ee[t.turnId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n},t[17]=Ee,t[18]=e),De=[...be].toSorted(e),t[14]=Ee,t[15]=be,t[16]=De}else De=t[16];let V=De,Oe=ue.diffTurnId??null,ke=Oe===null?null:ue.diffFilePath??null,Ae;t[19]!==V||t[20]!==Oe?(Ae=Oe===null?void 0:V.find(e=>e.turnId===Oe)??V[0],t[19]=V,t[20]=Oe,t[21]=Ae):Ae=t[21];let H=Ae,U=H&&(H.checkpointTurnCount??Ee[H.turnId]),je;t[22]===U?je=t[23]:(je=typeof U==`number`?{fromTurnCount:Math.max(0,U-1),toTurnCount:U}:null,t[22]=U,t[23]=je);let Me=je,Ne;if(t[24]!==Ee||t[25]!==V){bb0:{let e;t[27]===Ee?e=t[28]:(e=e=>e.checkpointTurnCount??Ee[e.turnId],t[27]=Ee,t[28]=e);let n=V.map(e).filter(Uu);if(n.length===0){Ne=void 0;break bb0}let r=Math.max(...n);Ne=r>0?r:void 0}t[24]=Ee,t[25]=V,t[26]=Ne}else Ne=t[26];let Pe=Ne,Fe;t[29]!==Pe||t[30]!==H?(Fe=!H&&typeof Pe==`number`?{fromTurnCount:0,toTurnCount:Pe}:null,t[29]=Pe,t[30]=H,t[31]=Fe):Fe=t[31];let Ie=H?Me:Fe,Le;bb1:{if(H||V.length===0){Le=null;break bb1}let e;t[32]===V?e=t[33]:(e=V.map(Hu).join(`,`),t[32]=V,t[33]=e),Le=`conversation:${e}`}let Re=Le,ze=R?.environmentId??null,W=Ie?.fromTurnCount??null,Be=Ie?.toTurnCount??null,Ve=H?`turn:${H.turnId}`:Re,He;t[34]!==I||t[35]!==y||t[36]!==ye||t[37]!==ze||t[38]!==W||t[39]!==Be||t[40]!==Ve?(He={environmentId:ze,threadId:I,fromTurnCount:W,toTurnCount:Be,ignoreWhitespace:y,cacheScope:Ve,enabled:ye},t[34]=I,t[35]=y,t[36]=ye,t[37]=ze,t[38]=W,t[39]=Be,t[40]=Ve,t[41]=He):He=t[41];let Ue=Wl(He),We=H?Ue.data?.diff:void 0,Ge=H?void 0:Ue.data?.diff,Ke=Ue.isLoading,qe=Ue.error instanceof Error?Ue.error.message:Ue.error?`Failed to load checkpoint diff.`:null,Je=H?We:Ge,Ye=typeof Je==`string`,Xe;t[42]!==Ye||t[43]!==Je?(Xe=Ye&&Je.trim().length===0,t[42]=Ye,t[43]=Je,t[44]=Xe):Xe=t[44];let Ze=Xe,Qe;if(t[45]!==Re||t[46]!==o||t[47]!==Je||t[48]!==H){bb2:{let e=`diff-panel:${o}`,n=typeof Je==`string`?Je.trim():``;if(n.length===0){let e;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(e={patch:null,files:[]},t[50]=e):e=t[50],Qe=e;break bb2}let r={turnId:H?`turn:${H.turnId}`:Re??`conversation`,filePath:e,blobSha:Wt(n)},i=xu.get(r);if(i){Qe=i;break bb2}let a=vu(Je,e),s={patch:a,files:bu(a)};a&&xu.set(r,s),Qe=s}t[45]=Re,t[46]=o,t[47]=Je,t[48]=H,t[49]=Qe}else Qe=t[49];let $e=Qe,et=$e.patch,tt=$e.files,nt;t[51]===tt?nt=t[52]:(nt=tu(tt),t[51]=tt,t[52]=nt);let rt=nt,it;t[53]===O?it=t[54]:(it=Zl(O),t[53]=O,t[54]=it);let at=it,ot;t[55]!==rt||t[56]!==O?(ot=iu(rt,O),t[55]=rt,t[56]=O,t[57]=ot):ot=t[57];let G=ot,st;t[58]===G?st=t[59]:(st=ou(G),t[58]=G,t[59]=st);let ct=st,lt;t[60]===tt?lt=t[61]:(lt=tt.map(Vu),t[60]=tt,t[61]=lt);let ut=lt,dt;bb3:{if(!at){dt=ut;break bb3}let e;if(t[62]!==G||t[63]!==tt){let n;t[65]===tt?n=t[66]:(n=e=>({fileDiff:tt[e],fileIndex:e}),t[65]=tt,t[66]=n),e=au(G).map(n),t[62]=G,t[63]=tt,t[64]=e}else e=t[64];dt=e}let ft=dt,pt;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(pt=()=>{A(0)},t[67]=pt):pt=t[67];let mt;t[68]!==at||t[69]!==tt?(mt=[at,tt],t[68]=at,t[69]=tt,t[70]=mt):mt=t[70],(0,J.useEffect)(pt,mt);let ht,gt;t[71]===G.length?(ht=t[72],gt=t[73]):(ht=()=>{A(e=>G.length===0?0:Math.min(e,G.length-1))},gt=[G.length],t[71]=G.length,t[72]=ht,t[73]=gt),(0,J.useEffect)(ht,gt);let _t;t[74]!==k||t[75]!==l||t[76]!==G?(_t=e=>{if(G.length===0)return;let t=su(k,G.length,e);A(t);let n=G[t],r=ee.current;if(!n||!r)return;let i=r.querySelector(`[data-diff-file-index="${n.fileIndex}"]`);if(!i)return;let a=Nu({fileElement:i,match:n,renderMode:l});(a??i).scrollIntoView({block:`center`,behavior:`smooth`}),!a&&cu(n,l)!==null&&window.requestAnimationFrame(()=>{Nu({fileElement:i,match:n,renderMode:l})?.scrollIntoView({block:`center`,behavior:`smooth`})})},t[74]=k,t[75]=l,t[76]=G,t[77]=_t):_t=t[77];let vt=_t,yt,bt;t[78]!==l||t[79]!==G.length||t[80]!==ct||t[81]!==at?(yt=()=>{if(!Du())return;let e=CSS.highlights,t=ee.current;if(!t||!at||G.length===0){e.delete(Cu);return}let n=0,r=0,i=new Map,a=t.querySelector(`.diff-render-surface`)??t.querySelector(`[data-virtualizer]`)??t,o=()=>{n=0,c();let r=Pu({rootElement:t,viewportElement:a,matchesByFileIndex:ct,renderMode:l});if(r.length===0){e.delete(Cu);return}e.set(Cu,new Highlight(...r))},s=()=>{n===0&&r===0&&(r=window.setTimeout(()=>{r=0,n=window.requestAnimationFrame(o)},Tu))},c=()=>{let e=t.querySelectorAll(`[data-diff-file-index]`);for(let t of e){if(!Ou(t,a))continue;let e=t.querySelectorAll(`diffs-container`);for(let t of e){let e=t.shadowRoot;if(!e||i.has(e))continue;let n=new MutationObserver(s);n.observe(e,{childList:!0,subtree:!0}),i.set(e,n)}}},u=new MutationObserver(s);u.observe(t,{childList:!0,subtree:!0}),a.addEventListener(`scroll`,s,{passive:!0});let d=new ResizeObserver(s);return d.observe(a),s(),()=>{u.disconnect(),a.removeEventListener(`scroll`,s),d.disconnect();for(let e of i.values())e.disconnect();i.clear(),r!==0&&window.clearTimeout(r),n!==0&&window.cancelAnimationFrame(n),e.delete(Cu)}},bt=[l,G.length,ct,at],t[78]=l,t[79]=G.length,t[80]=ct,t[81]=at,t[82]=yt,t[83]=bt):(yt=t[82],bt=t[83]),(0,J.useEffect)(yt,bt);let xt,St;t[84]===tt?(xt=t[85],St=t[86]):(xt=()=>{if(tt.length===0){S(Bu);return}let e=new Set(tt.map(Su));S(t=>{let n=new Set([...t].filter(t=>e.has(t)));return n.size===t.size?t:n})},St=[tt],t[84]=tt,t[85]=xt,t[86]=St),(0,J.useEffect)(xt,St);let Ct,wt;t[87]!==de||t[88]!==c||t[89]!==s.diffIgnoreWhitespace||t[90]!==s.diffWordWrap?(Ct=()=>{de&&!te.current&&(v(c?!0:s.diffWordWrap),b(s.diffIgnoreWhitespace),w(``)),te.current=de},wt=[de,c,s.diffIgnoreWhitespace,s.diffWordWrap],t[87]=de,t[88]=c,t[89]=s.diffIgnoreWhitespace,t[90]=s.diffWordWrap,t[91]=Ct,t[92]=wt):(Ct=t[91],wt=t[92]),(0,J.useEffect)(Ct,wt);let Et;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(Et=()=>{w(``)},t[93]=Et):Et=t[93];let Dt;t[94]===Oe?Dt=t[95]:(Dt=[Oe],t[94]=Oe,t[95]=Dt),(0,J.useEffect)(Et,Dt);let Ot;t[96]===ke?Ot=t[97]:(Ot=()=>{!ke||!ee.current||Array.from(ee.current.querySelectorAll(`[data-diff-file-path]`)).find(e=>e.dataset.diffFilePath===ke)?.scrollIntoView({block:`nearest`})},t[96]=ke,t[97]=Ot);let kt;t[98]!==tt||t[99]!==ke?(kt=[ke,tt],t[98]=tt,t[99]=ke,t[100]=kt):kt=t[100],(0,J.useEffect)(Ot,kt);let At;t[101]===he?At=t[102]:(At=(e,t)=>{let n=g();if(!n)return;let r=fu({cwd:he,filePath:e,lineNumber:t});nr(n,r).catch(zu)},t[101]=he,t[102]=At);let jt=At,Nt;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=e=>{S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[103]=Nt):Nt=t[103];let Pt=Nt,Ft;t[104]!==R||t[105]!==a?(Ft=e=>{R&&a({to:`/$environmentId/$threadId`,params:ne(r(R.environmentId,R.id)),search:t=>({...fe(t),diff:`1`,diffTurnId:e})})},t[104]=R,t[105]=a,t[106]=Ft):Ft=t[106];let It=Ft,Lt;t[107]!==R||t[108]!==a?(Lt=()=>{R&&a({to:`/$environmentId/$threadId`,params:ne(r(R.environmentId,R.id)),search:Ru})},t[107]=R,t[108]=a,t[109]=Lt):Lt=t[109];let Rt=Lt,zt;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(zt=()=>{let e=N.current;if(!e){ie(!1),se(!1);return}let t=Math.max(0,e.scrollWidth-e.clientWidth);ie(e.scrollLeft>4),se(e.scrollLeft<t-4)},t[110]=zt):zt=t[110];let Bt=zt,Vt;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(Vt=e=>{let t=N.current;t&&t.scrollBy({left:e,behavior:`smooth`})},t[111]=Vt):Vt=t[111];let Ut=Vt,Gt;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(Gt=e=>{let t=N.current;t&&(t.scrollWidth<=t.clientWidth+1||Math.abs(e.deltaY)<=Math.abs(e.deltaX)||(e.preventDefault(),t.scrollBy({left:e.deltaY,behavior:`auto`})))},t[112]=Gt):Gt=t[112];let Kt=Gt,qt,Jt;t[113]===Symbol.for(`react.memo_cache_sentinel`)?(qt=()=>{let e=N.current;if(!e)return;let t=window.requestAnimationFrame(()=>Bt()),n=()=>Bt();e.addEventListener(`scroll`,n,{passive:!0});let r=new ResizeObserver(()=>Bt());return r.observe(e),()=>{window.cancelAnimationFrame(t),e.removeEventListener(`scroll`,n),r.disconnect()}},Jt=[Bt],t[113]=qt,t[114]=Jt):(qt=t[113],Jt=t[114]),(0,J.useEffect)(qt,Jt);let Yt;t[115]===Symbol.for(`react.memo_cache_sentinel`)?(Yt=()=>{let e=window.requestAnimationFrame(()=>Bt());return()=>{window.cancelAnimationFrame(e)}},t[115]=Yt):Yt=t[115];let Xt;t[116]!==V||t[117]!==Oe?(Xt=[V,Oe,Bt],t[116]=V,t[117]=Oe,t[118]=Xt):Xt=t[118],(0,J.useEffect)(Yt,Xt);let Zt;t[119]===Symbol.for(`react.memo_cache_sentinel`)?(Zt=()=>{let e=N.current;e&&e.querySelector(`[data-turn-chip-selected='true']`)?.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`smooth`})},t[119]=Zt):Zt=t[119];let Qt=H?.turnId,$t;t[120]!==Oe||t[121]!==Qt?($t=[Qt,Oe],t[120]=Oe,t[121]=Qt,t[122]=$t):$t=t[122],(0,J.useEffect)(Zt,$t);let en;t[123]!==P||t[124]!==ae||t[125]!==c?(en=c?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{type:`button`,className:q(`absolute left-0 top-1/2 z-20 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-md border bg-background/90 text-muted-foreground transition-colors`,P?`border-border/70 hover:border-border hover:text-foreground`:`cursor-not-allowed border-border/40 text-muted-foreground/40`),onClick:()=>Ut(-180),disabled:!P,"aria-label":`Scroll turn list left`,children:(0,X.jsx)(Se,{className:`size-3.5`})}),(0,X.jsx)(`button`,{type:`button`,className:q(`absolute right-0 top-1/2 z-20 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-md border bg-background/90 text-muted-foreground transition-colors`,ae?`border-border/70 hover:border-border hover:text-foreground`:`cursor-not-allowed border-border/40 text-muted-foreground/40`),onClick:()=>Ut(180),disabled:!ae,"aria-label":`Scroll turn list right`,children:(0,X.jsx)(we,{className:`size-3.5`})})]}),t[123]=P,t[124]=ae,t[125]=c,t[126]=en):en=t[126];let tn=c?`px-1`:`px-8`,nn;t[127]===tn?nn=t[128]:(nn=q(`turn-chip-strip flex gap-1 overflow-x-auto py-0.5`,tn),t[127]=tn,t[128]=nn);let an;t[129]!==P||t[130]!==ae||t[131]!==c?(an=!c&&(P||ae)?{maskImage:`linear-gradient(to right, ${P?`transparent 24px, black 72px`:`black`}, ${ae?`black calc(100% - 72px), transparent calc(100% - 24px)`:`black`})`}:void 0,t[129]=P,t[130]=ae,t[131]=c,t[132]=an):an=t[132];let on=c&&`min-h-[44px]`,sn;t[133]===on?sn=t[134]:(sn=q(`shrink-0 rounded-md`,on),t[133]=on,t[134]=sn);let cn=Oe===null,ln=c&&`flex min-h-[44px] items-center`,un=Oe===null?`border-border bg-accent text-accent-foreground`:`border-border/70 bg-background/70 text-muted-foreground/80 hover:border-border hover:text-foreground/80`,dn;t[135]!==ln||t[136]!==un?(dn=q(`rounded-md border px-2 py-1 text-left transition-colors`,ln,un),t[135]=ln,t[136]=un,t[137]=dn):dn=t[137];let fn;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(fn=(0,X.jsx)(`div`,{className:`text-[10px] leading-tight font-medium`,children:`All turns`}),t[138]=fn):fn=t[138];let K;t[139]===dn?K=t[140]:(K=(0,X.jsx)(`div`,{className:dn,children:fn}),t[139]=dn,t[140]=K);let pn;t[141]!==Rt||t[142]!==sn||t[143]!==cn||t[144]!==K?(pn=(0,X.jsx)(`button`,{type:`button`,className:sn,onClick:Rt,"data-turn-chip-selected":cn,children:K}),t[141]=Rt,t[142]=sn,t[143]=cn,t[144]=K,t[145]=pn):pn=t[145];let mn;if(t[146]!==Ee||t[147]!==c||t[148]!==V||t[149]!==It||t[150]!==H?.turnId||t[151]!==s.timestampFormat){let e;t[153]!==Ee||t[154]!==c||t[155]!==It||t[156]!==H?.turnId||t[157]!==s.timestampFormat?(e=e=>(0,X.jsx)(`button`,{type:`button`,className:q(`shrink-0 rounded-md`,c&&`min-h-[44px]`),onClick:()=>It(e.turnId),title:e.turnId,"data-turn-chip-selected":e.turnId===H?.turnId,children:(0,X.jsx)(`div`,{className:q(`rounded-md border px-2 py-1 text-left transition-colors`,c&&`flex min-h-[44px] items-center`,e.turnId===H?.turnId?`border-border bg-accent text-accent-foreground`:`border-border/70 bg-background/70 text-muted-foreground/80 hover:border-border hover:text-foreground/80`),children:(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsxs)(`span`,{className:`text-[10px] leading-tight font-medium`,children:[`Turn`,` `,e.checkpointTurnCount??Ee[e.turnId]??`?`]}),(0,X.jsx)(`span`,{className:`text-[9px] leading-tight opacity-70`,children:Ln(e.completedAt,s.timestampFormat)})]})})},e.turnId),t[153]=Ee,t[154]=c,t[155]=It,t[156]=H?.turnId,t[157]=s.timestampFormat,t[158]=e):e=t[158],mn=V.map(e),t[146]=Ee,t[147]=c,t[148]=V,t[149]=It,t[150]=H?.turnId,t[151]=s.timestampFormat,t[152]=mn}else mn=t[152];let hn;t[159]!==nn||t[160]!==an||t[161]!==pn||t[162]!==mn?(hn=(0,X.jsxs)(`div`,{ref:N,className:nn,style:an,onWheel:Kt,children:[pn,mn]}),t[159]=nn,t[160]=an,t[161]=pn,t[162]=mn,t[163]=hn):hn=t[163];let gn;t[164]!==en||t[165]!==hn?(gn=(0,X.jsxs)(`div`,{className:`relative min-w-0 flex-1 [-webkit-app-region:no-drag]`,children:[en,hn]}),t[164]=en,t[165]=hn,t[166]=gn):gn=t[166];let _n;t[167]!==l||t[168]!==c?(_n=c?null:(0,X.jsxs)(ar,{className:`shrink-0`,variant:`outline`,size:`xs`,value:[l],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&m(t)},children:[(0,X.jsx)(or,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,X.jsx)(Tr,{className:`size-3`})}),(0,X.jsx)(or,{"aria-label":`Split diff view`,value:`split`,children:(0,X.jsx)(pr,{className:`size-3`})})]}),t[167]=l,t[168]=c,t[169]=_n):_n=t[169];let vn=_?`Disable diff line wrapping`:`Enable diff line wrapping`,yn=_?`Disable line wrapping`:`Enable line wrapping`,xn=c&&`min-h-[44px] min-w-[44px]`,Sn;t[170]===xn?Sn=t[171]:(Sn=q(xn),t[170]=xn,t[171]=Sn);let Cn,wn;t[172]===Symbol.for(`react.memo_cache_sentinel`)?(Cn=e=>{v(!!e)},wn=(0,X.jsx)(Er,{className:`size-3`}),t[172]=Cn,t[173]=wn):(Cn=t[172],wn=t[173]);let Tn;t[174]!==_||t[175]!==vn||t[176]!==yn||t[177]!==Sn?(Tn=(0,X.jsx)(or,{"aria-label":vn,title:yn,variant:`outline`,size:`xs`,className:Sn,pressed:_,onPressedChange:Cn,children:wn}),t[174]=_,t[175]=vn,t[176]=yn,t[177]=Sn,t[178]=Tn):Tn=t[178];let En=y?`Show whitespace changes`:`Hide whitespace changes`,On=y?`Show whitespace changes`:`Hide whitespace changes`,kn=c&&`min-h-[44px] min-w-[44px]`,An;t[179]===kn?An=t[180]:(An=q(kn),t[179]=kn,t[180]=An);let jn,Mn;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(jn=e=>{b(!!e)},Mn=(0,X.jsx)(Cr,{className:`size-3`}),t[181]=jn,t[182]=Mn):(jn=t[181],Mn=t[182]);let Nn;t[183]!==y||t[184]!==En||t[185]!==On||t[186]!==An?(Nn=(0,X.jsx)(or,{"aria-label":En,title:On,variant:`outline`,size:`xs`,className:An,pressed:y,onPressedChange:jn,children:Mn}),t[183]=y,t[184]=En,t[185]=On,t[186]=An,t[187]=Nn):Nn=t[187];let Pn;t[188]!==_n||t[189]!==Tn||t[190]!==Nn?(Pn=(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[_n,Tn,Nn]}),t[188]=_n,t[189]=Tn,t[190]=Nn,t[191]=Pn):Pn=t[191];let Fn;t[192]!==gn||t[193]!==Pn?(Fn=(0,X.jsxs)(X.Fragment,{children:[gn,Pn]}),t[192]=gn,t[193]=Pn,t[194]=Fn):Fn=t[194];let In=Fn,Rn;t[195]!==R||t[196]!==qe||t[197]!==x||t[198]!==k||t[199]!==l||t[200]!==G.length||t[201]!==C||t[202]!==_||t[203]!==ft||t[204]!==vt||t[205]!==Ze||t[206]!==ye||t[207]!==Ke||t[208]!==c||t[209]!==at||t[210]!==jt||t[211]!==V.length||t[212]!==et||t[213]!==o?(Rn=R?ye?V.length===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 completed turns yet.`}):(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)(`div`,{ref:ee,className:`diff-panel-viewport flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[qe&&!et&&(0,X.jsx)(`div`,{className:`px-3`,children:(0,X.jsx)(`p`,{className:`mb-2 text-[11px] text-red-500/80`,children:qe})}),et?et.kind===`files`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border/50 bg-card/40 px-2.5 py-1.5 [-webkit-app-region:no-drag]`,children:[(0,X.jsx)(bn,{className:`size-3.5 shrink-0 text-muted-foreground/70`}),(0,X.jsx)(`input`,{ref:M,type:`text`,value:C,onChange:e=>w(e.target.value),onKeyDown:e=>{if(e.key===`Escape`){w(``),e.currentTarget.blur();return}e.key===`Enter`&&at&&(e.preventDefault(),vt(e.shiftKey?-1:1))},placeholder:`Search files or hunks...`,"aria-label":`Search diff`,className:q(`min-w-0 flex-1 bg-transparent text-xs text-foreground outline-none placeholder:text-muted-foreground/55`,c&&`min-h-[44px]`)}),at&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{className:`shrink-0 text-[10px] tabular-nums text-muted-foreground/70`,children:[G.length===0?0:k+1,` of`,` `,G.length]}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:()=>vt(-1),disabled:G.length===0,className:q(`inline-flex size-5 cursor-pointer items-center justify-center rounded-sm text-muted-foreground/70 transition-colors hover:bg-foreground/10 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/70`,c&&`size-[44px]`),"aria-label":`Previous match`,title:`Previous match (Shift+Enter)`,children:(0,X.jsx)(Te,{className:`size-3.5`})}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>vt(1),disabled:G.length===0,className:q(`inline-flex size-5 cursor-pointer items-center justify-center rounded-sm text-muted-foreground/70 transition-colors hover:bg-foreground/10 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/70`,c&&`size-[44px]`),"aria-label":`Next match`,title:`Next match (Enter)`,children:(0,X.jsx)(xe,{className:`size-3.5`})})]})]}),C&&(0,X.jsx)(`button`,{type:`button`,onClick:()=>{w(``),M.current?.focus()},className:q(`inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground/70 transition-colors hover:bg-foreground/10 hover:text-foreground`,c&&`size-[44px]`),"aria-label":`Clear search`,title:`Clear search`,children:(0,X.jsx)(Dn,{className:`size-3`})})]}),ft.length===0?(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,X.jsxs)(`p`,{children:[`No files match “`,C,`”.`]})}):(0,X.jsx)(Pl,{className:q(`diff-render-surface min-h-0 flex-1 overflow-auto px-2 pb-2`,c&&`overflow-x-hidden overflow-y-auto overscroll-x-contain`),config:{overscrollSize:600,intersectionObserverMargin:1200},children:ft.map(e=>{let{fileDiff:t,fileIndex:n}=e,r=yu(t),i=Su(t),a=`${i}:${o}`,s=x.has(i);return(0,X.jsx)(`div`,{"data-diff-file-path":r,"data-diff-file-index":n,className:`diff-render-file group/diff-file mb-2 rounded-md first:mt-2 last:mb-0`,onClickCapture:c?void 0:e=>{(e.nativeEvent.composedPath?.()??[]).some(Lu)&&jt(r)},children:(0,X.jsx)(Ul,{fileDiff:t,renderHeaderPrefix:()=>(0,X.jsx)(`button`,{type:`button`,className:q(`inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-0 transition-colors hover:bg-foreground/10 focus-visible:outline-hidden`,c&&`size-[44px]`,Fu(t)),"aria-label":s?`Expand ${r}`:`Collapse ${r}`,"aria-expanded":!s,title:s?`Expand diff`:`Collapse diff`,onClick:e=>{e.stopPropagation(),Pt(i)},children:s?(0,X.jsx)(we,{className:`size-4`}):(0,X.jsx)(xe,{className:`size-4`})}),options:{collapsed:s,diffStyle:l===`split`?`split`:`unified`,lineDiffType:`none`,overflow:_?`wrap`:`scroll`,theme:Mt(o),themeType:o,unsafeCSS:c?_u:gu,lineHoverHighlight:`number`,...c?{}:{onLineNumberClick:e=>{let{lineNumber:t}=e;jt(r,t)}}}})},a)})})]}):(0,X.jsx)(`div`,{className:`flex-1 overflow-auto p-2`,children:(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{className:`text-[11px] text-muted-foreground/75`,children:et.reason}),(0,X.jsx)(`pre`,{className:q(`max-h-[72vh] rounded-md border border-border/70 bg-background/70 p-3 font-mono text-[11px] leading-relaxed text-muted-foreground/90`,_?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:et.text})]})}):Ke?(0,X.jsx)(rn,{label:`Loading checkpoint diff...`}):(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,X.jsx)(`p`,{children:Ze?`No net changes in this selection.`:`No patch available for this selection.`})})]})}):(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Turn diffs are unavailable because this project is not a git repository.`}):(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 inspect turn diffs.`}),t[195]=R,t[196]=qe,t[197]=x,t[198]=k,t[199]=l,t[200]=G.length,t[201]=C,t[202]=_,t[203]=ft,t[204]=vt,t[205]=Ze,t[206]=ye,t[207]=Ke,t[208]=c,t[209]=at,t[210]=jt,t[211]=V.length,t[212]=et,t[213]=o,t[214]=Rn):Rn=t[214];let zn;return t[215]!==In||t[216]!==i||t[217]!==Rn?(zn=(0,X.jsx)(Tt,{mode:i,header:In,children:Rn}),t[215]=In,t[216]=i,t[217]=Rn,t[218]=zn):zn=t[218],zn}function Lu(e){return e instanceof Element&&e.hasAttribute(`data-title`)}function Ru(e){return{...fe(e),diff:`1`}}function zu(e){console.warn(`Failed to open diff in editor.`,e)}function Bu(e){return e.size===0?e:new Set}function Vu(e,t){return{fileDiff:e,fileIndex:t}}function Hu(e){return e.turnId}function Uu(e){return typeof e==`number`}function Wu(e){return R(e)}function Gu(e){return ie(e)}function Ku(){return new Set}var qu=0,Ju=0,Yu=1,Xu=6e4,Zu=Object.freeze({data:null,isLoading:!1,isFetching:!1,error:null}),Qu=A({labelPrefix:`project-preview`,initialState:Zu,gcTime:Xu,maxEntries:48,buildFetchingState:e=>({data:e.data,isLoading:e.data===null,isFetching:!0,error:null}),buildSuccessState:e=>({data:e,isLoading:!1,isFetching:!1,error:null}),buildErrorState:(e,t)=>({data:e.data,isLoading:!1,isFetching:!1,error:t})});function $u(e,t=Yu){return e().catch(n=>{if(t<=0)throw n;return $u(e,t-1)})}function ed(e){return k(Qu,{...e,createControllerFields:()=>({})},e=>!e.hasData||Date.now()-e.lastFetchedAt>=e.staleTime)}function td(e){return w(e).projects}var nd=ed({label:`listEntries`,staleTime:qu,isEnabled:e=>(e.enabled??!0)&&e.environmentId!==null&&e.cwd!==null,buildKey:e=>`${e.environmentId}${e.cwd}`,resolveEnvironmentId:e=>e.environmentId,run:e=>$u(()=>td(e.environmentId).listEntries({cwd:e.cwd}))}),rd=ed({label:`readFile`,staleTime:Ju,isEnabled:e=>(e.enabled??!0)&&e.environmentId!==null&&e.cwd!==null&&e.relativePath!==null,buildKey:e=>`${e.environmentId}${e.cwd}${e.relativePath}`,resolveEnvironmentId:e=>e.environmentId,run:e=>$u(()=>td(e.environmentId).readFile({cwd:e.cwd,relativePath:e.relativePath}))});function id(e,t){let n=rd.keyOf(e);if(n===null)return;let r=Qu.controllers.get(n);r&&(r.hasData=!0,r.lastFetchedAt=Date.now()),Qu.setQueryState(n,{data:t,isLoading:!1,isFetching:!1,error:null})}function ad(e){let t=(0,Y.c)(18),{environmentId:n,cwd:r,enabled:i}=e,a=nd.keyOf(e),o,s;t[0]!==r||t[1]!==i||t[2]!==n?(o=()=>nd.watch({environmentId:n,cwd:r,...i===void 0?{}:{enabled:i}}),s=[n,r,i],t[0]=r,t[1]=i,t[2]=n,t[3]=o,t[4]=s):(o=t[3],s=t[4]),(0,J.useEffect)(o,s);let c=y(nd.getAtom(a)),l;bb0:{if(!c.data){l=null;break bb0}let e=c.data,n;t[5]===c.data.entries?n=t[6]:(n=c.data.entries.toSorted(sd),t[5]=c.data.entries,t[6]=n);let r;t[7]!==c.data||t[8]!==n?(r={...e,entries:n},t[7]=c.data,t[8]=n,t[9]=r):r=t[9],l=r}let u=l,d;t[10]===a?d=t[11]:(d=async()=>{let e=await nd.refreshAsync(a);return{data:e.data===null?null:{...e.data,entries:e.data.entries.toSorted(od)}}},t[10]=a,t[11]=d);let f=d,p;return t[12]!==f||t[13]!==u||t[14]!==c.error||t[15]!==c.isFetching||t[16]!==c.isLoading?(p={data:u,isLoading:c.isLoading,isFetching:c.isFetching,error:c.error,refetch:f},t[12]=f,t[13]=u,t[14]=c.error,t[15]=c.isFetching,t[16]=c.isLoading,t[17]=p):p=t[17],p}function od(e,t){return e.path.localeCompare(t.path,void 0,{numeric:!0,sensitivity:`base`})}function sd(e,t){return e.path.localeCompare(t.path,void 0,{numeric:!0,sensitivity:`base`})}function cd(e){let t=(0,Y.c)(14),{environmentId:n,cwd:r,relativePath:i,enabled:a}=e,o=rd.keyOf(e),s,c;t[0]!==r||t[1]!==a||t[2]!==n||t[3]!==i?(s=()=>rd.watch({environmentId:n,cwd:r,relativePath:i,...a===void 0?{}:{enabled:a}}),c=[n,r,i,a],t[0]=r,t[1]=a,t[2]=n,t[3]=i,t[4]=s,t[5]=c):(s=t[4],c=t[5]),(0,J.useEffect)(s,c);let l=y(rd.getAtom(o)),u;t[6]===o?u=t[7]:(u=async()=>({data:(await rd.refreshAsync(o)).data}),t[6]=o,t[7]=u);let d=u,f;return t[8]!==d||t[9]!==l.data||t[10]!==l.error||t[11]!==l.isFetching||t[12]!==l.isLoading?(f={data:l.data,isLoading:l.isLoading,isFetching:l.isFetching,error:l.error,refetch:d},t[8]=d,t[9]=l.data,t[10]=l.error,t[11]=l.isFetching,t[12]=l.isLoading,t[13]=f):f=t[13],f}var ld={},ud=(0,J.memo)(function(e){let t=(0,Y.c)(22),{files:n,allDirectoriesExpanded:r,onSelectFile:i,resolvedTheme:a,selectedFilePath:o,showStats:s}=e,c=o===void 0?null:o,l=s===void 0||s,u;t[0]===n?u=t[1]:(u=en(n),t[0]=n,t[1]=u);let d=u,f;t[2]===d?f=t[3]:(f=dd(d).join(`\0`),t[2]=d,t[3]=f);let p=`${r?`expanded`:`collapsed`}\u0000${f}`,m;t[4]===p?m=t[5]:(m=()=>({key:p,overrides:{}}),t[4]=p,t[5]=m);let[h,g]=(0,J.useState)(m),_=h.key===p?h.overrides:ld,v;t[6]!==r||t[7]!==p?(v=e=>{g(t=>{let n=t.key===p?t.overrides:{};return{key:p,overrides:{...n,[e]:!(n[e]??r)}}})},t[6]=r,t[7]=p,t[8]=v):v=t[8];let y=v,b,x;if(t[9]!==r||t[10]!==_||t[11]!==i||t[12]!==a||t[13]!==c||t[14]!==l||t[15]!==y||t[16]!==d){let e=(t,n)=>{let o=8+n*14;if(t.kind===`directory`){let i=_[t.path]??r;return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`button`,{type:`button`,"data-scroll-anchor-ignore":!0,className:`group/tree-row flex w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left hover:bg-background/80 phone:min-h-11`,style:{paddingLeft:`${o}px`},onClick:()=>y(t.path),children:[(0,X.jsx)(we,{"aria-hidden":`true`,className:q(`size-3.5 shrink-0 text-muted-foreground/70 transition-transform`,i&&`rotate-90`)}),i?(0,X.jsx)(H,{className:`size-3.5 shrink-0 text-muted-foreground/75`}):(0,X.jsx)(ke,{className:`size-3.5 shrink-0 text-muted-foreground/75`}),(0,X.jsx)(`span`,{"data-tree-label":!0,className:`truncate font-mono text-[11px] text-muted-foreground/90 group-hover/tree-row:text-foreground/90`,children:t.name}),l&&Kt(t.stat)&&(0,X.jsx)(`span`,{className:`ml-auto shrink-0 font-mono text-[10px] tabular-nums`,children:(0,X.jsx)(on,{additions:t.stat.additions,deletions:t.stat.deletions})})]}),i&&(0,X.jsx)(`div`,{className:`space-y-0.5`,children:t.children.map(t=>e(t,n+1))})]},`dir:${t.path}`)}return(0,X.jsxs)(`button`,{type:`button`,className:q(`group/tree-row flex w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left hover:bg-background/80 phone:min-h-11`,c===t.path&&`bg-accent text-accent-foreground hover:bg-accent`),style:{paddingLeft:`${o}px`},onClick:()=>i(t.path),children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,X.jsx)(Bt,{pathValue:t.path,kind:`file`,theme:a,className:`size-3.5 text-muted-foreground/70`}),(0,X.jsx)(`span`,{"data-tree-label":!0,className:q(`truncate font-mono text-[11px] text-muted-foreground/80 group-hover/tree-row:text-foreground/90`,c===t.path&&`text-accent-foreground`),children:t.name}),l&&t.stat&&(0,X.jsx)(`span`,{className:`ml-auto shrink-0 font-mono text-[10px] tabular-nums`,children:(0,X.jsx)(on,{additions:t.stat.additions,deletions:t.stat.deletions})})]},`file:${t.path}`)};b=`space-y-0.5`,x=d.map(t=>e(t,0)),t[9]=r,t[10]=_,t[11]=i,t[12]=a,t[13]=c,t[14]=l,t[15]=y,t[16]=d,t[17]=b,t[18]=x}else b=t[17],x=t[18];let S;return t[19]!==b||t[20]!==x?(S=(0,X.jsx)(`div`,{className:b,children:x}),t[19]=b,t[20]=x,t[21]=S):S=t[21],S});function dd(e){let t=[];for(let n of e)n.kind===`directory`&&(t.push(n.path),t.push(...dd(n.children)));return t}var fd=100,pd=1,md=2,hd=3,gd=class{#e=[];#t=[];#n;#r=!1;constructor(e){this.#n=Math.max(1,e?.maxEntries??fd)}get canUndo(){return this.#e.length>0}get canRedo(){return this.#t.length>0}clear(){this.#e.length=0,this.#t.length=0,this.#r=!1}clearRedo(){this.#t.length=0}push(e){this.#e.push(e),this.clearRedo(),this.#r=!0,this.#e.length>this.#n&&this.#e.shift()}setLastUndoSelectionsAfter(e){let t=this.#e[this.#e.length-1];t!==void 0&&(t.selectionsAfter=e.map(e=>({...e})))}setLastUndoLineAnnotations(e,t){let n=this.#e[this.#e.length-1];n!==void 0&&(n.lineAnnotationsBefore=e.slice(),n.lineAnnotationsAfter=t.slice())}peekUndo(){return this.#e[this.#e.length-1]}peekUndoForCoalescing(){return this.#r?this.peekUndo():void 0}replaceLastUndo(e){if(this.#e.length===0){this.push(e);return}this.#e[this.#e.length-1]=e,this.clearRedo(),this.#r=!0}popUndoToRedo(){let e=this.#e.pop();if(e!==void 0)return this.#t.push(e),this.#r=!1,e}popRedoToUndo(){let e=this.#t.pop();if(e!==void 0)return this.#e.push(e),this.#r=!1,e}};function _d(e,t,n,r,i,a,o,s){let c=[...t].sort((e,t)=>e.start-t.start),l=[],u;if(i?.length===c.length){let t=[];for(let n of i){if(n.start.line!==n.end.line||n.start.character!==n.end.character)break;t.push(e.offsetAt(n.start))}if(t.length===c.length){t.sort((e,t)=>e-t);let e=!0,n=!0;for(let r=0;r<c.length;r++){let i=c[r];if(i.text.length>0||i.start===i.end){e=!1,n=!1;break}e&&=t[r]===i.end,n&&=t[r]===i.start}u=e?md:n?hd:void 0}}for(let t=0,n=0;t<c.length;t++){let r=c[t],i=e.getTextSlice(r.start,r.end),a=r.start+n;l.push({start:a,end:a+r.text.length,text:i}),n+=r.text.length-(r.end-r.start)}return{forwardEdits:c.map(e=>({...e})),inverseEdits:l,versionBefore:n,versionAfter:r,selectionsBefore:i?.map(e=>({...e})),selectionsAfter:a?.map(e=>({...e})),lineAnnotationsBefore:o?.slice(),lineAnnotationsAfter:s?.slice(),coalescingMode:u}}function vd(e,t){if(e===void 0||e.undoBoundary===!0||t.undoBoundary===!0||e.forwardEdits.length===0||e.forwardEdits.length!==e.inverseEdits.length||e.forwardEdits.length!==t.forwardEdits.length||t.forwardEdits.length!==t.inverseEdits.length)return!1;let n;for(let r=0;r<e.forwardEdits.length;r++){let i=e.forwardEdits[r],a=e.inverseEdits[r],o=t.forwardEdits[r],s=t.inverseEdits[r],c=xd(o.start,e.forwardEdits),l=i.start<=i.end&&i.text.length>0&&!i.text.includes(`
1436
+ `,gu=`${pu}${mu}${hu}`,_u=`${pu}${hu}`;function vu(e,t=`diff-panel`){if(!e)return null;let n=e.trim();if(n.length===0)return null;try{let e=Hi(n,Wt(n,t)).flatMap(e=>e.files);return e.length>0?{kind:`files`,files:e}:{kind:`raw`,text:n,reason:`Unsupported diff format. Showing raw patch.`}}catch{return{kind:`raw`,text:n,reason:`Failed to parse patch. Showing raw patch.`}}}function yu(e){return Xl(e)}function bu(e){return!e||e.kind!==`files`?[]:e.files.toSorted((e,t)=>yu(e).localeCompare(yu(t),void 0,{numeric:!0,sensitivity:`base`}))}var xu=new Yl;function Su(e){return e.cacheKey??`${e.prevName??`none`}:${e.name}`}var Cu=`ryco-diff-search-match`,wu=150,Tu=80,Eu=1600;function Du(){return typeof CSS<`u`&&CSS.highlights!==void 0&&globalThis.Highlight!==void 0}function Ou(e,t,n=Eu){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();return r.bottom>=i.top-n&&r.top<=i.bottom+n&&r.right>=i.left-n&&r.left<=i.right+n}function ku(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(e){let t=e.parentElement;return t&&t.closest(`[data-line-number-content]`)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),r=n.nextNode(),i=0;for(;r;){let e=r,a=i+e.data.length;t.push({node:e,start:i,end:a}),i=a,r=n.nextNode()}return{offsets:t,textLength:i}}function Au(e,t,n){for(let r of e)if(!(t<r.start||t>r.end)&&(t!==r.end||n!==`start`))return{node:r.node,offset:t-r.start};return null}function ju(e,t,n){let{offsets:r,textLength:i}=ku(e);if(r.length===0||t.start<0||t.end>i||t.start>=t.end)return;let a=Au(r,t.start,`start`),o=Au(r,t.end,`end`);if(!a||!o)return;let s=document.createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset),n.push(s)}function Mu(e){let t=uu(e.lineIndexAttr);return t?e.matches.filter(n=>du(n,{renderMode:e.renderMode,lineIndexes:t,lineType:e.lineType})):[]}function Nu(e){if(cu(e.match,e.renderMode)===null)return null;let t=e.fileElement.querySelectorAll(`diffs-container`);for(let n of t){let t=n.shadowRoot?.querySelectorAll(`[data-line][data-line-index]`);for(let n of t??[]){let t=uu(n.getAttribute(`data-line-index`));if(t&&du(e.match,{renderMode:e.renderMode,lineIndexes:t,lineType:n.getAttribute(`data-line-type`)}))return n}}return null}function Pu(e){let t=[],n=e.rootElement.querySelectorAll(`[data-diff-file-index]`);for(let r of n){if(!Ou(r,e.viewportElement))continue;let n=r.dataset.diffFileIndex,i=n?Number.parseInt(n,10):NaN;if(!Number.isFinite(i))continue;let a=e.matchesByFileIndex.get(i);if(!a||a.length===0)continue;let o=r.querySelectorAll(`diffs-container`);for(let n of o){let r=n.shadowRoot?.querySelectorAll(`[data-line][data-line-index]`);for(let n of r??[]){if(!Ou(n,e.viewportElement))continue;let r=Mu({matches:a,renderMode:e.renderMode,lineIndexAttr:n.getAttribute(`data-line-index`),lineType:n.getAttribute(`data-line-type`)});for(let e of r)ju(n,e,t)}}}return t}function Fu(e){switch(e.type){case`new`:return`text-[var(--diffs-addition-base)]`;case`deleted`:return`text-[var(--diffs-deletion-base)]`;case`change`:case`rename-pure`:case`rename-changed`:return`text-[var(--diffs-modified-base)]`;default:return`text-muted-foreground/80`}}function Iu(e){let t=(0,Y.c)(219),{mode:n}=e,i=n===void 0?`inline`:n;Ce(`DiffPanel`);let a=ge(),{resolvedTheme:o}=ir(),s=h(),c=i===`phone`,[l,m]=(0,J.useState)(`stacked`),[_,v]=(0,J.useState)(c?!0:s.diffWordWrap),[y,b]=(0,J.useState)(s.diffIgnoreWhitespace),[x,S]=(0,J.useState)(Ku),[C,w]=(0,J.useState)(``),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T={wait:wu},t[0]=T):T=t[0];let[E]=j(C,T),D;t[1]!==E||t[2]!==C?(D=C.trim().length===0?``:E,t[1]=E,t[2]=C,t[3]=D):D=t[3];let O=D,[k,A]=(0,J.useState)(0),M=(0,J.useRef)(null),ee=(0,J.useRef)(null),N=(0,J.useRef)(null),te=(0,J.useRef)(!1),[P,ie]=(0,J.useState)(!1),[ae,se]=(0,J.useState)(!1),F;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(F={strict:!1,select:Gu},t[4]=F):F=t[4];let ce=re(F),le;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(le={strict:!1,select:Wu},t[5]=le):le=t[5];let ue=oe(le),de=ue.diff===`1`,I=ce?.threadId??null,L;t[6]===ce?L=t[7]:(L=f(ce),t[6]=ce,t[7]=L);let R=d(L),pe=R?.projectId??null,z;t[8]!==pe||t[9]!==R?(z=e=>R&&pe?p(e,{environmentId:R.environmentId,projectId:pe}):void 0,t[8]=pe,t[9]=R,t[10]=z):z=t[10];let me=d(z),he=R?.worktreePath??me?.cwd,B=R?.environmentId??null,_e=he??null,ve;t[11]!==B||t[12]!==_e?(ve={environmentId:B,cwd:_e},t[11]=B,t[12]=_e,t[13]=ve):ve=t[13];let ye=u(ve).data?.isRepo??!0,{turnDiffSummaries:be,inferredCheckpointTurnCountByTurnId:Ee}=Ht(R),De;if(t[14]!==Ee||t[15]!==be){let e;t[17]===Ee?e=t[18]:(e=(e,t)=>{let n=e.checkpointTurnCount??Ee[e.turnId]??0,r=t.checkpointTurnCount??Ee[t.turnId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n},t[17]=Ee,t[18]=e),De=[...be].toSorted(e),t[14]=Ee,t[15]=be,t[16]=De}else De=t[16];let V=De,Oe=ue.diffTurnId??null,ke=Oe===null?null:ue.diffFilePath??null,Ae;t[19]!==V||t[20]!==Oe?(Ae=Oe===null?void 0:V.find(e=>e.turnId===Oe)??V[0],t[19]=V,t[20]=Oe,t[21]=Ae):Ae=t[21];let H=Ae,U=H&&(H.checkpointTurnCount??Ee[H.turnId]),je;t[22]===U?je=t[23]:(je=typeof U==`number`?{fromTurnCount:Math.max(0,U-1),toTurnCount:U}:null,t[22]=U,t[23]=je);let Me=je,Ne;if(t[24]!==Ee||t[25]!==V){bb0:{let e;t[27]===Ee?e=t[28]:(e=e=>e.checkpointTurnCount??Ee[e.turnId],t[27]=Ee,t[28]=e);let n=V.map(e).filter(Uu);if(n.length===0){Ne=void 0;break bb0}let r=Math.max(...n);Ne=r>0?r:void 0}t[24]=Ee,t[25]=V,t[26]=Ne}else Ne=t[26];let Pe=Ne,Fe;t[29]!==Pe||t[30]!==H?(Fe=!H&&typeof Pe==`number`?{fromTurnCount:0,toTurnCount:Pe}:null,t[29]=Pe,t[30]=H,t[31]=Fe):Fe=t[31];let Ie=H?Me:Fe,Le;bb1:{if(H||V.length===0){Le=null;break bb1}let e;t[32]===V?e=t[33]:(e=V.map(Hu).join(`,`),t[32]=V,t[33]=e),Le=`conversation:${e}`}let Re=Le,ze=R?.environmentId??null,W=Ie?.fromTurnCount??null,Be=Ie?.toTurnCount??null,Ve=H?`turn:${H.turnId}`:Re,He;t[34]!==I||t[35]!==y||t[36]!==ye||t[37]!==ze||t[38]!==W||t[39]!==Be||t[40]!==Ve?(He={environmentId:ze,threadId:I,fromTurnCount:W,toTurnCount:Be,ignoreWhitespace:y,cacheScope:Ve,enabled:ye},t[34]=I,t[35]=y,t[36]=ye,t[37]=ze,t[38]=W,t[39]=Be,t[40]=Ve,t[41]=He):He=t[41];let Ue=Wl(He),We=H?Ue.data?.diff:void 0,Ge=H?void 0:Ue.data?.diff,Ke=Ue.isLoading,qe=Ue.error instanceof Error?Ue.error.message:Ue.error?`Failed to load checkpoint diff.`:null,Je=H?We:Ge,Ye=typeof Je==`string`,Xe;t[42]!==Ye||t[43]!==Je?(Xe=Ye&&Je.trim().length===0,t[42]=Ye,t[43]=Je,t[44]=Xe):Xe=t[44];let Ze=Xe,Qe;if(t[45]!==Re||t[46]!==o||t[47]!==Je||t[48]!==H){bb2:{let e=`diff-panel:${o}`,n=typeof Je==`string`?Je.trim():``;if(n.length===0){let e;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(e={patch:null,files:[]},t[50]=e):e=t[50],Qe=e;break bb2}let r={turnId:H?`turn:${H.turnId}`:Re??`conversation`,filePath:e,blobSha:Wt(n)},i=xu.get(r);if(i){Qe=i;break bb2}let a=vu(Je,e),s={patch:a,files:bu(a)};a&&xu.set(r,s),Qe=s}t[45]=Re,t[46]=o,t[47]=Je,t[48]=H,t[49]=Qe}else Qe=t[49];let $e=Qe,et=$e.patch,tt=$e.files,nt;t[51]===tt?nt=t[52]:(nt=tu(tt),t[51]=tt,t[52]=nt);let rt=nt,it;t[53]===O?it=t[54]:(it=Zl(O),t[53]=O,t[54]=it);let at=it,ot;t[55]!==rt||t[56]!==O?(ot=iu(rt,O),t[55]=rt,t[56]=O,t[57]=ot):ot=t[57];let G=ot,st;t[58]===G?st=t[59]:(st=ou(G),t[58]=G,t[59]=st);let ct=st,lt;t[60]===tt?lt=t[61]:(lt=tt.map(Vu),t[60]=tt,t[61]=lt);let ut=lt,dt;bb3:{if(!at){dt=ut;break bb3}let e;if(t[62]!==G||t[63]!==tt){let n;t[65]===tt?n=t[66]:(n=e=>({fileDiff:tt[e],fileIndex:e}),t[65]=tt,t[66]=n),e=au(G).map(n),t[62]=G,t[63]=tt,t[64]=e}else e=t[64];dt=e}let ft=dt,pt;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(pt=()=>{A(0)},t[67]=pt):pt=t[67];let mt;t[68]!==at||t[69]!==tt?(mt=[at,tt],t[68]=at,t[69]=tt,t[70]=mt):mt=t[70],(0,J.useEffect)(pt,mt);let ht,gt;t[71]===G.length?(ht=t[72],gt=t[73]):(ht=()=>{A(e=>G.length===0?0:Math.min(e,G.length-1))},gt=[G.length],t[71]=G.length,t[72]=ht,t[73]=gt),(0,J.useEffect)(ht,gt);let _t;t[74]!==k||t[75]!==l||t[76]!==G?(_t=e=>{if(G.length===0)return;let t=su(k,G.length,e);A(t);let n=G[t],r=ee.current;if(!n||!r)return;let i=r.querySelector(`[data-diff-file-index="${n.fileIndex}"]`);if(!i)return;let a=Nu({fileElement:i,match:n,renderMode:l});(a??i).scrollIntoView({block:`center`,behavior:`smooth`}),!a&&cu(n,l)!==null&&window.requestAnimationFrame(()=>{Nu({fileElement:i,match:n,renderMode:l})?.scrollIntoView({block:`center`,behavior:`smooth`})})},t[74]=k,t[75]=l,t[76]=G,t[77]=_t):_t=t[77];let vt=_t,yt,bt;t[78]!==l||t[79]!==G.length||t[80]!==ct||t[81]!==at?(yt=()=>{if(!Du())return;let e=CSS.highlights,t=ee.current;if(!t||!at||G.length===0){e.delete(Cu);return}let n=0,r=0,i=new Map,a=t.querySelector(`.diff-render-surface`)??t.querySelector(`[data-virtualizer]`)??t,o=()=>{n=0,c();let r=Pu({rootElement:t,viewportElement:a,matchesByFileIndex:ct,renderMode:l});if(r.length===0){e.delete(Cu);return}e.set(Cu,new Highlight(...r))},s=()=>{n===0&&r===0&&(r=window.setTimeout(()=>{r=0,n=window.requestAnimationFrame(o)},Tu))},c=()=>{let e=t.querySelectorAll(`[data-diff-file-index]`);for(let t of e){if(!Ou(t,a))continue;let e=t.querySelectorAll(`diffs-container`);for(let t of e){let e=t.shadowRoot;if(!e||i.has(e))continue;let n=new MutationObserver(s);n.observe(e,{childList:!0,subtree:!0}),i.set(e,n)}}},u=new MutationObserver(s);u.observe(t,{childList:!0,subtree:!0}),a.addEventListener(`scroll`,s,{passive:!0});let d=new ResizeObserver(s);return d.observe(a),s(),()=>{u.disconnect(),a.removeEventListener(`scroll`,s),d.disconnect();for(let e of i.values())e.disconnect();i.clear(),r!==0&&window.clearTimeout(r),n!==0&&window.cancelAnimationFrame(n),e.delete(Cu)}},bt=[l,G.length,ct,at],t[78]=l,t[79]=G.length,t[80]=ct,t[81]=at,t[82]=yt,t[83]=bt):(yt=t[82],bt=t[83]),(0,J.useEffect)(yt,bt);let xt,St;t[84]===tt?(xt=t[85],St=t[86]):(xt=()=>{if(tt.length===0){S(Bu);return}let e=new Set(tt.map(Su));S(t=>{let n=new Set([...t].filter(t=>e.has(t)));return n.size===t.size?t:n})},St=[tt],t[84]=tt,t[85]=xt,t[86]=St),(0,J.useEffect)(xt,St);let Ct,wt;t[87]!==de||t[88]!==c||t[89]!==s.diffIgnoreWhitespace||t[90]!==s.diffWordWrap?(Ct=()=>{de&&!te.current&&(v(c?!0:s.diffWordWrap),b(s.diffIgnoreWhitespace),w(``)),te.current=de},wt=[de,c,s.diffIgnoreWhitespace,s.diffWordWrap],t[87]=de,t[88]=c,t[89]=s.diffIgnoreWhitespace,t[90]=s.diffWordWrap,t[91]=Ct,t[92]=wt):(Ct=t[91],wt=t[92]),(0,J.useEffect)(Ct,wt);let Et;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(Et=()=>{w(``)},t[93]=Et):Et=t[93];let Dt;t[94]===Oe?Dt=t[95]:(Dt=[Oe],t[94]=Oe,t[95]=Dt),(0,J.useEffect)(Et,Dt);let Ot;t[96]===ke?Ot=t[97]:(Ot=()=>{!ke||!ee.current||Array.from(ee.current.querySelectorAll(`[data-diff-file-path]`)).find(e=>e.dataset.diffFilePath===ke)?.scrollIntoView({block:`nearest`})},t[96]=ke,t[97]=Ot);let kt;t[98]!==tt||t[99]!==ke?(kt=[ke,tt],t[98]=tt,t[99]=ke,t[100]=kt):kt=t[100],(0,J.useEffect)(Ot,kt);let At;t[101]===he?At=t[102]:(At=(e,t)=>{let n=g();if(!n)return;let r=fu({cwd:he,filePath:e,lineNumber:t});nr(n,r).catch(zu)},t[101]=he,t[102]=At);let jt=At,Nt;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=e=>{S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[103]=Nt):Nt=t[103];let Pt=Nt,Ft;t[104]!==R||t[105]!==a?(Ft=e=>{R&&a({to:`/$environmentId/$threadId`,params:ne(r(R.environmentId,R.id)),search:t=>({...fe(t),diff:`1`,diffTurnId:e})})},t[104]=R,t[105]=a,t[106]=Ft):Ft=t[106];let It=Ft,Lt;t[107]!==R||t[108]!==a?(Lt=()=>{R&&a({to:`/$environmentId/$threadId`,params:ne(r(R.environmentId,R.id)),search:Ru})},t[107]=R,t[108]=a,t[109]=Lt):Lt=t[109];let Rt=Lt,zt;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(zt=()=>{let e=N.current;if(!e){ie(!1),se(!1);return}let t=Math.max(0,e.scrollWidth-e.clientWidth);ie(e.scrollLeft>4),se(e.scrollLeft<t-4)},t[110]=zt):zt=t[110];let Bt=zt,Vt;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(Vt=e=>{let t=N.current;t&&t.scrollBy({left:e,behavior:`smooth`})},t[111]=Vt):Vt=t[111];let Ut=Vt,Gt;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(Gt=e=>{let t=N.current;t&&(t.scrollWidth<=t.clientWidth+1||Math.abs(e.deltaY)<=Math.abs(e.deltaX)||(e.preventDefault(),t.scrollBy({left:e.deltaY,behavior:`auto`})))},t[112]=Gt):Gt=t[112];let Kt=Gt,qt,Jt;t[113]===Symbol.for(`react.memo_cache_sentinel`)?(qt=()=>{let e=N.current;if(!e)return;let t=window.requestAnimationFrame(()=>Bt()),n=()=>Bt();e.addEventListener(`scroll`,n,{passive:!0});let r=new ResizeObserver(()=>Bt());return r.observe(e),()=>{window.cancelAnimationFrame(t),e.removeEventListener(`scroll`,n),r.disconnect()}},Jt=[Bt],t[113]=qt,t[114]=Jt):(qt=t[113],Jt=t[114]),(0,J.useEffect)(qt,Jt);let Yt;t[115]===Symbol.for(`react.memo_cache_sentinel`)?(Yt=()=>{let e=window.requestAnimationFrame(()=>Bt());return()=>{window.cancelAnimationFrame(e)}},t[115]=Yt):Yt=t[115];let Xt;t[116]!==V||t[117]!==Oe?(Xt=[V,Oe,Bt],t[116]=V,t[117]=Oe,t[118]=Xt):Xt=t[118],(0,J.useEffect)(Yt,Xt);let Zt;t[119]===Symbol.for(`react.memo_cache_sentinel`)?(Zt=()=>{let e=N.current;e&&e.querySelector(`[data-turn-chip-selected='true']`)?.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`smooth`})},t[119]=Zt):Zt=t[119];let Qt=H?.turnId,$t;t[120]!==Oe||t[121]!==Qt?($t=[Qt,Oe],t[120]=Oe,t[121]=Qt,t[122]=$t):$t=t[122],(0,J.useEffect)(Zt,$t);let en;t[123]!==P||t[124]!==ae||t[125]!==c?(en=c?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{type:`button`,className:q(`absolute left-0 top-1/2 z-20 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-md border bg-background/90 text-muted-foreground transition-colors`,P?`border-border/70 hover:border-border hover:text-foreground`:`cursor-not-allowed border-border/40 text-muted-foreground/40`),onClick:()=>Ut(-180),disabled:!P,"aria-label":`Scroll turn list left`,children:(0,X.jsx)(Se,{className:`size-3.5`})}),(0,X.jsx)(`button`,{type:`button`,className:q(`absolute right-0 top-1/2 z-20 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-md border bg-background/90 text-muted-foreground transition-colors`,ae?`border-border/70 hover:border-border hover:text-foreground`:`cursor-not-allowed border-border/40 text-muted-foreground/40`),onClick:()=>Ut(180),disabled:!ae,"aria-label":`Scroll turn list right`,children:(0,X.jsx)(we,{className:`size-3.5`})})]}),t[123]=P,t[124]=ae,t[125]=c,t[126]=en):en=t[126];let tn=c?`px-1`:`px-8`,nn;t[127]===tn?nn=t[128]:(nn=q(`turn-chip-strip flex gap-1 overflow-x-auto py-0.5`,tn),t[127]=tn,t[128]=nn);let an;t[129]!==P||t[130]!==ae||t[131]!==c?(an=!c&&(P||ae)?{maskImage:`linear-gradient(to right, ${P?`transparent 24px, black 72px`:`black`}, ${ae?`black calc(100% - 72px), transparent calc(100% - 24px)`:`black`})`}:void 0,t[129]=P,t[130]=ae,t[131]=c,t[132]=an):an=t[132];let on=c&&`min-h-[44px]`,sn;t[133]===on?sn=t[134]:(sn=q(`shrink-0 rounded-md`,on),t[133]=on,t[134]=sn);let cn=Oe===null,ln=c&&`flex min-h-[44px] items-center`,un=Oe===null?`border-border bg-accent text-accent-foreground`:`border-border/70 bg-background/70 text-muted-foreground/80 hover:border-border hover:text-foreground/80`,dn;t[135]!==ln||t[136]!==un?(dn=q(`rounded-md border px-2 py-1 text-left transition-colors`,ln,un),t[135]=ln,t[136]=un,t[137]=dn):dn=t[137];let fn;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(fn=(0,X.jsx)(`div`,{className:`text-[10px] leading-tight font-medium`,children:`All turns`}),t[138]=fn):fn=t[138];let K;t[139]===dn?K=t[140]:(K=(0,X.jsx)(`div`,{className:dn,children:fn}),t[139]=dn,t[140]=K);let pn;t[141]!==Rt||t[142]!==sn||t[143]!==cn||t[144]!==K?(pn=(0,X.jsx)(`button`,{type:`button`,className:sn,onClick:Rt,"data-turn-chip-selected":cn,children:K}),t[141]=Rt,t[142]=sn,t[143]=cn,t[144]=K,t[145]=pn):pn=t[145];let mn;if(t[146]!==Ee||t[147]!==c||t[148]!==V||t[149]!==It||t[150]!==H?.turnId||t[151]!==s.timestampFormat){let e;t[153]!==Ee||t[154]!==c||t[155]!==It||t[156]!==H?.turnId||t[157]!==s.timestampFormat?(e=e=>(0,X.jsx)(`button`,{type:`button`,className:q(`shrink-0 rounded-md`,c&&`min-h-[44px]`),onClick:()=>It(e.turnId),title:e.turnId,"data-turn-chip-selected":e.turnId===H?.turnId,children:(0,X.jsx)(`div`,{className:q(`rounded-md border px-2 py-1 text-left transition-colors`,c&&`flex min-h-[44px] items-center`,e.turnId===H?.turnId?`border-border bg-accent text-accent-foreground`:`border-border/70 bg-background/70 text-muted-foreground/80 hover:border-border hover:text-foreground/80`),children:(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsxs)(`span`,{className:`text-[10px] leading-tight font-medium`,children:[`Turn`,` `,e.checkpointTurnCount??Ee[e.turnId]??`?`]}),(0,X.jsx)(`span`,{className:`text-[9px] leading-tight opacity-70`,children:Ln(e.completedAt,s.timestampFormat)})]})})},e.turnId),t[153]=Ee,t[154]=c,t[155]=It,t[156]=H?.turnId,t[157]=s.timestampFormat,t[158]=e):e=t[158],mn=V.map(e),t[146]=Ee,t[147]=c,t[148]=V,t[149]=It,t[150]=H?.turnId,t[151]=s.timestampFormat,t[152]=mn}else mn=t[152];let hn;t[159]!==nn||t[160]!==an||t[161]!==pn||t[162]!==mn?(hn=(0,X.jsxs)(`div`,{ref:N,className:nn,style:an,onWheel:Kt,children:[pn,mn]}),t[159]=nn,t[160]=an,t[161]=pn,t[162]=mn,t[163]=hn):hn=t[163];let gn;t[164]!==en||t[165]!==hn?(gn=(0,X.jsxs)(`div`,{className:`relative min-w-0 flex-1 [-webkit-app-region:no-drag]`,children:[en,hn]}),t[164]=en,t[165]=hn,t[166]=gn):gn=t[166];let _n;t[167]!==l||t[168]!==c?(_n=c?null:(0,X.jsxs)(ar,{className:`shrink-0`,variant:`outline`,size:`xs`,value:[l],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&m(t)},children:[(0,X.jsx)(or,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,X.jsx)(Tr,{className:`size-3`})}),(0,X.jsx)(or,{"aria-label":`Split diff view`,value:`split`,children:(0,X.jsx)(pr,{className:`size-3`})})]}),t[167]=l,t[168]=c,t[169]=_n):_n=t[169];let vn=_?`Disable diff line wrapping`:`Enable diff line wrapping`,yn=_?`Disable line wrapping`:`Enable line wrapping`,xn=c&&`min-h-[44px] min-w-[44px]`,Sn;t[170]===xn?Sn=t[171]:(Sn=q(xn),t[170]=xn,t[171]=Sn);let Cn,wn;t[172]===Symbol.for(`react.memo_cache_sentinel`)?(Cn=e=>{v(!!e)},wn=(0,X.jsx)(Er,{className:`size-3`}),t[172]=Cn,t[173]=wn):(Cn=t[172],wn=t[173]);let Tn;t[174]!==_||t[175]!==vn||t[176]!==yn||t[177]!==Sn?(Tn=(0,X.jsx)(or,{"aria-label":vn,title:yn,variant:`outline`,size:`xs`,className:Sn,pressed:_,onPressedChange:Cn,children:wn}),t[174]=_,t[175]=vn,t[176]=yn,t[177]=Sn,t[178]=Tn):Tn=t[178];let En=y?`Show whitespace changes`:`Hide whitespace changes`,On=y?`Show whitespace changes`:`Hide whitespace changes`,kn=c&&`min-h-[44px] min-w-[44px]`,An;t[179]===kn?An=t[180]:(An=q(kn),t[179]=kn,t[180]=An);let jn,Mn;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(jn=e=>{b(!!e)},Mn=(0,X.jsx)(Cr,{className:`size-3`}),t[181]=jn,t[182]=Mn):(jn=t[181],Mn=t[182]);let Nn;t[183]!==y||t[184]!==En||t[185]!==On||t[186]!==An?(Nn=(0,X.jsx)(or,{"aria-label":En,title:On,variant:`outline`,size:`xs`,className:An,pressed:y,onPressedChange:jn,children:Mn}),t[183]=y,t[184]=En,t[185]=On,t[186]=An,t[187]=Nn):Nn=t[187];let Pn;t[188]!==_n||t[189]!==Tn||t[190]!==Nn?(Pn=(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[_n,Tn,Nn]}),t[188]=_n,t[189]=Tn,t[190]=Nn,t[191]=Pn):Pn=t[191];let Fn;t[192]!==gn||t[193]!==Pn?(Fn=(0,X.jsxs)(X.Fragment,{children:[gn,Pn]}),t[192]=gn,t[193]=Pn,t[194]=Fn):Fn=t[194];let In=Fn,Rn;t[195]!==R||t[196]!==qe||t[197]!==x||t[198]!==k||t[199]!==l||t[200]!==G.length||t[201]!==C||t[202]!==_||t[203]!==ft||t[204]!==vt||t[205]!==Ze||t[206]!==ye||t[207]!==Ke||t[208]!==c||t[209]!==at||t[210]!==jt||t[211]!==V.length||t[212]!==et||t[213]!==o?(Rn=R?ye?V.length===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 completed turns yet.`}):(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)(`div`,{ref:ee,className:`diff-panel-viewport flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[qe&&!et&&(0,X.jsx)(`div`,{className:`px-3`,children:(0,X.jsx)(`p`,{className:`mb-2 text-[11px] text-red-500/80`,children:qe})}),et?et.kind===`files`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border/50 bg-card/40 px-2.5 py-1.5 [-webkit-app-region:no-drag]`,children:[(0,X.jsx)(bn,{className:`size-3.5 shrink-0 text-muted-foreground/70`}),(0,X.jsx)(`input`,{ref:M,type:`text`,value:C,onChange:e=>w(e.target.value),onKeyDown:e=>{if(e.key===`Escape`){w(``),e.currentTarget.blur();return}e.key===`Enter`&&at&&(e.preventDefault(),vt(e.shiftKey?-1:1))},placeholder:`Search files or hunks...`,"aria-label":`Search diff`,className:q(`min-w-0 flex-1 bg-transparent text-xs text-foreground outline-none placeholder:text-muted-foreground/55`,c&&`min-h-[44px]`)}),at&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{className:`shrink-0 text-[10px] tabular-nums text-muted-foreground/70`,children:[G.length===0?0:k+1,` of`,` `,G.length]}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:()=>vt(-1),disabled:G.length===0,className:q(`inline-flex size-5 cursor-pointer items-center justify-center rounded-sm text-muted-foreground/70 transition-colors hover:bg-foreground/10 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/70`,c&&`size-[44px]`),"aria-label":`Previous match`,title:`Previous match (Shift+Enter)`,children:(0,X.jsx)(Te,{className:`size-3.5`})}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>vt(1),disabled:G.length===0,className:q(`inline-flex size-5 cursor-pointer items-center justify-center rounded-sm text-muted-foreground/70 transition-colors hover:bg-foreground/10 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/70`,c&&`size-[44px]`),"aria-label":`Next match`,title:`Next match (Enter)`,children:(0,X.jsx)(xe,{className:`size-3.5`})})]})]}),C&&(0,X.jsx)(`button`,{type:`button`,onClick:()=>{w(``),M.current?.focus()},className:q(`inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground/70 transition-colors hover:bg-foreground/10 hover:text-foreground`,c&&`size-[44px]`),"aria-label":`Clear search`,title:`Clear search`,children:(0,X.jsx)(Dn,{className:`size-3`})})]}),ft.length===0?(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,X.jsxs)(`p`,{children:[`No files match “`,C,`”.`]})}):(0,X.jsx)(Pl,{className:q(`diff-render-surface min-h-0 flex-1 overflow-auto px-2 pb-2`,c&&`overflow-x-hidden overflow-y-auto overscroll-x-contain`),config:{overscrollSize:600,intersectionObserverMargin:1200},children:ft.map(e=>{let{fileDiff:t,fileIndex:n}=e,r=yu(t),i=Su(t),a=`${i}:${o}`,s=x.has(i);return(0,X.jsx)(`div`,{"data-diff-file-path":r,"data-diff-file-index":n,className:`diff-render-file group/diff-file mb-2 rounded-md first:mt-2 last:mb-0`,onClickCapture:c?void 0:e=>{(e.nativeEvent.composedPath?.()??[]).some(Lu)&&jt(r)},children:(0,X.jsx)(Ul,{fileDiff:t,renderHeaderPrefix:()=>(0,X.jsx)(`button`,{type:`button`,className:q(`inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-0 transition-colors hover:bg-foreground/10 focus-visible:outline-hidden`,c&&`size-[44px]`,Fu(t)),"aria-label":s?`Expand ${r}`:`Collapse ${r}`,"aria-expanded":!s,title:s?`Expand diff`:`Collapse diff`,onClick:e=>{e.stopPropagation(),Pt(i)},children:s?(0,X.jsx)(we,{className:`size-4`}):(0,X.jsx)(xe,{className:`size-4`})}),options:{collapsed:s,diffStyle:l===`split`?`split`:`unified`,lineDiffType:`none`,overflow:_?`wrap`:`scroll`,theme:Mt(o),themeType:o,unsafeCSS:c?_u:gu,lineHoverHighlight:`number`,...c?{}:{onLineNumberClick:e=>{let{lineNumber:t}=e;jt(r,t)}}}})},a)})})]}):(0,X.jsx)(`div`,{className:`flex-1 overflow-auto p-2`,children:(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{className:`text-[11px] text-muted-foreground/75`,children:et.reason}),(0,X.jsx)(`pre`,{className:q(`max-h-[72vh] rounded-md border border-border/70 bg-background/70 p-3 font-mono text-[11px] leading-relaxed text-muted-foreground/90`,_?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:et.text})]})}):Ke?(0,X.jsx)(rn,{label:`Loading checkpoint diff...`}):(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,X.jsx)(`p`,{children:Ze?`No net changes in this selection.`:`No patch available for this selection.`})})]})}):(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Turn diffs are unavailable because this project is not a git repository.`}):(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 inspect turn diffs.`}),t[195]=R,t[196]=qe,t[197]=x,t[198]=k,t[199]=l,t[200]=G.length,t[201]=C,t[202]=_,t[203]=ft,t[204]=vt,t[205]=Ze,t[206]=ye,t[207]=Ke,t[208]=c,t[209]=at,t[210]=jt,t[211]=V.length,t[212]=et,t[213]=o,t[214]=Rn):Rn=t[214];let zn;return t[215]!==In||t[216]!==i||t[217]!==Rn?(zn=(0,X.jsx)(Tt,{mode:i,header:In,children:Rn}),t[215]=In,t[216]=i,t[217]=Rn,t[218]=zn):zn=t[218],zn}function Lu(e){return e instanceof Element&&e.hasAttribute(`data-title`)}function Ru(e){return{...fe(e),diff:`1`}}function zu(e){console.warn(`Failed to open diff in editor.`,e)}function Bu(e){return e.size===0?e:new Set}function Vu(e,t){return{fileDiff:e,fileIndex:t}}function Hu(e){return e.turnId}function Uu(e){return typeof e==`number`}function Wu(e){return R(e)}function Gu(e){return ie(e)}function Ku(){return new Set}var qu=0,Ju=0,Yu=1,Xu=6e4,Zu=Object.freeze({data:null,isLoading:!1,isFetching:!1,error:null}),Qu=A({labelPrefix:`project-preview`,initialState:Zu,gcTime:Xu,maxEntries:48,buildFetchingState:e=>({data:e.data,isLoading:e.data===null,isFetching:!0,error:null}),buildSuccessState:e=>({data:e,isLoading:!1,isFetching:!1,error:null}),buildErrorState:(e,t)=>({data:e.data,isLoading:!1,isFetching:!1,error:t}),isErrorState:e=>e.error!==null});function $u(e,t=Yu){return e().catch(n=>{if(t<=0)throw n;return $u(e,t-1)})}function ed(e){return k(Qu,{...e,createControllerFields:()=>({})},e=>!e.hasData||Date.now()-e.lastFetchedAt>=e.staleTime)}function td(e){return w(e).projects}var nd=ed({label:`listEntries`,staleTime:qu,isEnabled:e=>(e.enabled??!0)&&e.environmentId!==null&&e.cwd!==null,buildKey:e=>`${e.environmentId}${e.cwd}`,resolveEnvironmentId:e=>e.environmentId,run:e=>$u(()=>td(e.environmentId).listEntries({cwd:e.cwd}))}),rd=ed({label:`readFile`,staleTime:Ju,isEnabled:e=>(e.enabled??!0)&&e.environmentId!==null&&e.cwd!==null&&e.relativePath!==null,buildKey:e=>`${e.environmentId}${e.cwd}${e.relativePath}`,resolveEnvironmentId:e=>e.environmentId,run:e=>$u(()=>td(e.environmentId).readFile({cwd:e.cwd,relativePath:e.relativePath}))});function id(e,t){let n=rd.keyOf(e);if(n===null)return;let r=Qu.controllers.get(n);r&&(r.hasData=!0,r.lastFetchedAt=Date.now()),Qu.setQueryState(n,{data:t,isLoading:!1,isFetching:!1,error:null})}function ad(e){let t=(0,Y.c)(18),{environmentId:n,cwd:r,enabled:i}=e,a=nd.keyOf(e),o,s;t[0]!==r||t[1]!==i||t[2]!==n?(o=()=>nd.watch({environmentId:n,cwd:r,...i===void 0?{}:{enabled:i}}),s=[n,r,i],t[0]=r,t[1]=i,t[2]=n,t[3]=o,t[4]=s):(o=t[3],s=t[4]),(0,J.useEffect)(o,s);let c=y(nd.getAtom(a)),l;bb0:{if(!c.data){l=null;break bb0}let e=c.data,n;t[5]===c.data.entries?n=t[6]:(n=c.data.entries.toSorted(sd),t[5]=c.data.entries,t[6]=n);let r;t[7]!==c.data||t[8]!==n?(r={...e,entries:n},t[7]=c.data,t[8]=n,t[9]=r):r=t[9],l=r}let u=l,d;t[10]===a?d=t[11]:(d=async()=>{let e=await nd.refreshAsync(a);return{data:e.data===null?null:{...e.data,entries:e.data.entries.toSorted(od)}}},t[10]=a,t[11]=d);let f=d,p;return t[12]!==f||t[13]!==u||t[14]!==c.error||t[15]!==c.isFetching||t[16]!==c.isLoading?(p={data:u,isLoading:c.isLoading,isFetching:c.isFetching,error:c.error,refetch:f},t[12]=f,t[13]=u,t[14]=c.error,t[15]=c.isFetching,t[16]=c.isLoading,t[17]=p):p=t[17],p}function od(e,t){return e.path.localeCompare(t.path,void 0,{numeric:!0,sensitivity:`base`})}function sd(e,t){return e.path.localeCompare(t.path,void 0,{numeric:!0,sensitivity:`base`})}function cd(e){let t=(0,Y.c)(14),{environmentId:n,cwd:r,relativePath:i,enabled:a}=e,o=rd.keyOf(e),s,c;t[0]!==r||t[1]!==a||t[2]!==n||t[3]!==i?(s=()=>rd.watch({environmentId:n,cwd:r,relativePath:i,...a===void 0?{}:{enabled:a}}),c=[n,r,i,a],t[0]=r,t[1]=a,t[2]=n,t[3]=i,t[4]=s,t[5]=c):(s=t[4],c=t[5]),(0,J.useEffect)(s,c);let l=y(rd.getAtom(o)),u;t[6]===o?u=t[7]:(u=async()=>({data:(await rd.refreshAsync(o)).data}),t[6]=o,t[7]=u);let d=u,f;return t[8]!==d||t[9]!==l.data||t[10]!==l.error||t[11]!==l.isFetching||t[12]!==l.isLoading?(f={data:l.data,isLoading:l.isLoading,isFetching:l.isFetching,error:l.error,refetch:d},t[8]=d,t[9]=l.data,t[10]=l.error,t[11]=l.isFetching,t[12]=l.isLoading,t[13]=f):f=t[13],f}var ld={},ud=(0,J.memo)(function(e){let t=(0,Y.c)(22),{files:n,allDirectoriesExpanded:r,onSelectFile:i,resolvedTheme:a,selectedFilePath:o,showStats:s}=e,c=o===void 0?null:o,l=s===void 0||s,u;t[0]===n?u=t[1]:(u=en(n),t[0]=n,t[1]=u);let d=u,f;t[2]===d?f=t[3]:(f=dd(d).join(`\0`),t[2]=d,t[3]=f);let p=`${r?`expanded`:`collapsed`}\u0000${f}`,m;t[4]===p?m=t[5]:(m=()=>({key:p,overrides:{}}),t[4]=p,t[5]=m);let[h,g]=(0,J.useState)(m),_=h.key===p?h.overrides:ld,v;t[6]!==r||t[7]!==p?(v=e=>{g(t=>{let n=t.key===p?t.overrides:{};return{key:p,overrides:{...n,[e]:!(n[e]??r)}}})},t[6]=r,t[7]=p,t[8]=v):v=t[8];let y=v,b,x;if(t[9]!==r||t[10]!==_||t[11]!==i||t[12]!==a||t[13]!==c||t[14]!==l||t[15]!==y||t[16]!==d){let e=(t,n)=>{let o=8+n*14;if(t.kind===`directory`){let i=_[t.path]??r;return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`button`,{type:`button`,"data-scroll-anchor-ignore":!0,className:`group/tree-row flex w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left hover:bg-background/80 phone:min-h-11`,style:{paddingLeft:`${o}px`},onClick:()=>y(t.path),children:[(0,X.jsx)(we,{"aria-hidden":`true`,className:q(`size-3.5 shrink-0 text-muted-foreground/70 transition-transform`,i&&`rotate-90`)}),i?(0,X.jsx)(H,{className:`size-3.5 shrink-0 text-muted-foreground/75`}):(0,X.jsx)(ke,{className:`size-3.5 shrink-0 text-muted-foreground/75`}),(0,X.jsx)(`span`,{"data-tree-label":!0,className:`truncate font-mono text-[11px] text-muted-foreground/90 group-hover/tree-row:text-foreground/90`,children:t.name}),l&&Kt(t.stat)&&(0,X.jsx)(`span`,{className:`ml-auto shrink-0 font-mono text-[10px] tabular-nums`,children:(0,X.jsx)(on,{additions:t.stat.additions,deletions:t.stat.deletions})})]}),i&&(0,X.jsx)(`div`,{className:`space-y-0.5`,children:t.children.map(t=>e(t,n+1))})]},`dir:${t.path}`)}return(0,X.jsxs)(`button`,{type:`button`,className:q(`group/tree-row flex w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left hover:bg-background/80 phone:min-h-11`,c===t.path&&`bg-accent text-accent-foreground hover:bg-accent`),style:{paddingLeft:`${o}px`},onClick:()=>i(t.path),children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,X.jsx)(Bt,{pathValue:t.path,kind:`file`,theme:a,className:`size-3.5 text-muted-foreground/70`}),(0,X.jsx)(`span`,{"data-tree-label":!0,className:q(`truncate font-mono text-[11px] text-muted-foreground/80 group-hover/tree-row:text-foreground/90`,c===t.path&&`text-accent-foreground`),children:t.name}),l&&t.stat&&(0,X.jsx)(`span`,{className:`ml-auto shrink-0 font-mono text-[10px] tabular-nums`,children:(0,X.jsx)(on,{additions:t.stat.additions,deletions:t.stat.deletions})})]},`file:${t.path}`)};b=`space-y-0.5`,x=d.map(t=>e(t,0)),t[9]=r,t[10]=_,t[11]=i,t[12]=a,t[13]=c,t[14]=l,t[15]=y,t[16]=d,t[17]=b,t[18]=x}else b=t[17],x=t[18];let S;return t[19]!==b||t[20]!==x?(S=(0,X.jsx)(`div`,{className:b,children:x}),t[19]=b,t[20]=x,t[21]=S):S=t[21],S});function dd(e){let t=[];for(let n of e)n.kind===`directory`&&(t.push(n.path),t.push(...dd(n.children)));return t}var fd=100,pd=1,md=2,hd=3,gd=class{#e=[];#t=[];#n;#r=!1;constructor(e){this.#n=Math.max(1,e?.maxEntries??fd)}get canUndo(){return this.#e.length>0}get canRedo(){return this.#t.length>0}clear(){this.#e.length=0,this.#t.length=0,this.#r=!1}clearRedo(){this.#t.length=0}push(e){this.#e.push(e),this.clearRedo(),this.#r=!0,this.#e.length>this.#n&&this.#e.shift()}setLastUndoSelectionsAfter(e){let t=this.#e[this.#e.length-1];t!==void 0&&(t.selectionsAfter=e.map(e=>({...e})))}setLastUndoLineAnnotations(e,t){let n=this.#e[this.#e.length-1];n!==void 0&&(n.lineAnnotationsBefore=e.slice(),n.lineAnnotationsAfter=t.slice())}peekUndo(){return this.#e[this.#e.length-1]}peekUndoForCoalescing(){return this.#r?this.peekUndo():void 0}replaceLastUndo(e){if(this.#e.length===0){this.push(e);return}this.#e[this.#e.length-1]=e,this.clearRedo(),this.#r=!0}popUndoToRedo(){let e=this.#e.pop();if(e!==void 0)return this.#t.push(e),this.#r=!1,e}popRedoToUndo(){let e=this.#t.pop();if(e!==void 0)return this.#e.push(e),this.#r=!1,e}};function _d(e,t,n,r,i,a,o,s){let c=[...t].sort((e,t)=>e.start-t.start),l=[],u;if(i?.length===c.length){let t=[];for(let n of i){if(n.start.line!==n.end.line||n.start.character!==n.end.character)break;t.push(e.offsetAt(n.start))}if(t.length===c.length){t.sort((e,t)=>e-t);let e=!0,n=!0;for(let r=0;r<c.length;r++){let i=c[r];if(i.text.length>0||i.start===i.end){e=!1,n=!1;break}e&&=t[r]===i.end,n&&=t[r]===i.start}u=e?md:n?hd:void 0}}for(let t=0,n=0;t<c.length;t++){let r=c[t],i=e.getTextSlice(r.start,r.end),a=r.start+n;l.push({start:a,end:a+r.text.length,text:i}),n+=r.text.length-(r.end-r.start)}return{forwardEdits:c.map(e=>({...e})),inverseEdits:l,versionBefore:n,versionAfter:r,selectionsBefore:i?.map(e=>({...e})),selectionsAfter:a?.map(e=>({...e})),lineAnnotationsBefore:o?.slice(),lineAnnotationsAfter:s?.slice(),coalescingMode:u}}function vd(e,t){if(e===void 0||e.undoBoundary===!0||t.undoBoundary===!0||e.forwardEdits.length===0||e.forwardEdits.length!==e.inverseEdits.length||e.forwardEdits.length!==t.forwardEdits.length||t.forwardEdits.length!==t.inverseEdits.length)return!1;let n;for(let r=0;r<e.forwardEdits.length;r++){let i=e.forwardEdits[r],a=e.inverseEdits[r],o=t.forwardEdits[r],s=t.inverseEdits[r],c=xd(o.start,e.forwardEdits),l=i.start<=i.end&&i.text.length>0&&!i.text.includes(`
1437
1437
  `)&&!a.text.includes(`
1438
1438
  `),u=o.start===o.end&&o.text.length>0&&!o.text.includes(`
1439
1439
  `)&&s.text.length===0;if(l&&u){if(o.start!==a.end||(n??=pd,n!==pd||e.coalescingMode!==void 0&&e.coalescingMode!==pd||t.coalescingMode!==void 0&&t.coalescingMode!==pd))return!1;continue}let d=i.text.length===0&&i.end>i.start&&a.text.length>0,f=o.text.length===0&&o.end>o.start&&s.text.length>0;if(d&&f){let r;if(c===i.end)r=hd;else if(c+(o.end-o.start)!==i.start)return!1;else r=md;if(n??=r,n!==r||e.coalescingMode!==void 0&&e.coalescingMode!==r||t.coalescingMode!==void 0&&t.coalescingMode!==r)return!1;continue}return!1}return n!==void 0}function yd(e,t){let n=[],r=[],i;for(let a=0;a<e.forwardEdits.length;a++){let o=e.forwardEdits[a],s=e.inverseEdits[a],c=t.forwardEdits[a],l=t.inverseEdits[a],u=xd(c.start,e.forwardEdits);if(o.text.length>0){i??=pd,n.push({start:o.start,end:o.end,text:o.text+c.text}),r.push(s.text);continue}if(u===o.end){i??=hd,n.push({start:o.start,end:u+(c.end-c.start),text:``}),r.push(s.text+l.text);continue}i??=md,n.push({start:Math.min(o.start,u),end:o.end,text:``}),r.push(l.text+s.text)}return{forwardEdits:n,inverseEdits:bd(n,r),versionBefore:e.versionBefore,versionAfter:t.versionAfter,selectionsBefore:e.selectionsBefore?.slice(),selectionsAfter:t.selectionsAfter?.slice(),lineAnnotationsBefore:e.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:t.lineAnnotationsAfter?.slice(),coalescingMode:i}}function bd(e,t){let n=[];for(let r=0,i=0;r<e.length;r++){let a=e[r],o=a.start+i;n.push({start:o,end:o+a.text.length,text:t[r]}),i+=a.text.length-(a.end-a.start)}return n}function xd(e,t){let n=e;for(let e of t){let t=e.end-e.start,r=e.text.length,i=r-t;if(!(n<e.start)){if(n>=e.start+r){n-=i;continue}n=e.start+Math.min(n-e.start,t)}}return n}var Sd=1e5,Cd=10,wd=13,Td=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,Ed=class{source;offset;length;lineOffsetStart;lineOffsetEnd;hasVirtualTrailingCRBreak;firstCharCode;lastCharCode;static Original=0;static Added=1;constructor(e,t,n,r,i,a,o,s){this.source=e,this.offset=t,this.length=n,this.lineOffsetStart=r,this.lineOffsetEnd=i,this.hasVirtualTrailingCRBreak=a,this.firstCharCode=o,this.lastCharCode=s}get lineBreakCount(){return this.lineOffsetEnd-this.lineOffsetStart+ +!!this.hasVirtualTrailingCRBreak}},Dd=class{text;lineOffsets;constructor(e){this.text=e,this.lineOffsets=vt(e)}append(e){let t=this.text.length;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);(r===Cd||r===wd)&&(r===wd&&e.charCodeAt(n+1)===Cd&&n++,this.lineOffsets.push(t+n+1))}return this.text+=e,t}},Od=class{piece;subtreeLength;subtreeLineBreakCount;subtreeFirstCharCode;subtreeLastCharCode;left=null;right=null;parent=null;priority=0;constructor(e,t=e.length,n=e.lineBreakCount,r=e.firstCharCode,i=e.lastCharCode){this.piece=e,this.subtreeLength=t,this.subtreeLineBreakCount=n,this.subtreeFirstCharCode=r,this.subtreeLastCharCode=i}updateSubtreeLength(){this.subtreeLength=(this.left?.subtreeLength??0)+this.piece.length+(this.right?.subtreeLength??0),this.subtreeLineBreakCount=(this.left?.subtreeLineBreakCount??0)+this.piece.lineBreakCount+(this.right?.subtreeLineBreakCount??0)-+!!Ld(this.left?.subtreeLastCharCode,this.piece.firstCharCode)-!!Ld(this.piece.lastCharCode,this.right?.subtreeFirstCharCode),this.subtreeFirstCharCode=this.left?.subtreeFirstCharCode??this.piece.firstCharCode,this.subtreeLastCharCode=this.right?.subtreeLastCharCode??this.piece.lastCharCode}},kd=class{#e;#t=new Dd(``);#n=null;#r=0;#i=0;#a=null;#o=null;#s=null;#c=2654435769;constructor(e){this.#e=new Dd(e);let t=this.#y(Ed.Original,0,e.length);this.#n=t.length>0?this.#C(t):null,this.#r=this.#n?.subtreeLength??0,this.#i=(this.#n?.subtreeLineBreakCount??0)+1}get lineCount(){return this.#i}getText(e){if(e===void 0)return this.#g();let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this.getTextSlice(t,n)}getLineText(e,t=!1){if(this.#a!==null&&this.#a[0]===e&&this.#a[1]===t)return this.#a[2];let n=this.#f(e);if(n===void 0)throw Error(`Line index out of range: ${e}`);let r=this.getTextSlice(n[0],n[1],!t);return this.#a=[e,t,r],this.#o=[e,t,r.length],r}getLineLength(e,t=!1){let n=this.#o,r=this.#a;if(n!==null&&n[0]===e&&n[1]===t)return n[2];if(r!==null&&r[0]===e&&r[1]===t){let n=r[2].length;return this.#o=[e,t,n],n}let i=this.#f(e);if(i===void 0)throw Error(`Line index out of range: ${e}`);let[a,o]=i,s=o-a;if(!t)for(;s>0&&Ad(this.charAt(a+s-1).charCodeAt(0));)s--;return this.#o=[e,t,s],s}getTextSlice(e,t,n=!1){if(e>=t)return``;let r=jd(e,0,this.#r),i=jd(t,r,this.#r);if(r>=i)return``;let a=this.#u(r);if(a===void 0)return``;let o=[],[s,c]=a,l=i-r;for(;s!==null&&l>0;){let e=Math.min(s.piece.length-c,l),t=this.#v(s.piece.source),r=s.piece.offset+c,i=r+e;if(n)for(;i>r&&Ad(t.text.charCodeAt(i-1));)i--;o.push(t.text.slice(r,i)),l-=e,c=0,s=this.#d(s)}return o.join(``)}charAt(e){let t=this.#u(e);if(t===void 0)return``;let[n,r]=t;return this.#v(n.piece.source).text.charAt(n.piece.offset+r)}includes(e){if(e.length===0)return!0;let t=Md(e),n=0,r=!1;return this.#_(i=>{for(let a=i.start;a<i.end;a++){let o=i.text.charCodeAt(a);for(;n>0&&o!==e.charCodeAt(n);)n=t[n-1];if(o===e.charCodeAt(n)&&n++,n===e.length)return r=!0,!1}return!0}),r}findNextNonOverlappingSubstring(e,t){if(e.length===0||e.length>this.#r)return;let n=Nd(t,this.#r),r=n.reduce((e,[,t])=>Math.max(e,t),0),i=Md(e),a=0,o=0,s,c;return this.#_(t=>{for(let l=t.start;l<t.end;l++){let u=t.text.charCodeAt(l);for(;a>0&&u!==e.charCodeAt(a);)a=i[a-1];if(u===e.charCodeAt(a)&&a++,a===e.length){let t=o-e.length+1;if(!Pd(n,t,t+e.length)){if(t>=r)return c=t,!1;s??=t}a=i[a-1]}o++}return!0}),c??s}search(e){if(e.text.length===0||this.#r===0||e.text.includes(`
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{Mn as n,jn as r}from"./usePopupViewport-BuhsNdVy.js";import{d as i}from"./useRenderElement-DchFnsR8.js";import{t as a}from"./useScrollLock-D3tMGsRk.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
+ import{i as e,t}from"./react-SIfiwpqq.js";import{Mn as n,jn as r}from"./usePopupViewport-CAMlnyaP.js";import{d as i}from"./useRenderElement-DchFnsR8.js";import{t as a}from"./useScrollLock-CAPfesBT.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};