decocms 4.532.5 → 4.533.0

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 (395) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-DBB_x8Gs.js → ActiveShapeUtils-Dh3A6KYq.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-BgO0RShT.js → AlertCircle-Bv2BEUF9.js} +1 -1
  3. package/dist/client/assets/{AreaChart-DKpy9mUx.js → AreaChart-BRFgk81w.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-CLIbFvcM.js → ArrowLeft-Cl79k4DZ.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DGj1a1JQ.js → ArrowUp-BTDTOzLX.js} +1 -1
  6. package/dist/client/assets/{BarChart-D7kmxRhA.js → BarChart-BtIwUj1e.js} +1 -1
  7. package/dist/client/assets/{Building02-DTlG5UDd.js → Building02-GUof9J0b.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-BAgzcFkw.js → CartesianChart-NGqPfva_.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-1w257zDj.js → CategoricalChart-CEvQGC9L.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-BoFFOiJR.js → CheckCircle-BmUid6M4.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-DYan7Eqw.js → ChevronSelectorVertical-heI72CIu.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-DQBYMpqT.js → ChevronUp-DU-EG51B.js} +1 -1
  13. package/dist/client/assets/{Copy01-BPOEtZ0I.js → Copy01-nzf-QlFE.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-BgcDg6Po.js → CreditCard01-Cv4vR00-.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-bVrzKljT.js → DotsVertical-CUqDvwhV.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-F07hkAp5.js → ErrorBarContext-tsLi401z.js} +1 -1
  17. package/dist/client/assets/{Globe04-DROK8sB6.js → Globe04-BKU9C-bK.js} +1 -1
  18. package/dist/client/assets/{Image01-CYMd4B2w.js → Image01-Du-KvxND.js} +1 -1
  19. package/dist/client/assets/{Key01-CcnI3N_J.js → Key01-Bnd1AHxj.js} +1 -1
  20. package/dist/client/assets/{Link01-BaCE2stQ.js → Link01-DSMlj1p0.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-BCegKYMu.js → LinkBroken01-PSltL834.js} +1 -1
  22. package/dist/client/assets/{Minus-YbXjN_Ds.js → Minus-DcXAe-H5.js} +1 -1
  23. package/dist/client/assets/{Monitor01-aloCOxdR.js → Monitor01-BicT_5ll.js} +1 -1
  24. package/dist/client/assets/{Play-CKfAabLj.js → Play-DNGsG6Er.js} +1 -1
  25. package/dist/client/assets/{Plus-DifrnWDP.js → Plus-BN7UagXh.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-BjTHivV7.js → ReferenceLine-BzhVZtH8.js} +1 -1
  27. package/dist/client/assets/{SearchMd-OM6lL3Xq.js → SearchMd-3slIAJHk.js} +1 -1
  28. package/dist/client/assets/{Sector-aZQlOyVI.js → Sector-S7jJxZxj.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-EO0f4EEB.js → ShoppingBag01-CmG7bP88.js} +1 -1
  30. package/dist/client/assets/{Sun-tqaV4Ycc.js → Sun-CBWGnfjI.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-VCz6eoXn.js → SwitchHorizontal01-DggiPdjn.js} +1 -1
  32. package/dist/client/assets/{Tool01-CDUtHuFU.js → Tool01-DqXz0Txk.js} +1 -1
  33. package/dist/client/assets/{Trash01-VJJht0QK.js → Trash01-BRVhue7b.js} +1 -1
  34. package/dist/client/assets/{Upload01-Dxk-zD3u.js → Upload01-DbVTvCTH.js} +1 -1
  35. package/dist/client/assets/{UserSquare-DoHQfmRI.js → UserSquare-1C4lyqiS.js} +1 -1
  36. package/dist/client/assets/{Users01-CS7GcqAQ.js → Users01-RbPCVFSx.js} +1 -1
  37. package/dist/client/assets/{XClose-B88tJS8W.js → XClose-h4E5H3fg.js} +1 -1
  38. package/dist/client/assets/{ZoomOut-Dg4JYL36.js → ZoomOut-DvoVyeiz.js} +1 -1
  39. package/dist/client/assets/{access-gate-DE8upkjE.js → access-gate-C5krLons.js} +1 -1
  40. package/dist/client/assets/{add-connection-dialog-DxVAYgn3.js → add-connection-dialog-_eytJLIY.js} +1 -1
  41. package/dist/client/assets/{agent-analytics-CxXcJA46.js → agent-analytics-T2y8pdZh.js} +1 -1
  42. package/dist/client/assets/agent-app-DSY5oYwd.js +1 -0
  43. package/dist/client/assets/{agent-assets-2QbtIHgO.js → agent-assets-D_MvYPw6.js} +1 -1
  44. package/dist/client/assets/{agent-automation-Dw4OjqvF.js → agent-automation-C3Zfraei.js} +1 -1
  45. package/dist/client/assets/{agent-automations-CZq7e0tO.js → agent-automations-Dujz5bEK.js} +1 -1
  46. package/dist/client/assets/{agent-calendar-CGPFAwP8.js → agent-calendar-Cma-mG6e.js} +1 -1
  47. package/dist/client/assets/{agent-connect-sources-CwNcGkc9.js → agent-connect-sources-4H01DUHD.js} +1 -1
  48. package/dist/client/assets/agent-deck-OUVEapHE.js +1 -0
  49. package/dist/client/assets/{agent-e2e-tTccsl2f.js → agent-e2e-aM1AAZoT.js} +1 -1
  50. package/dist/client/assets/agent-experiments-Dm4tL0uK.js +1 -0
  51. package/dist/client/assets/{agent-file-BXmbhJ0A.js → agent-file-Crx9FdZp.js} +1 -1
  52. package/dist/client/assets/{agent-hosting-DFmxpM7m.js → agent-hosting-DQ6K72Cy.js} +1 -1
  53. package/dist/client/assets/{agent-icon-CA2ls6V4.js → agent-icon-DlOM9PPG.js} +1 -1
  54. package/dist/client/assets/agent-library-DdxgFy0w.js +1 -0
  55. package/dist/client/assets/agent-library-file-DLLD9085.js +1 -0
  56. package/dist/client/assets/agent-monitor-Lv8MKTgt.js +1 -0
  57. package/dist/client/assets/{agent-overview-DMIGbWhh.js → agent-overview-CXu4DHLw.js} +1 -1
  58. package/dist/client/assets/{agent-releases-TfhRok_k.js → agent-releases-CWbwq7pE.js} +1 -1
  59. package/dist/client/assets/agent-settings-C52PBVHh.js +1 -0
  60. package/dist/client/assets/{agent-site-editor-vIA92dqf.js → agent-site-editor-BEZVEr0s.js} +1 -1
  61. package/dist/client/assets/agent-site-editor-code-BvHDuOfo.js +2 -0
  62. package/dist/client/assets/agent-site-editor-content-BxvgW7xW.js +1 -0
  63. package/dist/client/assets/agent-site-editor-preview-DNxt-Hg9.js +1 -0
  64. package/dist/client/assets/agent-view-Di5cKxg2.js +1 -0
  65. package/dist/client/assets/{agent-view-guard-CTViio6x.js → agent-view-guard-QTGW3ZjV.js} +1 -1
  66. package/dist/client/assets/{agents-list-DF0DX580.js → agents-list-DoXFK47n.js} +1 -1
  67. package/dist/client/assets/{ai-providers-CQbH_x8n.js → ai-providers-BifXZOPL.js} +1 -1
  68. package/dist/client/assets/{alert-D3Vs7Hmm.js → alert-CjlAaO05.js} +1 -1
  69. package/dist/client/assets/{analytics-sections-C4W8AGNp.js → analytics-sections-CB4blq9-.js} +1 -1
  70. package/dist/client/assets/{api-keys-CxMUc2ge.js → api-keys-CBCQIToe.js} +1 -1
  71. package/dist/client/assets/api-keys-DlFg4zPj.js +1 -0
  72. package/dist/client/assets/{app-editor-BmqQZaqc.js → app-editor-B4zJaAZQ.js} +1 -1
  73. package/dist/client/assets/{asset-utils-O6X_dwt-.js → asset-utils-BscmD_Aj.js} +1 -1
  74. package/dist/client/assets/{auth-B2v1KOAc.js → auth-BRfZNrQw.js} +1 -1
  75. package/dist/client/assets/{auth-catchall-BGsoBMku.js → auth-catchall-CS0Gx1JE.js} +1 -1
  76. package/dist/client/assets/{auth-entry-CAB8qpvf.js → auth-entry-hwPUNZuK.js} +1 -1
  77. package/dist/client/assets/{auth-split-layout-Baxd24ro.js → auth-split-layout-D6_P_MI3.js} +1 -1
  78. package/dist/client/assets/{authenticate-and-persist-oauth-UWCdGiT0.js → authenticate-and-persist-oauth-hn1TtboK.js} +1 -1
  79. package/dist/client/assets/{automation-list-row-DLHQbxMG.js → automation-list-row-CA5eciVD.js} +1 -1
  80. package/dist/client/assets/{automation-runs-DUVVTfNU.js → automation-runs-B7gIkB_H.js} +1 -1
  81. package/dist/client/assets/{automations-B9kCc45C.js → automations-Cmk1y2Ah.js} +1 -1
  82. package/dist/client/assets/{autosend-BUHDH46M.js → autosend-CaW4auE_.js} +1 -1
  83. package/dist/client/assets/{badge-B275lbPZ.js → badge-DFfmOl2u.js} +1 -1
  84. package/dist/client/assets/{block-document-Ud-Pjgh_.js → block-document-DdnUjb3V.js} +1 -1
  85. package/dist/client/assets/{blocks-preview-workspace-context-Cfqwt0fl.js → blocks-preview-workspace-context-DjNGGVfK.js} +1 -1
  86. package/dist/client/assets/{blocks-tab-states-DhPO3927.js → blocks-tab-states-DUxhhtVk.js} +1 -1
  87. package/dist/client/assets/{blog-schema-CxYprLcJ.js → blog-schema-txYa4as0.js} +1 -1
  88. package/dist/client/assets/{buckets-Ctl6DyfN.js → buckets-BAuQ7z_l.js} +1 -1
  89. package/dist/client/assets/{build-improve-prompt-doc-B1ctgI5i.js → build-improve-prompt-doc-DckZxFVT.js} +1 -1
  90. package/dist/client/assets/{calendar-BF6y0Z9x.js → calendar-ksxqXCHK.js} +1 -1
  91. package/dist/client/assets/{capability-load-error-DLAPLAgw.js → capability-load-error-DTYT4QiE.js} +1 -1
  92. package/dist/client/assets/{category-editor-BWhnsKFl.js → category-editor-BJ1diRXR.js} +1 -1
  93. package/dist/client/assets/{cdn-tab-DNzFiD5m.js → cdn-tab-B_te-WLa.js} +1 -1
  94. package/dist/client/assets/{chart-BV2fH_6W.js → chart-DskIV1o6.js} +1 -1
  95. package/dist/client/assets/{chat-context-CRAqcBEA.js → chat-context-BinnCCDE.js} +1 -1
  96. package/dist/client/assets/{chat-draft-D8MxxmMn.js → chat-draft-D6rrl_xp.js} +1 -1
  97. package/dist/client/assets/{checkbox-z1yY0VbG.js → checkbox-BBWNbZkV.js} +1 -1
  98. package/dist/client/assets/{choose-editor-BfJ_uy-r.js → choose-editor-B6go4Qvs.js} +1 -1
  99. package/dist/client/assets/{cli-auth-success-BXP6hdAw.js → cli-auth-success-CzfpGx7Q.js} +1 -1
  100. package/dist/client/assets/{client-icons-CZJL6jbw.js → client-icons-BlICAj8K.js} +1 -1
  101. package/dist/client/assets/{cms-settings-editor-CykKSUR_.js → cms-settings-editor-XztPQgQ8.js} +1 -1
  102. package/dist/client/assets/{collapsible-TgXdzaTW.js → collapsible-BXxZmISg.js} +1 -1
  103. package/dist/client/assets/{collection-detail-C50ZKf3h.js → collection-detail-Bki6hrxh.js} +1 -1
  104. package/dist/client/assets/{collection-display-button-C1BGad1J.js → collection-display-button-DwDfjYV5.js} +1 -1
  105. package/dist/client/assets/{collection-search-Dxv0FJfh.js → collection-search-DIJSdZt0.js} +1 -1
  106. package/dist/client/assets/{collection-table-wrapper-BQz4wQv6.js → collection-table-wrapper-XO4FtTv5.js} +1 -1
  107. package/dist/client/assets/{collection-tabs-k2c4oB2_.js → collection-tabs-opUuz5vN.js} +1 -1
  108. package/dist/client/assets/{column-rules-IZdAS5gT.js → column-rules-BWtm7AbQ.js} +1 -1
  109. package/dist/client/assets/{combobox-CXI3q8SD.js → combobox-BoR716Aw.js} +1 -1
  110. package/dist/client/assets/{command-6ewscZzU.js → command-WgcgSVia.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-DoFZott1.js → companion-mcps-section-cWwOp-0n.js} +1 -1
  112. package/dist/client/assets/{config-DvYJzFe4.js → config-CAt7kBF6.js} +1 -1
  113. package/dist/client/assets/{connect-D2juww-N.js → connect-K7H_jTcM.js} +1 -1
  114. package/dist/client/assets/{connect-layout-DSU6EVHj.js → connect-layout-C5JyHarn.js} +1 -1
  115. package/dist/client/assets/{connect-source-dialog-BYzD_cCd.js → connect-source-dialog-Cm7x5SM7.js} +1 -1
  116. package/dist/client/assets/{connection--HCyemnh.js → connection-D8fbJOku.js} +1 -1
  117. package/dist/client/assets/{connection-card-CJzQ1R1a.js → connection-card-B0pQo4uU.js} +1 -1
  118. package/dist/client/assets/{connection-detail-DwxIR5Sg.js → connection-detail-B3GgXGXc.js} +1 -1
  119. package/dist/client/assets/{connection-form-helpers-BhmC9tzU.js → connection-form-helpers-xuzuwHvw.js} +1 -1
  120. package/dist/client/assets/{connections-BbTMsfM2.js → connections-DMzv4o_7.js} +1 -1
  121. package/dist/client/assets/{content-tab-C4xTdHdc.js → content-tab-DCSkBZfR.js} +3 -3
  122. package/dist/client/assets/{context-BpAOIYxL.js → context-DLxMCQ3I.js} +1 -1
  123. package/dist/client/assets/{context-menu-ClCy32tB.js → context-menu-ClcYZm4u.js} +1 -1
  124. package/dist/client/assets/{context-shell-AlLqYzkU.js → context-shell-AY8finpF.js} +3 -3
  125. package/dist/client/assets/{core.esm-BXQfTZkM.js → core.esm-B1paoQlf.js} +1 -1
  126. package/dist/client/assets/{create-organization-dialog-BY6IHR1p.js → create-organization-dialog-BiiU0djl.js} +1 -1
  127. package/dist/client/assets/{daily-pulse-BWeLPl82.js → daily-pulse-B9ghvwbS.js} +1 -1
  128. package/dist/client/assets/{discover-CCHDOxkE.js → discover-D3Nm5A8p.js} +1 -1
  129. package/dist/client/assets/{domain-settings-BrlbYDBP.js → domain-settings-BpExaUek.js} +1 -1
  130. package/dist/client/assets/{drawer-C8pd-9h5.js → drawer-BVpga17l.js} +1 -1
  131. package/dist/client/assets/{editor-BQUfQi3X.js → editor-BcjWwrMC.js} +1 -1
  132. package/dist/client/assets/{editor-classes-DeM_8BMv.js → editor-classes-9_ermL6z.js} +1 -1
  133. package/dist/client/assets/{empty-state-P8DRc5l5.js → empty-state-CP7ytH69.js} +1 -1
  134. package/dist/client/assets/{empty-state-DnXn-oXP.js → empty-state-Dlb5JOR7.js} +1 -1
  135. package/dist/client/assets/{experiments-tab-Dj_UXlje.js → experiments-tab-DBXkFRuH.js} +1 -1
  136. package/dist/client/assets/{experiments-tab-choice-CkKpewiH.js → experiments-tab-choice-BmmhKG2V.js} +1 -1
  137. package/dist/client/assets/{extract-connection-data-Bv4y_ppm.js → extract-connection-data-BII4xsnj.js} +1 -1
  138. package/dist/client/assets/{feature-gate-CeySSZwi.js → feature-gate-CNe95GU0.js} +1 -1
  139. package/dist/client/assets/{feature-paywall-DtZqXAFQ.js → feature-paywall-DmA4KYPT.js} +1 -1
  140. package/dist/client/assets/{file-explorer-CPhsOyRV.js → file-explorer-D5Ll5qrd.js} +1 -1
  141. package/dist/client/assets/{file-preview-B58y6F5R.js → file-preview-BwyLadss.js} +1 -1
  142. package/dist/client/assets/{file-share-button-Cvb6TL3d.js → file-share-button-DFaqeXzB.js} +1 -1
  143. package/dist/client/assets/{file-type-icon-qeWcetSB.js → file-type-icon-uRpzbNga.js} +1 -1
  144. package/dist/client/assets/{folder-icon-DN6fGLYE.js → folder-icon-Bd_My4_g.js} +1 -1
  145. package/dist/client/assets/{form-BIDT1Ue4.js → form-B2vutj6x.js} +1 -1
  146. package/dist/client/assets/{general-D_xrCx6_.js → general-BH_d0ya5.js} +1 -1
  147. package/dist/client/assets/{held-block-view-DAPwji26.js → held-block-view-Bm0NqUES.js} +3 -3
  148. package/dist/client/assets/{home-BgI7ZNrl.js → home-BJTijmx2.js} +1 -1
  149. package/dist/client/assets/{hosted-publish-feedback-BFYHRRPf.js → hosted-publish-feedback-DWBNwe6Q.js} +1 -1
  150. package/dist/client/assets/{icon-button-DSMd1qL1.js → icon-button-BsJh55bB.js} +1 -1
  151. package/dist/client/assets/{index-oqricAgA.js → index-803Ya6Hj.js} +1 -1
  152. package/dist/client/assets/{index-BDmPHxvf.js → index-BBCsE5y9.js} +1 -1
  153. package/dist/client/assets/{index-COUcDTIR.js → index-BO8-nMjM.js} +1 -1
  154. package/dist/client/assets/{index-Cu6YVL4w.js → index-BfFT6w4U.js} +1 -1
  155. package/dist/client/assets/{index-O_xtfziX.js → index-BfhDQnqO.js} +1 -1
  156. package/dist/client/assets/{index-BG1gU17W.js → index-Bq8ZC2tF.js} +1 -1
  157. package/dist/client/assets/{index-B94uTMNH.js → index-CgXFpgGW.js} +1 -1
  158. package/dist/client/assets/{index-BCDmEpzR.js → index-CnkKC8Ik.js} +1 -1
  159. package/dist/client/assets/{index-BxQkdZTK.js → index-D4BS6nSR.js} +1 -1
  160. package/dist/client/assets/{index-BqutwFSm.js → index-DXP9kVQg.js} +5 -5
  161. package/dist/client/assets/{index-Bk9GYF9h.js → index-DdaTr6N1.js} +1 -1
  162. package/dist/client/assets/{index-DX3l6VgM.js → index-Dlxfs42h.js} +1 -1
  163. package/dist/client/assets/{index-H6qehDl6.js → index-M1mc__PQ.js} +1 -1
  164. package/dist/client/assets/{index-CWPTQWeO.js → index-pN79kngB.js} +1 -1
  165. package/dist/client/assets/{index-redirect-Bt4gzxaD.js → index-redirect-DT2zSJzW.js} +1 -1
  166. package/dist/client/assets/{index-B_Vz7pw9.js → index-vnHlZy-T.js} +1 -1
  167. package/dist/client/assets/{infiniteQueryObserver-DCWN2zRB.js → infiniteQueryObserver-Bd0VUsPZ.js} +1 -1
  168. package/dist/client/assets/{infra-billing-ywaH9jxg.js → infra-billing-B14qXTdF.js} +1 -1
  169. package/dist/client/assets/{input-CpuPl1VL.js → input-C9HjOnkS.js} +1 -1
  170. package/dist/client/assets/{input-CsD5Q7QM.js → input-D7fi2U5v.js} +3 -3
  171. package/dist/client/assets/{integration-icon-C_aSliEO.js → integration-icon-DBOsWn_I.js} +1 -1
  172. package/dist/client/assets/{jira-icon-CYte4ad8.js → jira-icon-C33BaS_P.js} +1 -1
  173. package/dist/client/assets/{label-Ce-ZCIZn.js → label-Cmp7c-YE.js} +1 -1
  174. package/dist/client/assets/{layout-BN3gCJyG.js → layout-BKkemvgJ.js} +1 -1
  175. package/dist/client/assets/{legacy-agents-deep-mrP4uzb7.js → legacy-agents-deep-ChSexo0B.js} +1 -1
  176. package/dist/client/assets/{legacy-main-redirect-skPOzTvI.js → legacy-main-redirect-C3qVODA-.js} +1 -1
  177. package/dist/client/assets/library-CoS_wZqt.js +1 -0
  178. package/dist/client/assets/{login-Bqng4rrv.js → login-Cp-ImGks.js} +1 -1
  179. package/dist/client/assets/{markdown-Y9FReFEe.js → markdown-CIT6yohb.js} +1 -1
  180. package/dist/client/assets/{mcp-app-renderer-DrWXODkj.js → mcp-app-renderer-CscMxyZY.js} +1 -1
  181. package/dist/client/assets/{mcp-oauth-Mf3yN31G.js → mcp-oauth-BA0BQZDh.js} +1 -1
  182. package/dist/client/assets/{mcp-oauth-B1ojmT8l.js → mcp-oauth-DLzmg49T.js} +1 -1
  183. package/dist/client/assets/{members-Bl1zRjVM.js → members-B-RFetKJ.js} +1 -1
  184. package/dist/client/assets/{memory-MKr86D-6.js → memory-DVdyzWtP.js} +1 -1
  185. package/dist/client/assets/{mini-report-page-CJr2XkWD.js → mini-report-page-B3vzKRZQ.js} +1 -1
  186. package/dist/client/assets/{mock-board-CtHapNeM.js → mock-board-CyzK-z8x.js} +3 -3
  187. package/dist/client/assets/{monaco-editor-fuZZsh6j.js → monaco-editor-BkiGemdW.js} +1 -1
  188. package/dist/client/assets/monitoring-7MM8BkOt.js +1 -0
  189. package/dist/client/assets/{monitoring-stats-row-CfiYSb9F.js → monitoring-stats-row-cmFF1uXl.js} +1 -1
  190. package/dist/client/assets/{multi-select-BqD525y_.js → multi-select-mbRAgi-M.js} +1 -1
  191. package/dist/client/assets/{mustache-XoR-PEeZ.js → mustache-BFi17vNa.js} +1 -1
  192. package/dist/client/assets/{named-rule-uses-BbtWVVld.js → named-rule-uses-0XrHKY4d.js} +1 -1
  193. package/dist/client/assets/{new-project-dialog-BRBdOtjX.js → new-project-dialog-CFuU9Fex.js} +1 -1
  194. package/dist/client/assets/{oauth-callback-CZuAW6K7.js → oauth-callback-DCnaXIP6.js} +1 -1
  195. package/dist/client/assets/{oauth-callback-ai-provider-6NJDakak.js → oauth-callback-ai-provider-DqreNso7.js} +1 -1
  196. package/dist/client/assets/{onboarding-aHBbCiCh.js → onboarding-DY6XV2ia.js} +1 -1
  197. package/dist/client/assets/{openai-conversation-Ds3XswsL.js → openai-conversation-XrS65AgH.js} +1 -1
  198. package/dist/client/assets/{optimistic-project-sidebar-views-w9Ct7FMs.js → optimistic-project-sidebar-views-BtIXlxnT.js} +1 -1
  199. package/dist/client/assets/{order-monitor-day-CA2fWj1y.js → order-monitor-day-CaKTKtbu.js} +1 -1
  200. package/dist/client/assets/{organization-choice-D4aq2Nxu.js → organization-choice-BEWDPurT.js} +1 -1
  201. package/dist/client/assets/{orgs-kp47NygQ.js → orgs-CjL3pMaN.js} +1 -1
  202. package/dist/client/assets/{page-seo-form-C-3Oyqrm.js → page-seo-form-Dur3JbA9.js} +1 -1
  203. package/dist/client/assets/{pair-Dc1F6KjY.js → pair-BmrRVXOS.js} +1 -1
  204. package/dist/client/assets/{parse-sections-CRdFubPB.js → parse-sections-BcSYXVXt.js} +1 -1
  205. package/dist/client/assets/{plan-CmzQmIDy.js → plan-CTsjyq8s.js} +1 -1
  206. package/dist/client/assets/{plan-ladder-Dqd8xMeE.js → plan-ladder-Cza5dGz3.js} +1 -1
  207. package/dist/client/assets/{popover-VBk0ee-p.js → popover-CHPTQAbV.js} +1 -1
  208. package/dist/client/assets/{post-calendar-DwNGscjq.js → post-calendar-B513WTnl.js} +1 -1
  209. package/dist/client/assets/{post-editor-BEoWoH05.js → post-editor-BqQxp3PR.js} +1 -1
  210. package/dist/client/assets/{preview-content-DRmpsOLy.js → preview-content-BpX8kzUA.js} +1 -1
  211. package/dist/client/assets/{preview-dialog-dWAdST9o.js → preview-dialog-ChrHWNp0.js} +1 -1
  212. package/dist/client/assets/{preview-panel-BJLsJJcg.js → preview-panel-B_o720sp.js} +1 -1
  213. package/dist/client/assets/{preview-tab-DZ8ks1YP.js → preview-tab-VPQhgJ4-.js} +3 -3
  214. package/dist/client/assets/{product-picker-dialog-MPHTgKXX.js → product-picker-dialog-CSG3gjCs.js} +1 -1
  215. package/dist/client/assets/{profile-Dd0_s4VG.js → profile-Bn1Sq0Az.js} +1 -1
  216. package/dist/client/assets/{project-app-view-BtOq7ZWp.js → project-app-view-BEQRVHHw.js} +1 -1
  217. package/dist/client/assets/{project-apps-CqjnVLMe.js → project-apps-W3hZYCeW.js} +1 -1
  218. package/dist/client/assets/project-feed-C6QLVf0-.js +1 -0
  219. package/dist/client/assets/{project-icon-DtQEqIYx.js → project-icon-FtyZUi38.js} +1 -1
  220. package/dist/client/assets/project-reports-BZTJvUsq.js +1 -0
  221. package/dist/client/assets/project-tasks-BAIRrbcm.js +1 -0
  222. package/dist/client/assets/{projects-cYRTCGsM.js → projects-CIKPl0Yp.js} +1 -1
  223. package/dist/client/assets/{projects-empty-state-CaYoBzMW.js → projects-empty-state-CjoNYa-z.js} +1 -1
  224. package/dist/client/assets/{prompts-Sb2iWGQw.js → prompts-M_FbjiLj.js} +1 -1
  225. package/dist/client/assets/record-editor-9mazgRGm.js +1 -0
  226. package/dist/client/assets/{redirect-editor-BG_05zsK.js → redirect-editor-BwwUSQxi.js} +1 -1
  227. package/dist/client/assets/{releases-api-RCTgo6g_.js → releases-api-DSGiRElA.js} +1 -1
  228. package/dist/client/assets/reports-BsCQejo7.js +1 -0
  229. package/dist/client/assets/{reports-CtmBtrB8.js → reports-CxRPHm_l.js} +1 -1
  230. package/dist/client/assets/{reports-onboarding-BzWzS8Md.js → reports-onboarding-CbQXVyKy.js} +1 -1
  231. package/dist/client/assets/{reports-tab-BTBssl4Z.js → reports-tab-B8iWv-rw.js} +2 -2
  232. package/dist/client/assets/{repositories-BKZPSNVR.js → repositories-BICbSb7T.js} +1 -1
  233. package/dist/client/assets/repositories-CVTBmf1e.js +1 -0
  234. package/dist/client/assets/{repository-binding-UPUU8iTD.js → repository-binding-YiwD2eOf.js} +1 -1
  235. package/dist/client/assets/{repository-import-picker-Cgqnl0_u.js → repository-import-picker-DzEhAaUN.js} +1 -1
  236. package/dist/client/assets/{repository-picker-BGNbJ5FK.js → repository-picker-a8LTQxa8.js} +1 -1
  237. package/dist/client/assets/{require-capability-Fl7myTcy.js → require-capability-D_Qefhqc.js} +1 -1
  238. package/dist/client/assets/{required-auth-layout-DGUYFPwh.js → required-auth-layout-XwFjudX9.js} +1 -1
  239. package/dist/client/assets/{reset-password-vxbjXaOx.js → reset-password-CvVGN4xc.js} +1 -1
  240. package/dist/client/assets/{resizable-2wUgP6NM.js → resizable-DWfYJIwa.js} +1 -1
  241. package/dist/client/assets/{resolve-tab-icon-CXm2cUKs.js → resolve-tab-icon-Dest6_yi.js} +1 -1
  242. package/dist/client/assets/{review-settings-BMj11lsi.js → review-settings-BI0dc4QM.js} +1 -1
  243. package/dist/client/assets/{roles-D4Qgb0OR.js → roles-CCPaE4jh.js} +1 -1
  244. package/dist/client/assets/route-BCq6M-76.js +1 -0
  245. package/dist/client/assets/{route-BhW-SwkC.js → route-CSAN_5-V.js} +1 -1
  246. package/dist/client/assets/{route-B3dhLyR7.js → route-DHt154LD.js} +1 -1
  247. package/dist/client/assets/{sandbox-lifecycle-context-BrAJV0hd.js → sandbox-lifecycle-context-BT12FjqU.js} +1 -1
  248. package/dist/client/assets/{schema-7_06wAgs.js → schema-BIYky4vn.js} +1 -1
  249. package/dist/client/assets/{schema-DHeACN0H.js → schema-Dfn1mNtT.js} +1 -1
  250. package/dist/client/assets/{scroll-area-56TNtyKH.js → scroll-area-BHwqFep-.js} +1 -1
  251. package/dist/client/assets/{search-input-Zdy1mSae.js → search-input-C11NnV4N.js} +1 -1
  252. package/dist/client/assets/{search-toggle-DkaLKnSY.js → search-toggle-DakKinEX.js} +1 -1
  253. package/dist/client/assets/{secret-picker-B5fM64mM.js → secret-picker-DtkzXeIv.js} +1 -1
  254. package/dist/client/assets/{secrets-DyW2ssCW.js → secrets-DIH5QJ98.js} +1 -1
  255. package/dist/client/assets/{section-array-field-rBWQHh7r.js → section-array-field-C72n2ZhZ.js} +1 -1
  256. package/dist/client/assets/{sections-DlaCV9cl.js → sections-CAN_PdBk.js} +1 -1
  257. package/dist/client/assets/{sections-editor-BDKjqTEY.js → sections-editor-Cd4q9MoC.js} +1 -1
  258. package/dist/client/assets/{select-qBldsuZB.js → select-Q4_XsOVo.js} +1 -1
  259. package/dist/client/assets/{select-model-TCy_ghzu.js → select-model-MW3O4lX_.js} +1 -1
  260. package/dist/client/assets/{seo-editor-BLOTxVNW.js → seo-editor-93oAxlvN.js} +1 -1
  261. package/dist/client/assets/{separator-DZ0CgMqF.js → separator-CNzy--4A.js} +1 -1
  262. package/dist/client/assets/settings-tab-DixJcWNv.js +1 -0
  263. package/dist/client/assets/{sheet-D-DL4PyF.js → sheet-Ddci2wx1.js} +1 -1
  264. package/dist/client/assets/{shell-layout-DKjamnSj.js → shell-layout-BZ9W6l0o.js} +1 -1
  265. package/dist/client/assets/{site-draft-actions-DQJmjCxq.js → site-draft-actions-DnPUD_C_.js} +1 -1
  266. package/dist/client/assets/{site-draft-view-C5NGRcIz.js → site-draft-view-COShQLFX.js} +2 -2
  267. package/dist/client/assets/{site-editor-toast-UJBsXoYS.js → site-editor-toast-BvgrSnOk.js} +1 -1
  268. package/dist/client/assets/site-editor-up38_Odl.js +1 -0
  269. package/dist/client/assets/{skills-De822NM4.js → skills-77lSKqgE.js} +1 -1
  270. package/dist/client/assets/{slider-DKsnyXsn.js → slider-OXnTX_hS.js} +1 -1
  271. package/dist/client/assets/{sortable.esm-BPDXfku7.js → sortable.esm-Dduk6hvS.js} +1 -1
  272. package/dist/client/assets/{sso-ClBwUtr5.js → sso-Bv_RpsPv.js} +1 -1
  273. package/dist/client/assets/{suggestion-CgPYCK9k.js → suggestion-DEz_OZWr.js} +1 -1
  274. package/dist/client/assets/{switch-CZb-mYsM.js → switch-wL2tWtOE.js} +1 -1
  275. package/dist/client/assets/{symbol-CyQNqsns.js → symbol-D_xjpHRi.js} +1 -1
  276. package/dist/client/assets/{synced-repos-D4QeoEDp.js → synced-repos-Cs1VXg7E.js} +1 -1
  277. package/dist/client/assets/{tab-icon-glyph-DSl4L3DW.js → tab-icon-glyph-BADTh2WG.js} +1 -1
  278. package/dist/client/assets/{table-V2ahNRZT.js → table-BkLIZnAv.js} +1 -1
  279. package/dist/client/assets/{tabs-Cb1EEFWU.js → tabs-CVl3VdYT.js} +1 -1
  280. package/dist/client/assets/{task-assignee-avatar-Wqv60Mfs.js → task-assignee-avatar-gBuyyXUg.js} +1 -1
  281. package/dist/client/assets/{task-board-Cp4gjjuc.js → task-board-2YplgWyy.js} +1 -1
  282. package/dist/client/assets/{task-route-DKYWwLvg.js → task-route-Ctk36kOK.js} +1 -1
  283. package/dist/client/assets/{task-status-Ne5UIAX6.js → task-status-DUKSbYVL.js} +1 -1
  284. package/dist/client/assets/{taskboard-analytics-adljo_lT.js → taskboard-analytics-DaCvc-71.js} +1 -1
  285. package/dist/client/assets/{tasks--ex7OH66.js → tasks-BsieuQri.js} +1 -1
  286. package/dist/client/assets/tasks-iYlpdedm.js +1 -0
  287. package/dist/client/assets/{textarea-DIMcwKj_.js → textarea-RpjQmTzH.js} +1 -1
  288. package/dist/client/assets/{thread-analytics-CqnVp9Hp.js → thread-analytics-BWN6zDM5.js} +1 -1
  289. package/dist/client/assets/{thread-intent-BdGEZQ5d.js → thread-intent-BpPFlY-9.js} +1 -1
  290. package/dist/client/assets/{thread-route-BGD5ZDLj.js → thread-route-CKuZ7ciN.js} +1 -1
  291. package/dist/client/assets/{thread-route-DPiunvH4.js → thread-route-DGdpPDSq.js} +1 -1
  292. package/dist/client/assets/{thread-sheet-body-DFdozxob.js → thread-sheet-body-WbTA2OuC.js} +1 -1
  293. package/dist/client/assets/{time-range-picker-CyphWImg.js → time-range-picker-u_cAZwxl.js} +1 -1
  294. package/dist/client/assets/{toggle-group-DQ8R6Md0.js → toggle-group-DRmAgRFX.js} +1 -1
  295. package/dist/client/assets/{tool-namespace-BWBiQhUq.js → tool-namespace-BhiIe8FJ.js} +1 -1
  296. package/dist/client/assets/{toolbar-icon-button-C7qFILLP.js → toolbar-icon-button-FAf4DETX.js} +1 -1
  297. package/dist/client/assets/{tooltip-RrBkgkDb.js → tooltip-BvL0CKmO.js} +1 -1
  298. package/dist/client/assets/{tooltipContext-C2tBhXWj.js → tooltipContext-BR1SGjH8.js} +1 -1
  299. package/dist/client/assets/{track-C7T3Q_NS.js → track-D5rgxtnt.js} +1 -1
  300. package/dist/client/assets/{types-CRdMnwkp.js → types-Bq5bSX6k.js} +1 -1
  301. package/dist/client/assets/{url-slug-DUBa3zVK.js → url-slug-AXj6kGjK.js} +1 -1
  302. package/dist/client/assets/{usage-stats-C9C7AU7H.js → usage-stats-CZL8SgMa.js} +1 -1
  303. package/dist/client/assets/{use-ai-providers-DVBJIa-_.js → use-ai-providers-vfaNPABY.js} +1 -1
  304. package/dist/client/assets/{use-apply-named-rule-CjRIJJWs.js → use-apply-named-rule-CS11akFD.js} +1 -1
  305. package/dist/client/assets/{use-automations-DIvmuRlE.js → use-automations-6z_lBKqG.js} +1 -1
  306. package/dist/client/assets/{use-autosave-D0tBxxQ8.js → use-autosave-BR9Ac4LE.js} +1 -1
  307. package/dist/client/assets/{use-chat-layout-state-Aa4VqEQx.js → use-chat-layout-state-BqGllE7O.js} +1 -1
  308. package/dist/client/assets/{use-clock-tick-UQl4M1J5.js → use-clock-tick-BYDkzKDm.js} +1 -1
  309. package/dist/client/assets/{use-cms-publish-actions-c5y_nfEn.js → use-cms-publish-actions-Dr8M4Bv1.js} +1 -1
  310. package/dist/client/assets/{use-connect-companion-BPn2REj-.js → use-connect-companion-DZyUNH4L.js} +1 -1
  311. package/dist/client/assets/{use-connection-DVSix2AF.js → use-connection-BvDS_cY8.js} +1 -1
  312. package/dist/client/assets/{use-copy-C6zGg71V.js → use-copy-tOjayyPs.js} +1 -1
  313. package/dist/client/assets/{use-create-virtual-mcp-5nIGXG87.js → use-create-virtual-mcp-UX7IeI0P.js} +1 -1
  314. package/dist/client/assets/{use-date-fns-locale-DS-Izx-9.js → use-date-fns-locale-Curbsw6l.js} +1 -1
  315. package/dist/client/assets/{use-debounced-autosave-DwOKfyXg.js → use-debounced-autosave-CbEMLgOt.js} +1 -1
  316. package/dist/client/assets/{use-debounced-value-Chk6vawl.js → use-debounced-value-BOr4oihA.js} +1 -1
  317. package/dist/client/assets/{use-deco-credits-B32-9i_a.js → use-deco-credits-ZadQhSnG.js} +1 -1
  318. package/dist/client/assets/{use-decopilot-events-B5qoi0Wr.js → use-decopilot-events-CrlAnQ8d.js} +1 -1
  319. package/dist/client/assets/{use-delete-connection-DLjMAPog.js → use-delete-connection-Dvzrgmmg.js} +1 -1
  320. package/dist/client/assets/{use-deployment-admin-CuHcgI6F.js → use-deployment-admin-BhOJyjAy.js} +1 -1
  321. package/dist/client/assets/{use-fast-preview-draft-url-eu2nT6W8.js → use-fast-preview-draft-url-Bug7N1O2.js} +1 -1
  322. package/dist/client/assets/{use-file-configs-Cr0gwmd8.js → use-file-configs-Dd-ygMY7.js} +1 -1
  323. package/dist/client/assets/{use-inbox-feed-D4K-P1LA.js → use-inbox-feed-BHLvRufN.js} +1 -1
  324. package/dist/client/assets/{use-infinite-scroll-asA1-tf9.js → use-infinite-scroll-CO7fuxbC.js} +1 -1
  325. package/dist/client/assets/{use-join-requests-CkkZxs_r.js → use-join-requests-b-1Wcsbb.js} +1 -1
  326. package/dist/client/assets/{use-main-panel-tabs-Dy-Y3oMc.js → use-main-panel-tabs-frLY0CIy.js} +1 -1
  327. package/dist/client/assets/{use-mcp-auth-status-DqE0wx72.js → use-mcp-auth-status-tTpBtoMI.js} +1 -1
  328. package/dist/client/assets/{use-mcp-client-liHKfpfj.js → use-mcp-client-DGWpjcL5.js} +1 -1
  329. package/dist/client/assets/{use-mcp-prompts-cYDRO3Kp.js → use-mcp-prompts-3ZHImsTq.js} +1 -1
  330. package/dist/client/assets/{use-mcp-tools-iSL8qiEx.js → use-mcp-tools-Ce5gsgJo.js} +1 -1
  331. package/dist/client/assets/{use-mobile-XeH7HFdg.js → use-mobile-Do4XIu0C.js} +1 -1
  332. package/dist/client/assets/{use-move-blocks-Bkqfi8fY.js → use-move-blocks-TPapsiRC.js} +1 -1
  333. package/dist/client/assets/{use-navigate-to-agent-Ba4TBBON.js → use-navigate-to-agent-BGJCBCq8.js} +1 -1
  334. package/dist/client/assets/{use-org-fs-DNlQgLUG.js → use-org-fs-BoEUMisn.js} +1 -1
  335. package/dist/client/assets/{use-org-repo-syncs-MkA3X0Ud.js → use-org-repo-syncs-CO85gFKc.js} +1 -1
  336. package/dist/client/assets/{use-org-sso-ZqYOnTZ9.js → use-org-sso-BLpWw2Jv.js} +1 -1
  337. package/dist/client/assets/{use-organization-roles-cbSQbTbx.js → use-organization-roles-5x40epbU.js} +1 -1
  338. package/dist/client/assets/{use-organization-settings-C_uyrpUI.js → use-organization-settings-DDvTqhI9.js} +1 -1
  339. package/dist/client/assets/{use-panel-navigate-DIX895ki.js → use-panel-navigate-Be0CShye.js} +1 -1
  340. package/dist/client/assets/{use-project-native-view-presence-r0Gkk_5E.js → use-project-native-view-presence-WdxwZN6P.js} +1 -1
  341. package/dist/client/assets/{use-project-scope-C98g-M0M.js → use-project-scope-DE777QKf.js} +1 -1
  342. package/dist/client/assets/{use-recent-apps-Bp9mI3Hn.js → use-recent-apps-TYM0lv4p.js} +1 -1
  343. package/dist/client/assets/{use-releases-RUoL1asP.js → use-releases-QStvyekn.js} +1 -1
  344. package/dist/client/assets/{use-reports-diagnostic-CJqF-DdT.js → use-reports-diagnostic-DeqRNUA4.js} +1 -1
  345. package/dist/client/assets/{use-sandbox-events-COXHFEXL.js → use-sandbox-events-DtcmeL0C.js} +1 -1
  346. package/dist/client/assets/{use-secrets-BLT_VvH0.js → use-secrets-BppyIMno.js} +1 -1
  347. package/dist/client/assets/{use-section-preview-base-BHeBUNI1.js → use-section-preview-base-BFCngQWb.js} +1 -1
  348. package/dist/client/assets/{use-session-runtime-Cass8jgv.js → use-session-runtime-CTQ2Nf18.js} +1 -1
  349. package/dist/client/assets/{use-sidebar-collapsed-DTxIOS-x.js → use-sidebar-collapsed-C-iF4REf.js} +1 -1
  350. package/dist/client/assets/{use-tags-CrjLMu_-.js → use-tags-h3GwNkiJ.js} +1 -1
  351. package/dist/client/assets/{use-task-board-analytics-C2n2_51H.js → use-task-board-analytics-CCSjkUSs.js} +1 -1
  352. package/dist/client/assets/{use-task-board-events-D5XnGFaO.js → use-task-board-events-upfviPMy.js} +1 -1
  353. package/dist/client/assets/{use-task-board-item-prs-CSoHUx1b.js → use-task-board-item-prs-Clo-13Hl.js} +1 -1
  354. package/dist/client/assets/{use-task-metadata-C7aK-HiB.js → use-task-metadata-5TM0QDKC.js} +1 -1
  355. package/dist/client/assets/{use-thread-analytics-u-QN-pcv.js → use-thread-analytics-BuuwXXBL.js} +1 -1
  356. package/dist/client/assets/{use-thread-outputs-BkxphpfI.js → use-thread-outputs-B06BrpVU.js} +1 -1
  357. package/dist/client/assets/useInfiniteQuery-IMHm6XfO.js +1 -0
  358. package/dist/client/assets/{useQueries-Rmt36TSN.js → useQueries-DfqtklDo.js} +1 -1
  359. package/dist/client/assets/useSuspenseInfiniteQuery-DsI-d6iZ.js +1 -0
  360. package/dist/client/assets/{users-DaTm0LIa.js → users-C0mukYlh.js} +1 -1
  361. package/dist/client/assets/{utils-DF3h1YFq.js → utils-ogbk5u13.js} +1 -1
  362. package/dist/client/assets/{variant-calendar-6x1UYIC-.js → variant-calendar-B5u69hCi.js} +1 -1
  363. package/dist/client/assets/{variant-matcher-override-nKaBGWQ5.js → variant-matcher-override-CiBkn8tl.js} +1 -1
  364. package/dist/client/assets/{view-header-DhqNDwWw.js → view-header-C1YOgRu_.js} +1 -1
  365. package/dist/client/assets/{virtual-mcp-Bp27ph4n.js → virtual-mcp-DCCUgWQO.js} +1 -1
  366. package/dist/client/assets/{watch-sse-pool-62BerBh7.js → watch-sse-pool-CKpL2EpB.js} +1 -1
  367. package/dist/client/index.html +1 -1
  368. package/dist/server/server.js +660 -660
  369. package/package.json +1 -1
  370. package/dist/client/assets/agent-app-C7973U1b.js +0 -1
  371. package/dist/client/assets/agent-deck-DO5ISfla.js +0 -1
  372. package/dist/client/assets/agent-experiments-ZN8qK48q.js +0 -1
  373. package/dist/client/assets/agent-library-CZ7enUY0.js +0 -1
  374. package/dist/client/assets/agent-library-file-Isa4z3AB.js +0 -1
  375. package/dist/client/assets/agent-monitor-C2K3A6Za.js +0 -1
  376. package/dist/client/assets/agent-settings-ChMTEbgI.js +0 -1
  377. package/dist/client/assets/agent-site-editor-code-C_tlYT7V.js +0 -2
  378. package/dist/client/assets/agent-site-editor-content-BacOmakn.js +0 -1
  379. package/dist/client/assets/agent-site-editor-preview-WL-FCHY4.js +0 -1
  380. package/dist/client/assets/agent-view-BkMQ3DXr.js +0 -1
  381. package/dist/client/assets/api-keys-BDj5b6nN.js +0 -1
  382. package/dist/client/assets/library-C8H8nQx2.js +0 -1
  383. package/dist/client/assets/monitoring-CmKUhbQ7.js +0 -1
  384. package/dist/client/assets/project-feed-CykWxmDT.js +0 -1
  385. package/dist/client/assets/project-reports-BMBo-hKU.js +0 -1
  386. package/dist/client/assets/project-tasks-DVakkLu4.js +0 -1
  387. package/dist/client/assets/record-editor-B606zRBI.js +0 -1
  388. package/dist/client/assets/reports-BsuVeMpD.js +0 -1
  389. package/dist/client/assets/repositories-CNBPJbW9.js +0 -1
  390. package/dist/client/assets/route-D6RbDGc3.js +0 -1
  391. package/dist/client/assets/settings-tab-DU-L5-CZ.js +0 -1
  392. package/dist/client/assets/site-editor-BfXsVuJf.js +0 -1
  393. package/dist/client/assets/tasks-D4NYojIN.js +0 -1
  394. package/dist/client/assets/useInfiniteQuery-BYZFn0Hg.js +0 -1
  395. package/dist/client/assets/useSuspenseInfiniteQuery-BjfsGxpD.js +0 -1
