decocms 4.364.0 → 4.364.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/dist/client/assets/{AlertCircle-EniJtD8E.js → AlertCircle-CfOItn1b.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DZpAPo6a.js → AreaChart-B9tk92oC.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-Clu1mSdY.js → ArrowLeft-B4kTLC80.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-Cu8UuHNR.js → ArrowRight-B4GAIQKI.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-C0eratGp.js → ArrowUp-Be_FwN-E.js} +1 -1
  6. package/dist/client/assets/{Check-BWpBE9uf.js → Check-_wGz2-IJ.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-cinYKmPU.js → CheckCircle-BQEdmdLU.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-DzRB-rdO.js → ChevronRight-DfnK-irb.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-BiIbFU31.js → ChevronSelectorVertical-DTb5009V.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-DGrguvGW.js → ChevronUp-SbK1Bh_A.js} +1 -1
  11. package/dist/client/assets/{Copy01-DayLu0dF.js → Copy01-DoHw-_s5.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-4OsjIT5f.js → CreditCard01-CkbbYVCy.js} +1 -1
  13. package/dist/client/assets/{Database01-2gG_9E30.js → Database01-DDqP2OWW.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-CucJCL9y.js → DotsVertical-Ct2yI8vr.js} +1 -1
  15. package/dist/client/assets/{Download01-BC2rKbuh.js → Download01-IytcAces.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-CRh7XbJc.js → ErrorBarContext-Cgip1CtP.js} +1 -1
  17. package/dist/client/assets/{Eye-dnrP5DkM.js → Eye-Ccu8gsxq.js} +1 -1
  18. package/dist/client/assets/{File02-BhckHV8N.js → File02-CODRlzC9.js} +1 -1
  19. package/dist/client/assets/{GitBranch01-BBn4dN5f.js → GitBranch01-y6_LtrpC.js} +1 -1
  20. package/dist/client/assets/{Globe01-SLAc63wC.js → Globe01-BHsBANMN.js} +1 -1
  21. package/dist/client/assets/{HardDrive-FlnOYA_8.js → HardDrive-Cr2Uhzo6.js} +1 -1
  22. package/dist/client/assets/{Image01-BrHSH-Vi.js → Image01-PUenBySa.js} +1 -1
  23. package/dist/client/assets/{Key01-CKcg8G1v.js → Key01-ugSjw0sl.js} +1 -1
  24. package/dist/client/assets/{Link01-3t9JrUgl.js → Link01-CUXePRyB.js} +1 -1
  25. package/dist/client/assets/{LinkExternal01-Cp7uxK1i.js → LinkExternal01-DLDyK_TN.js} +1 -1
  26. package/dist/client/assets/{Monitor01-BUruMK2r.js → Monitor01-J9g_ep-X.js} +1 -1
  27. package/dist/client/assets/{Package-CdfyZYxN.js → Package-Dm9TBHk7.js} +1 -1
  28. package/dist/client/assets/{Palette-CglyAOTg.js → Palette-BywMlwsu.js} +1 -1
  29. package/dist/client/assets/{Play-rnw1eV52.js → Play-HfzzXB20.js} +1 -1
  30. package/dist/client/assets/{Plus-Bxp02MWl.js → Plus-zXs3aP31.js} +1 -1
  31. package/dist/client/assets/{Printer-fz_zwxfT.js → Printer-kkmv6XzS.js} +1 -1
  32. package/dist/client/assets/{SearchLg-FC9suxna.js → SearchLg-BkMCmJSN.js} +1 -1
  33. package/dist/client/assets/{SearchMd-DRRptSJN.js → SearchMd-uhtNwnF8.js} +1 -1
  34. package/dist/client/assets/{Sector-CJIPfQ5Z.js → Sector-DNcwKKFv.js} +1 -1
  35. package/dist/client/assets/{Settings02-D2oiGU4q.js → Settings02-DPUnnUpS.js} +1 -1
  36. package/dist/client/assets/{Share07-D_kiq5Fr.js → Share07-ezwRb3nU.js} +1 -1
  37. package/dist/client/assets/{Shield01-CjyLhqlS.js → Shield01-BcXJFwaP.js} +1 -1
  38. package/dist/client/assets/{Stars01-COChWymR.js → Stars01-DdrI1AvW.js} +1 -1
  39. package/dist/client/assets/{Sun-nKOZMh9n.js → Sun-DZjMucTf.js} +1 -1
  40. package/dist/client/assets/{SwitchHorizontal01-CxlKjkIX.js → SwitchHorizontal01-Dne29Upz.js} +1 -1
  41. package/dist/client/assets/{Tool01-BnKd95Y1.js → Tool01-duhLcQNq.js} +1 -1
  42. package/dist/client/assets/{Tool02-C_xRWqQk.js → Tool02-CnClhfmX.js} +1 -1
  43. package/dist/client/assets/{Trash01-DqUm2RRh.js → Trash01-CH5l96iG.js} +1 -1
  44. package/dist/client/assets/{TrendUp01-PFzYDizC.js → TrendUp01-fYoe36da.js} +1 -1
  45. package/dist/client/assets/{Upload01-CqWnAR1-.js → Upload01-DksJHtIE.js} +1 -1
  46. package/dist/client/assets/{User01-BJoNdkjl.js → User01-DZs8rqql.js} +1 -1
  47. package/dist/client/assets/{UserSquare-CCDsU001.js → UserSquare-CXNfIfPy.js} +1 -1
  48. package/dist/client/assets/{Users01-DSQPwtP5.js → Users01-DZlg18P8.js} +1 -1
  49. package/dist/client/assets/{Users03-CRtXqa1Q.js → Users03-pPPKVW_h.js} +1 -1
  50. package/dist/client/assets/{XCircle-9Cb0khfg.js → XCircle-CoSRJnuK.js} +1 -1
  51. package/dist/client/assets/{XClose-Cw4b4Uag.js → XClose-BYsCvLXW.js} +1 -1
  52. package/dist/client/assets/{Zap-ChVc0p76.js → Zap-BLQffepl.js} +1 -1
  53. package/dist/client/assets/{ZoomOut-BXPGwF_O.js → ZoomOut-B6xnZLKD.js} +1 -1
  54. package/dist/client/assets/{access-gate-BZbNb1lq.js → access-gate-Cc7o9awR.js} +1 -1
  55. package/dist/client/assets/{add-connection-dialog-s1GRGQ63.js → add-connection-dialog-ColILHSg.js} +1 -1
  56. package/dist/client/assets/{agent-analytics-C4aHsqYV.js → agent-analytics-BuUA9_zB.js} +1 -1
  57. package/dist/client/assets/agent-app-CvjgfHdj.js +1 -0
  58. package/dist/client/assets/{agent-assets-B6lPIA_2.js → agent-assets-CHRAa4hr.js} +1 -1
  59. package/dist/client/assets/{agent-automation-Bmdy2mNK.js → agent-automation-COYuXB1l.js} +1 -1
  60. package/dist/client/assets/{agent-automations-5exIOZ--.js → agent-automations-CVa9zvpd.js} +1 -1
  61. package/dist/client/assets/{agent-connect-sources-ozaEzrP4.js → agent-connect-sources-D-qScFZM.js} +1 -1
  62. package/dist/client/assets/agent-deck-CtPxHug1.js +1 -0
  63. package/dist/client/assets/{agent-e2e-s-Nk1F2Y.js → agent-e2e-BJ7p3EFw.js} +1 -1
  64. package/dist/client/assets/agent-file-r5wJ9MHq.js +1 -0
  65. package/dist/client/assets/{agent-git-Bu3r6tWp.js → agent-git-RSuMQ7we.js} +1 -1
  66. package/dist/client/assets/{agent-hosting-CdYzW_dA.js → agent-hosting-C6HCUd84.js} +1 -1
  67. package/dist/client/assets/{agent-icon-DrlilhFJ.js → agent-icon-DlT0cyOd.js} +1 -1
  68. package/dist/client/assets/agent-library-file-CDc9dHKg.js +1 -0
  69. package/dist/client/assets/{agent-monitor-DEQ-34KF.js → agent-monitor-Yob-hhJJ.js} +1 -1
  70. package/dist/client/assets/{agent-overview-BQIF-rwN.js → agent-overview-Cmt3_HNP.js} +1 -1
  71. package/dist/client/assets/agent-settings-E30r5sKL.js +1 -0
  72. package/dist/client/assets/{agent-site-editor-DtPpWjDD.js → agent-site-editor-C9RAIEyo.js} +1 -1
  73. package/dist/client/assets/agent-site-editor-code-hlPdL0sy.js +2 -0
  74. package/dist/client/assets/{agent-site-editor-content-6zQLGSyR.js → agent-site-editor-content-5xiQM6XU.js} +2 -2
  75. package/dist/client/assets/{agent-site-editor-preview-D8mxBZIU.js → agent-site-editor-preview-CEEI7DH8.js} +3 -3
  76. package/dist/client/assets/agent-view-DclyqFK6.js +1 -0
  77. package/dist/client/assets/{agent-view-guard-nj1TYVsk.js → agent-view-guard-BYjSQEWP.js} +1 -1
  78. package/dist/client/assets/{agents-list-hiZ_XS0O.js → agents-list-D-V7lKYi.js} +1 -1
  79. package/dist/client/assets/{ai-providers-oY9ilqJZ.js → ai-providers-CnrPu6-b.js} +1 -1
  80. package/dist/client/assets/{alert-D-emvPaG.js → alert-CKcqWgEA.js} +1 -1
  81. package/dist/client/assets/{alert-dialog-BE9ltHtr.js → alert-dialog-B19dFL0f.js} +1 -1
  82. package/dist/client/assets/{api-keys-4NMR09V3.js → api-keys-B82gXphc.js} +1 -1
  83. package/dist/client/assets/api-keys-C5nyTMkG.js +1 -0
  84. package/dist/client/assets/app-editor-Ce9aJoOB.js +1 -0
  85. package/dist/client/assets/{asset-utils-CR65HphV.js → asset-utils-DCSDKdD5.js} +1 -1
  86. package/dist/client/assets/{auth-RjDDTUUT.js → auth-BRT05k6V.js} +1 -1
  87. package/dist/client/assets/{auth-catchall-qxwSZGuB.js → auth-catchall-CKtZG-ZL.js} +1 -1
  88. package/dist/client/assets/{auth-entry-ddblLMjc.js → auth-entry-B04CeC2I.js} +1 -1
  89. package/dist/client/assets/{auth-split-layout-oGs_kK_4.js → auth-split-layout-Cr7N993d.js} +1 -1
  90. package/dist/client/assets/{authenticate-and-persist-oauth-DXlrPDSv.js → authenticate-and-persist-oauth-VFbyMRtb.js} +1 -1
  91. package/dist/client/assets/{automation-list-row-XibuWgpW.js → automation-list-row-Cpi5Xmll.js} +1 -1
  92. package/dist/client/assets/{automation-runs-nZP284NC.js → automation-runs-pUP2_-kz.js} +1 -1
  93. package/dist/client/assets/automations-DsASrpQ_.js +1 -0
  94. package/dist/client/assets/{autosend-HdosN86x.js → autosend-BfRMZFUN.js} +1 -1
  95. package/dist/client/assets/{avatar-DcDvs8Zz.js → avatar-CAI2JETZ.js} +1 -1
  96. package/dist/client/assets/{badge-DJpaBl8u.js → badge-ByfZPYh0.js} +1 -1
  97. package/dist/client/assets/{block-document-LCYQj9PJ.js → block-document-DBxhUTBx.js} +1 -1
  98. package/dist/client/assets/{breadcrumb-BOAVRiAa.js → breadcrumb-CFkPvTBR.js} +1 -1
  99. package/dist/client/assets/{buckets-Ze5fok7v.js → buckets-DKSvTBD6.js} +1 -1
  100. package/dist/client/assets/{build-improve-prompt-doc-Dn9xs_5X.js → build-improve-prompt-doc-Bni1nFjn.js} +1 -1
  101. package/dist/client/assets/{bulk-category-panel-D-Hh71MB.js → bulk-category-panel-B7Aw8gAs.js} +1 -1
  102. package/dist/client/assets/{calendar-DTnssie4.js → calendar-BPRd4cON.js} +1 -1
  103. package/dist/client/assets/{capability-load-error-CJ3e1sqb.js → capability-load-error-B39q7sVS.js} +1 -1
  104. package/dist/client/assets/{cards-DTFINi5r.js → cards-C9H7r60q.js} +1 -1
  105. package/dist/client/assets/category-editor-C6NG-7y-.js +1 -0
  106. package/dist/client/assets/{chart-Jb0gHMLD.js → chart-ChK_Oq3k.js} +1 -1
  107. package/dist/client/assets/{chat-context-CXknhaDs.js → chat-context-BdJniD3E.js} +1 -1
  108. package/dist/client/assets/{checkbox-D8Ab2Vb-.js → checkbox-Cx7-cMI2.js} +1 -1
  109. package/dist/client/assets/{choose-editor-Chy2VB_F.js → choose-editor-BFMfKqGX.js} +1 -1
  110. package/dist/client/assets/{cli-auth-success-B27gos5d.js → cli-auth-success-BXUI2QIq.js} +1 -1
  111. package/dist/client/assets/{client-icons-CoIMqlIz.js → client-icons-DH8XqhqX.js} +1 -1
  112. package/dist/client/assets/{collapsible-DH_CZdwE.js → collapsible-DWXt85UZ.js} +1 -1
  113. package/dist/client/assets/{collection-detail-D8Sq0PzS.js → collection-detail-yuoxb5ei.js} +1 -1
  114. package/dist/client/assets/{collection-display-button-P_aK73Om.js → collection-display-button-CYeWeHPn.js} +1 -1
  115. package/dist/client/assets/{collection-search-CzGq8Uso.js → collection-search-DBiZveMp.js} +1 -1
  116. package/dist/client/assets/{collection-table-wrapper-ChqJqpKo.js → collection-table-wrapper-GiH-7xKS.js} +1 -1
  117. package/dist/client/assets/{collection-tabs-BLgGMB42.js → collection-tabs-BxTayoNr.js} +1 -1
  118. package/dist/client/assets/{command-palette-store-BwHku_Zt.js → command-palette-store-D4d7ysBD.js} +1 -1
  119. package/dist/client/assets/{command-B6LMVdkQ.js → command-vCLlEnld.js} +1 -1
  120. package/dist/client/assets/{commerce-onboarding-EmIMFBqV.js → commerce-onboarding-DOo_j1fY.js} +1 -1
  121. package/dist/client/assets/{companion-mcps-section-BszDkkOp.js → companion-mcps-section-RMajitXP.js} +1 -1
  122. package/dist/client/assets/{connect-CM-97gwN.js → connect-DIZq-DN2.js} +1 -1
  123. package/dist/client/assets/{connect-layout-C_MQVbrT.js → connect-layout-CcZHYYLs.js} +1 -1
  124. package/dist/client/assets/{connection-OmoYXqZk.js → connection-D3sgkgc8.js} +1 -1
  125. package/dist/client/assets/{connection-card-Cy-GdKQl.js → connection-card-BUk8IuWl.js} +1 -1
  126. package/dist/client/assets/{connection-detail-CuBiFvjK.js → connection-detail-DI7dS0mq.js} +1 -1
  127. package/dist/client/assets/{connection-form-helpers-D3hdN_Pk.js → connection-form-helpers-CjZ0gF9p.js} +1 -1
  128. package/dist/client/assets/{connections-BnO49Vti.js → connections-DtcRjsIv.js} +1 -1
  129. package/dist/client/assets/{create-organization-dialog--p2RMsV5.js → create-organization-dialog-D3-ZW85P.js} +1 -1
  130. package/dist/client/assets/{decode-html-entities-DDqE27I4.js → decode-html-entities-DI0z1GlS.js} +1 -1
  131. package/dist/client/assets/{decopilot-sse-pool-CfYFArSW.js → decopilot-sse-pool-C4pTRblZ.js} +1 -1
  132. package/dist/client/assets/{dialog-otnvxVN0.js → dialog-BAfLND_C.js} +1 -1
  133. package/dist/client/assets/{discover-BZKxvY_j.js → discover-CgETi5Ba.js} +1 -1
  134. package/dist/client/assets/{domain-settings-QORwmdcG.js → domain-settings-DGeWS67L.js} +1 -1
  135. package/dist/client/assets/{download-app-dialog-BqNRF4Sn.js → download-app-dialog-inqOoiFR.js} +1 -1
  136. package/dist/client/assets/{drawer-s7gtDrb4.js → drawer-CftCt6Vc.js} +1 -1
  137. package/dist/client/assets/{dropdown-menu-BxKUbUkE.js → dropdown-menu-DlZDenrk.js} +1 -1
  138. package/dist/client/assets/{editor-DCxsAs7o.js → editor-VCziEYAl.js} +1 -1
  139. package/dist/client/assets/{empty-state-CL4F2BS4.js → empty-state-85cr_pDj.js} +1 -1
  140. package/dist/client/assets/{empty-state-Cz1DkYZE.js → empty-state-DrLFtqMC.js} +1 -1
  141. package/dist/client/assets/{extract-connection-data-CqGCTPdZ.js → extract-connection-data-DuAiwl2M.js} +1 -1
  142. package/dist/client/assets/{file-explorer-Uvp7ogK8.js → file-explorer-Dd6bLbvS.js} +1 -1
  143. package/dist/client/assets/{file-preview-18IJQMnU.js → file-preview-B9gO9A7B.js} +1 -1
  144. package/dist/client/assets/{file-share-button-Cef5f1VZ.js → file-share-button-Zm0jPBUd.js} +1 -1
  145. package/dist/client/assets/{file-type-icon-DGllFDOf.js → file-type-icon-ChixCG5B.js} +1 -1
  146. package/dist/client/assets/{folder-icon-p8jB76CU.js → folder-icon-jWW7DiXp.js} +1 -1
  147. package/dist/client/assets/{form-KjPevg0A.js → form-B2aJ1tMr.js} +1 -1
  148. package/dist/client/assets/{general-t-IB2WC3.js → general-Dbd-M2oy.js} +1 -1
  149. package/dist/client/assets/{github-icon-D51q_6S8.js → github-icon-BHD2Mc12.js} +1 -1
  150. package/dist/client/assets/{home-Bhl8U_ph.js → home-DRVwgYU_.js} +1 -1
  151. package/dist/client/assets/{hooks-BhviOOpn.js → hooks-CrGRDkCO.js} +1 -1
  152. package/dist/client/assets/{hooks-k1OxvonE.js → hooks-D-bAuZ0C.js} +1 -1
  153. package/dist/client/assets/{index-Bwc7J041.js → index-5lUn2NYU.js} +1 -1
  154. package/dist/client/assets/{index-CRCvoACn.js → index-BFLLIz5j.js} +1 -1
  155. package/dist/client/assets/{index-m01im2kT.js → index-Bm0CRiXJ.js} +1 -1
  156. package/dist/client/assets/{index-B3yBTWEk.js → index-BodvdIMk.js} +3 -3
  157. package/dist/client/assets/{index-w1d_dmEj.js → index-CFD2Tmax.js} +1 -1
  158. package/dist/client/assets/{index-D4YJGrDI.js → index-CMW740A7.js} +3 -3
  159. package/dist/client/assets/{index-fTs6ROSj.js → index-CV73SUyV.js} +1 -1
  160. package/dist/client/assets/{index-DD-r2o4M.js → index-CenLE2Y1.js} +1 -1
  161. package/dist/client/assets/{index-C1N-CFMR.js → index-CgWFi-UY.js} +1 -1
  162. package/dist/client/assets/{index-DlQKfvnq.js → index-D7HQX0oQ.js} +1 -1
  163. package/dist/client/assets/{index-C7WIaN4y.js → index-DFPd3Z7H.js} +1 -1
  164. package/dist/client/assets/{index-DOk05MCp.js → index-DTnAWEs3.js} +1 -1
  165. package/dist/client/assets/{index-DqX9hbqM.js → index-b0vxPrwt.js} +1 -1
  166. package/dist/client/assets/{index-xVQnUsdi.js → index-o8mv6JmO.js} +1 -1
  167. package/dist/client/assets/{index-redirect-e7Kr1hOd.js → index-redirect-CAUT4Gir.js} +1 -1
  168. package/dist/client/assets/{infiniteQueryObserver-DgAoAIrN.js → infiniteQueryObserver-BXxOeKaH.js} +1 -1
  169. package/dist/client/assets/{infra-billing-B2HwpfSN.js → infra-billing-C6s3jgkP.js} +1 -1
  170. package/dist/client/assets/{input-BnbYz5_9.js → input-2i3nmZXT.js} +1 -1
  171. package/dist/client/assets/{input-DxAgQLPa.js → input-7HsiiE3O.js} +1 -1
  172. package/dist/client/assets/{input-HFOrJf5B.js → input-CyCfmV2v.js} +1 -1
  173. package/dist/client/assets/{integration-icon-BPwWRlNG.js → integration-icon-BqCQeMla.js} +1 -1
  174. package/dist/client/assets/{invite-member-dialog-vPcEYe6v.js → invite-member-dialog-l7jaUM00.js} +1 -1
  175. package/dist/client/assets/{label-CqlSWrLn.js → label-oySBL-hw.js} +1 -1
  176. package/dist/client/assets/{layout-aU1eoqDA.js → layout-C_9zPyLB.js} +1 -1
  177. package/dist/client/assets/{legacy-agents-deep-CpKjJlPs.js → legacy-agents-deep-BGj1G-G6.js} +1 -1
  178. package/dist/client/assets/{legacy-main-redirect-ZPChWdtD.js → legacy-main-redirect-BAMIoUmF.js} +1 -1
  179. package/dist/client/assets/{library-uYIcEGdr.js → library-jBDBHa3X.js} +1 -1
  180. package/dist/client/assets/{login-CfxNz6kc.js → login-jcZJlm87.js} +1 -1
  181. package/dist/client/assets/{markdown-B1038zFJ.js → markdown-CuYSLr0D.js} +1 -1
  182. package/dist/client/assets/{mcp-app-renderer-Cb8Ud-E7.js → mcp-app-renderer-CAyJEYdf.js} +1 -1
  183. package/dist/client/assets/{mcp-oauth-D6isOO_s.js → mcp-oauth-D4sc2QRH.js} +1 -1
  184. package/dist/client/assets/{members-DHLsomPg.js → members-DZnhlZB5.js} +1 -1
  185. package/dist/client/assets/{mini-report-page-iTjakIrU.js → mini-report-page-DZcKIwCW.js} +1 -1
  186. package/dist/client/assets/{monaco-editor-WNMTPDp9.js → monaco-editor-miL0A9cI.js} +1 -1
  187. package/dist/client/assets/{monitoring-stats-row-B_mR1zw-.js → monitoring-stats-row-Bkr0yo_k.js} +1 -1
  188. package/dist/client/assets/{multi-select-D54pM3d4.js → multi-select-HV-sxpT4.js} +1 -1
  189. package/dist/client/assets/{mustache-r9snVmI4.js → mustache-8iDNlOWo.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-GAK1H0Is.js → oauth-callback-CdbS4grS.js} +1 -1
  191. package/dist/client/assets/{oauth-callback-ai-provider-sdaHeEFx.js → oauth-callback-ai-provider-B6UEwW8h.js} +1 -1
  192. package/dist/client/assets/{onboarding-BKPW4du6.js → onboarding-CXn2uZdK.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-yrtk59Mo.js → optimistic-project-sidebar-views-Crt809gH.js} +1 -1
  194. package/dist/client/assets/{org-layout-BNIg984j.js → org-layout-Bh2799KC.js} +1 -1
  195. package/dist/client/assets/{organization-choice-DvXG7tgx.js → organization-choice-Dim_EV8w.js} +1 -1
  196. package/dist/client/assets/{orgs-NTyzCYi-.js → orgs-BiHhUqle.js} +1 -1
  197. package/dist/client/assets/{page-seo-form-DAkbVQPg.js → page-seo-form-Byw6I6v1.js} +1 -1
  198. package/dist/client/assets/{pair-C08OPQNP.js → pair-BryCAS3L.js} +1 -1
  199. package/dist/client/assets/{popover-DIqZ2IKF.js → popover-BaPHFXoA.js} +1 -1
  200. package/dist/client/assets/{post-calendar-DuH_hA9y.js → post-calendar-CX_aQZ9o.js} +1 -1
  201. package/dist/client/assets/{post-editor-BAf6FqSQ.js → post-editor-Bik9xGuM.js} +1 -1
  202. package/dist/client/assets/{preview-content-B5xB74fu.js → preview-content-C25g1Qjg.js} +1 -1
  203. package/dist/client/assets/{preview-dialog-b2QyOGzU.js → preview-dialog-Bd71VPLl.js} +1 -1
  204. package/dist/client/assets/{primitives-4_D03rJK.js → primitives-C2ZKBNVE.js} +1 -1
  205. package/dist/client/assets/{profile-COT-hKKD.js → profile-Cvk7HYLO.js} +1 -1
  206. package/dist/client/assets/{project-app-view-DJ_q7UHg.js → project-app-view-BBFfxMn2.js} +1 -1
  207. package/dist/client/assets/{project-feed-DJ_jJM3E.js → project-feed-CuafBwOd.js} +1 -1
  208. package/dist/client/assets/{project-icon-Bl3bXnhv.js → project-icon-D14m61tO.js} +1 -1
  209. package/dist/client/assets/project-reports-FoQBd9tt.js +1 -0
  210. package/dist/client/assets/project-tasks-CtrmnVYd.js +1 -0
  211. package/dist/client/assets/{prompts-CI44HEcf.js → prompts-CdPbev6G.js} +1 -1
  212. package/dist/client/assets/record-editor-BeEtgfek.js +1 -0
  213. package/dist/client/assets/redirect-editor-qcgiHklQ.js +1 -0
  214. package/dist/client/assets/registry-DINMxyfR.js +2 -0
  215. package/dist/client/assets/{registry-layout-CvRfdld3.js → registry-layout-C94XAKOB.js} +1 -1
  216. package/dist/client/assets/{reports-C-eaYxW3.js → reports-CxUD1psy.js} +1 -1
  217. package/dist/client/assets/reports-DbvBqGHI.js +1 -0
  218. package/dist/client/assets/{reports-tab-qffeKlGd.js → reports-tab-BpUXLiNq.js} +2 -2
  219. package/dist/client/assets/{repositories-ao250fUH.js → repositories-cLgzNGhX.js} +1 -1
  220. package/dist/client/assets/{repository-import-picker-Bg_h8YsG.js → repository-import-picker-Bz4mO0xC.js} +1 -1
  221. package/dist/client/assets/{repository-picker-BDWGy2xY.js → repository-picker-aHa7Yens.js} +1 -1
  222. package/dist/client/assets/{require-capability-CmR_46yt.js → require-capability-CGWy1zcW.js} +1 -1
  223. package/dist/client/assets/{required-auth-layout-BEc3NUsQ.js → required-auth-layout-C8ueG7DN.js} +1 -1
  224. package/dist/client/assets/{reset-password-BlF157J6.js → reset-password-Dfhn1DHs.js} +1 -1
  225. package/dist/client/assets/{review-settings-BBciVvfB.js → review-settings-yj2xfDNH.js} +1 -1
  226. package/dist/client/assets/{rich-text-link-control-CrwbAR31.js → rich-text-link-control-D8pkIadD.js} +1 -1
  227. package/dist/client/assets/{roles-CuHUTdKb.js → roles-CtsHlJ7R.js} +1 -1
  228. package/dist/client/assets/{runnable-block-editor-2CMWc-S3.js → runnable-block-editor-DQQgPGex.js} +1 -1
  229. package/dist/client/assets/{sandbox-lifecycle-context-CXd9Um8u.js → sandbox-lifecycle-context-KgLleS3y.js} +1 -1
  230. package/dist/client/assets/{schema-BQbhQoxs.js → schema-DVRYVU-6.js} +1 -1
  231. package/dist/client/assets/{scroll-area-BgZjjLM3.js → scroll-area-DrpmDXmv.js} +1 -1
  232. package/dist/client/assets/{search-input-uXtJ6IU8.js → search-input-BEuwwr9P.js} +1 -1
  233. package/dist/client/assets/{secrets-C1mCKV1g.js → secrets-BfNyBKtt.js} +1 -1
  234. package/dist/client/assets/{sections-editor-Bv2odcBq.js → sections-editor-CyOHOz8a.js} +1 -1
  235. package/dist/client/assets/{select-Bc5UZb4n.js → select-bwhAgSkw.js} +1 -1
  236. package/dist/client/assets/{select-model-BDGEzt-Y.js → select-model-BUtG_o-5.js} +1 -1
  237. package/dist/client/assets/{seo-editor-DJw3ydvJ.js → seo-editor-liBqGoJ2.js} +1 -1
  238. package/dist/client/assets/settings-layout-8_4ivRpO.js +1 -0
  239. package/dist/client/assets/{settings-sidebar-DswZBMwm.js → settings-sidebar-D1CImlJ7.js} +1 -1
  240. package/dist/client/assets/{settings-tab-Ru2atFmZ.js → settings-tab-DfPM9bhj.js} +1 -1
  241. package/dist/client/assets/{shell-controls-DkLEUvEw.js → shell-controls-oSe12Dvv.js} +1 -1
  242. package/dist/client/assets/{shell-layout-1dFmVwYI.js → shell-layout-DfKFME9s.js} +1 -1
  243. package/dist/client/assets/{skill-preview-CGe8kUoa.js → skill-preview-e4uQz0Dy.js} +1 -1
  244. package/dist/client/assets/{skills-BGdKR-aF.js → skills-C-9wX-VV.js} +1 -1
  245. package/dist/client/assets/{sso-M-OsbEtw.js → sso-BRhlLrJf.js} +1 -1
  246. package/dist/client/assets/{store-BY4ZRY7y.js → store-BESxBvzo.js} +1 -1
  247. package/dist/client/assets/store-registry-C5Y2YACE.js +2 -0
  248. package/dist/client/assets/{switch-CJ5Ir2Zx.js → switch-B1nJbGCG.js} +1 -1
  249. package/dist/client/assets/{synced-repos-9D-CfhL7.js → synced-repos-DSIN0NR4.js} +1 -1
  250. package/dist/client/assets/{table-Di_WRNkb.js → table-y_mRJ9Zn.js} +1 -1
  251. package/dist/client/assets/{tabs-DV8akPGb.js → tabs-BUVbbLAT.js} +1 -1
  252. package/dist/client/assets/{task-board-CXsHf2Zn.js → task-board-B_FYv6yr.js} +1 -1
  253. package/dist/client/assets/{task-route-D79aS9d_.js → task-route-D8DTrzfK.js} +1 -1
  254. package/dist/client/assets/{task-status-DIr_2V94.js → task-status-Cm28QQwf.js} +1 -1
  255. package/dist/client/assets/tasks-C2bVBzhE.js +1 -0
  256. package/dist/client/assets/{tasks-CiIHA5f1.js → tasks-CIHytgaT.js} +1 -1
  257. package/dist/client/assets/{textarea-CneoU2lJ.js → textarea-2MjTWIvv.js} +1 -1
  258. package/dist/client/assets/{thread-intent-DVKldCEq.js → thread-intent-C_TUHShU.js} +1 -1
  259. package/dist/client/assets/{thread-route-CKY-dKC0.js → thread-route-BPX5b65a.js} +1 -1
  260. package/dist/client/assets/{thread-sheet-body-CcUGPZXB.js → thread-sheet-body-hrROtD20.js} +1 -1
  261. package/dist/client/assets/{toggle-group-9HQCpj-q.js → toggle-group-yY_Yhls6.js} +1 -1
  262. package/dist/client/assets/{tool-namespace-BVMQcKlk.js → tool-namespace-CCb8MkTr.js} +1 -1
  263. package/dist/client/assets/{toolbar-D0oe2g2b.js → toolbar-DK-dWmgo.js} +1 -1
  264. package/dist/client/assets/{toolbar-icon-button-EOE8J-Ai.js → toolbar-icon-button-D7IEoYBH.js} +1 -1
  265. package/dist/client/assets/{track-BzMi8kcZ.js → track-CzfYfVMq.js} +1 -1
  266. package/dist/client/assets/{types-Csu6Ims7.js → types-CJQ5rOJz.js} +1 -1
  267. package/dist/client/assets/{usage-stats-BNse37Wk.js → usage-stats-Cp4Mqdjr.js} +1 -1
  268. package/dist/client/assets/{use-ai-providers-qnkcjapR.js → use-ai-providers-BHw3Z_he.js} +1 -1
  269. package/dist/client/assets/{use-automations-CYOC_eS5.js → use-automations-B_2Eci9k.js} +1 -1
  270. package/dist/client/assets/{use-autosave-CCprSQ13.js → use-autosave-CGgcTeeH.js} +1 -1
  271. package/dist/client/assets/{use-commerce-diagnostic-mdvL2BW-.js → use-commerce-diagnostic-BQRYyoWw.js} +1 -1
  272. package/dist/client/assets/{use-connect-companion-2fL060lG.js → use-connect-companion-0NSfsYdR.js} +1 -1
  273. package/dist/client/assets/{use-connection-DCLPda2h.js → use-connection-B0HreEyO.js} +1 -1
  274. package/dist/client/assets/{use-copy-14DzRp8J.js → use-copy-Cc2PzrxF.js} +1 -1
  275. package/dist/client/assets/{use-create-virtual-mcp-DoCSQs95.js → use-create-virtual-mcp-GYM-p3SY.js} +1 -1
  276. package/dist/client/assets/{use-date-fns-locale-DYzMvrWB.js → use-date-fns-locale-C1uUurom.js} +1 -1
  277. package/dist/client/assets/{use-debounced-autosave-BRAVEUZc.js → use-debounced-autosave-D2DtaMQY.js} +1 -1
  278. package/dist/client/assets/{use-debounced-value-Cud3o3Fq.js → use-debounced-value-Dci7_Qwe.js} +1 -1
  279. package/dist/client/assets/{use-deco-credits-rwNQ1gMg.js → use-deco-credits-CQYk77NF.js} +1 -1
  280. package/dist/client/assets/{use-decopilot-events-DYRVevWg.js → use-decopilot-events-HctMj33h.js} +1 -1
  281. package/dist/client/assets/{use-delete-connection-ueGIYWMK.js → use-delete-connection-Do6SoZ3c.js} +1 -1
  282. package/dist/client/assets/{use-deployment-admin-D6IzoXV0.js → use-deployment-admin-CRRFLUPy.js} +1 -1
  283. package/dist/client/assets/{use-file-configs-BwD1CaWo.js → use-file-configs-CMLhU-Fj.js} +1 -1
  284. package/dist/client/assets/{use-infinite-scroll-DkLPxlOu.js → use-infinite-scroll-TMy8eEjN.js} +1 -1
  285. package/dist/client/assets/{use-join-requests-DTGTfD21.js → use-join-requests-DxlLP6Wr.js} +1 -1
  286. package/dist/client/assets/{use-main-panel-tabs-EW6rbxam.js → use-main-panel-tabs-CbcTcl9J.js} +1 -1
  287. package/dist/client/assets/{use-mcp-auth-status-CPh3Lmzs.js → use-mcp-auth-status-gxHqvxAC.js} +1 -1
  288. package/dist/client/assets/{use-mcp-client-DsJzBus3.js → use-mcp-client-DO1cH-Rq.js} +1 -1
  289. package/dist/client/assets/{use-mcp-prompts-i0LZ2nQA.js → use-mcp-prompts-DZqLLTvQ.js} +1 -1
  290. package/dist/client/assets/{use-mcp-tools-Dc3F6Krl.js → use-mcp-tools-BIFTy-Ao.js} +1 -1
  291. package/dist/client/assets/{use-members-C0MdJrYz.js → use-members-Ca1m7gk-.js} +1 -1
  292. package/dist/client/assets/{use-navigate-to-agent-Bbq0oQ0Y.js → use-navigate-to-agent-DbrSvmvC.js} +1 -1
  293. package/dist/client/assets/{use-open-billing-url-DvTk9GH0.js → use-open-billing-url-CpZXluVO.js} +1 -1
  294. package/dist/client/assets/{use-org-auth-client-4o0wRx2Q.js → use-org-auth-client-S952sZID.js} +1 -1
  295. package/dist/client/assets/{use-org-fs-BEoPvlnI.js → use-org-fs-C1ai334S.js} +1 -1
  296. package/dist/client/assets/{use-org-notice-CXYMfMUq.js → use-org-notice-CJiZMwf2.js} +1 -1
  297. package/dist/client/assets/{use-org-sso-CdSz0xa8.js → use-org-sso-CFwon6Ac.js} +1 -1
  298. package/dist/client/assets/{use-organization-roles-DzWM9Nv-.js → use-organization-roles--bC30gnD.js} +1 -1
  299. package/dist/client/assets/{use-organization-settings-BAVHurZk.js → use-organization-settings-C7uzGCkO.js} +1 -1
  300. package/dist/client/assets/{use-panel-navigate-Byvx0cbx.js → use-panel-navigate-BgqqPVEC.js} +1 -1
  301. package/dist/client/assets/{use-project-native-view-presence-D-AyEulW.js → use-project-native-view-presence-DqW-vLSC.js} +1 -1
  302. package/dist/client/assets/{use-project-scope-B2cuvtTy.js → use-project-scope-cOFjIv3F.js} +1 -1
  303. package/dist/client/assets/{use-registry-connections-DikbDR8w.js → use-registry-connections-XlfVpqo2.js} +1 -1
  304. package/dist/client/assets/{use-secrets-D-c1ciPZ.js → use-secrets-DEa3ZFkm.js} +1 -1
  305. package/dist/client/assets/{use-section-preview-base-CwIWGkgy.js → use-section-preview-base-DfU-w-9v.js} +1 -1
  306. package/dist/client/assets/{use-session-runtime-BHahDP0E.js → use-session-runtime-D2nv6bTI.js} +1 -1
  307. package/dist/client/assets/{use-status-sounds-CnCb1h48.js → use-status-sounds-CBYC79_Y.js} +1 -1
  308. package/dist/client/assets/{use-tags-C2LhenRb.js → use-tags-6rI6kyxz.js} +1 -1
  309. package/dist/client/assets/{use-task-metadata-CB3EJ29f.js → use-task-metadata-DuwC-TmK.js} +1 -1
  310. package/dist/client/assets/{use-thread-outputs-9oZhiYbB.js → use-thread-outputs-DwE-nO-h.js} +1 -1
  311. package/dist/client/assets/{use-view-mode-BvOL5I4W.js → use-view-mode-2goLAQJg.js} +1 -1
  312. package/dist/client/assets/{use-virtual-mcp-Bk09OpEg.js → use-virtual-mcp-DY2qk06G.js} +1 -1
  313. package/dist/client/assets/useInfiniteQuery-B3TKIUIz.js +1 -0
  314. package/dist/client/assets/{useQueries-qr8TAkZc.js → useQueries-CDFEvGc1.js} +1 -1
  315. package/dist/client/assets/useSuspenseInfiniteQuery-BuAksfER.js +1 -0
  316. package/dist/client/assets/{users-C1ExMDuM.js → users-xM0kvyFO.js} +1 -1
  317. package/dist/client/assets/{utils-B14U8IKK.js → utils-DPVkkzea.js} +1 -1
  318. package/dist/client/assets/{variant-calendar-urd0wE-3.js → variant-calendar-C1Gzo9bi.js} +1 -1
  319. package/dist/client/assets/{variant-matcher-override-DvY-JiuY.js → variant-matcher-override-GDeATfJn.js} +1 -1
  320. package/dist/client/assets/{view-mode-toggle-swSorpD7.js → view-mode-toggle-VHYgVEtv.js} +1 -1
  321. package/dist/client/assets/{virtual-mcp-DGQbDtgM.js → virtual-mcp-CSoIE5pZ.js} +1 -1
  322. package/dist/client/index.html +1 -1
  323. package/dist/server/cli.js +1 -1
  324. package/dist/server/server.js +1 -1
  325. package/package.json +1 -1
  326. package/dist/client/assets/agent-app-CzbKRw1_.js +0 -1
  327. package/dist/client/assets/agent-deck-D5-mvZ5i.js +0 -1
  328. package/dist/client/assets/agent-file-DkGApBvp.js +0 -1
  329. package/dist/client/assets/agent-library-file-CK85m8fH.js +0 -1
  330. package/dist/client/assets/agent-settings-gb3smN_4.js +0 -1
  331. package/dist/client/assets/agent-site-editor-code-DkcL_YVi.js +0 -2
  332. package/dist/client/assets/agent-view-D9WzU94g.js +0 -1
  333. package/dist/client/assets/api-keys-BQayHq-8.js +0 -1
  334. package/dist/client/assets/app-editor-DeI0TeES.js +0 -1
  335. package/dist/client/assets/automations-CDxxuCym.js +0 -1
  336. package/dist/client/assets/category-editor-4KcN0JRt.js +0 -1
  337. package/dist/client/assets/project-reports-q4w3pT5T.js +0 -1
  338. package/dist/client/assets/project-tasks-DqlAyIfE.js +0 -1
  339. package/dist/client/assets/record-editor-n0M7yiQw.js +0 -1
  340. package/dist/client/assets/redirect-editor-CK3YSOdb.js +0 -1
  341. package/dist/client/assets/registry-DkzCUqTc.js +0 -2
  342. package/dist/client/assets/reports-C2LVTrmJ.js +0 -1
  343. package/dist/client/assets/settings-layout-DlH0gQXK.js +0 -1
  344. package/dist/client/assets/store-registry-DQHLJpOA.js +0 -2
  345. package/dist/client/assets/tasks-C6DyE2q-.js +0 -1
  346. package/dist/client/assets/useInfiniteQuery-GKCP1c_7.js +0 -1
  347. package/dist/client/assets/useSuspenseInfiniteQuery-DmEiIBI4.js +0 -1
