decocms 4.372.3 → 4.373.1

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 (528) hide show
  1. package/dist/client/assets/{AlertCircle-CMjsP_Tk.js → AlertCircle-2L7lI8NL.js} +1 -1
  2. package/dist/client/assets/{AreaChart-Bh_grNQZ.js → AreaChart-BSJ08P7a.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CjYy5Nhj.js → ArrowLeft-8rouBEwC.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-CLncCNat.js → ArrowRight-DCA5zjxW.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-Cii1LHW7.js → ArrowUp-BtksDHBQ.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-CD-5y_pX.js → CartesianChart-BbOaLmfq.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DHXQFnpK.js → CheckCircle-BmVuh1xp.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-DiYhGG4T.js → ChevronUp-fg9sod-H.js} +1 -1
  9. package/dist/client/assets/{Copy01-nMxlBfeT.js → Copy01-BgwuTJFm.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-CWXVH3ZM.js → CreditCard01-CIt471eG.js} +1 -1
  11. package/dist/client/assets/DotsVertical-CE2o6L6N.js +1 -0
  12. package/dist/client/assets/{Download01-BRrSA3Yx.js → Download01-DNhEQzg0.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-fXvhmekg.js → ErrorBarContext-DxNax47N.js} +1 -1
  14. package/dist/client/assets/{Eye-Dyg2WPG4.js → Eye-Dq6Vw6FI.js} +1 -1
  15. package/dist/client/assets/{Globe01-D6FaaFR2.js → Globe01-g_y8gAs1.js} +1 -1
  16. package/dist/client/assets/{Users03-Y0Jco4zL.js → Globe04-GFiRExL0.js} +1 -1
  17. package/dist/client/assets/{Image01-CxnjAzbb.js → Image01-QB6twEDu.js} +1 -1
  18. package/dist/client/assets/{Key01-CIXwHMRo.js → Key01-CO_i2QPb.js} +1 -1
  19. package/dist/client/assets/LayoutLeft-BfySK4h8.js +1 -0
  20. package/dist/client/assets/{Line-YO4Ozgbt.js → Line-Cr57fOtp.js} +1 -1
  21. package/dist/client/assets/{Link01-C0FvgZZB.js → Link01-BIFMl_M0.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-AWlhN5o7.js → LinkExternal01-DQD59o7F.js} +1 -1
  23. package/dist/client/assets/{Monitor01-Ccs1gh2Z.js → Monitor01-Ddm2yOG6.js} +1 -1
  24. package/dist/client/assets/{Package-nTbucmaQ.js → Package-CvzEol5_.js} +1 -1
  25. package/dist/client/assets/{Palette-DSdn1Xis.js → Palette-DT856bn6.js} +1 -1
  26. package/dist/client/assets/{Play-lMuWOObF.js → Play-wYDcJhBq.js} +1 -1
  27. package/dist/client/assets/{Plus-CVauOqLT.js → Plus-BSp00qOC.js} +1 -1
  28. package/dist/client/assets/{SearchLg-BrrPVuXr.js → SearchLg-DFD1t2UL.js} +1 -1
  29. package/dist/client/assets/{SearchMd-C45D2PMI.js → SearchMd-Bb5gjLcX.js} +1 -1
  30. package/dist/client/assets/{Sector-9mXbxJ9i.js → Sector-wViCnB96.js} +5 -5
  31. package/dist/client/assets/{Settings02-Cyf85ea0.js → Settings02-D9Qv7BDm.js} +1 -1
  32. package/dist/client/assets/{Share07-wC47qn2E.js → Share07-CZ7JzYs9.js} +1 -1
  33. package/dist/client/assets/{Stars01-oAh9h5b5.js → Stars01-D-wYuyik.js} +1 -1
  34. package/dist/client/assets/{Sun-0Ied-kyZ.js → Sun-DLRcOzSd.js} +1 -1
  35. package/dist/client/assets/Tool01-Dwy1nlT9.js +1 -0
  36. package/dist/client/assets/{Tool02-CATStXCy.js → Tool02-CvlAGFBM.js} +1 -1
  37. package/dist/client/assets/{Trash01-nl-t4IoV.js → Trash01-DtE0n00a.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-BFAEMx9E.js → TrendUp01-BCriuXJd.js} +1 -1
  39. package/dist/client/assets/{Upload01-B4Fqdkae.js → Upload01-Ba-RLxE1.js} +1 -1
  40. package/dist/client/assets/{User01-ClMaVCaJ.js → User01-DHd46PZp.js} +1 -1
  41. package/dist/client/assets/{UserSquare-B2lKdt4w.js → UserSquare-CcF49LHs.js} +1 -1
  42. package/dist/client/assets/{Users01-BFhxJVhO.js → Users01-B8gdz27Y.js} +1 -1
  43. package/dist/client/assets/{X-CFCE4a-Q.js → X-BtMi8Qau.js} +1 -1
  44. package/dist/client/assets/{XCircle-CleKT0Id.js → XCircle-BLCHBIhx.js} +1 -1
  45. package/dist/client/assets/{SwitchHorizontal01-DpXsFGyJ.js → XClose-CvcHLHe2.js} +1 -1
  46. package/dist/client/assets/{Zap-B6zkqKWB.js → Zap-DZAIluO6.js} +1 -1
  47. package/dist/client/assets/ZoomOut-DUFJq3-K.js +1 -0
  48. package/dist/client/assets/{access-gate-Ds4n25mC.js → access-gate-C9Dl5e5c.js} +1 -1
  49. package/dist/client/assets/add-connection-dialog-DA05asFs.js +1 -0
  50. package/dist/client/assets/agent-analytics-CDo5Hugr.js +2 -0
  51. package/dist/client/assets/agent-app-lfl4wDqj.js +1 -0
  52. package/dist/client/assets/agent-assets-6UK-ev9d.js +1 -0
  53. package/dist/client/assets/agent-automation-BC-cMvrG.js +20 -0
  54. package/dist/client/assets/agent-automations-CnHTcvU7.js +1 -0
  55. package/dist/client/assets/agent-connect-sources-CJ8artss.js +1 -0
  56. package/dist/client/assets/agent-deck-BCZ0G4O2.js +1 -0
  57. package/dist/client/assets/agent-e2e-Cj1Q_JS0.js +1 -0
  58. package/dist/client/assets/agent-experiments-DJ13yAp9.js +1 -0
  59. package/dist/client/assets/agent-file-DbKP1r-4.js +1 -0
  60. package/dist/client/assets/{agent-git-D4IYczGa.js → agent-git-B8LMQ2zl.js} +2 -2
  61. package/dist/client/assets/agent-hosting-Bm-WxahY.js +1 -0
  62. package/dist/client/assets/agent-icon-CTsmTxHg.js +1 -0
  63. package/dist/client/assets/agent-library-file-DvybgEEZ.js +1 -0
  64. package/dist/client/assets/agent-monitor-DgVt0zbx.js +1 -0
  65. package/dist/client/assets/agent-overview-pOglhwpN.js +1 -0
  66. package/dist/client/assets/agent-settings-Bx-Ya3hQ.js +1 -0
  67. package/dist/client/assets/{agent-site-editor-DJSdtoNU.js → agent-site-editor-DVT-M9T0.js} +13 -13
  68. package/dist/client/assets/agent-site-editor-code-DpPWdLwT.js +2 -0
  69. package/dist/client/assets/agent-site-editor-content-eM0WchN0.js +2 -0
  70. package/dist/client/assets/agent-site-editor-preview-3VO_kTqr.js +518 -0
  71. package/dist/client/assets/{agent-view-guard-DHJpzCVR.js → agent-view-guard-BNYKK-x9.js} +1 -1
  72. package/dist/client/assets/agent-view-v-h5B6vN.js +1 -0
  73. package/dist/client/assets/agents-list-BXPjUzIN.js +1 -0
  74. package/dist/client/assets/{ai-providers-jxGd6MbV.js → ai-providers-BAmCFPvS.js} +2 -2
  75. package/dist/client/assets/{alert-U2IStW1f.js → alert-C8o4-kn8.js} +1 -1
  76. package/dist/client/assets/{alert-dialog-BI-B_8hq.js → alert-dialog-9n2p5SCQ.js} +2 -2
  77. package/dist/client/assets/api-keys-Cu1KdEtK.js +1 -0
  78. package/dist/client/assets/api-keys-DCurVLgh.js +1 -0
  79. package/dist/client/assets/app-editor-C3QSidsO.js +1 -0
  80. package/dist/client/assets/asset-utils-CK3Em4fb.js +1 -0
  81. package/dist/client/assets/{auth-DhzAq_9m.js → auth-BBW3DF0r.js} +1 -1
  82. package/dist/client/assets/{auth-catchall-Dar7OygY.js → auth-catchall-Bva2z4Gj.js} +1 -1
  83. package/dist/client/assets/auth-entry-BuHqwUIr.js +1 -0
  84. package/dist/client/assets/{auth-split-layout-DLFqjvPt.js → auth-split-layout-DMgxvbll.js} +1 -1
  85. package/dist/client/assets/{authenticate-and-persist-oauth-DkJ4g-X5.js → authenticate-and-persist-oauth-Pk9b2m8R.js} +1 -1
  86. package/dist/client/assets/automation-list-row-D-zBLXA-.js +1 -0
  87. package/dist/client/assets/automation-runs-C8Wbje-n.js +1 -0
  88. package/dist/client/assets/automations-D69ikqKh.js +1 -0
  89. package/dist/client/assets/{autosend-BberXmli.js → autosend-CVNOmzPu.js} +1 -1
  90. package/dist/client/assets/{avatar-C9HiP4eS.js → avatar-BzRNaDEk.js} +1 -1
  91. package/dist/client/assets/badge-C5M6nZd4.js +1 -0
  92. package/dist/client/assets/block-document-UPtnFOJG.js +3 -0
  93. package/dist/client/assets/{blocks-preview-workspace-context-Bwmvvd4S.js → blocks-preview-workspace-context-DAFMxzU6.js} +1 -1
  94. package/dist/client/assets/breadcrumb-0yy48vm9.js +1 -0
  95. package/dist/client/assets/{buckets-BndbOAGO.js → buckets-CktpbsrB.js} +1 -1
  96. package/dist/client/assets/build-improve-prompt-doc-C-SX02eL.js +2 -0
  97. package/dist/client/assets/bulk-category-panel-MrIv4eD2.js +1 -0
  98. package/dist/client/assets/calendar-QcX36iLy.js +1 -0
  99. package/dist/client/assets/capability-load-error-BVb3VEU2.js +1 -0
  100. package/dist/client/assets/category-editor-DZThBJlF.js +1 -0
  101. package/dist/client/assets/{chart-8nXuVw9P.js → chart-BVjaATZw.js} +5 -5
  102. package/dist/client/assets/{chat-context-tZCX_cqt.js → chat-context-ELO8A2Ar.js} +6 -6
  103. package/dist/client/assets/{chat-draft-BCeqPSxA.js → chat-draft-tDfZTlxU.js} +1 -1
  104. package/dist/client/assets/checkbox-iGlb02v9.js +1 -0
  105. package/dist/client/assets/choose-editor-CWLAiGtz.js +1 -0
  106. package/dist/client/assets/{cli-auth-success-D39z_FO3.js → cli-auth-success-DyNW_Pmq.js} +1 -1
  107. package/dist/client/assets/{client-icons-DpcP1bht.js → client-icons-BuRYGGKe.js} +1 -1
  108. package/dist/client/assets/collapsible-PyJ2NOzW.js +1 -0
  109. package/dist/client/assets/collection-detail-DXmBNKMr.js +1 -0
  110. package/dist/client/assets/collection-display-button-Cz5AkuIg.js +1 -0
  111. package/dist/client/assets/{collection-search-J9Bt25gS.js → collection-search-DM8MkJfo.js} +1 -1
  112. package/dist/client/assets/{collection-table-wrapper-DBeauaNS.js → collection-table-wrapper-cBr_X4Jo.js} +1 -1
  113. package/dist/client/assets/collection-tabs-aKKPIP9M.js +1 -0
  114. package/dist/client/assets/combobox-CQBdlQef.js +1 -0
  115. package/dist/client/assets/command-CZcxzTcw.js +1 -0
  116. package/dist/client/assets/{companion-mcps-section-xmRpNJBK.js → companion-mcps-section-B7qgbnOZ.js} +1 -1
  117. package/dist/client/assets/connect-D6Wz7x6C.js +8 -0
  118. package/dist/client/assets/connect-layout-DzSDvFP2.js +1 -0
  119. package/dist/client/assets/{connection-DD0omVHZ.js → connection-DStV2sLP.js} +1 -1
  120. package/dist/client/assets/connection-card-CpIJKLp3.js +1 -0
  121. package/dist/client/assets/connection-detail-junbbrHX.js +1 -0
  122. package/dist/client/assets/{connection-form-helpers-CHlcdgAK.js → connection-form-helpers-DM_wSOEJ.js} +1 -1
  123. package/dist/client/assets/connections-DvjnCZJT.js +1 -0
  124. package/dist/client/assets/{create-organization-dialog-1mI4Ad1B.js → create-organization-dialog-CvXOAbwA.js} +1 -1
  125. package/dist/client/assets/{decofile-api-BNWbEMR6.js → decofile-api-zRlIvvNL.js} +1 -1
  126. package/dist/client/assets/{decopilot-BvepxP_-.js → decopilot-BI8eOOPY.js} +2 -2
  127. package/dist/client/assets/dialog-AoC07APJ.js +1 -0
  128. package/dist/client/assets/discover-zo2iAYFW.js +1 -0
  129. package/dist/client/assets/domain-settings-C6kSznIr.js +1 -0
  130. package/dist/client/assets/download-app-dialog-CsiIuf7j.js +1 -0
  131. package/dist/client/assets/{drawer-BIjkXMV3.js → drawer-DGzquxJ8.js} +1 -1
  132. package/dist/client/assets/{editor-D4Ls62vg.js → editor-oL1B7LVJ.js} +1 -1
  133. package/dist/client/assets/{empty-state-BdiOfgle.js → empty-state-DxJQDjCw.js} +1 -1
  134. package/dist/client/assets/{empty-state-CyICQznD.js → empty-state-Y08kvU5o.js} +1 -1
  135. package/dist/client/assets/{extract-connection-data-Dbm_cKaX.js → extract-connection-data-C7Wh9xkI.js} +1 -1
  136. package/dist/client/assets/{feature-gate-Bp7Cydio.js → feature-gate-C1d068b1.js} +1 -1
  137. package/dist/client/assets/feature-paywall-BoABVlUQ.js +1 -0
  138. package/dist/client/assets/file-explorer-DG5Gvb-w.js +2 -0
  139. package/dist/client/assets/{file-preview-CARebwHJ.js → file-preview-iaqpqUYi.js} +1 -1
  140. package/dist/client/assets/file-share-button-D0lT5ixf.js +3 -0
  141. package/dist/client/assets/{file-type-icon-C9Qn36v4.js → file-type-icon-lZW2ows7.js} +1 -1
  142. package/dist/client/assets/{folder-icon-BLBZBD_a.js → folder-icon-DVG7PK8X.js} +1 -1
  143. package/dist/client/assets/{form-CSXgIHLz.js → form-CYsJTpNM.js} +1 -1
  144. package/dist/client/assets/{gateway-client-BuiOykcN.js → gateway-client-CnYYocwu.js} +1 -1
  145. package/dist/client/assets/general-BiYLEv2o.js +1 -0
  146. package/dist/client/assets/{github-icon-huXDOAgf.js → github-icon-swNUSpAU.js} +1 -1
  147. package/dist/client/assets/home-BbjS-573.js +1 -0
  148. package/dist/client/assets/{hooks-BoX5BC-f.js → hooks-BlE0QZwR.js} +2 -2
  149. package/dist/client/assets/{hooks-DZOMRp7D.js → hooks-D0dDgrIf.js} +1 -1
  150. package/dist/client/assets/icon-button-7c--Wy5B.js +1 -0
  151. package/dist/client/assets/{index-BWpNlf6e.js → index-0-s9o3tr.js} +1 -1
  152. package/dist/client/assets/index-BDYXeKzz.js +1 -0
  153. package/dist/client/assets/index-BOHOyAF8.css +1 -0
  154. package/dist/client/assets/{index-tj4CWdxr.js → index-BUfoj27y.js} +1 -1
  155. package/dist/client/assets/index-BchRuDAc.js +26 -0
  156. package/dist/client/assets/{index-BD213WLU.js → index-C97O3ClY.js} +1 -1
  157. package/dist/client/assets/index-CutV0Ygc.js +1 -0
  158. package/dist/client/assets/{index-DqT4mG5l.js → index-DGY2nhhI.js} +1 -1
  159. package/dist/client/assets/index-DItj2r3e.js +5 -0
  160. package/dist/client/assets/index-DKXWNSdB.js +1 -0
  161. package/dist/client/assets/{index-Bb-Re5q8.js → index-DllcfiZL.js} +1 -1
  162. package/dist/client/assets/{index-DiULBiX9.js → index-DyCAAYSx.js} +1 -1
  163. package/dist/client/assets/index-EcuFIS2a.js +235 -0
  164. package/dist/client/assets/{index-DWw5wi2G.js → index-Exw_Yjch.js} +1 -1
  165. package/dist/client/assets/{index-2gtoysbs.js → index-fN6RkMSD.js} +1 -1
  166. package/dist/client/assets/{index-redirect-BQTLrDGT.js → index-redirect-Bm4zqVUy.js} +1 -1
  167. package/dist/client/assets/{infiniteQueryObserver-CjWlcBHD.js → infiniteQueryObserver-3RxH1tr-.js} +1 -1
  168. package/dist/client/assets/infra-billing-CmY2herT.js +1 -0
  169. package/dist/client/assets/input-BrPa4I3Z.js +8 -0
  170. package/dist/client/assets/input-Buz_7xoG.js +1 -0
  171. package/dist/client/assets/input-C5klQNJJ.js +1 -0
  172. package/dist/client/assets/{integration-icon-BeEdjsn9.js → integration-icon-D3FHJbYu.js} +1 -1
  173. package/dist/client/assets/{label-BMxIRiEr.js → label-BX1BwzZ4.js} +1 -1
  174. package/dist/client/assets/{last-preview-page-B_H0ubHa.js → last-preview-page-BSVfE6AT.js} +1 -1
  175. package/dist/client/assets/layout-030aDjqi.js +1 -0
  176. package/dist/client/assets/legacy-agents-deep-BblX_qPq.js +1 -0
  177. package/dist/client/assets/legacy-main-redirect-BDaODIKZ.js +1 -0
  178. package/dist/client/assets/library-CmkU9fCT.js +161 -0
  179. package/dist/client/assets/{login-C4Dx9xMO.js → login-BpUdj6Fq.js} +1 -1
  180. package/dist/client/assets/{markdown-DGWjAeXL.js → markdown-VKlC4_bJ.js} +3 -3
  181. package/dist/client/assets/{mcp-app-renderer-BTjC7Gse.js → mcp-app-renderer-wS7imsel.js} +2 -2
  182. package/dist/client/assets/{mcp-oauth-C4khbNJJ.js → mcp-oauth-B7YJNr4N.js} +1 -1
  183. package/dist/client/assets/members-2ZkimP3H.js +1 -0
  184. package/dist/client/assets/message-templates-DyGM313y.js +1 -0
  185. package/dist/client/assets/{mini-report-page-Ci4cxCz8.js → mini-report-page-CYdef8vQ.js} +1 -1
  186. package/dist/client/assets/mock-board-Dk2mRFCa.js +90 -0
  187. package/dist/client/assets/{monaco-editor-CMRYkmyb.js → monaco-editor-ChRh_qus.js} +2 -2
  188. package/dist/client/assets/{monitoring-stats-row-PncjnNwy.js → monitoring-stats-row-DirMMFq2.js} +1 -1
  189. package/dist/client/assets/multi-select-CYKeAXVo.js +1 -0
  190. package/dist/client/assets/{mustache-CPZS2ebG.js → mustache-BpzqsH6c.js} +1 -1
  191. package/dist/client/assets/{oauth-callback-CETK2WZB.js → oauth-callback-CLQttSb2.js} +1 -1
  192. package/dist/client/assets/{oauth-callback-ai-provider-DqbbngEF.js → oauth-callback-ai-provider-C5AqSldx.js} +1 -1
  193. package/dist/client/assets/{onboarding-B5zAGi2B.js → onboarding-BYeSkDcE.js} +1 -1
  194. package/dist/client/assets/optimistic-project-sidebar-views-hB0JGrCs.js +1 -0
  195. package/dist/client/assets/{org-file-open-context-BCUpiY_R.js → org-file-open-context-D26BTBiX.js} +1 -1
  196. package/dist/client/assets/{organization-choice-BNulT5zU.js → organization-choice-sm9k2ko4.js} +1 -1
  197. package/dist/client/assets/orgs-BT6gh3Sc.js +1 -0
  198. package/dist/client/assets/{page-seo-form-BrHgBXF1.js → page-seo-form-Bhk-2qvu.js} +1 -1
  199. package/dist/client/assets/{pair-B46EBBjF.js → pair-Bh73YYpe.js} +8 -8
  200. package/dist/client/assets/plan-ladder-B-hb17ya.js +1 -0
  201. package/dist/client/assets/{popover-yk_ePqAA.js → popover-Bff85VlI.js} +1 -1
  202. package/dist/client/assets/post-calendar-BUJnl75O.js +1 -0
  203. package/dist/client/assets/post-editor-B8ClYTJb.js +1 -0
  204. package/dist/client/assets/{preview-content-CfbsbElk.js → preview-content-C4FuOpTi.js} +1 -1
  205. package/dist/client/assets/{preview-dialog-CA2C3DS4.js → preview-dialog-DY1kQ4y_.js} +1 -1
  206. package/dist/client/assets/primitives-BCCkMTJb.js +1 -0
  207. package/dist/client/assets/profile-T7ySaz_t.js +1 -0
  208. package/dist/client/assets/project-app-view-D4HCSkue.js +1 -0
  209. package/dist/client/assets/project-feed-CRHprIgj.js +1 -0
  210. package/dist/client/assets/{project-icon-MWmzrrm8.js → project-icon-D_oHwik9.js} +1 -1
  211. package/dist/client/assets/project-reports-CzVFjEoR.js +1 -0
  212. package/dist/client/assets/project-tasks-c_cBe8VF.js +1 -0
  213. package/dist/client/assets/{prompts-4lILOzK9.js → prompts-BuPAnA4R.js} +1 -1
  214. package/dist/client/assets/record-editor-CHfqyrFA.js +1 -0
  215. package/dist/client/assets/redirect-editor-BrEMZWAU.js +1 -0
  216. package/dist/client/assets/registry-4kJYrulU.js +2 -0
  217. package/dist/client/assets/registry-layout-o90YrVKa.js +27 -0
  218. package/dist/client/assets/reports-COffkxyo.js +1 -0
  219. package/dist/client/assets/{reports-BpxYdv2_.js → reports-DEVutxJq.js} +2 -2
  220. package/dist/client/assets/reports-onboarding-Dt5mvf07.js +1 -0
  221. package/dist/client/assets/reports-tab-C6PZg0b6.js +2 -0
  222. package/dist/client/assets/repositories-DBFrDUwl.js +1 -0
  223. package/dist/client/assets/repository-import-picker-ftg0FRzY.js +1 -0
  224. package/dist/client/assets/repository-picker-BKj90hIS.js +1 -0
  225. package/dist/client/assets/{require-capability-CmtOZnXt.js → require-capability-gpVnF6U4.js} +1 -1
  226. package/dist/client/assets/{required-auth-layout-RoMNnMPO.js → required-auth-layout-BhdxJMdb.js} +1 -1
  227. package/dist/client/assets/{reset-password-BeUL8IgX.js → reset-password-DD2ixVIR.js} +1 -1
  228. package/dist/client/assets/resizable-wU1MiASn.js +1 -0
  229. package/dist/client/assets/review-settings-3uLiRV1J.js +1 -0
  230. package/dist/client/assets/{rich-text-link-control-CHsxXHIo.js → rich-text-link-control-Bn-QsIS6.js} +2 -2
  231. package/dist/client/assets/roles-DX_ap2B0.js +1 -0
  232. package/dist/client/assets/route-Bdqr734y.js +1 -0
  233. package/dist/client/assets/route-Cg6AOuOY.js +1 -0
  234. package/dist/client/assets/route-DGhKwFXa.js +1 -0
  235. package/dist/client/assets/route-page-header-DKm5kHtX.js +1 -0
  236. package/dist/client/assets/runnable-block-editor-9i5DpxOA.js +16 -0
  237. package/dist/client/assets/{sandbox-lifecycle-context-C7VKOJoV.js → sandbox-lifecycle-context-BHn9YFEW.js} +2 -2
  238. package/dist/client/assets/{schema-1zAO-l7e.js → schema-FDf70VFI.js} +1 -1
  239. package/dist/client/assets/{scroll-area-C-wtbVS1.js → scroll-area-DMmJ7JtI.js} +1 -1
  240. package/dist/client/assets/search-input-BHVk6m6A.js +1 -0
  241. package/dist/client/assets/search-toggle-CCC7TvwN.js +1 -0
  242. package/dist/client/assets/secrets-BNtrMaDs.js +1 -0
  243. package/dist/client/assets/sections-editor-HtflyYMM.js +2 -0
  244. package/dist/client/assets/select-DBfOOW9i.js +1 -0
  245. package/dist/client/assets/select-model-2C5Fdpra.js +1 -0
  246. package/dist/client/assets/seo-editor-CFULobkJ.js +1 -0
  247. package/dist/client/assets/separator-8fswVHAH.js +1 -0
  248. package/dist/client/assets/settings-tab-s3d5MtS-.js +5 -0
  249. package/dist/client/assets/{sheet-i72Qx7sL.js → sheet-DWSThpSZ.js} +1 -1
  250. package/dist/client/assets/shell-layout-BQnbNNla.js +1 -0
  251. package/dist/client/assets/{shell-layout-CuFt8bor.css → shell-layout-CE2Eihra.css} +1 -1
  252. package/dist/client/assets/sidebar-CoC2_Nad.js +1 -0
  253. package/dist/client/assets/{skill-preview-gfYVdSdM.js → skill-preview-QgrtYNqp.js} +1 -1
  254. package/dist/client/assets/skills-BVINvlqv.js +1 -0
  255. package/dist/client/assets/sso-CSqM_F3b.js +1 -0
  256. package/dist/client/assets/store-DBNpNTVQ.js +1 -0
  257. package/dist/client/assets/store-registry-DLmFNBij.js +2 -0
  258. package/dist/client/assets/{switch-BQFtt3BH.js → switch-BIfmgDHS.js} +1 -1
  259. package/dist/client/assets/synced-repos-CG_pm_Ch.js +1 -0
  260. package/dist/client/assets/{table-6I6YKvFY.js → table-CEVOOGGz.js} +1 -1
  261. package/dist/client/assets/{tabs-CLziM0Ww.js → tabs-Dd0IWElc.js} +1 -1
  262. package/dist/client/assets/{task-board-DrUf5p-Z.js → task-board-Dip4Wu9j.js} +1 -1
  263. package/dist/client/assets/task-route-SKFoAFiU.js +1 -0
  264. package/dist/client/assets/task-status-k7EGfTLN.js +1 -0
  265. package/dist/client/assets/taskboard-analytics-C3lk9wb7.js +1 -0
  266. package/dist/client/assets/tasks-Sl_c9zFF.js +1 -0
  267. package/dist/client/assets/{tasks-Drgd6az8.js → tasks-ebQIYdwz.js} +4 -4
  268. package/dist/client/assets/textarea-D5v3ol7T.js +1 -0
  269. package/dist/client/assets/thread-button-C3YUAV-G.js +1 -0
  270. package/dist/client/assets/{thread-intent-F-sZEflj.js → thread-intent-CTSjhfEo.js} +1 -1
  271. package/dist/client/assets/thread-route-B57JfaL5.js +1 -0
  272. package/dist/client/assets/thread-route-CHwqHPf_.js +1 -0
  273. package/dist/client/assets/thread-sheet-body-Hqh1hVbj.js +1 -0
  274. package/dist/client/assets/toggle-group-CwAn2mKr.js +1 -0
  275. package/dist/client/assets/toolbar-icon-button-ChZE-2zp.js +1 -0
  276. package/dist/client/assets/{tooltip-DV2xHesQ.js → tooltip-nr5oS_bm.js} +1 -1
  277. package/dist/client/assets/{track-ZuOMvhd2.js → track-BDYWN4z3.js} +1 -1
  278. package/dist/client/assets/{types-27TVsPN_.js → types-7UQ7SDxU.js} +3 -3
  279. package/dist/client/assets/usage-stats-YafP0g9G.js +1 -0
  280. package/dist/client/assets/use-ai-providers-D-abiIwe.js +1 -0
  281. package/dist/client/assets/use-automations-D_y1YNke.js +1 -0
  282. package/dist/client/assets/{use-autosave-DOzyZumC.js → use-autosave-z8cIzzdm.js} +1 -1
  283. package/dist/client/assets/use-connect-companion-jQzCS0Na.js +1 -0
  284. package/dist/client/assets/use-connection-BKZRi94S.js +1 -0
  285. package/dist/client/assets/{use-copy-C_ctOeuP.js → use-copy-Cp_DyXH6.js} +1 -1
  286. package/dist/client/assets/{use-create-virtual-mcp-D1w9d4ex.js → use-create-virtual-mcp-nvoTomrD.js} +1 -1
  287. package/dist/client/assets/{use-date-fns-locale-onM9TTf8.js → use-date-fns-locale-CNoKSvxx.js} +1 -1
  288. package/dist/client/assets/{use-debounced-autosave-DqyNKPJM.js → use-debounced-autosave-B0HBbqeX.js} +1 -1
  289. package/dist/client/assets/{use-debounced-value-B9nG3bW5.js → use-debounced-value-BgYHDTDk.js} +1 -1
  290. package/dist/client/assets/use-deco-credits-CqbkXgA9.js +1 -0
  291. package/dist/client/assets/{use-decopilot-events-BpuQrfKN.js → use-decopilot-events-qaEKsixC.js} +1 -1
  292. package/dist/client/assets/use-delete-connection-CqvqqWgS.js +1 -0
  293. package/dist/client/assets/{use-deployment-admin-BVfgEagI.js → use-deployment-admin-DzkF6L4b.js} +1 -1
  294. package/dist/client/assets/{use-entitlements-Dl7pAsQ5.js → use-entitlements-kPr6KRf9.js} +1 -1
  295. package/dist/client/assets/{use-fast-preview-draft-url-mcfOeAAq.js → use-fast-preview-draft-url-BBBDyhsD.js} +1 -1
  296. package/dist/client/assets/use-file-configs-6ygOocDG.js +1 -0
  297. package/dist/client/assets/use-in-settings-BCDqA2EC.js +1 -0
  298. package/dist/client/assets/{use-infinite-scroll-PhBGPm8H.js → use-infinite-scroll-D0T36z_V.js} +1 -1
  299. package/dist/client/assets/use-join-requests-BBovhUnp.js +1 -0
  300. package/dist/client/assets/use-main-panel-tabs-BghanH6r.js +1 -0
  301. package/dist/client/assets/use-mcp-auth-status-h4sAecTI.js +1 -0
  302. package/dist/client/assets/{use-mcp-client-e_hCatGm.js → use-mcp-client-B_gcvvCy.js} +6 -6
  303. package/dist/client/assets/{use-mcp-prompts-DJRXjL4_.js → use-mcp-prompts-DfSKL4Gu.js} +1 -1
  304. package/dist/client/assets/{use-mcp-tools-g86k4oib.js → use-mcp-tools-DC47roTz.js} +1 -1
  305. package/dist/client/assets/use-members-C6brpkJ1.js +1 -0
  306. package/dist/client/assets/{use-mobile-hIijCK0k.js → use-mobile-BZ15DgEB.js} +1 -1
  307. package/dist/client/assets/use-navigate-to-agent-B8SXI0oO.js +1 -0
  308. package/dist/client/assets/use-open-billing-url-BAg3ZeFq.js +1 -0
  309. package/dist/client/assets/use-org-auth-client-8fDIgHEZ.js +1 -0
  310. package/dist/client/assets/use-org-fs-Bf6n51Xm.js +1 -0
  311. package/dist/client/assets/use-org-repo-syncs-CnBqiATM.js +8 -0
  312. package/dist/client/assets/{use-org-sso-BvfIL0yq.js → use-org-sso-QeqdMaIa.js} +1 -1
  313. package/dist/client/assets/use-organization-roles-tuKknI1K.js +1 -0
  314. package/dist/client/assets/use-organization-settings-DvtBymY3.js +1 -0
  315. package/dist/client/assets/{use-panel-navigate-WrD0KEYx.js → use-panel-navigate-IItrbgmN.js} +1 -1
  316. package/dist/client/assets/use-project-native-view-presence-WwnxvZuP.js +1 -0
  317. package/dist/client/assets/use-project-scope-CCxyXvEU.js +1 -0
  318. package/dist/client/assets/use-registry-connections-Bd4wJHbx.js +1 -0
  319. package/dist/client/assets/use-releases-DZvNer89.js +1 -0
  320. package/dist/client/assets/use-reports-diagnostic-BeTEI2FZ.js +1 -0
  321. package/dist/client/assets/{use-route-default-main-Djaj_cL9.js → use-route-default-main-BhbKsXCz.js} +1 -1
  322. package/dist/client/assets/use-secrets-Bq9yyXHE.js +1 -0
  323. package/dist/client/assets/{use-section-preview-base-BOFovHh4.js → use-section-preview-base--XbKHK2U.js} +1 -1
  324. package/dist/client/assets/{use-session-runtime-BR1aW1y5.js → use-session-runtime-B5wMaHtP.js} +1 -1
  325. package/dist/client/assets/use-tags-Do2tDPSO.js +1 -0
  326. package/dist/client/assets/use-task-board-analytics-MK_Z2cUq.js +1 -0
  327. package/dist/client/assets/use-task-metadata-CQjLXps1.js +1 -0
  328. package/dist/client/assets/use-thread-outputs-DYukUH5N.js +1 -0
  329. package/dist/client/assets/{use-view-mode-B0LeaJg7.js → use-view-mode-BEPkb8x0.js} +1 -1
  330. package/dist/client/assets/use-virtual-mcp-Ji9vcgUj.js +1 -0
  331. package/dist/client/assets/useInfiniteQuery-CzQJkRT9.js +1 -0
  332. package/dist/client/assets/{useQueries-C-SV8tD7.js → useQueries-D0xhxw7a.js} +1 -1
  333. package/dist/client/assets/useSuspenseInfiniteQuery-D9iG0Y5m.js +1 -0
  334. package/dist/client/assets/{users-BiOPZ43X.js → users-DzwkCv2F.js} +1 -1
  335. package/dist/client/assets/utils-y2q6u6PK.js +4 -0
  336. package/dist/client/assets/variant-calendar-D1R9xk7D.js +1 -0
  337. package/dist/client/assets/{variant-matcher-override-BFQoXu82.js → variant-matcher-override-qHzE4baz.js} +1 -1
  338. package/dist/client/assets/view-mode-toggle-Ca0bFull.js +1 -0
  339. package/dist/client/assets/{virtual-mcp-ldxphi5G.js → virtual-mcp-Dji-1ojO.js} +1 -1
  340. package/dist/client/index.html +2 -2
  341. package/dist/server/cli.js +3 -3
  342. package/dist/server/server.js +3 -3
  343. package/package.json +1 -1
  344. package/dist/client/assets/Check-B3RSsr_D.js +0 -1
  345. package/dist/client/assets/ChevronRight-USKkhEpL.js +0 -1
  346. package/dist/client/assets/ChevronSelectorVertical-DpRb2z1l.js +0 -1
  347. package/dist/client/assets/Database01-C0YJpjc3.js +0 -1
  348. package/dist/client/assets/DotsVertical-CsjwfYzf.js +0 -1
  349. package/dist/client/assets/File02-BvR-HYxK.js +0 -1
  350. package/dist/client/assets/GitBranch01-rWb2SJK9.js +0 -1
  351. package/dist/client/assets/HardDrive-DNTPLPT4.js +0 -1
  352. package/dist/client/assets/MessageCircle01-DBcg2aiD.js +0 -1
  353. package/dist/client/assets/Printer-CvyxF9Jo.js +0 -1
  354. package/dist/client/assets/Shield01-CqB4I7qm.js +0 -1
  355. package/dist/client/assets/Tool01-DouqPjim.js +0 -1
  356. package/dist/client/assets/XClose-BgzK-Dwz.js +0 -1
  357. package/dist/client/assets/ZoomOut-BPxprY2s.js +0 -1
  358. package/dist/client/assets/add-connection-dialog-DZjTm9W3.js +0 -1
  359. package/dist/client/assets/agent-analytics-DmvdLg8B.js +0 -2
  360. package/dist/client/assets/agent-app-BvmFdS4C.js +0 -1
  361. package/dist/client/assets/agent-assets-czUGY90q.js +0 -1
  362. package/dist/client/assets/agent-automation-C5Kr5Oj3.js +0 -20
  363. package/dist/client/assets/agent-automations-D-3-Opoc.js +0 -1
  364. package/dist/client/assets/agent-connect-sources-CjhmYssY.js +0 -1
  365. package/dist/client/assets/agent-deck-BC5MWVm-.js +0 -1
  366. package/dist/client/assets/agent-e2e-DkL4Ltr6.js +0 -1
  367. package/dist/client/assets/agent-experiments--rXT-2aB.js +0 -1
  368. package/dist/client/assets/agent-file-C3XkHLMm.js +0 -1
  369. package/dist/client/assets/agent-hosting-DaIfm8Hu.js +0 -1
  370. package/dist/client/assets/agent-icon-CczrFEe7.js +0 -1
  371. package/dist/client/assets/agent-library-file-Dji653pU.js +0 -1
  372. package/dist/client/assets/agent-monitor-C-HIyaF_.js +0 -1
  373. package/dist/client/assets/agent-overview-cm15sxNU.js +0 -1
  374. package/dist/client/assets/agent-settings-XmhY1FOi.js +0 -1
  375. package/dist/client/assets/agent-site-editor-code-_Tz57RqE.js +0 -2
  376. package/dist/client/assets/agent-site-editor-content-DOAcxz0t.js +0 -2
  377. package/dist/client/assets/agent-site-editor-preview-mg5Q6hoW.js +0 -518
  378. package/dist/client/assets/agent-view-ClMILC98.js +0 -1
  379. package/dist/client/assets/agents-list-rKFF5b3o.js +0 -1
  380. package/dist/client/assets/anchors-yqDzZN4K.js +0 -1
  381. package/dist/client/assets/api-keys-AIfL76r6.js +0 -1
  382. package/dist/client/assets/api-keys-B6ry5Bc6.js +0 -1
  383. package/dist/client/assets/app-editor-BZKFeBmU.js +0 -1
  384. package/dist/client/assets/asset-utils-DhbLEVKo.js +0 -1
  385. package/dist/client/assets/auth-entry-CwWjlqGu.js +0 -1
  386. package/dist/client/assets/automation-list-row-Btr-Kty6.js +0 -1
  387. package/dist/client/assets/automation-runs-CnOOOwZJ.js +0 -1
  388. package/dist/client/assets/automations-CtLmB1Eo.js +0 -1
  389. package/dist/client/assets/badge-Bu51Hlti.js +0 -1
  390. package/dist/client/assets/block-document-BLCekKXO.js +0 -3
  391. package/dist/client/assets/breadcrumb-Dhdru7Jh.js +0 -1
  392. package/dist/client/assets/build-improve-prompt-doc-Cedp3vV1.js +0 -2
  393. package/dist/client/assets/bulk-category-panel-D3c_qJDk.js +0 -1
  394. package/dist/client/assets/calendar-DIQx67oO.js +0 -1
  395. package/dist/client/assets/capability-load-error-CJMvYDf4.js +0 -1
  396. package/dist/client/assets/cards-BVw8sRdW.js +0 -8
  397. package/dist/client/assets/category-editor-C7sRrVfl.js +0 -1
  398. package/dist/client/assets/checkbox-jLf7fBuW.js +0 -1
  399. package/dist/client/assets/choose-editor-Cbu3-nVC.js +0 -1
  400. package/dist/client/assets/collapsible-CTgXdVQa.js +0 -1
  401. package/dist/client/assets/collection-detail-BF7WM7Gn.js +0 -1
  402. package/dist/client/assets/collection-display-button-C-4xB6xx.js +0 -1
  403. package/dist/client/assets/collection-tabs-CrXIJeNf.js +0 -1
  404. package/dist/client/assets/combobox-BHrqHmge.js +0 -1
  405. package/dist/client/assets/command-B-XD29Nx.js +0 -1
  406. package/dist/client/assets/command-palette-store-DK-56E2K.js +0 -1
  407. package/dist/client/assets/connect-D4qCE3TM.js +0 -8
  408. package/dist/client/assets/connect-layout-DGO84ImO.js +0 -1
  409. package/dist/client/assets/connection-card-fcMCwbTh.js +0 -1
  410. package/dist/client/assets/connection-detail-DS015J4e.js +0 -1
  411. package/dist/client/assets/connections-C98FMYyY.js +0 -1
  412. package/dist/client/assets/dialog-llvhXw2o.js +0 -1
  413. package/dist/client/assets/discover-DNPHmIfF.js +0 -1
  414. package/dist/client/assets/domain-settings-CXxEmIjB.js +0 -1
  415. package/dist/client/assets/download-app-dialog-D_4eQbbs.js +0 -1
  416. package/dist/client/assets/dropdown-menu-C5iafa8S.js +0 -1
  417. package/dist/client/assets/feature-paywall-DEy2mpV2.js +0 -1
  418. package/dist/client/assets/file-explorer-Bs7B2-rr.js +0 -2
  419. package/dist/client/assets/file-share-button-Dk1ugrdV.js +0 -3
  420. package/dist/client/assets/general-BYFfG0fF.js +0 -1
  421. package/dist/client/assets/home-DTaaCW3K.js +0 -1
  422. package/dist/client/assets/index-2eKztu7k.js +0 -5
  423. package/dist/client/assets/index-BH7uCYoT.js +0 -1
  424. package/dist/client/assets/index-CSd_k8Np.js +0 -1
  425. package/dist/client/assets/index-CiMUXLco.js +0 -26
  426. package/dist/client/assets/index-CpNTsElB.css +0 -1
  427. package/dist/client/assets/index-D4RUT3q0.js +0 -1
  428. package/dist/client/assets/index-D_X-LIyA.js +0 -1
  429. package/dist/client/assets/index-Dc7hzqoi.js +0 -235
  430. package/dist/client/assets/infra-billing-D6jrbNxA.js +0 -1
  431. package/dist/client/assets/input-DXlaTX4w.js +0 -1
  432. package/dist/client/assets/input-D_FfvHr0.js +0 -8
  433. package/dist/client/assets/input-uIV5S_EX.js +0 -1
  434. package/dist/client/assets/layout-Dli4i2a0.js +0 -1
  435. package/dist/client/assets/legacy-agents-deep-CoiLV3QJ.js +0 -1
  436. package/dist/client/assets/legacy-main-redirect-BZ4nzqkQ.js +0 -1
  437. package/dist/client/assets/library-Dste3SFA.js +0 -161
  438. package/dist/client/assets/members-CRtKrUle.js +0 -1
  439. package/dist/client/assets/message-templates-B8kOo0Kk.js +0 -1
  440. package/dist/client/assets/mock-board-DRa60E6i.js +0 -90
  441. package/dist/client/assets/multi-select-DzAZ8Rb8.js +0 -1
  442. package/dist/client/assets/optimistic-project-sidebar-views-CrZ9OeIk.js +0 -1
  443. package/dist/client/assets/orgs-B1TBklWZ.js +0 -1
  444. package/dist/client/assets/plan-ladder-B2pv9Y73.js +0 -1
  445. package/dist/client/assets/post-calendar-Bx8YiCbs.js +0 -1
  446. package/dist/client/assets/post-editor-B1fD7o8C.js +0 -1
  447. package/dist/client/assets/primitives-JiGRyPkw.js +0 -1
  448. package/dist/client/assets/profile-CDR0JVtv.js +0 -1
  449. package/dist/client/assets/project-app-view-8VWdrWMf.js +0 -1
  450. package/dist/client/assets/project-feed-ChJRKxhk.js +0 -1
  451. package/dist/client/assets/project-reports-D31utlHg.js +0 -1
  452. package/dist/client/assets/project-tasks-D2AAgqxo.js +0 -1
  453. package/dist/client/assets/record-editor-DPAL8Tq5.js +0 -1
  454. package/dist/client/assets/redirect-editor-EPs_GX-_.js +0 -1
  455. package/dist/client/assets/registry-Dw8UrRRZ.js +0 -2
  456. package/dist/client/assets/registry-layout-CC2lewiS.js +0 -27
  457. package/dist/client/assets/reports-Ch9UvBcS.js +0 -1
  458. package/dist/client/assets/reports-onboarding-Dhm8IBuD.js +0 -1
  459. package/dist/client/assets/reports-tab-BJWrZp37.js +0 -2
  460. package/dist/client/assets/repositories-CMIGVJwC.js +0 -1
  461. package/dist/client/assets/repository-import-picker-DhVniDI2.js +0 -1
  462. package/dist/client/assets/repository-picker-BkoSI-jm.js +0 -1
  463. package/dist/client/assets/resizable-Bt7dvMCc.js +0 -1
  464. package/dist/client/assets/review-settings-Cx_Yzx40.js +0 -1
  465. package/dist/client/assets/roles-BNleKwt9.js +0 -1
  466. package/dist/client/assets/route-CHqG9ihd.js +0 -1
  467. package/dist/client/assets/route-DqJoK5dW.js +0 -1
  468. package/dist/client/assets/route-x8jgkj5T.js +0 -1
  469. package/dist/client/assets/runnable-block-editor-xmOnaiFL.js +0 -16
  470. package/dist/client/assets/search-input-Pobww52G.js +0 -1
  471. package/dist/client/assets/secrets-BF5nuoR4.js +0 -1
  472. package/dist/client/assets/sections-editor-B1LpXw4X.js +0 -2
  473. package/dist/client/assets/select-BkKPcZFe.js +0 -1
  474. package/dist/client/assets/select-model-DPv-zVVj.js +0 -1
  475. package/dist/client/assets/seo-editor-9G7mQFJ5.js +0 -1
  476. package/dist/client/assets/settings-tab-D1V5Uszb.js +0 -5
  477. package/dist/client/assets/shell-layout-Ce0aCJuX.js +0 -1
  478. package/dist/client/assets/sidebar-C5KRz1Pj.js +0 -1
  479. package/dist/client/assets/skills-CgTiBPyO.js +0 -1
  480. package/dist/client/assets/sso-BK-aRT5P.js +0 -1
  481. package/dist/client/assets/store-Nm6KtwbD.js +0 -1
  482. package/dist/client/assets/store-registry-Cs6bPPkP.js +0 -2
  483. package/dist/client/assets/synced-repos-B1z4DDCt.js +0 -1
  484. package/dist/client/assets/task-route-BCTCy27Q.js +0 -1
  485. package/dist/client/assets/task-status-DhCT2ly_.js +0 -1
  486. package/dist/client/assets/taskboard-analytics-Cf1r1f7I.js +0 -1
  487. package/dist/client/assets/tasks-BNvHI7hJ.js +0 -1
  488. package/dist/client/assets/textarea-BU6xemAP.js +0 -1
  489. package/dist/client/assets/thread-route-BBf64Mwk.js +0 -1
  490. package/dist/client/assets/thread-route-BSYRqZDg.js +0 -1
  491. package/dist/client/assets/thread-sheet-body-B4OUWlMn.js +0 -1
  492. package/dist/client/assets/toggle-group-BiU_UDOq.js +0 -1
  493. package/dist/client/assets/toolbar-icon-button-PuQFE8Y9.js +0 -1
  494. package/dist/client/assets/usage-stats-vMRDbAUM.js +0 -1
  495. package/dist/client/assets/use-ai-providers-BnF5Rw_n.js +0 -1
  496. package/dist/client/assets/use-automations-Bo0S3g8m.js +0 -1
  497. package/dist/client/assets/use-connect-companion-CClQCUMS.js +0 -1
  498. package/dist/client/assets/use-connection-Ba04fHwa.js +0 -1
  499. package/dist/client/assets/use-deco-credits-BGBshlLi.js +0 -1
  500. package/dist/client/assets/use-delete-connection-Cns6x8UC.js +0 -1
  501. package/dist/client/assets/use-file-configs-DYGSdjth.js +0 -1
  502. package/dist/client/assets/use-join-requests-DjeVFQr9.js +0 -1
  503. package/dist/client/assets/use-main-panel-tabs-sSRGo66A.js +0 -1
  504. package/dist/client/assets/use-mcp-auth-status-I377R0Kg.js +0 -1
  505. package/dist/client/assets/use-members-DPYHJDe2.js +0 -1
  506. package/dist/client/assets/use-navigate-to-agent-C8pu0B4z.js +0 -1
  507. package/dist/client/assets/use-open-billing-url-Df7K1DCF.js +0 -1
  508. package/dist/client/assets/use-org-auth-client-DbPU3bA-.js +0 -1
  509. package/dist/client/assets/use-org-fs-Du-ErRPs.js +0 -1
  510. package/dist/client/assets/use-org-notice-CyiiFkRG.js +0 -1
  511. package/dist/client/assets/use-organization-roles-FAEtbpE5.js +0 -1
  512. package/dist/client/assets/use-organization-settings-CKbX2SdA.js +0 -1
  513. package/dist/client/assets/use-project-native-view-presence-DWzPH-Sc.js +0 -1
  514. package/dist/client/assets/use-project-scope-DU0-JxYr.js +0 -1
  515. package/dist/client/assets/use-registry-connections-SLFMHpqj.js +0 -1
  516. package/dist/client/assets/use-releases-CFNTwgY3.js +0 -1
  517. package/dist/client/assets/use-reports-diagnostic-8BvW2in8.js +0 -1
  518. package/dist/client/assets/use-secrets-DVry--sz.js +0 -1
  519. package/dist/client/assets/use-tags-CZXCbbwL.js +0 -1
  520. package/dist/client/assets/use-task-board-analytics-Ci1AhxvH.js +0 -1
  521. package/dist/client/assets/use-task-metadata-Dt9l5S_a.js +0 -1
  522. package/dist/client/assets/use-thread-outputs-Dq-RN0P_.js +0 -1
  523. package/dist/client/assets/use-virtual-mcp-DkK7ErtB.js +0 -1
  524. package/dist/client/assets/useInfiniteQuery-CspLjV7h.js +0 -1
  525. package/dist/client/assets/useSuspenseInfiniteQuery-BiQYAhJn.js +0 -1
  526. package/dist/client/assets/utils-DsvmRe8M.js +0 -4
  527. package/dist/client/assets/variant-calendar-DImnsJnP.js +0 -1
  528. package/dist/client/assets/view-mode-toggle-DvGhnpsV.js +0 -1
