decocms 4.388.4 → 4.389.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. package/dist/client/assets/{AlertCircle-Cat-Fy2i.js → AlertCircle-CVkVxygv.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CSNer7sZ.js → AreaChart-lVePxdbV.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DuxVUo5_.js → ArrowLeft-CN6aZBvX.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-CsoDgnUj.js → ArrowRight-FqJnNh3f.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CbPBDOpZ.js → ArrowUp-bOLRJZuX.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-DgQehil3.js → CartesianChart-C3Zko_Et.js} +1 -1
  7. package/dist/client/assets/{Check-BZXRTDaX.js → Check-DL_AGZMy.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-Cj4PQGuv.js → CheckCircle-DtMp-qqq.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DGt31MPD.js → ChevronUp-B6mY-MC1.js} +1 -1
  10. package/dist/client/assets/{Copy01-B6hr4CBg.js → Copy01-6lOOhJcp.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-CiYLi_pR.js → CreditCard01-DdYfDHIS.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-BITRq5d-.js → DotsVertical-CAjUqtRp.js} +1 -1
  13. package/dist/client/assets/{Download01-CsYfHghd.js → Download01-Dq8Pn8XY.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-zVAOL4kJ.js → ErrorBarContext-B26KvZ3G.js} +1 -1
  15. package/dist/client/assets/{Eye-rQUtSbk6.js → Eye-B5e-ilzV.js} +1 -1
  16. package/dist/client/assets/{Globe04-C_9DD9oO.js → Globe04-_nV993le.js} +1 -1
  17. package/dist/client/assets/{Image01-BLIf6uY9.js → Image01-CkJtDP-I.js} +1 -1
  18. package/dist/client/assets/{Key01-SGIR_QrT.js → Key01-BCuGindq.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-GBQ0rQxQ.js → LayoutLeft-U0F-Da_p.js} +1 -1
  20. package/dist/client/assets/{Line-y7nkMb-C.js → Line-BA6i0Sln.js} +1 -1
  21. package/dist/client/assets/{Link01-BnVQGp2l.js → Link01-BjTxU_bP.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-Dh0AABP8.js → LinkExternal01-DSUCZUJp.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CxisI5ut.js → Monitor01-r707obGd.js} +1 -1
  24. package/dist/client/assets/{Package-DsU1cU6S.js → Package-D2jMN__x.js} +1 -1
  25. package/dist/client/assets/{Palette-CzoNEzRs.js → Palette-DebiHmrq.js} +1 -1
  26. package/dist/client/assets/{Plus-qASEo4cN.js → Plus-BbELO07z.js} +1 -1
  27. package/dist/client/assets/{SearchLg-qmi8uaeX.js → SearchLg-C9MObDBB.js} +1 -1
  28. package/dist/client/assets/{SearchMd-B6NDUgzQ.js → SearchMd-B1Foybfh.js} +1 -1
  29. package/dist/client/assets/{Sector-DK9KwpRN.js → Sector-OiAocllE.js} +1 -1
  30. package/dist/client/assets/{Share07-CMPYQYHk.js → Share07-B2WnpDWD.js} +1 -1
  31. package/dist/client/assets/{Stars01-cdnol_cb.js → Stars01-DUL2jKUJ.js} +1 -1
  32. package/dist/client/assets/{Sun-BSFyLDhg.js → Sun-BKxdX8hu.js} +1 -1
  33. package/dist/client/assets/{Tool01-H9OcfGdq.js → Tool01-BvNT4KDI.js} +1 -1
  34. package/dist/client/assets/{Trash01-mB4s-hrv.js → Trash01-BLoRPhD3.js} +1 -1
  35. package/dist/client/assets/{Upload01-Uv_jtHIk.js → Upload01-CNb1qfRO.js} +1 -1
  36. package/dist/client/assets/{User01-DHGCVvV3.js → User01-U5CIC-GP.js} +1 -1
  37. package/dist/client/assets/{UserSquare-BfT6tB5U.js → UserSquare-CZakdYWe.js} +1 -1
  38. package/dist/client/assets/{Users01-C_qUmfZB.js → Users01-C6BprSkC.js} +1 -1
  39. package/dist/client/assets/{X-vKTIsgL1.js → X-BNszojyh.js} +1 -1
  40. package/dist/client/assets/{XCircle-Cu2Sy8Aw.js → XCircle-BuDwhQqF.js} +1 -1
  41. package/dist/client/assets/{XClose-DFUqDOc8.js → XClose-D_JLFZFT.js} +1 -1
  42. package/dist/client/assets/{Zap-CSRFlEXK.js → Zap-BCwjglMw.js} +1 -1
  43. package/dist/client/assets/{ZoomOut-Burao8Eg.js → ZoomOut-q6Y0RhlM.js} +1 -1
  44. package/dist/client/assets/{access-gate-Bbnx_Qh-.js → access-gate-Clo8Jex8.js} +1 -1
  45. package/dist/client/assets/{add-connection-dialog-DzNaYAxM.js → add-connection-dialog-C5SXdxkT.js} +1 -1
  46. package/dist/client/assets/{agent-analytics-C0sV-7Xb.js → agent-analytics-es8O9CL0.js} +2 -2
  47. package/dist/client/assets/agent-app-CGYFJjq5.js +1 -0
  48. package/dist/client/assets/{agent-assets-OnbttXnX.js → agent-assets-Dy169ySy.js} +1 -1
  49. package/dist/client/assets/{agent-automation-BSmqRx9Q.js → agent-automation-D1R1huVt.js} +6 -6
  50. package/dist/client/assets/{agent-automations-D7yiwZb3.js → agent-automations-BVBbNAeW.js} +1 -1
  51. package/dist/client/assets/{agent-connect-sources-CTElBaoM.js → agent-connect-sources-BYoUrpVF.js} +1 -1
  52. package/dist/client/assets/agent-deck-sqReTFoM.js +1 -0
  53. package/dist/client/assets/{agent-e2e-36-yunOr.js → agent-e2e-DxRXY84q.js} +1 -1
  54. package/dist/client/assets/{agent-experiments-B5DGYFrd.js → agent-experiments-_dQ2BC_Q.js} +1 -1
  55. package/dist/client/assets/agent-file-CGmxIBgM.js +1 -0
  56. package/dist/client/assets/{agent-git-BYVAaPsW.js → agent-git-B2s_zuHj.js} +2 -2
  57. package/dist/client/assets/{agent-hosting-BbmS530x.js → agent-hosting-BGGSrQLd.js} +1 -1
  58. package/dist/client/assets/{agent-icon-CzsnrYjD.js → agent-icon-CSebdE0g.js} +1 -1
  59. package/dist/client/assets/agent-library-file-CK_Y2Pye.js +1 -0
  60. package/dist/client/assets/{agent-monitor-C27DYrEB.js → agent-monitor-Dd5ty7vm.js} +1 -1
  61. package/dist/client/assets/{agent-overview-DsQze4i5.js → agent-overview-Cm3ny-qk.js} +1 -1
  62. package/dist/client/assets/agent-settings-B-c4VHd9.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-BNuBiz19.js → agent-site-editor-CDYe7KMp.js} +1 -1
  64. package/dist/client/assets/agent-site-editor-code-C2ptd6Is.js +2 -0
  65. package/dist/client/assets/agent-site-editor-content-B7A6sQQt.js +2 -0
  66. package/dist/client/assets/agent-site-editor-preview-sULLmso9.js +518 -0
  67. package/dist/client/assets/agent-view-C2yjGU43.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-C4pdkmKc.js → agent-view-guard-a8AZfEO9.js} +1 -1
  69. package/dist/client/assets/{agents-list-B3F1REj8.js → agents-list-oZyF4Ii3.js} +1 -1
  70. package/dist/client/assets/{ai-providers-BYHAVCy5.js → ai-providers-BlScv4nl.js} +2 -2
  71. package/dist/client/assets/{alert-DsW1KUvt.js → alert-DsihHj7h.js} +1 -1
  72. package/dist/client/assets/{alert-dialog-Dg6YJ6PP.js → alert-dialog-DeRt3vSN.js} +1 -1
  73. package/dist/client/assets/{api-keys-DDd9VBHu.js → api-keys-C9NfUH35.js} +1 -1
  74. package/dist/client/assets/api-keys-D3tjigFv.js +1 -0
  75. package/dist/client/assets/app-editor-D_REDtDg.js +1 -0
  76. package/dist/client/assets/{asset-utils-DOWh4JzZ.js → asset-utils-BS06OXCA.js} +1 -1
  77. package/dist/client/assets/{auth-D3Q2r2cz.js → auth-B-OXMWGw.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-M53zUwPP.js → auth-catchall-CLBv3q5z.js} +1 -1
  79. package/dist/client/assets/{auth-entry-CQhZUGUz.js → auth-entry-uRCGi0qy.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-Cp7zhn_p.js → auth-split-layout-C9jB6J1h.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-DG9xWGRs.js → authenticate-and-persist-oauth-B71_ZhsC.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-DuetYP8A.js → automation-list-row-BX3OvbcZ.js} +1 -1
  83. package/dist/client/assets/{automation-runs-DrVjV_Uv.js → automation-runs-CUFGFLxs.js} +1 -1
  84. package/dist/client/assets/automations-DGcV2mJq.js +1 -0
  85. package/dist/client/assets/{autosend-C5knIVwo.js → autosend-pQ9pD2-2.js} +1 -1
  86. package/dist/client/assets/{avatar-CLf3yQhN.js → avatar-GIuLZx2C.js} +1 -1
  87. package/dist/client/assets/{badge-DuB4cqrw.js → badge-DS3KIYvS.js} +1 -1
  88. package/dist/client/assets/{block-document-DZ3zGn-U.js → block-document-WF9-dn_8.js} +3 -3
  89. package/dist/client/assets/blocks-preview-workspace-context-BlZqg5yu.js +1 -0
  90. package/dist/client/assets/{breadcrumb-SXbKtw7u.js → breadcrumb-D6xZIsj2.js} +1 -1
  91. package/dist/client/assets/{buckets-D7jxbA8X.js → buckets-CNixgGHU.js} +1 -1
  92. package/dist/client/assets/{build-improve-prompt-doc-DKo7W0US.js → build-improve-prompt-doc-DeGFReow.js} +1 -1
  93. package/dist/client/assets/{bulk-category-panel-CS9EslBN.js → bulk-category-panel-BS5_T4uL.js} +1 -1
  94. package/dist/client/assets/{calendar-D41RMBsP.js → calendar-D4hMMrVq.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-CYpF4fm6.js → capability-load-error-BjI2iK0-.js} +1 -1
  96. package/dist/client/assets/category-editor-BFX9U9Yh.js +1 -0
  97. package/dist/client/assets/{chart-CdmZzz30.js → chart-CdPsiu6K.js} +1 -1
  98. package/dist/client/assets/{chat-context-D1GbDSrr.js → chat-context-HOmU0YHH.js} +6 -6
  99. package/dist/client/assets/{chat-draft-VYqGGS3B.js → chat-draft-BdxqYU8-.js} +1 -1
  100. package/dist/client/assets/{checkbox-BKGUJJNh.js → checkbox-DBYfq56y.js} +1 -1
  101. package/dist/client/assets/{choose-editor-Dkb9gjmg.js → choose-editor-DSxVv7hu.js} +1 -1
  102. package/dist/client/assets/{claim-phase-copy-0btUuJoC.js → claim-phase-copy-njXeDF0h.js} +1 -1
  103. package/dist/client/assets/{cli-auth-success-BFRzX7yY.js → cli-auth-success-uK8yk1Sb.js} +1 -1
  104. package/dist/client/assets/{client-icons-CIit2qYG.js → client-icons-CaoDPAaa.js} +1 -1
  105. package/dist/client/assets/{collapsible-eiDLfZY7.js → collapsible-BpIxv8-d.js} +1 -1
  106. package/dist/client/assets/{collection-detail-D6aw3A-V.js → collection-detail-vK2X038F.js} +1 -1
  107. package/dist/client/assets/{collection-display-button-D9O76Rnp.js → collection-display-button-ChjN1roR.js} +1 -1
  108. package/dist/client/assets/{collection-search-BQXOJg8a.js → collection-search-DyuqjLWs.js} +1 -1
  109. package/dist/client/assets/{collection-table-wrapper-zKpdBBAO.js → collection-table-wrapper-CNNpAz5Y.js} +1 -1
  110. package/dist/client/assets/{collection-tabs-BWQrYrdS.js → collection-tabs-3_QvnkN-.js} +1 -1
  111. package/dist/client/assets/combobox-OP-CbRFf.js +1 -0
  112. package/dist/client/assets/command-ByUEKQB9.js +1 -0
  113. package/dist/client/assets/{companion-mcps-section-8c0rXQex.js → companion-mcps-section-6HKE7JJ2.js} +1 -1
  114. package/dist/client/assets/{connect-B9ZzFP7o.js → connect-CsNBKbv0.js} +2 -2
  115. package/dist/client/assets/{connect-layout-CSTvrhGM.js → connect-layout-DVtCwqcX.js} +1 -1
  116. package/dist/client/assets/{connection-DzM2SOZ6.js → connection-DR9gf0au.js} +1 -1
  117. package/dist/client/assets/{connection-card-DF11WhqU.js → connection-card-BOo8yulu.js} +1 -1
  118. package/dist/client/assets/{connection-detail-Dimacfl3.js → connection-detail-BqzECTqG.js} +1 -1
  119. package/dist/client/assets/{connection-form-helpers-CyBATU5Y.js → connection-form-helpers-D5P5OxyV.js} +1 -1
  120. package/dist/client/assets/{connections-C_1m4t4b.js → connections-DH9JM6iR.js} +1 -1
  121. package/dist/client/assets/{create-organization-dialog-Cy1fVEro.js → create-organization-dialog-S8LtKHhd.js} +1 -1
  122. package/dist/client/assets/{decofile-api-DkM3ZQFM.js → decofile-api-CWaaGMA2.js} +1 -1
  123. package/dist/client/assets/{decopilot-YckYKTsg.js → decopilot-B7-O9fZC.js} +2 -2
  124. package/dist/client/assets/{dialog-C36x61_J.js → dialog-BG6kEGFR.js} +1 -1
  125. package/dist/client/assets/{discover-CqgNMlsp.js → discover-OS0btTyd.js} +1 -1
  126. package/dist/client/assets/{domain-settings-D6TBWbch.js → domain-settings-BrbTzYfK.js} +1 -1
  127. package/dist/client/assets/{download-app-dialog-7J000m-o.js → download-app-dialog-NqW4PLAx.js} +1 -1
  128. package/dist/client/assets/{drawer-CsJzOKcM.js → drawer-Bl-PPIzX.js} +1 -1
  129. package/dist/client/assets/{editor-BQuCFEpz.js → editor-BiwQpn1s.js} +1 -1
  130. package/dist/client/assets/{empty-state-ClBiZqLf.js → empty-state-BpI78UAU.js} +1 -1
  131. package/dist/client/assets/{empty-state-gVTYQvW1.js → empty-state-DzReaOau.js} +1 -1
  132. package/dist/client/assets/{extract-connection-data-BIqslos8.js → extract-connection-data-BimwPioU.js} +1 -1
  133. package/dist/client/assets/{feature-gate-DLeaUXYN.js → feature-gate-B63BZEdG.js} +1 -1
  134. package/dist/client/assets/{feature-paywall-lhh7GOr7.js → feature-paywall-DwNmZ-M9.js} +1 -1
  135. package/dist/client/assets/{file-explorer-BRRFAgbe.js → file-explorer-DLzYcbz9.js} +1 -1
  136. package/dist/client/assets/{file-preview-DobzjEc2.js → file-preview-DCBxvWAy.js} +1 -1
  137. package/dist/client/assets/{file-share-button-6XYGV6w8.js → file-share-button-Cz0mgdAm.js} +1 -1
  138. package/dist/client/assets/{file-type-icon-CFRsMAQ4.js → file-type-icon-Cbv1Det1.js} +1 -1
  139. package/dist/client/assets/{folder-icon-CxyYiSJb.js → folder-icon-DltflRpD.js} +1 -1
  140. package/dist/client/assets/{form-CXSt7_li.js → form-Bx8qGby0.js} +1 -1
  141. package/dist/client/assets/{gateway-client-BF14HPqj.js → gateway-client-DiyAsoDf.js} +1 -1
  142. package/dist/client/assets/{general-0kms2_Mb.js → general-DTp5FT8F.js} +1 -1
  143. package/dist/client/assets/{github-icon-CIx0jkrL.js → github-icon-Bx6tzbBb.js} +1 -1
  144. package/dist/client/assets/{home-CyQJcQvg.js → home-tpS1TH6x.js} +1 -1
  145. package/dist/client/assets/{hooks-enzgIMXj.js → hooks-ZOtfl4oi.js} +2 -2
  146. package/dist/client/assets/{hooks-C8t7cMQJ.js → hooks-lZSCdRwc.js} +1 -1
  147. package/dist/client/assets/{icon-button-Df-IeDHT.js → icon-button-BudvJWM8.js} +1 -1
  148. package/dist/client/assets/{index-Ci3v6d1n.js → index-B7pMCohP.js} +1 -1
  149. package/dist/client/assets/index-B88q0man.css +1 -0
  150. package/dist/client/assets/{index-B7z_63F4.js → index-B8ZawsDP.js} +1 -1
  151. package/dist/client/assets/{index-DC9_5qIh.js → index-B9lZAmmH.js} +1 -1
  152. package/dist/client/assets/{index-DowxFM-Z.js → index-Bzch_Lwn.js} +1 -1
  153. package/dist/client/assets/{index-ClQyNrgO.js → index-C-u7JO1Y.js} +1 -1
  154. package/dist/client/assets/{index-Doi07Y6T.js → index-C0e8Nw2i.js} +1 -1
  155. package/dist/client/assets/{index-Byz-UaqT.js → index-CR8U3UFH.js} +1 -1
  156. package/dist/client/assets/{index-doEaURqC.js → index-CyBVTyGa.js} +7 -7
  157. package/dist/client/assets/{index-DV9UJZA2.js → index-CzuzrcF3.js} +1 -1
  158. package/dist/client/assets/{index-BoSUEB27.js → index-DeVdNW-7.js} +1 -1
  159. package/dist/client/assets/{index-CDAG9yf3.js → index-DmF8NlWI.js} +1 -1
  160. package/dist/client/assets/{index-BODjkOG4.js → index-DmsjOEhK.js} +1 -1
  161. package/dist/client/assets/{index-C4LzZ3-O.js → index-DtBnPwzh.js} +1 -1
  162. package/dist/client/assets/{index-D9padtMD.js → index-nJTy1ykh.js} +1 -1
  163. package/dist/client/assets/{index-redirect-XY4L95T5.js → index-redirect-lSGpveHC.js} +1 -1
  164. package/dist/client/assets/{infiniteQueryObserver-CxJm0T6_.js → infiniteQueryObserver-COZ-9XSO.js} +1 -1
  165. package/dist/client/assets/{infra-billing-zdKJ_MUK.js → infra-billing-ZSvY9y-Y.js} +1 -1
  166. package/dist/client/assets/input-D5Zi_pUc.js +1 -0
  167. package/dist/client/assets/{input-BT236l5B.js → input-DMG-B3VZ.js} +2 -2
  168. package/dist/client/assets/{input-CLIoB1hh.js → input-DOIUaBAK.js} +1 -1
  169. package/dist/client/assets/{integration-icon-Crk6WRxP.js → integration-icon-mTqkOE6y.js} +1 -1
  170. package/dist/client/assets/{label-tAsQMZ2G.js → label-DVhvlWqs.js} +1 -1
  171. package/dist/client/assets/{last-preview-page-002026Ee.js → last-preview-page-Cc9l6ICr.js} +1 -1
  172. package/dist/client/assets/{layout-CCpqo3zm.js → layout-0DaHUY7Z.js} +1 -1
  173. package/dist/client/assets/{legacy-agents-deep-Cj78AYzA.js → legacy-agents-deep-O9zXW4qh.js} +1 -1
  174. package/dist/client/assets/{legacy-main-redirect-Dn96iLn4.js → legacy-main-redirect-MeePJHje.js} +1 -1
  175. package/dist/client/assets/{library-BuoDGyY9.js → library-DHdWNZX-.js} +1 -1
  176. package/dist/client/assets/{login-DqL9YZRz.js → login-CXyISdG5.js} +1 -1
  177. package/dist/client/assets/{markdown-D0jNOMCX.js → markdown-DCPDulUN.js} +1 -1
  178. package/dist/client/assets/{mcp-app-renderer-BvLPqeD1.js → mcp-app-renderer-DBdofBbE.js} +2 -2
  179. package/dist/client/assets/{mcp-oauth-61IHYJoj.js → mcp-oauth-DdNMjTqu.js} +1 -1
  180. package/dist/client/assets/{members-BcXF5gIl.js → members-YBQ4CS4C.js} +1 -1
  181. package/dist/client/assets/{message-templates-CUQwBtaa.js → message-templates-B-vmK4Xp.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-DbALNxiX.js → mini-report-page-DekMuoTa.js} +1 -1
  183. package/dist/client/assets/{mock-board-D9-PmaL9.js → mock-board-D9NUZPwb.js} +9 -9
  184. package/dist/client/assets/{monaco-editor-xB6SdWXy.js → monaco-editor-tpWF7AL5.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-CTbrFT2U.js → monitoring-stats-row-D_bvL4CA.js} +1 -1
  186. package/dist/client/assets/{multi-select-BPlBOZll.js → multi-select-C3lQgqH3.js} +1 -1
  187. package/dist/client/assets/{mustache-Btjjkmrx.js → mustache-BU3hKYND.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-D8-Vh_4C.js → oauth-callback-BiuyznT3.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-ai-provider-Dpai0ql-.js → oauth-callback-ai-provider-DqtXAIB8.js} +1 -1
  190. package/dist/client/assets/{onboarding-uOVvp-Mg.js → onboarding-BS368ORS.js} +1 -1
  191. package/dist/client/assets/{optimistic-project-sidebar-views-BQt56FI4.js → optimistic-project-sidebar-views-BfkTIuSj.js} +1 -1
  192. package/dist/client/assets/org-file-open-context-Bh_zBQ2O.js +1 -0
  193. package/dist/client/assets/{organization-choice-9DpczJ4c.js → organization-choice-GuO7qGDl.js} +1 -1
  194. package/dist/client/assets/{orgs-B6tWlX0C.js → orgs-DhHpNlvn.js} +1 -1
  195. package/dist/client/assets/page-seo-form-BML1eDhR.js +1 -0
  196. package/dist/client/assets/{pair-BIUMok9W.js → pair-CIltybgP.js} +1 -1
  197. package/dist/client/assets/{plan-ladder-DjuDG4EH.js → plan-ladder-BEYdYGx8.js} +1 -1
  198. package/dist/client/assets/{popover-GUR8piky.js → popover-CUdTfYte.js} +1 -1
  199. package/dist/client/assets/post-calendar-BVrfveN8.js +1 -0
  200. package/dist/client/assets/post-editor-LBOMfHyI.js +1 -0
  201. package/dist/client/assets/{preview-content-CkHbAlf-.js → preview-content-D7H_AlKU.js} +1 -1
  202. package/dist/client/assets/{preview-dialog-DUI33rZ8.js → preview-dialog-CUz95NoQ.js} +1 -1
  203. package/dist/client/assets/{primitives-CHkTFFF-.js → primitives-CyfO2GN8.js} +1 -1
  204. package/dist/client/assets/{profile-BIFbXoSW.js → profile-BNPVU14n.js} +1 -1
  205. package/dist/client/assets/{project-app-view-ZkgOByQo.js → project-app-view-Dm6c4g3t.js} +1 -1
  206. package/dist/client/assets/{project-feed-DGoAUO34.js → project-feed-orYCz9U3.js} +1 -1
  207. package/dist/client/assets/{project-icon-mjklzNJs.js → project-icon-DWnsLAeJ.js} +1 -1
  208. package/dist/client/assets/project-reports-DhaLYRaZ.js +1 -0
  209. package/dist/client/assets/project-tasks-Dzzzm0ET.js +1 -0
  210. package/dist/client/assets/{prompts-BwsVrHFI.js → prompts-Dpv9Ex1_.js} +1 -1
  211. package/dist/client/assets/record-editor-BQ-gbw4b.js +1 -0
  212. package/dist/client/assets/redirect-editor-eLzPdMVZ.js +1 -0
  213. package/dist/client/assets/reports-8U4sSr1z.js +1 -0
  214. package/dist/client/assets/{reports-ChF6GDQz.js → reports-CUfYm0DC.js} +1 -1
  215. package/dist/client/assets/{reports-onboarding-ukyewr1e.js → reports-onboarding-V3a9FHx8.js} +1 -1
  216. package/dist/client/assets/{reports-tab-Cxq1-mux.js → reports-tab-Bx7-g2HC.js} +2 -2
  217. package/dist/client/assets/{repositories-D7d8VzOE.js → repositories-Bbw6GL37.js} +1 -1
  218. package/dist/client/assets/{repository-import-picker-B6ijLkOL.js → repository-import-picker-74Y3ta69.js} +1 -1
  219. package/dist/client/assets/{repository-picker-Ca5oB9j5.js → repository-picker-dKTE5PS5.js} +1 -1
  220. package/dist/client/assets/{require-capability-vhXMBpff.js → require-capability-QoYjHav_.js} +1 -1
  221. package/dist/client/assets/{required-auth-layout-DbGCmQgx.js → required-auth-layout-BgLvQHTP.js} +1 -1
  222. package/dist/client/assets/{reset-password-DrRaSkr-.js → reset-password-ateNgI6E.js} +1 -1
  223. package/dist/client/assets/{resizable-WgWAPECX.js → resizable-D6HLmII4.js} +1 -1
  224. package/dist/client/assets/{review-settings-BzcjRJO0.js → review-settings-jZZT0JG1.js} +1 -1
  225. package/dist/client/assets/{rich-text-link-control-i_tw_Jd2.js → rich-text-link-control-0ZhNexVb.js} +2 -2
  226. package/dist/client/assets/{roles-DTbcvvsD.js → roles-ERYsouVf.js} +1 -1
  227. package/dist/client/assets/{route-BRh6VH3Q.js → route-D5DT7lzH.js} +1 -1
  228. package/dist/client/assets/{route-B8hLxHmX.js → route-DW_oVxtq.js} +1 -1
  229. package/dist/client/assets/{route-DsWfLZyf.js → route-HgZwHfFA.js} +1 -1
  230. package/dist/client/assets/{route-page-header-tbVW9ntg.js → route-page-header-BHdnDvfR.js} +1 -1
  231. package/dist/client/assets/runnable-block-editor-DrtKYS1k.js +17 -0
  232. package/dist/client/assets/{sandbox-lifecycle-context-CvyFr09R.js → sandbox-lifecycle-context-LNZL2c0K.js} +2 -2
  233. package/dist/client/assets/{schema-BVqtjcyJ.js → schema-DSsDEA1v.js} +1 -1
  234. package/dist/client/assets/{scroll-area-Cve7MqyA.js → scroll-area-CmvmQLS1.js} +1 -1
  235. package/dist/client/assets/{search-input-CCUlZDzf.js → search-input-0hd-PWUF.js} +1 -1
  236. package/dist/client/assets/{search-toggle-BtmGTpxl.js → search-toggle-Bp6o4xvm.js} +1 -1
  237. package/dist/client/assets/{secret-picker-DVWtSCXk.js → secret-picker--QwK1qR-.js} +1 -1
  238. package/dist/client/assets/{secrets-dQAYGJYM.js → secrets-ODT01eOm.js} +1 -1
  239. package/dist/client/assets/sections-editor-DwSDIcRs.js +1 -0
  240. package/dist/client/assets/select-CDhEibGy.js +1 -0
  241. package/dist/client/assets/{select-model-Bnz73VTx.js → select-model-Dd7JcBMF.js} +1 -1
  242. package/dist/client/assets/seo-editor-BMnaZ5KR.js +1 -0
  243. package/dist/client/assets/{separator-JATiwE_2.js → separator-D-_LXjFg.js} +1 -1
  244. package/dist/client/assets/{settings-tab-CE0tP2vq.js → settings-tab-CKxa2O9d.js} +4 -4
  245. package/dist/client/assets/{sheet-ZoEgH6s-.js → sheet-DH_REC9j.js} +1 -1
  246. package/dist/client/assets/shell-layout-B3x_9fo1.js +1 -0
  247. package/dist/client/assets/{sidebar-Cz1S2PSM.js → sidebar-CxoDmdm4.js} +1 -1
  248. package/dist/client/assets/{skill-preview-BP5xxsO4.js → skill-preview-D4GrMJU0.js} +1 -1
  249. package/dist/client/assets/{skills-D52kTkau.js → skills-BYtnT-vq.js} +1 -1
  250. package/dist/client/assets/{sso-DAgB-pSG.js → sso-C8v2EdhJ.js} +1 -1
  251. package/dist/client/assets/{switch-BNLiV_oA.js → switch-C7dIR4UF.js} +1 -1
  252. package/dist/client/assets/{synced-repos-BzaJ7fNm.js → synced-repos-BNAaKJnR.js} +1 -1
  253. package/dist/client/assets/{table-D7l9brRh.js → table-B9OXzOjU.js} +1 -1
  254. package/dist/client/assets/{tabs-Gq0qvZI4.js → tabs-D6s_HA-y.js} +1 -1
  255. package/dist/client/assets/{task-board-BXLBBo-B.js → task-board-Qj-6Ctqf.js} +1 -1
  256. package/dist/client/assets/{task-route-BpYPpL3v.js → task-route-9wqWimw6.js} +1 -1
  257. package/dist/client/assets/{task-status-C7fhyr8_.js → task-status-D5cWLC8O.js} +1 -1
  258. package/dist/client/assets/{taskboard-analytics-Bhbjv4p8.js → taskboard-analytics-BtiQkIih.js} +1 -1
  259. package/dist/client/assets/{tasks-C2avg53f.js → tasks-BF0fu0p2.js} +2 -2
  260. package/dist/client/assets/tasks-D4PEOEIP.js +1 -0
  261. package/dist/client/assets/textarea-TE2JJa-B.js +1 -0
  262. package/dist/client/assets/{thread-button-CzoAkKWi.js → thread-button-DUOTtsFE.js} +1 -1
  263. package/dist/client/assets/{thread-intent-DuCE7MYG.js → thread-intent-jq9HKW3p.js} +1 -1
  264. package/dist/client/assets/{thread-route-C5QqTXOt.js → thread-route-C47YRRAe.js} +1 -1
  265. package/dist/client/assets/{thread-route-BBKn0p1b.js → thread-route-JcpQ-ikA.js} +1 -1
  266. package/dist/client/assets/{thread-sheet-body-C52UGBXx.js → thread-sheet-body-DvAYJwTc.js} +1 -1
  267. package/dist/client/assets/{toggle-group-DHrftnUg.js → toggle-group-Dv_lnjT7.js} +1 -1
  268. package/dist/client/assets/{toolbar-icon-button-iy_uLVVB.js → toolbar-icon-button-Cq75cloK.js} +1 -1
  269. package/dist/client/assets/{tooltip-C91IS2ON.js → tooltip-BjUMPvkB.js} +1 -1
  270. package/dist/client/assets/{track-CpCOxAsM.js → track-CNE2_M0H.js} +1 -1
  271. package/dist/client/assets/{types-BCbJ4Eml.js → types-Bxr6Ak0g.js} +3 -3
  272. package/dist/client/assets/{usage-stats-P7Ebxq4V.js → usage-stats-Bug-9_EL.js} +1 -1
  273. package/dist/client/assets/{use-ai-providers-CJ2ga4nx.js → use-ai-providers-ShRDl02e.js} +1 -1
  274. package/dist/client/assets/{use-automations-V0dkF89H.js → use-automations-qnBbEhgN.js} +1 -1
  275. package/dist/client/assets/{use-autosave-ClFMVO3A.js → use-autosave-exq2JPmQ.js} +1 -1
  276. package/dist/client/assets/{use-connect-companion-CXK99yF4.js → use-connect-companion-DQoSkSuB.js} +1 -1
  277. package/dist/client/assets/{use-connection-PgTQPnAp.js → use-connection-WQuJ5yl_.js} +1 -1
  278. package/dist/client/assets/{use-copy-CGJ-16i-.js → use-copy-CPOYPvBF.js} +1 -1
  279. package/dist/client/assets/{use-create-virtual-mcp-D4lB4pbk.js → use-create-virtual-mcp-Da7cL0aL.js} +1 -1
  280. package/dist/client/assets/{use-date-fns-locale-VjB0j61V.js → use-date-fns-locale-BcOQz_O6.js} +1 -1
  281. package/dist/client/assets/{use-debounced-autosave-Du2G3qf3.js → use-debounced-autosave-BnbZSVdn.js} +1 -1
  282. package/dist/client/assets/{use-debounced-value-CG2jgHBI.js → use-debounced-value-DHN-wkc6.js} +1 -1
  283. package/dist/client/assets/{use-deco-credits-DU8sJrax.js → use-deco-credits-Fltfd2iB.js} +1 -1
  284. package/dist/client/assets/{use-decopilot-events-x0K7Zb7m.js → use-decopilot-events-DF_mJ7FX.js} +1 -1
  285. package/dist/client/assets/{use-delete-connection-Pe3fW9Dc.js → use-delete-connection-Di7K1zHS.js} +1 -1
  286. package/dist/client/assets/{use-deployment-admin-CWwZo7oV.js → use-deployment-admin-Ney-Hrk_.js} +1 -1
  287. package/dist/client/assets/{use-entitlements-pN-YIa6T.js → use-entitlements-D6f3xZaU.js} +1 -1
  288. package/dist/client/assets/{use-fast-preview-draft-url-CCQm80wV.js → use-fast-preview-draft-url-B6rIt3gA.js} +1 -1
  289. package/dist/client/assets/{use-file-configs-CzJCjBKX.js → use-file-configs-Cd7oj9Fw.js} +1 -1
  290. package/dist/client/assets/{use-in-settings-DplznXN9.js → use-in-settings-8fsBM1xN.js} +1 -1
  291. package/dist/client/assets/{use-infinite-scroll-Bm905rys.js → use-infinite-scroll-BCiTqxTQ.js} +1 -1
  292. package/dist/client/assets/{use-join-requests-D4wrlTl5.js → use-join-requests-BFN9i-Es.js} +1 -1
  293. package/dist/client/assets/use-main-panel-tabs-Wh3mzXf2.js +1 -0
  294. package/dist/client/assets/{use-mcp-auth-status-BnAPI8Zf.js → use-mcp-auth-status-B1aTfNe_.js} +1 -1
  295. package/dist/client/assets/{use-mcp-client-D2DgMGL-.js → use-mcp-client-CqKNXJW7.js} +1 -1
  296. package/dist/client/assets/{use-mcp-prompts-UNzUvECH.js → use-mcp-prompts-DpED8Vrg.js} +1 -1
  297. package/dist/client/assets/{use-mcp-tools-CtMvHJK9.js → use-mcp-tools-BgkfMsvS.js} +1 -1
  298. package/dist/client/assets/{use-members-C_tB-qI-.js → use-members-CeW4sAKm.js} +1 -1
  299. package/dist/client/assets/{use-mobile-DYpKQ1eP.js → use-mobile-CUQu4L8c.js} +1 -1
  300. package/dist/client/assets/{use-navigate-to-agent-TwlhlbmB.js → use-navigate-to-agent-W6hb3mqs.js} +1 -1
  301. package/dist/client/assets/{use-open-billing-url-BrlDdS6U.js → use-open-billing-url-KLMgEPxW.js} +1 -1
  302. package/dist/client/assets/{use-org-auth-client-BkVvw_9f.js → use-org-auth-client-zTkj17z7.js} +1 -1
  303. package/dist/client/assets/{use-org-fs-Bbl2QQqg.js → use-org-fs-B1IHOZ9S.js} +1 -1
  304. package/dist/client/assets/{use-org-repo-syncs-Ds4sFbSY.js → use-org-repo-syncs-CksqUgv6.js} +1 -1
  305. package/dist/client/assets/{use-org-sso-BnqcEd47.js → use-org-sso-CI1_4UQM.js} +1 -1
  306. package/dist/client/assets/{use-organization-roles-3K_wbMHo.js → use-organization-roles-DeV7SnLa.js} +1 -1
  307. package/dist/client/assets/{use-organization-settings-Wh36EN0I.js → use-organization-settings-4gJ9Tp49.js} +1 -1
  308. package/dist/client/assets/{use-panel-navigate-xYH0iX8e.js → use-panel-navigate-Bg-MVKv6.js} +1 -1
  309. package/dist/client/assets/{use-project-native-view-presence-U59DT0hQ.js → use-project-native-view-presence-C3jxCCXQ.js} +1 -1
  310. package/dist/client/assets/{use-project-scope-CENQvfVc.js → use-project-scope-CRdwBUT7.js} +1 -1
  311. package/dist/client/assets/{use-releases-_xbQ8yPk.js → use-releases-nsAtxjuW.js} +1 -1
  312. package/dist/client/assets/{use-reports-diagnostic-Cz_g9Pum.js → use-reports-diagnostic-CtuJZ5jH.js} +1 -1
  313. package/dist/client/assets/{use-route-default-main-evb2BAGs.js → use-route-default-main-DA5X9xDG.js} +1 -1
  314. package/dist/client/assets/{use-secrets-44zj-3N9.js → use-secrets-BfDHS5Uq.js} +1 -1
  315. package/dist/client/assets/use-section-preview-base-DW4RpMx9.js +1 -0
  316. package/dist/client/assets/{use-session-runtime-COugfsOm.js → use-session-runtime-DiG_Qt8i.js} +1 -1
  317. package/dist/client/assets/{use-tags-BqebMAjW.js → use-tags-BloUFB1L.js} +1 -1
  318. package/dist/client/assets/{use-task-board-analytics-CElip-Jh.js → use-task-board-analytics-C7hgblhm.js} +1 -1
  319. package/dist/client/assets/{use-task-metadata-Dhub_XGT.js → use-task-metadata-ehugU85S.js} +1 -1
  320. package/dist/client/assets/{use-thread-outputs-DldRsY9l.js → use-thread-outputs-C9_GjCjS.js} +1 -1
  321. package/dist/client/assets/{use-virtual-mcp-B-mdsJbn.js → use-virtual-mcp-Vg_Ogz61.js} +1 -1
  322. package/dist/client/assets/useInfiniteQuery-DebjMHv1.js +1 -0
  323. package/dist/client/assets/{useQueries-CrUxqve0.js → useQueries-CDvJYO-m.js} +1 -1
  324. package/dist/client/assets/useSuspenseInfiniteQuery-CqRV1dKR.js +1 -0
  325. package/dist/client/assets/{users-XpLTDG6s.js → users-BC2i5HSG.js} +1 -1
  326. package/dist/client/assets/{utils-BcFrUaDf.js → utils-Bf0RpmgB.js} +1 -1
  327. package/dist/client/assets/variant-calendar-BWeWEpfR.js +1 -0
  328. package/dist/client/assets/{variant-matcher-override-DWffsqol.js → variant-matcher-override-fLxntWss.js} +1 -1
  329. package/dist/client/assets/{view-mode-toggle-Bsk0Q0dk.js → view-mode-toggle-DQkw8yuh.js} +1 -1
  330. package/dist/client/assets/{virtual-mcp-Bj7Y16hO.js → virtual-mcp-S8IoUqby.js} +1 -1
  331. package/dist/client/index.html +2 -2
  332. package/dist/server/cli.js +1 -1
  333. package/dist/server/server.js +1 -1
  334. package/package.json +1 -1
  335. package/dist/client/assets/agent-app-D8aCkILQ.js +0 -1
  336. package/dist/client/assets/agent-deck-JfSkYOo0.js +0 -1
  337. package/dist/client/assets/agent-file-BQkNRXR6.js +0 -1
  338. package/dist/client/assets/agent-library-file-B_9ZfsqS.js +0 -1
  339. package/dist/client/assets/agent-settings-Dlb-w-aW.js +0 -1
  340. package/dist/client/assets/agent-site-editor-code-Cg74frt9.js +0 -2
  341. package/dist/client/assets/agent-site-editor-content-BMF_TO-O.js +0 -2
  342. package/dist/client/assets/agent-site-editor-preview-DfUEy_mW.js +0 -518
  343. package/dist/client/assets/agent-view-9ku1NYkG.js +0 -1
  344. package/dist/client/assets/api-keys-CB0BbOJK.js +0 -1
  345. package/dist/client/assets/app-editor-6ntO4YLY.js +0 -1
  346. package/dist/client/assets/automations-CflFKE1S.js +0 -1
  347. package/dist/client/assets/blocks-preview-workspace-context-CGrONP0s.js +0 -1
  348. package/dist/client/assets/category-editor-CMewSARd.js +0 -1
  349. package/dist/client/assets/combobox-B1IXE26_.js +0 -1
  350. package/dist/client/assets/command-CDaLB2Ox.js +0 -1
  351. package/dist/client/assets/index-xA_kfo6T.css +0 -1
  352. package/dist/client/assets/input-BK5Sp8hZ.js +0 -1
  353. package/dist/client/assets/org-file-open-context-DodrnIMR.js +0 -1
  354. package/dist/client/assets/page-seo-form-Dbz3eu1p.js +0 -1
  355. package/dist/client/assets/post-calendar-FfQIYQQi.js +0 -1
  356. package/dist/client/assets/post-editor-YU4-WfQ7.js +0 -1
  357. package/dist/client/assets/project-reports-DVMPWWFi.js +0 -1
  358. package/dist/client/assets/project-tasks-Jy5UvQy6.js +0 -1
  359. package/dist/client/assets/record-editor-CXOCBCZ1.js +0 -1
  360. package/dist/client/assets/redirect-editor-MDe3fibH.js +0 -1
  361. package/dist/client/assets/reports-DwYY1RWm.js +0 -1
  362. package/dist/client/assets/runnable-block-editor-CdEmnBad.js +0 -16
  363. package/dist/client/assets/sections-editor-C6cdGUNk.js +0 -2
  364. package/dist/client/assets/select-oEHCSTZi.js +0 -1
  365. package/dist/client/assets/seo-editor-BD39YQzP.js +0 -1
  366. package/dist/client/assets/shell-layout-BNVBlKMe.js +0 -1
  367. package/dist/client/assets/tasks-aGbeVyrS.js +0 -1
  368. package/dist/client/assets/textarea-B9cyNs7j.js +0 -1
  369. package/dist/client/assets/use-main-panel-tabs-BcprnHpG.js +0 -1
  370. package/dist/client/assets/use-section-preview-base-BbxztEDH.js +0 -1
  371. package/dist/client/assets/useInfiniteQuery-DCZL7BN4.js +0 -1
  372. package/dist/client/assets/useSuspenseInfiniteQuery-C0KSbZH8.js +0 -1
  373. package/dist/client/assets/variant-calendar-BPWkuyHy.js +0 -1