@@ -1 +1 @@
1
- import{bn as O,au as U,c as P,j as r,r as G,E as ee,b as F,B as q,I as te,K as Q,n as se,ej as ne,ev as re,l as ae}from"./index-B3yBTWEk.js";import{u as ie}from"./useSuspenseInfiniteQuery-DmEiIBI4.js";import{A as le}from"./avatar-DcDvs8Zz.js";import{n as oe,t as ce}from"./ChevronUp-DGrguvGW.js";import{n as W}from"./Tool02-C_xRWqQk.js";import{a as ue,M as de}from"./pair-C08OPQNP.js";import{D as me}from"./chat-context-CXknhaDs.js";import{I as Y}from"./integration-icon-BPwWRlNG.js";import{u as fe}from"./use-decopilot-events-DYRVevWg.js";import{u as xe}from"./use-infinite-scroll-DkLPxlOu.js";import{g as ge}from"./task-status-DIr_2V94.js";const z=[{ms:6e4,label:"1m"},{ms:12e4,label:"2m"},{ms:3e5,label:"5m"},{ms:6e5,label:"10m"},{ms:9e5,label:"15m"},{ms:18e5,label:"30m"},{ms:36e5,label:"1h"},{ms:72e5,label:"2h"},{ms:216e5,label:"6h"},{ms:432e5,label:"12h"},{ms:864e5,label:"1d"},{ms:6048e5,label:"7d"}],he=40;function qe(t){const s=(t.endDate.getTime()-t.startDate.getTime())/he;return z.find(i=>i.ms>=s)?.label??z[z.length-1].label}function K(t){const e=z.find(l=>l.label===t);if(e)return e.ms;const s=/^(\d+)([mhd])$/.exec(t);if(!s)return 6e4;const n=parseInt(s[1],10),i=s[2];return i==="h"?n*36e5:i==="d"?n*864e5:n*6e4}function pe(t,e){const s=new Date(t);return K(e)>=864e5?s.toLocaleDateString([],{month:"short",day:"numeric"}):s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function H(t,e){const s=K(e);return new Date(Math.floor(t.getTime()/s)*s)}function be(t){return t>=1e4?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`}function He(t){return Number.isFinite(t)?t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:Math.round(t).toLocaleString():"0"}function Oe(t){return Number.isFinite(t)?`$${t.toFixed(t<1?4:2)}`:"$0.00"}function Ue(t,e,s){const n=K(s),i=H(e.startDate,s).getTime(),l=e.endDate.getTime(),a=new Map(t.map(c=>[H(new Date(c.timestamp),s).getTime(),c])),u=[];for(let c=i;c<=l;c+=n){const m=a.get(c),h=new Date(c).toISOString();u.push({t:h,ts:c,label:pe(h,s),calls:m?.calls??0,errors:m?.errors??0,errorRate:m?.errorRate??0,avg:m?.avg??0,p50:m?.p50??0,p95:m?.p95??0,inputTokens:m?.inputTokens??0,outputTokens:m?.outputTokens??0,totalTokens:m?.totalTokens??0,costUsd:m?.costUsd??0})}return u}function Ge(t,e,s,n){const i=new Map;for(const o of t)i.set(o.toolName,(i.get(o.toolName)??0)+o[e]);const l=[...i.entries()].sort((o,d)=>d[1]-o[1]).slice(0,s).map(([o])=>o),a=new Set(l),u=new Map,c=new Map;for(const o of t){if(!a.has(o.toolName))continue;const d=o.virtualMcpId??"";u.set(d,(u.get(d)??0)+o[e]),c.set(`${d}::${o.toolName}`,{calls:o.calls,errors:o.errors,outputSize:o.outputSize})}const m=[...u.entries()].sort((o,d)=>d[1]-o[1]).slice(0,n).map(([o])=>o);let h=0;for(const o of m)for(const d of l){const x=c.get(`${o}::${d}`);x&&x[e]>h&&(h=x[e])}return{topTools:l,topAgentIds:m,cellMap:c,maxValue:h}}function Qe(t,e){return e==="requests"?t.calls:e==="errors"?t.errorRate:t.avgDurationMs}function We(t,e){return e==="requests"?t.calls.toLocaleString():e==="errors"?`${t.errorRate.toFixed(1)}%`:be(t.avgDurationMs)}function Z(t){return(t.run_config??{}).agent?.id??(t.virtual_mcp_id||null)}function J(t,e,s,n){if(!t)return n;const i=e.find(a=>a.id===t)??s?.find(a=>a.id===t);if(i?.title)return i.title;const l=O(t);return l?U(l).title??n:t}function X(t,e,s){if(!t)return null;const n=e.find(l=>l.id===t)??s?.find(l=>l.id===t);if(n?.icon)return n.icon;const i=O(t);return i?U(i).icon??null:null}function je(t){return t?.data?.members??[]}function V(t){const e=P.c(32),{thread:s,connections:n,virtualMcps:i,nav:l}=t,a=F();let u,c;if(e[0]!==n||e[1]!==s||e[2]!==i){const N=Z(s);u=J(N,i,n,""),c=X(N,i,n),e[0]=n,e[1]=s,e[2]=i,e[3]=u,e[4]=c}else u=e[3],c=e[4];const m=c;let h;e[5]!==u||e[6]!==a||e[7]!==s.title?(h=u||s.title||a("orgs.threads.untitledChat"),e[5]=u,e[6]=a,e[7]=s.title,e[8]=h):h=e[8];let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(W,{}),e[9]=o):o=e[9];let d;e[10]!==m||e[11]!==h?(d=r.jsx(Y,{icon:m,name:h,size:"sm",fallbackIcon:o,className:"shadow-sm shrink-0 rounded-md"}),e[10]=m,e[11]=h,e[12]=d):d=e[12];let x;e[13]!==a||e[14]!==s.title?(x=s.title||a("orgs.threads.untitledChat"),e[13]=a,e[14]=s.title,e[15]=x):x=e[15];let b;e[16]!==x?(b=r.jsx(ne,{className:"text-sm leading-snug truncate",children:x}),e[16]=x,e[17]=b):b=e[17];let v;e[18]!==u?(v=u&&r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:u}),e[18]=u,e[19]=v):v=e[19];let p;e[20]!==b||e[21]!==v?(p=r.jsxs("div",{className:"min-w-0",children:[b,v]}),e[20]=b,e[21]=v,e[22]=p):p=e[22];let f;e[23]!==d||e[24]!==p?(f=r.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d,p]}),e[23]=d,e[24]=p,e[25]=f):f=e[25];let g;e[26]!==l||e[27]!==a?(g=l&&r.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[r.jsx(q,{size:"icon",variant:"ghost",onClick:l.onPrev,disabled:l.index===0,className:"h-7 w-7 text-muted-foreground","aria-label":a("orgs.threads.previousChat"),children:r.jsx(oe,{size:14})}),r.jsx(q,{size:"icon",variant:"ghost",onClick:l.onNext,disabled:l.index===l.total-1,className:"h-7 w-7 text-muted-foreground","aria-label":a("orgs.threads.nextChat"),children:r.jsx(ce,{size:14})})]}),e[26]=l,e[27]=a,e[28]=g):g=e[28];let j;return e[29]!==g||e[30]!==f?(j=r.jsx(re,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:r.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[f,g]})}),e[29]=g,e[30]=f,e[31]=j):j=e[31],j}function ve(t){const e=P.c(62),{thread:s,connections:n,virtualMcps:i,members:l}=t,a=F();let u,c;if(e[0]!==n||e[1]!==s||e[2]!==i){const I=Z(s);u=J(I,i,n,""),c=X(I,i,n),e[0]=n,e[1]=s,e[2]=i,e[3]=u,e[4]=c}else u=e[3],c=e[4];const m=c;let h;if(e[5]!==l||e[6]!==s.created_by){const I=je(l);let R;e[8]!==s.created_by?(R=L=>L.userId===s.created_by,e[8]=s.created_by,e[9]=R):R=e[9],h=I.find(R),e[5]=l,e[6]=s.created_by,e[7]=h}else h=e[7];const o=h;let d;e[10]!==o?.user.email||e[11]!==o?.user.name||e[12]!==s.created_by?(d=o?.user.name??o?.user.email??s.created_by?.substring(0,8)??"—",e[10]=o?.user.email,e[11]=o?.user.name,e[12]=s.created_by,e[13]=d):d=e[13];const x=d,b=o?.user.image??void 0;let v;e[14]!==s.created_at?(v=new Date(s.created_at).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[14]=s.created_at,e[15]=v):v=e[15];const p=v;let f,g,j,N,C,w;if(e[16]!==a||e[17]!==s.status){const I=ge(s.status),R=I.icon;f="px-5 md:px-6 py-5 border-b border-border grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4 text-sm";let L;e[24]!==a?(L=a("orgs.threads.status"),e[24]=a,e[25]=L):L=e[25],e[26]!==L?(w=r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:L}),e[26]=L,e[27]=w):w=e[27],N="flex items-center gap-1.5",C=r.jsx(R,{size:13,className:I.iconClassName}),g=ae("text-sm",I.labelColor),j=a(I.labelKey),e[16]=a,e[17]=s.status,e[18]=f,e[19]=g,e[20]=j,e[21]=N,e[22]=C,e[23]=w}else f=e[18],g=e[19],j=e[20],N=e[21],C=e[22],w=e[23];let T;e[28]!==g||e[29]!==j?(T=r.jsx("span",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=T):T=e[30];let y;e[31]!==T||e[32]!==N||e[33]!==C?(y=r.jsxs("div",{className:N,children:[C,T]}),e[31]=T,e[32]=N,e[33]=C,e[34]=y):y=e[34];let S;e[35]!==y||e[36]!==w?(S=r.jsxs("div",{children:[w,y]}),e[35]=y,e[36]=w,e[37]=S):S=e[37];let E;e[38]!==a?(E=a("orgs.threads.date"),e[38]=a,e[39]=E):E=e[39];let _;e[40]!==E?(_=r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:E}),e[40]=E,e[41]=_):_=e[41];let M;e[42]!==p?(M=r.jsx("div",{className:"text-sm text-foreground",children:p}),e[42]=p,e[43]=M):M=e[43];let D;e[44]!==_||e[45]!==M?(D=r.jsxs("div",{children:[_,M]}),e[44]=_,e[45]=M,e[46]=D):D=e[46];let $;e[47]!==a||e[48]!==s.created_by||e[49]!==b||e[50]!==x?($=s.created_by&&r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:a("orgs.threads.user")}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(le,{url:b,fallback:x,shape:"circle",size:"2xs",className:"shrink-0"}),r.jsx("span",{className:"text-sm text-foreground",children:x})]})]}),e[47]=a,e[48]=s.created_by,e[49]=b,e[50]=x,e[51]=$):$=e[51];let k;e[52]!==m||e[53]!==u||e[54]!==a?(k=u&&r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:a("orgs.threads.agent")}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Y,{icon:m,name:u,size:"xs",fallbackIcon:r.jsx(W,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),r.jsx("span",{className:"text-sm text-foreground",children:u})]})]}),e[52]=m,e[53]=u,e[54]=a,e[55]=k):k=e[55];let A;return e[56]!==f||e[57]!==S||e[58]!==D||e[59]!==$||e[60]!==k?(A=r.jsxs("div",{className:f,children:[S,D,$,k]}),e[56]=f,e[57]=S,e[58]=D,e[59]=$,e[60]=k,e[61]=A):A=e[61],A}const B=100;function Ne(){const t=P.c(4),e=F();let s;t[0]!==e?(s=e("orgs.threads.noMessagesInChat"),t[0]=e,t[1]=s):s=t[1];let n;return t[2]!==s?(n=r.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=n):n=t[3],n}function Me(){const t=P.c(4),e=F();let s;t[0]!==e?(s=e("orgs.threads.loadingMore"),t[0]=e,t[1]=s):s=t[1];let n;return t[2]!==s?(n=r.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:s}),t[2]=s,t[3]=n):n=t[3],n}const Te=400,ye=5e3;function Se(t,e,s){const n=P.c(8),i=se(),l=G.useRef(null);let a;n[0]!==e||n[1]!==i||n[2]!==s?(a=()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,i.invalidateQueries({queryKey:Q.threadMessages(e,s)})},Te)},n[0]=e,n[1]=i,n[2]=s,n[3]=a):a=n[3];const u=a;let c;n[4]!==t||n[5]!==u||n[6]!==s?(c={orgSlug:t,taskId:s,onStep:u,onFinish:u,onReconnect:u},n[4]=t,n[5]=u,n[6]=s,n[7]=c):c=n[7],fe(c)}function _e(t){const e=P.c(36),{client:s,locator:n,thread:i,connections:l,virtualMcps:a,members:u,nav:c,meta:m}=t,{org:h}=te();let o;e[0]!==n||e[1]!==i.id?(o=Q.threadMessages(n,i.id),e[0]=n,e[1]=i.id,e[2]=o):o=e[2];let d;e[3]!==s||e[4]!==i.id?(d=async _=>{const{pageParam:M}=_,D=M===void 0?0:M;if(!s)throw new Error("MCP client is not available");const $=await s.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:i.id,limit:B,offset:D}});return $.structuredContent??$},e[3]=s,e[4]=i.id,e[5]=d):d=e[5];let x;e[6]!==o||e[7]!==d?(x={queryKey:o,queryFn:d,initialPageParam:0,getNextPageParam:Ee,staleTime:0,refetchInterval:ye},e[6]=o,e[7]=d,e[8]=x):x=e[8];const{data:b,fetchNextPage:v,hasNextPage:p,isFetchingNextPage:f}=ie(x);Se(h.slug,n,i.id);let g;e[9]!==b.pages?(g=b.pages.flatMap(Ce).filter(we),e[9]=b.pages,e[10]=g):g=e[10];const j=g,N=ue(j);let C;e[11]!==v||e[12]!==p||e[13]!==f?(C=()=>{p&&!f&&v()},e[11]=v,e[12]=p,e[13]=f,e[14]=C):C=e[14];const w=xe(C,p??!1,f);let T;e[15]!==l||e[16]!==c||e[17]!==i||e[18]!==a?(T=r.jsx(V,{thread:i,connections:l,virtualMcps:a,nav:c}),e[15]=l,e[16]=c,e[17]=i,e[18]=a,e[19]=T):T=e[19];let y;e[20]!==l||e[21]!==u||e[22]!==m||e[23]!==i||e[24]!==a?(y=m&&r.jsx(ve,{thread:i,connections:l,virtualMcps:a,members:u}),e[20]=l,e[21]=u,e[22]=m,e[23]=i,e[24]=a,e[25]=y):y=e[25];let S;e[26]!==f||e[27]!==w||e[28]!==N||e[29]!==j.length||e[30]!==i.status?(S=j.length===0?r.jsx(Ne,{}):r.jsx("div",{"data-chat-scroller":!0,className:"flex-1 overflow-y-auto min-h-0",children:r.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[N.map((_,M)=>r.jsx("div",{ref:M===N.length-1?w:void 0,children:r.jsx(de,{pair:_,isLastPair:M===N.length-1,status:M===N.length-1&&i.status==="in_progress"?"streaming":"ready"})},`pair-${_.user?.id??_.assistant?.id}`)),f&&r.jsx(Me,{})]})}),e[26]=f,e[27]=w,e[28]=N,e[29]=j.length,e[30]=i.status,e[31]=S):S=e[31];let E;return e[32]!==T||e[33]!==y||e[34]!==S?(E=r.jsxs(r.Fragment,{children:[T,y,S]}),e[32]=T,e[33]=y,e[34]=S,e[35]=E):E=e[35],E}function we(t){return t.role==="user"||t.role==="assistant"}function Ce(t){return t.items??[]}function Ee(t,e){const s=t,n=e;if(!((s?.items?.length??0)<B))return n.length*B}function Ie(){const t=P.c(4),e=F();let s;t[0]!==e?(s=e("orgs.threads.failedToLoadMessages"),t[0]=e,t[1]=s):s=t[1];let n;return t[2]!==s?(n=r.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=n):n=t[3],n}function $e(){const t=P.c(4),e=F();let s;t[0]!==e?(s=e("orgs.threads.loadingConversation"),t[0]=e,t[1]=s):s=t[1];let n;return t[2]!==s?(n=r.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=n):n=t[3],n}function Ye(t){const e=P.c(31),{thread:s,client:n,locator:i,connections:l,virtualMcps:a,members:u,nav:c,meta:m}=t,h=m===void 0?!0:m;let o;e[0]!==l||e[1]!==c||e[2]!==s||e[3]!==a?(o=r.jsx(V,{thread:s,connections:l,virtualMcps:a,nav:c}),e[0]=l,e[1]=c,e[2]=s,e[3]=a,e[4]=o):o=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=r.jsx(Ie,{}),e[5]=d):d=e[5];let x;e[6]!==o?(x=r.jsxs(r.Fragment,{children:[o,d]}),e[6]=o,e[7]=x):x=e[7];let b;e[8]!==l||e[9]!==c||e[10]!==s||e[11]!==a?(b=r.jsx(V,{thread:s,connections:l,virtualMcps:a,nav:c}),e[8]=l,e[9]=c,e[10]=s,e[11]=a,e[12]=b):b=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx($e,{}),e[13]=v):v=e[13];let p;e[14]!==b?(p=r.jsxs(r.Fragment,{children:[b,v]}),e[14]=b,e[15]=p):p=e[15];let f;e[16]!==n||e[17]!==l||e[18]!==i||e[19]!==u||e[20]!==h||e[21]!==c||e[22]!==s||e[23]!==a?(f=r.jsx(_e,{client:n,locator:i,thread:s,connections:l,virtualMcps:a,members:u,nav:c,meta:h}),e[16]=n,e[17]=l,e[18]=i,e[19]=u,e[20]=h,e[21]=c,e[22]=s,e[23]=a,e[24]=f):f=e[24];let g;e[25]!==p||e[26]!==f?(g=r.jsx(G.Suspense,{fallback:p,children:f}),e[25]=p,e[26]=f,e[27]=g):g=e[27];let j;return e[28]!==x||e[29]!==g?(j=r.jsx(me,{children:r.jsx(ee,{fallback:x,children:g})}),e[28]=x,e[29]=g,e[30]=j):j=e[30],j}export{Ye as T,Oe as a,Ue as b,be as c,We as d,Qe as e,He as f,qe as g,Ge as h,je as i,Z as j,X as k,J as r};
1
+ import{bn as O,au as U,c as P,j as r,r as G,E as ee,b as F,B as q,I as te,K as Q,n as se,ej as ne,ev as re,l as ae}from"./index-BodvdIMk.js";import{u as ie}from"./useSuspenseInfiniteQuery-BuAksfER.js";import{A as le}from"./avatar-CAI2JETZ.js";import{n as oe,t as ce}from"./ChevronUp-SbK1Bh_A.js";import{n as W}from"./Tool02-CnClhfmX.js";import{a as ue,M as de}from"./pair-BryCAS3L.js";import{D as me}from"./chat-context-BdJniD3E.js";import{I as Y}from"./integration-icon-BqCQeMla.js";import{u as fe}from"./use-decopilot-events-HctMj33h.js";import{u as xe}from"./use-infinite-scroll-TMy8eEjN.js";import{g as ge}from"./task-status-Cm28QQwf.js";const z=[{ms:6e4,label:"1m"},{ms:12e4,label:"2m"},{ms:3e5,label:"5m"},{ms:6e5,label:"10m"},{ms:9e5,label:"15m"},{ms:18e5,label:"30m"},{ms:36e5,label:"1h"},{ms:72e5,label:"2h"},{ms:216e5,label:"6h"},{ms:432e5,label:"12h"},{ms:864e5,label:"1d"},{ms:6048e5,label:"7d"}],he=40;function qe(t){const s=(t.endDate.getTime()-t.startDate.getTime())/he;return z.find(i=>i.ms>=s)?.label??z[z.length-1].label}function K(t){const e=z.find(l=>l.label===t);if(e)return e.ms;const s=/^(\d+)([mhd])$/.exec(t);if(!s)return 6e4;const n=parseInt(s[1],10),i=s[2];return i==="h"?n*36e5:i==="d"?n*864e5:n*6e4}function pe(t,e){const s=new Date(t);return K(e)>=864e5?s.toLocaleDateString([],{month:"short",day:"numeric"}):s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function H(t,e){const s=K(e);return new Date(Math.floor(t.getTime()/s)*s)}function be(t){return t>=1e4?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`}function He(t){return Number.isFinite(t)?t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:Math.round(t).toLocaleString():"0"}function Oe(t){return Number.isFinite(t)?`$${t.toFixed(t<1?4:2)}`:"$0.00"}function Ue(t,e,s){const n=K(s),i=H(e.startDate,s).getTime(),l=e.endDate.getTime(),a=new Map(t.map(c=>[H(new Date(c.timestamp),s).getTime(),c])),u=[];for(let c=i;c<=l;c+=n){const m=a.get(c),h=new Date(c).toISOString();u.push({t:h,ts:c,label:pe(h,s),calls:m?.calls??0,errors:m?.errors??0,errorRate:m?.errorRate??0,avg:m?.avg??0,p50:m?.p50??0,p95:m?.p95??0,inputTokens:m?.inputTokens??0,outputTokens:m?.outputTokens??0,totalTokens:m?.totalTokens??0,costUsd:m?.costUsd??0})}return u}function Ge(t,e,s,n){const i=new Map;for(const o of t)i.set(o.toolName,(i.get(o.toolName)??0)+o[e]);const l=[...i.entries()].sort((o,d)=>d[1]-o[1]).slice(0,s).map(([o])=>o),a=new Set(l),u=new Map,c=new Map;for(const o of t){if(!a.has(o.toolName))continue;const d=o.virtualMcpId??"";u.set(d,(u.get(d)??0)+o[e]),c.set(`${d}::${o.toolName}`,{calls:o.calls,errors:o.errors,outputSize:o.outputSize})}const m=[...u.entries()].sort((o,d)=>d[1]-o[1]).slice(0,n).map(([o])=>o);let h=0;for(const o of m)for(const d of l){const x=c.get(`${o}::${d}`);x&&x[e]>h&&(h=x[e])}return{topTools:l,topAgentIds:m,cellMap:c,maxValue:h}}function Qe(t,e){return e==="requests"?t.calls:e==="errors"?t.errorRate:t.avgDurationMs}function We(t,e){return e==="requests"?t.calls.toLocaleString():e==="errors"?`${t.errorRate.toFixed(1)}%`:be(t.avgDurationMs)}function Z(t){return(t.run_config??{}).agent?.id??(t.virtual_mcp_id||null)}function J(t,e,s,n){if(!t)return n;const i=e.find(a=>a.id===t)??s?.find(a=>a.id===t);if(i?.title)return i.title;const l=O(t);return l?U(l).title??n:t}function X(t,e,s){if(!t)return null;const n=e.find(l=>l.id===t)??s?.find(l=>l.id===t);if(n?.icon)return n.icon;const i=O(t);return i?U(i).icon??null:null}function je(t){return t?.data?.members??[]}function V(t){const e=P.c(32),{thread:s,connections:n,virtualMcps:i,nav:l}=t,a=F();let u,c;if(e[0]!==n||e[1]!==s||e[2]!==i){const N=Z(s);u=J(N,i,n,""),c=X(N,i,n),e[0]=n,e[1]=s,e[2]=i,e[3]=u,e[4]=c}else u=e[3],c=e[4];const m=c;let h;e[5]!==u||e[6]!==a||e[7]!==s.title?(h=u||s.title||a("orgs.threads.untitledChat"),e[5]=u,e[6]=a,e[7]=s.title,e[8]=h):h=e[8];let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(W,{}),e[9]=o):o=e[9];let d;e[10]!==m||e[11]!==h?(d=r.jsx(Y,{icon:m,name:h,size:"sm",fallbackIcon:o,className:"shadow-sm shrink-0 rounded-md"}),e[10]=m,e[11]=h,e[12]=d):d=e[12];let x;e[13]!==a||e[14]!==s.title?(x=s.title||a("orgs.threads.untitledChat"),e[13]=a,e[14]=s.title,e[15]=x):x=e[15];let b;e[16]!==x?(b=r.jsx(ne,{className:"text-sm leading-snug truncate",children:x}),e[16]=x,e[17]=b):b=e[17];let v;e[18]!==u?(v=u&&r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:u}),e[18]=u,e[19]=v):v=e[19];let p;e[20]!==b||e[21]!==v?(p=r.jsxs("div",{className:"min-w-0",children:[b,v]}),e[20]=b,e[21]=v,e[22]=p):p=e[22];let f;e[23]!==d||e[24]!==p?(f=r.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d,p]}),e[23]=d,e[24]=p,e[25]=f):f=e[25];let g;e[26]!==l||e[27]!==a?(g=l&&r.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[r.jsx(q,{size:"icon",variant:"ghost",onClick:l.onPrev,disabled:l.index===0,className:"h-7 w-7 text-muted-foreground","aria-label":a("orgs.threads.previousChat"),children:r.jsx(oe,{size:14})}),r.jsx(q,{size:"icon",variant:"ghost",onClick:l.onNext,disabled:l.index===l.total-1,className:"h-7 w-7 text-muted-foreground","aria-label":a("orgs.threads.nextChat"),children:r.jsx(ce,{size:14})})]}),e[26]=l,e[27]=a,e[28]=g):g=e[28];let j;return e[29]!==g||e[30]!==f?(j=r.jsx(re,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:r.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[f,g]})}),e[29]=g,e[30]=f,e[31]=j):j=e[31],j}function ve(t){const e=P.c(62),{thread:s,connections:n,virtualMcps:i,members:l}=t,a=F();let u,c;if(e[0]!==n||e[1]!==s||e[2]!==i){const I=Z(s);u=J(I,i,n,""),c=X(I,i,n),e[0]=n,e[1]=s,e[2]=i,e[3]=u,e[4]=c}else u=e[3],c=e[4];const m=c;let h;if(e[5]!==l||e[6]!==s.created_by){const I=je(l);let R;e[8]!==s.created_by?(R=L=>L.userId===s.created_by,e[8]=s.created_by,e[9]=R):R=e[9],h=I.find(R),e[5]=l,e[6]=s.created_by,e[7]=h}else h=e[7];const o=h;let d;e[10]!==o?.user.email||e[11]!==o?.user.name||e[12]!==s.created_by?(d=o?.user.name??o?.user.email??s.created_by?.substring(0,8)??"—",e[10]=o?.user.email,e[11]=o?.user.name,e[12]=s.created_by,e[13]=d):d=e[13];const x=d,b=o?.user.image??void 0;let v;e[14]!==s.created_at?(v=new Date(s.created_at).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[14]=s.created_at,e[15]=v):v=e[15];const p=v;let f,g,j,N,C,w;if(e[16]!==a||e[17]!==s.status){const I=ge(s.status),R=I.icon;f="px-5 md:px-6 py-5 border-b border-border grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4 text-sm";let L;e[24]!==a?(L=a("orgs.threads.status"),e[24]=a,e[25]=L):L=e[25],e[26]!==L?(w=r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:L}),e[26]=L,e[27]=w):w=e[27],N="flex items-center gap-1.5",C=r.jsx(R,{size:13,className:I.iconClassName}),g=ae("text-sm",I.labelColor),j=a(I.labelKey),e[16]=a,e[17]=s.status,e[18]=f,e[19]=g,e[20]=j,e[21]=N,e[22]=C,e[23]=w}else f=e[18],g=e[19],j=e[20],N=e[21],C=e[22],w=e[23];let T;e[28]!==g||e[29]!==j?(T=r.jsx("span",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=T):T=e[30];let y;e[31]!==T||e[32]!==N||e[33]!==C?(y=r.jsxs("div",{className:N,children:[C,T]}),e[31]=T,e[32]=N,e[33]=C,e[34]=y):y=e[34];let S;e[35]!==y||e[36]!==w?(S=r.jsxs("div",{children:[w,y]}),e[35]=y,e[36]=w,e[37]=S):S=e[37];let E;e[38]!==a?(E=a("orgs.threads.date"),e[38]=a,e[39]=E):E=e[39];let _;e[40]!==E?(_=r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:E}),e[40]=E,e[41]=_):_=e[41];let M;e[42]!==p?(M=r.jsx("div",{className:"text-sm text-foreground",children:p}),e[42]=p,e[43]=M):M=e[43];let D;e[44]!==_||e[45]!==M?(D=r.jsxs("div",{children:[_,M]}),e[44]=_,e[45]=M,e[46]=D):D=e[46];let $;e[47]!==a||e[48]!==s.created_by||e[49]!==b||e[50]!==x?($=s.created_by&&r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:a("orgs.threads.user")}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(le,{url:b,fallback:x,shape:"circle",size:"2xs",className:"shrink-0"}),r.jsx("span",{className:"text-sm text-foreground",children:x})]})]}),e[47]=a,e[48]=s.created_by,e[49]=b,e[50]=x,e[51]=$):$=e[51];let k;e[52]!==m||e[53]!==u||e[54]!==a?(k=u&&r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:a("orgs.threads.agent")}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Y,{icon:m,name:u,size:"xs",fallbackIcon:r.jsx(W,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),r.jsx("span",{className:"text-sm text-foreground",children:u})]})]}),e[52]=m,e[53]=u,e[54]=a,e[55]=k):k=e[55];let A;return e[56]!==f||e[57]!==S||e[58]!==D||e[59]!==$||e[60]!==k?(A=r.jsxs("div",{className:f,children:[S,D,$,k]}),e[56]=f,e[57]=S,e[58]=D,e[59]=$,e[60]=k,e[61]=A):A=e[61],A}const B=100;function Ne(){const t=P.c(4),e=F();let s;t[0]!==e?(s=e("orgs.threads.noMessagesInChat"),t[0]=e,t[1]=s):s=t[1];let n;return t[2]!==s?(n=r.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=n):n=t[3],n}function Me(){const t=P.c(4),e=F();let s;t[0]!==e?(s=e("orgs.threads.loadingMore"),t[0]=e,t[1]=s):s=t[1];let n;return t[2]!==s?(n=r.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:s}),t[2]=s,t[3]=n):n=t[3],n}const Te=400,ye=5e3;function Se(t,e,s){const n=P.c(8),i=se(),l=G.useRef(null);let a;n[0]!==e||n[1]!==i||n[2]!==s?(a=()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,i.invalidateQueries({queryKey:Q.threadMessages(e,s)})},Te)},n[0]=e,n[1]=i,n[2]=s,n[3]=a):a=n[3];const u=a;let c;n[4]!==t||n[5]!==u||n[6]!==s?(c={orgSlug:t,taskId:s,onStep:u,onFinish:u,onReconnect:u},n[4]=t,n[5]=u,n[6]=s,n[7]=c):c=n[7],fe(c)}function _e(t){const e=P.c(36),{client:s,locator:n,thread:i,connections:l,virtualMcps:a,members:u,nav:c,meta:m}=t,{org:h}=te();let o;e[0]!==n||e[1]!==i.id?(o=Q.threadMessages(n,i.id),e[0]=n,e[1]=i.id,e[2]=o):o=e[2];let d;e[3]!==s||e[4]!==i.id?(d=async _=>{const{pageParam:M}=_,D=M===void 0?0:M;if(!s)throw new Error("MCP client is not available");const $=await s.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:i.id,limit:B,offset:D}});return $.structuredContent??$},e[3]=s,e[4]=i.id,e[5]=d):d=e[5];let x;e[6]!==o||e[7]!==d?(x={queryKey:o,queryFn:d,initialPageParam:0,getNextPageParam:Ee,staleTime:0,refetchInterval:ye},e[6]=o,e[7]=d,e[8]=x):x=e[8];const{data:b,fetchNextPage:v,hasNextPage:p,isFetchingNextPage:f}=ie(x);Se(h.slug,n,i.id);let g;e[9]!==b.pages?(g=b.pages.flatMap(Ce).filter(we),e[9]=b.pages,e[10]=g):g=e[10];const j=g,N=ue(j);let C;e[11]!==v||e[12]!==p||e[13]!==f?(C=()=>{p&&!f&&v()},e[11]=v,e[12]=p,e[13]=f,e[14]=C):C=e[14];const w=xe(C,p??!1,f);let T;e[15]!==l||e[16]!==c||e[17]!==i||e[18]!==a?(T=r.jsx(V,{thread:i,connections:l,virtualMcps:a,nav:c}),e[15]=l,e[16]=c,e[17]=i,e[18]=a,e[19]=T):T=e[19];let y;e[20]!==l||e[21]!==u||e[22]!==m||e[23]!==i||e[24]!==a?(y=m&&r.jsx(ve,{thread:i,connections:l,virtualMcps:a,members:u}),e[20]=l,e[21]=u,e[22]=m,e[23]=i,e[24]=a,e[25]=y):y=e[25];let S;e[26]!==f||e[27]!==w||e[28]!==N||e[29]!==j.length||e[30]!==i.status?(S=j.length===0?r.jsx(Ne,{}):r.jsx("div",{"data-chat-scroller":!0,className:"flex-1 overflow-y-auto min-h-0",children:r.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[N.map((_,M)=>r.jsx("div",{ref:M===N.length-1?w:void 0,children:r.jsx(de,{pair:_,isLastPair:M===N.length-1,status:M===N.length-1&&i.status==="in_progress"?"streaming":"ready"})},`pair-${_.user?.id??_.assistant?.id}`)),f&&r.jsx(Me,{})]})}),e[26]=f,e[27]=w,e[28]=N,e[29]=j.length,e[30]=i.status,e[31]=S):S=e[31];let E;return e[32]!==T||e[33]!==y||e[34]!==S?(E=r.jsxs(r.Fragment,{children:[T,y,S]}),e[32]=T,e[33]=y,e[34]=S,e[35]=E):E=e[35],E}function we(t){return t.role==="user"||t.role==="assistant"}function Ce(t){return t.items??[]}function Ee(t,e){const s=t,n=e;if(!((s?.items?.length??0)<B))return n.length*B}function Ie(){const t=P.c(4),e=F();let s;t[0]!==e?(s=e("orgs.threads.failedToLoadMessages"),t[0]=e,t[1]=s):s=t[1];let n;return t[2]!==s?(n=r.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=n):n=t[3],n}function $e(){const t=P.c(4),e=F();let s;t[0]!==e?(s=e("orgs.threads.loadingConversation"),t[0]=e,t[1]=s):s=t[1];let n;return t[2]!==s?(n=r.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=n):n=t[3],n}function Ye(t){const e=P.c(31),{thread:s,client:n,locator:i,connections:l,virtualMcps:a,members:u,nav:c,meta:m}=t,h=m===void 0?!0:m;let o;e[0]!==l||e[1]!==c||e[2]!==s||e[3]!==a?(o=r.jsx(V,{thread:s,connections:l,virtualMcps:a,nav:c}),e[0]=l,e[1]=c,e[2]=s,e[3]=a,e[4]=o):o=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=r.jsx(Ie,{}),e[5]=d):d=e[5];let x;e[6]!==o?(x=r.jsxs(r.Fragment,{children:[o,d]}),e[6]=o,e[7]=x):x=e[7];let b;e[8]!==l||e[9]!==c||e[10]!==s||e[11]!==a?(b=r.jsx(V,{thread:s,connections:l,virtualMcps:a,nav:c}),e[8]=l,e[9]=c,e[10]=s,e[11]=a,e[12]=b):b=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx($e,{}),e[13]=v):v=e[13];let p;e[14]!==b?(p=r.jsxs(r.Fragment,{children:[b,v]}),e[14]=b,e[15]=p):p=e[15];let f;e[16]!==n||e[17]!==l||e[18]!==i||e[19]!==u||e[20]!==h||e[21]!==c||e[22]!==s||e[23]!==a?(f=r.jsx(_e,{client:n,locator:i,thread:s,connections:l,virtualMcps:a,members:u,nav:c,meta:h}),e[16]=n,e[17]=l,e[18]=i,e[19]=u,e[20]=h,e[21]=c,e[22]=s,e[23]=a,e[24]=f):f=e[24];let g;e[25]!==p||e[26]!==f?(g=r.jsx(G.Suspense,{fallback:p,children:f}),e[25]=p,e[26]=f,e[27]=g):g=e[27];let j;return e[28]!==x||e[29]!==g?(j=r.jsx(me,{children:r.jsx(ee,{fallback:x,children:g})}),e[28]=x,e[29]=g,e[30]=j):j=e[30],j}export{Ye as T,Oe as a,Ue as b,be as c,We as d,Qe as e,He as f,qe as g,Ge as h,je as i,Z as j,X as k,J as r};
@@ -1 +1 @@
1
- import{r as x,aM as h,j as c,aJ as m,aP as k,aI as p,eD as M,eE as T,aO as S,eF as A,aL as F,ax as D,c as P,l as C}from"./index-B3yBTWEk.js";var j="Toggle",_=x.forwardRef((a,e)=>{const{pressed:l,defaultPressed:s,onPressedChange:n,...r}=a,[t,o]=h({prop:l,onChange:n,defaultProp:s??!1,caller:j});return c.jsx(m.button,{type:"button","aria-pressed":t,"data-state":t?"on":"off","data-disabled":a.disabled?"":void 0,...r,ref:e,onClick:k(a.onClick,()=>{a.disabled||o(!t)})})});_.displayName=j;var v="ToggleGroup",[I]=F(v,[T]),w=T(),G=p.forwardRef((a,e)=>{const{type:l,...s}=a;if(l==="single"){const n=s;return c.jsx($,{...n,ref:e})}if(l==="multiple"){const n=s;return c.jsx(O,{...n,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${v}\``)});G.displayName=v;var[z,y]=I(v),$=p.forwardRef((a,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...r}=a,[t,o]=h({prop:l,defaultProp:s??"",onChange:n,caller:v});return c.jsx(z,{scope:a.__scopeToggleGroup,type:"single",value:p.useMemo(()=>t?[t]:[],[t]),onItemActivate:o,onItemDeactivate:p.useCallback(()=>o(""),[o]),children:c.jsx(R,{...r,ref:e})})}),O=p.forwardRef((a,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...r}=a,[t,o]=h({prop:l,defaultProp:s??[],onChange:n,caller:v}),i=p.useCallback(u=>o((g=[])=>[...g,u]),[o]),d=p.useCallback(u=>o((g=[])=>g.filter(V=>V!==u)),[o]);return c.jsx(z,{scope:a.__scopeToggleGroup,type:"multiple",value:t,onItemActivate:i,onItemDeactivate:d,children:c.jsx(R,{...r,ref:e})})});G.displayName=v;var[B,L]=I(v),R=p.forwardRef((a,e)=>{const{__scopeToggleGroup:l,disabled:s=!1,rovingFocus:n=!0,orientation:r,dir:t,loop:o=!0,...i}=a,d=w(l),u=S(t),g={role:"group",dir:u,...i};return c.jsx(B,{scope:l,rovingFocus:n,disabled:s,children:n?c.jsx(A,{asChild:!0,...d,orientation:r,dir:u,loop:o,children:c.jsx(m.div,{...g,ref:e})}):c.jsx(m.div,{...g,ref:e})})}),f="ToggleGroupItem",E=p.forwardRef((a,e)=>{const l=y(f,a.__scopeToggleGroup),s=L(f,a.__scopeToggleGroup),n=w(a.__scopeToggleGroup),r=l.value.includes(a.value),t=s.disabled||a.disabled,o={...a,pressed:r,disabled:t},i=p.useRef(null);return s.rovingFocus?c.jsx(M,{asChild:!0,...n,focusable:!t,active:r,ref:i,children:c.jsx(b,{...o,ref:e})}):c.jsx(b,{...o,ref:e})});E.displayName=f;var b=p.forwardRef((a,e)=>{const{__scopeToggleGroup:l,value:s,...n}=a,r=y(f,l),t={role:"radio","aria-checked":a.pressed,"aria-pressed":void 0},o=r.type==="single"?t:void 0;return c.jsx(_,{...o,...n,ref:e,onPressedChange:i=>{i?r.onItemActivate(s):r.onItemDeactivate(s)}})}),H=G,J=E;const U=D("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),N=x.createContext({size:"default",variant:"default"});function K(a){const e=P.c(20);let l,s,n,r,t;e[0]!==a?({className:s,variant:t,size:r,children:l,...n}=a,e[0]=a,e[1]=l,e[2]=s,e[3]=n,e[4]=r,e[5]=t):(l=e[1],s=e[2],n=e[3],r=e[4],t=e[5]);let o;e[6]!==s?(o=C("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",s),e[6]=s,e[7]=o):o=e[7];let i;e[8]!==r||e[9]!==t?(i={variant:t,size:r},e[8]=r,e[9]=t,e[10]=i):i=e[10];let d;e[11]!==l||e[12]!==i?(d=c.jsx(N.Provider,{value:i,children:l}),e[11]=l,e[12]=i,e[13]=d):d=e[13];let u;return e[14]!==n||e[15]!==r||e[16]!==o||e[17]!==d||e[18]!==t?(u=c.jsx(H,{"data-slot":"toggle-group","data-variant":t,"data-size":r,className:o,...n,children:d}),e[14]=n,e[15]=r,e[16]=o,e[17]=d,e[18]=t,e[19]=u):u=e[19],u}function Q(a){const e=P.c(18);let l,s,n,r,t;e[0]!==a?({className:s,children:l,variant:t,size:r,...n}=a,e[0]=a,e[1]=l,e[2]=s,e[3]=n,e[4]=r,e[5]=t):(l=e[1],s=e[2],n=e[3],r=e[4],t=e[5]);const o=x.useContext(N),i=o.variant||t,d=o.size||r;let u;e[6]!==s||e[7]!==o.size||e[8]!==o.variant||e[9]!==r||e[10]!==t?(u=C(U({variant:o.variant||t,size:o.size||r}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",s),e[6]=s,e[7]=o.size,e[8]=o.variant,e[9]=r,e[10]=t,e[11]=u):u=e[11];let g;return e[12]!==l||e[13]!==n||e[14]!==i||e[15]!==d||e[16]!==u?(g=c.jsx(J,{"data-slot":"toggle-group-item","data-variant":i,"data-size":d,className:u,...n,children:l}),e[12]=l,e[13]=n,e[14]=i,e[15]=d,e[16]=u,e[17]=g):g=e[17],g}export{K as T,Q as a};
1
+ import{r as x,aM as h,j as c,aJ as m,aP as k,aI as p,eD as M,eE as T,aO as S,eF as A,aL as F,ax as D,c as P,l as C}from"./index-BodvdIMk.js";var j="Toggle",_=x.forwardRef((a,e)=>{const{pressed:l,defaultPressed:s,onPressedChange:n,...r}=a,[t,o]=h({prop:l,onChange:n,defaultProp:s??!1,caller:j});return c.jsx(m.button,{type:"button","aria-pressed":t,"data-state":t?"on":"off","data-disabled":a.disabled?"":void 0,...r,ref:e,onClick:k(a.onClick,()=>{a.disabled||o(!t)})})});_.displayName=j;var v="ToggleGroup",[I]=F(v,[T]),w=T(),G=p.forwardRef((a,e)=>{const{type:l,...s}=a;if(l==="single"){const n=s;return c.jsx($,{...n,ref:e})}if(l==="multiple"){const n=s;return c.jsx(O,{...n,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${v}\``)});G.displayName=v;var[z,y]=I(v),$=p.forwardRef((a,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...r}=a,[t,o]=h({prop:l,defaultProp:s??"",onChange:n,caller:v});return c.jsx(z,{scope:a.__scopeToggleGroup,type:"single",value:p.useMemo(()=>t?[t]:[],[t]),onItemActivate:o,onItemDeactivate:p.useCallback(()=>o(""),[o]),children:c.jsx(R,{...r,ref:e})})}),O=p.forwardRef((a,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...r}=a,[t,o]=h({prop:l,defaultProp:s??[],onChange:n,caller:v}),i=p.useCallback(u=>o((g=[])=>[...g,u]),[o]),d=p.useCallback(u=>o((g=[])=>g.filter(V=>V!==u)),[o]);return c.jsx(z,{scope:a.__scopeToggleGroup,type:"multiple",value:t,onItemActivate:i,onItemDeactivate:d,children:c.jsx(R,{...r,ref:e})})});G.displayName=v;var[B,L]=I(v),R=p.forwardRef((a,e)=>{const{__scopeToggleGroup:l,disabled:s=!1,rovingFocus:n=!0,orientation:r,dir:t,loop:o=!0,...i}=a,d=w(l),u=S(t),g={role:"group",dir:u,...i};return c.jsx(B,{scope:l,rovingFocus:n,disabled:s,children:n?c.jsx(A,{asChild:!0,...d,orientation:r,dir:u,loop:o,children:c.jsx(m.div,{...g,ref:e})}):c.jsx(m.div,{...g,ref:e})})}),f="ToggleGroupItem",E=p.forwardRef((a,e)=>{const l=y(f,a.__scopeToggleGroup),s=L(f,a.__scopeToggleGroup),n=w(a.__scopeToggleGroup),r=l.value.includes(a.value),t=s.disabled||a.disabled,o={...a,pressed:r,disabled:t},i=p.useRef(null);return s.rovingFocus?c.jsx(M,{asChild:!0,...n,focusable:!t,active:r,ref:i,children:c.jsx(b,{...o,ref:e})}):c.jsx(b,{...o,ref:e})});E.displayName=f;var b=p.forwardRef((a,e)=>{const{__scopeToggleGroup:l,value:s,...n}=a,r=y(f,l),t={role:"radio","aria-checked":a.pressed,"aria-pressed":void 0},o=r.type==="single"?t:void 0;return c.jsx(_,{...o,...n,ref:e,onPressedChange:i=>{i?r.onItemActivate(s):r.onItemDeactivate(s)}})}),H=G,J=E;const U=D("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),N=x.createContext({size:"default",variant:"default"});function K(a){const e=P.c(20);let l,s,n,r,t;e[0]!==a?({className:s,variant:t,size:r,children:l,...n}=a,e[0]=a,e[1]=l,e[2]=s,e[3]=n,e[4]=r,e[5]=t):(l=e[1],s=e[2],n=e[3],r=e[4],t=e[5]);let o;e[6]!==s?(o=C("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",s),e[6]=s,e[7]=o):o=e[7];let i;e[8]!==r||e[9]!==t?(i={variant:t,size:r},e[8]=r,e[9]=t,e[10]=i):i=e[10];let d;e[11]!==l||e[12]!==i?(d=c.jsx(N.Provider,{value:i,children:l}),e[11]=l,e[12]=i,e[13]=d):d=e[13];let u;return e[14]!==n||e[15]!==r||e[16]!==o||e[17]!==d||e[18]!==t?(u=c.jsx(H,{"data-slot":"toggle-group","data-variant":t,"data-size":r,className:o,...n,children:d}),e[14]=n,e[15]=r,e[16]=o,e[17]=d,e[18]=t,e[19]=u):u=e[19],u}function Q(a){const e=P.c(18);let l,s,n,r,t;e[0]!==a?({className:s,children:l,variant:t,size:r,...n}=a,e[0]=a,e[1]=l,e[2]=s,e[3]=n,e[4]=r,e[5]=t):(l=e[1],s=e[2],n=e[3],r=e[4],t=e[5]);const o=x.useContext(N),i=o.variant||t,d=o.size||r;let u;e[6]!==s||e[7]!==o.size||e[8]!==o.variant||e[9]!==r||e[10]!==t?(u=C(U({variant:o.variant||t,size:o.size||r}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",s),e[6]=s,e[7]=o.size,e[8]=o.variant,e[9]=r,e[10]=t,e[11]=u):u=e[11];let g;return e[12]!==l||e[13]!==n||e[14]!==i||e[15]!==d||e[16]!==u?(g=c.jsx(J,{"data-slot":"toggle-group-item","data-variant":i,"data-size":d,className:u,...n,children:l}),e[12]=l,e[13]=n,e[14]=i,e[15]=d,e[16]=u,e[17]=g):g=e[17],g}export{K as T,Q as a};
@@ -1 +1 @@
1
- import"./index-B3yBTWEk.js";function i(t){let r=2166136261;for(let e=0;e<t.length;e++)r=Math.imul(r^t.charCodeAt(e),16777619);return`a${(r>>>0).toString(36).padStart(6,"0").slice(-6)}`}function l(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function n(t,r){if(!r)return t;const e=`${i(r)}_`;return t.startsWith(e)?t.slice(e.length):t}function s(t,r){return n(t,r).replace(/[_-]/g," ").toLowerCase()}const o=/^mcp__[a-zA-Z0-9_-]+__/;function c(t){return t.replace(o,"")}export{c as a,s as d,l as g,n as s};
1
+ import"./index-BodvdIMk.js";function i(t){let r=2166136261;for(let e=0;e<t.length;e++)r=Math.imul(r^t.charCodeAt(e),16777619);return`a${(r>>>0).toString(36).padStart(6,"0").slice(-6)}`}function l(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function n(t,r){if(!r)return t;const e=`${i(r)}_`;return t.startsWith(e)?t.slice(e.length):t}function s(t,r){return n(t,r).replace(/[_-]/g," ").toLowerCase()}const o=/^mcp__[a-zA-Z0-9_-]+__/;function c(t){return t.replace(o,"")}export{c as a,s as d,l as g,n as s};
@@ -1 +1 @@
1
- import{c,r as u,j as r,l as T,ar as p}from"./index-B3yBTWEk.js";const g=u.createContext(null);function m(){const l=u.use(g);if(!l)throw new Error("Toolbar.* must be used inside <Toolbar>");return l}function h(l){const e=c.c(8),{children:t}=l,[s,n]=u.useState(null),[o,a]=u.useState(null),[x,E]=u.useState(null),[b,j]=u.useState(null);let f;e[0]!==x||e[1]!==b||e[2]!==o||e[3]!==s?(f={togglesEl:s,setTogglesEl:n,tabsEl:o,setTabsEl:a,centerEl:x,setCenterEl:E,rightEl:b,setRightEl:j},e[0]=x,e[1]=b,e[2]=o,e[3]=s,e[4]=f):f=e[4];let d;return e[5]!==t||e[6]!==f?(d=r.jsx(g,{value:f,children:t}),e[5]=t,e[6]=f,e[7]=d):d=e[7],d}function i(l){const e=c.c(2),{children:t}=l;let s;return e[0]!==t?(s=r.jsx(h,{children:r.jsx("div",{className:"flex flex-col h-full min-h-0",children:t})}),e[0]=t,e[1]=s):s=e[1],s}function v(l){const e=c.c(10);let t,s,n;e[0]!==l?({children:t,className:s,...n}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=n):(t=e[1],s=e[2],n=e[3]);let o;e[4]!==s?(o=T("relative z-10 shrink-0 grid grid-cols-3 items-center pl-1 pr-2 h-12 bg-sidebar",s),e[4]=s,e[5]=o):o=e[5];let a;return e[6]!==t||e[7]!==n||e[8]!==o?(a=r.jsx("div",{className:o,...n,children:t}),e[6]=t,e[7]=n,e[8]=o,e[9]=a):a=e[9],a}function S(l){const e=c.c(2),{children:t}=l;let s;return e[0]!==t?(s=r.jsx("div",{className:"flex items-center gap-0.5 min-w-0 justify-self-start",children:t}),e[0]=t,e[1]=s):s=e[1],s}function C(l){const e=c.c(2),{children:t}=l;let s;return e[0]!==t?(s=r.jsx("div",{className:"flex items-center justify-end gap-0.5 min-w-0 justify-self-end",children:t}),e[0]=t,e[1]=s):s=e[1],s}function N(){const l=c.c(2),{setCenterEl:e}=m();let t;return l[0]!==e?(t=r.jsx("div",{ref:e,className:"min-w-0 flex items-center justify-center gap-2"}),l[0]=e,l[1]=t):t=l[1],t}function $(l){const e=c.c(5),{className:t}=l,{setTabsEl:s}=m();let n;e[0]!==t?(n=T("shrink-0 flex items-center",t),e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=r.jsx("div",{ref:s,className:n}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}function R(l){const e=c.c(3),{children:t}=l,{tabsEl:s}=m();if(!s)return null;let n;return e[0]!==t||e[1]!==s?(n=p.createPortal(t,s),e[0]=t,e[1]=s,e[2]=n):n=e[2],n}function w(l){const e=c.c(5),{className:t}=l,{setTogglesEl:s}=m();let n;e[0]!==t?(n=T("contents",t),e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=r.jsx("div",{ref:s,className:n}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}function y(){const l=c.c(2),{setRightEl:e}=m();let t;return l[0]!==e?(t=r.jsx("div",{ref:e,className:"flex items-center justify-end gap-0.5 shrink-0"}),l[0]=e,l[1]=t):t=l[1],t}i.Provider=h;i.Header=v;i.LeftColumn=S;i.RightColumn=C;i.CenterSlot=N;i.TabsSlot=$;i.Tabs=R;i.TogglesSlot=w;i.RightSlot=y;export{i as T};
1
+ import{c,r as u,j as r,l as T,ar as p}from"./index-BodvdIMk.js";const g=u.createContext(null);function m(){const l=u.use(g);if(!l)throw new Error("Toolbar.* must be used inside <Toolbar>");return l}function h(l){const e=c.c(8),{children:t}=l,[s,n]=u.useState(null),[o,a]=u.useState(null),[x,E]=u.useState(null),[b,j]=u.useState(null);let f;e[0]!==x||e[1]!==b||e[2]!==o||e[3]!==s?(f={togglesEl:s,setTogglesEl:n,tabsEl:o,setTabsEl:a,centerEl:x,setCenterEl:E,rightEl:b,setRightEl:j},e[0]=x,e[1]=b,e[2]=o,e[3]=s,e[4]=f):f=e[4];let d;return e[5]!==t||e[6]!==f?(d=r.jsx(g,{value:f,children:t}),e[5]=t,e[6]=f,e[7]=d):d=e[7],d}function i(l){const e=c.c(2),{children:t}=l;let s;return e[0]!==t?(s=r.jsx(h,{children:r.jsx("div",{className:"flex flex-col h-full min-h-0",children:t})}),e[0]=t,e[1]=s):s=e[1],s}function v(l){const e=c.c(10);let t,s,n;e[0]!==l?({children:t,className:s,...n}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=n):(t=e[1],s=e[2],n=e[3]);let o;e[4]!==s?(o=T("relative z-10 shrink-0 grid grid-cols-3 items-center pl-1 pr-2 h-12 bg-sidebar",s),e[4]=s,e[5]=o):o=e[5];let a;return e[6]!==t||e[7]!==n||e[8]!==o?(a=r.jsx("div",{className:o,...n,children:t}),e[6]=t,e[7]=n,e[8]=o,e[9]=a):a=e[9],a}function S(l){const e=c.c(2),{children:t}=l;let s;return e[0]!==t?(s=r.jsx("div",{className:"flex items-center gap-0.5 min-w-0 justify-self-start",children:t}),e[0]=t,e[1]=s):s=e[1],s}function C(l){const e=c.c(2),{children:t}=l;let s;return e[0]!==t?(s=r.jsx("div",{className:"flex items-center justify-end gap-0.5 min-w-0 justify-self-end",children:t}),e[0]=t,e[1]=s):s=e[1],s}function N(){const l=c.c(2),{setCenterEl:e}=m();let t;return l[0]!==e?(t=r.jsx("div",{ref:e,className:"min-w-0 flex items-center justify-center gap-2"}),l[0]=e,l[1]=t):t=l[1],t}function $(l){const e=c.c(5),{className:t}=l,{setTabsEl:s}=m();let n;e[0]!==t?(n=T("shrink-0 flex items-center",t),e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=r.jsx("div",{ref:s,className:n}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}function R(l){const e=c.c(3),{children:t}=l,{tabsEl:s}=m();if(!s)return null;let n;return e[0]!==t||e[1]!==s?(n=p.createPortal(t,s),e[0]=t,e[1]=s,e[2]=n):n=e[2],n}function w(l){const e=c.c(5),{className:t}=l,{setTogglesEl:s}=m();let n;e[0]!==t?(n=T("contents",t),e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=r.jsx("div",{ref:s,className:n}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}function y(){const l=c.c(2),{setRightEl:e}=m();let t;return l[0]!==e?(t=r.jsx("div",{ref:e,className:"flex items-center justify-end gap-0.5 shrink-0"}),l[0]=e,l[1]=t):t=l[1],t}i.Provider=h;i.Header=v;i.LeftColumn=S;i.RightColumn=C;i.CenterSlot=N;i.TabsSlot=$;i.Tabs=R;i.TogglesSlot=w;i.RightSlot=y;export{i as T};
@@ -1 +1 @@
1
- import{c as f,l as u,j as b}from"./index-B3yBTWEk.js";const d="focus-visible:not-forced-colors:outline-none focus-visible:forced-colors:outline-2 focus-visible:forced-colors:outline-offset-0 focus-visible:ring-0 focus-visible:border-border focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50";function m(n){return u("[transition:background-color_180ms_ease,color_180ms_ease]",d,n?"bg-sidebar-accent text-sidebar-foreground":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground")}function g(n){const e=f.c(14);let o,s,t,r,c;e[0]!==n?({active:o,className:s,ref:r,type:c,...t}=n,e[0]=n,e[1]=o,e[2]=s,e[3]=t,e[4]=r,e[5]=c):(o=e[1],s=e[2],t=e[3],r=e[4],c=e[5]);const a=c===void 0?"button":c;let i;e[6]!==o||e[7]!==s?(i=u("relative flex size-10 md:size-7 shrink-0 items-center justify-center rounded-md","max-md:[&_svg]:size-5",m(o),s),e[6]=o,e[7]=s,e[8]=i):i=e[8];let l;return e[9]!==t||e[10]!==r||e[11]!==i||e[12]!==a?(l=b.jsx("button",{ref:r,type:a,className:i,...t}),e[9]=t,e[10]=r,e[11]=i,e[12]=a,e[13]=l):l=e[13],l}export{d as I,g as T,m as p};
1
+ import{c as f,l as u,j as b}from"./index-BodvdIMk.js";const d="focus-visible:not-forced-colors:outline-none focus-visible:forced-colors:outline-2 focus-visible:forced-colors:outline-offset-0 focus-visible:ring-0 focus-visible:border-border focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50";function m(n){return u("[transition:background-color_180ms_ease,color_180ms_ease]",d,n?"bg-sidebar-accent text-sidebar-foreground":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground")}function g(n){const e=f.c(14);let o,s,t,r,c;e[0]!==n?({active:o,className:s,ref:r,type:c,...t}=n,e[0]=n,e[1]=o,e[2]=s,e[3]=t,e[4]=r,e[5]=c):(o=e[1],s=e[2],t=e[3],r=e[4],c=e[5]);const a=c===void 0?"button":c;let i;e[6]!==o||e[7]!==s?(i=u("relative flex size-10 md:size-7 shrink-0 items-center justify-center rounded-md","max-md:[&_svg]:size-5",m(o),s),e[6]=o,e[7]=s,e[8]=i):i=e[8];let l;return e[9]!==t||e[10]!==r||e[11]!==i||e[12]!==a?(l=b.jsx("button",{ref:r,type:a,className:i,...t}),e[9]=t,e[10]=r,e[11]=i,e[12]=a,e[13]=l):l=e[13],l}export{d as I,g as T,m as p};
@@ -1 +1 @@
1
- import{q as _,T as l}from"./index-B3yBTWEk.js";let s=!1;const p="report:auth-attempt:",f=3600*1e3;function h(e){const t=new URLSearchParams(e),n=t.get("share_id")||void 0,o=t.get("email_run_id")||void 0,r=t.get("utm_source")||void 0,u=t.get("utm_medium")||void 0,a=t.get("utm_campaign")||void 0;return{entrypoint:n||r==="share"?"share":o||t.has("d")||r==="email"?"email":r?"campaign":"direct",...n?{share_id:n}:{},...o?{email_run_id:o}:{},...r?{utm_source:r}:{},...u?{utm_medium:u}:{},...a?{utm_campaign:a}:{}}}function c(){return h(typeof window>"u"?"":window.location.search)}function i(e){return`${p}${e}`}function g(){try{return globalThis.crypto.randomUUID()}catch{return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}}function d(e){try{const t=window.sessionStorage.getItem(i(e));if(!t)return null;const n=JSON.parse(t);return n.domain!==e||typeof n.attempt_id!="string"||typeof n.gate_shown_at!="number"||Date.now()-n.gate_shown_at>f?(window.sessionStorage.removeItem(i(e)),null):n}catch{return null}}function m(e){try{window.sessionStorage.setItem(i(e.domain),JSON.stringify(e))}catch{}}function w(e){const t=d(e);if(t)return t;const n={attempt_id:g(),domain:e,gate_shown_at:Date.now(),...c()};return m(n),n}function y(e,t){const n={...w(e),...t};return m(n),n}function T(e){return{auth_attempt_id:e.attempt_id,entrypoint:e.entrypoint,...e.share_id?{share_id:e.share_id}:{},...e.email_run_id?{email_run_id:e.email_run_id}:{},...e.utm_source?{utm_source:e.utm_source}:{},...e.utm_medium?{utm_medium:e.utm_medium}:{},...e.utm_campaign?{utm_campaign:e.utm_campaign}:{}}}function R(e){const t=d(e);if(!t)return null;try{window.sessionStorage.removeItem(i(e))}catch{}return t}function S(e){const t=e.toLowerCase();return t==="invalid_email"?"invalid_email":t.includes("429")||t.includes("rate limit")?"rate_limited":t.includes("otp")||t.includes("verification code")||t.includes("invalid code")||t.includes("expired code")||t.includes("código")||t.includes("codigo")?"invalid_or_expired_code":t.includes("401")||t.includes("unauthorized")?"invalid_credentials":t.includes("409")||t.includes("already exists")?"account_exists":t.includes("network")||t.includes("fetch")?"network":t.includes("cancel")||t.includes("closed")?"cancelled":"unknown"}function I(e){s=e}function M(e,t,n){if(_())try{l.capture(e,{...c(),...t,...s?{report_preview:"reviewer"}:{}},n)}catch{}}export{S as a,w as b,M as c,T as d,R as e,h as r,I as s,y as u};
1
+ import{q as _,T as l}from"./index-BodvdIMk.js";let s=!1;const p="report:auth-attempt:",f=3600*1e3;function h(e){const t=new URLSearchParams(e),n=t.get("share_id")||void 0,o=t.get("email_run_id")||void 0,r=t.get("utm_source")||void 0,u=t.get("utm_medium")||void 0,a=t.get("utm_campaign")||void 0;return{entrypoint:n||r==="share"?"share":o||t.has("d")||r==="email"?"email":r?"campaign":"direct",...n?{share_id:n}:{},...o?{email_run_id:o}:{},...r?{utm_source:r}:{},...u?{utm_medium:u}:{},...a?{utm_campaign:a}:{}}}function c(){return h(typeof window>"u"?"":window.location.search)}function i(e){return`${p}${e}`}function g(){try{return globalThis.crypto.randomUUID()}catch{return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}}function d(e){try{const t=window.sessionStorage.getItem(i(e));if(!t)return null;const n=JSON.parse(t);return n.domain!==e||typeof n.attempt_id!="string"||typeof n.gate_shown_at!="number"||Date.now()-n.gate_shown_at>f?(window.sessionStorage.removeItem(i(e)),null):n}catch{return null}}function m(e){try{window.sessionStorage.setItem(i(e.domain),JSON.stringify(e))}catch{}}function w(e){const t=d(e);if(t)return t;const n={attempt_id:g(),domain:e,gate_shown_at:Date.now(),...c()};return m(n),n}function y(e,t){const n={...w(e),...t};return m(n),n}function T(e){return{auth_attempt_id:e.attempt_id,entrypoint:e.entrypoint,...e.share_id?{share_id:e.share_id}:{},...e.email_run_id?{email_run_id:e.email_run_id}:{},...e.utm_source?{utm_source:e.utm_source}:{},...e.utm_medium?{utm_medium:e.utm_medium}:{},...e.utm_campaign?{utm_campaign:e.utm_campaign}:{}}}function R(e){const t=d(e);if(!t)return null;try{window.sessionStorage.removeItem(i(e))}catch{}return t}function S(e){const t=e.toLowerCase();return t==="invalid_email"?"invalid_email":t.includes("429")||t.includes("rate limit")?"rate_limited":t.includes("otp")||t.includes("verification code")||t.includes("invalid code")||t.includes("expired code")||t.includes("código")||t.includes("codigo")?"invalid_or_expired_code":t.includes("401")||t.includes("unauthorized")?"invalid_credentials":t.includes("409")||t.includes("already exists")?"account_exists":t.includes("network")||t.includes("fetch")?"network":t.includes("cancel")||t.includes("closed")?"cancelled":"unknown"}function I(e){s=e}function M(e,t,n){if(_())try{l.capture(e,{...c(),...t,...s?{report_preview:"reviewer"}:{}},n)}catch{}}export{S as a,w as b,M as c,T as d,R as e,h as r,I as s,y as u};
@@ -1,4 +1,4 @@
1
- import{d5 as l,da as e,b1 as h,am as r,eG as b,ak as t,b2 as p,a_ as d,al as c,c6 as m,eH as v,eI as I,eJ as E,eK as w,cJ as x,e1 as T,eL as z,eM as C,eN as D,co as O,eO as B,c_ as V,eP as W,eQ as $,eR as K,eS as F,cW as J,cK as Z,cT as j,cU as Q,cV as Y,cM as G,cS as X,cL as ee,d2 as te}from"./index-B3yBTWEk.js";import{P as oe}from"./use-mcp-client-DsJzBus3.js";(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(o,s)=>(typeof require<"u"?require:o)[s]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});class se extends oe{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(o,s){}_ensureEventSlot(o){let s=this._eventSlots.get(o);if(!s){let i=this.eventSchemas[o];if(!i)throw Error(`Unknown event: ${String(o)}`);s={listeners:[]},this._eventSlots.set(o,s);let a=i.shape.method.value;this._registeredMethods.add(a);let u=s;super.setNotificationHandler(i,g=>{let R=g.params;this.onEventDispatch(o,R),u.onHandler?.(R);for(let A of[...u.listeners])A(R)})}return s}setEventHandler(o,s){let i=this._ensureEventSlot(o);i.onHandler&&s&&console.warn(`[MCP Apps] on${String(o)} handler replaced. Use addEventListener("${String(o)}", …) to add multiple listeners without replacing.`),i.onHandler=s}getEventHandler(o){return this._eventSlots.get(o)?.onHandler}addEventListener(o,s){this._ensureEventSlot(o).listeners.push(s)}removeEventListener(o,s){let i=this._eventSlots.get(o);if(!i)return;let a=i.listeners.indexOf(s);a!==-1&&i.listeners.splice(a,1)}setRequestHandler=(o,s)=>{this._assertMethodNotRegistered(o,"setRequestHandler"),super.setRequestHandler(o,s)};setNotificationHandler=(o,s)=>{this._assertMethodNotRegistered(o,"setNotificationHandler"),super.setNotificationHandler(o,s)};warnIfRequestHandlerReplaced(o,s,i){s&&i&&console.warn(`[MCP Apps] ${o} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(o,s)=>{let i=o.shape.method.value;this._registeredMethods.add(i),super.setRequestHandler(o,s)};_assertMethodNotRegistered(o,s){let i=o.shape.method.value;if(this._registeredMethods.has(i))throw Error(`Handler for "${i}" already registered (via ${s}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(i)}}var L="2026-01-26",ie="ui/notifications/tool-input-partial",re=l([e("light"),e("dark")]).describe("Color theme preference for the host environment."),f=l([e("inline"),e("fullscreen"),e("pip")]).describe("Display mode for UI presentation."),ae=l([e("--color-background-primary"),e("--color-background-secondary"),e("--color-background-tertiary"),e("--color-background-inverse"),e("--color-background-ghost"),e("--color-background-info"),e("--color-background-danger"),e("--color-background-success"),e("--color-background-warning"),e("--color-background-disabled"),e("--color-text-primary"),e("--color-text-secondary"),e("--color-text-tertiary"),e("--color-text-inverse"),e("--color-text-ghost"),e("--color-text-info"),e("--color-text-danger"),e("--color-text-success"),e("--color-text-warning"),e("--color-text-disabled"),e("--color-border-primary"),e("--color-border-secondary"),e("--color-border-tertiary"),e("--color-border-inverse"),e("--color-border-ghost"),e("--color-border-info"),e("--color-border-danger"),e("--color-border-success"),e("--color-border-warning"),e("--color-border-disabled"),e("--color-ring-primary"),e("--color-ring-secondary"),e("--color-ring-inverse"),e("--color-ring-info"),e("--color-ring-danger"),e("--color-ring-success"),e("--color-ring-warning"),e("--font-sans"),e("--font-mono"),e("--font-weight-normal"),e("--font-weight-medium"),e("--font-weight-semibold"),e("--font-weight-bold"),e("--font-text-xs-size"),e("--font-text-sm-size"),e("--font-text-md-size"),e("--font-text-lg-size"),e("--font-heading-xs-size"),e("--font-heading-sm-size"),e("--font-heading-md-size"),e("--font-heading-lg-size"),e("--font-heading-xl-size"),e("--font-heading-2xl-size"),e("--font-heading-3xl-size"),e("--font-text-xs-line-height"),e("--font-text-sm-line-height"),e("--font-text-md-line-height"),e("--font-text-lg-line-height"),e("--font-heading-xs-line-height"),e("--font-heading-sm-line-height"),e("--font-heading-md-line-height"),e("--font-heading-lg-line-height"),e("--font-heading-xl-line-height"),e("--font-heading-2xl-line-height"),e("--font-heading-3xl-line-height"),e("--border-radius-xs"),e("--border-radius-sm"),e("--border-radius-md"),e("--border-radius-lg"),e("--border-radius-xl"),e("--border-radius-full"),e("--border-width-regular"),e("--shadow-hairline"),e("--shadow-sm"),e("--shadow-md"),e("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),ne=h(ae.describe(`Style variables for theming MCP apps.
1
+ import{d5 as l,da as e,b1 as h,am as r,eG as b,ak as t,b2 as p,a_ as d,al as c,c6 as m,eH as v,eI as I,eJ as E,eK as w,cJ as x,e1 as T,eL as z,eM as C,eN as D,co as O,eO as B,c_ as V,eP as W,eQ as $,eR as K,eS as F,cW as J,cK as Z,cT as j,cU as Q,cV as Y,cM as G,cS as X,cL as ee,d2 as te}from"./index-BodvdIMk.js";import{P as oe}from"./use-mcp-client-DO1cH-Rq.js";(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(o,s)=>(typeof require<"u"?require:o)[s]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});class se extends oe{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(o,s){}_ensureEventSlot(o){let s=this._eventSlots.get(o);if(!s){let i=this.eventSchemas[o];if(!i)throw Error(`Unknown event: ${String(o)}`);s={listeners:[]},this._eventSlots.set(o,s);let a=i.shape.method.value;this._registeredMethods.add(a);let u=s;super.setNotificationHandler(i,g=>{let R=g.params;this.onEventDispatch(o,R),u.onHandler?.(R);for(let A of[...u.listeners])A(R)})}return s}setEventHandler(o,s){let i=this._ensureEventSlot(o);i.onHandler&&s&&console.warn(`[MCP Apps] on${String(o)} handler replaced. Use addEventListener("${String(o)}", …) to add multiple listeners without replacing.`),i.onHandler=s}getEventHandler(o){return this._eventSlots.get(o)?.onHandler}addEventListener(o,s){this._ensureEventSlot(o).listeners.push(s)}removeEventListener(o,s){let i=this._eventSlots.get(o);if(!i)return;let a=i.listeners.indexOf(s);a!==-1&&i.listeners.splice(a,1)}setRequestHandler=(o,s)=>{this._assertMethodNotRegistered(o,"setRequestHandler"),super.setRequestHandler(o,s)};setNotificationHandler=(o,s)=>{this._assertMethodNotRegistered(o,"setNotificationHandler"),super.setNotificationHandler(o,s)};warnIfRequestHandlerReplaced(o,s,i){s&&i&&console.warn(`[MCP Apps] ${o} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(o,s)=>{let i=o.shape.method.value;this._registeredMethods.add(i),super.setRequestHandler(o,s)};_assertMethodNotRegistered(o,s){let i=o.shape.method.value;if(this._registeredMethods.has(i))throw Error(`Handler for "${i}" already registered (via ${s}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(i)}}var L="2026-01-26",ie="ui/notifications/tool-input-partial",re=l([e("light"),e("dark")]).describe("Color theme preference for the host environment."),f=l([e("inline"),e("fullscreen"),e("pip")]).describe("Display mode for UI presentation."),ae=l([e("--color-background-primary"),e("--color-background-secondary"),e("--color-background-tertiary"),e("--color-background-inverse"),e("--color-background-ghost"),e("--color-background-info"),e("--color-background-danger"),e("--color-background-success"),e("--color-background-warning"),e("--color-background-disabled"),e("--color-text-primary"),e("--color-text-secondary"),e("--color-text-tertiary"),e("--color-text-inverse"),e("--color-text-ghost"),e("--color-text-info"),e("--color-text-danger"),e("--color-text-success"),e("--color-text-warning"),e("--color-text-disabled"),e("--color-border-primary"),e("--color-border-secondary"),e("--color-border-tertiary"),e("--color-border-inverse"),e("--color-border-ghost"),e("--color-border-info"),e("--color-border-danger"),e("--color-border-success"),e("--color-border-warning"),e("--color-border-disabled"),e("--color-ring-primary"),e("--color-ring-secondary"),e("--color-ring-inverse"),e("--color-ring-info"),e("--color-ring-danger"),e("--color-ring-success"),e("--color-ring-warning"),e("--font-sans"),e("--font-mono"),e("--font-weight-normal"),e("--font-weight-medium"),e("--font-weight-semibold"),e("--font-weight-bold"),e("--font-text-xs-size"),e("--font-text-sm-size"),e("--font-text-md-size"),e("--font-text-lg-size"),e("--font-heading-xs-size"),e("--font-heading-sm-size"),e("--font-heading-md-size"),e("--font-heading-lg-size"),e("--font-heading-xl-size"),e("--font-heading-2xl-size"),e("--font-heading-3xl-size"),e("--font-text-xs-line-height"),e("--font-text-sm-line-height"),e("--font-text-md-line-height"),e("--font-text-lg-line-height"),e("--font-heading-xs-line-height"),e("--font-heading-sm-line-height"),e("--font-heading-md-line-height"),e("--font-heading-lg-line-height"),e("--font-heading-xl-line-height"),e("--font-heading-2xl-line-height"),e("--font-heading-3xl-line-height"),e("--border-radius-xs"),e("--border-radius-sm"),e("--border-radius-md"),e("--border-radius-lg"),e("--border-radius-xl"),e("--border-radius-full"),e("--border-width-regular"),e("--shadow-hairline"),e("--shadow-sm"),e("--shadow-md"),e("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),ne=h(ae.describe(`Style variables for theming MCP apps.
2
2
 
3
3
  Individual style keys are optional - hosts may provide any subset of these values.
4
4
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
@@ -1,4 +1,4 @@
1
- import{c as qt,r as K,b as go,b0 as Kf,j as k,h as _f,B as hl,am as pl,ak as Uf,aF as qf,eA as pc,eB as Jf,ar as Gf,aI as Vt,eC as Yf,l as Yn,o as Xf,a6 as Xn,a7 as Qn,a9 as Zn}from"./index-B3yBTWEk.js";import{d as Qf,g as Zf}from"./tool-namespace-BVMQcKlk.js";import{d as eh,c as th,e as nh,b as rh,D as sh}from"./dialog-otnvxVN0.js";import{F as ih,d as oh,a as lh,e as ah,b as ch,c as uh}from"./form-KjPevg0A.js";import{I as dh}from"./input-HFOrJf5B.js";import{t as ml}from"./utils-CVEq3hMx.js";import{u as fh}from"./use-copy-14DzRp8J.js";import{a as hh}from"./markdown-B1038zFJ.js";import{i as ph}from"./Check-BWpBE9uf.js";import{a as mh}from"./Copy01-DayLu0dF.js";import{a2 as gh}from"./agent-icon-DrlilhFJ.js";import{b as gl}from"./format-time-BtXRrtv4.js";const yh={openrouter:n=>{const e=n?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function bh(n){if(!n?.providerMetadata)return 0;for(const e of Object.values(yh)){const t=e(n.providerMetadata);if(t!==null)return t}return 0}function kh(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function xh(n,e){if(!e)return n;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,r=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:n.inputTokens+(e.inputTokens??0),outputTokens:n.outputTokens+(e.outputTokens??0),reasoningTokens:n.reasoningTokens+(e.reasoningTokens??0),totalTokens:n.totalTokens+(e.totalTokens??0),cost:n.cost+bh(e),cacheReadTokens:n.cacheReadTokens+t,cacheWriteTokens:n.cacheWriteTokens+r}}function yo(n){const e=Math.max(n.inputTokens,n.cacheReadTokens+n.cacheWriteTokens);return e>0?n.cacheReadTokens/e:0}function OS(n){return n.reduce((e,t)=>xh(e,t.metadata?.usage),kh())}function Sh(n,e){const t={};for(const r of n?.arguments??[])t[r.name]=r.required?pl().min(1,e):pl();return Uf(t)}function Ch(n,e){const t={};for(const r of n.arguments??[])t[r.name]=e?.[r.name]??"";return t}function DS(n){const e=qt.c(74),{prompt:t,setPrompt:r,onSubmit:s,defaultValues:i}=n,o=K.useId(),l=go();let a,c;if(e[0]!==t||e[1]!==l){const ce=Sh(t,l("chat.dialogPromptArguments.required"));c=qf,a=Kf(ce),e[0]=t,e[1]=l,e[2]=a,e[3]=c}else a=e[2],c=e[3];let u;e[4]!==i||e[5]!==t?(u=t?Ch(t,i):{},e[4]=i,e[5]=t,e[6]=u):u=e[6];let d;e[7]!==a||e[8]!==u?(d={resolver:a,defaultValues:u,mode:"onChange"},e[7]=a,e[8]=u,e[9]=d):d=e[9];const f=c(d);let h;e[10]!==t?.arguments?(h=t?.arguments??[],e[10]=t?.arguments,e[11]=h):h=e[11];const p=h;let g;e[12]!==f||e[13]!==s||e[14]!==r?(g=async ce=>{await s(ce),r(null),f.reset()},e[12]=f,e[13]=s,e[14]=r,e[15]=g):g=e[15];const m=g;let y;e[16]!==f||e[17]!==r?(y=ce=>{ce||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=y):y=e[18];const b=y;if(!t)return null;let x;e[19]!==t._meta||e[20]!==t.name||e[21]!==t.title?(x=t.title||Qf(t.name,Zf(t._meta)),e[19]=t._meta,e[20]=t.name,e[21]=t.title,e[22]=x):x=e[22];let C;e[23]!==x?(C=k.jsx(eh,{children:k.jsx("span",{className:"capitalize",children:x})}),e[23]=x,e[24]=C):C=e[24];let M;e[25]!==t.description?(M=t.description&&k.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[25]=t.description,e[26]=M):M=e[26];let D;e[27]!==M||e[28]!==C?(D=k.jsxs(th,{children:[C,M]}),e[27]=M,e[28]=C,e[29]=D):D=e[29];let v;e[30]!==f||e[31]!==m?(v=ce=>{ce.stopPropagation(),f.handleSubmit(m)(ce)},e[30]=f,e[31]=m,e[32]=v):v=e[32];let O;if(e[33]!==p||e[34]!==f.control||e[35]!==f.formState.isSubmitting||e[36]!==l){let ce;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==l?(ce=Qt=>k.jsx(oh,{control:f.control,name:Qt.name,render:Wf=>{const{field:fl}=Wf;return k.jsxs(lh,{children:[k.jsxs(ah,{className:"text-xs",children:[Qt.name,Qt.required?null:k.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",l("chat.dialogPromptArguments.optional")]})]}),k.jsx(ch,{children:k.jsx(dh,{...fl,value:fl.value??"",required:Qt.required,placeholder:Qt.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),k.jsx(uh,{})]})}},Qt.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=l,e[41]=ce):ce=e[41],O=p.map(ce),e[33]=p,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=l,e[37]=O}else O=e[37];let R;e[42]!==b?(R=()=>b(!1),e[42]=b,e[43]=R):R=e[43];const j=f.formState.isSubmitting;let _;e[44]!==l?(_=l("chat.dialogPromptArguments.cancel"),e[44]=l,e[45]=_):_=e[45];let U;e[46]!==f.formState.isSubmitting||e[47]!==R||e[48]!==_?(U=k.jsx(hl,{type:"button",variant:"ghost",onClick:R,disabled:j,children:_}),e[46]=f.formState.isSubmitting,e[47]=R,e[48]=_,e[49]=U):U=e[49];let z;e[50]!==f.formState.isSubmitting||e[51]!==l?(z=f.formState.isSubmitting?k.jsxs("span",{className:"flex items-center gap-2",children:[k.jsx(_f,{size:"xs"}),l("chat.dialogPromptArguments.loading")]}):l("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=l,e[52]=z):z=e[52];let B;e[53]!==f.formState.isSubmitting||e[54]!==o||e[55]!==z?(B=k.jsx(hl,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:z}),e[53]=f.formState.isSubmitting,e[54]=o,e[55]=z,e[56]=B):B=e[56];let L;e[57]!==U||e[58]!==B?(L=k.jsxs(nh,{children:[U,B]}),e[57]=U,e[58]=B,e[59]=L):L=e[59];let H;e[60]!==o||e[61]!==v||e[62]!==O||e[63]!==L?(H=k.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:v,children:[O,L]}),e[60]=o,e[61]=v,e[62]=O,e[63]=L,e[64]=H):H=e[64];let Oe;e[65]!==f||e[66]!==H?(Oe=k.jsx(ih,{...f,children:H}),e[65]=f,e[66]=H,e[67]=Oe):Oe=e[67];let he;e[68]!==D||e[69]!==Oe?(he=k.jsxs(rh,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[D,Oe]}),e[68]=D,e[69]=Oe,e[70]=he):he=e[70];let Mt;return e[71]!==b||e[72]!==he?(Mt=k.jsx(sh,{open:!0,onOpenChange:b,children:he}),e[71]=b,e[72]=he,e[73]=Mt):Mt=e[73],Mt}var yl=Object.defineProperty,Th=(n,e)=>{let t={};for(var r in n)yl(t,r,{get:n[r],enumerable:!0});return yl(t,Symbol.toStringTag,{value:"Module"}),t};function ie(n){this.content=n}ie.prototype={constructor:ie,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new ie(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new ie(t)},addToStart:function(n,e){return new ie([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new ie(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new ie(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=ie.from(n),n.size?new ie(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=ie.from(n),n.size?new ie(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=ie.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};ie.from=function(n){if(n instanceof ie)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ie(e)};function mc(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){let o=s.text,l=i.text,a=0;for(;o[a]==l[a];a++)t++;return a&&a<o.length&&a<l.length&&bc(o.charCodeAt(a-1))&&yc(o.charCodeAt(a))&&t--,t}if(s.content.size||i.content.size){let o=mc(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function gc(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=o.text,u=l.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,t--,r--;return d&&f&&d<c.length&&bc(c.charCodeAt(d-1))&&yc(c.charCodeAt(d))&&(t++,r++),{a:t,b:r}}if(o.content.size||l.content.size){let c=gc(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}function yc(n){return n>=56320&&n<57344}function bc(n){return n>=55296&&n<56320}class S{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new S(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new S(r,s)}cutByIndex(e,t){return e==t?S.empty:e==0&&t==this.content.length?this:new S(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new S(s,i)}addToStart(e){return new S([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new S(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return mc(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return gc(this,e,t,r)}findIndex(e){if(e==0)return Cr(0,e);if(e==this.size)return Cr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Cr(t+1,i):Cr(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return S.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return S.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return S.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new S(t||e,r)}static from(e){if(!e)return S.empty;if(e instanceof S)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new S([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}S.empty=new S([],0);const Ys={index:0,offset:0};function Cr(n,e){return Ys.index=n,Ys.offset=e,Ys}function Hr(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Hr(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Hr(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let F=class wi{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Hr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return wi.none;if(e instanceof wi)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};F.none=[];class er extends Error{}class E{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=xc(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new E(r,this.openStart,this.openEnd)}removeBetween(e,t){return new E(kc(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return E.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new E(S.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new E(e,r,s)}}E.empty=new E(S.empty,0,0);function kc(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(kc(i.content,e-s-1,t-s-1)))}function xc(n,e,t,r,s,i){let{index:o,offset:l}=n.findIndex(e),a=n.maybeChild(o);if(l==e||a.isText)return i&&r<=0&&s<=0&&!i.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=xc(a.content,e-l-1,t,o==0?r-1:0,o==n.childCount-1?s-1:0,a);return c&&n.replaceChild(o,a.copy(c))}function Mh(n,e,t){if(t.openStart>n.depth)throw new er("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new er("Inconsistent open depths");return Sc(n,e,t,0)}function Sc(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Sc(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return Lt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Eh(t,n);return Lt(i,Tc(n,o,l,e,r))}else return Lt(i,Vr(n,e,r))}function Cc(n,e){if(!e.type.compatibleContent(n.type))throw new er("Cannot join "+e.type.name+" onto "+n.type.name)}function vi(n,e,t){let r=n.node(t);return Cc(r,e.node(t)),r}function Pt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Ln(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(Pt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)Pt(s.child(l),r);e&&e.depth==t&&e.textOffset&&Pt(e.nodeBefore,r)}function Lt(n,e){if(!n.type.validContent(e))throw new er("Invalid content for node "+n.type.name);return n.copy(e)}function Tc(n,e,t,r,s){let i=n.depth>s&&vi(n,e,s+1),o=r.depth>s&&vi(t,r,s+1),l=[];return Ln(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Cc(i,o),Pt(Lt(i,Tc(n,e,t,r,s+1)),l)):(i&&Pt(Lt(i,Vr(n,e,s+1)),l),Ln(e,t,s,l),o&&Pt(Lt(o,Vr(t,r,s+1)),l)),Ln(r,null,s,l),new S(l)}function Vr(n,e,t){let r=[];if(Ln(null,n,t,r),n.depth>t){let s=vi(n,e,t+1);Pt(Lt(s,Vr(n,e,t+1)),r)}return Ln(e,null,t,r),new S(r)}function Eh(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(S.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class tr{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return F.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Wr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new tr(t,r,i)}static resolveCached(e,t){let r=bl.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else bl.set(e,r=new wh);let s=r.elts[r.i]=tr.resolve(e,t);return r.i=(r.i+1)%vh,s}}class wh{constructor(){this.elts=[],this.i=0}}const vh=12,bl=new WeakMap;class Wr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Nh=Object.create(null);let $t=class Ni{constructor(e,t,r,s=F.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||S.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Hr(this.attrs,t||e.defaultAttrs||Nh)&&F.sameSet(this.marks,r||F.none)}copy(e=null){return e==this.content?this:new Ni(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ni(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return E.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new E(c,s.depth-o,i.depth-o)}replace(e,t,r){return Mh(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return tr.resolveCached(this,e)}resolveNoCache(e){return tr.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Mc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=S.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=F.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!F.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=S.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}};$t.prototype.text=void 0;class Kr extends $t{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Mc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Kr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Kr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Mc(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Wt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Ah(e,t);if(r.next==null)return Wt.empty;let s=Ec(r);r.next&&r.err("Unexpected trailing text");let i=$h(Lh(s));return zh(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return S.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
1
+ import{c as qt,r as K,b as go,b0 as Kf,j as k,h as _f,B as hl,am as pl,ak as Uf,aF as qf,eA as pc,eB as Jf,ar as Gf,aI as Vt,eC as Yf,l as Yn,o as Xf,a6 as Xn,a7 as Qn,a9 as Zn}from"./index-BodvdIMk.js";import{d as Qf,g as Zf}from"./tool-namespace-CCb8MkTr.js";import{d as eh,c as th,e as nh,b as rh,D as sh}from"./dialog-BAfLND_C.js";import{F as ih,d as oh,a as lh,e as ah,b as ch,c as uh}from"./form-B2aJ1tMr.js";import{I as dh}from"./input-CyCfmV2v.js";import{t as ml}from"./utils-CVEq3hMx.js";import{u as fh}from"./use-copy-Cc2PzrxF.js";import{a as hh}from"./markdown-CuYSLr0D.js";import{i as ph}from"./Check-_wGz2-IJ.js";import{a as mh}from"./Copy01-DoHw-_s5.js";import{a2 as gh}from"./agent-icon-DlT0cyOd.js";import{b as gl}from"./format-time-BtXRrtv4.js";const yh={openrouter:n=>{const e=n?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function bh(n){if(!n?.providerMetadata)return 0;for(const e of Object.values(yh)){const t=e(n.providerMetadata);if(t!==null)return t}return 0}function kh(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function xh(n,e){if(!e)return n;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,r=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:n.inputTokens+(e.inputTokens??0),outputTokens:n.outputTokens+(e.outputTokens??0),reasoningTokens:n.reasoningTokens+(e.reasoningTokens??0),totalTokens:n.totalTokens+(e.totalTokens??0),cost:n.cost+bh(e),cacheReadTokens:n.cacheReadTokens+t,cacheWriteTokens:n.cacheWriteTokens+r}}function yo(n){const e=Math.max(n.inputTokens,n.cacheReadTokens+n.cacheWriteTokens);return e>0?n.cacheReadTokens/e:0}function OS(n){return n.reduce((e,t)=>xh(e,t.metadata?.usage),kh())}function Sh(n,e){const t={};for(const r of n?.arguments??[])t[r.name]=r.required?pl().min(1,e):pl();return Uf(t)}function Ch(n,e){const t={};for(const r of n.arguments??[])t[r.name]=e?.[r.name]??"";return t}function DS(n){const e=qt.c(74),{prompt:t,setPrompt:r,onSubmit:s,defaultValues:i}=n,o=K.useId(),l=go();let a,c;if(e[0]!==t||e[1]!==l){const ce=Sh(t,l("chat.dialogPromptArguments.required"));c=qf,a=Kf(ce),e[0]=t,e[1]=l,e[2]=a,e[3]=c}else a=e[2],c=e[3];let u;e[4]!==i||e[5]!==t?(u=t?Ch(t,i):{},e[4]=i,e[5]=t,e[6]=u):u=e[6];let d;e[7]!==a||e[8]!==u?(d={resolver:a,defaultValues:u,mode:"onChange"},e[7]=a,e[8]=u,e[9]=d):d=e[9];const f=c(d);let h;e[10]!==t?.arguments?(h=t?.arguments??[],e[10]=t?.arguments,e[11]=h):h=e[11];const p=h;let g;e[12]!==f||e[13]!==s||e[14]!==r?(g=async ce=>{await s(ce),r(null),f.reset()},e[12]=f,e[13]=s,e[14]=r,e[15]=g):g=e[15];const m=g;let y;e[16]!==f||e[17]!==r?(y=ce=>{ce||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=y):y=e[18];const b=y;if(!t)return null;let x;e[19]!==t._meta||e[20]!==t.name||e[21]!==t.title?(x=t.title||Qf(t.name,Zf(t._meta)),e[19]=t._meta,e[20]=t.name,e[21]=t.title,e[22]=x):x=e[22];let C;e[23]!==x?(C=k.jsx(eh,{children:k.jsx("span",{className:"capitalize",children:x})}),e[23]=x,e[24]=C):C=e[24];let M;e[25]!==t.description?(M=t.description&&k.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[25]=t.description,e[26]=M):M=e[26];let D;e[27]!==M||e[28]!==C?(D=k.jsxs(th,{children:[C,M]}),e[27]=M,e[28]=C,e[29]=D):D=e[29];let v;e[30]!==f||e[31]!==m?(v=ce=>{ce.stopPropagation(),f.handleSubmit(m)(ce)},e[30]=f,e[31]=m,e[32]=v):v=e[32];let O;if(e[33]!==p||e[34]!==f.control||e[35]!==f.formState.isSubmitting||e[36]!==l){let ce;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==l?(ce=Qt=>k.jsx(oh,{control:f.control,name:Qt.name,render:Wf=>{const{field:fl}=Wf;return k.jsxs(lh,{children:[k.jsxs(ah,{className:"text-xs",children:[Qt.name,Qt.required?null:k.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",l("chat.dialogPromptArguments.optional")]})]}),k.jsx(ch,{children:k.jsx(dh,{...fl,value:fl.value??"",required:Qt.required,placeholder:Qt.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),k.jsx(uh,{})]})}},Qt.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=l,e[41]=ce):ce=e[41],O=p.map(ce),e[33]=p,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=l,e[37]=O}else O=e[37];let R;e[42]!==b?(R=()=>b(!1),e[42]=b,e[43]=R):R=e[43];const j=f.formState.isSubmitting;let _;e[44]!==l?(_=l("chat.dialogPromptArguments.cancel"),e[44]=l,e[45]=_):_=e[45];let U;e[46]!==f.formState.isSubmitting||e[47]!==R||e[48]!==_?(U=k.jsx(hl,{type:"button",variant:"ghost",onClick:R,disabled:j,children:_}),e[46]=f.formState.isSubmitting,e[47]=R,e[48]=_,e[49]=U):U=e[49];let z;e[50]!==f.formState.isSubmitting||e[51]!==l?(z=f.formState.isSubmitting?k.jsxs("span",{className:"flex items-center gap-2",children:[k.jsx(_f,{size:"xs"}),l("chat.dialogPromptArguments.loading")]}):l("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=l,e[52]=z):z=e[52];let B;e[53]!==f.formState.isSubmitting||e[54]!==o||e[55]!==z?(B=k.jsx(hl,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:z}),e[53]=f.formState.isSubmitting,e[54]=o,e[55]=z,e[56]=B):B=e[56];let L;e[57]!==U||e[58]!==B?(L=k.jsxs(nh,{children:[U,B]}),e[57]=U,e[58]=B,e[59]=L):L=e[59];let H;e[60]!==o||e[61]!==v||e[62]!==O||e[63]!==L?(H=k.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:v,children:[O,L]}),e[60]=o,e[61]=v,e[62]=O,e[63]=L,e[64]=H):H=e[64];let Oe;e[65]!==f||e[66]!==H?(Oe=k.jsx(ih,{...f,children:H}),e[65]=f,e[66]=H,e[67]=Oe):Oe=e[67];let he;e[68]!==D||e[69]!==Oe?(he=k.jsxs(rh,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[D,Oe]}),e[68]=D,e[69]=Oe,e[70]=he):he=e[70];let Mt;return e[71]!==b||e[72]!==he?(Mt=k.jsx(sh,{open:!0,onOpenChange:b,children:he}),e[71]=b,e[72]=he,e[73]=Mt):Mt=e[73],Mt}var yl=Object.defineProperty,Th=(n,e)=>{let t={};for(var r in n)yl(t,r,{get:n[r],enumerable:!0});return yl(t,Symbol.toStringTag,{value:"Module"}),t};function ie(n){this.content=n}ie.prototype={constructor:ie,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new ie(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new ie(t)},addToStart:function(n,e){return new ie([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new ie(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new ie(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=ie.from(n),n.size?new ie(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=ie.from(n),n.size?new ie(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=ie.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};ie.from=function(n){if(n instanceof ie)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ie(e)};function mc(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){let o=s.text,l=i.text,a=0;for(;o[a]==l[a];a++)t++;return a&&a<o.length&&a<l.length&&bc(o.charCodeAt(a-1))&&yc(o.charCodeAt(a))&&t--,t}if(s.content.size||i.content.size){let o=mc(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function gc(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=o.text,u=l.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,t--,r--;return d&&f&&d<c.length&&bc(c.charCodeAt(d-1))&&yc(c.charCodeAt(d))&&(t++,r++),{a:t,b:r}}if(o.content.size||l.content.size){let c=gc(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}function yc(n){return n>=56320&&n<57344}function bc(n){return n>=55296&&n<56320}class S{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new S(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new S(r,s)}cutByIndex(e,t){return e==t?S.empty:e==0&&t==this.content.length?this:new S(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new S(s,i)}addToStart(e){return new S([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new S(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return mc(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return gc(this,e,t,r)}findIndex(e){if(e==0)return Cr(0,e);if(e==this.size)return Cr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Cr(t+1,i):Cr(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return S.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return S.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return S.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new S(t||e,r)}static from(e){if(!e)return S.empty;if(e instanceof S)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new S([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}S.empty=new S([],0);const Ys={index:0,offset:0};function Cr(n,e){return Ys.index=n,Ys.offset=e,Ys}function Hr(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Hr(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Hr(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let F=class wi{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Hr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return wi.none;if(e instanceof wi)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};F.none=[];class er extends Error{}class E{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=xc(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new E(r,this.openStart,this.openEnd)}removeBetween(e,t){return new E(kc(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return E.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new E(S.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new E(e,r,s)}}E.empty=new E(S.empty,0,0);function kc(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(kc(i.content,e-s-1,t-s-1)))}function xc(n,e,t,r,s,i){let{index:o,offset:l}=n.findIndex(e),a=n.maybeChild(o);if(l==e||a.isText)return i&&r<=0&&s<=0&&!i.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=xc(a.content,e-l-1,t,o==0?r-1:0,o==n.childCount-1?s-1:0,a);return c&&n.replaceChild(o,a.copy(c))}function Mh(n,e,t){if(t.openStart>n.depth)throw new er("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new er("Inconsistent open depths");return Sc(n,e,t,0)}function Sc(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Sc(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return Lt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Eh(t,n);return Lt(i,Tc(n,o,l,e,r))}else return Lt(i,Vr(n,e,r))}function Cc(n,e){if(!e.type.compatibleContent(n.type))throw new er("Cannot join "+e.type.name+" onto "+n.type.name)}function vi(n,e,t){let r=n.node(t);return Cc(r,e.node(t)),r}function Pt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Ln(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(Pt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)Pt(s.child(l),r);e&&e.depth==t&&e.textOffset&&Pt(e.nodeBefore,r)}function Lt(n,e){if(!n.type.validContent(e))throw new er("Invalid content for node "+n.type.name);return n.copy(e)}function Tc(n,e,t,r,s){let i=n.depth>s&&vi(n,e,s+1),o=r.depth>s&&vi(t,r,s+1),l=[];return Ln(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Cc(i,o),Pt(Lt(i,Tc(n,e,t,r,s+1)),l)):(i&&Pt(Lt(i,Vr(n,e,s+1)),l),Ln(e,t,s,l),o&&Pt(Lt(o,Vr(t,r,s+1)),l)),Ln(r,null,s,l),new S(l)}function Vr(n,e,t){let r=[];if(Ln(null,n,t,r),n.depth>t){let s=vi(n,e,t+1);Pt(Lt(s,Vr(n,e,t+1)),r)}return Ln(e,null,t,r),new S(r)}function Eh(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(S.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class tr{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return F.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Wr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new tr(t,r,i)}static resolveCached(e,t){let r=bl.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else bl.set(e,r=new wh);let s=r.elts[r.i]=tr.resolve(e,t);return r.i=(r.i+1)%vh,s}}class wh{constructor(){this.elts=[],this.i=0}}const vh=12,bl=new WeakMap;class Wr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Nh=Object.create(null);let $t=class Ni{constructor(e,t,r,s=F.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||S.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Hr(this.attrs,t||e.defaultAttrs||Nh)&&F.sameSet(this.marks,r||F.none)}copy(e=null){return e==this.content?this:new Ni(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ni(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return E.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new E(c,s.depth-o,i.depth-o)}replace(e,t,r){return Mh(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return tr.resolveCached(this,e)}resolveNoCache(e){return tr.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Mc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=S.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=F.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!F.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=S.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}};$t.prototype.text=void 0;class Kr extends $t{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Mc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Kr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Kr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Mc(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Wt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Ah(e,t);if(r.next==null)return Wt.empty;let s=Ec(r);r.next&&r.err("Unexpected trailing text");let i=$h(Lh(s));return zh(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return S.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
2
2
  `)}}Wt.empty=new Wt(!0);class Ah{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ec(n){let e=[];do e.push(Oh(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Oh(n){let e=[];do e.push(Dh(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Dh(n){let e=Ph(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Rh(n,e);else break;return e}function kl(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Rh(n,e){let t=kl(n),r=t;return n.eat(",")&&(n.next!="}"?r=kl(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Ih(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let i in t){let o=t[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function Ph(n){if(n.eat("(")){let e=Ec(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Ih(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Lh(n){let e=[[]];return s(i(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=t();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=t();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function wc(n,e){return e-n}function xl(n,e){let t=[];return r(e),t.sort(wc);function r(s){let i=n[s];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&t.indexOf(a)==-1&&r(a)}}}function $h(n){let e=Object.create(null);return t(xl(n,0));function t(r){let s=[];r.forEach(o=>{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);xl(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Wt(r.indexOf(n.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(wc);i.next.push({type:s[o][0],next:e[l.join(",")]||t(l)})}return i}}function zh(n,e){for(let t=0,r=[n];t<r.length;t++){let s=r[t],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function vc(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Nc(n,e){let t=Object.create(null);for(let r in n){let s=e&&e[r];if(s===void 0){let i=n[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=s}return t}function Ac(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${r}`);for(let s in n)n[s].validate&&n[s].validate(e[s])}function Oc(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new Fh(n,r,e[r]);return t}let Sl=class Dc{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Oc(e,r.attrs),this.defaultAttrs=vc(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Wt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Nc(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new $t(this,this.computeAttrs(e),S.from(t),F.setFrom(r))}createChecked(e=null,t,r){return t=S.from(t),this.checkContent(t),new $t(this,this.computeAttrs(e),t,F.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=S.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),i=s&&s.fillBefore(S.empty,!0);return i?new $t(this,e,t.append(i),F.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Ac(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:F.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,o)=>r[i]=new Dc(i,t,o));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Bh(n,e,t){let r=t.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class Fh{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Bh(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ps{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=Oc(e,s.attrs),this.excluded=null;let i=vc(this.attrs);this.instance=i?new F(this,i):null}create(e=null){return!e&&this.instance?this.instance:new F(this,Nc(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new Ps(i,s++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Ac(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Rc{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=ie.from(e.nodes),t.marks=ie.from(e.marks||{}),this.nodes=Sl.compile(this.spec.nodes,this),this.marks=Ps.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=Wt.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?Cl(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:Cl(this,o.split(" "))}this.nodeFromJSON=s=>$t.fromJSON(this,s),this.markFromJSON=s=>F.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Sl){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new Kr(r,r.defaultAttrs,e,F.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Cl(n,e){let t=[];for(let r=0;r<e.length;r++){let s=e[r],i=n.marks[s],o=i;if(i)t.push(i);else for(let l in n.marks){let a=n.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function jh(n){return n.tag!=null}function Hh(n){return n.style!=null}class Fe{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(jh(s))this.tags.push(s);else if(Hh(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new Ml(this,t,!1);return r.addAll(e,F.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Ml(this,t,!0);return r.addAll(e,F.none,t.from,t.to),E.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(Kh(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,t,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<i)break}t.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=El(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=El(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Fe(e,Fe.schemaRules(e)))}}const Ic={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Vh={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Pc={ol:!0,ul:!0},nr=1,Ai=2,$n=4;function Tl(n,e,t){return e!=null?(e?nr:0)|(e==="full"?Ai:0):n&&n.whitespace=="pre"?nr|Ai:t&~$n}class Tr{constructor(e,t,r,s,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=F.none,this.match=i||(o&$n?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(S.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&nr)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let t=S.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(S.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ic.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ml{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,i,o=Tl(null,t.preserveWhitespace,0)|(r?$n:0);s?i=new Tr(s.type,s.attrs,F.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new Tr(null,null,F.none,!0,null,o):i=new Tr(e.schema.topNodeType,null,F.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,i=s.options&Ai?"full":this.localPreserveWS||(s.options&nr)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
3
3
  `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;Pc.hasOwnProperty(o)&&this.parser.normalizeLists&&Wh(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Vh.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(Ic.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)t=this.enterInner(s[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let s=this.findPlace(e,t,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=F.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):wl(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,t,r,s){let i=this.findPlace(e.create(t),r,!1);return i&&(i=this.enterInner(e,t,r,!0,s)),i}enterInner(e,t,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=Tl(e,i,o.options);o.options&$n&&o.content.length==0&&(l|=$n);let a=F.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):wl(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Tr(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=nr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function Wh(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Pc.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Kh(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function El(n){let e={};for(let t in n)e[t]=n[t];return e}function wl(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class et{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Mr(t).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,t);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){if(e.isText)return Mr(t).createTextNode(e.text);let{dom:r,contentDOM:s}=$r(Mr(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&$r(Mr(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return typeof t=="string"?{dom:e.createTextNode(t)}:$r(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new et(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=vl(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return vl(e.marks)}}function vl(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Mr(n){return n.document||window.document}const Nl=new WeakMap;function _h(n){let e=Nl.get(n);return e===void 0&&Nl.set(n,e=Uh(n)),e}function Uh(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)t(r[s]);else for(let s in r)t(r[s])}return t(n),e}function $r(n,e,t,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=_h(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(n.createTextNode(f));else{let{dom:h,contentDOM:p}=$r(n,f,t,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const Lc=65535,$c=Math.pow(2,16);function qh(n,e){return n+e*$c}function Al(n){return n&Lc}function Jh(n){return(n-(n&Lc))/$c}const zc=1,Bc=2,zr=4,Fc=8;class Oi{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Fc)>0}get deletedBefore(){return(this.delInfo&(zc|zr))>0}get deletedAfter(){return(this.delInfo&(Bc|zr))>0}get deletedAcross(){return(this.delInfo&zr)>0}}class Se{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Se.empty)return Se.empty}recover(e){let t=0,r=Al(e);if(!this.inverted)for(let s=0;s<r;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+t+Jh(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+s+(f<0?0:u);if(r)return h;let p=e==(t<0?a:d)?null:qh(l/3,e-a),g=e==a?Bc:e==d?zc:zr;return(t<0?e!=a:e!=d)&&(g|=Fc),new Oi(h,g,p)}s+=u-c}return r?e+s:new Oi(e+s,0,null)}touches(e,t){let r=0,s=Al(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+t],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new Se(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Se.empty:new Se(e<0?[0,-e,0]:[0,0,e])}}Se.empty=new Se([]);class rr{constructor(e,t,r=0,s=e?e.length:0){this.mirror=t,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new rr(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?r+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new rr;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new Oi(e,s,null)}}const Xs=Object.create(null);class fe{getMap(){return Se.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Xs[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Xs)throw new RangeError("Duplicate use of step JSON ID "+e);return Xs[e]=t,t.prototype.jsonID=e,t}}class Q{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Q(e,null)}static fail(e){return new Q(null,e)}static fromReplace(e,t,r,s){try{return Q.ok(e.replace(t,r,s))}catch(i){if(i instanceof er)return Q.fail(i.message);throw i}}}function bo(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let i=n.child(s);i.content.size&&(i=i.copy(bo(i.content,e,i))),i.isInline&&(i=e(i,t,s)),r.push(i)}return S.fromArray(r)}class dt extends fe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new E(bo(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return Q.fromReplace(e,this.from,this.to,i)}invert(){return new Re(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new dt(t.pos,r.pos,this.mark)}merge(e){return e instanceof dt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new dt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new dt(t.from,t.to,e.markFromJSON(t.mark))}}fe.jsonID("addMark",dt);class Re extends fe{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new E(bo(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return Q.fromReplace(e,this.from,this.to,r)}invert(){return new dt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Re(t.pos,r.pos,this.mark)}merge(e){return e instanceof Re&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Re(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Re(t.from,t.to,e.markFromJSON(t.mark))}}fe.jsonID("removeMark",Re);class ft extends fe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Q.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Q.fromReplace(e,this.pos,this.pos+1,new E(S.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(r))return new ft(this.pos,t.marks[s]);return new ft(this.pos,this.mark)}}return new Kt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ft(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ft(t.pos,e.markFromJSON(t.mark))}}fe.jsonID("addNodeMark",ft);class Kt extends fe{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Q.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Q.fromReplace(e,this.pos,this.pos+1,new E(S.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new ft(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Kt(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Kt(t.pos,e.markFromJSON(t.mark))}}fe.jsonID("removeNodeMark",Kt);class X extends fe{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&Di(e,this.from,this.to)?Q.fail("Structure replace would overwrite content"):Q.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Se([this.from,this.to-this.from,this.slice.size])}invert(e){return new X(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&X.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new X(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof X)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?E.empty:new E(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new X(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?E.empty:new E(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new X(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new X(t.from,t.to,E.fromJSON(e,t.slice),!!t.structure)}}X.MAP_BIAS=1;fe.jsonID("replace",X);class re extends fe{constructor(e,t,r,s,i,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Di(e,this.from,this.gapFrom)||Di(e,this.gapTo,this.to)))return Q.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Q.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Q.fromReplace(e,this.from,this.to,r):Q.fail("Content does not fit in gap")}getMap(){return new Se([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new re(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||s<t.pos||i>r.pos?null:new re(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new re(t.from,t.to,t.gapFrom,t.gapTo,E.fromJSON(e,t.slice),t.insert,!!t.structure)}}fe.jsonID("replaceAround",re);function Di(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function Gh(n,e,t,r){let s=[],i=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[g])?o.to=h:s.push(o=new Re(f,h,d[g])));l&&l.to==f?l.to=h:i.push(l=new dt(f,h,r))}}),s.forEach(a=>n.step(a)),i.forEach(a=>n.step(a))}function Yh(n,e,t,r){let s=[],i=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof Ps){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<s.length;h++){let p=s[h];p.step==i-1&&d.eq(s[h].style)&&(f=p)}f?(f.to=c,f.step=i):s.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>n.step(new Re(o.from,o.to,o.style)))}function ko(n,e,t,r=t.contentMatch,s=!0){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new X(l,u,E.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new Re(l,u,c.marks[f]));if(s&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new E(S.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new X(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(S.empty,!0);n.replace(l,l,new E(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function Xh(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Cn(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,i=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-i;if(r<n.depth&&o.canReplace(l,a,t))return r;if(r==0||o.type.spec.isolating||!Xh(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function Qh(n,e,t){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=S.empty,d=0;for(let p=i,g=!1;p>t;p--)g||r.index(p)>0?(g=!0,u=S.from(r.node(p).copy(u)),d++):a--;let f=S.empty,h=0;for(let p=i,g=!1;p>t;p--)g||s.after(p+1)<s.end(p)?(g=!0,f=S.from(s.node(p).copy(f)),h++):c++;n.step(new re(a,c,o,l,new E(u.append(f),d,h),u.size-d,!0))}function xo(n,e,t=null,r=n){let s=Zh(n,e),i=s&&ep(r,e);return i?s.map(Ol).concat({type:e,attrs:t}).concat(i.map(Ol)):null}function Ol(n){return{type:n,attrs:null}}function Zh(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return t.canReplaceWith(r,s,o)?i:null}function ep(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function tp(n,e,t){let r=S.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=S.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new re(s,i,s,i,new E(r,0,0),t.length,!0))}function np(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&rp(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Hc(n,o,l,i),ko(n,n.mapping.slice(i).map(l,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new re(d,f,d+1,f-1,new E(S.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&jc(n,o,l,i),!1}})}function jc(n,e,t,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+i+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Hc(n,e,t,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+i);n.replaceWith(o,o+1,e.type.schema.text(`
@@ -1 +1 @@
1
- import{c as p,I as m,ac as R,K as h,m as y,z as S,ay as D}from"./index-B3yBTWEk.js";const P=["deco","anthropic","openrouter","llmapi","google","openai-compatible"],M=new Set(P);function O(o){return M.has(o)}const A={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"]},v={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"]},L={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"]},T={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},K={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},w={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function _(o){return o.toLowerCase().replace(/[^a-z0-9]/g,"")}function x(o){return _(o).includes("deepresearch")}const q=["sonar","searchpreview","online"];function I(o){const e=_(o);return e.includes("deepresearch")?!1:q.some(t=>e.includes(t))}function C(o){return o.asyncResearch!==!0&&I(o.modelId)}function F(o){return o.asyncResearch===!0||x(o.modelId)||I(o.modelId)}function u(o,e,t,n){for(const i of t){const s=o.find(a=>a.modelId===i);if(s)return{keyId:e,modelId:s.modelId,title:s.title}}for(const i of t){const s=o.find(a=>a.modelId.includes(i));if(s)return{keyId:e,modelId:s.modelId,title:s.title}}if(n){const i=o.find(n);if(i)return{keyId:e,modelId:i.modelId,title:i.title}}return null}function b(o,e){const t={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const n of o){const i=e[n.id]??[],s=n.providerId;t.chat.fast||(t.chat.fast=u(i,n.id,A[s]??[])),t.chat.smart||(t.chat.smart=u(i,n.id,v[s]??[])),t.chat.thinking||(t.chat.thinking=u(i,n.id,L[s]??[])),t.image||(t.image=u(i,n.id,T[s]??[],a=>a.capabilities?.includes("image")===!0)),t.webSearch||(t.webSearch=u(i,n.id,K[s]??[],C)),t.deepResearch||(t.deepResearch=u(i,n.id,w[s]??[],F))}return t}function H(o,e){return{queryKey:h.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>await D(o,"AI_PROVIDER_KEY_LIST",{})}}function $(){const o=p.c(7),{org:e}=m(),t=R();let n;o[0]!==e.id?(n=h.aiProviders(e.id),o[0]=e.id,o[1]=n):n=o[1];let i;o[2]!==t?(i=async()=>await t.call("AI_PROVIDERS_LIST",{}),o[2]=t,o[3]=i):i=o[3];let s;o[4]!==n||o[5]!==i?(s={queryKey:n,staleTime:1/0,queryFn:i},o[4]=n,o[5]=i,o[6]=s):s=o[6];const{data:a}=S(s);return a}function N(){const o=p.c(5),{org:e}=m();let t;o[0]!==e.id||o[1]!==e.slug?(t=H(e.slug,e.id),o[0]=e.id,o[1]=e.slug,o[2]=t):t=o[2];const{data:n}=S(t);let i;return o[3]!==n?.keys?(i=n?.keys??[],o[3]=n?.keys,o[4]=i):i=o[4],i}function z(){const o=p.c(2),e=N();let t;return o[0]!==e?(t=e.filter(Q),o[0]=e,o[1]=t):t=o[1],t}function Q(o){return O(o.providerId)}function E(o){const e=p.c(15),{org:t}=m(),n=R();let i;e[0]!==o||e[1]!==t.id?(i=h.aiProviderModels(t.id,o??""),e[0]=o,e[1]=t.id,e[2]=i):i=e[2];const s=!!o;let a;e[3]!==o||e[4]!==n?(a=async()=>await n.call("AI_PROVIDERS_LIST_MODELS",{keyId:o??""}),e[3]=o,e[4]=n,e[5]=a):a=e[5];let r;e[6]!==i||e[7]!==s||e[8]!==a?(r={queryKey:i,enabled:s,staleTime:6e4,queryFn:a},e[6]=i,e[7]=s,e[8]=a,e[9]=r):r=e[9];const{data:l,isLoading:c}=y(r);let d;e[10]!==l?.models?(d=l?.models??[],e[10]=l?.models,e[11]=d):d=e[11];const g=!!o&&c;let f;return e[12]!==d||e[13]!==g?(f={models:d,isLoading:g},e[12]=d,e[13]=g,e[14]=f):f=e[14],f}function B(o){const e=p.c(8),t=o[0],n=o[1],i=o[2],{models:s}=E(t?.id),{models:a}=E(n?.id),{models:r}=E(i?.id);let l;if(e[0]!==t||e[1]!==n||e[2]!==i||e[3]!==o||e[4]!==s||e[5]!==a||e[6]!==r){const c={};t?.id&&(c[t.id]=s),n?.id&&(c[n.id]=a),i?.id&&(c[i.id]=r),l=b(o,c),e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=s,e[5]=a,e[6]=r,e[7]=l}else l=e[7];return l}function G(o){const e=p.c(11),{org:t}=m(),n=R();let i;e[0]!==o||e[1]!==t.id?(i=h.aiProviderModels(t.id,o),e[0]=o,e[1]=t.id,e[2]=i):i=e[2];let s;e[3]!==o||e[4]!==n?(s=async()=>await n.call("AI_PROVIDERS_LIST_MODELS",{keyId:o}),e[3]=o,e[4]=n,e[5]=s):s=e[5];let a;e[6]!==i||e[7]!==s?(a={queryKey:i,staleTime:6e4,queryFn:s},e[6]=i,e[7]=s,e[8]=a):a=e[8];const{data:r}=S(a);let l;return e[9]!==r?.models?(l=r?.models??[],e[9]=r?.models,e[10]=l):l=e[10],l}export{B as a,E as b,F as c,$ as d,N as e,O as f,G as g,C as i,b as p,z as u};
1
+ import{c as p,I as m,ac as R,K as h,m as y,z as S,ay as D}from"./index-BodvdIMk.js";const P=["deco","anthropic","openrouter","llmapi","google","openai-compatible"],M=new Set(P);function O(o){return M.has(o)}const A={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"]},v={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"]},L={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"]},T={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},K={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},w={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function _(o){return o.toLowerCase().replace(/[^a-z0-9]/g,"")}function x(o){return _(o).includes("deepresearch")}const q=["sonar","searchpreview","online"];function I(o){const e=_(o);return e.includes("deepresearch")?!1:q.some(t=>e.includes(t))}function C(o){return o.asyncResearch!==!0&&I(o.modelId)}function F(o){return o.asyncResearch===!0||x(o.modelId)||I(o.modelId)}function u(o,e,t,n){for(const i of t){const s=o.find(a=>a.modelId===i);if(s)return{keyId:e,modelId:s.modelId,title:s.title}}for(const i of t){const s=o.find(a=>a.modelId.includes(i));if(s)return{keyId:e,modelId:s.modelId,title:s.title}}if(n){const i=o.find(n);if(i)return{keyId:e,modelId:i.modelId,title:i.title}}return null}function b(o,e){const t={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const n of o){const i=e[n.id]??[],s=n.providerId;t.chat.fast||(t.chat.fast=u(i,n.id,A[s]??[])),t.chat.smart||(t.chat.smart=u(i,n.id,v[s]??[])),t.chat.thinking||(t.chat.thinking=u(i,n.id,L[s]??[])),t.image||(t.image=u(i,n.id,T[s]??[],a=>a.capabilities?.includes("image")===!0)),t.webSearch||(t.webSearch=u(i,n.id,K[s]??[],C)),t.deepResearch||(t.deepResearch=u(i,n.id,w[s]??[],F))}return t}function H(o,e){return{queryKey:h.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>await D(o,"AI_PROVIDER_KEY_LIST",{})}}function $(){const o=p.c(7),{org:e}=m(),t=R();let n;o[0]!==e.id?(n=h.aiProviders(e.id),o[0]=e.id,o[1]=n):n=o[1];let i;o[2]!==t?(i=async()=>await t.call("AI_PROVIDERS_LIST",{}),o[2]=t,o[3]=i):i=o[3];let s;o[4]!==n||o[5]!==i?(s={queryKey:n,staleTime:1/0,queryFn:i},o[4]=n,o[5]=i,o[6]=s):s=o[6];const{data:a}=S(s);return a}function N(){const o=p.c(5),{org:e}=m();let t;o[0]!==e.id||o[1]!==e.slug?(t=H(e.slug,e.id),o[0]=e.id,o[1]=e.slug,o[2]=t):t=o[2];const{data:n}=S(t);let i;return o[3]!==n?.keys?(i=n?.keys??[],o[3]=n?.keys,o[4]=i):i=o[4],i}function z(){const o=p.c(2),e=N();let t;return o[0]!==e?(t=e.filter(Q),o[0]=e,o[1]=t):t=o[1],t}function Q(o){return O(o.providerId)}function E(o){const e=p.c(15),{org:t}=m(),n=R();let i;e[0]!==o||e[1]!==t.id?(i=h.aiProviderModels(t.id,o??""),e[0]=o,e[1]=t.id,e[2]=i):i=e[2];const s=!!o;let a;e[3]!==o||e[4]!==n?(a=async()=>await n.call("AI_PROVIDERS_LIST_MODELS",{keyId:o??""}),e[3]=o,e[4]=n,e[5]=a):a=e[5];let r;e[6]!==i||e[7]!==s||e[8]!==a?(r={queryKey:i,enabled:s,staleTime:6e4,queryFn:a},e[6]=i,e[7]=s,e[8]=a,e[9]=r):r=e[9];const{data:l,isLoading:c}=y(r);let d;e[10]!==l?.models?(d=l?.models??[],e[10]=l?.models,e[11]=d):d=e[11];const g=!!o&&c;let f;return e[12]!==d||e[13]!==g?(f={models:d,isLoading:g},e[12]=d,e[13]=g,e[14]=f):f=e[14],f}function B(o){const e=p.c(8),t=o[0],n=o[1],i=o[2],{models:s}=E(t?.id),{models:a}=E(n?.id),{models:r}=E(i?.id);let l;if(e[0]!==t||e[1]!==n||e[2]!==i||e[3]!==o||e[4]!==s||e[5]!==a||e[6]!==r){const c={};t?.id&&(c[t.id]=s),n?.id&&(c[n.id]=a),i?.id&&(c[i.id]=r),l=b(o,c),e[0]=t,e[1]=n,e[2]=i,e[3]=o,e[4]=s,e[5]=a,e[6]=r,e[7]=l}else l=e[7];return l}function G(o){const e=p.c(11),{org:t}=m(),n=R();let i;e[0]!==o||e[1]!==t.id?(i=h.aiProviderModels(t.id,o),e[0]=o,e[1]=t.id,e[2]=i):i=e[2];let s;e[3]!==o||e[4]!==n?(s=async()=>await n.call("AI_PROVIDERS_LIST_MODELS",{keyId:o}),e[3]=o,e[4]=n,e[5]=s):s=e[5];let a;e[6]!==i||e[7]!==s?(a={queryKey:i,staleTime:6e4,queryFn:s},e[6]=i,e[7]=s,e[8]=a):a=e[8];const{data:r}=S(a);let l;return e[9]!==r?.models?(l=r?.models??[],e[9]=r?.models,e[10]=l):l=e[10],l}export{B as a,E as b,F as c,$ as d,N as e,O as f,G as g,C as i,b as p,z as u};
@@ -1 +1 @@
1
- import{c as U,I as q,ac as M,K as T,m as Q,n as w,e as y,t as m,x as z}from"./index-B3yBTWEk.js";import{u as J}from"./use-mcp-client-DsJzBus3.js";function V(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function et(t){const e=U.c(12),{org:s}=q(),l=t??z;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==l?(a={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l,e[3]=a):a=e[3];const i=J(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let o;e[6]!==i?(o=async()=>{const d=await i.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(V)},e[6]=i,e[7]=o):o=e[7];const c=!!t;let r;return e[8]!==n||e[9]!==o||e[10]!==c?(r={queryKey:n,queryFn:o,enabled:c,staleTime:3e4},e[8]=n,e[9]=o,e[10]=c,e[11]=r):r=e[11],Q(r)}function st(t){const e=U.c(9),{org:s}=q(),l=M();let a;e[0]!==s.id||e[1]!==t?(a=T.automations(s.id,t),e[0]=s.id,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==l||e[4]!==t?(i=async()=>(await l.call("AUTOMATION_LIST",t!=null?{virtual_mcp_id:t}:{})).automations,e[3]=l,e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==a||e[7]!==i?(n={queryKey:a,queryFn:i,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n):n=e[8],Q(n)}function it(t){const e=U.c(10),{org:s}=q(),l=M();let a;e[0]!==t||e[1]!==s.id?(a=T.automation(s.id,t),e[0]=t,e[1]=s.id,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==l?(i=async()=>(await l.call("AUTOMATION_GET",{id:t})).automation,e[3]=t,e[4]=l,e[5]=i):i=e[5];const n=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==n?(o={queryKey:a,queryFn:i,enabled:n,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n,e[9]=o):o=e[9],Q(o)}function ot(t,e){const s=U.c(12),{org:l}=q(),a=M();let i;s[0]!==t||s[1]!==l.id||s[2]!==e?(i=T.automationRunStats(l.id,t,JSON.stringify(e??{})),s[0]=t,s[1]=l.id,s[2]=e,s[3]=i):i=s[3];let n;s[4]!==t||s[5]!==e||s[6]!==a?(n=async()=>await a.call("AUTOMATION_RUN_STATS",{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}),s[4]=t,s[5]=e,s[6]=a,s[7]=n):n=s[7];const o=!!t;let c;return s[8]!==i||s[9]!==n||s[10]!==o?(c={queryKey:i,queryFn:n,enabled:o,staleTime:3e4},s[8]=i,s[9]=n,s[10]=o,s[11]=c):c=s[11],Q(c)}function at(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function nt(){const t=U.c(64),{org:e}=q(),s=M(),l=w();let a;t[0]!==e||t[1]!==l?(a=()=>l.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[0]=e,t[1]=l,t[2]=a):a=t[2];const i=a;let n;t[3]!==e||t[4]!==l?(n=u=>l.invalidateQueries({queryKey:T.automation(e.id,u)}),t[3]=e,t[4]=l,t[5]=n):n=t[5];const o=n;let c;t[6]!==s?(c=async u=>await s.call("AUTOMATION_CREATE",u),t[6]=s,t[7]=c):c=t[7];let r;t[8]!==i?(r=()=>{i(),m.success("Automation created successfully")},t[8]=i,t[9]=r):r=t[9];let d;t[10]!==c||t[11]!==r?(d={mutationFn:c,onSuccess:r,onError:X},t[10]=c,t[11]=r,t[12]=d):d=t[12];const D=y(d);let A;t[13]!==s?(A=async u=>await s.call("AUTOMATION_UPDATE",u),t[13]=s,t[14]=A):A=t[14];let p;t[15]!==i||t[16]!==o?(p=(u,f)=>{i(),typeof f.id=="string"&&o(f.id),m.success("Automation updated successfully")},t[15]=i,t[16]=o,t[17]=p):p=t[17];let G;t[18]!==A||t[19]!==p?(G={mutationFn:A,onSuccess:p,onError:W},t[18]=A,t[19]=p,t[20]=G):G=t[20];const j=y(G);let g;t[21]!==s?(g=async u=>await s.call("AUTOMATION_DELETE",{id:u}),t[21]=s,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==e||t[25]!==l?(_=(u,f)=>{l.removeQueries({queryKey:T.automation(e.id,f)}),i(),m.success("Automation deleted successfully")},t[23]=i,t[24]=e,t[25]=l,t[26]=_):_=t[26];let $;t[27]!==g||t[28]!==_?($={mutationFn:g,onSuccess:_,onError:H},t[27]=g,t[28]=_,t[29]=$):$=t[29];const k=y($);let E;t[30]!==s?(E=async u=>await s.call("AUTOMATION_TRIGGER_ADD",u),t[30]=s,t[31]=E):E=t[31];let S;t[32]!==i||t[33]!==o?(S=u=>{i(),o(u.automation_id)},t[32]=i,t[33]=o,t[34]=S):S=t[34];let K;t[35]!==E||t[36]!==S?(K={mutationFn:E,onSuccess:S},t[35]=E,t[36]=S,t[37]=K):K=t[37];const x=y(K);let O;t[38]!==s?(O=async u=>await s.call("AUTOMATION_TRIGGER_ROTATE_TOKEN",{trigger_id:u.trigger_id}),t[38]=s,t[39]=O):O=t[39];let R;t[40]!==i||t[41]!==o?(R=(u,f)=>{i(),o(f.automation_id)},t[40]=i,t[41]=o,t[42]=R):R=t[42];let C;t[43]!==O||t[44]!==R?(C={mutationFn:O,onSuccess:R},t[43]=O,t[44]=R,t[45]=C):C=t[45];const P=y(C);let F;t[46]!==s?(F=async u=>await s.call("AUTOMATION_TRIGGER_REMOVE",{trigger_id:u.trigger_id}),t[46]=s,t[47]=F):F=t[47];let N;t[48]!==i||t[49]!==o?(N=(u,f)=>{i(),o(f.automation_id)},t[48]=i,t[49]=o,t[50]=N):N=t[50];let b;t[51]!==F||t[52]!==N?(b={mutationFn:F,onSuccess:N},t[51]=F,t[52]=N,t[53]=b):b=t[53];const h=y(b);let I;t[54]!==s?(I={mutationFn:async u=>await s.call("AUTOMATION_RUN",{id:u}),onSuccess:B,onError:Y},t[54]=s,t[55]=I):I=t[55];const v=y(I);let L;return t[56]!==D||t[57]!==k||t[58]!==v||t[59]!==x||t[60]!==h||t[61]!==P||t[62]!==j?(L={create:D,update:j,remove:k,triggerAdd:x,triggerRemove:h,triggerRotateToken:P,run:v},t[56]=D,t[57]=k,t[58]=v,t[59]=x,t[60]=h,t[61]=P,t[62]=j,t[63]=L):L=t[63],L}function Y(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to run automation: ${e}`)}function B(t){t.skipped?m.info(`Automation skipped: ${t.skipped}`):t.error?m.error(`Automation failed: ${t.error}`):m.success("Automation triggered")}function H(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to delete automation: ${e}`)}function W(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to update automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to create automation: ${e}`)}export{nt as a,at as b,et as c,it as d,ot as e,st as u};
1
+ import{c as U,I as q,ac as M,K as T,m as Q,n as w,e as y,t as m,x as z}from"./index-BodvdIMk.js";import{u as J}from"./use-mcp-client-DO1cH-Rq.js";function V(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function et(t){const e=U.c(12),{org:s}=q(),l=t??z;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==l?(a={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l,e[3]=a):a=e[3];const i=J(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let o;e[6]!==i?(o=async()=>{const d=await i.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(V)},e[6]=i,e[7]=o):o=e[7];const c=!!t;let r;return e[8]!==n||e[9]!==o||e[10]!==c?(r={queryKey:n,queryFn:o,enabled:c,staleTime:3e4},e[8]=n,e[9]=o,e[10]=c,e[11]=r):r=e[11],Q(r)}function st(t){const e=U.c(9),{org:s}=q(),l=M();let a;e[0]!==s.id||e[1]!==t?(a=T.automations(s.id,t),e[0]=s.id,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==l||e[4]!==t?(i=async()=>(await l.call("AUTOMATION_LIST",t!=null?{virtual_mcp_id:t}:{})).automations,e[3]=l,e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==a||e[7]!==i?(n={queryKey:a,queryFn:i,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n):n=e[8],Q(n)}function it(t){const e=U.c(10),{org:s}=q(),l=M();let a;e[0]!==t||e[1]!==s.id?(a=T.automation(s.id,t),e[0]=t,e[1]=s.id,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==l?(i=async()=>(await l.call("AUTOMATION_GET",{id:t})).automation,e[3]=t,e[4]=l,e[5]=i):i=e[5];const n=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==n?(o={queryKey:a,queryFn:i,enabled:n,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n,e[9]=o):o=e[9],Q(o)}function ot(t,e){const s=U.c(12),{org:l}=q(),a=M();let i;s[0]!==t||s[1]!==l.id||s[2]!==e?(i=T.automationRunStats(l.id,t,JSON.stringify(e??{})),s[0]=t,s[1]=l.id,s[2]=e,s[3]=i):i=s[3];let n;s[4]!==t||s[5]!==e||s[6]!==a?(n=async()=>await a.call("AUTOMATION_RUN_STATS",{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}),s[4]=t,s[5]=e,s[6]=a,s[7]=n):n=s[7];const o=!!t;let c;return s[8]!==i||s[9]!==n||s[10]!==o?(c={queryKey:i,queryFn:n,enabled:o,staleTime:3e4},s[8]=i,s[9]=n,s[10]=o,s[11]=c):c=s[11],Q(c)}function at(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function nt(){const t=U.c(64),{org:e}=q(),s=M(),l=w();let a;t[0]!==e||t[1]!==l?(a=()=>l.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[0]=e,t[1]=l,t[2]=a):a=t[2];const i=a;let n;t[3]!==e||t[4]!==l?(n=u=>l.invalidateQueries({queryKey:T.automation(e.id,u)}),t[3]=e,t[4]=l,t[5]=n):n=t[5];const o=n;let c;t[6]!==s?(c=async u=>await s.call("AUTOMATION_CREATE",u),t[6]=s,t[7]=c):c=t[7];let r;t[8]!==i?(r=()=>{i(),m.success("Automation created successfully")},t[8]=i,t[9]=r):r=t[9];let d;t[10]!==c||t[11]!==r?(d={mutationFn:c,onSuccess:r,onError:X},t[10]=c,t[11]=r,t[12]=d):d=t[12];const D=y(d);let A;t[13]!==s?(A=async u=>await s.call("AUTOMATION_UPDATE",u),t[13]=s,t[14]=A):A=t[14];let p;t[15]!==i||t[16]!==o?(p=(u,f)=>{i(),typeof f.id=="string"&&o(f.id),m.success("Automation updated successfully")},t[15]=i,t[16]=o,t[17]=p):p=t[17];let G;t[18]!==A||t[19]!==p?(G={mutationFn:A,onSuccess:p,onError:W},t[18]=A,t[19]=p,t[20]=G):G=t[20];const j=y(G);let g;t[21]!==s?(g=async u=>await s.call("AUTOMATION_DELETE",{id:u}),t[21]=s,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==e||t[25]!==l?(_=(u,f)=>{l.removeQueries({queryKey:T.automation(e.id,f)}),i(),m.success("Automation deleted successfully")},t[23]=i,t[24]=e,t[25]=l,t[26]=_):_=t[26];let $;t[27]!==g||t[28]!==_?($={mutationFn:g,onSuccess:_,onError:H},t[27]=g,t[28]=_,t[29]=$):$=t[29];const k=y($);let E;t[30]!==s?(E=async u=>await s.call("AUTOMATION_TRIGGER_ADD",u),t[30]=s,t[31]=E):E=t[31];let S;t[32]!==i||t[33]!==o?(S=u=>{i(),o(u.automation_id)},t[32]=i,t[33]=o,t[34]=S):S=t[34];let K;t[35]!==E||t[36]!==S?(K={mutationFn:E,onSuccess:S},t[35]=E,t[36]=S,t[37]=K):K=t[37];const x=y(K);let O;t[38]!==s?(O=async u=>await s.call("AUTOMATION_TRIGGER_ROTATE_TOKEN",{trigger_id:u.trigger_id}),t[38]=s,t[39]=O):O=t[39];let R;t[40]!==i||t[41]!==o?(R=(u,f)=>{i(),o(f.automation_id)},t[40]=i,t[41]=o,t[42]=R):R=t[42];let C;t[43]!==O||t[44]!==R?(C={mutationFn:O,onSuccess:R},t[43]=O,t[44]=R,t[45]=C):C=t[45];const P=y(C);let F;t[46]!==s?(F=async u=>await s.call("AUTOMATION_TRIGGER_REMOVE",{trigger_id:u.trigger_id}),t[46]=s,t[47]=F):F=t[47];let N;t[48]!==i||t[49]!==o?(N=(u,f)=>{i(),o(f.automation_id)},t[48]=i,t[49]=o,t[50]=N):N=t[50];let b;t[51]!==F||t[52]!==N?(b={mutationFn:F,onSuccess:N},t[51]=F,t[52]=N,t[53]=b):b=t[53];const h=y(b);let I;t[54]!==s?(I={mutationFn:async u=>await s.call("AUTOMATION_RUN",{id:u}),onSuccess:B,onError:Y},t[54]=s,t[55]=I):I=t[55];const v=y(I);let L;return t[56]!==D||t[57]!==k||t[58]!==v||t[59]!==x||t[60]!==h||t[61]!==P||t[62]!==j?(L={create:D,update:j,remove:k,triggerAdd:x,triggerRemove:h,triggerRotateToken:P,run:v},t[56]=D,t[57]=k,t[58]=v,t[59]=x,t[60]=h,t[61]=P,t[62]=j,t[63]=L):L=t[63],L}function Y(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to run automation: ${e}`)}function B(t){t.skipped?m.info(`Automation skipped: ${t.skipped}`):t.error?m.error(`Automation failed: ${t.error}`):m.success("Automation triggered")}function H(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to delete automation: ${e}`)}function W(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to update automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to create automation: ${e}`)}export{nt as a,at as b,et as c,it as d,ot as e,st as u};
@@ -1 +1 @@
1
- import{c as T,r as o}from"./index-B3yBTWEk.js";const _=700;function D(s,l,S){const e=T.c(7),a=S?.delay??_,p=S?.isSaving??!1,[f,m]=o.useState(s),[g,y]=o.useState(s),[A,d]=o.useState(!1),t=o.useRef(null);s!==g&&(y(s),!A&&!p&&m(s));let r;e[0]!==a||e[1]!==l?(r=u=>{m(u),d(!0),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,d(!1),l(u)},a)},e[0]=a,e[1]=l,e[2]=r):r=e[2];const i=r;let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=u=>{m(u),t.current&&clearTimeout(t.current),t.current=null,d(!1)},e[3]=c):c=e[3];const E=c;let n;return e[4]!==f||e[5]!==i?(n=[f,i,E],e[4]=f,e[5]=i,e[6]=n):n=e[6],n}export{D as u};
1
+ import{c as T,r as o}from"./index-BodvdIMk.js";const _=700;function D(s,l,S){const e=T.c(7),a=S?.delay??_,p=S?.isSaving??!1,[f,m]=o.useState(s),[g,y]=o.useState(s),[A,d]=o.useState(!1),t=o.useRef(null);s!==g&&(y(s),!A&&!p&&m(s));let r;e[0]!==a||e[1]!==l?(r=u=>{m(u),d(!0),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,d(!1),l(u)},a)},e[0]=a,e[1]=l,e[2]=r):r=e[2];const i=r;let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=u=>{m(u),t.current&&clearTimeout(t.current),t.current=null,d(!1)},e[3]=c):c=e[3];const E=c;let n;return e[4]!==f||e[5]!==i?(n=[f,i,E],e[4]=f,e[5]=i,e[6]=n):n=e[6],n}export{D as u};
@@ -1 +1 @@
1
- import{c as D,I as N,W as M,m,K as R,x as Q,em as L,C as v,y as F}from"./index-B3yBTWEk.js";import{m as T}from"./use-mcp-client-DsJzBus3.js";import{u as h}from"./companions-core-CZwGf1b1.js";function A(e){return e?e.run_in_progress?"generating":e.scanned_at?"ready":"none":"none"}function K(e){return e.connectionQueryPending?!0:!e.hasConnection||e.cdClientFailed?!1:e.diagnosticQueryPending}const x=2e4;function U(e){if(typeof e!="string"||!e)return null;try{return new URL(e).hostname||null}catch{return null}}function W(){const e=D.c(24),{org:n}=N(),t=M.COMMERCE_DISCOVERY(n.id);let l;e[0]!==n.id||e[1]!==n.slug?(l=T({connectionId:Q,orgId:n.id,orgSlug:n.slug}),e[0]=n.id,e[1]=n.slug,e[2]=l):l=e[2];const{data:f}=m(l),u=m({queryKey:R.commerceDiscoveryConnection(n.id,t),enabled:!!f,retry:!1,staleTime:6e4,queryFn:async()=>{if(!f)throw new Error("selfClient not ready");const S=await f.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return h(S)}}),C=u.data?.item??null,{data:s,isError:y}=m({...T({connectionId:t,orgId:n.id,orgSlug:n.slug}),enabled:!!C}),E=R.commerceDiscoveryDiagnostic(n.id,t),p=!!s;let o;e[3]!==s?(o=async()=>{if(!s)throw new Error("cdClient not ready");const S=await s.callTool({name:L,arguments:{}});return h(S).diagnostic??null},e[3]=s,e[4]=o):o=e[4];let d;e[5]!==E||e[6]!==p||e[7]!==o?(d={queryKey:E,enabled:p,retry:1,refetchInterval:b,queryFn:o},e[5]=E,e[6]=p,e[7]=o,e[8]=d):d=e[8];const r=m(d),i=C?.metadata?.siteUrl,I=r.data??null,w=r.isSuccess,_=!!C;let c;e[9]!==y||e[10]!==u.isPending||e[11]!==r.isPending||e[12]!==_?(c=K({connectionQueryPending:u.isPending,hasConnection:_,cdClientFailed:y,diagnosticQueryPending:r.isPending}),e[9]=y,e[10]=u.isPending,e[11]=r.isPending,e[12]=_,e[13]=c):c=e[13];const O=typeof i=="string"&&i?i:null;let a;e[14]!==i?(a=U(i),e[14]=i,e[15]=a):a=e[15];const P=s??null;let g;return e[16]!==t||e[17]!==r.isSuccess||e[18]!==a||e[19]!==P||e[20]!==I||e[21]!==c||e[22]!==O?(g={diagnostic:I,isSuccess:w,isLoading:c,siteUrl:O,host:a,connectionId:t,cdClient:P},e[16]=t,e[17]=r.isSuccess,e[18]=a,e[19]=P,e[20]=I,e[21]=c,e[22]=O,e[23]=g):g=e[23],g}function b(e){return e.state.status!=="error"&&A(e.state.data)==="generating"?x:!1}function j(e,n){return{to:v.app,params:{org:e.slug,agentId:F(e.id),connectionId:n,toolName:L},search:{}}}export{j as c,A as d,W as u};
1
+ import{c as D,I as N,W as M,m,K as R,x as Q,em as L,C as v,y as F}from"./index-BodvdIMk.js";import{m as T}from"./use-mcp-client-DO1cH-Rq.js";import{u as h}from"./companions-core-CZwGf1b1.js";function A(e){return e?e.run_in_progress?"generating":e.scanned_at?"ready":"none":"none"}function K(e){return e.connectionQueryPending?!0:!e.hasConnection||e.cdClientFailed?!1:e.diagnosticQueryPending}const x=2e4;function U(e){if(typeof e!="string"||!e)return null;try{return new URL(e).hostname||null}catch{return null}}function W(){const e=D.c(24),{org:n}=N(),t=M.COMMERCE_DISCOVERY(n.id);let l;e[0]!==n.id||e[1]!==n.slug?(l=T({connectionId:Q,orgId:n.id,orgSlug:n.slug}),e[0]=n.id,e[1]=n.slug,e[2]=l):l=e[2];const{data:f}=m(l),u=m({queryKey:R.commerceDiscoveryConnection(n.id,t),enabled:!!f,retry:!1,staleTime:6e4,queryFn:async()=>{if(!f)throw new Error("selfClient not ready");const S=await f.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return h(S)}}),C=u.data?.item??null,{data:s,isError:y}=m({...T({connectionId:t,orgId:n.id,orgSlug:n.slug}),enabled:!!C}),E=R.commerceDiscoveryDiagnostic(n.id,t),p=!!s;let o;e[3]!==s?(o=async()=>{if(!s)throw new Error("cdClient not ready");const S=await s.callTool({name:L,arguments:{}});return h(S).diagnostic??null},e[3]=s,e[4]=o):o=e[4];let d;e[5]!==E||e[6]!==p||e[7]!==o?(d={queryKey:E,enabled:p,retry:1,refetchInterval:b,queryFn:o},e[5]=E,e[6]=p,e[7]=o,e[8]=d):d=e[8];const r=m(d),i=C?.metadata?.siteUrl,I=r.data??null,w=r.isSuccess,_=!!C;let c;e[9]!==y||e[10]!==u.isPending||e[11]!==r.isPending||e[12]!==_?(c=K({connectionQueryPending:u.isPending,hasConnection:_,cdClientFailed:y,diagnosticQueryPending:r.isPending}),e[9]=y,e[10]=u.isPending,e[11]=r.isPending,e[12]=_,e[13]=c):c=e[13];const O=typeof i=="string"&&i?i:null;let a;e[14]!==i?(a=U(i),e[14]=i,e[15]=a):a=e[15];const P=s??null;let g;return e[16]!==t||e[17]!==r.isSuccess||e[18]!==a||e[19]!==P||e[20]!==I||e[21]!==c||e[22]!==O?(g={diagnostic:I,isSuccess:w,isLoading:c,siteUrl:O,host:a,connectionId:t,cdClient:P},e[16]=t,e[17]=r.isSuccess,e[18]=a,e[19]=P,e[20]=I,e[21]=c,e[22]=O,e[23]=g):g=e[23],g}function b(e){return e.state.status!=="error"&&A(e.state.data)==="generating"?x:!1}function j(e,n){return{to:v.app,params:{org:e.slug,agentId:F(e.id),connectionId:n,toolName:L},search:{}}}export{j as c,A as d,W as u};