decocms 4.576.1 → 4.576.2

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 (392) hide show
  1. package/dist/client/assets/{AlertCircle-xXAUxL5Z.js → AlertCircle-CQW1P7_R.js} +1 -1
  2. package/dist/client/assets/{AreaChart-KQm98sY2.js → AreaChart-BEgOgZZj.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-C3_uUc-z.js → ArrowLeft-sSY9Zm-O.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-zmQoWTOv.js → ArrowUp-VZphHDPw.js} +1 -1
  5. package/dist/client/assets/{CartesianChart-DHvizK6L.js → CartesianChart-Bku6CBeN.js} +1 -1
  6. package/dist/client/assets/{CategoricalChart-CFhpDsVs.js → CategoricalChart-CI96Ht0A.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DWmAA0cA.js → CheckCircle-BAqlx5xq.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-CN80qRM1.js → ChevronSelectorVertical-CAw9AQRt.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-CjVmbW8q.js → ChevronUp-RQuomTlc.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-DexMydMI.js → CreditCard01-uW1Nq0L7.js} +1 -1
  11. package/dist/client/assets/{Globe04-DE0bAUaJ.js → Globe04-1JEh9zst.js} +1 -1
  12. package/dist/client/assets/{Key01-CYHpm2EC.js → Key01-B-MK6puk.js} +1 -1
  13. package/dist/client/assets/{LinkBroken01-DOEirutZ.js → LinkBroken01-ArAKWl5D.js} +1 -1
  14. package/dist/client/assets/{Minus-CzeqOX9y.js → Minus-y3rEkH4O.js} +1 -1
  15. package/dist/client/assets/{Monitor01-BRxbdUXR.js → Monitor01-DkdtFPE6.js} +1 -1
  16. package/dist/client/assets/{Play-lt5qVoJ1.js → Play-BtmesR9D.js} +1 -1
  17. package/dist/client/assets/{Plus-hGBo4v46.js → Plus-BhSB1FAc.js} +1 -1
  18. package/dist/client/assets/{ReferenceLine-C75x_SEP.js → ReferenceLine-CguuPF_F.js} +1 -1
  19. package/dist/client/assets/{SearchMd-5BOhX0M5.js → SearchMd-CTCaP47C.js} +1 -1
  20. package/dist/client/assets/{ShoppingBag01-drnY5mbB.js → ShoppingBag01-DEtqIAKG.js} +1 -1
  21. package/dist/client/assets/{Sun-qq_IYs5i.js → Sun-DhrY2nq7.js} +1 -1
  22. package/dist/client/assets/{SwitchHorizontal01-DTC4TsRM.js → SwitchHorizontal01-DTDSJnjG.js} +1 -1
  23. package/dist/client/assets/{Tool01-CiRc7Dx3.js → Tool01-CE4RsL2T.js} +1 -1
  24. package/dist/client/assets/{Tooltip-BPkeeG1S.js → Tooltip-DzoIZZA-.js} +1 -1
  25. package/dist/client/assets/{Trash01-Bhop9SkH.js → Trash01-DQCE9WJt.js} +1 -1
  26. package/dist/client/assets/{Upload01-Hve2lQE3.js → Upload01-C8pH3Rp-.js} +1 -1
  27. package/dist/client/assets/{UserSquare-BawmuPOv.js → UserSquare-DfCEdLMW.js} +1 -1
  28. package/dist/client/assets/{Users01-BjAyisfu.js → Users01-RbJbPNL4.js} +1 -1
  29. package/dist/client/assets/{XClose-DiD5f6J1.js → XClose-B9seet19.js} +1 -1
  30. package/dist/client/assets/{Zap-DKp_mX_L.js → Zap-B2TeJ3jk.js} +1 -1
  31. package/dist/client/assets/{access-gate-BytJbO55.js → access-gate-B3-8eUAT.js} +1 -1
  32. package/dist/client/assets/{add-connection-dialog-BFH1NNm1.js → add-connection-dialog-BZazlImL.js} +1 -1
  33. package/dist/client/assets/agent-app-S0Wudwb2.js +1 -0
  34. package/dist/client/assets/{agent-assets-CIjQglx7.js → agent-assets-D6n5n_j9.js} +1 -1
  35. package/dist/client/assets/{agent-automation-DAtnxeZt.js → agent-automation-BDFDUDqF.js} +1 -1
  36. package/dist/client/assets/{agent-automations-DnxzzcBV.js → agent-automations-CTb19iEo.js} +1 -1
  37. package/dist/client/assets/{agent-calendar-BGkmZsO1.js → agent-calendar-dOBBocaZ.js} +1 -1
  38. package/dist/client/assets/{agent-capabilities-JoZ74wKG.js → agent-capabilities-D8RyEQle.js} +1 -1
  39. package/dist/client/assets/{agent-connect-sources-BISjOBUq.js → agent-connect-sources-Cv_HfEov.js} +1 -1
  40. package/dist/client/assets/agent-deck-Cp4W6NYg.js +1 -0
  41. package/dist/client/assets/{agent-e2e-BlgOOj7a.js → agent-e2e-UuVTzQty.js} +1 -1
  42. package/dist/client/assets/agent-experiments-DqEDCkUD.js +1 -0
  43. package/dist/client/assets/{agent-file-169OLyrU.js → agent-file-BxTgqKD4.js} +1 -1
  44. package/dist/client/assets/{agent-hosting-YNj04bBF.js → agent-hosting-SFnhs_AJ.js} +1 -1
  45. package/dist/client/assets/{agent-icon-BA6h0wAH.js → agent-icon-DmYd33Zd.js} +1 -1
  46. package/dist/client/assets/agent-library-D-dnSVJn.js +1 -0
  47. package/dist/client/assets/agent-library-file-S8fMrNmL.js +1 -0
  48. package/dist/client/assets/agent-overview-DTBRMEQ0.js +1 -0
  49. package/dist/client/assets/{agent-releases-C6si7FBa.js → agent-releases-Nv7L0dpy.js} +1 -1
  50. package/dist/client/assets/agent-settings-BiadK6yu.js +1 -0
  51. package/dist/client/assets/{agent-site-editor-C1LxEaGf.js → agent-site-editor-DLrFF0Rn.js} +1 -1
  52. package/dist/client/assets/agent-site-editor-code-CYv63Bju.js +2 -0
  53. package/dist/client/assets/agent-site-editor-content-hqsSwJg4.js +1 -0
  54. package/dist/client/assets/agent-site-editor-preview-YV7jDYx1.js +1 -0
  55. package/dist/client/assets/agent-view-X2daaOWI.js +1 -0
  56. package/dist/client/assets/{agent-view-guard-CacdY14y.js → agent-view-guard-D0qWi85T.js} +1 -1
  57. package/dist/client/assets/{ai-providers-B9VjY3-C.js → ai-providers-CjPCR-pK.js} +1 -1
  58. package/dist/client/assets/{alert-ClhrC_dZ.js → alert-C5FPaAXQ.js} +1 -1
  59. package/dist/client/assets/{analytics-sections-Ceqbg_gn.js → analytics-sections-BGMxhZwl.js} +1 -1
  60. package/dist/client/assets/api-keys-D-r93aBn.js +1 -0
  61. package/dist/client/assets/{api-keys-BQCeDppV.js → api-keys-p6Xw6r8B.js} +1 -1
  62. package/dist/client/assets/{app-editor-CqxGM2YR.js → app-editor-DQwdeZHJ.js} +1 -1
  63. package/dist/client/assets/{asset-utils-BUJSzeIX.js → asset-utils-BW1FTT9q.js} +1 -1
  64. package/dist/client/assets/{auth-0v5kQxM4.js → auth-DeNsOsKX.js} +1 -1
  65. package/dist/client/assets/{auth-catchall-4_gVhcor.js → auth-catchall-C3auT4P_.js} +1 -1
  66. package/dist/client/assets/{auth-entry-CuZzH35o.js → auth-entry-BBIyDdU5.js} +1 -1
  67. package/dist/client/assets/{auth-split-layout-Gs_D53xo.js → auth-split-layout-CpPst90z.js} +1 -1
  68. package/dist/client/assets/{authenticate-and-persist-oauth-CEFAAPr5.js → authenticate-and-persist-oauth-Ca1G6bWy.js} +1 -1
  69. package/dist/client/assets/{automation-list-row-Da0Xr3Lq.js → automation-list-row-GTaw28qY.js} +1 -1
  70. package/dist/client/assets/{automation-runs-DSyVjayJ.js → automation-runs-e7UMBmIy.js} +1 -1
  71. package/dist/client/assets/{automations-Cyou7vFe.js → automations-DVHIEzYX.js} +1 -1
  72. package/dist/client/assets/{autosend-QEZQmopg.js → autosend-0p4cszrD.js} +1 -1
  73. package/dist/client/assets/{badge-OxXf6NyW.js → badge-fJOJmdQG.js} +1 -1
  74. package/dist/client/assets/{block-document-B6v34vY4.js → block-document-D6lQw_Sn.js} +1 -1
  75. package/dist/client/assets/{blocks-preview-workspace-context-taTuRoj9.js → blocks-preview-workspace-context-CevYm8XG.js} +1 -1
  76. package/dist/client/assets/{blocks-tab-states-BpFfPHVw.js → blocks-tab-states-BLBUtwwS.js} +1 -1
  77. package/dist/client/assets/{blog-schema-DT3MGNEM.js → blog-schema-CW6OwOTr.js} +1 -1
  78. package/dist/client/assets/{buckets-Cy9iWWRH.js → buckets-DJjTeJ67.js} +1 -1
  79. package/dist/client/assets/{build-improve-prompt-doc-BQTuUvnz.js → build-improve-prompt-doc-Bz_NuW8p.js} +1 -1
  80. package/dist/client/assets/{calendar-ZOQBRbgD.js → calendar-BN8LK6az.js} +1 -1
  81. package/dist/client/assets/{capability-load-error-Bb_YsAjX.js → capability-load-error-BwSdaWc5.js} +1 -1
  82. package/dist/client/assets/{category-editor-BSVL1WiV.js → category-editor-B2fU3l2-.js} +1 -1
  83. package/dist/client/assets/{chart-DuDORsVm.js → chart-TbvRqjuj.js} +1 -1
  84. package/dist/client/assets/{chat-context-CaBz0Fa_.js → chat-context-BwoQSegQ.js} +1 -1
  85. package/dist/client/assets/{chat-draft-0xyMYS4v.js → chat-draft-DH581p83.js} +1 -1
  86. package/dist/client/assets/{checkbox-uRiFMDEw.js → checkbox-BYltfk17.js} +1 -1
  87. package/dist/client/assets/{choose-editor-C8Fx5E1l.js → choose-editor-CF8pbtbx.js} +1 -1
  88. package/dist/client/assets/{cli-auth-success-Bco2eMX2.js → cli-auth-success-8VRhz3fQ.js} +1 -1
  89. package/dist/client/assets/{client-icons-BDJ7lEQk.js → client-icons-azPimjhr.js} +1 -1
  90. package/dist/client/assets/{cms-settings-editor-DcPG8xWi.js → cms-settings-editor-Dh2cgMIJ.js} +1 -1
  91. package/dist/client/assets/{cms-store-drafts-DBZ0eK6D.js → cms-store-drafts-DOqjCS5l.js} +1 -1
  92. package/dist/client/assets/{collapsible-DaRxY8dD.js → collapsible-DMIxs55h.js} +1 -1
  93. package/dist/client/assets/{collection-detail-BKy6YpxD.js → collection-detail-BNTXyqsr.js} +1 -1
  94. package/dist/client/assets/{collection-display-button-DDs-fVtH.js → collection-display-button-DlPhjc6E.js} +1 -1
  95. package/dist/client/assets/{collection-search-Ji_27Bi5.js → collection-search-DFoNgd1T.js} +1 -1
  96. package/dist/client/assets/{collection-table-wrapper-BjgrYQjR.js → collection-table-wrapper-OwJoF9HU.js} +1 -1
  97. package/dist/client/assets/{collection-tabs-BaAIKaN4.js → collection-tabs-DTr38V1c.js} +1 -1
  98. package/dist/client/assets/{combobox-DRpRWCQC.js → combobox-B8pIOucr.js} +1 -1
  99. package/dist/client/assets/{command-B7jjL5t_.js → command-8eo7blzl.js} +1 -1
  100. package/dist/client/assets/{companion-mcps-section-DwP-X6KV.js → companion-mcps-section-OBc1XSiN.js} +1 -1
  101. package/dist/client/assets/{config-BEwVyYgh.js → config-CZxXYayZ.js} +1 -1
  102. package/dist/client/assets/{connect-BznXeuBh.js → connect-BDnlsqF3.js} +1 -1
  103. package/dist/client/assets/{connect-layout-gSfDx1uw.js → connect-layout-f8wmYpiF.js} +1 -1
  104. package/dist/client/assets/{connect-source-dialog-DuLGNw3E.js → connect-source-dialog-BnoBKHvg.js} +1 -1
  105. package/dist/client/assets/{connection-BPIYy_H3.js → connection-B4VgNpkK.js} +1 -1
  106. package/dist/client/assets/{connection-card-By0LB3P3.js → connection-card-Cp7AJMDR.js} +1 -1
  107. package/dist/client/assets/{connection-detail-Dhu8wraq.js → connection-detail-BYR-qeWG.js} +1 -1
  108. package/dist/client/assets/{connection-form-helpers-C4GFwQ2z.js → connection-form-helpers-DqULERyx.js} +1 -1
  109. package/dist/client/assets/{connection-slug-Ch_wi6rN.js → connection-slug-CK9E8VRg.js} +1 -1
  110. package/dist/client/assets/{connections-B6aDUa3H.js → connections-D1yKPCTH.js} +1 -1
  111. package/dist/client/assets/{content-tab-D3jR5tEE.js → content-tab-D-PBLIve.js} +3 -3
  112. package/dist/client/assets/{context-BfZ0zud0.js → context-Ciehk0ao.js} +1 -1
  113. package/dist/client/assets/{context-menu-Cy3xsKiF.js → context-menu-SmukJNMU.js} +1 -1
  114. package/dist/client/assets/{context-shell-DzE9VmYd.js → context-shell-CO4fTNNJ.js} +3 -3
  115. package/dist/client/assets/{core.esm-Cqr0FhsT.js → core.esm-B_Pr2KZA.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-BqBXNJjp.js → create-organization-dialog-8e7uLr8k.js} +1 -1
  117. package/dist/client/assets/{device-hint-D0PKUXfK.js → device-hint-_3UpNo1y.js} +1 -1
  118. package/dist/client/assets/{discover-CuMES_lv.js → discover-j-WmLzAr.js} +1 -1
  119. package/dist/client/assets/{domain-settings-DdO_JKig.js → domain-settings-nzh2Xqh2.js} +1 -1
  120. package/dist/client/assets/{drawer-DEBrmbLh.js → drawer-BiZQd3jF.js} +1 -1
  121. package/dist/client/assets/{editor-DABA4jRW.js → editor-B5BFg8L4.js} +1 -1
  122. package/dist/client/assets/{editor-classes-BxXnftil.js → editor-classes-DxfrzHp8.js} +1 -1
  123. package/dist/client/assets/{empty-state-y2HOF9fL.js → empty-state-CPhGFwFG.js} +1 -1
  124. package/dist/client/assets/{empty-state-JLp-0Ot0.js → empty-state-D5FGRI4e.js} +1 -1
  125. package/dist/client/assets/{experiments-tab-choice-B2KrY0mn.js → experiments-tab-choice-5NNTmJRW.js} +1 -1
  126. package/dist/client/assets/{extract-connection-data-OTtBFz40.js → extract-connection-data-lBAlP3pz.js} +1 -1
  127. package/dist/client/assets/{feature-gate-D548gPqm.js → feature-gate-Djob_jbU.js} +1 -1
  128. package/dist/client/assets/{feature-paywall-B2ECRUtY.js → feature-paywall-DWnzqDkt.js} +1 -1
  129. package/dist/client/assets/{file-explorer-DvIUDgnp.js → file-explorer-B7HqI107.js} +1 -1
  130. package/dist/client/assets/{file-preview-QvtQ9sFZ.js → file-preview-CVLvq53I.js} +1 -1
  131. package/dist/client/assets/{file-share-button-DwysRdf9.js → file-share-button-Ug-zwu4d.js} +1 -1
  132. package/dist/client/assets/{file-type-icon-BT2FK5D4.js → file-type-icon-BZTtX6EK.js} +1 -1
  133. package/dist/client/assets/{folder-icon-Met9dqTq.js → folder-icon-C2EzD8if.js} +1 -1
  134. package/dist/client/assets/{form-DbD00MVE.js → form-Bhgzwnyp.js} +1 -1
  135. package/dist/client/assets/{general-Bd0HlBpp.js → general-CPLHJuRp.js} +1 -1
  136. package/dist/client/assets/{github-icon-cCo3aev2.js → github-icon-Buu0H1v4.js} +1 -1
  137. package/dist/client/assets/{home-CnPWKbZI.js → home-BCYh-a3a.js} +1 -1
  138. package/dist/client/assets/{home-overview-DrsU8cKl.js → home-overview-DTtXcEkG.js} +1 -1
  139. package/dist/client/assets/{hosted-reconcile-K8D7htGD.js → hosted-reconcile-BdwyWhOE.js} +1 -1
  140. package/dist/client/assets/{icon-button-jwnQI3ne.js → icon-button-Dls6AzVP.js} +1 -1
  141. package/dist/client/assets/{index-zkOXDA9t.js → index-0xCVweSM.js} +1 -1
  142. package/dist/client/assets/{index-CuVN4Aac.js → index-B3BrFVGB.js} +1 -1
  143. package/dist/client/assets/{index-B5_ugeYO.js → index-B4tnBHnb.js} +1 -1
  144. package/dist/client/assets/{index-C7Mti7OL.js → index-B6eHz5VS.js} +1 -1
  145. package/dist/client/assets/index-BJqMJFEL.js +4 -0
  146. package/dist/client/assets/{index-DwcKKa8f.js → index-BJrkqMqs.js} +1 -1
  147. package/dist/client/assets/{index-BrE_pa5_.js → index-C8i-vHCI.js} +1 -1
  148. package/dist/client/assets/{index-DU8NkptJ.js → index-CJKJ4WN3.js} +1 -1
  149. package/dist/client/assets/{index-Dqe8gjuB.js → index-CKuu5BgI.js} +1 -1
  150. package/dist/client/assets/{index-BFjarNZt.js → index-CMl-YIkn.js} +1 -1
  151. package/dist/client/assets/{index-7JVbNGhX.js → index-CQIKg7tc.js} +1 -1
  152. package/dist/client/assets/{index-C59L9F48.js → index-CtJa8hR9.js} +1 -1
  153. package/dist/client/assets/{index-KhB0zLZd.js → index-DAFka6tK.js} +1 -1
  154. package/dist/client/assets/{index-BDIGIIrk.js → index-DJy_S3Mn.js} +1 -1
  155. package/dist/client/assets/{index-BbbC2KAF.js → index-D_HCIUjf.js} +1 -1
  156. package/dist/client/assets/{index-B6JjeFQu.js → index-UxIaE43S.js} +1 -1
  157. package/dist/client/assets/{index-DIJ4i6l1.js → index-XdUWZF5g.js} +3 -3
  158. package/dist/client/assets/{index-redirect-CtwSztLi.js → index-redirect-ZoX0Nmet.js} +1 -1
  159. package/dist/client/assets/{infiniteQueryObserver-tz8kMnh3.js → infiniteQueryObserver-DgQQHW6Y.js} +1 -1
  160. package/dist/client/assets/{infra-billing-CF7Nx5tW.js → infra-billing-CbpAOQ7f.js} +1 -1
  161. package/dist/client/assets/{input-DZ3UD8Tc.js → input-BBwM3ir1.js} +1 -1
  162. package/dist/client/assets/{input-DNY7YfN5.js → input-BneF5n5F.js} +3 -3
  163. package/dist/client/assets/{integration-icon-DBS0IIUZ.js → integration-icon-DpoZYM7e.js} +1 -1
  164. package/dist/client/assets/{jira-icon-DjXG4S53.js → jira-icon-CfXcnbRW.js} +1 -1
  165. package/dist/client/assets/{label-CE_9qjVi.js → label-CUqIqnOS.js} +1 -1
  166. package/dist/client/assets/{layout-BFpUPLwM.js → layout-CZKu8-AR.js} +1 -1
  167. package/dist/client/assets/{legacy-admin-welcome-dialog-DufciNkJ.js → legacy-admin-welcome-dialog-D12aat8e.js} +1 -1
  168. package/dist/client/assets/{legacy-agents-deep-B9awpgEd.js → legacy-agents-deep-C46PUrrS.js} +1 -1
  169. package/dist/client/assets/{legacy-main-redirect-DeJi8kpi.js → legacy-main-redirect-si54JTxO.js} +1 -1
  170. package/dist/client/assets/library-bWgDO9u6.js +1 -0
  171. package/dist/client/assets/{library-tab-vwgQd5Km.js → library-tab-EiyuBjPa.js} +1 -1
  172. package/dist/client/assets/{login-BBfMw48d.js → login-D0eYUue3.js} +1 -1
  173. package/dist/client/assets/{markdown-B9ZXP-yI.js → markdown-A06Oe1_p.js} +1 -1
  174. package/dist/client/assets/{mcp-app-renderer-wdm200pr.js → mcp-app-renderer-Dkj1yLIG.js} +1 -1
  175. package/dist/client/assets/{mcp-oauth-De1bAphR.js → mcp-oauth-L4CbK4hz.js} +1 -1
  176. package/dist/client/assets/{mcp-oauth-YcJKxGgu.js → mcp-oauth-u5RBmpff.js} +1 -1
  177. package/dist/client/assets/{members-zJjusDEy.js → members-D2W9FUHb.js} +1 -1
  178. package/dist/client/assets/{memory-CmHFkNR_.js → memory-nZuh_3HW.js} +1 -1
  179. package/dist/client/assets/{mock-board-DSjXTehJ.js → mock-board-DkI2cfk-.js} +3 -3
  180. package/dist/client/assets/{monaco-editor-CKxrx3bb.js → monaco-editor-DoTBOc-e.js} +1 -1
  181. package/dist/client/assets/{monitoring-BweO8f9o.js → monitoring-DZ1uqyFT.js} +1 -1
  182. package/dist/client/assets/{monitoring-stats-row-BLJYBeQS.js → monitoring-stats-row-Be_-YMn8.js} +1 -1
  183. package/dist/client/assets/{multi-select-BManzll9.js → multi-select-CzoYfyvg.js} +1 -1
  184. package/dist/client/assets/{mustache-C28Q9k19.js → mustache-BctGjQ5L.js} +1 -1
  185. package/dist/client/assets/{named-rule-view-B8TaXMqW.js → named-rule-view-DUsv8g0V.js} +1 -1
  186. package/dist/client/assets/{new-project-dialog-CapD_z2K.js → new-project-dialog-151PED_m.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-1dAm1mGK.js → oauth-callback-DrwI5ATg.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-ai-provider-C4nlkpPG.js → oauth-callback-ai-provider-D9pLn0-_.js} +1 -1
  189. package/dist/client/assets/{oauth-consent-CA55TLKS.js → oauth-consent-o6k0sIQ6.js} +1 -1
  190. package/dist/client/assets/{onboarding-CydYT5k4.js → onboarding-BMQJZ4PX.js} +1 -1
  191. package/dist/client/assets/{openai-conversation-QjOxjJ9Z.js → openai-conversation-CWam_Ql8.js} +1 -1
  192. package/dist/client/assets/{optimistic-project-sidebar-views-DnVqzg8N.js → optimistic-project-sidebar-views-Dx-3KOhR.js} +1 -1
  193. package/dist/client/assets/{order-monitor-day-bNWc2xxe.js → order-monitor-day-DGR3iDef.js} +1 -1
  194. package/dist/client/assets/{organization-choice-B6WjGm9l.js → organization-choice-1Lr2hM9B.js} +1 -1
  195. package/dist/client/assets/{orgs-Z0cs0ktw.js → orgs-CbmN-Uo3.js} +1 -1
  196. package/dist/client/assets/{own-accounts-section-B4lUvL8j.js → own-accounts-section-DPfUOm23.js} +1 -1
  197. package/dist/client/assets/{pair-OacOFJo3.js → pair-BCJ5sFP0.js} +1 -1
  198. package/dist/client/assets/{parse-sections-C4WdZFz6.js → parse-sections-DxG18Udv.js} +3 -3
  199. package/dist/client/assets/{plan-B5R54DUG.js → plan-BaYlHrHs.js} +1 -1
  200. package/dist/client/assets/{plan-ladder-Cw552rCe.js → plan-ladder-LKl9l3TA.js} +1 -1
  201. package/dist/client/assets/{plan-usage-card-BQQUJlLg.js → plan-usage-card-wDWYSVHD.js} +1 -1
  202. package/dist/client/assets/{popover-D5azhkxn.js → popover-DmqBIPKi.js} +1 -1
  203. package/dist/client/assets/{post-calendar-H3gLWQrA.js → post-calendar-C4TZhDJz.js} +1 -1
  204. package/dist/client/assets/{post-editor-DsfAB88f.js → post-editor-DGrj-qXP.js} +1 -1
  205. package/dist/client/assets/{preview-content-ABYTWtaZ.js → preview-content-8R1QUim7.js} +1 -1
  206. package/dist/client/assets/{preview-dialog-DY-dYyi4.js → preview-dialog-ZNHmoyI1.js} +1 -1
  207. package/dist/client/assets/{preview-panel-Di5XwQKi.js → preview-panel-DbX8A-HE.js} +1 -1
  208. package/dist/client/assets/{preview-tab-DNN5D1rF.js → preview-tab-DglGrCFS.js} +3 -3
  209. package/dist/client/assets/{product-picker-dialog-RO5VZTY2.js → product-picker-dialog-B84p2GNz.js} +1 -1
  210. package/dist/client/assets/{profile-D1LUBdWE.js → profile-Bhqnq92W.js} +1 -1
  211. package/dist/client/assets/{project-app-view-CD95f-Ja.js → project-app-view-BH2u01TO.js} +1 -1
  212. package/dist/client/assets/{project-apps-CumaGNv9.js → project-apps-CTuZm-1a.js} +1 -1
  213. package/dist/client/assets/{project-icon-CapKL04Y.js → project-icon-BhWIi9DN.js} +1 -1
  214. package/dist/client/assets/{project-index-Dl_LNEuF.js → project-index-_-BCnGMR.js} +1 -1
  215. package/dist/client/assets/project-reports-yDx2KIN5.js +1 -0
  216. package/dist/client/assets/project-tasks-CZ24XPn7.js +1 -0
  217. package/dist/client/assets/{projects-CizIhWb4.js → projects-CbLcC2Cm.js} +1 -1
  218. package/dist/client/assets/{projects-empty-state-rX9MGuhO.js → projects-empty-state-DgeHjyWl.js} +1 -1
  219. package/dist/client/assets/{prompts-Bxu1gwra.js → prompts-CIAk1CWx.js} +1 -1
  220. package/dist/client/assets/{record-editor-BluW68E5.js → record-editor-Cqt0X6zj.js} +1 -1
  221. package/dist/client/assets/{redirect-editor-D_z4HgGi.js → redirect-editor-DrfUg_M2.js} +1 -1
  222. package/dist/client/assets/reports-BeqJdfY-.js +1 -0
  223. package/dist/client/assets/{reports-CdhkVMOp.js → reports-BqGiKAfm.js} +1 -1
  224. package/dist/client/assets/{reports-onboarding-DiIXbBm-.js → reports-onboarding-LZjQ8G8T.js} +1 -1
  225. package/dist/client/assets/{reports-tab-TaW27Dib.js → reports-tab-B55dyiL7.js} +2 -2
  226. package/dist/client/assets/{repositories-BEIy4iov.js → repositories-0RznNRUX.js} +1 -1
  227. package/dist/client/assets/repositories-BoB8X409.js +1 -0
  228. package/dist/client/assets/{repository-binding-DnTIKvh_.js → repository-binding-Cfy_YQIZ.js} +1 -1
  229. package/dist/client/assets/{repository-picker-Dm4xl8L-.js → repository-picker-BKWo-jhF.js} +1 -1
  230. package/dist/client/assets/{require-capability-BXxAP3RL.js → require-capability-Bpnmr0un.js} +1 -1
  231. package/dist/client/assets/{required-auth-layout-DhuiRYqz.js → required-auth-layout-CRKzQVpv.js} +1 -1
  232. package/dist/client/assets/{reset-password-B2i1JKOP.js → reset-password-DVKc7osA.js} +1 -1
  233. package/dist/client/assets/{resizable-CAylzP2b.js → resizable-w4diu4pE.js} +1 -1
  234. package/dist/client/assets/{resolve-tab-icon-uqUI1ibt.js → resolve-tab-icon-DY3vlmxg.js} +1 -1
  235. package/dist/client/assets/{review-settings-Dr0pk97x.js → review-settings-D7Ld59mb.js} +1 -1
  236. package/dist/client/assets/{role-color-Bhd8KoVS.js → role-color-DfOmE7Fu.js} +1 -1
  237. package/dist/client/assets/{roles-BIfyt_GY.js → roles-RQS02DUg.js} +1 -1
  238. package/dist/client/assets/route-59M5FlvK.js +1 -0
  239. package/dist/client/assets/route-B-HA2s4_.js +1 -0
  240. package/dist/client/assets/{route-rALNsp7W.js → route-BRvX0p-n.js} +1 -1
  241. package/dist/client/assets/{sandbox-lifecycle-context-T_FHqShI.js → sandbox-lifecycle-context-D-PaTa6M.js} +1 -1
  242. package/dist/client/assets/{schema-B0qCyNGJ.js → schema-CJ9UcSNs.js} +1 -1
  243. package/dist/client/assets/{schema-D6loGo_O.js → schema-Dq7led26.js} +1 -1
  244. package/dist/client/assets/{scroll-area-BONvYSJN.js → scroll-area-PZSCT0ow.js} +1 -1
  245. package/dist/client/assets/{search-input-ZJ0TUPZ6.js → search-input-DO66exG7.js} +1 -1
  246. package/dist/client/assets/{search-toggle-D6en4lHd.js → search-toggle-DaBbNP1T.js} +1 -1
  247. package/dist/client/assets/{secret-picker-BD3pokVI.js → secret-picker-bljsK2mV.js} +1 -1
  248. package/dist/client/assets/{secrets-ZJiNCrVj.js → secrets-CBAb9cvk.js} +1 -1
  249. package/dist/client/assets/{section-array-field-BjOMaOyh.js → section-array-field-CPrkBgr3.js} +1 -1
  250. package/dist/client/assets/{sections-RdndL6R-.js → sections-T2vi-zI4.js} +1 -1
  251. package/dist/client/assets/{sections-editor-YQkpJmYe.js → sections-editor-DQwNUlLv.js} +1 -1
  252. package/dist/client/assets/{select-DOPxEiy0.js → select-BABowMoY.js} +1 -1
  253. package/dist/client/assets/{select-model-C8OsJu0P.js → select-model-CbEyJ33x.js} +1 -1
  254. package/dist/client/assets/{seo-editor-qGMzOY9m.js → seo-editor-C9V4Y_YB.js} +1 -1
  255. package/dist/client/assets/{separator-B6Wfr511.js → separator-CM0d_WPE.js} +1 -1
  256. package/dist/client/assets/settings-tab-DUqPlhAE.js +1 -0
  257. package/dist/client/assets/{sheet-O98X_91-.js → sheet-BSCF-nmk.js} +1 -1
  258. package/dist/client/assets/{shell-layout-BAK0t5W4.js → shell-layout-d2Ief2ja.js} +1 -1
  259. package/dist/client/assets/{site-draft-actions-_J98WPse.js → site-draft-actions-CH7jTGTc.js} +1 -1
  260. package/dist/client/assets/{site-draft-view-DiD0S10y.js → site-draft-view-CbKyFhEM.js} +1 -1
  261. package/dist/client/assets/site-editor-CX53l3C_.js +1 -0
  262. package/dist/client/assets/{site-editor-toast-DbTzFTFl.js → site-editor-toast-CluWI-yZ.js} +1 -1
  263. package/dist/client/assets/{skills-BcCFe-5m.js → skills-BOpgUaHZ.js} +1 -1
  264. package/dist/client/assets/{slider-Bh2E_axo.js → slider-QcqvUsSI.js} +1 -1
  265. package/dist/client/assets/{sortable.esm-DG7uouGH.js → sortable.esm-0yomt8g2.js} +1 -1
  266. package/dist/client/assets/{sso-QU_aZP2B.js → sso-CbSeZ9e5.js} +1 -1
  267. package/dist/client/assets/{suggestion-DU-baT9O.js → suggestion-C9bDFuOo.js} +1 -1
  268. package/dist/client/assets/{super-agent-icon-DezxQHWn.js → super-agent-icon-DMm0_lmO.js} +1 -1
  269. package/dist/client/assets/{switch-DLFEYGM0.js → switch-CRe3xUPs.js} +1 -1
  270. package/dist/client/assets/{synced-repos-C0nMrxoG.js → synced-repos-D900mhEv.js} +1 -1
  271. package/dist/client/assets/{tab-icon-glyph-DN2wyTv4.js → tab-icon-glyph-D5lXXFkj.js} +1 -1
  272. package/dist/client/assets/{table-B09bkaSv.js → table-C-Iqqanf.js} +1 -1
  273. package/dist/client/assets/{tabs-DeTALxBi.js → tabs-CPwYT_wy.js} +1 -1
  274. package/dist/client/assets/{task-board-95swTute.js → task-board-B-Jl-DnQ.js} +1 -1
  275. package/dist/client/assets/{task-route-CYLyBkUK.js → task-route-C-boE7jG.js} +1 -1
  276. package/dist/client/assets/{task-status-CYrsK5kS.js → task-status-Dg7JusRR.js} +1 -1
  277. package/dist/client/assets/{taskboard-analytics-Cm6WIlTm.js → taskboard-analytics-DwDfRDQC.js} +1 -1
  278. package/dist/client/assets/tasks-DMBPC4PI.js +1 -0
  279. package/dist/client/assets/{tasks-B__eknj6.js → tasks-ElocVpWd.js} +1 -1
  280. package/dist/client/assets/{textarea-jjFZrPcz.js → textarea-DSiKrnTK.js} +1 -1
  281. package/dist/client/assets/{thread-analytics-IYdfqMK_.js → thread-analytics-BtdCUFGw.js} +1 -1
  282. package/dist/client/assets/{thread-intent-BtmlqwRH.js → thread-intent-DnduoWYb.js} +1 -1
  283. package/dist/client/assets/{thread-route-DoQ3AePC.js → thread-route-D0P3i7B7.js} +1 -1
  284. package/dist/client/assets/{thread-route-B-VKd0Ce.js → thread-route-DSQLBJ4Y.js} +1 -1
  285. package/dist/client/assets/{thread-sheet-body-kBMgJWAe.js → thread-sheet-body-BHjT7Rlx.js} +1 -1
  286. package/dist/client/assets/{time-range-picker-CqKQQJnw.js → time-range-picker-B0Xtja-D.js} +1 -1
  287. package/dist/client/assets/{toggle-group-BL47pqaq.js → toggle-group-CO1s8gR-.js} +1 -1
  288. package/dist/client/assets/{tool-namespace-qcytt9G1.js → tool-namespace-BskMFdfX.js} +1 -1
  289. package/dist/client/assets/{tool-set-selector-Jw58ZRph.js → tool-set-selector-DbHsII-W.js} +1 -1
  290. package/dist/client/assets/{toolbar-icon-button-DjIWEs2B.js → toolbar-icon-button-DQHnJFhG.js} +1 -1
  291. package/dist/client/assets/{tooltip-BVSpbx-_.js → tooltip-C1oPRuFg.js} +1 -1
  292. package/dist/client/assets/{tooltipContext-BbDqXSlB.js → tooltipContext-Dk4Jh8sf.js} +1 -1
  293. package/dist/client/assets/{track-BqiZiu1D.js → track-DQNlgsAd.js} +1 -1
  294. package/dist/client/assets/{types-DGYfIFbD.js → types-sVhbGxrT.js} +1 -1
  295. package/dist/client/assets/{url-slug-Dz10RPtP.js → url-slug-kny4-Gd8.js} +1 -1
  296. package/dist/client/assets/{usage-stats-D5I4yIME.js → usage-stats-CkprzoQA.js} +1 -1
  297. package/dist/client/assets/{use-ai-providers-qcI9kSam.js → use-ai-providers-BmwnG2L7.js} +1 -1
  298. package/dist/client/assets/{use-apply-named-rule-D6gdtjxE.js → use-apply-named-rule-QQXumPyC.js} +1 -1
  299. package/dist/client/assets/use-ask-in-chat-C56CHpt0.js +1 -0
  300. package/dist/client/assets/{use-automations-CE8iWCaz.js → use-automations-pGpYlQfd.js} +1 -1
  301. package/dist/client/assets/{use-autosave-D1oMLPfh.js → use-autosave-C1VLdEbv.js} +1 -1
  302. package/dist/client/assets/use-blocks-v8-project-DSiCCdEB.js +1 -0
  303. package/dist/client/assets/{use-chat-layout-state-D2kmyA5o.js → use-chat-layout-state-Ep7OkPup.js} +1 -1
  304. package/dist/client/assets/{use-cms-publish-actions-B9K0jzm5.js → use-cms-publish-actions-Cls9mAWe.js} +1 -1
  305. package/dist/client/assets/{use-connect-companion-cF-nX84z.js → use-connect-companion-B0uthGiU.js} +1 -1
  306. package/dist/client/assets/{use-connection-BCwT2p8B.js → use-connection-DFsrW4Mv.js} +1 -1
  307. package/dist/client/assets/{use-content-sync-CLeJQt6-.js → use-content-sync-BYcD8LZk.js} +1 -1
  308. package/dist/client/assets/{use-copy-Bn5nWWQG.js → use-copy-9wHvlEmg.js} +1 -1
  309. package/dist/client/assets/{use-date-fns-locale-CXg39XeJ.js → use-date-fns-locale-CfiWZhP7.js} +1 -1
  310. package/dist/client/assets/{use-debounced-autosave-CCIK5NSm.js → use-debounced-autosave-CK8e7jku.js} +1 -1
  311. package/dist/client/assets/{use-debounced-value-CALTE0-J.js → use-debounced-value-Cs49dczG.js} +1 -1
  312. package/dist/client/assets/{use-deco-credits-CI_hVc5L.js → use-deco-credits-ChuCrYAR.js} +1 -1
  313. package/dist/client/assets/{use-decopilot-events-BGb9i2D9.js → use-decopilot-events-CR7NJgme.js} +1 -1
  314. package/dist/client/assets/{use-delete-connection-BZfWavav.js → use-delete-connection-Dq2UKTpz.js} +1 -1
  315. package/dist/client/assets/{use-deployment-admin-CfaGw49b.js → use-deployment-admin-CALPlo_8.js} +1 -1
  316. package/dist/client/assets/{use-entitlements-HGoX64MA.js → use-entitlements-DzfUP8ON.js} +1 -1
  317. package/dist/client/assets/{use-fast-preview-draft-url-DhVINgsk.js → use-fast-preview-draft-url-B0ysxeQy.js} +1 -1
  318. package/dist/client/assets/{use-file-configs-DJ8uwfYI.js → use-file-configs-CfNCrD6y.js} +1 -1
  319. package/dist/client/assets/{use-id-selection-Byr-tWk-.js → use-id-selection-BeGsI2-X.js} +1 -1
  320. package/dist/client/assets/{use-inbox-feed-D0cAFMUM.js → use-inbox-feed-HViitByF.js} +1 -1
  321. package/dist/client/assets/{use-infinite-scroll-KRVACoeF.js → use-infinite-scroll-DdKcODzJ.js} +1 -1
  322. package/dist/client/assets/{use-join-requests-CpB6cItZ.js → use-join-requests-Dg5vHh8i.js} +1 -1
  323. package/dist/client/assets/{use-main-panel-tabs-BExuHHIh.js → use-main-panel-tabs-DZH6Z-sf.js} +1 -1
  324. package/dist/client/assets/{use-mcp-auth-status-BAlx6pDX.js → use-mcp-auth-status-C13HkQ9w.js} +1 -1
  325. package/dist/client/assets/{use-mcp-client-DfcqzMq1.js → use-mcp-client-B9_8tfCL.js} +1 -1
  326. package/dist/client/assets/{use-mcp-prompts-BV72WbSD.js → use-mcp-prompts-NcFGfyZU.js} +1 -1
  327. package/dist/client/assets/{use-mcp-tools-7PQ3NovP.js → use-mcp-tools-wrSWiD0P.js} +1 -1
  328. package/dist/client/assets/{use-mobile-CQ6V3YRN.js → use-mobile-DSmr8Fj3.js} +1 -1
  329. package/dist/client/assets/{use-move-blocks-JBQzX1My.js → use-move-blocks-gne4gzCh.js} +1 -1
  330. package/dist/client/assets/{use-navigate-to-agent-D5XHqsJq.js → use-navigate-to-agent-ycEqYJX7.js} +1 -1
  331. package/dist/client/assets/{use-org-fs-BqH5T3Sy.js → use-org-fs-C57fsXyq.js} +1 -1
  332. package/dist/client/assets/{use-org-repo-syncs-DN8-yp4r.js → use-org-repo-syncs-BcOvlKwo.js} +1 -1
  333. package/dist/client/assets/{use-org-sso-u9TOWNqG.js → use-org-sso-B5c0saDF.js} +1 -1
  334. package/dist/client/assets/{use-organization-settings-VtZHPkLh.js → use-organization-settings-B0lt5dXR.js} +1 -1
  335. package/dist/client/assets/use-project-native-view-presence-BBRyl28q.js +1 -0
  336. package/dist/client/assets/{use-project-scope-B83JUNc2.js → use-project-scope-C1eT4xwT.js} +1 -1
  337. package/dist/client/assets/{use-recent-apps-qkoPZRRH.js → use-recent-apps-CU27r377.js} +1 -1
  338. package/dist/client/assets/{use-reports-diagnostic-LlEd-RbG.js → use-reports-diagnostic-QLTyI1c7.js} +1 -1
  339. package/dist/client/assets/{use-sandbox-events-bTwWaKJH.js → use-sandbox-events-BNcBCK9X.js} +1 -1
  340. package/dist/client/assets/{use-secrets-BQOxylG3.js → use-secrets-Dh7bZZgD.js} +1 -1
  341. package/dist/client/assets/{use-section-preview-base-StiVIbqe.js → use-section-preview-base-53RIdpth.js} +1 -1
  342. package/dist/client/assets/{use-sidebar-collapsed-Bo_fV1ZI.js → use-sidebar-collapsed-XX5WdYs3.js} +1 -1
  343. package/dist/client/assets/{use-tags-BvVGefXP.js → use-tags-Cbxwh1yu.js} +1 -1
  344. package/dist/client/assets/{use-task-board-analytics-BpE1TPch.js → use-task-board-analytics-BseFgQx7.js} +1 -1
  345. package/dist/client/assets/{use-task-board-events-rFqMtePj.js → use-task-board-events-CMb3Vjy2.js} +1 -1
  346. package/dist/client/assets/{use-task-board-item-prs-CLvlosI3.js → use-task-board-item-prs-2_-y1IH5.js} +1 -1
  347. package/dist/client/assets/{use-task-board-items-HgW8DVW2.js → use-task-board-items-CnG0LR-k.js} +1 -1
  348. package/dist/client/assets/{use-task-board-prompts-DsxgB7IK.js → use-task-board-prompts-DschKVPr.js} +1 -1
  349. package/dist/client/assets/{use-task-metadata-bDql024r.js → use-task-metadata-KJjG2-5j.js} +1 -1
  350. package/dist/client/assets/{use-thread-outputs-DAMbPn4y.js → use-thread-outputs-B6Mbzgsq.js} +1 -1
  351. package/dist/client/assets/{use-voice-input-CQAqEi1v.js → use-voice-input-BVeAO01v.js} +1 -1
  352. package/dist/client/assets/useInfiniteQuery-BvhkDMwv.js +1 -0
  353. package/dist/client/assets/{useQueries-BIJ-tBOF.js → useQueries-COskgQPI.js} +1 -1
  354. package/dist/client/assets/useSuspenseInfiniteQuery-CHeSvNyF.js +1 -0
  355. package/dist/client/assets/{users-9rByH5AA.js → users-D9U38Uiq.js} +1 -1
  356. package/dist/client/assets/{utils-DQFBRZPm.js → utils-C07I_8BL.js} +1 -1
  357. package/dist/client/assets/{variant-calendar-BwYXWcFz.js → variant-calendar-B1xF-pvj.js} +1 -1
  358. package/dist/client/assets/{variant-matcher-override-ByMpLNRq.js → variant-matcher-override-O46bQvi2.js} +1 -1
  359. package/dist/client/assets/{view-header-v0F29KQ1.js → view-header-CB8g9i8I.js} +1 -1
  360. package/dist/client/assets/{virtual-mcp-BaFxXna4.js → virtual-mcp-DkEy_7-s.js} +1 -1
  361. package/dist/client/assets/{watch-sse-pool-yarYBhtI.js → watch-sse-pool-BUtg06cI.js} +1 -1
  362. package/dist/client/index.html +1 -1
  363. package/dist/server/server.js +1 -1
  364. package/package.json +1 -1
  365. package/dist/client/assets/agent-app-FtEM4M24.js +0 -1
  366. package/dist/client/assets/agent-deck-XPT7vuUL.js +0 -1
  367. package/dist/client/assets/agent-experiments-BX4Qxtn5.js +0 -1
  368. package/dist/client/assets/agent-library-Csjeb884.js +0 -1
  369. package/dist/client/assets/agent-library-file-Cb5y9Ot1.js +0 -1
  370. package/dist/client/assets/agent-overview-I8Oa7crw.js +0 -1
  371. package/dist/client/assets/agent-settings-D_5Nl5O6.js +0 -1
  372. package/dist/client/assets/agent-site-editor-code-V8zDZ0Sp.js +0 -2
  373. package/dist/client/assets/agent-site-editor-content-RSTA2mN_.js +0 -1
  374. package/dist/client/assets/agent-site-editor-preview-v_JSJiV0.js +0 -1
  375. package/dist/client/assets/agent-view-B8D5kU0t.js +0 -1
  376. package/dist/client/assets/api-keys-CgJQdLm6.js +0 -1
  377. package/dist/client/assets/index-BS27oJqi.js +0 -4
  378. package/dist/client/assets/library-ABRgCoFW.js +0 -1
  379. package/dist/client/assets/project-reports-D23gm-T0.js +0 -1
  380. package/dist/client/assets/project-tasks-BrFIJeSm.js +0 -1
  381. package/dist/client/assets/reports-C31yRbSC.js +0 -1
  382. package/dist/client/assets/repositories-D8_di3b3.js +0 -1
  383. package/dist/client/assets/route-CH_5kxvW.js +0 -1
  384. package/dist/client/assets/route-DF0O5T7i.js +0 -1
  385. package/dist/client/assets/settings-tab-DQUNLW_P.js +0 -1
  386. package/dist/client/assets/site-editor-DO210YQD.js +0 -1
  387. package/dist/client/assets/tasks-BYvtx4H_.js +0 -1
  388. package/dist/client/assets/use-ask-in-chat-CnM4deZ8.js +0 -1
  389. package/dist/client/assets/use-blocks-v8-project-CJV-tfcs.js +0 -1
  390. package/dist/client/assets/use-project-native-view-presence-Cwk8CqhY.js +0 -1
  391. package/dist/client/assets/useInfiniteQuery-BPQl0e27.js +0 -1
  392. package/dist/client/assets/useSuspenseInfiniteQuery-BZJyWpJ1.js +0 -1