@@ -1 +0,0 @@
1
- import{eD as Ge,c2 as Gt,r as S,eZ as ie,aw as Yt,c as Q,j as o,fi as Ht,b as Rt,fk as Xt,fl as Jt,fm as $t,eC as K,dN as de,B as Lt,ax as ae}from"./index-Dc7hzqoi.js";import{i as Qt}from"./CreditCard01-CWXVH3ZM.js";import{n as Ct}from"./LinkExternal01-AWlhN5o7.js";import{B as ne}from"./badge-Bu51Hlti.js";import{M as er}from"./multi-select-DzAZ8Rb8.js";import{S as tr,d as rr,c as nr,a as ir,b as ar}from"./select-BkKPcZFe.js";import{e as sr,a as or,b as Ye,T as C,d as lr,c as ee}from"./table-6I6YKvFY.js";import{aw as cr,ax as _t,ay as ur,az as fr,aA as dr,aB as mr,aC as gr,aD as yr,P as pr,aE as ue,aF as br,J as D,aG as hr,W as vr,aa as fe,aH as kt,z as G,aI as jr,aJ as xr,j as He,aK as Sr,aL as wr,v as Or,x as Pr,at as Br,Z as Ar,D as se,_ as Tr,r as Dr,ac as Er,aM as Nr,aN as qr,aO as Mr,aP as Ir,aQ as Rr,aR as Lr,aS as _r,aT as kr,aU as Ur,aV as Fr,C as Wr,X as Kr,Y as zr,aW as Vr}from"./CartesianChart-CD-5y_pX.js";import{R as Zr,S as Gr}from"./Sector-9mXbxJ9i.js";import{A as Yr,a as Hr}from"./AreaChart-Bh_grNQZ.js";import{R as Xr}from"./require-capability-CmtOZnXt.js";import"./checkbox-jLf7fBuW.js";import"./Check-B3RSsr_D.js";import"./ChevronUp-DiYhGG4T.js";import"./command-B-XD29Nx.js";import"./index-BD213WLU.js";import"./dialog-llvhXw2o.js";import"./X-CFCE4a-Q.js";import"./SearchMd-C45D2PMI.js";import"./popover-yk_ePqAA.js";import"./index-DWw5wi2G.js";import"./index-BWpNlf6e.js";import"./access-gate-Ds4n25mC.js";import"./capability-load-error-CJMvYDf4.js";var me={},ge={},Xe;function Jr(){return Xe||(Xe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){const a=new Map;for(let s=0;s<r.length;s++){const l=r[s],f=n(l,s,r);a.has(f)||a.set(f,l)}return Array.from(a.values())}e.uniqBy=t})(ge)),ge}var ye={},Je;function $r(){return Je||(Je=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return function(...a){return r.apply(this,a.slice(0,n))}}e.ary=t})(ye)),ye}var pe={},$e;function Ut(){return $e||($e=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t})(pe)),pe}var be={},he={},Qe;function Qr(){return Qe||(Qe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(he)),he}var Ce;function Cr(){return Ce||(Ce=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cr(),r=Qr();function n(a){return r.isObjectLike(a)&&t.isArrayLike(a)}e.isArrayLikeObject=n})(be)),be}var ve={},je={},et;function en(){return et||(et=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_t();function r(n){return function(a){return t.get(a,n)}}e.property=r})(je)),je}var xe={},Se={},we={},Oe={},tt;function Ft(){return tt||(tt=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(Oe)),Oe}var rt;function tn(){return rt||(rt=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ur(),r=Ft(),n=fr();function a(u,i,d){return typeof d!="function"?a(u,i,()=>{}):s(u,i,function b(m,p,v,c,h,x){const O=d(m,p,v,c,h,x);return O!==void 0?!!O:s(m,p,b,x)},new Map)}function s(u,i,d,b){if(i===u)return!0;switch(typeof i){case"object":return l(u,i,d,b);case"function":return Object.keys(i).length>0?s(u,{...i},d,b):n.isEqualsSameValueZero(u,i);default:return t.isObject(u)?typeof i=="string"?i==="":!0:n.isEqualsSameValueZero(u,i)}}function l(u,i,d,b){if(i==null)return!0;if(Array.isArray(i))return g(u,i,d,b);if(i instanceof Map)return f(u,i,d,b);if(i instanceof Set)return y(u,i,d,b);const m=Object.keys(i);if(u==null||r.isPrimitive(u))return m.length===0;if(m.length===0)return!0;if(b?.has(i))return b.get(i)===u;b?.set(i,u);try{for(let p=0;p<m.length;p++){const v=m[p];if(!r.isPrimitive(u)&&!(v in u)||i[v]===void 0&&u[v]!==void 0||i[v]===null&&u[v]!==null||!d(u[v],i[v],v,u,i,b))return!1}return!0}finally{b?.delete(i)}}function f(u,i,d,b){if(i.size===0)return!0;if(!(u instanceof Map))return!1;for(const[m,p]of i.entries()){const v=u.get(m);if(d(v,p,m,u,i,b)===!1)return!1}return!0}function g(u,i,d,b){if(i.length===0)return!0;if(!Array.isArray(u))return!1;const m=new Set;for(let p=0;p<i.length;p++){const v=i[p];let c=!1;for(let h=0;h<u.length;h++){if(m.has(h))continue;const x=u[h];let O=!1;if(d(x,v,p,u,i,b)&&(O=!0),O){m.add(h),c=!0;break}}if(!c)return!1}return!0}function y(u,i,d,b){return i.size===0?!0:u instanceof Set?g([...u],[...i],d,b):!1}e.isMatchWith=a,e.isSetMatch=y})(we)),we}var nt;function Wt(){return nt||(nt=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tn();function r(n,a){return t.isMatchWith(n,a,()=>{})}e.isMatch=r})(Se)),Se}var Pe={},Be={},Ae={},it;function rn(){return it||(it=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Object.getOwnPropertySymbols(r).filter(n=>Object.prototype.propertyIsEnumerable.call(r,n))}e.getSymbols=t})(Ae)),Ae}var Te={},at;function Ve(){return at||(at=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}e.getTag=t})(Te)),Te}var De={},st;function Kt(){return st||(st=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",r="[object String]",n="[object Number]",a="[object Boolean]",s="[object Arguments]",l="[object Symbol]",f="[object Date]",g="[object Map]",y="[object Set]",u="[object Array]",i="[object Function]",d="[object ArrayBuffer]",b="[object Object]",m="[object Error]",p="[object DataView]",v="[object Uint8Array]",c="[object Uint8ClampedArray]",h="[object Uint16Array]",x="[object Uint32Array]",O="[object BigUint64Array]",w="[object Int8Array]",P="[object Int16Array]",T="[object Int32Array]",A="[object BigInt64Array]",_="[object Float32Array]",U="[object Float64Array]";e.argumentsTag=s,e.arrayBufferTag=d,e.arrayTag=u,e.bigInt64ArrayTag=A,e.bigUint64ArrayTag=O,e.booleanTag=a,e.dataViewTag=p,e.dateTag=f,e.errorTag=m,e.float32ArrayTag=_,e.float64ArrayTag=U,e.functionTag=i,e.int16ArrayTag=P,e.int32ArrayTag=T,e.int8ArrayTag=w,e.mapTag=g,e.numberTag=n,e.objectTag=b,e.regexpTag=t,e.setTag=y,e.stringTag=r,e.symbolTag=l,e.uint16ArrayTag=h,e.uint32ArrayTag=x,e.uint8ArrayTag=v,e.uint8ClampedArrayTag=c})(De)),De}var Ee={},Ne={},ot;function nn(){return ot||(ot=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof Ge=="object"&&Ge||(function(){return this})()||Function("return this")();e.globalThis=t})(Ne)),Ne}var lt;function an(){return lt||(lt=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nn();function r(n){return typeof t.globalThis.Buffer<"u"&&t.globalThis.Buffer.isBuffer(n)}e.isBuffer=r})(Ee)),Ee}var qe={},ct;function sn(){return ct||(ct=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})(qe)),qe}var ut;function zt(){return ut||(ut=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rn(),r=Ve(),n=Kt(),a=an(),s=Ft(),l=sn();function f(i,d){return g(i,void 0,i,new Map,d)}function g(i,d,b,m=new Map,p=void 0){const v=p?.(i,d,b,m);if(v!==void 0)return v;if(s.isPrimitive(i))return i;if(m.has(i))return m.get(i);if(Array.isArray(i)){const c=new Array(i.length);m.set(i,c);for(let h=0;h<i.length;h++)c[h]=g(i[h],h,b,m,p);return Object.hasOwn(i,"index")&&(c.index=i.index),Object.hasOwn(i,"input")&&(c.input=i.input),c}if(i instanceof Date)return new Date(i.getTime());if(i instanceof RegExp){const c=new RegExp(i.source,i.flags);return c.lastIndex=i.lastIndex,c}if(i instanceof Map){const c=new Map;m.set(i,c);for(const[h,x]of i)c.set(h,g(x,h,b,m,p));return c}if(i instanceof Set){const c=new Set;m.set(i,c);for(const h of i)c.add(g(h,void 0,b,m,p));return c}if(a.isBuffer(i))return i.subarray();if(l.isTypedArray(i)){const c=new(Object.getPrototypeOf(i)).constructor(i.length);m.set(i,c);for(let h=0;h<i.length;h++)c[h]=g(i[h],h,b,m,p);return c}if(i instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&i instanceof SharedArrayBuffer)return i.slice(0);if(i instanceof DataView){const c=new DataView(i.buffer.slice(0),i.byteOffset,i.byteLength);return m.set(i,c),y(c,i,b,m,p),c}if(typeof File<"u"&&i instanceof File){const c=new File([i],i.name,{type:i.type});return m.set(i,c),y(c,i,b,m,p),c}if(typeof Blob<"u"&&i instanceof Blob){const c=new Blob([i],{type:i.type});return m.set(i,c),y(c,i,b,m,p),c}if(i instanceof Error){const c=structuredClone(i);return m.set(i,c),c.message=i.message,c.name=i.name,c.stack=i.stack,c.cause=i.cause,c.constructor=i.constructor,y(c,i,b,m,p),c}if(i instanceof Boolean){const c=new Boolean(i.valueOf());return m.set(i,c),y(c,i,b,m,p),c}if(i instanceof Number){const c=new Number(i.valueOf());return m.set(i,c),y(c,i,b,m,p),c}if(i instanceof String){const c=new String(i.valueOf());return m.set(i,c),y(c,i,b,m,p),c}if(typeof i=="object"&&u(i)){const c=Object.create(Object.getPrototypeOf(i));return m.set(i,c),y(c,i,b,m,p),c}return i}function y(i,d,b=i,m,p){const v=[...Object.keys(d),...t.getSymbols(d)];for(let c=0;c<v.length;c++){const h=v[c],x=Object.getOwnPropertyDescriptor(i,h);(x==null||x.writable)&&(i[h]=g(d[h],h,b,m,p))}}function u(i){switch(r.getTag(i)){case n.argumentsTag:case n.arrayTag:case n.arrayBufferTag:case n.dataViewTag:case n.booleanTag:case n.dateTag:case n.float32ArrayTag:case n.float64ArrayTag:case n.int8ArrayTag:case n.int16ArrayTag:case n.int32ArrayTag:case n.mapTag:case n.numberTag:case n.objectTag:case n.regexpTag:case n.setTag:case n.stringTag:case n.symbolTag:case n.uint8ArrayTag:case n.uint8ClampedArrayTag:case n.uint16ArrayTag:case n.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=f,e.cloneDeepWithImpl=g,e.copyProperties=y})(Be)),Be}var ft;function on(){return ft||(ft=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zt();function r(n){return t.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}e.cloneDeep=r})(Pe)),Pe}var dt;function ln(){return dt||(dt=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wt(),r=on();function n(a){return a=r.cloneDeep(a),s=>t.isMatch(s,a)}e.matches=n})(xe)),xe}var Me={},Ie={},Re={},mt;function cn(){return mt||(mt=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zt(),r=Ve(),n=Kt();function a(s,l){return t.cloneDeepWith(s,(f,g,y,u)=>{const i=l?.(f,g,y,u);if(i!==void 0)return i;if(typeof s=="object"){if(r.getTag(s)===n.objectTag&&typeof s.constructor!="function"){const d={};return u.set(s,d),t.copyProperties(d,s,y,u),d}switch(Object.prototype.toString.call(s)){case n.numberTag:case n.stringTag:case n.booleanTag:{const d=new s.constructor(s?.valueOf());return t.copyProperties(d,s),d}case n.argumentsTag:{const d={};return t.copyProperties(d,s),d.length=s.length,d[Symbol.iterator]=s[Symbol.iterator],d}default:return}}})}e.cloneDeepWith=a})(Re)),Re}var gt;function un(){return gt||(gt=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cn();function r(n){return t.cloneDeepWith(n)}e.cloneDeep=r})(Ie)),Ie}var Le={},_e={},yt;function fn(){return yt||(yt=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ve();function r(n){return n!==null&&typeof n=="object"&&t.getTag(n)==="[object Arguments]"}e.isArguments=r})(_e)),_e}var pt;function dn(){return pt||(pt=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dr(),r=gr(),n=fn(),a=mr();function s(l,f){let g;if(Array.isArray(f)?g=f:typeof f=="string"&&t.isDeepKey(f)&&l?.[f]==null?g=a.toPath(f):g=[f],g.length===0)return!1;let y=l;for(let u=0;u<g.length;u++){const i=g[u];if((y==null||!Object.hasOwn(y,i))&&!((Array.isArray(y)||n.isArguments(y))&&r.isIndex(i)&&i<y.length))return!1;y=y[i]}return!0}e.has=s})(Le)),Le}var bt;function mn(){return bt||(bt=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wt(),r=yr(),n=un(),a=_t(),s=dn();function l(f,g){switch(typeof f){case"object":{Object.is(f?.valueOf(),-0)&&(f="-0");break}case"number":{f=r.toKey(f);break}}return g=n.cloneDeep(g),function(y){const u=a.get(y,f);return u===void 0?s.has(y,f):g===void 0?u===void 0:t.isMatch(u,g)}}e.matchesProperty=l})(Me)),Me}var ht;function gn(){return ht||(ht=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ut(),r=en(),n=ln(),a=mn();function s(l){if(l==null)return t.identity;switch(typeof l){case"function":return l;case"object":return Array.isArray(l)&&l.length===2?a.matchesProperty(l[0],l[1]):n.matches(l);case"string":case"symbol":case"number":return r.property(l)}}e.iteratee=s})(ve)),ve}var vt;function yn(){return vt||(vt=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Jr(),r=$r(),n=Ut(),a=Cr(),s=gn();function l(f,g=n.identity){return a.isArrayLikeObject(f)?t.uniqBy(Array.from(f),r.ary(s.iteratee(g),1)):[]}e.uniqBy=l})(me)),me}var ke,jt;function pn(){return jt||(jt=1,ke=yn().uniqBy),ke}var bn=pn();const xt=Gt(bn);function hn(e,t,r){return t===!0?xt(e,r):typeof t=="function"?xt(e,t):e}var oe=1;function vn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,r]=S.useState({height:0,left:0,top:0,width:0}),n=S.useCallback(a=>{if(a!=null){var s=a.getBoundingClientRect(),l={height:s.height,left:s.left,top:s.top,width:s.width};(Math.abs(l.height-t.height)>oe||Math.abs(l.left-t.left)>oe||Math.abs(l.top-t.top)>oe||Math.abs(l.width-t.width)>oe)&&r({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,n]}function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},We.apply(null,arguments)}function St(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function te(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?St(Object(r),!0).forEach(function(n){jn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jn(e,t,r){return(t=xn(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xn(e){var t=Sn(e,"string");return typeof t=="symbol"?t:t+""}function Sn(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wn(e){return Array.isArray(e)&&ue(e[0])&&ue(e[1])?e.join(" ~ "):e}var J={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function On(e,t){return t==null?e:br(e,t)}var Pn=e=>{var{separator:t=J.separator,contentStyle:r,itemStyle:n,labelStyle:a=J.labelStyle,payload:s,formatter:l,itemSorter:f,wrapperClassName:g,labelClassName:y,label:u,labelFormatter:i,accessibilityLayer:d=J.accessibilityLayer}=e,b=()=>{if(s&&s.length){var w={padding:0,margin:0},P=On(s,f),T=P.map((A,_)=>{if(!A||A.type==="none")return null;var U=A.formatter||l||wn,{value:E,name:N}=A,R=E,q=N;if(U){var M=U(E,N,A,_,s);if(Array.isArray(M))[R,q]=M;else if(M!=null)R=M;else return null}var k=te(te({},J.itemStyle),{},{color:A.color||J.itemStyle.color},n);return S.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(_),style:k},ue(q)?S.createElement("span",{className:"recharts-tooltip-item-name"},q):null,ue(q)?S.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,S.createElement("span",{className:"recharts-tooltip-item-value"},R),S.createElement("span",{className:"recharts-tooltip-item-unit"},A.unit||""))});return S.createElement("ul",{className:"recharts-tooltip-item-list",style:w},T)}return null},m=te(te({},J.contentStyle),r),p=te({margin:0},a),v=!pr(u),c=v?u:"",h=ie("recharts-default-tooltip",g),x=ie("recharts-tooltip-label",y);v&&i&&s!==void 0&&s!==null&&(c=i(u,s));var O=d?{role:"status","aria-live":"assertive"}:{};return S.createElement("div",We({className:h,style:m},O),S.createElement("p",{className:x,style:p},S.isValidElement(c)?c:"".concat(c)),b())},re="recharts-tooltip-wrapper",Bn={visibility:"hidden"};function An(e){var{coordinate:t,translateX:r,translateY:n}=e;return ie(re,{["".concat(re,"-right")]:D(r)&&t&&D(t.x)&&r>=t.x,["".concat(re,"-left")]:D(r)&&t&&D(t.x)&&r<t.x,["".concat(re,"-bottom")]:D(n)&&t&&D(t.y)&&n>=t.y,["".concat(re,"-top")]:D(n)&&t&&D(t.y)&&n<t.y})}function wt(e){var{allowEscapeViewBox:t,coordinate:r,key:n,offset:a,position:s,reverseDirection:l,tooltipDimension:f,viewBox:g,viewBoxDimension:y}=e;if(s&&D(s[n]))return s[n];var u=r[n]-f-(a>0?a:0),i=r[n]+a;if(t[n])return l[n]?u:i;var d=g[n];if(d==null)return 0;if(l[n]){var b=u,m=d;return b<m?Math.max(i,d):Math.max(u,d)}if(y==null)return 0;var p=i+f,v=d+y;return p>v?Math.max(u,d):Math.max(i,d)}function Tn(e){var{translateX:t,translateY:r,useTranslate3d:n}=e;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function Dn(e){var{allowEscapeViewBox:t,coordinate:r,offsetTop:n,offsetLeft:a,position:s,reverseDirection:l,tooltipBox:f,useTranslate3d:g,viewBox:y}=e,u,i,d;return f.height>0&&f.width>0&&r?(i=wt({allowEscapeViewBox:t,coordinate:r,key:"x",offset:a,position:s,reverseDirection:l,tooltipDimension:f.width,viewBox:y,viewBoxDimension:y.width}),d=wt({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:s,reverseDirection:l,tooltipDimension:f.height,viewBox:y,viewBoxDimension:y.height}),u=Tn({translateX:i,translateY:d,useTranslate3d:g})):u=Bn,{cssProperties:u,cssClasses:An({translateX:i,translateY:d,coordinate:r})}}function Ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ot(Object(r),!0).forEach(function(n){En(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ot(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function En(e,t,r){return(t=Nn(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nn(e){var t=qn(e,"string");return typeof t=="symbol"?t:t+""}function qn(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mn(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function In(e){var t,r,n,a,s,l,f=hr(),[g,y]=S.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));S.useEffect(()=>{var m=p=>{if(p.key==="Escape"){var v,c,h,x;y({dismissed:!0,dismissedAtCoordinate:{x:(v=(c=e.coordinate)===null||c===void 0?void 0:c.x)!==null&&v!==void 0?v:0,y:(h=(x=e.coordinate)===null||x===void 0?void 0:x.y)!==null&&h!==void 0?h:0}})}};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(r=e.coordinate)===null||r===void 0?void 0:r.y]),g.dismissed&&(((n=(a=e.coordinate)===null||a===void 0?void 0:a.x)!==null&&n!==void 0?n:0)!==g.dismissedAtCoordinate.x||((s=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&s!==void 0?s:0)!==g.dismissedAtCoordinate.y)&&y($($({},g),{},{dismissed:!1}));var{cssClasses:u,cssProperties:i}=Dn({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),d=e.hasPortalFromProps?{}:$($({transition:Mn({prefersReducedMotion:f,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},i),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),b=$($({},d),{},{visibility:!g.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return S.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:u,style:b,ref:e.innerRef},e.children)}var Rn=S.memo(In),Ln=["x","y","top","left","width","height","className"];function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ke.apply(null,arguments)}function Pt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function _n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pt(Object(r),!0).forEach(function(n){kn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kn(e,t,r){return(t=Un(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Un(e){var t=Fn(e,"string");return typeof t=="symbol"?t:t+""}function Fn(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wn(e,t){if(e==null)return{};var r,n,a=Kn(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function Kn(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var zn=(e,t,r,n,a,s)=>"M".concat(e,",").concat(a,"v").concat(n,"M").concat(s,",").concat(t,"h").concat(r),Vn=e=>{var{x:t=0,y:r=0,top:n=0,left:a=0,width:s=0,height:l=0,className:f}=e,g=Wn(e,Ln),y=_n({x:t,y:r,top:n,left:a,width:s,height:l},g);return!D(t)||!D(r)||!D(s)||!D(l)||!D(n)||!D(a)?null:S.createElement("path",Ke({},vr(y),{className:ie("recharts-cross",f),d:zn(t,r,s,l,n,a)}))};function Zn(e,t,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-a,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function Vt(e){var{cx:t,cy:r,radius:n,startAngle:a,endAngle:s}=e,l=fe(t,r,n,a),f=fe(t,r,n,s);return{points:[l,f],cx:t,cy:r,radius:n,startAngle:a,endAngle:s}}function Gn(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(kt(t)){if(e==="centric"){var{cx:n,cy:a,innerRadius:s,outerRadius:l,angle:f}=t,g=fe(n,a,s,f),y=fe(n,a,l,f);return[{x:g.x,y:g.y},{x:y.x,y:y.y}]}return Vt(t)}}function Bt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function At(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bt(Object(r),!0).forEach(function(n){Yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Yn(e,t,r){return(t=Hn(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hn(e){var t=Xn(e,"string");return typeof t=="symbol"?t:t+""}function Xn(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Jn=()=>G(Sr),$n=()=>{var e=Jn(),t=G(jr),r=G(xr);return!e||!r?He(void 0,t):He(At(At({},e),{},{scale:r}),t)};function ze(){return ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ze.apply(null,arguments)}function Tt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function le(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tt(Object(r),!0).forEach(function(n){Qn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qn(e,t,r){return(t=Cn(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cn(e){var t=ei(e,"string");return typeof t=="symbol"?t:t+""}function ei(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ti(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return S.isValidElement(t)?S.cloneElement(t,n):S.createElement(r,n)}function ri(e){var t,{coordinate:r,payload:n,index:a,offset:s,tooltipAxisBandSize:l,layout:f,cursor:g,tooltipEventType:y,chartName:u}=e,i=r,d=n,b=a;if(!g||!i||u!=="ScatterChart"&&y!=="axis")return null;var m,p,v;if(u==="ScatterChart")m=i,p=Vn,v=se.cursorLine;else if(u==="BarChart")m=Zn(f,i,s,l),p=Zr,v=se.cursorRectangle;else if(f==="radial"&&kt(i)){var{cx:c,cy:h,radius:x,startAngle:O,endAngle:w}=Vt(i);m={cx:c,cy:h,startAngle:O,endAngle:w,innerRadius:x,outerRadius:x},p=Gr,v=se.cursorLine}else m={points:Gn(f,i,s)},p=Tr,v=se.cursorLine;var P=typeof g=="object"&&"className"in g?g.className:void 0,T=le(le(le(le({stroke:"#ccc",pointerEvents:"none"},s),m),Br(g)),{},{payload:d,payloadIndex:b,className:ie("recharts-tooltip-cursor",P)});return S.createElement(Ar,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:v},S.createElement(ti,{cursor:g,cursorComp:p,cursorProps:T}))}function ni(e){var t=$n(),r=wr(),n=Or(),a=Pr();return t==null||r==null||n==null||a==null?null:S.createElement(ri,ze({},e,{offset:r,layout:n,tooltipAxisBandSize:t,chartName:a}))}function Dt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Et(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Dt(Object(r),!0).forEach(function(n){ii(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ii(e,t,r){return(t=ai(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ai(e){var t=si(e,"string");return typeof t=="symbol"?t:t+""}function si(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oi(e){return e.dataKey}function li(e,t){return S.isValidElement(e)?S.cloneElement(e,t):typeof e=="function"?S.createElement(e,t):S.createElement(Pn,t)}var Nt=[],ci={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function ui(e){var t,r,n=Dr(e,ci),{active:a,allowEscapeViewBox:s,animationDuration:l,animationEasing:f,content:g,filterNull:y,isAnimationActive:u,offset:i,payloadUniqBy:d,position:b,reverseDirection:m,useTranslate3d:p,wrapperStyle:v,cursor:c,shared:h,trigger:x,defaultIndex:O,portal:w,axisId:P}=n,T=Er(),A=typeof O=="number"?String(O):O;S.useEffect(()=>{T(Nr({shared:h,trigger:x,axisId:P,active:a,defaultIndex:A}))},[T,h,x,P,a,A]);var _=qr(),U=Mr(),E=Ir(h),{activeIndex:N,isActive:R}=(t=G(B=>Rr(B,E,x,A)))!==null&&t!==void 0?t:{},q=G(B=>Lr(B,E,x,A)),M=G(B=>_r(B,E,x,A)),k=G(B=>kr(B,E,x,A)),z=q,F=Ur(),I=(r=a??R)!==null&&r!==void 0?r:!1,[Y,W]=vn([z,I]),V=E==="axis"?M:void 0;Fr(E,x,k,V,N,I);var Z=w??F;if(Z==null||_==null||E==null)return null;var L=z??Nt;I||(L=Nt),y&&L.length&&(L=hn(L.filter(B=>B.value!=null&&(B.hide!==!0||n.includeHidden)),d,oi));var H=L.length>0,X=Et(Et({},n),{},{payload:L,label:V,active:I,activeIndex:N,coordinate:k,accessibilityLayer:U}),j=S.createElement(Rn,{allowEscapeViewBox:s,animationDuration:l,animationEasing:f,isAnimationActive:u,active:I,coordinate:k,hasPayload:H,offset:i,position:b,reverseDirection:m,useTranslate3d:p,viewBox:_,wrapperStyle:v,lastBoundingBox:Y,innerRef:W,hasPortalFromProps:!!w},li(g,X));return S.createElement(S.Fragment,null,Yt.createPortal(j,Z),I&&S.createElement(ni,{cursor:c,tooltipEventType:E,coordinate:k,payload:L,index:N}))}const Ze=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1}),qt=["B","KB","MB","GB","TB","PB"];function Zt(e){if(e<=0)return"0 B";const t=Math.min(qt.length-1,Math.floor(Math.log(e)/Math.log(1024))),r=e/1024**t;return`${r.toFixed(r>=100||t===0?0:1)} ${qt[t]}`}const Ue=50,fi="https://assets.decocache.com/decocms/45f9e905-046b-4aeb-8420-0377a7d0d041/deco_Transferencia.pdf",di=new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"});function Mt(e){return new Date(`${e.slice(0,10)}T00:00:00Z`)}function mi(){const e=new Date;return Array.from({length:12},(t,r)=>{const n=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()-r,1));return{value:n.toISOString().slice(0,10),label:n.toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"})}})}function gi(e){return new Date(`${e}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function It(e){const t=Q.c(30),{usage:r,metric:n,colorNum:a,formatValue:s,height:l}=e,f=`var(--chart-${a})`,g=`infra-billing-${n}`;let y;t[0]!==r?(y=r.map(yi),t[0]=r,t[1]=y):y=t[1];const u=y;let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i={left:0,right:4,top:8,bottom:0},t[2]=i):i=t[2];let d,b;t[3]!==f?(d=o.jsx("stop",{offset:"0%",stopColor:f,stopOpacity:.25}),b=o.jsx("stop",{offset:"100%",stopColor:f,stopOpacity:0}),t[3]=f,t[4]=d,t[5]=b):(d=t[4],b=t[5]);let m;t[6]!==g||t[7]!==d||t[8]!==b?(m=o.jsx("defs",{children:o.jsxs("linearGradient",{id:g,x1:"0",y1:"0",x2:"0",y2:"1",children:[d,b]})}),t[6]=g,t[7]=d,t[8]=b,t[9]=m):m=t[9];let p;t[10]!==s||t[11]!==l?(p=l>100&&o.jsxs(o.Fragment,{children:[o.jsx(Wr,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),o.jsx(Kr,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),o.jsx(zr,{orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},tickFormatter:s,width:68})]}),t[10]=s,t[11]=l,t[12]=p):p=t[12];let v,c;t[13]===Symbol.for("react.memo_cache_sentinel")?(v={stroke:"var(--border)",strokeDasharray:"4 4"},c={background:"var(--background)",border:"1px solid var(--border)",borderRadius:8,fontSize:12},t[13]=v,t[14]=c):(v=t[13],c=t[14]);let h;t[15]!==s?(h=o.jsx(ui,{cursor:v,contentStyle:c,formatter:T=>s(Number(T)||0)}),t[15]=s,t[16]=h):h=t[16];const x=`url(#${g})`;let O;t[17]!==f||t[18]!==n||t[19]!==x?(O=o.jsx(Yr,{type:"linear",dataKey:n,stroke:f,strokeWidth:2,fill:x,dot:!1}),t[17]=f,t[18]=n,t[19]=x,t[20]=O):O=t[20];let w;t[21]!==u||t[22]!==O||t[23]!==m||t[24]!==p||t[25]!==h?(w=o.jsxs(Hr,{data:u,margin:i,children:[m,p,h,O]}),t[21]=u,t[22]=O,t[23]=m,t[24]=p,t[25]=h,t[26]=w):w=t[26];let P;return t[27]!==l||t[28]!==w?(P=o.jsx(Vr,{width:"100%",height:l,children:w}),t[27]=l,t[28]=w,t[29]=P):P=t[29],P}function yi(e){return{...e,label:gi(e.date)}}function ce(e,t){return e.reduce((r,n)=>r+n[t],0)}function pi(){const e=Q.c(47),t=Rt(),{sites:r,isLoading:n}=Xt(),[a,s]=S.useState(null),l=mi(),[f,g]=S.useState(l[0].value);let y;e[0]!==a||e[1]!==r?(y=a??r.slice(0,Ue),e[0]=a,e[1]=r,e[2]=y):y=e[2];const u=y,i=!a&&r.length>Ue,{data:d,isLoading:b}=Jt(u,f),m=$t();if(n){let j;return e[3]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(ae,{className:"h-64 w-full"}),e[3]=j):j=e[3],j}if(r.length===0){let j;e[4]!==t?(j=t("settings.infraBilling.noSites"),e[4]=t,e[5]=j):j=e[5];let B;return e[6]!==j?(B=o.jsx(K,{className:"p-6 text-sm text-muted-foreground",children:j}),e[6]=j,e[7]=B):B=e[7],B}const p=d?.usage??[],v=d?.pageviewsAvailable??!1,c=!!d&&!d.usageUnavailable,h=(j,B)=>c?B(ce(p,j)):"—",x=[{key:"pageviews",title:t("settings.infraBilling.pageviews"),description:t("settings.infraBilling.pageviewsDescription"),colorNum:1,total:v&&c?Ze.format(ce(p,"pageviews")):"—"},{key:"requests",title:t("settings.infraBilling.requests"),description:t("settings.infraBilling.requestsDescription"),colorNum:2,total:h("requests",Si)},{key:"dataTransferBytes",title:t("settings.infraBilling.dataTransfer"),description:t("settings.infraBilling.dataTransferDescription"),colorNum:3,total:h("dataTransferBytes",Zt)}],O=ji,w=d?.billing??null;let P;e[8]!==w?.invoices?(P=w?.invoices??[],e[8]=w?.invoices,e[9]=P):P=e[9];let T;e[10]!==P?(T=P.some(vi),e[10]=P,e[11]=T):T=e[11];const A=T,_=ce(p,"pageviews"),U=_>0?ce(p,"requests")/_:0,E=v&&c&&_>0?U.toFixed(U<10?1:0):"—";let N;e[12]!==t?(N=t("settings.infraBilling.multipleTeams"),e[12]=t,e[13]=N):N=e[13];let R;e[14]!==t?(R=t("settings.infraBilling.noTeam"),e[14]=t,e[15]=R):R=e[15];let q;e[16]!==t?(q=t("settings.infraBilling.partialTeam"),e[16]=t,e[17]=q):q=e[17];let M;e[18]!==t?(M=t("settings.infraBilling.billingUnavailable"),e[18]=t,e[19]=M):M=e[19];let k;e[20]!==N||e[21]!==R||e[22]!==q||e[23]!==M?(k={multiple_teams:N,no_team:R,partial_team:q,unavailable:M},e[20]=N,e[21]=R,e[22]=q,e[23]=M,e[24]=k):k=e[24];const z=k[d?.billingUnavailableReason??"multiple_teams"];let F;e[25]!==r?(F=r.map(hi),e[25]=r,e[26]=F):F=e[26];let I;e[27]!==t?(I=t("settings.infraBilling.siteLabel"),e[27]=t,e[28]=I):I=e[28];let Y;e[29]!==u||e[30]!==F||e[31]!==I?(Y=o.jsx(er,{className:"w-auto min-w-56 max-w-full",options:F,defaultValue:u,maxCount:2,placeholder:I,onValueChange:s}),e[29]=u,e[30]=F,e[31]=I,e[32]=Y):Y=e[32];let W;e[33]!==t?(W=t("settings.infraBilling.monthLabel"),e[33]=t,e[34]=W):W=e[34];let V;e[35]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx(ir,{}),e[35]=V):V=e[35];let Z;e[36]!==W?(Z=o.jsx(ar,{className:"w-48","aria-label":W,children:V}),e[36]=W,e[37]=Z):Z=e[37];let L;e[38]!==u.length||e[39]!==t?(L=u.length===0&&o.jsx(K,{className:"mx-4 p-4 text-sm text-muted-foreground",children:t("settings.infraBilling.pickASite")}),e[38]=u.length,e[39]=t,e[40]=L):L=e[40];let H;e[41]!==t||e[42]!==i?(H=i&&o.jsx(K,{className:"mx-4 p-4 text-sm text-muted-foreground",children:t("settings.infraBilling.tooManySites",{count:String(Ue)})}),e[41]=t,e[42]=i,e[43]=H):H=e[43];let X;return e[44]!==d?.usageUnavailable||e[45]!==t?(X=d?.usageUnavailable&&o.jsx(K,{className:"mx-4 p-4 text-sm text-muted-foreground",children:t("settings.infraBilling.warehouseUnavailable")}),e[44]=d?.usageUnavailable,e[45]=t,e[46]=X):X=e[46],o.jsxs("div",{className:"flex flex-col gap-8",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-4",children:[Y,o.jsxs(tr,{value:f,onValueChange:g,children:[Z,o.jsx(rr,{children:l.map(bi)})]})]}),L,H,X,u.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(de,{title:t("settings.infraBilling.summaryTitle"),children:o.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 px-4",children:[o.jsxs(K,{className:"flex-1 flex flex-col gap-4 p-4",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Qt,{size:16,className:"text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:t("settings.infraBilling.detailsTitle")})]}),w?.canManageSubscription&&o.jsx(Lt,{variant:"outline",size:"sm",disabled:m.isPending,onClick:()=>m.mutate(u),children:t("settings.infraBilling.manageButton")})]}),o.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[w?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex justify-between gap-3",children:[o.jsx("span",{className:"text-muted-foreground",children:t("settings.infraBilling.currentPlan")}),b?o.jsx(ae,{className:"h-5 w-16"}):o.jsx(ne,{variant:w.planType==="free"?"secondary":"success",children:t(`settings.infraBilling.plan.${w.planType}`)})]}),o.jsxs("div",{className:"flex justify-between gap-3",children:[o.jsx("span",{className:"text-muted-foreground",children:t("settings.infraBilling.nextBilling")}),o.jsx("span",{className:"font-medium tabular-nums",children:w.nextBillingDate?new Date(`${w.nextBillingDate}T00:00:00Z`).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"}):"—"})]})]}):!b&&o.jsx("p",{className:"text-xs text-muted-foreground",children:z}),o.jsxs("div",{className:"flex justify-between gap-3",children:[o.jsx("span",{className:"text-muted-foreground",children:t("settings.infraBilling.requestsPerPageview")}),o.jsx("span",{className:"font-medium tabular-nums",children:E})]})]})]}),x.map(j=>o.jsxs(K,{className:"flex-1 flex flex-col gap-2 p-4",children:[o.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[o.jsx("span",{className:"text-sm font-medium",children:j.title}),o.jsx("span",{className:"text-xs text-muted-foreground",children:l.find(B=>B.value===f)?.label})]}),b?o.jsx(ae,{className:"h-8 w-24"}):o.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:j.total}),o.jsx("div",{className:"-mx-2",children:o.jsx(It,{usage:p,metric:j.key,colorNum:j.colorNum,formatValue:O(j.key),height:64})})]},j.key))]})}),o.jsx(de,{title:t("settings.infraBilling.metricsTitle"),children:o.jsx("div",{className:"flex flex-col xl:flex-row gap-4 px-4",children:x.map(j=>o.jsxs(K,{className:"flex-1 flex flex-col gap-3 p-4",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("span",{className:"text-sm font-medium",children:j.title}),o.jsx("span",{className:"text-xs text-muted-foreground",children:j.description})]}),o.jsx(It,{usage:p,metric:j.key,colorNum:j.colorNum,formatValue:O(j.key),height:220})]},j.key))})}),o.jsx(de,{title:t("settings.infraBilling.invoicesTitle"),children:o.jsx(K,{className:"mx-4 overflow-x-auto",children:d?(w?.invoices.length??0)===0?o.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:w?t("settings.infraBilling.noInvoices"):z}):o.jsxs(sr,{children:[o.jsx(or,{children:o.jsxs(Ye,{children:[o.jsx(C,{children:t("settings.infraBilling.invoiceReference")}),o.jsx(C,{children:t("settings.infraBilling.invoiceDue")}),o.jsx(C,{children:t("settings.infraBilling.invoiceAmount")}),o.jsx(C,{children:t("settings.infraBilling.invoiceStatus")}),o.jsx(C,{children:t("settings.infraBilling.invoiceDocuments")})]})}),o.jsx(lr,{children:(w?.invoices??[]).map(j=>o.jsxs(Ye,{children:[o.jsx(ee,{children:j.referenceMonth?Mt(j.referenceMonth).toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"}):"—"}),o.jsx(ee,{children:j.dueDate?Mt(j.dueDate).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"}):"—"}),o.jsx(ee,{className:"tabular-nums",children:di.format(j.value)}),o.jsx(ee,{children:o.jsx(wi,{status:j.status})}),o.jsxs(ee,{className:"flex gap-2",children:[j.nfUrl&&o.jsx(Fe,{href:j.nfUrl,label:t("settings.infraBilling.invoiceNf")}),j.bankSlipUrl&&o.jsx(Fe,{href:j.bankSlipUrl,label:t("settings.infraBilling.invoiceBankSlip")}),!j.bankSlipUrl&&!A&&j.nfUrl&&o.jsx(Fe,{href:fi,label:t("settings.infraBilling.invoiceBankTransfer")}),!j.nfUrl&&!j.bankSlipUrl&&"—"]})]},j.id))})]}):o.jsx(ae,{className:"m-4 h-24"})})})]})]})}function bi(e){return o.jsx(nr,{value:e.value,children:e.label},e.value)}function hi(e){return{label:e,value:e}}function vi(e){return!!e.bankSlipUrl}function ji(e){return e==="dataTransferBytes"?Zt:xi}function xi(e){return Ze.format(e)}function Si(e){return Ze.format(e)}function Fe(e){const t=Q.c(4),{href:r,label:n}=e;let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(Ct,{size:14}),t[0]=a):a=t[0];let s;return t[1]!==r||t[2]!==n?(s=o.jsx(Lt,{variant:"outline",size:"sm",asChild:!0,children:o.jsxs("a",{href:r,target:"_blank",rel:"noreferrer",children:[a,n]})}),t[1]=r,t[2]=n,t[3]=s):s=t[3],s}function wi(e){const t=Q.c(14),{status:r}=e,n=Rt(),a=r.toLowerCase();if(a==="paid"){let l;t[0]!==n?(l=n("settings.infraBilling.statusPaid"),t[0]=n,t[1]=l):l=t[1];let f;return t[2]!==l?(f=o.jsx(ne,{variant:"success",children:l}),t[2]=l,t[3]=f):f=t[3],f}if(a==="overdue"){let l;t[4]!==n?(l=n("settings.infraBilling.statusOverdue"),t[4]=n,t[5]=l):l=t[5];let f;return t[6]!==l?(f=o.jsx(ne,{variant:"destructive",children:l}),t[6]=l,t[7]=f):f=t[7],f}if(a==="registered"){let l;t[8]!==n?(l=n("settings.infraBilling.statusPending"),t[8]=n,t[9]=l):l=t[9];let f;return t[10]!==l?(f=o.jsx(ne,{variant:"warning",children:l}),t[10]=l,t[11]=f):f=t[11],f}let s;return t[12]!==r?(s=o.jsx(ne,{variant:"secondary",children:r}),t[12]=r,t[13]=s):s=t[13],s}function Oi(){const e=Q.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsx(Ht,{group:"billing",children:o.jsx(pi,{})}),e[0]=t):t=e[0],t}function Xi(){const e=Q.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsx(Xr,{capability:"members:manage",area:"billing",children:o.jsx(Oi,{})}),e[0]=t):t=e[0],t}export{Xi as default};
@@ -1 +0,0 @@
1
- import{c as s,l as a,j as d}from"./index-Dc7hzqoi.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
@@ -1,8 +0,0 @@
1
- import{c as M,b as G,r as L,l as O,j as s,aa as fe,bq as os,ab as be,bs as $e,B as ee,ad as rs,ac as Vs,br as as,bp as is,v as he,az as ls,dJ as me,dK as st,_ as cs,e as ds,t as ye,o as X,M as we,d as Oe,dB as us,F as ps,K as ms,m as fs,h as hs,a as xs,I as gs,J as bs,ag as ze,D as bt,bx as As,an as vs}from"./index-Dc7hzqoi.js";import{c as js,d as At,P as ys,i as ws}from"./index-DiULBiX9.js";import{K as Cs,i as Ns}from"./command-palette-store-DK-56E2K.js";import{a as Ss}from"./use-virtual-mcp-DkK7ErtB.js";import{w as ks,A as Is}from"./autosend-BberXmli.js";import{s as Ts,r as nt,i as _s,c as Ds,w as Ps,H as Ms}from"./chat-draft-BCeqPSxA.js";import{u as Rs}from"./use-session-runtime-BR1aW1y5.js";import{i as vt}from"./ArrowRight-CLncCNat.js";import{i as jt}from"./ArrowUp-Cii1LHW7.js";import{t as Te,ap as Es,a6 as yt,c as Ke,a8 as Fs,M as Ls,aq as zs,J as wt,h as Ct,ar as Nt,x as Us,as as Bs,at as $s}from"./agent-icon-CczrFEe7.js";import{i as Qe}from"./Check-B3RSsr_D.js";import{a as St}from"./Image01-CxnjAzbb.js";import{i as Os}from"./Upload01-B4Fqdkae.js";import{i as Ye}from"./X-CFCE4a-Q.js";import{a as Ge,b as Ks,c as _e,i as Qs,k as Ys,l as Gs,m as qs,n as Ws,o as Hs,p as Js,q as Zs,f as Xs,u as en,s as tn,d as sn}from"./chat-context-tZCX_cqt.js";import{e as nn,z as on,p as rn,c as Vn}from"./hooks-DZOMRp7D.js";import{i as an}from"./AlertCircle-CMjsP_Tk.js";import{a as ln}from"./Copy01-nMxlBfeT.js";import{a as Ue,b as qe,d as We,f as He,F as kt}from"./form-CSXgIHLz.js";import{c as cn,S as dn,b as un,a as pn,d as mn}from"./select-BkKPcZFe.js";import{t as It}from"./ChevronUp-DiYhGG4T.js";import{T as De,a as Pe,c as Me}from"./tooltip-DV2xHesQ.js";import{i as fn}from"./ArrowLeft-CjYy5Nhj.js";import{M as hn,S as xn}from"./usage-stats-vMRDbAUM.js";import{c as gn,b as bn}from"./tabs-CLziM0Ww.js";import{t as Be}from"./Tool02-CATStXCy.js";import{d as An,h as vn,c as jn,b as yn,D as wn}from"./dialog-llvhXw2o.js";import{d as Ce,e as Cn,b as Nn,f as Sn}from"./use-entitlements-Dl7pAsQ5.js";import{u as kn}from"./use-deco-credits-BGBshlLi.js";import{I as In}from"./input-DXlaTX4w.js";import{T as ot,a as Tn}from"./toggle-group-BiU_UDOq.js";import{s as _n}from"./tool-namespace-DmnQIdtF.js";import{t as Dn}from"./utils-CVEq3hMx.js";import{u as Pn}from"./use-open-billing-url-Df7K1DCF.js";import{s as Mn}from"./XClose-BgzK-Dwz.js";import{M as Rn,m as Je,g as En,a as Fn}from"./decopilot-BvepxP_-.js";import{a as Tt,b as _t,P as Dt}from"./popover-yk_ePqAA.js";import{c as Ln,b as zn,a as Un,D as Bn}from"./drawer-BIjkXMV3.js";import{u as $n}from"./use-mobile-hIijCK0k.js";import{t as On}from"./Stars01-oAh9h5b5.js";import{d as Kn}from"./use-organization-settings-CKbX2SdA.js";import{u as Pt,c as Qn}from"./use-ai-providers-BnF5Rw_n.js";import{M as Yn}from"./index-Bb-Re5q8.js";import{p as Mt,u as Gn,T as qn,a as Wn,U as Hn}from"./input-uIV5S_EX.js";import{d as Jn,g as rt,s as Zn}from"./gateway-client-BuiOykcN.js";import{u as Xn}from"./use-mcp-client-e_hCatGm.js";import{l as eo,g as to}from"./use-mcp-prompts-DJRXjL4_.js";import{c as so,D as no,b as oo,a as pe,h as Vt,i as at,j as it,e as ro,d as Vo}from"./dropdown-menu-C5iafa8S.js";import{i as ao}from"./Link01-C0FvgZZB.js";import{s as lt}from"./Plus-CVauOqLT.js";import"./hooks-BoX5BC-f.js";import{p as io,q as lo}from"./question-004-sINsf4GQ.js";import{A as co}from"./avatar-C9HiP4eS.js";import{u as uo}from"./use-members-DPYHJDe2.js";import{F as ct}from"./feature-paywall-DEy2mpV2.js";import{A as po}from"./add-connection-dialog-DZjTm9W3.js";import{i as mo}from"./ChevronRight-USKkhEpL.js";import{u as fo}from"./use-is-desktop-app-BNujXJc_.js";const Le="cubic-bezier(0.645, 0.045, 0.355, 1)",da=44,ho={default:"",error:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-destructive/5 after:pointer-events-none after:-z-10",warning:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-warning/5 after:pointer-events-none after:-z-10"},xo={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},go={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function ue(t){const e=M.c(69),{icon:n,label:o,count:V,title:a,footerLeft:r,footerRight:i,children:l,defaultExpanded:p,variant:d,onClose:c}=t,u=d===void 0?"default":d,m=G(),[h,f]=L.useState(p),[x,b]=L.useState(!1);let g;e[0]!==c?(g=()=>{b(!0),c?.()},e[0]=c,e[1]=g):g=e[1];const v=g;if(x)return null;const A=xo[u],j=ho[u];let w;e[2]!==A||e[3]!==j?(w=O("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",A,j),e[2]=A,e[3]=j,e[4]=w):w=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>f(bo),e[5]=y):y=e[5];const C=h&&"rounded-b-none",S=!h&&"rounded-b-xl";let N;e[6]!==C||e[7]!==S?(N=O("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",C,S),e[6]=C,e[7]=S,e[8]=N):N=e[8];const _=go[u];let k;e[9]!==_?(k=O("shrink-0",_),e[9]=_,e[10]=k):k=e[10];let P;e[11]!==n||e[12]!==k?(P=s.jsx("span",{className:k,children:n}),e[11]=n,e[12]=k,e[13]=P):P=e[13];let D;e[14]!==o?(D=s.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=D):D=e[15];let R;e[16]!==V?(R=V?s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:V}):null,e[16]=V,e[17]=R):R=e[17];const E=h?"rotate(180deg)":"rotate(0deg)";let I;e[18]!==E?(I=s.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:s.jsx(It,{size:16,style:{transform:E,transition:`transform 180ms ${Le}`}})}),e[18]=E,e[19]=I):I=e[19];let F;e[20]!==m?(F=m("chat.collapsibleHighlight.closeLabel"),e[20]=m,e[21]=F):F=e[21];let U;e[22]!==m?(U=m("chat.collapsibleHighlight.closeTitle"),e[22]=m,e[23]=U):U=e[23];let q,$;e[24]!==v?(q=re=>{re.stopPropagation(),v()},$=re=>{(re.key==="Enter"||re.key===" ")&&(re.preventDefault(),re.stopPropagation(),v())},e[24]=v,e[25]=q,e[26]=$):(q=e[25],$=e[26]);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ye,{size:16}),e[27]=z):z=e[27];let Q;e[28]!==F||e[29]!==U||e[30]!==q||e[31]!==$?(Q=s.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":F,title:U,onClick:q,onKeyDown:$,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 flex items-center justify-center -mr-1 ml-1 p-1 rounded-md hover:bg-accent",children:z}),e[28]=F,e[29]=U,e[30]=q,e[31]=$,e[32]=Q):Q=e[32];let B;e[33]!==h||e[34]!==P||e[35]!==D||e[36]!==R||e[37]!==I||e[38]!==Q||e[39]!==N?(B=s.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:y,className:N,children:[P,D,R,I,Q]}),e[33]=h,e[34]=P,e[35]=D,e[36]=R,e[37]=I,e[38]=Q,e[39]=N,e[40]=B):B=e[40];const te=h?"1fr":"0fr";let Z;e[41]!==te?(Z={display:"grid",gridTemplateRows:te,transition:`grid-template-rows 180ms ${Le}`},e[41]=te,e[42]=Z):Z=e[42];let T;e[43]===Symbol.for("react.memo_cache_sentinel")?(T={overflow:"hidden",minHeight:0},e[43]=T):T=e[43];const Y=h?1:0;let W;e[44]!==Y?(W={opacity:Y,transition:`opacity 120ms ${Le}`,maxHeight:"60vh"},e[44]=Y,e[45]=W):W=e[45];let J;e[46]!==a?(J=a?s.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:s.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:a})}):s.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=a,e[47]=J):J=e[47];let H;e[48]!==l||e[49]!==a?(H=l?s.jsx("div",{className:O("pb-4",!a&&"pt-4"),children:l}):null,e[48]=l,e[49]=a,e[50]=H):H=e[50];let se;e[51]!==J||e[52]!==H?(se=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[J,H]}),e[51]=J,e[52]=H,e[53]=se):se=e[53];let Ve;e[54]!==r||e[55]!==i?(Ve=r||i?s.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{children:r}),s.jsx("div",{className:"flex items-center gap-2",children:i})]})}):null,e[54]=r,e[55]=i,e[56]=Ve):Ve=e[56];let ae;e[57]!==W||e[58]!==se||e[59]!==Ve?(ae=s.jsx("div",{style:T,children:s.jsxs("div",{className:"flex flex-col",style:W,children:[se,Ve]})}),e[57]=W,e[58]=se,e[59]=Ve,e[60]=ae):ae=e[60];let ne;e[61]!==Z||e[62]!==ae?(ne=s.jsx("div",{"data-testid":"collapsible-highlight-body",style:Z,children:ae}),e[61]=Z,e[62]=ae,e[63]=ne):ne=e[63];let ie;return e[64]!==B||e[65]!==ne||e[66]!==w||e[67]!==u?(ie=s.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":u,className:w,children:[B,ne]}),e[64]=B,e[65]=ne,e[66]=w,e[67]=u,e[68]=ie):ie=e[68],ie}function bo(t){return!t}const Ao=fe({content:be().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:$e(["pending","in_progress","completed"]),activeForm:be().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),Rt=fe({todos:os(Ao)}),vo="Plan and track multi-step work. Call with the FULL todo list every time — this replaces the prior list. Call at the start of every multi-step request. Skip only for true one-shots (a single tool call or a direct answer). Mark exactly one todo `in_progress` at a time. Flip a todo to `in_progress` before starting it and to `completed` the moment it finishes — do not batch completions. Your prior tool-call inputs are your current state — read your last call to see where you are.";nn({description:vo,inputSchema:on(Rt),execute:async({todos:t})=>({ok:!0,count:t.length})});const jo="tool-todo_write",yo=new Set(["input-available","output-available"]);function wo(t){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n.role!=="assistant")continue;const o=n.parts;if(Array.isArray(o))for(let V=o.length-1;V>=0;V--){const a=o[V];if(a.type!==jo||typeof a.state!="string"||!yo.has(a.state))continue;const r=Rt.safeParse(a.input);if(r.success)return r.data.todos}}return[]}function Et(t){const e=[];for(const n of t)if("state"in n&&n.state==="approval-requested"&&"approval"in n&&n.approval?.id&&"toolCallId"in n&&n.toolCallId){const o="toolName"in n&&typeof n.toolName=="string"?n.toolName:n.type.startsWith("tool-")?n.type.replace("tool-",""):"Tool";e.push({approvalId:n.approval.id,toolCallId:n.toolCallId,toolName:o,friendlyName:Dn(_n(o)),input:n.input})}return e}function Ft(t){return t.at(-1)}function Lt(t){const e=[];for(const n of t)n.type==="tool-propose_plan"&&n.state==="input-available"&&e.push({toolCallId:n.toolCallId,plan:n.input.plan,state:n.state});return e}function Co(t){return t?t.message.startsWith("[CREDITS]"):!1}const No={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,todos:[]};function So(t){const{messages:e,error:n,finishReason:o,isStreaming:V,isWaitingForApprovals:a}=t;if(!V&&n&&Co(n))return{...No,isCreditExhausted:!0};const r=e.at(-1),i=r?.role==="assistant"?r.parts:[],l=i,d=!!l.filter(j=>j.type==="tool-user_ask").filter(j=>j.state!=="output-available").length,c=Lt(i),u=Et(l),m=wo(e),h=V?null:Ts(n),f=V?null:rn(n),x=!V&&!!n&&!h&&!f,b=u.length>0||V&&a,g=c.length>0,A=!V&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(d||b||g))&&!x;return{isCreditExhausted:!1,planRefusal:f,subscriptionErrorKind:h,hasTodos:m.length>0,showError:x,showWarning:A,hasApprovals:b,hasPlans:g,isWaitingForUserInput:d,todos:m}}function zt(){const t=M.c(6),{messages:e,error:n,finishReason:o,isStreaming:V,isWaitingForApprovals:a}=Ge(),r=n??null,i=o??null;let l;return t[0]!==V||t[1]!==a||t[2]!==e||t[3]!==r||t[4]!==i?(l=So({messages:e,error:r,finishReason:i,isStreaming:V,isWaitingForApprovals:a}),t[0]=V,t[1]=a,t[2]=e,t[3]=r,t[4]=i,t[5]=l):l=t[5],l}function ua(){const t=zt(),e=Ce("credits");return t.isCreditExhausted?e?0:1:Number(t.hasTodos)+Number(t.showError)+ +!!t.subscriptionErrorKind+ +!!t.planRefusal+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)}const dt="start-task",ko=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
2
-
3
- 1. Read the report and any attached screenshots. Carry the reporter's own words into the task description, plus the URL of any attachment.
4
- 2. Call TASK_BOARD_ITEM_LIST. Its \`repos\` are this organization's repositories — the only valid values for a task's repo, so pick the one the report is about and never invent a name. Its \`items\` tell you whether an open task already covers this report: if one does, link it and stop.
5
- 3. Otherwise call TASK_BOARD_ITEM_CREATE with a concise title, the full description, the chosen repo as owner/name, and assigneeId "super-agent". That assignment is what queues the work.
6
- 4. Reply with the task key the tool returned (e.g. DECO-144) and one line on what you filed. Never invent a URL. Do NOT implement the fix here; the task's own run does that, and the reporter gets an email when its PR is ready for review.
7
-
8
- The report follows.`;function Io(t){return{...t,content:[{type:"paragraph",content:[js({id:dt,name:dt,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:ko}}]})]},...t.content??[]]}}function To(t){const e=M.c(30),{current:n,total:o,onPrev:V,onNext:a}=t,r=G();if(o<=1)return null;const i=n===0,l=n===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let p;e[0]!==l?(p=O("p-0.5 rounded transition-colors",l),e[0]=l,e[1]=p):p=e[1];let d;e[2]!==r?(d=r("chat.pagination.previousLabel"),e[2]=r,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(fn,{size:14}),e[4]=c):c=e[4];let u;e[5]!==V||e[6]!==i||e[7]!==p||e[8]!==d?(u=s.jsx("button",{type:"button",onClick:V,disabled:i,className:p,"aria-label":d,children:c}),e[5]=V,e[6]=i,e[7]=p,e[8]=d,e[9]=u):u=e[9];const m=n+1;let h;e[10]!==r||e[11]!==m||e[12]!==o?(h=r("chat.pagination.counter",{current:m,total:o}),e[10]=r,e[11]=m,e[12]=o,e[13]=h):h=e[13];let f;e[14]!==h?(f=s.jsx("span",{className:"tabular-nums text-xs",children:h}),e[14]=h,e[15]=f):f=e[15];const x=n===o-1,b=n===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let g;e[16]!==b?(g=O("p-0.5 rounded transition-colors",b),e[16]=b,e[17]=g):g=e[17];let v;e[18]!==r?(v=r("chat.pagination.nextLabel"),e[18]=r,e[19]=v):v=e[19];let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(vt,{size:14}),e[20]=A):A=e[20];let j;e[21]!==a||e[22]!==x||e[23]!==g||e[24]!==v?(j=s.jsx("button",{type:"button",onClick:a,disabled:x,className:g,"aria-label":v,children:A}),e[21]=a,e[22]=x,e[23]=g,e[24]=v,e[25]=j):j=e[25];let w;return e[26]!==j||e[27]!==u||e[28]!==f?(w=s.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[u,f,j]}),e[26]=j,e[27]=u,e[28]=f,e[29]=w):w=e[29],w}function Ut(t){const e=M.c(8),{currentIndex:n,total:o,onPrev:V,onNext:a,extraLeft:r}=t;let i;e[0]!==n||e[1]!==a||e[2]!==V||e[3]!==o?(i=s.jsx(To,{current:n,total:o,onPrev:V,onNext:a}),e[0]=n,e[1]=a,e[2]=V,e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[i,r]}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function _o(t){const e=M.c(17),{isStreaming:n,isAllAnswered:o,isCurrentAnswered:V,onAdvanceOrSubmit:a,submitLabel:r,nextLabel:i}=t,d=o?r===void 0?"Submit":r:i===void 0?"Next":i,c=o?n:!V,u=c?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let m;e[0]!==c||e[1]!==a?(m=()=>{c||a()},e[0]=c,e[1]=a,e[2]=m):m=e[2];const h=c&&"opacity-50 cursor-not-allowed";let f;e[3]!==h?(f=O("h-7 px-2.5 text-xs",h),e[3]=h,e[4]=f):f=e[4];let x;e[5]!==c||e[6]!==d||e[7]!==m||e[8]!==f?(x=s.jsx(ee,{type:"button",size:"sm","aria-disabled":c,onClick:m,className:f,children:d}),e[5]=c,e[6]=d,e[7]=m,e[8]=f,e[9]=x):x=e[9];const b=x;if(!u)return b;let g;e[10]!==b?(g=s.jsx(De,{asChild:!0,children:b}),e[10]=b,e[11]=g):g=e[11];let v;e[12]!==u?(v=s.jsx(Pe,{children:u}),e[12]=u,e[13]=v):v=e[13];let A;return e[14]!==g||e[15]!==v?(A=s.jsxs(Me,{children:[g,v]}),e[14]=g,e[15]=v,e[16]=A):A=e[16],A}function Bt(t,e,n){return t.findIndex(o=>e(o)===n)}function ut(t,e,n,o){return t.length===0?!1:t.every(V=>o(n[e(V)]))}function pt(t,e,n,o,V){if(t.length===0)return null;const a=Bt(t,e,V);for(let r=1;r<=t.length;r++){const i=t[(a+r)%t.length];if(!i)continue;const l=e(i);if(l!==V&&!o(n[l]))return l}return null}function Do(t){return!t.isStreaming&&t.allAnswered}function $t(t){const{parts:e,partKey:n,schema:o,defaultValues:V,isStreaming:a,hasAnswer:r,onSubmit:i}=t,l=e[0]?n(e[0]):"",[p,d]=L.useState(l),[c,u]=L.useState(!1),m=rs({resolver:Vs(o),defaultValues:V}),h=m.watch(),f=Bt(e,n,p),x=f>=0?e[f]:void 0,b=r(h[p]),g=ut(e,n,h,r),v=Do({isStreaming:a,allAnswered:g}),A=()=>{if(f>0){const _=e[f-1];_&&d(n(_))}},j=()=>{if(f>=0&&f<e.length-1){const _=e[f+1];_&&d(n(_))}},w=()=>{const _=m.getValues(),k=pt(e,n,_,r,p);k&&d(k)},y=()=>{m.handleSubmit(_=>{const k=_;for(const P of e)i(P,k[n(P)])})()},C=L.useRef(y);C.current=y;const S=()=>{v&&(u(!1),C.current())},N=()=>{const _=m.getValues();if(ut(e,n,_,r)){if(a){u(!0);return}u(!1),C.current()}else{const k=pt(e,n,_,r,p);k&&d(k)}};return L.useEffect(()=>{if(c&&!a){if(!g){u(!1);return}u(!1),C.current()}},[c,a,g]),{form:m,activeKey:p,setActiveKey:d,currentIndex:f,currentPart:x,isCurrentAnswered:b,isAllAnswered:g,canSubmit:v,goPrev:A,goNext:j,advanceToNextUnanswered:w,submit:S,submitOrAdvance:N}}const Ot="chat.approval.defaultDenyReason";function Kt(t){const e=M.c(36),{onYolo:n}=t,o=G(),[V,a]=he();let r,i,l,p,d,c,u,m,h;if(e[0]!==n||e[1]!==V||e[2]!==a||e[3]!==o){const A=me.find(y=>y.value===V.toolApprovalLevel)??me[0];let j;e[13]!==n||e[14]!==V||e[15]!==a?(j=y=>{const C=y,S=V.toolApprovalLevel??"readonly";a({...V,toolApprovalLevel:C}),C==="auto"&&n(S)},e[13]=n,e[14]=V,e[15]=a,e[16]=j):j=e[16];const w=j;l=dn,m=V.toolApprovalLevel,h=w,i=un,d="xs",c="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",u=Po,r=pn,p=o(A.shortKey),e[0]=n,e[1]=V,e[2]=a,e[3]=o,e[4]=r,e[5]=i,e[6]=l,e[7]=p,e[8]=d,e[9]=c,e[10]=u,e[11]=m,e[12]=h}else r=e[4],i=e[5],l=e[6],p=e[7],d=e[8],c=e[9],u=e[10],m=e[11],h=e[12];let f;e[17]!==r||e[18]!==p?(f=s.jsx(r,{children:p}),e[17]=r,e[18]=p,e[19]=f):f=e[19];let x;e[20]!==i||e[21]!==d||e[22]!==c||e[23]!==u||e[24]!==f?(x=s.jsx(i,{size:d,className:c,onClick:u,children:f}),e[20]=i,e[21]=d,e[22]=c,e[23]=u,e[24]=f,e[25]=x):x=e[25];let b;e[26]!==o?(b=me.map(A=>s.jsx(cn,{value:A.value,children:o(A.labelKey)},A.value)),e[26]=o,e[27]=b):b=e[27];let g;e[28]!==b?(g=s.jsx(mn,{children:b}),e[28]=b,e[29]=g):g=e[29];let v;return e[30]!==l||e[31]!==g||e[32]!==m||e[33]!==h||e[34]!==x?(v=s.jsxs(l,{value:m,onValueChange:h,children:[x,g]}),e[30]=l,e[31]=g,e[32]=m,e[33]=h,e[34]=x,e[35]=v):v=e[35],v}function Po(t){return t.stopPropagation()}function Qt(t){const e=M.c(8),{input:n}=t,o=G();if(n==null){let r;e[0]!==o?(r=o("chat.approval.noInput"),e[0]=o,e[1]=r):r=e[1];let i;return e[2]!==r?(i=s.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=i):i=e[3],i}let V;try{let r;e[4]!==n?(r=JSON.stringify(n,null,2),e[4]=n,e[5]=r):r=e[5],V=r}catch{V=String(n)}let a;return e[6]!==V?(a=s.jsx("div",{className:"px-4",children:s.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word max-h-32 overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:V})}),e[6]=V,e[7]=a):a=e[7],a}function Mo(t){const e=M.c(38),{approval:n,onRespond:o}=t,V=G(),[a]=he(),r=a.toolApprovalLevel??"readonly";let i;e[0]!==n.approvalId||e[1]!==r||e[2]!==o||e[3]!==V?(i=()=>o(n.approvalId,!1,V(Ot),r),e[0]=n.approvalId,e[1]=r,e[2]=o,e[3]=V,e[4]=i):i=e[4];const l=i;let p;e[5]!==n.approvalId||e[6]!==r||e[7]!==o?(p=()=>o(n.approvalId,!0,void 0,r),e[5]=n.approvalId,e[6]=r,e[7]=o,e[8]=p):p=e[8];const d=p;let c;e[9]!==n.approvalId||e[10]!==o?(c=S=>o(n.approvalId,!0,void 0,S),e[9]=n.approvalId,e[10]=o,e[11]=c):c=e[11];const u=c;let m;e[12]!==u?(m=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Kt,{onYolo:u})}),e[12]=u,e[13]=m):m=e[13];const h=m;let f;e[14]!==V?(f=V("chat.approval.denyButton"),e[14]=V,e[15]=f):f=e[15];let x;e[16]!==l||e[17]!==f?(x=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:l,children:f}),e[16]=l,e[17]=f,e[18]=x):x=e[18];let b;e[19]!==V?(b=V("chat.approval.acceptButton"),e[19]=V,e[20]=b):b=e[20];let g;e[21]!==d||e[22]!==b?(g=s.jsx(ee,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:d,children:b}),e[21]=d,e[22]=b,e[23]=g):g=e[23];let v;e[24]!==x||e[25]!==g?(v=s.jsxs(s.Fragment,{children:[x,g]}),e[24]=x,e[25]=g,e[26]=v):v=e[26];const A=v;let j;e[27]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Te,{size:14}),e[27]=j):j=e[27];let w;e[28]!==V?(w=V("chat.approval.needsApproval"),e[28]=V,e[29]=w):w=e[29];let y;e[30]!==n.input?(y=s.jsx(Qt,{input:n.input}),e[30]=n.input,e[31]=y):y=e[31];let C;return e[32]!==n.friendlyName||e[33]!==h||e[34]!==A||e[35]!==w||e[36]!==y?(C=s.jsx(ue,{icon:j,label:w,title:n.friendlyName,defaultExpanded:!0,footerLeft:h,footerRight:A,children:y}),e[32]=n.friendlyName,e[33]=h,e[34]=A,e[35]=w,e[36]=y,e[37]=C):C=e[37],C}const Ro=as(be(),fe({approved:is().optional(),levelOverride:$e(["auto","readonly"]).optional()}));function Eo(t){const e=M.c(46),{approvals:n,isStreaming:o,onRespond:V}=t,a=G(),[r]=he(),i=r.toolApprovalLevel??"readonly";let l;e[0]!==n?(l=Object.fromEntries(n.map(zo)),e[0]=n,e[1]=l):l=e[1];const p=l;let d;e[2]!==i||e[3]!==V||e[4]!==a?(d=(k,P)=>{const D=P;typeof D?.approved=="boolean"&&V(k.approvalId,D.approved,D.approved===!1?a(Ot):void 0,D.levelOverride??i)},e[2]=i,e[3]=V,e[4]=a,e[5]=d):d=e[5];let c;e[6]!==n||e[7]!==p||e[8]!==o||e[9]!==d?(c={parts:n,partKey:Lo,schema:Ro,defaultValues:p,isStreaming:o,hasAnswer:Fo,onSubmit:d},e[6]=n,e[7]=p,e[8]=o,e[9]=d,e[10]=c):c=e[10];const u=$t(c);let m;e[11]!==n||e[12]!==u?(m=k=>{u.form.reset(Object.fromEntries(n.map(P=>[P.approvalId,{approved:!0,levelOverride:k}]))),u.submitOrAdvance()},e[11]=n,e[12]=u,e[13]=m):m=e[13];const h=m,f=u.currentPart,x=u.form;let b;e[14]!==u?(b=k=>{k.preventDefault(),u.submit()},e[14]=u,e[15]=b):b=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Te,{size:14}),e[16]=g):g=e[16];let v;e[17]!==n.length||e[18]!==a?(v=a("chat.approval.batchedLabel",{count:n.length}),e[17]=n.length,e[18]=a,e[19]=v):v=e[19];const A=f?.friendlyName??"";let j;e[20]!==h?(j=s.jsx(Kt,{onYolo:h}),e[20]=h,e[21]=j):j=e[21];let w;e[22]!==n.length||e[23]!==u.currentIndex||e[24]!==u.goNext||e[25]!==u.goPrev||e[26]!==j?(w=s.jsx(Ut,{currentIndex:u.currentIndex,total:n.length,onPrev:u.goPrev,onNext:u.goNext,extraLeft:j}),e[22]=n.length,e[23]=u.currentIndex,e[24]=u.goNext,e[25]=u.goPrev,e[26]=j,e[27]=w):w=e[27];let y;e[28]!==f||e[29]!==u.form.control||e[30]!==u.submitOrAdvance?(y=f?s.jsx(Uo,{approvalId:f.approvalId,control:u.form.control,onChange:u.submitOrAdvance}):null,e[28]=f,e[29]=u.form.control,e[30]=u.submitOrAdvance,e[31]=y):y=e[31];let C;e[32]!==f?(C=f?s.jsx(Qt,{input:f.input}):null,e[32]=f,e[33]=C):C=e[33];let S;e[34]!==w||e[35]!==y||e[36]!==C||e[37]!==v||e[38]!==A?(S=s.jsx(ue,{icon:g,label:v,title:A,defaultExpanded:!0,footerLeft:w,footerRight:y,children:C}),e[34]=w,e[35]=y,e[36]=C,e[37]=v,e[38]=A,e[39]=S):S=e[39];let N;e[40]!==S||e[41]!==b?(N=s.jsx("form",{onSubmit:b,children:S}),e[40]=S,e[41]=b,e[42]=N):N=e[42];let _;return e[43]!==u.form||e[44]!==N?(_=s.jsx(Ue,{...x,children:N}),e[43]=u.form,e[44]=N,e[45]=_):_=e[45],_}function Fo(t){return typeof t?.approved=="boolean"}function Lo(t){return t.approvalId}function zo(t){return[t.approvalId,{approved:void 0}]}function Uo(t){const e=M.c(7),{approvalId:n,control:o,onChange:V}=t,a=G(),r=`${n}.approved`;let i;e[0]!==V||e[1]!==a?(i=p=>{const{field:d}=p,c=d.value===!0,u=d.value===!1;return s.jsxs(s.Fragment,{children:[s.jsx(ee,{type:"button",variant:u?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!1),V()},"aria-pressed":u,children:a("chat.approval.denyButton")}),s.jsx(ee,{type:"button",variant:c?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!0),V()},"aria-pressed":c,children:a("chat.approval.acceptButton")})]})},e[0]=V,e[1]=a,e[2]=i):i=e[2];let l;return e[3]!==o||e[4]!==r||e[5]!==i?(l=s.jsx(ls,{control:o,name:r,render:i}),e[3]=o,e[4]=r,e[5]=i,e[6]=l):l=e[6],l}function Bo(){const t=M.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Te,{className:"size-5 text-muted-foreground shimmer"}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let V;return t[3]!==o?(V=s.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[n,s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=V):V=t[4],V}function $o(t){const e=M.c(8),{approvals:n,isStreaming:o,onRespond:V}=t;if(o&&n.length===0){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Bo,{}),e[0]=r):r=e[0],r}if(n.length===0)return null;if(n.length===1){const r=n[0];if(!r)return null;let i;return e[1]!==V||e[2]!==r?(i=s.jsx(Mo,{approval:r,onRespond:V}),e[1]=V,e[2]=r,e[3]=i):i=e[3],i}let a;return e[4]!==n||e[5]!==o||e[6]!==V?(a=s.jsx(Eo,{approvals:n,isStreaming:o,onRespond:V}),e[4]=n,e[5]=o,e[6]=V,e[7]=a):a=e[7],a}function Oo(t){const e=M.c(28),{plan:n,onApprove:o,onDismiss:V}=t,a=G();let r;e[0]!==o||e[1]!==n.plan?(r=()=>{o(n.plan)},e[0]=o,e[1]=n.plan,e[2]=r):r=e[2];const i=r;let l;e[3]!==a?(l=a("chat.proposePlan.keepIterating"),e[3]=a,e[4]=l):l=e[4];let p;e[5]!==V||e[6]!==l?(p=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:V,children:l}),e[5]=V,e[6]=l,e[7]=p):p=e[7];let d;e[8]!==a?(d=a("chat.proposePlan.letsGo"),e[8]=a,e[9]=d):d=e[9];let c;e[10]!==i||e[11]!==d?(c=s.jsx(ee,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-purple-600 hover:bg-purple-700 text-white active:scale-[0.97] transition-transform",onClick:i,children:d}),e[10]=i,e[11]=d,e[12]=c):c=e[12];let u;e[13]!==p||e[14]!==c?(u=s.jsxs(s.Fragment,{children:[p,c]}),e[13]=p,e[14]=c,e[15]=u):u=e[15];const m=u;let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Es,{size:14}),e[16]=h):h=e[16];let f;e[17]!==a?(f=a("chat.proposePlan.planReady"),e[17]=a,e[18]=f):f=e[18];let x;e[19]!==a?(x=a("chat.proposePlan.implementationPlan"),e[19]=a,e[20]=x):x=e[20];let b;e[21]!==n.plan?(b=s.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:s.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:s.jsx(hn,{id:"plan-preview",part:{type:"text",text:n.plan}})})}),e[21]=n.plan,e[22]=b):b=e[22];let g;return e[23]!==m||e[24]!==b||e[25]!==f||e[26]!==x?(g=s.jsx(ue,{icon:h,label:f,title:x,defaultExpanded:!0,footerRight:m,children:b}),e[23]=m,e[24]=b,e[25]=f,e[26]=x,e[27]=g):g=e[27],g}function Ko(t){const e=M.c(6),{plans:n,onApprove:o,onDismiss:V}=t;let a;e[0]!==n?(a=Ft(n),e[0]=n,e[1]=a):a=e[1];const r=a;if(!r)return null;let i;return e[2]!==r||e[3]!==o||e[4]!==V?(i=s.jsx(Oo,{plan:r,onApprove:o,onDismiss:V}),e[2]=r,e[3]=o,e[4]=V,e[5]=i):i=e[5],i}function Yt(t){return t?"response"in t?t.response:t.option??t.draft:""}const mt=fe({response:be().min(1,"Response is required")}),Qo=fe({option:be().nullable(),draft:be()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Yo=fe({response:$e(["yes","no"])});function Go(t){switch(t.type){case"text":return mt;case"choice":return Qo;case"confirm":return Yo;default:return mt}}function qo(t){const e={};for(const n of t)e[n.toolCallId]=Go(n.input);return fe(e)}function Wo(t){const e=M.c(7),{control:n,name:o,placeholder:V}=t,a=G();let r;e[0]!==V||e[1]!==a?(r=l=>{const{field:p}=l,d=p.value??"";return s.jsxs(qe,{children:[s.jsx(We,{children:s.jsx("div",{className:"px-2",children:s.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[s.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:s.jsx(yt,{size:16,className:"text-muted-foreground"})}),s.jsx("input",{...p,value:d,type:"text",placeholder:V||a("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":a("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),s.jsx(He,{})]})},e[0]=V,e[1]=a,e[2]=r):r=e[2];let i;return e[3]!==n||e[4]!==o||e[5]!==r?(i=s.jsx(kt,{control:n,name:o,render:r}),e[3]=n,e[4]=o,e[5]=r,e[6]=i):i=e[6],i}function Gt(t,e){const n=M.c(4);let o,V;n[0]!==t||n[1]!==e?(o=()=>{const a=r=>{const i=r.target.tagName;if(i==="INPUT"||i==="TEXTAREA"||r.metaKey||r.ctrlKey||r.altKey)return;const l=Number.parseInt(r.key,10);l>=1&&l<=t&&(r.preventDefault(),e(l-1))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},V=[t,e],n[0]=t,n[1]=e,n[2]=o,n[3]=V):(o=n[2],V=n[3]),L.useEffect(o,V)}function Ho(t){const e=M.c(51),{control:n,name:o,options:V}=t,a=G(),r=`${o}.option`;let i;e[0]!==n||e[1]!==r?(i={control:n,name:r,defaultValue:null},e[0]=n,e[1]=r,e[2]=i):i=e[2];const{field:l}=st(i),p=`${o}.draft`;let d;e[3]!==n||e[4]!==p?(d={control:n,name:p,defaultValue:""},e[3]=n,e[4]=p,e[5]=d):d=e[5];const{field:c}=st(d),u=l.value,m=c.value??"";let h;if(e[6]!==l||e[7]!==V?(h=E=>{const I=V[E];I!=null&&l.onChange(I)},e[6]=l,e[7]=V,e[8]=h):h=e[8],Gt(V.length,h),V.length===0)return null;const f=u===null;let x;e[9]!==a?(x=a("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=a,e[10]=x):x=e[10];let b;if(e[11]!==l||e[12]!==u||e[13]!==V||e[14]!==a){let E;e[16]!==l||e[17]!==u||e[18]!==a?(E=(I,F)=>{const U=u===I;return s.jsxs("button",{type:"button",onClick:()=>l.onChange(I),className:O("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",U&&"bg-accent/50",!U&&"hover:bg-accent/30"),"aria-label":a("chat.userAskQuestion.selectOption",{option:I}),children:[s.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",U?"bg-chart-1 text-white":"bg-muted text-foreground"),children:F+1}),s.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:I})]},`${F}-${I}`)},e[16]=l,e[17]=u,e[18]=a,e[19]=E):E=e[19],b=V.map(E),e[11]=l,e[12]=u,e[13]=V,e[14]=a,e[15]=b}else b=e[15];const g=f&&"bg-accent/50",v=!f&&"hover:bg-accent/30";let A;e[20]!==g||e[21]!==v?(A=O("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",g,v),e[20]=g,e[21]=v,e[22]=A):A=e[22];let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:s.jsx(yt,{size:16,className:"text-muted-foreground"})}),e[23]=j):j=e[23];const w=f?m:"";let y;e[24]!==c||e[25]!==l||e[26]!==u?(y=E=>{c.onChange(E.target.value),u!==null&&l.onChange(null)},e[24]=c,e[25]=l,e[26]=u,e[27]=y):y=e[27];let C;e[28]!==l||e[29]!==u?(C=()=>{u!==null&&l.onChange(null)},e[28]=l,e[29]=u,e[30]=C):C=e[30];let S;e[31]!==a?(S=a("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=a,e[32]=S):S=e[32];let N;e[33]!==a?(N=a("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=a,e[34]=N):N=e[34];let _;e[35]!==w||e[36]!==y||e[37]!==C||e[38]!==S||e[39]!==N?(_=s.jsx("input",{type:"text",value:w,onChange:y,onFocus:C,placeholder:S,"aria-label":N,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=w,e[36]=y,e[37]=C,e[38]=S,e[39]=N,e[40]=_):_=e[40];let k;e[41]!==A||e[42]!==_?(k=s.jsxs("label",{className:A,children:[j,_]}),e[41]=A,e[42]=_,e[43]=k):k=e[43];let P;e[44]!==k||e[45]!==x||e[46]!==b?(P=s.jsx(We,{children:s.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":x,children:[b,k]})}),e[44]=k,e[45]=x,e[46]=b,e[47]=P):P=e[47];let D;e[48]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(He,{}),e[48]=D):D=e[48];let R;return e[49]!==P?(R=s.jsxs(qe,{children:[P,D]}),e[49]=P,e[50]=R):R=e[50],R}function Jo(t){const e=M.c(8),{control:n,name:o}=t,V=G();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["yes","no"],e[0]=a):a=e[0];const r=a,i=L.useRef(null);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=c=>{i.current?.onChange(r[c]??"")},e[1]=l):l=e[1],Gt(r.length,l);let p;e[2]!==V?(p=c=>{const{field:u}=c;return i.current=u,s.jsxs(qe,{children:[s.jsx(We,{children:s.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":V("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:r.map(m=>{const h=u.value===m;return s.jsxs("button",{type:"button",onClick:()=>u.onChange(m),className:O("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",h&&"bg-accent/50",!h&&"hover:bg-accent/30"),"aria-label":V("chat.userAskQuestion.confirmValue",{value:V(`chat.userAskQuestion.confirm${m==="yes"?"Yes":"No"}`)}),children:[s.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0",h?"bg-chart-1 text-white":"bg-muted text-foreground"),children:m==="yes"?1:2}),s.jsx("span",{className:"text-sm text-foreground capitalize",children:V(`chat.userAskQuestion.confirm${m==="yes"?"Yes":"No"}`)})]},m)})})}),s.jsx(He,{})]})},e[2]=V,e[3]=p):p=e[3];let d;return e[4]!==n||e[5]!==o||e[6]!==p?(d=s.jsx(kt,{control:n,name:o,render:p}),e[4]=n,e[5]=o,e[6]=p,e[7]=d):d=e[7],d}function ft(t){const e=M.c(13),{input:n,control:o,toolCallId:V}=t;switch(n.type){case"text":{const a=`${V}.response`;let r;return e[0]!==o||e[1]!==n.default||e[2]!==a?(r=s.jsx(Wo,{control:o,name:a,placeholder:n.default}),e[0]=o,e[1]=n.default,e[2]=a,e[3]=r):r=e[3],r}case"choice":{let a;e[4]!==n.options?(a=n.options?.filter(Boolean)??[],e[4]=n.options,e[5]=a):a=e[5];const r=a;let i;return e[6]!==o||e[7]!==r||e[8]!==V?(i=s.jsx(Ho,{control:o,name:V,options:r}),e[6]=o,e[7]=r,e[8]=V,e[9]=i):i=e[9],i}case"confirm":{const a=`${V}.response`;let r;return e[10]!==o||e[11]!==a?(r=s.jsx(Jo,{control:o,name:a}),e[10]=o,e[11]=a,e[12]=r):r=e[12],r}default:return null}}function Zo(t){const e=M.c(91),{parts:n,isStreaming:o,onSubmit:V}=t;let a;e[0]!==n?(a=qo(n.map(sr)),e[0]=n,e[1]=a):a=e[1];const r=a;let i;e[2]!==n?(i=Object.fromEntries(n.map(tr)),e[2]=n,e[3]=i):i=e[3];const l=i;let p;e[4]!==V?(p=($,z)=>{const Q=Yt(z);Q&&V($,Q)},e[4]=V,e[5]=p):p=e[5];let d;e[6]!==l||e[7]!==o||e[8]!==n||e[9]!==r||e[10]!==p?(d={parts:n,partKey:er,schema:r,defaultValues:l,isStreaming:o,hasAnswer:Xo,onSubmit:p},e[6]=l,e[7]=o,e[8]=n,e[9]=r,e[10]=p,e[11]=d):d=e[11];const c=$t(d),u=c.currentPart,m=G();let h;e[12]!==u||e[13]!==c||e[14]!==m?(h=()=>{const $=u;if(!$)return;const z=m("chat.userAskQuestion.skipMessage"),Q=$.toolCallId;$.input?.type==="choice"?(c.form.setValue(`${Q}.option`,null),c.form.setValue(`${Q}.draft`,z)):c.form.setValue(`${Q}.response`,z),c.advanceToNextUnanswered()},e[12]=u,e[13]=c,e[14]=m,e[15]=h):h=e[15];const f=h;let x;e[16]!==c.currentIndex||e[17]!==c.goNext||e[18]!==c.goPrev||e[19]!==n.length?(x=s.jsx(Ut,{currentIndex:c.currentIndex,total:n.length,onPrev:c.goPrev,onNext:c.goNext}),e[16]=c.currentIndex,e[17]=c.goNext,e[18]=c.goPrev,e[19]=n.length,e[20]=x):x=e[20];const b=x;let g;e[21]!==m?(g=m("chat.userAskQuestion.skip"),e[21]=m,e[22]=g):g=e[22];let v;e[23]!==f||e[24]!==g?(v=s.jsx(ee,{type:"button",variant:"outline",size:"sm",onClick:f,className:"h-7",children:g}),e[23]=f,e[24]=g,e[25]=v):v=e[25];let A;e[26]!==c.isAllAnswered||e[27]!==c.isCurrentAnswered||e[28]!==c.submitOrAdvance||e[29]!==o?(A=s.jsx(_o,{isStreaming:o,isAllAnswered:c.isAllAnswered,isCurrentAnswered:c.isCurrentAnswered,onAdvanceOrSubmit:c.submitOrAdvance}),e[26]=c.isAllAnswered,e[27]=c.isCurrentAnswered,e[28]=c.submitOrAdvance,e[29]=o,e[30]=A):A=e[30];let j;e[31]!==v||e[32]!==A?(j=s.jsxs(s.Fragment,{children:[v,A]}),e[31]=v,e[32]=A,e[33]=j):j=e[33];const w=j;if(n.length===1){const $=n[0];if(!$?.input)return null;const z=c.form;let Q;e[34]!==c?(Q=se=>{se.preventDefault(),c.submit()},e[34]=c,e[35]=Q):Q=e[35];let B;e[36]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Be,{size:14}),e[36]=B):B=e[36];let te;e[37]!==m?(te=m("chat.userAskQuestion.questionPending"),e[37]=m,e[38]=te):te=e[38];let Z;e[39]!==$.input?.prompt||e[40]!==m?(Z=$.input?.prompt??m("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=m,e[41]=Z):Z=e[41];const T=$.input;let Y;e[42]!==c.form.control||e[43]!==$.toolCallId||e[44]!==T?(Y=s.jsx(ft,{input:T,control:c.form.control,toolCallId:$.toolCallId}),e[42]=c.form.control,e[43]=$.toolCallId,e[44]=T,e[45]=Y):Y=e[45];let W;e[46]!==w||e[47]!==te||e[48]!==Z||e[49]!==Y?(W=s.jsx(ue,{icon:B,label:te,title:Z,defaultExpanded:!0,footerRight:w,children:Y}),e[46]=w,e[47]=te,e[48]=Z,e[49]=Y,e[50]=W):W=e[50];let J;e[51]!==Q||e[52]!==W?(J=s.jsx("form",{onSubmit:Q,autoComplete:"off",children:W}),e[51]=Q,e[52]=W,e[53]=J):J=e[53];let H;return e[54]!==c.form||e[55]!==J?(H=s.jsx(Ue,{...z,children:J}),e[54]=c.form,e[55]=J,e[56]=H):H=e[56],H}const y=c.form;let C;e[57]!==c?(C=$=>{$.preventDefault(),c.submit()},e[57]=c,e[58]=C):C=e[58];let S;e[59]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Be,{size:14}),e[59]=S):S=e[59];let N;e[60]!==m?(N=m("chat.userAskQuestion.questionPending"),e[60]=m,e[61]=N):N=e[61];const _=c.currentIndex+1;let k;e[62]!==n.length||e[63]!==m||e[64]!==_?(k=m("chat.userAskQuestion.questionCount",{current:_,total:n.length}),e[62]=n.length,e[63]=m,e[64]=_,e[65]=k):k=e[65];let P;e[66]!==u?.input?.prompt||e[67]!==m?(P=u?.input?.prompt??m("chat.userAskQuestion.question"),e[66]=u?.input?.prompt,e[67]=m,e[68]=P):P=e[68];const D=c.activeKey,R=c.setActiveKey;let E;if(e[69]!==c.form||e[70]!==n){let $;e[72]!==c.form?($=z=>s.jsx(gn,{value:z.toolCallId,className:"mt-0",children:s.jsx(ft,{input:z.input,control:c.form.control,toolCallId:z.toolCallId})},z.toolCallId),e[72]=c.form,e[73]=$):$=e[73],E=n.map($),e[69]=c.form,e[70]=n,e[71]=E}else E=e[71];let I;e[74]!==c.activeKey||e[75]!==c.setActiveKey||e[76]!==E?(I=s.jsx(bn,{value:D,onValueChange:R,children:E}),e[74]=c.activeKey,e[75]=c.setActiveKey,e[76]=E,e[77]=I):I=e[77];let F;e[78]!==b||e[79]!==w||e[80]!==N||e[81]!==k||e[82]!==P||e[83]!==I?(F=s.jsx(ue,{icon:S,label:N,count:k,title:P,defaultExpanded:!0,footerLeft:b,footerRight:w,children:I}),e[78]=b,e[79]=w,e[80]=N,e[81]=k,e[82]=P,e[83]=I,e[84]=F):F=e[84];let U;e[85]!==C||e[86]!==F?(U=s.jsx("form",{onSubmit:C,autoComplete:"off",children:F}),e[85]=C,e[86]=F,e[87]=U):U=e[87];let q;return e[88]!==c.form||e[89]!==U?(q=s.jsx(Ue,{...y,children:U}),e[88]=c.form,e[89]=U,e[90]=q):q=e[90],q}function Xo(t){return!!Yt(t)}function er(t){return t.toolCallId}function tr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function sr(t){return{toolCallId:t.toolCallId,input:t.input}}function nr(){const t=M.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Be,{className:"size-5 text-muted-foreground shimmer"}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=o):o=t[2];let V;return t[3]!==o?(V=s.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[n,s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=V):V=t[4],V}function qt(t){const e=M.c(7),{userAskParts:n,isStreaming:o,onSubmit:V}=t;let a;e[0]!==n?(a=n.filter(or),e[0]=n,e[1]=a):a=e[1];const r=a;if(r.length===0){if(o){let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(nr,{}),e[2]=l):l=e[2],l}return null}let i;return e[3]!==o||e[4]!==V||e[5]!==r?(i=s.jsx(Zo,{parts:r,isStreaming:o,onSubmit:V}),e[3]=o,e[4]=V,e[5]=r,e[6]=i):i=e[6],i}function or(t){return t.state==="input-available"}function rr(t){const e=t.filter(a=>a.status==="in_progress"),n=t.filter(a=>a.status==="completed").length,o=t.length;if(o>0&&n===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[V]=e;return V&&e.length===1?{icon:"in_progress",activity:V.activeForm,progress:`${n}/${o} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${n}/${o} done`}:n>0?{icon:"pending",activity:`${o-n} pending`,progress:`${n}/${o} done`}:{icon:"pending",activity:`${o} todos`,progress:"not started"}}function Vr(t){const e=M.c(13),{todos:n}=t;if(n.length===0)return null;let o;e[0]!==n?(o=rr(n),e[0]=n,e[1]=o):o=e[1];const V=o;let a;e[2]!==V.icon?(a=s.jsx(cr,{status:V.icon}),e[2]=V.icon,e[3]=a):a=e[3];const r=V.activity,i=V.progress;let l;e[4]!==n?(l=n.map(ar),e[4]=n,e[5]=l):l=e[5];let p;e[6]!==l?(p=s.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:l}),e[6]=l,e[7]=p):p=e[7];let d;return e[8]!==V.activity||e[9]!==V.progress||e[10]!==a||e[11]!==p?(d=s.jsx(ue,{icon:a,label:r,count:i,defaultExpanded:!1,children:p}),e[8]=V.activity,e[9]=V.progress,e[10]=a,e[11]=p,e[12]=d):d=e[12],d}function ar(t,e){return s.jsx(ir,{todo:t},e)}function ir(t){const e=M.c(14),{todo:n}=t,o=n.status==="completed",a=n.status==="in_progress"?n.activeForm:n.content;let r;e[0]!==n.status?(r=s.jsx(lr,{status:n.status}),e[0]=n.status,e[1]=r):r=e[1];const i=o&&"text-muted-foreground";let l;e[2]!==i?(l=O("relative text-sm leading-snug pt-px select-none",i),e[2]=i,e[3]=l):l=e[3];const p=o?"100%":"0%",d=o?"width 300ms ease 200ms":"width 150ms ease";let c;e[4]!==p||e[5]!==d?(c=s.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:p,transition:d}}),e[4]=p,e[5]=d,e[6]=c):c=e[6];let u;e[7]!==a||e[8]!==l||e[9]!==c?(u=s.jsxs("span",{className:l,children:[a,c]}),e[7]=a,e[8]=l,e[9]=c,e[10]=u):u=e[10];let m;return e[11]!==r||e[12]!==u?(m=s.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent/50 transition-colors",children:[r,u]}),e[11]=r,e[12]=u,e[13]=m):m=e[13],m}function lr(t){const e=M.c(4),{status:n}=t,o=n==="completed"?"true":void 0,V=n==="in_progress"?"true":void 0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("svg",{viewBox:"0 0 21 21",children:s.jsx("path",{d:"M5,10.75 L8.5,14.25 L19.4,2.3 C18.8333333,1.43333333 18.0333333,1 17,1 L4,1 C2.35,1 1,2.35 1,4 L1,17 C1,18.65 2.35,20 4,20 L17,20 C18.65,20 20,18.65 20,17 L20,7.99769186"})}),e[0]=a):a=e[0];let r;return e[1]!==o||e[2]!==V?(r=s.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":V,"aria-hidden":"true",children:a}),e[1]=o,e[2]=V,e[3]=r):r=e[3],r}function cr(t){const e=M.c(13),{status:n}=t,o=G();if(n==="completed"){let r;e[0]!==o?(r=o("chat.todoStatus.completed"),e[0]=o,e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("svg",{viewBox:"0 0 10 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"w-2 h-2 text-primary-foreground",style:{strokeWidth:2},children:s.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=i):i=e[2];let l;return e[3]!==r?(l=s.jsx("span",{"aria-label":r,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:i}),e[3]=r,e[4]=l):l=e[4],l}if(n==="in_progress"){let r;e[5]!==o?(r=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=r):r=e[6];let i;return e[7]!==r?(i=s.jsx("span",{"aria-label":r,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=r,e[8]=i):i=e[8],i}let V;e[9]!==o?(V=o("chat.todoStatus.pending"),e[9]=o,e[10]=V):V=e[10];let a;return e[11]!==V?(a=s.jsx("span",{"aria-label":V,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=V,e[12]=a):a=e[12],a}const dr={usd:[{dollars:10,labelKey:"credits.topUp.starter"},{dollars:20,labelKey:"credits.topUp.popular"},{dollars:100,labelKey:"credits.topUp.bestValue"}],brl:[{dollars:50,labelKey:"credits.topUp.starter"},{dollars:100,labelKey:"credits.topUp.popular"},{dollars:500,labelKey:"credits.topUp.bestValue"}]},ur={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function pr(t){const e=M.c(46),{source:n,onDone:o}=t,V=G(),a=cs(),[r]=he(),[i,l]=L.useState(r.language==="pt-BR"?"brl":"usd"),[p,d]=L.useState(""),[c,u]=L.useState(!1),m=i==="brl"?"R$":"$";let h;e[0]!==i||e[1]!==a?(h=async I=>{const{url:F}=await a.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:I,currency:i});return F},e[0]=i,e[1]=a,e[2]=h):h=e[2];let f;e[3]!==o?(f=I=>{I&&window.open(I,"_blank","noopener,noreferrer"),o?.()},e[3]=o,e[4]=f):f=e[4];let x;e[5]!==V?(x=I=>{ye.error(V("credits.topUp.failed",{message:I.message}))},e[5]=V,e[6]=x):x=e[6];let b;e[7]!==h||e[8]!==f||e[9]!==x?(b={mutationFn:h,onSuccess:f,onError:x},e[7]=h,e[8]=f,e[9]=x,e[10]=b):b=e[10];const{mutate:g,isPending:v}=ds(b);let A;e[11]!==i||e[12]!==n||e[13]!==g?(A=(I,F)=>{X("credits_topup_clicked",{amount_cents:I,currency:i,tier_label:F,source:n}),g(I)},e[11]=i,e[12]=n,e[13]=g,e[14]=A):A=e[14];const j=A,w=parseFloat(p),y=!isNaN(w)&&w>=1;let C,S,N;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=I=>{I&&l(I)},S=s.jsx(ot,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),N=s.jsx(ot,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=C,e[16]=S,e[17]=N):(C=e[15],S=e[16],N=e[17]);let _;e[18]!==i?(_=s.jsx("div",{className:"mb-4",children:s.jsxs(Tn,{type:"single",variant:"outline",size:"sm",value:i,onValueChange:C,children:[S,N]})}),e[18]=i,e[19]=_):_=e[19];const k=dr[i];let P;if(e[20]!==j||e[21]!==m||e[22]!==v||e[23]!==V||e[24]!==k){let I;e[26]!==j||e[27]!==m||e[28]!==v||e[29]!==V?(I=F=>{const{dollars:U,labelKey:q}=F;return s.jsxs("button",{type:"button",disabled:v,onClick:()=>j(U*100,ur[q]??"preset"),className:O("relative flex flex-col items-center gap-1 py-5 rounded-xl border transition-all duration-150 cursor-pointer","disabled:opacity-50 disabled:cursor-wait","border-border hover:border-foreground/20 hover:bg-muted/30"),children:[s.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[m,U]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:V(q)})]},U)},e[26]=j,e[27]=m,e[28]=v,e[29]=V,e[30]=I):I=e[30],P=k.map(I),e[20]=j,e[21]=m,e[22]=v,e[23]=V,e[24]=k,e[25]=P}else P=e[25];let D;e[31]!==P?(D=s.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:P}),e[31]=P,e[32]=D):D=e[32];let R;e[33]!==j||e[34]!==m||e[35]!==p||e[36]!==w||e[37]!==y||e[38]!==v||e[39]!==c||e[40]!==V?(R=c?s.jsxs("div",{className:"flex gap-2 mt-3",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:m}),s.jsx(In,{type:"number",min:"1",step:"1",placeholder:V("credits.topUp.customPlaceholder"),value:p,onChange:I=>d(I.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(ee,{className:"h-10",disabled:!y||v,onClick:()=>j(Math.round(w*100),"custom"),children:V(v?"credits.topUp.opening":"credits.topUp.add")})]}):s.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>u(!0),children:V("credits.topUp.enterCustom")}),e[33]=j,e[34]=m,e[35]=p,e[36]=w,e[37]=y,e[38]=v,e[39]=c,e[40]=V,e[41]=R):R=e[41];let E;return e[42]!==D||e[43]!==R||e[44]!==_?(E=s.jsxs("div",{children:[_,D,R]}),e[42]=D,e[43]=R,e[44]=_,e[45]=E):E=e[45],E}const mr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function fr(t){const e=M.c(47),{onDismiss:n}=t,{org:o}=we(),V=Oe(),{decoKeyId:a}=kn(),r=G(),i=Ce("credits");let l,p;if(e[0]!==o.id?(l=()=>{X("credits_exhausted_shown",{organization_id:o.id})},p=[o.id],e[0]=o.id,e[1]=l,e[2]=p):(l=e[1],p=e[2]),L.useEffect(l,p),!i)return null;let d;e[3]!==n?(d=k=>!k&&n?.(),e[3]=n,e[4]=d):d=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(165,149,255,0.5) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(208,236,26,0.45) 0%, transparent 100%)"],e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:c.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[6]=u):u=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[7]=m):m=e[7];let h;e[8]!==r?(h=r("chat.creditsExhaustedBanner.title"),e[8]=r,e[9]=h):h=e[9];let f;e[10]!==h?(f=s.jsx(An,{className:"text-xl font-semibold tracking-tight",children:h}),e[10]=h,e[11]=f):f=e[11];let x;e[12]!==r?(x=r("chat.creditsExhaustedBanner.description"),e[12]=r,e[13]=x):x=e[13];let b;e[14]!==x?(b=s.jsx(vn,{className:"mt-1.5 text-sm leading-relaxed",children:x}),e[14]=x,e[15]=b):b=e[15];let g;e[16]!==b||e[17]!==f?(g=s.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[u,s.jsxs(jn,{className:"relative gap-4",children:[m,s.jsxs("div",{children:[f,b]})]})]}),e[16]=b,e[17]=f,e[18]=g):g=e[18];let v;e[19]!==a||e[20]!==n||e[21]!==r?(v=a&&s.jsxs("div",{className:"px-8 pt-5 pb-6",children:[s.jsx("div",{className:"rounded-xl border border-border p-5",children:s.jsx(pr,{source:"exhausted_banner",onDone:n})}),s.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:mr.map(k=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:s.jsx(Qe,{size:12,className:"text-success"})}),s.jsx("span",{className:"text-sm text-foreground/80",children:r(k)})]},k))})]}),e[19]=a,e[20]=n,e[21]=r,e[22]=v):v=e[22];let A;e[23]!==r?(A=r("chat.creditsExhaustedBanner.dismiss"),e[23]=r,e[24]=A):A=e[24];let j;e[25]!==n||e[26]!==A?(j=s.jsx(ee,{variant:"ghost",size:"sm",onClick:n,children:A}),e[25]=n,e[26]=A,e[27]=j):j=e[27];let w;e[28]!==V||e[29]!==n||e[30]!==o.slug?(w=()=>{V({to:"/$org/settings/ai-providers",params:{org:o.slug}}),n?.()},e[28]=V,e[29]=n,e[30]=o.slug,e[31]=w):w=e[31];let y;e[32]!==r?(y=r("chat.creditsExhaustedBanner.manageProviders"),e[32]=r,e[33]=y):y=e[33];let C;e[34]!==w||e[35]!==y?(C=s.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:w,children:y}),e[34]=w,e[35]=y,e[36]=C):C=e[36];let S;e[37]!==j||e[38]!==C?(S=s.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[j,C]}),e[37]=j,e[38]=C,e[39]=S):S=e[39];let N;e[40]!==g||e[41]!==v||e[42]!==S?(N=s.jsxs(yn,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:hr,children:[g,v,S]}),e[40]=g,e[41]=v,e[42]=S,e[43]=N):N=e[43];let _;return e[44]!==N||e[45]!==d?(_=s.jsx(wn,{open:!0,onOpenChange:d,children:N}),e[44]=N,e[45]=d,e[46]=_):_=e[46],_}function hr(t){return t.preventDefault()}const xr={trial_exhausted:{label:"chat.subscriptionLimit.trialLabel",title:"chat.subscriptionLimit.trialTitle"},monthly_exhausted:{label:"chat.subscriptionLimit.monthlyLabel",title:"chat.subscriptionLimit.monthlyTitle"},runs_exhausted:{label:"chat.subscriptionLimit.runsLabel",title:"chat.subscriptionLimit.runsTitle"}};function gr(t){const e=M.c(16),{kind:n,onDismiss:o,onSubscribe:V}=t,a=G(),{label:r,title:i}=xr[n];let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ke,{size:14}),e[0]=l):l=e[0];let p;e[1]!==r||e[2]!==a?(p=a(r),e[1]=r,e[2]=a,e[3]=p):p=e[3];let d;e[4]!==a||e[5]!==i?(d=a(i),e[4]=a,e[5]=i,e[6]=d):d=e[6];let c;e[7]!==n||e[8]!==V||e[9]!==a?(c=n==="trial_exhausted"?s.jsx(ee,{size:"sm",onClick:V,className:"h-7 text-xs",children:a("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=n,e[8]=V,e[9]=a,e[10]=c):c=e[10];let u;return e[11]!==o||e[12]!==p||e[13]!==d||e[14]!==c?(u=s.jsx(ue,{icon:l,label:p,title:d,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:c}),e[11]=o,e[12]=p,e[13]=d,e[14]=c,e[15]=u):u=e[15],u}const br={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function ht(t){const e=M.c(21),{kind:n,onDismiss:o}=t,V=G(),a=Oe(),{org:r}=we(),{label:i,title:l}=br[n];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ke,{size:14}),e[0]=p):p=e[0];let d;e[1]!==i||e[2]!==V?(d=V(i),e[1]=i,e[2]=V,e[3]=d):d=e[3];let c;e[4]!==V||e[5]!==l?(c=V(l),e[4]=V,e[5]=l,e[6]=c):c=e[6];let u;e[7]!==a||e[8]!==o||e[9]!==r.slug?(u=()=>{a({to:"/$org/settings/ai-providers",params:{org:r.slug}}),o()},e[7]=a,e[8]=o,e[9]=r.slug,e[10]=u):u=e[10];let m;e[11]!==V?(m=V("chat.planRefused.seePlans"),e[11]=V,e[12]=m):m=e[12];let h;e[13]!==u||e[14]!==m?(h=s.jsx(ee,{size:"sm",className:"h-7 text-xs",onClick:u,children:m}),e[13]=u,e[14]=m,e[15]=h):h=e[15];let f;return e[16]!==o||e[17]!==d||e[18]!==c||e[19]!==h?(f=s.jsx(ue,{icon:p,label:d,title:c,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:h}),e[16]=o,e[17]=d,e[18]=c,e[19]=h,e[20]=f):f=e[20],f}function Wt(t){const e=Ar(t);if(e!==null){const p=Wt(e);return{summary:p.summary,rawDetails:p.rawDetails??t}}const n=t.trim(),o=n.startsWith("<")&&/<[a-z][\s\S]*>/i.test(n),V=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(n),a=/failed to fetch|networkerror|load failed|offline/i.test(n),r=/timeout|timed out|aborted|deadline/i.test(n),i=n.length>240,l=/sandbox failed to start(?::\s*(.+))?/is.exec(n);if(l){const p=l[1]?.trim().replace(/\.$/,"");return{summary:p?`Your sandbox didn't finish starting up (${p}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return V||o&&i?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:a?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:r?{summary:"That took longer than expected. Try again.",rawDetails:t}:o||i?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}function Ar(t){const e=t.trim();if(!e.startsWith("{"))return null;let n;try{n=JSON.parse(e)}catch{return null}if(!n||typeof n!="object")return null;const{error:o,message:V}=n,a=typeof o=="string"?o:V;return typeof a=="string"&&a.trim()&&!a.trim().startsWith("{")?a:null}const vr={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Ie(t){const e=M.c(29),n=G(),{variant:o,onDismiss:V}=t,a=o==="error";let r;e[0]!==a||e[1]!==n?(r=n(a?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=a,e[1]=n,e[2]=r):r=e[2];const i=r,l=a?an:ps;let p;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==n?(p=t.variant==="error"?t.error.message:(()=>{const g=vr[t.finishReason];return g?n(g):n("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=n,e[7]=p):p=e[7];const d=p;let c;e[8]!==a||e[9]!==d?(c=a?Wt(d):{summary:d,rawDetails:null},e[8]=a,e[9]=d,e[10]=c):c=e[10];const{summary:u,rawDetails:m}=c;let h;e[11]!==l?(h=s.jsx(l,{size:14}),e[11]=l,e[12]=h):h=e[12];let f;e[13]!==a||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==n?(f=a?s.jsx(ee,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:n("chat.highlight.fixInChat")}):s.jsx(ee,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:n("chat.highlight.continue")}),e[13]=a,e[14]=t.onContinue,e[15]=t.onFixInChat,e[16]=n,e[17]=f):f=e[17];let x;e[18]!==m||e[19]!==n?(x=m?s.jsxs("details",{className:"group mx-4",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground [&::-webkit-details-marker]:hidden",children:[s.jsx("svg",{"aria-hidden":"true",className:"size-3 transition-transform group-open:rotate-90",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"m4.5 3 3 3-3 3"})}),s.jsx("span",{className:"group-open:hidden",children:n("chat.highlight.showTechnicalDetails")}),s.jsx("span",{className:"hidden group-open:inline",children:n("chat.highlight.hideTechnicalDetails")})]}),s.jsxs("div",{className:"relative mt-2",children:[s.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(m).then(()=>ye.success(n("chat.highlight.copiedToClipboard"))).catch(()=>ye.error(n("chat.highlight.couldNotCopy")))},"aria-label":n("chat.highlight.copyErrorDetails"),title:n("chat.highlight.copy"),className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center rounded-md bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:s.jsx(ln,{className:"size-3.5"})}),s.jsx("pre",{className:"max-h-40 overflow-auto rounded-md border border-border/60 bg-background px-3 py-2 pr-8 font-mono text-xs text-foreground/80 whitespace-pre-wrap break-all",children:m})]})]}):null,e[18]=m,e[19]=n,e[20]=x):x=e[20];let b;return e[21]!==i||e[22]!==V||e[23]!==u||e[24]!==h||e[25]!==f||e[26]!==x||e[27]!==o?(b=s.jsx(ue,{icon:h,label:i,title:u,defaultExpanded:!0,variant:o,onClose:V,footerRight:f,children:x}),e[21]=i,e[22]=V,e[23]=u,e[24]=h,e[25]=f,e[26]=x,e[27]=o,e[28]=b):b=e[28],b}function Re(){const t=M.c(78),e=G(),{error:n,clearError:o,finishReason:V,clearFinishReason:a,messages:r,isStreaming:i,submit:l,sendMessage:p}=Ge(),[d,c]=he(),{virtualMcpId:u,createTaskWithMessage:m}=Ks(),{chatMode:h,simpleModeTier:f}=_e(),x=Ce("credits"),{mutate:b}=Pn("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let g;t[0]!==b?(g=()=>b(),t[0]=b,t[1]=g):g=t[1];const v=g;let A;t[2]!==h||t[3]!==f||t[4]!==u?(A=oe=>({tier:f,mode:h,toolApprovalLevel:oe,agent:u?{id:u}:void 0}),t[2]=h,t[3]=f,t[4]=u,t[5]=A):A=t[5];const j=A;let w;t[6]!==d.toolApprovalLevel?(w=d.toolApprovalLevel??us(),t[6]=d.toolApprovalLevel,t[7]=w):w=t[7];const y=w,C=r.at(-1),S=C?.role==="assistant"?C.parts:[],N=S.filter(Cr),_=Lt(S),k=Et(S);let P;t[8]!==n||t[9]!==p||t[10]!==e?(P=()=>{if(n){const le={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e("chat.highlight.fixInChatMessage",{error:n.message})}]}]};p(le)}},t[8]=n,t[9]=p,t[10]=e,t[11]=P):P=t[11];const D=P;let R;t[12]!==p||t[13]!==e?(R=()=>{const oe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e("chat.highlight.pleaseContinue")}]}]};p(oe)},t[12]=p,t[13]=e,t[14]=R):R=t[14];const E=R;let I;t[15]!==j||t[16]!==y||t[17]!==l?(I=(oe,le)=>{l({kind:"toolOutput",toolCallId:oe.toolCallId,output:{response:le}},j(y))},t[15]=j,t[16]=y,t[17]=l,t[18]=I):I=t[18];const F=I;let U;t[19]!==m||t[20]!==d||t[21]!==c||t[22]!==e||t[23]!==u?(U=oe=>{c({...d,toolApprovalLevel:"auto"}),m({virtualMcpId:u,message:{parts:[{type:"text",text:e("chat.highlight.implementPlanMessage",{plan:oe})}]}})},t[19]=m,t[20]=d,t[21]=c,t[22]=e,t[23]=u,t[24]=U):U=t[24];const q=U,$=wr;let z;t[25]!==j||t[26]!==l?(z=(oe,le,ve,Ee)=>{l({kind:"approval",approvalId:oe,approved:le,...ve?{reason:ve}:{}},j(Ee))},t[25]=j,t[26]=l,t[27]=z):z=t[27];const Q=z,B=zt();if(B.isCreditExhausted){let oe;return t[28]!==x||t[29]!==o?(oe=x?s.jsx(fr,{onDismiss:o}):s.jsx("div",{className:"absolute bottom-full left-0 right-0",children:s.jsx(ht,{kind:"ai_budget_exhausted",onDismiss:o})}),t[28]=x,t[29]=o,t[30]=oe):oe=t[30],oe}const{showError:te,showWarning:Z,hasApprovals:T}=B,Y=N.map(yr).join("|"),W=Ft(_)?.toolCallId??"",J=k.map(jr).join("|");let H;t[31]!==B.todos?(H=s.jsx(Vr,{todos:B.todos}),t[31]=B.todos,t[32]=H):H=t[32];let se;t[33]!==o||t[34]!==B.subscriptionErrorKind||t[35]!==v?(se=B.subscriptionErrorKind&&s.jsx(gr,{kind:B.subscriptionErrorKind,onDismiss:o,onSubscribe:v}),t[33]=o,t[34]=B.subscriptionErrorKind,t[35]=v,t[36]=se):se=t[36];let Ve;t[37]!==o||t[38]!==B.planRefusal?(Ve=B.planRefusal&&s.jsx(ht,{kind:B.planRefusal,onDismiss:o}),t[37]=o,t[38]=B.planRefusal,t[39]=Ve):Ve=t[39];let ae;t[40]!==o||t[41]!==n||t[42]!==D||t[43]!==te?(ae=te&&s.jsx(Ie,{variant:"error",error:n,onDismiss:o,onFixInChat:D}),t[40]=o,t[41]=n,t[42]=D,t[43]=te,t[44]=ae):ae=t[44];let ne;t[45]!==a||t[46]!==V||t[47]!==E||t[48]!==Z?(ne=Z&&s.jsx(Ie,{variant:"warning",finishReason:V,onDismiss:a,onContinue:E}),t[45]=a,t[46]=V,t[47]=E,t[48]=Z,t[49]=ne):ne=t[49];let ie;t[50]!==J||t[51]!==Q||t[52]!==T||t[53]!==i||t[54]!==k?(ie=T&&s.jsx($o,{approvals:k,isStreaming:i,onRespond:Q},J),t[50]=J,t[51]=Q,t[52]=T,t[53]=i,t[54]=k,t[55]=ie):ie=t[55];let re;t[56]!==B.hasPlans||t[57]!==q||t[58]!==$||t[59]!==i||t[60]!==_||t[61]!==W?(re=B.hasPlans&&s.jsx(Ko,{plans:_,isStreaming:i,onApprove:q,onDismiss:$},W),t[56]=B.hasPlans,t[57]=q,t[58]=$,t[59]=i,t[60]=_,t[61]=W,t[62]=re):re=t[62];let ce;t[63]!==B.isWaitingForUserInput||t[64]!==F||t[65]!==i||t[66]!==Y||t[67]!==N?(ce=B.isWaitingForUserInput&&s.jsx(qt,{userAskParts:N,isStreaming:i,onSubmit:F},Y),t[63]=B.isWaitingForUserInput,t[64]=F,t[65]=i,t[66]=Y,t[67]=N,t[68]=ce):ce=t[68];let Ae;return t[69]!==Ve||t[70]!==ae||t[71]!==ne||t[72]!==ie||t[73]!==re||t[74]!==ce||t[75]!==H||t[76]!==se?(Ae=s.jsxs("div",{className:"absolute bottom-full left-0 right-0",children:[H,se,Ve,ae,ne,ie,re,ce]}),t[69]=Ve,t[70]=ae,t[71]=ne,t[72]=ie,t[73]=re,t[74]=ce,t[75]=H,t[76]=se,t[77]=Ae):Ae=t[77],Ae}function jr(t){return t.approvalId}function yr(t){return t.toolCallId}function wr(){document.querySelector("[data-chat-input]")?.focus()}function Cr(t){return t.type==="tool-user_ask"}Re.Error=function(e){return s.jsx(Ie,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Re.Warning=function(e){return s.jsx(Ie,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Re.UserAskQuestion=qt;function Nr(t){const e=M.c(20),{taskId:n}=t,o=G(),V=Qs(n),a=Ys(V),r=Gs(),{stop:i,removeLocalMessage:l}=Ge();if(a.length===0)return null;let p;e[0]!==o?(p=o("chat.queueTray.sendNow"),e[0]=o,e[1]=p):p=e[1];let d;e[2]!==i?(d=()=>{i()},e[2]=i,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(jt,{size:14}),e[4]=c):c=e[4];let u;e[5]!==p||e[6]!==d?(u=s.jsx(De,{asChild:!0,children:s.jsx(ee,{type:"button",variant:"ghost",size:"icon-sm","aria-label":p,onClick:d,children:c})}),e[5]=p,e[6]=d,e[7]=u):u=e[7];let m;e[8]!==o?(m=o("chat.queueTray.sendNow"),e[8]=o,e[9]=m):m=e[9];let h;e[10]!==m?(h=s.jsx(Pe,{side:"top",children:s.jsx("p",{className:"text-xs",children:m})}),e[10]=m,e[11]=h):h=e[11];let f;e[12]!==u||e[13]!==h?(f=s.jsxs(Me,{delayDuration:400,children:[u,h]}),e[12]=u,e[13]=h,e[14]=f):f=e[14];let x;return e[15]!==r||e[16]!==l||e[17]!==o||e[18]!==n?(x=(b,g)=>s.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[s.jsx("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-semibold text-muted-foreground dark:bg-background",children:g+1}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:b.text}),s.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:s.jsx(ee,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{r.cancel(n,b.messageId).then(v=>{v&&(qs(n,b.messageId),l(b.messageId))})},children:s.jsx(Mn,{className:"size-3.5"})})})]},b.messageId),e[15]=r,e[16]=l,e[17]=o,e[18]=n,e[19]=x):x=e[19],s.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border py-1.5 pr-2 pl-3 text-xs text-muted-foreground",children:[s.jsx("span",{children:o(a.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:a.length})}),f]}),a.map(x)]})}function Sr(t,e){return t?{modelId:t.modelId,title:t.title??t.modelId,keyId:t.keyId,providerId:e,description:null,logo:null,capabilities:[],limits:null,costs:null}:null}const kr={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function Ir(t){const e=M.c(31),{tier:n,orgSlot:o,userSlot:V,autoSlot:a,onPick:r,onReset:i,onClose:l}=t,p=G(),d=Pt(),c=new Set(d.map(Tr)),u=Ws([V,o,a],c),m=u?.keyId??null,[h,f]=L.useState(m??d[0]?.id??null),x=d.some(F=>F.id===h)?h:m??d[0]?.id??null,b=x?d.find(F=>F.id===x):null,g="flex h-[70vh] max-h-[460px] w-full flex-col",v=kr[n];let A;e[0]!==p||e[1]!==v?(A=p(v),e[0]=p,e[1]=v,e[2]=A):A=e[2];let j;e[3]!==A?(j=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[3]=A,e[4]=j):j=e[4];let w;e[5]!==i||e[6]!==p||e[7]!==V?(w=V&&s.jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-md hover:bg-accent cursor-pointer",children:p("chat.modelPreferences.reset")}),e[5]=i,e[6]=p,e[7]=V,e[8]=w):w=e[8];let y;e[9]!==j||e[10]!==w?(y=s.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[j,w]}),e[9]=j,e[10]=w,e[11]=y):y=e[11];const C="flex-1 min-h-0",S=L.Suspense;let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Rn,{}),e[12]=N):N=e[12];const _=Yn,k=!0,P=Sr(m?u:null,b?.providerId??"deco");let D;e[13]!==x||e[14]!==r||e[15]!==f?(D=F=>{const U=F.keyId??x??"";f(U),r({keyId:U,modelId:F.modelId,title:F.title})},e[13]=x,e[14]=r,e[15]=f,e[16]=D):D=e[16];let R;e[17]!==_||e[18]!==x||e[19]!==l||e[20]!==f||e[21]!==P||e[22]!==D?(R=s.jsx(_,{compact:k,onClose:l,credentialId:x,onCredentialChange:f,selectedModel:P,onModelChange:D}),e[17]=_,e[18]=x,e[19]=l,e[20]=f,e[21]=P,e[22]=D,e[23]=R):R=e[23];let E;e[24]!==S||e[25]!==R||e[26]!==N?(E=s.jsx("div",{className:C,children:s.jsx(S,{fallback:N,children:R})}),e[24]=S,e[25]=R,e[26]=N,e[27]=E):E=e[27];let I;return e[28]!==E||e[29]!==y?(I=s.jsxs("div",{className:g,children:[y,E]}),e[28]=E,e[29]=y,e[30]=I):I=e[30],I}function Tr(t){return t.id}const _r=["fast","smart","thinking"];function Ht(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const xt={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function Dr(t){const e=M.c(28),{tier:n,pillIcon:o,groups:V}=t,a=G();let r;e[0]!==a?(r=Ht(a),e[0]=a,e[1]=r):r=e[1];const i=r,[l,p]=L.useState(!1);let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=C=>{C.onSelect(),p(!1)},e[2]=d):d=e[2];const c=d,u=i[n];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=m):m=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=O("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),e[4]=h):h=e[4];const f=i[n];let x;e[5]!==f?(x=s.jsx("span",{className:h,children:f}),e[5]=f,e[6]=x):x=e[6];let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(It,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=b):b=e[7];let g;e[8]!==o||e[9]!==u||e[10]!==x?(g=s.jsx(De,{asChild:!0,children:s.jsx("span",{className:"inline-flex min-w-0 shrink",children:s.jsx(Tt,{asChild:!0,children:s.jsxs(ee,{type:"button",variant:"ghost",size:"default","aria-label":u,className:m,children:[o,x,b]})})})}),e[8]=o,e[9]=u,e[10]=x,e[11]=g):g=e[11];let v;e[12]!==u?(v=s.jsx(Pe,{children:u}),e[12]=u,e[13]=v):v=e[13];let A;e[14]!==g||e[15]!==v?(A=s.jsxs(Me,{children:[g,v]}),e[14]=g,e[15]=v,e[16]=A):A=e[16];let j;if(e[17]!==V||e[18]!==a){let C;e[20]!==a?(C=S=>s.jsx("div",{className:"flex flex-col",children:S.rows.map(N=>s.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-md hover:bg-muted",children:[s.jsxs("button",{type:"button",role:"menuitem","aria-label":N.title,onClick:()=>c(N),className:O("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",N.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[N.icon&&s.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:N.icon}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm",children:N.title}),N.subtitle&&s.jsx("div",{className:"text-xs text-muted-foreground",children:N.subtitle})]}),N.active&&s.jsx("span",{title:a("chat.tierTrigger.selected"),children:s.jsx(Qe,{size:14,className:"text-foreground mt-0.5"})})]}),N.modelOverride&&s.jsx(Mr,{label:N.title,render:N.modelOverride})]},N.key))},S.key),e[20]=a,e[21]=C):C=e[21],j=V.map(C),e[17]=V,e[18]=a,e[19]=j}else j=e[19];let w;e[22]!==j?(w=s.jsx(_t,{align:"end",className:"p-1 w-64",onOpenAutoFocus:Pr,children:s.jsx("div",{role:"menu",className:"flex flex-col",children:j})}),e[22]=j,e[23]=w):w=e[23];let y;return e[24]!==l||e[25]!==A||e[26]!==w?(y=s.jsxs(Dt,{open:l,onOpenChange:p,children:[A,w]}),e[24]=l,e[25]=A,e[26]=w,e[27]=y):y=e[27],y}function Pr(t){return t.preventDefault()}function Mr(t){const e=M.c(38),{label:n,render:o}=t,V=G(),a=$n(),[r,i]=L.useState(!1);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i(!1),e[0]=l):l=e[0];const p=l;let d;e[1]!==n||e[2]!==V?(d=V("chat.modelPreferences.customizeModel",{tier:n}),e[1]=n,e[2]=V,e[3]=d):d=e[3];const c=r&&"opacity-100";let u;e[4]!==c?(u=O("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 rounded-md bg-background border border-border/60 shadow-sm","text-muted-foreground hover:text-foreground","opacity-100 [@media(hover:hover)]:opacity-0","[@media(hover:hover)]:group-hover/tier-row:opacity-100","[@media(hover:hover)]:group-focus-within/tier-row:opacity-100",c),e[4]=c,e[5]=u):u=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ls,{size:14}),e[6]=m):m=e[6];let h;e[7]!==d||e[8]!==u?(h=s.jsx("button",{type:"button","aria-label":d,className:u,children:m}),e[7]=d,e[8]=u,e[9]=h):h=e[9];const f=h;if(a){let A;e[10]!==f?(A=s.jsx(Ln,{asChild:!0,children:f}),e[10]=f,e[11]=A):A=e[11];let j;e[12]!==n||e[13]!==V?(j=V("chat.modelPreferences.customizeModel",{tier:n}),e[12]=n,e[13]=V,e[14]=j):j=e[14];let w;e[15]!==j?(w=s.jsx(zn,{className:"sr-only",children:j}),e[15]=j,e[16]=w):w=e[16];let y;e[17]!==r||e[18]!==o?(y=r&&o(p),e[17]=r,e[18]=o,e[19]=y):y=e[19];let C;e[20]!==y||e[21]!==w?(C=s.jsxs(Un,{className:"p-0 flex flex-col max-h-[95vh]",children:[w,y]}),e[20]=y,e[21]=w,e[22]=C):C=e[22];let S;return e[23]!==r||e[24]!==C||e[25]!==A?(S=s.jsxs(Bn,{open:r,onOpenChange:i,children:[A,C]}),e[23]=r,e[24]=C,e[25]=A,e[26]=S):S=e[26],S}let x;e[27]!==f?(x=s.jsx(Tt,{asChild:!0,children:f}),e[27]=f,e[28]=x):x=e[28];let b;e[29]!==r||e[30]!==o?(b=r&&o(p),e[29]=r,e[30]=o,e[31]=b):b=e[31];let g;e[32]!==b?(g=s.jsx(_t,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:b}),e[32]=b,e[33]=g):g=e[33];let v;return e[34]!==r||e[35]!==x||e[36]!==g?(v=s.jsxs(Dt,{open:r,onOpenChange:i,children:[x,g]}),e[34]=r,e[35]=x,e[36]=g,e[37]=v):v=e[37],v}function gt(t){return t==="fast"?s.jsx(Ke,{size:16}):t==="thinking"?s.jsx(Fs,{size:16}):s.jsx(On,{size:16})}function Rr(t){const e=M.c(13),n=Zs();let o;e[0]!==t||e[1]!==n.tiers?(o=p=>{const d=n.tiers[p];return d?d.title??d.modelId:t.chat[p]?.title},e[0]=t,e[1]=n.tiers,e[2]=o):o=e[2];const V=o;let a;e[3]!==V?(a=V("fast"),e[3]=V,e[4]=a):a=e[4];let r;e[5]!==V?(r=V("smart"),e[5]=V,e[6]=r):r=e[6];let i;e[7]!==V?(i=V("thinking"),e[7]=V,e[8]=i):i=e[8];let l;return e[9]!==a||e[10]!==r||e[11]!==i?(l={fast:a,smart:r,thinking:i},e[9]=a,e[10]=r,e[11]=i,e[12]=l):l=e[12],l}function Er(){const t=M.c(23),e=G(),{simpleModeTier:n,setSimpleModeTier:o}=_e(),V=Kn(),a=Pt(),r=Qn(a),i=Rr(r),{data:l,error:p}=Hs();let d;t[0]!==l?(d=l===void 0?{tiers:{}}:l,t[0]=l,t[1]=d):d=t[1];const c=d,u=Js(),m=Ce("model_choice"),h=Cn(),f=Nn();if(!h||!m)return null;let x,b;if(t[2]!==r||t[3]!==f||t[4]!==V||t[5]!==o||t[6]!==e||t[7]!==n||t[8]!==i||t[9]!==u||t[10]!==c||t[11]!==p){const w=Ht(e);x="decopilot",b=_r.map(y=>{const C=i[y],S=c.tiers[y];return{key:`decopilot-${y}`,icon:gt(y),title:w[y],subtitle:f?C??e(xt[y]):e(xt[y]),active:n===y,onSelect:()=>o(y),modelOverride:f?N=>s.jsxs(s.Fragment,{children:[p&&s.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),s.jsx(Ir,{tier:y,orgSlot:V.tiers[y],userSlot:S,autoSlot:r.chat[y],onClose:N,onPick:_=>u.mutate({tier:y,slot:_}),onReset:()=>u.mutate({tier:y,slot:null})},`${y}:${S?.keyId??"org"}:${S?.modelId??""}`)]}):void 0}}),t[2]=r,t[3]=f,t[4]=V,t[5]=o,t[6]=e,t[7]=n,t[8]=i,t[9]=u,t[10]=c,t[11]=p,t[12]=x,t[13]=b}else x=t[12],b=t[13];let g;t[14]!==x||t[15]!==b?(g=[{key:x,rows:b}],t[14]=x,t[15]=b,t[16]=g):g=t[16];const v=g;let A;t[17]!==n?(A=gt(n),t[17]=n,t[18]=A):A=t[18];let j;return t[19]!==v||t[20]!==A||t[21]!==n?(j=s.jsx(Dr,{tier:n,pillIcon:A,groups:v}),t[19]=v,t[20]=A,t[21]=n,t[22]=j):j=t[22],j}function Jt(t){const e=M.c(3),[n]=he();let o;return e[0]!==n.enableSounds||e[1]!==t?(o=()=>{n.enableSounds&&io(t.dataUri).catch(a=>{console.warn(`[sound] ${t.name} playback failed:`,a)})},e[0]=n.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const Fr={name:"switch-005",dataUri:"data:audio/mpeg;base64,SUQzBAAAAAAAIlRTU0VAAAAOAAADTGF2ZjYyLjMuMTAwAAAAAAAAAAAAAAD/+1DAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAABkAABU4ABMTEx0dHR0nJycnMTExMTs7OztERERETk5OTlhYWFhiYmJibGxsbHZ2dnZ/f39/iYmJiZOTk5OdnZ2dp6enp7GxsbG7u7u7xMTExM7Ozs7Y2NjY4uLi4uzs7Oz29vb2/////wAAAABMYXZjNjIuMTEAAAAAAAAAAAAAAAAkBVYAAAAAAAAVOPCP8KUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//tQxAAACEwDXvQRAAG8Ii93HtACUCAABAKCJwfaCEHwfeoEAQdEAYygIHBOCAIAgCAJh9QIOg+D5/ygPh/wfB8DuKAgCHyn9QPh/5SCDv+CEHAQdxOD4B27c39tbckkqYbBAYAN9bNJLB+aXAf5wQAKdzxfbmrVIRQ4xNx3HwnoDmLhfMhgJiiw/HREXNCHqjvHEPEG8QjBYlxQNepJAT0kC8ip6JzSWj1TasoG+iyycbf2Uil1ovf1f/oUtR1qP+s1WSBFKoAAU02BDjMhuP/7UsQEgws8bRpd8YABJYPeBf9wCGXTGxBYcw5AJFMFMAmQQAhGAxgLBgHIAMYAAALhgAchipbe/91aU1VV4zcZj1Vf1XgYCIMBNrsBAIGs9/Ue4i/xFPeqCqwViI9/UeLf///rOngdA3OPHFjmOBv+EQnGahgaZxVplmkAH5JadDTQlNCEuGNiWYbCCONWdUJg6HXNazFdu1T+VgaEpOP70exv7f2/4b/yH//2/4cqCX/zWRUrIw+IPNMNlDnjAXQas/I4AzmYifA0tMSCgQDF//tSxBCDSzzi3k/sQwEyCtjJ/rBZAk+Uqj1YhA5YMCAAMwgOUchTkK7OR7LbMl0W1H6SvzG0Q2ZzfKUhnmTobv9DNhS1v7P8h//8Gv8gTRt1jReZ7YEjmMQg9hhwwMycHooasFmZyjcZGBKJD+IwbMCQQLoi+IQXCcIoydKoilI2MWFS5uJdDEu2taRrYI2ZSqKY50pJLv2NfjUAAuQAMfqVQ/T3PDQgMJMeEZ45hJzY6MNoFMxqTj1zNGQKJjAxEsSCBgQJBSIL0mcKYQJfVAn/+1LEGwLKlEKrD3MiYcuMkVa/wABB8Vh6M1q1epbvXwWBURhkyEhWZ/////////////9gjZ/Wt4w+4MNMCpE4TBYQl4w1IHvMDdA2zBngBMwc8COMDhCpDAfgOAAgrBgNYU+YC0FBGAkAMpgWoSCYAGESGBGAKBgXgJOdiOJmMCmNwCYNDJhYRPykRCJhTBnEUzlsjv4UNLj/z97n3Mv/7z1nZqyitYAZIqErIwMwJAqEw0GAAMFptJMaqFwB8CQIWlhuhuDAwNjfuwrQFAYXCf/7UsQVAA+9PTP42gYRdiIu9zBwAPbFUCi0DAhgNcS+7cDwVgM05A9bUDeuQMyE/u3CygVISgZhpIau/9PhdQG2C9DpxZZJmn/dn/Psmt0EFm////l84ThUTopE4VD/9JkubOGasTvN30C20G21qgUCkVCoUCgPMywrPCGly27V5q5t24vl/8jSlSAPCxzNseNCw3oh3NGBu4BZJ5hv7DRSfR/+eWG7nA8IKh2Olv5iz3q5m3//Joxo3JqNyYkSuGt/k6D4DeoBOHmHdl0dkZYA//tSxAUAC4B1Z/2DADEcA17Z/uhI4Yoik/TrZo+ww7UtmpW4LDWu2IacoJKJJeTSM+ZmAYBEiU+ZnnAwCn1VVVV6JUJQVnioKhrgqdKgqGpUFeCp0sDR3ztQNREDRUFioKuxKCpYGQBlRIBk+aLwb8KblGQVDdphPYTUdBOGbVpAaTF6ZdjEV0iRUZRCYkA4oUQDx5zqDugtXvza/7fuNNvfZ+j9v+T/2f//J/4cAAOTpE5K4zksR9MfIB+TDcQTI4gNs1XKAzEFUrGkxABYEBb/+1LEEYNKrEjgT/TCwYYVmUX+mHoKgWhKU5Eiw9SFIRmppw+3fYo4siPhUFeexM8KgIO6wVuPDDy01qeRaVbw357//y3+o8M0pBNlNLCGBzGKwyYw2IIFOE1WNTjRM6x8MlA1AxDhUHTAkEiyKpnbWrLcaOBotBUKbk1pypcWDAIK00AhKLGkUco6q9VWvM53mcaq3tVa8zjTM/tX//EDP//////////XAAmrwAAPoKwcw0ShDCZD/BQlhzinxQdorsOuXTEIC01ZkJyu4k/qPP/7UsQUAEjkrrkvZaPBIRXUoe5QObfMhYKX9RVgTPqCSCaSCaSC0XVdV1f/////6IAlguuAJSiDRNloNBsZg+0+Ts8MMCn81WUTRAlIi+GHECD0y8AWDIqswYsxGOSKVV7MqOni8tkVOip0fZX/////9HrMCbAz2EHGS4GKAAiRAAAYAcDdKd4G6Z/nwYgJ0ZAIgZyC8aPAs/iPBhwMpWDQNARltNS5Y61v//9i8Yl4SkFkIGTkAc0UBrIYLPA4MYBEy+YLMRuY4nhTC3hZA68H//tSxCoAyQC6mY6CkWDJBIsBz/QUrgNmahSzcrYw0/HhfnMAZBojDsgTFkDR5MDkG/DZEbk2FCmowqdqv2TYABiJwqqYjaQRGZ1URZ1DhSsdiHX/GBu0QpzIBNSaLqZ0ARkwFARxMrpt/Eh47mbQAhhU6sisFUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LESoHHJCRaj/dmYAIAQAAQAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7UsSLg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LEoYPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7UsShg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LEoYPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",duration:.609,format:"mp3",license:"CC0",author:"Kenney"},Lr=Cs.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),zr=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Ur(){const t=M.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex items-center -space-x-1.5",children:zr.map(Br)}),t[0]=e):e=t[0],e}function Br(t){return s.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function $r({disabled:t,onOpenConnections:e,virtualMcpId:n,selectedModel:o,isStreaming:V,onUnsupportedFile:a}){const r=G(),[i,l]=L.useState(!1),p=Jt(Fr),{org:d}=we(),{editor:c}=At(),u=L.useRef(null),m=Je(o),h=()=>{!m||V||(l(!1),u.current?.click())},f=async T=>{const Y=T.target.files;if(!Y||Y.length===0||!c)return;const W=Array.from(Y);try{let J=c.state.selection.from;for(const H of W)await Mt(c,o??null,H,J,a,r),J=c.state.selection.to}finally{u.current&&(u.current.value="")}},x=Xn({connectionId:n,orgId:d.id,orgSlug:d.slug}),b=ms.virtualMcpPrompts(n,d.id),{data:g,isLoading:v}=fs({queryKey:b,queryFn:()=>eo(x),staleTime:6e4,enabled:i&&!!x}),A=g?.prompts??[],[j,w]=L.useState(null),{chatMode:y,setChatMode:C}=_e(),[S,N]=he(),_=me.find(T=>T.value===S.toolApprovalLevel)??me[0],k=r(_.shortKey),P=T=>{const Y=me.find(W=>W.value===T);if(Y){if(Y.value===S.toolApprovalLevel){l(!1);return}p(),X("chat_approval_level_changed",{from_level:S.toolApprovalLevel,to_level:Y.value,source:"tools_popover"}),N({...S,toolApprovalLevel:Y.value}),l(!1)}},D=y==="plan",R=()=>{p();const T=D?"default":"plan";X("chat_mode_changed",{from_mode:y,to_mode:T,source:"tools_popover"}),C(T),l(!1)},E=()=>{e(),l(!1)},I=async(T,Y)=>{if(!c||!x)return;const W=rt(T._meta),J={from:c.state.selection.from,to:c.state.selection.to};try{const H=await to(x,T.name,Y);ws(c,J,{id:T.name,name:Zn(T.name,W),metadata:H.messages,char:"/",kind:"prompt",args:Y})}catch{ye.error(r("chat.toolsPopover.failedLoadPrompt"))}},F=async T=>{l(!1);const Y=!!(T.arguments&&T.arguments.length>0);if(X("chat_prompt_inserted",{prompt_name:T.name,with_arguments:Y}),Y){w(T);return}await I(T)},U=async T=>{j&&(await I(j,T),w(null))},q=()=>{p();const T=y==="gen-image"?"default":"gen-image";X("chat_mode_changed",{from_mode:y,to_mode:T,source:"tools_popover"}),C(T),l(!1)},$=()=>{p();const T=y==="web-search"?"default":"web-search";X("chat_mode_changed",{from_mode:y,to_mode:T,source:"tools_popover"}),C(T),l(!1)},z=()=>{p();const T=y==="deep-research"?"default":"deep-research";X("chat_mode_changed",{from_mode:y,to_mode:T,source:"tools_popover"}),C(T),l(!1)},Q=y==="gen-image",B=y==="web-search",te=y==="deep-research",Z=s.jsx("input",{ref:u,type:"file",multiple:!0,accept:En(o??null),className:"hidden",onChange:f,disabled:V});return s.jsxs(s.Fragment,{children:[Z,s.jsxs(so,{open:i,onOpenChange:T=>{T&&!i&&X("chat_tools_popover_opened",{chat_mode:y}),l(T)},children:[s.jsx(no,{asChild:!0,children:s.jsxs(ee,{type:"button",variant:"ghost",size:"default",disabled:t,title:r("chat.toolsPopover.tools"),"aria-label":r("chat.toolsPopover.tools"),className:O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[s.jsx(zs,{size:14}),s.jsx("span",{className:O("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),children:r("chat.toolsPopover.tools")})]})}),s.jsxs(oo,{align:"start",className:"w-56 p-1.5 space-y-1",children:[m?s.jsxs(pe,{onClick:h,disabled:V,children:[s.jsx(lt,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.addFile")})]}):s.jsxs(Me,{children:[s.jsx(De,{asChild:!0,children:s.jsxs(pe,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:T=>T.preventDefault(),children:[s.jsx(lt,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.addFile")})]})}),s.jsx(Pe,{side:"right",children:r("chat.toolsPopover.modelNoFileSupport")})]}),s.jsxs(pe,{onClick:R,className:O(D&&"text-special"),children:[s.jsx(wt,{size:16,className:O(D&&"text-special")}),s.jsx("span",{className:"flex-1 whitespace-nowrap",children:r("chat.toolsPopover.planMode")}),s.jsx("span",{className:O("text-xs text-muted-foreground",D&&"text-special font-medium"),children:Lr})]}),s.jsxs(pe,{onClick:q,className:O(Q&&"text-special"),children:[s.jsx(St,{size:16,className:O(Q&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.createImage")}),Q&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(pe,{onClick:$,className:O(B&&"text-special"),children:[s.jsx(Ct,{size:16,className:O(B&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.webSearch")}),B&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(pe,{onClick:z,className:O(te&&"text-special"),children:[s.jsx(Nt,{size:16,className:O(te&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.deepResearch")}),te&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(Vt,{children:[s.jsxs(at,{className:"gap-2",children:[s.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.prompts")})]}),s.jsx(it,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:v?s.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[s.jsx(hs,{className:"size-3.5"}),r("chat.toolsPopover.loadingPrompts")]}):A.length===0?s.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:r("chat.toolsPopover.noPromptsAvailable")}):A.map(T=>s.jsxs(pe,{onClick:()=>F(T),className:"flex flex-col items-start gap-0.5",children:[s.jsx("span",{className:"font-medium text-sm capitalize",children:T.title||Jn(T.name,rt(T._meta))}),T.description&&s.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:T.description})]},T.name))})]}),s.jsxs(Vt,{children:[s.jsxs(at,{className:"gap-2",children:[s.jsx(Te,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.approval")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:k})]}),s.jsx(it,{className:"w-48 p-1.5",children:s.jsx(ro,{value:S.toolApprovalLevel,onValueChange:P,children:me.map(T=>s.jsx(Vo,{value:T.value,children:r(T.labelKey)},T.value))})})]}),s.jsxs(pe,{onClick:E,children:[s.jsx(ao,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.connections")}),s.jsx(L.Suspense,{children:s.jsx(Ur,{})})]})]})]}),s.jsx(ys,{prompt:j,setPrompt:w,onSubmit:U})]})}const Or=[{src:"/connections/github.png",name:"GitHub"},{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/linear.png",name:"Linear"},{src:"/connections/shopify.png",name:"Shopify"},{src:"/connections/firecrawl.png",name:"Firecrawl"},{src:"/connections/perplexity.png",name:"Perplexity"}];function Kr(){const t=M.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex items-center -space-x-1",children:Or.map(Qr)}),t[0]=e):e=t[0],e}function Qr(t){return s.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function Yr(t){const e=M.c(10),{onClick:n}=t,o=G();let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=O("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=V):V=e[0];let a;e[1]!==o?(a=o("chat.connectionsBanner.description"),e[1]=o,e[2]=a):a=e[2];let r;e[3]!==a?(r=s.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:a}),e[3]=a,e[4]=r):r=e[4];let i,l;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Kr,{}),l=s.jsx(mo,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=i,e[6]=l):(i=e[5],l=e[6]);let p;return e[7]!==n||e[8]!==r?(p=s.jsxs("button",{type:"button",onClick:n,className:V,children:[r,i,l]}),e[7]=n,e[8]=r,e[9]=p):p=e[9],p}const je=48;function Gr(){const t=M.c(9),[e,n]=L.useState("idle"),[o,V]=L.useState(""),[a,r]=L.useState(""),[i,l]=L.useState(Hr),p=L.useRef(null),d=L.useRef(null),c=L.useRef(null),u=L.useRef(null),m=L.useRef(0),h=L.useRef(!1),f=L.useRef(""),x=L.useRef(""),b=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{m.current&&(cancelAnimationFrame(m.current),m.current=0),d.current?.close().catch(Wr),u.current?.getTracks().forEach(qr),c.current=null,d.current=null,u.current=null},t[0]=g):g=t[0];const v=g;let A;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const _=k=>{u.current=k;const P=new AudioContext;d.current=P;const D=P.createMediaStreamSource(k),R=P.createAnalyser();R.fftSize=128,R.smoothingTimeConstant=.8,D.connect(R),c.current=R;const E=new Uint8Array(R.frequencyBinCount),I=()=>{if(!c.current)return;c.current.getByteFrequencyData(E);const F=[];for(let U=0;U<je;U++){const q=Math.floor(U/je*E.length);F.push(Math.max(.04,(E[q]??0)/255))}l(F),m.current=requestAnimationFrame(I)};I()};A=async()=>{const k=window.SpeechRecognition||window.webkitSpeechRecognition;if(!k)return n("unsupported"),"unsupported";let P;try{P=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return n("permission-denied"),"permission-denied"}V(""),r(""),x.current="",f.current="",h.current=!0,n("recording"),_(P);const D=new k;p.current=D,D.interimResults=!0,D.continuous=!0,D.lang=navigator.language||"en-US",D.onresult=R=>{if(p.current!==D)return;let E="",I="";for(let F=R.resultIndex;F<R.results.length;F++){const U=R.results[F],q=U?.[0]?.transcript??"";U?.isFinal?I=I+q:E=E+q}I&&(f.current=f.current+I,V(f.current)),x.current=E,r(E)},D.onerror=R=>{p.current===D&&R.error!=="no-speech"&&(h.current=!1,p.current=null,v(),n(R.error==="not-allowed"?"permission-denied":"idle"))},D.onend=()=>{if(p.current===D&&h.current)try{D.start()}catch{}};try{D.start()}catch{return h.current=!1,p.current=null,v(),n("idle"),"idle"}return"recording"},t[1]=A}else A=t[1];const j=A;let w;t[2]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{h.current=!1,p.current?.stop(),v(),n("idle"),l(Array(je).fill(.05)),r("");const _=(f.current+(x.current?" "+x.current:"")).trim();return V(""),f.current="",x.current="",_},t[2]=w):w=t[2];const y=w;let C;t[3]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{h.current=!1,p.current?.abort(),v(),n("idle"),V(""),r(""),l(Array(je).fill(.05)),f.current="",x.current=""},t[3]=C):C=t[3];const S=C;let N;return t[4]!==a||t[5]!==e||t[6]!==o||t[7]!==i?(N={status:e,transcript:o,interimTranscript:a,waveformData:i,isSupported:b,startRecording:j,stopRecording:y,cancelRecording:S},t[4]=a,t[5]=e,t[6]=o,t[7]=i,t[8]=N):N=t[8],N}function qr(t){return t.stop()}function Wr(){}function Hr(){return Array(je).fill(.05)}function Jr(t){const e=M.c(4),{data:n}=t;let o;e[0]!==n?(o=n.map(Zr),e[0]=n,e[1]=o):o=e[1];let V;return e[2]!==o?(V=s.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:o}),e[2]=o,e[3]=V):V=e[3],V}function Zr(t,e){return s.jsx("div",{className:"w-[2px] shrink-0 rounded-full bg-chart-2 transition-[height] duration-75 ease-out",style:{height:`${Math.max(4,Math.round(t*40))}px`}},e)}function Xr(t){return t.hasDraft?"send":t.isStreaming||t.isRunInProgress?"stop":"disabled"}function Se(t){const e=M.c(7),{message:n,icon:o}=t;let V;e[0]!==o?(V=o??s.jsx(bt,{size:14,className:"shrink-0"}),e[0]=o,e[1]=V):V=e[1];const a=n??"";let r;e[2]!==a?(r=s.jsx("span",{className:"text-sm",children:a}),e[2]=a,e[3]=r):r=e[3];let i;return e[4]!==V||e[5]!==r?(i=s.jsxs("div",{className:"flex w-full items-center gap-2 px-3 py-2.5 rounded-xl border border-border bg-muted/40 text-muted-foreground",children:[V,r]}),e[4]=V,e[5]=r,e[6]=i):i=e[6],i}function eV(t,e,n){const o=M.c(7),{editor:V}=At(),a=G(),[r,i]=L.useState(!1),l=L.useRef(0);let p,d;return o[0]!==n||o[1]!==V||o[2]!==e||o[3]!==t||o[4]!==a?(p=()=>{const c=f=>{f.dataTransfer?.types.includes("Files")&&(f.preventDefault(),l.current=l.current+1,i(!0))},u=f=>{f.preventDefault(),l.current=Math.max(0,l.current-1),l.current===0&&i(!1)},m=tV,h=f=>{if(f.preventDefault(),l.current=0,i(!1),n||!V||!t||!Je(t))return;const x=f.dataTransfer?.files;if(!x||x.length===0)return;const b=Array.from(x);(async()=>{let g=V.state.selection.from;for(const v of b)await Mt(V,t,v,g,e,a),g=V.state.selection.to})()};return window.addEventListener("dragenter",c),window.addEventListener("dragleave",u),window.addEventListener("dragover",m),window.addEventListener("drop",h),()=>{window.removeEventListener("dragenter",c),window.removeEventListener("dragleave",u),window.removeEventListener("dragover",m),window.removeEventListener("drop",h)}},d=[V,t,e,a,n],o[0]=n,o[1]=V,o[2]=e,o[3]=t,o[4]=a,o[5]=p,o[6]=d):(p=o[5],d=o[6]),L.useEffect(p,d),r}function tV(t){t.dataTransfer?.types.includes("Files")&&t.preventDefault()}function sV(t){const e=M.c(14),{selectedModel:n}=t,o=G();let V,a,r;if(e[0]!==n||e[1]!==o){const{parts:p}=Fn(n);e[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Os,{size:24}),e[5]=r):r=e[5],V="text-sm font-medium";let d;e[6]!==o?(d=c=>o(c),e[6]=o,e[7]=d):d=e[7],a=o("chat.input.dropFilesHere",{fileTypes:p.map(d).join(", ")}),e[0]=n,e[1]=o,e[2]=V,e[3]=a,e[4]=r}else V=e[2],a=e[3],r=e[4];let i;e[8]!==V||e[9]!==a?(i=s.jsx("span",{className:V,children:a}),e[8]=V,e[9]=a,e[10]=i):i=e[10];let l;return e[11]!==r||e[12]!==i?(l=s.jsxs(s.Fragment,{children:[r,i]}),e[11]=r,e[12]=i,e[13]=l):l=e[13],l}function nV(){const t=M.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(bt,{size:24}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.input.modelCannotReadAttachments"),t[1]=e,t[2]=o):o=t[2];let V;return t[3]!==o?(V=s.jsxs(s.Fragment,{children:[n,s.jsx("span",{className:"text-sm font-medium",children:o})]}),t[3]=o,t[4]=V):V=t[4],V}function oV(t){const e=M.c(11),{selectedModel:n,onUnsupportedFile:o,disabled:V}=t,a=eV(n,o,V);let r;e[0]!==n?(r=Je(n),e[0]=n,e[1]=r):r=e[1];const i=r,l=a?"opacity-100":"opacity-0 pointer-events-none",p=i?"border-primary/40 text-primary/70":"border-destructive/30 text-destructive/70";let d;e[2]!==l||e[3]!==p?(d=O("absolute inset-0 z-20 rounded-xl flex flex-col items-center justify-center gap-2 bg-muted border-2 border-dashed transition-opacity",l,p),e[2]=l,e[3]=p,e[4]=d):d=e[4];let c;e[5]!==n||e[6]!==i?(c=i?s.jsx(sV,{selectedModel:n}):s.jsx(nV,{}),e[5]=n,e[6]=i,e[7]=c):c=e[7];let u;return e[8]!==d||e[9]!==c?(u=s.jsx("div",{className:d,children:c}),e[8]=d,e[9]=c,e[10]=u):u=e[10],u}function ke(t){const e=M.c(14),{onClick:n,label:o,icon:V,colorClass:a,maxWidthClass:r}=t;let i;e[0]!==a?(i=O("flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium group min-w-0 shrink animate-in fade-in duration-200",a),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==r?(l=O("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:opacity-100",r),e[2]=r,e[3]=l):l=e[3];let p;e[4]!==o||e[5]!==l?(p=s.jsx("span",{className:l,children:o}),e[4]=o,e[5]=l,e[6]=p):p=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ye,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"}),e[7]=d):d=e[7];let c;return e[8]!==V||e[9]!==o||e[10]!==n||e[11]!==i||e[12]!==p?(c=s.jsxs("button",{type:"button",onClick:n,title:o,"aria-label":o,className:i,children:[V,p,d]}),e[8]=V,e[9]=o,e[10]=n,e[11]=i,e[12]=p,e[13]=c):c=e[13],c}function rV(){const t=M.c(6),e=Oe(),{org:n,locator:o}=we(),{create:V}=Vn();let a;return t[0]!==V||t[1]!==o||t[2]!==e||t[3]!==n.id||t[4]!==n.slug?(a=async r=>{const{tiptapDoc:i,virtualMcp:l,taskIntake:p}=r,d=p===void 0?!1:p,c=crypto.randomUUID(),u=l?.id??ze(n.id).id;ks(sessionStorage,o,c,{tiptapDoc:d&&i?Io(i):i});try{await V({id:c,virtual_mcp_id:u})}catch{}const m={autosend:Is};d&&(m.sidepanel=!0,m.mainpanel=!1),As(e,vs({org:n.slug,agentId:u,superAgentId:ze(n.id).id}),{search:()=>({...m,thread:c}),replace:!1})},t[0]=V,t[1]=o,t[2]=e,t[3]=n.id,t[4]=n.slug,t[5]=a):a=t[5],a}function pa({onOpenContextPanel:t,showConnectionsBanner:e=!1,homeTaskComposer:n=!1}){const o=G(),V=Xs(),a=en(),r=V?.messages??[],i=V?.isStreaming??!1,l=V?.isRunInProgress??!1,p=V?.stop??(()=>{}),d=a?.taskId??"",c=d||Ms,u=rV(),{selectedModel:m,selectedVirtualMcp:h,isModelsLoading:f,tiptapDocRef:x,imageModel:b,webSearchModel:g,deepResearchModel:v,chatMode:A,setChatMode:j}=_e(),{data:w}=xs.useSession(),y=w?.user?.id,{org:C,locator:S}=we(),[N,_]=gs(bs.homeTaskMode(S),!0),k=n&&N,P=ze(C.id).id,D=Ss(h?.id),R=Rs(D?.id).runtime==="cms",E=Jt(lo),[I,F]=L.useState(!1),{unsupportedFile:U,onUnsupportedFile:q,clearUnsupportedFile:$}=Gn(),z=Gr(),Q=L.useRef(void 0),B=async()=>{Q.current=ne;const K=await z.startRecording();X("chat_voice_started",{thread_id:d,outcome:K==="recording"?"started":K==="unsupported"?"unsupported":K==="permission-denied"?"permission_denied":"unknown"})},te=()=>{X("chat_voice_confirmed",{thread_id:d});const K=z.stopRecording();le.current?.syncVoiceText(Q.current,K),le.current?.focus()},Z=()=>{X("chat_voice_cancelled",{thread_id:d}),z.cancelRecording(),le.current?.restoreContent(Q.current)};L.useEffect(()=>{if(z.status!=="recording")return;const K=(z.transcript+(z.interimTranscript?" "+z.interimTranscript:"")).trim();le.current?.syncVoiceText(Q.current,K)},[z.transcript,z.interimTranscript,z.status]);const T=a?.activeTask??null,Y=T?.created_by,W=!!(y&&Y&&Y!==y),{data:J}=uo({enabled:W}),H=(J?.data?.members??[]).find(K=>K.userId===Y),se=H?.user?.name??H?.user?.email?.split("@")[0]??null,Ve=fo(),ae=tn({isDesktopApp:Ve,harnessId:T?.harness_id}),[ne,ie]=L.useState(()=>nt(sessionStorage,S,c)??void 0),re=K=>{ie(K),x.current=K,Ps(sessionStorage,S,c,K,{onQuotaExceeded:({docSizeBytes:de})=>{X("chat_draft_quota_exceeded",{thread_id:d||null,doc_size_bytes:de}),console.warn("[chat-draft] sessionStorage quota exceeded; draft not saved")}})},ce=L.useRef(d);if(ce.current!==d){ce.current=d;const K=nt(sessionStorage,S,c)??void 0;ie(K),x.current=K}const oe=[...r].reverse().find(K=>K.role==="assistant")?.metadata?.modelLimits?.contextWindow??m?.limits?.contextWindow,le=L.useRef(null),ve=L.useRef(!1),Ee=A==="plan",Ne=K=>{E(),X("chat_mode_changed",{from_mode:K,to_mode:"default",source:"pill_dismiss"}),j("default")};L.useEffect(()=>{const K=de=>{Ns(de)&&de.code==="KeyL"&&(de.preventDefault(),de.shiftKey&&j(A==="plan"?"default":"plan"),le.current?.focus())};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[A,j]);const Zt=sn(r),Ze=[...r].reverse().find(K=>K.role==="assistant"&&K.metadata?.usage)?.metadata?.usage?.contextTokens??0,Xt=Ce("chat"),es=Sn(),[ts,Xe]=L.useState(!1),[ss,et]=L.useState(!1),ns=!f&&!_s(ne),xe=Xr({hasDraft:ns,isStreaming:i,isRunInProgress:l}),Fe=xe==="send",ge=xe==="stop",tt=K=>{if(K?.preventDefault(),!Xt){Xe(!0);return}if(es){et(!0);return}if(xe==="send"&&ne){if(X("chat_message_sent",{thread_id:d||null,mode:A,model_id:m?.modelId??null,model_provider:m?.providerId??null,virtual_mcp_id:h?.id??null,submission:K?"button_or_enter":"programmatic"}),V){if(V.isSendInFlight()){ye.info(o("chat.input.stillSendingPreviousMessage"));return}V.sendMessage(ne)}else k&&X("task_report_submitted",{source:"home"}),u({tiptapDoc:ne,virtualMcp:k?null:h,taskIntake:k});Ds(sessionStorage,S,c),re(void 0)}else xe==="stop"&&(X("chat_message_stopped",{thread_id:d}),p())};if(W)return s.jsx(Se,{message:se?o("chat.input.readOnlyOthersChatNamed",{name:se}):o("chat.input.readOnlyOthersChat"),icon:se?s.jsx(co,{shape:"circle",size:"2xs",url:H?.user?.image??void 0,fallback:se.slice(0,2).toUpperCase()}):void 0});if(T?.metadata?.read_only)return s.jsx(Se,{message:o("chat.input.readOnlyThread")});if(ae)return s.jsx(Se,{message:o("chat.input.codingAgentRequiresDesktop")});if(R){if(!a)return s.jsx(Se,{message:o("chat.input.fastPreviewUnavailable")});const K=()=>{const de=a.createTask({runtime:"sandbox"});X("coding_session_started",{thread_id:de})};return s.jsxs("button",{type:"button",onClick:K,className:"group flex w-full items-center gap-3 rounded-2xl border border-border bg-background/60 px-4 py-3.5 text-left shadow-sm backdrop-blur-sm transition-colors hover:bg-background/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx(Us,{size:18,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:o("chat.fastPreview.startCodingSession")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:o("chat.fastPreview.chatNeedsSession")})]}),s.jsx(vt,{size:16,className:"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]})}return s.jsxs(s.Fragment,{children:[ts&&s.jsx(ct,{feature:"chat",onDismiss:()=>Xe(!1)}),ss&&s.jsx(ct,{feature:"chat",copy:{title:o("chat.input.allowanceExhaustedTitle")},onDismiss:()=>et(!1)}),s.jsx("div",{className:"flex flex-col w-full justify-end text-left",children:s.jsxs("div",{className:"relative rounded-2xl w-full flex flex-col",children:[e&&s.jsx("div",{className:"absolute inset-0 rounded-2xl pointer-events-none bg-muted/50"}),V&&a&&s.jsx(Re,{}),V&&a&&d?s.jsx(Nr,{taskId:d}):null,s.jsx(qn,{tiptapDoc:ne,setTiptapDoc:re,disabled:z.status==="recording",enterToSubmit:!0,placeholder:o(k?"chat.input.taskPlaceholder":"chat.input.placeholder"),onSubmit:tt,suggestionOpenRef:ve,children:s.jsxs("form",{onSubmit:tt,className:O("w-full relative rounded-2xl min-h-[110px] md:min-h-[130px] flex flex-col bg-card dark:bg-muted card-shadow overflow-hidden"),children:[s.jsx(oV,{selectedModel:m,onUnsupportedFile:q,disabled:z.status==="recording"}),s.jsx("div",{className:"group/input relative flex flex-col gap-2 flex-1",children:s.jsx(Wn,{ref:le,disabled:z.status==="recording",virtualMcpId:h?.id??P,showFileUploader:!0,selectedModel:m,onUnsupportedFile:q,suggestionOpenRef:ve})}),s.jsx("div",{className:"@container/chat-bottom flex items-center justify-between p-2.5 gap-1",children:z.status==="recording"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1"}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.jsx(Jr,{data:z.waveformData.slice(0,28)}),s.jsx("button",{type:"button",onClick:Z,className:"flex items-center justify-center size-8 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","aria-label":o("chat.input.cancelRecording"),children:s.jsx(Ye,{size:16})}),s.jsx("button",{type:"button",onClick:te,className:"flex items-center justify-center size-8 rounded-lg bg-foreground text-background hover:opacity-80 transition-opacity","aria-label":o("chat.input.useTranscription"),children:s.jsx(Qe,{size:16})})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[n&&s.jsx(ee,{type:"button",size:"sm",variant:N?"secondary":"ghost","aria-pressed":N,onClick:()=>_(!N),className:"h-8 rounded-lg",children:o("chat.input.taskMode")}),s.jsx($r,{disabled:!1,onOpenConnections:()=>{X("connections_dialog_opened",{source:"tools_popover",mode:"add"}),F(!0)},virtualMcpId:h?.id??P,selectedModel:m,isStreaming:i,onUnsupportedFile:q}),Ee&&s.jsx(ke,{onClick:()=>Ne("plan"),label:o("chat.input.planMode"),icon:s.jsx(wt,{size:14,className:"shrink-0"}),colorClass:"text-violet-600 dark:text-violet-400 hover:bg-violet-500/10",maxWidthClass:"@[320px]/chat-bottom:max-w-32"}),A==="gen-image"&&b&&s.jsx(ke,{onClick:()=>Ne("gen-image"),label:o("chat.input.createImage"),icon:s.jsx(St,{size:14,className:"shrink-0"}),colorClass:"text-pink-600 dark:text-pink-400 hover:bg-pink-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),A==="web-search"&&g&&s.jsx(ke,{onClick:()=>Ne("web-search"),label:o("chat.input.webSearch"),icon:s.jsx(Ct,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),A==="deep-research"&&v&&s.jsx(ke,{onClick:()=>Ne("deep-research"),label:o("chat.input.deepResearch"),icon:s.jsx(Nt,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),oe&&Ze>0&&s.jsx(xn,{usage:Zt,totalTokens:Ze,contextWindow:oe,onOpenContextPanel:t})]}),s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(Er,{}),z.isSupported&&s.jsx(ee,{type:"button",onClick:B,disabled:!1,variant:"ghost",size:"icon",className:O("size-8 rounded-lg transition-colors",z.status==="permission-denied"?"text-destructive hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-foreground"),title:z.status==="permission-denied"?o("chat.input.microphoneAccessDenied"):o("chat.input.voiceInput"),"aria-label":z.status==="permission-denied"?o("chat.input.microphoneAccessDenied"):o("chat.input.voiceInput"),children:s.jsx(Bs,{size:18})}),s.jsx(ee,{type:ge?"button":"submit",onClick:K=>{ge&&(K.preventDefault(),K.stopPropagation(),p())},variant:Fe||ge?"default":"ghost",size:k?"sm":"icon",disabled:!Fe&&!ge,className:O(k?"h-8 px-3 rounded-lg transition-all":"size-8 rounded-lg transition-all",!Fe&&!ge&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed"),title:o(xe==="stop"?i?"chat.input.stopGenerating":"chat.input.cancelRun":k?"chat.input.startTask":"chat.input.sendMessageEnter"),"aria-label":o(xe==="stop"?i?"chat.input.stopGenerating":"chat.input.cancelRun":k?"chat.input.startTask":"chat.input.sendMessage"),children:ge?s.jsx($s,{size:20}):s.jsxs(s.Fragment,{children:[k&&o("chat.input.startTask"),s.jsx(jt,{size:20})]})})]})]})})]})},d),n&&k&&s.jsx("p",{className:"px-3 pt-3 text-left text-xs text-muted-foreground",children:o("chat.input.taskHint")}),e&&s.jsx(Yr,{onClick:()=>{X("connections_banner_clicked",{source:"home_chat_input"}),X("connections_dialog_opened",{source:"home_banner",mode:"add"}),F(!0)}})]})}),s.jsx(po,{mode:"browse",open:I,onOpenChange:F,defaultTab:"all"}),s.jsx(Hn,{info:U,onClose:$})]})}export{pa as C,da as H,pr as T,fr as a,ua as u};
@@ -1 +0,0 @@
1
- import{c as Y,r as h,b as le,j as b,t as V,F as ct,B as ut,e0 as dt,e1 as Ke,e2 as ft,e3 as z,e4 as pe,aw as mt,e5 as pt,e6 as ge,e7 as gt,e8 as ht,e9 as vt,ea as bt,eb as xt,ec as yt,ed as wt,ee as St,l as Ue,h as Rt,n as qe,M as Be,K as ce,o as J,ef as Qe,cE as Ee,eg as oe}from"./index-Dc7hzqoi.js";import{u as Et,S as Ct,a as It,b as Pt,s as kt}from"./hooks-BoX5BC-f.js";import{f as Tt,h as Ft,j as Nt,i as se,k as _t,P as Ce,l as At,c as Mt,u as Dt,n as jt,d as Lt,e as Ot,F as $t,s as Kt,b as Ut}from"./index-DiULBiX9.js";import{d as qt,h as Bt,c as Qt,b as Ht,D as Vt}from"./dialog-llvhXw2o.js";import{aE as Wt,A as zt}from"./agent-icon-CczrFEe7.js";import"./chat-context-tZCX_cqt.js";import{m as Yt,i as Xt,a as Gt}from"./decopilot-BvepxP_-.js";import{u as He}from"./use-mcp-client-e_hCatGm.js";import{b as Jt}from"./use-virtual-mcp-DkK7ErtB.js";import{g as ue,d as Zt,s as Ve}from"./gateway-client-BuiOykcN.js";import{g as en}from"./use-project-scope-DU0-JxYr.js";import{l as Ie,g as We}from"./use-mcp-prompts-DJRXjL4_.js";import{f as tn,a as nn}from"./use-org-fs-Du-ErRPs.js";async function rn(t,e,n,r,o,s){if(!Yt(e)){V.error("Selected model does not support file uploads");return}const i=n.type||"application/octet-stream";if(!Xt(i,e)){const c=Gt(e).parts.map(f=>s(f)).join(", "),u=e?.title??"This model";o?o({fileName:n.name,modelName:u,accepted:c}):V.error(`"${n.name}" can't be attached`,{description:`${u} accepts ${c}.`});return}const a=10*1024*1024;if(n.size>a){V.error(`File "${n.name}" exceeds 10MB limit`);return}try{const c=new FileReader,u=new Promise((l,d)=>{c.onload=()=>{const g=c.result;if(typeof g!="string"){d(new Error("Failed to read file as data URL"));return}const m=g.includes(",")?g.split(",")[1]??g:g;l(m)},c.onerror=d});c.readAsDataURL(n);const f=await u,p={id:crypto.randomUUID(),name:n.name,mimeType:n.type||"application/octet-stream",size:n.size,data:f};Tt(t,{from:r,to:r},p)}catch(c){console.error("Failed to process file:",c),V.error(`Failed to load file "${n.name}"`)}}function on(t){const e=Y.c(9),{editor:n,selectedModel:r,onUnsupportedFile:o}=t,s=le(),i=h.useRef(an);let a,c;e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==s?(a=()=>{i.current=async(p,l)=>{await rn(n,r,p,l,o,s)}},c=[n,r,o,s],e[0]=n,e[1]=o,e[2]=r,e[3]=s,e[4]=a,e[5]=c):(a=e[4],c=e[5]),h.useEffect(a,c);let u,f;return e[6]!==n?(u=()=>{if(n?.isDestroyed)return;const p=new Ft("fileDropHandler");n.state.plugins.find(g=>g.spec.key===p)&&n.unregisterPlugin(p);const d=new Nt({key:p,props:{handleDrop:(g,m,v,y)=>{if(y)return!1;const x=m.dataTransfer?.files;if(!x||x.length===0)return!1;m.preventDefault();const w=g.posAtCoords({left:m.clientX,top:m.clientY});if(!w)return!1;const I=Array.from(x);return(async()=>{let N=w.pos;for(const T of I)await i.current?.(T,N),N=g.state.selection.to})(),!0},handlePaste:(g,m)=>{const v=m.clipboardData?.items;if(!v)return!1;const y=Array.from(v).filter(sn);return y.length===0?!1:(m.preventDefault(),(async()=>{let x=g.state.selection.from;for(const w of y){const I=w.getAsFile();I&&(await i.current?.(I,x),x=g.state.selection.to)}})(),!0)}}});return n.registerPlugin(d),()=>{n?.isDestroyed||n.unregisterPlugin(p)}},f=[n],e[6]=n,e[7]=u,e[8]=f):(u=e[7],f=e[8]),h.useEffect(u,f),null}function sn(t){return t.kind==="file"}function an(){return Promise.resolve()}function jr(t){const e=Y.c(43),{info:n,onClose:r}=t,o=le(),s=n!==null;let i;e[0]!==r?(i=A=>!A&&r(),e[0]=r,e[1]=i):i=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(251,191,36,0.35) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(244,114,182,0.25) 0%, transparent 100%)"],e[2]=a):a=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=b.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:a.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[3]=c):c=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=b.jsx("div",{className:"flex items-center justify-center size-9 rounded-lg bg-warning/15 text-warning",children:b.jsx(ct,{size:18})}),e[4]=u):u=e[4];let f;e[5]!==o?(f=o("chat.uploader.fileTypeNotSupported"),e[5]=o,e[6]=f):f=e[6];let p;e[7]!==f?(p=b.jsx(qt,{className:"text-xl font-semibold tracking-tight",children:f}),e[7]=f,e[8]=p):p=e[8];const l=n?.fileName;let d;e[9]!==l?(d=b.jsxs("span",{className:"font-medium text-foreground",children:["“",l,"”"]}),e[9]=l,e[10]=d):d=e[10];let g;e[11]!==o?(g=o("chat.uploader.cantAttachToChat"),e[11]=o,e[12]=g):g=e[12];let m;e[13]!==g||e[14]!==d?(m=b.jsxs(Bt,{className:"mt-1.5 text-sm leading-relaxed",children:[d," ",g]}),e[13]=g,e[14]=d,e[15]=m):m=e[15];let v;e[16]!==m||e[17]!==p?(v=b.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[c,b.jsxs(Qt,{className:"relative gap-4",children:[u,b.jsxs("div",{children:[p,m]})]})]}),e[16]=m,e[17]=p,e[18]=v):v=e[18];const y=n?.modelName??"";let x;e[19]!==o||e[20]!==y?(x=o("chat.uploader.accepts",{modelName:y}),e[19]=o,e[20]=y,e[21]=x):x=e[21];let w;e[22]!==x?(w=b.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground mb-2",children:x}),e[22]=x,e[23]=w):w=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=b.jsx(Wt,{size:14,className:"text-muted-foreground"}),e[24]=I):I=e[24];const N=n?.accepted;let T;e[25]!==N?(T=b.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground",children:[I,b.jsx("span",{className:"capitalize",children:N})]}),e[25]=N,e[26]=T):T=e[26];let S;e[27]!==w||e[28]!==T?(S=b.jsx("div",{className:"px-8 pt-3 pb-6 space-y-3",children:b.jsxs("div",{className:"rounded-xl border border-border p-4",children:[w,T]})}),e[27]=w,e[28]=T,e[29]=S):S=e[29];let R;e[30]!==o?(R=o("chat.uploader.gotIt"),e[30]=o,e[31]=R):R=e[31];let P;e[32]!==r||e[33]!==R?(P=b.jsx("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-end",children:b.jsx(ut,{onClick:r,children:R})}),e[32]=r,e[33]=R,e[34]=P):P=e[34];let F;e[35]!==v||e[36]!==S||e[37]!==P?(F=b.jsxs(Ht,{className:"sm:max-w-[480px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:ln,children:[v,S,P]}),e[35]=v,e[36]=S,e[37]=P,e[38]=F):F=e[38];let D;return e[39]!==s||e[40]!==i||e[41]!==F?(D=b.jsx(Vt,{open:s,onOpenChange:i,children:F}),e[39]=s,e[40]=i,e[41]=F,e[42]=D):D=e[42],D}function ln(t){return t.preventDefault()}function Lr(){const t=Y.c(3),[e,n]=h.useState(null);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>n(null),t[0]=r):r=t[0];let o;return t[1]!==e?(o={unsupportedFile:e,onUnsupportedFile:n,clearUnsupportedFile:r},t[1]=e,t[2]=o):o=t[2],o}var cn=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],xe=cn.join(","),ze=typeof Element>"u",ie=ze?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,fe=!ze&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},me=function(e,n){var r;n===void 0&&(n=!0);var o=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=o===""||o==="true",i=s||n&&e&&(typeof e.closest=="function"?e.closest("[inert]"):me(e.parentNode));return i},un=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},dn=function(e,n,r){if(me(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(xe));return n&&ie.call(e,xe)&&o.unshift(e),o=o.filter(r),o},ye=function(e,n,r){for(var o=[],s=Array.from(e);s.length;){var i=s.shift();if(!me(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),c=a.length?a:i.children,u=ye(c,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:i,candidates:u})}else{var f=ie.call(i,xe);f&&r.filter(i)&&(n||!e.includes(i))&&o.push(i);var p=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),l=!me(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(p&&l){var d=ye(p===!0?i.children:p.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:i,candidates:d})}else s.unshift.apply(s,i.children)}}return o},Ye=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Xe=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||un(e))&&!Ye(e)?0:e.tabIndex},fn=function(e,n){var r=Xe(e);return r<0&&n&&!Ye(e)?0:r},mn=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},Ge=function(e){return e.tagName==="INPUT"},pn=function(e){return Ge(e)&&e.type==="hidden"},gn=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},hn=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},vn=function(e){if(!e.name)return!0;var n=e.form||fe(e),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(e.name));else try{o=r(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=hn(o,e.form);return!s||s===e},bn=function(e){return Ge(e)&&e.type==="radio"},xn=function(e){return bn(e)&&!vn(e)},yn=function(e){var n,r=e&&fe(e),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==e){var i,a,c;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||e!=null&&(c=e.ownerDocument)!==null&&c!==void 0&&c.contains(e));!s&&o;){var u,f,p;r=fe(o),o=(u=r)===null||u===void 0?void 0:u.host,s=!!((f=o)!==null&&f!==void 0&&(p=f.ownerDocument)!==null&&p!==void 0&&p.contains(o))}}return s},Pe=function(e){var n=e.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},wn=function(e,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var s=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(e).visibility==="hidden")return!0;var i=ie.call(e,"details>summary:first-of-type"),a=i?e.parentElement:e;if(ie.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var c=e;e;){var u=e.parentElement,f=fe(e);if(u&&!u.shadowRoot&&o(u)===!0)return Pe(e);e.assignedSlot?e=e.assignedSlot:!u&&f!==e.ownerDocument?e=f.host:e=u}e=c}if(yn(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Pe(e);return!1},Sn=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return ie.call(n,"fieldset[disabled] *")?!0:!o.contains(e)}return!0}n=n.parentElement}return!1},Rn=function(e,n){return!(n.disabled||pn(n)||wn(n,e)||gn(n)||Sn(n))},ke=function(e,n){return!(xn(n)||Xe(n)<0||!Rn(e,n))},En=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Je=function(e){var n=[],r=[];return e.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,c=fn(a,i),u=i?Je(o.candidates):a;c===0?i?n.push.apply(n,u):n.push(a):r.push({documentOrder:s,tabIndex:c,item:o,isScope:i,content:u})}),r.sort(mn).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Ze=function(e,n){n=n||{};var r;return n.getShadowRoot?r=ye([e],n.includeContainer,{filter:ke.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:En}):r=dn(e,n.includeContainer,ke.bind(null,n)),Je(r)};function Cn(){return/apple/i.test(navigator.vendor)}const Te="data-floating-ui-focusable";function In(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function we(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&dt(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function re(t){return"composedPath"in t?t.composedPath()[0]:t.target}function he(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function Pn(t){return t.matches("html,body")}function ae(t){return t?.ownerDocument||document}function kn(t){return t?t.hasAttribute(Te)?t:t.querySelector("["+Te+"]")||t:null}function de(t,e,n){return n===void 0&&(n=!0),t.filter(o=>{var s;return o.parentId===e&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...de(t,o.id,n)])}function Tn(t){return"nativeEvent"in t}var Fn=typeof document<"u",Nn=function(){},Z=Fn?h.useLayoutEffect:Nn;const _n={...Ke},An=_n.useInsertionEffect,Mn=An||(t=>t());function te(t){const e=h.useRef(()=>{});return Mn(()=>{e.current=t}),h.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])}const et=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function tt(t,e){const n=Ze(t,et()),r=n.length;if(r===0)return;const o=In(ae(t)),s=n.indexOf(o),i=s===-1?e===1?0:r-1:s+e;return n[i]}function Dn(t){return tt(ae(t).body,1)||t}function jn(t){return tt(ae(t).body,-1)||t}function ve(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!we(n,r)}function Ln(t){Ze(t,et()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Fe(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const On="data-floating-ui-focusable",Ne="active",_e="selected",$n={...Ke};let Ae=!1,Kn=0;const Me=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Kn++;function Un(){const[t,e]=h.useState(()=>Ae?Me():void 0);return Z(()=>{t==null&&e(Me())},[]),h.useEffect(()=>{Ae=!0},[]),t}const qn=$n.useId,Se=qn||Un;function Bn(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(o=>o(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var r;(r=t.get(e))==null||r.delete(n)}}}const Qn=h.createContext(null),Hn=h.createContext(null),nt=()=>{var t;return((t=h.useContext(Qn))==null?void 0:t.id)||null},rt=()=>h.useContext(Hn);function Re(t){return"data-floating-ui-"+t}const Vn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},De=h.forwardRef(function(e,n){const[r,o]=h.useState();Z(()=>{Cn()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Re("focus-guard")]:"",style:Vn};return b.jsx("span",{...e,...s})}),Wn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},ot=h.createContext(null),je=Re("portal");function zn(t){t===void 0&&(t={});const{id:e,root:n}=t,r=Se(),o=Xn(),[s,i]=h.useState(null),a=h.useRef(null);return Z(()=>()=>{s?.remove(),queueMicrotask(()=>{a.current=null})},[s]),Z(()=>{if(!r||a.current)return;const c=e?document.getElementById(e):null;if(!c)return;const u=document.createElement("div");u.id=r,u.setAttribute(je,""),c.appendChild(u),a.current=u,i(u)},[e,r]),Z(()=>{if(n===null||!r||a.current)return;let c=n||o?.portalNode;c&&!bt(c)&&(c=c.current),c=c||document.body;let u=null;e&&(u=document.createElement("div"),u.id=e,c.appendChild(u));const f=document.createElement("div");f.id=r,f.setAttribute(je,""),c=u||c,c.appendChild(f),a.current=f,i(f)},[e,n,r,o]),s}function Yn(t){const{children:e,id:n,root:r,preserveTabOrder:o=!0}=t,s=zn({id:n,root:r}),[i,a]=h.useState(null),c=h.useRef(null),u=h.useRef(null),f=h.useRef(null),p=h.useRef(null),l=i?.modal,d=i?.open,g=!!i&&!i.modal&&i.open&&o&&!!(r||s);return h.useEffect(()=>{if(!s||!o||l)return;function m(v){s&&ve(v)&&(v.type==="focusin"?Fe:Ln)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,o,l]),h.useEffect(()=>{s&&(d||Fe(s))},[d,s]),b.jsxs(ot.Provider,{value:h.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:p,portalNode:s,setFocusManagerState:a}),[o,s]),children:[g&&s&&b.jsx(De,{"data-type":"outside",ref:c,onFocus:m=>{if(ve(m,s)){var v;(v=f.current)==null||v.focus()}else{const y=i?i.domReference:null,x=jn(y);x?.focus()}}}),g&&s&&b.jsx("span",{"aria-owns":s.id,style:Wn}),s&&mt.createPortal(e,s),g&&s&&b.jsx(De,{"data-type":"outside",ref:u,onFocus:m=>{if(ve(m,s)){var v;(v=p.current)==null||v.focus()}else{const y=i?i.domReference:null,x=Dn(y);x?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,m.nativeEvent,"focus-out")}}})]})}const Xn=()=>h.useContext(ot),Gn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Jn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Le=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t?.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t?.outsidePress)!=null?n:!0}};function Zn(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=t,{enabled:i=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:f=!1,referencePressEvent:p="pointerdown",ancestorScroll:l=!1,bubbles:d,capture:g}=e,m=rt(),v=te(typeof c=="function"?c:()=>!1),y=typeof c=="function"?v:c,x=h.useRef(!1),{escapeKey:w,outsidePress:I}=Le(d),{escapeKey:N,outsidePress:T}=Le(g),S=h.useRef(!1),R=te(C=>{var M;if(!n||!i||!a||C.key!=="Escape"||S.current)return;const E=(M=s.current.floatingContext)==null?void 0:M.nodeId,$=m?de(m.nodesRef.current,E):[];if(!w&&(C.stopPropagation(),$.length>0)){let k=!0;if($.forEach(L=>{var O;if((O=L.context)!=null&&O.open&&!L.context.dataRef.current.__escapeKeyBubbles){k=!1;return}}),!k)return}r(!1,Tn(C)?C.nativeEvent:C,"escape-key")}),P=te(C=>{var M;const E=()=>{var $;R(C),($=re(C))==null||$.removeEventListener("keydown",E)};(M=re(C))==null||M.addEventListener("keydown",E)}),F=te(C=>{var M;const E=s.current.insideReactTree;s.current.insideReactTree=!1;const $=x.current;if(x.current=!1,u==="click"&&$||E||typeof y=="function"&&!y(C))return;const k=re(C),L="["+Re("inert")+"]",O=ae(o.floating).querySelectorAll(L);let H=z(k)?k:null;for(;H&&!ge(H);){const j=gt(H);if(ge(j)||!z(j))break;H=j}if(O.length&&z(k)&&!Pn(k)&&!we(k,o.floating)&&Array.from(O).every(j=>!we(H,j)))return;if(ht(k)&&Q){const j=ge(k),K=vt(k),W=/auto|scroll/,q=j||W.test(K.overflowX),U=j||W.test(K.overflowY),ee=q&&k.clientWidth>0&&k.scrollWidth>k.clientWidth,B=U&&k.clientHeight>0&&k.scrollHeight>k.clientHeight,ne=K.direction==="rtl",at=B&&(ne?C.offsetX<=k.offsetWidth-k.clientWidth:C.offsetX>k.clientWidth),lt=ee&&C.offsetY>k.clientHeight;if(at||lt)return}const G=(M=s.current.floatingContext)==null?void 0:M.nodeId,X=m&&de(m.nodesRef.current,G).some(j=>{var K;return he(C,(K=j.context)==null?void 0:K.elements.floating)});if(he(C,o.floating)||he(C,o.domReference)||X)return;const _=m?de(m.nodesRef.current,G):[];if(_.length>0){let j=!0;if(_.forEach(K=>{var W;if((W=K.context)!=null&&W.open&&!K.context.dataRef.current.__outsidePressBubbles){j=!1;return}}),!j)return}r(!1,C,"outside-press")}),D=te(C=>{var M;const E=()=>{var $;F(C),($=re(C))==null||$.removeEventListener(u,E)};(M=re(C))==null||M.addEventListener(u,E)});h.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=w,s.current.__outsidePressBubbles=I;let C=-1;function M(O){r(!1,O,"ancestor-scroll")}function E(){window.clearTimeout(C),S.current=!0}function $(){C=window.setTimeout(()=>{S.current=!1},pt()?5:0)}const k=ae(o.floating);a&&(k.addEventListener("keydown",N?P:R,N),k.addEventListener("compositionstart",E),k.addEventListener("compositionend",$)),y&&k.addEventListener(u,T?D:F,T);let L=[];return l&&(z(o.domReference)&&(L=pe(o.domReference)),z(o.floating)&&(L=L.concat(pe(o.floating))),!z(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(pe(o.reference.contextElement)))),L=L.filter(O=>{var H;return O!==((H=k.defaultView)==null?void 0:H.visualViewport)}),L.forEach(O=>{O.addEventListener("scroll",M,{passive:!0})}),()=>{a&&(k.removeEventListener("keydown",N?P:R,N),k.removeEventListener("compositionstart",E),k.removeEventListener("compositionend",$)),y&&k.removeEventListener(u,T?D:F,T),L.forEach(O=>{O.removeEventListener("scroll",M)}),window.clearTimeout(C)}},[s,o,a,y,u,n,r,l,i,w,I,R,N,P,F,T,D]),h.useEffect(()=>{s.current.insideReactTree=!1},[s,y,u]);const A=h.useMemo(()=>({onKeyDown:R,...f&&{[Gn[p]]:C=>{r(!1,C.nativeEvent,"reference-press")},...p!=="click"&&{onClick(C){r(!1,C.nativeEvent,"reference-press")}}}}),[R,r,f,p]),Q=h.useMemo(()=>{function C(M){M.button===0&&(x.current=!0)}return{onKeyDown:R,onMouseDown:C,onMouseUp:C,[Jn[u]]:()=>{s.current.insideReactTree=!0}}},[R,u,s]);return h.useMemo(()=>i?{reference:A,floating:Q}:{},[i,A,Q])}function er(t){const{open:e=!1,onOpenChange:n,elements:r}=t,o=Se(),s=h.useRef({}),[i]=h.useState(()=>Bn()),a=nt()!=null,[c,u]=h.useState(r.reference),f=te((d,g,m)=>{s.current.openEvent=d?g:void 0,i.emit("openchange",{open:d,event:g,reason:m,nested:a}),n?.(d,g,m)}),p=h.useMemo(()=>({setPositionReference:u}),[]),l=h.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return h.useMemo(()=>({dataRef:s,open:e,onOpenChange:f,elements:l,events:i,floatingId:o,refs:p}),[e,f,l,i,o,p])}function tr(t){t===void 0&&(t={});const{nodeId:e}=t,n=er({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,o=r.elements,[s,i]=h.useState(null),[a,c]=h.useState(null),f=o?.domReference||s,p=h.useRef(null),l=rt();Z(()=>{f&&(p.current=f)},[f]);const d=ft({...t,elements:{...o,...a&&{reference:a}}}),g=h.useCallback(w=>{const I=z(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;c(I),d.refs.setReference(I)},[d.refs]),m=h.useCallback(w=>{(z(w)||w===null)&&(p.current=w,i(w)),(z(d.refs.reference.current)||d.refs.reference.current===null||w!==null&&!z(w))&&d.refs.setReference(w)},[d.refs]),v=h.useMemo(()=>({...d.refs,setReference:m,setPositionReference:g,domReference:p}),[d.refs,m,g]),y=h.useMemo(()=>({...d.elements,domReference:f}),[d.elements,f]),x=h.useMemo(()=>({...d,...r,refs:v,elements:y,nodeId:e}),[d,v,y,e,r]);return Z(()=>{r.dataRef.current.floatingContext=x;const w=l?.nodesRef.current.find(I=>I.id===e);w&&(w.context=x)}),h.useMemo(()=>({...d,context:x,refs:v,elements:y}),[d,v,y,x])}function be(t,e,n){const r=new Map,o=n==="item";let s=t;if(o&&t){const{[Ne]:i,[_e]:a,...c}=t;s=c}return{...n==="floating"&&{tabIndex:-1,[On]:""},...s,...e.map(i=>{const a=i?i[n]:null;return typeof a=="function"?t?a(t):null:a}).concat(t).reduce((i,a)=>(a&&Object.entries(a).forEach(c=>{let[u,f]=c;if(!(o&&[Ne,_e].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof f=="function"){var p;(p=r.get(u))==null||p.push(f),i[u]=function(){for(var l,d=arguments.length,g=new Array(d),m=0;m<d;m++)g[m]=arguments[m];return(l=r.get(u))==null?void 0:l.map(v=>v(...g)).find(v=>v!==void 0)}}}else i[u]=f}),i),{})}}function nr(t){t===void 0&&(t=[]);const e=t.map(a=>a?.reference),n=t.map(a=>a?.floating),r=t.map(a=>a?.item),o=h.useCallback(a=>be(a,t,"reference"),e),s=h.useCallback(a=>be(a,t,"floating"),n),i=h.useCallback(a=>be(a,t,"item"),r);return h.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const rr=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function or(t,e){var n,r;e===void 0&&(e={});const{open:o,elements:s,floatingId:i}=t,{enabled:a=!0,role:c="dialog"}=e,u=Se(),f=((n=s.domReference)==null?void 0:n.id)||u,p=h.useMemo(()=>{var x;return((x=kn(s.floating))==null?void 0:x.id)||i},[s.floating,i]),l=(r=rr.get(c))!=null?r:c,g=nt()!=null,m=h.useMemo(()=>l==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:o?p:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":l==="alertdialog"?"dialog":l,"aria-controls":o?p:void 0,...l==="listbox"&&{role:"combobox"},...l==="menu"&&{id:f},...l==="menu"&&g&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[l,p,g,o,f,c]),v=h.useMemo(()=>{const x={id:p,...l&&{role:l}};return l==="tooltip"||c==="label"?x:{...x,...l==="menu"&&{"aria-labelledby":f}}},[l,p,f,c]),y=h.useCallback(x=>{let{active:w,selected:I}=x;const N={role:"option",...w&&{id:p+"-fui-option"}};switch(c){case"select":case"combobox":return{...N,"aria-selected":I}}return{}},[p,c]);return h.useMemo(()=>a?{reference:m,floating:v,item:y}:{},[a,m,v,y])}function sr({children:t}){const{state:e,dispatch:n}=It(),{open:r,element:o}=e,s=()=>{n({type:"ON_EXIT"})},{refs:i,floatingStyles:a,context:c}=tr({placement:"bottom-start",open:r,onOpenChange:l=>{l||s()},elements:{reference:o},middleware:[xt(10),yt(),wt()],whileElementsMounted:St}),u=Zn(c,{outsidePress:l=>!(l.target instanceof Element&&l.target.closest(".ProseMirror"))}),f=or(c,{role:"listbox"}),{getFloatingProps:p}=nr([u,f]);return r?b.jsx(Yn,{children:b.jsx("div",{ref:i.setFloating,style:a,...p(),className:"z-50 w-auto min-w-[360px] max-w-[520px] rounded-lg border bg-popover p-0 text-popover-foreground shadow-md outline-hidden overflow-hidden",children:t})}):null}const ir=t=>{const e=Y.c(29),{item:n,isSelected:r,onSelect:o,isLoading:s,ref:i}=t;let a;if(e[0]!==n){const T=ue(n._meta);a=n.title||Zt(n.name,T),e[0]=n,e[1]=a}else a=e[1];const c=a,u=n.description||null,f=n.icon,p=r&&"bg-accent text-accent-foreground",l=s&&"pointer-events-none opacity-50";let d;e[2]!==p||e[3]!==l?(d=Ue("relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","hover:bg-accent hover:text-accent-foreground","focus:bg-accent focus:text-accent-foreground",p,l),e[2]=p,e[3]=l,e[4]=d):d=e[4];let g;e[5]!==f||e[6]!==c?(g=f!==void 0&&b.jsx(zt,{icon:f,name:c,size:"xs",className:"mr-2"}),e[5]=f,e[6]=c,e[7]=g):g=e[7];let m;e[8]!==c?(m=b.jsx("span",{className:"font-medium flex items-center truncate capitalize",children:c}),e[8]=c,e[9]=m):m=e[9];let v;e[10]!==s?(v=s&&b.jsx(Rt,{size:"xs"}),e[10]=s,e[11]=v):v=e[11];let y;e[12]!==m||e[13]!==v?(y=b.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m,v]}),e[12]=m,e[13]=v,e[14]=y):y=e[14];let x;e[15]!==u?(x=u&&b.jsx("div",{className:"text-xs text-muted-foreground line-clamp-1",children:u}),e[15]=u,e[16]=x):x=e[16];let w;e[17]!==y||e[18]!==x?(w=b.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[y,x]}),e[17]=y,e[18]=x,e[19]=w):w=e[19];let I;e[20]!==n.drillable?(I=n.drillable&&b.jsx("kbd",{className:"shrink-0 ml-2 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground bg-muted border border-border rounded",children:"↵"}),e[20]=n.drillable,e[21]=I):I=e[21];let N;return e[22]!==o||e[23]!==i||e[24]!==w||e[25]!==I||e[26]!==d||e[27]!==g?(N=b.jsxs("div",{ref:i,onClick:o,className:d,children:[g,w,I]}),e[22]=o,e[23]=i,e[24]=w,e[25]=I,e[26]=d,e[27]=g,e[28]=N):N=e[28],N},ar=t=>{const e=Y.c(21),{editor:n,queryKey:r,queryFn:o,onSelect:s}=t,i=le();let a;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==r?(a={editor:n,queryKey:r,queryFn:o,onSelect:s},e[0]=n,e[1]=s,e[2]=o,e[3]=r,e[4]=a):a=e[4];const{items:c,selectedIndex:u,onSelect:f,selectedItem:p}=Pt(a);if(!c.length){let m;e[5]!==i?(m=i("chat.mention.noItemsFound"),e[5]=i,e[6]=m):m=e[6];let v;return e[7]!==m?(v=b.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md border shadow-md p-3 text-sm",children:m}),e[7]=m,e[8]=v):v=e[8],v}let l;e[9]===Symbol.for("react.memo_cache_sentinel")?(l={maxHeight:"min(320px, var(--radix-popover-content-available-height, 320px))"},e[9]=l):l=e[9];let d;if(e[10]!==f||e[11]!==c||e[12]!==u||e[13]!==p?.name){let m;e[15]!==f||e[16]!==u||e[17]!==p?.name?(m=(v,y)=>b.jsx(ir,{item:v,isSelected:y===u,ref:y===u?ur:void 0,onSelect:()=>f(v,y),isLoading:p?.name===v.name},`${v.kind??"item"}:${v.name}`),e[15]=f,e[16]=u,e[17]=p?.name,e[18]=m):m=e[18],d=c.map(m),e[10]=f,e[11]=c,e[12]=u,e[13]=p?.name,e[14]=d}else d=e[14];let g;return e[19]!==d?(g=b.jsx("div",{className:"min-w-[360px] max-w-[520px] bg-popover text-popover-foreground rounded-md overflow-y-auto",style:l,children:b.jsx("div",{className:"p-1",children:d})}),e[19]=d,e[20]=g):g=e[20],g};function lr(){const t=Y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=b.jsx("div",{className:"p-1",children:[...Array(3)].map(cr)}),t[0]=e):e=t[0],e}function cr(t,e){return b.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 animate-pulse",children:[b.jsx("div",{className:"h-4 w-24 bg-muted rounded"}),b.jsx("div",{className:"h-3 w-32 bg-muted rounded"})]},e)}function st(t){const e=Y.c(18),{editor:n,char:r,pluginKey:o,queryKey:s,queryFn:i,onSelect:a,allow:c,onOpenChange:u}=t;let f;e[0]!==c||e[1]!==r||e[2]!==n||e[3]!==u||e[4]!==o?(f={editor:n,char:r,pluginKey:o,allow:c,onOpenChange:u},e[0]=c,e[1]=r,e[2]=n,e[3]=u,e[4]=o,e[5]=f):f=e[5];const{state:p,dispatch:l}=Et(f);let d;e[6]!==l||e[7]!==p?(d={state:p,dispatch:l},e[6]=l,e[7]=p,e[8]=d):d=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=b.jsx(lr,{}),e[9]=g):g=e[9];let m;e[10]!==n||e[11]!==a||e[12]!==i||e[13]!==s?(m=b.jsx(sr,{children:b.jsx(h.Suspense,{fallback:g,children:b.jsx(ar,{editor:n,queryKey:s,queryFn:i,onSelect:a})})}),e[10]=n,e[11]=a,e[12]=i,e[13]=s,e[14]=m):m=e[14];let v;return e[15]!==d||e[16]!==m?(v=b.jsx(Ct.Provider,{value:d,children:m}),e[15]=d,e[16]=m,e[17]=v):v=e[17],v}function ur(t){t&&t.scrollIntoView({block:"center",behavior:"smooth"})}const dr=t=>{const e=Y.c(53),{editor:n,virtualMcpId:r,suggestionOpenRef:o}=t,s=le(),i=qe(),{org:a}=Be(),c=Jt();let u;e[0]!==c?(u=en(c),e[0]=c,e[1]=u):u=e[1];const f=u;let p;e[2]!==a.id||e[3]!==a.slug||e[4]!==r?(p={connectionId:r,orgId:a.id,orgSlug:a.slug},e[2]=a.id,e[3]=a.slug,e[4]=r,e[5]=p):p=e[5];const l=He(p);let d;e[6]!==a.id||e[7]!==r?(d=ce.virtualMcpResources(r,a.id),e[6]=a.id,e[7]=r,e[8]=d):d=e[8];const g=d,[m,v]=h.useState("categories");let y;e[9]!==m?(y=()=>m,e[9]=m,e[10]=y):y=e[10];const x=h.useEffectEvent(y),w=h.useRef(null),I=h.useRef(!1),N=r??"default";let T;e[11]!==m||e[12]!==a.id||e[13]!==N?(T=["at-mention",a.id,N,m],e[11]=m,e[12]=a.id,e[13]=N,e[14]=T):T=e[14];const S=T;let R;e[15]!==s?(R=s("chat.mentionAt.agentsTitle"),e[15]=s,e[16]=R):R=e[16];let P;e[17]!==s?(P=s("chat.mentionAt.agentsDescription"),e[17]=s,e[18]=P):P=e[18];let F;e[19]!==R||e[20]!==P?(F={name:"agents",title:R,description:P,kind:"category",drillable:!0},e[19]=R,e[20]=P,e[21]=F):F=e[21];let D;e[22]!==s?(D=s("chat.mentionAt.resourcesTitle"),e[22]=s,e[23]=D):D=e[23];let A;e[24]!==s?(A=s("chat.mentionAt.resourcesDescription"),e[24]=s,e[25]=A):A=e[25];let Q;e[26]!==D||e[27]!==A?(Q={name:"resources",title:D,description:A,kind:"category",drillable:!0},e[26]=D,e[27]=A,e[28]=Q):Q=e[28];let C;e[29]!==Q||e[30]!==F?(C=[F,Q],e[29]=Q,e[30]=F,e[31]=C):C=e[31];const M=C;let E;e[32]!==l||e[33]!==n||e[34]!==s?(E=async X=>{const{item:_,range:j}=X;if(J("chat_picker_item_selected",{picker:"@",item_kind:_.kind,item_name:_.name}),_.kind!=="category"&&(I.current=!0),_.kind==="category")return v(_.name==="agents"?"agents":"resources"),!1;if(_.kind==="agent"&&_.agentId){se(n,j,{id:_.agentId,name:_.name,metadata:{agentId:_.agentId,title:_.name},char:"@"}),v("categories");return}if(_.kind==="resource"&&_.uri&&l){try{const K=await Qe(l,_.uri);se(n,j,{id:_.uri,name:_.uri,metadata:K.contents,char:"@"})}catch(K){console.error("[at-mention] Failed to fetch resource:",K),V.error(s("chat.mentionAt.failedToLoadResource"))}v("categories");return}},e[32]=l,e[33]=n,e[34]=s,e[35]=E):E=e[35];const $=E;let k;e[36]!==c||e[37]!==M||e[38]!==l||e[39]!==f||e[40]!==x||e[41]!==i||e[42]!==g||e[43]!==r?(k=async X=>{const{query:_}=X,j=x();if(j==="categories"){if(!_.trim())return M;const q=_.toLowerCase(),U=c.filter(B=>B.status==="active"&&(!B.id||!Ee(B.id))&&!f.has(B.id)&&B.id!==r&&(B.title.toLowerCase().includes(q)||B.description?.toLowerCase().includes(q))).map(fr),ee=await(async()=>{if(!l)return[];let B=i.getQueryData(g);return B||(B=await i.fetchQuery({queryKey:g,queryFn:()=>oe(l),staleTime:6e4})),(B?.resources??[]).filter(ne=>ne.uri.toLowerCase().includes(q)||ne.name?.toLowerCase().includes(q)||ne.description?.toLowerCase().includes(q)).map(mr)})();return[...U,...ee]}if(j==="agents"){let q=c.filter(U=>U.status==="active"&&(!U.id||!Ee(U.id))&&!f.has(U.id)&&U.id!==r);if(_.trim()){const U=_.toLowerCase();q=q.filter(ee=>ee.title.toLowerCase().includes(U)||ee.description?.toLowerCase().includes(U))}return q.map(pr)}if(!l)return[];let K=i.getQueryData(g);K?i.fetchQuery({queryKey:g,queryFn:()=>oe(l),staleTime:6e4}).catch(gr):K=await i.fetchQuery({queryKey:g,queryFn:()=>oe(l),staleTime:6e4});let W=K?.resources??[];if(_.trim()){const q=_.toLowerCase();W=W.filter(U=>U.uri.toLowerCase().includes(q)||U.name?.toLowerCase().includes(q)||U.description?.toLowerCase().includes(q))}return W.map(hr)},e[36]=c,e[37]=M,e[38]=l,e[39]=f,e[40]=x,e[41]=i,e[42]=g,e[43]=r,e[44]=k):k=e[44];const L=k;let O;e[45]!==o?(O=X=>{if(o&&(o.current=X),X)w.current=Date.now(),I.current=!1,J("chat_picker_opened",{picker:"@"});else{const _=w.current;J("chat_picker_closed",{picker:"@",outcome:I.current?"selected":"dismissed",duration_ms:_?Date.now()-_:null}),w.current=null,v("categories")}},e[45]=o,e[46]=O):O=e[46];const H=O;let G;return e[47]!==n||e[48]!==L||e[49]!==$||e[50]!==H||e[51]!==S?(G=b.jsx(st,{editor:n,char:"@",pluginKey:"atDropdownMenu",queryKey:S,queryFn:L,onSelect:$,onOpenChange:H}),e[47]=n,e[48]=L,e[49]=$,e[50]=H,e[51]=S,e[52]=G):G=e[52],G};function fr(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function mr(t){return{name:t.name??t.uri,title:t.name,description:t.description,kind:"resource",uri:t.uri}}function pr(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function gr(){}function hr(t){return{name:t.name??t.uri,title:t.name,description:t.description,kind:"resource",uri:t.uri}}async function Oe(t,e,n,r,o,s,i){try{const a=await We(n,r,s);se(t,e,{id:r,name:Ve(r,o),metadata:a.messages,char:"/",kind:"prompt",args:s})}catch(a){console.error("[slash] Failed to fetch prompt:",a),V.error(i.t("chat.mentionSlash.failedLoadPrompt"))}}async function vr(t,e,n,r,o){try{const s=await Qe(n,r);se(t,e,{id:r,name:r,metadata:s.contents,char:"/",kind:"resource"})}catch(s){console.error("[slash] Failed to fetch resource:",s),V.error(o.t("chat.mentionSlash.failedLoadResource"))}}async function br(t,e,n,r,o){try{const{files:s,omittedPaths:i}=await tn(n,r.volume,r.path),a={sandboxPath:r.sandboxPath,volume:r.volume,path:r.path,files:s,omittedPaths:i};se(t,e,{id:r.id,name:r.name,metadata:a,char:"/",kind:"skill"})}catch(s){console.error("[slash] Failed to fetch skill:",s),V.error(o.t("chat.mentionSlash.failedLoadSkill"))}}const xr=({editor:t,virtualMcpId:e,suggestionOpenRef:n})=>{const r=le(),o=qe(),{org:s}=Be(),i=He({connectionId:e,orgId:s.id,orgSlug:s.slug}),a=ce.virtualMcpPrompts(e,s.id),c=ce.virtualMcpResources(e,s.id),u=ce.slashSkills(s.id),f=["slash-mention",s.id,e??"default"],[p,l]=h.useState(null),[d,g]=h.useState(null),m=_t(t);m&&(m.onEditChip=async S=>{if(i)try{const P=(await $e(o,a,i)).find(F=>F.name===S.promptId);if(!P?.arguments||P.arguments.length===0)return;g({...S,prompt:P})}catch(R){console.error("[slash] Failed to load prompt for editing:",R),V.error(r("chat.mentionSlash.failedLoadPrompt"))}});const v=h.useRef(null),y=h.useRef(!1),x=async({item:S,range:R})=>{if(J("chat_picker_item_selected",{picker:"/",item_kind:S.kind,item_name:S.name}),y.current=!0,!!i)if(S.kind==="prompt"){if(S.arguments&&S.arguments.length>0){l({range:R,item:S});return}const P=ue(S._meta);await Oe(t,R,i,S.name,P,void 0,{t:r})}else S.kind==="skill"?S.skill&&await br(t,R,s.slug,S.skill,{t:r}):S.uri&&await vr(t,R,i,S.uri,{t:r})},w=async S=>{if(!p||!i)return;const{range:R,item:P}=p,F=ue(P._meta);await Oe(t,R,i,P.name,F,S,{t:r}),l(null)},I=async S=>{if(!(!d||!i)){if(!At(t,d.pos,d.promptId)){V.error(r("chat.mentionSlash.failedUpdatePrompt")),g(null);return}try{const R=await We(i,d.promptId,S),P=ue(d.prompt._meta);t.chain().focus().setNodeSelection(d.pos).deleteSelection().insertContentAt(d.pos,Mt({id:d.promptId,name:Ve(d.promptId,P),metadata:R.messages,char:"/",kind:"prompt",args:S})).run(),J("chat_picker_item_selected",{picker:"/edit",item_kind:"prompt",item_name:d.promptId})}catch(R){console.error("[slash] Failed to update prompt:",R),V.error(r("chat.mentionSlash.failedUpdatePrompt"))}g(null)}},N=async S=>{const{query:R}=S;if(!i)return[];const[P,F,D]=await Promise.all([$e(o,a,i),wr(o,c,i),yr(o,u,s.slug)]),A=R.trim().toLowerCase(),Q=(P??[]).filter(E=>!A||E.name.toLowerCase().includes(A)||E.title?.toLowerCase().includes(A)||E.description?.toLowerCase().includes(A)).map(E=>({name:E.name,title:E.title,description:E.description,kind:"prompt",arguments:E.arguments,_meta:E._meta})),C=(F??[]).filter(E=>!A||E.uri.toLowerCase().includes(A)||E.name?.toLowerCase().includes(A)||E.description?.toLowerCase().includes(A)).map(E=>({name:E.name??E.uri,title:E.name,description:E.description,kind:"resource",uri:E.uri})),M=(D??[]).filter(E=>!A||E.name.toLowerCase().includes(A)||E.id.toLowerCase().includes(A)||E.description?.toLowerCase().includes(A)).map(E=>({name:E.name,title:E.name,description:E.description??void 0,kind:"skill",skill:E}));return[...Q,...C,...M]},T=p?.item.kind==="prompt"?{name:p.item.name,title:p.item.title,arguments:p.item.arguments,description:p.item.description,_meta:p.item._meta}:null;return b.jsxs(b.Fragment,{children:[b.jsx(st,{editor:t,char:"/",pluginKey:"slashDropdownMenu",queryKey:f,queryFn:N,onSelect:x,onOpenChange:S=>{if(n&&(n.current=S),S)v.current=Date.now(),y.current=!1,J("chat_picker_opened",{picker:"/"});else{const R=v.current;J("chat_picker_closed",{picker:"/",outcome:y.current?"selected":"dismissed",duration_ms:R?Date.now()-R:null}),v.current=null}}}),b.jsx(Ce,{prompt:T,setPrompt:()=>l(null),onSubmit:w}),b.jsx(Ce,{prompt:d?.prompt??null,setPrompt:()=>g(null),onSubmit:I,defaultValues:d?.args},d?`edit-${d.promptId}-${d.pos}`:"edit-idle")]})};async function $e(t,e,n){let r=t.getQueryData(e);return r?t.fetchQuery({queryKey:e,queryFn:()=>Ie(n),staleTime:6e4}).catch(()=>{}):r=await t.fetchQuery({queryKey:e,queryFn:()=>Ie(n),staleTime:6e4}).catch(()=>{}),r?.prompts??[]}async function yr(t,e,n){const r=t.getQueryData(e),o=()=>t.fetchQuery({queryKey:e,queryFn:()=>nn(n),staleTime:6e4});return r?(o().catch(()=>{}),r):o().catch(()=>[])}async function wr(t,e,n){let r=t.getQueryData(e);return r?t.fetchQuery({queryKey:e,queryFn:()=>oe(n),staleTime:6e4}).catch(()=>{}):r=await t.fetchQuery({queryKey:e,queryFn:()=>oe(n),staleTime:6e4}).catch(()=>{}),r?.resources??[]}const it="Ask anything, / for prompts & skills, @ for agents & resources...";function Sr(t){return[Kt.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1}),kt.configure({placeholder:()=>t.current??it,showOnlyWhenEditable:!1}),Ot,$t]}function Or({tiptapDoc:t,setTiptapDoc:e,disabled:n=!1,enterToSubmit:r=!1,placeholder:o,onSubmit:s,suggestionOpenRef:i,children:a}){const c=h.useRef(s),u=h.useRef(e),f=h.useRef(r),p=h.useRef(o),l=Dt({extensions:Sr(p),content:t||"",editorProps:{attributes:{"data-chat-input":"true",role:"textbox","aria-multiline":"true","aria-label":o??it,class:"prose prose-sm max-w-none focus:outline-none w-full h-full text-[15px] p-[18px]"},handleKeyDown:(d,g)=>g.key==="Enter"&&!g.shiftKey&&f.current&&!i?.current?(g.preventDefault(),c.current?.(),!0):!1},onUpdate:({editor:d})=>{u.current(d?.getJSON())}});return h.useEffect(()=>{l?.setEditable(!n)},[l,n]),h.useEffect(()=>{c.current=s},[s]),h.useEffect(()=>{u.current=e},[e]),h.useEffect(()=>{f.current=r},[r]),h.useEffect(()=>{p.current=o},[o]),h.useEffect(()=>{if(!l||l.isDestroyed)return;const d=JSON.stringify(l.getJSON()),g=JSON.stringify(t||{type:"doc",content:[]});d!==g&&l.commands.setContent(t||{type:"doc",content:[]})},[l,t]),b.jsx(jt.Provider,{value:{editor:l},children:a})}function $r(t){const e=Y.c(29),{disabled:n,virtualMcpId:r,showFileUploader:o,selectedModel:s,onUnsupportedFile:i,suggestionOpenRef:a,ref:c,className:u}=t,f=n===void 0?!1:n,p=o===void 0?!1:o,{editor:l}=Lt();let d,g;if(e[0]!==l?(d=()=>({focus:()=>{l?.commands.focus()},clear:()=>{l?.commands.clearContent(!0)},appendText:P=>{if(!l)return;const F=l.state.doc.textContent.trim()==="";l.commands.focus("end"),F||l.commands.insertContent(" "),l.commands.insertContent(P)},syncVoiceText:(P,F)=>{if(l&&(l.commands.setContent(P||{type:"doc",content:[]}),F)){l.commands.focus("end");const D=l.state.doc.textContent.trim().length>0;l.commands.insertContent({type:"text",text:D?" "+F:F})}},restoreContent:P=>{l&&l.commands.setContent(P||{type:"doc",content:[]})}}),g=[l],e[0]=l,e[1]=d,e[2]=g):(d=e[1],g=e[2]),h.useImperativeHandle(c??null,d,g),!l)return null;const m=f&&"cursor-not-allowed opacity-70",v=f&&"[&_.ProseMirror]:cursor-not-allowed";let y;e[3]!==u||e[4]!==m||e[5]!==v?(y=Ue("overflow-y-auto relative flex-1 max-h-[164px] min-h-[20px] w-full flex flex-col",u,"[&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[20px] [&_.ProseMirror]:flex-1","[&_.ProseMirror_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.ProseMirror_p.is-editor-empty:first-child::before]:text-muted-foreground","[&_.ProseMirror_p.is-editor-empty:first-child::before]:opacity-50","[&_.ProseMirror_p.is-editor-empty:first-child::before]:float-left","[&_.ProseMirror_p.is-editor-empty:first-child::before]:pointer-events-none","[&_.ProseMirror_p.is-editor-empty:first-child::before]:h-0","[&_.ProseMirror_p.is-editor-empty:first-child::before]:w-full","[&_.ProseMirror_p.is-editor-empty:first-child::before]:break-words",m,v),e[3]=u,e[4]=m,e[5]=v,e[6]=y):y=e[6];let x;e[7]!==l||e[8]!==y?(x=b.jsx(Ut,{editor:l,className:y}),e[7]=l,e[8]=y,e[9]=x):x=e[9];const w=r??null;let I;e[10]!==l||e[11]!==a||e[12]!==w?(I=b.jsx(h.Suspense,{fallback:null,children:b.jsx(xr,{editor:l,virtualMcpId:w,suggestionOpenRef:a})}),e[10]=l,e[11]=a,e[12]=w,e[13]=I):I=e[13];const N=r??null;let T;e[14]!==l||e[15]!==a||e[16]!==N?(T=b.jsx(h.Suspense,{fallback:null,children:b.jsx(dr,{editor:l,virtualMcpId:N,suggestionOpenRef:a})}),e[14]=l,e[15]=a,e[16]=N,e[17]=T):T=e[17];let S;e[18]!==f||e[19]!==l||e[20]!==i||e[21]!==s||e[22]!==p?(S=p&&s&&!f?b.jsx(on,{editor:l,selectedModel:s,onUnsupportedFile:i}):null,e[18]=f,e[19]=l,e[20]=i,e[21]=s,e[22]=p,e[23]=S):S=e[23];let R;return e[24]!==I||e[25]!==T||e[26]!==S||e[27]!==x?(R=b.jsxs(b.Fragment,{children:[x,I,T,S]}),e[24]=I,e[25]=T,e[26]=S,e[27]=x,e[28]=R):R=e[28],R}export{Or as T,jr as U,$r as a,rn as p,Lr as u};
@@ -1 +0,0 @@
1
- import{c as p,j as s,b as y,O as _,h as g,B as S,L as j,i as v,k as A,l as N}from"./index-Dc7hzqoi.js";import{P as b}from"./index-CSd_k8Np.js";import{R}from"./required-auth-layout-RoMNnMPO.js";import{u as T}from"./use-deployment-admin-BVfgEagI.js";const D=[{to:"/_admin/users",labelKey:"admin.layout.usersTab"},{to:"/_admin/orgs",labelKey:"admin.layout.organizationsTab"},{to:"/_admin/prompts",labelKey:"admin.layout.promptsTab"}];function K(){const e=p.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:L},e[0]=a):a=e[0];const d=A(a),r=y();let t;e[1]!==d||e[2]!==r?(t=D.map(i=>s.jsx(j,{to:i.to,className:N("-mb-px border-b-2 px-3 py-2.5 text-sm font-medium transition-colors",d.startsWith(i.to)?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:r(i.labelKey)},i.to)),e[1]=d,e[2]=r,e[3]=t):t=e[3];let o;return e[4]!==t?(o=s.jsx("nav",{className:"flex items-center gap-1 border-b border-border px-4 md:px-10",children:t}),e[4]=t,e[5]=o):o=e[5],o}function L(e){return e.location.pathname}function k(){const e=p.c(22),{isAdmin:a,loading:d,needsEmailVerification:r}=T(),t=y();if(d){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex h-dvh flex-1 items-center justify-center",children:s.jsx(g,{className:"size-5 text-muted-foreground"})}),e[0]=n):n=e[0],n}if(!a){let n;e[1]!==t?(n=t("admin.layout.adminDashboardArea"),e[1]=t,e[2]=n):n=e[2];let l;e[3]!==r||e[4]!==t?(l=t(r?"admin.layout.emailVerificationRequired":"admin.layout.restrictedToDashboard"),e[3]=r,e[4]=t,e[5]=l):l=e[5];let m;e[6]!==t?(m=t("admin.layout.goHome"),e[6]=t,e[7]=m):m=e[7];let c;e[8]!==m?(c=s.jsx(S,{variant:"outline",size:"sm",asChild:!0,children:s.jsx(j,{to:"/",children:m})}),e[8]=m,e[9]=c):c=e[9];let h;return e[10]!==n||e[11]!==l||e[12]!==c?(h=s.jsx(v,{area:n,description:l,action:c}),e[10]=n,e[11]=l,e[12]=c,e[13]=h):h=e[13],h}let o;e[14]!==t?(o=t("admin.layout.adminDashboard"),e[14]=t,e[15]=o):o=e[15];let i;e[16]!==o?(i=s.jsx("div",{className:"shrink-0 px-4 pt-6 md:px-10",children:s.jsx("h1",{className:"pb-4 text-xl font-medium",children:o})}),e[16]=o,e[17]=i):i=e[17];let u;e[18]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{}),e[18]=u):u=e[18];let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(b.Content,{children:s.jsx(_,{})}),e[19]=f):f=e[19];let x;return e[20]!==i?(x=s.jsxs(b,{variant:"plain",className:"h-dvh",children:[i,u,f]}),e[20]=i,e[21]=x):x=e[21],x}function $(){const e=p.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(R,{children:s.jsx(k,{})}),e[0]=a):a=e[0],a}export{$ as default};
@@ -1 +0,0 @@
1
- import{c as _,f as h,u as x,M as j,dD as S,ag as b,f1 as v,j as p,N as d}from"./index-Dc7hzqoi.js";import{L}from"./legacy-main-redirect-BZ4nzqkQ.js";import"./thread-route-BBf64Mwk.js";function k(){const e=_.c(16);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const g=h(o);let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[1]=n):n=e[1];const s=x(n),{org:t}=j(),f="_splat"in g&&typeof g._splat=="string"?g._splat:"";let c,a;if(e[2]!==t.id||e[3]!==t.slug||e[4]!==s||e[5]!==f){a=Symbol.for("react.early_return_sentinel");e:{const m=f.split("/").find(Boolean);if(!m){let r;e[8]!==t.slug?(r={org:t.slug},e[8]=t.slug,e[9]=r):r=e[9];let u;e[10]!==s||e[11]!==r?(u=p.jsx(d,{to:"/$org/projects",params:r,search:s,hash:!0,replace:!0}),e[10]=s,e[11]=r,e[12]=u):u=e[12],a=u;break e}const y=S({virtualMcpIdSearch:s.virtualmcpid,fallbackAgentId:b(t.id).id});c=v({org:t.slug,agentId:y,panel:m,source:"view-first",search:s})}e[2]=t.id,e[3]=t.slug,e[4]=s,e[5]=f,e[6]=c,e[7]=a}else c=e[6],a=e[7];if(a!==Symbol.for("react.early_return_sentinel"))return a;const l=c;let i;return e[13]!==t.slug||e[14]!==l?(i=l?.kind==="canonical"?p.jsx(L,{target:{route:l.route,search:l.search}}):p.jsx(d,{to:"/$org/home",params:{org:t.slug},replace:!0}),e[13]=t.slug,e[14]=l,e[15]=i):i=e[15],i}export{k as default};
@@ -1 +0,0 @@
1
- import{c as v,C as t,j as p,N as m,a1 as c,f as y,u as I,R as E,dD as k,dE as R,dF as S,dG as b}from"./index-Dc7hzqoi.js";import{b as L}from"./thread-route-BBf64Mwk.js";function C(x){const a=v.c(81),{target:h}=x,{route:s,search:r}=h;switch(s.to){case c.home:{let e;return a[0]!==s.params||a[1]!==r?(e=p.jsx(m,{to:c.home,params:s.params,search:r,hash:!0,replace:!0}),a[0]=s.params,a[1]=r,a[2]=e):e=a[2],e}case c.tasks:{let e;return a[3]!==s.params||a[4]!==r?(e=p.jsx(m,{to:c.tasks,params:s.params,search:r,hash:!0,replace:!0}),a[3]=s.params,a[4]=r,a[5]=e):e=a[5],e}case c.reports:{let e;return a[6]!==s.params||a[7]!==r?(e=p.jsx(m,{to:c.reports,params:s.params,search:r,hash:!0,replace:!0}),a[6]=s.params,a[7]=r,a[8]=e):e=a[8],e}case c.discover:{let e;return a[9]!==s.params||a[10]!==r?(e=p.jsx(m,{to:c.discover,params:s.params,search:r,hash:!0,replace:!0}),a[9]=s.params,a[10]=r,a[11]=e):e=a[11],e}case c.library:{let e;return a[12]!==s.params||a[13]!==r?(e=p.jsx(m,{to:c.library,params:s.params,search:r,hash:!0,replace:!0}),a[12]=s.params,a[13]=r,a[14]=e):e=a[14],e}case t.root:{let e;return a[15]!==s.params||a[16]!==r?(e=p.jsx(m,{to:t.root,params:s.params,search:r,hash:!0,replace:!0}),a[15]=s.params,a[16]=r,a[17]=e):e=a[17],e}case t.tasks:{let e;return a[18]!==s.params||a[19]!==r?(e=p.jsx(m,{to:t.tasks,params:s.params,search:r,hash:!0,replace:!0}),a[18]=s.params,a[19]=r,a[20]=e):e=a[20],e}case t.reports:{let e;return a[21]!==s.params||a[22]!==r?(e=p.jsx(m,{to:t.reports,params:s.params,search:r,hash:!0,replace:!0}),a[21]=s.params,a[22]=r,a[23]=e):e=a[23],e}case t.siteEditor:{let e;return a[24]!==s.params||a[25]!==r?(e=p.jsx(m,{to:t.siteEditor,params:s.params,search:r,hash:!0,replace:!0}),a[24]=s.params,a[25]=r,a[26]=e):e=a[26],e}case t.siteEditorContent:{let e;return a[27]!==s.params||a[28]!==r?(e=p.jsx(m,{to:t.siteEditorContent,params:s.params,search:r,hash:!0,replace:!0}),a[27]=s.params,a[28]=r,a[29]=e):e=a[29],e}case t.siteEditorCode:{let e;return a[30]!==s.params||a[31]!==r?(e=p.jsx(m,{to:t.siteEditorCode,params:s.params,search:r,hash:!0,replace:!0}),a[30]=s.params,a[31]=r,a[32]=e):e=a[32],e}case t.settings:{let e;return a[33]!==s.params||a[34]!==r?(e=p.jsx(m,{to:t.settings,params:s.params,search:r,hash:!0,replace:!0}),a[33]=s.params,a[34]=r,a[35]=e):e=a[35],e}case t.assets:{let e;return a[36]!==s.params||a[37]!==r?(e=p.jsx(m,{to:t.assets,params:s.params,search:r,hash:!0,replace:!0}),a[36]=s.params,a[37]=r,a[38]=e):e=a[38],e}case t.git:{let e;return a[39]!==s.params||a[40]!==r?(e=p.jsx(m,{to:t.git,params:s.params,search:r,hash:!0,replace:!0}),a[39]=s.params,a[40]=r,a[41]=e):e=a[41],e}case t.hosting:{let e;return a[42]!==s.params||a[43]!==r?(e=p.jsx(m,{to:t.hosting,params:s.params,search:r,hash:!0,replace:!0}),a[42]=s.params,a[43]=r,a[44]=e):e=a[44],e}case t.e2e:{let e;return a[45]!==s.params||a[46]!==r?(e=p.jsx(m,{to:t.e2e,params:s.params,search:r,hash:!0,replace:!0}),a[45]=s.params,a[46]=r,a[47]=e):e=a[47],e}case t.analytics:{let e;return a[48]!==s.params||a[49]!==r?(e=p.jsx(m,{to:t.analytics,params:s.params,search:r,hash:!0,replace:!0}),a[48]=s.params,a[49]=r,a[50]=e):e=a[50],e}case t.experiments:{let e;return a[51]!==s.params||a[52]!==r?(e=p.jsx(m,{to:t.experiments,params:s.params,search:r,hash:!0,replace:!0}),a[51]=s.params,a[52]=r,a[53]=e):e=a[53],e}case t.monitor:{let e;return a[54]!==s.params||a[55]!==r?(e=p.jsx(m,{to:t.monitor,params:s.params,search:r,hash:!0,replace:!0}),a[54]=s.params,a[55]=r,a[56]=e):e=a[56],e}case t.automations:{let e;return a[57]!==s.params||a[58]!==r?(e=p.jsx(m,{to:t.automations,params:s.params,search:r,hash:!0,replace:!0}),a[57]=s.params,a[58]=r,a[59]=e):e=a[59],e}case t.automation:{let e;return a[60]!==s.params||a[61]!==r?(e=p.jsx(m,{to:t.automation,params:s.params,search:r,hash:!0,replace:!0}),a[60]=s.params,a[61]=r,a[62]=e):e=a[62],e}case t.app:{let e;return a[63]!==s.params||a[64]!==r?(e=p.jsx(m,{to:t.app,params:s.params,search:r,hash:!0,replace:!0}),a[63]=s.params,a[64]=r,a[65]=e):e=a[65],e}case t.view:{let e;return a[66]!==s.params||a[67]!==r?(e=p.jsx(m,{to:t.view,params:s.params,search:r,hash:!0,replace:!0}),a[66]=s.params,a[67]=r,a[68]=e):e=a[68],e}case t.outputFile:{let e;return a[69]!==s.params||a[70]!==r?(e=p.jsx(m,{to:t.outputFile,params:s.params,search:r,hash:!0,replace:!0}),a[69]=s.params,a[70]=r,a[71]=e):e=a[71],e}case t.outputDeck:{let e;return a[72]!==s.params||a[73]!==r?(e=p.jsx(m,{to:t.outputDeck,params:s.params,search:r,hash:!0,replace:!0}),a[72]=s.params,a[73]=r,a[74]=e):e=a[74],e}case t.libraryFile:{let e;return a[75]!==s.params||a[76]!==r?(e=p.jsx(m,{to:t.libraryFile,params:s.params,search:r,hash:!0,replace:!0}),a[75]=s.params,a[76]=r,a[77]=e):e=a[77],e}case t.connectSources:{let e;return a[78]!==s.params||a[79]!==r?(e=p.jsx(m,{to:t.connectSources,params:s.params,search:r,hash:!0,replace:!0}),a[78]=s.params,a[79]=r,a[80]=e):e=a[80],e}}}function A(x){const a=v.c(17),{children:h}=x;let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},a[0]=s):s=a[0];const r=y(s);let e;a[1]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},a[1]=e):e=a[1];const u=I(e),j=L(),g=E(),i=r.org;if(!i||r.taskId!==void 0||r._splat!==void 0)return h??null;let n,f;a[2]!==j||a[3]!==g||a[4]!==i||a[5]!==r.agentId||a[6]!==u?(n=k({agentIdParam:r.agentId,virtualMcpIdSearch:u.virtualmcpid,fallbackAgentId:j}),f=(u.main!==void 0?R({org:i,agentId:n,main:u.main,search:u}):null)??S({org:i,routePath:g,search:u}),a[2]=j,a[3]=g,a[4]=i,a[5]=r.agentId,a[6]=u,a[7]=n,a[8]=f):(n=a[7],f=a[8]);const o=f;if(o?.kind==="same-route"){let l;return a[9]!==o.search?(l=p.jsx(m,{to:".",search:o.search,hash:!0,replace:!0}),a[9]=o.search,a[10]=l):l=a[10],l}if(o?.kind==="canonical"){let l;return a[11]!==o?(l=p.jsx(C,{target:o}),a[11]=o,a[12]=l):l=a[12],l}if(r.agentId!==void 0&&r.agentId===n&&u.virtualmcpid!==void 0){let l;a[13]!==u?(l=b(u),a[13]=u,a[14]=l):l=a[14];let d;return a[15]!==l?(d=p.jsx(m,{to:".",search:l,hash:!0,replace:!0}),a[15]=l,a[16]=d):d=a[16],d}return h??null}export{C as L,A as a};