@@ -1,8 +1,8 @@
1
- import{c as P,b as Q,r as L,l as B,j as s,an as be,bN as as,ao as Ce,bM as Ye,B as W,aq as Vs,ap as is,bO as ls,bL as cs,x as Ae,aU as ds,dT as ge,dU as rt,a6 as us,e as ps,t as Se,q as X,a0 as Te,d as Ge,dL as ms,T as fs,K as hs,m as xs,I as gs,F as bs,H as As,G as he,aR as at,aS as Vt,aT as it,h as vs,aC as ys,aB as js,am as ws,a as Cs,_ as Ns,$ as ks,at as Oe,R as yt,bU as Ss,aA as Ts}from"./index-doEaURqC.js";import{c as Is,d as jt,P as _s,i as Ds}from"./index-CDAG9yf3.js";import{K as Rs,c as Ps}from"./shell-layout-BNVBlKMe.js";import{a as Ms}from"./use-virtual-mcp-B-mdsJbn.js";import{w as Es,A as Fs}from"./autosend-C5knIVwo.js";import{s as Ls,r as lt,i as zs,c as Us,w as Bs,H as $s}from"./chat-draft-VYqGGS3B.js";import{u as Os}from"./use-session-runtime-COugfsOm.js";import{i as wt}from"./ArrowRight-CsoDgnUj.js";import{i as Ct}from"./ArrowUp-CbPBDOpZ.js";import{t as Pe,at as Nt,a9 as kt,au as Ke,d as qe,ab as Ks,O as Qs,av as Ys,L as St,j as Tt,aw as It,x as Gs,ax as qs,ay as Hs}from"./agent-icon-CzsnrYjD.js";import{i as He}from"./Check-BZXRTDaX.js";import{a as _t}from"./Image01-BLIf6uY9.js";import{i as Ws}from"./Upload01-Uv_jtHIk.js";import{i as We}from"./X-vKTIsgL1.js";import{a as Ze,b as Zs,c as Me,i as Js,k as Xs,l as en,m as tn,n as sn,o as nn,p as on,q as rn,f as an,u as Vn,s as ln,d as cn}from"./chat-context-D1GbDSrr.js";import{e as dn,z as un,p as pn,c as mn}from"./hooks-C8t7cMQJ.js";import{i as fn}from"./AlertCircle-Cat-Fy2i.js";import{a as hn}from"./Copy01-B6hr4CBg.js";import{a as Qe,b as Je,d as Xe,f as et,F as Dt}from"./form-CXSt7_li.js";import{c as xn,S as gn,b as bn,a as An,d as vn}from"./select-oEHCSTZi.js";import{t as Rt}from"./ChevronUp-DGt31MPD.js";import{T as Ee,a as Fe,c as Le}from"./tooltip-C91IS2ON.js";import{i as yn}from"./ArrowLeft-DuxVUo5_.js";import{M as jn,S as wn}from"./usage-stats-P7Ebxq4V.js";import{c as Cn,b as Nn}from"./tabs-Gq0qvZI4.js";import{d as kn,h as Sn,c as Tn,b as In,D as _n}from"./dialog-C36x61_J.js";import{d as Ie,e as Dn,b as Rn,f as Pn}from"./use-entitlements-pN-YIa6T.js";import{u as Mn}from"./use-deco-credits-DU8sJrax.js";import{I as En}from"./input-BK5Sp8hZ.js";import{T as ct,a as Fn}from"./toggle-group-DHrftnUg.js";import{s as Ln}from"./tool-namespace-DmnQIdtF.js";import{t as zn}from"./utils-CVEq3hMx.js";import{u as Un}from"./use-open-billing-url-BrlDdS6U.js";import{s as Bn}from"./XClose-DFUqDOc8.js";import{M as $n,m as tt,g as On,a as Kn}from"./decopilot-YckYKTsg.js";import{a as Pt,b as Mt,P as Et}from"./popover-GUR8piky.js";import{c as Qn,b as Yn,a as Gn,D as qn}from"./drawer-CsJzOKcM.js";import{u as Hn}from"./use-mobile-DYpKQ1eP.js";import{t as Wn}from"./Stars01-cdnol_cb.js";import{c as Zn}from"./use-organization-settings-Wh36EN0I.js";import{u as Ft,c as Jn}from"./use-ai-providers-CJ2ga4nx.js";import{M as Xn}from"./index-B7z_63F4.js";import{p as Lt,u as eo,T as to,a as so,U as no}from"./input-CLIoB1hh.js";import{d as oo,g as dt,s as ro}from"./gateway-client-BF14HPqj.js";import{u as ao}from"./use-mcp-client-D2DgMGL-.js";import{l as Vo,g as io}from"./use-mcp-prompts-UNzUvECH.js";import{i as lo}from"./Link01-BnVQGp2l.js";import{s as ut}from"./Plus-qASEo4cN.js";import"./hooks-enzgIMXj.js";import{p as co,q as uo}from"./question-004-sINsf4GQ.js";import{A as po}from"./avatar-CLf3yQhN.js";import{u as mo}from"./use-members-C_tB-qI-.js";import{F as pt}from"./feature-paywall-lhh7GOr7.js";import{A as fo}from"./add-connection-dialog-DzNaYAxM.js";import{u as ho}from"./use-is-desktop-app-BNujXJc_.js";const $e="cubic-bezier(0.645, 0.045, 0.355, 1)",cV=44,xo={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"},go={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},bo={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function ce(t){const e=P.c(69),{icon:n,label:o,count:r,title:V,footerLeft:a,footerRight:i,children:l,defaultExpanded:p,variant:d,onClose:c}=t,u=d===void 0?"default":d,m=Q(),[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 A=g;if(x)return null;const v=go[u],j=xo[u];let w;e[2]!==v||e[3]!==j?(w=B("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",v,j),e[2]=v,e[3]=j,e[4]=w):w=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>f(Ao),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=B("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 _=bo[u];let T;e[9]!==_?(T=B("shrink-0",_),e[9]=_,e[10]=T):T=e[10];let R;e[11]!==n||e[12]!==T?(R=s.jsx("span",{className:T,children:n}),e[11]=n,e[12]=T,e[13]=R):R=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 E;e[16]!==r?(E=r?s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=E):E=e[17];const M=h?"rotate(180deg)":"rotate(0deg)";let I;e[18]!==M?(I=s.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:s.jsx(Rt,{size:16,style:{transform:M,transition:`transform 180ms ${$e}`}})}),e[18]=M,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 G,$;e[24]!==A?(G=oe=>{oe.stopPropagation(),A()},$=oe=>{(oe.key==="Enter"||oe.key===" ")&&(oe.preventDefault(),oe.stopPropagation(),A())},e[24]=A,e[25]=G,e[26]=$):(G=e[25],$=e[26]);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(We,{size:16}),e[27]=z):z=e[27];let Y;e[28]!==F||e[29]!==U||e[30]!==G||e[31]!==$?(Y=s.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":F,title:U,onClick:G,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]=G,e[31]=$,e[32]=Y):Y=e[32];let te;e[33]!==h||e[34]!==R||e[35]!==D||e[36]!==E||e[37]!==I||e[38]!==Y||e[39]!==N?(te=s.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:y,className:N,children:[R,D,E,I,Y]}),e[33]=h,e[34]=R,e[35]=D,e[36]=E,e[37]=I,e[38]=Y,e[39]=N,e[40]=te):te=e[40];const J=h?"1fr":"0fr";let se;e[41]!==J?(se={display:"grid",gridTemplateRows:J,transition:`grid-template-rows 180ms ${$e}`},e[41]=J,e[42]=se):se=e[42];let k;e[43]===Symbol.for("react.memo_cache_sentinel")?(k={overflow:"hidden",minHeight:0},e[43]=k):k=e[43];const K=h?1:0;let q;e[44]!==K?(q={opacity:K,transition:`opacity 120ms ${$e}`,maxHeight:"60vh"},e[44]=K,e[45]=q):q=e[45];let Z;e[46]!==V?(Z=V?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:V})}):s.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=V,e[47]=Z):Z=e[47];let H;e[48]!==l||e[49]!==V?(H=l?s.jsx("div",{className:B("pb-4",!V&&"pt-4"),children:l}):null,e[48]=l,e[49]=V,e[50]=H):H=e[50];let re;e[51]!==Z||e[52]!==H?(re=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[Z,H]}),e[51]=Z,e[52]=H,e[53]=re):re=e[53];let Ve;e[54]!==a||e[55]!==i?(Ve=a||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:a}),s.jsx("div",{className:"flex items-center gap-2",children:i})]})}):null,e[54]=a,e[55]=i,e[56]=Ve):Ve=e[56];let ie;e[57]!==q||e[58]!==re||e[59]!==Ve?(ie=s.jsx("div",{style:k,children:s.jsxs("div",{className:"flex flex-col",style:q,children:[re,Ve]})}),e[57]=q,e[58]=re,e[59]=Ve,e[60]=ie):ie=e[60];let ee;e[61]!==se||e[62]!==ie?(ee=s.jsx("div",{"data-testid":"collapsible-highlight-body",style:se,children:ie}),e[61]=se,e[62]=ie,e[63]=ee):ee=e[63];let ae;return e[64]!==te||e[65]!==ee||e[66]!==w||e[67]!==u?(ae=s.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":u,className:w,children:[te,ee]}),e[64]=te,e[65]=ee,e[66]=w,e[67]=u,e[68]=ae):ae=e[68],ae}function Ao(t){return!t}const vo=be({content:Ce().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Ye(["pending","in_progress","completed"]),activeForm:Ce().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),zt=be({todos:as(vo)}),yo="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.";dn({description:yo,inputSchema:un(zt),execute:async({todos:t})=>({ok:!0,count:t.length})});const jo="tool-todo_write",wo=new Set(["input-available","output-available"]);function Co(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 r=o.length-1;r>=0;r--){const V=o[r];if(V.type!==jo||typeof V.state!="string"||!wo.has(V.state))continue;const a=zt.safeParse(V.input);if(a.success)return a.data.todos}}return[]}function Ut(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:zn(Ln(o)),input:n.input})}return e}function Bt(t){return t.at(-1)}function $t(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 No(t){return t?t.message.startsWith("[CREDITS]"):!1}const ko={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function So(t){const{messages:e,error:n,finishReason:o,isStreaming:r,isWaitingForApprovals:V}=t;if(!r&&n&&No(n))return{...ko,isCreditExhausted:!0};const a=e.at(-1),i=a?.role==="assistant"?a.parts:[],l=i,d=!!l.filter(w=>w.type==="tool-user_ask").filter(w=>w.state!=="output-available").length,c=l.some(w=>w.type==="tool-suggest_task"&&w.state==="input-available"),u=$t(i),m=Ut(l),h=Co(e),f=r?null:Ls(n),x=r?null:pn(n),b=!r&&!!n&&!f&&!x,g=m.length>0||r&&V,A=u.length>0,j=!r&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(d||g||A||c))&&!b;return{isCreditExhausted:!1,planRefusal:x,subscriptionErrorKind:f,hasTodos:h.length>0,showError:b,showWarning:j,hasApprovals:g,hasPlans:A,isWaitingForUserInput:d,hasTaskSuggestion:c,todos:h}}function Ot(){const t=P.c(6),{messages:e,error:n,finishReason:o,isStreaming:r,isWaitingForApprovals:V}=Ze(),a=n??null,i=o??null;let l;return t[0]!==r||t[1]!==V||t[2]!==e||t[3]!==a||t[4]!==i?(l=So({messages:e,error:a,finishReason:i,isStreaming:r,isWaitingForApprovals:V}),t[0]=r,t[1]=V,t[2]=e,t[3]=a,t[4]=i,t[5]=l):l=t[5],l}function dV(){const t=Ot(),e=Ie("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)+Number(t.hasTaskSuggestion)}const mt="start-task",To=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
1
+ import{c as P,b as Q,r as L,l as B,j as s,an as be,bP as as,ao as Ce,bO as Ye,B as H,aq as Vs,ap as is,bQ as ls,bN as cs,x as Ae,aW as ds,dU as ge,dV as rt,a6 as us,e as ps,t as Se,q as X,a0 as Te,d as Ge,dM as ms,T as fs,K as hs,m as xs,I as gs,F as bs,H as As,G as he,aT as at,aU as Vt,aV as it,h as vs,aC as ys,aB as js,am as ws,a as Cs,_ as Ns,$ as ks,at as Oe,R as yt,bW as Ss,aA as Ts}from"./index-CyBVTyGa.js";import{c as Is,d as jt,P as _s,i as Ds}from"./index-DmF8NlWI.js";import{K as Rs,c as Ps}from"./shell-layout-B3x_9fo1.js";import{a as Ms}from"./use-virtual-mcp-Vg_Ogz61.js";import{w as Es,A as Fs}from"./autosend-pQ9pD2-2.js";import{s as Ls,r as lt,i as zs,c as Us,w as Bs,H as $s}from"./chat-draft-BdxqYU8-.js";import{u as Os}from"./use-session-runtime-DiG_Qt8i.js";import{i as wt}from"./ArrowRight-FqJnNh3f.js";import{i as Ct}from"./ArrowUp-bOLRJZuX.js";import{t as Pe,av as Nt,ab as kt,aw as Ke,d as qe,ad as Ks,O as Qs,ax as Ys,L as St,j as Tt,ay as It,x as Gs,az as qs,aA as Ws}from"./agent-icon-CSebdE0g.js";import{i as We}from"./Check-DL_AGZMy.js";import{a as _t}from"./Image01-CkJtDP-I.js";import{i as Hs}from"./Upload01-CNb1qfRO.js";import{i as He}from"./X-BNszojyh.js";import{a as Ze,b as Zs,c as Me,i as Js,k as Xs,l as en,m as tn,n as sn,o as nn,p as on,q as rn,f as an,u as Vn,s as ln,d as cn}from"./chat-context-HOmU0YHH.js";import{e as dn,z as un,p as pn,c as mn}from"./hooks-lZSCdRwc.js";import{i as fn}from"./AlertCircle-CVkVxygv.js";import{a as hn}from"./Copy01-6lOOhJcp.js";import{a as Qe,b as Je,d as Xe,f as et,F as Dt}from"./form-Bx8qGby0.js";import{c as xn,S as gn,b as bn,a as An,d as vn}from"./select-CDhEibGy.js";import{t as Rt}from"./ChevronUp-B6mY-MC1.js";import{T as Ee,a as Fe,c as Le}from"./tooltip-BjUMPvkB.js";import{i as yn}from"./ArrowLeft-CN6aZBvX.js";import{M as jn,S as wn}from"./usage-stats-Bug-9_EL.js";import{c as Cn,b as Nn}from"./tabs-D6s_HA-y.js";import{d as kn,h as Sn,c as Tn,b as In,D as _n}from"./dialog-BG6kEGFR.js";import{d as Ie,e as Dn,b as Rn,f as Pn}from"./use-entitlements-D6f3xZaU.js";import{u as Mn}from"./use-deco-credits-Fltfd2iB.js";import{I as En}from"./input-D5Zi_pUc.js";import{T as ct,a as Fn}from"./toggle-group-Dv_lnjT7.js";import{s as Ln}from"./tool-namespace-DmnQIdtF.js";import{t as zn}from"./utils-CVEq3hMx.js";import{u as Un}from"./use-open-billing-url-KLMgEPxW.js";import{s as Bn}from"./XClose-D_JLFZFT.js";import{M as $n,m as tt,g as On,a as Kn}from"./decopilot-B7-O9fZC.js";import{a as Pt,b as Mt,P as Et}from"./popover-CUdTfYte.js";import{c as Qn,b as Yn,a as Gn,D as qn}from"./drawer-Bl-PPIzX.js";import{u as Wn}from"./use-mobile-CUQu4L8c.js";import{t as Hn}from"./Stars01-DUL2jKUJ.js";import{c as Zn}from"./use-organization-settings-4gJ9Tp49.js";import{u as Ft,c as Jn}from"./use-ai-providers-ShRDl02e.js";import{M as Xn}from"./index-B8ZawsDP.js";import{p as Lt,u as eo,T as to,a as so,U as no}from"./input-DOIUaBAK.js";import{d as oo,g as dt,s as ro}from"./gateway-client-DiyAsoDf.js";import{u as ao}from"./use-mcp-client-CqKNXJW7.js";import{l as Vo,g as io}from"./use-mcp-prompts-DpED8Vrg.js";import{i as lo}from"./Link01-BjTxU_bP.js";import{s as ut}from"./Plus-BbELO07z.js";import"./hooks-ZOtfl4oi.js";import{p as co,q as uo}from"./question-004-sINsf4GQ.js";import{A as po}from"./avatar-GIuLZx2C.js";import{u as mo}from"./use-members-CeW4sAKm.js";import{F as pt}from"./feature-paywall-DwNmZ-M9.js";import{A as fo}from"./add-connection-dialog-C5SXdxkT.js";import{u as ho}from"./use-is-desktop-app-BNujXJc_.js";const $e="cubic-bezier(0.645, 0.045, 0.355, 1)",cV=44,xo={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"},go={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},bo={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function ce(t){const e=P.c(69),{icon:n,label:o,count:r,title:V,footerLeft:a,footerRight:i,children:l,defaultExpanded:p,variant:d,onClose:c}=t,u=d===void 0?"default":d,m=Q(),[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 A=g;if(x)return null;const v=go[u],j=xo[u];let w;e[2]!==v||e[3]!==j?(w=B("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",v,j),e[2]=v,e[3]=j,e[4]=w):w=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>f(Ao),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=B("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 _=bo[u];let T;e[9]!==_?(T=B("shrink-0",_),e[9]=_,e[10]=T):T=e[10];let R;e[11]!==n||e[12]!==T?(R=s.jsx("span",{className:T,children:n}),e[11]=n,e[12]=T,e[13]=R):R=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 E;e[16]!==r?(E=r?s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=E):E=e[17];const M=h?"rotate(180deg)":"rotate(0deg)";let I;e[18]!==M?(I=s.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:s.jsx(Rt,{size:16,style:{transform:M,transition:`transform 180ms ${$e}`}})}),e[18]=M,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 G,$;e[24]!==A?(G=oe=>{oe.stopPropagation(),A()},$=oe=>{(oe.key==="Enter"||oe.key===" ")&&(oe.preventDefault(),oe.stopPropagation(),A())},e[24]=A,e[25]=G,e[26]=$):(G=e[25],$=e[26]);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(He,{size:16}),e[27]=z):z=e[27];let Y;e[28]!==F||e[29]!==U||e[30]!==G||e[31]!==$?(Y=s.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":F,title:U,onClick:G,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]=G,e[31]=$,e[32]=Y):Y=e[32];let te;e[33]!==h||e[34]!==R||e[35]!==D||e[36]!==E||e[37]!==I||e[38]!==Y||e[39]!==N?(te=s.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:y,className:N,children:[R,D,E,I,Y]}),e[33]=h,e[34]=R,e[35]=D,e[36]=E,e[37]=I,e[38]=Y,e[39]=N,e[40]=te):te=e[40];const J=h?"1fr":"0fr";let se;e[41]!==J?(se={display:"grid",gridTemplateRows:J,transition:`grid-template-rows 180ms ${$e}`},e[41]=J,e[42]=se):se=e[42];let k;e[43]===Symbol.for("react.memo_cache_sentinel")?(k={overflow:"hidden",minHeight:0},e[43]=k):k=e[43];const K=h?1:0;let q;e[44]!==K?(q={opacity:K,transition:`opacity 120ms ${$e}`,maxHeight:"60vh"},e[44]=K,e[45]=q):q=e[45];let Z;e[46]!==V?(Z=V?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:V})}):s.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=V,e[47]=Z):Z=e[47];let W;e[48]!==l||e[49]!==V?(W=l?s.jsx("div",{className:B("pb-4",!V&&"pt-4"),children:l}):null,e[48]=l,e[49]=V,e[50]=W):W=e[50];let re;e[51]!==Z||e[52]!==W?(re=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[Z,W]}),e[51]=Z,e[52]=W,e[53]=re):re=e[53];let Ve;e[54]!==a||e[55]!==i?(Ve=a||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:a}),s.jsx("div",{className:"flex items-center gap-2",children:i})]})}):null,e[54]=a,e[55]=i,e[56]=Ve):Ve=e[56];let ie;e[57]!==q||e[58]!==re||e[59]!==Ve?(ie=s.jsx("div",{style:k,children:s.jsxs("div",{className:"flex flex-col",style:q,children:[re,Ve]})}),e[57]=q,e[58]=re,e[59]=Ve,e[60]=ie):ie=e[60];let ee;e[61]!==se||e[62]!==ie?(ee=s.jsx("div",{"data-testid":"collapsible-highlight-body",style:se,children:ie}),e[61]=se,e[62]=ie,e[63]=ee):ee=e[63];let ae;return e[64]!==te||e[65]!==ee||e[66]!==w||e[67]!==u?(ae=s.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":u,className:w,children:[te,ee]}),e[64]=te,e[65]=ee,e[66]=w,e[67]=u,e[68]=ae):ae=e[68],ae}function Ao(t){return!t}const vo=be({content:Ce().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Ye(["pending","in_progress","completed"]),activeForm:Ce().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),zt=be({todos:as(vo)}),yo="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.";dn({description:yo,inputSchema:un(zt),execute:async({todos:t})=>({ok:!0,count:t.length})});const jo="tool-todo_write",wo=new Set(["input-available","output-available"]);function Co(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 r=o.length-1;r>=0;r--){const V=o[r];if(V.type!==jo||typeof V.state!="string"||!wo.has(V.state))continue;const a=zt.safeParse(V.input);if(a.success)return a.data.todos}}return[]}function Ut(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:zn(Ln(o)),input:n.input})}return e}function Bt(t){return t.at(-1)}function $t(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 No(t){return t?t.message.startsWith("[CREDITS]"):!1}const ko={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function So(t){const{messages:e,error:n,finishReason:o,isStreaming:r,isWaitingForApprovals:V}=t;if(!r&&n&&No(n))return{...ko,isCreditExhausted:!0};const a=e.at(-1),i=a?.role==="assistant"?a.parts:[],l=i,d=!!l.filter(w=>w.type==="tool-user_ask").filter(w=>w.state!=="output-available").length,c=l.some(w=>w.type==="tool-suggest_task"&&w.state==="input-available"),u=$t(i),m=Ut(l),h=Co(e),f=r?null:Ls(n),x=r?null:pn(n),b=!r&&!!n&&!f&&!x,g=m.length>0||r&&V,A=u.length>0,j=!r&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(d||g||A||c))&&!b;return{isCreditExhausted:!1,planRefusal:x,subscriptionErrorKind:f,hasTodos:h.length>0,showError:b,showWarning:j,hasApprovals:g,hasPlans:A,isWaitingForUserInput:d,hasTaskSuggestion:c,todos:h}}function Ot(){const t=P.c(6),{messages:e,error:n,finishReason:o,isStreaming:r,isWaitingForApprovals:V}=Ze(),a=n??null,i=o??null;let l;return t[0]!==r||t[1]!==V||t[2]!==e||t[3]!==a||t[4]!==i?(l=So({messages:e,error:a,finishReason:i,isStreaming:r,isWaitingForApprovals:V}),t[0]=r,t[1]=V,t[2]=e,t[3]=a,t[4]=i,t[5]=l):l=t[5],l}function dV(){const t=Ot(),e=Ie("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)+Number(t.hasTaskSuggestion)}const mt="start-task",To=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
2
2
 
3
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
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.
5
5
  3. Call TASK_BOARD_ITEM_CREATE with a concise title, the full description, the chosen repo as owner/name, assigneeId "super-agent", and onDuplicate "return_existing". That assignment is what queues the work; the duplicate option makes the tool hand back an existing task when one already covers this report instead of opening a second one.
6
6
  4. Reply with the task key the tool returned (e.g. DECO-144) and one line on what you filed. If the output says \`deduplicated: true\`, say the report was already tracked by that task and quote its \`duplicateReason\`. 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
7
 
8
- The report follows.`;function Io(t){return{...t,content:[{type:"paragraph",content:[Is({id:mt,name:mt,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:To}}]})]},...t.content??[]]}}function _o(t){const e=P.c(30),{current:n,total:o,onPrev:r,onNext:V}=t,a=Q();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=B("p-0.5 classic:rounded transition-colors compact:rounded-lg",l),e[0]=l,e[1]=p):p=e[1];let d;e[2]!==a?(d=a("chat.pagination.previousLabel"),e[2]=a,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(yn,{size:14}),e[4]=c):c=e[4];let u;e[5]!==r||e[6]!==i||e[7]!==p||e[8]!==d?(u=s.jsx("button",{type:"button",onClick:r,disabled:i,className:p,"aria-label":d,children:c}),e[5]=r,e[6]=i,e[7]=p,e[8]=d,e[9]=u):u=e[9];const m=n+1;let h;e[10]!==a||e[11]!==m||e[12]!==o?(h=a("chat.pagination.counter",{current:m,total:o}),e[10]=a,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=B("p-0.5 classic:rounded transition-colors compact:rounded-lg",b),e[16]=b,e[17]=g):g=e[17];let A;e[18]!==a?(A=a("chat.pagination.nextLabel"),e[18]=a,e[19]=A):A=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(wt,{size:14}),e[20]=v):v=e[20];let j;e[21]!==V||e[22]!==x||e[23]!==g||e[24]!==A?(j=s.jsx("button",{type:"button",onClick:V,disabled:x,className:g,"aria-label":A,children:v}),e[21]=V,e[22]=x,e[23]=g,e[24]=A,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 Kt(t){const e=P.c(8),{currentIndex:n,total:o,onPrev:r,onNext:V,extraLeft:a}=t;let i;e[0]!==n||e[1]!==V||e[2]!==r||e[3]!==o?(i=s.jsx(_o,{current:n,total:o,onPrev:r,onNext:V}),e[0]=n,e[1]=V,e[2]=r,e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==a||e[6]!==i?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[i,a]}),e[5]=a,e[6]=i,e[7]=l):l=e[7],l}function Do(t){const e=P.c(17),{isStreaming:n,isAllAnswered:o,isCurrentAnswered:r,onAdvanceOrSubmit:V,submitLabel:a,nextLabel:i}=t,d=o?a===void 0?"Submit":a:i===void 0?"Next":i,c=o?n:!r,u=c?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let m;e[0]!==c||e[1]!==V?(m=()=>{c||V()},e[0]=c,e[1]=V,e[2]=m):m=e[2];const h=c&&"opacity-50 cursor-not-allowed";let f;e[3]!==h?(f=B("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(W,{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(Ee,{asChild:!0,children:b}),e[10]=b,e[11]=g):g=e[11];let A;e[12]!==u?(A=s.jsx(Fe,{children:u}),e[12]=u,e[13]=A):A=e[13];let v;return e[14]!==g||e[15]!==A?(v=s.jsxs(Le,{children:[g,A]}),e[14]=g,e[15]=A,e[16]=v):v=e[16],v}function Qt(t,e,n){return t.findIndex(o=>e(o)===n)}function ft(t,e,n,o){return t.length===0?!1:t.every(r=>o(n[e(r)]))}function ht(t,e,n,o,r){if(t.length===0)return null;const V=Qt(t,e,r);for(let a=1;a<=t.length;a++){const i=t[(V+a)%t.length];if(!i)continue;const l=e(i);if(l!==r&&!o(n[l]))return l}return null}function Ro(t){return!t.isStreaming&&t.allAnswered}function Yt(t){const{parts:e,partKey:n,schema:o,defaultValues:r,isStreaming:V,hasAnswer:a,onSubmit:i}=t,l=e[0]?n(e[0]):"",[p,d]=L.useState(l),[c,u]=L.useState(!1),m=Vs({resolver:is(o),defaultValues:r}),h=m.watch(),f=Qt(e,n,p),x=f>=0?e[f]:void 0,b=a(h[p]),g=ft(e,n,h,a),A=Ro({isStreaming:V,allAnswered:g}),v=()=>{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(),T=ht(e,n,_,a,p);T&&d(T)},y=()=>{m.handleSubmit(_=>{const T=_;for(const R of e)i(R,T[n(R)])})()},C=L.useRef(y);C.current=y;const S=()=>{A&&(u(!1),C.current())},N=()=>{const _=m.getValues();if(ft(e,n,_,a)){if(V){u(!0);return}u(!1),C.current()}else{const T=ht(e,n,_,a,p);T&&d(T)}};return L.useEffect(()=>{if(c&&!V){if(!g){u(!1);return}u(!1),C.current()}},[c,V,g]),{form:m,activeKey:p,setActiveKey:d,currentIndex:f,currentPart:x,isCurrentAnswered:b,isAllAnswered:g,canSubmit:A,goPrev:v,goNext:j,advanceToNextUnanswered:w,submit:S,submitOrAdvance:N}}const Gt="chat.approval.defaultDenyReason";function qt(t){const e=P.c(36),{onYolo:n}=t,o=Q(),[r,V]=Ae();let a,i,l,p,d,c,u,m,h;if(e[0]!==n||e[1]!==r||e[2]!==V||e[3]!==o){const v=ge.find(y=>y.value===r.toolApprovalLevel)??ge[0];let j;e[13]!==n||e[14]!==r||e[15]!==V?(j=y=>{const C=y,S=r.toolApprovalLevel??"readonly";V({...r,toolApprovalLevel:C}),C==="auto"&&n(S)},e[13]=n,e[14]=r,e[15]=V,e[16]=j):j=e[16];const w=j;l=gn,m=r.toolApprovalLevel,h=w,i=bn,d="xs",c="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",u=Po,a=An,p=o(v.shortKey),e[0]=n,e[1]=r,e[2]=V,e[3]=o,e[4]=a,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 a=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]!==a||e[18]!==p?(f=s.jsx(a,{children:p}),e[17]=a,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=ge.map(v=>s.jsx(xn,{value:v.value,children:o(v.labelKey)},v.value)),e[26]=o,e[27]=b):b=e[27];let g;e[28]!==b?(g=s.jsx(vn,{children:b}),e[28]=b,e[29]=g):g=e[29];let A;return e[30]!==l||e[31]!==g||e[32]!==m||e[33]!==h||e[34]!==x?(A=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]=A):A=e[35],A}function Po(t){return t.stopPropagation()}function Ht(t){const e=P.c(8),{input:n}=t,o=Q();if(n==null){let a;e[0]!==o?(a=o("chat.approval.noInput"),e[0]=o,e[1]=a):a=e[1];let i;return e[2]!==a?(i=s.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:a}),e[2]=a,e[3]=i):i=e[3],i}let r;try{let a;e[4]!==n?(a=JSON.stringify(n,null,2),e[4]=n,e[5]=a):a=e[5],r=a}catch{r=String(n)}let V;return e[6]!==r?(V=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:r})}),e[6]=r,e[7]=V):V=e[7],V}function Mo(t){const e=P.c(38),{approval:n,onRespond:o}=t,r=Q(),[V]=Ae(),a=V.toolApprovalLevel??"readonly";let i;e[0]!==n.approvalId||e[1]!==a||e[2]!==o||e[3]!==r?(i=()=>o(n.approvalId,!1,r(Gt),a),e[0]=n.approvalId,e[1]=a,e[2]=o,e[3]=r,e[4]=i):i=e[4];const l=i;let p;e[5]!==n.approvalId||e[6]!==a||e[7]!==o?(p=()=>o(n.approvalId,!0,void 0,a),e[5]=n.approvalId,e[6]=a,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(qt,{onYolo:u})}),e[12]=u,e[13]=m):m=e[13];const h=m;let f;e[14]!==r?(f=r("chat.approval.denyButton"),e[14]=r,e[15]=f):f=e[15];let x;e[16]!==l||e[17]!==f?(x=s.jsx(W,{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]!==r?(b=r("chat.approval.acceptButton"),e[19]=r,e[20]=b):b=e[20];let g;e[21]!==d||e[22]!==b?(g=s.jsx(W,{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 A;e[24]!==x||e[25]!==g?(A=s.jsxs(s.Fragment,{children:[x,g]}),e[24]=x,e[25]=g,e[26]=A):A=e[26];const v=A;let j;e[27]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Pe,{size:14}),e[27]=j):j=e[27];let w;e[28]!==r?(w=r("chat.approval.needsApproval"),e[28]=r,e[29]=w):w=e[29];let y;e[30]!==n.input?(y=s.jsx(Ht,{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]!==v||e[35]!==w||e[36]!==y?(C=s.jsx(ce,{icon:j,label:w,title:n.friendlyName,defaultExpanded:!0,footerLeft:h,footerRight:v,children:y}),e[32]=n.friendlyName,e[33]=h,e[34]=v,e[35]=w,e[36]=y,e[37]=C):C=e[37],C}const Eo=ls(Ce(),be({approved:cs().optional(),levelOverride:Ye(["auto","readonly"]).optional()}));function Fo(t){const e=P.c(46),{approvals:n,isStreaming:o,onRespond:r}=t,V=Q(),[a]=Ae(),i=a.toolApprovalLevel??"readonly";let l;e[0]!==n?(l=Object.fromEntries(n.map(Uo)),e[0]=n,e[1]=l):l=e[1];const p=l;let d;e[2]!==i||e[3]!==r||e[4]!==V?(d=(T,R)=>{const D=R;typeof D?.approved=="boolean"&&r(T.approvalId,D.approved,D.approved===!1?V(Gt):void 0,D.levelOverride??i)},e[2]=i,e[3]=r,e[4]=V,e[5]=d):d=e[5];let c;e[6]!==n||e[7]!==p||e[8]!==o||e[9]!==d?(c={parts:n,partKey:zo,schema:Eo,defaultValues:p,isStreaming:o,hasAnswer:Lo,onSubmit:d},e[6]=n,e[7]=p,e[8]=o,e[9]=d,e[10]=c):c=e[10];const u=Yt(c);let m;e[11]!==n||e[12]!==u?(m=T=>{u.form.reset(Object.fromEntries(n.map(R=>[R.approvalId,{approved:!0,levelOverride:T}]))),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=T=>{T.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(Pe,{size:14}),e[16]=g):g=e[16];let A;e[17]!==n.length||e[18]!==V?(A=V("chat.approval.batchedLabel",{count:n.length}),e[17]=n.length,e[18]=V,e[19]=A):A=e[19];const v=f?.friendlyName??"";let j;e[20]!==h?(j=s.jsx(qt,{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(Kt,{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(Bo,{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(Ht,{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]!==A||e[38]!==v?(S=s.jsx(ce,{icon:g,label:A,title:v,defaultExpanded:!0,footerLeft:w,footerRight:y,children:C}),e[34]=w,e[35]=y,e[36]=C,e[37]=A,e[38]=v,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(Qe,{...x,children:N}),e[43]=u.form,e[44]=N,e[45]=_):_=e[45],_}function Lo(t){return typeof t?.approved=="boolean"}function zo(t){return t.approvalId}function Uo(t){return[t.approvalId,{approved:void 0}]}function Bo(t){const e=P.c(7),{approvalId:n,control:o,onChange:r}=t,V=Q(),a=`${n}.approved`;let i;e[0]!==r||e[1]!==V?(i=p=>{const{field:d}=p,c=d.value===!0,u=d.value===!1;return s.jsxs(s.Fragment,{children:[s.jsx(W,{type:"button",variant:u?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!1),r()},"aria-pressed":u,children:V("chat.approval.denyButton")}),s.jsx(W,{type:"button",variant:c?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!0),r()},"aria-pressed":c,children:V("chat.approval.acceptButton")})]})},e[0]=r,e[1]=V,e[2]=i):i=e[2];let l;return e[3]!==o||e[4]!==a||e[5]!==i?(l=s.jsx(ds,{control:o,name:a,render:i}),e[3]=o,e[4]=a,e[5]=i,e[6]=l):l=e[6],l}function $o(){const t=P.c(5),e=Q();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Pe,{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 r;return t[3]!==o?(r=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]=r):r=t[4],r}function Oo(t){const e=P.c(8),{approvals:n,isStreaming:o,onRespond:r}=t;if(o&&n.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx($o,{}),e[0]=a):a=e[0],a}if(n.length===0)return null;if(n.length===1){const a=n[0];if(!a)return null;let i;return e[1]!==r||e[2]!==a?(i=s.jsx(Mo,{approval:a,onRespond:r}),e[1]=r,e[2]=a,e[3]=i):i=e[3],i}let V;return e[4]!==n||e[5]!==o||e[6]!==r?(V=s.jsx(Fo,{approvals:n,isStreaming:o,onRespond:r}),e[4]=n,e[5]=o,e[6]=r,e[7]=V):V=e[7],V}function Ko(t){const e=P.c(28),{plan:n,onApprove:o,onDismiss:r}=t,V=Q();let a;e[0]!==o||e[1]!==n.plan?(a=()=>{o(n.plan)},e[0]=o,e[1]=n.plan,e[2]=a):a=e[2];const i=a;let l;e[3]!==V?(l=V("chat.proposePlan.keepIterating"),e[3]=V,e[4]=l):l=e[4];let p;e[5]!==r||e[6]!==l?(p=s.jsx(W,{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:r,children:l}),e[5]=r,e[6]=l,e[7]=p):p=e[7];let d;e[8]!==V?(d=V("chat.proposePlan.letsGo"),e[8]=V,e[9]=d):d=e[9];let c;e[10]!==i||e[11]!==d?(c=s.jsx(W,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-special hover:bg-special/90 text-special-foreground 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(Nt,{size:14}),e[16]=h):h=e[16];let f;e[17]!==V?(f=V("chat.proposePlan.planReady"),e[17]=V,e[18]=f):f=e[18];let x;e[19]!==V?(x=V("chat.proposePlan.implementationPlan"),e[19]=V,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(jn,{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(ce,{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 Qo(t){const e=P.c(6),{plans:n,onApprove:o,onDismiss:r}=t;let V;e[0]!==n?(V=Bt(n),e[0]=n,e[1]=V):V=e[1];const a=V;if(!a)return null;let i;return e[2]!==a||e[3]!==o||e[4]!==r?(i=s.jsx(Ko,{plan:a,onApprove:o,onDismiss:r}),e[2]=a,e[3]=o,e[4]=r,e[5]=i):i=e[5],i}function Wt(t){return t?"response"in t?t.response:t.option??t.draft:""}const xt=be({response:Ce().min(1,"Response is required")}),Yo=be({option:Ce().nullable(),draft:Ce()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Go=be({response:Ye(["yes","no"])});function qo(t){switch(t.type){case"text":return xt;case"choice":return Yo;case"confirm":return Go;default:return xt}}function Ho(t){const e={};for(const n of t)e[n.toolCallId]=qo(n.input);return be(e)}function Wo(t){const e=P.c(7),{control:n,name:o,placeholder:r}=t,V=Q();let a;e[0]!==r||e[1]!==V?(a=l=>{const{field:p}=l,d=p.value??"";return s.jsxs(Je,{children:[s.jsx(Xe,{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(kt,{size:16,className:"text-muted-foreground"})}),s.jsx("input",{...p,value:d,type:"text",placeholder:r||V("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":V("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),s.jsx(et,{})]})},e[0]=r,e[1]=V,e[2]=a):a=e[2];let i;return e[3]!==n||e[4]!==o||e[5]!==a?(i=s.jsx(Dt,{control:n,name:o,render:a}),e[3]=n,e[4]=o,e[5]=a,e[6]=i):i=e[6],i}function Zt(t,e){const n=P.c(4);let o,r;n[0]!==t||n[1]!==e?(o=()=>{const V=a=>{const i=a.target.tagName;if(i==="INPUT"||i==="TEXTAREA"||a.metaKey||a.ctrlKey||a.altKey)return;const l=Number.parseInt(a.key,10);l>=1&&l<=t&&(a.preventDefault(),e(l-1))};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},r=[t,e],n[0]=t,n[1]=e,n[2]=o,n[3]=r):(o=n[2],r=n[3]),L.useEffect(o,r)}function Zo(t){const e=P.c(51),{control:n,name:o,options:r}=t,V=Q(),a=`${o}.option`;let i;e[0]!==n||e[1]!==a?(i={control:n,name:a,defaultValue:null},e[0]=n,e[1]=a,e[2]=i):i=e[2];const{field:l}=rt(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}=rt(d),u=l.value,m=c.value??"";let h;if(e[6]!==l||e[7]!==r?(h=M=>{const I=r[M];I!=null&&l.onChange(I)},e[6]=l,e[7]=r,e[8]=h):h=e[8],Zt(r.length,h),r.length===0)return null;const f=u===null;let x;e[9]!==V?(x=V("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=V,e[10]=x):x=e[10];let b;if(e[11]!==l||e[12]!==u||e[13]!==r||e[14]!==V){let M;e[16]!==l||e[17]!==u||e[18]!==V?(M=(I,F)=>{const U=u===I;return s.jsxs("button",{type:"button",onClick:()=>l.onChange(I),className:B("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":V("chat.userAskQuestion.selectOption",{option:I}),children:[s.jsx("span",{className:B("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]=V,e[19]=M):M=e[19],b=r.map(M),e[11]=l,e[12]=u,e[13]=r,e[14]=V,e[15]=b}else b=e[15];const g=f&&"bg-accent/50",A=!f&&"hover:bg-accent/30";let v;e[20]!==g||e[21]!==A?(v=B("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",g,A),e[20]=g,e[21]=A,e[22]=v):v=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(kt,{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=M=>{c.onChange(M.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]!==V?(S=V("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=V,e[32]=S):S=e[32];let N;e[33]!==V?(N=V("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=V,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 T;e[41]!==v||e[42]!==_?(T=s.jsxs("label",{className:v,children:[j,_]}),e[41]=v,e[42]=_,e[43]=T):T=e[43];let R;e[44]!==T||e[45]!==x||e[46]!==b?(R=s.jsx(Xe,{children:s.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":x,children:[b,T]})}),e[44]=T,e[45]=x,e[46]=b,e[47]=R):R=e[47];let D;e[48]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(et,{}),e[48]=D):D=e[48];let E;return e[49]!==R?(E=s.jsxs(Je,{children:[R,D]}),e[49]=R,e[50]=E):E=e[50],E}function Jo(t){const e=P.c(8),{control:n,name:o}=t,r=Q();let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=["yes","no"],e[0]=V):V=e[0];const a=V,i=L.useRef(null);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=c=>{i.current?.onChange(a[c]??"")},e[1]=l):l=e[1],Zt(a.length,l);let p;e[2]!==r?(p=c=>{const{field:u}=c;return i.current=u,s.jsxs(Je,{children:[s.jsx(Xe,{children:s.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(m=>{const h=u.value===m;return s.jsxs("button",{type:"button",onClick:()=>u.onChange(m),className:B("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":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${m==="yes"?"Yes":"No"}`)}),children:[s.jsx("span",{className:B("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:r(`chat.userAskQuestion.confirm${m==="yes"?"Yes":"No"}`)})]},m)})})}),s.jsx(et,{})]})},e[2]=r,e[3]=p):p=e[3];let d;return e[4]!==n||e[5]!==o||e[6]!==p?(d=s.jsx(Dt,{control:n,name:o,render:p}),e[4]=n,e[5]=o,e[6]=p,e[7]=d):d=e[7],d}function gt(t){const e=P.c(13),{input:n,control:o,toolCallId:r}=t;switch(n.type){case"text":{const V=`${r}.response`;let a;return e[0]!==o||e[1]!==n.default||e[2]!==V?(a=s.jsx(Wo,{control:o,name:V,placeholder:n.default}),e[0]=o,e[1]=n.default,e[2]=V,e[3]=a):a=e[3],a}case"choice":{let V;e[4]!==n.options?(V=n.options?.filter(Boolean)??[],e[4]=n.options,e[5]=V):V=e[5];const a=V;let i;return e[6]!==o||e[7]!==a||e[8]!==r?(i=s.jsx(Zo,{control:o,name:r,options:a}),e[6]=o,e[7]=a,e[8]=r,e[9]=i):i=e[9],i}case"confirm":{const V=`${r}.response`;let a;return e[10]!==o||e[11]!==V?(a=s.jsx(Jo,{control:o,name:V}),e[10]=o,e[11]=V,e[12]=a):a=e[12],a}default:return null}}function Xo(t){const e=P.c(91),{parts:n,isStreaming:o,onSubmit:r}=t;let V;e[0]!==n?(V=Ho(n.map(nr)),e[0]=n,e[1]=V):V=e[1];const a=V;let i;e[2]!==n?(i=Object.fromEntries(n.map(sr)),e[2]=n,e[3]=i):i=e[3];const l=i;let p;e[4]!==r?(p=($,z)=>{const Y=Wt(z);Y&&r($,Y)},e[4]=r,e[5]=p):p=e[5];let d;e[6]!==l||e[7]!==o||e[8]!==n||e[9]!==a||e[10]!==p?(d={parts:n,partKey:tr,schema:a,defaultValues:l,isStreaming:o,hasAnswer:er,onSubmit:p},e[6]=l,e[7]=o,e[8]=n,e[9]=a,e[10]=p,e[11]=d):d=e[11];const c=Yt(d),u=c.currentPart,m=Q();let h;e[12]!==u||e[13]!==c||e[14]!==m?(h=()=>{const $=u;if(!$)return;const z=m("chat.userAskQuestion.skipMessage"),Y=$.toolCallId;$.input?.type==="choice"?(c.form.setValue(`${Y}.option`,null),c.form.setValue(`${Y}.draft`,z)):c.form.setValue(`${Y}.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(Kt,{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 A;e[23]!==f||e[24]!==g?(A=s.jsx(W,{type:"button",variant:"outline",size:"sm",onClick:f,className:"h-7",children:g}),e[23]=f,e[24]=g,e[25]=A):A=e[25];let v;e[26]!==c.isAllAnswered||e[27]!==c.isCurrentAnswered||e[28]!==c.submitOrAdvance||e[29]!==o?(v=s.jsx(Do,{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]=v):v=e[30];let j;e[31]!==A||e[32]!==v?(j=s.jsxs(s.Fragment,{children:[A,v]}),e[31]=A,e[32]=v,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 Y;e[34]!==c?(Y=re=>{re.preventDefault(),c.submit()},e[34]=c,e[35]=Y):Y=e[35];let te;e[36]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(Ke,{size:14}),e[36]=te):te=e[36];let J;e[37]!==m?(J=m("chat.userAskQuestion.questionPending"),e[37]=m,e[38]=J):J=e[38];let se;e[39]!==$.input?.prompt||e[40]!==m?(se=$.input?.prompt??m("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=m,e[41]=se):se=e[41];const k=$.input;let K;e[42]!==c.form.control||e[43]!==$.toolCallId||e[44]!==k?(K=s.jsx(gt,{input:k,control:c.form.control,toolCallId:$.toolCallId}),e[42]=c.form.control,e[43]=$.toolCallId,e[44]=k,e[45]=K):K=e[45];let q;e[46]!==w||e[47]!==J||e[48]!==se||e[49]!==K?(q=s.jsx(ce,{icon:te,label:J,title:se,defaultExpanded:!0,footerRight:w,children:K}),e[46]=w,e[47]=J,e[48]=se,e[49]=K,e[50]=q):q=e[50];let Z;e[51]!==Y||e[52]!==q?(Z=s.jsx("form",{onSubmit:Y,autoComplete:"off",children:q}),e[51]=Y,e[52]=q,e[53]=Z):Z=e[53];let H;return e[54]!==c.form||e[55]!==Z?(H=s.jsx(Qe,{...z,children:Z}),e[54]=c.form,e[55]=Z,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(Ke,{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 T;e[62]!==n.length||e[63]!==m||e[64]!==_?(T=m("chat.userAskQuestion.questionCount",{current:_,total:n.length}),e[62]=n.length,e[63]=m,e[64]=_,e[65]=T):T=e[65];let R;e[66]!==u?.input?.prompt||e[67]!==m?(R=u?.input?.prompt??m("chat.userAskQuestion.question"),e[66]=u?.input?.prompt,e[67]=m,e[68]=R):R=e[68];const D=c.activeKey,E=c.setActiveKey;let M;if(e[69]!==c.form||e[70]!==n){let $;e[72]!==c.form?($=z=>s.jsx(Cn,{value:z.toolCallId,className:"mt-0",children:s.jsx(gt,{input:z.input,control:c.form.control,toolCallId:z.toolCallId})},z.toolCallId),e[72]=c.form,e[73]=$):$=e[73],M=n.map($),e[69]=c.form,e[70]=n,e[71]=M}else M=e[71];let I;e[74]!==c.activeKey||e[75]!==c.setActiveKey||e[76]!==M?(I=s.jsx(Nn,{value:D,onValueChange:E,children:M}),e[74]=c.activeKey,e[75]=c.setActiveKey,e[76]=M,e[77]=I):I=e[77];let F;e[78]!==b||e[79]!==w||e[80]!==N||e[81]!==T||e[82]!==R||e[83]!==I?(F=s.jsx(ce,{icon:S,label:N,count:T,title:R,defaultExpanded:!0,footerLeft:b,footerRight:w,children:I}),e[78]=b,e[79]=w,e[80]=N,e[81]=T,e[82]=R,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 G;return e[88]!==c.form||e[89]!==U?(G=s.jsx(Qe,{...y,children:U}),e[88]=c.form,e[89]=U,e[90]=G):G=e[90],G}function er(t){return!!Wt(t)}function tr(t){return t.toolCallId}function sr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function nr(t){return{toolCallId:t.toolCallId,input:t.input}}function or(){const t=P.c(5),e=Q();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ke,{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 r;return t[3]!==o?(r=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]=r):r=t[4],r}function Jt(t){const e=P.c(7),{userAskParts:n,isStreaming:o,onSubmit:r}=t;let V;e[0]!==n?(V=n.filter(rr),e[0]=n,e[1]=V):V=e[1];const a=V;if(a.length===0){if(o){let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(or,{}),e[2]=l):l=e[2],l}return null}let i;return e[3]!==o||e[4]!==r||e[5]!==a?(i=s.jsx(Xo,{parts:a,isStreaming:o,onSubmit:r}),e[3]=o,e[4]=r,e[5]=a,e[6]=i):i=e[6],i}function rr(t){return t.state==="input-available"}function ar(t){const e=P.c(33),{parts:n,isStreaming:o,onRespond:r}=t,V=Q();let a;e[0]!==n?(a=n.at(-1),e[0]=n,e[1]=a):a=e[1];const i=a,l=i?.input;if(!i||!l?.title)return null;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Nt,{size:14}),e[2]=p):p=e[2];let d;e[3]!==V?(d=V("chat.suggestTask.label"),e[3]=V,e[4]=d):d=e[4];const c=l.title;let u;e[5]!==r||e[6]!==i?(u=()=>r(i,!1),e[5]=r,e[6]=i,e[7]=u):u=e[7];let m;e[8]!==V?(m=V("chat.suggestTask.notNow"),e[8]=V,e[9]=m):m=e[9];let h;e[10]!==o||e[11]!==u||e[12]!==m?(h=s.jsx(W,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:o,onClick:u,children:m}),e[10]=o,e[11]=u,e[12]=m,e[13]=h):h=e[13];let f;e[14]!==r||e[15]!==i?(f=()=>r(i,!0),e[14]=r,e[15]=i,e[16]=f):f=e[16];let x;e[17]!==V?(x=V("chat.suggestTask.create"),e[17]=V,e[18]=x):x=e[18];let b;e[19]!==o||e[20]!==f||e[21]!==x?(b=s.jsx(W,{type:"button",size:"sm",className:"h-7",disabled:o,onClick:f,children:x}),e[19]=o,e[20]=f,e[21]=x,e[22]=b):b=e[22];let g;e[23]!==b||e[24]!==h?(g=s.jsxs(s.Fragment,{children:[h,b]}),e[23]=b,e[24]=h,e[25]=g):g=e[25];let A;e[26]!==l.summary?(A=l.summary?s.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:l.summary}):null,e[26]=l.summary,e[27]=A):A=e[27];let v;return e[28]!==l.title||e[29]!==g||e[30]!==A||e[31]!==d?(v=s.jsx(ce,{icon:p,label:d,title:c,defaultExpanded:!0,footerRight:g,children:A}),e[28]=l.title,e[29]=g,e[30]=A,e[31]=d,e[32]=v):v=e[32],v}function Vr(t){const e=t.filter(V=>V.status==="in_progress"),n=t.filter(V=>V.status==="completed").length,o=t.length;if(o>0&&n===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.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 ir(t){const e=P.c(13),{todos:n}=t;if(n.length===0)return null;let o;e[0]!==n?(o=Vr(n),e[0]=n,e[1]=o):o=e[1];const r=o;let V;e[2]!==r.icon?(V=s.jsx(ur,{status:r.icon}),e[2]=r.icon,e[3]=V):V=e[3];const a=r.activity,i=r.progress;let l;e[4]!==n?(l=n.map(lr),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]!==r.activity||e[9]!==r.progress||e[10]!==V||e[11]!==p?(d=s.jsx(ce,{icon:V,label:a,count:i,defaultExpanded:!1,children:p}),e[8]=r.activity,e[9]=r.progress,e[10]=V,e[11]=p,e[12]=d):d=e[12],d}function lr(t,e){return s.jsx(cr,{todo:t},e)}function cr(t){const e=P.c(14),{todo:n}=t,o=n.status==="completed",V=n.status==="in_progress"?n.activeForm:n.content;let a;e[0]!==n.status?(a=s.jsx(dr,{status:n.status}),e[0]=n.status,e[1]=a):a=e[1];const i=o&&"text-muted-foreground";let l;e[2]!==i?(l=B("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]!==V||e[8]!==l||e[9]!==c?(u=s.jsxs("span",{className:l,children:[V,c]}),e[7]=V,e[8]=l,e[9]=c,e[10]=u):u=e[10];let m;return e[11]!==a||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:[a,u]}),e[11]=a,e[12]=u,e[13]=m):m=e[13],m}function dr(t){const e=P.c(4),{status:n}=t,o=n==="completed"?"true":void 0,r=n==="in_progress"?"true":void 0;let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=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]=V):V=e[0];let a;return e[1]!==o||e[2]!==r?(a=s.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":r,"aria-hidden":"true",children:V}),e[1]=o,e[2]=r,e[3]=a):a=e[3],a}function ur(t){const e=P.c(13),{status:n}=t,o=Q();if(n==="completed"){let a;e[0]!==o?(a=o("chat.todoStatus.completed"),e[0]=o,e[1]=a):a=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]!==a?(l=s.jsx("span",{"aria-label":a,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:i}),e[3]=a,e[4]=l):l=e[4],l}if(n==="in_progress"){let a;e[5]!==o?(a=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=a):a=e[6];let i;return e[7]!==a?(i=s.jsx("span",{"aria-label":a,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=a,e[8]=i):i=e[8],i}let r;e[9]!==o?(r=o("chat.todoStatus.pending"),e[9]=o,e[10]=r):r=e[10];let V;return e[11]!==r?(V=s.jsx("span",{"aria-label":r,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=r,e[12]=V):V=e[12],V}const pr={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"}]},mr={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function fr(t){const e=P.c(46),{source:n,onDone:o}=t,r=Q(),V=us(),[a]=Ae(),[i,l]=L.useState(a.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]!==V?(h=async I=>{const{url:F}=await V.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:I,currency:i});return F},e[0]=i,e[1]=V,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]!==r?(x=I=>{Se.error(r("credits.topUp.failed",{message:I.message}))},e[5]=r,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:A}=ps(b);let v;e[11]!==i||e[12]!==n||e[13]!==g?(v=(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]=v):v=e[14];const j=v,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(ct,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),N=s.jsx(ct,{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(Fn,{type:"single",variant:"outline",size:"sm",value:i,onValueChange:C,children:[S,N]})}),e[18]=i,e[19]=_):_=e[19];const T=pr[i];let R;if(e[20]!==j||e[21]!==m||e[22]!==A||e[23]!==r||e[24]!==T){let I;e[26]!==j||e[27]!==m||e[28]!==A||e[29]!==r?(I=F=>{const{dollars:U,labelKey:G}=F;return s.jsxs("button",{type:"button",disabled:A,onClick:()=>j(U*100,mr[G]??"preset"),className:B("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:r(G)})]},U)},e[26]=j,e[27]=m,e[28]=A,e[29]=r,e[30]=I):I=e[30],R=T.map(I),e[20]=j,e[21]=m,e[22]=A,e[23]=r,e[24]=T,e[25]=R}else R=e[25];let D;e[31]!==R?(D=s.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:R}),e[31]=R,e[32]=D):D=e[32];let E;e[33]!==j||e[34]!==m||e[35]!==p||e[36]!==w||e[37]!==y||e[38]!==A||e[39]!==c||e[40]!==r?(E=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(En,{type:"number",min:"1",step:"1",placeholder:r("credits.topUp.customPlaceholder"),value:p,onChange:I=>d(I.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(W,{className:"h-10",disabled:!y||A,onClick:()=>j(Math.round(w*100),"custom"),children:r(A?"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:r("credits.topUp.enterCustom")}),e[33]=j,e[34]=m,e[35]=p,e[36]=w,e[37]=y,e[38]=A,e[39]=c,e[40]=r,e[41]=E):E=e[41];let M;return e[42]!==D||e[43]!==E||e[44]!==_?(M=s.jsxs("div",{children:[_,D,E]}),e[42]=D,e[43]=E,e[44]=_,e[45]=M):M=e[45],M}const hr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function xr(t){const e=P.c(47),{onDismiss:n}=t,{org:o}=Te(),r=Ge(),{decoKeyId:V}=Mn(),a=Q(),i=Ie("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=T=>!T&&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]!==a?(h=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=h):h=e[9];let f;e[10]!==h?(f=s.jsx(kn,{className:"text-xl font-semibold tracking-tight",children:h}),e[10]=h,e[11]=f):f=e[11];let x;e[12]!==a?(x=a("chat.creditsExhaustedBanner.description"),e[12]=a,e[13]=x):x=e[13];let b;e[14]!==x?(b=s.jsx(Sn,{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(Tn,{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 A;e[19]!==V||e[20]!==n||e[21]!==a?(A=V&&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(fr,{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:hr.map(T=>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(He,{size:12,className:"text-success"})}),s.jsx("span",{className:"text-sm text-foreground/80",children:a(T)})]},T))})]}),e[19]=V,e[20]=n,e[21]=a,e[22]=A):A=e[22];let v;e[23]!==a?(v=a("chat.creditsExhaustedBanner.dismiss"),e[23]=a,e[24]=v):v=e[24];let j;e[25]!==n||e[26]!==v?(j=s.jsx(W,{variant:"ghost",size:"sm",onClick:n,children:v}),e[25]=n,e[26]=v,e[27]=j):j=e[27];let w;e[28]!==r||e[29]!==n||e[30]!==o.slug?(w=()=>{r({to:"/$org/settings/ai-providers",params:{org:o.slug}}),n?.()},e[28]=r,e[29]=n,e[30]=o.slug,e[31]=w):w=e[31];let y;e[32]!==a?(y=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,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]!==A||e[42]!==S?(N=s.jsxs(In,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:gr,children:[g,A,S]}),e[40]=g,e[41]=A,e[42]=S,e[43]=N):N=e[43];let _;return e[44]!==N||e[45]!==d?(_=s.jsx(_n,{open:!0,onOpenChange:d,children:N}),e[44]=N,e[45]=d,e[46]=_):_=e[46],_}function gr(t){return t.preventDefault()}const br={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 Ar(t){const e=P.c(16),{kind:n,onDismiss:o,onSubscribe:r}=t,V=Q(),{label:a,title:i}=br[n];let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(qe,{size:14}),e[0]=l):l=e[0];let p;e[1]!==a||e[2]!==V?(p=V(a),e[1]=a,e[2]=V,e[3]=p):p=e[3];let d;e[4]!==V||e[5]!==i?(d=V(i),e[4]=V,e[5]=i,e[6]=d):d=e[6];let c;e[7]!==n||e[8]!==r||e[9]!==V?(c=n==="trial_exhausted"?s.jsx(W,{size:"sm",onClick:r,className:"h-7 text-xs",children:V("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=n,e[8]=r,e[9]=V,e[10]=c):c=e[10];let u;return e[11]!==o||e[12]!==p||e[13]!==d||e[14]!==c?(u=s.jsx(ce,{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 vr={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function bt(t){const e=P.c(21),{kind:n,onDismiss:o}=t,r=Q(),V=Ge(),{org:a}=Te(),{label:i,title:l}=vr[n];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(qe,{size:14}),e[0]=p):p=e[0];let d;e[1]!==i||e[2]!==r?(d=r(i),e[1]=i,e[2]=r,e[3]=d):d=e[3];let c;e[4]!==r||e[5]!==l?(c=r(l),e[4]=r,e[5]=l,e[6]=c):c=e[6];let u;e[7]!==V||e[8]!==o||e[9]!==a.slug?(u=()=>{V({to:"/$org/settings/ai-providers",params:{org:a.slug}}),o()},e[7]=V,e[8]=o,e[9]=a.slug,e[10]=u):u=e[10];let m;e[11]!==r?(m=r("chat.planRefused.seePlans"),e[11]=r,e[12]=m):m=e[12];let h;e[13]!==u||e[14]!==m?(h=s.jsx(W,{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(ce,{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 Xt(t){const e=yr(t);if(e!==null){const p=Xt(e);return{summary:p.summary,rawDetails:p.rawDetails??t}}const n=t.trim(),o=n.startsWith("<")&&/<[a-z][\s\S]*>/i.test(n),r=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(n),V=/failed to fetch|networkerror|load failed|offline/i.test(n),a=/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 r||o&&i?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:V?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:a?{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 yr(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:r}=n,V=typeof o=="string"?o:r;return typeof V=="string"&&V.trim()&&!V.trim().startsWith("{")?V:null}const jr={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Re(t){const e=P.c(29),n=Q(),{variant:o,onDismiss:r}=t,V=o==="error";let a;e[0]!==V||e[1]!==n?(a=n(V?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=V,e[1]=n,e[2]=a):a=e[2];const i=a,l=V?fn:fs;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=jr[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]!==V||e[9]!==d?(c=V?Xt(d):{summary:d,rawDetails:null},e[8]=V,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]!==V||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==n?(f=V?s.jsx(W,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:n("chat.highlight.fixInChat")}):s.jsx(W,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:n("chat.highlight.continue")}),e[13]=V,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(()=>Se.success(n("chat.highlight.copiedToClipboard"))).catch(()=>Se.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 classic:rounded-md compact:rounded-lg bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:s.jsx(hn,{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]!==r||e[23]!==u||e[24]!==h||e[25]!==f||e[26]!==x||e[27]!==o?(b=s.jsx(ce,{icon:h,label:i,title:u,defaultExpanded:!0,variant:o,onClose:r,footerRight:f,children:x}),e[21]=i,e[22]=r,e[23]=u,e[24]=h,e[25]=f,e[26]=x,e[27]=o,e[28]=b):b=e[28],b}function ze(){const t=P.c(70),e=Q(),{error:n,clearError:o,finishReason:r,clearFinishReason:V,messages:a,isStreaming:i,submit:l,sendMessage:p}=Ze(),[d,c]=Ae(),{virtualMcpId:u,createTaskWithMessage:m}=Zs(),{chatMode:h,simpleModeTier:f}=Me(),x=Ie("credits"),{mutate:b}=Un("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let g;t[0]!==b?(g=()=>b(),t[0]=b,t[1]=g):g=t[1];const A=g;let v;t[2]!==h||t[3]!==f||t[4]!==u?(v=ne=>({tier:f,mode:h,toolApprovalLevel:ne,agent:u?{id:u}:void 0}),t[2]=h,t[3]=f,t[4]=u,t[5]=v):v=t[5];const j=v;let w;t[6]!==d.toolApprovalLevel?(w=d.toolApprovalLevel??ms(),t[6]=d.toolApprovalLevel,t[7]=w):w=t[7];const y=w,C=a.at(-1),S=C?.role==="assistant"?C.parts:[],N=S.filter(Sr),_=S.filter(kr),T=$t(S),R=Ut(S);let D;t[8]!==n||t[9]!==p||t[10]!==e?(D=()=>{if(n){const fe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e("chat.highlight.fixInChatMessage",{error:n.message})}]}]};p(fe)}},t[8]=n,t[9]=p,t[10]=e,t[11]=D):D=t[11];const E=D;let M;t[12]!==p||t[13]!==e?(M=()=>{const ne={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e("chat.highlight.pleaseContinue")}]}]};p(ne)},t[12]=p,t[13]=e,t[14]=M):M=t[14];const I=M;let F;t[15]!==j||t[16]!==y||t[17]!==l?(F=(ne,fe)=>{l({kind:"toolOutput",toolCallId:ne.toolCallId,output:{response:fe}},j(y))},t[15]=j,t[16]=y,t[17]=l,t[18]=F):F=t[18];const U=F;let G;t[19]!==j||t[20]!==y||t[21]!==l?(G=(ne,fe)=>{l({kind:"toolOutput",toolCallId:ne.toolCallId,output:{accepted:fe}},j(y))},t[19]=j,t[20]=y,t[21]=l,t[22]=G):G=t[22];const $=G;let z;t[23]!==m||t[24]!==d||t[25]!==c||t[26]!==e||t[27]!==u?(z=ne=>{c({...d,toolApprovalLevel:"auto"}),m({virtualMcpId:u,message:{parts:[{type:"text",text:e("chat.highlight.implementPlanMessage",{plan:ne})}]}})},t[23]=m,t[24]=d,t[25]=c,t[26]=e,t[27]=u,t[28]=z):z=t[28];const Y=z,te=Nr;let J;t[29]!==j||t[30]!==l?(J=(ne,fe,Ne,Ue)=>{l({kind:"approval",approvalId:ne,approved:fe,...Ne?{reason:Ne}:{}},j(Ue))},t[29]=j,t[30]=l,t[31]=J):J=t[31];const se=J,k=Ot();if(k.isCreditExhausted){let ne;return t[32]!==x||t[33]!==o?(ne=x?s.jsx(xr,{onDismiss:o}):s.jsx("div",{className:"absolute bottom-full left-0 right-0",children:s.jsx(bt,{kind:"ai_budget_exhausted",onDismiss:o})}),t[32]=x,t[33]=o,t[34]=ne):ne=t[34],ne}const{showError:K,showWarning:q,hasApprovals:Z}=k,H=N.map(Cr).join("|"),re=Bt(T)?.toolCallId??"",Ve=R.map(wr).join("|"),ie="absolute bottom-full left-0 right-0";let ee;t[35]!==k.todos?(ee=s.jsx(ir,{todos:k.todos}),t[35]=k.todos,t[36]=ee):ee=t[36];let ae;t[37]!==o||t[38]!==k.subscriptionErrorKind||t[39]!==A?(ae=k.subscriptionErrorKind&&s.jsx(Ar,{kind:k.subscriptionErrorKind,onDismiss:o,onSubscribe:A}),t[37]=o,t[38]=k.subscriptionErrorKind,t[39]=A,t[40]=ae):ae=t[40];let oe;t[41]!==o||t[42]!==k.planRefusal?(oe=k.planRefusal&&s.jsx(bt,{kind:k.planRefusal,onDismiss:o}),t[41]=o,t[42]=k.planRefusal,t[43]=oe):oe=t[43];let de;t[44]!==o||t[45]!==n||t[46]!==E||t[47]!==K?(de=K&&s.jsx(Re,{variant:"error",error:n,onDismiss:o,onFixInChat:E}),t[44]=o,t[45]=n,t[46]=E,t[47]=K,t[48]=de):de=t[48];let xe;t[49]!==V||t[50]!==r||t[51]!==I||t[52]!==q?(xe=q&&s.jsx(Re,{variant:"warning",finishReason:r,onDismiss:V,onContinue:I}),t[49]=V,t[50]=r,t[51]=I,t[52]=q,t[53]=xe):xe=t[53];const ve=Z&&s.jsx(Oo,{approvals:R,isStreaming:i,onRespond:se},Ve),le=k.hasPlans&&s.jsx(Qo,{plans:T,isStreaming:i,onApprove:Y,onDismiss:te},re),ye=k.hasTaskSuggestion&&s.jsx(ar,{parts:_,isStreaming:i,onRespond:$},_.at(-1)?.toolCallId??"");let me;t[54]!==k.isWaitingForUserInput||t[55]!==U||t[56]!==i||t[57]!==H||t[58]!==N?(me=k.isWaitingForUserInput&&s.jsx(Jt,{userAskParts:N,isStreaming:i,onSubmit:U},H),t[54]=k.isWaitingForUserInput,t[55]=U,t[56]=i,t[57]=H,t[58]=N,t[59]=me):me=t[59];let ue;return t[60]!==ee||t[61]!==ae||t[62]!==oe||t[63]!==de||t[64]!==xe||t[65]!==ve||t[66]!==le||t[67]!==ye||t[68]!==me?(ue=s.jsxs("div",{className:ie,children:[ee,ae,oe,de,xe,ve,le,ye,me]}),t[60]=ee,t[61]=ae,t[62]=oe,t[63]=de,t[64]=xe,t[65]=ve,t[66]=le,t[67]=ye,t[68]=me,t[69]=ue):ue=t[69],ue}function wr(t){return t.approvalId}function Cr(t){return t.toolCallId}function Nr(){document.querySelector("[data-chat-input]")?.focus()}function kr(t){return t.type==="tool-suggest_task"&&t.state==="input-available"}function Sr(t){return t.type==="tool-user_ask"}ze.Error=function(e){return s.jsx(Re,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};ze.Warning=function(e){return s.jsx(Re,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};ze.UserAskQuestion=Jt;function Tr(t){const e=P.c(20),{taskId:n}=t,o=Q(),r=Js(n),V=Xs(r),a=en(),{stop:i,removeLocalMessage:l}=Ze();if(V.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(Ct,{size:14}),e[4]=c):c=e[4];let u;e[5]!==p||e[6]!==d?(u=s.jsx(Ee,{asChild:!0,children:s.jsx(W,{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(Fe,{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(Le,{delayDuration:400,children:[u,h]}),e[12]=u,e[13]=h,e[14]=f):f=e[14];let x;return e[15]!==a||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(W,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(n,b.messageId).then(A=>{A&&(tn(n,b.messageId),l(b.messageId))})},children:s.jsx(Bn,{className:"size-3.5"})})})]},b.messageId),e[15]=a,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(V.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:V.length})}),f]}),V.map(x)]})}function Ir(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 _r={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function Dr(t){const e=P.c(31),{tier:n,orgSlot:o,userSlot:r,autoSlot:V,onPick:a,onReset:i,onClose:l}=t,p=Q(),d=Ft(),c=new Set(d.map(Rr)),u=sn([r,o,V],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",A=_r[n];let v;e[0]!==p||e[1]!==A?(v=p(A),e[0]=p,e[1]=A,e[2]=v):v=e[2];let j;e[3]!==v?(j=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:v}),e[3]=v,e[4]=j):j=e[4];let w;e[5]!==i||e[6]!==p||e[7]!==r?(w=r&&s.jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 classic:rounded-md compact:rounded-lg hover:bg-accent cursor-pointer",children:p("chat.modelPreferences.reset")}),e[5]=i,e[6]=p,e[7]=r,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($n,{}),e[12]=N):N=e[12];const _=Xn,T=!0,R=Ir(m?u:null,b?.providerId??"deco");let D;e[13]!==x||e[14]!==a||e[15]!==f?(D=F=>{const U=F.keyId??x??"";f(U),a({keyId:U,modelId:F.modelId,title:F.title})},e[13]=x,e[14]=a,e[15]=f,e[16]=D):D=e[16];let E;e[17]!==_||e[18]!==x||e[19]!==l||e[20]!==f||e[21]!==R||e[22]!==D?(E=s.jsx(_,{compact:T,onClose:l,credentialId:x,onCredentialChange:f,selectedModel:R,onModelChange:D}),e[17]=_,e[18]=x,e[19]=l,e[20]=f,e[21]=R,e[22]=D,e[23]=E):E=e[23];let M;e[24]!==S||e[25]!==E||e[26]!==N?(M=s.jsx("div",{className:C,children:s.jsx(S,{fallback:N,children:E})}),e[24]=S,e[25]=E,e[26]=N,e[27]=M):M=e[27];let I;return e[28]!==M||e[29]!==y?(I=s.jsxs("div",{className:g,children:[y,M]}),e[28]=M,e[29]=y,e[30]=I):I=e[30],I}function Rr(t){return t.id}const Pr=["fast","smart","thinking"];function es(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const At={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function Mr(t){const e=P.c(28),{tier:n,pillIcon:o,groups:r}=t,V=Q();let a;e[0]!==V?(a=es(V),e[0]=V,e[1]=a):a=e[1];const i=a,[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=B("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=B("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(Rt,{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(Ee,{asChild:!0,children:s.jsx("span",{className:"inline-flex min-w-0 shrink",children:s.jsx(Pt,{asChild:!0,children:s.jsxs(W,{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 A;e[12]!==u?(A=s.jsx(Fe,{children:u}),e[12]=u,e[13]=A):A=e[13];let v;e[14]!==g||e[15]!==A?(v=s.jsxs(Le,{children:[g,A]}),e[14]=g,e[15]=A,e[16]=v):v=e[16];let j;if(e[17]!==r||e[18]!==V){let C;e[20]!==V?(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 classic:rounded-md compact:rounded-lg hover:bg-muted",children:[s.jsxs("button",{type:"button",role:"menuitem","aria-label":N.title,onClick:()=>c(N),className:B("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:V("chat.tierTrigger.selected"),children:s.jsx(He,{size:14,className:"text-foreground mt-0.5"})})]}),N.modelOverride&&s.jsx(Fr,{label:N.title,render:N.modelOverride})]},N.key))},S.key),e[20]=V,e[21]=C):C=e[21],j=r.map(C),e[17]=r,e[18]=V,e[19]=j}else j=e[19];let w;e[22]!==j?(w=s.jsx(Mt,{align:"end",className:"p-1 w-64",onOpenAutoFocus:Er,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]!==v||e[26]!==w?(y=s.jsxs(Et,{open:l,onOpenChange:p,children:[v,w]}),e[24]=l,e[25]=v,e[26]=w,e[27]=y):y=e[27],y}function Er(t){return t.preventDefault()}function Fr(t){const e=P.c(38),{label:n,render:o}=t,r=Q(),V=Hn(),[a,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]!==r?(d=r("chat.modelPreferences.customizeModel",{tier:n}),e[1]=n,e[2]=r,e[3]=d):d=e[3];const c=a&&"opacity-100";let u;e[4]!==c?(u=B("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 classic:rounded-md compact:rounded-lg 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(Qs,{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(V){let v;e[10]!==f?(v=s.jsx(Qn,{asChild:!0,children:f}),e[10]=f,e[11]=v):v=e[11];let j;e[12]!==n||e[13]!==r?(j=r("chat.modelPreferences.customizeModel",{tier:n}),e[12]=n,e[13]=r,e[14]=j):j=e[14];let w;e[15]!==j?(w=s.jsx(Yn,{className:"sr-only",children:j}),e[15]=j,e[16]=w):w=e[16];let y;e[17]!==a||e[18]!==o?(y=a&&o(p),e[17]=a,e[18]=o,e[19]=y):y=e[19];let C;e[20]!==y||e[21]!==w?(C=s.jsxs(Gn,{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]!==a||e[24]!==C||e[25]!==v?(S=s.jsxs(qn,{open:a,onOpenChange:i,children:[v,C]}),e[23]=a,e[24]=C,e[25]=v,e[26]=S):S=e[26],S}let x;e[27]!==f?(x=s.jsx(Pt,{asChild:!0,children:f}),e[27]=f,e[28]=x):x=e[28];let b;e[29]!==a||e[30]!==o?(b=a&&o(p),e[29]=a,e[30]=o,e[31]=b):b=e[31];let g;e[32]!==b?(g=s.jsx(Mt,{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 A;return e[34]!==a||e[35]!==x||e[36]!==g?(A=s.jsxs(Et,{open:a,onOpenChange:i,children:[x,g]}),e[34]=a,e[35]=x,e[36]=g,e[37]=A):A=e[37],A}function vt(t){return t==="fast"?s.jsx(qe,{size:16}):t==="thinking"?s.jsx(Ks,{size:16}):s.jsx(Wn,{size:16})}function Lr(t){const e=P.c(13),n=rn();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 r=o;let V;e[3]!==r?(V=r("fast"),e[3]=r,e[4]=V):V=e[4];let a;e[5]!==r?(a=r("smart"),e[5]=r,e[6]=a):a=e[6];let i;e[7]!==r?(i=r("thinking"),e[7]=r,e[8]=i):i=e[8];let l;return e[9]!==V||e[10]!==a||e[11]!==i?(l={fast:V,smart:a,thinking:i},e[9]=V,e[10]=a,e[11]=i,e[12]=l):l=e[12],l}function zr(){const t=P.c(23),e=Q(),{simpleModeTier:n,setSimpleModeTier:o}=Me(),r=Zn(),V=Ft(),a=Jn(V),i=Lr(a),{data:l,error:p}=nn();let d;t[0]!==l?(d=l===void 0?{tiers:{}}:l,t[0]=l,t[1]=d):d=t[1];const c=d,u=on(),m=Ie("model_choice"),h=Dn(),f=Rn();if(!h||!m)return null;let x,b;if(t[2]!==a||t[3]!==f||t[4]!==r||t[5]!==o||t[6]!==e||t[7]!==n||t[8]!==i||t[9]!==u||t[10]!==c||t[11]!==p){const w=es(e);x="decopilot",b=Pr.map(y=>{const C=i[y],S=c.tiers[y];return{key:`decopilot-${y}`,icon:vt(y),title:w[y],subtitle:f?C??e(At[y]):e(At[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(Dr,{tier:y,orgSlot:r.tiers[y],userSlot:S,autoSlot:a.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]=a,t[3]=f,t[4]=r,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 A=g;let v;t[17]!==n?(v=vt(n),t[17]=n,t[18]=v):v=t[18];let j;return t[19]!==A||t[20]!==v||t[21]!==n?(j=s.jsx(Mr,{tier:n,pillIcon:v,groups:A}),t[19]=A,t[20]=v,t[21]=n,t[22]=j):j=t[22],j}function ts(t){const e=P.c(3),[n]=Ae();let o;return e[0]!==n.enableSounds||e[1]!==t?(o=()=>{n.enableSounds&&co(t.dataUri).catch(V=>{console.warn(`[sound] ${t.name} playback failed:`,V)})},e[0]=n.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const Ur={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"},Br=Rs.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),$r=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Or(){const t=P.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:$r.map(Kr)}),t[0]=e):e=t[0],e}function Kr(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 Qr({disabled:t,onOpenConnections:e,virtualMcpId:n,selectedModel:o,isStreaming:r,onUnsupportedFile:V}){const a=Q(),[i,l]=L.useState(!1),p=ts(Ur),{org:d}=Te(),{editor:c}=jt(),u=L.useRef(null),m=tt(o),h=()=>{!m||r||(l(!1),u.current?.click())},f=async k=>{const K=k.target.files;if(!K||K.length===0||!c)return;const q=Array.from(K);try{let Z=c.state.selection.from;for(const H of q)await Lt(c,o??null,H,Z,V,a),Z=c.state.selection.to}finally{u.current&&(u.current.value="")}},x=ao({connectionId:n,orgId:d.id,orgSlug:d.slug}),b=hs.virtualMcpPrompts(n,d.id),{data:g,isLoading:A}=xs({queryKey:b,queryFn:()=>Vo(x),staleTime:6e4,enabled:i&&!!x}),v=g?.prompts??[],[j,w]=L.useState(null),{chatMode:y,setChatMode:C}=Me(),[S,N]=Ae(),_=ge.find(k=>k.value===S.toolApprovalLevel)??ge[0],T=a(_.shortKey),R=k=>{const K=ge.find(q=>q.value===k);if(K){if(K.value===S.toolApprovalLevel){l(!1);return}p(),X("chat_approval_level_changed",{from_level:S.toolApprovalLevel,to_level:K.value,source:"tools_popover"}),N({...S,toolApprovalLevel:K.value}),l(!1)}},D=y==="plan",E=()=>{p();const k=D?"default":"plan";X("chat_mode_changed",{from_mode:y,to_mode:k,source:"tools_popover"}),C(k),l(!1)},M=()=>{e(),l(!1)},I=async(k,K)=>{if(!c||!x)return;const q=dt(k._meta),Z={from:c.state.selection.from,to:c.state.selection.to};try{const H=await io(x,k.name,K);Ds(c,Z,{id:k.name,name:ro(k.name,q),metadata:H.messages,char:"/",kind:"prompt",args:K})}catch{Se.error(a("chat.toolsPopover.failedLoadPrompt"))}},F=async k=>{l(!1);const K=!!(k.arguments&&k.arguments.length>0);if(X("chat_prompt_inserted",{prompt_name:k.name,with_arguments:K}),K){w(k);return}await I(k)},U=async k=>{j&&(await I(j,k),w(null))},G=()=>{p();const k=y==="gen-image"?"default":"gen-image";X("chat_mode_changed",{from_mode:y,to_mode:k,source:"tools_popover"}),C(k),l(!1)},$=()=>{p();const k=y==="web-search"?"default":"web-search";X("chat_mode_changed",{from_mode:y,to_mode:k,source:"tools_popover"}),C(k),l(!1)},z=()=>{p();const k=y==="deep-research"?"default":"deep-research";X("chat_mode_changed",{from_mode:y,to_mode:k,source:"tools_popover"}),C(k),l(!1)},Y=y==="gen-image",te=y==="web-search",J=y==="deep-research",se=s.jsx("input",{ref:u,type:"file",multiple:!0,accept:On(o??null),className:"hidden",onChange:f,disabled:r});return s.jsxs(s.Fragment,{children:[se,s.jsxs(gs,{open:i,onOpenChange:k=>{k&&!i&&X("chat_tools_popover_opened",{chat_mode:y}),l(k)},children:[s.jsx(bs,{asChild:!0,children:s.jsxs(W,{type:"button",variant:"ghost",size:"default",disabled:t,title:a("chat.toolsPopover.tools"),"aria-label":a("chat.toolsPopover.tools"),className:B("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(Ys,{size:14}),s.jsx("span",{className:B("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:a("chat.toolsPopover.tools")})]})}),s.jsxs(As,{align:"start",className:"w-56 p-1.5 space-y-1",children:[m?s.jsxs(he,{onClick:h,disabled:r,children:[s.jsx(ut,{size:16}),s.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):s.jsxs(Le,{children:[s.jsx(Ee,{asChild:!0,children:s.jsxs(he,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:k=>k.preventDefault(),children:[s.jsx(ut,{size:16}),s.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),s.jsx(Fe,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),s.jsxs(he,{onClick:E,className:B(D&&"text-special"),children:[s.jsx(St,{size:16,className:B(D&&"text-special")}),s.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),s.jsx("span",{className:B("text-xs text-muted-foreground",D&&"text-special font-medium"),children:Br})]}),s.jsxs(he,{onClick:G,className:B(Y&&"text-special"),children:[s.jsx(_t,{size:16,className:B(Y&&"text-special")}),s.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),Y&&s.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),s.jsxs(he,{onClick:$,className:B(te&&"text-special"),children:[s.jsx(Tt,{size:16,className:B(te&&"text-special")}),s.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),te&&s.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),s.jsxs(he,{onClick:z,className:B(J&&"text-special"),children:[s.jsx(It,{size:16,className:B(J&&"text-special")}),s.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),J&&s.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),s.jsxs(at,{children:[s.jsxs(Vt,{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:a("chat.toolsPopover.prompts")})]}),s.jsx(it,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:A?s.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[s.jsx(vs,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):v.length===0?s.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):v.map(k=>s.jsxs(he,{onClick:()=>F(k),className:"flex flex-col items-start gap-0.5",children:[s.jsx("span",{className:"font-medium text-sm capitalize",children:k.title||oo(k.name,dt(k._meta))}),k.description&&s.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:k.description})]},k.name))})]}),s.jsxs(at,{children:[s.jsxs(Vt,{className:"gap-2",children:[s.jsx(Pe,{size:16}),s.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:T})]}),s.jsx(it,{className:"w-48 p-1.5",children:s.jsx(ys,{value:S.toolApprovalLevel,onValueChange:R,children:ge.map(k=>s.jsx(js,{value:k.value,children:a(k.labelKey)},k.value))})})]}),s.jsxs(he,{onClick:M,children:[s.jsx(lo,{size:16}),s.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),s.jsx(L.Suspense,{children:s.jsx(Or,{})})]})]})]}),s.jsx(_s,{prompt:j,setPrompt:w,onSubmit:U})]})}const Yr=[{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 Gr(){const t=P.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:Yr.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 Hr(t){const e=P.c(10),{onClick:n}=t,o=Q();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=B("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=r):r=e[0];let V;e[1]!==o?(V=o("chat.connectionsBanner.description"),e[1]=o,e[2]=V):V=e[2];let a;e[3]!==V?(a=s.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:V}),e[3]=V,e[4]=a):a=e[4];let i,l;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Gr,{}),l=s.jsx(ws,{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]!==a?(p=s.jsxs("button",{type:"button",onClick:n,className:r,children:[a,i,l]}),e[7]=n,e[8]=a,e[9]=p):p=e[9],p}const ke=48;function Wr(){const t=P.c(9),[e,n]=L.useState("idle"),[o,r]=L.useState(""),[V,a]=L.useState(""),[i,l]=L.useState(Xr),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(Jr),u.current?.getTracks().forEach(Zr),c.current=null,d.current=null,u.current=null},t[0]=g):g=t[0];const A=g;let v;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const _=T=>{u.current=T;const R=new AudioContext;d.current=R;const D=R.createMediaStreamSource(T),E=R.createAnalyser();E.fftSize=128,E.smoothingTimeConstant=.8,D.connect(E),c.current=E;const M=new Uint8Array(E.frequencyBinCount),I=()=>{if(!c.current)return;c.current.getByteFrequencyData(M);const F=[];for(let U=0;U<ke;U++){const G=Math.floor(U/ke*M.length);F.push(Math.max(.04,(M[G]??0)/255))}l(F),m.current=requestAnimationFrame(I)};I()};v=async()=>{const T=window.SpeechRecognition||window.webkitSpeechRecognition;if(!T)return n("unsupported"),"unsupported";let R;try{R=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return n("permission-denied"),"permission-denied"}r(""),a(""),x.current="",f.current="",h.current=!0,n("recording"),_(R);const D=new T;p.current=D,D.interimResults=!0,D.continuous=!0,D.lang=navigator.language||"en-US",D.onresult=E=>{if(p.current!==D)return;let M="",I="";for(let F=E.resultIndex;F<E.results.length;F++){const U=E.results[F],G=U?.[0]?.transcript??"";U?.isFinal?I=I+G:M=M+G}I&&(f.current=f.current+I,r(f.current)),x.current=M,a(M)},D.onerror=E=>{p.current===D&&E.error!=="no-speech"&&(h.current=!1,p.current=null,A(),n(E.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,A(),n("idle"),"idle"}return"recording"},t[1]=v}else v=t[1];const j=v;let w;t[2]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{h.current=!1,p.current?.stop(),A(),n("idle"),l(Array(ke).fill(.05)),a("");const _=(f.current+(x.current?" "+x.current:"")).trim();return r(""),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(),A(),n("idle"),r(""),a(""),l(Array(ke).fill(.05)),f.current="",x.current=""},t[3]=C):C=t[3];const S=C;let N;return t[4]!==V||t[5]!==e||t[6]!==o||t[7]!==i?(N={status:e,transcript:o,interimTranscript:V,waveformData:i,isSupported:b,startRecording:j,stopRecording:y,cancelRecording:S},t[4]=V,t[5]=e,t[6]=o,t[7]=i,t[8]=N):N=t[8],N}function Zr(t){return t.stop()}function Jr(){}function Xr(){return Array(ke).fill(.05)}function ea(t){const e=P.c(4),{data:n}=t;let o;e[0]!==n?(o=n.map(ta),e[0]=n,e[1]=o):o=e[1];let r;return e[2]!==o?(r=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]=r):r=e[3],r}function ta(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 sa(t){return t.hasDraft?"send":t.isStreaming||t.isRunInProgress?"stop":"disabled"}function _e(t){const e=P.c(7),{message:n,icon:o}=t;let r;e[0]!==o?(r=o??s.jsx(yt,{size:14,className:"shrink-0"}),e[0]=o,e[1]=r):r=e[1];const V=n??"";let a;e[2]!==V?(a=s.jsx("span",{className:"text-sm",children:V}),e[2]=V,e[3]=a):a=e[3];let i;return e[4]!==r||e[5]!==a?(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:[r,a]}),e[4]=r,e[5]=a,e[6]=i):i=e[6],i}function na(t,e,n){const o=P.c(7),{editor:r}=jt(),V=Q(),[a,i]=L.useState(!1),l=L.useRef(0);let p,d;return o[0]!==n||o[1]!==r||o[2]!==e||o[3]!==t||o[4]!==V?(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=oa,h=f=>{if(f.preventDefault(),l.current=0,i(!1),n||!r||!t||!tt(t))return;const x=f.dataTransfer?.files;if(!x||x.length===0)return;const b=Array.from(x);(async()=>{let g=r.state.selection.from;for(const A of b)await Lt(r,t,A,g,e,V),g=r.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=[r,t,e,V,n],o[0]=n,o[1]=r,o[2]=e,o[3]=t,o[4]=V,o[5]=p,o[6]=d):(p=o[5],d=o[6]),L.useEffect(p,d),a}function oa(t){t.dataTransfer?.types.includes("Files")&&t.preventDefault()}function ra(t){const e=P.c(14),{selectedModel:n}=t,o=Q();let r,V,a;if(e[0]!==n||e[1]!==o){const{parts:p}=Kn(n);e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ws,{size:24}),e[5]=a):a=e[5],r="text-sm font-medium";let d;e[6]!==o?(d=c=>o(c),e[6]=o,e[7]=d):d=e[7],V=o("chat.input.dropFilesHere",{fileTypes:p.map(d).join(", ")}),e[0]=n,e[1]=o,e[2]=r,e[3]=V,e[4]=a}else r=e[2],V=e[3],a=e[4];let i;e[8]!==r||e[9]!==V?(i=s.jsx("span",{className:r,children:V}),e[8]=r,e[9]=V,e[10]=i):i=e[10];let l;return e[11]!==a||e[12]!==i?(l=s.jsxs(s.Fragment,{children:[a,i]}),e[11]=a,e[12]=i,e[13]=l):l=e[13],l}function aa(){const t=P.c(5),e=Q();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(yt,{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 r;return t[3]!==o?(r=s.jsxs(s.Fragment,{children:[n,s.jsx("span",{className:"text-sm font-medium",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function Va(t){const e=P.c(11),{selectedModel:n,onUnsupportedFile:o,disabled:r}=t,V=na(n,o,r);let a;e[0]!==n?(a=tt(n),e[0]=n,e[1]=a):a=e[1];const i=a,l=V?"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=B("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(ra,{selectedModel:n}):s.jsx(aa,{}),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 De(t){const e=P.c(14),{onClick:n,label:o,icon:r,colorClass:V,maxWidthClass:a}=t;let i;e[0]!==V?(i=B("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",V),e[0]=V,e[1]=i):i=e[1];let l;e[2]!==a?(l=B("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:opacity-100",a),e[2]=a,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(We,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"}),e[7]=d):d=e[7];let c;return e[8]!==r||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:[r,p,d]}),e[8]=r,e[9]=o,e[10]=n,e[11]=i,e[12]=p,e[13]=c):c=e[13],c}function ia(){const t=P.c(6),e=Ge(),{org:n,locator:o}=Te(),{create:r}=mn();let V;return t[0]!==r||t[1]!==o||t[2]!==e||t[3]!==n.id||t[4]!==n.slug?(V=async a=>{const{tiptapDoc:i,virtualMcp:l,taskIntake:p}=a,d=p===void 0?!1:p,c=crypto.randomUUID(),u=l?.id??Oe(n.id).id;Es(sessionStorage,o,c,{tiptapDoc:d&&i?Io(i):i});try{await r({id:c,virtual_mcp_id:u})}catch{}const m={autosend:Fs};d&&(m.sidepanel=!0,m.mainpanel=!1),Ss(e,Ts({org:n.slug,agentId:u,superAgentId:Oe(n.id).id}),{search:()=>({...m,thread:c}),replace:!1})},t[0]=r,t[1]=o,t[2]=e,t[3]=n.id,t[4]=n.slug,t[5]=V):V=t[5],V}function uV({onOpenContextPanel:t,showConnectionsBanner:e=!1,homeTaskComposer:n=!1}){const o=Q(),r=an(),V=Vn(),a=r?.messages??[],i=r?.isStreaming??!1,l=r?.isRunInProgress??!1,p=r?.stop??(()=>{}),d=V?.taskId??"",c=d||$s,u=ia(),{selectedModel:m,selectedVirtualMcp:h,isModelsLoading:f,tiptapDocRef:x,imageModel:b,webSearchModel:g,deepResearchModel:A,chatMode:v,setChatMode:j}=Me(),{data:w}=Cs.useSession(),y=w?.user?.id,{org:C,locator:S}=Te(),[N,_]=Ns(ks.homeTaskMode(S),!0),T=n&&N,R=Oe(C.id).id,D=Ms(h?.id),E=Os(D?.id).runtime==="cms",M=ts(uo),[I,F]=L.useState(!1),{unsupportedFile:U,onUnsupportedFile:G,clearUnsupportedFile:$}=eo(),z=Wr(),Y=L.useRef(void 0),te=async()=>{Y.current=ee;const O=await z.startRecording();X("chat_voice_started",{thread_id:d,outcome:O==="recording"?"started":O==="unsupported"?"unsupported":O==="permission-denied"?"permission_denied":"unknown"})},J=()=>{X("chat_voice_confirmed",{thread_id:d});const O=z.stopRecording();le.current?.syncVoiceText(Y.current,O),le.current?.focus()},se=()=>{X("chat_voice_cancelled",{thread_id:d}),z.cancelRecording(),le.current?.restoreContent(Y.current)};L.useEffect(()=>{if(z.status!=="recording")return;const O=(z.transcript+(z.interimTranscript?" "+z.interimTranscript:"")).trim();le.current?.syncVoiceText(Y.current,O)},[z.transcript,z.interimTranscript,z.status]);const k=V?.activeTask??null,K=k?.created_by,q=!!(y&&K&&K!==y),{data:Z}=mo({enabled:q}),H=(Z?.data?.members??[]).find(O=>O.userId===K),re=H?.user?.name??H?.user?.email?.split("@")[0]??null,Ve=ho(),ie=ln({isDesktopApp:Ve,harnessId:k?.harness_id}),[ee,ae]=L.useState(()=>lt(sessionStorage,S,c)??void 0),oe=O=>{ae(O),x.current=O,Bs(sessionStorage,S,c,O,{onQuotaExceeded:({docSizeBytes:pe})=>{X("chat_draft_quota_exceeded",{thread_id:d||null,doc_size_bytes:pe}),console.warn("[chat-draft] sessionStorage quota exceeded; draft not saved")}})},de=L.useRef(d);if(de.current!==d){de.current=d;const O=lt(sessionStorage,S,c)??void 0;ae(O),x.current=O}const ve=[...a].reverse().find(O=>O.role==="assistant")?.metadata?.modelLimits?.contextWindow??m?.limits?.contextWindow,le=L.useRef(null),ye=L.useRef(!1),me=v==="plan",ue=O=>{M(),X("chat_mode_changed",{from_mode:O,to_mode:"default",source:"pill_dismiss"}),j("default")};L.useEffect(()=>{const O=pe=>{Ps(pe)&&pe.code==="KeyL"&&(pe.preventDefault(),pe.shiftKey&&j(v==="plan"?"default":"plan"),le.current?.focus())};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[v,j]);const ne=cn(a),Ne=[...a].reverse().find(O=>O.role==="assistant"&&O.metadata?.usage)?.metadata?.usage?.contextTokens??0,Ue=Ie("chat"),ss=Pn(),[ns,st]=L.useState(!1),[os,nt]=L.useState(!1),rs=!f&&!zs(ee),je=sa({hasDraft:rs,isStreaming:i,isRunInProgress:l}),Be=je==="send",we=je==="stop",ot=O=>{if(O?.preventDefault(),!Ue){st(!0);return}if(ss){nt(!0);return}if(je==="send"&&ee){if(X("chat_message_sent",{thread_id:d||null,mode:v,model_id:m?.modelId??null,model_provider:m?.providerId??null,virtual_mcp_id:h?.id??null,submission:O?"button_or_enter":"programmatic"}),r){if(r.isSendInFlight()){Se.info(o("chat.input.stillSendingPreviousMessage"));return}r.sendMessage(ee)}else T&&X("task_report_submitted",{source:"home"}),u({tiptapDoc:ee,virtualMcp:T?null:h,taskIntake:T});Us(sessionStorage,S,c),oe(void 0)}else je==="stop"&&(X("chat_message_stopped",{thread_id:d}),p())};if(q)return s.jsx(_e,{message:re?o("chat.input.readOnlyOthersChatNamed",{name:re}):o("chat.input.readOnlyOthersChat"),icon:re?s.jsx(po,{shape:"circle",size:"2xs",url:H?.user?.image??void 0,fallback:re.slice(0,2).toUpperCase()}):void 0});if(k?.metadata?.read_only)return s.jsx(_e,{message:o("chat.input.readOnlyThread")});if(ie)return s.jsx(_e,{message:o("chat.input.codingAgentRequiresDesktop")});if(E){if(!V)return s.jsx(_e,{message:o("chat.input.fastPreviewUnavailable")});const O=()=>{const pe=V.createTask({runtime:"sandbox"});X("coding_session_started",{thread_id:pe})};return s.jsxs("button",{type:"button",onClick:O,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(Gs,{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(wt,{size:16,className:"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]})}return s.jsxs(s.Fragment,{children:[ns&&s.jsx(pt,{feature:"chat",onDismiss:()=>st(!1)}),os&&s.jsx(pt,{feature:"chat",copy:{title:o("chat.input.allowanceExhaustedTitle")},onDismiss:()=>nt(!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"}),r&&V&&s.jsx(ze,{}),r&&V&&d?s.jsx(Tr,{taskId:d}):null,s.jsx(to,{tiptapDoc:ee,setTiptapDoc:oe,disabled:z.status==="recording",enterToSubmit:!0,placeholder:o(T?"chat.input.taskPlaceholder":"chat.input.placeholder"),onSubmit:ot,suggestionOpenRef:ye,children:s.jsxs("form",{onSubmit:ot,className:B("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(Va,{selectedModel:m,onUnsupportedFile:G,disabled:z.status==="recording"}),s.jsx("div",{className:"group/input relative flex flex-col gap-2 flex-1",children:s.jsx(so,{ref:le,disabled:z.status==="recording",virtualMcpId:h?.id??R,showFileUploader:!0,selectedModel:m,onUnsupportedFile:G,suggestionOpenRef:ye})}),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(ea,{data:z.waveformData.slice(0,28)}),s.jsx("button",{type:"button",onClick:se,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(We,{size:16})}),s.jsx("button",{type:"button",onClick:J,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(He,{size:16})})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[n&&s.jsx(W,{type:"button",size:"sm",variant:N?"secondary":"ghost","aria-pressed":N,onClick:()=>_(!N),className:"h-8",children:o("chat.input.taskMode")}),s.jsx(Qr,{disabled:!1,onOpenConnections:()=>{X("connections_dialog_opened",{source:"tools_popover",mode:"add"}),F(!0)},virtualMcpId:h?.id??R,selectedModel:m,isStreaming:i,onUnsupportedFile:G}),me&&s.jsx(De,{onClick:()=>ue("plan"),label:o("chat.input.planMode"),icon:s.jsx(St,{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"}),v==="gen-image"&&b&&s.jsx(De,{onClick:()=>ue("gen-image"),label:o("chat.input.createImage"),icon:s.jsx(_t,{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]"}),v==="web-search"&&g&&s.jsx(De,{onClick:()=>ue("web-search"),label:o("chat.input.webSearch"),icon:s.jsx(Tt,{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]"}),v==="deep-research"&&A&&s.jsx(De,{onClick:()=>ue("deep-research"),label:o("chat.input.deepResearch"),icon:s.jsx(It,{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]"}),ve&&Ne>0&&s.jsx(wn,{usage:ne,totalTokens:Ne,contextWindow:ve,onOpenContextPanel:t})]}),s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(zr,{}),z.isSupported&&s.jsx(W,{type:"button",onClick:te,disabled:!1,variant:"ghost",size:"icon",className:B("size-8 classic: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(qs,{size:18})}),s.jsx(W,{type:we?"button":"submit",onClick:O=>{we&&(O.preventDefault(),O.stopPropagation(),p())},variant:Be||we?"default":"ghost",size:T?"sm":"icon",disabled:!Be&&!we,className:B(T?"h-8 px-3 classic:rounded-lg transition-all":"size-8 classic:rounded-lg transition-all",!Be&&!we&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed"),title:o(je==="stop"?i?"chat.input.stopGenerating":"chat.input.cancelRun":T?"chat.input.startTask":"chat.input.sendMessageEnter"),"aria-label":o(je==="stop"?i?"chat.input.stopGenerating":"chat.input.cancelRun":T?"chat.input.startTask":"chat.input.sendMessage"),children:we?s.jsx(Hs,{size:20}):s.jsxs(s.Fragment,{children:[T&&o("chat.input.startTask"),s.jsx(Ct,{size:20})]})})]})]})})]})},d),n&&T&&s.jsx("p",{className:"px-3 pt-3 text-left text-xs text-muted-foreground",children:o("chat.input.taskHint")}),e&&s.jsx(Hr,{onClick:()=>{X("connections_banner_clicked",{source:"home_chat_input"}),X("connections_dialog_opened",{source:"home_banner",mode:"add"}),F(!0)}})]})}),s.jsx(fo,{mode:"browse",open:I,onOpenChange:F,defaultTab:"all"}),s.jsx(no,{info:U,onClose:$})]})}export{uV as C,cV as H,fr as T,xr as a,dV as u};
8
+ The report follows.`;function Io(t){return{...t,content:[{type:"paragraph",content:[Is({id:mt,name:mt,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:To}}]})]},...t.content??[]]}}function _o(t){const e=P.c(30),{current:n,total:o,onPrev:r,onNext:V}=t,a=Q();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=B("p-0.5 classic:rounded transition-colors compact:rounded-lg",l),e[0]=l,e[1]=p):p=e[1];let d;e[2]!==a?(d=a("chat.pagination.previousLabel"),e[2]=a,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(yn,{size:14}),e[4]=c):c=e[4];let u;e[5]!==r||e[6]!==i||e[7]!==p||e[8]!==d?(u=s.jsx("button",{type:"button",onClick:r,disabled:i,className:p,"aria-label":d,children:c}),e[5]=r,e[6]=i,e[7]=p,e[8]=d,e[9]=u):u=e[9];const m=n+1;let h;e[10]!==a||e[11]!==m||e[12]!==o?(h=a("chat.pagination.counter",{current:m,total:o}),e[10]=a,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=B("p-0.5 classic:rounded transition-colors compact:rounded-lg",b),e[16]=b,e[17]=g):g=e[17];let A;e[18]!==a?(A=a("chat.pagination.nextLabel"),e[18]=a,e[19]=A):A=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(wt,{size:14}),e[20]=v):v=e[20];let j;e[21]!==V||e[22]!==x||e[23]!==g||e[24]!==A?(j=s.jsx("button",{type:"button",onClick:V,disabled:x,className:g,"aria-label":A,children:v}),e[21]=V,e[22]=x,e[23]=g,e[24]=A,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 Kt(t){const e=P.c(8),{currentIndex:n,total:o,onPrev:r,onNext:V,extraLeft:a}=t;let i;e[0]!==n||e[1]!==V||e[2]!==r||e[3]!==o?(i=s.jsx(_o,{current:n,total:o,onPrev:r,onNext:V}),e[0]=n,e[1]=V,e[2]=r,e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==a||e[6]!==i?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[i,a]}),e[5]=a,e[6]=i,e[7]=l):l=e[7],l}function Do(t){const e=P.c(17),{isStreaming:n,isAllAnswered:o,isCurrentAnswered:r,onAdvanceOrSubmit:V,submitLabel:a,nextLabel:i}=t,d=o?a===void 0?"Submit":a:i===void 0?"Next":i,c=o?n:!r,u=c?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let m;e[0]!==c||e[1]!==V?(m=()=>{c||V()},e[0]=c,e[1]=V,e[2]=m):m=e[2];const h=c&&"opacity-50 cursor-not-allowed";let f;e[3]!==h?(f=B("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(H,{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(Ee,{asChild:!0,children:b}),e[10]=b,e[11]=g):g=e[11];let A;e[12]!==u?(A=s.jsx(Fe,{children:u}),e[12]=u,e[13]=A):A=e[13];let v;return e[14]!==g||e[15]!==A?(v=s.jsxs(Le,{children:[g,A]}),e[14]=g,e[15]=A,e[16]=v):v=e[16],v}function Qt(t,e,n){return t.findIndex(o=>e(o)===n)}function ft(t,e,n,o){return t.length===0?!1:t.every(r=>o(n[e(r)]))}function ht(t,e,n,o,r){if(t.length===0)return null;const V=Qt(t,e,r);for(let a=1;a<=t.length;a++){const i=t[(V+a)%t.length];if(!i)continue;const l=e(i);if(l!==r&&!o(n[l]))return l}return null}function Ro(t){return!t.isStreaming&&t.allAnswered}function Yt(t){const{parts:e,partKey:n,schema:o,defaultValues:r,isStreaming:V,hasAnswer:a,onSubmit:i}=t,l=e[0]?n(e[0]):"",[p,d]=L.useState(l),[c,u]=L.useState(!1),m=Vs({resolver:is(o),defaultValues:r}),h=m.watch(),f=Qt(e,n,p),x=f>=0?e[f]:void 0,b=a(h[p]),g=ft(e,n,h,a),A=Ro({isStreaming:V,allAnswered:g}),v=()=>{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(),T=ht(e,n,_,a,p);T&&d(T)},y=()=>{m.handleSubmit(_=>{const T=_;for(const R of e)i(R,T[n(R)])})()},C=L.useRef(y);C.current=y;const S=()=>{A&&(u(!1),C.current())},N=()=>{const _=m.getValues();if(ft(e,n,_,a)){if(V){u(!0);return}u(!1),C.current()}else{const T=ht(e,n,_,a,p);T&&d(T)}};return L.useEffect(()=>{if(c&&!V){if(!g){u(!1);return}u(!1),C.current()}},[c,V,g]),{form:m,activeKey:p,setActiveKey:d,currentIndex:f,currentPart:x,isCurrentAnswered:b,isAllAnswered:g,canSubmit:A,goPrev:v,goNext:j,advanceToNextUnanswered:w,submit:S,submitOrAdvance:N}}const Gt="chat.approval.defaultDenyReason";function qt(t){const e=P.c(36),{onYolo:n}=t,o=Q(),[r,V]=Ae();let a,i,l,p,d,c,u,m,h;if(e[0]!==n||e[1]!==r||e[2]!==V||e[3]!==o){const v=ge.find(y=>y.value===r.toolApprovalLevel)??ge[0];let j;e[13]!==n||e[14]!==r||e[15]!==V?(j=y=>{const C=y,S=r.toolApprovalLevel??"readonly";V({...r,toolApprovalLevel:C}),C==="auto"&&n(S)},e[13]=n,e[14]=r,e[15]=V,e[16]=j):j=e[16];const w=j;l=gn,m=r.toolApprovalLevel,h=w,i=bn,d="xs",c="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",u=Po,a=An,p=o(v.shortKey),e[0]=n,e[1]=r,e[2]=V,e[3]=o,e[4]=a,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 a=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]!==a||e[18]!==p?(f=s.jsx(a,{children:p}),e[17]=a,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=ge.map(v=>s.jsx(xn,{value:v.value,children:o(v.labelKey)},v.value)),e[26]=o,e[27]=b):b=e[27];let g;e[28]!==b?(g=s.jsx(vn,{children:b}),e[28]=b,e[29]=g):g=e[29];let A;return e[30]!==l||e[31]!==g||e[32]!==m||e[33]!==h||e[34]!==x?(A=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]=A):A=e[35],A}function Po(t){return t.stopPropagation()}function Wt(t){const e=P.c(8),{input:n}=t,o=Q();if(n==null){let a;e[0]!==o?(a=o("chat.approval.noInput"),e[0]=o,e[1]=a):a=e[1];let i;return e[2]!==a?(i=s.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:a}),e[2]=a,e[3]=i):i=e[3],i}let r;try{let a;e[4]!==n?(a=JSON.stringify(n,null,2),e[4]=n,e[5]=a):a=e[5],r=a}catch{r=String(n)}let V;return e[6]!==r?(V=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:r})}),e[6]=r,e[7]=V):V=e[7],V}function Mo(t){const e=P.c(38),{approval:n,onRespond:o}=t,r=Q(),[V]=Ae(),a=V.toolApprovalLevel??"readonly";let i;e[0]!==n.approvalId||e[1]!==a||e[2]!==o||e[3]!==r?(i=()=>o(n.approvalId,!1,r(Gt),a),e[0]=n.approvalId,e[1]=a,e[2]=o,e[3]=r,e[4]=i):i=e[4];const l=i;let p;e[5]!==n.approvalId||e[6]!==a||e[7]!==o?(p=()=>o(n.approvalId,!0,void 0,a),e[5]=n.approvalId,e[6]=a,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(qt,{onYolo:u})}),e[12]=u,e[13]=m):m=e[13];const h=m;let f;e[14]!==r?(f=r("chat.approval.denyButton"),e[14]=r,e[15]=f):f=e[15];let x;e[16]!==l||e[17]!==f?(x=s.jsx(H,{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]!==r?(b=r("chat.approval.acceptButton"),e[19]=r,e[20]=b):b=e[20];let g;e[21]!==d||e[22]!==b?(g=s.jsx(H,{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 A;e[24]!==x||e[25]!==g?(A=s.jsxs(s.Fragment,{children:[x,g]}),e[24]=x,e[25]=g,e[26]=A):A=e[26];const v=A;let j;e[27]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Pe,{size:14}),e[27]=j):j=e[27];let w;e[28]!==r?(w=r("chat.approval.needsApproval"),e[28]=r,e[29]=w):w=e[29];let y;e[30]!==n.input?(y=s.jsx(Wt,{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]!==v||e[35]!==w||e[36]!==y?(C=s.jsx(ce,{icon:j,label:w,title:n.friendlyName,defaultExpanded:!0,footerLeft:h,footerRight:v,children:y}),e[32]=n.friendlyName,e[33]=h,e[34]=v,e[35]=w,e[36]=y,e[37]=C):C=e[37],C}const Eo=ls(Ce(),be({approved:cs().optional(),levelOverride:Ye(["auto","readonly"]).optional()}));function Fo(t){const e=P.c(46),{approvals:n,isStreaming:o,onRespond:r}=t,V=Q(),[a]=Ae(),i=a.toolApprovalLevel??"readonly";let l;e[0]!==n?(l=Object.fromEntries(n.map(Uo)),e[0]=n,e[1]=l):l=e[1];const p=l;let d;e[2]!==i||e[3]!==r||e[4]!==V?(d=(T,R)=>{const D=R;typeof D?.approved=="boolean"&&r(T.approvalId,D.approved,D.approved===!1?V(Gt):void 0,D.levelOverride??i)},e[2]=i,e[3]=r,e[4]=V,e[5]=d):d=e[5];let c;e[6]!==n||e[7]!==p||e[8]!==o||e[9]!==d?(c={parts:n,partKey:zo,schema:Eo,defaultValues:p,isStreaming:o,hasAnswer:Lo,onSubmit:d},e[6]=n,e[7]=p,e[8]=o,e[9]=d,e[10]=c):c=e[10];const u=Yt(c);let m;e[11]!==n||e[12]!==u?(m=T=>{u.form.reset(Object.fromEntries(n.map(R=>[R.approvalId,{approved:!0,levelOverride:T}]))),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=T=>{T.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(Pe,{size:14}),e[16]=g):g=e[16];let A;e[17]!==n.length||e[18]!==V?(A=V("chat.approval.batchedLabel",{count:n.length}),e[17]=n.length,e[18]=V,e[19]=A):A=e[19];const v=f?.friendlyName??"";let j;e[20]!==h?(j=s.jsx(qt,{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(Kt,{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(Bo,{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(Wt,{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]!==A||e[38]!==v?(S=s.jsx(ce,{icon:g,label:A,title:v,defaultExpanded:!0,footerLeft:w,footerRight:y,children:C}),e[34]=w,e[35]=y,e[36]=C,e[37]=A,e[38]=v,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(Qe,{...x,children:N}),e[43]=u.form,e[44]=N,e[45]=_):_=e[45],_}function Lo(t){return typeof t?.approved=="boolean"}function zo(t){return t.approvalId}function Uo(t){return[t.approvalId,{approved:void 0}]}function Bo(t){const e=P.c(7),{approvalId:n,control:o,onChange:r}=t,V=Q(),a=`${n}.approved`;let i;e[0]!==r||e[1]!==V?(i=p=>{const{field:d}=p,c=d.value===!0,u=d.value===!1;return s.jsxs(s.Fragment,{children:[s.jsx(H,{type:"button",variant:u?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!1),r()},"aria-pressed":u,children:V("chat.approval.denyButton")}),s.jsx(H,{type:"button",variant:c?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!0),r()},"aria-pressed":c,children:V("chat.approval.acceptButton")})]})},e[0]=r,e[1]=V,e[2]=i):i=e[2];let l;return e[3]!==o||e[4]!==a||e[5]!==i?(l=s.jsx(ds,{control:o,name:a,render:i}),e[3]=o,e[4]=a,e[5]=i,e[6]=l):l=e[6],l}function $o(){const t=P.c(5),e=Q();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Pe,{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 r;return t[3]!==o?(r=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]=r):r=t[4],r}function Oo(t){const e=P.c(8),{approvals:n,isStreaming:o,onRespond:r}=t;if(o&&n.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx($o,{}),e[0]=a):a=e[0],a}if(n.length===0)return null;if(n.length===1){const a=n[0];if(!a)return null;let i;return e[1]!==r||e[2]!==a?(i=s.jsx(Mo,{approval:a,onRespond:r}),e[1]=r,e[2]=a,e[3]=i):i=e[3],i}let V;return e[4]!==n||e[5]!==o||e[6]!==r?(V=s.jsx(Fo,{approvals:n,isStreaming:o,onRespond:r}),e[4]=n,e[5]=o,e[6]=r,e[7]=V):V=e[7],V}function Ko(t){const e=P.c(28),{plan:n,onApprove:o,onDismiss:r}=t,V=Q();let a;e[0]!==o||e[1]!==n.plan?(a=()=>{o(n.plan)},e[0]=o,e[1]=n.plan,e[2]=a):a=e[2];const i=a;let l;e[3]!==V?(l=V("chat.proposePlan.keepIterating"),e[3]=V,e[4]=l):l=e[4];let p;e[5]!==r||e[6]!==l?(p=s.jsx(H,{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:r,children:l}),e[5]=r,e[6]=l,e[7]=p):p=e[7];let d;e[8]!==V?(d=V("chat.proposePlan.letsGo"),e[8]=V,e[9]=d):d=e[9];let c;e[10]!==i||e[11]!==d?(c=s.jsx(H,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-special hover:bg-special/90 text-special-foreground 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(Nt,{size:14}),e[16]=h):h=e[16];let f;e[17]!==V?(f=V("chat.proposePlan.planReady"),e[17]=V,e[18]=f):f=e[18];let x;e[19]!==V?(x=V("chat.proposePlan.implementationPlan"),e[19]=V,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(jn,{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(ce,{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 Qo(t){const e=P.c(6),{plans:n,onApprove:o,onDismiss:r}=t;let V;e[0]!==n?(V=Bt(n),e[0]=n,e[1]=V):V=e[1];const a=V;if(!a)return null;let i;return e[2]!==a||e[3]!==o||e[4]!==r?(i=s.jsx(Ko,{plan:a,onApprove:o,onDismiss:r}),e[2]=a,e[3]=o,e[4]=r,e[5]=i):i=e[5],i}function Ht(t){return t?"response"in t?t.response:t.option??t.draft:""}const xt=be({response:Ce().min(1,"Response is required")}),Yo=be({option:Ce().nullable(),draft:Ce()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Go=be({response:Ye(["yes","no"])});function qo(t){switch(t.type){case"text":return xt;case"choice":return Yo;case"confirm":return Go;default:return xt}}function Wo(t){const e={};for(const n of t)e[n.toolCallId]=qo(n.input);return be(e)}function Ho(t){const e=P.c(7),{control:n,name:o,placeholder:r}=t,V=Q();let a;e[0]!==r||e[1]!==V?(a=l=>{const{field:p}=l,d=p.value??"";return s.jsxs(Je,{children:[s.jsx(Xe,{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(kt,{size:16,className:"text-muted-foreground"})}),s.jsx("input",{...p,value:d,type:"text",placeholder:r||V("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":V("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),s.jsx(et,{})]})},e[0]=r,e[1]=V,e[2]=a):a=e[2];let i;return e[3]!==n||e[4]!==o||e[5]!==a?(i=s.jsx(Dt,{control:n,name:o,render:a}),e[3]=n,e[4]=o,e[5]=a,e[6]=i):i=e[6],i}function Zt(t,e){const n=P.c(4);let o,r;n[0]!==t||n[1]!==e?(o=()=>{const V=a=>{const i=a.target.tagName;if(i==="INPUT"||i==="TEXTAREA"||a.metaKey||a.ctrlKey||a.altKey)return;const l=Number.parseInt(a.key,10);l>=1&&l<=t&&(a.preventDefault(),e(l-1))};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},r=[t,e],n[0]=t,n[1]=e,n[2]=o,n[3]=r):(o=n[2],r=n[3]),L.useEffect(o,r)}function Zo(t){const e=P.c(51),{control:n,name:o,options:r}=t,V=Q(),a=`${o}.option`;let i;e[0]!==n||e[1]!==a?(i={control:n,name:a,defaultValue:null},e[0]=n,e[1]=a,e[2]=i):i=e[2];const{field:l}=rt(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}=rt(d),u=l.value,m=c.value??"";let h;if(e[6]!==l||e[7]!==r?(h=M=>{const I=r[M];I!=null&&l.onChange(I)},e[6]=l,e[7]=r,e[8]=h):h=e[8],Zt(r.length,h),r.length===0)return null;const f=u===null;let x;e[9]!==V?(x=V("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=V,e[10]=x):x=e[10];let b;if(e[11]!==l||e[12]!==u||e[13]!==r||e[14]!==V){let M;e[16]!==l||e[17]!==u||e[18]!==V?(M=(I,F)=>{const U=u===I;return s.jsxs("button",{type:"button",onClick:()=>l.onChange(I),className:B("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":V("chat.userAskQuestion.selectOption",{option:I}),children:[s.jsx("span",{className:B("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]=V,e[19]=M):M=e[19],b=r.map(M),e[11]=l,e[12]=u,e[13]=r,e[14]=V,e[15]=b}else b=e[15];const g=f&&"bg-accent/50",A=!f&&"hover:bg-accent/30";let v;e[20]!==g||e[21]!==A?(v=B("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",g,A),e[20]=g,e[21]=A,e[22]=v):v=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(kt,{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=M=>{c.onChange(M.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]!==V?(S=V("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=V,e[32]=S):S=e[32];let N;e[33]!==V?(N=V("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=V,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 T;e[41]!==v||e[42]!==_?(T=s.jsxs("label",{className:v,children:[j,_]}),e[41]=v,e[42]=_,e[43]=T):T=e[43];let R;e[44]!==T||e[45]!==x||e[46]!==b?(R=s.jsx(Xe,{children:s.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":x,children:[b,T]})}),e[44]=T,e[45]=x,e[46]=b,e[47]=R):R=e[47];let D;e[48]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(et,{}),e[48]=D):D=e[48];let E;return e[49]!==R?(E=s.jsxs(Je,{children:[R,D]}),e[49]=R,e[50]=E):E=e[50],E}function Jo(t){const e=P.c(8),{control:n,name:o}=t,r=Q();let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=["yes","no"],e[0]=V):V=e[0];const a=V,i=L.useRef(null);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=c=>{i.current?.onChange(a[c]??"")},e[1]=l):l=e[1],Zt(a.length,l);let p;e[2]!==r?(p=c=>{const{field:u}=c;return i.current=u,s.jsxs(Je,{children:[s.jsx(Xe,{children:s.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(m=>{const h=u.value===m;return s.jsxs("button",{type:"button",onClick:()=>u.onChange(m),className:B("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":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${m==="yes"?"Yes":"No"}`)}),children:[s.jsx("span",{className:B("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:r(`chat.userAskQuestion.confirm${m==="yes"?"Yes":"No"}`)})]},m)})})}),s.jsx(et,{})]})},e[2]=r,e[3]=p):p=e[3];let d;return e[4]!==n||e[5]!==o||e[6]!==p?(d=s.jsx(Dt,{control:n,name:o,render:p}),e[4]=n,e[5]=o,e[6]=p,e[7]=d):d=e[7],d}function gt(t){const e=P.c(13),{input:n,control:o,toolCallId:r}=t;switch(n.type){case"text":{const V=`${r}.response`;let a;return e[0]!==o||e[1]!==n.default||e[2]!==V?(a=s.jsx(Ho,{control:o,name:V,placeholder:n.default}),e[0]=o,e[1]=n.default,e[2]=V,e[3]=a):a=e[3],a}case"choice":{let V;e[4]!==n.options?(V=n.options?.filter(Boolean)??[],e[4]=n.options,e[5]=V):V=e[5];const a=V;let i;return e[6]!==o||e[7]!==a||e[8]!==r?(i=s.jsx(Zo,{control:o,name:r,options:a}),e[6]=o,e[7]=a,e[8]=r,e[9]=i):i=e[9],i}case"confirm":{const V=`${r}.response`;let a;return e[10]!==o||e[11]!==V?(a=s.jsx(Jo,{control:o,name:V}),e[10]=o,e[11]=V,e[12]=a):a=e[12],a}default:return null}}function Xo(t){const e=P.c(91),{parts:n,isStreaming:o,onSubmit:r}=t;let V;e[0]!==n?(V=Wo(n.map(nr)),e[0]=n,e[1]=V):V=e[1];const a=V;let i;e[2]!==n?(i=Object.fromEntries(n.map(sr)),e[2]=n,e[3]=i):i=e[3];const l=i;let p;e[4]!==r?(p=($,z)=>{const Y=Ht(z);Y&&r($,Y)},e[4]=r,e[5]=p):p=e[5];let d;e[6]!==l||e[7]!==o||e[8]!==n||e[9]!==a||e[10]!==p?(d={parts:n,partKey:tr,schema:a,defaultValues:l,isStreaming:o,hasAnswer:er,onSubmit:p},e[6]=l,e[7]=o,e[8]=n,e[9]=a,e[10]=p,e[11]=d):d=e[11];const c=Yt(d),u=c.currentPart,m=Q();let h;e[12]!==u||e[13]!==c||e[14]!==m?(h=()=>{const $=u;if(!$)return;const z=m("chat.userAskQuestion.skipMessage"),Y=$.toolCallId;$.input?.type==="choice"?(c.form.setValue(`${Y}.option`,null),c.form.setValue(`${Y}.draft`,z)):c.form.setValue(`${Y}.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(Kt,{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 A;e[23]!==f||e[24]!==g?(A=s.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:f,className:"h-7",children:g}),e[23]=f,e[24]=g,e[25]=A):A=e[25];let v;e[26]!==c.isAllAnswered||e[27]!==c.isCurrentAnswered||e[28]!==c.submitOrAdvance||e[29]!==o?(v=s.jsx(Do,{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]=v):v=e[30];let j;e[31]!==A||e[32]!==v?(j=s.jsxs(s.Fragment,{children:[A,v]}),e[31]=A,e[32]=v,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 Y;e[34]!==c?(Y=re=>{re.preventDefault(),c.submit()},e[34]=c,e[35]=Y):Y=e[35];let te;e[36]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(Ke,{size:14}),e[36]=te):te=e[36];let J;e[37]!==m?(J=m("chat.userAskQuestion.questionPending"),e[37]=m,e[38]=J):J=e[38];let se;e[39]!==$.input?.prompt||e[40]!==m?(se=$.input?.prompt??m("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=m,e[41]=se):se=e[41];const k=$.input;let K;e[42]!==c.form.control||e[43]!==$.toolCallId||e[44]!==k?(K=s.jsx(gt,{input:k,control:c.form.control,toolCallId:$.toolCallId}),e[42]=c.form.control,e[43]=$.toolCallId,e[44]=k,e[45]=K):K=e[45];let q;e[46]!==w||e[47]!==J||e[48]!==se||e[49]!==K?(q=s.jsx(ce,{icon:te,label:J,title:se,defaultExpanded:!0,footerRight:w,children:K}),e[46]=w,e[47]=J,e[48]=se,e[49]=K,e[50]=q):q=e[50];let Z;e[51]!==Y||e[52]!==q?(Z=s.jsx("form",{onSubmit:Y,autoComplete:"off",children:q}),e[51]=Y,e[52]=q,e[53]=Z):Z=e[53];let W;return e[54]!==c.form||e[55]!==Z?(W=s.jsx(Qe,{...z,children:Z}),e[54]=c.form,e[55]=Z,e[56]=W):W=e[56],W}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(Ke,{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 T;e[62]!==n.length||e[63]!==m||e[64]!==_?(T=m("chat.userAskQuestion.questionCount",{current:_,total:n.length}),e[62]=n.length,e[63]=m,e[64]=_,e[65]=T):T=e[65];let R;e[66]!==u?.input?.prompt||e[67]!==m?(R=u?.input?.prompt??m("chat.userAskQuestion.question"),e[66]=u?.input?.prompt,e[67]=m,e[68]=R):R=e[68];const D=c.activeKey,E=c.setActiveKey;let M;if(e[69]!==c.form||e[70]!==n){let $;e[72]!==c.form?($=z=>s.jsx(Cn,{value:z.toolCallId,className:"mt-0",children:s.jsx(gt,{input:z.input,control:c.form.control,toolCallId:z.toolCallId})},z.toolCallId),e[72]=c.form,e[73]=$):$=e[73],M=n.map($),e[69]=c.form,e[70]=n,e[71]=M}else M=e[71];let I;e[74]!==c.activeKey||e[75]!==c.setActiveKey||e[76]!==M?(I=s.jsx(Nn,{value:D,onValueChange:E,children:M}),e[74]=c.activeKey,e[75]=c.setActiveKey,e[76]=M,e[77]=I):I=e[77];let F;e[78]!==b||e[79]!==w||e[80]!==N||e[81]!==T||e[82]!==R||e[83]!==I?(F=s.jsx(ce,{icon:S,label:N,count:T,title:R,defaultExpanded:!0,footerLeft:b,footerRight:w,children:I}),e[78]=b,e[79]=w,e[80]=N,e[81]=T,e[82]=R,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 G;return e[88]!==c.form||e[89]!==U?(G=s.jsx(Qe,{...y,children:U}),e[88]=c.form,e[89]=U,e[90]=G):G=e[90],G}function er(t){return!!Ht(t)}function tr(t){return t.toolCallId}function sr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function nr(t){return{toolCallId:t.toolCallId,input:t.input}}function or(){const t=P.c(5),e=Q();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ke,{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 r;return t[3]!==o?(r=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]=r):r=t[4],r}function Jt(t){const e=P.c(7),{userAskParts:n,isStreaming:o,onSubmit:r}=t;let V;e[0]!==n?(V=n.filter(rr),e[0]=n,e[1]=V):V=e[1];const a=V;if(a.length===0){if(o){let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(or,{}),e[2]=l):l=e[2],l}return null}let i;return e[3]!==o||e[4]!==r||e[5]!==a?(i=s.jsx(Xo,{parts:a,isStreaming:o,onSubmit:r}),e[3]=o,e[4]=r,e[5]=a,e[6]=i):i=e[6],i}function rr(t){return t.state==="input-available"}function ar(t){const e=P.c(33),{parts:n,isStreaming:o,onRespond:r}=t,V=Q();let a;e[0]!==n?(a=n.at(-1),e[0]=n,e[1]=a):a=e[1];const i=a,l=i?.input;if(!i||!l?.title)return null;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Nt,{size:14}),e[2]=p):p=e[2];let d;e[3]!==V?(d=V("chat.suggestTask.label"),e[3]=V,e[4]=d):d=e[4];const c=l.title;let u;e[5]!==r||e[6]!==i?(u=()=>r(i,!1),e[5]=r,e[6]=i,e[7]=u):u=e[7];let m;e[8]!==V?(m=V("chat.suggestTask.notNow"),e[8]=V,e[9]=m):m=e[9];let h;e[10]!==o||e[11]!==u||e[12]!==m?(h=s.jsx(H,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:o,onClick:u,children:m}),e[10]=o,e[11]=u,e[12]=m,e[13]=h):h=e[13];let f;e[14]!==r||e[15]!==i?(f=()=>r(i,!0),e[14]=r,e[15]=i,e[16]=f):f=e[16];let x;e[17]!==V?(x=V("chat.suggestTask.create"),e[17]=V,e[18]=x):x=e[18];let b;e[19]!==o||e[20]!==f||e[21]!==x?(b=s.jsx(H,{type:"button",size:"sm",className:"h-7",disabled:o,onClick:f,children:x}),e[19]=o,e[20]=f,e[21]=x,e[22]=b):b=e[22];let g;e[23]!==b||e[24]!==h?(g=s.jsxs(s.Fragment,{children:[h,b]}),e[23]=b,e[24]=h,e[25]=g):g=e[25];let A;e[26]!==l.summary?(A=l.summary?s.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:l.summary}):null,e[26]=l.summary,e[27]=A):A=e[27];let v;return e[28]!==l.title||e[29]!==g||e[30]!==A||e[31]!==d?(v=s.jsx(ce,{icon:p,label:d,title:c,defaultExpanded:!0,footerRight:g,children:A}),e[28]=l.title,e[29]=g,e[30]=A,e[31]=d,e[32]=v):v=e[32],v}function Vr(t){const e=t.filter(V=>V.status==="in_progress"),n=t.filter(V=>V.status==="completed").length,o=t.length;if(o>0&&n===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.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 ir(t){const e=P.c(13),{todos:n}=t;if(n.length===0)return null;let o;e[0]!==n?(o=Vr(n),e[0]=n,e[1]=o):o=e[1];const r=o;let V;e[2]!==r.icon?(V=s.jsx(ur,{status:r.icon}),e[2]=r.icon,e[3]=V):V=e[3];const a=r.activity,i=r.progress;let l;e[4]!==n?(l=n.map(lr),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]!==r.activity||e[9]!==r.progress||e[10]!==V||e[11]!==p?(d=s.jsx(ce,{icon:V,label:a,count:i,defaultExpanded:!1,children:p}),e[8]=r.activity,e[9]=r.progress,e[10]=V,e[11]=p,e[12]=d):d=e[12],d}function lr(t,e){return s.jsx(cr,{todo:t},e)}function cr(t){const e=P.c(14),{todo:n}=t,o=n.status==="completed",V=n.status==="in_progress"?n.activeForm:n.content;let a;e[0]!==n.status?(a=s.jsx(dr,{status:n.status}),e[0]=n.status,e[1]=a):a=e[1];const i=o&&"text-muted-foreground";let l;e[2]!==i?(l=B("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]!==V||e[8]!==l||e[9]!==c?(u=s.jsxs("span",{className:l,children:[V,c]}),e[7]=V,e[8]=l,e[9]=c,e[10]=u):u=e[10];let m;return e[11]!==a||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:[a,u]}),e[11]=a,e[12]=u,e[13]=m):m=e[13],m}function dr(t){const e=P.c(4),{status:n}=t,o=n==="completed"?"true":void 0,r=n==="in_progress"?"true":void 0;let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=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]=V):V=e[0];let a;return e[1]!==o||e[2]!==r?(a=s.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":r,"aria-hidden":"true",children:V}),e[1]=o,e[2]=r,e[3]=a):a=e[3],a}function ur(t){const e=P.c(13),{status:n}=t,o=Q();if(n==="completed"){let a;e[0]!==o?(a=o("chat.todoStatus.completed"),e[0]=o,e[1]=a):a=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]!==a?(l=s.jsx("span",{"aria-label":a,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:i}),e[3]=a,e[4]=l):l=e[4],l}if(n==="in_progress"){let a;e[5]!==o?(a=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=a):a=e[6];let i;return e[7]!==a?(i=s.jsx("span",{"aria-label":a,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=a,e[8]=i):i=e[8],i}let r;e[9]!==o?(r=o("chat.todoStatus.pending"),e[9]=o,e[10]=r):r=e[10];let V;return e[11]!==r?(V=s.jsx("span",{"aria-label":r,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=r,e[12]=V):V=e[12],V}const pr={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"}]},mr={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function fr(t){const e=P.c(46),{source:n,onDone:o}=t,r=Q(),V=us(),[a]=Ae(),[i,l]=L.useState(a.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]!==V?(h=async I=>{const{url:F}=await V.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:I,currency:i});return F},e[0]=i,e[1]=V,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]!==r?(x=I=>{Se.error(r("credits.topUp.failed",{message:I.message}))},e[5]=r,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:A}=ps(b);let v;e[11]!==i||e[12]!==n||e[13]!==g?(v=(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]=v):v=e[14];const j=v,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(ct,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),N=s.jsx(ct,{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(Fn,{type:"single",variant:"outline",size:"sm",value:i,onValueChange:C,children:[S,N]})}),e[18]=i,e[19]=_):_=e[19];const T=pr[i];let R;if(e[20]!==j||e[21]!==m||e[22]!==A||e[23]!==r||e[24]!==T){let I;e[26]!==j||e[27]!==m||e[28]!==A||e[29]!==r?(I=F=>{const{dollars:U,labelKey:G}=F;return s.jsxs("button",{type:"button",disabled:A,onClick:()=>j(U*100,mr[G]??"preset"),className:B("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:r(G)})]},U)},e[26]=j,e[27]=m,e[28]=A,e[29]=r,e[30]=I):I=e[30],R=T.map(I),e[20]=j,e[21]=m,e[22]=A,e[23]=r,e[24]=T,e[25]=R}else R=e[25];let D;e[31]!==R?(D=s.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:R}),e[31]=R,e[32]=D):D=e[32];let E;e[33]!==j||e[34]!==m||e[35]!==p||e[36]!==w||e[37]!==y||e[38]!==A||e[39]!==c||e[40]!==r?(E=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(En,{type:"number",min:"1",step:"1",placeholder:r("credits.topUp.customPlaceholder"),value:p,onChange:I=>d(I.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(H,{className:"h-10",disabled:!y||A,onClick:()=>j(Math.round(w*100),"custom"),children:r(A?"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:r("credits.topUp.enterCustom")}),e[33]=j,e[34]=m,e[35]=p,e[36]=w,e[37]=y,e[38]=A,e[39]=c,e[40]=r,e[41]=E):E=e[41];let M;return e[42]!==D||e[43]!==E||e[44]!==_?(M=s.jsxs("div",{children:[_,D,E]}),e[42]=D,e[43]=E,e[44]=_,e[45]=M):M=e[45],M}const hr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function xr(t){const e=P.c(47),{onDismiss:n}=t,{org:o}=Te(),r=Ge(),{decoKeyId:V}=Mn(),a=Q(),i=Ie("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=T=>!T&&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]!==a?(h=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=h):h=e[9];let f;e[10]!==h?(f=s.jsx(kn,{className:"text-xl font-semibold tracking-tight",children:h}),e[10]=h,e[11]=f):f=e[11];let x;e[12]!==a?(x=a("chat.creditsExhaustedBanner.description"),e[12]=a,e[13]=x):x=e[13];let b;e[14]!==x?(b=s.jsx(Sn,{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(Tn,{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 A;e[19]!==V||e[20]!==n||e[21]!==a?(A=V&&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(fr,{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:hr.map(T=>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(We,{size:12,className:"text-success"})}),s.jsx("span",{className:"text-sm text-foreground/80",children:a(T)})]},T))})]}),e[19]=V,e[20]=n,e[21]=a,e[22]=A):A=e[22];let v;e[23]!==a?(v=a("chat.creditsExhaustedBanner.dismiss"),e[23]=a,e[24]=v):v=e[24];let j;e[25]!==n||e[26]!==v?(j=s.jsx(H,{variant:"ghost",size:"sm",onClick:n,children:v}),e[25]=n,e[26]=v,e[27]=j):j=e[27];let w;e[28]!==r||e[29]!==n||e[30]!==o.slug?(w=()=>{r({to:"/$org/settings/ai-providers",params:{org:o.slug}}),n?.()},e[28]=r,e[29]=n,e[30]=o.slug,e[31]=w):w=e[31];let y;e[32]!==a?(y=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,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]!==A||e[42]!==S?(N=s.jsxs(In,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:gr,children:[g,A,S]}),e[40]=g,e[41]=A,e[42]=S,e[43]=N):N=e[43];let _;return e[44]!==N||e[45]!==d?(_=s.jsx(_n,{open:!0,onOpenChange:d,children:N}),e[44]=N,e[45]=d,e[46]=_):_=e[46],_}function gr(t){return t.preventDefault()}const br={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 Ar(t){const e=P.c(16),{kind:n,onDismiss:o,onSubscribe:r}=t,V=Q(),{label:a,title:i}=br[n];let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(qe,{size:14}),e[0]=l):l=e[0];let p;e[1]!==a||e[2]!==V?(p=V(a),e[1]=a,e[2]=V,e[3]=p):p=e[3];let d;e[4]!==V||e[5]!==i?(d=V(i),e[4]=V,e[5]=i,e[6]=d):d=e[6];let c;e[7]!==n||e[8]!==r||e[9]!==V?(c=n==="trial_exhausted"?s.jsx(H,{size:"sm",onClick:r,className:"h-7 text-xs",children:V("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=n,e[8]=r,e[9]=V,e[10]=c):c=e[10];let u;return e[11]!==o||e[12]!==p||e[13]!==d||e[14]!==c?(u=s.jsx(ce,{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 vr={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function bt(t){const e=P.c(21),{kind:n,onDismiss:o}=t,r=Q(),V=Ge(),{org:a}=Te(),{label:i,title:l}=vr[n];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(qe,{size:14}),e[0]=p):p=e[0];let d;e[1]!==i||e[2]!==r?(d=r(i),e[1]=i,e[2]=r,e[3]=d):d=e[3];let c;e[4]!==r||e[5]!==l?(c=r(l),e[4]=r,e[5]=l,e[6]=c):c=e[6];let u;e[7]!==V||e[8]!==o||e[9]!==a.slug?(u=()=>{V({to:"/$org/settings/ai-providers",params:{org:a.slug}}),o()},e[7]=V,e[8]=o,e[9]=a.slug,e[10]=u):u=e[10];let m;e[11]!==r?(m=r("chat.planRefused.seePlans"),e[11]=r,e[12]=m):m=e[12];let h;e[13]!==u||e[14]!==m?(h=s.jsx(H,{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(ce,{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 Xt(t){const e=yr(t);if(e!==null){const p=Xt(e);return{summary:p.summary,rawDetails:p.rawDetails??t}}const n=t.trim(),o=n.startsWith("<")&&/<[a-z][\s\S]*>/i.test(n),r=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(n),V=/failed to fetch|networkerror|load failed|offline/i.test(n),a=/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 r||o&&i?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:V?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:a?{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 yr(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:r}=n,V=typeof o=="string"?o:r;return typeof V=="string"&&V.trim()&&!V.trim().startsWith("{")?V:null}const jr={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Re(t){const e=P.c(29),n=Q(),{variant:o,onDismiss:r}=t,V=o==="error";let a;e[0]!==V||e[1]!==n?(a=n(V?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=V,e[1]=n,e[2]=a):a=e[2];const i=a,l=V?fn:fs;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=jr[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]!==V||e[9]!==d?(c=V?Xt(d):{summary:d,rawDetails:null},e[8]=V,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]!==V||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==n?(f=V?s.jsx(H,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:n("chat.highlight.fixInChat")}):s.jsx(H,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:n("chat.highlight.continue")}),e[13]=V,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(()=>Se.success(n("chat.highlight.copiedToClipboard"))).catch(()=>Se.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 classic:rounded-md compact:rounded-lg bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:s.jsx(hn,{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]!==r||e[23]!==u||e[24]!==h||e[25]!==f||e[26]!==x||e[27]!==o?(b=s.jsx(ce,{icon:h,label:i,title:u,defaultExpanded:!0,variant:o,onClose:r,footerRight:f,children:x}),e[21]=i,e[22]=r,e[23]=u,e[24]=h,e[25]=f,e[26]=x,e[27]=o,e[28]=b):b=e[28],b}function ze(){const t=P.c(70),e=Q(),{error:n,clearError:o,finishReason:r,clearFinishReason:V,messages:a,isStreaming:i,submit:l,sendMessage:p}=Ze(),[d,c]=Ae(),{virtualMcpId:u,createTaskWithMessage:m}=Zs(),{chatMode:h,simpleModeTier:f}=Me(),x=Ie("credits"),{mutate:b}=Un("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let g;t[0]!==b?(g=()=>b(),t[0]=b,t[1]=g):g=t[1];const A=g;let v;t[2]!==h||t[3]!==f||t[4]!==u?(v=ne=>({tier:f,mode:h,toolApprovalLevel:ne,agent:u?{id:u}:void 0}),t[2]=h,t[3]=f,t[4]=u,t[5]=v):v=t[5];const j=v;let w;t[6]!==d.toolApprovalLevel?(w=d.toolApprovalLevel??ms(),t[6]=d.toolApprovalLevel,t[7]=w):w=t[7];const y=w,C=a.at(-1),S=C?.role==="assistant"?C.parts:[],N=S.filter(Sr),_=S.filter(kr),T=$t(S),R=Ut(S);let D;t[8]!==n||t[9]!==p||t[10]!==e?(D=()=>{if(n){const fe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e("chat.highlight.fixInChatMessage",{error:n.message})}]}]};p(fe)}},t[8]=n,t[9]=p,t[10]=e,t[11]=D):D=t[11];const E=D;let M;t[12]!==p||t[13]!==e?(M=()=>{const ne={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e("chat.highlight.pleaseContinue")}]}]};p(ne)},t[12]=p,t[13]=e,t[14]=M):M=t[14];const I=M;let F;t[15]!==j||t[16]!==y||t[17]!==l?(F=(ne,fe)=>{l({kind:"toolOutput",toolCallId:ne.toolCallId,output:{response:fe}},j(y))},t[15]=j,t[16]=y,t[17]=l,t[18]=F):F=t[18];const U=F;let G;t[19]!==j||t[20]!==y||t[21]!==l?(G=(ne,fe)=>{l({kind:"toolOutput",toolCallId:ne.toolCallId,output:{accepted:fe}},j(y))},t[19]=j,t[20]=y,t[21]=l,t[22]=G):G=t[22];const $=G;let z;t[23]!==m||t[24]!==d||t[25]!==c||t[26]!==e||t[27]!==u?(z=ne=>{c({...d,toolApprovalLevel:"auto"}),m({virtualMcpId:u,message:{parts:[{type:"text",text:e("chat.highlight.implementPlanMessage",{plan:ne})}]}})},t[23]=m,t[24]=d,t[25]=c,t[26]=e,t[27]=u,t[28]=z):z=t[28];const Y=z,te=Nr;let J;t[29]!==j||t[30]!==l?(J=(ne,fe,Ne,Ue)=>{l({kind:"approval",approvalId:ne,approved:fe,...Ne?{reason:Ne}:{}},j(Ue))},t[29]=j,t[30]=l,t[31]=J):J=t[31];const se=J,k=Ot();if(k.isCreditExhausted){let ne;return t[32]!==x||t[33]!==o?(ne=x?s.jsx(xr,{onDismiss:o}):s.jsx("div",{className:"absolute bottom-full left-0 right-0",children:s.jsx(bt,{kind:"ai_budget_exhausted",onDismiss:o})}),t[32]=x,t[33]=o,t[34]=ne):ne=t[34],ne}const{showError:K,showWarning:q,hasApprovals:Z}=k,W=N.map(Cr).join("|"),re=Bt(T)?.toolCallId??"",Ve=R.map(wr).join("|"),ie="absolute bottom-full left-0 right-0";let ee;t[35]!==k.todos?(ee=s.jsx(ir,{todos:k.todos}),t[35]=k.todos,t[36]=ee):ee=t[36];let ae;t[37]!==o||t[38]!==k.subscriptionErrorKind||t[39]!==A?(ae=k.subscriptionErrorKind&&s.jsx(Ar,{kind:k.subscriptionErrorKind,onDismiss:o,onSubscribe:A}),t[37]=o,t[38]=k.subscriptionErrorKind,t[39]=A,t[40]=ae):ae=t[40];let oe;t[41]!==o||t[42]!==k.planRefusal?(oe=k.planRefusal&&s.jsx(bt,{kind:k.planRefusal,onDismiss:o}),t[41]=o,t[42]=k.planRefusal,t[43]=oe):oe=t[43];let de;t[44]!==o||t[45]!==n||t[46]!==E||t[47]!==K?(de=K&&s.jsx(Re,{variant:"error",error:n,onDismiss:o,onFixInChat:E}),t[44]=o,t[45]=n,t[46]=E,t[47]=K,t[48]=de):de=t[48];let xe;t[49]!==V||t[50]!==r||t[51]!==I||t[52]!==q?(xe=q&&s.jsx(Re,{variant:"warning",finishReason:r,onDismiss:V,onContinue:I}),t[49]=V,t[50]=r,t[51]=I,t[52]=q,t[53]=xe):xe=t[53];const ve=Z&&s.jsx(Oo,{approvals:R,isStreaming:i,onRespond:se},Ve),le=k.hasPlans&&s.jsx(Qo,{plans:T,isStreaming:i,onApprove:Y,onDismiss:te},re),ye=k.hasTaskSuggestion&&s.jsx(ar,{parts:_,isStreaming:i,onRespond:$},_.at(-1)?.toolCallId??"");let me;t[54]!==k.isWaitingForUserInput||t[55]!==U||t[56]!==i||t[57]!==W||t[58]!==N?(me=k.isWaitingForUserInput&&s.jsx(Jt,{userAskParts:N,isStreaming:i,onSubmit:U},W),t[54]=k.isWaitingForUserInput,t[55]=U,t[56]=i,t[57]=W,t[58]=N,t[59]=me):me=t[59];let ue;return t[60]!==ee||t[61]!==ae||t[62]!==oe||t[63]!==de||t[64]!==xe||t[65]!==ve||t[66]!==le||t[67]!==ye||t[68]!==me?(ue=s.jsxs("div",{className:ie,children:[ee,ae,oe,de,xe,ve,le,ye,me]}),t[60]=ee,t[61]=ae,t[62]=oe,t[63]=de,t[64]=xe,t[65]=ve,t[66]=le,t[67]=ye,t[68]=me,t[69]=ue):ue=t[69],ue}function wr(t){return t.approvalId}function Cr(t){return t.toolCallId}function Nr(){document.querySelector("[data-chat-input]")?.focus()}function kr(t){return t.type==="tool-suggest_task"&&t.state==="input-available"}function Sr(t){return t.type==="tool-user_ask"}ze.Error=function(e){return s.jsx(Re,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};ze.Warning=function(e){return s.jsx(Re,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};ze.UserAskQuestion=Jt;function Tr(t){const e=P.c(20),{taskId:n}=t,o=Q(),r=Js(n),V=Xs(r),a=en(),{stop:i,removeLocalMessage:l}=Ze();if(V.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(Ct,{size:14}),e[4]=c):c=e[4];let u;e[5]!==p||e[6]!==d?(u=s.jsx(Ee,{asChild:!0,children:s.jsx(H,{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(Fe,{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(Le,{delayDuration:400,children:[u,h]}),e[12]=u,e[13]=h,e[14]=f):f=e[14];let x;return e[15]!==a||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(H,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(n,b.messageId).then(A=>{A&&(tn(n,b.messageId),l(b.messageId))})},children:s.jsx(Bn,{className:"size-3.5"})})})]},b.messageId),e[15]=a,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(V.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:V.length})}),f]}),V.map(x)]})}function Ir(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 _r={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function Dr(t){const e=P.c(31),{tier:n,orgSlot:o,userSlot:r,autoSlot:V,onPick:a,onReset:i,onClose:l}=t,p=Q(),d=Ft(),c=new Set(d.map(Rr)),u=sn([r,o,V],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",A=_r[n];let v;e[0]!==p||e[1]!==A?(v=p(A),e[0]=p,e[1]=A,e[2]=v):v=e[2];let j;e[3]!==v?(j=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:v}),e[3]=v,e[4]=j):j=e[4];let w;e[5]!==i||e[6]!==p||e[7]!==r?(w=r&&s.jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 classic:rounded-md compact:rounded-lg hover:bg-accent cursor-pointer",children:p("chat.modelPreferences.reset")}),e[5]=i,e[6]=p,e[7]=r,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($n,{}),e[12]=N):N=e[12];const _=Xn,T=!0,R=Ir(m?u:null,b?.providerId??"deco");let D;e[13]!==x||e[14]!==a||e[15]!==f?(D=F=>{const U=F.keyId??x??"";f(U),a({keyId:U,modelId:F.modelId,title:F.title})},e[13]=x,e[14]=a,e[15]=f,e[16]=D):D=e[16];let E;e[17]!==_||e[18]!==x||e[19]!==l||e[20]!==f||e[21]!==R||e[22]!==D?(E=s.jsx(_,{compact:T,onClose:l,credentialId:x,onCredentialChange:f,selectedModel:R,onModelChange:D}),e[17]=_,e[18]=x,e[19]=l,e[20]=f,e[21]=R,e[22]=D,e[23]=E):E=e[23];let M;e[24]!==S||e[25]!==E||e[26]!==N?(M=s.jsx("div",{className:C,children:s.jsx(S,{fallback:N,children:E})}),e[24]=S,e[25]=E,e[26]=N,e[27]=M):M=e[27];let I;return e[28]!==M||e[29]!==y?(I=s.jsxs("div",{className:g,children:[y,M]}),e[28]=M,e[29]=y,e[30]=I):I=e[30],I}function Rr(t){return t.id}const Pr=["fast","smart","thinking"];function es(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const At={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function Mr(t){const e=P.c(28),{tier:n,pillIcon:o,groups:r}=t,V=Q();let a;e[0]!==V?(a=es(V),e[0]=V,e[1]=a):a=e[1];const i=a,[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=B("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=B("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(Rt,{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(Ee,{asChild:!0,children:s.jsx("span",{className:"inline-flex min-w-0 shrink",children:s.jsx(Pt,{asChild:!0,children:s.jsxs(H,{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 A;e[12]!==u?(A=s.jsx(Fe,{children:u}),e[12]=u,e[13]=A):A=e[13];let v;e[14]!==g||e[15]!==A?(v=s.jsxs(Le,{children:[g,A]}),e[14]=g,e[15]=A,e[16]=v):v=e[16];let j;if(e[17]!==r||e[18]!==V){let C;e[20]!==V?(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 classic:rounded-md compact:rounded-lg hover:bg-muted",children:[s.jsxs("button",{type:"button",role:"menuitem","aria-label":N.title,onClick:()=>c(N),className:B("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:V("chat.tierTrigger.selected"),children:s.jsx(We,{size:14,className:"text-foreground mt-0.5"})})]}),N.modelOverride&&s.jsx(Fr,{label:N.title,render:N.modelOverride})]},N.key))},S.key),e[20]=V,e[21]=C):C=e[21],j=r.map(C),e[17]=r,e[18]=V,e[19]=j}else j=e[19];let w;e[22]!==j?(w=s.jsx(Mt,{align:"end",className:"p-1 w-64",onOpenAutoFocus:Er,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]!==v||e[26]!==w?(y=s.jsxs(Et,{open:l,onOpenChange:p,children:[v,w]}),e[24]=l,e[25]=v,e[26]=w,e[27]=y):y=e[27],y}function Er(t){return t.preventDefault()}function Fr(t){const e=P.c(38),{label:n,render:o}=t,r=Q(),V=Wn(),[a,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]!==r?(d=r("chat.modelPreferences.customizeModel",{tier:n}),e[1]=n,e[2]=r,e[3]=d):d=e[3];const c=a&&"opacity-100";let u;e[4]!==c?(u=B("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 classic:rounded-md compact:rounded-lg 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(Qs,{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(V){let v;e[10]!==f?(v=s.jsx(Qn,{asChild:!0,children:f}),e[10]=f,e[11]=v):v=e[11];let j;e[12]!==n||e[13]!==r?(j=r("chat.modelPreferences.customizeModel",{tier:n}),e[12]=n,e[13]=r,e[14]=j):j=e[14];let w;e[15]!==j?(w=s.jsx(Yn,{className:"sr-only",children:j}),e[15]=j,e[16]=w):w=e[16];let y;e[17]!==a||e[18]!==o?(y=a&&o(p),e[17]=a,e[18]=o,e[19]=y):y=e[19];let C;e[20]!==y||e[21]!==w?(C=s.jsxs(Gn,{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]!==a||e[24]!==C||e[25]!==v?(S=s.jsxs(qn,{open:a,onOpenChange:i,children:[v,C]}),e[23]=a,e[24]=C,e[25]=v,e[26]=S):S=e[26],S}let x;e[27]!==f?(x=s.jsx(Pt,{asChild:!0,children:f}),e[27]=f,e[28]=x):x=e[28];let b;e[29]!==a||e[30]!==o?(b=a&&o(p),e[29]=a,e[30]=o,e[31]=b):b=e[31];let g;e[32]!==b?(g=s.jsx(Mt,{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 A;return e[34]!==a||e[35]!==x||e[36]!==g?(A=s.jsxs(Et,{open:a,onOpenChange:i,children:[x,g]}),e[34]=a,e[35]=x,e[36]=g,e[37]=A):A=e[37],A}function vt(t){return t==="fast"?s.jsx(qe,{size:16}):t==="thinking"?s.jsx(Ks,{size:16}):s.jsx(Hn,{size:16})}function Lr(t){const e=P.c(13),n=rn();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 r=o;let V;e[3]!==r?(V=r("fast"),e[3]=r,e[4]=V):V=e[4];let a;e[5]!==r?(a=r("smart"),e[5]=r,e[6]=a):a=e[6];let i;e[7]!==r?(i=r("thinking"),e[7]=r,e[8]=i):i=e[8];let l;return e[9]!==V||e[10]!==a||e[11]!==i?(l={fast:V,smart:a,thinking:i},e[9]=V,e[10]=a,e[11]=i,e[12]=l):l=e[12],l}function zr(){const t=P.c(23),e=Q(),{simpleModeTier:n,setSimpleModeTier:o}=Me(),r=Zn(),V=Ft(),a=Jn(V),i=Lr(a),{data:l,error:p}=nn();let d;t[0]!==l?(d=l===void 0?{tiers:{}}:l,t[0]=l,t[1]=d):d=t[1];const c=d,u=on(),m=Ie("model_choice"),h=Dn(),f=Rn();if(!h||!m)return null;let x,b;if(t[2]!==a||t[3]!==f||t[4]!==r||t[5]!==o||t[6]!==e||t[7]!==n||t[8]!==i||t[9]!==u||t[10]!==c||t[11]!==p){const w=es(e);x="decopilot",b=Pr.map(y=>{const C=i[y],S=c.tiers[y];return{key:`decopilot-${y}`,icon:vt(y),title:w[y],subtitle:f?C??e(At[y]):e(At[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(Dr,{tier:y,orgSlot:r.tiers[y],userSlot:S,autoSlot:a.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]=a,t[3]=f,t[4]=r,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 A=g;let v;t[17]!==n?(v=vt(n),t[17]=n,t[18]=v):v=t[18];let j;return t[19]!==A||t[20]!==v||t[21]!==n?(j=s.jsx(Mr,{tier:n,pillIcon:v,groups:A}),t[19]=A,t[20]=v,t[21]=n,t[22]=j):j=t[22],j}function ts(t){const e=P.c(3),[n]=Ae();let o;return e[0]!==n.enableSounds||e[1]!==t?(o=()=>{n.enableSounds&&co(t.dataUri).catch(V=>{console.warn(`[sound] ${t.name} playback failed:`,V)})},e[0]=n.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const Ur={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"},Br=Rs.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),$r=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Or(){const t=P.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:$r.map(Kr)}),t[0]=e):e=t[0],e}function Kr(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 Qr({disabled:t,onOpenConnections:e,virtualMcpId:n,selectedModel:o,isStreaming:r,onUnsupportedFile:V}){const a=Q(),[i,l]=L.useState(!1),p=ts(Ur),{org:d}=Te(),{editor:c}=jt(),u=L.useRef(null),m=tt(o),h=()=>{!m||r||(l(!1),u.current?.click())},f=async k=>{const K=k.target.files;if(!K||K.length===0||!c)return;const q=Array.from(K);try{let Z=c.state.selection.from;for(const W of q)await Lt(c,o??null,W,Z,V,a),Z=c.state.selection.to}finally{u.current&&(u.current.value="")}},x=ao({connectionId:n,orgId:d.id,orgSlug:d.slug}),b=hs.virtualMcpPrompts(n,d.id),{data:g,isLoading:A}=xs({queryKey:b,queryFn:()=>Vo(x),staleTime:6e4,enabled:i&&!!x}),v=g?.prompts??[],[j,w]=L.useState(null),{chatMode:y,setChatMode:C}=Me(),[S,N]=Ae(),_=ge.find(k=>k.value===S.toolApprovalLevel)??ge[0],T=a(_.shortKey),R=k=>{const K=ge.find(q=>q.value===k);if(K){if(K.value===S.toolApprovalLevel){l(!1);return}p(),X("chat_approval_level_changed",{from_level:S.toolApprovalLevel,to_level:K.value,source:"tools_popover"}),N({...S,toolApprovalLevel:K.value}),l(!1)}},D=y==="plan",E=()=>{p();const k=D?"default":"plan";X("chat_mode_changed",{from_mode:y,to_mode:k,source:"tools_popover"}),C(k),l(!1)},M=()=>{e(),l(!1)},I=async(k,K)=>{if(!c||!x)return;const q=dt(k._meta),Z={from:c.state.selection.from,to:c.state.selection.to};try{const W=await io(x,k.name,K);Ds(c,Z,{id:k.name,name:ro(k.name,q),metadata:W.messages,char:"/",kind:"prompt",args:K})}catch{Se.error(a("chat.toolsPopover.failedLoadPrompt"))}},F=async k=>{l(!1);const K=!!(k.arguments&&k.arguments.length>0);if(X("chat_prompt_inserted",{prompt_name:k.name,with_arguments:K}),K){w(k);return}await I(k)},U=async k=>{j&&(await I(j,k),w(null))},G=()=>{p();const k=y==="gen-image"?"default":"gen-image";X("chat_mode_changed",{from_mode:y,to_mode:k,source:"tools_popover"}),C(k),l(!1)},$=()=>{p();const k=y==="web-search"?"default":"web-search";X("chat_mode_changed",{from_mode:y,to_mode:k,source:"tools_popover"}),C(k),l(!1)},z=()=>{p();const k=y==="deep-research"?"default":"deep-research";X("chat_mode_changed",{from_mode:y,to_mode:k,source:"tools_popover"}),C(k),l(!1)},Y=y==="gen-image",te=y==="web-search",J=y==="deep-research",se=s.jsx("input",{ref:u,type:"file",multiple:!0,accept:On(o??null),className:"hidden",onChange:f,disabled:r});return s.jsxs(s.Fragment,{children:[se,s.jsxs(gs,{open:i,onOpenChange:k=>{k&&!i&&X("chat_tools_popover_opened",{chat_mode:y}),l(k)},children:[s.jsx(bs,{asChild:!0,children:s.jsxs(H,{type:"button",variant:"ghost",size:"default",disabled:t,title:a("chat.toolsPopover.tools"),"aria-label":a("chat.toolsPopover.tools"),className:B("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(Ys,{size:14}),s.jsx("span",{className:B("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:a("chat.toolsPopover.tools")})]})}),s.jsxs(As,{align:"start",className:"w-56 p-1.5 space-y-1",children:[m?s.jsxs(he,{onClick:h,disabled:r,children:[s.jsx(ut,{size:16}),s.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):s.jsxs(Le,{children:[s.jsx(Ee,{asChild:!0,children:s.jsxs(he,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:k=>k.preventDefault(),children:[s.jsx(ut,{size:16}),s.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),s.jsx(Fe,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),s.jsxs(he,{onClick:E,className:B(D&&"text-special"),children:[s.jsx(St,{size:16,className:B(D&&"text-special")}),s.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),s.jsx("span",{className:B("text-xs text-muted-foreground",D&&"text-special font-medium"),children:Br})]}),s.jsxs(he,{onClick:G,className:B(Y&&"text-special"),children:[s.jsx(_t,{size:16,className:B(Y&&"text-special")}),s.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),Y&&s.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),s.jsxs(he,{onClick:$,className:B(te&&"text-special"),children:[s.jsx(Tt,{size:16,className:B(te&&"text-special")}),s.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),te&&s.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),s.jsxs(he,{onClick:z,className:B(J&&"text-special"),children:[s.jsx(It,{size:16,className:B(J&&"text-special")}),s.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),J&&s.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),s.jsxs(at,{children:[s.jsxs(Vt,{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:a("chat.toolsPopover.prompts")})]}),s.jsx(it,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:A?s.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[s.jsx(vs,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):v.length===0?s.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):v.map(k=>s.jsxs(he,{onClick:()=>F(k),className:"flex flex-col items-start gap-0.5",children:[s.jsx("span",{className:"font-medium text-sm capitalize",children:k.title||oo(k.name,dt(k._meta))}),k.description&&s.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:k.description})]},k.name))})]}),s.jsxs(at,{children:[s.jsxs(Vt,{className:"gap-2",children:[s.jsx(Pe,{size:16}),s.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:T})]}),s.jsx(it,{className:"w-48 p-1.5",children:s.jsx(ys,{value:S.toolApprovalLevel,onValueChange:R,children:ge.map(k=>s.jsx(js,{value:k.value,children:a(k.labelKey)},k.value))})})]}),s.jsxs(he,{onClick:M,children:[s.jsx(lo,{size:16}),s.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),s.jsx(L.Suspense,{children:s.jsx(Or,{})})]})]})]}),s.jsx(_s,{prompt:j,setPrompt:w,onSubmit:U})]})}const Yr=[{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 Gr(){const t=P.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:Yr.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 Wr(t){const e=P.c(10),{onClick:n}=t,o=Q();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=B("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=r):r=e[0];let V;e[1]!==o?(V=o("chat.connectionsBanner.description"),e[1]=o,e[2]=V):V=e[2];let a;e[3]!==V?(a=s.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:V}),e[3]=V,e[4]=a):a=e[4];let i,l;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Gr,{}),l=s.jsx(ws,{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]!==a?(p=s.jsxs("button",{type:"button",onClick:n,className:r,children:[a,i,l]}),e[7]=n,e[8]=a,e[9]=p):p=e[9],p}const ke=48;function Hr(){const t=P.c(9),[e,n]=L.useState("idle"),[o,r]=L.useState(""),[V,a]=L.useState(""),[i,l]=L.useState(Xr),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(Jr),u.current?.getTracks().forEach(Zr),c.current=null,d.current=null,u.current=null},t[0]=g):g=t[0];const A=g;let v;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const _=T=>{u.current=T;const R=new AudioContext;d.current=R;const D=R.createMediaStreamSource(T),E=R.createAnalyser();E.fftSize=128,E.smoothingTimeConstant=.8,D.connect(E),c.current=E;const M=new Uint8Array(E.frequencyBinCount),I=()=>{if(!c.current)return;c.current.getByteFrequencyData(M);const F=[];for(let U=0;U<ke;U++){const G=Math.floor(U/ke*M.length);F.push(Math.max(.04,(M[G]??0)/255))}l(F),m.current=requestAnimationFrame(I)};I()};v=async()=>{const T=window.SpeechRecognition||window.webkitSpeechRecognition;if(!T)return n("unsupported"),"unsupported";let R;try{R=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return n("permission-denied"),"permission-denied"}r(""),a(""),x.current="",f.current="",h.current=!0,n("recording"),_(R);const D=new T;p.current=D,D.interimResults=!0,D.continuous=!0,D.lang=navigator.language||"en-US",D.onresult=E=>{if(p.current!==D)return;let M="",I="";for(let F=E.resultIndex;F<E.results.length;F++){const U=E.results[F],G=U?.[0]?.transcript??"";U?.isFinal?I=I+G:M=M+G}I&&(f.current=f.current+I,r(f.current)),x.current=M,a(M)},D.onerror=E=>{p.current===D&&E.error!=="no-speech"&&(h.current=!1,p.current=null,A(),n(E.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,A(),n("idle"),"idle"}return"recording"},t[1]=v}else v=t[1];const j=v;let w;t[2]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{h.current=!1,p.current?.stop(),A(),n("idle"),l(Array(ke).fill(.05)),a("");const _=(f.current+(x.current?" "+x.current:"")).trim();return r(""),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(),A(),n("idle"),r(""),a(""),l(Array(ke).fill(.05)),f.current="",x.current=""},t[3]=C):C=t[3];const S=C;let N;return t[4]!==V||t[5]!==e||t[6]!==o||t[7]!==i?(N={status:e,transcript:o,interimTranscript:V,waveformData:i,isSupported:b,startRecording:j,stopRecording:y,cancelRecording:S},t[4]=V,t[5]=e,t[6]=o,t[7]=i,t[8]=N):N=t[8],N}function Zr(t){return t.stop()}function Jr(){}function Xr(){return Array(ke).fill(.05)}function ea(t){const e=P.c(4),{data:n}=t;let o;e[0]!==n?(o=n.map(ta),e[0]=n,e[1]=o):o=e[1];let r;return e[2]!==o?(r=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]=r):r=e[3],r}function ta(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 sa(t){return t.hasDraft?"send":t.isStreaming||t.isRunInProgress?"stop":"disabled"}function _e(t){const e=P.c(7),{message:n,icon:o}=t;let r;e[0]!==o?(r=o??s.jsx(yt,{size:14,className:"shrink-0"}),e[0]=o,e[1]=r):r=e[1];const V=n??"";let a;e[2]!==V?(a=s.jsx("span",{className:"text-sm",children:V}),e[2]=V,e[3]=a):a=e[3];let i;return e[4]!==r||e[5]!==a?(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:[r,a]}),e[4]=r,e[5]=a,e[6]=i):i=e[6],i}function na(t,e,n){const o=P.c(7),{editor:r}=jt(),V=Q(),[a,i]=L.useState(!1),l=L.useRef(0);let p,d;return o[0]!==n||o[1]!==r||o[2]!==e||o[3]!==t||o[4]!==V?(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=oa,h=f=>{if(f.preventDefault(),l.current=0,i(!1),n||!r||!t||!tt(t))return;const x=f.dataTransfer?.files;if(!x||x.length===0)return;const b=Array.from(x);(async()=>{let g=r.state.selection.from;for(const A of b)await Lt(r,t,A,g,e,V),g=r.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=[r,t,e,V,n],o[0]=n,o[1]=r,o[2]=e,o[3]=t,o[4]=V,o[5]=p,o[6]=d):(p=o[5],d=o[6]),L.useEffect(p,d),a}function oa(t){t.dataTransfer?.types.includes("Files")&&t.preventDefault()}function ra(t){const e=P.c(14),{selectedModel:n}=t,o=Q();let r,V,a;if(e[0]!==n||e[1]!==o){const{parts:p}=Kn(n);e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Hs,{size:24}),e[5]=a):a=e[5],r="text-sm font-medium";let d;e[6]!==o?(d=c=>o(c),e[6]=o,e[7]=d):d=e[7],V=o("chat.input.dropFilesHere",{fileTypes:p.map(d).join(", ")}),e[0]=n,e[1]=o,e[2]=r,e[3]=V,e[4]=a}else r=e[2],V=e[3],a=e[4];let i;e[8]!==r||e[9]!==V?(i=s.jsx("span",{className:r,children:V}),e[8]=r,e[9]=V,e[10]=i):i=e[10];let l;return e[11]!==a||e[12]!==i?(l=s.jsxs(s.Fragment,{children:[a,i]}),e[11]=a,e[12]=i,e[13]=l):l=e[13],l}function aa(){const t=P.c(5),e=Q();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(yt,{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 r;return t[3]!==o?(r=s.jsxs(s.Fragment,{children:[n,s.jsx("span",{className:"text-sm font-medium",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function Va(t){const e=P.c(11),{selectedModel:n,onUnsupportedFile:o,disabled:r}=t,V=na(n,o,r);let a;e[0]!==n?(a=tt(n),e[0]=n,e[1]=a):a=e[1];const i=a,l=V?"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=B("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(ra,{selectedModel:n}):s.jsx(aa,{}),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 De(t){const e=P.c(14),{onClick:n,label:o,icon:r,colorClass:V,maxWidthClass:a}=t;let i;e[0]!==V?(i=B("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",V),e[0]=V,e[1]=i):i=e[1];let l;e[2]!==a?(l=B("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:opacity-100",a),e[2]=a,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(He,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"}),e[7]=d):d=e[7];let c;return e[8]!==r||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:[r,p,d]}),e[8]=r,e[9]=o,e[10]=n,e[11]=i,e[12]=p,e[13]=c):c=e[13],c}function ia(){const t=P.c(6),e=Ge(),{org:n,locator:o}=Te(),{create:r}=mn();let V;return t[0]!==r||t[1]!==o||t[2]!==e||t[3]!==n.id||t[4]!==n.slug?(V=async a=>{const{tiptapDoc:i,virtualMcp:l,taskIntake:p}=a,d=p===void 0?!1:p,c=crypto.randomUUID(),u=l?.id??Oe(n.id).id;Es(sessionStorage,o,c,{tiptapDoc:d&&i?Io(i):i});try{await r({id:c,virtual_mcp_id:u})}catch{}const m={autosend:Fs};d&&(m.sidepanel=!0,m.mainpanel=!1),Ss(e,Ts({org:n.slug,agentId:u,superAgentId:Oe(n.id).id}),{search:()=>({...m,thread:c}),replace:!1})},t[0]=r,t[1]=o,t[2]=e,t[3]=n.id,t[4]=n.slug,t[5]=V):V=t[5],V}function uV({onOpenContextPanel:t,showConnectionsBanner:e=!1,homeTaskComposer:n=!1}){const o=Q(),r=an(),V=Vn(),a=r?.messages??[],i=r?.isStreaming??!1,l=r?.isRunInProgress??!1,p=r?.stop??(()=>{}),d=V?.taskId??"",c=d||$s,u=ia(),{selectedModel:m,selectedVirtualMcp:h,isModelsLoading:f,tiptapDocRef:x,imageModel:b,webSearchModel:g,deepResearchModel:A,chatMode:v,setChatMode:j}=Me(),{data:w}=Cs.useSession(),y=w?.user?.id,{org:C,locator:S}=Te(),[N,_]=Ns(ks.homeTaskMode(S),!0),T=n&&N,R=Oe(C.id).id,D=Ms(h?.id),E=Os(D?.id).runtime==="cms",M=ts(uo),[I,F]=L.useState(!1),{unsupportedFile:U,onUnsupportedFile:G,clearUnsupportedFile:$}=eo(),z=Hr(),Y=L.useRef(void 0),te=async()=>{Y.current=ee;const O=await z.startRecording();X("chat_voice_started",{thread_id:d,outcome:O==="recording"?"started":O==="unsupported"?"unsupported":O==="permission-denied"?"permission_denied":"unknown"})},J=()=>{X("chat_voice_confirmed",{thread_id:d});const O=z.stopRecording();le.current?.syncVoiceText(Y.current,O),le.current?.focus()},se=()=>{X("chat_voice_cancelled",{thread_id:d}),z.cancelRecording(),le.current?.restoreContent(Y.current)};L.useEffect(()=>{if(z.status!=="recording")return;const O=(z.transcript+(z.interimTranscript?" "+z.interimTranscript:"")).trim();le.current?.syncVoiceText(Y.current,O)},[z.transcript,z.interimTranscript,z.status]);const k=V?.activeTask??null,K=k?.created_by,q=!!(y&&K&&K!==y),{data:Z}=mo({enabled:q}),W=(Z?.data?.members??[]).find(O=>O.userId===K),re=W?.user?.name??W?.user?.email?.split("@")[0]??null,Ve=ho(),ie=ln({isDesktopApp:Ve,harnessId:k?.harness_id}),[ee,ae]=L.useState(()=>lt(sessionStorage,S,c)??void 0),oe=O=>{ae(O),x.current=O,Bs(sessionStorage,S,c,O,{onQuotaExceeded:({docSizeBytes:pe})=>{X("chat_draft_quota_exceeded",{thread_id:d||null,doc_size_bytes:pe}),console.warn("[chat-draft] sessionStorage quota exceeded; draft not saved")}})},de=L.useRef(d);if(de.current!==d){de.current=d;const O=lt(sessionStorage,S,c)??void 0;ae(O),x.current=O}const ve=[...a].reverse().find(O=>O.role==="assistant")?.metadata?.modelLimits?.contextWindow??m?.limits?.contextWindow,le=L.useRef(null),ye=L.useRef(!1),me=v==="plan",ue=O=>{M(),X("chat_mode_changed",{from_mode:O,to_mode:"default",source:"pill_dismiss"}),j("default")};L.useEffect(()=>{const O=pe=>{Ps(pe)&&pe.code==="KeyL"&&(pe.preventDefault(),pe.shiftKey&&j(v==="plan"?"default":"plan"),le.current?.focus())};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[v,j]);const ne=cn(a),Ne=[...a].reverse().find(O=>O.role==="assistant"&&O.metadata?.usage)?.metadata?.usage?.contextTokens??0,Ue=Ie("chat"),ss=Pn(),[ns,st]=L.useState(!1),[os,nt]=L.useState(!1),rs=!f&&!zs(ee),je=sa({hasDraft:rs,isStreaming:i,isRunInProgress:l}),Be=je==="send",we=je==="stop",ot=O=>{if(O?.preventDefault(),!Ue){st(!0);return}if(ss){nt(!0);return}if(je==="send"&&ee){if(X("chat_message_sent",{thread_id:d||null,mode:v,model_id:m?.modelId??null,model_provider:m?.providerId??null,virtual_mcp_id:h?.id??null,submission:O?"button_or_enter":"programmatic"}),r){if(r.isSendInFlight()){Se.info(o("chat.input.stillSendingPreviousMessage"));return}r.sendMessage(ee)}else T&&X("task_report_submitted",{source:"home"}),u({tiptapDoc:ee,virtualMcp:T?null:h,taskIntake:T});Us(sessionStorage,S,c),oe(void 0)}else je==="stop"&&(X("chat_message_stopped",{thread_id:d}),p())};if(q)return s.jsx(_e,{message:re?o("chat.input.readOnlyOthersChatNamed",{name:re}):o("chat.input.readOnlyOthersChat"),icon:re?s.jsx(po,{shape:"circle",size:"2xs",url:W?.user?.image??void 0,fallback:re.slice(0,2).toUpperCase()}):void 0});if(k?.metadata?.read_only)return s.jsx(_e,{message:o("chat.input.readOnlyThread")});if(ie)return s.jsx(_e,{message:o("chat.input.codingAgentRequiresDesktop")});if(E){if(!V)return s.jsx(_e,{message:o("chat.input.fastPreviewUnavailable")});const O=()=>{const pe=V.createTask({runtime:"sandbox"});X("coding_session_started",{thread_id:pe})};return s.jsxs("button",{type:"button",onClick:O,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(Gs,{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(wt,{size:16,className:"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]})}return s.jsxs(s.Fragment,{children:[ns&&s.jsx(pt,{feature:"chat",onDismiss:()=>st(!1)}),os&&s.jsx(pt,{feature:"chat",copy:{title:o("chat.input.allowanceExhaustedTitle")},onDismiss:()=>nt(!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"}),r&&V&&s.jsx(ze,{}),r&&V&&d?s.jsx(Tr,{taskId:d}):null,s.jsx(to,{tiptapDoc:ee,setTiptapDoc:oe,disabled:z.status==="recording",enterToSubmit:!0,placeholder:o(T?"chat.input.taskPlaceholder":"chat.input.placeholder"),onSubmit:ot,suggestionOpenRef:ye,children:s.jsxs("form",{onSubmit:ot,className:B("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(Va,{selectedModel:m,onUnsupportedFile:G,disabled:z.status==="recording"}),s.jsx("div",{className:"group/input relative flex flex-col gap-2 flex-1",children:s.jsx(so,{ref:le,disabled:z.status==="recording",virtualMcpId:h?.id??R,showFileUploader:!0,selectedModel:m,onUnsupportedFile:G,suggestionOpenRef:ye})}),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(ea,{data:z.waveformData.slice(0,28)}),s.jsx("button",{type:"button",onClick:se,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(He,{size:16})}),s.jsx("button",{type:"button",onClick:J,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(We,{size:16})})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[n&&s.jsx(H,{type:"button",size:"sm",variant:N?"secondary":"ghost","aria-pressed":N,onClick:()=>_(!N),className:"h-8",children:o("chat.input.taskMode")}),s.jsx(Qr,{disabled:!1,onOpenConnections:()=>{X("connections_dialog_opened",{source:"tools_popover",mode:"add"}),F(!0)},virtualMcpId:h?.id??R,selectedModel:m,isStreaming:i,onUnsupportedFile:G}),me&&s.jsx(De,{onClick:()=>ue("plan"),label:o("chat.input.planMode"),icon:s.jsx(St,{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"}),v==="gen-image"&&b&&s.jsx(De,{onClick:()=>ue("gen-image"),label:o("chat.input.createImage"),icon:s.jsx(_t,{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]"}),v==="web-search"&&g&&s.jsx(De,{onClick:()=>ue("web-search"),label:o("chat.input.webSearch"),icon:s.jsx(Tt,{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]"}),v==="deep-research"&&A&&s.jsx(De,{onClick:()=>ue("deep-research"),label:o("chat.input.deepResearch"),icon:s.jsx(It,{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]"}),ve&&Ne>0&&s.jsx(wn,{usage:ne,totalTokens:Ne,contextWindow:ve,onOpenContextPanel:t})]}),s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(zr,{}),z.isSupported&&s.jsx(H,{type:"button",onClick:te,disabled:!1,variant:"ghost",size:"icon",className:B("size-8 classic: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(qs,{size:18})}),s.jsx(H,{type:we?"button":"submit",onClick:O=>{we&&(O.preventDefault(),O.stopPropagation(),p())},variant:Be||we?"default":"ghost",size:T?"sm":"icon",disabled:!Be&&!we,className:B(T?"h-8 px-3 classic:rounded-lg transition-all":"size-8 classic:rounded-lg transition-all",!Be&&!we&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed"),title:o(je==="stop"?i?"chat.input.stopGenerating":"chat.input.cancelRun":T?"chat.input.startTask":"chat.input.sendMessageEnter"),"aria-label":o(je==="stop"?i?"chat.input.stopGenerating":"chat.input.cancelRun":T?"chat.input.startTask":"chat.input.sendMessage"),children:we?s.jsx(Ws,{size:20}):s.jsxs(s.Fragment,{children:[T&&o("chat.input.startTask"),s.jsx(Ct,{size:20})]})})]})]})})]})},d),n&&T&&s.jsx("p",{className:"px-3 pt-3 text-left text-xs text-muted-foreground",children:o("chat.input.taskHint")}),e&&s.jsx(Wr,{onClick:()=>{X("connections_banner_clicked",{source:"home_chat_input"}),X("connections_dialog_opened",{source:"home_banner",mode:"add"}),F(!0)}})]})}),s.jsx(fo,{mode:"browse",open:I,onOpenChange:F,defaultTab:"all"}),s.jsx(no,{info:U,onClose:$})]})}export{uV as C,cV as H,fr as T,xr as a,dV as u};