@@ -1 +1 @@
1
- import{c as L,a4 as ae,a as pe,aj as Ce,K as fe,i as me,b as V,r as z,m as ee,j as n,h as Pe,B as qe,aR as ye,aQ as Ie,R as xt,E as he,x as Yt,aS as Zt,w as Qt,v as Xt,D as Jt,ab as es,aT as ts,aq as gt,t as ss,ar as ns,d as Me,n as st,aU as as,f as je,U as nt,l as bt,e as rs,u as Ae,aV as is,aW as ls,O as vt,aX as os,aY as cs,N as ds,aZ as us,P as De}from"./index-DIJ4i6l1.js";import{i as We}from"./AlertCircle-xXAUxL5Z.js";import{E as fs,F as at,A as ve,G as ms,H as hs,k as ps,I as xs,J as gs,K as bs,L as yt,M as vs,n as ys,m as js,o as Ss}from"./agent-icon-BA6h0wAH.js";import{c as ks,u as Ts}from"./use-sidebar-collapsed-Bo_fV1ZI.js";import{T as Ne}from"./toolbar-icon-button-DjIWEs2B.js";import{C as q,w as Ns}from"./index-zkOXDA9t.js";import{s as jt,u as St}from"./use-voice-input-CQAqEi1v.js";import{u as Le,b as Ye,c as $e,d as kt,e as _s,s as ws}from"./chat-context-CaBz0Fa_.js";import{u as Cs,s as Tt}from"./use-ai-providers-qcI9kSam.js";import{b as Nt,a as Ps,u as Is}from"./use-organization-settings-VtZHPkLh.js";import{i as Ms}from"./CheckCircle-DWmAA0cA.js";import{s as rt}from"./XClose-DiD5f6J1.js";import{u as Ee,a as As,b as _t,g as wt}from"./repository-binding-DnTIKvh_.js";import{I as Ct}from"./integration-icon-DBS0IIUZ.js";import{b as Ls}from"./use-entitlements-HGoX64MA.js";import{t as Ze}from"./ChevronUp-CjVmbW8q.js";import{O as $s}from"./pair-OacOFJo3.js";import{u as Es,a as Fs}from"./use-thread-outputs-DAMbPn4y.js";import{u as Rs}from"./use-deco-credits-CI_hVc5L.js";import{C as Os,u as Bs,V as Ds,a as zs}from"./input-DNY7YfN5.js";import{a as Gs}from"./agent-capabilities-JoZ74wKG.js";import{g as Pt,u as Hs,a as Ks,i as Vs,n as Us,b as qs}from"./cms-store-drafts-DBZ0eK6D.js";import{u as Ws,d as It,a as Qe,b as Xe,c as Mt,e as Ys}from"./thread-intent-BtmlqwRH.js";import{f as Zs,b as At,c as Qs}from"./use-navigate-to-agent-D5XHqsJq.js";import{o as Xs,s as Js,u as en,S as tn}from"./sandbox-lifecycle-context-T_FHqShI.js";import{E as Lt}from"./empty-state-JLp-0Ot0.js";import{t as sn,m as nn,u as an}from"./use-chat-layout-state-D2kmyA5o.js";import{b as it}from"./use-blocks-v8-project-CJV-tfcs.js";import{C as lt}from"./index-B5_ugeYO.js";import{a as $t,b as Et,P as Ft}from"./popover-D5azhkxn.js";import{T as Fe,a as Re,c as Oe}from"./tooltip-BVSpbx-_.js";import{T as rn,a as ln}from"./toggle-group-BL47pqaq.js";import{g as Je,j as on,k as cn,L as dn,s as un}from"./shell-layout-BAK0t5W4.js";import{u as Rt,a as et,r as fn,b as Ot,c as mn,d as hn}from"./thread-route-B-VKd0Ce.js";import{c as pn,C as xn,e as gn,b as bn,a as vn,f as yn}from"./command-B7jjL5t_.js";import{i as Bt}from"./Zap-DKp_mX_L.js";import{g as jn,S as Sn}from"./task-status-CYrsK5kS.js";import{a as Dt,u as kn}from"./autosend-QEZQmopg.js";import{u as zt}from"./use-main-panel-tabs-BExuHHIh.js";import{T as _e}from"./tab-icon-glyph-DN2wyTv4.js";import{a as Tn}from"./UserSquare-BawmuPOv.js";import{b as Nn,c as Gt,S as _n,d as wn}from"./select-DOPxEiy0.js";import{S as Cn}from"./use-sandbox-events-bTwWaKJH.js";import{L as Pn}from"./project-apps-CumaGNv9.js";import{L as tt,a as In}from"./legacy-main-redirect-DeJi8kpi.js";import{u as Mn}from"./use-mobile-CQ6V3YRN.js";import{L as An}from"./preview-dialog-DY-dYyi4.js";import{O as Ln}from"./markdown-B9ZXP-yI.js";import{B as ot}from"./blocks-preview-workspace-context-taTuRoj9.js";import{p as $n}from"./virtual-mcp-BaFxXna4.js";import"./Tool01-CiRc7Dx3.js";import"./ArrowUp-zmQoWTOv.js";import"./ArrowLeft-C3_uUc-z.js";import"./LinkBroken01-DOEirutZ.js";import"./ShoppingBag01-drnY5mbB.js";import"./Globe04-DE0bAUaJ.js";import"./ChevronSelectorVertical-CN80qRM1.js";import"./CreditCard01-DexMydMI.js";import"./SwitchHorizontal01-DTC4TsRM.js";import"./Key01-CYHpm2EC.js";import"./Minus-CzeqOX9y.js";import"./Monitor01-BRxbdUXR.js";import"./Sun-qq_IYs5i.js";import"./Play-lt5qVoJ1.js";import"./Plus-hGBo4v46.js";import"./SearchMd-5BOhX0M5.js";import"./Trash01-Bhop9SkH.js";import"./Upload01-Hve2lQE3.js";import"./Users01-BjAyisfu.js";import"./sheet-O98X_91-.js";import"./tool-namespace-qcytt9G1.js";import"./drawer-DEBrmbLh.js";import"./collection-search-Ji_27Bi5.js";import"./use-mcp-client-DfcqzMq1.js";import"./auth-0v5kQxM4.js";import"./use-mcp-prompts-BV72WbSD.js";import"./usage-stats-D5I4yIME.js";import"./form-DbD00MVE.js";import"./label-CE_9qjVi.js";import"./utils-CVEq3hMx.js";import"./use-copy-Bn5nWWQG.js";import"./index-DU8NkptJ.js";import"./checkbox-uRiFMDEw.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./feature-paywall-B2ECRUtY.js";import"./plan-ladder-Cw552rCe.js";import"./use-decopilot-events-BGb9i2D9.js";import"./watch-sse-pool-yarYBhtI.js";import"./task-board-95swTute.js";import"./schema-B0qCyNGJ.js";import"./backoff-CrEUbyZT.js";import"./collapsible-DaRxY8dD.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-wdm200pr.js";import"./types-DGYfIFbD.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./use-connection-BCwT2p8B.js";import"./file-type-icon-BT2FK5D4.js";import"./icon-button-jwnQI3ne.js";import"./chat-draft-0xyMYS4v.js";import"./tabs-DeTALxBi.js";import"./active-indicator-CCMhAsc_.js";import"./input-DZ3UD8Tc.js";import"./suggestion-DU-baT9O.js";import"./use-org-fs-BqH5T3Sy.js";import"./useInfiniteQuery-BPQl0e27.js";import"./infiniteQueryObserver-tz8kMnh3.js";import"./question-004-sINsf4GQ.js";import"./add-connection-dialog-BFH1NNm1.js";import"./extract-connection-data-OTtBFz40.js";import"./metadata-D72DunRR.js";import"./connection-BPIYy_H3.js";import"./url-slug-Dz10RPtP.js";import"./connection-card-By0LB3P3.js";import"./connection-slug-Ch_wi6rN.js";import"./textarea-jjFZrPcz.js";import"./schema-D6loGo_O.js";import"./connection-form-helpers-C4GFwQ2z.js";import"./authenticate-and-persist-oauth-CEFAAPr5.js";import"./mcp-oauth-YcJKxGgu.js";import"./mcp-oauth-De1bAphR.js";import"./collection-tabs-BaAIKaN4.js";import"./badge-OxXf6NyW.js";import"./use-infinite-scroll-KRVACoeF.js";import"./useSuspenseInfiniteQuery-BZJyWpJ1.js";import"./use-task-board-events-rFqMtePj.js";import"./serial-task-queue-CGOeQgpr.js";import"./delay-CnY5UFtP.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./resizable-CAylzP2b.js";import"./use-project-scope-B83JUNc2.js";import"./index-BDIGIIrk.js";import"./use-deployment-admin-CfaGw49b.js";import"./admin-fetch-BhTJlAsX.js";import"./project-icon-CapKL04Y.js";import"./use-debounced-value-CALTE0-J.js";import"./new-project-dialog-CapD_z2K.js";import"./repository-picker-Dm4xl8L-.js";import"./github-icon-cCo3aev2.js";import"./legacy-admin-welcome-dialog-DufciNkJ.js";import"./required-auth-layout-DhuiRYqz.js";import"./use-org-sso-u9TOWNqG.js";import"./index-Dqe8gjuB.js";import"./use-mcp-tools-7PQ3NovP.js";import"./resolve-tab-icon-uqUI1ibt.js";import"./use-task-metadata-bDql024r.js";import"./preview-source-BsRLGWUP.js";import"./use-project-native-view-presence-Cwk8CqhY.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-DJ8uwfYI.js";import"./index-BdQq_4o_.js";import"./sandbox-url-D3mC8qhT.js";import"./preview-content-ABYTWtaZ.js";import"./file-share-button-DwysRdf9.js";import"./file-preview-QvtQ9sFZ.js";import"./utils-DQFBRZPm.js";import"./editor-DABA4jRW.js";function En({isThreadLocked:t,hasCloudProviderKeys:e,sandboxOnlyChats:s,canRunClaudeCode:r}){return t?null:!e&&!(s&&r)?"provider":s&&!r?"claude-code-provider":null}function Fn(){const t=L.c(26),e=Cs(),s=Le(),r=Nt(),i=Ps("chat_harness_codex"),{org:a}=ae(),{data:l}=pe.useSession(),c=l?.user.id??"",u=Ce(),o=e.some(On);let d;t[0]!==a.id||t[1]!==c?(d=fe.claudeSubscription(a.id,c),t[0]=a.id,t[1]=c,t[2]=d):d=t[2];let m;t[3]!==u?(m=()=>u.call("CLAUDE_SUBSCRIPTION_STATUS",{}),t[3]=u,t[4]=m):m=t[4];const f=r&&!i&&!o;let h;t[5]!==d||t[6]!==m||t[7]!==f?(h={queryKey:d,queryFn:m,enabled:f},t[5]=d,t[6]=m,t[7]=f,t[8]=h):h=t[8];const b=me(h);let g;t[9]!==a.id?(g=fe.githubCopilot(a.id),t[9]=a.id,t[10]=g):g=t[10];let v;t[11]!==u?(v=()=>u.call("GITHUB_COPILOT_STATUS",{}),t[11]=u,t[12]=v):v=t[12];const x=r&&!i&&!o;let y;t[13]!==g||t[14]!==v||t[15]!==x?(y={queryKey:g,queryFn:v,enabled:x},t[13]=g,t[14]=v,t[15]=x,t[16]=y):y=t[16];const j=me(y);let S;t[17]!==a.id||t[18]!==c?(S=fe.codexSubscription(a.id,c),t[17]=a.id,t[18]=c,t[19]=S):S=t[19];let p;t[20]!==u?(p=()=>u.call("CODEX_SUBSCRIPTION_STATUS",{}),t[20]=u,t[21]=p):p=t[21];const k=r&&i;let T;t[22]!==k||t[23]!==S||t[24]!==p?(T={queryKey:S,queryFn:p,enabled:k},t[22]=k,t[23]=S,t[24]=p,t[25]=T):T=t[25];const N=me(T);return r&&i&&!s?.isThreadLocked?e.some(Rn)||N.data?.connected!==!1?null:"codex-provider":En({isThreadLocked:s?.isThreadLocked??!1,hasCloudProviderKeys:e.length>0,sandboxOnlyChats:r,canRunClaudeCode:o||b.data?.connected!==!1||j.data?.connected!==!1||!!j.data?.orgShare})}function Rn(t){return jt(t.providerId)}function On(t){return Tt(t.providerId)}function be(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function ze(t){if(!t)return"—";const e=typeof t=="string"?new Date(t):t;return isNaN(e.getTime())?"—":e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function Bn(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function Dn(t){const e=L.c(4),{items:s}=t;let r;e[0]!==s?(r=s.map(zn),e[0]=s,e[1]=r):r=e[1];let i;return e[2]!==r?(i=n.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:r}),e[2]=r,e[3]=i):i=e[3],i}function zn(t){return n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[n.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t.label}),n.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:t.value})]},t.label)}function Gn(t){const e=L.c(33),{userTokens:s,assistantTokens:r,otherTokens:i}=t,a=V(),l=s+r+i,c=l>0?s/l*100:0,u=l>0?r/l*100:0,o=l>0?i/l*100:0;let d;e[0]!==c?(d=c>0&&n.jsx("div",{className:"h-full bg-chart-1",style:{width:`${c}%`}}),e[0]=c,e[1]=d):d=e[1];let m;e[2]!==u?(m=u>0&&n.jsx("div",{className:"h-full bg-chart-2",style:{width:`${u}%`}}),e[2]=u,e[3]=m):m=e[3];let f;e[4]!==o?(f=o>0&&n.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${o}%`}}),e[4]=o,e[5]=f):f=e[5];let h;e[6]!==d||e[7]!==m||e[8]!==f?(h=n.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[d,m,f]}),e[6]=d,e[7]=m,e[8]=f,e[9]=h):h=e[9];let b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=b):b=e[10];let g;e[11]!==a||e[12]!==c?(g=a("chat.contextPanel.userPercent",{pct:c.toFixed(1)}),e[11]=a,e[12]=c,e[13]=g):g=e[13];let v;e[14]!==g?(v=n.jsxs("div",{className:"flex items-center gap-1.5",children:[b,n.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e[14]=g,e[15]=v):v=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[16]=x):x=e[16];let y;e[17]!==u||e[18]!==a?(y=a("chat.contextPanel.assistantPercent",{pct:u.toFixed(1)}),e[17]=u,e[18]=a,e[19]=y):y=e[19];let j;e[20]!==y?(j=n.jsxs("div",{className:"flex items-center gap-1.5",children:[x,n.jsx("span",{className:"text-xs text-muted-foreground",children:y})]}),e[20]=y,e[21]=j):j=e[21];let S;e[22]!==o||e[23]!==i||e[24]!==a?(S=i>0&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.otherPercent",{pct:o.toFixed(1)})})]}),e[22]=o,e[23]=i,e[24]=a,e[25]=S):S=e[25];let p;e[26]!==j||e[27]!==S||e[28]!==v?(p=n.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[v,j,S]}),e[26]=j,e[27]=S,e[28]=v,e[29]=p):p=e[29];let k;return e[30]!==p||e[31]!==h?(k=n.jsxs("div",{className:"flex flex-col gap-2",children:[h,p]}),e[30]=p,e[31]=h,e[32]=k):k=e[32],k}function Hn(t){const e=L.c(14),{agentId:s,isError:r}=t,i=Ee(s),a=V();let l;e[0]!==i?.title||e[1]!==a?(l=i?.title??a("chat.subtask.subtaskNoun"),e[0]=i?.title,e[1]=a,e[2]=l):l=e[2];const c=l,u=i?.icon??null;let o;e[3]!==u||e[4]!==c?(o=n.jsx(Ct,{icon:u,name:c,size:"xs",className:"size-6 rounded-md shrink-0"}),e[3]=u,e[4]=c,e[5]=o):o=e[5];const d=r?"text-destructive":"text-foreground";let m;e[6]!==d?(m=ee("shrink-0 font-medium",d),e[6]=d,e[7]=m):m=e[7];let f;e[8]!==c||e[9]!==m?(f=n.jsx("span",{className:m,children:c}),e[8]=c,e[9]=m,e[10]=f):f=e[10];let h;return e[11]!==o||e[12]!==f?(h=n.jsxs(n.Fragment,{children:[o,f]}),e[11]=o,e[12]=f,e[13]=h):h=e[13],h}function Kn(t){const e=L.c(12),{isError:s}=t,r=V();let i;e[0]!==r?(i=r("chat.contextPanel.subtask"),e[0]=r,e[1]=i):i=e[1];const a=i;let l;e[2]!==a?(l=n.jsx(Ct,{icon:null,name:a,size:"xs",className:"size-6 rounded-md shrink-0"}),e[2]=a,e[3]=l):l=e[3];const c=s?"text-destructive":"text-foreground";let u;e[4]!==c?(u=ee("shrink-0 font-medium",c),e[4]=c,e[5]=u):u=e[5];let o;e[6]!==a||e[7]!==u?(o=n.jsx("span",{className:u,children:a}),e[6]=a,e[7]=u,e[8]=o):o=e[8];let d;return e[9]!==l||e[10]!==o?(d=n.jsxs(n.Fragment,{children:[l,o]}),e[9]=l,e[10]=o,e[11]=d):d=e[11],d}function Vn(t){const e=L.c(18),{part:s}=t,r=s.input?.agent_id,i=s.state==="input-streaming"||s.state==="input-available"||s.state==="output-available"&&s.preliminary===!0,a=s.state==="output-error",l=s.state==="approval-requested";let c;e[0]!==a?(c=n.jsx(Kn,{isError:a}),e[0]=a,e[1]=c):c=e[1];let u;e[2]!==r||e[3]!==a?(u=n.jsx(Hn,{agentId:r,isError:a}),e[2]=r,e[3]=a,e[4]=u):u=e[4];let o;e[5]!==c||e[6]!==u?(o=n.jsx(z.Suspense,{fallback:c,children:u}),e[5]=c,e[6]=u,e[7]=o):o=e[7];let d;e[8]!==s.input?(d=s.input?.prompt&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted-foreground/50",children:"·"}),n.jsx("span",{className:"truncate text-muted-foreground",children:s.input.prompt})]}),e[8]=s.input,e[9]=d):d=e[9];let m;e[10]!==l||e[11]!==a||e[12]!==i?(m=n.jsx("span",{className:"ml-auto shrink-0",children:i?n.jsx(Pe,{className:"size-3 text-muted-foreground"}):a?n.jsx(fs,{size:12,className:"text-destructive"}):l?n.jsx(We,{size:12,className:"text-warning"}):n.jsx(Ms,{size:12,className:"text-success"})}),e[10]=l,e[11]=a,e[12]=i,e[13]=m):m=e[13];let f;return e[14]!==o||e[15]!==d||e[16]!==m?(f=n.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[o,d,m]}),e[14]=o,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Un(t){const e=L.c(51),{onClose:s,back:r,className:i}=t,a=V(),[l,c]=z.useState(null),{messages:u}=Ye(),{activeTask:o}=$e(),{selectedModel:d,selectedVirtualMcp:m}=kt(),f=_s(u),h=[...u].reverse().find(aa),b=h?.metadata?.usage,g=[...u].reverse().find(na)?.metadata?.models?.thinking,v=h?.metadata?.modelLimits?.contextWindow??(!g||g.id===d?.modelId?d?.limits?.contextWindow:null)??null,x=b?.contextTokens??0,y=v&&v>0?(x/v*100).toFixed(1):null,j=u;let S;e[0]!==j?(S=j.filter(sa).reduce(ta,0),e[0]=j,e[1]=S):S=e[1];const p=S,k=u;let T;e[2]!==k?(T=k.filter(ea).reduce(Jn,0),e[2]=k,e[3]=T):T=e[3];const N=T,w=Math.max(0,f.totalTokens-p-N),_=u[0],P=u.at(-1),C=_?.metadata?.created_at??o?.created_at,A=P?.metadata?.created_at??o?.updated_at,M=u.filter(Xn),$=u.flatMap(Zn),E=Bn(g?.id??d?.modelId),F=m?.title??"Super Agent",R=Ls(),I=[{label:a("chat.contextPanel.sessionLabel"),value:o?.title??a("chat.contextPanel.newChat")},{label:a("chat.contextPanel.messagesLabel"),value:M.length},{label:a("chat.contextPanel.agentLabel"),value:F},...R?[{label:a("chat.contextPanel.modelLabel"),value:E}]:[],{label:a("chat.contextPanel.contextLimitLabel"),value:v?be(v):"—"},{label:a("chat.contextPanel.sessionTokensLabel"),value:f.totalTokens>0?be(f.totalTokens):"0"},{label:a("chat.contextPanel.usageLabel"),value:y!==null?`${y}%`:"—"},{label:a("chat.contextPanel.inputTokensLabel"),value:f.inputTokens>0?be(f.inputTokens):"0"},{label:a("chat.contextPanel.outputTokensLabel"),value:f.outputTokens>0?be(f.outputTokens):"0"},{label:a("chat.contextPanel.reasoningTokensLabel"),value:f.reasoningTokens>0?be(f.reasoningTokens):"0"},...R?[{label:a("chat.contextPanel.costLabel"),value:f.cost>0?`$${f.cost<.001?f.cost.toFixed(6):f.cost.toFixed(4)}`:"$0.00"}]:[],{label:a("chat.contextPanel.sessionCreatedLabel"),value:ze(C)},{label:a("chat.contextPanel.lastActivityLabel"),value:ze(A)}];if(!o&&M.length===0){let G;e[4]!==i?(G=ee("flex flex-col h-full w-full border-l border-border bg-background",i),e[4]=i,e[5]=G):G=e[5];let re;e[6]!==a?(re=a("chat.contextPanel.title"),e[6]=a,e[7]=re):re=e[7];let X;e[8]!==re?(X=n.jsx("span",{className:"text-sm font-medium text-foreground",children:re}),e[8]=re,e[9]=X):X=e[9];let J;e[10]!==r?(J=r?n.jsx(at,{size:14,className:"text-muted-foreground"}):n.jsx(rt,{size:14,className:"text-muted-foreground"}),e[10]=r,e[11]=J):J=e[11];let te;e[12]!==s||e[13]!==J?(te=n.jsx("button",{type:"button",onClick:s,className:"flex size-6 items-center justify-center hover:bg-accent transition-colors rounded-lg",children:J}),e[12]=s,e[13]=J,e[14]=te):te=e[14];let ne;e[15]!==X||e[16]!==te?(ne=n.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[X,te]}),e[15]=X,e[16]=te,e[17]=ne):ne=e[17];let ie;e[18]!==a?(ie=a("chat.contextPanel.emptyState"),e[18]=a,e[19]=ie):ie=e[19];let se;e[20]!==ie?(se=n.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:n.jsx("p",{className:"text-xs text-muted-foreground",children:ie})}),e[20]=ie,e[21]=se):se=e[21];let oe;return e[22]!==ne||e[23]!==se||e[24]!==G?(oe=n.jsxs("div",{className:G,children:[ne,se]}),e[22]=ne,e[23]=se,e[24]=G,e[25]=oe):oe=e[25],oe}let B;e[26]!==i?(B=ee("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",i),e[26]=i,e[27]=B):B=e[27];let O;e[28]!==a?(O=a("chat.contextPanel.title"),e[28]=a,e[29]=O):O=e[29];let H;e[30]!==O?(H=n.jsx("span",{className:"text-sm font-medium text-foreground",children:O}),e[30]=O,e[31]=H):H=e[31];let D;e[32]!==r?(D=r?n.jsx(at,{className:"size-3.5"}):n.jsx(rt,{className:"size-3.5"}),e[32]=r,e[33]=D):D=e[33];let U;e[34]!==s||e[35]!==D?(U=n.jsx(qe,{type:"button",variant:"ghost",size:"icon-sm",onClick:s,className:"text-muted-foreground",children:D}),e[34]=s,e[35]=D,e[36]=U):U=e[36];let Z;e[37]!==H||e[38]!==U?(Z=n.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[H,U]}),e[37]=H,e[38]=U,e[39]=Z):Z=e[39];let Y;e[40]!==a?(Y=a("chat.contextPanel.contextBreakdownSection"),e[40]=a,e[41]=Y):Y=e[41];let Q;e[42]!==Y?(Q=n.jsx("span",{className:"text-xs text-muted-foreground",children:Y}),e[42]=Y,e[43]=Q):Q=e[43];let W;e[44]!==N||e[45]!==w||e[46]!==p?(W=n.jsx(Gn,{userTokens:p,assistantTokens:N,otherTokens:w}),e[44]=N,e[45]=w,e[46]=p,e[47]=W):W=e[47];let le;return e[48]!==Q||e[49]!==W?(le=n.jsxs("div",{className:"flex flex-col gap-3",children:[Q,W]}),e[48]=Q,e[49]=W,e[50]=le):le=e[50],n.jsxs("div",{className:B,children:[Z,n.jsxs("div",{className:"flex flex-col gap-8 p-6",children:[$.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.subtasksSection")}),n.jsx("div",{className:"flex flex-col gap-1",children:$.map(Yn)})]}),n.jsx(Dn,{items:I}),le,M.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.rawMessagesSection")}),n.jsx("div",{className:"flex flex-col gap-1",children:M.map(G=>{const re=G.metadata?.created_at,X=l?.id===G.id;return n.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:()=>c(X?null:G),className:"flex items-center justify-between gap-2 px-3 py-2 text-xs hover:bg-accent w-full text-left cursor-pointer",children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:ee("shrink-0 font-medium",G.role==="user"?"text-chart-1":"text-chart-2"),children:G.role}),n.jsx("span",{className:"text-muted-foreground",children:"•"}),n.jsx("span",{className:"truncate text-muted-foreground font-mono",children:G.id})]}),re&&n.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:ze(re)})]}),X&&n.jsxs(n.Fragment,{children:[G.role==="assistant"&&(()=>{const J=G.metadata?._request;if(!J)return null;const te=J.systemSections??[],ne=Math.max(1,...te.map(Wn)),ie=te.reduce(qn,0);return n.jsxs("div",{className:"border-t border-border/50 px-3 py-2.5 text-xs space-y-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"font-medium text-foreground",children:a("chat.contextPanel.requestLabel")}),n.jsxs("span",{className:"text-muted-foreground tabular-nums",children:[J.activeTools??0," / ",J.tools??0," ",a("chat.contextPanel.toolsActive")]})]}),te.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"text-muted-foreground",children:[a("chat.contextPanel.systemPromptLabel")," ",n.jsxs("span",{className:"tabular-nums",children:["~",Math.round(ie/4).toLocaleString()," ",a("chat.contextPanel.tokAbbrev")]})]}),te.map((se,oe)=>{const ce=se.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${oe}`,xe=se.chars/ne*100,de=Math.round(se.chars/4);return n.jsxs("div",{className:"space-y-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:"font-mono text-foreground truncate",children:ce}),n.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["~",de.toLocaleString()," ",a("chat.contextPanel.tokAbbrev")]})]}),n.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-chart-3",style:{width:`${xe}%`}})})]},oe)})]})]})})(),n.jsx("pre",{className:"text-xs font-mono bg-muted px-3 py-2 overflow-auto whitespace-pre-wrap break-all border-t border-border/50 max-h-64",children:JSON.stringify(G,null,2)})]})]},G.id)})})]})]})]})}function qn(t,e){return t+e.chars}function Wn(t){return t.chars}function Yn(t,e){return n.jsx(Vn,{part:t},e)}function Zn(t){return(t.parts??[]).filter(Qn)}function Qn(t){return t.type==="tool-subtask"}function Xn(t){return t.role!=="system"}function Jn(t,e){const s=e.metadata?.usage;return t+(s?.outputTokens??0)}function ea(t){return t.role==="assistant"}function ta(t,e){const s=e.metadata?.usage;return t+(s?.inputTokens??0)}function sa(t){return t.role==="user"}function na(t){return t.role==="assistant"&&t.metadata?.models}function aa(t){return t.role==="assistant"&&t.metadata?.usage}function ra(t){const e=L.c(21),{onOpenContextPanel:s}=t,{org:r}=ae(),{selectedVirtualMcp:i}=kt();let a;e[0]!==r.id?(a=ye(r.id),e[0]=r.id,e[1]=a):a=e[1];const c=i??a,o=Ee(c.id)??c,d=o.title??"Super Agent",m=o.icon??null,f=o.description??null;let h;e[2]!==m||e[3]!==d?(h=n.jsx(ve,{icon:m,name:d,size:"lg"}),e[2]=m,e[3]=d,e[4]=h):h=e[4];let b;e[5]!==d?(b=n.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:d}),e[5]=d,e[6]=b):b=e[6];let g;e[7]!==f?(g=f?n.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-balance",children:f}):null,e[7]=f,e[8]=g):g=e[8];let v;e[9]!==b||e[10]!==g?(v=n.jsxs("div",{className:"space-y-1.5",children:[b,g]}),e[9]=b,e[10]=g,e[11]=v):v=e[11];let x;e[12]!==h||e[13]!==v?(x=n.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-4 px-6 text-center overflow-hidden",children:[h,v]}),e[12]=h,e[13]=v,e[14]=x):x=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(q.IceBreakers,{className:"pb-3"}),e[15]=y):y=e[15];let j;e[16]!==s?(j=n.jsxs(q.Footer,{children:[y,n.jsx(q.Input,{onOpenContextPanel:s})]}),e[16]=s,e[17]=j):j=e[17];let S;return e[18]!==x||e[19]!==j?(S=n.jsxs(n.Fragment,{children:[x,j]}),e[18]=x,e[19]=j,e[20]=S):S=e[20],S}function ct(t){const e=L.c(17),{outputs:s,collapsed:r,onToggle:i,variant:a}=t,l=a==="card"?"rounded-xl bg-muted/95 shadow-edge backdrop-blur-sm":"border-b border-border bg-background";let c;e[0]!==l?(c=ee(l),e[0]=l,e[1]=c):c=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Files in this task"}),e[2]=u):u=e[2];const o=r&&"-rotate-90";let d;e[3]!==o?(d=ee("size-4 text-muted-foreground transition-transform",o),e[3]=o,e[4]=d):d=e[4];let m;e[5]!==d?(m=n.jsx(Ze,{className:d}),e[5]=d,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==m?(f=n.jsxs("button",{type:"button",onClick:i,className:"flex w-full items-center justify-between px-3 py-2.5 text-left",children:[u,m]}),e[7]=i,e[8]=m,e[9]=f):f=e[9];let h;e[10]!==r||e[11]!==s?(h=!r&&n.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto px-2 pb-2",children:s.map(ia)}),e[10]=r,e[11]=s,e[12]=h):h=e[12];let b;return e[13]!==c||e[14]!==f||e[15]!==h?(b=n.jsxs("div",{className:c,children:[f,h]}),e[13]=c,e[14]=f,e[15]=h,e[16]=b):b=e[16],b}function ia(t){return n.jsx($s,{file:t},t.key)}function la(){const t=L.c(13),e=Le()?.taskId??null,s=Es();let r;t[0]!==s?(r={enabled:s},t[0]=s,t[1]=r):r=t[1];const{data:i}=Fs(e,r),[a,l]=z.useState(!1),[c,u]=z.useState(!0);if(!e||!i||i.length===0)return null;let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=()=>l(ca),t[2]=o):o=t[2];let d;t[3]!==a||t[4]!==i?(d=n.jsx("div",{className:"absolute top-2 right-2 z-10 hidden w-72 @[1280px]:block",children:n.jsx(ct,{variant:"card",outputs:i,collapsed:a,onToggle:o})}),t[3]=a,t[4]=i,t[5]=d):d=t[5];let m;t[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>u(oa),t[6]=m):m=t[6];let f;t[7]!==c||t[8]!==i?(f=n.jsx("div",{className:"shrink-0 @[1280px]:hidden",children:n.jsx(ct,{variant:"bar",outputs:i,collapsed:c,onToggle:m})}),t[7]=c,t[8]=i,t[9]=f):f=t[9];let h;return t[10]!==d||t[11]!==f?(h=n.jsxs(n.Fragment,{children:[d,f]}),t[10]=d,t[11]=f,t[12]=h):h=t[12],h}function oa(t){return!t}function ca(t){return!t}function da(){const t=L.c(1);z.use(Ye().ready);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Os,{children:n.jsx(ua,{})}),t[0]=e):e=t[0],e}function ua(){const t=L.c(29),{active:e}=Bs(),{org:s}=ae(),r=Le(),{isChatEmpty:i}=Ye(),[a,l]=z.useState("chat"),c=Rs(),u=V(),o=Fn(),{runtime:d}=St(r?.virtualMcpId);if(o!==null&&d!=="cms"){let N;return t[0]!==o||t[1]!==u?(N=n.jsx(q,{className:"animate-in fade-in-0 duration-200",children:n.jsx(q.Main,{className:"flex flex-col items-center",children:n.jsx(q.EmptyState,{children:o==="codex-provider"?n.jsx(q.NoAiProviderEmptyState,{title:u("settings.codexSubscription.setupHeading"),description:u("settings.codexSubscription.setupDescription"),providerFilter:jt}):o==="claude-code-provider"?n.jsx(q.NoAiProviderEmptyState,{title:u("chat.noAiProviderEmptyState.supportedHeading"),description:u("chat.noAiProviderEmptyState.supportedSubtitle"),providerFilter:Tt}):n.jsx(q.NoAiProviderEmptyState,{})})})}),t[0]=o,t[1]=u,t[2]=N):N=t[2],N}let f;t[3]!==c.hasDecoKey||t[4]!==c.hasOnlyDecoProvider||t[5]!==c.isLoading||t[6]!==c.isZeroBalance||t[7]!==i||t[8]!==s?(f=c.hasDecoKey&&c.isZeroBalance&&c.hasOnlyDecoProvider&&!c.isLoading&&i&&!Ns(s.id),t[3]=c.hasDecoKey,t[4]=c.hasOnlyDecoProvider,t[5]=c.isLoading,t[6]=c.isZeroBalance,t[7]=i,t[8]=s,t[9]=f):f=t[9];const h=f;let b;t[10]!==h?(b=h&&n.jsx(q.CreditsEmptyState,{}),t[10]=h,t[11]=b):b=t[11];let g;t[12]!==a||t[13]!==i||t[14]!==d||t[15]!==e?(g=!e&&n.jsx("div",{inert:a!=="chat"?!0:void 0,"aria-hidden":a!=="chat",className:ee("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",a!=="chat"?"opacity-0 pointer-events-none":"opacity-100"),children:i&&d!=="cms"?n.jsx(ra,{onOpenContextPanel:()=>l("context")}):n.jsxs(n.Fragment,{children:[n.jsxs(q.Main,{className:"relative flex flex-col overflow-hidden @container",children:[n.jsx(la,{}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(q.Messages,{})})]}),n.jsx(q.Footer,{children:n.jsx(q.Input,{onOpenContextPanel:()=>l("context")})})]})}),t[12]=a,t[13]=i,t[14]=d,t[15]=e,t[16]=g):g=t[16];let v;t[17]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ds,{}),t[17]=v):v=t[17];const x=a!=="context"?!0:void 0,y=a!=="context",j=a==="context"?"opacity-100":"opacity-0 pointer-events-none";let S;t[18]!==j?(S=ee("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",j),t[18]=j,t[19]=S):S=t[19];let p;t[20]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Un,{back:!0,onClose:()=>l("chat")}),t[20]=p):p=t[20];let k;t[21]!==x||t[22]!==y||t[23]!==S?(k=n.jsx("div",{inert:x,"aria-hidden":y,className:S,children:p}),t[21]=x,t[22]=y,t[23]=S,t[24]=k):k=t[24];let T;return t[25]!==b||t[26]!==g||t[27]!==k?(T=n.jsxs(q,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[b,g,v,k]}),t[25]=b,t[26]=g,t[27]=k,t[28]=T):T=t[28],T}function fa(){const t=L.c(7),e=V();let s;t[0]!==e?(s=e("agentShellLayout.agentShellLayout.chatLoadingError"),t[0]=e,t[1]=s):s=t[1];let r;t[2]!==s?(r=n.jsx("div",{role:"alert",className:"flex h-full flex-1 items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=r):r=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ie,{children:n.jsx(da,{})}),t[4]=i):i=t[4];let a;return t[5]!==r?(a=n.jsx(xt,{fallback:r,children:i}),t[5]=r,t[6]=a):a=t[6],a}function ma(t){const e=L.c(10),{org:s}=ae(),r=Ws(),{data:i}=pe.useSession(),a=i?.user?.id,l=t?.id??null,c=!!t&&!!a&&!!t.created_by&&t.created_by!==a;let u;e[0]!==s.id||e[1]!==l?(u=fe.viewedThreadMetadataRefresh(s.id,l??""),e[0]=s.id,e[1]=l,e[2]=u):u=e[2];const o=!!r&&!!l&&c;let d;e[3]!==r||e[4]!==l?(d=async()=>(await r?.refreshThreadMetadata(l??""),!0),e[3]=r,e[4]=l,e[5]=d):d=e[5];let m;e[6]!==u||e[7]!==o||e[8]!==d?(m={queryKey:u,enabled:o,staleTime:Number.POSITIVE_INFINITY,queryFn:d},e[6]=u,e[7]=o,e[8]=d,e[9]=m):m=e[9],me(m)}function Ge(t){const e=L.c(14),{label:s,value:r,onChange:i,options:a}=t;let l;e[0]!==s?(l=n.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=l):l=e[1];let c;e[2]!==i?(c=m=>m&&i(m),e[2]=i,e[3]=c):c=e[3];let u;e[4]!==a?(u=a.map(ha),e[4]=a,e[5]=u):u=e[5];let o;e[6]!==s||e[7]!==c||e[8]!==u||e[9]!==r?(o=n.jsx(ln,{type:"single",size:"sm",value:r,onValueChange:c,"aria-label":s,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:u}),e[6]=s,e[7]=c,e[8]=u,e[9]=r,e[10]=o):o=e[10];let d;return e[11]!==l||e[12]!==o?(d=n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l,o]}),e[11]=l,e[12]=o,e[13]=d):d=e[13],d}function ha(t){return n.jsxs(rn,{value:t.value,className:"h-6 gap-1.5 rounded-lg px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:bg-card data-[state=on]:text-foreground data-[state=on]:shadow-edge",children:[t.icon,t.label]},t.value)}function pa(t){const e=L.c(91),{panel:s,className:r}=t,i=r===void 0?"md:size-[34px]":r,a=V();let l;e[0]!==a?(l=a("sidebar.taskGroupsList.filterChats"),e[0]=a,e[1]=l):l=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ms,{size:16}),e[2]=c):c=e[2];let u;e[3]!==s.filtersActive?(u=s.filtersActive&&n.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"}),e[3]=s.filtersActive,e[4]=u):u=e[4];let o;e[5]!==i||e[6]!==s.filtersActive||e[7]!==l||e[8]!==u?(o=n.jsx(Fe,{asChild:!0,children:n.jsx($t,{asChild:!0,children:n.jsxs(Ne,{"aria-label":l,active:s.filtersActive,className:i,children:[c,u]})})}),e[5]=i,e[6]=s.filtersActive,e[7]=l,e[8]=u,e[9]=o):o=e[9];let d;e[10]!==a?(d=a("sidebar.taskGroupsList.filterChats"),e[10]=a,e[11]=d):d=e[11];let m;e[12]!==d?(m=n.jsx(Re,{side:"bottom",children:d}),e[12]=d,e[13]=m):m=e[13];let f;e[14]!==o||e[15]!==m?(f=n.jsxs(Oe,{children:[o,m]}),e[14]=o,e[15]=m,e[16]=f):f=e[16];let h;e[17]!==a?(h=a("sidebar.taskGroupsList.filterView"),e[17]=a,e[18]=h):h=e[18];const b=s.groupBy;let g;e[19]!==s?(g=G=>{he("tasks_panel_group_by_changed",{to_value:G}),s.setGroupBy(G)},e[19]=s,e[20]=g):g=e[20];let v;e[21]!==a?(v=a("sidebar.taskGroupsList.viewList"),e[21]=a,e[22]=v):v=e[22];let x;e[23]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(hs,{size:13}),e[23]=x):x=e[23];let y;e[24]!==v?(y={value:"flat",label:v,icon:x},e[24]=v,e[25]=y):y=e[25];let j;e[26]!==a?(j=a("sidebar.taskGroupsList.viewStatus"),e[26]=a,e[27]=j):j=e[27];let S;e[28]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(ps,{size:13}),e[28]=S):S=e[28];let p;e[29]!==j?(p={value:"status",label:j,icon:S},e[29]=j,e[30]=p):p=e[30];let k;e[31]!==y||e[32]!==p?(k=[y,p],e[31]=y,e[32]=p,e[33]=k):k=e[33];let T;e[34]!==s.groupBy||e[35]!==g||e[36]!==k||e[37]!==h?(T=n.jsx(Ge,{label:h,value:b,onChange:g,options:k}),e[34]=s.groupBy,e[35]=g,e[36]=k,e[37]=h,e[38]=T):T=e[38];let N;e[39]!==a?(N=a("sidebar.taskGroupsList.filterType"),e[39]=a,e[40]=N):N=e[40];const w=s.typeFilter;let _;e[41]!==s?(_=G=>{he("tasks_panel_filter_changed",{to_value:G}),s.setTypeFilter(G)},e[41]=s,e[42]=_):_=e[42];let P;e[43]!==a?(P=a("sidebar.taskGroupsList.typeAll"),e[43]=a,e[44]=P):P=e[44];let C;e[45]!==P?(C={value:"all",label:P},e[45]=P,e[46]=C):C=e[46];let A;e[47]!==a?(A=a("sidebar.taskGroupsList.typeChats"),e[47]=a,e[48]=A):A=e[48];let M;e[49]!==A?(M={value:"manual",label:A},e[49]=A,e[50]=M):M=e[50];let $;e[51]!==a?($=a("sidebar.taskGroupsList.typeAuto"),e[51]=a,e[52]=$):$=e[52];let E;e[53]!==$?(E={value:"automation",label:$},e[53]=$,e[54]=E):E=e[54];let F;e[55]!==C||e[56]!==M||e[57]!==E?(F=[C,M,E],e[55]=C,e[56]=M,e[57]=E,e[58]=F):F=e[58];let R;e[59]!==s.typeFilter||e[60]!==N||e[61]!==_||e[62]!==F?(R=n.jsx(Ge,{label:N,value:w,onChange:_,options:F}),e[59]=s.typeFilter,e[60]=N,e[61]=_,e[62]=F,e[63]=R):R=e[63];let I;e[64]!==a?(I=a("sidebar.taskGroupsList.filterScope"),e[64]=a,e[65]=I):I=e[65];const B=s.showAll?"team":"mine";let O;e[66]!==s?(O=G=>s.setShowAll(G==="team"),e[66]=s,e[67]=O):O=e[67];let H;e[68]!==a?(H=a("sidebar.taskGroupsList.scopeMine"),e[68]=a,e[69]=H):H=e[69];let D;e[70]!==H?(D={value:"mine",label:H},e[70]=H,e[71]=D):D=e[71];let U;e[72]!==a?(U=a("sidebar.taskGroupsList.scopeTeam"),e[72]=a,e[73]=U):U=e[73];let Z;e[74]!==U?(Z={value:"team",label:U},e[74]=U,e[75]=Z):Z=e[75];let Y;e[76]!==D||e[77]!==Z?(Y=[D,Z],e[76]=D,e[77]=Z,e[78]=Y):Y=e[78];let Q;e[79]!==I||e[80]!==B||e[81]!==O||e[82]!==Y?(Q=n.jsx(Ge,{label:I,value:B,onChange:O,options:Y}),e[79]=I,e[80]=B,e[81]=O,e[82]=Y,e[83]=Q):Q=e[83];let W;e[84]!==T||e[85]!==R||e[86]!==Q?(W=n.jsxs(Et,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[T,R,Q]}),e[84]=T,e[85]=R,e[86]=Q,e[87]=W):W=e[87];let le;return e[88]!==W||e[89]!==f?(le=n.jsxs(Ft,{children:[f,W]}),e[88]=W,e[89]=f,e[90]=le):le=e[90],le}function xa(t,e){return t.filter(s=>s.id===e||!!s.trigger_id||sn(s))}function ga(){const t=L.c(2),e=As()??[];let s;return t[0]!==e?(s=r=>{if(!r)return;const i=e.find(a=>a.id===r);return i?It(i.metadata):void 0},t[0]=e,t[1]=s):s=t[1],s}function ba(t){const e=L.c(9),{virtualMcpId:s,size:r,showAutomationBadge:i}=t,a=r===void 0?"sm":r,l=V();let c;e[0]!==a||e[1]!==s?(c=s?n.jsx(va,{virtualMcpId:s,size:a}):n.jsx(ve,{icon:null,name:"?",size:a}),e[0]=a,e[1]=s,e[2]=c):c=e[2];let u;e[3]!==i||e[4]!==l?(u=i&&n.jsx("span",{"aria-label":l("tasksPanel.mcpAvatar.automationTriggered"),className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-special border border-special text-special-foreground",children:n.jsx(Bt,{size:10,className:"text-white"})}),e[3]=i,e[4]=l,e[5]=u):u=e[5];let o;return e[6]!==c||e[7]!==u?(o=n.jsxs("div",{className:"relative shrink-0",children:[c,u]}),e[6]=c,e[7]=u,e[8]=o):o=e[8],o}function va(t){const e=L.c(6),{virtualMcpId:s,size:r}=t,i=_t(s);if(!i){let c;return e[0]!==r?(c=n.jsx(ve,{icon:null,name:"?",size:r}),e[0]=r,e[1]=c):c=e[1],c}const a=i.icon??null;let l;return e[2]!==i.title||e[3]!==r||e[4]!==a?(l=n.jsx(ve,{icon:a,name:i.title,size:r}),e[2]=i.title,e[3]=r,e[4]=a,e[5]=l):l=e[5],l}const dt=["thread"];function ya(t){const e=L.c(53),{open:s,onOpenChange:r}=t,[i,a]=z.useState(""),{org:l}=ae(),{setTaskId:c}=Je(),u=Ce(),o=V();let d,m,f,h;e[0]!==l.id||e[1]!==i?(h=i.trim(),d=h?20:10,f=me,m=fe.globalSearch(l.id,h,d,dt),e[0]=l.id,e[1]=i,e[2]=d,e[3]=m,e[4]=f,e[5]=h):(d=e[2],m=e[3],f=e[4],h=e[5]);let b;e[6]!==d||e[7]!==u||e[8]!==h?(b=async()=>{const I=await u.call("GLOBAL_SEARCH",{query:h,limit:d,types:[...dt]});return{...I,items:I.items.filter(ja)}},e[6]=d,e[7]=u,e[8]=h,e[9]=b):b=e[9];let g;e[10]!==s||e[11]!==m||e[12]!==b?(g={queryKey:m,enabled:s,queryFn:b,staleTime:1e4},e[10]=s,e[11]=m,e[12]=b,e[13]=g):g=e[13];const{data:v,isFetching:x}=f(g);let y;e[14]!==v?.items?(y=v?.items??[],e[14]=v?.items,e[15]=y):y=e[15];const j=y;let S;e[16]!==r?(S=I=>{I||a(""),r(I)},e[16]=r,e[17]=S):S=e[17];const p=S;let k;e[18]!==p||e[19]!==c?(k=I=>{p(!1),c(I.id,I.virtual_mcp_id??void 0)},e[18]=p,e[19]=c,e[20]=k):k=e[20];const T=k;let N;e[21]!==o?(N=o("tasksPanel.globalSearchDialog.title"),e[21]=o,e[22]=N):N=e[22];let w;e[23]!==N?(w=n.jsx(Yt,{children:N}),e[23]=N,e[24]=w):w=e[24];let _;e[25]!==o?(_=o("tasksPanel.globalSearchDialog.description"),e[25]=o,e[26]=_):_=e[26];let P;e[27]!==_?(P=n.jsx(Zt,{children:_}),e[27]=_,e[28]=P):P=e[28];let C;e[29]!==P||e[30]!==w?(C=n.jsxs(Qt,{className:"sr-only",children:[w,P]}),e[29]=P,e[30]=w,e[31]=C):C=e[31];let A;e[32]!==o?(A=o("tasksPanel.globalSearchDialog.placeholder"),e[32]=o,e[33]=A):A=e[33];let M;e[34]!==i||e[35]!==A?(M=n.jsx(vn,{value:i,onValueChange:a,placeholder:A}),e[34]=i,e[35]=A,e[36]=M):M=e[36];let $;e[37]!==T||e[38]!==x||e[39]!==j||e[40]!==o||e[41]!==h?($=n.jsx(pn,{children:x&&j.length===0?n.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:o("tasksPanel.globalSearchDialog.searching")}):j.length===0?n.jsx(xn,{children:o("tasksPanel.globalSearchDialog.noResults")}):n.jsx(gn,{heading:h?void 0:o("tasksPanel.globalSearchDialog.recent"),children:j.map(I=>I.type==="thread"?n.jsxs(bn,{value:`thread:${I.id}:${I.title}`,onSelect:()=>T(I),className:"gap-2.5",children:[n.jsx(ba,{virtualMcpId:I.virtual_mcp_id,size:"xs"}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx("div",{className:"text-sm text-foreground truncate",children:I.title||o("tasksPanel.globalSearchDialog.untitledChat")})}),n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(I.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${I.id}`):null)})}),e[37]=T,e[38]=x,e[39]=j,e[40]=o,e[41]=h,e[42]=$):$=e[42];let E;e[43]!==M||e[44]!==$?(E=n.jsxs(yn,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[M,$]}),e[43]=M,e[44]=$,e[45]=E):E=e[45];let F;e[46]!==C||e[47]!==E?(F=n.jsxs(Xt,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[C,E]}),e[46]=C,e[47]=E,e[48]=F):F=e[48];let R;return e[49]!==p||e[50]!==s||e[51]!==F?(R=n.jsx(Jt,{open:s,onOpenChange:p,children:F}),e[49]=p,e[50]=s,e[51]=F,e[52]=R):R=e[52],R}function ja(t){return t.type==="thread"}function Sa(t,e,s){if(!s)return;const r=t.findIndex(i=>i.id===e);if(r!==-1){for(let i=r+1;i<t.length;i++){const a=t[i];if(a?.created_by===s)return a}for(let i=r-1;i>=0;i--){const a=t[i];if(a?.created_by===s)return a}}}function ka(t){return t==="ephemeral"||t.startsWith("thread:")}function Ht(t){const e=L.c(45),{task:s,isActive:r,onClick:i,onArchive:a,showAutomationBadge:l,showAgentIcon:c,hideStatusIdle:u,indented:o}=t,d=V(),m=jn(s.status),f=m.icon,h=s.metadata?.kind==="tool_call_run",b=_t(h?void 0:s.virtual_mcp_id);let g;e[0]!==b?(g=wt(b),e[0]=b,e[1]=g):g=e[1];const v=g;on(6e4);const x=l||!!s.trigger_id,y=s.id,j="button",S=0;let p;e[2]!==i?(p=O=>{O.target===O.currentTarget&&(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),i())},e[2]=i,e[3]=p):p=e[3];const k=o?"-ml-4 pl-6":"pl-[9px]",T=r?"bg-accent text-accent-foreground":"hover:bg-accent";let N;e[4]!==k||e[5]!==T?(N=ee("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",k,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",T),e[4]=k,e[5]=T,e[6]=N):N=e[6];let w;e[7]!==h||e[8]!==c||e[9]!==b?.icon||e[10]!==b?.title?(w=c&&!h&&n.jsx(ve,{icon:b?.icon??null,name:b?.title??"?",size:"2xs"}),e[7]=h,e[8]=c,e[9]=b?.icon,e[10]=b?.title,e[11]=w):w=e[11];let _;e[12]!==x||e[13]!==d?(_=x&&n.jsx(Bt,{size:12,"aria-label":d("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-special"}),e[12]=x,e[13]=d,e[14]=_):_=e[14];let P;e[15]!==d||e[16]!==s.title?(P=s.title||d("tasksPanel.taskRow.untitledTask"),e[15]=d,e[16]=s.title,e[17]=P):P=e[17];let C;e[18]!==P?(C=n.jsx("div",{className:"text-sm text-foreground truncate",children:P}),e[18]=P,e[19]=C):C=e[19];let A;e[20]!==_||e[21]!==C?(A=n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[_,C]}),e[20]=_,e[21]=C,e[22]=A):A=e[22];let M;e[23]!==r||e[24]!==v||e[25]!==s.branch||e[26]!==s.updated_at?(M=s.updated_at&&n.jsxs("div",{className:ee("flex items-center gap-1 text-2xs min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[s.branch&&!ka(s.branch)?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate font-mono",children:s.branch}),n.jsx("span",{className:"shrink-0",children:"·"})]}):v?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"truncate",children:[v.owner,"/",v.name]}),n.jsx("span",{className:"shrink-0",children:"·"})]}):null,n.jsx("span",{className:"shrink-0",children:es(new Date(s.updated_at))})]}),e[23]=r,e[24]=v,e[25]=s.branch,e[26]=s.updated_at,e[27]=M):M=e[27];let $;e[28]!==A||e[29]!==M?($=n.jsxs("div",{className:"flex-1 min-w-0",children:[A,M]}),e[28]=A,e[29]=M,e[30]=$):$=e[30];const E="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",F=!u&&n.jsx("span",{className:ee("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",a&&"group-hover/row:opacity-0"),"aria-label":d("tasksPanel.taskRow.statusLabel",{status:d(m.labelKey)}),children:s.status==="in_progress"?n.jsx(Pe,{className:ee("size-3.5",m.iconClassName)}):n.jsx(f,{size:14,className:m.iconClassName})});let R;e[31]!==a||e[32]!==d?(R=a&&n.jsxs(Oe,{children:[n.jsx(Fe,{asChild:!0,children:n.jsx(qe,{variant:"ghost",size:"icon","aria-label":d("tasksPanel.taskRow.archiveTask"),onClick:O=>{O.stopPropagation(),a()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto text-muted-foreground",children:n.jsx(ts,{className:"size-3.5"})})}),n.jsx(Re,{side:"right",children:d("tasksPanel.taskRow.archive")})]}),e[31]=a,e[32]=d,e[33]=R):R=e[33];let I;e[34]!==F||e[35]!==R?(I=n.jsxs("div",{className:E,children:[F,R]}),e[34]=F,e[35]=R,e[36]=I):I=e[36];let B;return e[37]!==i||e[38]!==$||e[39]!==I||e[40]!==p||e[41]!==N||e[42]!==w||e[43]!==s.id?(B=n.jsxs("div",{"data-task-id":y,role:j,tabIndex:S,onClick:i,onKeyDown:p,className:N,children:[w,$,I]}),e[37]=i,e[38]=$,e[39]=I,e[40]=p,e[41]=N,e[42]=w,e[43]=s.id,e[44]=B):B=e[44],B}const ut=["requires_action","in_progress","failed","expired","completed"];function Ta(t){const e=new Map(ut.map(s=>[s,[]]));for(const s of t){const r=s.status??"completed";(e.get(r)??e.get("completed")).push(s)}return ut.map(s=>({status:s,threads:e.get(s)}))}const Na="sidebar.group.expanded.";function _a(t,e){const s=L.c(3),[r,i]=gt(`${Na}${t}`,e);let a;return s[0]!==r||s[1]!==i?(a=[r,i],s[0]=r,s[1]=i,s[2]=a):a=s[2],a}function Kt(t){const e=L.c(18),{onClick:s,isFetching:r,indented:i}=t,a=V();let l;e[0]!==a?(l=a("sidebar.showMoreButton.ariaLabel"),e[0]=a,e[1]=l):l=e[1];const c=i?"-ml-4 pl-6 pr-2":"px-2";let u;e[2]!==c?(u=ee("flex items-center gap-2 py-1.5 rounded-lg text-sm text-muted-foreground",c,"hover:bg-sidebar-accent hover:text-foreground focus-ring","transition-colors disabled:cursor-progress disabled:opacity-60"),e[2]=c,e[3]=u):u=e[3];let o;e[4]!==r?(o=r&&n.jsx(Pe,{className:"size-3.5"}),e[4]=r,e[5]=o):o=e[5];let d;e[6]!==r||e[7]!==a?(d=a(r?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=r,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==d?(m=n.jsx("span",{children:d}),e[9]=d,e[10]=m):m=e[10];let f;return e[11]!==r||e[12]!==s||e[13]!==l||e[14]!==u||e[15]!==o||e[16]!==m?(f=n.jsxs("button",{type:"button","aria-label":l,onClick:s,disabled:r,className:u,children:[o,m]}),e[11]=r,e[12]=s,e[13]=l,e[14]=u,e[15]=o,e[16]=m,e[17]=f):f=e[17],f}function wa(t,e,s,r){return[t,e,s,r.type,r.member,r.currentUserId??""].join("|")}function Ca(t){return t.member==="mine"&&!t.currentUserId}const Vt=4;let Te=0;const Ve=[];function Pa(){for(;Te<Vt&&Ve.length>0;){const t=Ve.shift();t&&t()}}function Ut(t){return new Promise((e,s)=>{const r=()=>{Te++,t().then(e,s).finally(()=>{Te--,Pa()})};Te<Vt?r():Ve.push(r)})}const Be=10;function ft(t,e,s,r,i){const a={hidden:!1};r.member==="mine"&&r.currentUserId&&(a.created_by=r.currentUserId),r.type==="automation"&&(a.has_trigger=!0),r.type==="manual"&&(a.has_trigger=!1);const l={where:a,limit:i,offset:s,orderBy:[{field:["updated_at"],direction:"desc"}]};return l.status=e,l}function Ia(t,e,s,r){let i=0;for(const a of t)qt(a,e,s,r)&&i++;return i}function He(t,e,s,r){return Ia(t,e,s,r)}function Ma(t,e){return!!(t>=Be||t===0&&e)}function mt(t,e){return t<e}function Aa(t,e){return e===!1?!1:e===!0?!0:t}function qt(t,e,s,r){return!(t.hidden||(t.status??"completed")!==s||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const we=new Map,ke=new Map;function La(t,e){return e?t>=Be?!0:null:!1}function ht(t){return we.get(t)}function $a(t,e){we.set(t,e)}function Ea(t,e,s){const r=we.get(t);if(r!==void 0){s(r);return}let i=ke.get(t);i||(i=Ut(e).then(a=>(we.set(t,a),ke.delete(t),a)).catch(()=>(ke.delete(t),Promise.reject(new Error("group probe failed")))),ke.set(t,i)),i.then(s,()=>s(!1))}function pt(t){const e=t,s=Array.isArray(e.items)?e.items:[];return{items:s,hasMore:e.hasMore??s.length===Be,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Fa(t,e,s,r,i){let a=0;for(const l of t)e.has(l.id)||qt(l,s,r,i)&&a++;return a}function Ra(t,e,s,r){const i=L.c(8),{org:a}=ae(),l=wa(a.id,t,e,s);let c;i[0]!==s?(c=Ca(s),i[0]=s,i[1]=c):c=i[1];const u=c,[o,d]=z.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});o.identity!==l&&d({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const m=Qe(),{threads:f,hasMore:h}=Xe(),b=He(f,t,e,s),g=Ma(b,h),v=La(b,h),x=Ce();if(o.identity===l&&o.serverHasMore===null){const T=v??ht(l);T!==void 0&&d({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:o.probeSubscribedIdentity,serverHasMore:T})}!u&&o.identity===l&&o.serverHasMore===null&&v===null&&ht(l)===void 0&&o.probeSubscribedIdentity!==l&&(d(T=>T.identity===l?{...T,isProbing:!0,probeSubscribedIdentity:l}:T),Ea(l,async()=>{const T=ft(t,e,0,s,1),N=await x.call("COLLECTION_THREADS_LIST",T),{totalCount:w}=pt(N),_=He(m.threads.get(),t,e,s);return w===void 0?!1:mt(_,w)},T=>{d(N=>N.identity!==l?N:{...N,isProbing:!1,serverHasMore:T})}));const j=async function(){if(o.isFetching||o.isProbing||u)return;const N=l;d(w=>w.identity===N?{...w,isFetching:!0}:w);try{const w=He(f,t,e,s),_=ft(t,e,w,s,Be),P=await Ut(()=>x.call("COLLECTION_THREADS_LIST",_)),{items:C,hasMore:A,totalCount:M}=pt(P),$=new Set(f.map(Oa)),E=Fa(C,$,t,e,s),F=w;m.mergeThreads(C),d(R=>{if(R.identity!==N)return R;let I;return M!==void 0?I=mt(F+E,M):I=C.length===0||E===0?!1:A,$a(N,I),{...R,isFetching:!1,serverHasMore:I}})}catch(w){const _=w,P=_ instanceof Error?_.message:String(_);ss.error(`Could not load more tasks: ${P}`),d(C=>C.identity===N?{...C,isFetching:!1}:C)}},S=o.isFetching||o.isProbing,p=!u&&!S&&Aa(g,o.serverHasMore);let k;return i[2]!==S||i[3]!==j||i[4]!==p||i[5]!==o.isProbing||i[6]!==o.serverHasMore?(k={hasMore:p,isFetching:S,isProbing:o.isProbing,serverHasMore:o.serverHasMore,loadMore:j},i[2]=S,i[3]=j,i[4]=p,i[5]=o.isProbing,i[6]=o.serverHasMore,i[7]=k):k=i[7],k}function Oa(t){return t.id}function Ba(t){const e=L.c(20),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:l,canArchive:c,filters:u}=t,{isFetching:o,isProbing:d,loadMore:m,hasMore:f,serverHasMore:h}=Ra("status",s,u),[b,g]=z.useState(!1);!b&&r.length===0&&h===!0&&!o&&!d&&(g(!0),queueMicrotask(()=>{m()}));let v;if(e[0]!==i||e[1]!==c||e[2]!==u||e[3]!==l||e[4]!==a||e[5]!==r){let j;e[7]!==i||e[8]!==c||e[9]!==u||e[10]!==l||e[11]!==a?(j=S=>n.jsx(Ht,{task:S,isActive:i===S.id,onClick:()=>a(S),onArchive:c&&S.created_by===u.currentUserId?()=>l(S):void 0,showAutomationBadge:!!S.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},S.id),e[7]=i,e[8]=c,e[9]=u,e[10]=l,e[11]=a,e[12]=j):j=e[12],v=r.map(j),e[0]=i,e[1]=c,e[2]=u,e[3]=l,e[4]=a,e[5]=r,e[6]=v}else v=e[6];let x;e[13]!==f||e[14]!==o||e[15]!==m?(x=(f||o)&&n.jsx(Kt,{onClick:()=>{m()},isFetching:o,indented:!0}),e[13]=f,e[14]=o,e[15]=m,e[16]=x):x=e[16];let y;return e[17]!==v||e[18]!==x?(y=n.jsxs(n.Fragment,{children:[v,x]}),e[17]=v,e[18]=x,e[19]=y):y=e[19],y}function Da(t){const e=L.c(43),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:l,canArchive:c,filters:u}=t,o=V(),d=Sn[s],m=d.icon,[f,h]=_a(`status-${s}`,!1);let b;e[0]!==f||e[1]!==h?(b=function(){h(!f)},e[0]=f,e[1]=h,e[2]=b):b=e[2];const g=b;let v;e[3]!==d.labelKey||e[4]!==o?(v=o("sidebar.taskGroupsList.toggleStatusGroup",{status:o(d.labelKey)}),e[3]=d.labelKey,e[4]=o,e[5]=v):v=e[5];let x;e[6]!==g?(x=P=>{P.target===P.currentTarget&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),g())},e[6]=g,e[7]=x):x=e[7];let y;e[8]!==m||e[9]!==d.iconClassName?(y=n.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:n.jsx(m,{size:12,className:d.iconClassName})}),e[8]=m,e[9]=d.iconClassName,e[10]=y):y=e[10];let j;e[11]!==f?(j=n.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:f?n.jsx(Ze,{size:14}):n.jsx(ns,{size:14})}),e[11]=f,e[12]=j):j=e[12];let S;e[13]!==y||e[14]!==j?(S=n.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[y,j]}),e[13]=y,e[14]=j,e[15]=S):S=e[15];let p;e[16]!==d.labelKey||e[17]!==o?(p=o(d.labelKey),e[16]=d.labelKey,e[17]=o,e[18]=p):p=e[18];let k;e[19]!==p?(k=n.jsx("span",{className:"flex-1 truncate",children:p}),e[19]=p,e[20]=k):k=e[20];let T;e[21]!==r.length?(T=n.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:n.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[21]=r.length,e[22]=T):T=e[22];let N;e[23]!==f||e[24]!==g||e[25]!==v||e[26]!==x||e[27]!==S||e[28]!==k||e[29]!==T?(N=n.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":f,"aria-label":v,onClick:g,onKeyDown:x,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-lg text-sm font-medium text-foreground cursor-pointer hover:bg-sidebar-accent focus-ring transition-colors",children:[S,k,T]}),e[23]=f,e[24]=g,e[25]=v,e[26]=x,e[27]=S,e[28]=k,e[29]=T,e[30]=N):N=e[30];let w;e[31]!==i||e[32]!==c||e[33]!==f||e[34]!==u||e[35]!==l||e[36]!==a||e[37]!==s||e[38]!==r?(w=f&&n.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:n.jsx(Ba,{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:l,canArchive:c,filters:u})}),e[31]=i,e[32]=c,e[33]=f,e[34]=u,e[35]=l,e[36]=a,e[37]=s,e[38]=r,e[39]=w):w=e[39];let _;return e[40]!==N||e[41]!==w?(_=n.jsxs("div",{className:"flex flex-col gap-0.5",children:[N,w]}),e[40]=N,e[41]=w,e[42]=_):_=e[42],_}function za(t){const e=L.c(41),{threads:s,groupBy:r,activeTaskId:i,onSelectTask:a,onArchiveTask:l,filters:c,hasMore:u,isFetchingMore:o,onLoadMore:d,filtersActive:m}=t,f=V();if(s.length===0&&!u&&!o){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(xs,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];let y;e[1]!==m||e[2]!==f?(y=f(m?"sidebar.myThreadsSection.noChatsMatchFilters":"sidebar.myThreadsSection.noChatsYet"),e[1]=m,e[2]=f,e[3]=y):y=e[3];let j;return e[4]!==y?(j=n.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,n.jsx("p",{className:"text-sm",children:y})]}),e[4]=y,e[5]=j):j=e[5],j}const h=s.length>1||u;if(r==="status"){let x;if(e[6]!==i||e[7]!==h||e[8]!==c||e[9]!==l||e[10]!==a||e[11]!==s){let j;e[13]!==i||e[14]!==h||e[15]!==c||e[16]!==l||e[17]!==a?(j=S=>n.jsx(Da,{status:S.status,threads:S.threads,activeTaskId:i,onSelectTask:a,onArchiveTask:l,canArchive:h,filters:c},S.status),e[13]=i,e[14]=h,e[15]=c,e[16]=l,e[17]=a,e[18]=j):j=e[18],x=Ta(s).map(j),e[6]=i,e[7]=h,e[8]=c,e[9]=l,e[10]=a,e[11]=s,e[12]=x}else x=e[12];let y;return e[19]!==x?(y=n.jsx(n.Fragment,{children:x}),e[19]=x,e[20]=y):y=e[20],y}let b;if(e[21]!==i||e[22]!==h||e[23]!==c||e[24]!==l||e[25]!==a||e[26]!==s){let x;e[28]!==i||e[29]!==h||e[30]!==c||e[31]!==l||e[32]!==a?(x=y=>n.jsx(Ht,{task:y,isActive:i===y.id,onClick:()=>a(y),onArchive:h&&y.created_by===c.currentUserId?()=>l(y):void 0,showAutomationBadge:!!y.trigger_id,showAgentIcon:!0},y.id),e[28]=i,e[29]=h,e[30]=c,e[31]=l,e[32]=a,e[33]=x):x=e[33],b=s.map(x),e[21]=i,e[22]=h,e[23]=c,e[24]=l,e[25]=a,e[26]=s,e[27]=b}else b=e[27];let g;e[34]!==u||e[35]!==o||e[36]!==d?(g=(u||o)&&n.jsx(Kt,{onClick:d,isFetching:o}),e[34]=u,e[35]=o,e[36]=d,e[37]=g):g=e[37];let v;return e[38]!==b||e[39]!==g?(v=n.jsxs(n.Fragment,{children:[b,g]}),e[38]=b,e[39]=g,e[40]=v):v=e[40],v}function Ga(t){const e=L.c(11),{panel:s}=t;let r;return e[0]!==s.activeTaskId||e[1]!==s.archiveTask||e[2]!==s.filters||e[3]!==s.filtersActive||e[4]!==s.groupBy||e[5]!==s.hasMore||e[6]!==s.isFetchingMore||e[7]!==s.loadMore||e[8]!==s.selectTask||e[9]!==s.threads?(r=n.jsx(za,{threads:s.threads,groupBy:s.groupBy,activeTaskId:s.activeTaskId,onSelectTask:s.selectTask,onArchiveTask:s.archiveTask,filters:s.filters,hasMore:s.hasMore,isFetchingMore:s.isFetchingMore,onLoadMore:s.loadMore,filtersActive:s.filtersActive}),e[0]=s.activeTaskId,e[1]=s.archiveTask,e[2]=s.filters,e[3]=s.filtersActive,e[4]=s.groupBy,e[5]=s.hasMore,e[6]=s.isFetchingMore,e[7]=s.loadMore,e[8]=s.selectTask,e[9]=s.threads,e[10]=r):r=e[10],r}function Ha(t){const e=L.c(67);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{onNavigate:r}=s,{data:i}=pe.useSession(),a=i?.user?.id,{org:l}=ae();let c;e[2]!==l.id?(c=ye(l.id),e[2]=l.id,e[3]=c):c=e[3];const u=c.id,o=ga(),d=Nt(),{threads:m,hasMore:f,isFetchingMore:h,fetchNextPage:b}=Xe(),g=m.filter(qa),{hide:v,setScope:x}=Mt(),y=Me(),{setTaskId:j,createNewTask:S}=Je(),p=Rt(),k=et();let T;e[4]!==k||e[5]!==m||e[6]!==p?(T=fn({routeAgentId:p,threadVirtualMcpId:m.find(K=>K.id===k)?.virtual_mcp_id}),e[4]=k,e[5]=m,e[6]=p,e[7]=T):T=e[7];const N=T;let w;e[8]!==r?(w=()=>{r?.()},e[8]=r,e[9]=w):w=e[9];const _=w,P=[...g].sort(Ua),[C,A]=z.useState("all"),[M,$]=z.useState("flat"),[E,F]=gt("sidebar-threads-scope-all",!1),[R,I]=z.useState(!1),[B,O]=z.useState(!1);let H;e[10]!==I?(H=()=>{he("tasks_panel_search_opened"),O(!0),I(!0)},e[10]=I,e[11]=H):H=e[11];const D=H,U=a??null;let Z;e[12]!==U||e[13]!==C?(Z={type:C,member:"mine",currentUserId:U},e[12]=U,e[13]=C,e[14]=Z):Z=e[14];const Y=Z,Q={};E||(Q.created_by="me"),x(Q);let W;e[15]!==a?(W=K=>a?K.filter(ue=>ue.created_by===a):[],e[15]=a,e[16]=W):W=e[16];const le=W;let G;e[17]!==C?(G=K=>C==="automation"?K.filter(Va):C==="manual"?K.filter(Ka):K,e[17]=C,e[18]=G):G=e[18];const re=G,X=xa(re(E?P:le(P)),k);let J;e[19]!==k||e[20]!==_||e[21]!==a||e[22]!==v||e[23]!==y||e[24]!==l.slug||e[25]!==j||e[26]!==X?(J=K=>{if(a&&K.created_by&&K.created_by!==a)return;const ue=K.id===k;if(v(K.id),cn(K.id),!ue)return;const ge=Sa(X,K.id,a);_(),ge?j(ge.id,ge.virtual_mcp_id):y({to:"/$org",params:{org:l.slug}})},e[19]=k,e[20]=_,e[21]=a,e[22]=v,e[23]=y,e[24]=l.slug,e[25]=j,e[26]=X,e[27]=J):J=e[27];const te=J;let ne;e[28]!==_||e[29]!==j?(ne=K=>{_(),j(K.id,K.virtual_mcp_id)},e[28]=_,e[29]=j,e[30]=ne):ne=e[30];const ie=ne;let se;e[31]!==N||e[32]!==k||e[33]!==m||e[34]!==_||e[35]!==S||e[36]!==a||e[37]!==u||e[38]!==o||e[39]!==d||e[40]!==j?(se=()=>{const K=N??u;he("sidebar_new_thread_clicked",{virtual_mcp_id:K}),_();const ue=Zs(m,K,a,o(K));if(ue){j(ue.id,ue.virtual_mcp_id,{newThread:!0});return}const ge=d?null:m.find(Wt=>Wt.id===k)?.branch??null;S(K,ge)},e[31]=N,e[32]=k,e[33]=m,e[34]=_,e[35]=S,e[36]=a,e[37]=u,e[38]=o,e[39]=d,e[40]=j,e[41]=se):se=e[41];const oe=se;let ce;e[42]!==b?(ce=()=>{b()},e[42]=b,e[43]=ce):ce=e[43];const xe=M!=="flat"||C!=="all"||E;let de;e[44]!==B||e[45]!==R||e[46]!==I?(de=B?n.jsx(ya,{open:R,onOpenChange:I}):null,e[44]=B,e[45]=R,e[46]=I,e[47]=de):de=e[47];let Se;return e[48]!==k||e[49]!==te||e[50]!==Y||e[51]!==M||e[52]!==f||e[53]!==h||e[54]!==oe||e[55]!==D||e[56]!==ie||e[57]!==$||e[58]!==F||e[59]!==A||e[60]!==E||e[61]!==ce||e[62]!==xe||e[63]!==de||e[64]!==C||e[65]!==X?(Se={threads:X,activeTaskId:k,filters:Y,hasMore:f,isFetchingMore:h,loadMore:ce,groupBy:M,setGroupBy:$,typeFilter:C,setTypeFilter:A,showAll:E,setShowAll:F,filtersActive:xe,selectTask:ie,archiveTask:te,newThread:oe,openSearch:D,searchDialog:de},e[48]=k,e[49]=te,e[50]=Y,e[51]=M,e[52]=f,e[53]=h,e[54]=oe,e[55]=D,e[56]=ie,e[57]=$,e[58]=F,e[59]=A,e[60]=E,e[61]=ce,e[62]=xe,e[63]=de,e[64]=C,e[65]=X,e[66]=Se):Se=e[66],Se}function Ka(t){return!t.trigger_id}function Va(t){return!!t.trigger_id}function Ua(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function qa(t){return!t.hidden}function Wa(){const t=L.c(59),e=V(),[s,r]=z.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={onNavigate:()=>r(!1)},t[0]=i):i=t[0];const a=Ha(i),l=Le()?.activeTask;let c;t[1]!==l?.title||t[2]!==a.activeTaskId||t[3]!==a.threads||t[4]!==e?(c=l?.title||a.threads.find(R=>R.id===a.activeTaskId)?.title||e("tasksPanel.taskRow.untitledTask"),t[1]=l?.title,t[2]=a.activeTaskId,t[3]=a.threads,t[4]=e,t[5]=c):c=t[5];const u=c;let o;t[6]!==a?(o=()=>{r(!1),a.openSearch()},t[6]=a,t[7]=o):o=t[7];const d=o;let m;t[8]!==e?(m=e("chat.threadsMenu.chats"),t[8]=e,t[9]=m):m=t[9];const f=s&&"bg-sidebar-accent";let h;t[10]!==f?(h=ee("flex h-[34px] min-w-0 shrink items-center gap-1.5 rounded-lg px-2 text-sm text-foreground transition-colors hover:bg-accent focus-ring",f),t[10]=f,t[11]=h):h=t[11];let b;t[12]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(gs,{size:16,className:"shrink-0"}),t[12]=b):b=t[12];let g;t[13]!==u?(g=n.jsx("span",{className:"truncate max-w-[10rem] font-medium",children:u}),t[13]=u,t[14]=g):g=t[14];let v;t[15]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ze,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[15]=v):v=t[15];let x;t[16]!==m||t[17]!==h||t[18]!==g?(x=n.jsx(Fe,{asChild:!0,children:n.jsx($t,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":m,className:h,children:[b,g,v]})})}),t[16]=m,t[17]=h,t[18]=g,t[19]=x):x=t[19];let y;t[20]!==e?(y=e("chat.threadsMenu.chats"),t[20]=e,t[21]=y):y=t[21];let j;t[22]!==y?(j=n.jsx(Re,{side:"bottom",children:y}),t[22]=y,t[23]=j):j=t[23];let S;t[24]!==j||t[25]!==x?(S=n.jsxs(Oe,{children:[x,j]}),t[24]=j,t[25]=x,t[26]=S):S=t[26];let p;t[27]!==a?(p=n.jsx(pa,{panel:a,className:"size-8"}),t[27]=a,t[28]=p):p=t[28];let k;t[29]!==e?(k=e("sidebar.taskGroupsList.searchChats"),t[29]=e,t[30]=k):k=t[30];let T;t[31]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(bs,{size:16}),t[31]=T):T=t[31];let N;t[32]!==d||t[33]!==k?(N=n.jsx(Ne,{"aria-label":k,onClick:d,className:"size-8",children:T}),t[32]=d,t[33]=k,t[34]=N):N=t[34];let w;t[35]!==e?(w=e("sidebar.taskGroupsList.newChat"),t[35]=e,t[36]=w):w=t[36];let _;t[37]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(yt,{size:16}),t[37]=_):_=t[37];let P;t[38]!==a.newThread||t[39]!==w?(P=n.jsx(Ne,{"aria-label":w,onClick:a.newThread,className:"size-8",children:_}),t[38]=a.newThread,t[39]=w,t[40]=P):P=t[40];let C;t[41]!==N||t[42]!==P?(C=n.jsxs("div",{className:"flex items-center gap-0.5",children:[N,P]}),t[41]=N,t[42]=P,t[43]=C):C=t[43];let A;t[44]!==p||t[45]!==C?(A=n.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[p,C]}),t[44]=p,t[45]=C,t[46]=A):A=t[46];let M;t[47]!==a?(M=n.jsx("div",{className:"flex max-h-[60vh] min-h-0 flex-col gap-0.5 overflow-y-auto overscroll-contain",children:n.jsx(Ga,{panel:a})}),t[47]=a,t[48]=M):M=t[48];let $;t[49]!==A||t[50]!==M?($=n.jsxs(Et,{align:"start",side:"bottom",onOpenAutoFocus:Ya,className:"flex w-80 flex-col gap-2 p-2",children:[A,M]}),t[49]=A,t[50]=M,t[51]=$):$=t[51];let E;t[52]!==s||t[53]!==S||t[54]!==$?(E=n.jsxs(Ft,{open:s,onOpenChange:r,children:[S,$]}),t[52]=s,t[53]=S,t[54]=$,t[55]=E):E=t[55];let F;return t[56]!==a.searchDialog||t[57]!==E?(F=n.jsxs(n.Fragment,{children:[E,a.searchDialog]}),t[56]=a.searchDialog,t[57]=E,t[58]=F):F=t[58],F}function Ya(t){return t.preventDefault()}function Za(){const t=L.c(20),e=V(),{threads:s}=Xe(),{createNewTask:r}=Je(),i=Ot(),a=et();let l;t[0]!==a||t[1]!==s?(l=s.find(v=>v.id===a)?.branch??null,t[0]=a,t[1]=s,t[2]=l):l=t[2];const c=l;let u;t[3]!==i||t[4]!==r||t[5]!==c?(u=()=>{r(i,c)},t[3]=i,t[4]=r,t[5]=c,t[6]=u):u=t[6];const o=u;let d;t[7]!==e?(d=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=d):d=t[8];let m;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(yt,{size:16}),t[9]=m):m=t[9];let f;t[10]!==o||t[11]!==d?(f=n.jsx(Fe,{asChild:!0,children:n.jsx("button",{type:"button",onClick:o,"aria-label":d,className:"flex shrink-0 items-center rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-ring",children:m})}),t[10]=o,t[11]=d,t[12]=f):f=t[12];let h;t[13]!==e?(h=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=h):h=t[14];let b;t[15]!==h?(b=n.jsx(Re,{side:"bottom",children:h}),t[15]=h,t[16]=b):b=t[16];let g;return t[17]!==f||t[18]!==b?(g=n.jsxs(Oe,{children:[f,b]}),t[17]=f,t[18]=b,t[19]=g):g=t[19],g}function Qa(t){const e=L.c(16),{virtualMcpId:s,taskId:r}=t,{openPanel:i}=Dt();let a;e[0]!==r||e[1]!==s?(a={virtualMcpId:s,taskId:r},e[0]=r,e[1]=s,e[2]=a):a=e[2];const{tabs:l,activeTab:c,mainOpen:u}=zt(a);if(l.length===0)return null;let o;if(e[3]!==c||e[4]!==u||e[5]!==i||e[6]!==l||e[7]!==s){let m;e[9]!==c||e[10]!==u||e[11]!==i||e[12]!==s?(m=f=>{const h=f.id==="automations"?as({activeTab:c,mainOpen:u}):u&&f.id===c;return n.jsxs(st.Tab,{active:h,onClick:()=>{h||(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:f.id,tab_kind:f.kind,was_active:!1}),i(f.id))},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(_e,{icon:f.icon})}),f.title]},f.id)},e[9]=c,e[10]=u,e[11]=i,e[12]=s,e[13]=m):m=e[13],o=l.map(m),e[3]=c,e[4]=u,e[5]=i,e[6]=l,e[7]=s,e[8]=o}else o=e[8];let d;return e[14]!==o?(d=n.jsx(st.Tabs,{"data-tour":dn.surfaceTabs,children:o}),e[14]=o,e[15]=d):d=e[15],d}function Xa(t){return{threadId:t.routeThreadId,providerKey:t.routeThreadId??t.fallbackKey}}const Ke="__mobile-main-panel-tab-select__",Ue="main";function Ja({tabs:t,activeTab:e,mainOpen:s,t:r}){const i=t.find(l=>l.id===e),a=r("mainPanelTabs.mobileMainPanelTabSelect.mainView");return s?i?.title??a:i?.title??t[0]?.title??a}const er={kind:"component",Component:vs},tr={kind:"component",Component:ys},sr={kind:"component",Component:js},nr={kind:"component",Component:Tn};function ar({tabs:t,overlayEnabled:e,t:s}){return[{value:"chat",title:s("mainPanelTabs.mobileMainPanelTabSelect.chat"),icon:er},...t.length>0?t.map(r=>({value:r.id,title:r.title,icon:r.icon})):[{value:Ue,title:s("mainPanelTabs.mobileMainPanelTabSelect.mainView"),icon:nr}],...e?[{value:"board",title:s("mainPanelTabs.mobileMainPanelTabSelect.tasks"),icon:tr},{value:"files",title:s("mainPanelTabs.mobileMainPanelTabSelect.library"),icon:sr}]:[]]}function rr(t){const e=L.c(53),{virtualMcpId:s,taskId:r}=t,i=V(),a=Me(),{openPanel:l}=Dt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const u=je(c);let o;e[1]!==r||e[2]!==s?(o={virtualMcpId:s,taskId:r},e[1]=r,e[2]=s,e[3]=o):o=e[3];const{tabs:d,activeTab:m,mainOpen:f}=zt(o),{org:h}=ae(),b=Is();let g;e[4]!==h.id?(g=nt(h.id),e[4]=h.id,e[5]=g):g=e[5];const v=s===g;let x,y,j,S,p,k,T,N,w,_;if(e[6]!==m||e[7]!==f||e[8]!==a||e[9]!==v||e[10]!==l||e[11]!==h.id||e[12]!==u.org||e[13]!==u.taskId||e[14]!==b||e[15]!==i||e[16]!==d||e[17]!==s){S=Symbol.for("react.early_return_sentinel");e:{const A=ar({tabs:d,overlayEnabled:!!(u.org&&u.taskId),t:i}),M=f?A.find(D=>D.value===m)?.value??Ue:"chat",$=A.find(D=>D.value===M),E=$?.title??Ja({tabs:d,activeTab:m,mainOpen:f,t:i});let F;e[28]!==a?(F=D=>{a({to:".",search:U=>({...U,...nn(D)}),replace:!0})},e[28]=a,e[29]=F):F=e[29];const R=F;let I;e[30]!==v||e[31]!==l||e[32]!==h.id||e[33]!==b||e[34]!==R||e[35]!==s?(I=D=>{if(D!==Ke){if(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:D,source:"mobile_select"}),un({reportsOnly:b,onReportAgent:v,tabId:D})){l(D,{virtualmcpid:nt(h.id),search:or});return}if(D==="chat"||D===Ue){R(D==="chat"?"chat":"main");return}l(D,{search:lr})}},e[30]=v,e[31]=l,e[32]=h.id,e[33]=b,e[34]=R,e[35]=s,e[36]=I):I=e[36];const B=I,O=A.find(D=>D.value!==M);if(A.length===2&&O){S=n.jsxs("button",{type:"button",onClick:()=>B(O.value),"aria-label":i("mainPanelTabs.mobileMainPanelTabSelect.switchTo",{name:O.title}),className:"flex h-10 min-w-0 max-w-[7.5rem] items-center gap-1.5 rounded-lg px-1.5 text-xs text-foreground transition-colors hover:bg-accent focus-ring",children:[n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(_e,{icon:O.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:O.title})]});break e}y=_n,w=Ke,_=B;let H;e[37]!==i?(H=i("mainPanelTabs.mobileMainPanelTabSelect.view"),e[37]=i,e[38]=H):H=e[38],j=n.jsx(Nn,{"aria-label":H,className:"h-10! w-full min-w-0 max-w-[7.5rem] rounded-lg border-0 bg-transparent px-1.5 text-xs shadow-none [--shadow-edge:none]",children:n.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[$&&n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(_e,{icon:$.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:E})]})}),x=wn,p="end",k="w-56",e[39]!==E?(T=n.jsx(Gt,{value:Ke,disabled:!0,hideCheck:!0,className:"hidden",children:E}),e[39]=E,e[40]=T):T=e[40],N=A.map(ir)}e[6]=m,e[7]=f,e[8]=a,e[9]=v,e[10]=l,e[11]=h.id,e[12]=u.org,e[13]=u.taskId,e[14]=b,e[15]=i,e[16]=d,e[17]=s,e[18]=x,e[19]=y,e[20]=j,e[21]=S,e[22]=p,e[23]=k,e[24]=T,e[25]=N,e[26]=w,e[27]=_}else x=e[18],y=e[19],j=e[20],S=e[21],p=e[22],k=e[23],T=e[24],N=e[25],w=e[26],_=e[27];if(S!==Symbol.for("react.early_return_sentinel"))return S;let P;e[41]!==x||e[42]!==p||e[43]!==k||e[44]!==T||e[45]!==N?(P=n.jsxs(x,{align:p,className:k,children:[T,N]}),e[41]=x,e[42]=p,e[43]=k,e[44]=T,e[45]=N,e[46]=P):P=e[46];let C;return e[47]!==y||e[48]!==j||e[49]!==P||e[50]!==w||e[51]!==_?(C=n.jsxs(y,{value:w,onValueChange:_,children:[j,P]}),e[47]=y,e[48]=j,e[49]=P,e[50]=w,e[51]=_,e[52]=C):C=e[52],C}function ir(t){return n.jsx(Gt,{value:t.value,children:n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(_e,{icon:t.icon})}),n.jsx("span",{className:"min-w-0 truncate",children:t.title})]})},t.value)}function lr(t){return{...t,sidepanel:!1}}function or(t){return{...t,thread:void 0,sidepanel:!1}}function cr(){const t=L.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={select:dr},t[0]=e):e=t[0];const s=bt(e);if(!s)return!1;let r;return t[1]!==s?(r=s==="app"||Pn.includes(s),t[1]=s,t[2]=r):r=t[2],r}function dr(t){const{staticData:e}=t.matches.findLast(ur)??{};return e?.siteEditorView?"site-editor":e?.mainView}function ur(t){return t.staticData.mainView}function fr(t,e,s){const r=L.c(33),i=Qe(),{locator:a}=ae(),l=z.useSyncExternalStore(i.threads.subscribe,i.threads.get),c=z.useSyncExternalStore(i.threadsStatus.subscribe,i.threadsStatus.get);let u;r[0]!==t||r[1]!==l?(u=t===null?null:l.find(p=>p.id===t&&!p.partial)??null,r[0]=t,r[1]=l,r[2]=u):u=r[2];const o=u,[d,m]=z.useState(void 0),[f,h]=z.useState(t);f!==t&&(h(t),m(void 0));let b,g;r[3]!==d||r[4]!==t||r[5]!==o||r[6]!==i||r[7]!==c.kind?(b=()=>{t!==null&&(o||c.kind!=="loading"&&d===void 0&&(m("pending"),i.fetchThreadIntoSlot(t).then(p=>{m(p)})))},g=[t,o,c.kind,d,i],r[3]=d,r[4]=t,r[5]=o,r[6]=i,r[7]=c.kind,r[8]=b,r[9]=g):(b=r[8],g=r[9]),z.useEffect(b,g);let v;r[10]!==s||r[11]!==a||r[12]!==i||r[13]!==e?(v={mutationFn:async p=>i.create({id:p,virtual_mcp_id:e,...s?{branch:s}:{},...Ys(sessionStorage,a,p)})},r[10]=s,r[11]=a,r[12]=i,r[13]=e,r[14]=v):v=r[14];const x=rs(v);let y,j;if(r[15]!==x||r[16]!==d||r[17]!==t||r[18]!==o||r[19]!==c.kind?(y=()=>{t!==null&&(o||d===null&&c.kind!=="loading"&&(x.isPending||x.variables!==t&&x.mutate(t)))},j=[t,o,d,c.kind,x],r[15]=x,r[16]=d,r[17]=t,r[18]=o,r[19]=c.kind,r[20]=y,r[21]=j):(y=r[20],j=r[21]),z.useEffect(y,j),t===null){let p;return r[22]===Symbol.for("react.memo_cache_sentinel")?(p={status:"ready",task:null},r[22]=p):p=r[22],p}if(o){let p;return r[23]!==o?(p={status:"ready",task:o},r[23]=o,r[24]=p):p=r[24],p}if(d&&typeof d=="object"){let p;return r[25]!==d?(p={status:"ready",task:d},r[25]=d,r[26]=p):p=r[26],p}if(x.data){let p;return r[27]!==x.data?(p={status:"ready",task:x.data},r[27]=x.data,r[28]=p):p=r[28],p}if(x.isError){let p;return r[29]!==x.error?(p={status:"error",error:x.error},r[29]=x.error,r[30]=p):p=r[30],p}if(x.isPending||c.kind!=="loading"){let p;return r[31]===Symbol.for("react.memo_cache_sentinel")?(p={status:"creating"},r[31]=p):p=r[31],p}let S;return r[32]===Symbol.for("react.memo_cache_sentinel")?(S={status:"loading"},r[32]=S):S=r[32],S}const mr=50;function hr(t,e){const s=L.c(15),{org:r}=ae(),i=Ce(),{data:a}=pe.useSession(),l=a?.user?.id??"";let c;s[0]!==r.id||s[1]!==l||s[2]!==t?(c=fe.agentEntryThreads(r.id,l,t),s[0]=r.id,s[1]=l,s[2]=t,s[3]=c):c=s[3];const u=e&&!!l;let o;s[4]!==i||s[5]!==t?(o=async()=>{try{return(await i.call("COLLECTION_THREADS_LIST",{limit:mr,offset:0,orderBy:[{field:["updated_at"],direction:"desc"}],where:{hidden:!1,created_by:"me",virtual_mcp_id:t}})).items}catch{return[]}},s[4]=i,s[5]=t,s[6]=o):o=s[6];let d;s[7]!==c||s[8]!==u||s[9]!==o?(d={queryKey:c,enabled:u,staleTime:0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,queryFn:o},s[7]=c,s[8]=u,s[9]=o,s[10]=d):d=s[10];const m=me(d);if(!e||!l){let h;return s[11]===Symbol.for("react.memo_cache_sentinel")?(h={status:"idle"},s[11]=h):h=s[11],h}if(!m.data||m.isFetching){let h;return s[12]===Symbol.for("react.memo_cache_sentinel")?(h={status:"loading"},s[12]=h):h=s[12],h}let f;return s[13]!==m.data?(f={status:"ready",threads:m.data},s[13]=m.data,s[14]=f):f=s[14],f}function pr(t){const e=L.c(13),{children:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=je(r);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const l=Ae(a);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={select:xr},e[2]=c):c=e[2];const u=bt(c),{org:o}=ae();let d;e[3]!==o||e[4]!==i.agentId||e[5]!==i.legacyView||e[6]!==i.org||e[7]!==u||e[8]!==l?(d=i.org?is({pathname:u,org:i.org,pathAgentId:i.agentId,pathLegacyView:i.legacyView,fallbackAgentId:ye(o.id).id,search:l}):null,e[3]=o,e[4]=i.agentId,e[5]=i.legacyView,e[6]=i.org,e[7]=u,e[8]=l,e[9]=d):d=e[9];const m=d;let f;return e[10]!==s||e[11]!==m?(f=m?n.jsx(tt,{target:m}):s,e[10]=s,e[11]=m,e[12]=f):f=e[12],f}function xr(t){return t.matches.at(-1)?.pathname??t.location.pathname}function gr(){const t=L.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=je(e);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[1]=r):r=t[1];const i=Ae(r),{org:a}=ae(),{org:l,taskId:c}=s;if(!l||c===void 0)return null;let u;return t[2]!==l||t[3]!==a.id||t[4]!==i||t[5]!==c?(u=ls({org:l,taskId:c,fallbackAgentId:ye(a.id).id,search:i}),t[2]=l,t[3]=a.id,t[4]=i,t[5]=c,t[6]=u):u=t[6],u}function br(){const t=L.c(2),e=gr();let s;return t[0]!==e?(s=e?n.jsx(tt,{target:e}):null,t[0]=e,t[1]=s):s=t[1],s}function vr(){const t=L.c(6),e=Mn(),s=Me();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{preview:i}=Ae(r);if(!e||!i)return null;let a;t[1]!==s?(a=()=>s({to:".",search:yr}),t[1]=s,t[2]=a):a=t[2];let l;return t[3]!==i||t[4]!==a?(l=n.jsx(An,{previewPath:i,onClose:a,showSeeInLibrary:!0}),t[3]=i,t[4]=a,t[5]=l):l=t[5],l}function yr(t){const{preview:e,...s}=t;return s}function jr(t){const e=L.c(11),{children:s}=t,r=V();let i;e[0]!==r?(i=r("agentShellLayout.agentShellLayout.chatLoadingError"),e[0]=r,e[1]=i):i=e[1];let a;e[2]!==i?(a=n.jsx("div",{role:"alert",className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:i}),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==s?(l=s??n.jsx(fa,{}),e[4]=s,e[5]=l):l=e[5];let c;e[6]!==l?(c=n.jsx(Ie,{children:l}),e[6]=l,e[7]=c):c=e[7];let u;return e[8]!==a||e[9]!==c?(u=n.jsx(xt,{fallback:a,children:c}),e[8]=a,e[9]=c,e[10]=u):u=e[10],u}function Sr(t){const e=L.c(6),{threadId:s,providerKey:r,children:i}=t;let a;e[0]!==r||e[1]!==s?(a=s===null?n.jsx(q.ThreadlessStreamSource,{},r):n.jsx(q.ActiveTaskStreamSource,{taskId:s},r),e[0]=r,e[1]=s,e[2]=a):a=e[2];let l;return e[3]!==i||e[4]!==a?(l=n.jsx(q.StreamHost,{source:a,children:i}),e[3]=i,e[4]=a,e[5]=l):l=e[5],l}function kr(t){const e=L.c(3),{onNewTaskRef:s,createNewTask:r}=t;let i;return e[0]!==r||e[1]!==s?(i=()=>(s.current=r,()=>{s.current=null}),e[0]=r,e[1]=s,e[2]=i):i=e[2],z.useLayoutEffect(i),null}function Tr({virtualMcpId:t,hasActiveRepository:e,sandboxMap:s,children:r}){const i=V(),{currentBranch:a,activeTask:l,setCurrentTaskBranch:c,isThreadLocked:u}=$e(),{data:o}=pe.useSession(),d=o?.user?.id,m=!ws(l?.harness_id),f=Xs({agentSandboxMap:s,threadSandboxMap:l?.metadata?.sandboxMap,userId:d,ownerId:l?.created_by,branch:a}),h=e||Gs(l?.metadata),b=z.useRef(null),g=m&&Js({threadLoaded:!!l,isOwner:!!d&&l?.created_by===d,hasActiveRepository:h,branch:a??null,attempted:b.current===(l?.id??null)});z.useEffect(()=>{!g||!l||(b.current=l.id,c(Pt(o?.user?.name||o?.user?.email?.split("@")[0])))},[g,l,o,c]);const v=St(t),x=v.resolved?v.runtime:null,y=Ee(t),j=At(y,a),{releases:S,createRelease:p,markSandbox:k}=Hs(t),T=Ks(t,it(y)),N=it(y)&&a?Vs(a,T.data):!1,w=!!d&&l?.created_by===d,_=!!x&&w&&!!a&&a!==j&&!S.some(B=>B.branch===a)&&!T.isLoading&&N!==!0,P=z.useRef(null);z.useEffect(()=>{!_||!a||!x||P.current!==a&&(P.current=a,p({branch:a,name:qs(S,i("thread.branchPicker.defaultVersionName")),color:Us(S.length),createdBy:d,createdAt:new Date().toISOString(),runtime:x}).catch(()=>{}))},[_,a,x,S,p,d,i]);const C=x==="sandbox"&&u&&w&&S.some(B=>B.branch===a&&B.runtime!=="sandbox"),[A,M]=z.useState(null);if(C&&a&&A!==a){M(a);const B=a;queueMicrotask(()=>{k(B).catch(()=>{})})}const $=en(t,a??void 0),F=(d&&a?$n(f?.[d]?.[a]):{})["agent-sandbox"]??null,R=F?.previewUrl??null,I=m&&x!=="cms"&&(!!F||$);return m?x==="cms"?n.jsx(ot,{resetKey:`${t}:${a??"no-branch"}:${l?.id??""}`,children:r}):n.jsx(Cn,{resetKey:l?.id??"no-thread",virtualMcpId:t,branch:a??null,previewUrl:R,enabled:I,children:n.jsx(tn,{resetKey:l?.id??"no-thread",executionEnabled:m,virtualMcpId:t,branch:a??null,userId:d??null,hasActiveRepository:h,vmEntry:F,threadId:l?.id??null,children:n.jsx(ot,{resetKey:`${t}:${a??"no-branch"}:${l?.id??""}`,children:r})})}):n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex h-full rounded-[0.75rem] bg-background shadow-edge",children:n.jsx(Lt,{image:n.jsx(We,{size:48,className:"text-muted-foreground"}),title:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWeb"),description:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWebDescription")})})})}function Nr(){const t=L.c(19),e=V(),{toggleSidebar:s}=ks(),r=Ts(),{virtualMcpId:i,taskId:a}=$e(),l=!r&&"md:hidden";let c;t[0]!==l?(c=ee(l),t[0]=l,t[1]=c):c=t[1];let u;t[2]!==e?(u=e("layouts.shellControls.toggleSidebar"),t[2]=e,t[3]=u):u=t[3];let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ss,{size:16}),t[4]=o):o=t[4];let d;t[5]!==c||t[6]!==u||t[7]!==s?(d=n.jsx(Ne,{className:c,onClick:s,"aria-label":u,children:o}),t[5]=c,t[6]=u,t[7]=s,t[8]=d):d=t[8];let m;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Wa,{}),t[9]=m):m=t[9];let f;t[10]!==d?(f=n.jsxs(De.Topbar.Left,{children:[d,m]}),t[10]=d,t[11]=f):f=t[11];let h;t[12]!==a||t[13]!==i?(h=n.jsx("div",{className:"min-w-0 md:hidden",children:n.jsx(rr,{virtualMcpId:i,taskId:a})}),t[12]=a,t[13]=i,t[14]=h):h=t[14];let b;t[15]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(De.Topbar.Right,{className:"shrink-0",children:n.jsx(Za,{})}),t[15]=b):b=t[15];let g;return t[16]!==f||t[17]!==h?(g=n.jsxs(De.Topbar,{className:"border-b border-border/60 px-3",children:[f,h,b]}),t[16]=f,t[17]=h,t[18]=g):g=t[18],g}function _r(t){const e=L.c(25),{layout:s,onNewTaskRef:r,createNewTask:i}=t,{virtualMcpId:a,taskId:l}=$e(),c=kn()??"overview",u=cr(),[o,d]=z.useState(null),m=o===c,f=u?m:s.threadOpen;let h;e[0]!==c||e[1]!==s||e[2]!==u||e[3]!==m?(h=u?()=>d(m?null:c):s.toggleThread,e[0]=c,e[1]=s,e[2]=u,e[3]=m,e[4]=h):h=e[4];const b=h;let g;e[5]!==i||e[6]!==r?(g=n.jsx(kr,{onNewTaskRef:r,createNewTask:i}),e[5]=i,e[6]=r,e[7]=g):g=e[7];let v;e[8]!==l||e[9]!==a?(v=n.jsx(Qa,{virtualMcpId:a,taskId:l}),e[8]=l,e[9]=a,e[10]=v):v=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Nr,{}),e[11]=x):x=e[11];const y=l??"threadless";let j;e[12]!==y?(j=n.jsx(lt.Thread,{topbar:x,children:n.jsx(jr,{},y)}),e[12]=y,e[13]=j):j=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(vt,{}),e[14]=S):S=e[14];let p;e[15]!==c||e[16]!==s||e[17]!==v||e[18]!==j||e[19]!==f||e[20]!==b?(p=n.jsxs(lt,{...s,threadOpen:f,toggleThread:b,contentKey:c,contentNavigation:v,children:[j,S]}),e[15]=c,e[16]=s,e[17]=v,e[18]=j,e[19]=f,e[20]=b,e[21]=p):p=e[21];let k;return e[22]!==g||e[23]!==p?(k=n.jsxs(n.Fragment,{children:[g,p]}),e[22]=g,e[23]=p,e[24]=k):k=e[24],k}function wr(){const t=V(),e=Me(),s=mn(),{create:r}=Mt(),{org:i}=ae(),l=je({strict:!1}).org??"",c=Ae({strict:!1}),u=et(),o=Ot(),d=Rt(),[m]=z.useState(()=>crypto.randomUUID()),{data:f}=pe.useSession(),[h]=z.useState(()=>Pt(f?.user?.name||f?.user?.email?.split("@")[0])),b=Qe(),g=z.useSyncExternalStore(b.threads.subscribe,b.threads.get),v=z.useSyncExternalStore(b.threadsStatus.subscribe,b.threadsStatus.get),x=Ee(o),y=!!(x&&wt(x)),j=At(x,null),[S,p]=z.useState(null);u!==null&&S!==null&&p(null);const k=u===null&&!!d&&!!x&&S!==o,T=B=>Qs(B,o,f?.user?.id,It(x?.metadata),y,{baseBranch:j,releases:x?.metadata?.releases??void 0}),N=k&&v.kind!=="loading"?T(g):void 0,w=hr(o,k&&v.kind!=="loading"&&!N),_=fr(u,o,h);ma(_.status==="ready"?_.task:null);const P=x?.metadata?.ui?.layout??null,C=P?{defaultMainView:P.defaultMainView??null,chatDefaultOpen:P.chatDefaultOpen??null}:null,A=an(C),{threadId:M,providerKey:$}=Xa({routeThreadId:u,fallbackKey:m}),E=async()=>{const B=crypto.randomUUID(),O=g.find(H=>H.id===M)?.branch??null;try{await r({id:B,virtual_mcp_id:o,...O?{branch:O}:{}})}catch{}s(B,()=>({}))},F=z.useRef(null);z.useEffect(()=>{const B=O=>{us(O)&&O.shiftKey&&O.code==="KeyS"&&!O.repeat&&(O.preventDefault(),F.current?.())};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[]);const R=_.status==="ready"?_.task:null,I=R?.virtual_mcp_id;if(R&&I&&!hn({routeAgentId:o,threadAgentId:I})){const B=os({org:l,agentId:I,superAgentId:ye(i.id).id});return n.jsx(tt,{target:{route:B,search:{thread:R.id,sidepanel:c.sidepanel,mainpanel:c.mainpanel,autosend:c.autosend}}})}if(k){if(v.kind==="loading"||w.status==="loading")return n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex h-full bg-background shadow-edge rounded-[0.75rem]",children:n.jsx(cs,{})})});const O=(N??(w.status==="ready"?T(w.threads):void 0))?.id??(y?m:null);if(O)return n.jsx(ds,{to:".",replace:!0,search:H=>({...H,thread:O})});p(o)}return _.status==="creating"||_.status==="loading"?n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsxs("div",{role:"status","aria-live":"polite",className:"flex h-full items-center justify-center bg-background shadow-edge rounded-[0.75rem] text-sm text-muted-foreground",children:[n.jsx(Pe,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})}):_.status==="error"?n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsxs("div",{role:"alert",className:"flex flex-col h-full items-center justify-center gap-2 bg-background shadow-edge rounded-[0.75rem] p-8 text-sm",children:[n.jsx("div",{className:"font-medium",children:t("agentShellLayout.agentShellLayout.taskUnavailable")}),n.jsx("div",{className:"text-muted-foreground",children:_.error.message})]})}):x?n.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:n.jsx(q.Provider,{virtualMcpId:o,task:_.status==="ready"?_.task:null,children:n.jsx(zs,{layout:A,children:n.jsx(Tr,{virtualMcpId:o,hasActiveRepository:y,sandboxMap:x.metadata?.sandboxMap,children:n.jsx(Sr,{threadId:M,providerKey:$,children:n.jsx(Ie,{children:n.jsx(_r,{layout:A,onNewTaskRef:F,createNewTask:E})})})})})},o)}):n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden shadow-edge rounded-[0.75rem]",children:n.jsx(Lt,{image:n.jsx(We,{size:48,className:"text-muted-foreground"}),title:t("agentShellLayout.agentShellLayout.agentNotFound"),description:t("agentShellLayout.agentShellLayout.agentNotFoundDescription",{virtualMcpId:o}),actions:n.jsx(qe,{variant:"outline",onClick:()=>e({to:"/$org",params:{org:l}}),children:t("agentShellLayout.agentShellLayout.goToOrgHome")})})})})}function No(){const t=L.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=je(e);if(s.taskId!==void 0){let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(br,{}),t[1]=i):i=t[1],i}if(s._splat!==void 0){let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(vt,{}),t[2]=i):i=t[2],i}let r;return t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ie,{children:n.jsx(pr,{children:n.jsx(In,{children:n.jsxs(Ln,{children:[n.jsx(wr,{}),n.jsx(vr,{})]})})})}),t[3]=r):r=t[3],r}export{No as default};
1
+ import{c as L,a4 as ae,a as pe,aj as Ce,K as fe,i as me,b as V,r as z,m as ee,j as n,h as Pe,B as qe,aR as ye,aQ as Ie,R as xt,E as he,x as Yt,aS as Zt,w as Qt,v as Xt,D as Jt,ab as es,aT as ts,aq as gt,t as ss,ar as ns,d as Me,n as st,aU as as,f as je,U as nt,l as bt,e as rs,u as Ae,aV as is,aW as ls,O as vt,aX as os,aY as cs,N as ds,aZ as us,P as De}from"./index-XdUWZF5g.js";import{i as We}from"./AlertCircle-CQW1P7_R.js";import{E as fs,F as at,A as ve,G as ms,H as hs,k as ps,I as xs,J as gs,K as bs,L as yt,M as vs,n as ys,m as js,o as Ss}from"./agent-icon-DmYd33Zd.js";import{c as ks,u as Ts}from"./use-sidebar-collapsed-XX5WdYs3.js";import{T as Ne}from"./toolbar-icon-button-DQHnJFhG.js";import{C as q,w as Ns}from"./index-0xCVweSM.js";import{s as jt,u as St}from"./use-voice-input-BVeAO01v.js";import{u as Le,b as Ye,c as $e,d as kt,e as _s,s as ws}from"./chat-context-BwoQSegQ.js";import{u as Cs,s as Tt}from"./use-ai-providers-BmwnG2L7.js";import{b as Nt,a as Ps,u as Is}from"./use-organization-settings-B0lt5dXR.js";import{i as Ms}from"./CheckCircle-BAqlx5xq.js";import{s as rt}from"./XClose-B9seet19.js";import{u as Ee,a as As,b as _t,g as wt}from"./repository-binding-Cfy_YQIZ.js";import{I as Ct}from"./integration-icon-DpoZYM7e.js";import{b as Ls}from"./use-entitlements-DzfUP8ON.js";import{t as Ze}from"./ChevronUp-RQuomTlc.js";import{O as $s}from"./pair-BCJ5sFP0.js";import{u as Es,a as Fs}from"./use-thread-outputs-B6Mbzgsq.js";import{u as Rs}from"./use-deco-credits-ChuCrYAR.js";import{C as Os,u as Bs,V as Ds,a as zs}from"./input-BneF5n5F.js";import{a as Gs}from"./agent-capabilities-D8RyEQle.js";import{g as Pt,u as Hs,a as Ks,i as Vs,n as Us,b as qs}from"./cms-store-drafts-DOqjCS5l.js";import{u as Ws,d as It,a as Qe,b as Xe,c as Mt,e as Ys}from"./thread-intent-DnduoWYb.js";import{f as Zs,b as At,c as Qs}from"./use-navigate-to-agent-ycEqYJX7.js";import{o as Xs,s as Js,u as en,S as tn}from"./sandbox-lifecycle-context-D-PaTa6M.js";import{E as Lt}from"./empty-state-D5FGRI4e.js";import{t as sn,m as nn,u as an}from"./use-chat-layout-state-Ep7OkPup.js";import{b as it}from"./use-blocks-v8-project-DSiCCdEB.js";import{C as lt}from"./index-B4tnBHnb.js";import{a as $t,b as Et,P as Ft}from"./popover-DmqBIPKi.js";import{T as Fe,a as Re,c as Oe}from"./tooltip-C1oPRuFg.js";import{T as rn,a as ln}from"./toggle-group-CO1s8gR-.js";import{g as Je,j as on,k as cn,L as dn,s as un}from"./shell-layout-d2Ief2ja.js";import{u as Rt,a as et,r as fn,b as Ot,c as mn,d as hn}from"./thread-route-DSQLBJ4Y.js";import{c as pn,C as xn,e as gn,b as bn,a as vn,f as yn}from"./command-8eo7blzl.js";import{i as Bt}from"./Zap-B2TeJ3jk.js";import{g as jn,S as Sn}from"./task-status-Dg7JusRR.js";import{a as Dt,u as kn}from"./autosend-0p4cszrD.js";import{u as zt}from"./use-main-panel-tabs-DZH6Z-sf.js";import{T as _e}from"./tab-icon-glyph-D5lXXFkj.js";import{a as Tn}from"./UserSquare-DfCEdLMW.js";import{b as Nn,c as Gt,S as _n,d as wn}from"./select-BABowMoY.js";import{S as Cn}from"./use-sandbox-events-BNcBCK9X.js";import{L as Pn}from"./project-apps-CTuZm-1a.js";import{L as tt,a as In}from"./legacy-main-redirect-si54JTxO.js";import{u as Mn}from"./use-mobile-DSmr8Fj3.js";import{L as An}from"./preview-dialog-ZNHmoyI1.js";import{O as Ln}from"./markdown-A06Oe1_p.js";import{B as ot}from"./blocks-preview-workspace-context-CevYm8XG.js";import{p as $n}from"./virtual-mcp-DkEy_7-s.js";import"./Tool01-CE4RsL2T.js";import"./ArrowUp-VZphHDPw.js";import"./ArrowLeft-sSY9Zm-O.js";import"./LinkBroken01-ArAKWl5D.js";import"./ShoppingBag01-DEtqIAKG.js";import"./Globe04-1JEh9zst.js";import"./ChevronSelectorVertical-CAw9AQRt.js";import"./CreditCard01-uW1Nq0L7.js";import"./SwitchHorizontal01-DTDSJnjG.js";import"./Key01-B-MK6puk.js";import"./Minus-y3rEkH4O.js";import"./Monitor01-DkdtFPE6.js";import"./Sun-DhrY2nq7.js";import"./Play-BtmesR9D.js";import"./Plus-BhSB1FAc.js";import"./SearchMd-CTCaP47C.js";import"./Trash01-DQCE9WJt.js";import"./Upload01-C8pH3Rp-.js";import"./Users01-RbJbPNL4.js";import"./sheet-BSCF-nmk.js";import"./tool-namespace-BskMFdfX.js";import"./drawer-BiZQd3jF.js";import"./collection-search-DFoNgd1T.js";import"./use-mcp-client-B9_8tfCL.js";import"./auth-DeNsOsKX.js";import"./use-mcp-prompts-NcFGfyZU.js";import"./usage-stats-CkprzoQA.js";import"./form-Bhgzwnyp.js";import"./label-CUqIqnOS.js";import"./utils-CVEq3hMx.js";import"./use-copy-9wHvlEmg.js";import"./index-CJKJ4WN3.js";import"./checkbox-BYltfk17.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./feature-paywall-DWnzqDkt.js";import"./plan-ladder-LKl9l3TA.js";import"./use-decopilot-events-CR7NJgme.js";import"./watch-sse-pool-BUtg06cI.js";import"./task-board-B-Jl-DnQ.js";import"./schema-CJ9UcSNs.js";import"./backoff-CrEUbyZT.js";import"./collapsible-DMIxs55h.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-Dkj1yLIG.js";import"./types-sVhbGxrT.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./use-connection-DFsrW4Mv.js";import"./file-type-icon-BZTtX6EK.js";import"./icon-button-Dls6AzVP.js";import"./chat-draft-DH581p83.js";import"./tabs-CPwYT_wy.js";import"./active-indicator-CCMhAsc_.js";import"./input-BBwM3ir1.js";import"./suggestion-C9bDFuOo.js";import"./use-org-fs-C57fsXyq.js";import"./useInfiniteQuery-BvhkDMwv.js";import"./infiniteQueryObserver-DgQQHW6Y.js";import"./question-004-sINsf4GQ.js";import"./add-connection-dialog-BZazlImL.js";import"./extract-connection-data-lBAlP3pz.js";import"./metadata-D72DunRR.js";import"./connection-B4VgNpkK.js";import"./url-slug-kny4-Gd8.js";import"./connection-card-Cp7AJMDR.js";import"./connection-slug-CK9E8VRg.js";import"./textarea-DSiKrnTK.js";import"./schema-Dq7led26.js";import"./connection-form-helpers-DqULERyx.js";import"./authenticate-and-persist-oauth-Ca1G6bWy.js";import"./mcp-oauth-u5RBmpff.js";import"./mcp-oauth-L4CbK4hz.js";import"./collection-tabs-DTr38V1c.js";import"./badge-fJOJmdQG.js";import"./use-infinite-scroll-DdKcODzJ.js";import"./useSuspenseInfiniteQuery-CHeSvNyF.js";import"./use-task-board-events-CMb3Vjy2.js";import"./serial-task-queue-CGOeQgpr.js";import"./delay-CnY5UFtP.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./resizable-w4diu4pE.js";import"./use-project-scope-C1eT4xwT.js";import"./index-DJy_S3Mn.js";import"./use-deployment-admin-CALPlo_8.js";import"./admin-fetch-BhTJlAsX.js";import"./project-icon-BhWIi9DN.js";import"./use-debounced-value-Cs49dczG.js";import"./new-project-dialog-151PED_m.js";import"./repository-picker-BKWo-jhF.js";import"./github-icon-Buu0H1v4.js";import"./legacy-admin-welcome-dialog-D12aat8e.js";import"./required-auth-layout-CRKzQVpv.js";import"./use-org-sso-B5c0saDF.js";import"./index-CKuu5BgI.js";import"./use-mcp-tools-wrSWiD0P.js";import"./resolve-tab-icon-DY3vlmxg.js";import"./use-task-metadata-KJjG2-5j.js";import"./preview-source-BsRLGWUP.js";import"./use-project-native-view-presence-BBRyl28q.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-CfNCrD6y.js";import"./index-BdQq_4o_.js";import"./sandbox-url-D3mC8qhT.js";import"./preview-content-8R1QUim7.js";import"./file-share-button-Ug-zwu4d.js";import"./file-preview-CVLvq53I.js";import"./utils-C07I_8BL.js";import"./editor-B5BFg8L4.js";function En({isThreadLocked:t,hasCloudProviderKeys:e,sandboxOnlyChats:s,canRunClaudeCode:r}){return t?null:!e&&!(s&&r)?"provider":s&&!r?"claude-code-provider":null}function Fn(){const t=L.c(26),e=Cs(),s=Le(),r=Nt(),i=Ps("chat_harness_codex"),{org:a}=ae(),{data:l}=pe.useSession(),c=l?.user.id??"",u=Ce(),o=e.some(On);let d;t[0]!==a.id||t[1]!==c?(d=fe.claudeSubscription(a.id,c),t[0]=a.id,t[1]=c,t[2]=d):d=t[2];let m;t[3]!==u?(m=()=>u.call("CLAUDE_SUBSCRIPTION_STATUS",{}),t[3]=u,t[4]=m):m=t[4];const f=r&&!i&&!o;let h;t[5]!==d||t[6]!==m||t[7]!==f?(h={queryKey:d,queryFn:m,enabled:f},t[5]=d,t[6]=m,t[7]=f,t[8]=h):h=t[8];const b=me(h);let g;t[9]!==a.id?(g=fe.githubCopilot(a.id),t[9]=a.id,t[10]=g):g=t[10];let v;t[11]!==u?(v=()=>u.call("GITHUB_COPILOT_STATUS",{}),t[11]=u,t[12]=v):v=t[12];const x=r&&!i&&!o;let y;t[13]!==g||t[14]!==v||t[15]!==x?(y={queryKey:g,queryFn:v,enabled:x},t[13]=g,t[14]=v,t[15]=x,t[16]=y):y=t[16];const j=me(y);let S;t[17]!==a.id||t[18]!==c?(S=fe.codexSubscription(a.id,c),t[17]=a.id,t[18]=c,t[19]=S):S=t[19];let p;t[20]!==u?(p=()=>u.call("CODEX_SUBSCRIPTION_STATUS",{}),t[20]=u,t[21]=p):p=t[21];const k=r&&i;let T;t[22]!==k||t[23]!==S||t[24]!==p?(T={queryKey:S,queryFn:p,enabled:k},t[22]=k,t[23]=S,t[24]=p,t[25]=T):T=t[25];const N=me(T);return r&&i&&!s?.isThreadLocked?e.some(Rn)||N.data?.connected!==!1?null:"codex-provider":En({isThreadLocked:s?.isThreadLocked??!1,hasCloudProviderKeys:e.length>0,sandboxOnlyChats:r,canRunClaudeCode:o||b.data?.connected!==!1||j.data?.connected!==!1||!!j.data?.orgShare})}function Rn(t){return jt(t.providerId)}function On(t){return Tt(t.providerId)}function be(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function ze(t){if(!t)return"—";const e=typeof t=="string"?new Date(t):t;return isNaN(e.getTime())?"—":e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function Bn(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function Dn(t){const e=L.c(4),{items:s}=t;let r;e[0]!==s?(r=s.map(zn),e[0]=s,e[1]=r):r=e[1];let i;return e[2]!==r?(i=n.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:r}),e[2]=r,e[3]=i):i=e[3],i}function zn(t){return n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[n.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t.label}),n.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:t.value})]},t.label)}function Gn(t){const e=L.c(33),{userTokens:s,assistantTokens:r,otherTokens:i}=t,a=V(),l=s+r+i,c=l>0?s/l*100:0,u=l>0?r/l*100:0,o=l>0?i/l*100:0;let d;e[0]!==c?(d=c>0&&n.jsx("div",{className:"h-full bg-chart-1",style:{width:`${c}%`}}),e[0]=c,e[1]=d):d=e[1];let m;e[2]!==u?(m=u>0&&n.jsx("div",{className:"h-full bg-chart-2",style:{width:`${u}%`}}),e[2]=u,e[3]=m):m=e[3];let f;e[4]!==o?(f=o>0&&n.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${o}%`}}),e[4]=o,e[5]=f):f=e[5];let h;e[6]!==d||e[7]!==m||e[8]!==f?(h=n.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[d,m,f]}),e[6]=d,e[7]=m,e[8]=f,e[9]=h):h=e[9];let b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=b):b=e[10];let g;e[11]!==a||e[12]!==c?(g=a("chat.contextPanel.userPercent",{pct:c.toFixed(1)}),e[11]=a,e[12]=c,e[13]=g):g=e[13];let v;e[14]!==g?(v=n.jsxs("div",{className:"flex items-center gap-1.5",children:[b,n.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e[14]=g,e[15]=v):v=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[16]=x):x=e[16];let y;e[17]!==u||e[18]!==a?(y=a("chat.contextPanel.assistantPercent",{pct:u.toFixed(1)}),e[17]=u,e[18]=a,e[19]=y):y=e[19];let j;e[20]!==y?(j=n.jsxs("div",{className:"flex items-center gap-1.5",children:[x,n.jsx("span",{className:"text-xs text-muted-foreground",children:y})]}),e[20]=y,e[21]=j):j=e[21];let S;e[22]!==o||e[23]!==i||e[24]!==a?(S=i>0&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.otherPercent",{pct:o.toFixed(1)})})]}),e[22]=o,e[23]=i,e[24]=a,e[25]=S):S=e[25];let p;e[26]!==j||e[27]!==S||e[28]!==v?(p=n.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[v,j,S]}),e[26]=j,e[27]=S,e[28]=v,e[29]=p):p=e[29];let k;return e[30]!==p||e[31]!==h?(k=n.jsxs("div",{className:"flex flex-col gap-2",children:[h,p]}),e[30]=p,e[31]=h,e[32]=k):k=e[32],k}function Hn(t){const e=L.c(14),{agentId:s,isError:r}=t,i=Ee(s),a=V();let l;e[0]!==i?.title||e[1]!==a?(l=i?.title??a("chat.subtask.subtaskNoun"),e[0]=i?.title,e[1]=a,e[2]=l):l=e[2];const c=l,u=i?.icon??null;let o;e[3]!==u||e[4]!==c?(o=n.jsx(Ct,{icon:u,name:c,size:"xs",className:"size-6 rounded-md shrink-0"}),e[3]=u,e[4]=c,e[5]=o):o=e[5];const d=r?"text-destructive":"text-foreground";let m;e[6]!==d?(m=ee("shrink-0 font-medium",d),e[6]=d,e[7]=m):m=e[7];let f;e[8]!==c||e[9]!==m?(f=n.jsx("span",{className:m,children:c}),e[8]=c,e[9]=m,e[10]=f):f=e[10];let h;return e[11]!==o||e[12]!==f?(h=n.jsxs(n.Fragment,{children:[o,f]}),e[11]=o,e[12]=f,e[13]=h):h=e[13],h}function Kn(t){const e=L.c(12),{isError:s}=t,r=V();let i;e[0]!==r?(i=r("chat.contextPanel.subtask"),e[0]=r,e[1]=i):i=e[1];const a=i;let l;e[2]!==a?(l=n.jsx(Ct,{icon:null,name:a,size:"xs",className:"size-6 rounded-md shrink-0"}),e[2]=a,e[3]=l):l=e[3];const c=s?"text-destructive":"text-foreground";let u;e[4]!==c?(u=ee("shrink-0 font-medium",c),e[4]=c,e[5]=u):u=e[5];let o;e[6]!==a||e[7]!==u?(o=n.jsx("span",{className:u,children:a}),e[6]=a,e[7]=u,e[8]=o):o=e[8];let d;return e[9]!==l||e[10]!==o?(d=n.jsxs(n.Fragment,{children:[l,o]}),e[9]=l,e[10]=o,e[11]=d):d=e[11],d}function Vn(t){const e=L.c(18),{part:s}=t,r=s.input?.agent_id,i=s.state==="input-streaming"||s.state==="input-available"||s.state==="output-available"&&s.preliminary===!0,a=s.state==="output-error",l=s.state==="approval-requested";let c;e[0]!==a?(c=n.jsx(Kn,{isError:a}),e[0]=a,e[1]=c):c=e[1];let u;e[2]!==r||e[3]!==a?(u=n.jsx(Hn,{agentId:r,isError:a}),e[2]=r,e[3]=a,e[4]=u):u=e[4];let o;e[5]!==c||e[6]!==u?(o=n.jsx(z.Suspense,{fallback:c,children:u}),e[5]=c,e[6]=u,e[7]=o):o=e[7];let d;e[8]!==s.input?(d=s.input?.prompt&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted-foreground/50",children:"·"}),n.jsx("span",{className:"truncate text-muted-foreground",children:s.input.prompt})]}),e[8]=s.input,e[9]=d):d=e[9];let m;e[10]!==l||e[11]!==a||e[12]!==i?(m=n.jsx("span",{className:"ml-auto shrink-0",children:i?n.jsx(Pe,{className:"size-3 text-muted-foreground"}):a?n.jsx(fs,{size:12,className:"text-destructive"}):l?n.jsx(We,{size:12,className:"text-warning"}):n.jsx(Ms,{size:12,className:"text-success"})}),e[10]=l,e[11]=a,e[12]=i,e[13]=m):m=e[13];let f;return e[14]!==o||e[15]!==d||e[16]!==m?(f=n.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[o,d,m]}),e[14]=o,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Un(t){const e=L.c(51),{onClose:s,back:r,className:i}=t,a=V(),[l,c]=z.useState(null),{messages:u}=Ye(),{activeTask:o}=$e(),{selectedModel:d,selectedVirtualMcp:m}=kt(),f=_s(u),h=[...u].reverse().find(aa),b=h?.metadata?.usage,g=[...u].reverse().find(na)?.metadata?.models?.thinking,v=h?.metadata?.modelLimits?.contextWindow??(!g||g.id===d?.modelId?d?.limits?.contextWindow:null)??null,x=b?.contextTokens??0,y=v&&v>0?(x/v*100).toFixed(1):null,j=u;let S;e[0]!==j?(S=j.filter(sa).reduce(ta,0),e[0]=j,e[1]=S):S=e[1];const p=S,k=u;let T;e[2]!==k?(T=k.filter(ea).reduce(Jn,0),e[2]=k,e[3]=T):T=e[3];const N=T,w=Math.max(0,f.totalTokens-p-N),_=u[0],P=u.at(-1),C=_?.metadata?.created_at??o?.created_at,A=P?.metadata?.created_at??o?.updated_at,M=u.filter(Xn),$=u.flatMap(Zn),E=Bn(g?.id??d?.modelId),F=m?.title??"Super Agent",R=Ls(),I=[{label:a("chat.contextPanel.sessionLabel"),value:o?.title??a("chat.contextPanel.newChat")},{label:a("chat.contextPanel.messagesLabel"),value:M.length},{label:a("chat.contextPanel.agentLabel"),value:F},...R?[{label:a("chat.contextPanel.modelLabel"),value:E}]:[],{label:a("chat.contextPanel.contextLimitLabel"),value:v?be(v):"—"},{label:a("chat.contextPanel.sessionTokensLabel"),value:f.totalTokens>0?be(f.totalTokens):"0"},{label:a("chat.contextPanel.usageLabel"),value:y!==null?`${y}%`:"—"},{label:a("chat.contextPanel.inputTokensLabel"),value:f.inputTokens>0?be(f.inputTokens):"0"},{label:a("chat.contextPanel.outputTokensLabel"),value:f.outputTokens>0?be(f.outputTokens):"0"},{label:a("chat.contextPanel.reasoningTokensLabel"),value:f.reasoningTokens>0?be(f.reasoningTokens):"0"},...R?[{label:a("chat.contextPanel.costLabel"),value:f.cost>0?`$${f.cost<.001?f.cost.toFixed(6):f.cost.toFixed(4)}`:"$0.00"}]:[],{label:a("chat.contextPanel.sessionCreatedLabel"),value:ze(C)},{label:a("chat.contextPanel.lastActivityLabel"),value:ze(A)}];if(!o&&M.length===0){let G;e[4]!==i?(G=ee("flex flex-col h-full w-full border-l border-border bg-background",i),e[4]=i,e[5]=G):G=e[5];let re;e[6]!==a?(re=a("chat.contextPanel.title"),e[6]=a,e[7]=re):re=e[7];let X;e[8]!==re?(X=n.jsx("span",{className:"text-sm font-medium text-foreground",children:re}),e[8]=re,e[9]=X):X=e[9];let J;e[10]!==r?(J=r?n.jsx(at,{size:14,className:"text-muted-foreground"}):n.jsx(rt,{size:14,className:"text-muted-foreground"}),e[10]=r,e[11]=J):J=e[11];let te;e[12]!==s||e[13]!==J?(te=n.jsx("button",{type:"button",onClick:s,className:"flex size-6 items-center justify-center hover:bg-accent transition-colors rounded-lg",children:J}),e[12]=s,e[13]=J,e[14]=te):te=e[14];let ne;e[15]!==X||e[16]!==te?(ne=n.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[X,te]}),e[15]=X,e[16]=te,e[17]=ne):ne=e[17];let ie;e[18]!==a?(ie=a("chat.contextPanel.emptyState"),e[18]=a,e[19]=ie):ie=e[19];let se;e[20]!==ie?(se=n.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:n.jsx("p",{className:"text-xs text-muted-foreground",children:ie})}),e[20]=ie,e[21]=se):se=e[21];let oe;return e[22]!==ne||e[23]!==se||e[24]!==G?(oe=n.jsxs("div",{className:G,children:[ne,se]}),e[22]=ne,e[23]=se,e[24]=G,e[25]=oe):oe=e[25],oe}let B;e[26]!==i?(B=ee("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",i),e[26]=i,e[27]=B):B=e[27];let O;e[28]!==a?(O=a("chat.contextPanel.title"),e[28]=a,e[29]=O):O=e[29];let H;e[30]!==O?(H=n.jsx("span",{className:"text-sm font-medium text-foreground",children:O}),e[30]=O,e[31]=H):H=e[31];let D;e[32]!==r?(D=r?n.jsx(at,{className:"size-3.5"}):n.jsx(rt,{className:"size-3.5"}),e[32]=r,e[33]=D):D=e[33];let U;e[34]!==s||e[35]!==D?(U=n.jsx(qe,{type:"button",variant:"ghost",size:"icon-sm",onClick:s,className:"text-muted-foreground",children:D}),e[34]=s,e[35]=D,e[36]=U):U=e[36];let Z;e[37]!==H||e[38]!==U?(Z=n.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[H,U]}),e[37]=H,e[38]=U,e[39]=Z):Z=e[39];let Y;e[40]!==a?(Y=a("chat.contextPanel.contextBreakdownSection"),e[40]=a,e[41]=Y):Y=e[41];let Q;e[42]!==Y?(Q=n.jsx("span",{className:"text-xs text-muted-foreground",children:Y}),e[42]=Y,e[43]=Q):Q=e[43];let W;e[44]!==N||e[45]!==w||e[46]!==p?(W=n.jsx(Gn,{userTokens:p,assistantTokens:N,otherTokens:w}),e[44]=N,e[45]=w,e[46]=p,e[47]=W):W=e[47];let le;return e[48]!==Q||e[49]!==W?(le=n.jsxs("div",{className:"flex flex-col gap-3",children:[Q,W]}),e[48]=Q,e[49]=W,e[50]=le):le=e[50],n.jsxs("div",{className:B,children:[Z,n.jsxs("div",{className:"flex flex-col gap-8 p-6",children:[$.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.subtasksSection")}),n.jsx("div",{className:"flex flex-col gap-1",children:$.map(Yn)})]}),n.jsx(Dn,{items:I}),le,M.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.rawMessagesSection")}),n.jsx("div",{className:"flex flex-col gap-1",children:M.map(G=>{const re=G.metadata?.created_at,X=l?.id===G.id;return n.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:()=>c(X?null:G),className:"flex items-center justify-between gap-2 px-3 py-2 text-xs hover:bg-accent w-full text-left cursor-pointer",children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:ee("shrink-0 font-medium",G.role==="user"?"text-chart-1":"text-chart-2"),children:G.role}),n.jsx("span",{className:"text-muted-foreground",children:"•"}),n.jsx("span",{className:"truncate text-muted-foreground font-mono",children:G.id})]}),re&&n.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:ze(re)})]}),X&&n.jsxs(n.Fragment,{children:[G.role==="assistant"&&(()=>{const J=G.metadata?._request;if(!J)return null;const te=J.systemSections??[],ne=Math.max(1,...te.map(Wn)),ie=te.reduce(qn,0);return n.jsxs("div",{className:"border-t border-border/50 px-3 py-2.5 text-xs space-y-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"font-medium text-foreground",children:a("chat.contextPanel.requestLabel")}),n.jsxs("span",{className:"text-muted-foreground tabular-nums",children:[J.activeTools??0," / ",J.tools??0," ",a("chat.contextPanel.toolsActive")]})]}),te.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"text-muted-foreground",children:[a("chat.contextPanel.systemPromptLabel")," ",n.jsxs("span",{className:"tabular-nums",children:["~",Math.round(ie/4).toLocaleString()," ",a("chat.contextPanel.tokAbbrev")]})]}),te.map((se,oe)=>{const ce=se.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${oe}`,xe=se.chars/ne*100,de=Math.round(se.chars/4);return n.jsxs("div",{className:"space-y-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:"font-mono text-foreground truncate",children:ce}),n.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["~",de.toLocaleString()," ",a("chat.contextPanel.tokAbbrev")]})]}),n.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-chart-3",style:{width:`${xe}%`}})})]},oe)})]})]})})(),n.jsx("pre",{className:"text-xs font-mono bg-muted px-3 py-2 overflow-auto whitespace-pre-wrap break-all border-t border-border/50 max-h-64",children:JSON.stringify(G,null,2)})]})]},G.id)})})]})]})]})}function qn(t,e){return t+e.chars}function Wn(t){return t.chars}function Yn(t,e){return n.jsx(Vn,{part:t},e)}function Zn(t){return(t.parts??[]).filter(Qn)}function Qn(t){return t.type==="tool-subtask"}function Xn(t){return t.role!=="system"}function Jn(t,e){const s=e.metadata?.usage;return t+(s?.outputTokens??0)}function ea(t){return t.role==="assistant"}function ta(t,e){const s=e.metadata?.usage;return t+(s?.inputTokens??0)}function sa(t){return t.role==="user"}function na(t){return t.role==="assistant"&&t.metadata?.models}function aa(t){return t.role==="assistant"&&t.metadata?.usage}function ra(t){const e=L.c(21),{onOpenContextPanel:s}=t,{org:r}=ae(),{selectedVirtualMcp:i}=kt();let a;e[0]!==r.id?(a=ye(r.id),e[0]=r.id,e[1]=a):a=e[1];const c=i??a,o=Ee(c.id)??c,d=o.title??"Super Agent",m=o.icon??null,f=o.description??null;let h;e[2]!==m||e[3]!==d?(h=n.jsx(ve,{icon:m,name:d,size:"lg"}),e[2]=m,e[3]=d,e[4]=h):h=e[4];let b;e[5]!==d?(b=n.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:d}),e[5]=d,e[6]=b):b=e[6];let g;e[7]!==f?(g=f?n.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-balance",children:f}):null,e[7]=f,e[8]=g):g=e[8];let v;e[9]!==b||e[10]!==g?(v=n.jsxs("div",{className:"space-y-1.5",children:[b,g]}),e[9]=b,e[10]=g,e[11]=v):v=e[11];let x;e[12]!==h||e[13]!==v?(x=n.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-4 px-6 text-center overflow-hidden",children:[h,v]}),e[12]=h,e[13]=v,e[14]=x):x=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(q.IceBreakers,{className:"pb-3"}),e[15]=y):y=e[15];let j;e[16]!==s?(j=n.jsxs(q.Footer,{children:[y,n.jsx(q.Input,{onOpenContextPanel:s})]}),e[16]=s,e[17]=j):j=e[17];let S;return e[18]!==x||e[19]!==j?(S=n.jsxs(n.Fragment,{children:[x,j]}),e[18]=x,e[19]=j,e[20]=S):S=e[20],S}function ct(t){const e=L.c(17),{outputs:s,collapsed:r,onToggle:i,variant:a}=t,l=a==="card"?"rounded-xl bg-muted/95 shadow-edge backdrop-blur-sm":"border-b border-border bg-background";let c;e[0]!==l?(c=ee(l),e[0]=l,e[1]=c):c=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Files in this task"}),e[2]=u):u=e[2];const o=r&&"-rotate-90";let d;e[3]!==o?(d=ee("size-4 text-muted-foreground transition-transform",o),e[3]=o,e[4]=d):d=e[4];let m;e[5]!==d?(m=n.jsx(Ze,{className:d}),e[5]=d,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==m?(f=n.jsxs("button",{type:"button",onClick:i,className:"flex w-full items-center justify-between px-3 py-2.5 text-left",children:[u,m]}),e[7]=i,e[8]=m,e[9]=f):f=e[9];let h;e[10]!==r||e[11]!==s?(h=!r&&n.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto px-2 pb-2",children:s.map(ia)}),e[10]=r,e[11]=s,e[12]=h):h=e[12];let b;return e[13]!==c||e[14]!==f||e[15]!==h?(b=n.jsxs("div",{className:c,children:[f,h]}),e[13]=c,e[14]=f,e[15]=h,e[16]=b):b=e[16],b}function ia(t){return n.jsx($s,{file:t},t.key)}function la(){const t=L.c(13),e=Le()?.taskId??null,s=Es();let r;t[0]!==s?(r={enabled:s},t[0]=s,t[1]=r):r=t[1];const{data:i}=Fs(e,r),[a,l]=z.useState(!1),[c,u]=z.useState(!0);if(!e||!i||i.length===0)return null;let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=()=>l(ca),t[2]=o):o=t[2];let d;t[3]!==a||t[4]!==i?(d=n.jsx("div",{className:"absolute top-2 right-2 z-10 hidden w-72 @[1280px]:block",children:n.jsx(ct,{variant:"card",outputs:i,collapsed:a,onToggle:o})}),t[3]=a,t[4]=i,t[5]=d):d=t[5];let m;t[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>u(oa),t[6]=m):m=t[6];let f;t[7]!==c||t[8]!==i?(f=n.jsx("div",{className:"shrink-0 @[1280px]:hidden",children:n.jsx(ct,{variant:"bar",outputs:i,collapsed:c,onToggle:m})}),t[7]=c,t[8]=i,t[9]=f):f=t[9];let h;return t[10]!==d||t[11]!==f?(h=n.jsxs(n.Fragment,{children:[d,f]}),t[10]=d,t[11]=f,t[12]=h):h=t[12],h}function oa(t){return!t}function ca(t){return!t}function da(){const t=L.c(1);z.use(Ye().ready);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Os,{children:n.jsx(ua,{})}),t[0]=e):e=t[0],e}function ua(){const t=L.c(29),{active:e}=Bs(),{org:s}=ae(),r=Le(),{isChatEmpty:i}=Ye(),[a,l]=z.useState("chat"),c=Rs(),u=V(),o=Fn(),{runtime:d}=St(r?.virtualMcpId);if(o!==null&&d!=="cms"){let N;return t[0]!==o||t[1]!==u?(N=n.jsx(q,{className:"animate-in fade-in-0 duration-200",children:n.jsx(q.Main,{className:"flex flex-col items-center",children:n.jsx(q.EmptyState,{children:o==="codex-provider"?n.jsx(q.NoAiProviderEmptyState,{title:u("settings.codexSubscription.setupHeading"),description:u("settings.codexSubscription.setupDescription"),providerFilter:jt}):o==="claude-code-provider"?n.jsx(q.NoAiProviderEmptyState,{title:u("chat.noAiProviderEmptyState.supportedHeading"),description:u("chat.noAiProviderEmptyState.supportedSubtitle"),providerFilter:Tt}):n.jsx(q.NoAiProviderEmptyState,{})})})}),t[0]=o,t[1]=u,t[2]=N):N=t[2],N}let f;t[3]!==c.hasDecoKey||t[4]!==c.hasOnlyDecoProvider||t[5]!==c.isLoading||t[6]!==c.isZeroBalance||t[7]!==i||t[8]!==s?(f=c.hasDecoKey&&c.isZeroBalance&&c.hasOnlyDecoProvider&&!c.isLoading&&i&&!Ns(s.id),t[3]=c.hasDecoKey,t[4]=c.hasOnlyDecoProvider,t[5]=c.isLoading,t[6]=c.isZeroBalance,t[7]=i,t[8]=s,t[9]=f):f=t[9];const h=f;let b;t[10]!==h?(b=h&&n.jsx(q.CreditsEmptyState,{}),t[10]=h,t[11]=b):b=t[11];let g;t[12]!==a||t[13]!==i||t[14]!==d||t[15]!==e?(g=!e&&n.jsx("div",{inert:a!=="chat"?!0:void 0,"aria-hidden":a!=="chat",className:ee("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",a!=="chat"?"opacity-0 pointer-events-none":"opacity-100"),children:i&&d!=="cms"?n.jsx(ra,{onOpenContextPanel:()=>l("context")}):n.jsxs(n.Fragment,{children:[n.jsxs(q.Main,{className:"relative flex flex-col overflow-hidden @container",children:[n.jsx(la,{}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(q.Messages,{})})]}),n.jsx(q.Footer,{children:n.jsx(q.Input,{onOpenContextPanel:()=>l("context")})})]})}),t[12]=a,t[13]=i,t[14]=d,t[15]=e,t[16]=g):g=t[16];let v;t[17]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ds,{}),t[17]=v):v=t[17];const x=a!=="context"?!0:void 0,y=a!=="context",j=a==="context"?"opacity-100":"opacity-0 pointer-events-none";let S;t[18]!==j?(S=ee("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",j),t[18]=j,t[19]=S):S=t[19];let p;t[20]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Un,{back:!0,onClose:()=>l("chat")}),t[20]=p):p=t[20];let k;t[21]!==x||t[22]!==y||t[23]!==S?(k=n.jsx("div",{inert:x,"aria-hidden":y,className:S,children:p}),t[21]=x,t[22]=y,t[23]=S,t[24]=k):k=t[24];let T;return t[25]!==b||t[26]!==g||t[27]!==k?(T=n.jsxs(q,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[b,g,v,k]}),t[25]=b,t[26]=g,t[27]=k,t[28]=T):T=t[28],T}function fa(){const t=L.c(7),e=V();let s;t[0]!==e?(s=e("agentShellLayout.agentShellLayout.chatLoadingError"),t[0]=e,t[1]=s):s=t[1];let r;t[2]!==s?(r=n.jsx("div",{role:"alert",className:"flex h-full flex-1 items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=r):r=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ie,{children:n.jsx(da,{})}),t[4]=i):i=t[4];let a;return t[5]!==r?(a=n.jsx(xt,{fallback:r,children:i}),t[5]=r,t[6]=a):a=t[6],a}function ma(t){const e=L.c(10),{org:s}=ae(),r=Ws(),{data:i}=pe.useSession(),a=i?.user?.id,l=t?.id??null,c=!!t&&!!a&&!!t.created_by&&t.created_by!==a;let u;e[0]!==s.id||e[1]!==l?(u=fe.viewedThreadMetadataRefresh(s.id,l??""),e[0]=s.id,e[1]=l,e[2]=u):u=e[2];const o=!!r&&!!l&&c;let d;e[3]!==r||e[4]!==l?(d=async()=>(await r?.refreshThreadMetadata(l??""),!0),e[3]=r,e[4]=l,e[5]=d):d=e[5];let m;e[6]!==u||e[7]!==o||e[8]!==d?(m={queryKey:u,enabled:o,staleTime:Number.POSITIVE_INFINITY,queryFn:d},e[6]=u,e[7]=o,e[8]=d,e[9]=m):m=e[9],me(m)}function Ge(t){const e=L.c(14),{label:s,value:r,onChange:i,options:a}=t;let l;e[0]!==s?(l=n.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=l):l=e[1];let c;e[2]!==i?(c=m=>m&&i(m),e[2]=i,e[3]=c):c=e[3];let u;e[4]!==a?(u=a.map(ha),e[4]=a,e[5]=u):u=e[5];let o;e[6]!==s||e[7]!==c||e[8]!==u||e[9]!==r?(o=n.jsx(ln,{type:"single",size:"sm",value:r,onValueChange:c,"aria-label":s,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:u}),e[6]=s,e[7]=c,e[8]=u,e[9]=r,e[10]=o):o=e[10];let d;return e[11]!==l||e[12]!==o?(d=n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l,o]}),e[11]=l,e[12]=o,e[13]=d):d=e[13],d}function ha(t){return n.jsxs(rn,{value:t.value,className:"h-6 gap-1.5 rounded-lg px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:bg-card data-[state=on]:text-foreground data-[state=on]:shadow-edge",children:[t.icon,t.label]},t.value)}function pa(t){const e=L.c(91),{panel:s,className:r}=t,i=r===void 0?"md:size-[34px]":r,a=V();let l;e[0]!==a?(l=a("sidebar.taskGroupsList.filterChats"),e[0]=a,e[1]=l):l=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ms,{size:16}),e[2]=c):c=e[2];let u;e[3]!==s.filtersActive?(u=s.filtersActive&&n.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"}),e[3]=s.filtersActive,e[4]=u):u=e[4];let o;e[5]!==i||e[6]!==s.filtersActive||e[7]!==l||e[8]!==u?(o=n.jsx(Fe,{asChild:!0,children:n.jsx($t,{asChild:!0,children:n.jsxs(Ne,{"aria-label":l,active:s.filtersActive,className:i,children:[c,u]})})}),e[5]=i,e[6]=s.filtersActive,e[7]=l,e[8]=u,e[9]=o):o=e[9];let d;e[10]!==a?(d=a("sidebar.taskGroupsList.filterChats"),e[10]=a,e[11]=d):d=e[11];let m;e[12]!==d?(m=n.jsx(Re,{side:"bottom",children:d}),e[12]=d,e[13]=m):m=e[13];let f;e[14]!==o||e[15]!==m?(f=n.jsxs(Oe,{children:[o,m]}),e[14]=o,e[15]=m,e[16]=f):f=e[16];let h;e[17]!==a?(h=a("sidebar.taskGroupsList.filterView"),e[17]=a,e[18]=h):h=e[18];const b=s.groupBy;let g;e[19]!==s?(g=G=>{he("tasks_panel_group_by_changed",{to_value:G}),s.setGroupBy(G)},e[19]=s,e[20]=g):g=e[20];let v;e[21]!==a?(v=a("sidebar.taskGroupsList.viewList"),e[21]=a,e[22]=v):v=e[22];let x;e[23]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(hs,{size:13}),e[23]=x):x=e[23];let y;e[24]!==v?(y={value:"flat",label:v,icon:x},e[24]=v,e[25]=y):y=e[25];let j;e[26]!==a?(j=a("sidebar.taskGroupsList.viewStatus"),e[26]=a,e[27]=j):j=e[27];let S;e[28]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(ps,{size:13}),e[28]=S):S=e[28];let p;e[29]!==j?(p={value:"status",label:j,icon:S},e[29]=j,e[30]=p):p=e[30];let k;e[31]!==y||e[32]!==p?(k=[y,p],e[31]=y,e[32]=p,e[33]=k):k=e[33];let T;e[34]!==s.groupBy||e[35]!==g||e[36]!==k||e[37]!==h?(T=n.jsx(Ge,{label:h,value:b,onChange:g,options:k}),e[34]=s.groupBy,e[35]=g,e[36]=k,e[37]=h,e[38]=T):T=e[38];let N;e[39]!==a?(N=a("sidebar.taskGroupsList.filterType"),e[39]=a,e[40]=N):N=e[40];const w=s.typeFilter;let _;e[41]!==s?(_=G=>{he("tasks_panel_filter_changed",{to_value:G}),s.setTypeFilter(G)},e[41]=s,e[42]=_):_=e[42];let P;e[43]!==a?(P=a("sidebar.taskGroupsList.typeAll"),e[43]=a,e[44]=P):P=e[44];let C;e[45]!==P?(C={value:"all",label:P},e[45]=P,e[46]=C):C=e[46];let A;e[47]!==a?(A=a("sidebar.taskGroupsList.typeChats"),e[47]=a,e[48]=A):A=e[48];let M;e[49]!==A?(M={value:"manual",label:A},e[49]=A,e[50]=M):M=e[50];let $;e[51]!==a?($=a("sidebar.taskGroupsList.typeAuto"),e[51]=a,e[52]=$):$=e[52];let E;e[53]!==$?(E={value:"automation",label:$},e[53]=$,e[54]=E):E=e[54];let F;e[55]!==C||e[56]!==M||e[57]!==E?(F=[C,M,E],e[55]=C,e[56]=M,e[57]=E,e[58]=F):F=e[58];let R;e[59]!==s.typeFilter||e[60]!==N||e[61]!==_||e[62]!==F?(R=n.jsx(Ge,{label:N,value:w,onChange:_,options:F}),e[59]=s.typeFilter,e[60]=N,e[61]=_,e[62]=F,e[63]=R):R=e[63];let I;e[64]!==a?(I=a("sidebar.taskGroupsList.filterScope"),e[64]=a,e[65]=I):I=e[65];const B=s.showAll?"team":"mine";let O;e[66]!==s?(O=G=>s.setShowAll(G==="team"),e[66]=s,e[67]=O):O=e[67];let H;e[68]!==a?(H=a("sidebar.taskGroupsList.scopeMine"),e[68]=a,e[69]=H):H=e[69];let D;e[70]!==H?(D={value:"mine",label:H},e[70]=H,e[71]=D):D=e[71];let U;e[72]!==a?(U=a("sidebar.taskGroupsList.scopeTeam"),e[72]=a,e[73]=U):U=e[73];let Z;e[74]!==U?(Z={value:"team",label:U},e[74]=U,e[75]=Z):Z=e[75];let Y;e[76]!==D||e[77]!==Z?(Y=[D,Z],e[76]=D,e[77]=Z,e[78]=Y):Y=e[78];let Q;e[79]!==I||e[80]!==B||e[81]!==O||e[82]!==Y?(Q=n.jsx(Ge,{label:I,value:B,onChange:O,options:Y}),e[79]=I,e[80]=B,e[81]=O,e[82]=Y,e[83]=Q):Q=e[83];let W;e[84]!==T||e[85]!==R||e[86]!==Q?(W=n.jsxs(Et,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[T,R,Q]}),e[84]=T,e[85]=R,e[86]=Q,e[87]=W):W=e[87];let le;return e[88]!==W||e[89]!==f?(le=n.jsxs(Ft,{children:[f,W]}),e[88]=W,e[89]=f,e[90]=le):le=e[90],le}function xa(t,e){return t.filter(s=>s.id===e||!!s.trigger_id||sn(s))}function ga(){const t=L.c(2),e=As()??[];let s;return t[0]!==e?(s=r=>{if(!r)return;const i=e.find(a=>a.id===r);return i?It(i.metadata):void 0},t[0]=e,t[1]=s):s=t[1],s}function ba(t){const e=L.c(9),{virtualMcpId:s,size:r,showAutomationBadge:i}=t,a=r===void 0?"sm":r,l=V();let c;e[0]!==a||e[1]!==s?(c=s?n.jsx(va,{virtualMcpId:s,size:a}):n.jsx(ve,{icon:null,name:"?",size:a}),e[0]=a,e[1]=s,e[2]=c):c=e[2];let u;e[3]!==i||e[4]!==l?(u=i&&n.jsx("span",{"aria-label":l("tasksPanel.mcpAvatar.automationTriggered"),className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-special border border-special text-special-foreground",children:n.jsx(Bt,{size:10,className:"text-white"})}),e[3]=i,e[4]=l,e[5]=u):u=e[5];let o;return e[6]!==c||e[7]!==u?(o=n.jsxs("div",{className:"relative shrink-0",children:[c,u]}),e[6]=c,e[7]=u,e[8]=o):o=e[8],o}function va(t){const e=L.c(6),{virtualMcpId:s,size:r}=t,i=_t(s);if(!i){let c;return e[0]!==r?(c=n.jsx(ve,{icon:null,name:"?",size:r}),e[0]=r,e[1]=c):c=e[1],c}const a=i.icon??null;let l;return e[2]!==i.title||e[3]!==r||e[4]!==a?(l=n.jsx(ve,{icon:a,name:i.title,size:r}),e[2]=i.title,e[3]=r,e[4]=a,e[5]=l):l=e[5],l}const dt=["thread"];function ya(t){const e=L.c(53),{open:s,onOpenChange:r}=t,[i,a]=z.useState(""),{org:l}=ae(),{setTaskId:c}=Je(),u=Ce(),o=V();let d,m,f,h;e[0]!==l.id||e[1]!==i?(h=i.trim(),d=h?20:10,f=me,m=fe.globalSearch(l.id,h,d,dt),e[0]=l.id,e[1]=i,e[2]=d,e[3]=m,e[4]=f,e[5]=h):(d=e[2],m=e[3],f=e[4],h=e[5]);let b;e[6]!==d||e[7]!==u||e[8]!==h?(b=async()=>{const I=await u.call("GLOBAL_SEARCH",{query:h,limit:d,types:[...dt]});return{...I,items:I.items.filter(ja)}},e[6]=d,e[7]=u,e[8]=h,e[9]=b):b=e[9];let g;e[10]!==s||e[11]!==m||e[12]!==b?(g={queryKey:m,enabled:s,queryFn:b,staleTime:1e4},e[10]=s,e[11]=m,e[12]=b,e[13]=g):g=e[13];const{data:v,isFetching:x}=f(g);let y;e[14]!==v?.items?(y=v?.items??[],e[14]=v?.items,e[15]=y):y=e[15];const j=y;let S;e[16]!==r?(S=I=>{I||a(""),r(I)},e[16]=r,e[17]=S):S=e[17];const p=S;let k;e[18]!==p||e[19]!==c?(k=I=>{p(!1),c(I.id,I.virtual_mcp_id??void 0)},e[18]=p,e[19]=c,e[20]=k):k=e[20];const T=k;let N;e[21]!==o?(N=o("tasksPanel.globalSearchDialog.title"),e[21]=o,e[22]=N):N=e[22];let w;e[23]!==N?(w=n.jsx(Yt,{children:N}),e[23]=N,e[24]=w):w=e[24];let _;e[25]!==o?(_=o("tasksPanel.globalSearchDialog.description"),e[25]=o,e[26]=_):_=e[26];let P;e[27]!==_?(P=n.jsx(Zt,{children:_}),e[27]=_,e[28]=P):P=e[28];let C;e[29]!==P||e[30]!==w?(C=n.jsxs(Qt,{className:"sr-only",children:[w,P]}),e[29]=P,e[30]=w,e[31]=C):C=e[31];let A;e[32]!==o?(A=o("tasksPanel.globalSearchDialog.placeholder"),e[32]=o,e[33]=A):A=e[33];let M;e[34]!==i||e[35]!==A?(M=n.jsx(vn,{value:i,onValueChange:a,placeholder:A}),e[34]=i,e[35]=A,e[36]=M):M=e[36];let $;e[37]!==T||e[38]!==x||e[39]!==j||e[40]!==o||e[41]!==h?($=n.jsx(pn,{children:x&&j.length===0?n.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:o("tasksPanel.globalSearchDialog.searching")}):j.length===0?n.jsx(xn,{children:o("tasksPanel.globalSearchDialog.noResults")}):n.jsx(gn,{heading:h?void 0:o("tasksPanel.globalSearchDialog.recent"),children:j.map(I=>I.type==="thread"?n.jsxs(bn,{value:`thread:${I.id}:${I.title}`,onSelect:()=>T(I),className:"gap-2.5",children:[n.jsx(ba,{virtualMcpId:I.virtual_mcp_id,size:"xs"}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx("div",{className:"text-sm text-foreground truncate",children:I.title||o("tasksPanel.globalSearchDialog.untitledChat")})}),n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(I.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${I.id}`):null)})}),e[37]=T,e[38]=x,e[39]=j,e[40]=o,e[41]=h,e[42]=$):$=e[42];let E;e[43]!==M||e[44]!==$?(E=n.jsxs(yn,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[M,$]}),e[43]=M,e[44]=$,e[45]=E):E=e[45];let F;e[46]!==C||e[47]!==E?(F=n.jsxs(Xt,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[C,E]}),e[46]=C,e[47]=E,e[48]=F):F=e[48];let R;return e[49]!==p||e[50]!==s||e[51]!==F?(R=n.jsx(Jt,{open:s,onOpenChange:p,children:F}),e[49]=p,e[50]=s,e[51]=F,e[52]=R):R=e[52],R}function ja(t){return t.type==="thread"}function Sa(t,e,s){if(!s)return;const r=t.findIndex(i=>i.id===e);if(r!==-1){for(let i=r+1;i<t.length;i++){const a=t[i];if(a?.created_by===s)return a}for(let i=r-1;i>=0;i--){const a=t[i];if(a?.created_by===s)return a}}}function ka(t){return t==="ephemeral"||t.startsWith("thread:")}function Ht(t){const e=L.c(45),{task:s,isActive:r,onClick:i,onArchive:a,showAutomationBadge:l,showAgentIcon:c,hideStatusIdle:u,indented:o}=t,d=V(),m=jn(s.status),f=m.icon,h=s.metadata?.kind==="tool_call_run",b=_t(h?void 0:s.virtual_mcp_id);let g;e[0]!==b?(g=wt(b),e[0]=b,e[1]=g):g=e[1];const v=g;on(6e4);const x=l||!!s.trigger_id,y=s.id,j="button",S=0;let p;e[2]!==i?(p=O=>{O.target===O.currentTarget&&(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),i())},e[2]=i,e[3]=p):p=e[3];const k=o?"-ml-4 pl-6":"pl-[9px]",T=r?"bg-accent text-accent-foreground":"hover:bg-accent";let N;e[4]!==k||e[5]!==T?(N=ee("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",k,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",T),e[4]=k,e[5]=T,e[6]=N):N=e[6];let w;e[7]!==h||e[8]!==c||e[9]!==b?.icon||e[10]!==b?.title?(w=c&&!h&&n.jsx(ve,{icon:b?.icon??null,name:b?.title??"?",size:"2xs"}),e[7]=h,e[8]=c,e[9]=b?.icon,e[10]=b?.title,e[11]=w):w=e[11];let _;e[12]!==x||e[13]!==d?(_=x&&n.jsx(Bt,{size:12,"aria-label":d("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-special"}),e[12]=x,e[13]=d,e[14]=_):_=e[14];let P;e[15]!==d||e[16]!==s.title?(P=s.title||d("tasksPanel.taskRow.untitledTask"),e[15]=d,e[16]=s.title,e[17]=P):P=e[17];let C;e[18]!==P?(C=n.jsx("div",{className:"text-sm text-foreground truncate",children:P}),e[18]=P,e[19]=C):C=e[19];let A;e[20]!==_||e[21]!==C?(A=n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[_,C]}),e[20]=_,e[21]=C,e[22]=A):A=e[22];let M;e[23]!==r||e[24]!==v||e[25]!==s.branch||e[26]!==s.updated_at?(M=s.updated_at&&n.jsxs("div",{className:ee("flex items-center gap-1 text-2xs min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[s.branch&&!ka(s.branch)?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate font-mono",children:s.branch}),n.jsx("span",{className:"shrink-0",children:"·"})]}):v?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"truncate",children:[v.owner,"/",v.name]}),n.jsx("span",{className:"shrink-0",children:"·"})]}):null,n.jsx("span",{className:"shrink-0",children:es(new Date(s.updated_at))})]}),e[23]=r,e[24]=v,e[25]=s.branch,e[26]=s.updated_at,e[27]=M):M=e[27];let $;e[28]!==A||e[29]!==M?($=n.jsxs("div",{className:"flex-1 min-w-0",children:[A,M]}),e[28]=A,e[29]=M,e[30]=$):$=e[30];const E="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",F=!u&&n.jsx("span",{className:ee("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",a&&"group-hover/row:opacity-0"),"aria-label":d("tasksPanel.taskRow.statusLabel",{status:d(m.labelKey)}),children:s.status==="in_progress"?n.jsx(Pe,{className:ee("size-3.5",m.iconClassName)}):n.jsx(f,{size:14,className:m.iconClassName})});let R;e[31]!==a||e[32]!==d?(R=a&&n.jsxs(Oe,{children:[n.jsx(Fe,{asChild:!0,children:n.jsx(qe,{variant:"ghost",size:"icon","aria-label":d("tasksPanel.taskRow.archiveTask"),onClick:O=>{O.stopPropagation(),a()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto text-muted-foreground",children:n.jsx(ts,{className:"size-3.5"})})}),n.jsx(Re,{side:"right",children:d("tasksPanel.taskRow.archive")})]}),e[31]=a,e[32]=d,e[33]=R):R=e[33];let I;e[34]!==F||e[35]!==R?(I=n.jsxs("div",{className:E,children:[F,R]}),e[34]=F,e[35]=R,e[36]=I):I=e[36];let B;return e[37]!==i||e[38]!==$||e[39]!==I||e[40]!==p||e[41]!==N||e[42]!==w||e[43]!==s.id?(B=n.jsxs("div",{"data-task-id":y,role:j,tabIndex:S,onClick:i,onKeyDown:p,className:N,children:[w,$,I]}),e[37]=i,e[38]=$,e[39]=I,e[40]=p,e[41]=N,e[42]=w,e[43]=s.id,e[44]=B):B=e[44],B}const ut=["requires_action","in_progress","failed","expired","completed"];function Ta(t){const e=new Map(ut.map(s=>[s,[]]));for(const s of t){const r=s.status??"completed";(e.get(r)??e.get("completed")).push(s)}return ut.map(s=>({status:s,threads:e.get(s)}))}const Na="sidebar.group.expanded.";function _a(t,e){const s=L.c(3),[r,i]=gt(`${Na}${t}`,e);let a;return s[0]!==r||s[1]!==i?(a=[r,i],s[0]=r,s[1]=i,s[2]=a):a=s[2],a}function Kt(t){const e=L.c(18),{onClick:s,isFetching:r,indented:i}=t,a=V();let l;e[0]!==a?(l=a("sidebar.showMoreButton.ariaLabel"),e[0]=a,e[1]=l):l=e[1];const c=i?"-ml-4 pl-6 pr-2":"px-2";let u;e[2]!==c?(u=ee("flex items-center gap-2 py-1.5 rounded-lg text-sm text-muted-foreground",c,"hover:bg-sidebar-accent hover:text-foreground focus-ring","transition-colors disabled:cursor-progress disabled:opacity-60"),e[2]=c,e[3]=u):u=e[3];let o;e[4]!==r?(o=r&&n.jsx(Pe,{className:"size-3.5"}),e[4]=r,e[5]=o):o=e[5];let d;e[6]!==r||e[7]!==a?(d=a(r?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=r,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==d?(m=n.jsx("span",{children:d}),e[9]=d,e[10]=m):m=e[10];let f;return e[11]!==r||e[12]!==s||e[13]!==l||e[14]!==u||e[15]!==o||e[16]!==m?(f=n.jsxs("button",{type:"button","aria-label":l,onClick:s,disabled:r,className:u,children:[o,m]}),e[11]=r,e[12]=s,e[13]=l,e[14]=u,e[15]=o,e[16]=m,e[17]=f):f=e[17],f}function wa(t,e,s,r){return[t,e,s,r.type,r.member,r.currentUserId??""].join("|")}function Ca(t){return t.member==="mine"&&!t.currentUserId}const Vt=4;let Te=0;const Ve=[];function Pa(){for(;Te<Vt&&Ve.length>0;){const t=Ve.shift();t&&t()}}function Ut(t){return new Promise((e,s)=>{const r=()=>{Te++,t().then(e,s).finally(()=>{Te--,Pa()})};Te<Vt?r():Ve.push(r)})}const Be=10;function ft(t,e,s,r,i){const a={hidden:!1};r.member==="mine"&&r.currentUserId&&(a.created_by=r.currentUserId),r.type==="automation"&&(a.has_trigger=!0),r.type==="manual"&&(a.has_trigger=!1);const l={where:a,limit:i,offset:s,orderBy:[{field:["updated_at"],direction:"desc"}]};return l.status=e,l}function Ia(t,e,s,r){let i=0;for(const a of t)qt(a,e,s,r)&&i++;return i}function He(t,e,s,r){return Ia(t,e,s,r)}function Ma(t,e){return!!(t>=Be||t===0&&e)}function mt(t,e){return t<e}function Aa(t,e){return e===!1?!1:e===!0?!0:t}function qt(t,e,s,r){return!(t.hidden||(t.status??"completed")!==s||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const we=new Map,ke=new Map;function La(t,e){return e?t>=Be?!0:null:!1}function ht(t){return we.get(t)}function $a(t,e){we.set(t,e)}function Ea(t,e,s){const r=we.get(t);if(r!==void 0){s(r);return}let i=ke.get(t);i||(i=Ut(e).then(a=>(we.set(t,a),ke.delete(t),a)).catch(()=>(ke.delete(t),Promise.reject(new Error("group probe failed")))),ke.set(t,i)),i.then(s,()=>s(!1))}function pt(t){const e=t,s=Array.isArray(e.items)?e.items:[];return{items:s,hasMore:e.hasMore??s.length===Be,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Fa(t,e,s,r,i){let a=0;for(const l of t)e.has(l.id)||qt(l,s,r,i)&&a++;return a}function Ra(t,e,s,r){const i=L.c(8),{org:a}=ae(),l=wa(a.id,t,e,s);let c;i[0]!==s?(c=Ca(s),i[0]=s,i[1]=c):c=i[1];const u=c,[o,d]=z.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});o.identity!==l&&d({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const m=Qe(),{threads:f,hasMore:h}=Xe(),b=He(f,t,e,s),g=Ma(b,h),v=La(b,h),x=Ce();if(o.identity===l&&o.serverHasMore===null){const T=v??ht(l);T!==void 0&&d({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:o.probeSubscribedIdentity,serverHasMore:T})}!u&&o.identity===l&&o.serverHasMore===null&&v===null&&ht(l)===void 0&&o.probeSubscribedIdentity!==l&&(d(T=>T.identity===l?{...T,isProbing:!0,probeSubscribedIdentity:l}:T),Ea(l,async()=>{const T=ft(t,e,0,s,1),N=await x.call("COLLECTION_THREADS_LIST",T),{totalCount:w}=pt(N),_=He(m.threads.get(),t,e,s);return w===void 0?!1:mt(_,w)},T=>{d(N=>N.identity!==l?N:{...N,isProbing:!1,serverHasMore:T})}));const j=async function(){if(o.isFetching||o.isProbing||u)return;const N=l;d(w=>w.identity===N?{...w,isFetching:!0}:w);try{const w=He(f,t,e,s),_=ft(t,e,w,s,Be),P=await Ut(()=>x.call("COLLECTION_THREADS_LIST",_)),{items:C,hasMore:A,totalCount:M}=pt(P),$=new Set(f.map(Oa)),E=Fa(C,$,t,e,s),F=w;m.mergeThreads(C),d(R=>{if(R.identity!==N)return R;let I;return M!==void 0?I=mt(F+E,M):I=C.length===0||E===0?!1:A,$a(N,I),{...R,isFetching:!1,serverHasMore:I}})}catch(w){const _=w,P=_ instanceof Error?_.message:String(_);ss.error(`Could not load more tasks: ${P}`),d(C=>C.identity===N?{...C,isFetching:!1}:C)}},S=o.isFetching||o.isProbing,p=!u&&!S&&Aa(g,o.serverHasMore);let k;return i[2]!==S||i[3]!==j||i[4]!==p||i[5]!==o.isProbing||i[6]!==o.serverHasMore?(k={hasMore:p,isFetching:S,isProbing:o.isProbing,serverHasMore:o.serverHasMore,loadMore:j},i[2]=S,i[3]=j,i[4]=p,i[5]=o.isProbing,i[6]=o.serverHasMore,i[7]=k):k=i[7],k}function Oa(t){return t.id}function Ba(t){const e=L.c(20),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:l,canArchive:c,filters:u}=t,{isFetching:o,isProbing:d,loadMore:m,hasMore:f,serverHasMore:h}=Ra("status",s,u),[b,g]=z.useState(!1);!b&&r.length===0&&h===!0&&!o&&!d&&(g(!0),queueMicrotask(()=>{m()}));let v;if(e[0]!==i||e[1]!==c||e[2]!==u||e[3]!==l||e[4]!==a||e[5]!==r){let j;e[7]!==i||e[8]!==c||e[9]!==u||e[10]!==l||e[11]!==a?(j=S=>n.jsx(Ht,{task:S,isActive:i===S.id,onClick:()=>a(S),onArchive:c&&S.created_by===u.currentUserId?()=>l(S):void 0,showAutomationBadge:!!S.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},S.id),e[7]=i,e[8]=c,e[9]=u,e[10]=l,e[11]=a,e[12]=j):j=e[12],v=r.map(j),e[0]=i,e[1]=c,e[2]=u,e[3]=l,e[4]=a,e[5]=r,e[6]=v}else v=e[6];let x;e[13]!==f||e[14]!==o||e[15]!==m?(x=(f||o)&&n.jsx(Kt,{onClick:()=>{m()},isFetching:o,indented:!0}),e[13]=f,e[14]=o,e[15]=m,e[16]=x):x=e[16];let y;return e[17]!==v||e[18]!==x?(y=n.jsxs(n.Fragment,{children:[v,x]}),e[17]=v,e[18]=x,e[19]=y):y=e[19],y}function Da(t){const e=L.c(43),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:l,canArchive:c,filters:u}=t,o=V(),d=Sn[s],m=d.icon,[f,h]=_a(`status-${s}`,!1);let b;e[0]!==f||e[1]!==h?(b=function(){h(!f)},e[0]=f,e[1]=h,e[2]=b):b=e[2];const g=b;let v;e[3]!==d.labelKey||e[4]!==o?(v=o("sidebar.taskGroupsList.toggleStatusGroup",{status:o(d.labelKey)}),e[3]=d.labelKey,e[4]=o,e[5]=v):v=e[5];let x;e[6]!==g?(x=P=>{P.target===P.currentTarget&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),g())},e[6]=g,e[7]=x):x=e[7];let y;e[8]!==m||e[9]!==d.iconClassName?(y=n.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:n.jsx(m,{size:12,className:d.iconClassName})}),e[8]=m,e[9]=d.iconClassName,e[10]=y):y=e[10];let j;e[11]!==f?(j=n.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:f?n.jsx(Ze,{size:14}):n.jsx(ns,{size:14})}),e[11]=f,e[12]=j):j=e[12];let S;e[13]!==y||e[14]!==j?(S=n.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[y,j]}),e[13]=y,e[14]=j,e[15]=S):S=e[15];let p;e[16]!==d.labelKey||e[17]!==o?(p=o(d.labelKey),e[16]=d.labelKey,e[17]=o,e[18]=p):p=e[18];let k;e[19]!==p?(k=n.jsx("span",{className:"flex-1 truncate",children:p}),e[19]=p,e[20]=k):k=e[20];let T;e[21]!==r.length?(T=n.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:n.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[21]=r.length,e[22]=T):T=e[22];let N;e[23]!==f||e[24]!==g||e[25]!==v||e[26]!==x||e[27]!==S||e[28]!==k||e[29]!==T?(N=n.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":f,"aria-label":v,onClick:g,onKeyDown:x,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-lg text-sm font-medium text-foreground cursor-pointer hover:bg-sidebar-accent focus-ring transition-colors",children:[S,k,T]}),e[23]=f,e[24]=g,e[25]=v,e[26]=x,e[27]=S,e[28]=k,e[29]=T,e[30]=N):N=e[30];let w;e[31]!==i||e[32]!==c||e[33]!==f||e[34]!==u||e[35]!==l||e[36]!==a||e[37]!==s||e[38]!==r?(w=f&&n.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:n.jsx(Ba,{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:l,canArchive:c,filters:u})}),e[31]=i,e[32]=c,e[33]=f,e[34]=u,e[35]=l,e[36]=a,e[37]=s,e[38]=r,e[39]=w):w=e[39];let _;return e[40]!==N||e[41]!==w?(_=n.jsxs("div",{className:"flex flex-col gap-0.5",children:[N,w]}),e[40]=N,e[41]=w,e[42]=_):_=e[42],_}function za(t){const e=L.c(41),{threads:s,groupBy:r,activeTaskId:i,onSelectTask:a,onArchiveTask:l,filters:c,hasMore:u,isFetchingMore:o,onLoadMore:d,filtersActive:m}=t,f=V();if(s.length===0&&!u&&!o){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(xs,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];let y;e[1]!==m||e[2]!==f?(y=f(m?"sidebar.myThreadsSection.noChatsMatchFilters":"sidebar.myThreadsSection.noChatsYet"),e[1]=m,e[2]=f,e[3]=y):y=e[3];let j;return e[4]!==y?(j=n.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,n.jsx("p",{className:"text-sm",children:y})]}),e[4]=y,e[5]=j):j=e[5],j}const h=s.length>1||u;if(r==="status"){let x;if(e[6]!==i||e[7]!==h||e[8]!==c||e[9]!==l||e[10]!==a||e[11]!==s){let j;e[13]!==i||e[14]!==h||e[15]!==c||e[16]!==l||e[17]!==a?(j=S=>n.jsx(Da,{status:S.status,threads:S.threads,activeTaskId:i,onSelectTask:a,onArchiveTask:l,canArchive:h,filters:c},S.status),e[13]=i,e[14]=h,e[15]=c,e[16]=l,e[17]=a,e[18]=j):j=e[18],x=Ta(s).map(j),e[6]=i,e[7]=h,e[8]=c,e[9]=l,e[10]=a,e[11]=s,e[12]=x}else x=e[12];let y;return e[19]!==x?(y=n.jsx(n.Fragment,{children:x}),e[19]=x,e[20]=y):y=e[20],y}let b;if(e[21]!==i||e[22]!==h||e[23]!==c||e[24]!==l||e[25]!==a||e[26]!==s){let x;e[28]!==i||e[29]!==h||e[30]!==c||e[31]!==l||e[32]!==a?(x=y=>n.jsx(Ht,{task:y,isActive:i===y.id,onClick:()=>a(y),onArchive:h&&y.created_by===c.currentUserId?()=>l(y):void 0,showAutomationBadge:!!y.trigger_id,showAgentIcon:!0},y.id),e[28]=i,e[29]=h,e[30]=c,e[31]=l,e[32]=a,e[33]=x):x=e[33],b=s.map(x),e[21]=i,e[22]=h,e[23]=c,e[24]=l,e[25]=a,e[26]=s,e[27]=b}else b=e[27];let g;e[34]!==u||e[35]!==o||e[36]!==d?(g=(u||o)&&n.jsx(Kt,{onClick:d,isFetching:o}),e[34]=u,e[35]=o,e[36]=d,e[37]=g):g=e[37];let v;return e[38]!==b||e[39]!==g?(v=n.jsxs(n.Fragment,{children:[b,g]}),e[38]=b,e[39]=g,e[40]=v):v=e[40],v}function Ga(t){const e=L.c(11),{panel:s}=t;let r;return e[0]!==s.activeTaskId||e[1]!==s.archiveTask||e[2]!==s.filters||e[3]!==s.filtersActive||e[4]!==s.groupBy||e[5]!==s.hasMore||e[6]!==s.isFetchingMore||e[7]!==s.loadMore||e[8]!==s.selectTask||e[9]!==s.threads?(r=n.jsx(za,{threads:s.threads,groupBy:s.groupBy,activeTaskId:s.activeTaskId,onSelectTask:s.selectTask,onArchiveTask:s.archiveTask,filters:s.filters,hasMore:s.hasMore,isFetchingMore:s.isFetchingMore,onLoadMore:s.loadMore,filtersActive:s.filtersActive}),e[0]=s.activeTaskId,e[1]=s.archiveTask,e[2]=s.filters,e[3]=s.filtersActive,e[4]=s.groupBy,e[5]=s.hasMore,e[6]=s.isFetchingMore,e[7]=s.loadMore,e[8]=s.selectTask,e[9]=s.threads,e[10]=r):r=e[10],r}function Ha(t){const e=L.c(67);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{onNavigate:r}=s,{data:i}=pe.useSession(),a=i?.user?.id,{org:l}=ae();let c;e[2]!==l.id?(c=ye(l.id),e[2]=l.id,e[3]=c):c=e[3];const u=c.id,o=ga(),d=Nt(),{threads:m,hasMore:f,isFetchingMore:h,fetchNextPage:b}=Xe(),g=m.filter(qa),{hide:v,setScope:x}=Mt(),y=Me(),{setTaskId:j,createNewTask:S}=Je(),p=Rt(),k=et();let T;e[4]!==k||e[5]!==m||e[6]!==p?(T=fn({routeAgentId:p,threadVirtualMcpId:m.find(K=>K.id===k)?.virtual_mcp_id}),e[4]=k,e[5]=m,e[6]=p,e[7]=T):T=e[7];const N=T;let w;e[8]!==r?(w=()=>{r?.()},e[8]=r,e[9]=w):w=e[9];const _=w,P=[...g].sort(Ua),[C,A]=z.useState("all"),[M,$]=z.useState("flat"),[E,F]=gt("sidebar-threads-scope-all",!1),[R,I]=z.useState(!1),[B,O]=z.useState(!1);let H;e[10]!==I?(H=()=>{he("tasks_panel_search_opened"),O(!0),I(!0)},e[10]=I,e[11]=H):H=e[11];const D=H,U=a??null;let Z;e[12]!==U||e[13]!==C?(Z={type:C,member:"mine",currentUserId:U},e[12]=U,e[13]=C,e[14]=Z):Z=e[14];const Y=Z,Q={};E||(Q.created_by="me"),x(Q);let W;e[15]!==a?(W=K=>a?K.filter(ue=>ue.created_by===a):[],e[15]=a,e[16]=W):W=e[16];const le=W;let G;e[17]!==C?(G=K=>C==="automation"?K.filter(Va):C==="manual"?K.filter(Ka):K,e[17]=C,e[18]=G):G=e[18];const re=G,X=xa(re(E?P:le(P)),k);let J;e[19]!==k||e[20]!==_||e[21]!==a||e[22]!==v||e[23]!==y||e[24]!==l.slug||e[25]!==j||e[26]!==X?(J=K=>{if(a&&K.created_by&&K.created_by!==a)return;const ue=K.id===k;if(v(K.id),cn(K.id),!ue)return;const ge=Sa(X,K.id,a);_(),ge?j(ge.id,ge.virtual_mcp_id):y({to:"/$org",params:{org:l.slug}})},e[19]=k,e[20]=_,e[21]=a,e[22]=v,e[23]=y,e[24]=l.slug,e[25]=j,e[26]=X,e[27]=J):J=e[27];const te=J;let ne;e[28]!==_||e[29]!==j?(ne=K=>{_(),j(K.id,K.virtual_mcp_id)},e[28]=_,e[29]=j,e[30]=ne):ne=e[30];const ie=ne;let se;e[31]!==N||e[32]!==k||e[33]!==m||e[34]!==_||e[35]!==S||e[36]!==a||e[37]!==u||e[38]!==o||e[39]!==d||e[40]!==j?(se=()=>{const K=N??u;he("sidebar_new_thread_clicked",{virtual_mcp_id:K}),_();const ue=Zs(m,K,a,o(K));if(ue){j(ue.id,ue.virtual_mcp_id,{newThread:!0});return}const ge=d?null:m.find(Wt=>Wt.id===k)?.branch??null;S(K,ge)},e[31]=N,e[32]=k,e[33]=m,e[34]=_,e[35]=S,e[36]=a,e[37]=u,e[38]=o,e[39]=d,e[40]=j,e[41]=se):se=e[41];const oe=se;let ce;e[42]!==b?(ce=()=>{b()},e[42]=b,e[43]=ce):ce=e[43];const xe=M!=="flat"||C!=="all"||E;let de;e[44]!==B||e[45]!==R||e[46]!==I?(de=B?n.jsx(ya,{open:R,onOpenChange:I}):null,e[44]=B,e[45]=R,e[46]=I,e[47]=de):de=e[47];let Se;return e[48]!==k||e[49]!==te||e[50]!==Y||e[51]!==M||e[52]!==f||e[53]!==h||e[54]!==oe||e[55]!==D||e[56]!==ie||e[57]!==$||e[58]!==F||e[59]!==A||e[60]!==E||e[61]!==ce||e[62]!==xe||e[63]!==de||e[64]!==C||e[65]!==X?(Se={threads:X,activeTaskId:k,filters:Y,hasMore:f,isFetchingMore:h,loadMore:ce,groupBy:M,setGroupBy:$,typeFilter:C,setTypeFilter:A,showAll:E,setShowAll:F,filtersActive:xe,selectTask:ie,archiveTask:te,newThread:oe,openSearch:D,searchDialog:de},e[48]=k,e[49]=te,e[50]=Y,e[51]=M,e[52]=f,e[53]=h,e[54]=oe,e[55]=D,e[56]=ie,e[57]=$,e[58]=F,e[59]=A,e[60]=E,e[61]=ce,e[62]=xe,e[63]=de,e[64]=C,e[65]=X,e[66]=Se):Se=e[66],Se}function Ka(t){return!t.trigger_id}function Va(t){return!!t.trigger_id}function Ua(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function qa(t){return!t.hidden}function Wa(){const t=L.c(59),e=V(),[s,r]=z.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={onNavigate:()=>r(!1)},t[0]=i):i=t[0];const a=Ha(i),l=Le()?.activeTask;let c;t[1]!==l?.title||t[2]!==a.activeTaskId||t[3]!==a.threads||t[4]!==e?(c=l?.title||a.threads.find(R=>R.id===a.activeTaskId)?.title||e("tasksPanel.taskRow.untitledTask"),t[1]=l?.title,t[2]=a.activeTaskId,t[3]=a.threads,t[4]=e,t[5]=c):c=t[5];const u=c;let o;t[6]!==a?(o=()=>{r(!1),a.openSearch()},t[6]=a,t[7]=o):o=t[7];const d=o;let m;t[8]!==e?(m=e("chat.threadsMenu.chats"),t[8]=e,t[9]=m):m=t[9];const f=s&&"bg-sidebar-accent";let h;t[10]!==f?(h=ee("flex h-[34px] min-w-0 shrink items-center gap-1.5 rounded-lg px-2 text-sm text-foreground transition-colors hover:bg-accent focus-ring",f),t[10]=f,t[11]=h):h=t[11];let b;t[12]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(gs,{size:16,className:"shrink-0"}),t[12]=b):b=t[12];let g;t[13]!==u?(g=n.jsx("span",{className:"truncate max-w-[10rem] font-medium",children:u}),t[13]=u,t[14]=g):g=t[14];let v;t[15]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ze,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[15]=v):v=t[15];let x;t[16]!==m||t[17]!==h||t[18]!==g?(x=n.jsx(Fe,{asChild:!0,children:n.jsx($t,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":m,className:h,children:[b,g,v]})})}),t[16]=m,t[17]=h,t[18]=g,t[19]=x):x=t[19];let y;t[20]!==e?(y=e("chat.threadsMenu.chats"),t[20]=e,t[21]=y):y=t[21];let j;t[22]!==y?(j=n.jsx(Re,{side:"bottom",children:y}),t[22]=y,t[23]=j):j=t[23];let S;t[24]!==j||t[25]!==x?(S=n.jsxs(Oe,{children:[x,j]}),t[24]=j,t[25]=x,t[26]=S):S=t[26];let p;t[27]!==a?(p=n.jsx(pa,{panel:a,className:"size-8"}),t[27]=a,t[28]=p):p=t[28];let k;t[29]!==e?(k=e("sidebar.taskGroupsList.searchChats"),t[29]=e,t[30]=k):k=t[30];let T;t[31]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(bs,{size:16}),t[31]=T):T=t[31];let N;t[32]!==d||t[33]!==k?(N=n.jsx(Ne,{"aria-label":k,onClick:d,className:"size-8",children:T}),t[32]=d,t[33]=k,t[34]=N):N=t[34];let w;t[35]!==e?(w=e("sidebar.taskGroupsList.newChat"),t[35]=e,t[36]=w):w=t[36];let _;t[37]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(yt,{size:16}),t[37]=_):_=t[37];let P;t[38]!==a.newThread||t[39]!==w?(P=n.jsx(Ne,{"aria-label":w,onClick:a.newThread,className:"size-8",children:_}),t[38]=a.newThread,t[39]=w,t[40]=P):P=t[40];let C;t[41]!==N||t[42]!==P?(C=n.jsxs("div",{className:"flex items-center gap-0.5",children:[N,P]}),t[41]=N,t[42]=P,t[43]=C):C=t[43];let A;t[44]!==p||t[45]!==C?(A=n.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[p,C]}),t[44]=p,t[45]=C,t[46]=A):A=t[46];let M;t[47]!==a?(M=n.jsx("div",{className:"flex max-h-[60vh] min-h-0 flex-col gap-0.5 overflow-y-auto overscroll-contain",children:n.jsx(Ga,{panel:a})}),t[47]=a,t[48]=M):M=t[48];let $;t[49]!==A||t[50]!==M?($=n.jsxs(Et,{align:"start",side:"bottom",onOpenAutoFocus:Ya,className:"flex w-80 flex-col gap-2 p-2",children:[A,M]}),t[49]=A,t[50]=M,t[51]=$):$=t[51];let E;t[52]!==s||t[53]!==S||t[54]!==$?(E=n.jsxs(Ft,{open:s,onOpenChange:r,children:[S,$]}),t[52]=s,t[53]=S,t[54]=$,t[55]=E):E=t[55];let F;return t[56]!==a.searchDialog||t[57]!==E?(F=n.jsxs(n.Fragment,{children:[E,a.searchDialog]}),t[56]=a.searchDialog,t[57]=E,t[58]=F):F=t[58],F}function Ya(t){return t.preventDefault()}function Za(){const t=L.c(20),e=V(),{threads:s}=Xe(),{createNewTask:r}=Je(),i=Ot(),a=et();let l;t[0]!==a||t[1]!==s?(l=s.find(v=>v.id===a)?.branch??null,t[0]=a,t[1]=s,t[2]=l):l=t[2];const c=l;let u;t[3]!==i||t[4]!==r||t[5]!==c?(u=()=>{r(i,c)},t[3]=i,t[4]=r,t[5]=c,t[6]=u):u=t[6];const o=u;let d;t[7]!==e?(d=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=d):d=t[8];let m;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(yt,{size:16}),t[9]=m):m=t[9];let f;t[10]!==o||t[11]!==d?(f=n.jsx(Fe,{asChild:!0,children:n.jsx("button",{type:"button",onClick:o,"aria-label":d,className:"flex shrink-0 items-center rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-ring",children:m})}),t[10]=o,t[11]=d,t[12]=f):f=t[12];let h;t[13]!==e?(h=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=h):h=t[14];let b;t[15]!==h?(b=n.jsx(Re,{side:"bottom",children:h}),t[15]=h,t[16]=b):b=t[16];let g;return t[17]!==f||t[18]!==b?(g=n.jsxs(Oe,{children:[f,b]}),t[17]=f,t[18]=b,t[19]=g):g=t[19],g}function Qa(t){const e=L.c(16),{virtualMcpId:s,taskId:r}=t,{openPanel:i}=Dt();let a;e[0]!==r||e[1]!==s?(a={virtualMcpId:s,taskId:r},e[0]=r,e[1]=s,e[2]=a):a=e[2];const{tabs:l,activeTab:c,mainOpen:u}=zt(a);if(l.length===0)return null;let o;if(e[3]!==c||e[4]!==u||e[5]!==i||e[6]!==l||e[7]!==s){let m;e[9]!==c||e[10]!==u||e[11]!==i||e[12]!==s?(m=f=>{const h=f.id==="automations"?as({activeTab:c,mainOpen:u}):u&&f.id===c;return n.jsxs(st.Tab,{active:h,onClick:()=>{h||(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:f.id,tab_kind:f.kind,was_active:!1}),i(f.id))},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(_e,{icon:f.icon})}),f.title]},f.id)},e[9]=c,e[10]=u,e[11]=i,e[12]=s,e[13]=m):m=e[13],o=l.map(m),e[3]=c,e[4]=u,e[5]=i,e[6]=l,e[7]=s,e[8]=o}else o=e[8];let d;return e[14]!==o?(d=n.jsx(st.Tabs,{"data-tour":dn.surfaceTabs,children:o}),e[14]=o,e[15]=d):d=e[15],d}function Xa(t){return{threadId:t.routeThreadId,providerKey:t.routeThreadId??t.fallbackKey}}const Ke="__mobile-main-panel-tab-select__",Ue="main";function Ja({tabs:t,activeTab:e,mainOpen:s,t:r}){const i=t.find(l=>l.id===e),a=r("mainPanelTabs.mobileMainPanelTabSelect.mainView");return s?i?.title??a:i?.title??t[0]?.title??a}const er={kind:"component",Component:vs},tr={kind:"component",Component:ys},sr={kind:"component",Component:js},nr={kind:"component",Component:Tn};function ar({tabs:t,overlayEnabled:e,t:s}){return[{value:"chat",title:s("mainPanelTabs.mobileMainPanelTabSelect.chat"),icon:er},...t.length>0?t.map(r=>({value:r.id,title:r.title,icon:r.icon})):[{value:Ue,title:s("mainPanelTabs.mobileMainPanelTabSelect.mainView"),icon:nr}],...e?[{value:"board",title:s("mainPanelTabs.mobileMainPanelTabSelect.tasks"),icon:tr},{value:"files",title:s("mainPanelTabs.mobileMainPanelTabSelect.library"),icon:sr}]:[]]}function rr(t){const e=L.c(53),{virtualMcpId:s,taskId:r}=t,i=V(),a=Me(),{openPanel:l}=Dt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const u=je(c);let o;e[1]!==r||e[2]!==s?(o={virtualMcpId:s,taskId:r},e[1]=r,e[2]=s,e[3]=o):o=e[3];const{tabs:d,activeTab:m,mainOpen:f}=zt(o),{org:h}=ae(),b=Is();let g;e[4]!==h.id?(g=nt(h.id),e[4]=h.id,e[5]=g):g=e[5];const v=s===g;let x,y,j,S,p,k,T,N,w,_;if(e[6]!==m||e[7]!==f||e[8]!==a||e[9]!==v||e[10]!==l||e[11]!==h.id||e[12]!==u.org||e[13]!==u.taskId||e[14]!==b||e[15]!==i||e[16]!==d||e[17]!==s){S=Symbol.for("react.early_return_sentinel");e:{const A=ar({tabs:d,overlayEnabled:!!(u.org&&u.taskId),t:i}),M=f?A.find(D=>D.value===m)?.value??Ue:"chat",$=A.find(D=>D.value===M),E=$?.title??Ja({tabs:d,activeTab:m,mainOpen:f,t:i});let F;e[28]!==a?(F=D=>{a({to:".",search:U=>({...U,...nn(D)}),replace:!0})},e[28]=a,e[29]=F):F=e[29];const R=F;let I;e[30]!==v||e[31]!==l||e[32]!==h.id||e[33]!==b||e[34]!==R||e[35]!==s?(I=D=>{if(D!==Ke){if(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:D,source:"mobile_select"}),un({reportsOnly:b,onReportAgent:v,tabId:D})){l(D,{virtualmcpid:nt(h.id),search:or});return}if(D==="chat"||D===Ue){R(D==="chat"?"chat":"main");return}l(D,{search:lr})}},e[30]=v,e[31]=l,e[32]=h.id,e[33]=b,e[34]=R,e[35]=s,e[36]=I):I=e[36];const B=I,O=A.find(D=>D.value!==M);if(A.length===2&&O){S=n.jsxs("button",{type:"button",onClick:()=>B(O.value),"aria-label":i("mainPanelTabs.mobileMainPanelTabSelect.switchTo",{name:O.title}),className:"flex h-10 min-w-0 max-w-[7.5rem] items-center gap-1.5 rounded-lg px-1.5 text-xs text-foreground transition-colors hover:bg-accent focus-ring",children:[n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(_e,{icon:O.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:O.title})]});break e}y=_n,w=Ke,_=B;let H;e[37]!==i?(H=i("mainPanelTabs.mobileMainPanelTabSelect.view"),e[37]=i,e[38]=H):H=e[38],j=n.jsx(Nn,{"aria-label":H,className:"h-10! w-full min-w-0 max-w-[7.5rem] rounded-lg border-0 bg-transparent px-1.5 text-xs shadow-none [--shadow-edge:none]",children:n.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[$&&n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(_e,{icon:$.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:E})]})}),x=wn,p="end",k="w-56",e[39]!==E?(T=n.jsx(Gt,{value:Ke,disabled:!0,hideCheck:!0,className:"hidden",children:E}),e[39]=E,e[40]=T):T=e[40],N=A.map(ir)}e[6]=m,e[7]=f,e[8]=a,e[9]=v,e[10]=l,e[11]=h.id,e[12]=u.org,e[13]=u.taskId,e[14]=b,e[15]=i,e[16]=d,e[17]=s,e[18]=x,e[19]=y,e[20]=j,e[21]=S,e[22]=p,e[23]=k,e[24]=T,e[25]=N,e[26]=w,e[27]=_}else x=e[18],y=e[19],j=e[20],S=e[21],p=e[22],k=e[23],T=e[24],N=e[25],w=e[26],_=e[27];if(S!==Symbol.for("react.early_return_sentinel"))return S;let P;e[41]!==x||e[42]!==p||e[43]!==k||e[44]!==T||e[45]!==N?(P=n.jsxs(x,{align:p,className:k,children:[T,N]}),e[41]=x,e[42]=p,e[43]=k,e[44]=T,e[45]=N,e[46]=P):P=e[46];let C;return e[47]!==y||e[48]!==j||e[49]!==P||e[50]!==w||e[51]!==_?(C=n.jsxs(y,{value:w,onValueChange:_,children:[j,P]}),e[47]=y,e[48]=j,e[49]=P,e[50]=w,e[51]=_,e[52]=C):C=e[52],C}function ir(t){return n.jsx(Gt,{value:t.value,children:n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(_e,{icon:t.icon})}),n.jsx("span",{className:"min-w-0 truncate",children:t.title})]})},t.value)}function lr(t){return{...t,sidepanel:!1}}function or(t){return{...t,thread:void 0,sidepanel:!1}}function cr(){const t=L.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={select:dr},t[0]=e):e=t[0];const s=bt(e);if(!s)return!1;let r;return t[1]!==s?(r=s==="app"||Pn.includes(s),t[1]=s,t[2]=r):r=t[2],r}function dr(t){const{staticData:e}=t.matches.findLast(ur)??{};return e?.siteEditorView?"site-editor":e?.mainView}function ur(t){return t.staticData.mainView}function fr(t,e,s){const r=L.c(33),i=Qe(),{locator:a}=ae(),l=z.useSyncExternalStore(i.threads.subscribe,i.threads.get),c=z.useSyncExternalStore(i.threadsStatus.subscribe,i.threadsStatus.get);let u;r[0]!==t||r[1]!==l?(u=t===null?null:l.find(p=>p.id===t&&!p.partial)??null,r[0]=t,r[1]=l,r[2]=u):u=r[2];const o=u,[d,m]=z.useState(void 0),[f,h]=z.useState(t);f!==t&&(h(t),m(void 0));let b,g;r[3]!==d||r[4]!==t||r[5]!==o||r[6]!==i||r[7]!==c.kind?(b=()=>{t!==null&&(o||c.kind!=="loading"&&d===void 0&&(m("pending"),i.fetchThreadIntoSlot(t).then(p=>{m(p)})))},g=[t,o,c.kind,d,i],r[3]=d,r[4]=t,r[5]=o,r[6]=i,r[7]=c.kind,r[8]=b,r[9]=g):(b=r[8],g=r[9]),z.useEffect(b,g);let v;r[10]!==s||r[11]!==a||r[12]!==i||r[13]!==e?(v={mutationFn:async p=>i.create({id:p,virtual_mcp_id:e,...s?{branch:s}:{},...Ys(sessionStorage,a,p)})},r[10]=s,r[11]=a,r[12]=i,r[13]=e,r[14]=v):v=r[14];const x=rs(v);let y,j;if(r[15]!==x||r[16]!==d||r[17]!==t||r[18]!==o||r[19]!==c.kind?(y=()=>{t!==null&&(o||d===null&&c.kind!=="loading"&&(x.isPending||x.variables!==t&&x.mutate(t)))},j=[t,o,d,c.kind,x],r[15]=x,r[16]=d,r[17]=t,r[18]=o,r[19]=c.kind,r[20]=y,r[21]=j):(y=r[20],j=r[21]),z.useEffect(y,j),t===null){let p;return r[22]===Symbol.for("react.memo_cache_sentinel")?(p={status:"ready",task:null},r[22]=p):p=r[22],p}if(o){let p;return r[23]!==o?(p={status:"ready",task:o},r[23]=o,r[24]=p):p=r[24],p}if(d&&typeof d=="object"){let p;return r[25]!==d?(p={status:"ready",task:d},r[25]=d,r[26]=p):p=r[26],p}if(x.data){let p;return r[27]!==x.data?(p={status:"ready",task:x.data},r[27]=x.data,r[28]=p):p=r[28],p}if(x.isError){let p;return r[29]!==x.error?(p={status:"error",error:x.error},r[29]=x.error,r[30]=p):p=r[30],p}if(x.isPending||c.kind!=="loading"){let p;return r[31]===Symbol.for("react.memo_cache_sentinel")?(p={status:"creating"},r[31]=p):p=r[31],p}let S;return r[32]===Symbol.for("react.memo_cache_sentinel")?(S={status:"loading"},r[32]=S):S=r[32],S}const mr=50;function hr(t,e){const s=L.c(15),{org:r}=ae(),i=Ce(),{data:a}=pe.useSession(),l=a?.user?.id??"";let c;s[0]!==r.id||s[1]!==l||s[2]!==t?(c=fe.agentEntryThreads(r.id,l,t),s[0]=r.id,s[1]=l,s[2]=t,s[3]=c):c=s[3];const u=e&&!!l;let o;s[4]!==i||s[5]!==t?(o=async()=>{try{return(await i.call("COLLECTION_THREADS_LIST",{limit:mr,offset:0,orderBy:[{field:["updated_at"],direction:"desc"}],where:{hidden:!1,created_by:"me",virtual_mcp_id:t}})).items}catch{return[]}},s[4]=i,s[5]=t,s[6]=o):o=s[6];let d;s[7]!==c||s[8]!==u||s[9]!==o?(d={queryKey:c,enabled:u,staleTime:0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,queryFn:o},s[7]=c,s[8]=u,s[9]=o,s[10]=d):d=s[10];const m=me(d);if(!e||!l){let h;return s[11]===Symbol.for("react.memo_cache_sentinel")?(h={status:"idle"},s[11]=h):h=s[11],h}if(!m.data||m.isFetching){let h;return s[12]===Symbol.for("react.memo_cache_sentinel")?(h={status:"loading"},s[12]=h):h=s[12],h}let f;return s[13]!==m.data?(f={status:"ready",threads:m.data},s[13]=m.data,s[14]=f):f=s[14],f}function pr(t){const e=L.c(13),{children:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=je(r);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const l=Ae(a);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={select:xr},e[2]=c):c=e[2];const u=bt(c),{org:o}=ae();let d;e[3]!==o||e[4]!==i.agentId||e[5]!==i.legacyView||e[6]!==i.org||e[7]!==u||e[8]!==l?(d=i.org?is({pathname:u,org:i.org,pathAgentId:i.agentId,pathLegacyView:i.legacyView,fallbackAgentId:ye(o.id).id,search:l}):null,e[3]=o,e[4]=i.agentId,e[5]=i.legacyView,e[6]=i.org,e[7]=u,e[8]=l,e[9]=d):d=e[9];const m=d;let f;return e[10]!==s||e[11]!==m?(f=m?n.jsx(tt,{target:m}):s,e[10]=s,e[11]=m,e[12]=f):f=e[12],f}function xr(t){return t.matches.at(-1)?.pathname??t.location.pathname}function gr(){const t=L.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=je(e);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[1]=r):r=t[1];const i=Ae(r),{org:a}=ae(),{org:l,taskId:c}=s;if(!l||c===void 0)return null;let u;return t[2]!==l||t[3]!==a.id||t[4]!==i||t[5]!==c?(u=ls({org:l,taskId:c,fallbackAgentId:ye(a.id).id,search:i}),t[2]=l,t[3]=a.id,t[4]=i,t[5]=c,t[6]=u):u=t[6],u}function br(){const t=L.c(2),e=gr();let s;return t[0]!==e?(s=e?n.jsx(tt,{target:e}):null,t[0]=e,t[1]=s):s=t[1],s}function vr(){const t=L.c(6),e=Mn(),s=Me();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{preview:i}=Ae(r);if(!e||!i)return null;let a;t[1]!==s?(a=()=>s({to:".",search:yr}),t[1]=s,t[2]=a):a=t[2];let l;return t[3]!==i||t[4]!==a?(l=n.jsx(An,{previewPath:i,onClose:a,showSeeInLibrary:!0}),t[3]=i,t[4]=a,t[5]=l):l=t[5],l}function yr(t){const{preview:e,...s}=t;return s}function jr(t){const e=L.c(11),{children:s}=t,r=V();let i;e[0]!==r?(i=r("agentShellLayout.agentShellLayout.chatLoadingError"),e[0]=r,e[1]=i):i=e[1];let a;e[2]!==i?(a=n.jsx("div",{role:"alert",className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:i}),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==s?(l=s??n.jsx(fa,{}),e[4]=s,e[5]=l):l=e[5];let c;e[6]!==l?(c=n.jsx(Ie,{children:l}),e[6]=l,e[7]=c):c=e[7];let u;return e[8]!==a||e[9]!==c?(u=n.jsx(xt,{fallback:a,children:c}),e[8]=a,e[9]=c,e[10]=u):u=e[10],u}function Sr(t){const e=L.c(6),{threadId:s,providerKey:r,children:i}=t;let a;e[0]!==r||e[1]!==s?(a=s===null?n.jsx(q.ThreadlessStreamSource,{},r):n.jsx(q.ActiveTaskStreamSource,{taskId:s},r),e[0]=r,e[1]=s,e[2]=a):a=e[2];let l;return e[3]!==i||e[4]!==a?(l=n.jsx(q.StreamHost,{source:a,children:i}),e[3]=i,e[4]=a,e[5]=l):l=e[5],l}function kr(t){const e=L.c(3),{onNewTaskRef:s,createNewTask:r}=t;let i;return e[0]!==r||e[1]!==s?(i=()=>(s.current=r,()=>{s.current=null}),e[0]=r,e[1]=s,e[2]=i):i=e[2],z.useLayoutEffect(i),null}function Tr({virtualMcpId:t,hasActiveRepository:e,sandboxMap:s,children:r}){const i=V(),{currentBranch:a,activeTask:l,setCurrentTaskBranch:c,isThreadLocked:u}=$e(),{data:o}=pe.useSession(),d=o?.user?.id,m=!ws(l?.harness_id),f=Xs({agentSandboxMap:s,threadSandboxMap:l?.metadata?.sandboxMap,userId:d,ownerId:l?.created_by,branch:a}),h=e||Gs(l?.metadata),b=z.useRef(null),g=m&&Js({threadLoaded:!!l,isOwner:!!d&&l?.created_by===d,hasActiveRepository:h,branch:a??null,attempted:b.current===(l?.id??null)});z.useEffect(()=>{!g||!l||(b.current=l.id,c(Pt(o?.user?.name||o?.user?.email?.split("@")[0])))},[g,l,o,c]);const v=St(t),x=v.resolved?v.runtime:null,y=Ee(t),j=At(y,a),{releases:S,createRelease:p,markSandbox:k}=Hs(t),T=Ks(t,it(y)),N=it(y)&&a?Vs(a,T.data):!1,w=!!d&&l?.created_by===d,_=!!x&&w&&!!a&&a!==j&&!S.some(B=>B.branch===a)&&!T.isLoading&&N!==!0,P=z.useRef(null);z.useEffect(()=>{!_||!a||!x||P.current!==a&&(P.current=a,p({branch:a,name:qs(S,i("thread.branchPicker.defaultVersionName")),color:Us(S.length),createdBy:d,createdAt:new Date().toISOString(),runtime:x}).catch(()=>{}))},[_,a,x,S,p,d,i]);const C=x==="sandbox"&&u&&w&&S.some(B=>B.branch===a&&B.runtime!=="sandbox"),[A,M]=z.useState(null);if(C&&a&&A!==a){M(a);const B=a;queueMicrotask(()=>{k(B).catch(()=>{})})}const $=en(t,a??void 0),F=(d&&a?$n(f?.[d]?.[a]):{})["agent-sandbox"]??null,R=F?.previewUrl??null,I=m&&x!=="cms"&&(!!F||$);return m?x==="cms"?n.jsx(ot,{resetKey:`${t}:${a??"no-branch"}:${l?.id??""}`,children:r}):n.jsx(Cn,{resetKey:l?.id??"no-thread",virtualMcpId:t,branch:a??null,previewUrl:R,enabled:I,children:n.jsx(tn,{resetKey:l?.id??"no-thread",executionEnabled:m,virtualMcpId:t,branch:a??null,userId:d??null,hasActiveRepository:h,vmEntry:F,threadId:l?.id??null,children:n.jsx(ot,{resetKey:`${t}:${a??"no-branch"}:${l?.id??""}`,children:r})})}):n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex h-full rounded-[0.75rem] bg-background shadow-edge",children:n.jsx(Lt,{image:n.jsx(We,{size:48,className:"text-muted-foreground"}),title:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWeb"),description:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWebDescription")})})})}function Nr(){const t=L.c(19),e=V(),{toggleSidebar:s}=ks(),r=Ts(),{virtualMcpId:i,taskId:a}=$e(),l=!r&&"md:hidden";let c;t[0]!==l?(c=ee(l),t[0]=l,t[1]=c):c=t[1];let u;t[2]!==e?(u=e("layouts.shellControls.toggleSidebar"),t[2]=e,t[3]=u):u=t[3];let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ss,{size:16}),t[4]=o):o=t[4];let d;t[5]!==c||t[6]!==u||t[7]!==s?(d=n.jsx(Ne,{className:c,onClick:s,"aria-label":u,children:o}),t[5]=c,t[6]=u,t[7]=s,t[8]=d):d=t[8];let m;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Wa,{}),t[9]=m):m=t[9];let f;t[10]!==d?(f=n.jsxs(De.Topbar.Left,{children:[d,m]}),t[10]=d,t[11]=f):f=t[11];let h;t[12]!==a||t[13]!==i?(h=n.jsx("div",{className:"min-w-0 md:hidden",children:n.jsx(rr,{virtualMcpId:i,taskId:a})}),t[12]=a,t[13]=i,t[14]=h):h=t[14];let b;t[15]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(De.Topbar.Right,{className:"shrink-0",children:n.jsx(Za,{})}),t[15]=b):b=t[15];let g;return t[16]!==f||t[17]!==h?(g=n.jsxs(De.Topbar,{className:"border-b border-border/60 px-3",children:[f,h,b]}),t[16]=f,t[17]=h,t[18]=g):g=t[18],g}function _r(t){const e=L.c(25),{layout:s,onNewTaskRef:r,createNewTask:i}=t,{virtualMcpId:a,taskId:l}=$e(),c=kn()??"overview",u=cr(),[o,d]=z.useState(null),m=o===c,f=u?m:s.threadOpen;let h;e[0]!==c||e[1]!==s||e[2]!==u||e[3]!==m?(h=u?()=>d(m?null:c):s.toggleThread,e[0]=c,e[1]=s,e[2]=u,e[3]=m,e[4]=h):h=e[4];const b=h;let g;e[5]!==i||e[6]!==r?(g=n.jsx(kr,{onNewTaskRef:r,createNewTask:i}),e[5]=i,e[6]=r,e[7]=g):g=e[7];let v;e[8]!==l||e[9]!==a?(v=n.jsx(Qa,{virtualMcpId:a,taskId:l}),e[8]=l,e[9]=a,e[10]=v):v=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Nr,{}),e[11]=x):x=e[11];const y=l??"threadless";let j;e[12]!==y?(j=n.jsx(lt.Thread,{topbar:x,children:n.jsx(jr,{},y)}),e[12]=y,e[13]=j):j=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(vt,{}),e[14]=S):S=e[14];let p;e[15]!==c||e[16]!==s||e[17]!==v||e[18]!==j||e[19]!==f||e[20]!==b?(p=n.jsxs(lt,{...s,threadOpen:f,toggleThread:b,contentKey:c,contentNavigation:v,children:[j,S]}),e[15]=c,e[16]=s,e[17]=v,e[18]=j,e[19]=f,e[20]=b,e[21]=p):p=e[21];let k;return e[22]!==g||e[23]!==p?(k=n.jsxs(n.Fragment,{children:[g,p]}),e[22]=g,e[23]=p,e[24]=k):k=e[24],k}function wr(){const t=V(),e=Me(),s=mn(),{create:r}=Mt(),{org:i}=ae(),l=je({strict:!1}).org??"",c=Ae({strict:!1}),u=et(),o=Ot(),d=Rt(),[m]=z.useState(()=>crypto.randomUUID()),{data:f}=pe.useSession(),[h]=z.useState(()=>Pt(f?.user?.name||f?.user?.email?.split("@")[0])),b=Qe(),g=z.useSyncExternalStore(b.threads.subscribe,b.threads.get),v=z.useSyncExternalStore(b.threadsStatus.subscribe,b.threadsStatus.get),x=Ee(o),y=!!(x&&wt(x)),j=At(x,null),[S,p]=z.useState(null);u!==null&&S!==null&&p(null);const k=u===null&&!!d&&!!x&&S!==o,T=B=>Qs(B,o,f?.user?.id,It(x?.metadata),y,{baseBranch:j,releases:x?.metadata?.releases??void 0}),N=k&&v.kind!=="loading"?T(g):void 0,w=hr(o,k&&v.kind!=="loading"&&!N),_=fr(u,o,h);ma(_.status==="ready"?_.task:null);const P=x?.metadata?.ui?.layout??null,C=P?{defaultMainView:P.defaultMainView??null,chatDefaultOpen:P.chatDefaultOpen??null}:null,A=an(C),{threadId:M,providerKey:$}=Xa({routeThreadId:u,fallbackKey:m}),E=async()=>{const B=crypto.randomUUID(),O=g.find(H=>H.id===M)?.branch??null;try{await r({id:B,virtual_mcp_id:o,...O?{branch:O}:{}})}catch{}s(B,()=>({}))},F=z.useRef(null);z.useEffect(()=>{const B=O=>{us(O)&&O.shiftKey&&O.code==="KeyS"&&!O.repeat&&(O.preventDefault(),F.current?.())};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[]);const R=_.status==="ready"?_.task:null,I=R?.virtual_mcp_id;if(R&&I&&!hn({routeAgentId:o,threadAgentId:I})){const B=os({org:l,agentId:I,superAgentId:ye(i.id).id});return n.jsx(tt,{target:{route:B,search:{thread:R.id,sidepanel:c.sidepanel,mainpanel:c.mainpanel,autosend:c.autosend}}})}if(k){if(v.kind==="loading"||w.status==="loading")return n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex h-full bg-background shadow-edge rounded-[0.75rem]",children:n.jsx(cs,{})})});const O=(N??(w.status==="ready"?T(w.threads):void 0))?.id??(y?m:null);if(O)return n.jsx(ds,{to:".",replace:!0,search:H=>({...H,thread:O})});p(o)}return _.status==="creating"||_.status==="loading"?n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsxs("div",{role:"status","aria-live":"polite",className:"flex h-full items-center justify-center bg-background shadow-edge rounded-[0.75rem] text-sm text-muted-foreground",children:[n.jsx(Pe,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})}):_.status==="error"?n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsxs("div",{role:"alert",className:"flex flex-col h-full items-center justify-center gap-2 bg-background shadow-edge rounded-[0.75rem] p-8 text-sm",children:[n.jsx("div",{className:"font-medium",children:t("agentShellLayout.agentShellLayout.taskUnavailable")}),n.jsx("div",{className:"text-muted-foreground",children:_.error.message})]})}):x?n.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:n.jsx(q.Provider,{virtualMcpId:o,task:_.status==="ready"?_.task:null,children:n.jsx(zs,{layout:A,children:n.jsx(Tr,{virtualMcpId:o,hasActiveRepository:y,sandboxMap:x.metadata?.sandboxMap,children:n.jsx(Sr,{threadId:M,providerKey:$,children:n.jsx(Ie,{children:n.jsx(_r,{layout:A,onNewTaskRef:F,createNewTask:E})})})})})},o)}):n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden shadow-edge rounded-[0.75rem]",children:n.jsx(Lt,{image:n.jsx(We,{size:48,className:"text-muted-foreground"}),title:t("agentShellLayout.agentShellLayout.agentNotFound"),description:t("agentShellLayout.agentShellLayout.agentNotFoundDescription",{virtualMcpId:o}),actions:n.jsx(qe,{variant:"outline",onClick:()=>e({to:"/$org",params:{org:l}}),children:t("agentShellLayout.agentShellLayout.goToOrgHome")})})})})}function No(){const t=L.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=je(e);if(s.taskId!==void 0){let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(br,{}),t[1]=i):i=t[1],i}if(s._splat!==void 0){let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(vt,{}),t[2]=i):i=t[2],i}let r;return t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ie,{children:n.jsx(pr,{children:n.jsx(In,{children:n.jsxs(Ln,{children:[n.jsx(wr,{}),n.jsx(vr,{})]})})})}),t[3]=r):r=t[3],r}export{No as default};
@@ -1 +1 @@
1
- import{q as b,r as i,eH as ce,bo as le,c as X,e as de,df as q,j as I,a4 as fe,T as Se}from"./index-DIJ4i6l1.js";import{i as me,c as pe,u as ye}from"./chat-context-CaBz0Fa_.js";import{u as Ee}from"./use-mcp-client-DfcqzMq1.js";import{u as he}from"./use-voice-input-CQAqEi1v.js";import{u as xe}from"./thread-intent-BtmlqwRH.js";import{e as Re}from"./backoff-CrEUbyZT.js";import{u as we}from"./use-sandbox-events-bTwWaKJH.js";import{d as Ae}from"./sandbox-start-errors-BK_aDCyt.js";function Te(e,t){const n=b(t);return be({filters:{...e,status:"pending"}},n).length}function j(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function be(e={},t){const n=b(t).getMutationCache(),r=i.useRef(e),s=i.useRef(null);return s.current===null&&(s.current=j(n,e)),i.useEffect(()=>{r.current=e}),i.useSyncExternalStore(i.useCallback(o=>n.subscribe(()=>{const u=ce(s.current,j(n,r.current));s.current!==u&&(s.current=u,le.schedule(o))}),[n]),()=>s.current,()=>s.current)}async function Pe(e,t,n){const r=await e.callTool({name:t,arguments:n});if(r.isError){const s=r.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(s)}return r}const Y=["SANDBOX_START"],w=new Map,Ce=e=>`${e.virtualMcpId}::${e.branch??""}`,ke=e=>e.message.includes("retry shortly"),L=new Set,g={mark:(e,t)=>L.add(`${e}::${t}`),clear:(e,t)=>L.delete(`${e}::${t}`),isStopped:(e,t)=>L.has(`${e}::${t}`)};function _e(e,t){const n=b();return de({mutationKey:Y,retry:(r,s)=>ke(s)&&r<6,retryDelay:r=>Re(5e3,500,r,2,0),mutationFn:async r=>{r.branch&&g.clear(r.virtualMcpId,r.branch);const s=Ce(r),o=w.get(s);if(o)return o;const u=(async()=>(await Pe(e,"SANDBOX_START",r)).structuredContent)();w.set(s,u);try{return await u}finally{w.get(s)===u&&w.delete(s)}},onSuccess:()=>{q(n),t?.onStarted?.()}})}function Ge(e,t){const n=X.c(3);let r;return n[0]!==t||n[1]!==e?(r={mutationKey:Y,predicate:o=>{if(!e)return!1;const u=o.state.variables;return!u||u.virtualMcpId!==e?!1:(u.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=r):r=n[2],Te(r)>0}function Ue(e){return e.appPaused||e.userStopped?{kind:"suspended"}:e.startError&&!e.previewUrl?{kind:"errored",error:e.startError}:e.previewUrl?{kind:"iframe",previewUrl:e.previewUrl}:{kind:"starting"}}function Le(e){return e.executionEnabled&&e.sessionRuntime==="sandbox"&&e.hasActiveRepository&&!!e.userId&&!!e.branch&&!e.vmEntry&&!e.userStopped&&!e.isPending&&!e.attempted}function Ze(e){return e.threadLoaded&&e.isOwner&&e.hasActiveRepository&&!e.branch&&!e.attempted}function ge(e){return e.executionEnabled&&e.notFound&&!!e.deadVmId&&!e.isPending&&!e.userStopped&&e.deadVmId!==e.lastDeadVmId}function et(e){const{agentSandboxMap:t,threadSandboxMap:n,userId:r,branch:s}=e,o=e.ownerId??r;if(!r||!o||!s)return t;const u=n?.[o]?.[s];return u?{...t??{},[r]:{...t?.[r]??{},[s]:u}}:t}function A(e,t,n){const r={virtualMcpId:e};return t&&(r.branch=t),n&&(r.threadId=n),r}const Q=2,De=new Set(["scheduling-timeout","reconciler-error","claim-never-created","unknown"]);function J(e){return De.has(e)}function $e(e){return e.executionEnabled&&e.failedReason!==null&&J(e.failedReason)&&e.attempts<Q&&!e.isPending&&!e.userStopped&&!e.alreadyHandled}const Oe={branch:null,count:0,handled:!1};function Ve(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function Be(e){return e.mutationError?e.mutationError:e.phase?.kind==="failed"&&!e.startPending&&e.claimRetryExhausted?{code:null,message:e.phase.message}:null}function Fe(e){switch(e.kind){case"suspended":return"suspended";case"iframe":return"running";case"starting":return"starting";case"errored":return"errored"}}function M(e,t){return`${e??""}::${t??""}`}function ve(e){const t=e.vmEntry?.previewUrl??null;return t||(e.seeded?.key===e.key?e.seeded.url:null)}function T(e){const{data:t,virtualMcpId:n,branch:r}=e;t?.branch&&!r&&e.setCurrentTaskBranch(t.branch),t?.previewUrl&&e.setSeededPreviewUrl({key:M(n,t.branch??r),url:t.previewUrl})}const Ke={branch:null,previewState:{kind:"starting"},status:"idle",vmEntry:null,previewUrl:null,userStopped:!1,start:()=>{},stop:async()=>{},restart:async()=>{},retry:()=>{},resume:()=>{}},W=i.createContext(Ke);function tt(){return i.use(W)}const z=me(W);function nt(e){const t=X.c(10);let n,r,s;t[0]!==e?({resetKey:s,children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=s):(n=t[1],r=t[2],s=t[3]);let o;t[4]!==r||t[5]!==s?(o=I.jsx(He,{...r},s),t[4]=r,t[5]=s,t[6]=o):o=t[6];let u;return t[7]!==n||t[8]!==o?(u=I.jsx(z.Host,{source:o,children:n}),t[7]=n,t[8]=o,t[9]=u):u=t[9],u}function He(e){return z.usePublish(Ne(e)),null}function Ne({executionEnabled:e,virtualMcpId:t,branch:n,userId:r,hasActiveRepository:s,vmEntry:o,threadId:u}){const{org:P}=fe(),{setCurrentTaskBranch:l}=pe(),G=xe(),p=we(),Z=b(),D=he(t),ee=D.resolved?D.runtime:null,d=ye()?.taskId??null,$=Ee({connectionId:Se,orgId:P.id,orgSlug:P.slug}),c=_e($,{onStarted:()=>{u&&G?.refreshThreadMetadata(u)}}),{mutate:f,reset:te}=c,[ne,S]=i.useState(null),C=i.useRef(new Set),k=i.useRef(null),[O,x]=i.useState(Oe),E=Ve(O,n);E!==O&&x(E);const y=p.phase?.kind==="failed"?p.phase:null,V=ve({vmEntry:o,seeded:y?null:ne,key:M(t,n)}),h=!!t&&!!n&&g.isStopped(t,n),re=p.status.state==="paused",se=!y||!J(y.reason)||E.count>=Q,oe=Be({mutationError:c.isError&&c.error?Ae(c.error.message):null,phase:p.phase,startPending:c.isPending,claimRetryExhausted:se}),B=Ue({previewUrl:V,appPaused:re,userStopped:h,startError:oe}),ae=Fe(B),_=n??"",ue=C.current.has(_),F=Le({executionEnabled:e,hasActiveRepository:s,userId:r,branch:n,vmEntry:o,userStopped:h,isPending:c.isPending,attempted:ue,sessionRuntime:ee});i.useEffect(()=>{if(!F||!t)return;C.current.add(_);const m=A(t,n,d);f(m,{onSuccess:a=>{T({data:a,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:a=>{console.error("[sandbox-lifecycle] auto-start failed:",a)}})},[F,_,n,t,d,f,l,S]);const R=p.notFound?o?.sandboxHandle??null:null,v=ge({executionEnabled:e,notFound:p.notFound,deadVmId:R,lastDeadVmId:k.current,isPending:c.isPending,userStopped:h});i.useEffect(()=>{if(!v||!R||!t)return;k.current=R;const m=A(t,n,d);f(m,{onSuccess:a=>{T({data:a,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:a=>{console.error("[sandbox-lifecycle] self-heal failed:",a)}})},[v,R,t,n,d,f,l,S]);const K=$e({executionEnabled:e,failedReason:y?.reason??null,attempts:E.count,isPending:c.isPending,userStopped:h,alreadyHandled:E.handled});i.useEffect(()=>{if(!y){x(a=>a.handled?{...a,handled:!1}:a);return}if(!K||!t)return;x(a=>({...a,handled:!0,count:a.count+1}));const m=A(t,n,d);f(m,{onSuccess:a=>{T({data:a,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:a=>{console.error("[sandbox-lifecycle] claim auto-retry failed:",a)}})},[y,K,t,n,d,f,l,S]);const U=()=>{if(!e||!t)return;const m=A(t,n,d);f(m,{onSuccess:a=>{T({data:a,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:a=>{console.error("[sandbox-lifecycle] user start failed:",a)}})},H=async()=>{if(!(!e||!t||!n)&&o){g.mark(t,n);try{await $.callTool({name:"SANDBOX_DELETE",arguments:{virtualMcpId:t,branch:n}})}catch{}q(Z)}},ie=async()=>{await H(),U()},N=()=>{C.current=new Set,k.current=null,x({branch:n,count:0,handled:!1}),te(),U()};return{branch:n,previewState:B,status:ae,vmEntry:o,previewUrl:V,userStopped:h,start:U,stop:H,restart:ie,retry:N,resume:N}}export{nt as S,tt as a,_e as b,et as o,Ze as s,Ge as u};
1
+ import{q as b,r as i,eH as ce,bo as le,c as X,e as de,df as q,j as I,a4 as fe,T as Se}from"./index-XdUWZF5g.js";import{i as me,c as pe,u as ye}from"./chat-context-BwoQSegQ.js";import{u as Ee}from"./use-mcp-client-B9_8tfCL.js";import{u as he}from"./use-voice-input-BVeAO01v.js";import{u as xe}from"./thread-intent-DnduoWYb.js";import{e as Re}from"./backoff-CrEUbyZT.js";import{u as we}from"./use-sandbox-events-BNcBCK9X.js";import{d as Ae}from"./sandbox-start-errors-BK_aDCyt.js";function Te(e,t){const n=b(t);return be({filters:{...e,status:"pending"}},n).length}function j(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function be(e={},t){const n=b(t).getMutationCache(),r=i.useRef(e),s=i.useRef(null);return s.current===null&&(s.current=j(n,e)),i.useEffect(()=>{r.current=e}),i.useSyncExternalStore(i.useCallback(o=>n.subscribe(()=>{const u=ce(s.current,j(n,r.current));s.current!==u&&(s.current=u,le.schedule(o))}),[n]),()=>s.current,()=>s.current)}async function Pe(e,t,n){const r=await e.callTool({name:t,arguments:n});if(r.isError){const s=r.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(s)}return r}const Y=["SANDBOX_START"],w=new Map,Ce=e=>`${e.virtualMcpId}::${e.branch??""}`,ke=e=>e.message.includes("retry shortly"),L=new Set,g={mark:(e,t)=>L.add(`${e}::${t}`),clear:(e,t)=>L.delete(`${e}::${t}`),isStopped:(e,t)=>L.has(`${e}::${t}`)};function _e(e,t){const n=b();return de({mutationKey:Y,retry:(r,s)=>ke(s)&&r<6,retryDelay:r=>Re(5e3,500,r,2,0),mutationFn:async r=>{r.branch&&g.clear(r.virtualMcpId,r.branch);const s=Ce(r),o=w.get(s);if(o)return o;const u=(async()=>(await Pe(e,"SANDBOX_START",r)).structuredContent)();w.set(s,u);try{return await u}finally{w.get(s)===u&&w.delete(s)}},onSuccess:()=>{q(n),t?.onStarted?.()}})}function Ge(e,t){const n=X.c(3);let r;return n[0]!==t||n[1]!==e?(r={mutationKey:Y,predicate:o=>{if(!e)return!1;const u=o.state.variables;return!u||u.virtualMcpId!==e?!1:(u.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=r):r=n[2],Te(r)>0}function Ue(e){return e.appPaused||e.userStopped?{kind:"suspended"}:e.startError&&!e.previewUrl?{kind:"errored",error:e.startError}:e.previewUrl?{kind:"iframe",previewUrl:e.previewUrl}:{kind:"starting"}}function Le(e){return e.executionEnabled&&e.sessionRuntime==="sandbox"&&e.hasActiveRepository&&!!e.userId&&!!e.branch&&!e.vmEntry&&!e.userStopped&&!e.isPending&&!e.attempted}function Ze(e){return e.threadLoaded&&e.isOwner&&e.hasActiveRepository&&!e.branch&&!e.attempted}function ge(e){return e.executionEnabled&&e.notFound&&!!e.deadVmId&&!e.isPending&&!e.userStopped&&e.deadVmId!==e.lastDeadVmId}function et(e){const{agentSandboxMap:t,threadSandboxMap:n,userId:r,branch:s}=e,o=e.ownerId??r;if(!r||!o||!s)return t;const u=n?.[o]?.[s];return u?{...t??{},[r]:{...t?.[r]??{},[s]:u}}:t}function A(e,t,n){const r={virtualMcpId:e};return t&&(r.branch=t),n&&(r.threadId=n),r}const Q=2,De=new Set(["scheduling-timeout","reconciler-error","claim-never-created","unknown"]);function J(e){return De.has(e)}function $e(e){return e.executionEnabled&&e.failedReason!==null&&J(e.failedReason)&&e.attempts<Q&&!e.isPending&&!e.userStopped&&!e.alreadyHandled}const Oe={branch:null,count:0,handled:!1};function Ve(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function Be(e){return e.mutationError?e.mutationError:e.phase?.kind==="failed"&&!e.startPending&&e.claimRetryExhausted?{code:null,message:e.phase.message}:null}function Fe(e){switch(e.kind){case"suspended":return"suspended";case"iframe":return"running";case"starting":return"starting";case"errored":return"errored"}}function M(e,t){return`${e??""}::${t??""}`}function ve(e){const t=e.vmEntry?.previewUrl??null;return t||(e.seeded?.key===e.key?e.seeded.url:null)}function T(e){const{data:t,virtualMcpId:n,branch:r}=e;t?.branch&&!r&&e.setCurrentTaskBranch(t.branch),t?.previewUrl&&e.setSeededPreviewUrl({key:M(n,t.branch??r),url:t.previewUrl})}const Ke={branch:null,previewState:{kind:"starting"},status:"idle",vmEntry:null,previewUrl:null,userStopped:!1,start:()=>{},stop:async()=>{},restart:async()=>{},retry:()=>{},resume:()=>{}},W=i.createContext(Ke);function tt(){return i.use(W)}const z=me(W);function nt(e){const t=X.c(10);let n,r,s;t[0]!==e?({resetKey:s,children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=s):(n=t[1],r=t[2],s=t[3]);let o;t[4]!==r||t[5]!==s?(o=I.jsx(He,{...r},s),t[4]=r,t[5]=s,t[6]=o):o=t[6];let u;return t[7]!==n||t[8]!==o?(u=I.jsx(z.Host,{source:o,children:n}),t[7]=n,t[8]=o,t[9]=u):u=t[9],u}function He(e){return z.usePublish(Ne(e)),null}function Ne({executionEnabled:e,virtualMcpId:t,branch:n,userId:r,hasActiveRepository:s,vmEntry:o,threadId:u}){const{org:P}=fe(),{setCurrentTaskBranch:l}=pe(),G=xe(),p=we(),Z=b(),D=he(t),ee=D.resolved?D.runtime:null,d=ye()?.taskId??null,$=Ee({connectionId:Se,orgId:P.id,orgSlug:P.slug}),c=_e($,{onStarted:()=>{u&&G?.refreshThreadMetadata(u)}}),{mutate:f,reset:te}=c,[ne,S]=i.useState(null),C=i.useRef(new Set),k=i.useRef(null),[O,x]=i.useState(Oe),E=Ve(O,n);E!==O&&x(E);const y=p.phase?.kind==="failed"?p.phase:null,V=ve({vmEntry:o,seeded:y?null:ne,key:M(t,n)}),h=!!t&&!!n&&g.isStopped(t,n),re=p.status.state==="paused",se=!y||!J(y.reason)||E.count>=Q,oe=Be({mutationError:c.isError&&c.error?Ae(c.error.message):null,phase:p.phase,startPending:c.isPending,claimRetryExhausted:se}),B=Ue({previewUrl:V,appPaused:re,userStopped:h,startError:oe}),ae=Fe(B),_=n??"",ue=C.current.has(_),F=Le({executionEnabled:e,hasActiveRepository:s,userId:r,branch:n,vmEntry:o,userStopped:h,isPending:c.isPending,attempted:ue,sessionRuntime:ee});i.useEffect(()=>{if(!F||!t)return;C.current.add(_);const m=A(t,n,d);f(m,{onSuccess:a=>{T({data:a,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:a=>{console.error("[sandbox-lifecycle] auto-start failed:",a)}})},[F,_,n,t,d,f,l,S]);const R=p.notFound?o?.sandboxHandle??null:null,v=ge({executionEnabled:e,notFound:p.notFound,deadVmId:R,lastDeadVmId:k.current,isPending:c.isPending,userStopped:h});i.useEffect(()=>{if(!v||!R||!t)return;k.current=R;const m=A(t,n,d);f(m,{onSuccess:a=>{T({data:a,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:a=>{console.error("[sandbox-lifecycle] self-heal failed:",a)}})},[v,R,t,n,d,f,l,S]);const K=$e({executionEnabled:e,failedReason:y?.reason??null,attempts:E.count,isPending:c.isPending,userStopped:h,alreadyHandled:E.handled});i.useEffect(()=>{if(!y){x(a=>a.handled?{...a,handled:!1}:a);return}if(!K||!t)return;x(a=>({...a,handled:!0,count:a.count+1}));const m=A(t,n,d);f(m,{onSuccess:a=>{T({data:a,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:a=>{console.error("[sandbox-lifecycle] claim auto-retry failed:",a)}})},[y,K,t,n,d,f,l,S]);const U=()=>{if(!e||!t)return;const m=A(t,n,d);f(m,{onSuccess:a=>{T({data:a,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:a=>{console.error("[sandbox-lifecycle] user start failed:",a)}})},H=async()=>{if(!(!e||!t||!n)&&o){g.mark(t,n);try{await $.callTool({name:"SANDBOX_DELETE",arguments:{virtualMcpId:t,branch:n}})}catch{}q(Z)}},ie=async()=>{await H(),U()},N=()=>{C.current=new Set,k.current=null,x({branch:n,count:0,handled:!1}),te(),U()};return{branch:n,previewState:B,status:ae,vmEntry:o,previewUrl:V,userStopped:h,start:U,stop:H,restart:ie,retry:N,resume:N}}export{nt as S,tt as a,_e as b,et as o,Ze as s,Ge as u};
@@ -1 +1 @@
1
- import{aE as s,cY as e,aF as a,cZ as d,ba as l}from"./index-DIJ4i6l1.js";const o=500;s({title:a().max(o),url:a().max(o),icon:a().max(o)});const t=s({keyId:a().max(o),modelId:a().max(o),title:a().max(o).optional()}).nullable();d(["fast","smart","thinking","image","web_search","deep_research"]);d(["fast","smart","thinking"]);const b=s({tiers:s({fast:t,smart:t,thinking:t,image:t,web_search:t,deep_research:t})});s({tiers:s({fast:t.optional(),smart:t.optional(),thinking:t.optional()})});const f=50,c=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/;s({host:a().trim().toLowerCase().min(1).max(o).regex(c).describe("Git host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:a().min(1).max(o).describe("Vault secret id holding the PAT used to authenticate this host.")});s({ids:l(a().max(o)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const u=s({voice_mode:e().optional(),home_task_intake_enabled:e().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:e().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),demo_board_reset:e().optional().describe("Curated demo org: every morning the task board returns to its captured snapshot, and admins can reset or recapture it on demand."),reports_only:e().optional().describe("Curated Deco Score look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:e().optional().describe("Run the Reviewer on a task's pull request when the card reaches In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:e().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:e().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:e().optional().describe("When a card reaches Ready for Deployment, merge its pull request automatically instead of waiting for someone to press Ship."),auto_resolve_conflicts:e().optional().describe("When a pull request in Ready for Deployment can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:e().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:e().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow Studio surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:e().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),task_board_codex:e().optional().describe("Allow tasks to select the Codex harness. Off by default; existing tasks keep Claude Code. Reviewers keep their own runtime."),chat_harness_codex:e().optional().describe("Use Codex for new sandbox chats. Off by default; requires hosted sandboxes and a ChatGPT subscription or Responses API provider. Existing chats keep their pinned runtime."),chat_harness_sandbox_only:e().optional().describe("Run every chat with the claude-code harness in its own sandbox instead of hosted Decopilot. On by default (see DEFAULT_ON_FLAGS); a deployment without hosted sandboxes keeps Decopilot regardless."),sandbox_run_metadata:e().optional().describe("Forward a sandbox run's metadata (such as a webhook trigger's run_metadata) to the MCP tools it calls, as hosted Decopilot runs do. Off by default."),sandbox_repo_snapshots:e().optional().describe("Keep a Freestyle snapshot of each project repo at its default branch's head, with its dependencies installed and its dev server running, so a new sandbox for that repo starts already serving. Off by default: each push to a default branch costs a snapshot build the next time a sandbox starts."),auto_assign_report_tasks_to_super_agent:e().optional().describe("When a Deco Score import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:e().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:e().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:e().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),experiments_enabled:e().optional().describe("Per-site Experiments tab (A/B tests + variant results). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org."),experiments_v2_enabled:e().optional().describe("Rebuilt Experiments tab: describe the test in prose and an agent drafts it, plus inline editing and the implement/preview tools that write the split into the site. Off by default — an org without it keeps the table-and-dialog tab, which only records experiment metadata. Requires `experiments_enabled`, which still decides whether the tab exists at all."),monitor_enabled:e().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),site_create_enabled:e().optional().describe('The "Create a new site" option under New project: generates a GitHub repository from a site template in an account the org connected, and opens it as a project. Off by default, for every org — deco.cx staff included.'),new_blocks_editor:e().optional().describe("Use the redesigned blocks editor for every member of the organization. Off by default — the classic editor stays until an admin opts the org in."),blog_ai_enabled:e().optional().describe("The blog's brand context tab and its agentic generation — campaigns, post drafting and link suggestions. Off by default; with it off the blog is written by hand and every BLOG_* tool refuses, over MCP and in the app alike, so an agent cannot spend the organization's credits on a feature it turned off."),site_apps_install_enabled:e().optional().describe("Installing a site app from the Apps tab: writes the app module, registers it (the manifest on Deno, APP_REGISTRY on TanStack), adds the npm dependency, then reinstalls dependencies and restarts the dev script on the running sandbox. Off by default — it writes code and restarts the dev server on install, and the restart only works on a daemon new enough to honour a forced step, so an org opts in once its pods are running one. With it off the catalogue stays browsable and nothing is installable, which is also the lever for an org that does not want the CMS writing code."),multi_app_preview:e().optional().describe("Previewing more than one app of a monorepo: an Apps list in project settings, app tabs with a split view in the preview, and a dev server per extra app in the sandbox, served at its own preview host. Off by default."),hide_default_blog_blocks:e().optional().describe("Hide the `deco-cms/blog` app's own blocks (`blog/*`) everywhere a post is written — the inserter, the format briefs, and generated drafts — so only the site's own `site/sections/Blog/Post/*` blocks are eligible, plus, in the inserter, the sections under the blog app's `customSectionPaths`. Off by default. Blocks already present in a post keep rendering; this only governs what can be added.")}),h=new Set(["reviewer_enabled","cheap_reviewer_model","chat_harness_sandbox_only"]);function g(i,n){const r=i?.[n];return h.has(n)?r!==!1:r===!0}function m(i){const n=i?.auto_resolve_conflicts;return typeof n=="boolean"?n:i?.auto_merge===!0}export{h as D,f as G,u as O,b as S,m as a,c as b,g as o};
1
+ import{aE as s,cY as e,aF as a,cZ as d,ba as l}from"./index-XdUWZF5g.js";const o=500;s({title:a().max(o),url:a().max(o),icon:a().max(o)});const t=s({keyId:a().max(o),modelId:a().max(o),title:a().max(o).optional()}).nullable();d(["fast","smart","thinking","image","web_search","deep_research"]);d(["fast","smart","thinking"]);const b=s({tiers:s({fast:t,smart:t,thinking:t,image:t,web_search:t,deep_research:t})});s({tiers:s({fast:t.optional(),smart:t.optional(),thinking:t.optional()})});const f=50,c=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/;s({host:a().trim().toLowerCase().min(1).max(o).regex(c).describe("Git host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:a().min(1).max(o).describe("Vault secret id holding the PAT used to authenticate this host.")});s({ids:l(a().max(o)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const u=s({voice_mode:e().optional(),home_task_intake_enabled:e().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:e().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),demo_board_reset:e().optional().describe("Curated demo org: every morning the task board returns to its captured snapshot, and admins can reset or recapture it on demand."),reports_only:e().optional().describe("Curated Deco Score look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:e().optional().describe("Run the Reviewer on a task's pull request when the card reaches In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:e().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:e().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:e().optional().describe("When a card reaches Ready for Deployment, merge its pull request automatically instead of waiting for someone to press Ship."),auto_resolve_conflicts:e().optional().describe("When a pull request in Ready for Deployment can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:e().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:e().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow Studio surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:e().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),task_board_codex:e().optional().describe("Allow tasks to select the Codex harness. Off by default; existing tasks keep Claude Code. Reviewers keep their own runtime."),chat_harness_codex:e().optional().describe("Use Codex for new sandbox chats. Off by default; requires hosted sandboxes and a ChatGPT subscription or Responses API provider. Existing chats keep their pinned runtime."),chat_harness_sandbox_only:e().optional().describe("Run every chat with the claude-code harness in its own sandbox instead of hosted Decopilot. On by default (see DEFAULT_ON_FLAGS); a deployment without hosted sandboxes keeps Decopilot regardless."),sandbox_run_metadata:e().optional().describe("Forward a sandbox run's metadata (such as a webhook trigger's run_metadata) to the MCP tools it calls, as hosted Decopilot runs do. Off by default."),sandbox_repo_snapshots:e().optional().describe("Keep a Freestyle snapshot of each project repo at its default branch's head, with its dependencies installed and its dev server running, so a new sandbox for that repo starts already serving. Off by default: each push to a default branch costs a snapshot build the next time a sandbox starts."),auto_assign_report_tasks_to_super_agent:e().optional().describe("When a Deco Score import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:e().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:e().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:e().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),experiments_enabled:e().optional().describe("Per-site Experiments tab (A/B tests + variant results). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org."),experiments_v2_enabled:e().optional().describe("Rebuilt Experiments tab: describe the test in prose and an agent drafts it, plus inline editing and the implement/preview tools that write the split into the site. Off by default — an org without it keeps the table-and-dialog tab, which only records experiment metadata. Requires `experiments_enabled`, which still decides whether the tab exists at all."),monitor_enabled:e().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),site_create_enabled:e().optional().describe('The "Create a new site" option under New project: generates a GitHub repository from a site template in an account the org connected, and opens it as a project. Off by default, for every org — deco.cx staff included.'),new_blocks_editor:e().optional().describe("Use the redesigned blocks editor for every member of the organization. Off by default — the classic editor stays until an admin opts the org in."),blog_ai_enabled:e().optional().describe("The blog's brand context tab and its agentic generation — campaigns, post drafting and link suggestions. Off by default; with it off the blog is written by hand and every BLOG_* tool refuses, over MCP and in the app alike, so an agent cannot spend the organization's credits on a feature it turned off."),site_apps_install_enabled:e().optional().describe("Installing a site app from the Apps tab: writes the app module, registers it (the manifest on Deno, APP_REGISTRY on TanStack), adds the npm dependency, then reinstalls dependencies and restarts the dev script on the running sandbox. Off by default — it writes code and restarts the dev server on install, and the restart only works on a daemon new enough to honour a forced step, so an org opts in once its pods are running one. With it off the catalogue stays browsable and nothing is installable, which is also the lever for an org that does not want the CMS writing code."),multi_app_preview:e().optional().describe("Previewing more than one app of a monorepo: an Apps list in project settings, app tabs with a split view in the preview, and a dev server per extra app in the sandbox, served at its own preview host. Off by default."),hide_default_blog_blocks:e().optional().describe("Hide the `deco-cms/blog` app's own blocks (`blog/*`) everywhere a post is written — the inserter, the format briefs, and generated drafts — so only the site's own `site/sections/Blog/Post/*` blocks are eligible, plus, in the inserter, the sections under the blog app's `customSectionPaths`. Off by default. Blocks already present in a post keep rendering; this only governs what can be added.")}),h=new Set(["reviewer_enabled","cheap_reviewer_model","chat_harness_sandbox_only"]);function g(i,n){const r=i?.[n];return h.has(n)?r!==!1:r===!0}function m(i){const n=i?.auto_resolve_conflicts;return typeof n=="boolean"?n:i?.auto_merge===!0}export{h as D,f as G,u as O,b as S,m as a,c as b,g as o};
@@ -1 +1 @@
1
- import{aE as r,e8 as p,e6 as _,aF as n,ba as o,cZ as m}from"./index-DIJ4i6l1.js";const f=r({key:n().min(1,"Key is required"),value:n()}),g=r({title:n().min(1,"Name is required"),description:n().nullable().optional(),icon:n().nullable().optional(),ui_type:m(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:n().optional(),connection_token:n().nullable().optional(),npx_package:n().optional(),stdio_command:n().optional(),stdio_args:n().optional(),stdio_cwd:n().optional(),env_vars:o(f).optional(),configuration_scopes:o(n()).nullable().optional(),configuration_state:p(n(),_()).nullable().optional()}).refine(e=>e.ui_type==="NPX"?!!e.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(e=>e.ui_type==="STDIO"?!!e.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(e=>e.ui_type==="HTTP"||e.ui_type==="SSE"||e.ui_type==="Websocket"?!!e.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(e=>(e.ui_type==="HTTP"||e.ui_type==="SSE"||e.ui_type==="Websocket")&&e.connection_url?.trim()?n().url().safeParse(e.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function S(e,u,a){const s=i=>{if(i==="*")return!0;const c=i.split("::")[0]??"";let t=a;for(const l of c.split(".")){if(t===null||typeof t!="object")return!1;t=t[l]}return t!=null};return[...new Set([...e,...u.filter(s)])]}export{S as a,g as c};
1
+ import{aE as r,e8 as p,e6 as _,aF as n,ba as o,cZ as m}from"./index-XdUWZF5g.js";const f=r({key:n().min(1,"Key is required"),value:n()}),g=r({title:n().min(1,"Name is required"),description:n().nullable().optional(),icon:n().nullable().optional(),ui_type:m(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:n().optional(),connection_token:n().nullable().optional(),npx_package:n().optional(),stdio_command:n().optional(),stdio_args:n().optional(),stdio_cwd:n().optional(),env_vars:o(f).optional(),configuration_scopes:o(n()).nullable().optional(),configuration_state:p(n(),_()).nullable().optional()}).refine(e=>e.ui_type==="NPX"?!!e.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(e=>e.ui_type==="STDIO"?!!e.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(e=>e.ui_type==="HTTP"||e.ui_type==="SSE"||e.ui_type==="Websocket"?!!e.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(e=>(e.ui_type==="HTTP"||e.ui_type==="SSE"||e.ui_type==="Websocket")&&e.connection_url?.trim()?n().url().safeParse(e.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function S(e,u,a){const s=i=>{if(i==="*")return!0;const c=i.split("::")[0]??"";let t=a;for(const l of c.split(".")){if(t===null||typeof t!="object")return!1;t=t[l]}return t!=null};return[...new Set([...e,...u.filter(s)])]}export{S as a,g as c};