decocms 4.518.2 → 4.518.3

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 (415) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-EYkJV7tD.js → ActiveShapeUtils-Docp8wLu.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-CzTXJ0ax.js → AlertCircle-DbgHFTtO.js} +1 -1
  3. package/dist/client/assets/{AreaChart-8lCOmLfE.js → AreaChart-CcL-fFKM.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BQThfb60.js → ArrowLeft-B24gv2xe.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DUhCibLH.js → ArrowUp-CgN1Qhsf.js} +1 -1
  6. package/dist/client/assets/{BarChart-2wCpTPJ2.js → BarChart-CCFGMu0H.js} +1 -1
  7. package/dist/client/assets/{Building02-BOLEL9nK.js → Building02-DBmpU4M6.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-CmRg3x8T.js → CartesianChart-DHq2iPiU.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-BtQQT8Ex.js → CategoricalChart-Do09x_e5.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-OCgBlAwW.js → CheckCircle-Cqp__I1R.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-DaDJpoIU.js → ChevronSelectorVertical-Bg2KdIAv.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-DtSKb4be.js → ChevronUp-BJfOFayd.js} +1 -1
  13. package/dist/client/assets/{Copy01-DVWv3lef.js → Copy01-C8oI3ru2.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-Bw5uGiku.js → CreditCard01-DBg0t5KK.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-CEoX1VVK.js → DotsVertical-MgtYn_XR.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-i8geYMQV.js → ErrorBarContext-Bjgx2BpF.js} +1 -1
  17. package/dist/client/assets/{Globe04-CMBPkECo.js → Globe04-8XNa-DGn.js} +1 -1
  18. package/dist/client/assets/{Image01-D_y3XkIW.js → Image01-BYSI_JTy.js} +1 -1
  19. package/dist/client/assets/{Key01-p2EsnMlr.js → Key01-CVBy3Esl.js} +1 -1
  20. package/dist/client/assets/{Link01-D28gAr0F.js → Link01-1YHKCfLl.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-Dz2vlPBe.js → LinkBroken01-D8vKURBw.js} +1 -1
  22. package/dist/client/assets/{Minus-DNpWuD14.js → Minus-D7Nn8Jj1.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CYm-wjzD.js → Monitor01-th-leB7u.js} +1 -1
  24. package/dist/client/assets/{Play-cNq95jJS.js → Play-B3knqxcb.js} +1 -1
  25. package/dist/client/assets/{Plus-C4rGoU1F.js → Plus-Bf8vM3Sx.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-BvmA07RC.js → ReferenceLine-DevuDJh8.js} +1 -1
  27. package/dist/client/assets/{SearchMd-BYCOzBqa.js → SearchMd-C1vd4NNy.js} +1 -1
  28. package/dist/client/assets/{Sector-23KRNcXn.js → Sector-CjducGVR.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-DvN3FHxE.js → ShoppingBag01-Bkku1Te9.js} +1 -1
  30. package/dist/client/assets/{Sun-DFIh8Vd-.js → Sun-C_rfv84K.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-D6mwjnXs.js → SwitchHorizontal01-DsxrRdFb.js} +1 -1
  32. package/dist/client/assets/{Tool01-_CVpzZpk.js → Tool01-XzMXqYKz.js} +1 -1
  33. package/dist/client/assets/{Trash01-CgNTH-jr.js → Trash01-C68DqBe-.js} +1 -1
  34. package/dist/client/assets/{Upload01-CiTZ5ZQQ.js → Upload01-D4h8lLWj.js} +1 -1
  35. package/dist/client/assets/{User01-vLr2BfmM.js → User01-BKJMa06q.js} +1 -1
  36. package/dist/client/assets/{UserSquare-B7fe7FYj.js → UserSquare-ezkB_C7H.js} +1 -1
  37. package/dist/client/assets/{Users01-BgSWeeD_.js → Users01-sQ3Jopve.js} +1 -1
  38. package/dist/client/assets/{XClose-B_rQyiiY.js → XClose-5-Y_ZVDY.js} +1 -1
  39. package/dist/client/assets/{ZoomOut-DzrH576O.js → ZoomOut-CTwXyALk.js} +1 -1
  40. package/dist/client/assets/{access-gate-CjdHb0j3.js → access-gate-BAeTdIKF.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-DyCA7E5B.js → add-connection-dialog-CzGzxkZf.js} +1 -1
  42. package/dist/client/assets/agent-analytics-CyvLQ78l.js +1 -0
  43. package/dist/client/assets/agent-app-CNlTu6Xl.js +1 -0
  44. package/dist/client/assets/{agent-assets-AUU4xJcf.js → agent-assets-CDrWVXsZ.js} +1 -1
  45. package/dist/client/assets/{agent-automation-H4qJ1HOM.js → agent-automation-CANuyesn.js} +3 -3
  46. package/dist/client/assets/agent-automations-FCLkmptj.js +1 -0
  47. package/dist/client/assets/agent-calendar-ChKa8nwx.js +1 -0
  48. package/dist/client/assets/{agent-connect-sources-DO6Zn3Mx.js → agent-connect-sources-DPRFzy_W.js} +1 -1
  49. package/dist/client/assets/agent-deck-DgzTTX-H.js +1 -0
  50. package/dist/client/assets/{agent-e2e-BswlcjA7.js → agent-e2e-CGsydJDk.js} +1 -1
  51. package/dist/client/assets/agent-experiments-g1fOqVOr.js +1 -0
  52. package/dist/client/assets/agent-file-DZxHfHqj.js +1 -0
  53. package/dist/client/assets/{agent-hosting-CgIJCVf2.js → agent-hosting-DLdgWaMb.js} +1 -1
  54. package/dist/client/assets/{agent-icon-BVqmbz-P.js → agent-icon-Bl0Q4nDQ.js} +1 -1
  55. package/dist/client/assets/agent-library-T0msL9vO.js +1 -0
  56. package/dist/client/assets/agent-library-file-Dc6tLUFf.js +1 -0
  57. package/dist/client/assets/agent-monitor-64lw2Ndx.js +1 -0
  58. package/dist/client/assets/{agent-overview-BnCn329o.js → agent-overview-DmbW8VOm.js} +1 -1
  59. package/dist/client/assets/{agent-releases-PaWDRDlN.js → agent-releases-DJsbXDlS.js} +1 -1
  60. package/dist/client/assets/agent-settings-BEGX73lw.js +1 -0
  61. package/dist/client/assets/{agent-site-editor-Dgv9OUYF.js → agent-site-editor-Dn7we51s.js} +1 -1
  62. package/dist/client/assets/agent-site-editor-code-MGF1GSqb.js +2 -0
  63. package/dist/client/assets/agent-site-editor-content-KSRD36m4.js +1 -0
  64. package/dist/client/assets/agent-site-editor-preview-jNYBd5Qs.js +1 -0
  65. package/dist/client/assets/agent-view-Cmt42rZM.js +1 -0
  66. package/dist/client/assets/{agent-view-guard-CIz__L_S.js → agent-view-guard-B0aDsWRb.js} +1 -1
  67. package/dist/client/assets/{agents-list-B9ydQIh8.js → agents-list-lOOhfuKV.js} +1 -1
  68. package/dist/client/assets/{ai-providers-BvGFGpkW.js → ai-providers-Bm7atoS5.js} +1 -1
  69. package/dist/client/assets/{alert-dialog-Bbqu21pF.js → alert-dialog-SFY1grIM.js} +2 -2
  70. package/dist/client/assets/alert-fsJICKf8.js +1 -0
  71. package/dist/client/assets/{analytics-sections-CXA9Djw5.js → analytics-sections-KGMek742.js} +1 -1
  72. package/dist/client/assets/{analytics-tab-CNbGVSyT.js → analytics-tab-DrPnNwhC.js} +1 -1
  73. package/dist/client/assets/{api-keys-zMWE0eW-.js → api-keys-DGMEM3Pu.js} +1 -1
  74. package/dist/client/assets/api-keys-DxiLI10z.js +1 -0
  75. package/dist/client/assets/{app-editor-BnLt2HBc.js → app-editor-6m_ygtwU.js} +1 -1
  76. package/dist/client/assets/{asset-utils-CQBKR3VN.js → asset-utils-DJKQ3jqO.js} +1 -1
  77. package/dist/client/assets/{auth-catchall-BeibfVV0.js → auth-catchall-BDasxET4.js} +1 -1
  78. package/dist/client/assets/{auth-entry-DgsnWxp_.js → auth-entry-CIp781XC.js} +1 -1
  79. package/dist/client/assets/{auth-BypL5L1O.js → auth-k-50r1Jm.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-Daxd6Ypw.js → auth-split-layout-DKyMuscv.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-ClTAD7nN.js → authenticate-and-persist-oauth-Citp3_ku.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-CvwYuhxk.js → automation-list-row-DCYvqhb1.js} +1 -1
  83. package/dist/client/assets/{automation-runs-CApbL_Sf.js → automation-runs-Bv01EPr_.js} +1 -1
  84. package/dist/client/assets/{automations-Di1Er6hW.js → automations-CMa4N4ws.js} +1 -1
  85. package/dist/client/assets/{autosend-B4f5gabb.js → autosend-BUGExBM4.js} +1 -1
  86. package/dist/client/assets/{avatar-CFO-sRGJ.js → avatar-DZp2nksb.js} +1 -1
  87. package/dist/client/assets/badge-B8Ivcb6S.js +1 -0
  88. package/dist/client/assets/{block-document-C4MOQYjr.js → block-document-t9Z4rWQI.js} +1 -1
  89. package/dist/client/assets/{blocks-preview-workspace-context-Bq9hpUEB.js → blocks-preview-workspace-context-guMABPcp.js} +1 -1
  90. package/dist/client/assets/{blocks-tab-states-CwfYFgj9.js → blocks-tab-states-Ch0bvZWI.js} +1 -1
  91. package/dist/client/assets/{blog-schema-CgYPJyE9.js → blog-schema-DGhK3ld9.js} +1 -1
  92. package/dist/client/assets/{buckets-DoEfEinO.js → buckets-PCZkbjVY.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-BByi4O7Q.js → build-improve-prompt-doc-Ba28GGJ7.js} +1 -1
  94. package/dist/client/assets/{calendar-AEesHfNc.js → calendar-BDnGPQeR.js} +1 -1
  95. package/dist/client/assets/{campaigns-view-DTbZCmg6.js → campaigns-view-BzxbPG_g.js} +1 -1
  96. package/dist/client/assets/{capability-load-error-BfKRzvUM.js → capability-load-error-h9GaAVI2.js} +1 -1
  97. package/dist/client/assets/{category-editor-sR05FPNS.js → category-editor-BCaNtr8G.js} +1 -1
  98. package/dist/client/assets/{cdn-tab-9RYVl35J.js → cdn-tab-BxlHc73J.js} +1 -1
  99. package/dist/client/assets/{chart-D7lvPdFx.js → chart-CF2951Pl.js} +1 -1
  100. package/dist/client/assets/{chat-context-DqNUlJMY.js → chat-context-C_P788VD.js} +6 -6
  101. package/dist/client/assets/{chat-draft-DeylAkNb.js → chat-draft-Cd62GOk3.js} +1 -1
  102. package/dist/client/assets/{checkbox-JO6XiJJq.js → checkbox-D_LpTCuo.js} +1 -1
  103. package/dist/client/assets/{choose-editor-CQPIEsfr.js → choose-editor-CB85FQ98.js} +1 -1
  104. package/dist/client/assets/{cli-auth-success-DksDQz1c.js → cli-auth-success-6cvMKGqI.js} +1 -1
  105. package/dist/client/assets/{client-icons-DbBtP136.js → client-icons-CwlNIvVS.js} +1 -1
  106. package/dist/client/assets/cms-settings-editor-CoBhi6-0.js +1 -0
  107. package/dist/client/assets/{collapsible-CXUiqrZ3.js → collapsible-BHKr0Yuy.js} +1 -1
  108. package/dist/client/assets/{collection-detail-BXm00G6J.js → collection-detail--pNpxuBG.js} +1 -1
  109. package/dist/client/assets/{collection-display-button-BYX1WGsT.js → collection-display-button-CmGqnHZR.js} +1 -1
  110. package/dist/client/assets/{collection-search-CVvFJ5Bb.js → collection-search-BfeTverb.js} +1 -1
  111. package/dist/client/assets/{collection-table-wrapper-_tytodYv.js → collection-table-wrapper-DbYcMpOp.js} +1 -1
  112. package/dist/client/assets/{collection-tabs-8dvqqnDR.js → collection-tabs-BCwnkCTo.js} +1 -1
  113. package/dist/client/assets/{column-rules-iw7Orhw0.js → column-rules-cuIMwEgL.js} +1 -1
  114. package/dist/client/assets/{combobox-CS_HItwQ.js → combobox-Br3ekqoF.js} +1 -1
  115. package/dist/client/assets/{command-C9iGFbUT.js → command-9a3EU_B7.js} +1 -1
  116. package/dist/client/assets/{companion-mcps-section-DuvDeify.js → companion-mcps-section-Bict1-Py.js} +1 -1
  117. package/dist/client/assets/{config-Ba5RPb40.js → config-HnMhGwJ8.js} +1 -1
  118. package/dist/client/assets/{connect-Q-Yb-tbQ.js → connect-CPP1LzMI.js} +1 -1
  119. package/dist/client/assets/{connect-layout-BsURWVqR.js → connect-layout-CoCuwn0R.js} +1 -1
  120. package/dist/client/assets/{connect-source-dialog-Cugh2Kwq.js → connect-source-dialog-tW0_dVgF.js} +1 -1
  121. package/dist/client/assets/{connection-y8T_LUE4.js → connection-DA0DdtmE.js} +1 -1
  122. package/dist/client/assets/{connection-card-C_97TUuR.js → connection-card-D6khbIvi.js} +1 -1
  123. package/dist/client/assets/{connection-detail-B2pboQAc.js → connection-detail-3DINZ9Ps.js} +1 -1
  124. package/dist/client/assets/{connection-form-helpers-B61Y3llL.js → connection-form-helpers-CD1Glq-b.js} +1 -1
  125. package/dist/client/assets/{connections-BtM211zd.js → connections-5zgE9hOg.js} +1 -1
  126. package/dist/client/assets/{content-tab-6aM6SPfn.js → content-tab-DsX079ZZ.js} +3 -3
  127. package/dist/client/assets/{context-Dhzbo3rE.js → context-D_yEBKdV.js} +1 -1
  128. package/dist/client/assets/{context-menu-DvfYSbOF.js → context-menu-CQmIAsNX.js} +1 -1
  129. package/dist/client/assets/{context-shell-DQlTMTgZ.js → context-shell-Cm9pkJeZ.js} +3 -3
  130. package/dist/client/assets/{core.esm-Bnj1keGH.js → core.esm-KXf7B9P5.js} +1 -1
  131. package/dist/client/assets/{create-organization-dialog-BJw0GqGQ.js → create-organization-dialog-CU3HQ3J9.js} +1 -1
  132. package/dist/client/assets/{daily-pulse-ambOqGdx.js → daily-pulse-BTMsF03t.js} +1 -1
  133. package/dist/client/assets/{discover-BaCG_0h-.js → discover-CF8v9Owa.js} +1 -1
  134. package/dist/client/assets/{domain-settings-DvRELpY-.js → domain-settings-BE6GV0Yp.js} +1 -1
  135. package/dist/client/assets/{drawer-txFUQcqx.js → drawer-BTNZfEU6.js} +1 -1
  136. package/dist/client/assets/{editor-classes-C__SrxMV.js → editor-classes-DQrtem9w.js} +1 -1
  137. package/dist/client/assets/{editor-DxbkHv3R.js → editor-swke_0an.js} +1 -1
  138. package/dist/client/assets/{empty-state-bJzQYitF.js → empty-state-CkRk6emt.js} +1 -1
  139. package/dist/client/assets/{empty-state-BCgDvmX-.js → empty-state-DjnYxJoJ.js} +1 -1
  140. package/dist/client/assets/experiments-tab-6fYgjeCj.js +1 -0
  141. package/dist/client/assets/experiments-tab-choice-DLYJ3Xgw.js +1 -0
  142. package/dist/client/assets/{extract-connection-data-DrQExIK1.js → extract-connection-data-BcSeYo2b.js} +1 -1
  143. package/dist/client/assets/{feature-gate-Q2dMtYpF.js → feature-gate-DnDfxxPc.js} +1 -1
  144. package/dist/client/assets/{feature-paywall-XpETcjbv.js → feature-paywall-DbYyln6a.js} +1 -1
  145. package/dist/client/assets/{file-explorer-CfVYwLoJ.js → file-explorer-CmXZRbDC.js} +1 -1
  146. package/dist/client/assets/{file-preview-Dd06GGvy.js → file-preview-CB-QuWoi.js} +1 -1
  147. package/dist/client/assets/{file-share-button-BxZcqmJb.js → file-share-button-5DKLtCO8.js} +2 -2
  148. package/dist/client/assets/{file-type-icon-CIdo5ojc.js → file-type-icon-BlPndn8R.js} +1 -1
  149. package/dist/client/assets/{folder-icon-EiO3M0UC.js → folder-icon-50i43Zdi.js} +2 -2
  150. package/dist/client/assets/{form-uqsH1s-y.js → form-CWlPjOiE.js} +1 -1
  151. package/dist/client/assets/{general-Vd-hJfIm.js → general-DiUoRhmp.js} +1 -1
  152. package/dist/client/assets/{home-HWe4c99-.js → home-DgNlH8AE.js} +1 -1
  153. package/dist/client/assets/{icon-button-BUDG7R_U.js → icon-button-BjI92SlL.js} +1 -1
  154. package/dist/client/assets/{index-C_7vDyVA.js → index-AzZxgAUy.js} +1 -1
  155. package/dist/client/assets/{index-BtufcGJ5.js → index-BT89s1_n.js} +1 -1
  156. package/dist/client/assets/{index-v9zzzqiT.js → index-BiGgRVLA.js} +1 -1
  157. package/dist/client/assets/{index-kjyiSPIZ.js → index-BzTLQsHh.js} +1 -1
  158. package/dist/client/assets/{index-BphI8pNH.js → index-CImJlq71.js} +38 -38
  159. package/dist/client/assets/{index-B7PBSrog.js → index-ChO_KP9v.js} +1 -1
  160. package/dist/client/assets/{index-BP0spIbU.js → index-D5TlKaB4.js} +1 -1
  161. package/dist/client/assets/index-D8VCkLtE.js +1 -0
  162. package/dist/client/assets/{index-C5xgscqu.js → index-DQ2PXCBR.js} +1 -1
  163. package/dist/client/assets/{index-BCGh3XTH.js → index-DYNe4TdA.js} +1 -1
  164. package/dist/client/assets/{index-7jvcir73.js → index-DfzKVEQZ.js} +1 -1
  165. package/dist/client/assets/{index-CW0mTKOH.js → index-UjSXE0Iy.js} +1 -1
  166. package/dist/client/assets/{index-Codsxxmu.js → index-YTcaUBCs.js} +1 -1
  167. package/dist/client/assets/{index-B4zmwgCj.js → index-YVO_Peic.js} +1 -1
  168. package/dist/client/assets/{index-unPBFo0y.js → index-YbD_X2Sg.js} +1 -1
  169. package/dist/client/assets/{index-redirect-TlUNx3Dt.js → index-redirect-DDzvngbU.js} +1 -1
  170. package/dist/client/assets/{infiniteQueryObserver-CD6zPv_B.js → infiniteQueryObserver-BPnYbZuQ.js} +1 -1
  171. package/dist/client/assets/{infra-billing-gJ1Pxkhj.js → infra-billing-BqdikAj2.js} +1 -1
  172. package/dist/client/assets/{input-otZYQGEr.js → input-BHFkZ3T9.js} +3 -3
  173. package/dist/client/assets/{input-DeNGl9cT.js → input-Cs9OOIz-.js} +1 -1
  174. package/dist/client/assets/{integration-icon-C-_9oW7G.js → integration-icon-B9snkXuC.js} +1 -1
  175. package/dist/client/assets/{jira-icon-7kZdJvHs.js → jira-icon-DIYO8jdA.js} +1 -1
  176. package/dist/client/assets/{label-BXumUTqC.js → label-CfvfFl3x.js} +1 -1
  177. package/dist/client/assets/{layout-Ba0KZf90.js → layout-BRYkue1F.js} +1 -1
  178. package/dist/client/assets/{legacy-agents-deep-D4pxgM1l.js → legacy-agents-deep-Sb6HNynM.js} +1 -1
  179. package/dist/client/assets/{legacy-main-redirect-BQ_7LpiD.js → legacy-main-redirect-DxGhnvQi.js} +1 -1
  180. package/dist/client/assets/library-BWuIS4mc.js +1 -0
  181. package/dist/client/assets/{login-CtcB6JMd.js → login-BoKhcWPb.js} +1 -1
  182. package/dist/client/assets/{markdown-Bqq3R66p.js → markdown-BDnIqP7U.js} +1 -1
  183. package/dist/client/assets/{mcp-app-renderer-tCfKhIA1.js → mcp-app-renderer-vmvnP_G4.js} +1 -1
  184. package/dist/client/assets/{mcp-oauth-ZxlBJ_T6.js → mcp-oauth-Bf1ymd_L.js} +1 -1
  185. package/dist/client/assets/{mcp-oauth-CaTRnuQU.js → mcp-oauth-De4zWGdY.js} +1 -1
  186. package/dist/client/assets/{members-Ds3beXMQ.js → members-C_49FqGn.js} +1 -1
  187. package/dist/client/assets/{memory-CgI9n1je.js → memory-DB-8JkBQ.js} +1 -1
  188. package/dist/client/assets/{mini-report-page-C4CjzrcA.js → mini-report-page-UFZ1_IfA.js} +1 -1
  189. package/dist/client/assets/{mock-board-x9OA1kIr.js → mock-board-uI6Kjr1q.js} +3 -3
  190. package/dist/client/assets/{monaco-editor-DZ2Rp_C7.js → monaco-editor-FMQP-sIq.js} +2 -2
  191. package/dist/client/assets/{monitoring-BkpBpvIZ.js → monitoring-D8MQ-E4C.js} +1 -1
  192. package/dist/client/assets/{monitoring-stats-row-tdOtylzh.js → monitoring-stats-row-BGPZUteu.js} +1 -1
  193. package/dist/client/assets/{multi-select-BnYAqN90.js → multi-select-CjpZ72b0.js} +1 -1
  194. package/dist/client/assets/{mustache-DuPMqXPT.js → mustache-wrPcgRSJ.js} +1 -1
  195. package/dist/client/assets/{named-rule-uses-BFHY2QY4.js → named-rule-uses-DUhhItNP.js} +1 -1
  196. package/dist/client/assets/{named-rule-view-DHbEzjpv.js → named-rule-view-DuazhL5D.js} +1 -1
  197. package/dist/client/assets/{new-project-dialog-Cs8HMQlb.js → new-project-dialog-CEUx8Wuz.js} +1 -1
  198. package/dist/client/assets/{oauth-callback-DSM8XE33.js → oauth-callback-VCDp4Mdt.js} +1 -1
  199. package/dist/client/assets/{oauth-callback-ai-provider-DgCpBfDW.js → oauth-callback-ai-provider-DA8fj9mx.js} +1 -1
  200. package/dist/client/assets/{onboarding-DeVuIfK9.js → onboarding-CNAboKGM.js} +1 -1
  201. package/dist/client/assets/{openai-conversation-CXYNFSGC.js → openai-conversation-DzWEkMFW.js} +2 -2
  202. package/dist/client/assets/{optimistic-project-sidebar-views-VOTXYU3D.js → optimistic-project-sidebar-views-DtUy3pl1.js} +1 -1
  203. package/dist/client/assets/{order-monitor-day-Bxp4gXEu.js → order-monitor-day-AyxJmcAH.js} +1 -1
  204. package/dist/client/assets/{organization-choice-BhCIGMjr.js → organization-choice-BQVJgGgg.js} +1 -1
  205. package/dist/client/assets/{orgs-BPDKksL2.js → orgs-D0MWQorV.js} +1 -1
  206. package/dist/client/assets/{page-seo-form-WBlhJY38.js → page-seo-form-Dbm_mNqs.js} +1 -1
  207. package/dist/client/assets/{pair-DRaIXAj-.js → pair-CNR7-_qK.js} +8 -8
  208. package/dist/client/assets/{parse-sections-ClqXxi6i.js → parse-sections-BYTdQHxf.js} +1 -1
  209. package/dist/client/assets/{plan-DVQ6L_2j.js → plan-CEyzI8hm.js} +1 -1
  210. package/dist/client/assets/{plan-ladder-BJOn0tjJ.js → plan-ladder-Chib98li.js} +1 -1
  211. package/dist/client/assets/{popover-D-MLGIKG.js → popover-BqGcOxqn.js} +1 -1
  212. package/dist/client/assets/{post-calendar-Ywpfpf68.js → post-calendar-2c7rIKCZ.js} +1 -1
  213. package/dist/client/assets/{post-editor-tA48ONL1.js → post-editor-CRPwAV6k.js} +2 -2
  214. package/dist/client/assets/{preview-content-0nJULLLy.js → preview-content-C3GD-BQD.js} +1 -1
  215. package/dist/client/assets/{preview-dialog-DweVJd_n.js → preview-dialog-vLTpbCc0.js} +1 -1
  216. package/dist/client/assets/{preview-panel-BJ3KrhDy.js → preview-panel-C6xrnpJj.js} +1 -1
  217. package/dist/client/assets/{preview-tab-C3IiVwf1.js → preview-tab-CBRKeC1b.js} +3 -3
  218. package/dist/client/assets/{product-picker-dialog-CCIg354O.js → product-picker-dialog-DHVGLlrb.js} +1 -1
  219. package/dist/client/assets/{profile-ZCnKsIdj.js → profile-C5h78yhG.js} +1 -1
  220. package/dist/client/assets/project-app-view-C3iPvweM.js +1 -0
  221. package/dist/client/assets/{project-apps-FJ0TrEc6.js → project-apps-D7YctFcN.js} +1 -1
  222. package/dist/client/assets/{project-feed-CZ6ECbBu.js → project-feed-CpfPTWDh.js} +1 -1
  223. package/dist/client/assets/{project-icon-J_TfV9WN.js → project-icon-B-MVviOF.js} +1 -1
  224. package/dist/client/assets/project-reports-qKDYuHCF.js +1 -0
  225. package/dist/client/assets/project-tasks-C08bqxWt.js +1 -0
  226. package/dist/client/assets/{projects-BGlrrPvQ.js → projects-DrGNXye1.js} +1 -1
  227. package/dist/client/assets/{projects-empty-state-B699jX9t.js → projects-empty-state-B6Ieq7wG.js} +1 -1
  228. package/dist/client/assets/{prompts-CL3pb_We.js → prompts-DszjlGng.js} +1 -1
  229. package/dist/client/assets/record-editor-zoDoy66N.js +1 -0
  230. package/dist/client/assets/{redirect-editor-DwpwMdsP.js → redirect-editor-D4gU7n0c.js} +1 -1
  231. package/dist/client/assets/{releases-api-DX2L3yOb.js → releases-api-CK0jSLYO.js} +1 -1
  232. package/dist/client/assets/reports-CalnjK7E.js +1 -0
  233. package/dist/client/assets/{reports-fz3ShzPV.js → reports-CjnzDShS.js} +1 -1
  234. package/dist/client/assets/{reports-onboarding-mTQFH_iA.js → reports-onboarding-C81Upwj7.js} +1 -1
  235. package/dist/client/assets/{reports-tab-Bon4oiNK.js → reports-tab-DJdkQM-o.js} +2 -2
  236. package/dist/client/assets/repositories-C7NPKiSj.js +1 -0
  237. package/dist/client/assets/{repositories-Pjwn0cqi.js → repositories-IyZ5mwlx.js} +1 -1
  238. package/dist/client/assets/{repository-binding-CqjA7Tko.js → repository-binding-wXpkgUS5.js} +1 -1
  239. package/dist/client/assets/{repository-import-picker-DRcn5MCM.js → repository-import-picker-DWw4DnKc.js} +1 -1
  240. package/dist/client/assets/{repository-picker-BL6xlIly.js → repository-picker-fHOvHVjl.js} +1 -1
  241. package/dist/client/assets/{require-capability-gPmNE28i.js → require-capability-B4IJOpH-.js} +1 -1
  242. package/dist/client/assets/{required-auth-layout-BA3Gxw_5.js → required-auth-layout-p9wTtbkA.js} +1 -1
  243. package/dist/client/assets/{reset-password-qyVzV1QI.js → reset-password-CpXnMk-E.js} +1 -1
  244. package/dist/client/assets/{resizable-Bu3AyxKl.js → resizable-CykEr2xO.js} +1 -1
  245. package/dist/client/assets/{resolve-tab-icon-DXt8FU1X.js → resolve-tab-icon-dNyXGxcc.js} +1 -1
  246. package/dist/client/assets/{review-settings-O8K_mvh6.js → review-settings-D36VxF8a.js} +1 -1
  247. package/dist/client/assets/{roles-CCLRm2p0.js → roles-DPB4O14g.js} +1 -1
  248. package/dist/client/assets/{route-DaeLPCnk.js → route-CH9GHNDj.js} +1 -1
  249. package/dist/client/assets/route-DsIfFih1.js +1 -0
  250. package/dist/client/assets/route-rXh3k9jX.js +1 -0
  251. package/dist/client/assets/{runnable-block-editor-DXVt1mRj.js → runnable-block-editor-CvNZGRDu.js} +6 -6
  252. package/dist/client/assets/{sandbox-lifecycle-context-CAD11jz7.js → sandbox-lifecycle-context-CsnW_1kh.js} +1 -1
  253. package/dist/client/assets/{schema-Ddw2ah-q.js → schema-BXcU44Bp.js} +1 -1
  254. package/dist/client/assets/{schema-BKLQwKnK.js → schema-BjLtWzT5.js} +1 -1
  255. package/dist/client/assets/{scroll-area-GNWuujdQ.js → scroll-area-BZP0xkZ2.js} +1 -1
  256. package/dist/client/assets/{search-input-i8DAXvnS.js → search-input-CLbrLBK4.js} +1 -1
  257. package/dist/client/assets/{search-toggle-C2BWIs4O.js → search-toggle-Bz--u_u6.js} +1 -1
  258. package/dist/client/assets/{secret-ciphertext-BA15G7qe.js → secret-ciphertext-DZQPZkTr.js} +1 -1
  259. package/dist/client/assets/{secret-picker-CwZHe4Yx.js → secret-picker-r4BGxMfM.js} +1 -1
  260. package/dist/client/assets/{secrets-BWNDO0aL.js → secrets-CzuDVgfq.js} +1 -1
  261. package/dist/client/assets/{sections-DhRieK41.js → sections-DE80daGy.js} +1 -1
  262. package/dist/client/assets/{sections-editor-TqSLQIU8.js → sections-editor-C5rNMLKQ.js} +1 -1
  263. package/dist/client/assets/{select-BAxIwkW7.js → select-CO-KeEXe.js} +1 -1
  264. package/dist/client/assets/{select-model-DKcSOpKv.js → select-model-B9aWAF7v.js} +1 -1
  265. package/dist/client/assets/{seo-editor-BhgypNCN.js → seo-editor-C5HGby9p.js} +1 -1
  266. package/dist/client/assets/{separator-gKWGw3ec.js → separator-Dr93-tcp.js} +1 -1
  267. package/dist/client/assets/settings-tab-OQ9gNE2t.js +1 -0
  268. package/dist/client/assets/{sheet-Dy9d78N0.js → sheet-DYqe447t.js} +1 -1
  269. package/dist/client/assets/shell-layout-Bmd6dXD4.js +1 -0
  270. package/dist/client/assets/{site-draft-actions-BjAr6xi6.js → site-draft-actions-CNazOyJI.js} +1 -1
  271. package/dist/client/assets/site-draft-view-CaiajxbQ.js +2 -0
  272. package/dist/client/assets/site-editor-BC9YFkDH.js +1 -0
  273. package/dist/client/assets/{site-editor-toast-n7tT-SpR.js → site-editor-toast-Ckx512no.js} +1 -1
  274. package/dist/client/assets/{skills-C-lfUnzb.js → skills-Dq2dQBym.js} +1 -1
  275. package/dist/client/assets/{slider-DMzP4oef.js → slider-Dm9m4Zom.js} +1 -1
  276. package/dist/client/assets/{sortable.esm-BEpH5tbt.js → sortable.esm-PpUBUYvN.js} +1 -1
  277. package/dist/client/assets/{sso-Bdl8tzvn.js → sso-et00F2-M.js} +1 -1
  278. package/dist/client/assets/{suggestion-BfzPP8A_.js → suggestion-CaGvyBH6.js} +1 -1
  279. package/dist/client/assets/{switch-B0lPkF5_.js → switch-DGiOaGRn.js} +1 -1
  280. package/dist/client/assets/{symbol-CcauWbN2.js → symbol-ZVON6uKU.js} +1 -1
  281. package/dist/client/assets/{synced-repos-cKAzeg2x.js → synced-repos-CKQ3x7oT.js} +1 -1
  282. package/dist/client/assets/{tab-icon-glyph-C2nHjzae.js → tab-icon-glyph-DLj4dmeB.js} +1 -1
  283. package/dist/client/assets/{table-CeULXNQ2.js → table-DcqK9CO1.js} +1 -1
  284. package/dist/client/assets/{tabs-fkqYJpP8.js → tabs-CU2NQvm6.js} +1 -1
  285. package/dist/client/assets/{task-assignee-avatar-BuSQPIHq.js → task-assignee-avatar-Cs9bBLeR.js} +1 -1
  286. package/dist/client/assets/{task-board-Cv7D_3uN.js → task-board-CRvOV9zQ.js} +1 -1
  287. package/dist/client/assets/{task-route-dMm35uIv.js → task-route-BPQ9h0t-.js} +1 -1
  288. package/dist/client/assets/{task-status-D3EaEAgF.js → task-status-k_KZvqi3.js} +1 -1
  289. package/dist/client/assets/{taskboard-analytics-C2Yib8gP.js → taskboard-analytics-DXKp_Xl8.js} +1 -1
  290. package/dist/client/assets/{tasks-Cx6Zd4fY.js → tasks-CJWFfvRo.js} +1 -1
  291. package/dist/client/assets/tasks-DfOAe8MK.js +1 -0
  292. package/dist/client/assets/{textarea-aGNI5bvN.js → textarea-Bp989dUN.js} +1 -1
  293. package/dist/client/assets/{thread-analytics-B9HcTgTh.js → thread-analytics-CMG9NspT.js} +1 -1
  294. package/dist/client/assets/{thread-intent-BQGp3MKl.js → thread-intent-DXY7orZh.js} +1 -1
  295. package/dist/client/assets/{thread-route-BEIPJEss.js → thread-route-B1rrIJuw.js} +1 -1
  296. package/dist/client/assets/{thread-route-D147zL8e.js → thread-route-ChN9O-1A.js} +1 -1
  297. package/dist/client/assets/{thread-sheet-body-i2u8ULqW.js → thread-sheet-body-D-x-TABK.js} +1 -1
  298. package/dist/client/assets/{time-range-picker-0kVuNsQb.js → time-range-picker-B10kjTj_.js} +1 -1
  299. package/dist/client/assets/{toggle-group-DaYieoyW.js → toggle-group-K25Bl_Tm.js} +1 -1
  300. package/dist/client/assets/{tool-namespace-DqsoHKmd.js → tool-namespace-ln4cIuCt.js} +1 -1
  301. package/dist/client/assets/{toolbar-icon-button-3blDPoB6.js → toolbar-icon-button-NAoOtagz.js} +1 -1
  302. package/dist/client/assets/{tooltip-2YCPx1DM.js → tooltip-BB8x2ajM.js} +1 -1
  303. package/dist/client/assets/{tooltipContext-CgeI21sB.js → tooltipContext-DG-hvJrr.js} +1 -1
  304. package/dist/client/assets/{track-DO9rvMbw.js → track-DwVNsvWy.js} +1 -1
  305. package/dist/client/assets/{types-6BxgL_uJ.js → types-D4eFbg3n.js} +2 -2
  306. package/dist/client/assets/{url-slug-DxJ8K4M_.js → url-slug-Ck137SN4.js} +1 -1
  307. package/dist/client/assets/{usage-stats-BHO2m1GZ.js → usage-stats-DpZZQ75-.js} +1 -1
  308. package/dist/client/assets/{use-ai-providers-D11veeve.js → use-ai-providers-Cng_Zcqq.js} +1 -1
  309. package/dist/client/assets/{use-apply-named-rule-B4OGys4b.js → use-apply-named-rule-5US13ud-.js} +1 -1
  310. package/dist/client/assets/{use-automations-tbwaowTj.js → use-automations-BV-J2Ily.js} +1 -1
  311. package/dist/client/assets/{use-autosave-DfMGkaud.js → use-autosave-By6DVzfK.js} +1 -1
  312. package/dist/client/assets/{use-chat-layout-state-CIyU-XxO.js → use-chat-layout-state-CNkklJiF.js} +1 -1
  313. package/dist/client/assets/{use-clock-tick-DRqivY5H.js → use-clock-tick-D95T8222.js} +1 -1
  314. package/dist/client/assets/{use-connect-companion-pRfQU03M.js → use-connect-companion-BRWaN5AJ.js} +1 -1
  315. package/dist/client/assets/{use-connection-hBtWetVy.js → use-connection-CAJy9ePc.js} +1 -1
  316. package/dist/client/assets/{use-content-sync-DTts1O7D.js → use-content-sync-3FE60C_P.js} +1 -1
  317. package/dist/client/assets/{use-copy-Ctyjo3u8.js → use-copy-CvMH5zdo.js} +1 -1
  318. package/dist/client/assets/{use-create-virtual-mcp-BoVnWYo_.js → use-create-virtual-mcp-DTJ0zfpe.js} +1 -1
  319. package/dist/client/assets/{use-date-fns-locale-BL151nA9.js → use-date-fns-locale-D3Iz1MzV.js} +1 -1
  320. package/dist/client/assets/{use-debounced-autosave-XfpamUxh.js → use-debounced-autosave-CGLCHS8I.js} +1 -1
  321. package/dist/client/assets/{use-debounced-value-DppuiHxU.js → use-debounced-value-DvzjOUVw.js} +1 -1
  322. package/dist/client/assets/{use-deco-credits-DAnq8bae.js → use-deco-credits-D1dKlqXc.js} +1 -1
  323. package/dist/client/assets/{use-decopilot-events-CmWo-JmL.js → use-decopilot-events-DvJkZDam.js} +1 -1
  324. package/dist/client/assets/{use-delete-connection-D4L5Nbwc.js → use-delete-connection-D1ttYwJz.js} +1 -1
  325. package/dist/client/assets/{use-deployment-admin-CqRFItVm.js → use-deployment-admin-BpF0owio.js} +1 -1
  326. package/dist/client/assets/{use-fast-preview-draft-url-6n7ATrzr.js → use-fast-preview-draft-url-C_TDHMYN.js} +1 -1
  327. package/dist/client/assets/{use-file-configs-BukUB2a7.js → use-file-configs-Bf0fhL21.js} +1 -1
  328. package/dist/client/assets/{use-inbox-feed-DWwwp0yB.js → use-inbox-feed-DFw-YlJH.js} +1 -1
  329. package/dist/client/assets/{use-infinite-scroll-CAGEOw6T.js → use-infinite-scroll-CwPqy0HC.js} +1 -1
  330. package/dist/client/assets/{use-join-requests-C5RVOca9.js → use-join-requests-Z3CFtAeL.js} +1 -1
  331. package/dist/client/assets/{use-main-panel-tabs-C_SiePFc.js → use-main-panel-tabs-Cp-duvYv.js} +1 -1
  332. package/dist/client/assets/{use-mcp-auth-status-CPaTWfZe.js → use-mcp-auth-status-Db86wDh0.js} +1 -1
  333. package/dist/client/assets/{use-mcp-client-DsrOnW9o.js → use-mcp-client-BT3MLYTJ.js} +1 -1
  334. package/dist/client/assets/{use-mcp-prompts-B5RvuVy4.js → use-mcp-prompts-DvHpjECx.js} +1 -1
  335. package/dist/client/assets/{use-mcp-tools-oOqD73aG.js → use-mcp-tools-DY3R7rf0.js} +1 -1
  336. package/dist/client/assets/{use-members-DQZYP7Cb.js → use-members-DrsTuCTp.js} +1 -1
  337. package/dist/client/assets/{use-mobile-DruvZ2zF.js → use-mobile-Nz4my9ZZ.js} +1 -1
  338. package/dist/client/assets/{use-move-blocks-C7t8R0hh.js → use-move-blocks-Ck3YCWT9.js} +1 -1
  339. package/dist/client/assets/{use-navigate-to-agent-CfXi671z.js → use-navigate-to-agent-DqXhqPI9.js} +1 -1
  340. package/dist/client/assets/{use-open-billing-url-0u6Rqj8b.js → use-open-billing-url-BPZ_x4uz.js} +1 -1
  341. package/dist/client/assets/{use-org-auth-client-CSFZu3Wj.js → use-org-auth-client-BVmUiQl1.js} +1 -1
  342. package/dist/client/assets/{use-org-fs-Bndw9m25.js → use-org-fs-qBxAqXun.js} +1 -1
  343. package/dist/client/assets/{use-org-repo-syncs-DgWzYW9F.js → use-org-repo-syncs-C4sXoqIp.js} +1 -1
  344. package/dist/client/assets/{use-org-sso-B7o6rhq2.js → use-org-sso-B4zmaZVL.js} +1 -1
  345. package/dist/client/assets/{use-organization-roles-DPfq-0hG.js → use-organization-roles-CfuwXcGJ.js} +1 -1
  346. package/dist/client/assets/{use-organization-settings-B2e749tN.js → use-organization-settings-DKJZVR_x.js} +1 -1
  347. package/dist/client/assets/{use-panel-navigate-C-ip5ing.js → use-panel-navigate-D57HPY2x.js} +1 -1
  348. package/dist/client/assets/use-project-native-view-presence-C3HlYZwC.js +1 -0
  349. package/dist/client/assets/{use-project-scope-DN9qkINS.js → use-project-scope-CnnlA-du.js} +1 -1
  350. package/dist/client/assets/{use-recent-apps-Dieru2LM.js → use-recent-apps-CeorMBvV.js} +1 -1
  351. package/dist/client/assets/{use-releases-DJrTmfLZ.js → use-releases-fI9YxkQH.js} +1 -1
  352. package/dist/client/assets/{use-reports-diagnostic-BdDNwhZy.js → use-reports-diagnostic-J_fRdq7J.js} +1 -1
  353. package/dist/client/assets/{use-sandbox-events-B-rKhgAE.js → use-sandbox-events-CioMqxnO.js} +1 -1
  354. package/dist/client/assets/{use-secrets-C3hSYvUx.js → use-secrets-OlxyEwyb.js} +1 -1
  355. package/dist/client/assets/{use-section-preview-base-NrYdhHI5.js → use-section-preview-base-C3ZuHMr0.js} +1 -1
  356. package/dist/client/assets/{use-session-runtime-RS_ZeJDS.js → use-session-runtime-DfVwDDov.js} +1 -1
  357. package/dist/client/assets/{use-sidebar-collapsed-C9KH2wzy.js → use-sidebar-collapsed-D3qR_zRH.js} +1 -1
  358. package/dist/client/assets/{use-tags-DBJgOg0Z.js → use-tags-CxN5zuRZ.js} +1 -1
  359. package/dist/client/assets/{use-task-board-analytics-Bl-3jKgS.js → use-task-board-analytics-C-0VTjUE.js} +1 -1
  360. package/dist/client/assets/{use-task-board-events-CemAfTjA.js → use-task-board-events-BH7aE_i8.js} +1 -1
  361. package/dist/client/assets/{use-task-board-item-prs-83sFKoAa.js → use-task-board-item-prs-BLDfRR9k.js} +1 -1
  362. package/dist/client/assets/{use-task-metadata-DYSGuNJN.js → use-task-metadata-xGzNCL2M.js} +1 -1
  363. package/dist/client/assets/{use-thread-analytics-B-gfPcTz.js → use-thread-analytics-DJdxAjR-.js} +1 -1
  364. package/dist/client/assets/{use-thread-outputs-9KkInEd1.js → use-thread-outputs-D8VLF1dw.js} +1 -1
  365. package/dist/client/assets/useInfiniteQuery-BwyrFPWF.js +1 -0
  366. package/dist/client/assets/{useQueries-BRUig2bT.js → useQueries-1QlJ0aQr.js} +1 -1
  367. package/dist/client/assets/useSuspenseInfiniteQuery-DJXxpWPx.js +1 -0
  368. package/dist/client/assets/{users-zGj6iqQJ.js → users-C4R4jnJb.js} +1 -1
  369. package/dist/client/assets/{utils-DnxtSQ0E.js → utils-Dc05pOUY.js} +1 -1
  370. package/dist/client/assets/{variant-calendar-DzngKeid.js → variant-calendar-B48hMXng.js} +1 -1
  371. package/dist/client/assets/{variant-matcher-override-BvLc7beb.js → variant-matcher-override-f1vt09fC.js} +1 -1
  372. package/dist/client/assets/{virtual-mcp-CKcyAjRE.js → virtual-mcp-CP4uoCBU.js} +1 -1
  373. package/dist/client/assets/{watch-sse-pool-B6MhK1l7.js → watch-sse-pool-HKRMih-U.js} +1 -1
  374. package/dist/client/index.html +1 -1
  375. package/dist/server/server.js +1 -1
  376. package/package.json +1 -1
  377. package/dist/client/assets/agent-analytics-C_1r2ktq.js +0 -1
  378. package/dist/client/assets/agent-app-DADhKCUS.js +0 -1
  379. package/dist/client/assets/agent-automations-BCHMa4q1.js +0 -1
  380. package/dist/client/assets/agent-calendar-BIC31eZQ.js +0 -1
  381. package/dist/client/assets/agent-deck-DfcsXmVh.js +0 -1
  382. package/dist/client/assets/agent-experiments-DacDH6n9.js +0 -1
  383. package/dist/client/assets/agent-file-DvvjQBtI.js +0 -1
  384. package/dist/client/assets/agent-library-D07m5-2P.js +0 -1
  385. package/dist/client/assets/agent-library-file-CKXkh_Ag.js +0 -1
  386. package/dist/client/assets/agent-monitor-T2Kisepj.js +0 -1
  387. package/dist/client/assets/agent-settings-CtpQVMq0.js +0 -1
  388. package/dist/client/assets/agent-site-editor-code-DEyTlk7z.js +0 -2
  389. package/dist/client/assets/agent-site-editor-content-CO78zdWN.js +0 -1
  390. package/dist/client/assets/agent-site-editor-preview-C8DxePtH.js +0 -1
  391. package/dist/client/assets/agent-view-zDoYJpqf.js +0 -1
  392. package/dist/client/assets/alert-COKmPgNZ.js +0 -1
  393. package/dist/client/assets/api-keys-rvaVQMbg.js +0 -1
  394. package/dist/client/assets/badge-CYEiaJVw.js +0 -1
  395. package/dist/client/assets/cms-settings-editor-CD6Fhdzj.js +0 -1
  396. package/dist/client/assets/experiments-tab-DmhKoZxz.js +0 -1
  397. package/dist/client/assets/experiments-tab-choice-Ie5k_O6x.js +0 -1
  398. package/dist/client/assets/index-DDtLrgkt.js +0 -1
  399. package/dist/client/assets/library-1V2C8s_K.js +0 -1
  400. package/dist/client/assets/project-app-view-BLZBQKeL.js +0 -1
  401. package/dist/client/assets/project-reports-IwgSFkuk.js +0 -1
  402. package/dist/client/assets/project-tasks-DIh-1w8l.js +0 -1
  403. package/dist/client/assets/record-editor-v6loIaK5.js +0 -1
  404. package/dist/client/assets/reports-VklqwHN4.js +0 -1
  405. package/dist/client/assets/repositories-DVBlDnPs.js +0 -1
  406. package/dist/client/assets/route-DMrkbv9t.js +0 -1
  407. package/dist/client/assets/route-jSSJr7H8.js +0 -1
  408. package/dist/client/assets/settings-tab-Cp66Lx0x.js +0 -1
  409. package/dist/client/assets/shell-layout-DPflSDI7.js +0 -1
  410. package/dist/client/assets/site-draft-view-Bpwq-4Im.js +0 -2
  411. package/dist/client/assets/site-editor-CP2FSMmX.js +0 -1
  412. package/dist/client/assets/tasks-5wUjot9O.js +0 -1
  413. package/dist/client/assets/use-project-native-view-presence-iEIqgCZR.js +0 -1
  414. package/dist/client/assets/useInfiniteQuery-Ctv8zOi3.js +0 -1
  415. package/dist/client/assets/useSuspenseInfiniteQuery-DRLUIOlU.js +0 -1
@@ -1,8 +1,8 @@
1
- import{c as M,r as z,j as l,b as H,av as Ze,l as V,af as ct,a2 as me,o as Yt,an as Zt,e as es,K as xe,t as ze,m as ut,ak as ts,H as ss,h as ns,B as be,aV as dt,aj as as,aF as ls,eq as os,er as ft,a5 as rs,z as is,x as He,d as qe,es as et,dV as cs,et as us}from"./index-BphI8pNH.js";import{aL as ds,h as fs,aE as ms,X as ps,a as tt,ax as gs,k as xs,a6 as hs,aM as bs,aN as mt,aO as ys,v as Fe,aP as js,aQ as vs,aR as pt,A as gt,aS as de,f as Ss,b as Ns,L as ks}from"./agent-icon-BVqmbz-P.js";import{t as Ce,d as ws,b as _s}from"./Tool01-_CVpzZpk.js";import{i as xt}from"./LinkBroken01-Dz2vlPBe.js";import{a as Ts}from"./Copy01-DVWv3lef.js";import{c as ye,t as We,d as st}from"./format-time-Cq80KKvY.js";import{b as Cs,C as Is,a as $s}from"./collapsible-CXUiqrZ3.js";import{u as Ms}from"./use-copy-Ctyjo3u8.js";import{d as ht,i as As,e as Ie,c as Ps,P as Ls,u as Es,f as Rs,F as zs,s as Fs,b as Ds,h as Os}from"./usage-stats-BHO2m1GZ.js";import{o as Bs,u as Us,q as Hs,t as qs}from"./thread-intent-BQGp3MKl.js";import{f as je,m as Ws,u as ve,n as Vs,b as Gs,o as bt,q as Ks,v as $e,x as Js,y as Qs}from"./chat-context-DqNUlJMY.js";import{u as Ve}from"./use-clock-tick-DRqivY5H.js";import{c as Xs}from"./content-blocks-o63cs2vh.js";import{M as Ys}from"./mcp-app-renderer-tCfKhIA1.js";import{g as yt}from"./types-6BxgL_uJ.js";import{o as Zs}from"./omit-sandbox-map-jj4lCB2U.js";import{T as jt,a as vt,c as St}from"./tooltip-2YCPx1DM.js";import{c as en,u as tn,a as sn}from"./use-mcp-client-DsrOnW9o.js";import{a as Nt,g as kt,s as wt}from"./tool-namespace-DqsoHKmd.js";import{t as nn,g as pe,u as Ge}from"./utils-CVEq3hMx.js";import{i as _t}from"./AlertCircle-CzTXJ0ax.js";import{s as an,a as ke}from"./Image01-D_y3XkIW.js";import{s as ln}from"./XClose-B_rQyiiY.js";import{n as De}from"./ShoppingBag01-DvN3FHxE.js";import{i as on}from"./SearchMd-BYCOzBqa.js";import{a as rn,d as cn}from"./shell-layout-DPflSDI7.js";import{a as Ke}from"./use-panel-navigate-C-ip5ing.js";import{c as Tt}from"./use-decopilot-events-CmWo-JmL.js";import{I as un,M as Ct}from"./markdown-Bqq3R66p.js";import{c as dn,S as fn,a as mn,b as pn}from"./sheet-Dy9d78N0.js";import{I as Se}from"./integration-icon-C-_9oW7G.js";import{a as It}from"./use-connection-hBtWetVy.js";import{u as $t}from"./use-navigate-to-agent-CfXi671z.js";import{i as we}from"./Link01-D28gAr0F.js";import{s as gn}from"./UserSquare-B7fe7FYj.js";import{g as xn}from"./use-mcp-prompts-B5RvuVy4.js";import{t as hn}from"./ChevronUp-DtSKb4be.js";import{i as bn}from"./Monitor01-CYm-wjzD.js";import{a as yn}from"./use-thread-outputs-9KkInEd1.js";import{n as jn}from"./ZoomOut-DzrH576O.js";import{F as vn}from"./file-type-icon-CIdo5ojc.js";const Mt=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function Sn(){const s=M.c(5),[e]=z.useState(Nn);let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t={gridTemplateColumns:"repeat(3, 3px)",gap:"1.5px",width:"fit-content"},s[0]=t):t=s[0];let n;s[1]!==e?(n=Mt.map((o,c)=>{const{delay:i}=o;return l.jsx("div",{className:"rounded-[1px]",style:{width:3,height:3,"--cell-color":e[c],animation:"grid-ripple 1s ease infinite",animationDelay:`${i}ms`}},c)}),s[1]=e,s[2]=n):n=s[2];let a;return s[3]!==n?(a=l.jsx("div",{className:"grid",style:t,children:n}),s[3]=n,s[4]=a):a=s[4],a}function Nn(){const s=`var(--chart-${Math.ceil(Math.random()*5)})`;return Mt.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":s)}const kn={damping:.7,stiffness:.05,mass:1.25},wn=70,_n=1e3/60,Tn=350;let Me=!1;globalThis.document?.addEventListener("mousedown",()=>{Me=!0});globalThis.document?.addEventListener("mouseup",()=>{Me=!1});globalThis.document?.addEventListener("click",()=>{Me=!1});const Cn=(s={})=>{const[e,t]=z.useState(!1),[n,a]=z.useState(s.initial!==!1),[o,c]=z.useState(!1),i=z.useRef(null);i.current=s;const u=z.useCallback(()=>{if(!Me)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const k=b.getRangeAt(0);return k.commonAncestorContainer.contains(h.current)||h.current?.contains(k.commonAncestorContainer)},[]),r=z.useCallback(b=>{d.isAtBottom=b,a(b)},[]),f=z.useCallback(b=>{d.escapedFromLock=b,t(b)},[]),d=z.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:n,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return h.current?.scrollTop??0},set scrollTop(k){if(h.current){const{scrollBehavior:j}=getComputedStyle(h.current);j!=="auto"&&(h.current.style.scrollBehavior="auto"),h.current.scrollTop=k,d.ignoreScrollToTop=h.current.scrollTop,j!=="auto"&&(h.current.style.scrollBehavior=j)}},get targetScrollTop(){return!h.current||!y.current?0:h.current.scrollHeight-1-h.current.clientHeight},get calculatedTargetScrollTop(){if(!h.current||!y.current)return 0;const{targetScrollTop:k}=this;if(!s.targetScrollTop)return k;if(b?.targetScrollTop===k)return b.calculatedScrollTop;const j=Math.max(Math.min(s.targetScrollTop(k,{scrollElement:h.current,contentElement:y.current}),k),0);return b={targetScrollTop:k,calculatedScrollTop:j},requestAnimationFrame(()=>{b=void 0}),j},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=wn}}},[]),m=z.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||r(!0);const k=Date.now()+(Number(b.wait)||0),j=Le(i.current,b.animation),{ignoreEscapes:w=!1}=b;let S,N=d.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{S=Date.now()}):S=k+(b.duration??0);const v=async()=>{const _=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:T}=d,A=performance.now(),P=(A-(d.lastTick??A))/_n;if(d.animation||(d.animation={behavior:j,promise:_,ignoreEscapes:w}),d.animation.behavior===j&&(d.lastTick=A),u()||k>Date.now())return v();if(T<Math.min(N,d.calculatedTargetScrollTop)){if(d.animation?.behavior===j){if(j==="instant")return d.scrollTop=d.calculatedTargetScrollTop,v();d.velocity=(j.damping*d.velocity+j.stiffness*d.scrollDifference)/j.mass,d.accumulated+=d.velocity*P,d.scrollTop+=d.accumulated,d.scrollTop!==T&&(d.accumulated=0)}return v()}return S>Date.now()?(N=d.calculatedTargetScrollTop,v()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?m({animation:Le(i.current,i.current.resize),ignoreEscapes:w,duration:Math.max(0,S-Date.now())||void 0}):d.isAtBottom)});return _.then(T=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),T))};return b.wait!==!0&&(d.animation=void 0),d.animation?.behavior===j?d.animation.promise:v()},[r,u,d]),p=z.useCallback(()=>{f(!0),r(!1)},[f,r]),g=z.useCallback(({target:b})=>{if(b!==h.current)return;const{scrollTop:k,ignoreScrollToTop:j}=d;let{lastScrollTop:w=k}=d;d.lastScrollTop=k,d.ignoreScrollToTop=void 0,j&&j>k&&(w=j),c(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||k===j)return;if(u()){f(!0),r(!1);return}const S=k>w,N=k<w;if(d.animation?.ignoreEscapes){d.scrollTop=w;return}N&&(f(!0),r(!1)),S&&f(!1),!d.escapedFromLock&&d.isNearBottom&&r(!0)},1)},[f,r,u,d]),x=z.useCallback(({target:b,deltaY:k})=>{let j=b;for(;!["scroll","auto"].includes(getComputedStyle(j).overflow);){if(!j.parentElement)return;j=j.parentElement}j===h.current&&k<0&&h.current.scrollHeight>h.current.clientHeight&&!d.animation?.ignoreEscapes&&(f(!0),r(!1))},[f,r,d]),h=nt(b=>{h.current?.removeEventListener("scroll",g),h.current?.removeEventListener("wheel",x),b?.addEventListener("scroll",g,{passive:!0}),b?.addEventListener("wheel",x,{passive:!0})},[]),y=nt(b=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!b)return;let k;d.resizeObserver=new ResizeObserver(([j])=>{const{height:w}=j.contentRect,S=w-(k??w);if(d.resizeDifference=S,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),c(d.isNearBottom),S>=0){const N=Le(i.current,k?i.current.resize:i.current.initial);m({animation:N,wait:!0,preserveScrollPosition:!0,duration:N==="instant"?void 0:Tn})}else d.isNearBottom&&(f(!1),r(!0));k=w,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===S&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(b)},[]);return{contentRef:y,scrollRef:h,scrollToBottom:m,stopScroll:p,isAtBottom:n||o,isNearBottom:o,escapedFromLock:e,state:d}};function nt(s,e){const t=z.useCallback(n=>(t.current=n,s(n)),e);return t}const Pe=new Map;function Le(...s){const e={...kn};let t=!1;for(const a of s){if(a==="instant"){t=!0;continue}typeof a=="object"&&(t=!1,e.damping=a.damping??e.damping,e.stiffness=a.stiffness??e.stiffness,e.mass=a.mass??e.mass)}const n=JSON.stringify(e);return Pe.has(n)||Pe.set(n,Object.freeze(e)),t?"instant":Pe.get(n)}function Y({icon:s,title:e,usage:t,summary:n,state:a,detail:o,detailVariant:c="code",forceOpen:i,variant:u="default",trailing:r,iconDestructive:f,alwaysChevron:d,defaultOpen:m,children:p}){const g=H(),[x,h]=z.useState(m??!1),{handleCopy:y,copied:b}=Ms(),k=a==="loading",j=a==="error",S=!!(o&&o.trim())||!!p,N=u==="subtask",v=(i??!1)||x,_=Cn({initial:k?"instant":!1}),T=l.jsxs(Cs,{open:v,onOpenChange:i?void 0:h,className:"min-w-0",children:[l.jsxs(Is,{disabled:!S,className:V("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",S&&"[@media(hover:hover)]:hover:bg-accent",!S&&"cursor-default"),"aria-disabled":!S,children:[l.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:d?l.jsx(Ze,{className:V("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",v&&"rotate-90")}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:V("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",f?"[&>svg]:text-destructive/70":j?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",S&&(v?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:s}),S&&l.jsx("div",{className:V("absolute inset-0 flex items-center justify-center transition-opacity duration-150",v?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:l.jsx(Ze,{className:V("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",v&&"rotate-90")})})]})}),l.jsx("span",{className:V("shrink-0 text-sm font-normal",j?"text-warning/80":"text-foreground",k&&"shimmer"),children:e}),n?l.jsx("span",{className:"min-w-0 flex-1 truncate",children:l.jsx("span",{className:"text-xs text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:l.jsx("span",{className:V(k&&"shimmer"),children:n})})}):l.jsx("div",{className:"flex-1"}),r&&l.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:r}),l.jsx(ht,{usage:t})]}),S&&l.jsx($s,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:p||(c==="prose"?l.jsx("div",{className:"mt-1 mb-1",children:l.jsx("div",{ref:_.scrollRef,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:l.jsx("p",{ref:_.contentRef,className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:o})})}):l.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:l.jsx("div",{ref:_.scrollRef,className:"flex flex-col max-h-48 overflow-y-auto",children:l.jsxs("div",{ref:_.contentRef,className:"flex items-start justify-between gap-2",children:[l.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:l.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:o})}),l.jsx("button",{type:"button",onClick:()=>y(o),className:"shrink-0 p-1.5 rounded-lg text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent transition-colors active:scale-[0.97]","aria-label":g("common.copy"),children:b?l.jsx(ct,{className:"size-3.5"}):l.jsx(Ts,{className:"size-3.5"})})]})})}))})]});return N?l.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:T}):T}function fe(s){const e=M.c(4),{latency:t}=s;if(t==null||t<=0)return null;let n;e[0]!==t?(n=ye(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a=l.jsx("span",{className:"text-2xs font-mono tabular-nums text-muted-foreground",children:n}),e[2]=n,e[3]=a):a=e[3],a}const At=4;function Pt(s){const e=M.c(8),{count:t,noun:n,onClick:a}=s,o=H();let c;e[0]!==t||e[1]!==n||e[2]!==o?(c=o("common.seeAll",{count:t,noun:n}),e[0]=t,e[1]=n,e[2]=o,e[3]=c):c=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx(xt,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[4]=i):i=e[4];let u;return e[5]!==a||e[6]!==c?(u=l.jsxs("button",{type:"button",onClick:a,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground cursor-pointer",children:[c,i]}),e[5]=a,e[6]=c,e[7]=u):u=e[7],u}function Lt(s){const e=M.c(12),{message:t,className:n}=s,a=t.created_at??t.metadata?.created_at??null;let o,c,i,u;if(e[0]!==n||e[1]!==a){u=Symbol.for("react.early_return_sentinel");e:{const f=We(a);if(f===null){u=null;break e}const d=new Date(f);o=d.toLocaleString(),e[6]!==n?(c=V("text-2xs text-muted-foreground/60 select-none",n),e[6]=n,e[7]=c):c=e[7],i=d.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}e[0]=n,e[1]=a,e[2]=o,e[3]=c,e[4]=i,e[5]=u}else o=e[2],c=e[3],i=e[4],u=e[5];if(u!==Symbol.for("react.early_return_sentinel"))return u;let r;return e[8]!==o||e[9]!==c||e[10]!==i?(r=l.jsx("span",{title:o,className:c,children:i}),e[8]=o,e[9]=c,e[10]=i,e[11]=r):r=e[11],r}function Oe(s){const e=M.c(9),{since:t}=s;let n;e[0]!==t?(n=()=>st(t,Date.now()),e[0]=t,e[1]=n):n=e[1];const[a,o]=z.useState(n);let c,i;e[2]!==t?(c=()=>{const d=setInterval(()=>o(st(t,Date.now())),100);return()=>clearInterval(d)},i=[t],e[2]=t,e[3]=c,e[4]=i):(c=e[3],i=e[4]),z.useEffect(c,i);const u=a/1e3;let r;e[5]!==u?(r=ye(u),e[5]=u,e[6]=r):r=e[6];let f;return e[7]!==r?(f=l.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground/50",children:r}),e[7]=r,e[8]=f):f=e[8],f}function In(s){return{planning:{icon:l.jsx(fs,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:s("chat.thinkingIndicator.planningLabel"),detail:s("chat.thinkingIndicator.planningDetail")},thinking:{icon:l.jsx(Ce,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:s("chat.thinkingIndicator.thinkingLabel"),detail:s("chat.thinkingIndicator.thinkingDetail")}}}const $n=1200;function Be(s){const e=M.c(8),{icon:t,title:n,summary:a,detail:o,state:c,detailVariant:i,trailing:u}=s,r=i===void 0?"prose":i;let f;return e[0]!==o||e[1]!==r||e[2]!==t||e[3]!==c||e[4]!==a||e[5]!==n||e[6]!==u?(f=l.jsx(Y,{icon:t,title:n,summary:a,detail:o,state:c,detailVariant:r,trailing:u}),e[0]=o,e[1]=r,e[2]=t,e[3]=c,e[4]=a,e[5]=n,e[6]=u,e[7]=f):f=e[7],f}function Mn(s){const e=M.c(22),{startedAt:t}=s,n=H(),a=je()?.runStatusStage??null,[o,c]=z.useState("planning");let i,u;if(e[0]!==a?(i=()=>{if(a!==null)return;const x=setTimeout(()=>{c("thinking")},$n);return()=>{clearTimeout(x)}},u=[a],e[0]=a,e[1]=i,e[2]=u):(i=e[1],u=e[2]),z.useEffect(i,u),a!==null){let x;e[3]!==a||e[4]!==n?(x=Bs(n,a),e[3]=a,e[4]=n,e[5]=x):x=e[5];const h=x;let y;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(Ce,{className:"size-4"}),e[6]=y):y=e[6];const b=`${h.label}...`;let k;e[7]!==t?(k=t!==null&&l.jsx(Oe,{since:t}),e[7]=t,e[8]=k):k=e[8];let j;return e[9]!==h.detail||e[10]!==b||e[11]!==k?(j=l.jsx(Be,{icon:y,title:b,summary:h.detail,state:"loading",trailing:k}),e[9]=h.detail,e[10]=b,e[11]=k,e[12]=j):j=e[12],j}let r;e[13]!==n?(r=In(n),e[13]=n,e[14]=r):r=e[14];const d=r[o],m=`${d.label}...`;let p;e[15]!==t?(p=t!==null&&l.jsx(Oe,{since:t}),e[15]=t,e[16]=p):p=e[16];let g;return e[17]!==d.detail||e[18]!==d.icon||e[19]!==m||e[20]!==p?(g=l.jsx(Be,{icon:d.icon,title:m,summary:d.detail,state:"loading",trailing:p}),e[17]=d.detail,e[18]=d.icon,e[19]=m,e[20]=p,e[21]=g):g=e[21],g}function An(s){const e=M.c(3),{startedAt:t}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx(Sn,{}),e[0]=n):n=e[0];let a;return e[1]!==t?(a=l.jsxs("div",{className:"flex items-center gap-2.5 mt-1 pb-1 text-muted-foreground/40 select-none",children:[n,l.jsx(Oe,{since:t})]}),e[1]=t,e[2]=a):a=e[2],a}const Pn=2e4;function Ln(s){const e=M.c(9),{startedAt:t}=s,n=H(),a=Ve(1e3),o=je(),i=(t!==null?a-t:0)>=Pn;let u;e[0]!==t?(u=l.jsx(Mn,{startedAt:t}),e[0]=t,e[1]=u):u=e[1];let r;e[2]!==i||e[3]!==o||e[4]!==n?(r=i&&o?.stop&&l.jsxs("div",{className:"flex items-center gap-2 pb-1 text-sm text-muted-foreground/60",children:[l.jsx("span",{children:n("chat.thinkingIndicator.takingLonger")}),l.jsx("button",{type:"button",onClick:()=>o.stop(),className:"text-muted-foreground hover:text-foreground underline underline-offset-2",children:n("chat.thinkingIndicator.cancel")})]}),e[2]=i,e[3]=o,e[4]=n,e[5]=r):r=e[5];let f;return e[6]!==u||e[7]!==r?(f=l.jsxs("div",{className:"flex flex-col gap-0.5",children:[u,r]}),e[6]=u,e[7]=r,e[8]=f):f=e[8],f}function En(s){const e=M.c(24),{duration:t,parts:n,isStreaming:a}=s,o=H();let c;e[0]!==n?(c=n.every(Fn),e[0]=n,e[1]=c):c=e[1];const i=c;let u;e[2]!==t||e[3]!==o?(u=t&&t/1e3>1?o("chat.thinkingIndicator.thoughtFor",{duration:ye(t/1e3)}):o("chat.thinkingIndicator.thought"),e[2]=t,e[3]=o,e[4]=u):u=e[4];const r=u;let f;if(e[5]!==i||e[6]!==a||e[7]!==n){const k=n.map(zn).join(`
1
+ import{c as M,r as z,j as l,b as H,av as Ze,l as G,af as ct,a2 as me,o as Yt,an as Zt,e as es,K as xe,t as ze,m as ut,ak as ts,H as ss,h as ns,B as be,aX as dt,aj as as,aG as ls,eq as os,er as ft,a5 as rs,z as is,x as He,d as qe,es as et,dV as cs,et as us}from"./index-CImJlq71.js";import{aL as ds,h as fs,aE as ms,X as ps,a as tt,ax as gs,k as xs,a6 as hs,aM as bs,aN as mt,aO as ys,v as De,aP as js,aQ as vs,aR as pt,A as gt,aS as de,f as Ss,b as Ns,L as ks}from"./agent-icon-Bl0Q4nDQ.js";import{t as Ce,d as ws,b as _s}from"./Tool01-XzMXqYKz.js";import{i as xt}from"./LinkBroken01-D8vKURBw.js";import{a as Ts}from"./Copy01-C8oI3ru2.js";import{c as ye,t as We,d as st}from"./format-time-Cq80KKvY.js";import{b as Cs,C as Is,a as $s}from"./collapsible-BHKr0Yuy.js";import{u as Ms}from"./use-copy-CvMH5zdo.js";import{d as ht,i as As,e as Ie,c as Ps,P as Ls,u as Es,f as Rs,F as zs,s as Ds,b as Fs,h as Os}from"./usage-stats-DpZZQ75-.js";import{o as Bs,u as Us,q as Hs,t as qs}from"./thread-intent-DXY7orZh.js";import{f as je,m as Ws,u as ve,n as Gs,b as Ks,o as bt,q as Vs,v as $e,x as Js,y as Qs}from"./chat-context-C_P788VD.js";import{u as Ge}from"./use-clock-tick-D95T8222.js";import{c as Xs}from"./content-blocks-o63cs2vh.js";import{M as Ys}from"./mcp-app-renderer-vmvnP_G4.js";import{g as yt}from"./types-D4eFbg3n.js";import{o as Zs}from"./omit-sandbox-map-jj4lCB2U.js";import{T as jt,a as vt,c as St}from"./tooltip-BB8x2ajM.js";import{c as en,u as tn,a as sn}from"./use-mcp-client-BT3MLYTJ.js";import{a as Nt,g as kt,s as wt}from"./tool-namespace-ln4cIuCt.js";import{t as nn,g as pe,u as Ke}from"./utils-CVEq3hMx.js";import{i as _t}from"./AlertCircle-DbgHFTtO.js";import{s as an,a as ke}from"./Image01-BYSI_JTy.js";import{s as ln}from"./XClose-5-Y_ZVDY.js";import{n as Fe}from"./ShoppingBag01-Bkku1Te9.js";import{i as on}from"./SearchMd-C1vd4NNy.js";import{a as rn,d as cn}from"./shell-layout-Bmd6dXD4.js";import{a as Ve}from"./use-panel-navigate-D57HPY2x.js";import{c as Tt}from"./use-decopilot-events-DvJkZDam.js";import{I as un,M as Ct}from"./markdown-BDnIqP7U.js";import{c as dn,S as fn,a as mn,b as pn}from"./sheet-DYqe447t.js";import{I as Se}from"./integration-icon-B9snkXuC.js";import{a as It}from"./use-connection-CAJy9ePc.js";import{u as $t}from"./use-navigate-to-agent-DqXhqPI9.js";import{i as we}from"./Link01-1YHKCfLl.js";import{s as gn}from"./UserSquare-ezkB_C7H.js";import{g as xn}from"./use-mcp-prompts-DvHpjECx.js";import{t as hn}from"./ChevronUp-BJfOFayd.js";import{i as bn}from"./Monitor01-th-leB7u.js";import{a as yn}from"./use-thread-outputs-D8VLF1dw.js";import{n as jn}from"./ZoomOut-CTwXyALk.js";import{F as vn}from"./file-type-icon-BlPndn8R.js";const Mt=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function Sn(){const s=M.c(5),[e]=z.useState(Nn);let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t={gridTemplateColumns:"repeat(3, 3px)",gap:"1.5px",width:"fit-content"},s[0]=t):t=s[0];let n;s[1]!==e?(n=Mt.map((o,c)=>{const{delay:i}=o;return l.jsx("div",{className:"rounded-[1px]",style:{width:3,height:3,"--cell-color":e[c],animation:"grid-ripple 1s ease infinite",animationDelay:`${i}ms`}},c)}),s[1]=e,s[2]=n):n=s[2];let a;return s[3]!==n?(a=l.jsx("div",{className:"grid",style:t,children:n}),s[3]=n,s[4]=a):a=s[4],a}function Nn(){const s=`var(--chart-${Math.ceil(Math.random()*5)})`;return Mt.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":s)}const kn={damping:.7,stiffness:.05,mass:1.25},wn=70,_n=1e3/60,Tn=350;let Me=!1;globalThis.document?.addEventListener("mousedown",()=>{Me=!0});globalThis.document?.addEventListener("mouseup",()=>{Me=!1});globalThis.document?.addEventListener("click",()=>{Me=!1});const Cn=(s={})=>{const[e,t]=z.useState(!1),[n,a]=z.useState(s.initial!==!1),[o,c]=z.useState(!1),i=z.useRef(null);i.current=s;const u=z.useCallback(()=>{if(!Me)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const k=b.getRangeAt(0);return k.commonAncestorContainer.contains(h.current)||h.current?.contains(k.commonAncestorContainer)},[]),r=z.useCallback(b=>{d.isAtBottom=b,a(b)},[]),f=z.useCallback(b=>{d.escapedFromLock=b,t(b)},[]),d=z.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:n,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return h.current?.scrollTop??0},set scrollTop(k){if(h.current){const{scrollBehavior:j}=getComputedStyle(h.current);j!=="auto"&&(h.current.style.scrollBehavior="auto"),h.current.scrollTop=k,d.ignoreScrollToTop=h.current.scrollTop,j!=="auto"&&(h.current.style.scrollBehavior=j)}},get targetScrollTop(){return!h.current||!y.current?0:h.current.scrollHeight-1-h.current.clientHeight},get calculatedTargetScrollTop(){if(!h.current||!y.current)return 0;const{targetScrollTop:k}=this;if(!s.targetScrollTop)return k;if(b?.targetScrollTop===k)return b.calculatedScrollTop;const j=Math.max(Math.min(s.targetScrollTop(k,{scrollElement:h.current,contentElement:y.current}),k),0);return b={targetScrollTop:k,calculatedScrollTop:j},requestAnimationFrame(()=>{b=void 0}),j},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=wn}}},[]),m=z.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||r(!0);const k=Date.now()+(Number(b.wait)||0),j=Le(i.current,b.animation),{ignoreEscapes:w=!1}=b;let S,N=d.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{S=Date.now()}):S=k+(b.duration??0);const v=async()=>{const _=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:T}=d,A=performance.now(),P=(A-(d.lastTick??A))/_n;if(d.animation||(d.animation={behavior:j,promise:_,ignoreEscapes:w}),d.animation.behavior===j&&(d.lastTick=A),u()||k>Date.now())return v();if(T<Math.min(N,d.calculatedTargetScrollTop)){if(d.animation?.behavior===j){if(j==="instant")return d.scrollTop=d.calculatedTargetScrollTop,v();d.velocity=(j.damping*d.velocity+j.stiffness*d.scrollDifference)/j.mass,d.accumulated+=d.velocity*P,d.scrollTop+=d.accumulated,d.scrollTop!==T&&(d.accumulated=0)}return v()}return S>Date.now()?(N=d.calculatedTargetScrollTop,v()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?m({animation:Le(i.current,i.current.resize),ignoreEscapes:w,duration:Math.max(0,S-Date.now())||void 0}):d.isAtBottom)});return _.then(T=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),T))};return b.wait!==!0&&(d.animation=void 0),d.animation?.behavior===j?d.animation.promise:v()},[r,u,d]),p=z.useCallback(()=>{f(!0),r(!1)},[f,r]),g=z.useCallback(({target:b})=>{if(b!==h.current)return;const{scrollTop:k,ignoreScrollToTop:j}=d;let{lastScrollTop:w=k}=d;d.lastScrollTop=k,d.ignoreScrollToTop=void 0,j&&j>k&&(w=j),c(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||k===j)return;if(u()){f(!0),r(!1);return}const S=k>w,N=k<w;if(d.animation?.ignoreEscapes){d.scrollTop=w;return}N&&(f(!0),r(!1)),S&&f(!1),!d.escapedFromLock&&d.isNearBottom&&r(!0)},1)},[f,r,u,d]),x=z.useCallback(({target:b,deltaY:k})=>{let j=b;for(;!["scroll","auto"].includes(getComputedStyle(j).overflow);){if(!j.parentElement)return;j=j.parentElement}j===h.current&&k<0&&h.current.scrollHeight>h.current.clientHeight&&!d.animation?.ignoreEscapes&&(f(!0),r(!1))},[f,r,d]),h=nt(b=>{h.current?.removeEventListener("scroll",g),h.current?.removeEventListener("wheel",x),b?.addEventListener("scroll",g,{passive:!0}),b?.addEventListener("wheel",x,{passive:!0})},[]),y=nt(b=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!b)return;let k;d.resizeObserver=new ResizeObserver(([j])=>{const{height:w}=j.contentRect,S=w-(k??w);if(d.resizeDifference=S,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),c(d.isNearBottom),S>=0){const N=Le(i.current,k?i.current.resize:i.current.initial);m({animation:N,wait:!0,preserveScrollPosition:!0,duration:N==="instant"?void 0:Tn})}else d.isNearBottom&&(f(!1),r(!0));k=w,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===S&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(b)},[]);return{contentRef:y,scrollRef:h,scrollToBottom:m,stopScroll:p,isAtBottom:n||o,isNearBottom:o,escapedFromLock:e,state:d}};function nt(s,e){const t=z.useCallback(n=>(t.current=n,s(n)),e);return t}const Pe=new Map;function Le(...s){const e={...kn};let t=!1;for(const a of s){if(a==="instant"){t=!0;continue}typeof a=="object"&&(t=!1,e.damping=a.damping??e.damping,e.stiffness=a.stiffness??e.stiffness,e.mass=a.mass??e.mass)}const n=JSON.stringify(e);return Pe.has(n)||Pe.set(n,Object.freeze(e)),t?"instant":Pe.get(n)}function Y({icon:s,title:e,usage:t,summary:n,state:a,detail:o,detailVariant:c="code",forceOpen:i,variant:u="default",trailing:r,iconDestructive:f,alwaysChevron:d,defaultOpen:m,children:p}){const g=H(),[x,h]=z.useState(m??!1),{handleCopy:y,copied:b}=Ms(),k=a==="loading",j=a==="error",S=!!(o&&o.trim())||!!p,N=u==="subtask",v=(i??!1)||x,_=Cn({initial:k?"instant":!1}),T=l.jsxs(Cs,{open:v,onOpenChange:i?void 0:h,className:"min-w-0",children:[l.jsxs(Is,{disabled:!S,className:G("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",S&&"[@media(hover:hover)]:hover:bg-accent",!S&&"cursor-default"),"aria-disabled":!S,children:[l.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:d?l.jsx(Ze,{className:G("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",v&&"rotate-90")}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:G("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",f?"[&>svg]:text-destructive/70":j?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",S&&(v?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:s}),S&&l.jsx("div",{className:G("absolute inset-0 flex items-center justify-center transition-opacity duration-150",v?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:l.jsx(Ze,{className:G("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",v&&"rotate-90")})})]})}),l.jsx("span",{className:G("shrink-0 text-sm font-normal",j?"text-warning/80":"text-foreground",k&&"shimmer"),children:e}),n?l.jsx("span",{className:"min-w-0 flex-1 truncate",children:l.jsx("span",{className:"text-xs text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:l.jsx("span",{className:G(k&&"shimmer"),children:n})})}):l.jsx("div",{className:"flex-1"}),r&&l.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:r}),l.jsx(ht,{usage:t})]}),S&&l.jsx($s,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:p||(c==="prose"?l.jsx("div",{className:"mt-1 mb-1",children:l.jsx("div",{ref:_.scrollRef,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:l.jsx("p",{ref:_.contentRef,className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:o})})}):l.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:l.jsx("div",{ref:_.scrollRef,className:"flex flex-col max-h-48 overflow-y-auto",children:l.jsxs("div",{ref:_.contentRef,className:"flex items-start justify-between gap-2",children:[l.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:l.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:o})}),l.jsx("button",{type:"button",onClick:()=>y(o),className:"shrink-0 p-1.5 rounded-lg text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent transition-colors active:scale-[0.97]","aria-label":g("common.copy"),children:b?l.jsx(ct,{className:"size-3.5"}):l.jsx(Ts,{className:"size-3.5"})})]})})}))})]});return N?l.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:T}):T}function fe(s){const e=M.c(4),{latency:t}=s;if(t==null||t<=0)return null;let n;e[0]!==t?(n=ye(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a=l.jsx("span",{className:"text-2xs font-mono tabular-nums text-muted-foreground",children:n}),e[2]=n,e[3]=a):a=e[3],a}const At=4;function Pt(s){const e=M.c(8),{count:t,noun:n,onClick:a}=s,o=H();let c;e[0]!==t||e[1]!==n||e[2]!==o?(c=o("common.seeAll",{count:t,noun:n}),e[0]=t,e[1]=n,e[2]=o,e[3]=c):c=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx(xt,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[4]=i):i=e[4];let u;return e[5]!==a||e[6]!==c?(u=l.jsxs("button",{type:"button",onClick:a,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground cursor-pointer",children:[c,i]}),e[5]=a,e[6]=c,e[7]=u):u=e[7],u}function Lt(s){const e=M.c(12),{message:t,className:n}=s,a=t.created_at??t.metadata?.created_at??null;let o,c,i,u;if(e[0]!==n||e[1]!==a){u=Symbol.for("react.early_return_sentinel");e:{const f=We(a);if(f===null){u=null;break e}const d=new Date(f);o=d.toLocaleString(),e[6]!==n?(c=G("text-2xs text-muted-foreground/60 select-none",n),e[6]=n,e[7]=c):c=e[7],i=d.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}e[0]=n,e[1]=a,e[2]=o,e[3]=c,e[4]=i,e[5]=u}else o=e[2],c=e[3],i=e[4],u=e[5];if(u!==Symbol.for("react.early_return_sentinel"))return u;let r;return e[8]!==o||e[9]!==c||e[10]!==i?(r=l.jsx("span",{title:o,className:c,children:i}),e[8]=o,e[9]=c,e[10]=i,e[11]=r):r=e[11],r}function Oe(s){const e=M.c(9),{since:t}=s;let n;e[0]!==t?(n=()=>st(t,Date.now()),e[0]=t,e[1]=n):n=e[1];const[a,o]=z.useState(n);let c,i;e[2]!==t?(c=()=>{const d=setInterval(()=>o(st(t,Date.now())),100);return()=>clearInterval(d)},i=[t],e[2]=t,e[3]=c,e[4]=i):(c=e[3],i=e[4]),z.useEffect(c,i);const u=a/1e3;let r;e[5]!==u?(r=ye(u),e[5]=u,e[6]=r):r=e[6];let f;return e[7]!==r?(f=l.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground/50",children:r}),e[7]=r,e[8]=f):f=e[8],f}function In(s){return{planning:{icon:l.jsx(fs,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:s("chat.thinkingIndicator.planningLabel"),detail:s("chat.thinkingIndicator.planningDetail")},thinking:{icon:l.jsx(Ce,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:s("chat.thinkingIndicator.thinkingLabel"),detail:s("chat.thinkingIndicator.thinkingDetail")}}}const $n=1200;function Be(s){const e=M.c(8),{icon:t,title:n,summary:a,detail:o,state:c,detailVariant:i,trailing:u}=s,r=i===void 0?"prose":i;let f;return e[0]!==o||e[1]!==r||e[2]!==t||e[3]!==c||e[4]!==a||e[5]!==n||e[6]!==u?(f=l.jsx(Y,{icon:t,title:n,summary:a,detail:o,state:c,detailVariant:r,trailing:u}),e[0]=o,e[1]=r,e[2]=t,e[3]=c,e[4]=a,e[5]=n,e[6]=u,e[7]=f):f=e[7],f}function Mn(s){const e=M.c(22),{startedAt:t}=s,n=H(),a=je()?.runStatusStage??null,[o,c]=z.useState("planning");let i,u;if(e[0]!==a?(i=()=>{if(a!==null)return;const x=setTimeout(()=>{c("thinking")},$n);return()=>{clearTimeout(x)}},u=[a],e[0]=a,e[1]=i,e[2]=u):(i=e[1],u=e[2]),z.useEffect(i,u),a!==null){let x;e[3]!==a||e[4]!==n?(x=Bs(n,a),e[3]=a,e[4]=n,e[5]=x):x=e[5];const h=x;let y;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(Ce,{className:"size-4"}),e[6]=y):y=e[6];const b=`${h.label}...`;let k;e[7]!==t?(k=t!==null&&l.jsx(Oe,{since:t}),e[7]=t,e[8]=k):k=e[8];let j;return e[9]!==h.detail||e[10]!==b||e[11]!==k?(j=l.jsx(Be,{icon:y,title:b,summary:h.detail,state:"loading",trailing:k}),e[9]=h.detail,e[10]=b,e[11]=k,e[12]=j):j=e[12],j}let r;e[13]!==n?(r=In(n),e[13]=n,e[14]=r):r=e[14];const d=r[o],m=`${d.label}...`;let p;e[15]!==t?(p=t!==null&&l.jsx(Oe,{since:t}),e[15]=t,e[16]=p):p=e[16];let g;return e[17]!==d.detail||e[18]!==d.icon||e[19]!==m||e[20]!==p?(g=l.jsx(Be,{icon:d.icon,title:m,summary:d.detail,state:"loading",trailing:p}),e[17]=d.detail,e[18]=d.icon,e[19]=m,e[20]=p,e[21]=g):g=e[21],g}function An(s){const e=M.c(3),{startedAt:t}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx(Sn,{}),e[0]=n):n=e[0];let a;return e[1]!==t?(a=l.jsxs("div",{className:"flex items-center gap-2.5 mt-1 pb-1 text-muted-foreground/40 select-none",children:[n,l.jsx(Oe,{since:t})]}),e[1]=t,e[2]=a):a=e[2],a}const Pn=2e4;function Ln(s){const e=M.c(9),{startedAt:t}=s,n=H(),a=Ge(1e3),o=je(),i=(t!==null?a-t:0)>=Pn;let u;e[0]!==t?(u=l.jsx(Mn,{startedAt:t}),e[0]=t,e[1]=u):u=e[1];let r;e[2]!==i||e[3]!==o||e[4]!==n?(r=i&&o?.stop&&l.jsxs("div",{className:"flex items-center gap-2 pb-1 text-sm text-muted-foreground/60",children:[l.jsx("span",{children:n("chat.thinkingIndicator.takingLonger")}),l.jsx("button",{type:"button",onClick:()=>o.stop(),className:"text-muted-foreground hover:text-foreground underline underline-offset-2",children:n("chat.thinkingIndicator.cancel")})]}),e[2]=i,e[3]=o,e[4]=n,e[5]=r):r=e[5];let f;return e[6]!==u||e[7]!==r?(f=l.jsxs("div",{className:"flex flex-col gap-0.5",children:[u,r]}),e[6]=u,e[7]=r,e[8]=f):f=e[8],f}function En(s){const e=M.c(24),{duration:t,parts:n,isStreaming:a}=s,o=H();let c;e[0]!==n?(c=n.every(Dn),e[0]=n,e[1]=c):c=e[1];const i=c;let u;e[2]!==t||e[3]!==o?(u=t&&t/1e3>1?o("chat.thinkingIndicator.thoughtFor",{duration:ye(t/1e3)}):o("chat.thinkingIndicator.thought"),e[2]=t,e[3]=o,e[4]=u):u=e[4];const r=u;let f;if(e[5]!==i||e[6]!==a||e[7]!==n){const k=n.map(zn).join(`
2
2
  `).trim().split(`
3
3
  `).filter(Boolean),j=a?k[k.length-1]??"":k[0]??"";f=!i&&j?j.length>100?j.slice(0,100)+"…":j:void 0,e[5]=i,e[6]=a,e[7]=n,e[8]=f}else f=e[8];const d=f;let m;if(e[9]!==i||e[10]!==n){const b=n.map(Rn).join(`
4
4
 
5
- `);m=!i&&b.trim()?b:null,e[9]=i,e[10]=n,e[11]=m}else m=e[11];const p=m;let g;e[12]!==a?(g=a?l.jsx(Ce,{className:"size-4"}):l.jsx(ds,{className:"size-4"}),e[12]=a,e[13]=g):g=e[13];let x;e[14]!==a||e[15]!==o||e[16]!==r?(x=a?o("chat.thinkingIndicator.thinking"):r,e[14]=a,e[15]=o,e[16]=r,e[17]=x):x=e[17];const h=a?"loading":"idle";let y;return e[18]!==p||e[19]!==d||e[20]!==g||e[21]!==x||e[22]!==h?(y=l.jsx(Be,{icon:g,title:x,summary:d,detail:p,state:h,detailVariant:"prose"}),e[18]=p,e[19]=d,e[20]=g,e[21]=x,e[22]=h,e[23]=y):y=e[23],y}function Rn(s){return s.text??""}function zn(s){return s.text??""}function Fn(s){return s.text?.includes("REDACTED")}function Dn(s){const e=M.c(24),{org:t}=me(),n=Yt(),a=Us(),o=Zt();let c;e[0]!==o||e[1]!==s?(c=async x=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const y=(await o.call("COLLECTION_THREADS_GET",{id:s})).item?.metadata??{},k=(y.expanded_tools??[]).filter(w=>w.toolName!==x.toolName);k.push({...x,expandedAt:new Date().toISOString()});const j={...Zs(y),expanded_tools:k};return await o.call("COLLECTION_THREADS_UPDATE",{id:s,data:{metadata:j}}),k},e[0]=o,e[1]=s,e[2]=c):c=e[2];let i,u,r;e[3]!==t||e[4]!==n||e[5]!==s?(i=async x=>{const h=xe.ensureTask(t.id,s??"");await n.cancelQueries({queryKey:h});const y=n.getQueryData(h),k=(y?.metadata?.expanded_tools??[]).filter(j=>j.toolName!==x.toolName);return k.push({...x,expandedAt:new Date().toISOString()}),n.setQueryData(h,j=>j&&{...j,metadata:{...j.metadata??{},expanded_tools:k}}),{previous:y}},u=()=>{n.invalidateQueries({queryKey:xe.ensureTask(t.id,s??"")})},r=(x,h,y)=>{const b=xe.ensureTask(t.id,s??"");y?.previous===void 0?n.removeQueries({queryKey:b,exact:!0}):n.setQueryData(b,y.previous),ze.error(x instanceof Error?x.message:"Failed to expand tool")},e[3]=t,e[4]=n,e[5]=s,e[6]=i,e[7]=u,e[8]=r):(i=e[6],u=e[7],r=e[8]);let f;e[9]!==c||e[10]!==i||e[11]!==u||e[12]!==r?(f={mutationFn:c,onMutate:i,onSuccess:u,onError:r},e[9]=c,e[10]=i,e[11]=u,e[12]=r,e[13]=f):f=e[13];const d=es(f);let m;e[14]!==a||e[15]!==d||e[16]!==t||e[17]!==n||e[18]!==s?(m=x=>{if(!s||!a)return;const h=xe.ensureTask(t.id,s),y=n.getQueryData(h),k=(y?.metadata?.expanded_tools??[]).filter(w=>w.toolName!==x.toolName);k.push({...x,expandedAt:new Date().toISOString()});const j={...y?.metadata??{},expanded_tools:k};n.setQueryData(h,w=>w&&{...w,metadata:j}),a.patchThread({id:s,metadata:j}),d.mutate(x)},e[14]=a,e[15]=d,e[16]=t,e[17]=n,e[18]=s,e[19]=m):m=e[19];const p=m;let g;return e[20]!==p||e[21]!==d.isPending||e[22]!==d.mutate?(g={addOrReplace:d.mutate,addOrReplaceEager:p,isPending:d.isPending},e[20]=p,e[21]=d.isPending,e[22]=d.mutate,e[23]=g):g=e[23],g}function On(s){if(s<1024)return`${s} B`;if(s<1024*1024){const t=s/1024;return t<10?`${t.toFixed(1)} KB`:`${Math.round(t)} KB`}const e=s/(1024*1024);return e<10?`${e.toFixed(1)} MB`:`${Math.round(e)} MB`}function Bn(s,e,t,n){const{data:a,isLoading:o}=ut({queryKey:xe.toolDefinitionLookup(e,t,s),queryFn:async()=>{if(!s||!e)return null;const c=await en({connectionId:e,orgId:t,orgSlug:n});try{const{tools:i}=await c.listTools(),u=Nt(s);return i.find(r=>r.name===u)??null}finally{await c.close().catch(()=>{})}},enabled:!!s&&!!e,staleTime:6e4,gcTime:3e5,retry:!1});return{toolDef:a??void 0,isLoading:o}}const Un={read:{icon:tt,labelKey:"chat.generic.tool.read"},write:{icon:_s,labelKey:"chat.generic.tool.write"},edit:{icon:hs,labelKey:"chat.generic.tool.edit"},grep:{icon:on,labelKey:"chat.generic.tool.grep"},glob:{icon:xs,labelKey:"chat.generic.tool.glob"},bash:{icon:gs,labelKey:"chat.generic.tool.bash"},read_tool_output:{icon:tt,labelKey:"chat.generic.tool.readToolOutput"},read_resource:{icon:ps,labelKey:"chat.generic.tool.readResource"},read_prompt:{icon:De,labelKey:"chat.generic.tool.readPrompt"},skill:{icon:De,labelKey:"chat.generic.tool.skill"},enable_tool:{icon:ws,labelKey:"chat.generic.tool.enableTool"},open_in_agent:{icon:ts,labelKey:"chat.generic.tool.openInAgent"},sandbox:{icon:ms,labelKey:"chat.generic.tool.sandbox"}},Et="studio:bash-sleep-start:v1",Hn=200;function qn(s,e,t,n=Hn){const a=s.filter(([o])=>o!==e);for(a.push([e,t]);a.length>n;)a.shift();return a}function Wn(){try{const s=sessionStorage.getItem(Et);if(!s)return[];const e=JSON.parse(s);return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&Number.isFinite(t[1])):[]}catch{return[]}}function Vn(s){try{const e=Wn(),t=e.find(([a])=>a===s);if(t)return t[1];const n=Date.now();return sessionStorage.setItem(Et,JSON.stringify(qn(e,s,n))),n}catch{return Date.now()}}function Rt(s,e){const t=M.c(2);let n;t[0]!==s?(n=()=>Vn(s),t[0]=s,t[1]=n):n=t[1];const a=z.useState(n)[0];return e??a}function zt(s){const e=Math.ceil(s/1e3);if(e<60)return`${e}s`;const t=Math.floor(e/60),n=e%60;return n?`${t}m ${n}s`:`${t}m`}function Gn(s){const e=M.c(5),{toolCallId:t,durationMs:n,anchorMs:a}=s,o=H(),c=Ve(1e3),u=Rt(t,a)+n-c;let r;e[0]!==u||e[1]!==o?(r=u>0?o("chat.generic.waitingFor",{duration:zt(u)}):o("chat.generic.wrappingUp"),e[0]=u,e[1]=o,e[2]=r):r=e[2];let f;return e[3]!==r?(f=l.jsx("span",{className:"tabular-nums",children:r}),e[3]=r,e[4]=f):f=e[4],f}const Kn=1e4;function Jn(s){const e=M.c(7),{toolCallId:t,anchorMs:n}=s,a=H(),o=Ve(1e3),c=Rt(t,n),i=o-c;if(i<Kn){let f;return e[0]!==a?(f=a("chat.generic.preparing"),e[0]=a,e[1]=f):f=e[1],f}let u;e[2]!==i||e[3]!==a?(u=a("chat.generic.runningFor",{elapsed:zt(i)}),e[2]=i,e[3]=a,e[4]=u):u=e[4];let r;return e[5]!==u?(r=l.jsx("span",{className:"tabular-nums",children:u}),e[5]=u,e[6]=r):r=e[6],r}const Qn={s:1e3,m:6e4,h:36e5,d:864e5};function Xn(s){const e=/(?:^|[\s;&|(])sleep((?:\s+[\d.]+[smhd]?)+)/g;let t=0,n=!1;for(const a of s.matchAll(e))for(const o of a[1].trim().split(/\s+/)){const c=/^([\d.]+)([smhd]?)$/.exec(o);if(!c)continue;const i=Number.parseFloat(c[1]);Number.isFinite(i)&&(t+=i*(Qn[c[2]||"s"]??1e3),n=!0)}return n?t:null}function Ae(s,e="An unknown error occurred"){return"errorText"in s&&typeof s.errorText=="string"?s.errorText:e}function ge(s){if(s==null)return"";try{return JSON.stringify(s)}catch{return"[Non-serializable value]"}}function Te(s){const e=ge(s);if(e===""||e==="[Non-serializable value]")return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}const Yn=s=>s.type==="dynamic-tool"||s.type.startsWith("tool-");function Zn(s){if(!s||typeof s!="object")return null;const e=s;if(!Array.isArray(e.parts))return null;const t=[];for(const n of e.parts)if(n.type==="text"&&typeof n.text=="string")t.push(n.text);else if(n.type==="reasoning")t.push(`## Reasoning
5
+ `);m=!i&&b.trim()?b:null,e[9]=i,e[10]=n,e[11]=m}else m=e[11];const p=m;let g;e[12]!==a?(g=a?l.jsx(Ce,{className:"size-4"}):l.jsx(ds,{className:"size-4"}),e[12]=a,e[13]=g):g=e[13];let x;e[14]!==a||e[15]!==o||e[16]!==r?(x=a?o("chat.thinkingIndicator.thinking"):r,e[14]=a,e[15]=o,e[16]=r,e[17]=x):x=e[17];const h=a?"loading":"idle";let y;return e[18]!==p||e[19]!==d||e[20]!==g||e[21]!==x||e[22]!==h?(y=l.jsx(Be,{icon:g,title:x,summary:d,detail:p,state:h,detailVariant:"prose"}),e[18]=p,e[19]=d,e[20]=g,e[21]=x,e[22]=h,e[23]=y):y=e[23],y}function Rn(s){return s.text??""}function zn(s){return s.text??""}function Dn(s){return s.text?.includes("REDACTED")}function Fn(s){const e=M.c(24),{org:t}=me(),n=Yt(),a=Us(),o=Zt();let c;e[0]!==o||e[1]!==s?(c=async x=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const y=(await o.call("COLLECTION_THREADS_GET",{id:s})).item?.metadata??{},k=(y.expanded_tools??[]).filter(w=>w.toolName!==x.toolName);k.push({...x,expandedAt:new Date().toISOString()});const j={...Zs(y),expanded_tools:k};return await o.call("COLLECTION_THREADS_UPDATE",{id:s,data:{metadata:j}}),k},e[0]=o,e[1]=s,e[2]=c):c=e[2];let i,u,r;e[3]!==t||e[4]!==n||e[5]!==s?(i=async x=>{const h=xe.ensureTask(t.id,s??"");await n.cancelQueries({queryKey:h});const y=n.getQueryData(h),k=(y?.metadata?.expanded_tools??[]).filter(j=>j.toolName!==x.toolName);return k.push({...x,expandedAt:new Date().toISOString()}),n.setQueryData(h,j=>j&&{...j,metadata:{...j.metadata??{},expanded_tools:k}}),{previous:y}},u=()=>{n.invalidateQueries({queryKey:xe.ensureTask(t.id,s??"")})},r=(x,h,y)=>{const b=xe.ensureTask(t.id,s??"");y?.previous===void 0?n.removeQueries({queryKey:b,exact:!0}):n.setQueryData(b,y.previous),ze.error(x instanceof Error?x.message:"Failed to expand tool")},e[3]=t,e[4]=n,e[5]=s,e[6]=i,e[7]=u,e[8]=r):(i=e[6],u=e[7],r=e[8]);let f;e[9]!==c||e[10]!==i||e[11]!==u||e[12]!==r?(f={mutationFn:c,onMutate:i,onSuccess:u,onError:r},e[9]=c,e[10]=i,e[11]=u,e[12]=r,e[13]=f):f=e[13];const d=es(f);let m;e[14]!==a||e[15]!==d||e[16]!==t||e[17]!==n||e[18]!==s?(m=x=>{if(!s||!a)return;const h=xe.ensureTask(t.id,s),y=n.getQueryData(h),k=(y?.metadata?.expanded_tools??[]).filter(w=>w.toolName!==x.toolName);k.push({...x,expandedAt:new Date().toISOString()});const j={...y?.metadata??{},expanded_tools:k};n.setQueryData(h,w=>w&&{...w,metadata:j}),a.patchThread({id:s,metadata:j}),d.mutate(x)},e[14]=a,e[15]=d,e[16]=t,e[17]=n,e[18]=s,e[19]=m):m=e[19];const p=m;let g;return e[20]!==p||e[21]!==d.isPending||e[22]!==d.mutate?(g={addOrReplace:d.mutate,addOrReplaceEager:p,isPending:d.isPending},e[20]=p,e[21]=d.isPending,e[22]=d.mutate,e[23]=g):g=e[23],g}function On(s){if(s<1024)return`${s} B`;if(s<1024*1024){const t=s/1024;return t<10?`${t.toFixed(1)} KB`:`${Math.round(t)} KB`}const e=s/(1024*1024);return e<10?`${e.toFixed(1)} MB`:`${Math.round(e)} MB`}function Bn(s,e,t,n){const{data:a,isLoading:o}=ut({queryKey:xe.toolDefinitionLookup(e,t,s),queryFn:async()=>{if(!s||!e)return null;const c=await en({connectionId:e,orgId:t,orgSlug:n});try{const{tools:i}=await c.listTools(),u=Nt(s);return i.find(r=>r.name===u)??null}finally{await c.close().catch(()=>{})}},enabled:!!s&&!!e,staleTime:6e4,gcTime:3e5,retry:!1});return{toolDef:a??void 0,isLoading:o}}const Un={read:{icon:tt,labelKey:"chat.generic.tool.read"},write:{icon:_s,labelKey:"chat.generic.tool.write"},edit:{icon:hs,labelKey:"chat.generic.tool.edit"},grep:{icon:on,labelKey:"chat.generic.tool.grep"},glob:{icon:xs,labelKey:"chat.generic.tool.glob"},bash:{icon:gs,labelKey:"chat.generic.tool.bash"},read_tool_output:{icon:tt,labelKey:"chat.generic.tool.readToolOutput"},read_resource:{icon:ps,labelKey:"chat.generic.tool.readResource"},read_prompt:{icon:Fe,labelKey:"chat.generic.tool.readPrompt"},skill:{icon:Fe,labelKey:"chat.generic.tool.skill"},enable_tool:{icon:ws,labelKey:"chat.generic.tool.enableTool"},open_in_agent:{icon:ts,labelKey:"chat.generic.tool.openInAgent"},sandbox:{icon:ms,labelKey:"chat.generic.tool.sandbox"}},Et="studio:bash-sleep-start:v1",Hn=200;function qn(s,e,t,n=Hn){const a=s.filter(([o])=>o!==e);for(a.push([e,t]);a.length>n;)a.shift();return a}function Wn(){try{const s=sessionStorage.getItem(Et);if(!s)return[];const e=JSON.parse(s);return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&Number.isFinite(t[1])):[]}catch{return[]}}function Gn(s){try{const e=Wn(),t=e.find(([a])=>a===s);if(t)return t[1];const n=Date.now();return sessionStorage.setItem(Et,JSON.stringify(qn(e,s,n))),n}catch{return Date.now()}}function Rt(s,e){const t=M.c(2);let n;t[0]!==s?(n=()=>Gn(s),t[0]=s,t[1]=n):n=t[1];const a=z.useState(n)[0];return e??a}function zt(s){const e=Math.ceil(s/1e3);if(e<60)return`${e}s`;const t=Math.floor(e/60),n=e%60;return n?`${t}m ${n}s`:`${t}m`}function Kn(s){const e=M.c(5),{toolCallId:t,durationMs:n,anchorMs:a}=s,o=H(),c=Ge(1e3),u=Rt(t,a)+n-c;let r;e[0]!==u||e[1]!==o?(r=u>0?o("chat.generic.waitingFor",{duration:zt(u)}):o("chat.generic.wrappingUp"),e[0]=u,e[1]=o,e[2]=r):r=e[2];let f;return e[3]!==r?(f=l.jsx("span",{className:"tabular-nums",children:r}),e[3]=r,e[4]=f):f=e[4],f}const Vn=1e4;function Jn(s){const e=M.c(7),{toolCallId:t,anchorMs:n}=s,a=H(),o=Ge(1e3),c=Rt(t,n),i=o-c;if(i<Vn){let f;return e[0]!==a?(f=a("chat.generic.preparing"),e[0]=a,e[1]=f):f=e[1],f}let u;e[2]!==i||e[3]!==a?(u=a("chat.generic.runningFor",{elapsed:zt(i)}),e[2]=i,e[3]=a,e[4]=u):u=e[4];let r;return e[5]!==u?(r=l.jsx("span",{className:"tabular-nums",children:u}),e[5]=u,e[6]=r):r=e[6],r}const Qn={s:1e3,m:6e4,h:36e5,d:864e5};function Xn(s){const e=/(?:^|[\s;&|(])sleep((?:\s+[\d.]+[smhd]?)+)/g;let t=0,n=!1;for(const a of s.matchAll(e))for(const o of a[1].trim().split(/\s+/)){const c=/^([\d.]+)([smhd]?)$/.exec(o);if(!c)continue;const i=Number.parseFloat(c[1]);Number.isFinite(i)&&(t+=i*(Qn[c[2]||"s"]??1e3),n=!0)}return n?t:null}function Ae(s,e="An unknown error occurred"){return"errorText"in s&&typeof s.errorText=="string"?s.errorText:e}function ge(s){if(s==null)return"";try{return JSON.stringify(s)}catch{return"[Non-serializable value]"}}function Te(s){const e=ge(s);if(e===""||e==="[Non-serializable value]")return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}const Yn=s=>s.type==="dynamic-tool"||s.type.startsWith("tool-");function Zn(s){if(!s||typeof s!="object")return null;const e=s;if(!Array.isArray(e.parts))return null;const t=[];for(const n of e.parts)if(n.type==="text"&&typeof n.text=="string")t.push(n.text);else if(n.type==="reasoning")t.push(`## Reasoning
6
6
  ${n.text}`);else if(n.type==="source-url")t.push(`## Source URL
7
7
  ${n.url}`);else if(n.type==="source-document")t.push(`## Source Document
8
8
  ${n.title}`);else if(n.type==="file")t.push(`## File
@@ -23,26 +23,26 @@ Error: Tool responded with an error`)}else if(n.state==="output-denied"){const o
23
23
  Input: ${o||"[No input]"}...
24
24
  Output: Tool execution was denied`)}}}return t.length>0?t.join(`
25
25
 
26
- `):null}function at(s){const e=s&&typeof s=="object"&&"created_at"in s?s.created_at:void 0;return typeof e=="string"||e instanceof Date?We(e):null}function ea(s){const e=s&&typeof s=="object"&&"timeout"in s?s.timeout:void 0;return Math.min(typeof e=="number"?e:3e4,12e4)}function _e(s){const e=M.c(7),{icon:t,label:n}=s;let a;e[0]!==t?(a=l.jsx(jt,{asChild:!0,children:l.jsx("span",{className:"flex items-center",children:t})}),e[0]=t,e[1]=a):a=e[1];let o;e[2]!==n?(o=l.jsx(vt,{side:"top",children:n}),e[2]=n,e[3]=o):o=e[3];let c;return e[4]!==a||e[5]!==o?(c=l.jsxs(St,{children:[a,o]}),e[4]=a,e[5]=o,e[6]=c):c=e[6],c}function ta(s){const e=M.c(19),{annotations:t,toolMeta:n}=s,a=H();let o;e[0]!==n?(o=yt(n),e[0]=n,e[1]=o):o=e[1];const c=!!o;if(!t&&!c)return null;let i;e[2]!==c||e[3]!==a?(i=c&&l.jsx(_e,{icon:l.jsx(mt,{}),label:a("chat.generic.annotation.interactive")}),e[2]=c,e[3]=a,e[4]=i):i=e[4];let u;e[5]!==t?.readOnlyHint||e[6]!==a?(u=t?.readOnlyHint&&l.jsx(_e,{icon:l.jsx(an,{}),label:a("chat.generic.annotation.readOnly")}),e[5]=t?.readOnlyHint,e[6]=a,e[7]=u):u=e[7];let r;e[8]!==t?.destructiveHint||e[9]!==a?(r=t?.destructiveHint&&l.jsx(_e,{icon:l.jsx(_t,{}),label:a("chat.generic.annotation.destructive")}),e[8]=t?.destructiveHint,e[9]=a,e[10]=r):r=e[10];let f;e[11]!==t?.openWorldHint||e[12]!==a?(f=t?.openWorldHint&&l.jsx(_e,{icon:l.jsx(Fe,{}),label:a("chat.generic.annotation.openWorld")}),e[11]=t?.openWorldHint,e[12]=a,e[13]=f):f=e[13];let d;return e[14]!==i||e[15]!==u||e[16]!==r||e[17]!==f?(d=l.jsxs(l.Fragment,{children:[i,u,r,f]}),e[14]=i,e[15]=u,e[16]=r,e[17]=f,e[18]=d):d=e[18],d}function sa(s){return s<1?`${Math.round(s*1e3)}ms`:s<10?`${s.toFixed(1)}s`:`${Math.round(s)}s`}function na(s){const e=M.c(13),{latency:t,outputBytes:n}=s,a=typeof t=="number"&&t>0,o=typeof n=="number"&&n>=0;if(!a&&!o)return null;let c;e[0]!==a||e[1]!==t?(c=a&&l.jsx("span",{children:sa(t)}),e[0]=a,e[1]=t,e[2]=c):c=e[2];let i;e[3]!==o||e[4]!==a?(i=a&&o&&l.jsx("span",{className:"text-muted-foreground/30",children:"·"}),e[3]=o,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==o||e[7]!==n?(u=o&&l.jsx("span",{children:On(n)}),e[6]=o,e[7]=n,e[8]=u):u=e[8];let r;return e[9]!==c||e[10]!==i||e[11]!==u?(r=l.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs font-mono tabular-nums text-muted-foreground/60 px-1 leading-none",children:[c,i,u]}),e[9]=c,e[10]=i,e[11]=u,e[12]=r):r=e[12],r}function aa(s,e,t,n){switch(s){case"input-streaming":case"input-available":return n?n("chat.generic.preparing"):"Preparing...";case"approval-requested":return n?n("chat.generic.waitingForApproval"):"Waiting for your approval";case"output-denied":return n?n("chat.generic.cancelled"):"Cancelled";case"output-error":return t??(n?n("chat.generic.failed"):"Failed");case"output-available":{if(e==null)return n?n("chat.generic.done"):"Done";if(typeof e=="string"){const a=e.trim();return a.length>100?a.slice(0,100)+"…":a}if(typeof e=="object"){for(const a of Object.keys(e)){const o=e[a];if(typeof o=="string"&&o.trim()){const c=o.trim();return c.length>100?c.slice(0,100)+"…":c}}return""}return String(e).slice(0,100)}default:return""}}function lt(s){const e=M.c(76),{part:t,annotations:n,latency:a,outputBytes:o,isLastMessage:c,toolMeta:i}=s,u=H(),r="toolName"in t&&typeof t.toolName=="string"?t.toolName:t.type==="dynamic-tool"?u("chat.generic.dynamicTool"):t.type.replace("tool-","")||"Tool",f=Nt(r),d=je(),m=Ws(),{org:p}=me(),{openSidePanel:g}=rn(),x=ve()?.taskId??null,{addOrReplaceEager:h}=Dn(x),{openPanel:y}=Ke(),b=i&&typeof i=="object"&&i!==null&&"connectionId"in i&&i.connectionId!=null&&i.connectionId!==""?String(i.connectionId):m?.selectedVirtualMcp?.id??null,{toolDef:k}=Bn(b?r:null,b,p.id,p.slug),j=k?._meta??i,w=kt(j),S=wt(f,w),N=Un[S],v=k?.title??(N?.labelKey?u(N.labelKey):void 0)??nn(S);let _;e[0]!==j?(_=yt(j),e[0]=j,e[1]=_):_=e[1];const T=_,A=!!T&&t.state==="output-available",P=b?`${b}:${r}`:null,E=!!n?.destructiveHint,L=A&&!!b&&!E&&!!x;let I;e[2]!==h||e[3]!==b||e[4]!==y||e[5]!==t||e[6]!==r?(I=()=>{if(!b)return;const J="input"in t&&t.input&&typeof t.input=="object"?t.input:{};h({toolName:r,appId:b,args:J}),y(as(b,r))},e[2]=h,e[3]=b,e[4]=y,e[5]=t,e[6]=r,e[7]=I):I=e[7];const $=I;let C;e[8]!==L||e[9]!==$?(C=J=>J==="fullscreen"&&L?($(),"fullscreen"):"inline",e[8]=L,e[9]=$,e[10]=C):C=e[10];const R=C;let D;e[11]!==d||e[12]!==g?(D=J=>{const te=Xs(J.content);te.content.length>0&&(g(),d?.sendMessage(te))},e[11]=d,e[12]=g,e[13]=D):D=e[13];const B=D,U=t.state==="approval-requested"&&c===!1,W=t.state==="output-denied"||U,K=t.state==="output-available"&&typeof t.output=="object"&&t.output!=null&&"isError"in t.output&&t.output.isError===!0;let X;e[14]!==t.state?(X=pe(t.state),e[14]=t.state,e[15]=X):X=e[15];const Z=X,G=U||Z==="approval"?"idle":K?"error":Z;let Q,ne;if(e[16]!==G||e[17]!==K||e[18]!==U||e[19]!==t||e[20]!==u||e[21]!==S){Q=t.state==="output-error"?Ae(t):void 0;const J=S==="bash"&&G==="loading"&&t.input&&typeof t.input=="object"&&typeof t.input.command=="string"?t.input.command:null;let te;e[24]!==J?(te=J!==null?Xn(J):null,e[24]=J,e[25]=te):te=e[25];const se=te;let Ne;e[26]!==t.input||e[27]!==se?(Ne=se!==null?Math.min(se,ea(t.input)):null,e[26]=t.input,e[27]=se,e[28]=Ne):Ne=e[28];const Xe=Ne,Ye="toolCallId"in t?t.toolCallId:"";ne=Xe!==null?l.jsx(Gn,{toolCallId:Ye,durationMs:Xe,anchorMs:at(t)}):G==="loading"?l.jsx(Jn,{toolCallId:Ye,anchorMs:at(t)}):U?u("chat.generic.cancelled"):K?u("chat.generic.failed"):aa(t.state,t.output,Q,u),e[16]=G,e[17]=K,e[18]=U,e[19]=t,e[20]=u,e[21]=S,e[22]=Q,e[23]=ne}else Q=e[22],ne=e[23];const oe=ne;let ee="";t.input!==void 0&&(ee=`# Input
26
+ `):null}function at(s){const e=s&&typeof s=="object"&&"created_at"in s?s.created_at:void 0;return typeof e=="string"||e instanceof Date?We(e):null}function ea(s){const e=s&&typeof s=="object"&&"timeout"in s?s.timeout:void 0;return Math.min(typeof e=="number"?e:3e4,12e4)}function _e(s){const e=M.c(7),{icon:t,label:n}=s;let a;e[0]!==t?(a=l.jsx(jt,{asChild:!0,children:l.jsx("span",{className:"flex items-center",children:t})}),e[0]=t,e[1]=a):a=e[1];let o;e[2]!==n?(o=l.jsx(vt,{side:"top",children:n}),e[2]=n,e[3]=o):o=e[3];let c;return e[4]!==a||e[5]!==o?(c=l.jsxs(St,{children:[a,o]}),e[4]=a,e[5]=o,e[6]=c):c=e[6],c}function ta(s){const e=M.c(19),{annotations:t,toolMeta:n}=s,a=H();let o;e[0]!==n?(o=yt(n),e[0]=n,e[1]=o):o=e[1];const c=!!o;if(!t&&!c)return null;let i;e[2]!==c||e[3]!==a?(i=c&&l.jsx(_e,{icon:l.jsx(mt,{}),label:a("chat.generic.annotation.interactive")}),e[2]=c,e[3]=a,e[4]=i):i=e[4];let u;e[5]!==t?.readOnlyHint||e[6]!==a?(u=t?.readOnlyHint&&l.jsx(_e,{icon:l.jsx(an,{}),label:a("chat.generic.annotation.readOnly")}),e[5]=t?.readOnlyHint,e[6]=a,e[7]=u):u=e[7];let r;e[8]!==t?.destructiveHint||e[9]!==a?(r=t?.destructiveHint&&l.jsx(_e,{icon:l.jsx(_t,{}),label:a("chat.generic.annotation.destructive")}),e[8]=t?.destructiveHint,e[9]=a,e[10]=r):r=e[10];let f;e[11]!==t?.openWorldHint||e[12]!==a?(f=t?.openWorldHint&&l.jsx(_e,{icon:l.jsx(De,{}),label:a("chat.generic.annotation.openWorld")}),e[11]=t?.openWorldHint,e[12]=a,e[13]=f):f=e[13];let d;return e[14]!==i||e[15]!==u||e[16]!==r||e[17]!==f?(d=l.jsxs(l.Fragment,{children:[i,u,r,f]}),e[14]=i,e[15]=u,e[16]=r,e[17]=f,e[18]=d):d=e[18],d}function sa(s){return s<1?`${Math.round(s*1e3)}ms`:s<10?`${s.toFixed(1)}s`:`${Math.round(s)}s`}function na(s){const e=M.c(13),{latency:t,outputBytes:n}=s,a=typeof t=="number"&&t>0,o=typeof n=="number"&&n>=0;if(!a&&!o)return null;let c;e[0]!==a||e[1]!==t?(c=a&&l.jsx("span",{children:sa(t)}),e[0]=a,e[1]=t,e[2]=c):c=e[2];let i;e[3]!==o||e[4]!==a?(i=a&&o&&l.jsx("span",{className:"text-muted-foreground/30",children:"·"}),e[3]=o,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==o||e[7]!==n?(u=o&&l.jsx("span",{children:On(n)}),e[6]=o,e[7]=n,e[8]=u):u=e[8];let r;return e[9]!==c||e[10]!==i||e[11]!==u?(r=l.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs font-mono tabular-nums text-muted-foreground/60 px-1 leading-none",children:[c,i,u]}),e[9]=c,e[10]=i,e[11]=u,e[12]=r):r=e[12],r}function aa(s,e,t,n){switch(s){case"input-streaming":case"input-available":return n?n("chat.generic.preparing"):"Preparing...";case"approval-requested":return n?n("chat.generic.waitingForApproval"):"Waiting for your approval";case"output-denied":return n?n("chat.generic.cancelled"):"Cancelled";case"output-error":return t??(n?n("chat.generic.failed"):"Failed");case"output-available":{if(e==null)return n?n("chat.generic.done"):"Done";if(typeof e=="string"){const a=e.trim();return a.length>100?a.slice(0,100)+"…":a}if(typeof e=="object"){for(const a of Object.keys(e)){const o=e[a];if(typeof o=="string"&&o.trim()){const c=o.trim();return c.length>100?c.slice(0,100)+"…":c}}return""}return String(e).slice(0,100)}default:return""}}function lt(s){const e=M.c(76),{part:t,annotations:n,latency:a,outputBytes:o,isLastMessage:c,toolMeta:i}=s,u=H(),r="toolName"in t&&typeof t.toolName=="string"?t.toolName:t.type==="dynamic-tool"?u("chat.generic.dynamicTool"):t.type.replace("tool-","")||"Tool",f=Nt(r),d=je(),m=Ws(),{org:p}=me(),{openSidePanel:g}=rn(),x=ve()?.taskId??null,{addOrReplaceEager:h}=Fn(x),{openPanel:y}=Ve(),b=i&&typeof i=="object"&&i!==null&&"connectionId"in i&&i.connectionId!=null&&i.connectionId!==""?String(i.connectionId):m?.selectedVirtualMcp?.id??null,{toolDef:k}=Bn(b?r:null,b,p.id,p.slug),j=k?._meta??i,w=kt(j),S=wt(f,w),N=Un[S],v=k?.title??(N?.labelKey?u(N.labelKey):void 0)??nn(S);let _;e[0]!==j?(_=yt(j),e[0]=j,e[1]=_):_=e[1];const T=_,A=!!T&&t.state==="output-available",P=b?`${b}:${r}`:null,E=!!n?.destructiveHint,L=A&&!!b&&!E&&!!x;let I;e[2]!==h||e[3]!==b||e[4]!==y||e[5]!==t||e[6]!==r?(I=()=>{if(!b)return;const J="input"in t&&t.input&&typeof t.input=="object"?t.input:{};h({toolName:r,appId:b,args:J}),y(as(b,r))},e[2]=h,e[3]=b,e[4]=y,e[5]=t,e[6]=r,e[7]=I):I=e[7];const $=I;let C;e[8]!==L||e[9]!==$?(C=J=>J==="fullscreen"&&L?($(),"fullscreen"):"inline",e[8]=L,e[9]=$,e[10]=C):C=e[10];const R=C;let F;e[11]!==d||e[12]!==g?(F=J=>{const te=Xs(J.content);te.content.length>0&&(g(),d?.sendMessage(te))},e[11]=d,e[12]=g,e[13]=F):F=e[13];const B=F,U=t.state==="approval-requested"&&c===!1,W=t.state==="output-denied"||U,V=t.state==="output-available"&&typeof t.output=="object"&&t.output!=null&&"isError"in t.output&&t.output.isError===!0;let X;e[14]!==t.state?(X=pe(t.state),e[14]=t.state,e[15]=X):X=e[15];const Z=X,K=U||Z==="approval"?"idle":V?"error":Z;let Q,ne;if(e[16]!==K||e[17]!==V||e[18]!==U||e[19]!==t||e[20]!==u||e[21]!==S){Q=t.state==="output-error"?Ae(t):void 0;const J=S==="bash"&&K==="loading"&&t.input&&typeof t.input=="object"&&typeof t.input.command=="string"?t.input.command:null;let te;e[24]!==J?(te=J!==null?Xn(J):null,e[24]=J,e[25]=te):te=e[25];const se=te;let Ne;e[26]!==t.input||e[27]!==se?(Ne=se!==null?Math.min(se,ea(t.input)):null,e[26]=t.input,e[27]=se,e[28]=Ne):Ne=e[28];const Xe=Ne,Ye="toolCallId"in t?t.toolCallId:"";ne=Xe!==null?l.jsx(Kn,{toolCallId:Ye,durationMs:Xe,anchorMs:at(t)}):K==="loading"?l.jsx(Jn,{toolCallId:Ye,anchorMs:at(t)}):U?u("chat.generic.cancelled"):V?u("chat.generic.failed"):aa(t.state,t.output,Q,u),e[16]=K,e[17]=V,e[18]=U,e[19]=t,e[20]=u,e[21]=S,e[22]=Q,e[23]=ne}else Q=e[22],ne=e[23];const oe=ne;let ee="";t.input!==void 0&&(ee=`# Input
27
27
  `+Te(t.input)),t.state==="output-error"?(ee&&(ee=ee+`
28
28
 
29
29
  `),ee=ee+(`# Error
30
30
  `+(Q??""))):t.output!==void 0&&!A&&(ee&&(ee=ee+`
31
31
 
32
32
  `),ee=ee+(`# Output
33
- `+Te(t.output)));let re;e:{if(W){let se;e[29]===Symbol.for("react.memo_cache_sentinel")?(se=l.jsx(ln,{}),e[29]=se):se=e[29],re=se;break e}if(A){let se;e[30]===Symbol.for("react.memo_cache_sentinel")?(se=l.jsx(mt,{className:"size-4 text-muted-foreground"}),e[30]=se):se=e[30],re=se;break e}const J=N?.icon;if(J){let se;e[31]!==J?(se=l.jsx(J,{className:"size-4 text-muted-foreground"}),e[31]=J,e[32]=se):se=e[32],re=se;break e}let te;e[33]===Symbol.for("react.memo_cache_sentinel")?(te=l.jsx(ys,{className:"size-4 text-muted-foreground"}),e[33]=te):te=e[33],re=te}let F;e[34]!==n||e[35]!==i?(F=l.jsx(ta,{annotations:n,toolMeta:i}),e[34]=n,e[35]=i,e[36]=F):F=e[36];let O;e[37]!==a||e[38]!==o?(O=l.jsx(na,{latency:a,outputBytes:o}),e[37]=a,e[38]=o,e[39]=O):O=e[39];let q;e[40]!==F||e[41]!==O?(q=l.jsxs(l.Fragment,{children:[F,O]}),e[40]=F,e[41]=O,e[42]=q):q=e[42];const ae=ee||null;let le;e[43]!==G||e[44]!==v||e[45]!==W||e[46]!==oe||e[47]!==q||e[48]!==ae||e[49]!==re?(le=l.jsx(Y,{icon:re,iconDestructive:W,trailing:q,title:v,summary:oe,state:G,detail:ae}),e[43]=G,e[44]=v,e[45]=W,e[46]=oe,e[47]=q,e[48]=ae,e[49]=re,e[50]=le):le=e[50];let ue;e[51]!==L||e[52]!==$||e[53]!==u?(ue=L&&l.jsx("div",{className:"flex justify-end mt-1.5 mb-1",children:l.jsxs("button",{type:"button",onClick:$,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground rounded-lg [@media(hover:hover)]:hover:bg-accent [@media(hover:hover)]:hover:text-foreground transition-colors",children:[l.jsx(bs,{className:"size-3.5"}),u("chat.generic.openInPanel")]})}),e[51]=L,e[52]=$,e[53]=u,e[54]=ue):ue=e[54];let ie;e[55]!==L||e[56]!==m||e[57]!==b||e[58]!==v||e[59]!==B||e[60]!==R||e[61]!==A||e[62]!==j||e[63]!==p.id||e[64]!==p.slug||e[65]!==t.input||e[66]!==t.output||e[67]!==P||e[68]!==u||e[69]!==S||e[70]!==T?(ie=A&&T&&b&&p?.id&&l.jsx(l.Fragment,{children:l.jsx(ss,{fallback:J=>{const{resetError:te}=J;return l.jsxs("div",{className:"mt-2 flex items-center gap-2 px-3 py-2.5 border border-dashed border-destructive/30 bg-destructive/5 rounded-lg",children:[l.jsx(_t,{size:16,className:"shrink-0 text-destructive"}),l.jsx("span",{className:"flex-1 text-xs text-destructive font-medium",children:u("chat.generic.failedToLoad",{toolName:v})}),l.jsxs(be,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5 shrink-0",onClick:te,children:[l.jsx(dt,{className:"size-3.5"}),u("chat.generic.retry")]})]})},children:l.jsx(z.Suspense,{fallback:l.jsx("div",{className:"mt-2 flex items-center justify-center h-12 border border-border/75 rounded-lg overflow-hidden p-3",children:l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[l.jsx(ns,{className:"size-4"}),l.jsx("span",{className:"text-sm",children:u("chat.generic.loadingApp")})]})}),children:l.jsx(ra,{uiResourceUri:T,connectionId:b,orgId:p.id,orgSlug:p.slug,toolName:S,toolInput:t.input,toolResult:t.output,toolMeta:j,onMessage:B,onUpdateModelContext:P&&m?J=>m.setAppContext(P,J):void 0,onTeardown:P&&m?()=>m.clearAppContext(P):void 0,onRequestDisplayMode:L?R:void 0})})})}),e[55]=L,e[56]=m,e[57]=b,e[58]=v,e[59]=B,e[60]=R,e[61]=A,e[62]=j,e[63]=p.id,e[64]=p.slug,e[65]=t.input,e[66]=t.output,e[67]=P,e[68]=u,e[69]=S,e[70]=T,e[71]=ie):ie=e[71];let ce;return e[72]!==le||e[73]!==ue||e[74]!==ie?(ce=l.jsxs("div",{children:[le,ue,ie]}),e[72]=le,e[73]=ue,e[74]=ie,e[75]=ce):ce=e[75],ce}function Ft(s){return typeof s=="object"&&s!=null&&"type"in s&&s.type==="mcpToolCall"}function la(s){if(s!=null)return Ft(s)?s.arguments??void 0:s}function oa(s){if(s==null)return;if(Ft(s)&&s.result!=null)return s.result;if(typeof s=="object"&&"content"in s&&Array.isArray(s.content)){const t=s.content;if(t.length>0&&typeof t[0]=="object"&&t[0]!=null&&"type"in t[0])return s}const e=typeof s=="string"?s:JSON.stringify(s);return{structuredContent:typeof s=="object"&&!Array.isArray(s)?s:void 0,content:[{type:"text",text:e}]}}function ra(s){const e=M.c(27),{uiResourceUri:t,connectionId:n,orgId:a,orgSlug:o,toolName:c,toolInput:i,toolResult:u,toolMeta:r,onMessage:f,onUpdateModelContext:d,onTeardown:m,onRequestDisplayMode:p}=s;let g;e[0]!==n||e[1]!==a||e[2]!==o?(g={connectionId:n,orgId:a,orgSlug:o},e[0]=n,e[1]=a,e[2]=o,e[3]=g):g=e[3];const x=tn(g);let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h={type:"object"},e[4]=h):h=e[4];let y;e[5]!==r?(y=r!=null&&{_meta:r},e[5]=r,e[6]=y):y=e[6];let b;e[7]!==y||e[8]!==c?(b={name:c,inputSchema:h,...y},e[7]=y,e[8]=c,e[9]=b):b=e[9];const k=b;let j;e[10]!==k?(j={tool:k},e[10]=k,e[11]=j):j=e[11];let w;e[12]!==i?(w=la(i),e[12]=i,e[13]=w):w=e[13];let S;e[14]!==u?(S=oa(u),e[14]=u,e[15]=S):S=e[15];let N;return e[16]!==x||e[17]!==f||e[18]!==p||e[19]!==m||e[20]!==d||e[21]!==a||e[22]!==j||e[23]!==w||e[24]!==S||e[25]!==t?(N=l.jsx("div",{className:"mt-2 border border-border/75 rounded-lg overflow-hidden p-3",children:l.jsx(Ys,{resourceURI:t,orgId:a,toolInfo:j,toolInput:w,toolResult:S,client:x,onMessage:f,onUpdateModelContext:d,onTeardown:m,onRequestDisplayMode:p})}),e[16]=x,e[17]=f,e[18]=p,e[19]=m,e[20]=d,e[21]=a,e[22]=j,e[23]=w,e[24]=S,e[25]=t,e[26]=N):N=e[26],N}const ot="studio-storage://",rt="mesh-storage://";function Je(s){return s.startsWith(ot)?s.slice(ot.length):s.startsWith(rt)?s.slice(rt.length):null}function Dt(s,e){const t=Je(s);return t!==null?`/api/${e}/files/${t}`:s}function Ot(s){const e=M.c(7),{srcs:t,alt:n}=s;let a;if(e[0]!==n||e[1]!==t){let c;e[3]!==n?(c=i=>l.jsx(un,{src:i,alt:n,children:l.jsx("img",{src:i,alt:n,className:"max-w-sm max-h-80 object-contain rounded-lg border border-border hover:border-foreground/20 transition-colors"})},i),e[3]=n,e[4]=c):c=e[4],a=t.map(c),e[0]=n,e[1]=t,e[2]=a}else a=e[2];let o;return e[5]!==a?(o=l.jsx("div",{className:"flex flex-wrap gap-2",children:a}),e[5]=a,e[6]=o):o=e[6],o}const ia=ls({image_url:os({protocol:/^https$/})});function ca(s){if(typeof s!="string")return null;try{const e=ia.safeParse(JSON.parse(s.split(`
34
- `,1)[0]??""));return e.success?e.data.image_url:null}catch{return null}}function ua(s){return Array.isArray(s?.images)?s.images:void 0}function da(s){if(!s?.usage)return null;const e=s.usage.inputTokens??0,t=s.usage.outputTokens??0,n=e+t;return n?{inputTokens:e,outputTokens:t,reasoningTokens:0,totalTokens:n,cost:0,cacheReadTokens:0,cacheWriteTokens:0}:null}function fa(s){const e=M.c(14),{uri:t,orgSlug:n}=s,a=H();let o;e[0]!==n||e[1]!==t?(o=Dt(t,n),e[0]=n,e[1]=t,e[2]=o):o=e[2];const c=o;let i;e[3]!==a||e[4]!==t?(i=Je(t)!==null?t.slice(t.lastIndexOf("/")+1):a("chat.generateImage.reference"),e[3]=a,e[4]=t,e[5]=i):i=e[5];const u=i;let r;e[6]!==u?(r=l.jsx(jt,{asChild:!0,children:l.jsx("span",{className:"inline-flex items-center gap-1 px-1 py-0.5 rounded bg-muted text-muted-foreground text-xs cursor-default select-none",children:u})}),e[6]=u,e[7]=r):r=e[7];let f;e[8]!==u||e[9]!==c?(f=l.jsx(vt,{side:"top",className:"max-w-sm p-1.5",children:l.jsx("img",{src:c,alt:u,className:"max-w-full max-h-64 object-contain rounded"})}),e[8]=u,e[9]=c,e[10]=f):f=e[10];let d;return e[11]!==r||e[12]!==f?(d=l.jsxs(St,{children:[r,f]}),e[11]=r,e[12]=f,e[13]=d):d=e[13],d}function ma(s){const e=M.c(64),{part:t,latency:n}=s,a=H(),o=ft();let c;e[0]!==t.state?(c=pe(t.state),e[0]=t.state,e[1]=c):c=e[1];const i=c,u=t.input,r=t.output,f=ua(r);let d;e[2]!==r?(d=da(r),e[2]=r,e[3]=d):d=e[3];const m=d,g=Tt()?r?.model:void 0,x=Array.isArray(u?.referenceImages)?u.referenceImages.filter(pa):void 0;let h;e[4]!==n?(h=n!=null&&n>0?l.jsx("span",{className:"text-2xs font-mono tabular-nums text-muted-foreground/60",children:ye(n)}):null,e[4]=n,e[5]=h):h=e[5];const y=h;if(i==="loading"){let I;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=l.jsx(ke,{size:14}),e[6]=I):I=e[6];let $;e[7]!==a?($=a("chat.generateImage.generatingImage"),e[7]=a,e[8]=$):$=e[8];let C;e[9]!==u?(C=u?.prompt?`"${u.prompt.slice(0,80)}…"`:void 0,e[9]=u,e[10]=C):C=e[10];let R;return e[11]!==$||e[12]!==C?(R=l.jsx(Y,{icon:I,title:$,summary:C,state:"loading"}),e[11]=$,e[12]=C,e[13]=R):R=e[13],R}if(r?.background){let I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=l.jsx(ke,{size:14}),e[14]=I):I=e[14];let $;e[15]!==a?($=a("chat.generateImage.imageQueuedGeneratingInBackground"),e[15]=a,e[16]=$):$=e[16];let C;e[17]!==u?(C=u?.prompt?`"${u.prompt.slice(0,80)}…"`:void 0,e[17]=u,e[18]=C):C=e[18];let R;return e[19]!==$||e[20]!==C?(R=l.jsx(Y,{icon:I,title:$,summary:C,state:"idle"}),e[19]=$,e[20]=C,e[21]=R):R=e[21],R}if(i==="error"||!f||f.length===0){let I;e[22]!==t||e[23]!==i?(I=i==="error"?Ae(t):void 0,e[22]=t,e[23]=i,e[24]=I):I=e[24];const $=I;let C="";u!==void 0&&(C=`# Input
33
+ `+Te(t.output)));let re;e:{if(W){let se;e[29]===Symbol.for("react.memo_cache_sentinel")?(se=l.jsx(ln,{}),e[29]=se):se=e[29],re=se;break e}if(A){let se;e[30]===Symbol.for("react.memo_cache_sentinel")?(se=l.jsx(mt,{className:"size-4 text-muted-foreground"}),e[30]=se):se=e[30],re=se;break e}const J=N?.icon;if(J){let se;e[31]!==J?(se=l.jsx(J,{className:"size-4 text-muted-foreground"}),e[31]=J,e[32]=se):se=e[32],re=se;break e}let te;e[33]===Symbol.for("react.memo_cache_sentinel")?(te=l.jsx(ys,{className:"size-4 text-muted-foreground"}),e[33]=te):te=e[33],re=te}let D;e[34]!==n||e[35]!==i?(D=l.jsx(ta,{annotations:n,toolMeta:i}),e[34]=n,e[35]=i,e[36]=D):D=e[36];let O;e[37]!==a||e[38]!==o?(O=l.jsx(na,{latency:a,outputBytes:o}),e[37]=a,e[38]=o,e[39]=O):O=e[39];let q;e[40]!==D||e[41]!==O?(q=l.jsxs(l.Fragment,{children:[D,O]}),e[40]=D,e[41]=O,e[42]=q):q=e[42];const ae=ee||null;let le;e[43]!==K||e[44]!==v||e[45]!==W||e[46]!==oe||e[47]!==q||e[48]!==ae||e[49]!==re?(le=l.jsx(Y,{icon:re,iconDestructive:W,trailing:q,title:v,summary:oe,state:K,detail:ae}),e[43]=K,e[44]=v,e[45]=W,e[46]=oe,e[47]=q,e[48]=ae,e[49]=re,e[50]=le):le=e[50];let ue;e[51]!==L||e[52]!==$||e[53]!==u?(ue=L&&l.jsx("div",{className:"flex justify-end mt-1.5 mb-1",children:l.jsxs("button",{type:"button",onClick:$,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground rounded-lg [@media(hover:hover)]:hover:bg-accent [@media(hover:hover)]:hover:text-foreground transition-colors",children:[l.jsx(bs,{className:"size-3.5"}),u("chat.generic.openInPanel")]})}),e[51]=L,e[52]=$,e[53]=u,e[54]=ue):ue=e[54];let ie;e[55]!==L||e[56]!==m||e[57]!==b||e[58]!==v||e[59]!==B||e[60]!==R||e[61]!==A||e[62]!==j||e[63]!==p.id||e[64]!==p.slug||e[65]!==t.input||e[66]!==t.output||e[67]!==P||e[68]!==u||e[69]!==S||e[70]!==T?(ie=A&&T&&b&&p?.id&&l.jsx(l.Fragment,{children:l.jsx(ss,{fallback:J=>{const{resetError:te}=J;return l.jsxs("div",{className:"mt-2 flex items-center gap-2 px-3 py-2.5 border border-dashed border-destructive/30 bg-destructive/5 rounded-lg",children:[l.jsx(_t,{size:16,className:"shrink-0 text-destructive"}),l.jsx("span",{className:"flex-1 text-xs text-destructive font-medium",children:u("chat.generic.failedToLoad",{toolName:v})}),l.jsxs(be,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5 shrink-0",onClick:te,children:[l.jsx(dt,{className:"size-3.5"}),u("chat.generic.retry")]})]})},children:l.jsx(z.Suspense,{fallback:l.jsx("div",{className:"mt-2 flex items-center justify-center h-12 border border-border/75 rounded-lg overflow-hidden p-3",children:l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[l.jsx(ns,{className:"size-4"}),l.jsx("span",{className:"text-sm",children:u("chat.generic.loadingApp")})]})}),children:l.jsx(ra,{uiResourceUri:T,connectionId:b,orgId:p.id,orgSlug:p.slug,toolName:S,toolInput:t.input,toolResult:t.output,toolMeta:j,onMessage:B,onUpdateModelContext:P&&m?J=>m.setAppContext(P,J):void 0,onTeardown:P&&m?()=>m.clearAppContext(P):void 0,onRequestDisplayMode:L?R:void 0})})})}),e[55]=L,e[56]=m,e[57]=b,e[58]=v,e[59]=B,e[60]=R,e[61]=A,e[62]=j,e[63]=p.id,e[64]=p.slug,e[65]=t.input,e[66]=t.output,e[67]=P,e[68]=u,e[69]=S,e[70]=T,e[71]=ie):ie=e[71];let ce;return e[72]!==le||e[73]!==ue||e[74]!==ie?(ce=l.jsxs("div",{children:[le,ue,ie]}),e[72]=le,e[73]=ue,e[74]=ie,e[75]=ce):ce=e[75],ce}function Dt(s){return typeof s=="object"&&s!=null&&"type"in s&&s.type==="mcpToolCall"}function la(s){if(s!=null)return Dt(s)?s.arguments??void 0:s}function oa(s){if(s==null)return;if(Dt(s)&&s.result!=null)return s.result;if(typeof s=="object"&&"content"in s&&Array.isArray(s.content)){const t=s.content;if(t.length>0&&typeof t[0]=="object"&&t[0]!=null&&"type"in t[0])return s}const e=typeof s=="string"?s:JSON.stringify(s);return{structuredContent:typeof s=="object"&&!Array.isArray(s)?s:void 0,content:[{type:"text",text:e}]}}function ra(s){const e=M.c(27),{uiResourceUri:t,connectionId:n,orgId:a,orgSlug:o,toolName:c,toolInput:i,toolResult:u,toolMeta:r,onMessage:f,onUpdateModelContext:d,onTeardown:m,onRequestDisplayMode:p}=s;let g;e[0]!==n||e[1]!==a||e[2]!==o?(g={connectionId:n,orgId:a,orgSlug:o},e[0]=n,e[1]=a,e[2]=o,e[3]=g):g=e[3];const x=tn(g);let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h={type:"object"},e[4]=h):h=e[4];let y;e[5]!==r?(y=r!=null&&{_meta:r},e[5]=r,e[6]=y):y=e[6];let b;e[7]!==y||e[8]!==c?(b={name:c,inputSchema:h,...y},e[7]=y,e[8]=c,e[9]=b):b=e[9];const k=b;let j;e[10]!==k?(j={tool:k},e[10]=k,e[11]=j):j=e[11];let w;e[12]!==i?(w=la(i),e[12]=i,e[13]=w):w=e[13];let S;e[14]!==u?(S=oa(u),e[14]=u,e[15]=S):S=e[15];let N;return e[16]!==x||e[17]!==f||e[18]!==p||e[19]!==m||e[20]!==d||e[21]!==a||e[22]!==j||e[23]!==w||e[24]!==S||e[25]!==t?(N=l.jsx("div",{className:"mt-2 border border-border/75 rounded-lg overflow-hidden p-3",children:l.jsx(Ys,{resourceURI:t,orgId:a,toolInfo:j,toolInput:w,toolResult:S,client:x,onMessage:f,onUpdateModelContext:d,onTeardown:m,onRequestDisplayMode:p})}),e[16]=x,e[17]=f,e[18]=p,e[19]=m,e[20]=d,e[21]=a,e[22]=j,e[23]=w,e[24]=S,e[25]=t,e[26]=N):N=e[26],N}const ot="studio-storage://",rt="mesh-storage://";function Je(s){return s.startsWith(ot)?s.slice(ot.length):s.startsWith(rt)?s.slice(rt.length):null}function Ft(s,e){const t=Je(s);return t!==null?`/api/${e}/files/${t}`:s}function Ot(s){const e=M.c(7),{srcs:t,alt:n}=s;let a;if(e[0]!==n||e[1]!==t){let c;e[3]!==n?(c=i=>l.jsx(un,{src:i,alt:n,children:l.jsx("img",{src:i,alt:n,className:"max-w-sm max-h-80 object-contain rounded-lg border border-border hover:border-foreground/20 transition-colors"})},i),e[3]=n,e[4]=c):c=e[4],a=t.map(c),e[0]=n,e[1]=t,e[2]=a}else a=e[2];let o;return e[5]!==a?(o=l.jsx("div",{className:"flex flex-wrap gap-2",children:a}),e[5]=a,e[6]=o):o=e[6],o}const ia=ls({image_url:os({protocol:/^https$/})});function ca(s){if(typeof s!="string")return null;try{const e=ia.safeParse(JSON.parse(s.split(`
34
+ `,1)[0]??""));return e.success?e.data.image_url:null}catch{return null}}function ua(s){return Array.isArray(s?.images)?s.images:void 0}function da(s){if(!s?.usage)return null;const e=s.usage.inputTokens??0,t=s.usage.outputTokens??0,n=e+t;return n?{inputTokens:e,outputTokens:t,reasoningTokens:0,totalTokens:n,cost:0,cacheReadTokens:0,cacheWriteTokens:0}:null}function fa(s){const e=M.c(14),{uri:t,orgSlug:n}=s,a=H();let o;e[0]!==n||e[1]!==t?(o=Ft(t,n),e[0]=n,e[1]=t,e[2]=o):o=e[2];const c=o;let i;e[3]!==a||e[4]!==t?(i=Je(t)!==null?t.slice(t.lastIndexOf("/")+1):a("chat.generateImage.reference"),e[3]=a,e[4]=t,e[5]=i):i=e[5];const u=i;let r;e[6]!==u?(r=l.jsx(jt,{asChild:!0,children:l.jsx("span",{className:"inline-flex items-center gap-1 px-1 py-0.5 rounded bg-muted text-muted-foreground text-xs cursor-default select-none",children:u})}),e[6]=u,e[7]=r):r=e[7];let f;e[8]!==u||e[9]!==c?(f=l.jsx(vt,{side:"top",className:"max-w-sm p-1.5",children:l.jsx("img",{src:c,alt:u,className:"max-w-full max-h-64 object-contain rounded"})}),e[8]=u,e[9]=c,e[10]=f):f=e[10];let d;return e[11]!==r||e[12]!==f?(d=l.jsxs(St,{children:[r,f]}),e[11]=r,e[12]=f,e[13]=d):d=e[13],d}function ma(s){const e=M.c(64),{part:t,latency:n}=s,a=H(),o=ft();let c;e[0]!==t.state?(c=pe(t.state),e[0]=t.state,e[1]=c):c=e[1];const i=c,u=t.input,r=t.output,f=ua(r);let d;e[2]!==r?(d=da(r),e[2]=r,e[3]=d):d=e[3];const m=d,g=Tt()?r?.model:void 0,x=Array.isArray(u?.referenceImages)?u.referenceImages.filter(pa):void 0;let h;e[4]!==n?(h=n!=null&&n>0?l.jsx("span",{className:"text-2xs font-mono tabular-nums text-muted-foreground/60",children:ye(n)}):null,e[4]=n,e[5]=h):h=e[5];const y=h;if(i==="loading"){let I;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=l.jsx(ke,{size:14}),e[6]=I):I=e[6];let $;e[7]!==a?($=a("chat.generateImage.generatingImage"),e[7]=a,e[8]=$):$=e[8];let C;e[9]!==u?(C=u?.prompt?`"${u.prompt.slice(0,80)}…"`:void 0,e[9]=u,e[10]=C):C=e[10];let R;return e[11]!==$||e[12]!==C?(R=l.jsx(Y,{icon:I,title:$,summary:C,state:"loading"}),e[11]=$,e[12]=C,e[13]=R):R=e[13],R}if(r?.background){let I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=l.jsx(ke,{size:14}),e[14]=I):I=e[14];let $;e[15]!==a?($=a("chat.generateImage.imageQueuedGeneratingInBackground"),e[15]=a,e[16]=$):$=e[16];let C;e[17]!==u?(C=u?.prompt?`"${u.prompt.slice(0,80)}…"`:void 0,e[17]=u,e[18]=C):C=e[18];let R;return e[19]!==$||e[20]!==C?(R=l.jsx(Y,{icon:I,title:$,summary:C,state:"idle"}),e[19]=$,e[20]=C,e[21]=R):R=e[21],R}if(i==="error"||!f||f.length===0){let I;e[22]!==t||e[23]!==i?(I=i==="error"?Ae(t):void 0,e[22]=t,e[23]=i,e[24]=I):I=e[24];const $=I;let C="";u!==void 0&&(C=`# Input
35
35
  `+Te(u)),$?(C&&(C=C+`
36
36
 
37
37
  `),C=C+(`# Error
38
38
  `+$)):r!==void 0&&(C&&(C=C+`
39
39
 
40
40
  `),C=C+(`# Output
41
- `+Te(r)));let R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsx(ke,{size:14}),e[25]=R):R=e[25];let D;e[26]!==a?(D=a("chat.generateImage.imageGeneration"),e[26]=a,e[27]=D):D=e[27];let B;e[28]!==i||e[29]!==a?(B=a(i==="error"?"chat.generateImage.failed":"chat.generateImage.noImagesGenerated"),e[28]=i,e[29]=a,e[30]=B):B=e[30];const U=i==="error"?"error":"idle",W=C||null;let K;return e[31]!==y||e[32]!==D||e[33]!==B||e[34]!==U||e[35]!==W||e[36]!==m?(K=l.jsx(Y,{icon:R,title:D,summary:B,state:U,usage:m,trailing:y,detail:W}),e[31]=y,e[32]=D,e[33]=B,e[34]=U,e[35]=W,e[36]=m,e[37]=K):K=e[37],K}const b="flex flex-col gap-2";let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsx(ke,{size:14,className:"text-special"}),e[38]=k):k=e[38];let j;e[39]!==a?(j=a("chat.generateImage.generatedImage"),e[39]=a,e[40]=j):j=e[40];let w;e[41]!==u?(w=u?.prompt&&l.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:u.prompt}),e[41]=u,e[42]=w):w=e[42];const S=x&&x.length>0&&l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[l.jsx("span",{className:"text-2xs text-muted-foreground/50",children:a("chat.generateImage.references")}),x.map((I,$)=>{const C=I.uri??I.url;return l.jsx(fa,{uri:C,orgSlug:o.slug},$)})]});let N;e[43]!==w||e[44]!==S?(N=l.jsxs("div",{className:"flex flex-col gap-1 pb-2 pl-6",children:[w,S]}),e[43]=w,e[44]=S,e[45]=N):N=e[45];let v;e[46]!==y||e[47]!==g||e[48]!==j||e[49]!==N||e[50]!==m?(v=l.jsx(Y,{icon:k,title:j,summary:g,state:"idle",usage:m,trailing:y,children:N}),e[46]=y,e[47]=g,e[48]=j,e[49]=N,e[50]=m,e[51]=v):v=e[51];const _=Ot;let T;e[52]!==o?(T=I=>{const $=I.uri??I.url;return $?[Dt($,o.slug)]:[]},e[52]=o,e[53]=T):T=e[53];const A=f.flatMap(T);let P;e[54]!==u?.prompt||e[55]!==a?(P=u?.prompt??a("chat.generateImage.generatedImageAlt"),e[54]=u?.prompt,e[55]=a,e[56]=P):P=e[56];let E;e[57]!==_||e[58]!==A||e[59]!==P?(E=l.jsx(_,{srcs:A,alt:P}),e[57]=_,e[58]=A,e[59]=P,e[60]=E):E=e[60];let L;return e[61]!==v||e[62]!==E?(L=l.jsxs("div",{className:b,children:[v,E]}),e[61]=v,e[62]=E,e[63]=L):L=e[63],L}function pa(s){return s.uri??s.url}function ga(s,e){const t=Je(s);return t!==null?`/api/${e}/files/${t}`:s}function xa(s){if(!s?.usage)return null;const e=s.usage.inputTokens??0,t=s.usage.outputTokens??0,n=e+t;if(!n)return null;const a={providerMetadata:s.usage.providerMetadata};return{inputTokens:e,outputTokens:t,reasoningTokens:0,totalTokens:n,cost:Vs(a),cacheReadTokens:0,cacheWriteTokens:0}}function ha(s){try{return new URL(s).hostname.replace(/^www\./,"")}catch{return s}}function ba(s){try{return`${new URL(s).origin}/favicon.ico`}catch{return""}}function ya(s){const e=M.c(16),{citation:t,index:n}=s;let a;e[0]!==t.url?(a=ha(t.url),e[0]=t.url,e[1]=a):a=e[1];const o=a;let c;e[2]!==t.url?(c=ba(t.url),e[2]=t.url,e[3]=c):c=e[3];const i=c,u=t.title||o;let r;e[4]!==i?(r=l.jsx("img",{src:i,alt:"",className:"size-3.5 rounded-sm shrink-0",onError:ja}),e[4]=i,e[5]=r):r=e[5];let f;e[6]!==u?(f=l.jsx("span",{className:"truncate max-w-[180px]",children:u}),e[6]=u,e[7]=f):f=e[7];const d=n+1;let m;e[8]!==d?(m=l.jsxs("span",{className:"text-2xs text-muted-foreground/50 tabular-nums shrink-0",children:["[",d,"]"]}),e[8]=d,e[9]=m):m=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=l.jsx(rs,{size:10,className:"shrink-0 opacity-0 group-hover/src:opacity-100 transition-opacity"}),e[10]=p):p=e[10];let g;return e[11]!==t.url||e[12]!==r||e[13]!==f||e[14]!==m?(g=l.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"group/src inline-flex items-center gap-1.5 rounded-md border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent hover:border-border hover:text-foreground",children:[r,f,m,p]}),e[11]=t.url,e[12]=r,e[13]=f,e[14]=m,e[15]=g):g=e[15],g}function ja(s){s.target.style.display="none"}function va(s,e){return s.replace(/\[(\d+)\]/g,(t,n)=>{const a=parseInt(n,10)-1,o=e[a];return o?`[\\[${n}\\]](${o.url})`:t})}const Ee=5;function Sa(s){const e=M.c(13),{citations:t}=s,n=H(),[a,o]=z.useState(!1),c=t.length>Ee;let i;e[0]!==t||e[1]!==a?(i=a?t:t.slice(0,Ee),e[0]=t,e[1]=a,e[2]=i):i=e[2];const u=i;let r;e[3]!==u?(r=u.map(ka),e[3]=u,e[4]=r):r=e[4];let f;e[5]!==t.length||e[6]!==a||e[7]!==c||e[8]!==n?(f=c&&l.jsx("button",{type:"button",onClick:()=>o(Na),className:"inline-flex items-center rounded-lg border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent hover:border-border hover:text-foreground",children:a?n("chat.webSearch.showLess"):n("chat.webSearch.showMore",{count:t.length-Ee})}),e[5]=t.length,e[6]=a,e[7]=c,e[8]=n,e[9]=f):f=e[9];let d;return e[10]!==r||e[11]!==f?(d=l.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[r,f]}),e[10]=r,e[11]=f,e[12]=d):d=e[12],d}function Na(s){return!s}function ka(s,e){return l.jsx(ya,{citation:s,index:e},s.url)}function wa(s){const e=M.c(61),{part:t,latency:n,streamingText:a}=s,o=H(),c=ft();let i;e[0]!==t.state?(i=pe(t.state),e[0]=t.state,e[1]=i):i=e[1];const u=i,r=t.input,f=t.output;let d,m,p;e[2]!==c||e[3]!==f?(d=f?.uri?ga(f.uri,c.slug):void 0,p=ut,m=xe.webSearchBlob(d??""),e[2]=c,e[3]=f,e[4]=d,e[5]=m,e[6]=p):(d=e[4],m=e[5],p=e[6]);let g;e[7]!==d?(g=async()=>{const X=await fetch(d);if(!X.ok)throw new Error(`Failed to fetch: ${X.status}`);return X.text()},e[7]=d,e[8]=g):g=e[8];const x=!!d;let h;e[9]!==m||e[10]!==g||e[11]!==x?(h={queryKey:m,queryFn:g,enabled:x,staleTime:1/0},e[9]=m,e[10]=g,e[11]=x,e[12]=h):h=e[12];const{data:y}=p(h),b=u==="loading",k=u!=="loading"&&u!=="error",j=Tt(),w=f?.citations;let S;e[13]!==f?(S=xa(f),e[13]=f,e[14]=S):S=e[14];const N=S,v=f?.content??y??a;let _;e[15]!==w||e[16]!==v?(_=v&&w?.length?va(v,w):v,e[15]=w,e[16]=v,e[17]=_):_=e[17];const T=_;let A;e[18]!==n?(A=n!=null&&n>0?l.jsx("span",{className:"text-2xs font-mono tabular-nums text-muted-foreground/60",children:ye(n)}):null,e[18]=n,e[19]=A):A=e[19];const P=A;if(u==="error"){let X;e[20]===Symbol.for("react.memo_cache_sentinel")?(X=l.jsx(Fe,{size:14}),e[20]=X):X=e[20];let Z;e[21]!==o?(Z=o("chat.webSearch.title"),e[21]=o,e[22]=Z):Z=e[22];let G;e[23]!==o?(G=o("chat.webSearch.failed"),e[23]=o,e[24]=G):G=e[24];let Q;return e[25]!==P||e[26]!==Z||e[27]!==G||e[28]!==N?(Q=l.jsx(Y,{icon:X,title:Z,summary:G,state:"error",usage:N,trailing:P}),e[25]=P,e[26]=Z,e[27]=G,e[28]=N,e[29]=Q):Q=e[29],Q}const E=b?"animate-pulse":"text-brand-blue";let L;e[30]!==E?(L=V(E),e[30]=E,e[31]=L):L=e[31];let I;e[32]!==L?(I=l.jsx(Fe,{size:14,className:L}),e[32]=L,e[33]=I):I=e[33];let $;e[34]!==b||e[35]!==o?($=o(b?"chat.webSearch.researching":"chat.webSearch.title"),e[34]=b,e[35]=o,e[36]=$):$=e[36];let C;e[37]!==r||e[38]!==k||e[39]!==f?.model||e[40]!==j?(C=k?(j?f?.model:void 0)??r?.query?.slice(0,60):r?.query?`"${r.query.slice(0,80)}"`:void 0,e[37]=r,e[38]=k,e[39]=f?.model,e[40]=j,e[41]=C):C=e[41];const R=b?"loading":"idle";let D;e[42]!==r?(D=r?.query&&l.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:r.query}),e[42]=r,e[43]=D):D=e[43];let B;e[44]!==T||e[45]!==t.toolCallId?(B=T?l.jsx("div",{className:"max-h-96 overflow-y-auto overflow-x-hidden rounded-lg border border-border/40 bg-muted/20 px-4 py-3 min-w-0",children:l.jsx("div",{className:"prose prose-sm prose-neutral dark:prose-invert max-w-none text-sm leading-relaxed break-words",children:l.jsx(Ct,{id:t.toolCallId,text:T})})}):l.jsx("div",{className:"rounded-lg border border-border/40 bg-muted/20 px-4 py-3",children:l.jsxs("div",{className:"space-y-2 animate-pulse",children:[l.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-3/4"}),l.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-1/2"})]})}),e[44]=T,e[45]=t.toolCallId,e[46]=B):B=e[46];let U;e[47]!==w?(U=w&&w.length>0&&l.jsx(Sa,{citations:w}),e[47]=w,e[48]=U):U=e[48];let W;e[49]!==D||e[50]!==B||e[51]!==U?(W=l.jsxs("div",{className:"pl-6 pb-3 flex flex-col gap-1 min-w-0",children:[D,B,U]}),e[49]=D,e[50]=B,e[51]=U,e[52]=W):W=e[52];let K;return e[53]!==P||e[54]!==I||e[55]!==$||e[56]!==C||e[57]!==R||e[58]!==W||e[59]!==N?(K=l.jsx(Y,{icon:I,title:$,summary:C,state:R,usage:N,trailing:P,defaultOpen:!0,children:W}),e[53]=P,e[54]=I,e[55]=$,e[56]=C,e[57]=R,e[58]=W,e[59]=N,e[60]=K):K=e[60],K}function _a(s){const e=M.c(16),{part:t}=s,n=H();if(!t.state.startsWith("output-"))return null;let a;e[0]!==t.input?.prompt||e[1]!==n?(a=t.input?.prompt?.trim()||n("chat.userAskQuestion.question"),e[0]=t.input?.prompt,e[1]=n,e[2]=a):a=e[2];const o=a,c=t.state==="output-error"||t.state==="output-denied",i=t.state==="output-denied";let u;e[3]!==i||e[4]!==t||e[5]!==n?(u=i?n("chat.userAskQuestion.skippedAnswer"):t.state==="output-error"?Ae(t)??n("chat.subtask.errorLabel"):t.output?.response??"",e[3]=i,e[4]=t,e[5]=n,e[6]=u):u=e[6];const r=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(js,{className:"size-4 text-muted-foreground/50 shrink-0 mt-0.5"}),e[7]=f):f=e[7];let d;e[8]!==o?(d=l.jsxs("div",{className:"flex items-start gap-2",children:[f,l.jsx("span",{className:"text-sm text-muted-foreground leading-snug",children:o})]}),e[8]=o,e[9]=d):d=e[9];let m;e[10]!==r||e[11]!==c?(m=r&&l.jsx("div",{className:"ml-6 pl-2 border-l border-border/50",children:l.jsx("span",{className:V("text-sm leading-snug",c?"text-muted-foreground/50 italic":"text-foreground/70"),children:r})}),e[10]=r,e[11]=c,e[12]=m):m=e[12];let p;return e[13]!==d||e[14]!==m?(p=l.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[d,m]}),e[13]=d,e[14]=m,e[15]=p):p=e[15],p}function Ta(s){const e=M.c(14),{part:t}=s,n=H();if(!t.state.startsWith("output-")||As(t))return null;const a=t.output?.accepted===!0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx(vs,{className:"size-4 text-muted-foreground/50 shrink-0 mt-0.5"}),e[0]=o):o=e[0];const c=t.input?.title;let i;e[1]!==c?(i=l.jsx("span",{className:"text-sm leading-snug text-muted-foreground",children:c}),e[1]=c,e[2]=i):i=e[2];const u=a?"text-foreground/70":"text-muted-foreground/50 italic";let r;e[3]!==u?(r=V("text-sm leading-snug shrink-0",u),e[3]=u,e[4]=r):r=e[4];let f;e[5]!==a||e[6]!==n?(f=n(a?"chat.suggestTask.accepted":"chat.suggestTask.declined"),e[5]=a,e[6]=n,e[7]=f):f=e[7];let d;e[8]!==r||e[9]!==f?(d=l.jsx("span",{className:r,children:f}),e[8]=r,e[9]=f,e[10]=d):d=e[10];let m;return e[11]!==i||e[12]!==d?(m=l.jsxs("div",{className:"my-1.5 flex items-start gap-2",children:[o,i,d]}),e[11]=i,e[12]=d,e[13]=m):m=e[13],m}const Bt=z.createContext(new Map);function bo(s){const e=M.c(5),{messages:t,children:n}=s;let a;if(e[0]!==t){a=new Map;for(const c of t){const i=c.metadata?.subtaskJobId;if(!i)continue;const u=a.get(i);u?u.push(c):a.set(i,[c])}e[0]=t,e[1]=a}else a=e[1];let o;return e[2]!==a||e[3]!==n?(o=l.jsx(Bt.Provider,{value:a,children:n}),e[2]=a,e[3]=n,e[4]=o):o=e[4],o}function Ca(s){const e=M.c(3),t=z.useContext(Bt);let n;return e[0]!==s||e[1]!==t?(n=s?t.get(s)??[]:[],e[0]=s,e[1]=t,e[2]=n):n=e[2],n}function Ia(s){return new ReadableStream({async start(e){const t=s.getReader(),n=new TextDecoder;let a="";try{for(;;){const{done:o,value:c}=await t.read();if(o)break;a+=n.decode(c,{stream:!0});let i;for(;(i=a.indexOf(`
41
+ `+Te(r)));let R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsx(ke,{size:14}),e[25]=R):R=e[25];let F;e[26]!==a?(F=a("chat.generateImage.imageGeneration"),e[26]=a,e[27]=F):F=e[27];let B;e[28]!==i||e[29]!==a?(B=a(i==="error"?"chat.generateImage.failed":"chat.generateImage.noImagesGenerated"),e[28]=i,e[29]=a,e[30]=B):B=e[30];const U=i==="error"?"error":"idle",W=C||null;let V;return e[31]!==y||e[32]!==F||e[33]!==B||e[34]!==U||e[35]!==W||e[36]!==m?(V=l.jsx(Y,{icon:R,title:F,summary:B,state:U,usage:m,trailing:y,detail:W}),e[31]=y,e[32]=F,e[33]=B,e[34]=U,e[35]=W,e[36]=m,e[37]=V):V=e[37],V}const b="flex flex-col gap-2";let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsx(ke,{size:14,className:"text-special"}),e[38]=k):k=e[38];let j;e[39]!==a?(j=a("chat.generateImage.generatedImage"),e[39]=a,e[40]=j):j=e[40];let w;e[41]!==u?(w=u?.prompt&&l.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:u.prompt}),e[41]=u,e[42]=w):w=e[42];const S=x&&x.length>0&&l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[l.jsx("span",{className:"text-2xs text-muted-foreground/50",children:a("chat.generateImage.references")}),x.map((I,$)=>{const C=I.uri??I.url;return l.jsx(fa,{uri:C,orgSlug:o.slug},$)})]});let N;e[43]!==w||e[44]!==S?(N=l.jsxs("div",{className:"flex flex-col gap-1 pb-2 pl-6",children:[w,S]}),e[43]=w,e[44]=S,e[45]=N):N=e[45];let v;e[46]!==y||e[47]!==g||e[48]!==j||e[49]!==N||e[50]!==m?(v=l.jsx(Y,{icon:k,title:j,summary:g,state:"idle",usage:m,trailing:y,children:N}),e[46]=y,e[47]=g,e[48]=j,e[49]=N,e[50]=m,e[51]=v):v=e[51];const _=Ot;let T;e[52]!==o?(T=I=>{const $=I.uri??I.url;return $?[Ft($,o.slug)]:[]},e[52]=o,e[53]=T):T=e[53];const A=f.flatMap(T);let P;e[54]!==u?.prompt||e[55]!==a?(P=u?.prompt??a("chat.generateImage.generatedImageAlt"),e[54]=u?.prompt,e[55]=a,e[56]=P):P=e[56];let E;e[57]!==_||e[58]!==A||e[59]!==P?(E=l.jsx(_,{srcs:A,alt:P}),e[57]=_,e[58]=A,e[59]=P,e[60]=E):E=e[60];let L;return e[61]!==v||e[62]!==E?(L=l.jsxs("div",{className:b,children:[v,E]}),e[61]=v,e[62]=E,e[63]=L):L=e[63],L}function pa(s){return s.uri??s.url}function ga(s,e){const t=Je(s);return t!==null?`/api/${e}/files/${t}`:s}function xa(s){if(!s?.usage)return null;const e=s.usage.inputTokens??0,t=s.usage.outputTokens??0,n=e+t;if(!n)return null;const a={providerMetadata:s.usage.providerMetadata};return{inputTokens:e,outputTokens:t,reasoningTokens:0,totalTokens:n,cost:Gs(a),cacheReadTokens:0,cacheWriteTokens:0}}function ha(s){try{return new URL(s).hostname.replace(/^www\./,"")}catch{return s}}function ba(s){try{return`${new URL(s).origin}/favicon.ico`}catch{return""}}function ya(s){const e=M.c(16),{citation:t,index:n}=s;let a;e[0]!==t.url?(a=ha(t.url),e[0]=t.url,e[1]=a):a=e[1];const o=a;let c;e[2]!==t.url?(c=ba(t.url),e[2]=t.url,e[3]=c):c=e[3];const i=c,u=t.title||o;let r;e[4]!==i?(r=l.jsx("img",{src:i,alt:"",className:"size-3.5 rounded-sm shrink-0",onError:ja}),e[4]=i,e[5]=r):r=e[5];let f;e[6]!==u?(f=l.jsx("span",{className:"truncate max-w-[180px]",children:u}),e[6]=u,e[7]=f):f=e[7];const d=n+1;let m;e[8]!==d?(m=l.jsxs("span",{className:"text-2xs text-muted-foreground/50 tabular-nums shrink-0",children:["[",d,"]"]}),e[8]=d,e[9]=m):m=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=l.jsx(rs,{size:10,className:"shrink-0 opacity-0 group-hover/src:opacity-100 transition-opacity"}),e[10]=p):p=e[10];let g;return e[11]!==t.url||e[12]!==r||e[13]!==f||e[14]!==m?(g=l.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"group/src inline-flex items-center gap-1.5 rounded-md border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent hover:border-border hover:text-foreground",children:[r,f,m,p]}),e[11]=t.url,e[12]=r,e[13]=f,e[14]=m,e[15]=g):g=e[15],g}function ja(s){s.target.style.display="none"}function va(s,e){return s.replace(/\[(\d+)\]/g,(t,n)=>{const a=parseInt(n,10)-1,o=e[a];return o?`[\\[${n}\\]](${o.url})`:t})}const Ee=5;function Sa(s){const e=M.c(13),{citations:t}=s,n=H(),[a,o]=z.useState(!1),c=t.length>Ee;let i;e[0]!==t||e[1]!==a?(i=a?t:t.slice(0,Ee),e[0]=t,e[1]=a,e[2]=i):i=e[2];const u=i;let r;e[3]!==u?(r=u.map(ka),e[3]=u,e[4]=r):r=e[4];let f;e[5]!==t.length||e[6]!==a||e[7]!==c||e[8]!==n?(f=c&&l.jsx("button",{type:"button",onClick:()=>o(Na),className:"inline-flex items-center rounded-lg border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent hover:border-border hover:text-foreground",children:a?n("chat.webSearch.showLess"):n("chat.webSearch.showMore",{count:t.length-Ee})}),e[5]=t.length,e[6]=a,e[7]=c,e[8]=n,e[9]=f):f=e[9];let d;return e[10]!==r||e[11]!==f?(d=l.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[r,f]}),e[10]=r,e[11]=f,e[12]=d):d=e[12],d}function Na(s){return!s}function ka(s,e){return l.jsx(ya,{citation:s,index:e},s.url)}function wa(s){const e=M.c(61),{part:t,latency:n,streamingText:a}=s,o=H(),c=ft();let i;e[0]!==t.state?(i=pe(t.state),e[0]=t.state,e[1]=i):i=e[1];const u=i,r=t.input,f=t.output;let d,m,p;e[2]!==c||e[3]!==f?(d=f?.uri?ga(f.uri,c.slug):void 0,p=ut,m=xe.webSearchBlob(d??""),e[2]=c,e[3]=f,e[4]=d,e[5]=m,e[6]=p):(d=e[4],m=e[5],p=e[6]);let g;e[7]!==d?(g=async()=>{const X=await fetch(d);if(!X.ok)throw new Error(`Failed to fetch: ${X.status}`);return X.text()},e[7]=d,e[8]=g):g=e[8];const x=!!d;let h;e[9]!==m||e[10]!==g||e[11]!==x?(h={queryKey:m,queryFn:g,enabled:x,staleTime:1/0},e[9]=m,e[10]=g,e[11]=x,e[12]=h):h=e[12];const{data:y}=p(h),b=u==="loading",k=u!=="loading"&&u!=="error",j=Tt(),w=f?.citations;let S;e[13]!==f?(S=xa(f),e[13]=f,e[14]=S):S=e[14];const N=S,v=f?.content??y??a;let _;e[15]!==w||e[16]!==v?(_=v&&w?.length?va(v,w):v,e[15]=w,e[16]=v,e[17]=_):_=e[17];const T=_;let A;e[18]!==n?(A=n!=null&&n>0?l.jsx("span",{className:"text-2xs font-mono tabular-nums text-muted-foreground/60",children:ye(n)}):null,e[18]=n,e[19]=A):A=e[19];const P=A;if(u==="error"){let X;e[20]===Symbol.for("react.memo_cache_sentinel")?(X=l.jsx(De,{size:14}),e[20]=X):X=e[20];let Z;e[21]!==o?(Z=o("chat.webSearch.title"),e[21]=o,e[22]=Z):Z=e[22];let K;e[23]!==o?(K=o("chat.webSearch.failed"),e[23]=o,e[24]=K):K=e[24];let Q;return e[25]!==P||e[26]!==Z||e[27]!==K||e[28]!==N?(Q=l.jsx(Y,{icon:X,title:Z,summary:K,state:"error",usage:N,trailing:P}),e[25]=P,e[26]=Z,e[27]=K,e[28]=N,e[29]=Q):Q=e[29],Q}const E=b?"animate-pulse":"text-brand-blue";let L;e[30]!==E?(L=G(E),e[30]=E,e[31]=L):L=e[31];let I;e[32]!==L?(I=l.jsx(De,{size:14,className:L}),e[32]=L,e[33]=I):I=e[33];let $;e[34]!==b||e[35]!==o?($=o(b?"chat.webSearch.researching":"chat.webSearch.title"),e[34]=b,e[35]=o,e[36]=$):$=e[36];let C;e[37]!==r||e[38]!==k||e[39]!==f?.model||e[40]!==j?(C=k?(j?f?.model:void 0)??r?.query?.slice(0,60):r?.query?`"${r.query.slice(0,80)}"`:void 0,e[37]=r,e[38]=k,e[39]=f?.model,e[40]=j,e[41]=C):C=e[41];const R=b?"loading":"idle";let F;e[42]!==r?(F=r?.query&&l.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:r.query}),e[42]=r,e[43]=F):F=e[43];let B;e[44]!==T||e[45]!==t.toolCallId?(B=T?l.jsx("div",{className:"max-h-96 overflow-y-auto overflow-x-hidden rounded-lg border border-border/40 bg-muted/20 px-4 py-3 min-w-0",children:l.jsx("div",{className:"prose prose-sm prose-neutral dark:prose-invert max-w-none text-sm leading-relaxed break-words",children:l.jsx(Ct,{id:t.toolCallId,text:T})})}):l.jsx("div",{className:"rounded-lg border border-border/40 bg-muted/20 px-4 py-3",children:l.jsxs("div",{className:"space-y-2 animate-pulse",children:[l.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-3/4"}),l.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-1/2"})]})}),e[44]=T,e[45]=t.toolCallId,e[46]=B):B=e[46];let U;e[47]!==w?(U=w&&w.length>0&&l.jsx(Sa,{citations:w}),e[47]=w,e[48]=U):U=e[48];let W;e[49]!==F||e[50]!==B||e[51]!==U?(W=l.jsxs("div",{className:"pl-6 pb-3 flex flex-col gap-1 min-w-0",children:[F,B,U]}),e[49]=F,e[50]=B,e[51]=U,e[52]=W):W=e[52];let V;return e[53]!==P||e[54]!==I||e[55]!==$||e[56]!==C||e[57]!==R||e[58]!==W||e[59]!==N?(V=l.jsx(Y,{icon:I,title:$,summary:C,state:R,usage:N,trailing:P,defaultOpen:!0,children:W}),e[53]=P,e[54]=I,e[55]=$,e[56]=C,e[57]=R,e[58]=W,e[59]=N,e[60]=V):V=e[60],V}function _a(s){const e=M.c(16),{part:t}=s,n=H();if(!t.state.startsWith("output-"))return null;let a;e[0]!==t.input?.prompt||e[1]!==n?(a=t.input?.prompt?.trim()||n("chat.userAskQuestion.question"),e[0]=t.input?.prompt,e[1]=n,e[2]=a):a=e[2];const o=a,c=t.state==="output-error"||t.state==="output-denied",i=t.state==="output-denied";let u;e[3]!==i||e[4]!==t||e[5]!==n?(u=i?n("chat.userAskQuestion.skippedAnswer"):t.state==="output-error"?Ae(t)??n("chat.subtask.errorLabel"):t.output?.response??"",e[3]=i,e[4]=t,e[5]=n,e[6]=u):u=e[6];const r=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(js,{className:"size-4 text-muted-foreground/50 shrink-0 mt-0.5"}),e[7]=f):f=e[7];let d;e[8]!==o?(d=l.jsxs("div",{className:"flex items-start gap-2",children:[f,l.jsx("span",{className:"text-sm text-muted-foreground leading-snug",children:o})]}),e[8]=o,e[9]=d):d=e[9];let m;e[10]!==r||e[11]!==c?(m=r&&l.jsx("div",{className:"ml-6 pl-2 border-l border-border/50",children:l.jsx("span",{className:G("text-sm leading-snug",c?"text-muted-foreground/50 italic":"text-foreground/70"),children:r})}),e[10]=r,e[11]=c,e[12]=m):m=e[12];let p;return e[13]!==d||e[14]!==m?(p=l.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[d,m]}),e[13]=d,e[14]=m,e[15]=p):p=e[15],p}function Ta(s){const e=M.c(14),{part:t}=s,n=H();if(!t.state.startsWith("output-")||As(t))return null;const a=t.output?.accepted===!0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx(vs,{className:"size-4 text-muted-foreground/50 shrink-0 mt-0.5"}),e[0]=o):o=e[0];const c=t.input?.title;let i;e[1]!==c?(i=l.jsx("span",{className:"text-sm leading-snug text-muted-foreground",children:c}),e[1]=c,e[2]=i):i=e[2];const u=a?"text-foreground/70":"text-muted-foreground/50 italic";let r;e[3]!==u?(r=G("text-sm leading-snug shrink-0",u),e[3]=u,e[4]=r):r=e[4];let f;e[5]!==a||e[6]!==n?(f=n(a?"chat.suggestTask.accepted":"chat.suggestTask.declined"),e[5]=a,e[6]=n,e[7]=f):f=e[7];let d;e[8]!==r||e[9]!==f?(d=l.jsx("span",{className:r,children:f}),e[8]=r,e[9]=f,e[10]=d):d=e[10];let m;return e[11]!==i||e[12]!==d?(m=l.jsxs("div",{className:"my-1.5 flex items-start gap-2",children:[o,i,d]}),e[11]=i,e[12]=d,e[13]=m):m=e[13],m}const Bt=z.createContext(new Map);function bo(s){const e=M.c(5),{messages:t,children:n}=s;let a;if(e[0]!==t){a=new Map;for(const c of t){const i=c.metadata?.subtaskJobId;if(!i)continue;const u=a.get(i);u?u.push(c):a.set(i,[c])}e[0]=t,e[1]=a}else a=e[1];let o;return e[2]!==a||e[3]!==n?(o=l.jsx(Bt.Provider,{value:a,children:n}),e[2]=a,e[3]=n,e[4]=o):o=e[4],o}function Ca(s){const e=M.c(3),t=z.useContext(Bt);let n;return e[0]!==s||e[1]!==t?(n=s?t.get(s)??[]:[],e[0]=s,e[1]=t,e[2]=n):n=e[2],n}function Ia(s){return new ReadableStream({async start(e){const t=s.getReader(),n=new TextDecoder;let a="";try{for(;;){const{done:o,value:c}=await t.read();if(o)break;a+=n.decode(c,{stream:!0});let i;for(;(i=a.indexOf(`
42
42
 
43
43
  `))!==-1;){const u=a.slice(0,i);a=a.slice(i+2);const r=u.split(`
44
44
  `).filter(f=>f.startsWith("data:")).map(f=>f.slice(5).trim()).join(`
45
45
  `);if(r)try{e.enqueue(JSON.parse(r))}catch{}}}}finally{t.releaseLock(),e.close()}}})}function $a(s){const{orgSlug:e,threadId:t,jobId:n,enabled:a}=s,[o,c]=z.useState([]),[i,u]=z.useState(!1);return z.useEffect(()=>{if(!a||!n||!t)return;const r=new AbortController;return c([]),u(!0),(async()=>{try{const f=await fetch(`/api/${encodeURIComponent(e)}/decopilot/threads/${encodeURIComponent(t)}/jobs/${encodeURIComponent(n)}/stream`,{headers:{accept:"text/event-stream"},credentials:"include",signal:r.signal});if(!f.ok||!f.body)return;for await(const d of Hs({stream:qs(Ia(f.body),void 0)})){if(r.signal.aborted)return;c([d])}}catch{}finally{r.signal.aborted||u(!1)}})(),()=>r.abort()},[a,n,t,e]),{messages:o,streaming:i}}function Ma(s,e){if(s&&typeof s=="object"&&!Array.isArray(s)){const t=s;if(typeof t.text=="string"||typeof t.error=="string"||typeof t.finishReason=="string"){if(typeof t.error=="string"&&t.error.length>0)return e("chat.subtask.failedWithError",{error:t.error});const a=typeof t.text=="string"?t.text.trim():"",o=t.finishReason==="length";return a?(o?`${e("chat.subtask.stepLimitPartial")}
46
46
 
47
- `:"")+a:e(o?"chat.subtask.stepLimitNoOutput":"chat.subtask.completedNoOutput")}}return Zn(s)}function Ut(s){return!!s&&typeof s=="object"&&s.background===!0}function Ht({part:s,subtaskMeta:e},t){const n=s.state==="input-streaming"||s.state==="input-available",a=s.state==="output-available"&&s.preliminary===!0,o=s.state==="output-available"&&!s.preliminary,c=s.state==="output-error",i=pe(s.state,"preliminary"in s?s.preliminary:!1),u=i==="approval"?"idle":i,r=t(n?"chat.subtask.startingEllipsis":a?"chat.subtask.runningEllipsis":o?"chat.subtask.completedTitle":c?"chat.subtask.failedTitle":"chat.subtask.subtaskNoun"),f=s.input?.prompt??"",d=s.state==="approval-requested"?t("chat.subtask.awaitingApproval"):f.length>120?f.slice(0,120)+"…":f;return{fallbackTitle:r,summary:d,usage:e?.usage,state:u}}function qt(s){return s.state==="input-available"?!0:s.state==="output-available"?"preliminary"in s&&s.preliminary===!0:!1}function Wt(s){const e=M.c(4),t=ve()?.taskId??null,{org:n}=me();if(!t)return null;let a;return e[0]!==n||e[1]!==t||e[2]!==s?(a=async()=>{if(t===null)return;const o=await fetch(`/api/${encodeURIComponent(n.slug)}/decopilot/flip/${encodeURIComponent(t)}`,{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({toolCallId:s})});if(!o.ok)throw new Error(`flip failed: ${o.status}`)},e[0]=n,e[1]=t,e[2]=s,e[3]=a):a=e[3],a}function Aa(s){const e=M.c(10),{onFlip:t}=s,n=H(),[a,o]=z.useState(!1);let c;e[0]!==t?(c=async f=>{f.stopPropagation(),o(!0);try{await t()}catch{o(!1)}},e[0]=t,e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=V("shrink-0 text-xs text-muted-foreground/70 px-2 py-1 rounded-lg transition-colors","[@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent","disabled:opacity-50"),e[2]=i):i=e[2];let u;e[3]!==a||e[4]!==n?(u=n(a?"chat.subtask.flipping":"chat.subtask.flipToBackground"),e[3]=a,e[4]=n,e[5]=u):u=e[5];let r;return e[6]!==a||e[7]!==c||e[8]!==u?(r=l.jsx("button",{type:"button",disabled:a,onClick:c,className:i,children:u}),e[6]=a,e[7]=c,e[8]=u,e[9]=r):r=e[9],r}function Qe(s){const e=M.c(54),{icon:t,title:n,summary:a,state:o,usage:c,latency:i,onOpenChange:u,onFlip:r,children:f}=s,[d,m]=z.useState(!1);let p;e[0]!==u?(p=K=>{m(K),u?.(K)},e[0]=u,e[1]=p):p=e[1];const g=p,x=o==="loading",h=o==="error";let y;e[2]!==g?(y=()=>g(!0),e[2]=g,e[3]=y):y=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=V("group/tool flex items-center gap-2 flex-1 min-w-0 py-2.5 text-left rounded-lg transition-colors","[@media(hover:hover)]:hover:bg-accent"),e[4]=b):b=e[4];const k=h?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75";let j;e[5]!==k?(j=V("relative shrink-0 size-4 flex items-center justify-center [&>svg]:size-4",k),e[5]=k,e[6]=j):j=e[6];let w;e[7]!==t||e[8]!==j?(w=l.jsx("div",{className:j,children:t}),e[7]=t,e[8]=j,e[9]=w):w=e[9];const S=h?"text-warning/80":"text-foreground",N=x&&"shimmer";let v;e[10]!==S||e[11]!==N?(v=V("shrink-0 text-sm font-normal",S,N),e[10]=S,e[11]=N,e[12]=v):v=e[12];let _;e[13]!==v||e[14]!==n?(_=l.jsx("span",{className:v,children:n}),e[13]=v,e[14]=n,e[15]=_):_=e[15];let T;e[16]!==x||e[17]!==a?(T=a?l.jsx("span",{className:"min-w-0 flex-1 truncate",children:l.jsx("span",{className:"text-xs text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:l.jsx("span",{className:V(x&&"shimmer"),children:a})})}):l.jsx("div",{className:"flex-1"}),e[16]=x,e[17]=a,e[18]=T):T=e[18];let A;e[19]===Symbol.for("react.memo_cache_sentinel")?(A=l.jsx(is,{className:"size-3.5 shrink-0 text-muted-foreground/40 opacity-0 transition-opacity [@media(hover:hover)]:group-hover/tool:opacity-100"}),e[19]=A):A=e[19];let P;e[20]!==i?(P=l.jsx(fe,{latency:i}),e[20]=i,e[21]=P):P=e[21];let E;e[22]!==c?(E=l.jsx(ht,{usage:c}),e[22]=c,e[23]=E):E=e[23];let L;e[24]!==_||e[25]!==T||e[26]!==P||e[27]!==E||e[28]!==y||e[29]!==w?(L=l.jsxs("button",{type:"button",onClick:y,className:b,children:[w,_,T,A,P,E]}),e[24]=_,e[25]=T,e[26]=P,e[27]=E,e[28]=y,e[29]=w,e[30]=L):L=e[30];let I;e[31]!==x||e[32]!==r?(I=r&&x?l.jsx(Aa,{onFlip:r}):null,e[31]=x,e[32]=r,e[33]=I):I=e[33];let $;e[34]!==L||e[35]!==I?($=l.jsxs("div",{className:"flex items-center gap-1 w-full",children:[L,I]}),e[34]=L,e[35]=I,e[36]=$):$=e[36];let C;e[37]!==t?(C=l.jsx("span",{className:"flex items-center [&>svg]:size-4 [&>svg]:text-muted-foreground/75",children:t}),e[37]=t,e[38]=C):C=e[38];let R;e[39]!==C||e[40]!==n?(R=l.jsx(dn,{className:"px-4 py-3 border-b border-border shrink-0",children:l.jsxs(fn,{className:"flex items-center gap-2 text-sm font-medium",children:[C,n]})}),e[39]=C,e[40]=n,e[41]=R):R=e[41];let D;e[42]!==f?(D=l.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-4 py-4",children:f}),e[42]=f,e[43]=D):D=e[43];let B;e[44]!==R||e[45]!==D?(B=l.jsxs(mn,{side:"right",className:"w-full sm:max-w-2xl flex flex-col p-0 gap-0",children:[R,D]}),e[44]=R,e[45]=D,e[46]=B):B=e[46];let U;e[47]!==d||e[48]!==g||e[49]!==B?(U=l.jsx(pn,{open:d,onOpenChange:g,children:B}),e[47]=d,e[48]=g,e[49]=B,e[50]=U):U=e[50];let W;return e[51]!==$||e[52]!==U?(W=l.jsxs(l.Fragment,{children:[$,U]}),e[51]=$,e[52]=U,e[53]=W):W=e[53],W}function Vt(s){const e=M.c(22),{part:t}=s,n=H(),a=t.state==="output-error";let o;e[0]!==t.input?.prompt||e[1]!==n?(o=t.input?.prompt??n("chat.subtask.noPromptProvided"),e[0]=t.input?.prompt,e[1]=n,e[2]=o):o=e[2];const c=o;let i;if(e[3]!==a||e[4]!==t||e[5]!==c||e[6]!==n){const u=a?Ae(t):Ma(t.output,n)??"";let r;e[8]!==n?(r=n("chat.subtask.taskLabel"),e[8]=n,e[9]=r):r=e[9];let f;e[10]!==r?(f=l.jsx("h3",{className:"text-xs font-medium text-muted-foreground/70 mb-1.5",children:r}),e[10]=r,e[11]=f):f=e[11];let d;e[12]!==c?(d=l.jsx("p",{className:"text-sm text-foreground/90 whitespace-pre-wrap wrap-break-word",children:c}),e[12]=c,e[13]=d):d=e[13];let m;e[14]!==f||e[15]!==d?(m=l.jsxs("section",{children:[f,d]}),e[14]=f,e[15]=d,e[16]=m):m=e[16];let p;e[17]!==a||e[18]!==n?(p=n(a?"chat.subtask.errorLabel":"chat.subtask.resultLabel"),e[17]=a,e[18]=n,e[19]=p):p=e[19];let g;e[20]!==p?(g=l.jsx("h3",{className:"text-xs font-medium text-muted-foreground/70 mb-1.5",children:p}),e[20]=p,e[21]=g):g=e[21],i=l.jsxs("div",{className:"flex flex-col gap-4",children:[m,l.jsxs("section",{children:[g,u.trim()?l.jsx(Ct,{id:`${t.toolCallId}-result`,text:u}):l.jsx("p",{className:"text-sm text-muted-foreground/60 italic",children:n("chat.subtask.running")})]})]}),e[3]=a,e[4]=t,e[5]=c,e[6]=n,e[7]=i}else i=e[7];return i}const Re=600;function Pa(s){const e=M.c(12),{part:t}=s,n=t.type??"";let a;e[0]!==t.toolName||e[1]!==n?(a=n==="dynamic-tool"?t.toolName??"tool":n.slice(5),e[0]=t.toolName,e[1]=n,e[2]=a):a=e[2];const o=a;let c;if(e[3]!==t.input){const m=t.input!=null?JSON.stringify(t.input):"";c=m.length>80?`${m.slice(0,80)}…`:m||void 0,e[3]=t.input,e[4]=c}else c=e[4];const i=c;let u;if(e[5]!==t.input){const m=t.input!=null?JSON.stringify(t.input,null,2):null;u=m&&m.length>Re?`${m.slice(0,Re)}
48
- … (${m.length-Re} more characters)`:m,e[5]=t.input,e[6]=u}else u=e[6];const r=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(pt,{}),e[7]=f):f=e[7];let d;return e[8]!==r||e[9]!==o||e[10]!==i?(d=l.jsx(Y,{icon:f,title:o,summary:i,state:"idle",detail:r,detailVariant:"code"}),e[8]=r,e[9]=o,e[10]=i,e[11]=d):d=e[11],d}function La(s){const e=M.c(19),{jobId:t,prompt:n,items:a,streaming:o}=s,c=H();let i;e[0]!==c?(i=c("chat.subtask.taskLabel"),e[0]=c,e[1]=i):i=e[1];let u;e[2]!==i?(u=l.jsx("h3",{className:"text-xs font-medium text-muted-foreground/70 mb-1.5",children:i}),e[2]=i,e[3]=u):u=e[3];let r;e[4]!==n?(r=l.jsx("p",{className:"text-sm text-foreground/90 whitespace-pre-wrap wrap-break-word",children:n}),e[4]=n,e[5]=r):r=e[5];let f;e[6]!==u||e[7]!==r?(f=l.jsxs("section",{children:[u,r]}),e[6]=u,e[7]=r,e[8]=f):f=e[8];let d;e[9]!==a||e[10]!==t||e[11]!==o||e[12]!==c?(d=a.length===0?l.jsx("p",{className:"text-sm text-muted-foreground/60 italic py-1",children:c("chat.subtask.runningInBackground")}):a.map((g,x)=>{const h=g,y=h.type??"";return y==="text"?h.text?.trim()?l.jsx(Ie,{id:`${t}-sub-${x}`,part:g,animate:o},`${t}-sub-${x}`):null:y==="dynamic-tool"||y.startsWith("tool-")&&y!=="tool-todo_write"&&y!=="tool-update_interests"?l.jsx(Pa,{part:h},`${t}-sub-${x}`):null}),e[9]=a,e[10]=t,e[11]=o,e[12]=c,e[13]=d):d=e[13];let m;e[14]!==d?(m=l.jsx("section",{className:"flex flex-col gap-3 sm:gap-2",children:d}),e[14]=d,e[15]=m):m=e[15];let p;return e[16]!==f||e[17]!==m?(p=l.jsxs("div",{className:"flex flex-col gap-4",children:[f,m]}),e[16]=f,e[17]=m,e[18]=p):p=e[18],p}function Gt(s){const e=M.c(32),{part:t}=s,n=H(),a=t.output?.jobId,o=ve()?.taskId??null,{org:c}=me(),[i,u]=z.useState(!1),r=Ca(a),f=o??"",d=i&&!!o;let m;e[0]!==a||e[1]!==c.slug||e[2]!==f||e[3]!==d?(m={orgSlug:c.slug,threadId:f,jobId:a,enabled:d},e[0]=a,e[1]=c.slug,e[2]=f,e[3]=d,e[4]=m):m=e[4];const p=$a(m);let g;e[5]!==p.messages?(g=p.messages.flatMap(Ra),e[5]=p.messages,e[6]=g):g=e[6];const x=g;let h;e[7]!==r?(h=r.flatMap(Ea),e[7]=r,e[8]=h):h=e[8];const y=h,b=x.length>0?x:y;let k;e[9]!==t.input?.prompt||e[10]!==n?(k=t.input?.prompt??n("chat.subtask.noPromptProvided"),e[9]=t.input?.prompt,e[10]=n,e[11]=k):k=e[11];const j=k;let w;e[12]!==j?(w=j.length>120?`${j.slice(0,120)}…`:j,e[12]=j,e[13]=w):w=e[13];const S=w,N=r.length===0;let v;e[14]!==n?(v=n("chat.subtask.subtaskNoun"),e[14]=n,e[15]=v):v=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=l.jsx(He,{}),e[16]=_):_=e[16];let T;e[17]!==v?(T=l.jsx(Se,{icon:void 0,name:v,size:"2xs",className:"rounded-xs",fallbackIcon:_}),e[17]=v,e[18]=T):T=e[18];let A;e[19]!==n?(A=n("chat.subtask.subtaskNoun"),e[19]=n,e[20]=A):A=e[20];const P=N?"loading":"idle",E=p.streaming||N;let L;e[21]!==b||e[22]!==a||e[23]!==j||e[24]!==E?(L=l.jsx(La,{jobId:a,prompt:j,items:b,streaming:E}),e[21]=b,e[22]=a,e[23]=j,e[24]=E,e[25]=L):L=e[25];let I;return e[26]!==S||e[27]!==T||e[28]!==A||e[29]!==P||e[30]!==L?(I=l.jsx(Qe,{icon:T,title:A,summary:S,state:P,onOpenChange:u,children:L}),e[26]=S,e[27]=T,e[28]=A,e[29]=P,e[30]=L,e[31]=I):I=e[31],I}function Ea(s){return s.parts??[]}function Ra(s){return s.parts??[]}function za(s){const e=M.c(24),t=H(),n=Wt(s.part.toolCallId);if(Ut(s.part.output)){let x;return e[0]!==s?(x=l.jsx(Gt,{...s}),e[0]=s,e[1]=x):x=e[1],x}let a;e[2]!==s||e[3]!==t?(a=Ht(s,t),e[2]=s,e[3]=t,e[4]=a):a=e[4];const{fallbackTitle:o,summary:c,usage:i,state:u}=a;let r;e[5]!==t?(r=t("chat.subtask.subtaskNoun"),e[5]=t,e[6]=r):r=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(He,{}),e[7]=f):f=e[7];let d;e[8]!==r?(d=l.jsx(Se,{icon:void 0,name:r,size:"2xs",className:"rounded-xs",fallbackIcon:f}),e[8]=r,e[9]=d):d=e[9];let m;e[10]!==n||e[11]!==s.part?(m=n&&qt(s.part)?n:void 0,e[10]=n,e[11]=s.part,e[12]=m):m=e[12];let p;e[13]!==s.part?(p=l.jsx(Vt,{part:s.part}),e[13]=s.part,e[14]=p):p=e[14];let g;return e[15]!==o||e[16]!==s.latency||e[17]!==u||e[18]!==c||e[19]!==d||e[20]!==m||e[21]!==p||e[22]!==i?(g=l.jsx(Qe,{icon:d,title:o,summary:c,state:u,usage:i,latency:s.latency,onFlip:m,children:p}),e[15]=o,e[16]=s.latency,e[17]=u,e[18]=c,e[19]=d,e[20]=m,e[21]=p,e[22]=i,e[23]=g):g=e[23],g}function Fa(s){const e=M.c(26),t=H(),n=It(s.part.input?.agent_id),a=Wt(s.part.toolCallId);if(Ut(s.part.output)){let b;return e[0]!==s?(b=l.jsx(Gt,{...s}),e[0]=s,e[1]=b):b=e[1],b}let o;e[2]!==s||e[3]!==t?(o=Ht(s,t),e[2]=s,e[3]=t,e[4]=o):o=e[4];const{fallbackTitle:c,summary:i,usage:u,state:r}=o,f=n?.icon;let d;e[5]!==t||e[6]!==n?.title?(d=n?.title??t("chat.subtask.subtaskNoun"),e[5]=t,e[6]=n?.title,e[7]=d):d=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=l.jsx(He,{}),e[8]=m):m=e[8];let p;e[9]!==f||e[10]!==d?(p=l.jsx(Se,{icon:f,name:d,size:"2xs",className:"rounded-xs",fallbackIcon:m}),e[9]=f,e[10]=d,e[11]=p):p=e[11];const g=n?.title??c;let x;e[12]!==a||e[13]!==s.part?(x=a&&qt(s.part)?a:void 0,e[12]=a,e[13]=s.part,e[14]=x):x=e[14];let h;e[15]!==s.part?(h=l.jsx(Vt,{part:s.part}),e[15]=s.part,e[16]=h):h=e[16];let y;return e[17]!==s.latency||e[18]!==r||e[19]!==i||e[20]!==p||e[21]!==g||e[22]!==x||e[23]!==h||e[24]!==u?(y=l.jsx(Qe,{icon:p,title:g,summary:i,state:r,usage:u,latency:s.latency,onFlip:x,children:h}),e[17]=s.latency,e[18]=r,e[19]=i,e[20]=p,e[21]=g,e[22]=x,e[23]=h,e[24]=u,e[25]=y):y=e[25],y}function Da(s){const e=M.c(28),{part:t}=s,n=H();if(!t.state.startsWith("output-"))return null;const a=t.input?.plan??"",c=t.output?.approved===!0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx(De,{className:"size-4 text-special shrink-0"}),e[0]=i):i=e[0];let u;e[1]!==n?(u=n("chat.proposePlan.implementationPlan"),e[1]=n,e[2]=u):u=e[2];let r;e[3]!==u?(r=l.jsx("span",{className:"text-sm font-medium text-foreground/80",children:u}),e[3]=u,e[4]=r):r=e[4];let f;e[5]!==c||e[6]!==n?(f=c&&l.jsxs("span",{className:"flex items-center gap-1 text-xs text-success bg-success/10 px-1.5 py-0.5 rounded-md",children:[l.jsx(ct,{size:12}),n("chat.proposePlan.approved")]}),e[5]=c,e[6]=n,e[7]=f):f=e[7];let d;e[8]!==c||e[9]!==t.state||e[10]!==n?(d=!c&&t.state==="output-available"&&l.jsx("span",{className:"text-xs text-muted-foreground/70 italic",children:n("chat.proposePlan.rejected")}),e[8]=c,e[9]=t.state,e[10]=n,e[11]=d):d=e[11];let m;e[12]!==r||e[13]!==f||e[14]!==d?(m=l.jsxs("div",{className:"flex items-center gap-2",children:[i,r,f,d]}),e[12]=r,e[13]=f,e[14]=d,e[15]=m):m=e[15];let p;e[16]!==n?(p=n("chat.proposePlan.viewPlan"),e[16]=n,e[17]=p):p=e[17];let g;e[18]!==p?(g=l.jsx("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:p}),e[18]=p,e[19]=g):g=e[19];let x;e[20]!==a?(x=l.jsx("div",{className:"mt-1 pl-2 border-l-2 border-special/30 prose prose-sm max-w-none text-sm",children:l.jsx(Ie,{id:"plan-content",part:{type:"text",text:a}})}),e[20]=a,e[21]=x):x=e[21];let h;e[22]!==g||e[23]!==x?(h=l.jsxs("details",{className:"ml-6",children:[g,x]}),e[22]=g,e[23]=x,e[24]=h):h=e[24];let y;return e[25]!==h||e[26]!==m?(y=l.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[m,h]}),e[25]=h,e[26]=m,e[27]=y):y=e[27],y}function Ue(s){const e=M.c(4),{connection_id:t,iconSize:n}=s,a=n===void 0?"xs":n,o=It(t);if(!o)return null;let c;return e[0]!==o.icon||e[1]!==o.title||e[2]!==a?(c=l.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:l.jsx(Se,{icon:o.icon,name:o.title,size:a})}),e[0]=o.icon,e[1]=o.title,e[2]=a,e[3]=c):c=e[3],c}Ue.Fallback=function({iconSize:e="xs"}){const t=e==="sm"?"size-6":"size-5";return l.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:l.jsx("div",{className:V(t,"rounded bg-muted animate-pulse")})})};function he(s){const e=M.c(18),{connectionIds:t,maxVisibleIcons:n,iconSize:a,className:o}=s,c=n===void 0?2:n,i=a===void 0?"xs":a;if(t.length===0)return null;let u,r,f;if(e[0]!==o||e[1]!==t||e[2]!==i||e[3]!==c){const p=t.slice(0,c);u=t.length-c,e[7]!==o?(r=V("flex items-center justify-end -space-x-2",o),e[7]=o,e[8]=r):r=e[8];let g;e[9]!==i?(g=x=>l.jsx(z.Suspense,{fallback:l.jsx(Ue.Fallback,{iconSize:i}),children:l.jsx(Ue,{connection_id:x,iconSize:i})},x),e[9]=i,e[10]=g):g=e[10],f=p.map(g),e[0]=o,e[1]=t,e[2]=i,e[3]=c,e[4]=u,e[5]=r,e[6]=f}else u=e[4],r=e[5],f=e[6];let d;e[11]!==i||e[12]!==u?(d=u>0&&l.jsx("div",{className:V("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",i==="sm"?"size-8":"size-6"),children:l.jsxs("span",{className:V(i==="sm"?"text-sm":"text-xs","font-medium text-muted-foreground"),"aria-label":`and ${u} more`,children:["+",u]})}),e[11]=i,e[12]=u,e[13]=d):d=e[13];let m;return e[14]!==r||e[15]!==f||e[16]!==d?(m=l.jsxs("div",{className:r,children:[f,d]}),e[14]=r,e[15]=f,e[16]=d,e[17]=m):m=e[17],m}he.Fallback=function({maxVisibleIcons:e=2,totalCount:t,iconSize:n="xs"}){const a=n==="sm"?"size-6":"size-5",o=n==="sm"?"size-8":"size-6",c=t!==void 0&&t>e;return l.jsxs("div",{className:"flex items-center -space-x-2",children:[Array.from({length:e}).map((i,u)=>l.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:l.jsx("div",{className:V(a,"rounded bg-muted animate-pulse")})},u)),c&&l.jsx("div",{className:V("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",o),children:l.jsx("div",{className:V(n==="sm"?"h-3.5 w-5":"h-3 w-4","rounded bg-muted animate-pulse")})})]})};const Oa="This document certifies that the bearer agent has been granted authorized access to the tools and capabilities described herein. The agent is permitted to operate within the scope defined by its instructions and shall act in accordance with the constraints set forth by the issuing organization. This credential remains valid for the duration of the agent's active status. Unauthorized modification of this agent's permissions or scope is prohibited. The issuing authority reserves the right to revoke access at any time. All actions performed by this agent are subject to audit and review by the organization administrator. ",it=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)"):null;function Ba(s){const e=M.c(105),{part:t,latency:n}=s,a=H(),o=$t(),c=pe(t.state),i=z.useRef(null),u=z.useRef(null),r=z.useRef(null),f=z.useRef(null),d=z.useRef(null);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{it?.matches||(d.current=i.current?.getBoundingClientRect()??null,i.current&&(i.current.style.willChange="transform"))},e[0]=m):m=e[0];const p=m;let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=F=>{if(it?.matches)return;const O=d.current,q=i.current;if(!O||!q)return;const ae=(F.clientX-O.left)/O.width*100,le=(F.clientY-O.top)/O.height*100;q.style.transform=`perspective(800px) rotateY(${(ae-50)*.05}deg) rotateX(${(le-50)*-.05}deg)`,u.current&&(u.current.style.opacity="1",u.current.style.transform=`translate(${(ae-50)*.15}px, ${(le-50)*.15}px)`),r.current&&(r.current.style.opacity="0.45"),f.current&&(f.current.style.opacity="0.45")},e[1]=g):g=e[1];const x=g;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{const F=i.current;F&&(F.style.transform="none",F.style.willChange="auto"),u.current&&(u.current.style.opacity="0.4",u.current.style.transform="translate(0, 0)"),r.current&&(r.current.style.opacity="0.3"),f.current&&(f.current.style.opacity="0.3"),d.current=null},e[2]=h):h=e[2];const y=h;if(c==="loading"){let F;e[3]===Symbol.for("react.memo_cache_sentinel")?(F=l.jsx(de,{className:"animate-pulse"}),e[3]=F):F=e[3];let O;e[4]!==a?(O=a("chat.agentCreate.creating"),e[4]=a,e[5]=O):O=e[5];let q;return e[6]!==O?(q=l.jsx(Y,{icon:F,title:O,state:"loading",defaultOpen:!0}),e[6]=O,e[7]=q):q=e[7],q}if(c==="approval"){let F;e[8]===Symbol.for("react.memo_cache_sentinel")?(F=l.jsx(de,{}),e[8]=F):F=e[8];let O;e[9]!==a?(O=a("chat.agentCreate.createAgent"),e[9]=a,e[10]=O):O=e[10];let q;return e[11]!==O?(q=l.jsx(Y,{icon:F,title:O,state:"idle"}),e[11]=O,e[12]=q):q=e[12],q}if(c==="error"){let F;e[13]===Symbol.for("react.memo_cache_sentinel")?(F=l.jsx(de,{}),e[13]=F):F=e[13];let O;e[14]!==t.state||e[15]!==a?(O=t.state==="output-denied"?a("chat.agentCreate.cancelled"):a("chat.agentCreate.couldntCreate"),e[14]=t.state,e[15]=a,e[16]=O):O=e[16];let q;e[17]!==n?(q=l.jsx(fe,{latency:n}),e[17]=n,e[18]=q):q=e[18];let ae;return e[19]!==O||e[20]!==q?(ae=l.jsx(Y,{icon:F,title:O,state:"error",trailing:q}),e[19]=O,e[20]=q,e[21]=ae):ae=e[21],ae}let b,k,j,w,S,N,v,_,T,A,P,E,L,I,$,C,R,D,B,U,W,K,X;if(e[22]!==n||e[23]!==o||e[24]!==t.output||e[25]!==a){R=Symbol.for("react.early_return_sentinel");e:{const F=Ge(t.output)?.item;if(!F?.id||!F?.title){let ie;e[49]===Symbol.for("react.memo_cache_sentinel")?(ie=l.jsx(de,{}),e[49]=ie):ie=e[49];let ce;e[50]!==a?(ce=a("chat.agentCreate.created"),e[50]=a,e[51]=ce):ce=e[51];let J;e[52]!==n?(J=l.jsx(fe,{latency:n}),e[52]=n,e[53]=J):J=e[53];let te;e[54]!==ce||e[55]!==J?(te=l.jsx(Y,{icon:ie,title:ce,state:"idle",trailing:J}),e[54]=ce,e[55]=J,e[56]=te):te=e[56],R=te;break e}const O=(F.connections??[]).map(Ua);let q;e[57]===Symbol.for("react.memo_cache_sentinel")?(q=l.jsx(de,{className:"text-success"}),e[57]=q):q=e[57];let ae;e[58]!==n?(ae=l.jsx(fe,{latency:n}),e[58]=n,e[59]=ae):ae=e[59],C=l.jsx(Y,{icon:q,title:a("chat.agentCreate.agentCreated",{name:F.title}),state:"idle",trailing:ae}),$="mt-2 overflow-hidden surface p-2.5",j=i,w="relative overflow-hidden rounded-lg bg-accent/25 p-2",e[60]===Symbol.for("react.memo_cache_sentinel")?(S={transition:"transform 0.3s ease-out"},e[60]=S):S=e[60],N=p,v=x,_=y,e[61]===Symbol.for("react.memo_cache_sentinel")?(T=l.jsx("div",{ref:u,className:"pointer-events-none absolute inset-[-20%] z-[1] select-none rounded-lg",style:{background:"linear-gradient(135deg, hsla(280, 60%, 80%, 0.35) 0%, transparent 35%), linear-gradient(315deg, hsla(190, 70%, 80%, 0.35) 0%, transparent 35%), linear-gradient(225deg, hsla(140, 55%, 80%, 0.3) 0%, transparent 30%), linear-gradient(45deg, hsla(320, 55%, 82%, 0.3) 0%, transparent 30%)",opacity:.4,transition:"opacity 0.3s ease, transform 0.3s ease-out"},"aria-hidden":"true"}),e[61]=T):T=e[61];let le;e[62]===Symbol.for("react.memo_cache_sentinel")?(le={textAlign:"justify",wordBreak:"break-all"},e[62]=le):le=e[62],e[63]===Symbol.for("react.memo_cache_sentinel")?(A=l.jsx("p",{className:"pointer-events-none absolute inset-0 z-[1] select-none overflow-hidden text-[6px] font-light leading-[1.5] tracking-[0.06px] text-background opacity-50 mix-blend-overlay",style:le,"aria-hidden":"true",children:Oa.repeat(6)}),P=l.jsx("img",{src:"/stamp.svg",alt:"",className:"pointer-events-none absolute -right-10 -top-10 size-[140px] opacity-50 select-none","aria-hidden":"true"}),e[63]=A,e[64]=P):(A=e[63],P=e[64]),e[65]===Symbol.for("react.memo_cache_sentinel")?(E=l.jsx("img",{ref:r,src:"/left-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 left-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[65]=E):E=e[65],e[66]===Symbol.for("react.memo_cache_sentinel")?(L=l.jsx("img",{ref:f,src:"/right-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 right-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[66]=L):L=e[66],I=l.jsxs("div",{className:"relative",children:[l.jsxs("div",{className:"flex items-center gap-2.5 p-2",children:[l.jsx(gt,{icon:F.icon,name:F.title,size:"md"}),l.jsx("div",{className:"flex-1 min-w-0",children:l.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:F.title})})]}),F.description&&l.jsx("div",{className:"px-2 pt-1 pr-16",children:l.jsx("p",{className:"text-sm leading-snug text-muted-foreground line-clamp-2",children:F.description})})]}),X="relative z-[3] flex items-center gap-2.5 px-2 pt-6 pb-1";const ue=O.length>0&&l.jsx(z.Suspense,{fallback:l.jsx(he.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:O.length}),children:l.jsx(he,{connectionIds:O,iconSize:"xs",maxVisibleIcons:3,className:"flex items-center justify-start -space-x-1"})});e[67]!==ue?(k=l.jsx("div",{className:"flex-1 min-w-0",children:ue}),e[67]=ue,e[68]=k):k=e[68],K="flex items-center gap-2 shrink-0",b=be,D="sm",B="h-7",U=()=>o(F.id),W=a("chat.agentCreate.seeAgentLabel",{name:F.title})}e[22]=n,e[23]=o,e[24]=t.output,e[25]=a,e[26]=b,e[27]=k,e[28]=j,e[29]=w,e[30]=S,e[31]=N,e[32]=v,e[33]=_,e[34]=T,e[35]=A,e[36]=P,e[37]=E,e[38]=L,e[39]=I,e[40]=$,e[41]=C,e[42]=R,e[43]=D,e[44]=B,e[45]=U,e[46]=W,e[47]=K,e[48]=X}else b=e[26],k=e[27],j=e[28],w=e[29],S=e[30],N=e[31],v=e[32],_=e[33],T=e[34],A=e[35],P=e[36],E=e[37],L=e[38],I=e[39],$=e[40],C=e[41],R=e[42],D=e[43],B=e[44],U=e[45],W=e[46],K=e[47],X=e[48];if(R!==Symbol.for("react.early_return_sentinel"))return R;let Z;e[69]!==a?(Z=a("chat.agentCreate.seeAgent"),e[69]=a,e[70]=Z):Z=e[70];let G;e[71]!==b||e[72]!==Z||e[73]!==D||e[74]!==B||e[75]!==U||e[76]!==W?(G=l.jsx(b,{size:D,className:B,onClick:U,"aria-label":W,children:Z}),e[71]=b,e[72]=Z,e[73]=D,e[74]=B,e[75]=U,e[76]=W,e[77]=G):G=e[77];let Q;e[78]!==G||e[79]!==K?(Q=l.jsx("div",{className:K,children:G}),e[78]=G,e[79]=K,e[80]=Q):Q=e[80];let ne;e[81]!==k||e[82]!==Q||e[83]!==X?(ne=l.jsxs("div",{className:X,children:[k,Q]}),e[81]=k,e[82]=Q,e[83]=X,e[84]=ne):ne=e[84];let oe;e[85]!==j||e[86]!==w||e[87]!==S||e[88]!==N||e[89]!==v||e[90]!==_||e[91]!==T||e[92]!==A||e[93]!==P||e[94]!==E||e[95]!==L||e[96]!==I||e[97]!==ne?(oe=l.jsxs("div",{ref:j,className:w,style:S,onMouseEnter:N,onMouseMove:v,onMouseLeave:_,children:[T,A,P,E,L,I,ne]}),e[85]=j,e[86]=w,e[87]=S,e[88]=N,e[89]=v,e[90]=_,e[91]=T,e[92]=A,e[93]=P,e[94]=E,e[95]=L,e[96]=I,e[97]=ne,e[98]=oe):oe=e[98];let ee;e[99]!==$||e[100]!==oe?(ee=l.jsx("div",{className:$,children:oe}),e[99]=$,e[100]=oe,e[101]=ee):ee=e[101];let re;return e[102]!==C||e[103]!==ee?(re=l.jsxs(l.Fragment,{children:[C,ee]}),e[102]=C,e[103]=ee,e[104]=re):re=e[104],re}function Ua(s){return s.connection_id}function Ha(s){const e=M.c(24),{agent:t}=s,n=$t();if(!t.id)return null;let a;e[0]!==t.connections?(a=t.connections??[],e[0]=t.connections,e[1]=a):a=e[1];let o;e[2]!==a?(o=a.map(qa),e[2]=a,e[3]=o):o=e[3];const c=o;let i;e[4]!==t.id||e[5]!==n?(i=()=>n(t.id),e[4]=t.id,e[5]=n,e[6]=i):i=e[6];let u;e[7]!==t.icon||e[8]!==t.title?(u=l.jsx(gt,{icon:t.icon,name:t.title,size:"sm"}),e[7]=t.icon,e[8]=t.title,e[9]=u):u=e[9];let r;e[10]!==t.title?(r=l.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[10]=t.title,e[11]=r):r=e[11];let f;e[12]!==t.description?(f=t.description&&l.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[12]=t.description,e[13]=f):f=e[13];let d;e[14]!==r||e[15]!==f?(d=l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r,f]}),e[14]=r,e[15]=f,e[16]=d):d=e[16];let m;e[17]!==c?(m=c.length>0&&l.jsx(z.Suspense,{fallback:l.jsx(he.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:c.length}),children:l.jsx(he,{connectionIds:c,iconSize:"xs",maxVisibleIcons:3})}),e[17]=c,e[18]=m):m=e[18];let p;return e[19]!==i||e[20]!==u||e[21]!==d||e[22]!==m?(p=l.jsxs("button",{type:"button",onClick:i,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-accent cursor-pointer",children:[u,d,m]}),e[19]=i,e[20]=u,e[21]=d,e[22]=m,e[23]=p):p=e[23],p}function qa(s){return s.connection_id}function Wa(s){const e=M.c(59),{part:t,latency:n}=s,a=H(),o=qe(),{org:c}=me();let i;e[0]!==t.state?(i=pe(t.state),e[0]=t.state,e[1]=i):i=e[1];const u=i;let r,f,d,m,p,g;if(e[2]!==n||e[3]!==t.output||e[4]!==t.state||e[5]!==u||e[6]!==a){g=Symbol.for("react.early_return_sentinel");e:{const b=Ge(t.output);if(f=Array.isArray(b?.items)?b.items:[],u==="loading"){let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(de,{className:"animate-pulse"}),e[13]=S):S=e[13];let N;e[14]!==a?(N=a("chat.agentList.loading"),e[14]=a,e[15]=N):N=e[15];let v;e[16]!==N?(v=l.jsx(Y,{icon:S,title:N,state:"loading"}),e[16]=N,e[17]=v):v=e[17],g=v;break e}if(u==="approval"){let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(de,{}),e[18]=S):S=e[18];let N;e[19]!==a?(N=a("chat.agentList.listAgents"),e[19]=a,e[20]=N):N=e[20];let v;e[21]!==N?(v=l.jsx(Y,{icon:S,title:N,state:"idle"}),e[21]=N,e[22]=v):v=e[22],g=v;break e}if(u==="error"){let S;e[23]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(de,{}),e[23]=S):S=e[23];let N;e[24]!==t.state||e[25]!==a?(N=t.state==="output-denied"?a("chat.agentList.unavailable"):a("chat.agentList.couldntLoad"),e[24]=t.state,e[25]=a,e[26]=N):N=e[26];let v;e[27]!==n?(v=l.jsx(fe,{latency:n}),e[27]=n,e[28]=v):v=e[28];let _;e[29]!==N||e[30]!==v?(_=l.jsx(Y,{icon:S,title:N,state:"error",trailing:v}),e[29]=N,e[30]=v,e[31]=_):_=e[31],g=_;break e}if(f.length===0){let S;e[32]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(de,{}),e[32]=S):S=e[32];let N;e[33]!==a?(N=a("chat.agentList.noAgents"),e[33]=a,e[34]=N):N=e[34];let v;e[35]!==a?(v=a("chat.agentList.noAgentsDesc"),e[35]=a,e[36]=v):v=e[36];let _;e[37]!==n?(_=l.jsx(fe,{latency:n}),e[37]=n,e[38]=_):_=e[38];let T;e[39]!==N||e[40]!==v||e[41]!==_?(T=l.jsx(Y,{icon:S,title:N,summary:v,state:"idle",trailing:_}),e[39]=N,e[40]=v,e[41]=_,e[42]=T):T=e[42],g=T;break e}const k=f.slice(0,At);r=f.length-k.length;let j;e[43]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx(de,{className:"text-success"}),e[43]=j):j=e[43];let w;e[44]!==n?(w=l.jsx(fe,{latency:n}),e[44]=n,e[45]=w):w=e[45],p=l.jsx(Y,{icon:j,title:f.length===1?a("chat.agentList.oneAgent"):a("chat.agentList.multiAgents",{count:f.length}),state:"idle",trailing:w}),d="mt-2 flex flex-col gap-1.5",m=k.map(Va)}e[2]=n,e[3]=t.output,e[4]=t.state,e[5]=u,e[6]=a,e[7]=r,e[8]=f,e[9]=d,e[10]=m,e[11]=p,e[12]=g}else r=e[7],f=e[8],d=e[9],m=e[10],p=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let x;e[46]!==r||e[47]!==f||e[48]!==o||e[49]!==c||e[50]!==a?(x=r>0&&l.jsx(Pt,{count:f.length,noun:a("chat.agentList.agentsNoun"),onClick:()=>o({to:"/$org/settings/projects",params:{org:c.slug}})}),e[46]=r,e[47]=f,e[48]=o,e[49]=c,e[50]=a,e[51]=x):x=e[51];let h;e[52]!==d||e[53]!==m||e[54]!==x?(h=l.jsxs("div",{className:d,children:[m,x]}),e[52]=d,e[53]=m,e[54]=x,e[55]=h):h=e[55];let y;return e[56]!==p||e[57]!==h?(y=l.jsxs(l.Fragment,{children:[p,h]}),e[56]=p,e[57]=h,e[58]=y):y=e[58],y}function Va(s){return l.jsx(Ha,{agent:s},s.id)}const Ga={active:"bg-success",inactive:"bg-muted-foreground",error:"bg-destructive"};function Ka(s){const e=M.c(27),{connection:t}=s,n=qe(),{org:a}=me(),o=t.slug,c=t.description||t.app_name,i=!o||void 0;let u;e[0]!==n||e[1]!==a||e[2]!==o?(u=()=>o&&n({to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:o}}),e[0]=n,e[1]=a,e[2]=o,e[3]=u):u=e[3];let r;e[4]!==t.icon||e[5]!==t.title?(r=l.jsx(Se,{icon:t.icon,name:t.title,size:"sm"}),e[4]=t.icon,e[5]=t.title,e[6]=r):r=e[6];let f;e[7]!==t.title?(f=l.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[7]=t.title,e[8]=f):f=e[8];let d;e[9]!==c?(d=c&&l.jsx("span",{className:"truncate text-xs text-muted-foreground",children:c}),e[9]=c,e[10]=d):d=e[10];let m;e[11]!==f||e[12]!==d?(m=l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[f,d]}),e[11]=f,e[12]=d,e[13]=m):m=e[13];const p=Ga[t.status]??"bg-muted-foreground";let g;e[14]!==p?(g=V("size-2 shrink-0 rounded-full",p),e[14]=p,e[15]=g):g=e[15];let x;e[16]!==g?(x=l.jsx("span",{className:g,"aria-hidden":"true"}),e[16]=g,e[17]=x):x=e[17];let h;e[18]!==t.status?(h=l.jsx("span",{className:"sr-only",children:t.status}),e[18]=t.status,e[19]=h):h=e[19];let y;return e[20]!==i||e[21]!==h||e[22]!==u||e[23]!==r||e[24]!==m||e[25]!==x?(y=l.jsxs("button",{type:"button","aria-disabled":i,onClick:u,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-accent cursor-pointer aria-disabled:cursor-default aria-disabled:hover:bg-card",children:[r,m,x,h]}),e[20]=i,e[21]=h,e[22]=u,e[23]=r,e[24]=m,e[25]=x,e[26]=y):y=e[26],y}function Ja(s){const e=M.c(54),{part:t,latency:n}=s,a=H(),o=qe(),{org:c}=me();let i;e[0]!==t.state?(i=pe(t.state),e[0]=t.state,e[1]=i):i=e[1];const u=i;let r,f,d,m,p,g;if(e[2]!==n||e[3]!==t.output||e[4]!==t.state||e[5]!==u||e[6]!==a){g=Symbol.for("react.early_return_sentinel");e:{const b=Ge(t.output);if(f=(Array.isArray(b?.items)?b.items:[]).filter(Xa),u==="loading"||u==="approval"){let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(we,{className:"animate-pulse"}),e[13]=S):S=e[13];let N;e[14]!==a?(N=a("chat.connectionList.loadingTitle"),e[14]=a,e[15]=N):N=e[15];let v;e[16]!==N?(v=l.jsx(Y,{icon:S,title:N,state:"loading"}),e[16]=N,e[17]=v):v=e[17],g=v;break e}if(u==="error"){let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(we,{}),e[18]=S):S=e[18];let N;e[19]!==t.state||e[20]!==a?(N=t.state==="output-denied"?a("chat.connectionList.unavailableTitle"):a("chat.connectionList.errorTitle"),e[19]=t.state,e[20]=a,e[21]=N):N=e[21];let v;e[22]!==n?(v=l.jsx(fe,{latency:n}),e[22]=n,e[23]=v):v=e[23];let _;e[24]!==N||e[25]!==v?(_=l.jsx(Y,{icon:S,title:N,state:"error",trailing:v}),e[24]=N,e[25]=v,e[26]=_):_=e[26],g=_;break e}if(f.length===0){let S;e[27]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(we,{}),e[27]=S):S=e[27];let N;e[28]!==a?(N=a("chat.connectionList.emptyTitle"),e[28]=a,e[29]=N):N=e[29];let v;e[30]!==a?(v=a("chat.connectionList.emptySummary"),e[30]=a,e[31]=v):v=e[31];let _;e[32]!==n?(_=l.jsx(fe,{latency:n}),e[32]=n,e[33]=_):_=e[33];let T;e[34]!==N||e[35]!==v||e[36]!==_?(T=l.jsx(Y,{icon:S,title:N,summary:v,state:"idle",trailing:_}),e[34]=N,e[35]=v,e[36]=_,e[37]=T):T=e[37],g=T;break e}const k=f.slice(0,At);r=f.length-k.length;let j;e[38]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx(we,{className:"text-success"}),e[38]=j):j=e[38];let w;e[39]!==n?(w=l.jsx(fe,{latency:n}),e[39]=n,e[40]=w):w=e[40],p=l.jsx(Y,{icon:j,title:f.length===1?a("chat.connectionList.singleConnection"):a("chat.connectionList.multipleConnections",{count:f.length}),state:"idle",trailing:w}),d="mt-2 flex flex-col gap-1.5",m=k.map(Qa)}e[2]=n,e[3]=t.output,e[4]=t.state,e[5]=u,e[6]=a,e[7]=r,e[8]=f,e[9]=d,e[10]=m,e[11]=p,e[12]=g}else r=e[7],f=e[8],d=e[9],m=e[10],p=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let x;e[41]!==r||e[42]!==f||e[43]!==o||e[44]!==c||e[45]!==a?(x=r>0&&l.jsx(Pt,{count:f.length,noun:a("chat.connectionList.connectionNoun"),onClick:()=>o({to:"/$org/settings/connections",params:{org:c.slug}})}),e[41]=r,e[42]=f,e[43]=o,e[44]=c,e[45]=a,e[46]=x):x=e[46];let h;e[47]!==d||e[48]!==m||e[49]!==x?(h=l.jsxs("div",{className:d,children:[m,x]}),e[47]=d,e[48]=m,e[49]=x,e[50]=h):h=e[50];let y;return e[51]!==p||e[52]!==h?(y=l.jsxs(l.Fragment,{children:[p,h]}),e[51]=p,e[52]=h,e[53]=y):y=e[53],y}function Qa(s){return l.jsx(Ka,{connection:s},s.id)}function Xa(s){return s.connection_type!=="VIRTUAL"}function Ya(){const s=M.c(46),e=H(),t=ve(),{sendMessage:n,isStreaming:a,messages:o}=Gs(),{org:c}=me(),i=t?.virtualMcpId,{prompts:u}=cn(c.slug),r=i??null;let f;s[0]!==c.id||s[1]!==c.slug||s[2]!==r?(f={connectionId:r,orgId:c.id,orgSlug:c.slug},s[0]=c.id,s[1]=c.slug,s[2]=r,s[3]=f):f=s[3];let d;s[4]!==i?(d=!!i&&et(i),s[4]=i,s[5]=d):d=s[5];let m;s[6]!==d?(m={enabled:d},s[6]=d,s[7]=m):m=s[7];const p=sn(f,m),[g,x]=z.useState(null);if(!i||a||!et(i)||!o.some(Za))return null;let y;if(s[8]!==u||s[9]!==i){let C;s[11]!==i?(C=R=>R.agentId===i&&R.promptName,s[11]=i,s[12]=C):C=s[12],y=u.find(C),s[8]=u,s[9]=i,s[10]=y}else y=s[10];const b=y;if(!b)return null;let k;s[13]!==p||s[14]!==n||s[15]!==e?(k=async(C,R)=>{if(!p){ze.error(e("chat.nextActionChip.mcpClientNotAvailable"));return}try{const D=await xn(p,C.name,R);await n({type:"doc",content:[{type:"paragraph",content:[Ps({id:C.name,name:wt(C.name,kt(C._meta)),metadata:D.messages,char:"/",kind:"prompt",args:R}),{type:"text",text:" "}]}]})}catch(D){console.error("[next-action-chip] failed",D),ze.error(e("chat.nextActionChip.failedLoadPrompt"))}},s[13]=p,s[14]=n,s[15]=e,s[16]=k):k=s[16];const j=k;let w;s[17]!==b._meta||s[18]!==b.arguments||s[19]!==b.description||s[20]!==b.promptName||s[21]!==b.title||s[22]!==j?(w=()=>{const C={name:b.promptName,title:b.title,description:b.description,arguments:b.arguments,_meta:b._meta};if(C.arguments&&C.arguments.length>0){x(C);return}j(C)},s[17]=b._meta,s[18]=b.arguments,s[19]=b.description,s[20]=b.promptName,s[21]=b.title,s[22]=j,s[23]=w):w=s[23];const S=w;let N;s[24]===Symbol.for("react.memo_cache_sentinel")?(N=l.jsx(gn,{className:"size-3 shrink-0 text-special"}),s[24]=N):N=s[24];let v;s[25]!==e?(v=e("chat.nextActionChip.next"),s[25]=e,s[26]=v):v=s[26];let _;s[27]!==v?(_=l.jsx("span",{className:"font-medium text-foreground/80",children:v}),s[27]=v,s[28]=_):_=s[28];let T;s[29]!==b.title?(T=l.jsx("span",{className:"truncate",children:b.title}),s[29]=b.title,s[30]=T):T=s[30];let A;s[31]===Symbol.for("react.memo_cache_sentinel")?(A=l.jsx(xt,{className:"size-3 shrink-0 transition-transform duration-150 group-hover:translate-x-0.5"}),s[31]=A):A=s[31];let P;s[32]!==S||s[33]!==T||s[34]!==_?(P=l.jsxs(be,{type:"button",variant:"outline",size:"sm",onClick:S,className:"group mt-3 self-start text-muted-foreground",children:[N,_,T,A]}),s[32]=S,s[33]=T,s[34]=_,s[35]=P):P=s[35];let E;s[36]===Symbol.for("react.memo_cache_sentinel")?(E=C=>x(C),s[36]=E):E=s[36];let L;s[37]!==g||s[38]!==j?(L=async C=>{const R=g;x(null),R&&await j(R,C)},s[37]=g,s[38]=j,s[39]=L):L=s[39];let I;s[40]!==g||s[41]!==L?(I=l.jsx(Ls,{prompt:g,setPrompt:E,onSubmit:L}),s[40]=g,s[41]=L,s[42]=I):I=s[42];let $;return s[43]!==P||s[44]!==I?($=l.jsxs(l.Fragment,{children:[P,I]}),s[43]=P,s[44]=I,s[45]=$):$=s[45],$}function Za(s){return s.role==="user"||s.parts.some(el)}function el(s){return s.type==="tool-user_ask"&&s.state==="output-available"}function tl(s){const e=M.c(25),{event:t}=s,n=H(),[a,o]=z.useState(!1);let c;e[0]!==t.data?(c=JSON.stringify(t.data,null,2),e[0]=t.data,e[1]=c):c=e[1];const i=c;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>o(sl),e[2]=u):u=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=l.jsx(Ss,{className:"size-4 shrink-0 text-muted-foreground"}),e[3]=r):r=e[3];let f;e[4]!==n?(f=n("chat.triggerEventPart.triggeredByEvent"),e[4]=n,e[5]=f):f=e[5];let d;e[6]!==f?(d=l.jsx("span",{className:"font-medium",children:f}),e[6]=f,e[7]=d):d=e[7];let m;e[8]!==t.type?(m=l.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:t.type}),e[8]=t.type,e[9]=m):m=e[9];const p=a&&"rotate-180";let g;e[10]!==p?(g=V("ml-auto size-4 shrink-0 text-muted-foreground transition-transform",p),e[10]=p,e[11]=g):g=e[11];let x;e[12]!==g?(x=l.jsx(hn,{className:g}),e[12]=g,e[13]=x):x=e[13];let h;e[14]!==d||e[15]!==m||e[16]!==x?(h=l.jsxs("button",{type:"button",onClick:u,className:"flex w-full items-center gap-2 px-3 py-2 text-sm cursor-pointer",children:[r,d,m,x]}),e[14]=d,e[15]=m,e[16]=x,e[17]=h):h=e[17];let y;e[18]!==t.source||e[19]!==a||e[20]!==i?(y=a&&l.jsxs("div",{className:"border-t border-border/60 px-3 py-2",children:[l.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:t.source}),l.jsx("pre",{className:"overflow-auto whitespace-pre-wrap break-words text-xs text-foreground",children:i})]}),e[18]=t.source,e[19]=a,e[20]=i,e[21]=y):y=e[21];let b;return e[22]!==h||e[23]!==y?(b=l.jsxs("div",{className:"rounded-lg border border-border/60 bg-background overflow-hidden text-left",children:[h,y]}),e[22]=h,e[23]=y,e[24]=b):b=e[24],b}function sl(s){return!s}const nl=[Fs.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1}),Rs,zs];function al(s){const e=M.c(5),{tiptapDoc:t}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={attributes:{class:"prose prose-sm max-w-none focus:outline-none"}},e[0]=n):n=e[0];let a;e[1]!==t?(a={extensions:nl,content:t,editable:!1,editorProps:n},e[1]=t,e[2]=a):a=e[2];const o=Es(a);if(!o)return null;let c;return e[3]!==o?(c=l.jsx(Ds,{editor:o,className:"[&_.ProseMirror]:outline-none [&_.ProseMirror]:cursor-text"}),e[3]=o,e[4]=c):c=e[4],c}function Kt(s){const e=M.c(38),{message:t,className:n,onScrollToPair:a}=s,{id:o,parts:c,metadata:i}=t,[u,r]=z.useState(!1),[f,d]=z.useState(!1),m=z.useRef(!1);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=I=>{I&&!m.current&&(m.current=!0,d(I.scrollHeight>I.clientHeight))},e[0]=p):p=e[0];const g=p;if(!c||c.length===0)return null;let x;e[1]!==a?(x=()=>{r(!0),a?.()},e[1]=a,e[2]=x):x=e[2];const h=x,y=i?.tiptapDoc;let b;e[3]!==n?(b=V("message-block w-full min-w-0 relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",n),e[3]=n,e[4]=b):b=e[4];let k,j;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=()=>r(!0),j=()=>r(!1),e[5]=k,e[6]=j):(k=e[5],j=e[6]);let w;e[7]===Symbol.for("react.memo_cache_sentinel")?(w=l.jsx("div",{className:"absolute inset-0 bg-muted/75 rounded-lg pointer-events-none"}),e[7]=w):w=e[7];let S;e[8]!==u||e[9]!==f?(S=V("z-10 px-4 py-2 flex-1 transition-[max-height,opacity] duration-300 ease-out",u?"max-h-[50vh] overflow-auto opacity-100":V("max-h-[84px] overflow-hidden opacity-99",f&&"mask-b-from-1%")),e[8]=u,e[9]=f,e[10]=S):S=e[10];let N;if(e[11]!==o||e[12]!==c){let I;e[14]!==o?(I=($,C)=>$.type==="data-trigger-event"?l.jsx(tl,{event:$.data},`${o}-${C}`):null,e[14]=o,e[15]=I):I=e[15],N=c.map(I),e[11]=o,e[12]=c,e[13]=N}else N=e[13];let v;e[16]!==y||e[17]!==o||e[18]!==i||e[19]!==c?(v=y?l.jsx(al,{tiptapDoc:i.tiptapDoc}):c.map((I,$)=>I.type==="text"?c[$-1]?.type==="data-trigger-event"?null:l.jsx(Ie,{id:o,part:I},`${o}-${$}`):null),e[16]=y,e[17]=o,e[18]=i,e[19]=c,e[20]=v):v=e[20];let _;e[21]!==N||e[22]!==v?(_=l.jsxs("div",{className:"flex flex-col gap-2",children:[N,v]}),e[21]=N,e[22]=v,e[23]=_):_=e[23];let T;e[24]!==_||e[25]!==S?(T=l.jsx("div",{ref:g,className:S,children:_}),e[24]=_,e[25]=S,e[26]=T):T=e[26];let A;e[27]!==h||e[28]!==T?(A=l.jsxs("div",{tabIndex:0,onClick:h,onFocus:k,onBlur:j,className:"w-full border border-border/60 min-w-0 shadow-xs rounded-lg text-sm wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[w,T]}),e[27]=h,e[28]=T,e[29]=A):A=e[29];let P;e[30]!==t?(P=l.jsx(Lt,{message:t,className:"mt-1 mr-1 self-end"}),e[30]=t,e[31]=P):P=e[31];let E;e[32]!==A||e[33]!==P?(E=l.jsxs("div",{className:"w-full min-w-0 flex flex-col",children:[A,P]}),e[32]=A,e[33]=P,e[34]=E):E=e[34];let L;return e[35]!==E||e[36]!==b?(L=l.jsx(l.Fragment,{children:l.jsx("div",{className:b,children:E})}),e[35]=E,e[36]=b,e[37]=L):L=e[37],L}function Jt(s){const e=M.c(10),{message:t,pending:n}=s,a=H();let o;e[0]!==n||e[1]!==a?(o=a(n?"chat.liveMessage.pending":"chat.liveMessage.readByAgent"),e[0]=n,e[1]=a,e[2]=o):o=e[2];let c;e[3]!==o?(c=l.jsx("span",{className:"self-end px-3 text-xs text-muted-foreground",children:o}),e[3]=o,e[4]=c):c=e[4];let i;e[5]!==t?(i=l.jsx(Kt,{message:t}),e[5]=t,e[6]=i):i=e[6];let u;return e[7]!==c||e[8]!==i?(u=l.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[c,i]}),e[7]=c,e[8]=i,e[9]=u):u=e[9],u}function ll(s){const e=M.c(5),{part:t}=s,{read:n}=bt();let a;if(e[0]!==t||e[1]!==n){const i=Ks(t);a=i?n.get(i):void 0,e[0]=t,e[1]=n,e[2]=a}else a=e[2];const o=a;if(!o)return null;let c;return e[3]!==o?(c=l.jsx(Jt,{message:o,pending:!1}),e[3]=o,e[4]=c):c=e[4],c}function ol(s){const e=new Map;for(let t=s.length-1;t>=0;t--){const n=s[t]?.parts;if(n)for(const a of n){const o=a;if(o.type!=="data-deck-updated")continue;const c=o.data;if(!c?.path)continue;const i=`deck:${c.path}`;e.has(i)||e.set(i,{tabId:cs(c.path),label:c.name||c.path,kind:c.kind==="page"?"page":"deck"})}}return Array.from(e.values())}function rl(){const s=M.c(9),e=H(),{openPanel:t}=Ke(),n=je()?.messages??[],a=ol(n);if(a.length===0)return null;const o=a.some(cl),c=a.some(il),i=e(o?c?"chat.threadHtmlPreviews.slidesAndPages":"chat.threadHtmlPreviews.slides":"chat.threadHtmlPreviews.pages"),u="flex flex-col gap-1.5 py-2";let r;s[0]!==i?(r=l.jsx("div",{className:"text-xs text-muted-foreground/70",children:i}),s[0]=i,s[1]=r):r=s[1];const f="flex flex-wrap gap-2";let d;s[2]!==t?(d=x=>l.jsxs(be,{type:"button",variant:"outline",className:"max-w-full",onClick:()=>t(x.tabId),children:[x.kind==="deck"?l.jsx(bn,{className:"size-3.5 shrink-0 text-muted-foreground"}):l.jsx(Ns,{className:"size-3.5 shrink-0 text-muted-foreground"}),l.jsx("span",{className:"truncate font-medium text-foreground",children:x.label})]},x.tabId),s[2]=t,s[3]=d):d=s[3];const m=a.map(d);let p;s[4]!==m?(p=l.jsx("div",{className:f,children:m}),s[4]=m,s[5]=p):p=s[5];let g;return s[6]!==r||s[7]!==p?(g=l.jsxs("div",{className:u,children:[r,p]}),s[6]=r,s[7]=p,s[8]=g):g=s[8],g}function il(s){return s.kind==="page"}function cl(s){return s.kind==="deck"}function ul(s){const e=M.c(29),{file:t}=s,n=H(),{openPanel:a}=Ke();let o;e[0]!==t.key||e[1]!==a?(o=()=>a(us(t.key)),e[0]=t.key,e[1]=a,e[2]=o):o=e[2];const c=o;let i;e[3]!==t.filename?(i=l.jsx(vn,{filename:t.filename,className:"h-5 w-4 shrink-0"}),e[3]=t.filename,e[4]=i):i=e[4];let u;e[5]!==t.filename||e[6]!==c?(u=l.jsx("button",{type:"button",onClick:c,className:"min-w-0 flex-1 truncate text-left text-sm font-medium text-foreground hover:underline",title:t.filename,children:t.filename}),e[5]=t.filename,e[6]=c,e[7]=u):u=e[7];const r=t.downloadUrl,f=t.filename;let d;e[8]!==n?(d=n("chat.outputFileRow.download"),e[8]=n,e[9]=d):d=e[9];let m;e[10]!==t.filename||e[11]!==n?(m=n("chat.outputFileRow.downloadFile",{filename:t.filename}),e[10]=t.filename,e[11]=n,e[12]=m):m=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=l.jsx(jn,{className:"size-3.5"}),e[13]=p):p=e[13];let g;e[14]!==t.downloadUrl||e[15]!==t.filename||e[16]!==d||e[17]!==m?(g=l.jsx("a",{href:r,download:f,className:"hidden shrink-0 text-muted-foreground hover:text-foreground group-hover:block group-focus-within:block",title:d,"aria-label":m,children:p}),e[14]=t.downloadUrl,e[15]=t.filename,e[16]=d,e[17]=m,e[18]=g):g=e[18];let x;e[19]!==n?(x=n("chat.outputFileRow.open"),e[19]=n,e[20]=x):x=e[20];let h;e[21]!==c||e[22]!==x?(h=l.jsx(be,{variant:"outline",size:"sm",className:"h-7 shrink-0 px-2.5 text-xs",onClick:c,children:x}),e[21]=c,e[22]=x,e[23]=h):h=e[23];let y;return e[24]!==h||e[25]!==i||e[26]!==u||e[27]!==g?(y=l.jsxs("div",{className:"group flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-2",children:[i,u,g,h]}),e[24]=h,e[25]=i,e[26]=u,e[27]=g,e[28]=y):y=e[28],y}function dl(s){return s.split("/").pop()??s}const fl=/(^|\/)output\//;function ml(s){const e=new Set;for(const t of s.parts??[]){const n=t;if(n.state==="output-available"&&n.type==="tool-write"){const a=n.input?.path;a&&fl.test(a)&&e.add(dl(a))}}return e}function pl(s){const e=M.c(4),{threadId:t,message:n}=s,a=ml(n),o=a.size>0;let c;e[0]!==o?(c={enabled:o},e[0]=o,e[1]=c):c=e[1];const{data:i}=yn(t,c);if(a.size===0)return null;const u=(i??[]).filter(m=>a.has(m.filename));if(u.length===0)return null;const r="flex flex-col gap-1.5 py-2",f=u.map(gl);let d;return e[2]!==f?(d=l.jsx("div",{className:r,children:f}),e[2]=f,e[3]=d):d=e[3],d}function gl(s){return l.jsx(ul,{file:s},s.key)}function xl(s){return s.type==="reasoning"}function hl(s){const e=[],t=new Set,n=new Map,a=new Map,o=new Map;if(s){let i=null;for(let u=0;u<s.parts.length;u++){const r=s.parts[u];if(xl(r)){i||(i={parts:[],startIndex:u},e.push(i)),i.parts.push(r),t.add(u);continue}if(i=null,r.type==="data-tool-metadata"&&"id"in r&&"data"in r){const f=r.data,d={};f.annotations&&(d.annotations=f.annotations),typeof f.latencyMs=="number"&&Number.isFinite(f.latencyMs)&&(d.latencySeconds=f.latencyMs/1e3),typeof f.outputBytes=="number"&&Number.isFinite(f.outputBytes)&&f.outputBytes>=0&&(d.outputBytes=f.outputBytes),f._meta&&typeof f._meta=="object"&&(d._meta=f._meta),n.set(r.id,d);continue}if(r.type==="data-tool-subtask-metadata"&&"id"in r){a.set(r.id,r.data);continue}if(r.type==="data-web-search"&&"id"in r&&"data"in r){const f=r.id,d=r.data;o.set(f,d.text??"");continue}}}const c=[];if(s)for(let i=0;i<s.parts.length;i++){const u=s.parts[i];if(u.type!=="step-start"){if(t.has(i)){const r=e.find(f=>f.startIndex===i);r&&c.push({kind:"reasoning-group",group:r});continue}u.type.startsWith("data-")&&u.type!==$e||c.push({kind:"part",index:i})}}return{reasoningGroups:e,renderOrder:c,dataParts:{toolMetadata:n,toolSubtaskMetadata:a,webSearchStreaming:o}}}const bl=3;function yl(s,e){let t=-1;for(let o=s.length-1;o>=0;o--){const c=s[o];if(c.kind==="part"&&e[c.index]?.type==="text"){t=o;break}}if(t===-1)return{collapsed:[],tail:s};const n=s.findLastIndex(o=>o.kind==="part"&&e[o.index]?.type===$e),a=n!==-1&&n<t?n:t;return{collapsed:s.slice(0,a),tail:s.slice(a)}}function Qt(s,e){return s.kind==="part"&&e[s.index]?.type!==$e}function jl(s,e){let t=0,n=0;for(const a of s)if(a.kind==="reasoning-group")n++;else{const o=e[a.index]?.type;o==="text"?n++:(o==="dynamic-tool"||o?.startsWith("tool-"))&&o!=="tool-todo_write"&&o!=="tool-update_interests"&&t++}return{toolCalls:t,messages:n}}function vl(s){const e=M.c(10),{toolCalls:t,messages:n}=s,a=H();let o;e[0]!==n||e[1]!==a||e[2]!==t?(o=t>0&&l.jsxs(l.Fragment,{children:[l.jsx(pt,{className:"size-3.5 shrink-0"}),l.jsxs("span",{children:[a("chat.assistant.toolCallPlural",{count:t}),n>0?",":""]})]}),e[0]=n,e[1]=a,e[2]=t,e[3]=o):o=e[3];let c;e[4]!==n||e[5]!==a?(c=n>0&&l.jsxs(l.Fragment,{children:[l.jsx(ks,{className:"size-3.5 shrink-0"}),l.jsx("span",{children:a("chat.assistant.messagePlural",{count:n})})]}),e[4]=n,e[5]=a,e[6]=c):c=e[6];let i;return e[7]!==o||e[8]!==c?(i=l.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[o,c]}),e[7]=o,e[8]=c,e[9]=i):i=e[9],i}function Sl(s){const e=M.c(28),{items:t,message:n,reasoningGroups:a,isReasoningActive:o,totalDuration:c,dataParts:i,isLoading:u,isLast:r}=s;let f;e[0]!==t||e[1]!==n.parts?(f=jl(t,n.parts),e[0]=t,e[1]=n.parts,e[2]=f):f=e[2];const{toolCalls:d,messages:m}=f;if(d===0&&m===0)return null;let p;e[3]!==m||e[4]!==d?(p=l.jsx(vl,{toolCalls:d,messages:m}),e[3]=m,e[4]=d,e[5]=p):p=e[5];let g;if(e[6]!==i||e[7]!==r||e[8]!==u||e[9]!==o||e[10]!==t||e[11]!==n||e[12]!==a||e[13]!==c){let y;e[15]!==i||e[16]!==r||e[17]!==u||e[18]!==o||e[19]!==n||e[20]!==a||e[21]!==c?(y=(b,k)=>Xt({item:b,renderIndex:k,message:n,reasoningGroups:a,isReasoningActive:o,totalDuration:c,dataParts:i,isLoading:u,isLast:r,isLastVisiblePart:!1}),e[15]=i,e[16]=r,e[17]=u,e[18]=o,e[19]=n,e[20]=a,e[21]=c,e[22]=y):y=e[22],g=t.map(y),e[6]=i,e[7]=r,e[8]=u,e[9]=o,e[10]=t,e[11]=n,e[12]=a,e[13]=c,e[14]=g}else g=e[14];let x;e[23]!==g?(x=l.jsx("div",{className:"flex flex-col gap-3 sm:gap-2 pt-1",children:g}),e[23]=g,e[24]=x):x=e[24];let h;return e[25]!==p||e[26]!==x?(h=l.jsx(Y,{icon:null,alwaysChevron:!0,title:p,state:"idle",children:x}),e[25]=p,e[26]=x,e[27]=h):h=e[27],h}function Xt({item:s,renderIndex:e,message:t,reasoningGroups:n,isReasoningActive:a,totalDuration:o,dataParts:c,isLoading:i,isLast:u,isLastVisiblePart:r,renderOrder:f}){if(s.kind==="reasoning-group"){const{group:g}=s,x=g===n[n.length-1],h=a&&x;if(!g.parts.some(k=>k.text?.trim())&&!h)return null;const b=n.length===1?o:null;return l.jsx(En,{duration:b,parts:g.parts,isStreaming:h},`${t.id}-reasoning-${g.startIndex}`)}const d=t.parts[s.index],m=r||(f?f.findLastIndex(g=>Qt(g,t.parts))===e:!1),p=m?Js(Qs(),t.metadata?.usage):null;return l.jsx(Nl,{part:d,id:t.id,usageStats:m&&l.jsx(Os,{usage:p,duration:o}),dataParts:c,isLoading:i,isLastMessage:u},`${t.id}-${s.index}`)}function Nl(s){const e=M.c(114),{part:t,id:n,usageStats:a,dataParts:o,isLoading:c,isLastMessage:i}=s;let u;e[0]!==o.toolMetadata?(u=m=>o.toolMetadata.get(m),e[0]=o.toolMetadata,e[1]=u):u=e[1];const r=u;let f;e[2]!==o.toolSubtaskMetadata?(f=m=>o.toolSubtaskMetadata.get(m),e[2]=o.toolSubtaskMetadata,e[3]=f):f=e[3];const d=f;switch(t.type){case"dynamic-tool":{let m;e[4]!==r||e[5]!==t.toolCallId?(m=r(t.toolCallId)?.annotations,e[4]=r,e[5]=t.toolCallId,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==t.toolCallId?(p=r(t.toolCallId)?.latencySeconds,e[7]=r,e[8]=t.toolCallId,e[9]=p):p=e[9];let g;e[10]!==r||e[11]!==t.toolCallId?(g=r(t.toolCallId)?.outputBytes,e[10]=r,e[11]=t.toolCallId,e[12]=g):g=e[12];let x;e[13]!==r||e[14]!==t.toolCallId?(x=r(t.toolCallId)?._meta,e[13]=r,e[14]=t.toolCallId,e[15]=x):x=e[15];let h;return e[16]!==i||e[17]!==t||e[18]!==m||e[19]!==p||e[20]!==g||e[21]!==x?(h=l.jsx(lt,{part:t,annotations:m,latency:p,outputBytes:g,isLastMessage:i,toolMeta:x}),e[16]=i,e[17]=t,e[18]=m,e[19]=p,e[20]=g,e[21]=x,e[22]=h):h=e[22],h}case"tool-todo_write":return null;case"tool-update_interests":return null;case"tool-user_ask":{let m;e[23]!==r||e[24]!==t.toolCallId?(m=r(t.toolCallId)?.latencySeconds,e[23]=r,e[24]=t.toolCallId,e[25]=m):m=e[25];let p;return e[26]!==t||e[27]!==m?(p=l.jsx(_a,{part:t,latency:m}),e[26]=t,e[27]=m,e[28]=p):p=e[28],p}case"tool-suggest_task":{let m;return e[29]!==t?(m=l.jsx(Ta,{part:t}),e[29]=t,e[30]=m):m=e[30],m}case"tool-propose_plan":{let m;return e[31]!==t?(m=l.jsx(Da,{part:t}),e[31]=t,e[32]=m):m=e[32],m}case"tool-generate_image":{let m;e[33]!==r||e[34]!==t.toolCallId?(m=r(t.toolCallId)?.latencySeconds,e[33]=r,e[34]=t.toolCallId,e[35]=m):m=e[35];let p;return e[36]!==t||e[37]!==m?(p=l.jsx(ma,{part:t,latency:m}),e[36]=t,e[37]=m,e[38]=p):p=e[38],p}case"tool-web_search":case"tool-deep_research":{let m;e[39]!==r||e[40]!==t.toolCallId?(m=r(t.toolCallId)?.latencySeconds,e[39]=r,e[40]=t.toolCallId,e[41]=m):m=e[41];let p;e[42]!==o.webSearchStreaming||e[43]!==t.toolCallId?(p=o.webSearchStreaming.get(t.toolCallId),e[42]=o.webSearchStreaming,e[43]=t.toolCallId,e[44]=p):p=e[44];let g;return e[45]!==t||e[46]!==m||e[47]!==p?(g=l.jsx(wa,{part:t,latency:m,streamingText:p}),e[45]=t,e[46]=m,e[47]=p,e[48]=g):g=e[48],g}case"tool-subtask":{let m;e[49]!==d||e[50]!==t.toolCallId?(m=d(t.toolCallId),e[49]=d,e[50]=t.toolCallId,e[51]=m):m=e[51];let p;e[52]!==r||e[53]!==t.toolCallId?(p=r(t.toolCallId)?.annotations,e[52]=r,e[53]=t.toolCallId,e[54]=p):p=e[54];let g;e[55]!==r||e[56]!==t.toolCallId?(g=r(t.toolCallId)?.latencySeconds,e[55]=r,e[56]=t.toolCallId,e[57]=g):g=e[57];let x;e[58]!==t||e[59]!==m||e[60]!==p||e[61]!==g?(x={part:t,subtaskMeta:m,annotations:p,latency:g},e[58]=t,e[59]=m,e[60]=p,e[61]=g,e[62]=x):x=e[62];const h=x;let y;return e[63]!==h?(y=l.jsx(z.Suspense,{fallback:l.jsx(za,{...h}),children:l.jsx(Fa,{...h})}),e[63]=h,e[64]=y):y=e[64],y}case"text":{const m=!!a&&!c,p=c&&i;let g;return e[65]!==n||e[66]!==t||e[67]!==m||e[68]!==p||e[69]!==a?(g=l.jsx(Ie,{id:n,part:t,extraActions:a,copyable:!0,alwaysShowActions:m,animate:p}),e[65]=n,e[66]=t,e[67]=m,e[68]=p,e[69]=a,e[70]=g):g=e[70],g}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;case"data-tool-metadata":case"data-tool-subtask-metadata":case"data-generate-image":case"data-web-search":return null;default:{const m=t;if(m.type==="tool-COLLECTION_VIRTUAL_MCP_CREATE"){let p;e[71]!==m.toolCallId||e[72]!==r?(p=r(m.toolCallId)?.latencySeconds,e[71]=m.toolCallId,e[72]=r,e[73]=p):p=e[73];let g;return e[74]!==m||e[75]!==p?(g=l.jsx(Ba,{part:m,latency:p}),e[74]=m,e[75]=p,e[76]=g):g=e[76],g}if(m.type==="tool-COLLECTION_VIRTUAL_MCP_LIST"){let p;e[77]!==m.toolCallId||e[78]!==r?(p=r(m.toolCallId)?.latencySeconds,e[77]=m.toolCallId,e[78]=r,e[79]=p):p=e[79];let g;return e[80]!==m||e[81]!==p?(g=l.jsx(Wa,{part:m,latency:p}),e[80]=m,e[81]=p,e[82]=g):g=e[82],g}if(m.type==="tool-COLLECTION_CONNECTIONS_LIST"){let p;e[83]!==m.toolCallId||e[84]!==r?(p=r(m.toolCallId)?.latencySeconds,e[83]=m.toolCallId,e[84]=r,e[85]=p):p=e[85];let g;return e[86]!==m||e[87]!==p?(g=l.jsx(Ja,{part:m,latency:p}),e[86]=m,e[87]=p,e[88]=g):g=e[88],g}if(m.type.startsWith("tool-")){const p=m;let g;e[89]!==o.toolMetadata||e[90]!==p.toolCallId?(g=o.toolMetadata.get(p.toolCallId),e[89]=o.toolMetadata,e[90]=p.toolCallId,e[91]=g):g=e[91];const x=g;let h;e[92]!==m.type||e[93]!==p.output?(h=m.type.endsWith("__get_screenshot")?ca(p.output):null,e[92]=m.type,e[93]=p.output,e[94]=h):h=e[94];const y=h,b=x?.annotations,k=x?.latencySeconds,j=x?.outputBytes,w=x?._meta;let S;e[95]!==m||e[96]!==i||e[97]!==b||e[98]!==k||e[99]!==j||e[100]!==w?(S=l.jsx(lt,{part:m,annotations:b,latency:k,outputBytes:j,isLastMessage:i,toolMeta:w}),e[95]=m,e[96]=i,e[97]=b,e[98]=k,e[99]=j,e[100]=w,e[101]=S):S=e[101];const N=S;if(!y)return N;let v;e[102]!==y?(v=[y],e[102]=y,e[103]=v):v=e[103];let _;e[104]!==p.type?(_=p.type.slice(5),e[104]=p.type,e[105]=_):_=e[105];let T;e[106]!==v||e[107]!==_?(T=l.jsx(Ot,{srcs:v,alt:_}),e[106]=v,e[107]=_,e[108]=T):T=e[108];let A;return e[109]!==N||e[110]!==T?(A=l.jsxs("div",{className:"flex flex-col gap-2",children:[N,T]}),e[109]=N,e[110]=T,e[111]=A):A=e[111],A}if(t.type===$e){let p;return e[112]!==t?(p=l.jsx(ll,{part:t}),e[112]=t,e[113]=p):p=e[113],p}return m.type.startsWith("data-")||console.warn(`[chat] unknown message part type: ${m.type}`),null}}}function kl(s){const e=M.c(3),{pending:t,children:n}=s;if(!t||t.length===0)return n;let a;return e[0]!==n||e[1]!==t?(a=l.jsxs("div",{className:"flex flex-col gap-3 sm:gap-2",children:[n,t]}),e[0]=n,e[1]=t,e[2]=a):a=e[2],a}function wl(s){const e=M.c(9),{isRunInProgress:t}=s,n=H();if(t){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(Ce,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),e[0]=c):c=e[0];let i;e[1]!==n?(i=n("chat.assistant.resumingTask"),e[1]=n,e[2]=i):i=e[2];let u;return e[3]!==i?(u=l.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:l.jsxs("span",{className:"flex items-center gap-1.5",children:[c,l.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:i})]})}),e[3]=i,e[4]=u):u=e[4],u}let a;e[5]!==n?(a=n("chat.assistant.noResponseGenerated"),e[5]=n,e[6]=a):a=e[6];let o;return e[7]!==a?(o=l.jsx("div",{className:"text-sm text-muted-foreground/60 py-2",children:a}),e[7]=a,e[8]=o):o=e[8],o}function _l(s){const e=M.c(7),{className:t,children:n}=s;let a;e[0]!==t?(a=V("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",t),e[0]=t,e[1]=a):a=e[1];let o;e[2]!==n?(o=l.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:l.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-sm wrap-break-word overflow-wrap-anywhere bg-transparent",children:n})}),e[2]=n,e[3]=o):o=e[3];let c;return e[4]!==a||e[5]!==o?(c=l.jsx("div",{className:a,children:o}),e[4]=a,e[5]=o,e[6]=c):c=e[6],c}function Tl(s){const e=M.c(16),{message:t,turnStartedAt:n,status:a,className:o,isLast:c}=s,i=c===void 0?!1:c,u=H(),{isRunInProgress:r}=je()??{},f=r===void 0?!1:r,d=ve()?.taskId??null,m=a==="streaming",g=m||a==="submitted";let x;e[0]!==n?(x=We(n),e[0]=n,e[1]=x):x=e[1];const h=x;let y;e[2]!==g?(y=()=>g?Date.now():null,e[2]=g,e[3]=y):y=e[3];const[b,k]=z.useState(y),[j,w]=z.useState(g);j!==g&&(w(g),k(()=>g?Date.now():null));const S=h??b,{reasoningGroups:N,renderOrder:v,dataParts:_}=hl(t),T=t!==null&&v.length>0,A=t&&t.parts.length>0?t.parts[t.parts.length-1]:null,P=m&&A?.type==="reasoning";let E;if(e[4]!==t){const G=t?.metadata?.reasoning_start_at?new Date(t.metadata.reasoning_start_at):null,Q=t?.metadata?.reasoning_end_at?new Date(t.metadata.reasoning_end_at):new Date;E=G!==null?Q.getTime()-G.getTime():null,e[4]=t,e[5]=E}else E=e[5];const L=E;let I;e[6]!==i||e[7]!==t?(I=!i||!t||!t.parts.some(Il),e[6]=i,e[7]=t,e[8]=I):I=e[8];const $=I,C=!g&&T&&$&&(()=>{let G=0;for(const Q of v)if(Q.kind==="part"){const ne=t.parts[Q.index]?.type;(ne==="dynamic-tool"||ne?.startsWith("tool-"))&&G++}return G>=bl})(),{collapsed:R,tail:D}=C?yl(v,t.parts):{collapsed:[],tail:v},{pending:B}=bt();let U;e[9]!==i||e[10]!==B?(U=i?B.map(Cl):null,e[9]=i,e[10]=B,e[11]=U):U=e[11];const W=U,K=_l,X=T?l.jsxs("div",{className:"flex flex-col gap-3 sm:gap-2",children:[t.metadata?.resumedFromBackground&&l.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground/60 select-none",children:[l.jsx(dt,{className:"size-3 shrink-0"}),l.jsx("span",{children:u("chat.assistant.resumedBackgroundTask")})]}),R.length>0&&l.jsx(Sl,{items:R,message:t,reasoningGroups:N,isReasoningActive:P,totalDuration:L,dataParts:_,isLoading:g,isLast:i}),D.map((G,Q)=>{const ne=R.length+Q,oe=D.findLastIndex(ee=>Qt(ee,t.parts))===Q;return Xt({item:G,renderIndex:ne,message:t,reasoningGroups:N,isReasoningActive:P,totalDuration:L,dataParts:_,isLoading:g,isLast:i,isLastVisiblePart:oe,renderOrder:v})}),d&&l.jsx(pl,{threadId:d,message:t}),W,i&&(g||f)&&S!==null&&l.jsx(An,{startedAt:S}),i&&!g&&d&&l.jsxs(l.Fragment,{children:[l.jsx(rl,{}),$&&l.jsx(Ya,{})]}),!g&&l.jsx(Lt,{message:t})]}):l.jsx(kl,{pending:W,children:g?l.jsx(Ln,{startedAt:S}):l.jsx(wl,{isRunInProgress:i&&f})});let Z;return e[12]!==K||e[13]!==o||e[14]!==X?(Z=l.jsx(K,{className:o,children:X}),e[12]=K,e[13]=o,e[14]=X,e[15]=Z):Z=e[15],Z}function Cl(s){return l.jsx(Jt,{message:s,pending:!0},s.id)}function Il(s){const e=s.type;if(e!=="dynamic-tool"&&!e?.startsWith("tool-"))return!1;const t=s.state;return t==="input-streaming"||t==="input-available"||t==="approval-requested"}function yo(s){const e=[],t=s.filter(n=>n.role!=="system"&&!n.metadata?.internal&&!n.metadata?.subtaskJobId);for(let n=0;n<t.length;n++){const a=t[n];if(a)if(a.role==="user"){const o=t[n+1];o&&o.role==="assistant"?(e.push({user:a,assistant:o}),n++):e.push({user:a,assistant:null})}else a.role==="assistant"&&e.push({user:null,assistant:a})}return e}function jo(s){const e=M.c(19),{pair:t,isLastPair:n,status:a}=s,o=z.useRef(null),c=z.useRef(!1);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{o.current&&o.current.scrollIntoView({behavior:"smooth",block:"start"})},e[0]=i):i=e[0];const u=i;let r;e[1]!==n||e[2]!==t.assistant?.metadata?.resumedFromBackground||e[3]!==a?(r=y=>{if(o.current=y,!n||!y||c.current||(c.current=!0,t.assistant?.metadata?.resumedFromBackground))return;if(a==="submitted"||a==="streaming"){y.scrollIntoView({behavior:"smooth",block:"start"});return}const b=y.closest("[data-chat-scroller]");b?b.scrollTop=b.scrollHeight:y.scrollIntoView({behavior:"instant",block:"start"})},e[1]=n,e[2]=t.assistant?.metadata?.resumedFromBackground,e[3]=a,e[4]=r):r=e[4];const f=r,d=!t.user&&"pt-8 sm:pt-6";let m;e[5]!==d?(m=V("flex flex-col pb-2 sm:pb-2",d),e[5]=d,e[6]=m):m=e[6];let p;e[7]!==t.user?(p=t.user&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"sticky top-0 z-50 w-full h-4 bg-background"}),l.jsx("div",{className:"sticky mb-8 sm:mb-6 top-4 z-50",children:l.jsx(Kt,{message:t.user,onScrollToPair:u})})]}),e[7]=t.user,e[8]=p):p=e[8];const g=t.user?.created_at??null;let x;e[9]!==n||e[10]!==t.assistant||e[11]!==a||e[12]!==g?(x=l.jsx(Tl,{message:t.assistant,turnStartedAt:g,status:a,isLast:n}),e[9]=n,e[10]=t.assistant,e[11]=a,e[12]=g,e[13]=x):x=e[13];let h;return e[14]!==f||e[15]!==m||e[16]!==p||e[17]!==x?(h=l.jsxs("div",{ref:f,className:m,children:[p,x]}),e[14]=f,e[15]=m,e[16]=p,e[17]=x,e[18]=h):h=e[18],h}export{Sn as G,jo as M,ul as O,bo as S,Cn as a,On as f,yo as u};
47
+ `:"")+a:e(o?"chat.subtask.stepLimitNoOutput":"chat.subtask.completedNoOutput")}}return Zn(s)}function Ut(s){return!!s&&typeof s=="object"&&s.background===!0}function Ht({part:s,subtaskMeta:e},t){const n=s.state==="input-streaming"||s.state==="input-available",a=s.state==="output-available"&&s.preliminary===!0,o=s.state==="output-available"&&!s.preliminary,c=s.state==="output-error",i=pe(s.state,"preliminary"in s?s.preliminary:!1),u=i==="approval"?"idle":i,r=t(n?"chat.subtask.startingEllipsis":a?"chat.subtask.runningEllipsis":o?"chat.subtask.completedTitle":c?"chat.subtask.failedTitle":"chat.subtask.subtaskNoun"),f=s.input?.prompt??"",d=s.state==="approval-requested"?t("chat.subtask.awaitingApproval"):f.length>120?f.slice(0,120)+"…":f;return{fallbackTitle:r,summary:d,usage:e?.usage,state:u}}function qt(s){return s.state==="input-available"?!0:s.state==="output-available"?"preliminary"in s&&s.preliminary===!0:!1}function Wt(s){const e=M.c(4),t=ve()?.taskId??null,{org:n}=me();if(!t)return null;let a;return e[0]!==n||e[1]!==t||e[2]!==s?(a=async()=>{if(t===null)return;const o=await fetch(`/api/${encodeURIComponent(n.slug)}/decopilot/flip/${encodeURIComponent(t)}`,{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({toolCallId:s})});if(!o.ok)throw new Error(`flip failed: ${o.status}`)},e[0]=n,e[1]=t,e[2]=s,e[3]=a):a=e[3],a}function Aa(s){const e=M.c(10),{onFlip:t}=s,n=H(),[a,o]=z.useState(!1);let c;e[0]!==t?(c=async f=>{f.stopPropagation(),o(!0);try{await t()}catch{o(!1)}},e[0]=t,e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=G("shrink-0 text-xs text-muted-foreground/70 px-2 py-1 rounded-lg transition-colors","[@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent","disabled:opacity-50"),e[2]=i):i=e[2];let u;e[3]!==a||e[4]!==n?(u=n(a?"chat.subtask.flipping":"chat.subtask.flipToBackground"),e[3]=a,e[4]=n,e[5]=u):u=e[5];let r;return e[6]!==a||e[7]!==c||e[8]!==u?(r=l.jsx("button",{type:"button",disabled:a,onClick:c,className:i,children:u}),e[6]=a,e[7]=c,e[8]=u,e[9]=r):r=e[9],r}function Qe(s){const e=M.c(54),{icon:t,title:n,summary:a,state:o,usage:c,latency:i,onOpenChange:u,onFlip:r,children:f}=s,[d,m]=z.useState(!1);let p;e[0]!==u?(p=V=>{m(V),u?.(V)},e[0]=u,e[1]=p):p=e[1];const g=p,x=o==="loading",h=o==="error";let y;e[2]!==g?(y=()=>g(!0),e[2]=g,e[3]=y):y=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=G("group/tool flex items-center gap-2 flex-1 min-w-0 py-2.5 text-left rounded-lg transition-colors","[@media(hover:hover)]:hover:bg-accent"),e[4]=b):b=e[4];const k=h?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75";let j;e[5]!==k?(j=G("relative shrink-0 size-4 flex items-center justify-center [&>svg]:size-4",k),e[5]=k,e[6]=j):j=e[6];let w;e[7]!==t||e[8]!==j?(w=l.jsx("div",{className:j,children:t}),e[7]=t,e[8]=j,e[9]=w):w=e[9];const S=h?"text-warning/80":"text-foreground",N=x&&"shimmer";let v;e[10]!==S||e[11]!==N?(v=G("shrink-0 text-sm font-normal",S,N),e[10]=S,e[11]=N,e[12]=v):v=e[12];let _;e[13]!==v||e[14]!==n?(_=l.jsx("span",{className:v,children:n}),e[13]=v,e[14]=n,e[15]=_):_=e[15];let T;e[16]!==x||e[17]!==a?(T=a?l.jsx("span",{className:"min-w-0 flex-1 truncate",children:l.jsx("span",{className:"text-xs text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:l.jsx("span",{className:G(x&&"shimmer"),children:a})})}):l.jsx("div",{className:"flex-1"}),e[16]=x,e[17]=a,e[18]=T):T=e[18];let A;e[19]===Symbol.for("react.memo_cache_sentinel")?(A=l.jsx(is,{className:"size-3.5 shrink-0 text-muted-foreground/40 opacity-0 transition-opacity [@media(hover:hover)]:group-hover/tool:opacity-100"}),e[19]=A):A=e[19];let P;e[20]!==i?(P=l.jsx(fe,{latency:i}),e[20]=i,e[21]=P):P=e[21];let E;e[22]!==c?(E=l.jsx(ht,{usage:c}),e[22]=c,e[23]=E):E=e[23];let L;e[24]!==_||e[25]!==T||e[26]!==P||e[27]!==E||e[28]!==y||e[29]!==w?(L=l.jsxs("button",{type:"button",onClick:y,className:b,children:[w,_,T,A,P,E]}),e[24]=_,e[25]=T,e[26]=P,e[27]=E,e[28]=y,e[29]=w,e[30]=L):L=e[30];let I;e[31]!==x||e[32]!==r?(I=r&&x?l.jsx(Aa,{onFlip:r}):null,e[31]=x,e[32]=r,e[33]=I):I=e[33];let $;e[34]!==L||e[35]!==I?($=l.jsxs("div",{className:"flex items-center gap-1 w-full",children:[L,I]}),e[34]=L,e[35]=I,e[36]=$):$=e[36];let C;e[37]!==t?(C=l.jsx("span",{className:"flex items-center [&>svg]:size-4 [&>svg]:text-muted-foreground/75",children:t}),e[37]=t,e[38]=C):C=e[38];let R;e[39]!==C||e[40]!==n?(R=l.jsx(dn,{className:"px-4 py-3 border-b border-border shrink-0",children:l.jsxs(fn,{className:"flex items-center gap-2 text-sm font-medium",children:[C,n]})}),e[39]=C,e[40]=n,e[41]=R):R=e[41];let F;e[42]!==f?(F=l.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-4 py-4",children:f}),e[42]=f,e[43]=F):F=e[43];let B;e[44]!==R||e[45]!==F?(B=l.jsxs(mn,{side:"right",className:"w-full sm:max-w-2xl flex flex-col p-0 gap-0",children:[R,F]}),e[44]=R,e[45]=F,e[46]=B):B=e[46];let U;e[47]!==d||e[48]!==g||e[49]!==B?(U=l.jsx(pn,{open:d,onOpenChange:g,children:B}),e[47]=d,e[48]=g,e[49]=B,e[50]=U):U=e[50];let W;return e[51]!==$||e[52]!==U?(W=l.jsxs(l.Fragment,{children:[$,U]}),e[51]=$,e[52]=U,e[53]=W):W=e[53],W}function Gt(s){const e=M.c(22),{part:t}=s,n=H(),a=t.state==="output-error";let o;e[0]!==t.input?.prompt||e[1]!==n?(o=t.input?.prompt??n("chat.subtask.noPromptProvided"),e[0]=t.input?.prompt,e[1]=n,e[2]=o):o=e[2];const c=o;let i;if(e[3]!==a||e[4]!==t||e[5]!==c||e[6]!==n){const u=a?Ae(t):Ma(t.output,n)??"";let r;e[8]!==n?(r=n("chat.subtask.taskLabel"),e[8]=n,e[9]=r):r=e[9];let f;e[10]!==r?(f=l.jsx("h3",{className:"text-xs font-medium text-muted-foreground/70 mb-1.5",children:r}),e[10]=r,e[11]=f):f=e[11];let d;e[12]!==c?(d=l.jsx("p",{className:"text-sm text-foreground/90 whitespace-pre-wrap wrap-break-word",children:c}),e[12]=c,e[13]=d):d=e[13];let m;e[14]!==f||e[15]!==d?(m=l.jsxs("section",{children:[f,d]}),e[14]=f,e[15]=d,e[16]=m):m=e[16];let p;e[17]!==a||e[18]!==n?(p=n(a?"chat.subtask.errorLabel":"chat.subtask.resultLabel"),e[17]=a,e[18]=n,e[19]=p):p=e[19];let g;e[20]!==p?(g=l.jsx("h3",{className:"text-xs font-medium text-muted-foreground/70 mb-1.5",children:p}),e[20]=p,e[21]=g):g=e[21],i=l.jsxs("div",{className:"flex flex-col gap-4",children:[m,l.jsxs("section",{children:[g,u.trim()?l.jsx(Ct,{id:`${t.toolCallId}-result`,text:u}):l.jsx("p",{className:"text-sm text-muted-foreground/60 italic",children:n("chat.subtask.running")})]})]}),e[3]=a,e[4]=t,e[5]=c,e[6]=n,e[7]=i}else i=e[7];return i}const Re=600;function Pa(s){const e=M.c(12),{part:t}=s,n=t.type??"";let a;e[0]!==t.toolName||e[1]!==n?(a=n==="dynamic-tool"?t.toolName??"tool":n.slice(5),e[0]=t.toolName,e[1]=n,e[2]=a):a=e[2];const o=a;let c;if(e[3]!==t.input){const m=t.input!=null?JSON.stringify(t.input):"";c=m.length>80?`${m.slice(0,80)}…`:m||void 0,e[3]=t.input,e[4]=c}else c=e[4];const i=c;let u;if(e[5]!==t.input){const m=t.input!=null?JSON.stringify(t.input,null,2):null;u=m&&m.length>Re?`${m.slice(0,Re)}
48
+ … (${m.length-Re} more characters)`:m,e[5]=t.input,e[6]=u}else u=e[6];const r=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(pt,{}),e[7]=f):f=e[7];let d;return e[8]!==r||e[9]!==o||e[10]!==i?(d=l.jsx(Y,{icon:f,title:o,summary:i,state:"idle",detail:r,detailVariant:"code"}),e[8]=r,e[9]=o,e[10]=i,e[11]=d):d=e[11],d}function La(s){const e=M.c(19),{jobId:t,prompt:n,items:a,streaming:o}=s,c=H();let i;e[0]!==c?(i=c("chat.subtask.taskLabel"),e[0]=c,e[1]=i):i=e[1];let u;e[2]!==i?(u=l.jsx("h3",{className:"text-xs font-medium text-muted-foreground/70 mb-1.5",children:i}),e[2]=i,e[3]=u):u=e[3];let r;e[4]!==n?(r=l.jsx("p",{className:"text-sm text-foreground/90 whitespace-pre-wrap wrap-break-word",children:n}),e[4]=n,e[5]=r):r=e[5];let f;e[6]!==u||e[7]!==r?(f=l.jsxs("section",{children:[u,r]}),e[6]=u,e[7]=r,e[8]=f):f=e[8];let d;e[9]!==a||e[10]!==t||e[11]!==o||e[12]!==c?(d=a.length===0?l.jsx("p",{className:"text-sm text-muted-foreground/60 italic py-1",children:c("chat.subtask.runningInBackground")}):a.map((g,x)=>{const h=g,y=h.type??"";return y==="text"?h.text?.trim()?l.jsx(Ie,{id:`${t}-sub-${x}`,part:g,animate:o},`${t}-sub-${x}`):null:y==="dynamic-tool"||y.startsWith("tool-")&&y!=="tool-todo_write"&&y!=="tool-update_interests"?l.jsx(Pa,{part:h},`${t}-sub-${x}`):null}),e[9]=a,e[10]=t,e[11]=o,e[12]=c,e[13]=d):d=e[13];let m;e[14]!==d?(m=l.jsx("section",{className:"flex flex-col gap-3 sm:gap-2",children:d}),e[14]=d,e[15]=m):m=e[15];let p;return e[16]!==f||e[17]!==m?(p=l.jsxs("div",{className:"flex flex-col gap-4",children:[f,m]}),e[16]=f,e[17]=m,e[18]=p):p=e[18],p}function Kt(s){const e=M.c(32),{part:t}=s,n=H(),a=t.output?.jobId,o=ve()?.taskId??null,{org:c}=me(),[i,u]=z.useState(!1),r=Ca(a),f=o??"",d=i&&!!o;let m;e[0]!==a||e[1]!==c.slug||e[2]!==f||e[3]!==d?(m={orgSlug:c.slug,threadId:f,jobId:a,enabled:d},e[0]=a,e[1]=c.slug,e[2]=f,e[3]=d,e[4]=m):m=e[4];const p=$a(m);let g;e[5]!==p.messages?(g=p.messages.flatMap(Ra),e[5]=p.messages,e[6]=g):g=e[6];const x=g;let h;e[7]!==r?(h=r.flatMap(Ea),e[7]=r,e[8]=h):h=e[8];const y=h,b=x.length>0?x:y;let k;e[9]!==t.input?.prompt||e[10]!==n?(k=t.input?.prompt??n("chat.subtask.noPromptProvided"),e[9]=t.input?.prompt,e[10]=n,e[11]=k):k=e[11];const j=k;let w;e[12]!==j?(w=j.length>120?`${j.slice(0,120)}…`:j,e[12]=j,e[13]=w):w=e[13];const S=w,N=r.length===0;let v;e[14]!==n?(v=n("chat.subtask.subtaskNoun"),e[14]=n,e[15]=v):v=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=l.jsx(He,{}),e[16]=_):_=e[16];let T;e[17]!==v?(T=l.jsx(Se,{icon:void 0,name:v,size:"2xs",className:"rounded-xs",fallbackIcon:_}),e[17]=v,e[18]=T):T=e[18];let A;e[19]!==n?(A=n("chat.subtask.subtaskNoun"),e[19]=n,e[20]=A):A=e[20];const P=N?"loading":"idle",E=p.streaming||N;let L;e[21]!==b||e[22]!==a||e[23]!==j||e[24]!==E?(L=l.jsx(La,{jobId:a,prompt:j,items:b,streaming:E}),e[21]=b,e[22]=a,e[23]=j,e[24]=E,e[25]=L):L=e[25];let I;return e[26]!==S||e[27]!==T||e[28]!==A||e[29]!==P||e[30]!==L?(I=l.jsx(Qe,{icon:T,title:A,summary:S,state:P,onOpenChange:u,children:L}),e[26]=S,e[27]=T,e[28]=A,e[29]=P,e[30]=L,e[31]=I):I=e[31],I}function Ea(s){return s.parts??[]}function Ra(s){return s.parts??[]}function za(s){const e=M.c(24),t=H(),n=Wt(s.part.toolCallId);if(Ut(s.part.output)){let x;return e[0]!==s?(x=l.jsx(Kt,{...s}),e[0]=s,e[1]=x):x=e[1],x}let a;e[2]!==s||e[3]!==t?(a=Ht(s,t),e[2]=s,e[3]=t,e[4]=a):a=e[4];const{fallbackTitle:o,summary:c,usage:i,state:u}=a;let r;e[5]!==t?(r=t("chat.subtask.subtaskNoun"),e[5]=t,e[6]=r):r=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(He,{}),e[7]=f):f=e[7];let d;e[8]!==r?(d=l.jsx(Se,{icon:void 0,name:r,size:"2xs",className:"rounded-xs",fallbackIcon:f}),e[8]=r,e[9]=d):d=e[9];let m;e[10]!==n||e[11]!==s.part?(m=n&&qt(s.part)?n:void 0,e[10]=n,e[11]=s.part,e[12]=m):m=e[12];let p;e[13]!==s.part?(p=l.jsx(Gt,{part:s.part}),e[13]=s.part,e[14]=p):p=e[14];let g;return e[15]!==o||e[16]!==s.latency||e[17]!==u||e[18]!==c||e[19]!==d||e[20]!==m||e[21]!==p||e[22]!==i?(g=l.jsx(Qe,{icon:d,title:o,summary:c,state:u,usage:i,latency:s.latency,onFlip:m,children:p}),e[15]=o,e[16]=s.latency,e[17]=u,e[18]=c,e[19]=d,e[20]=m,e[21]=p,e[22]=i,e[23]=g):g=e[23],g}function Da(s){const e=M.c(26),t=H(),n=It(s.part.input?.agent_id),a=Wt(s.part.toolCallId);if(Ut(s.part.output)){let b;return e[0]!==s?(b=l.jsx(Kt,{...s}),e[0]=s,e[1]=b):b=e[1],b}let o;e[2]!==s||e[3]!==t?(o=Ht(s,t),e[2]=s,e[3]=t,e[4]=o):o=e[4];const{fallbackTitle:c,summary:i,usage:u,state:r}=o,f=n?.icon;let d;e[5]!==t||e[6]!==n?.title?(d=n?.title??t("chat.subtask.subtaskNoun"),e[5]=t,e[6]=n?.title,e[7]=d):d=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=l.jsx(He,{}),e[8]=m):m=e[8];let p;e[9]!==f||e[10]!==d?(p=l.jsx(Se,{icon:f,name:d,size:"2xs",className:"rounded-xs",fallbackIcon:m}),e[9]=f,e[10]=d,e[11]=p):p=e[11];const g=n?.title??c;let x;e[12]!==a||e[13]!==s.part?(x=a&&qt(s.part)?a:void 0,e[12]=a,e[13]=s.part,e[14]=x):x=e[14];let h;e[15]!==s.part?(h=l.jsx(Gt,{part:s.part}),e[15]=s.part,e[16]=h):h=e[16];let y;return e[17]!==s.latency||e[18]!==r||e[19]!==i||e[20]!==p||e[21]!==g||e[22]!==x||e[23]!==h||e[24]!==u?(y=l.jsx(Qe,{icon:p,title:g,summary:i,state:r,usage:u,latency:s.latency,onFlip:x,children:h}),e[17]=s.latency,e[18]=r,e[19]=i,e[20]=p,e[21]=g,e[22]=x,e[23]=h,e[24]=u,e[25]=y):y=e[25],y}function Fa(s){const e=M.c(28),{part:t}=s,n=H();if(!t.state.startsWith("output-"))return null;const a=t.input?.plan??"",c=t.output?.approved===!0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx(Fe,{className:"size-4 text-special shrink-0"}),e[0]=i):i=e[0];let u;e[1]!==n?(u=n("chat.proposePlan.implementationPlan"),e[1]=n,e[2]=u):u=e[2];let r;e[3]!==u?(r=l.jsx("span",{className:"text-sm font-medium text-foreground/80",children:u}),e[3]=u,e[4]=r):r=e[4];let f;e[5]!==c||e[6]!==n?(f=c&&l.jsxs("span",{className:"flex items-center gap-1 text-xs text-success bg-success/10 px-1.5 py-0.5 rounded-md",children:[l.jsx(ct,{size:12}),n("chat.proposePlan.approved")]}),e[5]=c,e[6]=n,e[7]=f):f=e[7];let d;e[8]!==c||e[9]!==t.state||e[10]!==n?(d=!c&&t.state==="output-available"&&l.jsx("span",{className:"text-xs text-muted-foreground/70 italic",children:n("chat.proposePlan.rejected")}),e[8]=c,e[9]=t.state,e[10]=n,e[11]=d):d=e[11];let m;e[12]!==r||e[13]!==f||e[14]!==d?(m=l.jsxs("div",{className:"flex items-center gap-2",children:[i,r,f,d]}),e[12]=r,e[13]=f,e[14]=d,e[15]=m):m=e[15];let p;e[16]!==n?(p=n("chat.proposePlan.viewPlan"),e[16]=n,e[17]=p):p=e[17];let g;e[18]!==p?(g=l.jsx("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:p}),e[18]=p,e[19]=g):g=e[19];let x;e[20]!==a?(x=l.jsx("div",{className:"mt-1 pl-2 border-l-2 border-special/30 prose prose-sm max-w-none text-sm",children:l.jsx(Ie,{id:"plan-content",part:{type:"text",text:a}})}),e[20]=a,e[21]=x):x=e[21];let h;e[22]!==g||e[23]!==x?(h=l.jsxs("details",{className:"ml-6",children:[g,x]}),e[22]=g,e[23]=x,e[24]=h):h=e[24];let y;return e[25]!==h||e[26]!==m?(y=l.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[m,h]}),e[25]=h,e[26]=m,e[27]=y):y=e[27],y}function Ue(s){const e=M.c(4),{connection_id:t,iconSize:n}=s,a=n===void 0?"xs":n,o=It(t);if(!o)return null;let c;return e[0]!==o.icon||e[1]!==o.title||e[2]!==a?(c=l.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:l.jsx(Se,{icon:o.icon,name:o.title,size:a})}),e[0]=o.icon,e[1]=o.title,e[2]=a,e[3]=c):c=e[3],c}Ue.Fallback=function({iconSize:e="xs"}){const t=e==="sm"?"size-6":"size-5";return l.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:l.jsx("div",{className:G(t,"rounded bg-muted animate-pulse")})})};function he(s){const e=M.c(18),{connectionIds:t,maxVisibleIcons:n,iconSize:a,className:o}=s,c=n===void 0?2:n,i=a===void 0?"xs":a;if(t.length===0)return null;let u,r,f;if(e[0]!==o||e[1]!==t||e[2]!==i||e[3]!==c){const p=t.slice(0,c);u=t.length-c,e[7]!==o?(r=G("flex items-center justify-end -space-x-2",o),e[7]=o,e[8]=r):r=e[8];let g;e[9]!==i?(g=x=>l.jsx(z.Suspense,{fallback:l.jsx(Ue.Fallback,{iconSize:i}),children:l.jsx(Ue,{connection_id:x,iconSize:i})},x),e[9]=i,e[10]=g):g=e[10],f=p.map(g),e[0]=o,e[1]=t,e[2]=i,e[3]=c,e[4]=u,e[5]=r,e[6]=f}else u=e[4],r=e[5],f=e[6];let d;e[11]!==i||e[12]!==u?(d=u>0&&l.jsx("div",{className:G("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",i==="sm"?"size-8":"size-6"),children:l.jsxs("span",{className:G(i==="sm"?"text-sm":"text-xs","font-medium text-muted-foreground"),"aria-label":`and ${u} more`,children:["+",u]})}),e[11]=i,e[12]=u,e[13]=d):d=e[13];let m;return e[14]!==r||e[15]!==f||e[16]!==d?(m=l.jsxs("div",{className:r,children:[f,d]}),e[14]=r,e[15]=f,e[16]=d,e[17]=m):m=e[17],m}he.Fallback=function({maxVisibleIcons:e=2,totalCount:t,iconSize:n="xs"}){const a=n==="sm"?"size-6":"size-5",o=n==="sm"?"size-8":"size-6",c=t!==void 0&&t>e;return l.jsxs("div",{className:"flex items-center -space-x-2",children:[Array.from({length:e}).map((i,u)=>l.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:l.jsx("div",{className:G(a,"rounded bg-muted animate-pulse")})},u)),c&&l.jsx("div",{className:G("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",o),children:l.jsx("div",{className:G(n==="sm"?"h-3.5 w-5":"h-3 w-4","rounded bg-muted animate-pulse")})})]})};const Oa="This document certifies that the bearer agent has been granted authorized access to the tools and capabilities described herein. The agent is permitted to operate within the scope defined by its instructions and shall act in accordance with the constraints set forth by the issuing organization. This credential remains valid for the duration of the agent's active status. Unauthorized modification of this agent's permissions or scope is prohibited. The issuing authority reserves the right to revoke access at any time. All actions performed by this agent are subject to audit and review by the organization administrator. ",it=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)"):null;function Ba(s){const e=M.c(105),{part:t,latency:n}=s,a=H(),o=$t(),c=pe(t.state),i=z.useRef(null),u=z.useRef(null),r=z.useRef(null),f=z.useRef(null),d=z.useRef(null);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{it?.matches||(d.current=i.current?.getBoundingClientRect()??null,i.current&&(i.current.style.willChange="transform"))},e[0]=m):m=e[0];const p=m;let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=D=>{if(it?.matches)return;const O=d.current,q=i.current;if(!O||!q)return;const ae=(D.clientX-O.left)/O.width*100,le=(D.clientY-O.top)/O.height*100;q.style.transform=`perspective(800px) rotateY(${(ae-50)*.05}deg) rotateX(${(le-50)*-.05}deg)`,u.current&&(u.current.style.opacity="1",u.current.style.transform=`translate(${(ae-50)*.15}px, ${(le-50)*.15}px)`),r.current&&(r.current.style.opacity="0.45"),f.current&&(f.current.style.opacity="0.45")},e[1]=g):g=e[1];const x=g;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{const D=i.current;D&&(D.style.transform="none",D.style.willChange="auto"),u.current&&(u.current.style.opacity="0.4",u.current.style.transform="translate(0, 0)"),r.current&&(r.current.style.opacity="0.3"),f.current&&(f.current.style.opacity="0.3"),d.current=null},e[2]=h):h=e[2];const y=h;if(c==="loading"){let D;e[3]===Symbol.for("react.memo_cache_sentinel")?(D=l.jsx(de,{className:"animate-pulse"}),e[3]=D):D=e[3];let O;e[4]!==a?(O=a("chat.agentCreate.creating"),e[4]=a,e[5]=O):O=e[5];let q;return e[6]!==O?(q=l.jsx(Y,{icon:D,title:O,state:"loading",defaultOpen:!0}),e[6]=O,e[7]=q):q=e[7],q}if(c==="approval"){let D;e[8]===Symbol.for("react.memo_cache_sentinel")?(D=l.jsx(de,{}),e[8]=D):D=e[8];let O;e[9]!==a?(O=a("chat.agentCreate.createAgent"),e[9]=a,e[10]=O):O=e[10];let q;return e[11]!==O?(q=l.jsx(Y,{icon:D,title:O,state:"idle"}),e[11]=O,e[12]=q):q=e[12],q}if(c==="error"){let D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D=l.jsx(de,{}),e[13]=D):D=e[13];let O;e[14]!==t.state||e[15]!==a?(O=t.state==="output-denied"?a("chat.agentCreate.cancelled"):a("chat.agentCreate.couldntCreate"),e[14]=t.state,e[15]=a,e[16]=O):O=e[16];let q;e[17]!==n?(q=l.jsx(fe,{latency:n}),e[17]=n,e[18]=q):q=e[18];let ae;return e[19]!==O||e[20]!==q?(ae=l.jsx(Y,{icon:D,title:O,state:"error",trailing:q}),e[19]=O,e[20]=q,e[21]=ae):ae=e[21],ae}let b,k,j,w,S,N,v,_,T,A,P,E,L,I,$,C,R,F,B,U,W,V,X;if(e[22]!==n||e[23]!==o||e[24]!==t.output||e[25]!==a){R=Symbol.for("react.early_return_sentinel");e:{const D=Ke(t.output)?.item;if(!D?.id||!D?.title){let ie;e[49]===Symbol.for("react.memo_cache_sentinel")?(ie=l.jsx(de,{}),e[49]=ie):ie=e[49];let ce;e[50]!==a?(ce=a("chat.agentCreate.created"),e[50]=a,e[51]=ce):ce=e[51];let J;e[52]!==n?(J=l.jsx(fe,{latency:n}),e[52]=n,e[53]=J):J=e[53];let te;e[54]!==ce||e[55]!==J?(te=l.jsx(Y,{icon:ie,title:ce,state:"idle",trailing:J}),e[54]=ce,e[55]=J,e[56]=te):te=e[56],R=te;break e}const O=(D.connections??[]).map(Ua);let q;e[57]===Symbol.for("react.memo_cache_sentinel")?(q=l.jsx(de,{className:"text-success"}),e[57]=q):q=e[57];let ae;e[58]!==n?(ae=l.jsx(fe,{latency:n}),e[58]=n,e[59]=ae):ae=e[59],C=l.jsx(Y,{icon:q,title:a("chat.agentCreate.agentCreated",{name:D.title}),state:"idle",trailing:ae}),$="mt-2 overflow-hidden surface p-2.5",j=i,w="relative overflow-hidden rounded-lg bg-accent/25 p-2",e[60]===Symbol.for("react.memo_cache_sentinel")?(S={transition:"transform 0.3s ease-out"},e[60]=S):S=e[60],N=p,v=x,_=y,e[61]===Symbol.for("react.memo_cache_sentinel")?(T=l.jsx("div",{ref:u,className:"pointer-events-none absolute inset-[-20%] z-[1] select-none rounded-lg",style:{background:"linear-gradient(135deg, hsla(280, 60%, 80%, 0.35) 0%, transparent 35%), linear-gradient(315deg, hsla(190, 70%, 80%, 0.35) 0%, transparent 35%), linear-gradient(225deg, hsla(140, 55%, 80%, 0.3) 0%, transparent 30%), linear-gradient(45deg, hsla(320, 55%, 82%, 0.3) 0%, transparent 30%)",opacity:.4,transition:"opacity 0.3s ease, transform 0.3s ease-out"},"aria-hidden":"true"}),e[61]=T):T=e[61];let le;e[62]===Symbol.for("react.memo_cache_sentinel")?(le={textAlign:"justify",wordBreak:"break-all"},e[62]=le):le=e[62],e[63]===Symbol.for("react.memo_cache_sentinel")?(A=l.jsx("p",{className:"pointer-events-none absolute inset-0 z-[1] select-none overflow-hidden text-[6px] font-light leading-[1.5] tracking-[0.06px] text-background opacity-50 mix-blend-overlay",style:le,"aria-hidden":"true",children:Oa.repeat(6)}),P=l.jsx("img",{src:"/stamp.svg",alt:"",className:"pointer-events-none absolute -right-10 -top-10 size-[140px] opacity-50 select-none","aria-hidden":"true"}),e[63]=A,e[64]=P):(A=e[63],P=e[64]),e[65]===Symbol.for("react.memo_cache_sentinel")?(E=l.jsx("img",{ref:r,src:"/left-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 left-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[65]=E):E=e[65],e[66]===Symbol.for("react.memo_cache_sentinel")?(L=l.jsx("img",{ref:f,src:"/right-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 right-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[66]=L):L=e[66],I=l.jsxs("div",{className:"relative",children:[l.jsxs("div",{className:"flex items-center gap-2.5 p-2",children:[l.jsx(gt,{icon:D.icon,name:D.title,size:"md"}),l.jsx("div",{className:"flex-1 min-w-0",children:l.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:D.title})})]}),D.description&&l.jsx("div",{className:"px-2 pt-1 pr-16",children:l.jsx("p",{className:"text-sm leading-snug text-muted-foreground line-clamp-2",children:D.description})})]}),X="relative z-[3] flex items-center gap-2.5 px-2 pt-6 pb-1";const ue=O.length>0&&l.jsx(z.Suspense,{fallback:l.jsx(he.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:O.length}),children:l.jsx(he,{connectionIds:O,iconSize:"xs",maxVisibleIcons:3,className:"flex items-center justify-start -space-x-1"})});e[67]!==ue?(k=l.jsx("div",{className:"flex-1 min-w-0",children:ue}),e[67]=ue,e[68]=k):k=e[68],V="flex items-center gap-2 shrink-0",b=be,F="sm",B="h-7",U=()=>o(D.id),W=a("chat.agentCreate.seeAgentLabel",{name:D.title})}e[22]=n,e[23]=o,e[24]=t.output,e[25]=a,e[26]=b,e[27]=k,e[28]=j,e[29]=w,e[30]=S,e[31]=N,e[32]=v,e[33]=_,e[34]=T,e[35]=A,e[36]=P,e[37]=E,e[38]=L,e[39]=I,e[40]=$,e[41]=C,e[42]=R,e[43]=F,e[44]=B,e[45]=U,e[46]=W,e[47]=V,e[48]=X}else b=e[26],k=e[27],j=e[28],w=e[29],S=e[30],N=e[31],v=e[32],_=e[33],T=e[34],A=e[35],P=e[36],E=e[37],L=e[38],I=e[39],$=e[40],C=e[41],R=e[42],F=e[43],B=e[44],U=e[45],W=e[46],V=e[47],X=e[48];if(R!==Symbol.for("react.early_return_sentinel"))return R;let Z;e[69]!==a?(Z=a("chat.agentCreate.seeAgent"),e[69]=a,e[70]=Z):Z=e[70];let K;e[71]!==b||e[72]!==Z||e[73]!==F||e[74]!==B||e[75]!==U||e[76]!==W?(K=l.jsx(b,{size:F,className:B,onClick:U,"aria-label":W,children:Z}),e[71]=b,e[72]=Z,e[73]=F,e[74]=B,e[75]=U,e[76]=W,e[77]=K):K=e[77];let Q;e[78]!==K||e[79]!==V?(Q=l.jsx("div",{className:V,children:K}),e[78]=K,e[79]=V,e[80]=Q):Q=e[80];let ne;e[81]!==k||e[82]!==Q||e[83]!==X?(ne=l.jsxs("div",{className:X,children:[k,Q]}),e[81]=k,e[82]=Q,e[83]=X,e[84]=ne):ne=e[84];let oe;e[85]!==j||e[86]!==w||e[87]!==S||e[88]!==N||e[89]!==v||e[90]!==_||e[91]!==T||e[92]!==A||e[93]!==P||e[94]!==E||e[95]!==L||e[96]!==I||e[97]!==ne?(oe=l.jsxs("div",{ref:j,className:w,style:S,onMouseEnter:N,onMouseMove:v,onMouseLeave:_,children:[T,A,P,E,L,I,ne]}),e[85]=j,e[86]=w,e[87]=S,e[88]=N,e[89]=v,e[90]=_,e[91]=T,e[92]=A,e[93]=P,e[94]=E,e[95]=L,e[96]=I,e[97]=ne,e[98]=oe):oe=e[98];let ee;e[99]!==$||e[100]!==oe?(ee=l.jsx("div",{className:$,children:oe}),e[99]=$,e[100]=oe,e[101]=ee):ee=e[101];let re;return e[102]!==C||e[103]!==ee?(re=l.jsxs(l.Fragment,{children:[C,ee]}),e[102]=C,e[103]=ee,e[104]=re):re=e[104],re}function Ua(s){return s.connection_id}function Ha(s){const e=M.c(24),{agent:t}=s,n=$t();if(!t.id)return null;let a;e[0]!==t.connections?(a=t.connections??[],e[0]=t.connections,e[1]=a):a=e[1];let o;e[2]!==a?(o=a.map(qa),e[2]=a,e[3]=o):o=e[3];const c=o;let i;e[4]!==t.id||e[5]!==n?(i=()=>n(t.id),e[4]=t.id,e[5]=n,e[6]=i):i=e[6];let u;e[7]!==t.icon||e[8]!==t.title?(u=l.jsx(gt,{icon:t.icon,name:t.title,size:"sm"}),e[7]=t.icon,e[8]=t.title,e[9]=u):u=e[9];let r;e[10]!==t.title?(r=l.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[10]=t.title,e[11]=r):r=e[11];let f;e[12]!==t.description?(f=t.description&&l.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[12]=t.description,e[13]=f):f=e[13];let d;e[14]!==r||e[15]!==f?(d=l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r,f]}),e[14]=r,e[15]=f,e[16]=d):d=e[16];let m;e[17]!==c?(m=c.length>0&&l.jsx(z.Suspense,{fallback:l.jsx(he.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:c.length}),children:l.jsx(he,{connectionIds:c,iconSize:"xs",maxVisibleIcons:3})}),e[17]=c,e[18]=m):m=e[18];let p;return e[19]!==i||e[20]!==u||e[21]!==d||e[22]!==m?(p=l.jsxs("button",{type:"button",onClick:i,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-accent cursor-pointer",children:[u,d,m]}),e[19]=i,e[20]=u,e[21]=d,e[22]=m,e[23]=p):p=e[23],p}function qa(s){return s.connection_id}function Wa(s){const e=M.c(59),{part:t,latency:n}=s,a=H(),o=qe(),{org:c}=me();let i;e[0]!==t.state?(i=pe(t.state),e[0]=t.state,e[1]=i):i=e[1];const u=i;let r,f,d,m,p,g;if(e[2]!==n||e[3]!==t.output||e[4]!==t.state||e[5]!==u||e[6]!==a){g=Symbol.for("react.early_return_sentinel");e:{const b=Ke(t.output);if(f=Array.isArray(b?.items)?b.items:[],u==="loading"){let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(de,{className:"animate-pulse"}),e[13]=S):S=e[13];let N;e[14]!==a?(N=a("chat.agentList.loading"),e[14]=a,e[15]=N):N=e[15];let v;e[16]!==N?(v=l.jsx(Y,{icon:S,title:N,state:"loading"}),e[16]=N,e[17]=v):v=e[17],g=v;break e}if(u==="approval"){let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(de,{}),e[18]=S):S=e[18];let N;e[19]!==a?(N=a("chat.agentList.listAgents"),e[19]=a,e[20]=N):N=e[20];let v;e[21]!==N?(v=l.jsx(Y,{icon:S,title:N,state:"idle"}),e[21]=N,e[22]=v):v=e[22],g=v;break e}if(u==="error"){let S;e[23]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(de,{}),e[23]=S):S=e[23];let N;e[24]!==t.state||e[25]!==a?(N=t.state==="output-denied"?a("chat.agentList.unavailable"):a("chat.agentList.couldntLoad"),e[24]=t.state,e[25]=a,e[26]=N):N=e[26];let v;e[27]!==n?(v=l.jsx(fe,{latency:n}),e[27]=n,e[28]=v):v=e[28];let _;e[29]!==N||e[30]!==v?(_=l.jsx(Y,{icon:S,title:N,state:"error",trailing:v}),e[29]=N,e[30]=v,e[31]=_):_=e[31],g=_;break e}if(f.length===0){let S;e[32]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(de,{}),e[32]=S):S=e[32];let N;e[33]!==a?(N=a("chat.agentList.noAgents"),e[33]=a,e[34]=N):N=e[34];let v;e[35]!==a?(v=a("chat.agentList.noAgentsDesc"),e[35]=a,e[36]=v):v=e[36];let _;e[37]!==n?(_=l.jsx(fe,{latency:n}),e[37]=n,e[38]=_):_=e[38];let T;e[39]!==N||e[40]!==v||e[41]!==_?(T=l.jsx(Y,{icon:S,title:N,summary:v,state:"idle",trailing:_}),e[39]=N,e[40]=v,e[41]=_,e[42]=T):T=e[42],g=T;break e}const k=f.slice(0,At);r=f.length-k.length;let j;e[43]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx(de,{className:"text-success"}),e[43]=j):j=e[43];let w;e[44]!==n?(w=l.jsx(fe,{latency:n}),e[44]=n,e[45]=w):w=e[45],p=l.jsx(Y,{icon:j,title:f.length===1?a("chat.agentList.oneAgent"):a("chat.agentList.multiAgents",{count:f.length}),state:"idle",trailing:w}),d="mt-2 flex flex-col gap-1.5",m=k.map(Ga)}e[2]=n,e[3]=t.output,e[4]=t.state,e[5]=u,e[6]=a,e[7]=r,e[8]=f,e[9]=d,e[10]=m,e[11]=p,e[12]=g}else r=e[7],f=e[8],d=e[9],m=e[10],p=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let x;e[46]!==r||e[47]!==f||e[48]!==o||e[49]!==c||e[50]!==a?(x=r>0&&l.jsx(Pt,{count:f.length,noun:a("chat.agentList.agentsNoun"),onClick:()=>o({to:"/$org/settings/projects",params:{org:c.slug}})}),e[46]=r,e[47]=f,e[48]=o,e[49]=c,e[50]=a,e[51]=x):x=e[51];let h;e[52]!==d||e[53]!==m||e[54]!==x?(h=l.jsxs("div",{className:d,children:[m,x]}),e[52]=d,e[53]=m,e[54]=x,e[55]=h):h=e[55];let y;return e[56]!==p||e[57]!==h?(y=l.jsxs(l.Fragment,{children:[p,h]}),e[56]=p,e[57]=h,e[58]=y):y=e[58],y}function Ga(s){return l.jsx(Ha,{agent:s},s.id)}const Ka={active:"bg-success",inactive:"bg-muted-foreground",error:"bg-destructive"};function Va(s){const e=M.c(27),{connection:t}=s,n=qe(),{org:a}=me(),o=t.slug,c=t.description||t.app_name,i=!o||void 0;let u;e[0]!==n||e[1]!==a||e[2]!==o?(u=()=>o&&n({to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:o}}),e[0]=n,e[1]=a,e[2]=o,e[3]=u):u=e[3];let r;e[4]!==t.icon||e[5]!==t.title?(r=l.jsx(Se,{icon:t.icon,name:t.title,size:"sm"}),e[4]=t.icon,e[5]=t.title,e[6]=r):r=e[6];let f;e[7]!==t.title?(f=l.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[7]=t.title,e[8]=f):f=e[8];let d;e[9]!==c?(d=c&&l.jsx("span",{className:"truncate text-xs text-muted-foreground",children:c}),e[9]=c,e[10]=d):d=e[10];let m;e[11]!==f||e[12]!==d?(m=l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[f,d]}),e[11]=f,e[12]=d,e[13]=m):m=e[13];const p=Ka[t.status]??"bg-muted-foreground";let g;e[14]!==p?(g=G("size-2 shrink-0 rounded-full",p),e[14]=p,e[15]=g):g=e[15];let x;e[16]!==g?(x=l.jsx("span",{className:g,"aria-hidden":"true"}),e[16]=g,e[17]=x):x=e[17];let h;e[18]!==t.status?(h=l.jsx("span",{className:"sr-only",children:t.status}),e[18]=t.status,e[19]=h):h=e[19];let y;return e[20]!==i||e[21]!==h||e[22]!==u||e[23]!==r||e[24]!==m||e[25]!==x?(y=l.jsxs("button",{type:"button","aria-disabled":i,onClick:u,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-accent cursor-pointer aria-disabled:cursor-default aria-disabled:hover:bg-card",children:[r,m,x,h]}),e[20]=i,e[21]=h,e[22]=u,e[23]=r,e[24]=m,e[25]=x,e[26]=y):y=e[26],y}function Ja(s){const e=M.c(54),{part:t,latency:n}=s,a=H(),o=qe(),{org:c}=me();let i;e[0]!==t.state?(i=pe(t.state),e[0]=t.state,e[1]=i):i=e[1];const u=i;let r,f,d,m,p,g;if(e[2]!==n||e[3]!==t.output||e[4]!==t.state||e[5]!==u||e[6]!==a){g=Symbol.for("react.early_return_sentinel");e:{const b=Ke(t.output);if(f=(Array.isArray(b?.items)?b.items:[]).filter(Xa),u==="loading"||u==="approval"){let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(we,{className:"animate-pulse"}),e[13]=S):S=e[13];let N;e[14]!==a?(N=a("chat.connectionList.loadingTitle"),e[14]=a,e[15]=N):N=e[15];let v;e[16]!==N?(v=l.jsx(Y,{icon:S,title:N,state:"loading"}),e[16]=N,e[17]=v):v=e[17],g=v;break e}if(u==="error"){let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(we,{}),e[18]=S):S=e[18];let N;e[19]!==t.state||e[20]!==a?(N=t.state==="output-denied"?a("chat.connectionList.unavailableTitle"):a("chat.connectionList.errorTitle"),e[19]=t.state,e[20]=a,e[21]=N):N=e[21];let v;e[22]!==n?(v=l.jsx(fe,{latency:n}),e[22]=n,e[23]=v):v=e[23];let _;e[24]!==N||e[25]!==v?(_=l.jsx(Y,{icon:S,title:N,state:"error",trailing:v}),e[24]=N,e[25]=v,e[26]=_):_=e[26],g=_;break e}if(f.length===0){let S;e[27]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(we,{}),e[27]=S):S=e[27];let N;e[28]!==a?(N=a("chat.connectionList.emptyTitle"),e[28]=a,e[29]=N):N=e[29];let v;e[30]!==a?(v=a("chat.connectionList.emptySummary"),e[30]=a,e[31]=v):v=e[31];let _;e[32]!==n?(_=l.jsx(fe,{latency:n}),e[32]=n,e[33]=_):_=e[33];let T;e[34]!==N||e[35]!==v||e[36]!==_?(T=l.jsx(Y,{icon:S,title:N,summary:v,state:"idle",trailing:_}),e[34]=N,e[35]=v,e[36]=_,e[37]=T):T=e[37],g=T;break e}const k=f.slice(0,At);r=f.length-k.length;let j;e[38]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx(we,{className:"text-success"}),e[38]=j):j=e[38];let w;e[39]!==n?(w=l.jsx(fe,{latency:n}),e[39]=n,e[40]=w):w=e[40],p=l.jsx(Y,{icon:j,title:f.length===1?a("chat.connectionList.singleConnection"):a("chat.connectionList.multipleConnections",{count:f.length}),state:"idle",trailing:w}),d="mt-2 flex flex-col gap-1.5",m=k.map(Qa)}e[2]=n,e[3]=t.output,e[4]=t.state,e[5]=u,e[6]=a,e[7]=r,e[8]=f,e[9]=d,e[10]=m,e[11]=p,e[12]=g}else r=e[7],f=e[8],d=e[9],m=e[10],p=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let x;e[41]!==r||e[42]!==f||e[43]!==o||e[44]!==c||e[45]!==a?(x=r>0&&l.jsx(Pt,{count:f.length,noun:a("chat.connectionList.connectionNoun"),onClick:()=>o({to:"/$org/settings/connections",params:{org:c.slug}})}),e[41]=r,e[42]=f,e[43]=o,e[44]=c,e[45]=a,e[46]=x):x=e[46];let h;e[47]!==d||e[48]!==m||e[49]!==x?(h=l.jsxs("div",{className:d,children:[m,x]}),e[47]=d,e[48]=m,e[49]=x,e[50]=h):h=e[50];let y;return e[51]!==p||e[52]!==h?(y=l.jsxs(l.Fragment,{children:[p,h]}),e[51]=p,e[52]=h,e[53]=y):y=e[53],y}function Qa(s){return l.jsx(Va,{connection:s},s.id)}function Xa(s){return s.connection_type!=="VIRTUAL"}function Ya(){const s=M.c(46),e=H(),t=ve(),{sendMessage:n,isStreaming:a,messages:o}=Ks(),{org:c}=me(),i=t?.virtualMcpId,{prompts:u}=cn(c.slug),r=i??null;let f;s[0]!==c.id||s[1]!==c.slug||s[2]!==r?(f={connectionId:r,orgId:c.id,orgSlug:c.slug},s[0]=c.id,s[1]=c.slug,s[2]=r,s[3]=f):f=s[3];let d;s[4]!==i?(d=!!i&&et(i),s[4]=i,s[5]=d):d=s[5];let m;s[6]!==d?(m={enabled:d},s[6]=d,s[7]=m):m=s[7];const p=sn(f,m),[g,x]=z.useState(null);if(!i||a||!et(i)||!o.some(Za))return null;let y;if(s[8]!==u||s[9]!==i){let C;s[11]!==i?(C=R=>R.agentId===i&&R.promptName,s[11]=i,s[12]=C):C=s[12],y=u.find(C),s[8]=u,s[9]=i,s[10]=y}else y=s[10];const b=y;if(!b)return null;let k;s[13]!==p||s[14]!==n||s[15]!==e?(k=async(C,R)=>{if(!p){ze.error(e("chat.nextActionChip.mcpClientNotAvailable"));return}try{const F=await xn(p,C.name,R);await n({type:"doc",content:[{type:"paragraph",content:[Ps({id:C.name,name:wt(C.name,kt(C._meta)),metadata:F.messages,char:"/",kind:"prompt",args:R}),{type:"text",text:" "}]}]})}catch(F){console.error("[next-action-chip] failed",F),ze.error(e("chat.nextActionChip.failedLoadPrompt"))}},s[13]=p,s[14]=n,s[15]=e,s[16]=k):k=s[16];const j=k;let w;s[17]!==b._meta||s[18]!==b.arguments||s[19]!==b.description||s[20]!==b.promptName||s[21]!==b.title||s[22]!==j?(w=()=>{const C={name:b.promptName,title:b.title,description:b.description,arguments:b.arguments,_meta:b._meta};if(C.arguments&&C.arguments.length>0){x(C);return}j(C)},s[17]=b._meta,s[18]=b.arguments,s[19]=b.description,s[20]=b.promptName,s[21]=b.title,s[22]=j,s[23]=w):w=s[23];const S=w;let N;s[24]===Symbol.for("react.memo_cache_sentinel")?(N=l.jsx(gn,{className:"size-3 shrink-0 text-special"}),s[24]=N):N=s[24];let v;s[25]!==e?(v=e("chat.nextActionChip.next"),s[25]=e,s[26]=v):v=s[26];let _;s[27]!==v?(_=l.jsx("span",{className:"font-medium text-foreground/80",children:v}),s[27]=v,s[28]=_):_=s[28];let T;s[29]!==b.title?(T=l.jsx("span",{className:"truncate",children:b.title}),s[29]=b.title,s[30]=T):T=s[30];let A;s[31]===Symbol.for("react.memo_cache_sentinel")?(A=l.jsx(xt,{className:"size-3 shrink-0 transition-transform duration-150 group-hover:translate-x-0.5"}),s[31]=A):A=s[31];let P;s[32]!==S||s[33]!==T||s[34]!==_?(P=l.jsxs(be,{type:"button",variant:"outline",size:"sm",onClick:S,className:"group mt-3 self-start text-muted-foreground",children:[N,_,T,A]}),s[32]=S,s[33]=T,s[34]=_,s[35]=P):P=s[35];let E;s[36]===Symbol.for("react.memo_cache_sentinel")?(E=C=>x(C),s[36]=E):E=s[36];let L;s[37]!==g||s[38]!==j?(L=async C=>{const R=g;x(null),R&&await j(R,C)},s[37]=g,s[38]=j,s[39]=L):L=s[39];let I;s[40]!==g||s[41]!==L?(I=l.jsx(Ls,{prompt:g,setPrompt:E,onSubmit:L}),s[40]=g,s[41]=L,s[42]=I):I=s[42];let $;return s[43]!==P||s[44]!==I?($=l.jsxs(l.Fragment,{children:[P,I]}),s[43]=P,s[44]=I,s[45]=$):$=s[45],$}function Za(s){return s.role==="user"||s.parts.some(el)}function el(s){return s.type==="tool-user_ask"&&s.state==="output-available"}function tl(s){const e=M.c(25),{event:t}=s,n=H(),[a,o]=z.useState(!1);let c;e[0]!==t.data?(c=JSON.stringify(t.data,null,2),e[0]=t.data,e[1]=c):c=e[1];const i=c;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>o(sl),e[2]=u):u=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=l.jsx(Ss,{className:"size-4 shrink-0 text-muted-foreground"}),e[3]=r):r=e[3];let f;e[4]!==n?(f=n("chat.triggerEventPart.triggeredByEvent"),e[4]=n,e[5]=f):f=e[5];let d;e[6]!==f?(d=l.jsx("span",{className:"font-medium",children:f}),e[6]=f,e[7]=d):d=e[7];let m;e[8]!==t.type?(m=l.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:t.type}),e[8]=t.type,e[9]=m):m=e[9];const p=a&&"rotate-180";let g;e[10]!==p?(g=G("ml-auto size-4 shrink-0 text-muted-foreground transition-transform",p),e[10]=p,e[11]=g):g=e[11];let x;e[12]!==g?(x=l.jsx(hn,{className:g}),e[12]=g,e[13]=x):x=e[13];let h;e[14]!==d||e[15]!==m||e[16]!==x?(h=l.jsxs("button",{type:"button",onClick:u,className:"flex w-full items-center gap-2 px-3 py-2 text-sm cursor-pointer",children:[r,d,m,x]}),e[14]=d,e[15]=m,e[16]=x,e[17]=h):h=e[17];let y;e[18]!==t.source||e[19]!==a||e[20]!==i?(y=a&&l.jsxs("div",{className:"border-t border-border/60 px-3 py-2",children:[l.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:t.source}),l.jsx("pre",{className:"overflow-auto whitespace-pre-wrap break-words text-xs text-foreground",children:i})]}),e[18]=t.source,e[19]=a,e[20]=i,e[21]=y):y=e[21];let b;return e[22]!==h||e[23]!==y?(b=l.jsxs("div",{className:"rounded-lg border border-border/60 bg-background overflow-hidden text-left",children:[h,y]}),e[22]=h,e[23]=y,e[24]=b):b=e[24],b}function sl(s){return!s}const nl=[Ds.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1}),Rs,zs];function al(s){const e=M.c(5),{tiptapDoc:t}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={attributes:{class:"prose prose-sm max-w-none focus:outline-none"}},e[0]=n):n=e[0];let a;e[1]!==t?(a={extensions:nl,content:t,editable:!1,editorProps:n},e[1]=t,e[2]=a):a=e[2];const o=Es(a);if(!o)return null;let c;return e[3]!==o?(c=l.jsx(Fs,{editor:o,className:"[&_.ProseMirror]:outline-none [&_.ProseMirror]:cursor-text"}),e[3]=o,e[4]=c):c=e[4],c}function Vt(s){const e=M.c(38),{message:t,className:n,onScrollToPair:a}=s,{id:o,parts:c,metadata:i}=t,[u,r]=z.useState(!1),[f,d]=z.useState(!1),m=z.useRef(!1);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=I=>{I&&!m.current&&(m.current=!0,d(I.scrollHeight>I.clientHeight))},e[0]=p):p=e[0];const g=p;if(!c||c.length===0)return null;let x;e[1]!==a?(x=()=>{r(!0),a?.()},e[1]=a,e[2]=x):x=e[2];const h=x,y=i?.tiptapDoc;let b;e[3]!==n?(b=G("message-block w-full min-w-0 relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",n),e[3]=n,e[4]=b):b=e[4];let k,j;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=()=>r(!0),j=()=>r(!1),e[5]=k,e[6]=j):(k=e[5],j=e[6]);let w;e[7]===Symbol.for("react.memo_cache_sentinel")?(w=l.jsx("div",{className:"absolute inset-0 bg-muted/75 rounded-lg pointer-events-none"}),e[7]=w):w=e[7];let S;e[8]!==u||e[9]!==f?(S=G("z-10 px-4 py-2 flex-1 transition-[max-height,opacity] duration-300 ease-out",u?"max-h-[50vh] overflow-auto opacity-100":G("max-h-[84px] overflow-hidden opacity-99",f&&"mask-b-from-1%")),e[8]=u,e[9]=f,e[10]=S):S=e[10];let N;if(e[11]!==o||e[12]!==c){let I;e[14]!==o?(I=($,C)=>$.type==="data-trigger-event"?l.jsx(tl,{event:$.data},`${o}-${C}`):null,e[14]=o,e[15]=I):I=e[15],N=c.map(I),e[11]=o,e[12]=c,e[13]=N}else N=e[13];let v;e[16]!==y||e[17]!==o||e[18]!==i||e[19]!==c?(v=y?l.jsx(al,{tiptapDoc:i.tiptapDoc}):c.map((I,$)=>I.type==="text"?c[$-1]?.type==="data-trigger-event"?null:l.jsx(Ie,{id:o,part:I},`${o}-${$}`):null),e[16]=y,e[17]=o,e[18]=i,e[19]=c,e[20]=v):v=e[20];let _;e[21]!==N||e[22]!==v?(_=l.jsxs("div",{className:"flex flex-col gap-2",children:[N,v]}),e[21]=N,e[22]=v,e[23]=_):_=e[23];let T;e[24]!==_||e[25]!==S?(T=l.jsx("div",{ref:g,className:S,children:_}),e[24]=_,e[25]=S,e[26]=T):T=e[26];let A;e[27]!==h||e[28]!==T?(A=l.jsxs("div",{tabIndex:0,onClick:h,onFocus:k,onBlur:j,className:"w-full border border-border/60 min-w-0 shadow-xs rounded-lg text-sm wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[w,T]}),e[27]=h,e[28]=T,e[29]=A):A=e[29];let P;e[30]!==t?(P=l.jsx(Lt,{message:t,className:"mt-1 mr-1 self-end"}),e[30]=t,e[31]=P):P=e[31];let E;e[32]!==A||e[33]!==P?(E=l.jsxs("div",{className:"w-full min-w-0 flex flex-col",children:[A,P]}),e[32]=A,e[33]=P,e[34]=E):E=e[34];let L;return e[35]!==E||e[36]!==b?(L=l.jsx(l.Fragment,{children:l.jsx("div",{className:b,children:E})}),e[35]=E,e[36]=b,e[37]=L):L=e[37],L}function Jt(s){const e=M.c(10),{message:t,pending:n}=s,a=H();let o;e[0]!==n||e[1]!==a?(o=a(n?"chat.liveMessage.pending":"chat.liveMessage.readByAgent"),e[0]=n,e[1]=a,e[2]=o):o=e[2];let c;e[3]!==o?(c=l.jsx("span",{className:"self-end px-3 text-xs text-muted-foreground",children:o}),e[3]=o,e[4]=c):c=e[4];let i;e[5]!==t?(i=l.jsx(Vt,{message:t}),e[5]=t,e[6]=i):i=e[6];let u;return e[7]!==c||e[8]!==i?(u=l.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[c,i]}),e[7]=c,e[8]=i,e[9]=u):u=e[9],u}function ll(s){const e=M.c(5),{part:t}=s,{read:n}=bt();let a;if(e[0]!==t||e[1]!==n){const i=Vs(t);a=i?n.get(i):void 0,e[0]=t,e[1]=n,e[2]=a}else a=e[2];const o=a;if(!o)return null;let c;return e[3]!==o?(c=l.jsx(Jt,{message:o,pending:!1}),e[3]=o,e[4]=c):c=e[4],c}function ol(s){const e=new Map;for(let t=s.length-1;t>=0;t--){const n=s[t]?.parts;if(n)for(const a of n){const o=a;if(o.type!=="data-deck-updated")continue;const c=o.data;if(!c?.path)continue;const i=`deck:${c.path}`;e.has(i)||e.set(i,{tabId:cs(c.path),label:c.name||c.path,kind:c.kind==="page"?"page":"deck"})}}return Array.from(e.values())}function rl(){const s=M.c(9),e=H(),{openPanel:t}=Ve(),n=je()?.messages??[],a=ol(n);if(a.length===0)return null;const o=a.some(cl),c=a.some(il),i=e(o?c?"chat.threadHtmlPreviews.slidesAndPages":"chat.threadHtmlPreviews.slides":"chat.threadHtmlPreviews.pages"),u="flex flex-col gap-1.5 py-2";let r;s[0]!==i?(r=l.jsx("div",{className:"text-xs text-muted-foreground/70",children:i}),s[0]=i,s[1]=r):r=s[1];const f="flex flex-wrap gap-2";let d;s[2]!==t?(d=x=>l.jsxs(be,{type:"button",variant:"outline",className:"max-w-full",onClick:()=>t(x.tabId),children:[x.kind==="deck"?l.jsx(bn,{className:"size-3.5 shrink-0 text-muted-foreground"}):l.jsx(Ns,{className:"size-3.5 shrink-0 text-muted-foreground"}),l.jsx("span",{className:"truncate font-medium text-foreground",children:x.label})]},x.tabId),s[2]=t,s[3]=d):d=s[3];const m=a.map(d);let p;s[4]!==m?(p=l.jsx("div",{className:f,children:m}),s[4]=m,s[5]=p):p=s[5];let g;return s[6]!==r||s[7]!==p?(g=l.jsxs("div",{className:u,children:[r,p]}),s[6]=r,s[7]=p,s[8]=g):g=s[8],g}function il(s){return s.kind==="page"}function cl(s){return s.kind==="deck"}function ul(s){const e=M.c(29),{file:t}=s,n=H(),{openPanel:a}=Ve();let o;e[0]!==t.key||e[1]!==a?(o=()=>a(us(t.key)),e[0]=t.key,e[1]=a,e[2]=o):o=e[2];const c=o;let i;e[3]!==t.filename?(i=l.jsx(vn,{filename:t.filename,className:"h-5 w-4 shrink-0"}),e[3]=t.filename,e[4]=i):i=e[4];let u;e[5]!==t.filename||e[6]!==c?(u=l.jsx("button",{type:"button",onClick:c,className:"min-w-0 flex-1 truncate text-left text-sm font-medium text-foreground hover:underline",title:t.filename,children:t.filename}),e[5]=t.filename,e[6]=c,e[7]=u):u=e[7];const r=t.downloadUrl,f=t.filename;let d;e[8]!==n?(d=n("chat.outputFileRow.download"),e[8]=n,e[9]=d):d=e[9];let m;e[10]!==t.filename||e[11]!==n?(m=n("chat.outputFileRow.downloadFile",{filename:t.filename}),e[10]=t.filename,e[11]=n,e[12]=m):m=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=l.jsx(jn,{className:"size-3.5"}),e[13]=p):p=e[13];let g;e[14]!==t.downloadUrl||e[15]!==t.filename||e[16]!==d||e[17]!==m?(g=l.jsx("a",{href:r,download:f,className:"hidden shrink-0 text-muted-foreground hover:text-foreground group-hover:block group-focus-within:block",title:d,"aria-label":m,children:p}),e[14]=t.downloadUrl,e[15]=t.filename,e[16]=d,e[17]=m,e[18]=g):g=e[18];let x;e[19]!==n?(x=n("chat.outputFileRow.open"),e[19]=n,e[20]=x):x=e[20];let h;e[21]!==c||e[22]!==x?(h=l.jsx(be,{variant:"outline",size:"sm",className:"h-7 shrink-0 px-2.5 text-xs",onClick:c,children:x}),e[21]=c,e[22]=x,e[23]=h):h=e[23];let y;return e[24]!==h||e[25]!==i||e[26]!==u||e[27]!==g?(y=l.jsxs("div",{className:"group flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-2",children:[i,u,g,h]}),e[24]=h,e[25]=i,e[26]=u,e[27]=g,e[28]=y):y=e[28],y}function dl(s){return s.split("/").pop()??s}const fl=/(^|\/)output\//;function ml(s){const e=new Set;for(const t of s.parts??[]){const n=t;if(n.state==="output-available"&&n.type==="tool-write"){const a=n.input?.path;a&&fl.test(a)&&e.add(dl(a))}}return e}function pl(s){const e=M.c(4),{threadId:t,message:n}=s,a=ml(n),o=a.size>0;let c;e[0]!==o?(c={enabled:o},e[0]=o,e[1]=c):c=e[1];const{data:i}=yn(t,c);if(a.size===0)return null;const u=(i??[]).filter(m=>a.has(m.filename));if(u.length===0)return null;const r="flex flex-col gap-1.5 py-2",f=u.map(gl);let d;return e[2]!==f?(d=l.jsx("div",{className:r,children:f}),e[2]=f,e[3]=d):d=e[3],d}function gl(s){return l.jsx(ul,{file:s},s.key)}function xl(s){return s.type==="reasoning"}function hl(s){const e=[],t=new Set,n=new Map,a=new Map,o=new Map;if(s){let i=null;for(let u=0;u<s.parts.length;u++){const r=s.parts[u];if(xl(r)){i||(i={parts:[],startIndex:u},e.push(i)),i.parts.push(r),t.add(u);continue}if(i=null,r.type==="data-tool-metadata"&&"id"in r&&"data"in r){const f=r.data,d={};f.annotations&&(d.annotations=f.annotations),typeof f.latencyMs=="number"&&Number.isFinite(f.latencyMs)&&(d.latencySeconds=f.latencyMs/1e3),typeof f.outputBytes=="number"&&Number.isFinite(f.outputBytes)&&f.outputBytes>=0&&(d.outputBytes=f.outputBytes),f._meta&&typeof f._meta=="object"&&(d._meta=f._meta),n.set(r.id,d);continue}if(r.type==="data-tool-subtask-metadata"&&"id"in r){a.set(r.id,r.data);continue}if(r.type==="data-web-search"&&"id"in r&&"data"in r){const f=r.id,d=r.data;o.set(f,d.text??"");continue}}}const c=[];if(s)for(let i=0;i<s.parts.length;i++){const u=s.parts[i];if(u.type!=="step-start"){if(t.has(i)){const r=e.find(f=>f.startIndex===i);r&&c.push({kind:"reasoning-group",group:r});continue}u.type.startsWith("data-")&&u.type!==$e||c.push({kind:"part",index:i})}}return{reasoningGroups:e,renderOrder:c,dataParts:{toolMetadata:n,toolSubtaskMetadata:a,webSearchStreaming:o}}}const bl=3;function yl(s,e){let t=-1;for(let o=s.length-1;o>=0;o--){const c=s[o];if(c.kind==="part"&&e[c.index]?.type==="text"){t=o;break}}if(t===-1)return{collapsed:[],tail:s};const n=s.findLastIndex(o=>o.kind==="part"&&e[o.index]?.type===$e),a=n!==-1&&n<t?n:t;return{collapsed:s.slice(0,a),tail:s.slice(a)}}function Qt(s,e){return s.kind==="part"&&e[s.index]?.type!==$e}function jl(s,e){let t=0,n=0;for(const a of s)if(a.kind==="reasoning-group")n++;else{const o=e[a.index]?.type;o==="text"?n++:(o==="dynamic-tool"||o?.startsWith("tool-"))&&o!=="tool-todo_write"&&o!=="tool-update_interests"&&t++}return{toolCalls:t,messages:n}}function vl(s){const e=M.c(10),{toolCalls:t,messages:n}=s,a=H();let o;e[0]!==n||e[1]!==a||e[2]!==t?(o=t>0&&l.jsxs(l.Fragment,{children:[l.jsx(pt,{className:"size-3.5 shrink-0"}),l.jsxs("span",{children:[a("chat.assistant.toolCallPlural",{count:t}),n>0?",":""]})]}),e[0]=n,e[1]=a,e[2]=t,e[3]=o):o=e[3];let c;e[4]!==n||e[5]!==a?(c=n>0&&l.jsxs(l.Fragment,{children:[l.jsx(ks,{className:"size-3.5 shrink-0"}),l.jsx("span",{children:a("chat.assistant.messagePlural",{count:n})})]}),e[4]=n,e[5]=a,e[6]=c):c=e[6];let i;return e[7]!==o||e[8]!==c?(i=l.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[o,c]}),e[7]=o,e[8]=c,e[9]=i):i=e[9],i}function Sl(s){const e=M.c(28),{items:t,message:n,reasoningGroups:a,isReasoningActive:o,totalDuration:c,dataParts:i,isLoading:u,isLast:r}=s;let f;e[0]!==t||e[1]!==n.parts?(f=jl(t,n.parts),e[0]=t,e[1]=n.parts,e[2]=f):f=e[2];const{toolCalls:d,messages:m}=f;if(d===0&&m===0)return null;let p;e[3]!==m||e[4]!==d?(p=l.jsx(vl,{toolCalls:d,messages:m}),e[3]=m,e[4]=d,e[5]=p):p=e[5];let g;if(e[6]!==i||e[7]!==r||e[8]!==u||e[9]!==o||e[10]!==t||e[11]!==n||e[12]!==a||e[13]!==c){let y;e[15]!==i||e[16]!==r||e[17]!==u||e[18]!==o||e[19]!==n||e[20]!==a||e[21]!==c?(y=(b,k)=>Xt({item:b,renderIndex:k,message:n,reasoningGroups:a,isReasoningActive:o,totalDuration:c,dataParts:i,isLoading:u,isLast:r,isLastVisiblePart:!1}),e[15]=i,e[16]=r,e[17]=u,e[18]=o,e[19]=n,e[20]=a,e[21]=c,e[22]=y):y=e[22],g=t.map(y),e[6]=i,e[7]=r,e[8]=u,e[9]=o,e[10]=t,e[11]=n,e[12]=a,e[13]=c,e[14]=g}else g=e[14];let x;e[23]!==g?(x=l.jsx("div",{className:"flex flex-col gap-3 sm:gap-2 pt-1",children:g}),e[23]=g,e[24]=x):x=e[24];let h;return e[25]!==p||e[26]!==x?(h=l.jsx(Y,{icon:null,alwaysChevron:!0,title:p,state:"idle",children:x}),e[25]=p,e[26]=x,e[27]=h):h=e[27],h}function Xt({item:s,renderIndex:e,message:t,reasoningGroups:n,isReasoningActive:a,totalDuration:o,dataParts:c,isLoading:i,isLast:u,isLastVisiblePart:r,renderOrder:f}){if(s.kind==="reasoning-group"){const{group:g}=s,x=g===n[n.length-1],h=a&&x;if(!g.parts.some(k=>k.text?.trim())&&!h)return null;const b=n.length===1?o:null;return l.jsx(En,{duration:b,parts:g.parts,isStreaming:h},`${t.id}-reasoning-${g.startIndex}`)}const d=t.parts[s.index],m=r||(f?f.findLastIndex(g=>Qt(g,t.parts))===e:!1),p=m?Js(Qs(),t.metadata?.usage):null;return l.jsx(Nl,{part:d,id:t.id,usageStats:m&&l.jsx(Os,{usage:p,duration:o}),dataParts:c,isLoading:i,isLastMessage:u},`${t.id}-${s.index}`)}function Nl(s){const e=M.c(114),{part:t,id:n,usageStats:a,dataParts:o,isLoading:c,isLastMessage:i}=s;let u;e[0]!==o.toolMetadata?(u=m=>o.toolMetadata.get(m),e[0]=o.toolMetadata,e[1]=u):u=e[1];const r=u;let f;e[2]!==o.toolSubtaskMetadata?(f=m=>o.toolSubtaskMetadata.get(m),e[2]=o.toolSubtaskMetadata,e[3]=f):f=e[3];const d=f;switch(t.type){case"dynamic-tool":{let m;e[4]!==r||e[5]!==t.toolCallId?(m=r(t.toolCallId)?.annotations,e[4]=r,e[5]=t.toolCallId,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==t.toolCallId?(p=r(t.toolCallId)?.latencySeconds,e[7]=r,e[8]=t.toolCallId,e[9]=p):p=e[9];let g;e[10]!==r||e[11]!==t.toolCallId?(g=r(t.toolCallId)?.outputBytes,e[10]=r,e[11]=t.toolCallId,e[12]=g):g=e[12];let x;e[13]!==r||e[14]!==t.toolCallId?(x=r(t.toolCallId)?._meta,e[13]=r,e[14]=t.toolCallId,e[15]=x):x=e[15];let h;return e[16]!==i||e[17]!==t||e[18]!==m||e[19]!==p||e[20]!==g||e[21]!==x?(h=l.jsx(lt,{part:t,annotations:m,latency:p,outputBytes:g,isLastMessage:i,toolMeta:x}),e[16]=i,e[17]=t,e[18]=m,e[19]=p,e[20]=g,e[21]=x,e[22]=h):h=e[22],h}case"tool-todo_write":return null;case"tool-update_interests":return null;case"tool-user_ask":{let m;e[23]!==r||e[24]!==t.toolCallId?(m=r(t.toolCallId)?.latencySeconds,e[23]=r,e[24]=t.toolCallId,e[25]=m):m=e[25];let p;return e[26]!==t||e[27]!==m?(p=l.jsx(_a,{part:t,latency:m}),e[26]=t,e[27]=m,e[28]=p):p=e[28],p}case"tool-suggest_task":{let m;return e[29]!==t?(m=l.jsx(Ta,{part:t}),e[29]=t,e[30]=m):m=e[30],m}case"tool-propose_plan":{let m;return e[31]!==t?(m=l.jsx(Fa,{part:t}),e[31]=t,e[32]=m):m=e[32],m}case"tool-generate_image":{let m;e[33]!==r||e[34]!==t.toolCallId?(m=r(t.toolCallId)?.latencySeconds,e[33]=r,e[34]=t.toolCallId,e[35]=m):m=e[35];let p;return e[36]!==t||e[37]!==m?(p=l.jsx(ma,{part:t,latency:m}),e[36]=t,e[37]=m,e[38]=p):p=e[38],p}case"tool-web_search":case"tool-deep_research":{let m;e[39]!==r||e[40]!==t.toolCallId?(m=r(t.toolCallId)?.latencySeconds,e[39]=r,e[40]=t.toolCallId,e[41]=m):m=e[41];let p;e[42]!==o.webSearchStreaming||e[43]!==t.toolCallId?(p=o.webSearchStreaming.get(t.toolCallId),e[42]=o.webSearchStreaming,e[43]=t.toolCallId,e[44]=p):p=e[44];let g;return e[45]!==t||e[46]!==m||e[47]!==p?(g=l.jsx(wa,{part:t,latency:m,streamingText:p}),e[45]=t,e[46]=m,e[47]=p,e[48]=g):g=e[48],g}case"tool-subtask":{let m;e[49]!==d||e[50]!==t.toolCallId?(m=d(t.toolCallId),e[49]=d,e[50]=t.toolCallId,e[51]=m):m=e[51];let p;e[52]!==r||e[53]!==t.toolCallId?(p=r(t.toolCallId)?.annotations,e[52]=r,e[53]=t.toolCallId,e[54]=p):p=e[54];let g;e[55]!==r||e[56]!==t.toolCallId?(g=r(t.toolCallId)?.latencySeconds,e[55]=r,e[56]=t.toolCallId,e[57]=g):g=e[57];let x;e[58]!==t||e[59]!==m||e[60]!==p||e[61]!==g?(x={part:t,subtaskMeta:m,annotations:p,latency:g},e[58]=t,e[59]=m,e[60]=p,e[61]=g,e[62]=x):x=e[62];const h=x;let y;return e[63]!==h?(y=l.jsx(z.Suspense,{fallback:l.jsx(za,{...h}),children:l.jsx(Da,{...h})}),e[63]=h,e[64]=y):y=e[64],y}case"text":{const m=!!a&&!c,p=c&&i;let g;return e[65]!==n||e[66]!==t||e[67]!==m||e[68]!==p||e[69]!==a?(g=l.jsx(Ie,{id:n,part:t,extraActions:a,copyable:!0,alwaysShowActions:m,animate:p}),e[65]=n,e[66]=t,e[67]=m,e[68]=p,e[69]=a,e[70]=g):g=e[70],g}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;case"data-tool-metadata":case"data-tool-subtask-metadata":case"data-generate-image":case"data-web-search":return null;default:{const m=t;if(m.type==="tool-COLLECTION_VIRTUAL_MCP_CREATE"){let p;e[71]!==m.toolCallId||e[72]!==r?(p=r(m.toolCallId)?.latencySeconds,e[71]=m.toolCallId,e[72]=r,e[73]=p):p=e[73];let g;return e[74]!==m||e[75]!==p?(g=l.jsx(Ba,{part:m,latency:p}),e[74]=m,e[75]=p,e[76]=g):g=e[76],g}if(m.type==="tool-COLLECTION_VIRTUAL_MCP_LIST"){let p;e[77]!==m.toolCallId||e[78]!==r?(p=r(m.toolCallId)?.latencySeconds,e[77]=m.toolCallId,e[78]=r,e[79]=p):p=e[79];let g;return e[80]!==m||e[81]!==p?(g=l.jsx(Wa,{part:m,latency:p}),e[80]=m,e[81]=p,e[82]=g):g=e[82],g}if(m.type==="tool-COLLECTION_CONNECTIONS_LIST"){let p;e[83]!==m.toolCallId||e[84]!==r?(p=r(m.toolCallId)?.latencySeconds,e[83]=m.toolCallId,e[84]=r,e[85]=p):p=e[85];let g;return e[86]!==m||e[87]!==p?(g=l.jsx(Ja,{part:m,latency:p}),e[86]=m,e[87]=p,e[88]=g):g=e[88],g}if(m.type.startsWith("tool-")){const p=m;let g;e[89]!==o.toolMetadata||e[90]!==p.toolCallId?(g=o.toolMetadata.get(p.toolCallId),e[89]=o.toolMetadata,e[90]=p.toolCallId,e[91]=g):g=e[91];const x=g;let h;e[92]!==m.type||e[93]!==p.output?(h=m.type.endsWith("__get_screenshot")?ca(p.output):null,e[92]=m.type,e[93]=p.output,e[94]=h):h=e[94];const y=h,b=x?.annotations,k=x?.latencySeconds,j=x?.outputBytes,w=x?._meta;let S;e[95]!==m||e[96]!==i||e[97]!==b||e[98]!==k||e[99]!==j||e[100]!==w?(S=l.jsx(lt,{part:m,annotations:b,latency:k,outputBytes:j,isLastMessage:i,toolMeta:w}),e[95]=m,e[96]=i,e[97]=b,e[98]=k,e[99]=j,e[100]=w,e[101]=S):S=e[101];const N=S;if(!y)return N;let v;e[102]!==y?(v=[y],e[102]=y,e[103]=v):v=e[103];let _;e[104]!==p.type?(_=p.type.slice(5),e[104]=p.type,e[105]=_):_=e[105];let T;e[106]!==v||e[107]!==_?(T=l.jsx(Ot,{srcs:v,alt:_}),e[106]=v,e[107]=_,e[108]=T):T=e[108];let A;return e[109]!==N||e[110]!==T?(A=l.jsxs("div",{className:"flex flex-col gap-2",children:[N,T]}),e[109]=N,e[110]=T,e[111]=A):A=e[111],A}if(t.type===$e){let p;return e[112]!==t?(p=l.jsx(ll,{part:t}),e[112]=t,e[113]=p):p=e[113],p}return m.type.startsWith("data-")||console.warn(`[chat] unknown message part type: ${m.type}`),null}}}function kl(s){const e=M.c(3),{pending:t,children:n}=s;if(!t||t.length===0)return n;let a;return e[0]!==n||e[1]!==t?(a=l.jsxs("div",{className:"flex flex-col gap-3 sm:gap-2",children:[n,t]}),e[0]=n,e[1]=t,e[2]=a):a=e[2],a}function wl(s){const e=M.c(9),{isRunInProgress:t}=s,n=H();if(t){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(Ce,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),e[0]=c):c=e[0];let i;e[1]!==n?(i=n("chat.assistant.resumingTask"),e[1]=n,e[2]=i):i=e[2];let u;return e[3]!==i?(u=l.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:l.jsxs("span",{className:"flex items-center gap-1.5",children:[c,l.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:i})]})}),e[3]=i,e[4]=u):u=e[4],u}let a;e[5]!==n?(a=n("chat.assistant.noResponseGenerated"),e[5]=n,e[6]=a):a=e[6];let o;return e[7]!==a?(o=l.jsx("div",{className:"text-sm text-muted-foreground/60 py-2",children:a}),e[7]=a,e[8]=o):o=e[8],o}function _l(s){const e=M.c(7),{className:t,children:n}=s;let a;e[0]!==t?(a=G("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",t),e[0]=t,e[1]=a):a=e[1];let o;e[2]!==n?(o=l.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:l.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-sm wrap-break-word overflow-wrap-anywhere bg-transparent",children:n})}),e[2]=n,e[3]=o):o=e[3];let c;return e[4]!==a||e[5]!==o?(c=l.jsx("div",{className:a,children:o}),e[4]=a,e[5]=o,e[6]=c):c=e[6],c}function Tl(s){const e=M.c(16),{message:t,turnStartedAt:n,status:a,className:o,isLast:c}=s,i=c===void 0?!1:c,u=H(),{isRunInProgress:r}=je()??{},f=r===void 0?!1:r,d=ve()?.taskId??null,m=a==="streaming",g=m||a==="submitted";let x;e[0]!==n?(x=We(n),e[0]=n,e[1]=x):x=e[1];const h=x;let y;e[2]!==g?(y=()=>g?Date.now():null,e[2]=g,e[3]=y):y=e[3];const[b,k]=z.useState(y),[j,w]=z.useState(g);j!==g&&(w(g),k(()=>g?Date.now():null));const S=h??b,{reasoningGroups:N,renderOrder:v,dataParts:_}=hl(t),T=t!==null&&v.length>0,A=t&&t.parts.length>0?t.parts[t.parts.length-1]:null,P=m&&A?.type==="reasoning";let E;if(e[4]!==t){const K=t?.metadata?.reasoning_start_at?new Date(t.metadata.reasoning_start_at):null,Q=t?.metadata?.reasoning_end_at?new Date(t.metadata.reasoning_end_at):new Date;E=K!==null?Q.getTime()-K.getTime():null,e[4]=t,e[5]=E}else E=e[5];const L=E;let I;e[6]!==i||e[7]!==t?(I=!i||!t||!t.parts.some(Il),e[6]=i,e[7]=t,e[8]=I):I=e[8];const $=I,C=!g&&T&&$&&(()=>{let K=0;for(const Q of v)if(Q.kind==="part"){const ne=t.parts[Q.index]?.type;(ne==="dynamic-tool"||ne?.startsWith("tool-"))&&K++}return K>=bl})(),{collapsed:R,tail:F}=C?yl(v,t.parts):{collapsed:[],tail:v},{pending:B}=bt();let U;e[9]!==i||e[10]!==B?(U=i?B.map(Cl):null,e[9]=i,e[10]=B,e[11]=U):U=e[11];const W=U,V=_l,X=T?l.jsxs("div",{className:"flex flex-col gap-3 sm:gap-2",children:[t.metadata?.resumedFromBackground&&l.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground/60 select-none",children:[l.jsx(dt,{className:"size-3 shrink-0"}),l.jsx("span",{children:u("chat.assistant.resumedBackgroundTask")})]}),R.length>0&&l.jsx(Sl,{items:R,message:t,reasoningGroups:N,isReasoningActive:P,totalDuration:L,dataParts:_,isLoading:g,isLast:i}),F.map((K,Q)=>{const ne=R.length+Q,oe=F.findLastIndex(ee=>Qt(ee,t.parts))===Q;return Xt({item:K,renderIndex:ne,message:t,reasoningGroups:N,isReasoningActive:P,totalDuration:L,dataParts:_,isLoading:g,isLast:i,isLastVisiblePart:oe,renderOrder:v})}),d&&l.jsx(pl,{threadId:d,message:t}),W,i&&(g||f)&&S!==null&&l.jsx(An,{startedAt:S}),i&&!g&&d&&l.jsxs(l.Fragment,{children:[l.jsx(rl,{}),$&&l.jsx(Ya,{})]}),!g&&l.jsx(Lt,{message:t})]}):l.jsx(kl,{pending:W,children:g?l.jsx(Ln,{startedAt:S}):l.jsx(wl,{isRunInProgress:i&&f})});let Z;return e[12]!==V||e[13]!==o||e[14]!==X?(Z=l.jsx(V,{className:o,children:X}),e[12]=V,e[13]=o,e[14]=X,e[15]=Z):Z=e[15],Z}function Cl(s){return l.jsx(Jt,{message:s,pending:!0},s.id)}function Il(s){const e=s.type;if(e!=="dynamic-tool"&&!e?.startsWith("tool-"))return!1;const t=s.state;return t==="input-streaming"||t==="input-available"||t==="approval-requested"}function yo(s){const e=[],t=s.filter(n=>n.role!=="system"&&!n.metadata?.internal&&!n.metadata?.subtaskJobId);for(let n=0;n<t.length;n++){const a=t[n];if(a)if(a.role==="user"){const o=t[n+1];o&&o.role==="assistant"?(e.push({user:a,assistant:o}),n++):e.push({user:a,assistant:null})}else a.role==="assistant"&&e.push({user:null,assistant:a})}return e}function jo(s){const e=M.c(19),{pair:t,isLastPair:n,status:a}=s,o=z.useRef(null),c=z.useRef(!1);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{o.current&&o.current.scrollIntoView({behavior:"smooth",block:"start"})},e[0]=i):i=e[0];const u=i;let r;e[1]!==n||e[2]!==t.assistant?.metadata?.resumedFromBackground||e[3]!==a?(r=y=>{if(o.current=y,!n||!y||c.current||(c.current=!0,t.assistant?.metadata?.resumedFromBackground))return;if(a==="submitted"||a==="streaming"){y.scrollIntoView({behavior:"smooth",block:"start"});return}const b=y.closest("[data-chat-scroller]");b?b.scrollTop=b.scrollHeight:y.scrollIntoView({behavior:"instant",block:"start"})},e[1]=n,e[2]=t.assistant?.metadata?.resumedFromBackground,e[3]=a,e[4]=r):r=e[4];const f=r,d=!t.user&&"pt-8 sm:pt-6";let m;e[5]!==d?(m=G("flex flex-col pb-2 sm:pb-2",d),e[5]=d,e[6]=m):m=e[6];let p;e[7]!==t.user?(p=t.user&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"sticky top-0 z-50 w-full h-4 bg-background"}),l.jsx("div",{className:"sticky mb-8 sm:mb-6 top-4 z-50",children:l.jsx(Vt,{message:t.user,onScrollToPair:u})})]}),e[7]=t.user,e[8]=p):p=e[8];const g=t.user?.created_at??null;let x;e[9]!==n||e[10]!==t.assistant||e[11]!==a||e[12]!==g?(x=l.jsx(Tl,{message:t.assistant,turnStartedAt:g,status:a,isLast:n}),e[9]=n,e[10]=t.assistant,e[11]=a,e[12]=g,e[13]=x):x=e[13];let h;return e[14]!==f||e[15]!==m||e[16]!==p||e[17]!==x?(h=l.jsxs("div",{ref:f,className:m,children:[p,x]}),e[14]=f,e[15]=m,e[16]=p,e[17]=x,e[18]=h):h=e[18],h}export{Sn as G,jo as M,ul as O,bo as S,Cn as a,On as f,yo as u};