@@ -1 +1 @@
1
- import{c as L,a4 as ae,a as pe,aq as Ce,K as fe,m as me,b as V,r as D,l as se,j as n,h as Pe,B as qe,aX as ye,aW as Ie,M as pt,C as he,x as Wt,aY as Yt,w as Zt,v as Xt,D as Jt,ab as Qt,aZ as es,ax as xt,t as ts,ay as ss,d as Me,n as st,a_ as ns,f as je,T as nt,ad as as,k as gt,e as rs,u as Ae,a$ as is,b0 as ls,O as bt,b1 as os,b2 as cs,N as ds,b3 as us,P as De}from"./index-BqutwFSm.js";import{i as We}from"./AlertCircle-BgO0RShT.js";import{G as fs,H as at,A as ve,I as ms,J as hs,j as ps,K as xs,L as gs,M as bs,N as vt,O as vs,n as ys,k as js,m as Ss}from"./agent-icon-CA2ls6V4.js";import{c as ks}from"./use-sidebar-collapsed-DTxIOS-x.js";import{T as Ne}from"./toolbar-icon-button-C7qFILLP.js";import{C as q,w as Ts}from"./index-BxQkdZTK.js";import{s as yt,C as Ns,u as _s,V as ws,a as Cs}from"./input-CsD5Q7QM.js";import{u as Le,b as Ye,c as $e,d as jt,e as Ps,s as Is}from"./chat-context-CRAqcBEA.js";import{u as St}from"./use-session-runtime-Cass8jgv.js";import{u as Ms,s as kt}from"./use-ai-providers-DVBJIa-_.js";import{b as Tt,a as As,u as Ls}from"./use-organization-settings-C_uyrpUI.js";import{i as $s}from"./CheckCircle-BoFFOiJR.js";import{s as rt}from"./XClose-B88tJS8W.js";import{a as Fe,b as Fs,c as Nt,g as _t}from"./repository-binding-UPUU8iTD.js";import{I as wt}from"./integration-icon-C_aSliEO.js";import{c as Es}from"./use-decopilot-events-B5qoi0Wr.js";import{t as Ze}from"./ChevronUp-DQBYMpqT.js";import{O as Rs}from"./pair-Dc1F6KjY.js";import{u as Os,a as Bs}from"./use-thread-outputs-BkxphpfI.js";import{u as Ds}from"./use-deco-credits-B32-9i_a.js";import{a as zs}from"./experiments-tab-choice-CkKpewiH.js";import{g as Ct,u as Gs,n as Hs,a as Ks}from"./use-releases-RUoL1asP.js";import{u as Vs,d as Pt,a as Xe,b as Je,c as It,e as Us}from"./thread-intent-BdGEZQ5d.js";import{f as qs,c as Mt,d as Ws}from"./use-navigate-to-agent-Ba4TBBON.js";import{o as Ys,s as Zs,u as Xs,S as Js}from"./sandbox-lifecycle-context-BrAJV0hd.js";import{E as At}from"./empty-state-P8DRc5l5.js";import{t as Qs,m as en,u as tn}from"./use-chat-layout-state-Aa4VqEQx.js";import{C as it}from"./index-DX3l6VgM.js";import{a as Lt,b as $t,P as Ft}from"./popover-VBk0ee-p.js";import{T as Ee,a as Re,c as Oe}from"./tooltip-RrBkgkDb.js";import{T as sn,a as nn}from"./toggle-group-DQ8R6Md0.js";import{a as Qe,f as an,L as rn,s as ln}from"./shell-layout-DKjamnSj.js";import{u as Et,a as et,r as on,b as Rt,c as cn,d as dn}from"./thread-route-DPiunvH4.js";import{c as un,C as fn,a as mn,b as hn,e as pn,d as xn}from"./command-6ewscZzU.js";import{i as Ot}from"./ZoomOut-Dg4JYL36.js";import{g as gn,S as bn}from"./task-status-Ne5UIAX6.js";import{u as vn}from"./use-clock-tick-UQl4M1J5.js";import{a as Bt,u as yn}from"./use-panel-navigate-DIX895ki.js";import{u as Dt}from"./use-main-panel-tabs-Dy-Y3oMc.js";import{T as _e}from"./tab-icon-glyph-DSl4L3DW.js";import{a as jn}from"./UserSquare-DoHQfmRI.js";import{b as Sn,c as zt,S as kn,d as Tn}from"./select-qBldsuZB.js";import{S as Nn}from"./use-sandbox-events-COXHFEXL.js";import{L as _n}from"./project-apps-CqjnVLMe.js";import{L as tt,a as wn}from"./legacy-main-redirect-skPOzTvI.js";import{u as Cn}from"./use-mobile-XeH7HFdg.js";import{L as Pn}from"./preview-dialog-dWAdST9o.js";import{O as In}from"./markdown-Y9FReFEe.js";import{B as lt}from"./blocks-preview-workspace-context-Cfqwt0fl.js";import{p as Mn}from"./virtual-mcp-Bp27ph4n.js";import"./Tool01-CDUtHuFU.js";import"./ArrowUp-DGj1a1JQ.js";import"./ArrowLeft-CLIbFvcM.js";import"./LinkBroken01-BCegKYMu.js";import"./ShoppingBag01-EO0f4EEB.js";import"./Building02-DTlG5UDd.js";import"./ChevronSelectorVertical-DYan7Eqw.js";import"./Copy01-BPOEtZ0I.js";import"./CreditCard01-BgcDg6Po.js";import"./DotsVertical-bVrzKljT.js";import"./Image01-CYMd4B2w.js";import"./Globe04-DROK8sB6.js";import"./SwitchHorizontal01-VCz6eoXn.js";import"./Key01-CcnI3N_J.js";import"./Link01-BaCE2stQ.js";import"./Minus-YbXjN_Ds.js";import"./Monitor01-aloCOxdR.js";import"./Sun-tqaV4Ycc.js";import"./Play-CKfAabLj.js";import"./Plus-DifrnWDP.js";import"./SearchMd-OM6lL3Xq.js";import"./Trash01-VJJht0QK.js";import"./Upload01-Dxk-zD3u.js";import"./Users01-CS7GcqAQ.js";import"./sheet-D-DL4PyF.js";import"./tool-namespace-BWBiQhUq.js";import"./drawer-C8pd-9h5.js";import"./collection-search-Dxv0FJfh.js";import"./use-mcp-client-liHKfpfj.js";import"./auth-B2v1KOAc.js";import"./use-mcp-prompts-cYDRO3Kp.js";import"./usage-stats-C9C7AU7H.js";import"./form-BIDT1Ue4.js";import"./label-Ce-ZCIZn.js";import"./utils-CVEq3hMx.js";import"./use-copy-C6zGg71V.js";import"./index-Cu6YVL4w.js";import"./checkbox-z1yY0VbG.js";import"./ai-providers-logos-DD3qZ33J.js";import"./feature-paywall-DtZqXAFQ.js";import"./plan-ladder-Dqd8xMeE.js";import"./icon-button-DSMd1qL1.js";import"./file-type-icon-qeWcetSB.js";import"./location-V0VwTJTt.js";import"./autosend-BUHDH46M.js";import"./chat-draft-D8MxxmMn.js";import"./tabs-Cb1EEFWU.js";import"./active-indicator-CCMhAsc_.js";import"./input-CpuPl1VL.js";import"./suggestion-CgPYCK9k.js";import"./use-org-fs-DNlQgLUG.js";import"./useInfiniteQuery-BYZFn0Hg.js";import"./infiniteQueryObserver-DCWN2zRB.js";import"./question-004-sINsf4GQ.js";import"./add-connection-dialog-DxVAYgn3.js";import"./extract-connection-data-Bv4y_ppm.js";import"./metadata-D72DunRR.js";import"./connection--HCyemnh.js";import"./url-slug-DUBa3zVK.js";import"./connection-card-CJzQ1R1a.js";import"./connection-slug-CITJ0kGN.js";import"./slugify-CEUa2lfQ.js";import"./textarea-DIMcwKj_.js";import"./use-connection-DVSix2AF.js";import"./schema-7_06wAgs.js";import"./connection-form-helpers-BhmC9tzU.js";import"./authenticate-and-persist-oauth-UWCdGiT0.js";import"./mcp-oauth-Mf3yN31G.js";import"./mcp-oauth-B1ojmT8l.js";import"./collection-tabs-k2c4oB2_.js";import"./badge-B275lbPZ.js";import"./use-infinite-scroll-asA1-tf9.js";import"./useSuspenseInfiniteQuery-BjfsGxpD.js";import"./use-task-board-events-D5XnGFaO.js";import"./task-board-Cp4gjjuc.js";import"./schema-DHeACN0H.js";import"./watch-sse-pool-62BerBh7.js";import"./backoff-CrEUbyZT.js";import"./collapsible-TgXdzaTW.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DrWXODkj.js";import"./types-CRdMnwkp.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./serial-task-queue-CGOeQgpr.js";import"./delay-CnY5UFtP.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./resizable-2wUgP6NM.js";import"./use-project-scope-C98g-M0M.js";import"./index-oqricAgA.js";import"./use-deployment-admin-CuHcgI6F.js";import"./admin-fetch-BhTJlAsX.js";import"./project-icon-DtQEqIYx.js";import"./new-project-dialog-BRBdOtjX.js";import"./repository-import-picker-Cgqnl0_u.js";import"./repository-picker-BGNbJ5FK.js";import"./use-debounced-value-Chk6vawl.js";import"./required-auth-layout-DGUYFPwh.js";import"./use-org-sso-ZqYOnTZ9.js";import"./index-B94uTMNH.js";import"./use-mcp-tools-iSL8qiEx.js";import"./resolve-tab-icon-CXm2cUKs.js";import"./use-task-metadata-C7aK-HiB.js";import"./preview-source-BsRLGWUP.js";import"./use-project-native-view-presence-r0Gkk_5E.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-Cr0gwmd8.js";import"./site-slug-DebpOoQq.js";import"./index-BdQq_4o_.js";import"./sandbox-url-D3mC8qhT.js";import"./preview-content-DRmpsOLy.js";import"./file-share-button-Cvb6TL3d.js";import"./file-preview-B58y6F5R.js";import"./utils-DF3h1YFq.js";import"./editor-BQUfQi3X.js";function An({isThreadLocked:t,hasCloudProviderKeys:e,sandboxOnlyChats:s,canRunClaudeCode:r}){return t?null:!e&&!(s&&r)?"provider":s&&!r?"claude-code-provider":null}function Ln(){const t=L.c(26),e=Ms(),s=Le(),r=Tt(),i=As("chat_harness_codex"),{org:a}=ae(),{data:o}=pe.useSession(),c=o?.user.id??"",u=Ce(),l=e.some(Fn);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&&!l;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 j=me(h);let y;t[9]!==a.id?(y=fe.githubCopilot(a.id),t[9]=a.id,t[10]=y):y=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&&!l;let g;t[13]!==y||t[14]!==v||t[15]!==x?(g={queryKey:y,queryFn:v,enabled:x},t[13]=y,t[14]=v,t[15]=x,t[16]=g):g=t[16];const b=me(g);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($n)||N.data?.connected!==!1?null:"codex-provider":An({isThreadLocked:s?.isThreadLocked??!1,hasCloudProviderKeys:e.length>0,sandboxOnlyChats:r,canRunClaudeCode:l||j.data?.connected!==!1||b.data?.connected!==!1||!!b.data?.orgShare})}function $n(t){return yt(t.providerId)}function Fn(t){return kt(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 En(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function Rn(t){const e=L.c(4),{items:s}=t;let r;e[0]!==s?(r=s.map(On),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 On(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 Bn(t){const e=L.c(33),{userTokens:s,assistantTokens:r,otherTokens:i}=t,a=V(),o=s+r+i,c=o>0?s/o*100:0,u=o>0?r/o*100:0,l=o>0?i/o*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]!==l?(f=l>0&&n.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${l}%`}}),e[4]=l,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 j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=j):j=e[10];let y;e[11]!==a||e[12]!==c?(y=a("chat.contextPanel.userPercent",{pct:c.toFixed(1)}),e[11]=a,e[12]=c,e[13]=y):y=e[13];let v;e[14]!==y?(v=n.jsxs("div",{className:"flex items-center gap-1.5",children:[j,n.jsx("span",{className:"text-xs text-muted-foreground",children:y})]}),e[14]=y,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 g;e[17]!==u||e[18]!==a?(g=a("chat.contextPanel.assistantPercent",{pct:u.toFixed(1)}),e[17]=u,e[18]=a,e[19]=g):g=e[19];let b;e[20]!==g?(b=n.jsxs("div",{className:"flex items-center gap-1.5",children:[x,n.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e[20]=g,e[21]=b):b=e[21];let S;e[22]!==l||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:l.toFixed(1)})})]}),e[22]=l,e[23]=i,e[24]=a,e[25]=S):S=e[25];let p;e[26]!==b||e[27]!==S||e[28]!==v?(p=n.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[v,b,S]}),e[26]=b,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 Dn(t){const e=L.c(14),{agentId:s,isError:r}=t,i=Fe(s),a=V();let o;e[0]!==i?.title||e[1]!==a?(o=i?.title??a("chat.subtask.subtaskNoun"),e[0]=i?.title,e[1]=a,e[2]=o):o=e[2];const c=o,u=i?.icon??null;let l;e[3]!==u||e[4]!==c?(l=n.jsx(wt,{icon:u,name:c,size:"xs",className:"size-6 rounded-md shrink-0"}),e[3]=u,e[4]=c,e[5]=l):l=e[5];const d=r?"text-destructive":"text-foreground";let m;e[6]!==d?(m=se("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]!==l||e[12]!==f?(h=n.jsxs(n.Fragment,{children:[l,f]}),e[11]=l,e[12]=f,e[13]=h):h=e[13],h}function zn(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 o;e[2]!==a?(o=n.jsx(wt,{icon:null,name:a,size:"xs",className:"size-6 rounded-md shrink-0"}),e[2]=a,e[3]=o):o=e[3];const c=s?"text-destructive":"text-foreground";let u;e[4]!==c?(u=se("shrink-0 font-medium",c),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==a||e[7]!==u?(l=n.jsx("span",{className:u,children:a}),e[6]=a,e[7]=u,e[8]=l):l=e[8];let d;return e[9]!==o||e[10]!==l?(d=n.jsxs(n.Fragment,{children:[o,l]}),e[9]=o,e[10]=l,e[11]=d):d=e[11],d}function Gn(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",o=s.state==="approval-requested";let c;e[0]!==a?(c=n.jsx(zn,{isError:a}),e[0]=a,e[1]=c):c=e[1];let u;e[2]!==r||e[3]!==a?(u=n.jsx(Dn,{agentId:r,isError:a}),e[2]=r,e[3]=a,e[4]=u):u=e[4];let l;e[5]!==c||e[6]!==u?(l=n.jsx(D.Suspense,{fallback:c,children:u}),e[5]=c,e[6]=u,e[7]=l):l=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]!==o||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"}):o?n.jsx(We,{size:12,className:"text-warning"}):n.jsx($s,{size:12,className:"text-success"})}),e[10]=o,e[11]=a,e[12]=i,e[13]=m):m=e[13];let f;return e[14]!==l||e[15]!==d||e[16]!==m?(f=n.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[l,d,m]}),e[14]=l,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Hn(t){const e=L.c(51),{onClose:s,back:r,className:i}=t,a=V(),[o,c]=D.useState(null),{messages:u}=Ye(),{activeTask:l}=$e(),{selectedModel:d,selectedVirtualMcp:m}=jt(),f=Ps(u),h=[...u].reverse().find(ta),j=h?.metadata?.usage,y=[...u].reverse().find(ea)?.metadata?.models?.thinking,v=h?.metadata?.modelLimits?.contextWindow??(!y||y.id===d?.modelId?d?.limits?.contextWindow:null)??null,x=j?.contextTokens??0,g=v&&v>0?(x/v*100).toFixed(1):null,b=u;let S;e[0]!==b?(S=b.filter(Qn).reduce(Jn,0),e[0]=b,e[1]=S):S=e[1];const p=S,k=u;let T;e[2]!==k?(T=k.filter(Xn).reduce(Zn,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??l?.created_at,M=P?.metadata?.created_at??l?.updated_at,A=u.filter(Yn),$=u.flatMap(qn),F=En(y?.id??d?.modelId),O=m?.title??"Super Agent",R=Es(),I=[{label:a("chat.contextPanel.sessionLabel"),value:l?.title??a("chat.contextPanel.newChat")},{label:a("chat.contextPanel.messagesLabel"),value:A.length},{label:a("chat.contextPanel.agentLabel"),value:O},...R?[{label:a("chat.contextPanel.modelLabel"),value:F}]:[],{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:g!==null?`${g}%`:"—"},{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(M)}];if(!l&&A.length===0){let G;e[4]!==i?(G=se("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 J;e[8]!==re?(J=n.jsx("span",{className:"text-sm font-medium text-foreground",children:re}),e[8]=re,e[9]=J):J=e[9];let Q;e[10]!==r?(Q=r?n.jsx(at,{size:14,className:"text-muted-foreground"}):n.jsx(rt,{size:14,className:"text-muted-foreground"}),e[10]=r,e[11]=Q):Q=e[11];let ee;e[12]!==s||e[13]!==Q?(ee=n.jsx("button",{type:"button",onClick:s,className:"flex size-6 items-center justify-center hover:bg-accent transition-colors rounded-lg",children:Q}),e[12]=s,e[13]=Q,e[14]=ee):ee=e[14];let ne;e[15]!==J||e[16]!==ee?(ne=n.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[J,ee]}),e[15]=J,e[16]=ee,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 te;e[20]!==ie?(te=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]=te):te=e[21];let oe;return e[22]!==ne||e[23]!==te||e[24]!==G?(oe=n.jsxs("div",{className:G,children:[ne,te]}),e[22]=ne,e[23]=te,e[24]=G,e[25]=oe):oe=e[25],oe}let z;e[26]!==i?(z=se("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",i),e[26]=i,e[27]=z):z=e[27];let E;e[28]!==a?(E=a("chat.contextPanel.title"),e[28]=a,e[29]=E):E=e[29];let H;e[30]!==E?(H=n.jsx("span",{className:"text-sm font-medium text-foreground",children:E}),e[30]=E,e[31]=H):H=e[31];let B;e[32]!==r?(B=r?n.jsx(at,{className:"size-3.5"}):n.jsx(rt,{className:"size-3.5"}),e[32]=r,e[33]=B):B=e[33];let U;e[34]!==s||e[35]!==B?(U=n.jsx(qe,{type:"button",variant:"ghost",size:"icon-sm",onClick:s,className:"text-muted-foreground",children:B}),e[34]=s,e[35]=B,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 X;e[42]!==Y?(X=n.jsx("span",{className:"text-xs text-muted-foreground",children:Y}),e[42]=Y,e[43]=X):X=e[43];let W;e[44]!==N||e[45]!==w||e[46]!==p?(W=n.jsx(Bn,{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]!==X||e[49]!==W?(le=n.jsxs("div",{className:"flex flex-col gap-3",children:[X,W]}),e[48]=X,e[49]=W,e[50]=le):le=e[50],n.jsxs("div",{className:z,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(Un)})]}),n.jsx(Rn,{items:I}),le,A.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:A.map(G=>{const re=G.metadata?.created_at,J=o?.id===G.id;return n.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:()=>c(J?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:se("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)})]}),J&&n.jsxs(n.Fragment,{children:[G.role==="assistant"&&(()=>{const Q=G.metadata?._request;if(!Q)return null;const ee=Q.systemSections??[],ne=Math.max(1,...ee.map(Vn)),ie=ee.reduce(Kn,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:[Q.activeTools??0," / ",Q.tools??0," ",a("chat.contextPanel.toolsActive")]})]}),ee.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")]})]}),ee.map((te,oe)=>{const ce=te.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${oe}`,xe=te.chars/ne*100,de=Math.round(te.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 Kn(t,e){return t+e.chars}function Vn(t){return t.chars}function Un(t,e){return n.jsx(Gn,{part:t},e)}function qn(t){return(t.parts??[]).filter(Wn)}function Wn(t){return t.type==="tool-subtask"}function Yn(t){return t.role!=="system"}function Zn(t,e){const s=e.metadata?.usage;return t+(s?.outputTokens??0)}function Xn(t){return t.role==="assistant"}function Jn(t,e){const s=e.metadata?.usage;return t+(s?.inputTokens??0)}function Qn(t){return t.role==="user"}function ea(t){return t.role==="assistant"&&t.metadata?.models}function ta(t){return t.role==="assistant"&&t.metadata?.usage}function sa(t){const e=L.c(21),{onOpenContextPanel:s}=t,{org:r}=ae(),{selectedVirtualMcp:i}=jt();let a;e[0]!==r.id?(a=ye(r.id),e[0]=r.id,e[1]=a):a=e[1];const c=i??a,l=Fe(c.id)??c,d=l.title??"Super Agent",m=l.icon??null,f=l.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 j;e[5]!==d?(j=n.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:d}),e[5]=d,e[6]=j):j=e[6];let y;e[7]!==f?(y=f?n.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-balance",children:f}):null,e[7]=f,e[8]=y):y=e[8];let v;e[9]!==j||e[10]!==y?(v=n.jsxs("div",{className:"space-y-1.5",children:[j,y]}),e[9]=j,e[10]=y,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 g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(q.IceBreakers,{className:"pb-3"}),e[15]=g):g=e[15];let b;e[16]!==s?(b=n.jsxs(q.Footer,{children:[g,n.jsx(q.Input,{onOpenContextPanel:s})]}),e[16]=s,e[17]=b):b=e[17];let S;return e[18]!==x||e[19]!==b?(S=n.jsxs(n.Fragment,{children:[x,b]}),e[18]=x,e[19]=b,e[20]=S):S=e[20],S}function ot(t){const e=L.c(17),{outputs:s,collapsed:r,onToggle:i,variant:a}=t,o=a==="card"?"rounded-xl bg-muted/95 shadow-edge backdrop-blur-sm":"border-b border-border bg-background";let c;e[0]!==o?(c=se(o),e[0]=o,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 l=r&&"-rotate-90";let d;e[3]!==l?(d=se("size-4 text-muted-foreground transition-transform",l),e[3]=l,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(na)}),e[10]=r,e[11]=s,e[12]=h):h=e[12];let j;return e[13]!==c||e[14]!==f||e[15]!==h?(j=n.jsxs("div",{className:c,children:[f,h]}),e[13]=c,e[14]=f,e[15]=h,e[16]=j):j=e[16],j}function na(t){return n.jsx(Rs,{file:t},t.key)}function aa(){const t=L.c(13),e=Le()?.taskId??null,s=Os();let r;t[0]!==s?(r={enabled:s},t[0]=s,t[1]=r):r=t[1];const{data:i}=Bs(e,r),[a,o]=D.useState(!1),[c,u]=D.useState(!0);if(!e||!i||i.length===0)return null;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>o(ia),t[2]=l):l=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(ot,{variant:"card",outputs:i,collapsed:a,onToggle:l})}),t[3]=a,t[4]=i,t[5]=d):d=t[5];let m;t[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>u(ra),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(ot,{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 ra(t){return!t}function ia(t){return!t}function la(){const t=L.c(1);D.use(Ye().ready);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Ns,{children:n.jsx(oa,{})}),t[0]=e):e=t[0],e}function oa(){const t=L.c(29),{active:e}=_s(),{org:s}=ae(),r=Le(),{isChatEmpty:i}=Ye(),[a,o]=D.useState("chat"),c=Ds(),u=V(),l=Ln(),{runtime:d}=St(r?.virtualMcpId);if(l!==null&&d!=="cms"){let N;return t[0]!==l||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:l==="codex-provider"?n.jsx(q.NoAiProviderEmptyState,{title:u("settings.codexSubscription.setupHeading"),description:u("settings.codexSubscription.setupDescription"),providerFilter:yt}):l==="claude-code-provider"?n.jsx(q.NoAiProviderEmptyState,{title:u("chat.noAiProviderEmptyState.supportedHeading"),description:u("chat.noAiProviderEmptyState.supportedSubtitle"),providerFilter:kt}):n.jsx(q.NoAiProviderEmptyState,{})})})}),t[0]=l,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&&!Ts(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 j;t[10]!==h?(j=h&&n.jsx(q.CreditsEmptyState,{}),t[10]=h,t[11]=j):j=t[11];let y;t[12]!==a||t[13]!==i||t[14]!==d||t[15]!==e?(y=!e&&n.jsx("div",{inert:a!=="chat"?!0:void 0,"aria-hidden":a!=="chat",className:se("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(sa,{onOpenContextPanel:()=>o("context")}):n.jsxs(n.Fragment,{children:[n.jsxs(q.Main,{className:"relative flex flex-col overflow-hidden @container",children:[n.jsx(aa,{}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(q.Messages,{})})]}),n.jsx(q.Footer,{children:n.jsx(q.Input,{onOpenContextPanel:()=>o("context")})})]})}),t[12]=a,t[13]=i,t[14]=d,t[15]=e,t[16]=y):y=t[16];let v;t[17]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(ws,{}),t[17]=v):v=t[17];const x=a!=="context"?!0:void 0,g=a!=="context",b=a==="context"?"opacity-100":"opacity-0 pointer-events-none";let S;t[18]!==b?(S=se("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",b),t[18]=b,t[19]=S):S=t[19];let p;t[20]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Hn,{back:!0,onClose:()=>o("chat")}),t[20]=p):p=t[20];let k;t[21]!==x||t[22]!==g||t[23]!==S?(k=n.jsx("div",{inert:x,"aria-hidden":g,className:S,children:p}),t[21]=x,t[22]=g,t[23]=S,t[24]=k):k=t[24];let T;return t[25]!==j||t[26]!==y||t[27]!==k?(T=n.jsxs(q,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[j,y,v,k]}),t[25]=j,t[26]=y,t[27]=k,t[28]=T):T=t[28],T}function ca(){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(la,{})}),t[4]=i):i=t[4];let a;return t[5]!==r?(a=n.jsx(pt,{fallback:r,children:i}),t[5]=r,t[6]=a):a=t[6],a}function da(t){const e=L.c(10),{org:s}=ae(),r=Vs(),{data:i}=pe.useSession(),a=i?.user?.id,o=t?.id??null,c=!!t&&!!a&&!!t.created_by&&t.created_by!==a;let u;e[0]!==s.id||e[1]!==o?(u=fe.viewedThreadMetadataRefresh(s.id,o??""),e[0]=s.id,e[1]=o,e[2]=u):u=e[2];const l=!!r&&!!o&&c;let d;e[3]!==r||e[4]!==o?(d=async()=>(await r?.refreshThreadMetadata(o??""),!0),e[3]=r,e[4]=o,e[5]=d):d=e[5];let m;e[6]!==u||e[7]!==l||e[8]!==d?(m={queryKey:u,enabled:l,staleTime:Number.POSITIVE_INFINITY,queryFn:d},e[6]=u,e[7]=l,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 o;e[0]!==s?(o=n.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=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(ua),e[4]=a,e[5]=u):u=e[5];let l;e[6]!==s||e[7]!==c||e[8]!==u||e[9]!==r?(l=n.jsx(nn,{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]=l):l=e[10];let d;return e[11]!==o||e[12]!==l?(d=n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,l]}),e[11]=o,e[12]=l,e[13]=d):d=e[13],d}function ua(t){return n.jsxs(sn,{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 fa(t){const e=L.c(91),{panel:s,className:r}=t,i=r===void 0?"md:size-[34px]":r,a=V();let o;e[0]!==a?(o=a("sidebar.taskGroupsList.filterChats"),e[0]=a,e[1]=o):o=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 l;e[5]!==i||e[6]!==s.filtersActive||e[7]!==o||e[8]!==u?(l=n.jsx(Ee,{asChild:!0,children:n.jsx(Lt,{asChild:!0,children:n.jsxs(Ne,{"aria-label":o,active:s.filtersActive,className:i,children:[c,u]})})}),e[5]=i,e[6]=s.filtersActive,e[7]=o,e[8]=u,e[9]=l):l=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]!==l||e[15]!==m?(f=n.jsxs(Oe,{children:[l,m]}),e[14]=l,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 j=s.groupBy;let y;e[19]!==s?(y=G=>{he("tasks_panel_group_by_changed",{to_value:G}),s.setGroupBy(G)},e[19]=s,e[20]=y):y=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 g;e[24]!==v?(g={value:"flat",label:v,icon:x},e[24]=v,e[25]=g):g=e[25];let b;e[26]!==a?(b=a("sidebar.taskGroupsList.viewStatus"),e[26]=a,e[27]=b):b=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]!==b?(p={value:"status",label:b,icon:S},e[29]=b,e[30]=p):p=e[30];let k;e[31]!==g||e[32]!==p?(k=[g,p],e[31]=g,e[32]=p,e[33]=k):k=e[33];let T;e[34]!==s.groupBy||e[35]!==y||e[36]!==k||e[37]!==h?(T=n.jsx(Ge,{label:h,value:j,onChange:y,options:k}),e[34]=s.groupBy,e[35]=y,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 M;e[47]!==a?(M=a("sidebar.taskGroupsList.typeChats"),e[47]=a,e[48]=M):M=e[48];let A;e[49]!==M?(A={value:"manual",label:M},e[49]=M,e[50]=A):A=e[50];let $;e[51]!==a?($=a("sidebar.taskGroupsList.typeAuto"),e[51]=a,e[52]=$):$=e[52];let F;e[53]!==$?(F={value:"automation",label:$},e[53]=$,e[54]=F):F=e[54];let O;e[55]!==C||e[56]!==A||e[57]!==F?(O=[C,A,F],e[55]=C,e[56]=A,e[57]=F,e[58]=O):O=e[58];let R;e[59]!==s.typeFilter||e[60]!==N||e[61]!==_||e[62]!==O?(R=n.jsx(Ge,{label:N,value:w,onChange:_,options:O}),e[59]=s.typeFilter,e[60]=N,e[61]=_,e[62]=O,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 z=s.showAll?"team":"mine";let E;e[66]!==s?(E=G=>s.setShowAll(G==="team"),e[66]=s,e[67]=E):E=e[67];let H;e[68]!==a?(H=a("sidebar.taskGroupsList.scopeMine"),e[68]=a,e[69]=H):H=e[69];let B;e[70]!==H?(B={value:"mine",label:H},e[70]=H,e[71]=B):B=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]!==B||e[77]!==Z?(Y=[B,Z],e[76]=B,e[77]=Z,e[78]=Y):Y=e[78];let X;e[79]!==I||e[80]!==z||e[81]!==E||e[82]!==Y?(X=n.jsx(Ge,{label:I,value:z,onChange:E,options:Y}),e[79]=I,e[80]=z,e[81]=E,e[82]=Y,e[83]=X):X=e[83];let W;e[84]!==T||e[85]!==R||e[86]!==X?(W=n.jsxs($t,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[T,R,X]}),e[84]=T,e[85]=R,e[86]=X,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 ma(t,e){return t.filter(s=>s.id===e||!!s.trigger_id||Qs(s))}function ha(){const t=L.c(2),e=Fs()??[];let s;return t[0]!==e?(s=r=>{if(!r)return;const i=e.find(a=>a.id===r);return i?Pt(i.metadata):void 0},t[0]=e,t[1]=s):s=t[1],s}function pa(t){const e=L.c(9),{virtualMcpId:s,size:r,showAutomationBadge:i}=t,a=r===void 0?"sm":r,o=V();let c;e[0]!==a||e[1]!==s?(c=s?n.jsx(xa,{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]!==o?(u=i&&n.jsx("span",{"aria-label":o("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(Ot,{size:10,className:"text-white"})}),e[3]=i,e[4]=o,e[5]=u):u=e[5];let l;return e[6]!==c||e[7]!==u?(l=n.jsxs("div",{className:"relative shrink-0",children:[c,u]}),e[6]=c,e[7]=u,e[8]=l):l=e[8],l}function xa(t){const e=L.c(6),{virtualMcpId:s,size:r}=t,i=Nt(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 o;return e[2]!==i.title||e[3]!==r||e[4]!==a?(o=n.jsx(ve,{icon:a,name:i.title,size:r}),e[2]=i.title,e[3]=r,e[4]=a,e[5]=o):o=e[5],o}const ct=["thread"];function ga(t){const e=L.c(53),{open:s,onOpenChange:r}=t,[i,a]=D.useState(""),{org:o}=ae(),{setTaskId:c}=Qe(),u=Ce(),l=V();let d,m,f,h;e[0]!==o.id||e[1]!==i?(h=i.trim(),d=h?20:10,f=me,m=fe.globalSearch(o.id,h,d,ct),e[0]=o.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 j;e[6]!==d||e[7]!==u||e[8]!==h?(j=async()=>{const I=await u.call("GLOBAL_SEARCH",{query:h,limit:d,types:[...ct]});return{...I,items:I.items.filter(ba)}},e[6]=d,e[7]=u,e[8]=h,e[9]=j):j=e[9];let y;e[10]!==s||e[11]!==m||e[12]!==j?(y={queryKey:m,enabled:s,queryFn:j,staleTime:1e4},e[10]=s,e[11]=m,e[12]=j,e[13]=y):y=e[13];const{data:v,isFetching:x}=f(y);let g;e[14]!==v?.items?(g=v?.items??[],e[14]=v?.items,e[15]=g):g=e[15];const b=g;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]!==l?(N=l("tasksPanel.globalSearchDialog.title"),e[21]=l,e[22]=N):N=e[22];let w;e[23]!==N?(w=n.jsx(Wt,{children:N}),e[23]=N,e[24]=w):w=e[24];let _;e[25]!==l?(_=l("tasksPanel.globalSearchDialog.description"),e[25]=l,e[26]=_):_=e[26];let P;e[27]!==_?(P=n.jsx(Yt,{children:_}),e[27]=_,e[28]=P):P=e[28];let C;e[29]!==P||e[30]!==w?(C=n.jsxs(Zt,{className:"sr-only",children:[w,P]}),e[29]=P,e[30]=w,e[31]=C):C=e[31];let M;e[32]!==l?(M=l("tasksPanel.globalSearchDialog.placeholder"),e[32]=l,e[33]=M):M=e[33];let A;e[34]!==i||e[35]!==M?(A=n.jsx(pn,{value:i,onValueChange:a,placeholder:M}),e[34]=i,e[35]=M,e[36]=A):A=e[36];let $;e[37]!==T||e[38]!==x||e[39]!==b||e[40]!==l||e[41]!==h?($=n.jsx(un,{children:x&&b.length===0?n.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l("tasksPanel.globalSearchDialog.searching")}):b.length===0?n.jsx(fn,{children:l("tasksPanel.globalSearchDialog.noResults")}):n.jsx(mn,{heading:h?void 0:l("tasksPanel.globalSearchDialog.recent"),children:b.map(I=>I.type==="thread"?n.jsxs(hn,{value:`thread:${I.id}:${I.title}`,onSelect:()=>T(I),className:"gap-2.5",children:[n.jsx(pa,{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||l("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]=b,e[40]=l,e[41]=h,e[42]=$):$=e[42];let F;e[43]!==A||e[44]!==$?(F=n.jsxs(xn,{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:[A,$]}),e[43]=A,e[44]=$,e[45]=F):F=e[45];let O;e[46]!==C||e[47]!==F?(O=n.jsxs(Xt,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[C,F]}),e[46]=C,e[47]=F,e[48]=O):O=e[48];let R;return e[49]!==p||e[50]!==s||e[51]!==O?(R=n.jsx(Jt,{open:s,onOpenChange:p,children:O}),e[49]=p,e[50]=s,e[51]=O,e[52]=R):R=e[52],R}function ba(t){return t.type==="thread"}function va(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 ya(t){return t==="ephemeral"||t.startsWith("thread:")}function Gt(t){const e=L.c(45),{task:s,isActive:r,onClick:i,onArchive:a,showAutomationBadge:o,showAgentIcon:c,hideStatusIdle:u,indented:l}=t,d=V(),m=gn(s.status),f=m.icon,h=s.metadata?.kind==="tool_call_run",j=Nt(h?void 0:s.virtual_mcp_id);let y;e[0]!==j?(y=_t(j),e[0]=j,e[1]=y):y=e[1];const v=y;vn(6e4);const x=o||!!s.trigger_id,g=s.id,b="button",S=0;let p;e[2]!==i?(p=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),i())},e[2]=i,e[3]=p):p=e[3];const k=l?"-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=se("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]!==j?.icon||e[10]!==j?.title?(w=c&&!h&&n.jsx(ve,{icon:j?.icon??null,name:j?.title??"?",size:"2xs"}),e[7]=h,e[8]=c,e[9]=j?.icon,e[10]=j?.title,e[11]=w):w=e[11];let _;e[12]!==x||e[13]!==d?(_=x&&n.jsx(Ot,{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 M;e[20]!==_||e[21]!==C?(M=n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[_,C]}),e[20]=_,e[21]=C,e[22]=M):M=e[22];let A;e[23]!==r||e[24]!==v||e[25]!==s.branch||e[26]!==s.updated_at?(A=s.updated_at&&n.jsxs("div",{className:se("flex items-center gap-1 text-2xs min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[s.branch&&!ya(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:Qt(new Date(s.updated_at))})]}),e[23]=r,e[24]=v,e[25]=s.branch,e[26]=s.updated_at,e[27]=A):A=e[27];let $;e[28]!==M||e[29]!==A?($=n.jsxs("div",{className:"flex-1 min-w-0",children:[M,A]}),e[28]=M,e[29]=A,e[30]=$):$=e[30];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",O=!u&&n.jsx("span",{className:se("[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:se("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(Ee,{asChild:!0,children:n.jsx(qe,{variant:"ghost",size:"icon","aria-label":d("tasksPanel.taskRow.archiveTask"),onClick:E=>{E.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(es,{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]!==O||e[35]!==R?(I=n.jsxs("div",{className:F,children:[O,R]}),e[34]=O,e[35]=R,e[36]=I):I=e[36];let z;return e[37]!==i||e[38]!==$||e[39]!==I||e[40]!==p||e[41]!==N||e[42]!==w||e[43]!==s.id?(z=n.jsxs("div",{"data-task-id":g,role:b,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]=z):z=e[44],z}const dt=["requires_action","in_progress","failed","expired","completed"];function ja(t){const e=new Map(dt.map(s=>[s,[]]));for(const s of t){const r=s.status??"completed";(e.get(r)??e.get("completed")).push(s)}return dt.map(s=>({status:s,threads:e.get(s)}))}const Sa="sidebar.group.expanded.";function ka(t,e){const s=L.c(3),[r,i]=xt(`${Sa}${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 Ht(t){const e=L.c(18),{onClick:s,isFetching:r,indented:i}=t,a=V();let o;e[0]!==a?(o=a("sidebar.showMoreButton.ariaLabel"),e[0]=a,e[1]=o):o=e[1];const c=i?"-ml-4 pl-6 pr-2":"px-2";let u;e[2]!==c?(u=se("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 l;e[4]!==r?(l=r&&n.jsx(Pe,{className:"size-3.5"}),e[4]=r,e[5]=l):l=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]!==o||e[14]!==u||e[15]!==l||e[16]!==m?(f=n.jsxs("button",{type:"button","aria-label":o,onClick:s,disabled:r,className:u,children:[l,m]}),e[11]=r,e[12]=s,e[13]=o,e[14]=u,e[15]=l,e[16]=m,e[17]=f):f=e[17],f}function Ta(t,e,s,r){return[t,e,s,r.type,r.member,r.currentUserId??""].join("|")}function Na(t){return t.member==="mine"&&!t.currentUserId}const Kt=4;let Te=0;const Ve=[];function _a(){for(;Te<Kt&&Ve.length>0;){const t=Ve.shift();t&&t()}}function Vt(t){return new Promise((e,s)=>{const r=()=>{Te++,t().then(e,s).finally(()=>{Te--,_a()})};Te<Kt?r():Ve.push(r)})}const Be=10;function ut(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 o={where:a,limit:i,offset:s,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function wa(t,e,s,r){let i=0;for(const a of t)Ut(a,e,s,r)&&i++;return i}function He(t,e,s,r){return wa(t,e,s,r)}function Ca(t,e){return!!(t>=Be||t===0&&e)}function ft(t,e){return t<e}function Pa(t,e){return e===!1?!1:e===!0?!0:t}function Ut(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 Ia(t,e){return e?t>=Be?!0:null:!1}function mt(t){return we.get(t)}function Ma(t,e){we.set(t,e)}function Aa(t,e,s){const r=we.get(t);if(r!==void 0){s(r);return}let i=ke.get(t);i||(i=Vt(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 ht(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 La(t,e,s,r,i){let a=0;for(const o of t)e.has(o.id)||Ut(o,s,r,i)&&a++;return a}function $a(t,e,s,r){const i=L.c(8),{org:a}=ae(),o=Ta(a.id,t,e,s);let c;i[0]!==s?(c=Na(s),i[0]=s,i[1]=c):c=i[1];const u=c,[l,d]=D.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});l.identity!==o&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const m=Xe(),{threads:f,hasMore:h}=Je(),j=He(f,t,e,s),y=Ca(j,h),v=Ia(j,h),x=Ce();if(l.identity===o&&l.serverHasMore===null){const T=v??mt(o);T!==void 0&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:l.probeSubscribedIdentity,serverHasMore:T})}!u&&l.identity===o&&l.serverHasMore===null&&v===null&&mt(o)===void 0&&l.probeSubscribedIdentity!==o&&(d(T=>T.identity===o?{...T,isProbing:!0,probeSubscribedIdentity:o}:T),Aa(o,async()=>{const T=ut(t,e,0,s,1),N=await x.call("COLLECTION_THREADS_LIST",T),{totalCount:w}=ht(N),_=He(m.threads.get(),t,e,s);return w===void 0?!1:ft(_,w)},T=>{d(N=>N.identity!==o?N:{...N,isProbing:!1,serverHasMore:T})}));const b=async function(){if(l.isFetching||l.isProbing||u)return;const N=o;d(w=>w.identity===N?{...w,isFetching:!0}:w);try{const w=He(f,t,e,s),_=ut(t,e,w,s,Be),P=await Vt(()=>x.call("COLLECTION_THREADS_LIST",_)),{items:C,hasMore:M,totalCount:A}=ht(P),$=new Set(f.map(Fa)),F=La(C,$,t,e,s),O=w;m.mergeThreads(C),d(R=>{if(R.identity!==N)return R;let I;return A!==void 0?I=ft(O+F,A):I=C.length===0||F===0?!1:M,Ma(N,I),{...R,isFetching:!1,serverHasMore:I}})}catch(w){const _=w,P=_ instanceof Error?_.message:String(_);ts.error(`Could not load more tasks: ${P}`),d(C=>C.identity===N?{...C,isFetching:!1}:C)}},S=l.isFetching||l.isProbing,p=!u&&!S&&Pa(y,l.serverHasMore);let k;return i[2]!==S||i[3]!==b||i[4]!==p||i[5]!==l.isProbing||i[6]!==l.serverHasMore?(k={hasMore:p,isFetching:S,isProbing:l.isProbing,serverHasMore:l.serverHasMore,loadMore:b},i[2]=S,i[3]=b,i[4]=p,i[5]=l.isProbing,i[6]=l.serverHasMore,i[7]=k):k=i[7],k}function Fa(t){return t.id}function Ea(t){const e=L.c(20),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u}=t,{isFetching:l,isProbing:d,loadMore:m,hasMore:f,serverHasMore:h}=$a("status",s,u),[j,y]=D.useState(!1);!j&&r.length===0&&h===!0&&!l&&!d&&(y(!0),queueMicrotask(()=>{m()}));let v;if(e[0]!==i||e[1]!==c||e[2]!==u||e[3]!==o||e[4]!==a||e[5]!==r){let b;e[7]!==i||e[8]!==c||e[9]!==u||e[10]!==o||e[11]!==a?(b=S=>n.jsx(Gt,{task:S,isActive:i===S.id,onClick:()=>a(S),onArchive:c&&S.created_by===u.currentUserId?()=>o(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]=o,e[11]=a,e[12]=b):b=e[12],v=r.map(b),e[0]=i,e[1]=c,e[2]=u,e[3]=o,e[4]=a,e[5]=r,e[6]=v}else v=e[6];let x;e[13]!==f||e[14]!==l||e[15]!==m?(x=(f||l)&&n.jsx(Ht,{onClick:()=>{m()},isFetching:l,indented:!0}),e[13]=f,e[14]=l,e[15]=m,e[16]=x):x=e[16];let g;return e[17]!==v||e[18]!==x?(g=n.jsxs(n.Fragment,{children:[v,x]}),e[17]=v,e[18]=x,e[19]=g):g=e[19],g}function Ra(t){const e=L.c(43),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u}=t,l=V(),d=bn[s],m=d.icon,[f,h]=ka(`status-${s}`,!1);let j;e[0]!==f||e[1]!==h?(j=function(){h(!f)},e[0]=f,e[1]=h,e[2]=j):j=e[2];const y=j;let v;e[3]!==d.labelKey||e[4]!==l?(v=l("sidebar.taskGroupsList.toggleStatusGroup",{status:l(d.labelKey)}),e[3]=d.labelKey,e[4]=l,e[5]=v):v=e[5];let x;e[6]!==y?(x=P=>{P.target===P.currentTarget&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),y())},e[6]=y,e[7]=x):x=e[7];let g;e[8]!==m||e[9]!==d.iconClassName?(g=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]=g):g=e[10];let b;e[11]!==f?(b=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(ss,{size:14})}),e[11]=f,e[12]=b):b=e[12];let S;e[13]!==g||e[14]!==b?(S=n.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[g,b]}),e[13]=g,e[14]=b,e[15]=S):S=e[15];let p;e[16]!==d.labelKey||e[17]!==l?(p=l(d.labelKey),e[16]=d.labelKey,e[17]=l,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]!==y||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:y,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]=y,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]!==o||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(Ea,{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u})}),e[31]=i,e[32]=c,e[33]=f,e[34]=u,e[35]=o,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 Oa(t){const e=L.c(41),{threads:s,groupBy:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,filters:c,hasMore:u,isFetchingMore:l,onLoadMore:d,filtersActive:m}=t,f=V();if(s.length===0&&!u&&!l){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 g;e[1]!==m||e[2]!==f?(g=f(m?"sidebar.myThreadsSection.noChatsMatchFilters":"sidebar.myThreadsSection.noChatsYet"),e[1]=m,e[2]=f,e[3]=g):g=e[3];let b;return e[4]!==g?(b=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:g})]}),e[4]=g,e[5]=b):b=e[5],b}const h=s.length>1||u;if(r==="status"){let x;if(e[6]!==i||e[7]!==h||e[8]!==c||e[9]!==o||e[10]!==a||e[11]!==s){let b;e[13]!==i||e[14]!==h||e[15]!==c||e[16]!==o||e[17]!==a?(b=S=>n.jsx(Ra,{status:S.status,threads:S.threads,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:h,filters:c},S.status),e[13]=i,e[14]=h,e[15]=c,e[16]=o,e[17]=a,e[18]=b):b=e[18],x=ja(s).map(b),e[6]=i,e[7]=h,e[8]=c,e[9]=o,e[10]=a,e[11]=s,e[12]=x}else x=e[12];let g;return e[19]!==x?(g=n.jsx(n.Fragment,{children:x}),e[19]=x,e[20]=g):g=e[20],g}let j;if(e[21]!==i||e[22]!==h||e[23]!==c||e[24]!==o||e[25]!==a||e[26]!==s){let x;e[28]!==i||e[29]!==h||e[30]!==c||e[31]!==o||e[32]!==a?(x=g=>n.jsx(Gt,{task:g,isActive:i===g.id,onClick:()=>a(g),onArchive:h&&g.created_by===c.currentUserId?()=>o(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[28]=i,e[29]=h,e[30]=c,e[31]=o,e[32]=a,e[33]=x):x=e[33],j=s.map(x),e[21]=i,e[22]=h,e[23]=c,e[24]=o,e[25]=a,e[26]=s,e[27]=j}else j=e[27];let y;e[34]!==u||e[35]!==l||e[36]!==d?(y=(u||l)&&n.jsx(Ht,{onClick:d,isFetching:l}),e[34]=u,e[35]=l,e[36]=d,e[37]=y):y=e[37];let v;return e[38]!==j||e[39]!==y?(v=n.jsxs(n.Fragment,{children:[j,y]}),e[38]=j,e[39]=y,e[40]=v):v=e[40],v}function Ba(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(Oa,{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 Da(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:o}=ae();let c;e[2]!==o.id?(c=ye(o.id),e[2]=o.id,e[3]=c):c=e[3];const u=c.id,l=ha(),d=Tt(),{threads:m,hasMore:f,isFetchingMore:h,fetchNextPage:j}=Je(),y=m.filter(Ka),{hide:v,setScope:x}=It(),g=Me(),{setTaskId:b,createNewTask:S}=Qe(),p=Et(),k=et();let T;e[4]!==k||e[5]!==m||e[6]!==p?(T=on({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=[...y].sort(Ha),[C,M]=D.useState("all"),[A,$]=D.useState("flat"),[F,O]=xt("sidebar-threads-scope-all",!1),[R,I]=D.useState(!1),[z,E]=D.useState(!1);let H;e[10]!==I?(H=()=>{he("tasks_panel_search_opened"),E(!0),I(!0)},e[10]=I,e[11]=H):H=e[11];const B=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,X={};F||(X.created_by="me"),x(X);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(Ga):C==="manual"?K.filter(za):K,e[17]=C,e[18]=G):G=e[18];const re=G,J=ma(re(F?P:le(P)),k);let Q;e[19]!==k||e[20]!==_||e[21]!==a||e[22]!==v||e[23]!==g||e[24]!==o.slug||e[25]!==b||e[26]!==J?(Q=K=>{if(a&&K.created_by&&K.created_by!==a)return;const ue=K.id===k;if(v(K.id),an(K.id),!ue)return;const ge=va(J,K.id,a);_(),ge?b(ge.id,ge.virtual_mcp_id):g({to:"/$org",params:{org:o.slug}})},e[19]=k,e[20]=_,e[21]=a,e[22]=v,e[23]=g,e[24]=o.slug,e[25]=b,e[26]=J,e[27]=Q):Q=e[27];const ee=Q;let ne;e[28]!==_||e[29]!==b?(ne=K=>{_(),b(K.id,K.virtual_mcp_id)},e[28]=_,e[29]=b,e[30]=ne):ne=e[30];const ie=ne;let te;e[31]!==N||e[32]!==k||e[33]!==m||e[34]!==_||e[35]!==S||e[36]!==a||e[37]!==u||e[38]!==l||e[39]!==d||e[40]!==b?(te=()=>{const K=N??u;he("sidebar_new_thread_clicked",{virtual_mcp_id:K}),_();const ue=qs(m,K,a,l(K));if(ue){b(ue.id,ue.virtual_mcp_id,{newThread:!0});return}const ge=d?null:m.find(qt=>qt.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]=l,e[39]=d,e[40]=b,e[41]=te):te=e[41];const oe=te;let ce;e[42]!==j?(ce=()=>{j()},e[42]=j,e[43]=ce):ce=e[43];const xe=A!=="flat"||C!=="all"||F;let de;e[44]!==z||e[45]!==R||e[46]!==I?(de=z?n.jsx(ga,{open:R,onOpenChange:I}):null,e[44]=z,e[45]=R,e[46]=I,e[47]=de):de=e[47];let Se;return e[48]!==k||e[49]!==ee||e[50]!==Y||e[51]!==A||e[52]!==f||e[53]!==h||e[54]!==oe||e[55]!==B||e[56]!==ie||e[57]!==$||e[58]!==O||e[59]!==M||e[60]!==F||e[61]!==ce||e[62]!==xe||e[63]!==de||e[64]!==C||e[65]!==J?(Se={threads:J,activeTaskId:k,filters:Y,hasMore:f,isFetchingMore:h,loadMore:ce,groupBy:A,setGroupBy:$,typeFilter:C,setTypeFilter:M,showAll:F,setShowAll:O,filtersActive:xe,selectTask:ie,archiveTask:ee,newThread:oe,openSearch:B,searchDialog:de},e[48]=k,e[49]=ee,e[50]=Y,e[51]=A,e[52]=f,e[53]=h,e[54]=oe,e[55]=B,e[56]=ie,e[57]=$,e[58]=O,e[59]=M,e[60]=F,e[61]=ce,e[62]=xe,e[63]=de,e[64]=C,e[65]=J,e[66]=Se):Se=e[66],Se}function za(t){return!t.trigger_id}function Ga(t){return!!t.trigger_id}function Ha(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Ka(t){return!t.hidden}function Va(){const t=L.c(59),e=V(),[s,r]=D.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={onNavigate:()=>r(!1)},t[0]=i):i=t[0];const a=Da(i),o=Le()?.activeTask;let c;t[1]!==o?.title||t[2]!==a.activeTaskId||t[3]!==a.threads||t[4]!==e?(c=o?.title||a.threads.find(R=>R.id===a.activeTaskId)?.title||e("tasksPanel.taskRow.untitledTask"),t[1]=o?.title,t[2]=a.activeTaskId,t[3]=a.threads,t[4]=e,t[5]=c):c=t[5];const u=c;let l;t[6]!==a?(l=()=>{r(!1),a.openSearch()},t[6]=a,t[7]=l):l=t[7];const d=l;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=se("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 j;t[12]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(gs,{size:16,className:"shrink-0"}),t[12]=j):j=t[12];let y;t[13]!==u?(y=n.jsx("span",{className:"truncate max-w-[10rem] font-medium",children:u}),t[13]=u,t[14]=y):y=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]!==y?(x=n.jsx(Ee,{asChild:!0,children:n.jsx(Lt,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":m,className:h,children:[j,y,v]})})}),t[16]=m,t[17]=h,t[18]=y,t[19]=x):x=t[19];let g;t[20]!==e?(g=e("chat.threadsMenu.chats"),t[20]=e,t[21]=g):g=t[21];let b;t[22]!==g?(b=n.jsx(Re,{side:"bottom",children:g}),t[22]=g,t[23]=b):b=t[23];let S;t[24]!==b||t[25]!==x?(S=n.jsxs(Oe,{children:[x,b]}),t[24]=b,t[25]=x,t[26]=S):S=t[26];let p;t[27]!==a?(p=n.jsx(fa,{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(vt,{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 M;t[44]!==p||t[45]!==C?(M=n.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[p,C]}),t[44]=p,t[45]=C,t[46]=M):M=t[46];let A;t[47]!==a?(A=n.jsx("div",{className:"flex max-h-[60vh] min-h-0 flex-col gap-0.5 overflow-y-auto overscroll-contain",children:n.jsx(Ba,{panel:a})}),t[47]=a,t[48]=A):A=t[48];let $;t[49]!==M||t[50]!==A?($=n.jsxs($t,{align:"start",side:"bottom",onOpenAutoFocus:Ua,className:"flex w-80 flex-col gap-2 p-2",children:[M,A]}),t[49]=M,t[50]=A,t[51]=$):$=t[51];let F;t[52]!==s||t[53]!==S||t[54]!==$?(F=n.jsxs(Ft,{open:s,onOpenChange:r,children:[S,$]}),t[52]=s,t[53]=S,t[54]=$,t[55]=F):F=t[55];let O;return t[56]!==a.searchDialog||t[57]!==F?(O=n.jsxs(n.Fragment,{children:[F,a.searchDialog]}),t[56]=a.searchDialog,t[57]=F,t[58]=O):O=t[58],O}function Ua(t){return t.preventDefault()}function qa(){const t=L.c(20),e=V(),{threads:s}=Je(),{createNewTask:r}=Qe(),i=Rt(),a=et();let o;t[0]!==a||t[1]!==s?(o=s.find(v=>v.id===a)?.branch??null,t[0]=a,t[1]=s,t[2]=o):o=t[2];const c=o;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 l=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(vt,{size:16}),t[9]=m):m=t[9];let f;t[10]!==l||t[11]!==d?(f=n.jsx(Ee,{asChild:!0,children:n.jsx("button",{type:"button",onClick:l,"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]=l,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 j;t[15]!==h?(j=n.jsx(Re,{side:"bottom",children:h}),t[15]=h,t[16]=j):j=t[16];let y;return t[17]!==f||t[18]!==j?(y=n.jsxs(Oe,{children:[f,j]}),t[17]=f,t[18]=j,t[19]=y):y=t[19],y}function Wa(t){const e=L.c(16),{virtualMcpId:s,taskId:r}=t,{openPanel:i}=Bt();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:o,activeTab:c,mainOpen:u}=Dt(a);if(o.length===0)return null;let l;if(e[3]!==c||e[4]!==u||e[5]!==i||e[6]!==o||e[7]!==s){let m;e[9]!==c||e[10]!==u||e[11]!==i||e[12]!==s?(m=f=>{const h=f.id==="automations"?ns({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],l=o.map(m),e[3]=c,e[4]=u,e[5]=i,e[6]=o,e[7]=s,e[8]=l}else l=e[8];let d;return e[14]!==l?(d=n.jsx(st.Tabs,{"data-tour":rn.surfaceTabs,children:l}),e[14]=l,e[15]=d):d=e[15],d}function Ya(t){return{threadId:t.routeThreadId,providerKey:t.routeThreadId??t.fallbackKey}}const Ke="__mobile-main-panel-tab-select__",Ue="main";function Za({tabs:t,activeTab:e,mainOpen:s,t:r}){const i=t.find(o=>o.id===e),a=r("mainPanelTabs.mobileMainPanelTabSelect.mainView");return s?i?.title??a:i?.title??t[0]?.title??a}const Xa={kind:"component",Component:vs},Ja={kind:"component",Component:ys},Qa={kind:"component",Component:js},er={kind:"component",Component:jn};function tr({tabs:t,overlayEnabled:e,t:s}){return[{value:"chat",title:s("mainPanelTabs.mobileMainPanelTabSelect.chat"),icon:Xa},...t.length>0?t.map(r=>({value:r.id,title:r.title,icon:r.icon})):[{value:Ue,title:s("mainPanelTabs.mobileMainPanelTabSelect.mainView"),icon:er}],...e?[{value:"board",title:s("mainPanelTabs.mobileMainPanelTabSelect.tasks"),icon:Ja},{value:"files",title:s("mainPanelTabs.mobileMainPanelTabSelect.library"),icon:Qa}]:[]]}function sr(t){const e=L.c(53),{virtualMcpId:s,taskId:r}=t,i=V(),a=Me(),{openPanel:o}=Bt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const u=je(c);let l;e[1]!==r||e[2]!==s?(l={virtualMcpId:s,taskId:r},e[1]=r,e[2]=s,e[3]=l):l=e[3];const{tabs:d,activeTab:m,mainOpen:f}=Dt(l),{org:h}=ae(),j=Ls();let y;e[4]!==h.id?(y=nt(h.id),e[4]=h.id,e[5]=y):y=e[5];const v=s===y;let x,g,b,S,p,k,T,N,w,_;if(e[6]!==m||e[7]!==f||e[8]!==a||e[9]!==v||e[10]!==o||e[11]!==h.id||e[12]!==u.org||e[13]!==u.taskId||e[14]!==j||e[15]!==i||e[16]!==d||e[17]!==s){S=Symbol.for("react.early_return_sentinel");e:{const M=tr({tabs:d,overlayEnabled:!!(u.org&&u.taskId),t:i}),A=f?M.find(B=>B.value===m)?.value??Ue:"chat",$=M.find(B=>B.value===A),F=$?.title??Za({tabs:d,activeTab:m,mainOpen:f,t:i});let O;e[28]!==a?(O=B=>{a({to:".",search:U=>({...U,...en(B)}),replace:!0})},e[28]=a,e[29]=O):O=e[29];const R=O;let I;e[30]!==v||e[31]!==o||e[32]!==h.id||e[33]!==j||e[34]!==R||e[35]!==s?(I=B=>{if(B!==Ke){if(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:B,source:"mobile_select"}),ln({reportsOnly:j,onReportAgent:v,tabId:B})){o(B,{virtualmcpid:nt(h.id),search:rr});return}if(B==="chat"||B===Ue){R(B==="chat"?"chat":"main");return}o(B,{search:ar})}},e[30]=v,e[31]=o,e[32]=h.id,e[33]=j,e[34]=R,e[35]=s,e[36]=I):I=e[36];const z=I,E=M.find(B=>B.value!==A);if(M.length===2&&E){S=n.jsxs("button",{type:"button",onClick:()=>z(E.value),"aria-label":i("mainPanelTabs.mobileMainPanelTabSelect.switchTo",{name:E.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:E.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:E.title})]});break e}g=kn,w=Ke,_=z;let H;e[37]!==i?(H=i("mainPanelTabs.mobileMainPanelTabSelect.view"),e[37]=i,e[38]=H):H=e[38],b=n.jsx(Sn,{"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:F})]})}),x=Tn,p="end",k="w-56",e[39]!==F?(T=n.jsx(zt,{value:Ke,disabled:!0,hideCheck:!0,className:"hidden",children:F}),e[39]=F,e[40]=T):T=e[40],N=M.map(nr)}e[6]=m,e[7]=f,e[8]=a,e[9]=v,e[10]=o,e[11]=h.id,e[12]=u.org,e[13]=u.taskId,e[14]=j,e[15]=i,e[16]=d,e[17]=s,e[18]=x,e[19]=g,e[20]=b,e[21]=S,e[22]=p,e[23]=k,e[24]=T,e[25]=N,e[26]=w,e[27]=_}else x=e[18],g=e[19],b=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]!==g||e[48]!==b||e[49]!==P||e[50]!==w||e[51]!==_?(C=n.jsxs(g,{value:w,onValueChange:_,children:[b,P]}),e[47]=g,e[48]=b,e[49]=P,e[50]=w,e[51]=_,e[52]=C):C=e[52],C}function nr(t){return n.jsx(zt,{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 ar(t){return{...t,sidepanel:!1}}function rr(t){return{...t,thread:void 0,sidepanel:!1}}function ir(){const t=L.c(3),e=as();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={select:lr},t[0]=s):s=t[0];const r=gt(s);if(!e||!r)return!1;let i;return t[1]!==r?(i=r==="app"||_n.includes(r),t[1]=r,t[2]=i):i=t[2],i}function lr(t){const{staticData:e}=t.matches.findLast(or)??{};return e?.siteEditorView?"site-editor":e?.mainView}function or(t){return t.staticData.mainView}function cr(t,e,s){const r=L.c(33),i=Xe(),{locator:a}=ae(),o=D.useSyncExternalStore(i.threads.subscribe,i.threads.get),c=D.useSyncExternalStore(i.threadsStatus.subscribe,i.threadsStatus.get);let u;r[0]!==t||r[1]!==o?(u=t===null?null:o.find(p=>p.id===t&&!p.partial)??null,r[0]=t,r[1]=o,r[2]=u):u=r[2];const l=u,[d,m]=D.useState(void 0),[f,h]=D.useState(t);f!==t&&(h(t),m(void 0));let j,y;r[3]!==d||r[4]!==t||r[5]!==l||r[6]!==i||r[7]!==c.kind?(j=()=>{t!==null&&(l||c.kind!=="loading"&&d===void 0&&(m("pending"),i.fetchThreadIntoSlot(t).then(p=>{m(p)})))},y=[t,l,c.kind,d,i],r[3]=d,r[4]=t,r[5]=l,r[6]=i,r[7]=c.kind,r[8]=j,r[9]=y):(j=r[8],y=r[9]),D.useEffect(j,y);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}:{},...Us(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 g,b;if(r[15]!==x||r[16]!==d||r[17]!==t||r[18]!==l||r[19]!==c.kind?(g=()=>{t!==null&&(l||d===null&&c.kind!=="loading"&&(x.isPending||x.variables!==t&&x.mutate(t)))},b=[t,l,d,c.kind,x],r[15]=x,r[16]=d,r[17]=t,r[18]=l,r[19]=c.kind,r[20]=g,r[21]=b):(g=r[20],b=r[21]),D.useEffect(g,b),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(l){let p;return r[23]!==l?(p={status:"ready",task:l},r[23]=l,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 dr=50;function ur(t,e){const s=L.c(15),{org:r}=ae(),i=Ce(),{data:a}=pe.useSession(),o=a?.user?.id??"";let c;s[0]!==r.id||s[1]!==o||s[2]!==t?(c=fe.agentEntryThreads(r.id,o,t),s[0]=r.id,s[1]=o,s[2]=t,s[3]=c):c=s[3];const u=e&&!!o;let l;s[4]!==i||s[5]!==t?(l=async()=>{try{return(await i.call("COLLECTION_THREADS_LIST",{limit:dr,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]=l):l=s[6];let d;s[7]!==c||s[8]!==u||s[9]!==l?(d={queryKey:c,enabled:u,staleTime:0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,queryFn:l},s[7]=c,s[8]=u,s[9]=l,s[10]=d):d=s[10];const m=me(d);if(!e||!o){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 fr(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 o=Ae(a);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={select:mr},e[2]=c):c=e[2];const u=gt(c),{org:l}=ae();let d;e[3]!==l||e[4]!==i.agentId||e[5]!==i.legacyView||e[6]!==i.org||e[7]!==u||e[8]!==o?(d=i.org?is({pathname:u,org:i.org,pathAgentId:i.agentId,pathLegacyView:i.legacyView,fallbackAgentId:ye(l.id).id,search:o}):null,e[3]=l,e[4]=i.agentId,e[5]=i.legacyView,e[6]=i.org,e[7]=u,e[8]=o,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 mr(t){return t.matches.at(-1)?.pathname??t.location.pathname}function hr(){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:o,taskId:c}=s;if(!o||c===void 0)return null;let u;return t[2]!==o||t[3]!==a.id||t[4]!==i||t[5]!==c?(u=ls({org:o,taskId:c,fallbackAgentId:ye(a.id).id,search:i}),t[2]=o,t[3]=a.id,t[4]=i,t[5]=c,t[6]=u):u=t[6],u}function pr(){const t=L.c(2),e=hr();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 xr(){const t=L.c(6),e=Cn(),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:gr}),t[1]=s,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=n.jsx(Pn,{previewPath:i,onClose:a,showSeeInLibrary:!0}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function gr(t){const{preview:e,...s}=t;return s}function br(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 o;e[4]!==s?(o=s??n.jsx(ca,{}),e[4]=s,e[5]=o):o=e[5];let c;e[6]!==o?(c=n.jsx(Ie,{children:o}),e[6]=o,e[7]=c):c=e[7];let u;return e[8]!==a||e[9]!==c?(u=n.jsx(pt,{fallback:a,children:c}),e[8]=a,e[9]=c,e[10]=u):u=e[10],u}function vr(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 o;return e[3]!==i||e[4]!==a?(o=n.jsx(q.StreamHost,{source:a,children:i}),e[3]=i,e[4]=a,e[5]=o):o=e[5],o}function yr(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],D.useLayoutEffect(i),null}function jr({virtualMcpId:t,hasActiveRepository:e,sandboxMap:s,children:r}){const i=V(),{currentBranch:a,activeTask:o,setCurrentTaskBranch:c}=$e(),{data:u}=pe.useSession(),l=u?.user?.id,d=!Is(o?.harness_id),m=Ys({agentSandboxMap:s,threadSandboxMap:o?.metadata?.sandboxMap,userId:l,ownerId:o?.created_by,branch:a}),f=e||zs(o?.metadata),h=D.useRef(null),j=d&&Zs({threadLoaded:!!o,isOwner:!!l&&o?.created_by===l,hasActiveRepository:f,branch:a??null,attempted:h.current===(o?.id??null)});D.useEffect(()=>{!j||!o||(h.current=o.id,c(Ct(u?.user?.name||u?.user?.email?.split("@")[0])))},[j,o,u,c]);const y=St(t),v=Fe(t),x=Mt(v,a),{releases:g,createRelease:b}=Gs(t),p=!!l&&o?.created_by===l&&!!a&&a!==x&&!g.some(M=>M.branch===a),k=D.useRef(null);D.useEffect(()=>{!p||!a||k.current!==a&&(k.current=a,b({branch:a,name:Ks(g,i("thread.branchPicker.defaultVersionName")),color:Hs(g.length),createdBy:l,createdAt:new Date().toISOString()}).catch(()=>{}))},[p,a,g,b,l,i]);const T=y.resolved?y.runtime:null,N=Xs(t,a??void 0),_=(l&&a?Mn(m?.[l]?.[a]):{})["agent-sandbox"]??null,P=_?.previewUrl??null,C=d&&T!=="cms"&&(!!_||N);return d?T==="cms"?n.jsx(lt,{resetKey:`${t}:${a??"no-branch"}:${o?.id??""}`,children:r}):n.jsx(Nn,{resetKey:o?.id??"no-thread",virtualMcpId:t,branch:a??null,previewUrl:P,enabled:C,children:n.jsx(Js,{resetKey:o?.id??"no-thread",executionEnabled:d,virtualMcpId:t,branch:a??null,userId:l??null,hasActiveRepository:f,vmEntry:_,threadId:o?.id??null,children:n.jsx(lt,{resetKey:`${t}:${a??"no-branch"}:${o?.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(At,{image:n.jsx(We,{size:48,className:"text-muted-foreground"}),title:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWeb"),description:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWebDescription")})})})}function Sr(){const t=L.c(16),e=V(),{toggleSidebar:s}=ks(),{virtualMcpId:r,taskId:i}=$e();let a;t[0]!==e?(a=e("layouts.shellControls.toggleSidebar"),t[0]=e,t[1]=a):a=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ss,{size:16}),t[2]=o):o=t[2];let c;t[3]!==a||t[4]!==s?(c=n.jsx(Ne,{className:"md:hidden",onClick:s,"aria-label":a,children:o}),t[3]=a,t[4]=s,t[5]=c):c=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Va,{}),t[6]=u):u=t[6];let l;t[7]!==c?(l=n.jsxs(De.Topbar.Left,{children:[c,u]}),t[7]=c,t[8]=l):l=t[8];let d;t[9]!==i||t[10]!==r?(d=n.jsx("div",{className:"min-w-0 md:hidden",children:n.jsx(sr,{virtualMcpId:r,taskId:i})}),t[9]=i,t[10]=r,t[11]=d):d=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(De.Topbar.Right,{className:"shrink-0",children:n.jsx(qa,{})}),t[12]=m):m=t[12];let f;return t[13]!==l||t[14]!==d?(f=n.jsxs(De.Topbar,{className:"border-b border-border/60 px-3",children:[l,d,m]}),t[13]=l,t[14]=d,t[15]=f):f=t[15],f}function kr(t){const e=L.c(25),{layout:s,onNewTaskRef:r,createNewTask:i}=t,{virtualMcpId:a,taskId:o}=$e(),c=yn()??"overview",u=ir(),[l,d]=D.useState(null),m=l===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 j=h;let y;e[5]!==i||e[6]!==r?(y=n.jsx(yr,{onNewTaskRef:r,createNewTask:i}),e[5]=i,e[6]=r,e[7]=y):y=e[7];let v;e[8]!==o||e[9]!==a?(v=n.jsx(Wa,{virtualMcpId:a,taskId:o}),e[8]=o,e[9]=a,e[10]=v):v=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Sr,{}),e[11]=x):x=e[11];const g=o??"threadless";let b;e[12]!==g?(b=n.jsx(it.Thread,{topbar:x,children:n.jsx(br,{},g)}),e[12]=g,e[13]=b):b=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(bt,{}),e[14]=S):S=e[14];let p;e[15]!==c||e[16]!==s||e[17]!==v||e[18]!==b||e[19]!==f||e[20]!==j?(p=n.jsxs(it,{...s,threadOpen:f,toggleThread:j,contentKey:c,contentNavigation:v,children:[b,S]}),e[15]=c,e[16]=s,e[17]=v,e[18]=b,e[19]=f,e[20]=j,e[21]=p):p=e[21];let k;return e[22]!==y||e[23]!==p?(k=n.jsxs(n.Fragment,{children:[y,p]}),e[22]=y,e[23]=p,e[24]=k):k=e[24],k}function Tr(){const t=V(),e=Me(),s=cn(),{create:r}=It(),{org:i}=ae(),o=je({strict:!1}).org??"",c=Ae({strict:!1}),u=et(),l=Rt(),d=Et(),[m]=D.useState(()=>crypto.randomUUID()),{data:f}=pe.useSession(),[h]=D.useState(()=>Ct(f?.user?.name||f?.user?.email?.split("@")[0])),j=Xe(),y=D.useSyncExternalStore(j.threads.subscribe,j.threads.get),v=D.useSyncExternalStore(j.threadsStatus.subscribe,j.threadsStatus.get),x=Fe(l),g=!!(x&&_t(x)),b=Mt(x,null),[S,p]=D.useState(null);u!==null&&S!==null&&p(null);const k=u===null&&!!d&&!!x&&S!==l,T=z=>Ws(z,l,f?.user?.id,Pt(x?.metadata),g,{baseBranch:b}),N=k&&v.kind!=="loading"?T(y):void 0,w=ur(l,k&&v.kind!=="loading"&&!N),_=cr(u,l,h);da(_.status==="ready"?_.task:null);const P=x?.metadata?.ui?.layout??null,C=P?{defaultMainView:P.defaultMainView??null,chatDefaultOpen:P.chatDefaultOpen??null}:null,M=tn(C),{threadId:A,providerKey:$}=Ya({routeThreadId:u,fallbackKey:m}),F=async()=>{const z=crypto.randomUUID(),E=y.find(H=>H.id===A)?.branch??null;try{await r({id:z,virtual_mcp_id:l,...E?{branch:E}:{}})}catch{}s(z,()=>({}))},O=D.useRef(null);D.useEffect(()=>{const z=E=>{us(E)&&E.shiftKey&&E.code==="KeyS"&&!E.repeat&&(E.preventDefault(),O.current?.())};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[]);const R=_.status==="ready"?_.task:null,I=R?.virtual_mcp_id;if(R&&I&&!dn({routeAgentId:l,threadAgentId:I})){const z=os({org:o,agentId:I,superAgentId:ye(i.id).id});return n.jsx(tt,{target:{route:z,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 E=(N??(w.status==="ready"?T(w.threads):void 0))?.id??(g?m:null);if(E)return n.jsx(ds,{to:".",replace:!0,search:H=>({...H,thread:E})});p(l)}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:l,task:_.status==="ready"?_.task:null,children:n.jsx(Cs,{layout:M,children:n.jsx(jr,{virtualMcpId:l,hasActiveRepository:g,sandboxMap:x.metadata?.sandboxMap,children:n.jsx(vr,{threadId:A,providerKey:$,children:n.jsx(Ie,{children:n.jsx(kr,{layout:M,onNewTaskRef:O,createNewTask:F})})})})})},l)}):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(At,{image:n.jsx(We,{size:48,className:"text-muted-foreground"}),title:t("agentShellLayout.agentShellLayout.agentNotFound"),description:t("agentShellLayout.agentShellLayout.agentNotFoundDescription",{virtualMcpId:l}),actions:n.jsx(qe,{variant:"outline",onClick:()=>e({to:"/$org",params:{org:o}}),children:t("agentShellLayout.agentShellLayout.goToOrgHome")})})})})}function Co(){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(pr,{}),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(bt,{}),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(fr,{children:n.jsx(wn,{children:n.jsxs(In,{children:[n.jsx(Tr,{}),n.jsx(xr,{})]})})})}),t[3]=r):r=t[3],r}export{Co as default};
1
+ import{c as L,a4 as ae,a as pe,aq as Ce,K as fe,m as me,b as V,r as D,l as se,j as n,h as Pe,B as qe,aX as ye,aW as Ie,M as pt,C as he,x as Wt,aY as Yt,w as Zt,v as Xt,D as Jt,ab as Qt,aZ as es,ax as xt,t as ts,ay as ss,d as Me,n as st,a_ as ns,f as je,T as nt,ad as as,k as gt,e as rs,u as Ae,a$ as is,b0 as ls,O as bt,b1 as os,b2 as cs,N as ds,b3 as us,P as De}from"./index-DXP9kVQg.js";import{i as We}from"./AlertCircle-Bv2BEUF9.js";import{G as fs,H as at,A as ve,I as ms,J as hs,j as ps,K as xs,L as gs,M as bs,N as vt,O as vs,n as ys,k as js,m as Ss}from"./agent-icon-DlOM9PPG.js";import{c as ks}from"./use-sidebar-collapsed-C-iF4REf.js";import{T as Ne}from"./toolbar-icon-button-FAf4DETX.js";import{C as q,w as Ts}from"./index-D4BS6nSR.js";import{s as yt,C as Ns,u as _s,V as ws,a as Cs}from"./input-D7fi2U5v.js";import{u as Le,b as Ye,c as $e,d as jt,e as Ps,s as Is}from"./chat-context-BinnCCDE.js";import{u as St}from"./use-session-runtime-CTQ2Nf18.js";import{u as Ms,s as kt}from"./use-ai-providers-vfaNPABY.js";import{b as Tt,a as As,u as Ls}from"./use-organization-settings-DDvTqhI9.js";import{i as $s}from"./CheckCircle-BmUid6M4.js";import{s as rt}from"./XClose-h4E5H3fg.js";import{a as Fe,b as Fs,c as Nt,g as _t}from"./repository-binding-YiwD2eOf.js";import{I as wt}from"./integration-icon-DBOsWn_I.js";import{c as Es}from"./use-decopilot-events-CrlAnQ8d.js";import{t as Ze}from"./ChevronUp-DU-EG51B.js";import{O as Rs}from"./pair-BmrRVXOS.js";import{u as Os,a as Bs}from"./use-thread-outputs-B06BrpVU.js";import{u as Ds}from"./use-deco-credits-ZadQhSnG.js";import{a as zs}from"./experiments-tab-choice-BmmhKG2V.js";import{g as Ct,u as Gs,n as Hs,a as Ks}from"./use-releases-QStvyekn.js";import{u as Vs,d as Pt,a as Xe,b as Je,c as It,e as Us}from"./thread-intent-BpPFlY-9.js";import{f as qs,c as Mt,d as Ws}from"./use-navigate-to-agent-BGJCBCq8.js";import{o as Ys,s as Zs,u as Xs,S as Js}from"./sandbox-lifecycle-context-BT12FjqU.js";import{E as At}from"./empty-state-CP7ytH69.js";import{t as Qs,m as en,u as tn}from"./use-chat-layout-state-BqGllE7O.js";import{C as it}from"./index-Dlxfs42h.js";import{a as Lt,b as $t,P as Ft}from"./popover-CHPTQAbV.js";import{T as Ee,a as Re,c as Oe}from"./tooltip-BvL0CKmO.js";import{T as sn,a as nn}from"./toggle-group-DRmAgRFX.js";import{a as Qe,f as an,L as rn,s as ln}from"./shell-layout-BZ9W6l0o.js";import{u as Et,a as et,r as on,b as Rt,c as cn,d as dn}from"./thread-route-DGdpPDSq.js";import{c as un,C as fn,a as mn,b as hn,e as pn,d as xn}from"./command-WgcgSVia.js";import{i as Ot}from"./ZoomOut-DvoVyeiz.js";import{g as gn,S as bn}from"./task-status-DUKSbYVL.js";import{u as vn}from"./use-clock-tick-BYDkzKDm.js";import{a as Bt,u as yn}from"./use-panel-navigate-Be0CShye.js";import{u as Dt}from"./use-main-panel-tabs-frLY0CIy.js";import{T as _e}from"./tab-icon-glyph-BADTh2WG.js";import{a as jn}from"./UserSquare-1C4lyqiS.js";import{b as Sn,c as zt,S as kn,d as Tn}from"./select-Q4_XsOVo.js";import{S as Nn}from"./use-sandbox-events-DtcmeL0C.js";import{L as _n}from"./project-apps-W3hZYCeW.js";import{L as tt,a as wn}from"./legacy-main-redirect-C3qVODA-.js";import{u as Cn}from"./use-mobile-Do4XIu0C.js";import{L as Pn}from"./preview-dialog-ChrHWNp0.js";import{O as In}from"./markdown-CIT6yohb.js";import{B as lt}from"./blocks-preview-workspace-context-DjNGGVfK.js";import{p as Mn}from"./virtual-mcp-DCCUgWQO.js";import"./Tool01-DqXz0Txk.js";import"./ArrowUp-BTDTOzLX.js";import"./ArrowLeft-Cl79k4DZ.js";import"./LinkBroken01-PSltL834.js";import"./ShoppingBag01-CmG7bP88.js";import"./Building02-GUof9J0b.js";import"./ChevronSelectorVertical-heI72CIu.js";import"./Copy01-nzf-QlFE.js";import"./CreditCard01-Cv4vR00-.js";import"./DotsVertical-CUqDvwhV.js";import"./Image01-Du-KvxND.js";import"./Globe04-BKU9C-bK.js";import"./SwitchHorizontal01-DggiPdjn.js";import"./Key01-Bnd1AHxj.js";import"./Link01-DSMlj1p0.js";import"./Minus-DcXAe-H5.js";import"./Monitor01-BicT_5ll.js";import"./Sun-CBWGnfjI.js";import"./Play-DNGsG6Er.js";import"./Plus-BN7UagXh.js";import"./SearchMd-3slIAJHk.js";import"./Trash01-BRVhue7b.js";import"./Upload01-DbVTvCTH.js";import"./Users01-RbPCVFSx.js";import"./sheet-Ddci2wx1.js";import"./tool-namespace-BhiIe8FJ.js";import"./drawer-BVpga17l.js";import"./collection-search-DIJSdZt0.js";import"./use-mcp-client-DGWpjcL5.js";import"./auth-BRfZNrQw.js";import"./use-mcp-prompts-3ZHImsTq.js";import"./usage-stats-CZL8SgMa.js";import"./form-B2vutj6x.js";import"./label-Cmp7c-YE.js";import"./utils-CVEq3hMx.js";import"./use-copy-tOjayyPs.js";import"./index-BfFT6w4U.js";import"./checkbox-BBWNbZkV.js";import"./ai-providers-logos-DD3qZ33J.js";import"./feature-paywall-DmA4KYPT.js";import"./plan-ladder-Cza5dGz3.js";import"./icon-button-BsJh55bB.js";import"./file-type-icon-uRpzbNga.js";import"./location-V0VwTJTt.js";import"./autosend-CaW4auE_.js";import"./chat-draft-D6rrl_xp.js";import"./tabs-CVl3VdYT.js";import"./active-indicator-CCMhAsc_.js";import"./input-C9HjOnkS.js";import"./suggestion-DEz_OZWr.js";import"./use-org-fs-BoEUMisn.js";import"./useInfiniteQuery-IMHm6XfO.js";import"./infiniteQueryObserver-Bd0VUsPZ.js";import"./question-004-sINsf4GQ.js";import"./add-connection-dialog-_eytJLIY.js";import"./extract-connection-data-BII4xsnj.js";import"./metadata-D72DunRR.js";import"./connection-D8fbJOku.js";import"./url-slug-AXj6kGjK.js";import"./connection-card-B0pQo4uU.js";import"./connection-slug-CITJ0kGN.js";import"./slugify-CEUa2lfQ.js";import"./textarea-RpjQmTzH.js";import"./use-connection-BvDS_cY8.js";import"./schema-BIYky4vn.js";import"./connection-form-helpers-xuzuwHvw.js";import"./authenticate-and-persist-oauth-hn1TtboK.js";import"./mcp-oauth-BA0BQZDh.js";import"./mcp-oauth-DLzmg49T.js";import"./collection-tabs-opUuz5vN.js";import"./badge-DFfmOl2u.js";import"./use-infinite-scroll-CO7fuxbC.js";import"./useSuspenseInfiniteQuery-DsI-d6iZ.js";import"./use-task-board-events-upfviPMy.js";import"./task-board-2YplgWyy.js";import"./schema-Dfn1mNtT.js";import"./watch-sse-pool-CKpL2EpB.js";import"./backoff-CrEUbyZT.js";import"./collapsible-BXxZmISg.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CscMxyZY.js";import"./types-Bq5bSX6k.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./serial-task-queue-CGOeQgpr.js";import"./delay-CnY5UFtP.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./resizable-DWfYJIwa.js";import"./use-project-scope-DE777QKf.js";import"./index-803Ya6Hj.js";import"./use-deployment-admin-BhOJyjAy.js";import"./admin-fetch-BhTJlAsX.js";import"./project-icon-FtyZUi38.js";import"./new-project-dialog-CFuU9Fex.js";import"./repository-import-picker-DzEhAaUN.js";import"./repository-picker-a8LTQxa8.js";import"./use-debounced-value-BOr4oihA.js";import"./required-auth-layout-XwFjudX9.js";import"./use-org-sso-BLpWw2Jv.js";import"./index-CgXFpgGW.js";import"./use-mcp-tools-Ce5gsgJo.js";import"./resolve-tab-icon-Dest6_yi.js";import"./use-task-metadata-5TM0QDKC.js";import"./preview-source-BsRLGWUP.js";import"./use-project-native-view-presence-WdxwZN6P.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-Dd-ygMY7.js";import"./site-slug-DebpOoQq.js";import"./index-BdQq_4o_.js";import"./sandbox-url-D3mC8qhT.js";import"./preview-content-BpX8kzUA.js";import"./file-share-button-DFaqeXzB.js";import"./file-preview-BwyLadss.js";import"./utils-ogbk5u13.js";import"./editor-BcjWwrMC.js";function An({isThreadLocked:t,hasCloudProviderKeys:e,sandboxOnlyChats:s,canRunClaudeCode:r}){return t?null:!e&&!(s&&r)?"provider":s&&!r?"claude-code-provider":null}function Ln(){const t=L.c(26),e=Ms(),s=Le(),r=Tt(),i=As("chat_harness_codex"),{org:a}=ae(),{data:o}=pe.useSession(),c=o?.user.id??"",u=Ce(),l=e.some(Fn);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&&!l;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 j=me(h);let y;t[9]!==a.id?(y=fe.githubCopilot(a.id),t[9]=a.id,t[10]=y):y=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&&!l;let g;t[13]!==y||t[14]!==v||t[15]!==x?(g={queryKey:y,queryFn:v,enabled:x},t[13]=y,t[14]=v,t[15]=x,t[16]=g):g=t[16];const b=me(g);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($n)||N.data?.connected!==!1?null:"codex-provider":An({isThreadLocked:s?.isThreadLocked??!1,hasCloudProviderKeys:e.length>0,sandboxOnlyChats:r,canRunClaudeCode:l||j.data?.connected!==!1||b.data?.connected!==!1||!!b.data?.orgShare})}function $n(t){return yt(t.providerId)}function Fn(t){return kt(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 En(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function Rn(t){const e=L.c(4),{items:s}=t;let r;e[0]!==s?(r=s.map(On),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 On(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 Bn(t){const e=L.c(33),{userTokens:s,assistantTokens:r,otherTokens:i}=t,a=V(),o=s+r+i,c=o>0?s/o*100:0,u=o>0?r/o*100:0,l=o>0?i/o*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]!==l?(f=l>0&&n.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${l}%`}}),e[4]=l,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 j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=j):j=e[10];let y;e[11]!==a||e[12]!==c?(y=a("chat.contextPanel.userPercent",{pct:c.toFixed(1)}),e[11]=a,e[12]=c,e[13]=y):y=e[13];let v;e[14]!==y?(v=n.jsxs("div",{className:"flex items-center gap-1.5",children:[j,n.jsx("span",{className:"text-xs text-muted-foreground",children:y})]}),e[14]=y,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 g;e[17]!==u||e[18]!==a?(g=a("chat.contextPanel.assistantPercent",{pct:u.toFixed(1)}),e[17]=u,e[18]=a,e[19]=g):g=e[19];let b;e[20]!==g?(b=n.jsxs("div",{className:"flex items-center gap-1.5",children:[x,n.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e[20]=g,e[21]=b):b=e[21];let S;e[22]!==l||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:l.toFixed(1)})})]}),e[22]=l,e[23]=i,e[24]=a,e[25]=S):S=e[25];let p;e[26]!==b||e[27]!==S||e[28]!==v?(p=n.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[v,b,S]}),e[26]=b,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 Dn(t){const e=L.c(14),{agentId:s,isError:r}=t,i=Fe(s),a=V();let o;e[0]!==i?.title||e[1]!==a?(o=i?.title??a("chat.subtask.subtaskNoun"),e[0]=i?.title,e[1]=a,e[2]=o):o=e[2];const c=o,u=i?.icon??null;let l;e[3]!==u||e[4]!==c?(l=n.jsx(wt,{icon:u,name:c,size:"xs",className:"size-6 rounded-md shrink-0"}),e[3]=u,e[4]=c,e[5]=l):l=e[5];const d=r?"text-destructive":"text-foreground";let m;e[6]!==d?(m=se("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]!==l||e[12]!==f?(h=n.jsxs(n.Fragment,{children:[l,f]}),e[11]=l,e[12]=f,e[13]=h):h=e[13],h}function zn(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 o;e[2]!==a?(o=n.jsx(wt,{icon:null,name:a,size:"xs",className:"size-6 rounded-md shrink-0"}),e[2]=a,e[3]=o):o=e[3];const c=s?"text-destructive":"text-foreground";let u;e[4]!==c?(u=se("shrink-0 font-medium",c),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==a||e[7]!==u?(l=n.jsx("span",{className:u,children:a}),e[6]=a,e[7]=u,e[8]=l):l=e[8];let d;return e[9]!==o||e[10]!==l?(d=n.jsxs(n.Fragment,{children:[o,l]}),e[9]=o,e[10]=l,e[11]=d):d=e[11],d}function Gn(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",o=s.state==="approval-requested";let c;e[0]!==a?(c=n.jsx(zn,{isError:a}),e[0]=a,e[1]=c):c=e[1];let u;e[2]!==r||e[3]!==a?(u=n.jsx(Dn,{agentId:r,isError:a}),e[2]=r,e[3]=a,e[4]=u):u=e[4];let l;e[5]!==c||e[6]!==u?(l=n.jsx(D.Suspense,{fallback:c,children:u}),e[5]=c,e[6]=u,e[7]=l):l=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]!==o||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"}):o?n.jsx(We,{size:12,className:"text-warning"}):n.jsx($s,{size:12,className:"text-success"})}),e[10]=o,e[11]=a,e[12]=i,e[13]=m):m=e[13];let f;return e[14]!==l||e[15]!==d||e[16]!==m?(f=n.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[l,d,m]}),e[14]=l,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Hn(t){const e=L.c(51),{onClose:s,back:r,className:i}=t,a=V(),[o,c]=D.useState(null),{messages:u}=Ye(),{activeTask:l}=$e(),{selectedModel:d,selectedVirtualMcp:m}=jt(),f=Ps(u),h=[...u].reverse().find(ta),j=h?.metadata?.usage,y=[...u].reverse().find(ea)?.metadata?.models?.thinking,v=h?.metadata?.modelLimits?.contextWindow??(!y||y.id===d?.modelId?d?.limits?.contextWindow:null)??null,x=j?.contextTokens??0,g=v&&v>0?(x/v*100).toFixed(1):null,b=u;let S;e[0]!==b?(S=b.filter(Qn).reduce(Jn,0),e[0]=b,e[1]=S):S=e[1];const p=S,k=u;let T;e[2]!==k?(T=k.filter(Xn).reduce(Zn,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??l?.created_at,M=P?.metadata?.created_at??l?.updated_at,A=u.filter(Yn),$=u.flatMap(qn),F=En(y?.id??d?.modelId),O=m?.title??"Super Agent",R=Es(),I=[{label:a("chat.contextPanel.sessionLabel"),value:l?.title??a("chat.contextPanel.newChat")},{label:a("chat.contextPanel.messagesLabel"),value:A.length},{label:a("chat.contextPanel.agentLabel"),value:O},...R?[{label:a("chat.contextPanel.modelLabel"),value:F}]:[],{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:g!==null?`${g}%`:"—"},{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(M)}];if(!l&&A.length===0){let G;e[4]!==i?(G=se("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 J;e[8]!==re?(J=n.jsx("span",{className:"text-sm font-medium text-foreground",children:re}),e[8]=re,e[9]=J):J=e[9];let Q;e[10]!==r?(Q=r?n.jsx(at,{size:14,className:"text-muted-foreground"}):n.jsx(rt,{size:14,className:"text-muted-foreground"}),e[10]=r,e[11]=Q):Q=e[11];let ee;e[12]!==s||e[13]!==Q?(ee=n.jsx("button",{type:"button",onClick:s,className:"flex size-6 items-center justify-center hover:bg-accent transition-colors rounded-lg",children:Q}),e[12]=s,e[13]=Q,e[14]=ee):ee=e[14];let ne;e[15]!==J||e[16]!==ee?(ne=n.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[J,ee]}),e[15]=J,e[16]=ee,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 te;e[20]!==ie?(te=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]=te):te=e[21];let oe;return e[22]!==ne||e[23]!==te||e[24]!==G?(oe=n.jsxs("div",{className:G,children:[ne,te]}),e[22]=ne,e[23]=te,e[24]=G,e[25]=oe):oe=e[25],oe}let z;e[26]!==i?(z=se("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",i),e[26]=i,e[27]=z):z=e[27];let E;e[28]!==a?(E=a("chat.contextPanel.title"),e[28]=a,e[29]=E):E=e[29];let H;e[30]!==E?(H=n.jsx("span",{className:"text-sm font-medium text-foreground",children:E}),e[30]=E,e[31]=H):H=e[31];let B;e[32]!==r?(B=r?n.jsx(at,{className:"size-3.5"}):n.jsx(rt,{className:"size-3.5"}),e[32]=r,e[33]=B):B=e[33];let U;e[34]!==s||e[35]!==B?(U=n.jsx(qe,{type:"button",variant:"ghost",size:"icon-sm",onClick:s,className:"text-muted-foreground",children:B}),e[34]=s,e[35]=B,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 X;e[42]!==Y?(X=n.jsx("span",{className:"text-xs text-muted-foreground",children:Y}),e[42]=Y,e[43]=X):X=e[43];let W;e[44]!==N||e[45]!==w||e[46]!==p?(W=n.jsx(Bn,{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]!==X||e[49]!==W?(le=n.jsxs("div",{className:"flex flex-col gap-3",children:[X,W]}),e[48]=X,e[49]=W,e[50]=le):le=e[50],n.jsxs("div",{className:z,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(Un)})]}),n.jsx(Rn,{items:I}),le,A.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:A.map(G=>{const re=G.metadata?.created_at,J=o?.id===G.id;return n.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:()=>c(J?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:se("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)})]}),J&&n.jsxs(n.Fragment,{children:[G.role==="assistant"&&(()=>{const Q=G.metadata?._request;if(!Q)return null;const ee=Q.systemSections??[],ne=Math.max(1,...ee.map(Vn)),ie=ee.reduce(Kn,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:[Q.activeTools??0," / ",Q.tools??0," ",a("chat.contextPanel.toolsActive")]})]}),ee.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")]})]}),ee.map((te,oe)=>{const ce=te.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${oe}`,xe=te.chars/ne*100,de=Math.round(te.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 Kn(t,e){return t+e.chars}function Vn(t){return t.chars}function Un(t,e){return n.jsx(Gn,{part:t},e)}function qn(t){return(t.parts??[]).filter(Wn)}function Wn(t){return t.type==="tool-subtask"}function Yn(t){return t.role!=="system"}function Zn(t,e){const s=e.metadata?.usage;return t+(s?.outputTokens??0)}function Xn(t){return t.role==="assistant"}function Jn(t,e){const s=e.metadata?.usage;return t+(s?.inputTokens??0)}function Qn(t){return t.role==="user"}function ea(t){return t.role==="assistant"&&t.metadata?.models}function ta(t){return t.role==="assistant"&&t.metadata?.usage}function sa(t){const e=L.c(21),{onOpenContextPanel:s}=t,{org:r}=ae(),{selectedVirtualMcp:i}=jt();let a;e[0]!==r.id?(a=ye(r.id),e[0]=r.id,e[1]=a):a=e[1];const c=i??a,l=Fe(c.id)??c,d=l.title??"Super Agent",m=l.icon??null,f=l.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 j;e[5]!==d?(j=n.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:d}),e[5]=d,e[6]=j):j=e[6];let y;e[7]!==f?(y=f?n.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-balance",children:f}):null,e[7]=f,e[8]=y):y=e[8];let v;e[9]!==j||e[10]!==y?(v=n.jsxs("div",{className:"space-y-1.5",children:[j,y]}),e[9]=j,e[10]=y,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 g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(q.IceBreakers,{className:"pb-3"}),e[15]=g):g=e[15];let b;e[16]!==s?(b=n.jsxs(q.Footer,{children:[g,n.jsx(q.Input,{onOpenContextPanel:s})]}),e[16]=s,e[17]=b):b=e[17];let S;return e[18]!==x||e[19]!==b?(S=n.jsxs(n.Fragment,{children:[x,b]}),e[18]=x,e[19]=b,e[20]=S):S=e[20],S}function ot(t){const e=L.c(17),{outputs:s,collapsed:r,onToggle:i,variant:a}=t,o=a==="card"?"rounded-xl bg-muted/95 shadow-edge backdrop-blur-sm":"border-b border-border bg-background";let c;e[0]!==o?(c=se(o),e[0]=o,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 l=r&&"-rotate-90";let d;e[3]!==l?(d=se("size-4 text-muted-foreground transition-transform",l),e[3]=l,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(na)}),e[10]=r,e[11]=s,e[12]=h):h=e[12];let j;return e[13]!==c||e[14]!==f||e[15]!==h?(j=n.jsxs("div",{className:c,children:[f,h]}),e[13]=c,e[14]=f,e[15]=h,e[16]=j):j=e[16],j}function na(t){return n.jsx(Rs,{file:t},t.key)}function aa(){const t=L.c(13),e=Le()?.taskId??null,s=Os();let r;t[0]!==s?(r={enabled:s},t[0]=s,t[1]=r):r=t[1];const{data:i}=Bs(e,r),[a,o]=D.useState(!1),[c,u]=D.useState(!0);if(!e||!i||i.length===0)return null;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>o(ia),t[2]=l):l=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(ot,{variant:"card",outputs:i,collapsed:a,onToggle:l})}),t[3]=a,t[4]=i,t[5]=d):d=t[5];let m;t[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>u(ra),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(ot,{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 ra(t){return!t}function ia(t){return!t}function la(){const t=L.c(1);D.use(Ye().ready);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Ns,{children:n.jsx(oa,{})}),t[0]=e):e=t[0],e}function oa(){const t=L.c(29),{active:e}=_s(),{org:s}=ae(),r=Le(),{isChatEmpty:i}=Ye(),[a,o]=D.useState("chat"),c=Ds(),u=V(),l=Ln(),{runtime:d}=St(r?.virtualMcpId);if(l!==null&&d!=="cms"){let N;return t[0]!==l||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:l==="codex-provider"?n.jsx(q.NoAiProviderEmptyState,{title:u("settings.codexSubscription.setupHeading"),description:u("settings.codexSubscription.setupDescription"),providerFilter:yt}):l==="claude-code-provider"?n.jsx(q.NoAiProviderEmptyState,{title:u("chat.noAiProviderEmptyState.supportedHeading"),description:u("chat.noAiProviderEmptyState.supportedSubtitle"),providerFilter:kt}):n.jsx(q.NoAiProviderEmptyState,{})})})}),t[0]=l,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&&!Ts(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 j;t[10]!==h?(j=h&&n.jsx(q.CreditsEmptyState,{}),t[10]=h,t[11]=j):j=t[11];let y;t[12]!==a||t[13]!==i||t[14]!==d||t[15]!==e?(y=!e&&n.jsx("div",{inert:a!=="chat"?!0:void 0,"aria-hidden":a!=="chat",className:se("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(sa,{onOpenContextPanel:()=>o("context")}):n.jsxs(n.Fragment,{children:[n.jsxs(q.Main,{className:"relative flex flex-col overflow-hidden @container",children:[n.jsx(aa,{}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(q.Messages,{})})]}),n.jsx(q.Footer,{children:n.jsx(q.Input,{onOpenContextPanel:()=>o("context")})})]})}),t[12]=a,t[13]=i,t[14]=d,t[15]=e,t[16]=y):y=t[16];let v;t[17]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(ws,{}),t[17]=v):v=t[17];const x=a!=="context"?!0:void 0,g=a!=="context",b=a==="context"?"opacity-100":"opacity-0 pointer-events-none";let S;t[18]!==b?(S=se("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",b),t[18]=b,t[19]=S):S=t[19];let p;t[20]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Hn,{back:!0,onClose:()=>o("chat")}),t[20]=p):p=t[20];let k;t[21]!==x||t[22]!==g||t[23]!==S?(k=n.jsx("div",{inert:x,"aria-hidden":g,className:S,children:p}),t[21]=x,t[22]=g,t[23]=S,t[24]=k):k=t[24];let T;return t[25]!==j||t[26]!==y||t[27]!==k?(T=n.jsxs(q,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[j,y,v,k]}),t[25]=j,t[26]=y,t[27]=k,t[28]=T):T=t[28],T}function ca(){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(la,{})}),t[4]=i):i=t[4];let a;return t[5]!==r?(a=n.jsx(pt,{fallback:r,children:i}),t[5]=r,t[6]=a):a=t[6],a}function da(t){const e=L.c(10),{org:s}=ae(),r=Vs(),{data:i}=pe.useSession(),a=i?.user?.id,o=t?.id??null,c=!!t&&!!a&&!!t.created_by&&t.created_by!==a;let u;e[0]!==s.id||e[1]!==o?(u=fe.viewedThreadMetadataRefresh(s.id,o??""),e[0]=s.id,e[1]=o,e[2]=u):u=e[2];const l=!!r&&!!o&&c;let d;e[3]!==r||e[4]!==o?(d=async()=>(await r?.refreshThreadMetadata(o??""),!0),e[3]=r,e[4]=o,e[5]=d):d=e[5];let m;e[6]!==u||e[7]!==l||e[8]!==d?(m={queryKey:u,enabled:l,staleTime:Number.POSITIVE_INFINITY,queryFn:d},e[6]=u,e[7]=l,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 o;e[0]!==s?(o=n.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=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(ua),e[4]=a,e[5]=u):u=e[5];let l;e[6]!==s||e[7]!==c||e[8]!==u||e[9]!==r?(l=n.jsx(nn,{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]=l):l=e[10];let d;return e[11]!==o||e[12]!==l?(d=n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,l]}),e[11]=o,e[12]=l,e[13]=d):d=e[13],d}function ua(t){return n.jsxs(sn,{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 fa(t){const e=L.c(91),{panel:s,className:r}=t,i=r===void 0?"md:size-[34px]":r,a=V();let o;e[0]!==a?(o=a("sidebar.taskGroupsList.filterChats"),e[0]=a,e[1]=o):o=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 l;e[5]!==i||e[6]!==s.filtersActive||e[7]!==o||e[8]!==u?(l=n.jsx(Ee,{asChild:!0,children:n.jsx(Lt,{asChild:!0,children:n.jsxs(Ne,{"aria-label":o,active:s.filtersActive,className:i,children:[c,u]})})}),e[5]=i,e[6]=s.filtersActive,e[7]=o,e[8]=u,e[9]=l):l=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]!==l||e[15]!==m?(f=n.jsxs(Oe,{children:[l,m]}),e[14]=l,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 j=s.groupBy;let y;e[19]!==s?(y=G=>{he("tasks_panel_group_by_changed",{to_value:G}),s.setGroupBy(G)},e[19]=s,e[20]=y):y=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 g;e[24]!==v?(g={value:"flat",label:v,icon:x},e[24]=v,e[25]=g):g=e[25];let b;e[26]!==a?(b=a("sidebar.taskGroupsList.viewStatus"),e[26]=a,e[27]=b):b=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]!==b?(p={value:"status",label:b,icon:S},e[29]=b,e[30]=p):p=e[30];let k;e[31]!==g||e[32]!==p?(k=[g,p],e[31]=g,e[32]=p,e[33]=k):k=e[33];let T;e[34]!==s.groupBy||e[35]!==y||e[36]!==k||e[37]!==h?(T=n.jsx(Ge,{label:h,value:j,onChange:y,options:k}),e[34]=s.groupBy,e[35]=y,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 M;e[47]!==a?(M=a("sidebar.taskGroupsList.typeChats"),e[47]=a,e[48]=M):M=e[48];let A;e[49]!==M?(A={value:"manual",label:M},e[49]=M,e[50]=A):A=e[50];let $;e[51]!==a?($=a("sidebar.taskGroupsList.typeAuto"),e[51]=a,e[52]=$):$=e[52];let F;e[53]!==$?(F={value:"automation",label:$},e[53]=$,e[54]=F):F=e[54];let O;e[55]!==C||e[56]!==A||e[57]!==F?(O=[C,A,F],e[55]=C,e[56]=A,e[57]=F,e[58]=O):O=e[58];let R;e[59]!==s.typeFilter||e[60]!==N||e[61]!==_||e[62]!==O?(R=n.jsx(Ge,{label:N,value:w,onChange:_,options:O}),e[59]=s.typeFilter,e[60]=N,e[61]=_,e[62]=O,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 z=s.showAll?"team":"mine";let E;e[66]!==s?(E=G=>s.setShowAll(G==="team"),e[66]=s,e[67]=E):E=e[67];let H;e[68]!==a?(H=a("sidebar.taskGroupsList.scopeMine"),e[68]=a,e[69]=H):H=e[69];let B;e[70]!==H?(B={value:"mine",label:H},e[70]=H,e[71]=B):B=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]!==B||e[77]!==Z?(Y=[B,Z],e[76]=B,e[77]=Z,e[78]=Y):Y=e[78];let X;e[79]!==I||e[80]!==z||e[81]!==E||e[82]!==Y?(X=n.jsx(Ge,{label:I,value:z,onChange:E,options:Y}),e[79]=I,e[80]=z,e[81]=E,e[82]=Y,e[83]=X):X=e[83];let W;e[84]!==T||e[85]!==R||e[86]!==X?(W=n.jsxs($t,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[T,R,X]}),e[84]=T,e[85]=R,e[86]=X,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 ma(t,e){return t.filter(s=>s.id===e||!!s.trigger_id||Qs(s))}function ha(){const t=L.c(2),e=Fs()??[];let s;return t[0]!==e?(s=r=>{if(!r)return;const i=e.find(a=>a.id===r);return i?Pt(i.metadata):void 0},t[0]=e,t[1]=s):s=t[1],s}function pa(t){const e=L.c(9),{virtualMcpId:s,size:r,showAutomationBadge:i}=t,a=r===void 0?"sm":r,o=V();let c;e[0]!==a||e[1]!==s?(c=s?n.jsx(xa,{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]!==o?(u=i&&n.jsx("span",{"aria-label":o("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(Ot,{size:10,className:"text-white"})}),e[3]=i,e[4]=o,e[5]=u):u=e[5];let l;return e[6]!==c||e[7]!==u?(l=n.jsxs("div",{className:"relative shrink-0",children:[c,u]}),e[6]=c,e[7]=u,e[8]=l):l=e[8],l}function xa(t){const e=L.c(6),{virtualMcpId:s,size:r}=t,i=Nt(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 o;return e[2]!==i.title||e[3]!==r||e[4]!==a?(o=n.jsx(ve,{icon:a,name:i.title,size:r}),e[2]=i.title,e[3]=r,e[4]=a,e[5]=o):o=e[5],o}const ct=["thread"];function ga(t){const e=L.c(53),{open:s,onOpenChange:r}=t,[i,a]=D.useState(""),{org:o}=ae(),{setTaskId:c}=Qe(),u=Ce(),l=V();let d,m,f,h;e[0]!==o.id||e[1]!==i?(h=i.trim(),d=h?20:10,f=me,m=fe.globalSearch(o.id,h,d,ct),e[0]=o.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 j;e[6]!==d||e[7]!==u||e[8]!==h?(j=async()=>{const I=await u.call("GLOBAL_SEARCH",{query:h,limit:d,types:[...ct]});return{...I,items:I.items.filter(ba)}},e[6]=d,e[7]=u,e[8]=h,e[9]=j):j=e[9];let y;e[10]!==s||e[11]!==m||e[12]!==j?(y={queryKey:m,enabled:s,queryFn:j,staleTime:1e4},e[10]=s,e[11]=m,e[12]=j,e[13]=y):y=e[13];const{data:v,isFetching:x}=f(y);let g;e[14]!==v?.items?(g=v?.items??[],e[14]=v?.items,e[15]=g):g=e[15];const b=g;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]!==l?(N=l("tasksPanel.globalSearchDialog.title"),e[21]=l,e[22]=N):N=e[22];let w;e[23]!==N?(w=n.jsx(Wt,{children:N}),e[23]=N,e[24]=w):w=e[24];let _;e[25]!==l?(_=l("tasksPanel.globalSearchDialog.description"),e[25]=l,e[26]=_):_=e[26];let P;e[27]!==_?(P=n.jsx(Yt,{children:_}),e[27]=_,e[28]=P):P=e[28];let C;e[29]!==P||e[30]!==w?(C=n.jsxs(Zt,{className:"sr-only",children:[w,P]}),e[29]=P,e[30]=w,e[31]=C):C=e[31];let M;e[32]!==l?(M=l("tasksPanel.globalSearchDialog.placeholder"),e[32]=l,e[33]=M):M=e[33];let A;e[34]!==i||e[35]!==M?(A=n.jsx(pn,{value:i,onValueChange:a,placeholder:M}),e[34]=i,e[35]=M,e[36]=A):A=e[36];let $;e[37]!==T||e[38]!==x||e[39]!==b||e[40]!==l||e[41]!==h?($=n.jsx(un,{children:x&&b.length===0?n.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l("tasksPanel.globalSearchDialog.searching")}):b.length===0?n.jsx(fn,{children:l("tasksPanel.globalSearchDialog.noResults")}):n.jsx(mn,{heading:h?void 0:l("tasksPanel.globalSearchDialog.recent"),children:b.map(I=>I.type==="thread"?n.jsxs(hn,{value:`thread:${I.id}:${I.title}`,onSelect:()=>T(I),className:"gap-2.5",children:[n.jsx(pa,{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||l("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]=b,e[40]=l,e[41]=h,e[42]=$):$=e[42];let F;e[43]!==A||e[44]!==$?(F=n.jsxs(xn,{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:[A,$]}),e[43]=A,e[44]=$,e[45]=F):F=e[45];let O;e[46]!==C||e[47]!==F?(O=n.jsxs(Xt,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[C,F]}),e[46]=C,e[47]=F,e[48]=O):O=e[48];let R;return e[49]!==p||e[50]!==s||e[51]!==O?(R=n.jsx(Jt,{open:s,onOpenChange:p,children:O}),e[49]=p,e[50]=s,e[51]=O,e[52]=R):R=e[52],R}function ba(t){return t.type==="thread"}function va(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 ya(t){return t==="ephemeral"||t.startsWith("thread:")}function Gt(t){const e=L.c(45),{task:s,isActive:r,onClick:i,onArchive:a,showAutomationBadge:o,showAgentIcon:c,hideStatusIdle:u,indented:l}=t,d=V(),m=gn(s.status),f=m.icon,h=s.metadata?.kind==="tool_call_run",j=Nt(h?void 0:s.virtual_mcp_id);let y;e[0]!==j?(y=_t(j),e[0]=j,e[1]=y):y=e[1];const v=y;vn(6e4);const x=o||!!s.trigger_id,g=s.id,b="button",S=0;let p;e[2]!==i?(p=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),i())},e[2]=i,e[3]=p):p=e[3];const k=l?"-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=se("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]!==j?.icon||e[10]!==j?.title?(w=c&&!h&&n.jsx(ve,{icon:j?.icon??null,name:j?.title??"?",size:"2xs"}),e[7]=h,e[8]=c,e[9]=j?.icon,e[10]=j?.title,e[11]=w):w=e[11];let _;e[12]!==x||e[13]!==d?(_=x&&n.jsx(Ot,{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 M;e[20]!==_||e[21]!==C?(M=n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[_,C]}),e[20]=_,e[21]=C,e[22]=M):M=e[22];let A;e[23]!==r||e[24]!==v||e[25]!==s.branch||e[26]!==s.updated_at?(A=s.updated_at&&n.jsxs("div",{className:se("flex items-center gap-1 text-2xs min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[s.branch&&!ya(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:Qt(new Date(s.updated_at))})]}),e[23]=r,e[24]=v,e[25]=s.branch,e[26]=s.updated_at,e[27]=A):A=e[27];let $;e[28]!==M||e[29]!==A?($=n.jsxs("div",{className:"flex-1 min-w-0",children:[M,A]}),e[28]=M,e[29]=A,e[30]=$):$=e[30];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",O=!u&&n.jsx("span",{className:se("[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:se("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(Ee,{asChild:!0,children:n.jsx(qe,{variant:"ghost",size:"icon","aria-label":d("tasksPanel.taskRow.archiveTask"),onClick:E=>{E.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(es,{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]!==O||e[35]!==R?(I=n.jsxs("div",{className:F,children:[O,R]}),e[34]=O,e[35]=R,e[36]=I):I=e[36];let z;return e[37]!==i||e[38]!==$||e[39]!==I||e[40]!==p||e[41]!==N||e[42]!==w||e[43]!==s.id?(z=n.jsxs("div",{"data-task-id":g,role:b,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]=z):z=e[44],z}const dt=["requires_action","in_progress","failed","expired","completed"];function ja(t){const e=new Map(dt.map(s=>[s,[]]));for(const s of t){const r=s.status??"completed";(e.get(r)??e.get("completed")).push(s)}return dt.map(s=>({status:s,threads:e.get(s)}))}const Sa="sidebar.group.expanded.";function ka(t,e){const s=L.c(3),[r,i]=xt(`${Sa}${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 Ht(t){const e=L.c(18),{onClick:s,isFetching:r,indented:i}=t,a=V();let o;e[0]!==a?(o=a("sidebar.showMoreButton.ariaLabel"),e[0]=a,e[1]=o):o=e[1];const c=i?"-ml-4 pl-6 pr-2":"px-2";let u;e[2]!==c?(u=se("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 l;e[4]!==r?(l=r&&n.jsx(Pe,{className:"size-3.5"}),e[4]=r,e[5]=l):l=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]!==o||e[14]!==u||e[15]!==l||e[16]!==m?(f=n.jsxs("button",{type:"button","aria-label":o,onClick:s,disabled:r,className:u,children:[l,m]}),e[11]=r,e[12]=s,e[13]=o,e[14]=u,e[15]=l,e[16]=m,e[17]=f):f=e[17],f}function Ta(t,e,s,r){return[t,e,s,r.type,r.member,r.currentUserId??""].join("|")}function Na(t){return t.member==="mine"&&!t.currentUserId}const Kt=4;let Te=0;const Ve=[];function _a(){for(;Te<Kt&&Ve.length>0;){const t=Ve.shift();t&&t()}}function Vt(t){return new Promise((e,s)=>{const r=()=>{Te++,t().then(e,s).finally(()=>{Te--,_a()})};Te<Kt?r():Ve.push(r)})}const Be=10;function ut(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 o={where:a,limit:i,offset:s,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function wa(t,e,s,r){let i=0;for(const a of t)Ut(a,e,s,r)&&i++;return i}function He(t,e,s,r){return wa(t,e,s,r)}function Ca(t,e){return!!(t>=Be||t===0&&e)}function ft(t,e){return t<e}function Pa(t,e){return e===!1?!1:e===!0?!0:t}function Ut(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 Ia(t,e){return e?t>=Be?!0:null:!1}function mt(t){return we.get(t)}function Ma(t,e){we.set(t,e)}function Aa(t,e,s){const r=we.get(t);if(r!==void 0){s(r);return}let i=ke.get(t);i||(i=Vt(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 ht(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 La(t,e,s,r,i){let a=0;for(const o of t)e.has(o.id)||Ut(o,s,r,i)&&a++;return a}function $a(t,e,s,r){const i=L.c(8),{org:a}=ae(),o=Ta(a.id,t,e,s);let c;i[0]!==s?(c=Na(s),i[0]=s,i[1]=c):c=i[1];const u=c,[l,d]=D.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});l.identity!==o&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const m=Xe(),{threads:f,hasMore:h}=Je(),j=He(f,t,e,s),y=Ca(j,h),v=Ia(j,h),x=Ce();if(l.identity===o&&l.serverHasMore===null){const T=v??mt(o);T!==void 0&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:l.probeSubscribedIdentity,serverHasMore:T})}!u&&l.identity===o&&l.serverHasMore===null&&v===null&&mt(o)===void 0&&l.probeSubscribedIdentity!==o&&(d(T=>T.identity===o?{...T,isProbing:!0,probeSubscribedIdentity:o}:T),Aa(o,async()=>{const T=ut(t,e,0,s,1),N=await x.call("COLLECTION_THREADS_LIST",T),{totalCount:w}=ht(N),_=He(m.threads.get(),t,e,s);return w===void 0?!1:ft(_,w)},T=>{d(N=>N.identity!==o?N:{...N,isProbing:!1,serverHasMore:T})}));const b=async function(){if(l.isFetching||l.isProbing||u)return;const N=o;d(w=>w.identity===N?{...w,isFetching:!0}:w);try{const w=He(f,t,e,s),_=ut(t,e,w,s,Be),P=await Vt(()=>x.call("COLLECTION_THREADS_LIST",_)),{items:C,hasMore:M,totalCount:A}=ht(P),$=new Set(f.map(Fa)),F=La(C,$,t,e,s),O=w;m.mergeThreads(C),d(R=>{if(R.identity!==N)return R;let I;return A!==void 0?I=ft(O+F,A):I=C.length===0||F===0?!1:M,Ma(N,I),{...R,isFetching:!1,serverHasMore:I}})}catch(w){const _=w,P=_ instanceof Error?_.message:String(_);ts.error(`Could not load more tasks: ${P}`),d(C=>C.identity===N?{...C,isFetching:!1}:C)}},S=l.isFetching||l.isProbing,p=!u&&!S&&Pa(y,l.serverHasMore);let k;return i[2]!==S||i[3]!==b||i[4]!==p||i[5]!==l.isProbing||i[6]!==l.serverHasMore?(k={hasMore:p,isFetching:S,isProbing:l.isProbing,serverHasMore:l.serverHasMore,loadMore:b},i[2]=S,i[3]=b,i[4]=p,i[5]=l.isProbing,i[6]=l.serverHasMore,i[7]=k):k=i[7],k}function Fa(t){return t.id}function Ea(t){const e=L.c(20),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u}=t,{isFetching:l,isProbing:d,loadMore:m,hasMore:f,serverHasMore:h}=$a("status",s,u),[j,y]=D.useState(!1);!j&&r.length===0&&h===!0&&!l&&!d&&(y(!0),queueMicrotask(()=>{m()}));let v;if(e[0]!==i||e[1]!==c||e[2]!==u||e[3]!==o||e[4]!==a||e[5]!==r){let b;e[7]!==i||e[8]!==c||e[9]!==u||e[10]!==o||e[11]!==a?(b=S=>n.jsx(Gt,{task:S,isActive:i===S.id,onClick:()=>a(S),onArchive:c&&S.created_by===u.currentUserId?()=>o(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]=o,e[11]=a,e[12]=b):b=e[12],v=r.map(b),e[0]=i,e[1]=c,e[2]=u,e[3]=o,e[4]=a,e[5]=r,e[6]=v}else v=e[6];let x;e[13]!==f||e[14]!==l||e[15]!==m?(x=(f||l)&&n.jsx(Ht,{onClick:()=>{m()},isFetching:l,indented:!0}),e[13]=f,e[14]=l,e[15]=m,e[16]=x):x=e[16];let g;return e[17]!==v||e[18]!==x?(g=n.jsxs(n.Fragment,{children:[v,x]}),e[17]=v,e[18]=x,e[19]=g):g=e[19],g}function Ra(t){const e=L.c(43),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u}=t,l=V(),d=bn[s],m=d.icon,[f,h]=ka(`status-${s}`,!1);let j;e[0]!==f||e[1]!==h?(j=function(){h(!f)},e[0]=f,e[1]=h,e[2]=j):j=e[2];const y=j;let v;e[3]!==d.labelKey||e[4]!==l?(v=l("sidebar.taskGroupsList.toggleStatusGroup",{status:l(d.labelKey)}),e[3]=d.labelKey,e[4]=l,e[5]=v):v=e[5];let x;e[6]!==y?(x=P=>{P.target===P.currentTarget&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),y())},e[6]=y,e[7]=x):x=e[7];let g;e[8]!==m||e[9]!==d.iconClassName?(g=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]=g):g=e[10];let b;e[11]!==f?(b=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(ss,{size:14})}),e[11]=f,e[12]=b):b=e[12];let S;e[13]!==g||e[14]!==b?(S=n.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[g,b]}),e[13]=g,e[14]=b,e[15]=S):S=e[15];let p;e[16]!==d.labelKey||e[17]!==l?(p=l(d.labelKey),e[16]=d.labelKey,e[17]=l,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]!==y||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:y,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]=y,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]!==o||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(Ea,{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u})}),e[31]=i,e[32]=c,e[33]=f,e[34]=u,e[35]=o,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 Oa(t){const e=L.c(41),{threads:s,groupBy:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,filters:c,hasMore:u,isFetchingMore:l,onLoadMore:d,filtersActive:m}=t,f=V();if(s.length===0&&!u&&!l){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 g;e[1]!==m||e[2]!==f?(g=f(m?"sidebar.myThreadsSection.noChatsMatchFilters":"sidebar.myThreadsSection.noChatsYet"),e[1]=m,e[2]=f,e[3]=g):g=e[3];let b;return e[4]!==g?(b=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:g})]}),e[4]=g,e[5]=b):b=e[5],b}const h=s.length>1||u;if(r==="status"){let x;if(e[6]!==i||e[7]!==h||e[8]!==c||e[9]!==o||e[10]!==a||e[11]!==s){let b;e[13]!==i||e[14]!==h||e[15]!==c||e[16]!==o||e[17]!==a?(b=S=>n.jsx(Ra,{status:S.status,threads:S.threads,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:h,filters:c},S.status),e[13]=i,e[14]=h,e[15]=c,e[16]=o,e[17]=a,e[18]=b):b=e[18],x=ja(s).map(b),e[6]=i,e[7]=h,e[8]=c,e[9]=o,e[10]=a,e[11]=s,e[12]=x}else x=e[12];let g;return e[19]!==x?(g=n.jsx(n.Fragment,{children:x}),e[19]=x,e[20]=g):g=e[20],g}let j;if(e[21]!==i||e[22]!==h||e[23]!==c||e[24]!==o||e[25]!==a||e[26]!==s){let x;e[28]!==i||e[29]!==h||e[30]!==c||e[31]!==o||e[32]!==a?(x=g=>n.jsx(Gt,{task:g,isActive:i===g.id,onClick:()=>a(g),onArchive:h&&g.created_by===c.currentUserId?()=>o(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[28]=i,e[29]=h,e[30]=c,e[31]=o,e[32]=a,e[33]=x):x=e[33],j=s.map(x),e[21]=i,e[22]=h,e[23]=c,e[24]=o,e[25]=a,e[26]=s,e[27]=j}else j=e[27];let y;e[34]!==u||e[35]!==l||e[36]!==d?(y=(u||l)&&n.jsx(Ht,{onClick:d,isFetching:l}),e[34]=u,e[35]=l,e[36]=d,e[37]=y):y=e[37];let v;return e[38]!==j||e[39]!==y?(v=n.jsxs(n.Fragment,{children:[j,y]}),e[38]=j,e[39]=y,e[40]=v):v=e[40],v}function Ba(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(Oa,{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 Da(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:o}=ae();let c;e[2]!==o.id?(c=ye(o.id),e[2]=o.id,e[3]=c):c=e[3];const u=c.id,l=ha(),d=Tt(),{threads:m,hasMore:f,isFetchingMore:h,fetchNextPage:j}=Je(),y=m.filter(Ka),{hide:v,setScope:x}=It(),g=Me(),{setTaskId:b,createNewTask:S}=Qe(),p=Et(),k=et();let T;e[4]!==k||e[5]!==m||e[6]!==p?(T=on({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=[...y].sort(Ha),[C,M]=D.useState("all"),[A,$]=D.useState("flat"),[F,O]=xt("sidebar-threads-scope-all",!1),[R,I]=D.useState(!1),[z,E]=D.useState(!1);let H;e[10]!==I?(H=()=>{he("tasks_panel_search_opened"),E(!0),I(!0)},e[10]=I,e[11]=H):H=e[11];const B=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,X={};F||(X.created_by="me"),x(X);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(Ga):C==="manual"?K.filter(za):K,e[17]=C,e[18]=G):G=e[18];const re=G,J=ma(re(F?P:le(P)),k);let Q;e[19]!==k||e[20]!==_||e[21]!==a||e[22]!==v||e[23]!==g||e[24]!==o.slug||e[25]!==b||e[26]!==J?(Q=K=>{if(a&&K.created_by&&K.created_by!==a)return;const ue=K.id===k;if(v(K.id),an(K.id),!ue)return;const ge=va(J,K.id,a);_(),ge?b(ge.id,ge.virtual_mcp_id):g({to:"/$org",params:{org:o.slug}})},e[19]=k,e[20]=_,e[21]=a,e[22]=v,e[23]=g,e[24]=o.slug,e[25]=b,e[26]=J,e[27]=Q):Q=e[27];const ee=Q;let ne;e[28]!==_||e[29]!==b?(ne=K=>{_(),b(K.id,K.virtual_mcp_id)},e[28]=_,e[29]=b,e[30]=ne):ne=e[30];const ie=ne;let te;e[31]!==N||e[32]!==k||e[33]!==m||e[34]!==_||e[35]!==S||e[36]!==a||e[37]!==u||e[38]!==l||e[39]!==d||e[40]!==b?(te=()=>{const K=N??u;he("sidebar_new_thread_clicked",{virtual_mcp_id:K}),_();const ue=qs(m,K,a,l(K));if(ue){b(ue.id,ue.virtual_mcp_id,{newThread:!0});return}const ge=d?null:m.find(qt=>qt.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]=l,e[39]=d,e[40]=b,e[41]=te):te=e[41];const oe=te;let ce;e[42]!==j?(ce=()=>{j()},e[42]=j,e[43]=ce):ce=e[43];const xe=A!=="flat"||C!=="all"||F;let de;e[44]!==z||e[45]!==R||e[46]!==I?(de=z?n.jsx(ga,{open:R,onOpenChange:I}):null,e[44]=z,e[45]=R,e[46]=I,e[47]=de):de=e[47];let Se;return e[48]!==k||e[49]!==ee||e[50]!==Y||e[51]!==A||e[52]!==f||e[53]!==h||e[54]!==oe||e[55]!==B||e[56]!==ie||e[57]!==$||e[58]!==O||e[59]!==M||e[60]!==F||e[61]!==ce||e[62]!==xe||e[63]!==de||e[64]!==C||e[65]!==J?(Se={threads:J,activeTaskId:k,filters:Y,hasMore:f,isFetchingMore:h,loadMore:ce,groupBy:A,setGroupBy:$,typeFilter:C,setTypeFilter:M,showAll:F,setShowAll:O,filtersActive:xe,selectTask:ie,archiveTask:ee,newThread:oe,openSearch:B,searchDialog:de},e[48]=k,e[49]=ee,e[50]=Y,e[51]=A,e[52]=f,e[53]=h,e[54]=oe,e[55]=B,e[56]=ie,e[57]=$,e[58]=O,e[59]=M,e[60]=F,e[61]=ce,e[62]=xe,e[63]=de,e[64]=C,e[65]=J,e[66]=Se):Se=e[66],Se}function za(t){return!t.trigger_id}function Ga(t){return!!t.trigger_id}function Ha(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Ka(t){return!t.hidden}function Va(){const t=L.c(59),e=V(),[s,r]=D.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={onNavigate:()=>r(!1)},t[0]=i):i=t[0];const a=Da(i),o=Le()?.activeTask;let c;t[1]!==o?.title||t[2]!==a.activeTaskId||t[3]!==a.threads||t[4]!==e?(c=o?.title||a.threads.find(R=>R.id===a.activeTaskId)?.title||e("tasksPanel.taskRow.untitledTask"),t[1]=o?.title,t[2]=a.activeTaskId,t[3]=a.threads,t[4]=e,t[5]=c):c=t[5];const u=c;let l;t[6]!==a?(l=()=>{r(!1),a.openSearch()},t[6]=a,t[7]=l):l=t[7];const d=l;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=se("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 j;t[12]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(gs,{size:16,className:"shrink-0"}),t[12]=j):j=t[12];let y;t[13]!==u?(y=n.jsx("span",{className:"truncate max-w-[10rem] font-medium",children:u}),t[13]=u,t[14]=y):y=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]!==y?(x=n.jsx(Ee,{asChild:!0,children:n.jsx(Lt,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":m,className:h,children:[j,y,v]})})}),t[16]=m,t[17]=h,t[18]=y,t[19]=x):x=t[19];let g;t[20]!==e?(g=e("chat.threadsMenu.chats"),t[20]=e,t[21]=g):g=t[21];let b;t[22]!==g?(b=n.jsx(Re,{side:"bottom",children:g}),t[22]=g,t[23]=b):b=t[23];let S;t[24]!==b||t[25]!==x?(S=n.jsxs(Oe,{children:[x,b]}),t[24]=b,t[25]=x,t[26]=S):S=t[26];let p;t[27]!==a?(p=n.jsx(fa,{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(vt,{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 M;t[44]!==p||t[45]!==C?(M=n.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[p,C]}),t[44]=p,t[45]=C,t[46]=M):M=t[46];let A;t[47]!==a?(A=n.jsx("div",{className:"flex max-h-[60vh] min-h-0 flex-col gap-0.5 overflow-y-auto overscroll-contain",children:n.jsx(Ba,{panel:a})}),t[47]=a,t[48]=A):A=t[48];let $;t[49]!==M||t[50]!==A?($=n.jsxs($t,{align:"start",side:"bottom",onOpenAutoFocus:Ua,className:"flex w-80 flex-col gap-2 p-2",children:[M,A]}),t[49]=M,t[50]=A,t[51]=$):$=t[51];let F;t[52]!==s||t[53]!==S||t[54]!==$?(F=n.jsxs(Ft,{open:s,onOpenChange:r,children:[S,$]}),t[52]=s,t[53]=S,t[54]=$,t[55]=F):F=t[55];let O;return t[56]!==a.searchDialog||t[57]!==F?(O=n.jsxs(n.Fragment,{children:[F,a.searchDialog]}),t[56]=a.searchDialog,t[57]=F,t[58]=O):O=t[58],O}function Ua(t){return t.preventDefault()}function qa(){const t=L.c(20),e=V(),{threads:s}=Je(),{createNewTask:r}=Qe(),i=Rt(),a=et();let o;t[0]!==a||t[1]!==s?(o=s.find(v=>v.id===a)?.branch??null,t[0]=a,t[1]=s,t[2]=o):o=t[2];const c=o;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 l=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(vt,{size:16}),t[9]=m):m=t[9];let f;t[10]!==l||t[11]!==d?(f=n.jsx(Ee,{asChild:!0,children:n.jsx("button",{type:"button",onClick:l,"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]=l,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 j;t[15]!==h?(j=n.jsx(Re,{side:"bottom",children:h}),t[15]=h,t[16]=j):j=t[16];let y;return t[17]!==f||t[18]!==j?(y=n.jsxs(Oe,{children:[f,j]}),t[17]=f,t[18]=j,t[19]=y):y=t[19],y}function Wa(t){const e=L.c(16),{virtualMcpId:s,taskId:r}=t,{openPanel:i}=Bt();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:o,activeTab:c,mainOpen:u}=Dt(a);if(o.length===0)return null;let l;if(e[3]!==c||e[4]!==u||e[5]!==i||e[6]!==o||e[7]!==s){let m;e[9]!==c||e[10]!==u||e[11]!==i||e[12]!==s?(m=f=>{const h=f.id==="automations"?ns({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],l=o.map(m),e[3]=c,e[4]=u,e[5]=i,e[6]=o,e[7]=s,e[8]=l}else l=e[8];let d;return e[14]!==l?(d=n.jsx(st.Tabs,{"data-tour":rn.surfaceTabs,children:l}),e[14]=l,e[15]=d):d=e[15],d}function Ya(t){return{threadId:t.routeThreadId,providerKey:t.routeThreadId??t.fallbackKey}}const Ke="__mobile-main-panel-tab-select__",Ue="main";function Za({tabs:t,activeTab:e,mainOpen:s,t:r}){const i=t.find(o=>o.id===e),a=r("mainPanelTabs.mobileMainPanelTabSelect.mainView");return s?i?.title??a:i?.title??t[0]?.title??a}const Xa={kind:"component",Component:vs},Ja={kind:"component",Component:ys},Qa={kind:"component",Component:js},er={kind:"component",Component:jn};function tr({tabs:t,overlayEnabled:e,t:s}){return[{value:"chat",title:s("mainPanelTabs.mobileMainPanelTabSelect.chat"),icon:Xa},...t.length>0?t.map(r=>({value:r.id,title:r.title,icon:r.icon})):[{value:Ue,title:s("mainPanelTabs.mobileMainPanelTabSelect.mainView"),icon:er}],...e?[{value:"board",title:s("mainPanelTabs.mobileMainPanelTabSelect.tasks"),icon:Ja},{value:"files",title:s("mainPanelTabs.mobileMainPanelTabSelect.library"),icon:Qa}]:[]]}function sr(t){const e=L.c(53),{virtualMcpId:s,taskId:r}=t,i=V(),a=Me(),{openPanel:o}=Bt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const u=je(c);let l;e[1]!==r||e[2]!==s?(l={virtualMcpId:s,taskId:r},e[1]=r,e[2]=s,e[3]=l):l=e[3];const{tabs:d,activeTab:m,mainOpen:f}=Dt(l),{org:h}=ae(),j=Ls();let y;e[4]!==h.id?(y=nt(h.id),e[4]=h.id,e[5]=y):y=e[5];const v=s===y;let x,g,b,S,p,k,T,N,w,_;if(e[6]!==m||e[7]!==f||e[8]!==a||e[9]!==v||e[10]!==o||e[11]!==h.id||e[12]!==u.org||e[13]!==u.taskId||e[14]!==j||e[15]!==i||e[16]!==d||e[17]!==s){S=Symbol.for("react.early_return_sentinel");e:{const M=tr({tabs:d,overlayEnabled:!!(u.org&&u.taskId),t:i}),A=f?M.find(B=>B.value===m)?.value??Ue:"chat",$=M.find(B=>B.value===A),F=$?.title??Za({tabs:d,activeTab:m,mainOpen:f,t:i});let O;e[28]!==a?(O=B=>{a({to:".",search:U=>({...U,...en(B)}),replace:!0})},e[28]=a,e[29]=O):O=e[29];const R=O;let I;e[30]!==v||e[31]!==o||e[32]!==h.id||e[33]!==j||e[34]!==R||e[35]!==s?(I=B=>{if(B!==Ke){if(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:B,source:"mobile_select"}),ln({reportsOnly:j,onReportAgent:v,tabId:B})){o(B,{virtualmcpid:nt(h.id),search:rr});return}if(B==="chat"||B===Ue){R(B==="chat"?"chat":"main");return}o(B,{search:ar})}},e[30]=v,e[31]=o,e[32]=h.id,e[33]=j,e[34]=R,e[35]=s,e[36]=I):I=e[36];const z=I,E=M.find(B=>B.value!==A);if(M.length===2&&E){S=n.jsxs("button",{type:"button",onClick:()=>z(E.value),"aria-label":i("mainPanelTabs.mobileMainPanelTabSelect.switchTo",{name:E.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:E.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:E.title})]});break e}g=kn,w=Ke,_=z;let H;e[37]!==i?(H=i("mainPanelTabs.mobileMainPanelTabSelect.view"),e[37]=i,e[38]=H):H=e[38],b=n.jsx(Sn,{"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:F})]})}),x=Tn,p="end",k="w-56",e[39]!==F?(T=n.jsx(zt,{value:Ke,disabled:!0,hideCheck:!0,className:"hidden",children:F}),e[39]=F,e[40]=T):T=e[40],N=M.map(nr)}e[6]=m,e[7]=f,e[8]=a,e[9]=v,e[10]=o,e[11]=h.id,e[12]=u.org,e[13]=u.taskId,e[14]=j,e[15]=i,e[16]=d,e[17]=s,e[18]=x,e[19]=g,e[20]=b,e[21]=S,e[22]=p,e[23]=k,e[24]=T,e[25]=N,e[26]=w,e[27]=_}else x=e[18],g=e[19],b=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]!==g||e[48]!==b||e[49]!==P||e[50]!==w||e[51]!==_?(C=n.jsxs(g,{value:w,onValueChange:_,children:[b,P]}),e[47]=g,e[48]=b,e[49]=P,e[50]=w,e[51]=_,e[52]=C):C=e[52],C}function nr(t){return n.jsx(zt,{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 ar(t){return{...t,sidepanel:!1}}function rr(t){return{...t,thread:void 0,sidepanel:!1}}function ir(){const t=L.c(3),e=as();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={select:lr},t[0]=s):s=t[0];const r=gt(s);if(!e||!r)return!1;let i;return t[1]!==r?(i=r==="app"||_n.includes(r),t[1]=r,t[2]=i):i=t[2],i}function lr(t){const{staticData:e}=t.matches.findLast(or)??{};return e?.siteEditorView?"site-editor":e?.mainView}function or(t){return t.staticData.mainView}function cr(t,e,s){const r=L.c(33),i=Xe(),{locator:a}=ae(),o=D.useSyncExternalStore(i.threads.subscribe,i.threads.get),c=D.useSyncExternalStore(i.threadsStatus.subscribe,i.threadsStatus.get);let u;r[0]!==t||r[1]!==o?(u=t===null?null:o.find(p=>p.id===t&&!p.partial)??null,r[0]=t,r[1]=o,r[2]=u):u=r[2];const l=u,[d,m]=D.useState(void 0),[f,h]=D.useState(t);f!==t&&(h(t),m(void 0));let j,y;r[3]!==d||r[4]!==t||r[5]!==l||r[6]!==i||r[7]!==c.kind?(j=()=>{t!==null&&(l||c.kind!=="loading"&&d===void 0&&(m("pending"),i.fetchThreadIntoSlot(t).then(p=>{m(p)})))},y=[t,l,c.kind,d,i],r[3]=d,r[4]=t,r[5]=l,r[6]=i,r[7]=c.kind,r[8]=j,r[9]=y):(j=r[8],y=r[9]),D.useEffect(j,y);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}:{},...Us(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 g,b;if(r[15]!==x||r[16]!==d||r[17]!==t||r[18]!==l||r[19]!==c.kind?(g=()=>{t!==null&&(l||d===null&&c.kind!=="loading"&&(x.isPending||x.variables!==t&&x.mutate(t)))},b=[t,l,d,c.kind,x],r[15]=x,r[16]=d,r[17]=t,r[18]=l,r[19]=c.kind,r[20]=g,r[21]=b):(g=r[20],b=r[21]),D.useEffect(g,b),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(l){let p;return r[23]!==l?(p={status:"ready",task:l},r[23]=l,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 dr=50;function ur(t,e){const s=L.c(15),{org:r}=ae(),i=Ce(),{data:a}=pe.useSession(),o=a?.user?.id??"";let c;s[0]!==r.id||s[1]!==o||s[2]!==t?(c=fe.agentEntryThreads(r.id,o,t),s[0]=r.id,s[1]=o,s[2]=t,s[3]=c):c=s[3];const u=e&&!!o;let l;s[4]!==i||s[5]!==t?(l=async()=>{try{return(await i.call("COLLECTION_THREADS_LIST",{limit:dr,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]=l):l=s[6];let d;s[7]!==c||s[8]!==u||s[9]!==l?(d={queryKey:c,enabled:u,staleTime:0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,queryFn:l},s[7]=c,s[8]=u,s[9]=l,s[10]=d):d=s[10];const m=me(d);if(!e||!o){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 fr(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 o=Ae(a);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={select:mr},e[2]=c):c=e[2];const u=gt(c),{org:l}=ae();let d;e[3]!==l||e[4]!==i.agentId||e[5]!==i.legacyView||e[6]!==i.org||e[7]!==u||e[8]!==o?(d=i.org?is({pathname:u,org:i.org,pathAgentId:i.agentId,pathLegacyView:i.legacyView,fallbackAgentId:ye(l.id).id,search:o}):null,e[3]=l,e[4]=i.agentId,e[5]=i.legacyView,e[6]=i.org,e[7]=u,e[8]=o,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 mr(t){return t.matches.at(-1)?.pathname??t.location.pathname}function hr(){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:o,taskId:c}=s;if(!o||c===void 0)return null;let u;return t[2]!==o||t[3]!==a.id||t[4]!==i||t[5]!==c?(u=ls({org:o,taskId:c,fallbackAgentId:ye(a.id).id,search:i}),t[2]=o,t[3]=a.id,t[4]=i,t[5]=c,t[6]=u):u=t[6],u}function pr(){const t=L.c(2),e=hr();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 xr(){const t=L.c(6),e=Cn(),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:gr}),t[1]=s,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=n.jsx(Pn,{previewPath:i,onClose:a,showSeeInLibrary:!0}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function gr(t){const{preview:e,...s}=t;return s}function br(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 o;e[4]!==s?(o=s??n.jsx(ca,{}),e[4]=s,e[5]=o):o=e[5];let c;e[6]!==o?(c=n.jsx(Ie,{children:o}),e[6]=o,e[7]=c):c=e[7];let u;return e[8]!==a||e[9]!==c?(u=n.jsx(pt,{fallback:a,children:c}),e[8]=a,e[9]=c,e[10]=u):u=e[10],u}function vr(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 o;return e[3]!==i||e[4]!==a?(o=n.jsx(q.StreamHost,{source:a,children:i}),e[3]=i,e[4]=a,e[5]=o):o=e[5],o}function yr(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],D.useLayoutEffect(i),null}function jr({virtualMcpId:t,hasActiveRepository:e,sandboxMap:s,children:r}){const i=V(),{currentBranch:a,activeTask:o,setCurrentTaskBranch:c}=$e(),{data:u}=pe.useSession(),l=u?.user?.id,d=!Is(o?.harness_id),m=Ys({agentSandboxMap:s,threadSandboxMap:o?.metadata?.sandboxMap,userId:l,ownerId:o?.created_by,branch:a}),f=e||zs(o?.metadata),h=D.useRef(null),j=d&&Zs({threadLoaded:!!o,isOwner:!!l&&o?.created_by===l,hasActiveRepository:f,branch:a??null,attempted:h.current===(o?.id??null)});D.useEffect(()=>{!j||!o||(h.current=o.id,c(Ct(u?.user?.name||u?.user?.email?.split("@")[0])))},[j,o,u,c]);const y=St(t),v=Fe(t),x=Mt(v,a),{releases:g,createRelease:b}=Gs(t),p=!!l&&o?.created_by===l&&!!a&&a!==x&&!g.some(M=>M.branch===a),k=D.useRef(null);D.useEffect(()=>{!p||!a||k.current!==a&&(k.current=a,b({branch:a,name:Ks(g,i("thread.branchPicker.defaultVersionName")),color:Hs(g.length),createdBy:l,createdAt:new Date().toISOString()}).catch(()=>{}))},[p,a,g,b,l,i]);const T=y.resolved?y.runtime:null,N=Xs(t,a??void 0),_=(l&&a?Mn(m?.[l]?.[a]):{})["agent-sandbox"]??null,P=_?.previewUrl??null,C=d&&T!=="cms"&&(!!_||N);return d?T==="cms"?n.jsx(lt,{resetKey:`${t}:${a??"no-branch"}:${o?.id??""}`,children:r}):n.jsx(Nn,{resetKey:o?.id??"no-thread",virtualMcpId:t,branch:a??null,previewUrl:P,enabled:C,children:n.jsx(Js,{resetKey:o?.id??"no-thread",executionEnabled:d,virtualMcpId:t,branch:a??null,userId:l??null,hasActiveRepository:f,vmEntry:_,threadId:o?.id??null,children:n.jsx(lt,{resetKey:`${t}:${a??"no-branch"}:${o?.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(At,{image:n.jsx(We,{size:48,className:"text-muted-foreground"}),title:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWeb"),description:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWebDescription")})})})}function Sr(){const t=L.c(16),e=V(),{toggleSidebar:s}=ks(),{virtualMcpId:r,taskId:i}=$e();let a;t[0]!==e?(a=e("layouts.shellControls.toggleSidebar"),t[0]=e,t[1]=a):a=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ss,{size:16}),t[2]=o):o=t[2];let c;t[3]!==a||t[4]!==s?(c=n.jsx(Ne,{className:"md:hidden",onClick:s,"aria-label":a,children:o}),t[3]=a,t[4]=s,t[5]=c):c=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Va,{}),t[6]=u):u=t[6];let l;t[7]!==c?(l=n.jsxs(De.Topbar.Left,{children:[c,u]}),t[7]=c,t[8]=l):l=t[8];let d;t[9]!==i||t[10]!==r?(d=n.jsx("div",{className:"min-w-0 md:hidden",children:n.jsx(sr,{virtualMcpId:r,taskId:i})}),t[9]=i,t[10]=r,t[11]=d):d=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(De.Topbar.Right,{className:"shrink-0",children:n.jsx(qa,{})}),t[12]=m):m=t[12];let f;return t[13]!==l||t[14]!==d?(f=n.jsxs(De.Topbar,{className:"border-b border-border/60 px-3",children:[l,d,m]}),t[13]=l,t[14]=d,t[15]=f):f=t[15],f}function kr(t){const e=L.c(25),{layout:s,onNewTaskRef:r,createNewTask:i}=t,{virtualMcpId:a,taskId:o}=$e(),c=yn()??"overview",u=ir(),[l,d]=D.useState(null),m=l===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 j=h;let y;e[5]!==i||e[6]!==r?(y=n.jsx(yr,{onNewTaskRef:r,createNewTask:i}),e[5]=i,e[6]=r,e[7]=y):y=e[7];let v;e[8]!==o||e[9]!==a?(v=n.jsx(Wa,{virtualMcpId:a,taskId:o}),e[8]=o,e[9]=a,e[10]=v):v=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Sr,{}),e[11]=x):x=e[11];const g=o??"threadless";let b;e[12]!==g?(b=n.jsx(it.Thread,{topbar:x,children:n.jsx(br,{},g)}),e[12]=g,e[13]=b):b=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(bt,{}),e[14]=S):S=e[14];let p;e[15]!==c||e[16]!==s||e[17]!==v||e[18]!==b||e[19]!==f||e[20]!==j?(p=n.jsxs(it,{...s,threadOpen:f,toggleThread:j,contentKey:c,contentNavigation:v,children:[b,S]}),e[15]=c,e[16]=s,e[17]=v,e[18]=b,e[19]=f,e[20]=j,e[21]=p):p=e[21];let k;return e[22]!==y||e[23]!==p?(k=n.jsxs(n.Fragment,{children:[y,p]}),e[22]=y,e[23]=p,e[24]=k):k=e[24],k}function Tr(){const t=V(),e=Me(),s=cn(),{create:r}=It(),{org:i}=ae(),o=je({strict:!1}).org??"",c=Ae({strict:!1}),u=et(),l=Rt(),d=Et(),[m]=D.useState(()=>crypto.randomUUID()),{data:f}=pe.useSession(),[h]=D.useState(()=>Ct(f?.user?.name||f?.user?.email?.split("@")[0])),j=Xe(),y=D.useSyncExternalStore(j.threads.subscribe,j.threads.get),v=D.useSyncExternalStore(j.threadsStatus.subscribe,j.threadsStatus.get),x=Fe(l),g=!!(x&&_t(x)),b=Mt(x,null),[S,p]=D.useState(null);u!==null&&S!==null&&p(null);const k=u===null&&!!d&&!!x&&S!==l,T=z=>Ws(z,l,f?.user?.id,Pt(x?.metadata),g,{baseBranch:b}),N=k&&v.kind!=="loading"?T(y):void 0,w=ur(l,k&&v.kind!=="loading"&&!N),_=cr(u,l,h);da(_.status==="ready"?_.task:null);const P=x?.metadata?.ui?.layout??null,C=P?{defaultMainView:P.defaultMainView??null,chatDefaultOpen:P.chatDefaultOpen??null}:null,M=tn(C),{threadId:A,providerKey:$}=Ya({routeThreadId:u,fallbackKey:m}),F=async()=>{const z=crypto.randomUUID(),E=y.find(H=>H.id===A)?.branch??null;try{await r({id:z,virtual_mcp_id:l,...E?{branch:E}:{}})}catch{}s(z,()=>({}))},O=D.useRef(null);D.useEffect(()=>{const z=E=>{us(E)&&E.shiftKey&&E.code==="KeyS"&&!E.repeat&&(E.preventDefault(),O.current?.())};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[]);const R=_.status==="ready"?_.task:null,I=R?.virtual_mcp_id;if(R&&I&&!dn({routeAgentId:l,threadAgentId:I})){const z=os({org:o,agentId:I,superAgentId:ye(i.id).id});return n.jsx(tt,{target:{route:z,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 E=(N??(w.status==="ready"?T(w.threads):void 0))?.id??(g?m:null);if(E)return n.jsx(ds,{to:".",replace:!0,search:H=>({...H,thread:E})});p(l)}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:l,task:_.status==="ready"?_.task:null,children:n.jsx(Cs,{layout:M,children:n.jsx(jr,{virtualMcpId:l,hasActiveRepository:g,sandboxMap:x.metadata?.sandboxMap,children:n.jsx(vr,{threadId:A,providerKey:$,children:n.jsx(Ie,{children:n.jsx(kr,{layout:M,onNewTaskRef:O,createNewTask:F})})})})})},l)}):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(At,{image:n.jsx(We,{size:48,className:"text-muted-foreground"}),title:t("agentShellLayout.agentShellLayout.agentNotFound"),description:t("agentShellLayout.agentShellLayout.agentNotFoundDescription",{virtualMcpId:l}),actions:n.jsx(qe,{variant:"outline",onClick:()=>e({to:"/$org",params:{org:o}}),children:t("agentShellLayout.agentShellLayout.goToOrgHome")})})})})}function Co(){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(pr,{}),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(bt,{}),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(fr,{children:n.jsx(wn,{children:n.jsxs(In,{children:[n.jsx(Tr,{}),n.jsx(xr,{})]})})})}),t[3]=r):r=t[3],r}export{Co as default};
@@ -1 +1 @@
1
- import{q as P,r as i,eB as ce,br as le,c as X,e as de,ec as q,j as I,a4 as fe,R as Se}from"./index-BqutwFSm.js";import{i as me,c as pe,u as ye}from"./chat-context-CRAqcBEA.js";import{u as Ee}from"./use-mcp-client-liHKfpfj.js";import{u as he}from"./use-session-runtime-Cass8jgv.js";import{u as xe}from"./thread-intent-BdGEZQ5d.js";import{e as Re}from"./backoff-CrEUbyZT.js";import{u as we}from"./use-sandbox-events-COXHFEXL.js";import{d as Ae}from"./sandbox-start-errors-BK_aDCyt.js";function be(e,t){const n=P(t);return Pe({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 Pe(e={},t){const n=P(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 Te(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=P();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 Te(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],be(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 Be={branch:null,count:0,handled:!1};function Oe(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function Ve(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 b(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(Ne,{...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 Ne(e){return z.usePublish(He(e)),null}function He({executionEnabled:e,virtualMcpId:t,branch:n,userId:r,hasActiveRepository:s,vmEntry:o,threadId:u}){const{org:T}=fe(),{setCurrentTaskBranch:l}=pe(),G=xe(),p=we(),Z=P(),D=he(t),ee=D.resolved?D.runtime:null,d=ye()?.taskId??null,$=Ee({connectionId:Se,orgId:T.id,orgSlug:T.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),[B,x]=i.useState(Be),E=Oe(B,n);E!==B&&x(E);const y=p.phase?.kind==="failed"?p.phase:null,O=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=Ve({mutationError:c.isError&&c.error?Ae(c.error.message):null,phase:p.phase,startPending:c.isPending,claimRetryExhausted:se}),V=Ue({previewUrl:O,appPaused:re,userStopped:h,startError:oe}),ae=Fe(V),_=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=>{b({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=>{b({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=>{b({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=>{b({data:a,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:a=>{console.error("[sandbox-lifecycle] user start failed:",a)}})},N=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 N(),U()},H=()=>{C.current=new Set,k.current=null,x({branch:n,count:0,handled:!1}),te(),U()};return{branch:n,previewState:V,status:ae,vmEntry:o,previewUrl:O,userStopped:h,start:U,stop:N,restart:ie,retry:H,resume:H}}export{nt as S,tt as a,_e as b,et as o,Ze as s,Ge as u};
1
+ import{q as P,r as i,eB as ce,br as le,c as X,e as de,ec as q,j as I,a4 as fe,R as Se}from"./index-DXP9kVQg.js";import{i as me,c as pe,u as ye}from"./chat-context-BinnCCDE.js";import{u as Ee}from"./use-mcp-client-DGWpjcL5.js";import{u as he}from"./use-session-runtime-CTQ2Nf18.js";import{u as xe}from"./thread-intent-BpPFlY-9.js";import{e as Re}from"./backoff-CrEUbyZT.js";import{u as we}from"./use-sandbox-events-DtcmeL0C.js";import{d as Ae}from"./sandbox-start-errors-BK_aDCyt.js";function be(e,t){const n=P(t);return Pe({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 Pe(e={},t){const n=P(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 Te(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=P();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 Te(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],be(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 Be={branch:null,count:0,handled:!1};function Oe(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function Ve(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 b(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(Ne,{...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 Ne(e){return z.usePublish(He(e)),null}function He({executionEnabled:e,virtualMcpId:t,branch:n,userId:r,hasActiveRepository:s,vmEntry:o,threadId:u}){const{org:T}=fe(),{setCurrentTaskBranch:l}=pe(),G=xe(),p=we(),Z=P(),D=he(t),ee=D.resolved?D.runtime:null,d=ye()?.taskId??null,$=Ee({connectionId:Se,orgId:T.id,orgSlug:T.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),[B,x]=i.useState(Be),E=Oe(B,n);E!==B&&x(E);const y=p.phase?.kind==="failed"?p.phase:null,O=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=Ve({mutationError:c.isError&&c.error?Ae(c.error.message):null,phase:p.phase,startPending:c.isPending,claimRetryExhausted:se}),V=Ue({previewUrl:O,appPaused:re,userStopped:h,startError:oe}),ae=Fe(V),_=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=>{b({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=>{b({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=>{b({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=>{b({data:a,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:a=>{console.error("[sandbox-lifecycle] user start failed:",a)}})},N=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 N(),U()},H=()=>{C.current=new Set,k.current=null,x({branch:n,count:0,handled:!1}),te(),U()};return{branch:n,previewState:V,status:ae,vmEntry:o,previewUrl:O,userStopped:h,start:U,stop:N,restart:ie,retry:H,resume:H}}export{nt as S,tt as a,_e as b,et as o,Ze as s,Ge as u};
@@ -1 +1 @@
1
- import{aK as r,dZ as p,dX as _,aL as n,cU as o,cT as m}from"./index-BqutwFSm.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,s){const a=i=>{if(i==="*")return!0;const c=i.split("::")[0]??"";let t=s;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(a)])]}export{S as a,g as c};
1
+ import{aK as r,dZ as p,dX as _,aL as n,cU as o,cT as m}from"./index-DXP9kVQg.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,s){const a=i=>{if(i==="*")return!0;const c=i.split("::")[0]??"";let t=s;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(a)])]}export{S as a,g as c};
@@ -1 +1 @@
1
- import{aK as s,cS as e,aL as a,cT as d,cU as l}from"./index-BqutwFSm.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 u=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 f=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_reuse_rotates_git_credential:e().optional().describe("Hand a sandbox that a new turn reuses a fresh git token before the turn starts, so pushes from a long-lived sandbox keep working after the token it was created with expires. Off by default: it adds a token read and a sandbox config request to every turn that reuses a sandbox."),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, the npm dependency and the registry entry into the project's repository, then reinstalls dependencies and restarts the dev script on the running sandbox. Off by default, for every org — the catalogue stays browsable without it and nothing is installable. Rollout lever, separate from the deploy."),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` built-in post blocks 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. 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,u as G,f as O,b as S,m as a,c as b,g as o};
1
+ import{aK as s,cS as e,aL as a,cT as d,cU as l}from"./index-DXP9kVQg.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 u=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 f=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_reuse_rotates_git_credential:e().optional().describe("Hand a sandbox that a new turn reuses a fresh git token before the turn starts, so pushes from a long-lived sandbox keep working after the token it was created with expires. Off by default: it adds a token read and a sandbox config request to every turn that reuses a sandbox."),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, the npm dependency and the registry entry into the project's repository, then reinstalls dependencies and restarts the dev script on the running sandbox. Off by default, for every org — the catalogue stays browsable without it and nothing is installable. Rollout lever, separate from the deploy."),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` built-in post blocks 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. 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,u as G,f as O,b as S,m as a,c as b,g as o};