decocms 4.447.0 → 4.448.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (363) hide show
  1. package/dist/client/assets/{AlertCircle-O5yKT_wD.js → AlertCircle-BgzKIHBg.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DOBe6b77.js → AreaChart-D9J1W_3A.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-Bgwvgp7N.js → ArrowLeft-Bd0lzf25.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-BcguyIxa.js → ArrowUp-THfmrwlM.js} +1 -1
  5. package/dist/client/assets/{Building02-DXskyQyV.js → Building02-CSMMDKRZ.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-Dxs56jW8.js → CartesianChart-BWUtT14P.js} +1 -1
  7. package/dist/client/assets/{Check-BwZg9K6a.js → Check-CkBscgA2.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-B8nBZ9lR.js → CheckCircle-Bokn_JKt.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-XuQjQLoK.js → ChevronUp-d9MFOW1T.js} +1 -1
  10. package/dist/client/assets/{Copy01-YmLU_wow.js → Copy01-C68wCYtl.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-CwEdzwSq.js → CreditCard01-B4oRpD46.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DEYhHh-q.js → DotsVertical-C2t5zhKy.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-CoXkTI3v.js → ErrorBarContext-D08eI2fo.js} +1 -1
  14. package/dist/client/assets/{Image01-DFTuvWJV.js → Image01-Duw-3ecX.js} +1 -1
  15. package/dist/client/assets/{Key01-CW5AmBXO.js → Key01-CqL4JhuL.js} +1 -1
  16. package/dist/client/assets/{Line-w53GBlC_.js → Line-DL1QPfVo.js} +1 -1
  17. package/dist/client/assets/{Link01-rblrB3OI.js → Link01-C-Mwe2eF.js} +1 -1
  18. package/dist/client/assets/{LinkBroken01-cRHkOCv3.js → LinkBroken01-DN8kSYpX.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-DMr7xmMD.js → LinkExternal01-DMM7FS6P.js} +1 -1
  20. package/dist/client/assets/{Monitor01-DRRgoSgd.js → Monitor01-Wyitf2St.js} +1 -1
  21. package/dist/client/assets/{Palette-BLSfhg5D.js → Palette-VX8lOEW0.js} +1 -1
  22. package/dist/client/assets/{Plus-B7fu2HeJ.js → Plus-DDqlhBDc.js} +1 -1
  23. package/dist/client/assets/{SearchMd-DpRsJH0P.js → SearchMd-WaC9Elkv.js} +1 -1
  24. package/dist/client/assets/{Sector-DUcOKKda.js → Sector-BR94vGtg.js} +1 -1
  25. package/dist/client/assets/{ShoppingBag01-Bn_Ml-RN.js → ShoppingBag01-Cl4z1_2H.js} +1 -1
  26. package/dist/client/assets/{Sun-JyTPOz6f.js → Sun-COvLf5Lc.js} +1 -1
  27. package/dist/client/assets/{Tool01-TfY7iJsP.js → Tool01-CH2aHsGf.js} +1 -1
  28. package/dist/client/assets/{Trash01-DBoWC6W0.js → Trash01-DK8Y_gth.js} +1 -1
  29. package/dist/client/assets/{Upload01-oBIhuFXz.js → Upload01-oF1C_3Ru.js} +1 -1
  30. package/dist/client/assets/{User01-DlDKGoyi.js → User01-GD0yW4Qu.js} +1 -1
  31. package/dist/client/assets/{UserSquare-Cij4gM7j.js → UserSquare-D6GqJl2I.js} +1 -1
  32. package/dist/client/assets/{Users01-B0qqt-bB.js → Users01-DgVeXNsL.js} +1 -1
  33. package/dist/client/assets/{X-B1izQ1KV.js → X-YRTghwXC.js} +1 -1
  34. package/dist/client/assets/{XAxis-CxP14qz_.js → XAxis-DnLQ7FuQ.js} +1 -1
  35. package/dist/client/assets/{XClose-B1wwChfA.js → XClose-75e7Vbaa.js} +1 -1
  36. package/dist/client/assets/{ZoomOut-Cy6sSJWj.js → ZoomOut-Dvx_7Y9U.js} +1 -1
  37. package/dist/client/assets/{access-gate-DvGFBZwA.js → access-gate-BU27wCPK.js} +1 -1
  38. package/dist/client/assets/{add-connection-dialog-1TbuXfcy.js → add-connection-dialog-BHmJQXXQ.js} +1 -1
  39. package/dist/client/assets/{agent-analytics-CVvlpC2h.js → agent-analytics-B6eFHWAd.js} +1 -1
  40. package/dist/client/assets/agent-app-Dq_7tqVN.js +1 -0
  41. package/dist/client/assets/{agent-assets-dT4w7KXp.js → agent-assets-DiWQ8d3n.js} +1 -1
  42. package/dist/client/assets/{agent-automation-QQcgGJrd.js → agent-automation-DjYw4oXf.js} +1 -1
  43. package/dist/client/assets/{agent-automations-DYCzMC9n.js → agent-automations-BUvLJ7il.js} +1 -1
  44. package/dist/client/assets/{agent-connect-sources-BH2pAvk9.js → agent-connect-sources-MyA_CgnU.js} +1 -1
  45. package/dist/client/assets/agent-deck-DP1RFPYl.js +1 -0
  46. package/dist/client/assets/{agent-e2e-CE4P7SOm.js → agent-e2e-C9FCqOvB.js} +1 -1
  47. package/dist/client/assets/{agent-experiments-Cvf_GoyJ.js → agent-experiments-BlE9ebq7.js} +1 -1
  48. package/dist/client/assets/{agent-file-2ITxF0Ae.js → agent-file-BALSM2yR.js} +1 -1
  49. package/dist/client/assets/{agent-git-CaE7XjIB.js → agent-git-CrY9aGVI.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-JmwTdK6y.js → agent-hosting-Cih5FNYQ.js} +1 -1
  51. package/dist/client/assets/{agent-icon-DebFssce.js → agent-icon-BUiQnNP8.js} +1 -1
  52. package/dist/client/assets/agent-library-Beh5m17Q.js +1 -0
  53. package/dist/client/assets/agent-library-file-CwXHAXv4.js +1 -0
  54. package/dist/client/assets/{agent-monitor-IbBmqvCt.js → agent-monitor-BuhaPSMe.js} +1 -1
  55. package/dist/client/assets/{agent-overview-BwNdPBpC.js → agent-overview-BX0iaaBw.js} +1 -1
  56. package/dist/client/assets/agent-settings-CW-eYN6A.js +1 -0
  57. package/dist/client/assets/{agent-site-editor-C8eLBttq.js → agent-site-editor-Dz301u4g.js} +1 -1
  58. package/dist/client/assets/agent-site-editor-code--ZdaE1Zs.js +2 -0
  59. package/dist/client/assets/{agent-site-editor-content--b4gLs1h.js → agent-site-editor-content-ChafU8bT.js} +3 -3
  60. package/dist/client/assets/{agent-site-editor-preview-BZZnLQZf.js → agent-site-editor-preview-UtIZTPE6.js} +3 -3
  61. package/dist/client/assets/agent-view-BYv17ry1.js +1 -0
  62. package/dist/client/assets/{agent-view-guard-B4uVbmma.js → agent-view-guard-CegzWEHj.js} +1 -1
  63. package/dist/client/assets/{agents-list-CwdDMmy-.js → agents-list-OSdOs1OH.js} +1 -1
  64. package/dist/client/assets/{ai-providers-D2O1ixBz.js → ai-providers-fPKqY7_P.js} +1 -1
  65. package/dist/client/assets/{alert-CqDdaXWn.js → alert-BxQz8cP6.js} +1 -1
  66. package/dist/client/assets/{alert-dialog-BaW-BGF4.js → alert-dialog-BB87iWcS.js} +1 -1
  67. package/dist/client/assets/{analytics-sections-D61Wwl8L.js → analytics-sections-md4NfZUk.js} +1 -1
  68. package/dist/client/assets/api-keys-BtiHVECl.js +1 -0
  69. package/dist/client/assets/{api-keys-wNYNv40Y.js → api-keys-OtcVZ-We.js} +1 -1
  70. package/dist/client/assets/app-editor-D0P361Xh.js +1 -0
  71. package/dist/client/assets/{asset-utils-D3olPYx7.js → asset-utils-PWPK46Eo.js} +1 -1
  72. package/dist/client/assets/{auth-CABZOlQ0.js → auth-CqmWT_2g.js} +1 -1
  73. package/dist/client/assets/{auth-catchall-qhf0Gqyx.js → auth-catchall-B3XbOymv.js} +1 -1
  74. package/dist/client/assets/{auth-entry-nJBLD0Y2.js → auth-entry-BPZIshWr.js} +1 -1
  75. package/dist/client/assets/{auth-split-layout-P-3F6VoK.js → auth-split-layout-BVZv5XKC.js} +1 -1
  76. package/dist/client/assets/{authenticate-and-persist-oauth-DBd5KhOF.js → authenticate-and-persist-oauth-B41Sx_s0.js} +1 -1
  77. package/dist/client/assets/{automation-list-row-B2m3VUdV.js → automation-list-row-BYt9sTMx.js} +1 -1
  78. package/dist/client/assets/{automation-runs-BGWmky8f.js → automation-runs-DIohB3g_.js} +1 -1
  79. package/dist/client/assets/{automations-C4fgolau.js → automations-BedV72qg.js} +1 -1
  80. package/dist/client/assets/{autosend-BkG_BHpj.js → autosend-CEQzRhvd.js} +1 -1
  81. package/dist/client/assets/{avatar-C70_Ki0z.js → avatar-BUy252-G.js} +1 -1
  82. package/dist/client/assets/{badge-D10nU5hm.js → badge-DejmcZm9.js} +1 -1
  83. package/dist/client/assets/{block-document-D3BljOLs.js → block-document-BgGQ2lXv.js} +1 -1
  84. package/dist/client/assets/{blocks-preview-workspace-context-DDuiEZgT.js → blocks-preview-workspace-context-CJ0cJXJ-.js} +1 -1
  85. package/dist/client/assets/{buckets-B2U9XBuC.js → buckets-ZSaS5z_u.js} +1 -1
  86. package/dist/client/assets/{build-improve-prompt-doc-Cjucl5Ml.js → build-improve-prompt-doc-BRKfF38j.js} +1 -1
  87. package/dist/client/assets/{calendar-BF7zRWf5.js → calendar-CLfWOBUX.js} +1 -1
  88. package/dist/client/assets/{capability-load-error-CI6r2eSt.js → capability-load-error-BJHb8XrA.js} +1 -1
  89. package/dist/client/assets/{category-editor-BPgoNKbj.js → category-editor-DWtggVgM.js} +1 -1
  90. package/dist/client/assets/{chart-BkrO3MsD.js → chart-HsGopGVn.js} +1 -1
  91. package/dist/client/assets/{chat-context-Crr9YCN0.js → chat-context-BaRraYAA.js} +1 -1
  92. package/dist/client/assets/{chat-draft-BkkmQZdS.js → chat-draft-CFEQOnWd.js} +1 -1
  93. package/dist/client/assets/{checkbox-CAXlLvHp.js → checkbox-CNknzL68.js} +1 -1
  94. package/dist/client/assets/{choose-editor-CXZPe8wI.js → choose-editor-DHUTwjGC.js} +1 -1
  95. package/dist/client/assets/{claim-phase-copy-DZ3Yirir.js → claim-phase-copy-D-H4AKq1.js} +1 -1
  96. package/dist/client/assets/{cli-auth-success-BVdFv3bm.js → cli-auth-success-DMCOlZVU.js} +1 -1
  97. package/dist/client/assets/{client-icons-DrzfFqzQ.js → client-icons-Dot2-8Ng.js} +1 -1
  98. package/dist/client/assets/{collapsible-CKOvtNeB.js → collapsible-COfnVvaq.js} +1 -1
  99. package/dist/client/assets/{collection-detail-DnoqLlcG.js → collection-detail-CvQy-FNQ.js} +1 -1
  100. package/dist/client/assets/{collection-display-button-bxkLloWp.js → collection-display-button-nS47msXw.js} +1 -1
  101. package/dist/client/assets/{collection-search-DZ1wZYuR.js → collection-search-QrA0qPpv.js} +1 -1
  102. package/dist/client/assets/{collection-table-wrapper-DjNNBLdq.js → collection-table-wrapper-D-FHJqcw.js} +1 -1
  103. package/dist/client/assets/{collection-tabs-Y0ynVKEj.js → collection-tabs-BTTf3Im8.js} +1 -1
  104. package/dist/client/assets/{column-rules-DQX2ptJC.js → column-rules-26AzKhwv.js} +1 -1
  105. package/dist/client/assets/{combobox-DfBcz1Tb.js → combobox-DJMmGAgM.js} +1 -1
  106. package/dist/client/assets/{command-BUcXz1jA.js → command-BeWosBD5.js} +1 -1
  107. package/dist/client/assets/{companion-mcps-section-DbjKMv-Y.js → companion-mcps-section-DquOXFwc.js} +1 -1
  108. package/dist/client/assets/{config-DaCobjNE.js → config-B_J6eren.js} +1 -1
  109. package/dist/client/assets/{connect-CPjoHilW.js → connect-BHDzXT3q.js} +1 -1
  110. package/dist/client/assets/{connect-layout-K_gPt_sp.js → connect-layout-B5DraPjV.js} +1 -1
  111. package/dist/client/assets/{connection-D4h25APd.js → connection-DLraZ45i.js} +1 -1
  112. package/dist/client/assets/{connection-card-XwOnt1f0.js → connection-card-ByBeHaTx.js} +1 -1
  113. package/dist/client/assets/{connection-detail-D4tkjBck.js → connection-detail-D5wElMjE.js} +1 -1
  114. package/dist/client/assets/{connection-form-helpers-MMq14fzZ.js → connection-form-helpers-B37qd_wK.js} +1 -1
  115. package/dist/client/assets/{connections-BzC5bqYg.js → connections-BGJZd1b3.js} +1 -1
  116. package/dist/client/assets/{context-0fIuzLTM.js → context-_owvmTJc.js} +1 -1
  117. package/dist/client/assets/{context-menu-Bl0G1UDO.js → context-menu-cIAF7GDl.js} +1 -1
  118. package/dist/client/assets/{create-organization-dialog-CFcjJ3cx.js → create-organization-dialog-DpSclRHW.js} +1 -1
  119. package/dist/client/assets/daily-pulse-BMbckFog.js +1 -0
  120. package/dist/client/assets/{decopilot-4kqD0JAa.js → decopilot-DvJjDwc1.js} +1 -1
  121. package/dist/client/assets/{device-hint-BcqeJvfC.js → device-hint-B1OpXsK3.js} +1 -1
  122. package/dist/client/assets/{dialog-C_zHR8DK.js → dialog-B30-8RI6.js} +1 -1
  123. package/dist/client/assets/{discover-Djz6Veha.js → discover-CvOdgoTH.js} +1 -1
  124. package/dist/client/assets/{domain-settings-CFO7Yfbv.js → domain-settings-DoLockR6.js} +1 -1
  125. package/dist/client/assets/{download-app-dialog-UTCmHANJ.js → download-app-dialog-BEeBKwQl.js} +1 -1
  126. package/dist/client/assets/{drawer-CeyU31cS.js → drawer-Dx_eDva4.js} +1 -1
  127. package/dist/client/assets/{editor-DEzZHfDd.js → editor-CLYxWXVn.js} +1 -1
  128. package/dist/client/assets/{empty-state-BrxgsLHG.js → empty-state-BtuSozdW.js} +1 -1
  129. package/dist/client/assets/{empty-state-2X05DwZp.js → empty-state-CyTqx1WF.js} +1 -1
  130. package/dist/client/assets/{extract-connection-data-DZSiJSCE.js → extract-connection-data-Ceomd2dy.js} +1 -1
  131. package/dist/client/assets/{feature-gate-BweFNKr3.js → feature-gate-ByQ_9Uyr.js} +1 -1
  132. package/dist/client/assets/{feature-paywall-DCy88YOr.js → feature-paywall-BpkcH4cr.js} +1 -1
  133. package/dist/client/assets/{file-explorer-E1QpuooZ.js → file-explorer-p49Fj9h5.js} +1 -1
  134. package/dist/client/assets/{file-preview-BFYm2Ebl.js → file-preview-oU4O4mYj.js} +1 -1
  135. package/dist/client/assets/{file-share-button-BNECzHpC.js → file-share-button-42_gXSxN.js} +1 -1
  136. package/dist/client/assets/{file-type-icon-D0M-S9U1.js → file-type-icon-DM7d4yre.js} +1 -1
  137. package/dist/client/assets/flat-project-D60fVc1Z.js +1 -0
  138. package/dist/client/assets/{folder-icon-CSGYfuW8.js → folder-icon-Bw0HK4N5.js} +1 -1
  139. package/dist/client/assets/{form-BGxoVGvb.js → form-HEFwQ86k.js} +1 -1
  140. package/dist/client/assets/{gateway-client-DqqeM3yS.js → gateway-client-DMn6uSTc.js} +1 -1
  141. package/dist/client/assets/{general--Lx4oqfC.js → general--mkEOaC6.js} +1 -1
  142. package/dist/client/assets/home-Dx0u1fAR.js +1 -0
  143. package/dist/client/assets/{icon-button-BAAffUhi.js → icon-button-C6LsyxKS.js} +1 -1
  144. package/dist/client/assets/{index-CpFVLV3H.js → index-B8iNur1H.js} +1 -1
  145. package/dist/client/assets/{index-D-s3ZvIF.js → index-BCW6nCJr.js} +1 -1
  146. package/dist/client/assets/{index-Dn333xYc.js → index-Bi-7WlGx.js} +1 -1
  147. package/dist/client/assets/{index-BxML1xBj.js → index-BuKCAq02.js} +1 -1
  148. package/dist/client/assets/{index-GgUtI-aH.js → index-C4Vjmkff.js} +1 -1
  149. package/dist/client/assets/{index-CpuEtEqc.js → index-CYKZD4gc.js} +3 -3
  150. package/dist/client/assets/{index-B_Hj8ygS.js → index-D8B9h6s-.js} +1 -1
  151. package/dist/client/assets/{index-Djpcf0g3.js → index-D9Dp_srJ.js} +1 -1
  152. package/dist/client/assets/{index-Dyzblr5g.js → index-D9o-WuiI.js} +1 -1
  153. package/dist/client/assets/{index-D3VyLkC3.js → index-DAhfV5vh.js} +6 -6
  154. package/dist/client/assets/{index-BVzkdynM.js → index-DUchVaNj.js} +1 -1
  155. package/dist/client/assets/{index-szJAEvQa.js → index-DfRZ3eV-.js} +1 -1
  156. package/dist/client/assets/index-DoNIk522.css +1 -0
  157. package/dist/client/assets/{index-DXhMSpJ7.js → index-IqSVG5fY.js} +1 -1
  158. package/dist/client/assets/{index-CcuAAQfR.js → index-Laz3och2.js} +1 -1
  159. package/dist/client/assets/{index-CJflvpaj.js → index-rIGGQh0Z.js} +1 -1
  160. package/dist/client/assets/{index-redirect-C1AnjHYu.js → index-redirect-9lk3Mcpc.js} +1 -1
  161. package/dist/client/assets/{infiniteQueryObserver-rGQ-BvZd.js → infiniteQueryObserver-BlKY7V_o.js} +1 -1
  162. package/dist/client/assets/{infra-billing-a2nqEasz.js → infra-billing-ClXW240-.js} +1 -1
  163. package/dist/client/assets/{input-CQAdPV6U.js → input-C1SzE0r0.js} +1 -1
  164. package/dist/client/assets/{input-DJjbA9M9.js → input-Cxi1fFAz.js} +3 -3
  165. package/dist/client/assets/{input-B-l5PYzO.js → input-Uk8z-Ktf.js} +1 -1
  166. package/dist/client/assets/{integration-icon-Bo3BUxvM.js → integration-icon-DTJ53jik.js} +1 -1
  167. package/dist/client/assets/{label-UBdu3ctU.js → label-CsA5aIjl.js} +1 -1
  168. package/dist/client/assets/{layout-BtmKdLdk.js → layout-0SkVikTT.js} +1 -1
  169. package/dist/client/assets/{legacy-agents-deep-YQnPtFe_.js → legacy-agents-deep-o2zNRJBD.js} +1 -1
  170. package/dist/client/assets/{legacy-main-redirect-CAZhbTVo.js → legacy-main-redirect-D1DUV9jt.js} +1 -1
  171. package/dist/client/assets/library-BP7VdqPu.js +1 -0
  172. package/dist/client/assets/{library-tab-Cw6l7YjS.js → library-tab-yb3t70cm.js} +1 -1
  173. package/dist/client/assets/{login-RaQgedvb.js → login-BCvV20QX.js} +1 -1
  174. package/dist/client/assets/{markdown-DgNX2G8Y.js → markdown-DA7Pnev1.js} +1 -1
  175. package/dist/client/assets/{mcp-app-renderer-Gi8nuIVZ.js → mcp-app-renderer-CL-fBp7u.js} +1 -1
  176. package/dist/client/assets/{mcp-oauth-ax5kWWJK.js → mcp-oauth-Ig94NzNJ.js} +1 -1
  177. package/dist/client/assets/{members-C_--iBrh.js → members-BVCs6BGJ.js} +1 -1
  178. package/dist/client/assets/{memory-wojZsd5w.js → memory-wRkeFRMb.js} +1 -1
  179. package/dist/client/assets/{message-templates-DbJIQtFs.js → message-templates-DAHFL7pm.js} +1 -1
  180. package/dist/client/assets/{mini-report-page-U0-aZ9Hl.js → mini-report-page-Bsz_Vl_A.js} +1 -1
  181. package/dist/client/assets/{mock-board-YpCRnBGe.js → mock-board-DfLUI4qA.js} +1 -1
  182. package/dist/client/assets/{monaco-editor-Cs1rDRDm.js → monaco-editor-v37lBX9D.js} +1 -1
  183. package/dist/client/assets/{monitoring-stats-row-CcTNMb-i.js → monitoring-stats-row-BvGkbm2U.js} +1 -1
  184. package/dist/client/assets/{multi-select-CWb2Oi6x.js → multi-select-Bwn4u1SH.js} +1 -1
  185. package/dist/client/assets/{mustache-CWsYDxkA.js → mustache-WARBPpMc.js} +1 -1
  186. package/dist/client/assets/{new-project-dialog-BWolKWvl.js → new-project-dialog-CD-S7Uy7.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-Ld01h9Tj.js → oauth-callback-KD8ycZ5S.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-ai-provider-BGdom6cI.js → oauth-callback-ai-provider-QZ1DUytq.js} +1 -1
  189. package/dist/client/assets/{onboarding-D_NwiA9X.js → onboarding-C6fAcgnI.js} +1 -1
  190. package/dist/client/assets/{openai-conversation-DB4k1EYC.js → openai-conversation-DpaYihIr.js} +1 -1
  191. package/dist/client/assets/{optimistic-project-sidebar-views-DhsliVvJ.js → optimistic-project-sidebar-views-BYi3SXbd.js} +1 -1
  192. package/dist/client/assets/{org-file-open-context-kIKkchjb.js → org-file-open-context-BFenNlZj.js} +1 -1
  193. package/dist/client/assets/{organization-choice-DGTPCWDh.js → organization-choice-BPRjWGDV.js} +1 -1
  194. package/dist/client/assets/{orgs-C5MsSx08.js → orgs-BBxAiigC.js} +1 -1
  195. package/dist/client/assets/{page-seo-form-CW2BoQ-K.js → page-seo-form-D-Y4ByH_.js} +1 -1
  196. package/dist/client/assets/{pair-qre124N2.js → pair-DyoXAxM8.js} +1 -1
  197. package/dist/client/assets/{plan-ladder-B1XIg6KA.js → plan-ladder-DDzYift2.js} +1 -1
  198. package/dist/client/assets/{popover-DmsBpt35.js → popover-VHHbgkVg.js} +1 -1
  199. package/dist/client/assets/{post-calendar-DOVsx0im.js → post-calendar-BzC1oMA5.js} +1 -1
  200. package/dist/client/assets/{post-editor-D82mbe-R.js → post-editor-yqrrgVyd.js} +1 -1
  201. package/dist/client/assets/{preview-content-CPFw8Bau.js → preview-content-m5N-x4SX.js} +1 -1
  202. package/dist/client/assets/{preview-dialog-UaHza9Kp.js → preview-dialog-YD1mDcgr.js} +1 -1
  203. package/dist/client/assets/{profile-CMD3mJV4.js → profile-Eok7UgYx.js} +1 -1
  204. package/dist/client/assets/{project-app-view-3CpE9pa5.js → project-app-view-KKbO6aIR.js} +1 -1
  205. package/dist/client/assets/{project-feed-C4PTy6zU.js → project-feed-DUhzdphC.js} +1 -1
  206. package/dist/client/assets/{project-icon-BlCsNLWV.js → project-icon-rqB8fgDE.js} +1 -1
  207. package/dist/client/assets/project-reports-RQE1LLFO.js +1 -0
  208. package/dist/client/assets/project-tasks-CuvuY6F8.js +1 -0
  209. package/dist/client/assets/{projects-DnKzaVrl.js → projects-BPCyrkzG.js} +1 -1
  210. package/dist/client/assets/{projects-empty-state-Sx3HMMRD.js → projects-empty-state-Dg9KTZEd.js} +1 -1
  211. package/dist/client/assets/{prompts-iLYOGVAY.js → prompts-BW6rt8iD.js} +1 -1
  212. package/dist/client/assets/record-editor-CGGiShp3.js +1 -0
  213. package/dist/client/assets/{redirect-editor-D_mpcVqR.js → redirect-editor-B4oNhGb_.js} +1 -1
  214. package/dist/client/assets/reports-BadwKRdX.js +1 -0
  215. package/dist/client/assets/{reports-CnA1uxk8.js → reports-RlJWeR7R.js} +1 -1
  216. package/dist/client/assets/{reports-onboarding-Wd1uDWK4.js → reports-onboarding-DG0-FS10.js} +1 -1
  217. package/dist/client/assets/{reports-tab-586SqbUE.js → reports-tab-BY1reunF.js} +2 -2
  218. package/dist/client/assets/{repositories-DjuvrwKG.js → repositories-jwsNIE6M.js} +1 -1
  219. package/dist/client/assets/{repository-binding-qP9N-2MJ.js → repository-binding-BjQg44s0.js} +1 -1
  220. package/dist/client/assets/{repository-import-picker-BxSMVAOp.js → repository-import-picker-ZyzYgBKd.js} +1 -1
  221. package/dist/client/assets/{repository-picker-DXcVdbPo.js → repository-picker-zKlkxI7H.js} +1 -1
  222. package/dist/client/assets/{require-capability-Btgp_M9F.js → require-capability-BqUwjQSq.js} +1 -1
  223. package/dist/client/assets/{required-auth-layout-BXGj5Xuz.js → required-auth-layout-Ci_VyqXV.js} +1 -1
  224. package/dist/client/assets/{reset-password-DNvbhWv1.js → reset-password-s1hi7DCq.js} +1 -1
  225. package/dist/client/assets/{resizable-p0Iz3mjy.js → resizable-ByFftuKZ.js} +1 -1
  226. package/dist/client/assets/{resolve-tab-icon-BRRLdzHa.js → resolve-tab-icon-C76owMiT.js} +1 -1
  227. package/dist/client/assets/{review-settings-DL4Naz6f.js → review-settings-9KPdssy5.js} +1 -1
  228. package/dist/client/assets/{rich-text-link-control-BAQED-eE.js → rich-text-link-control-Cxt5hePr.js} +1 -1
  229. package/dist/client/assets/{roles-BKGa4A-8.js → roles-D15bYv4O.js} +1 -1
  230. package/dist/client/assets/{route-DzBhuQmI.js → route-CtEWmlke.js} +1 -1
  231. package/dist/client/assets/route-frKExtKv.js +1 -0
  232. package/dist/client/assets/route-gl8RhBbx.js +1 -0
  233. package/dist/client/assets/{runnable-block-editor-PtJtt2DC.js → runnable-block-editor-qWArPPH0.js} +1 -1
  234. package/dist/client/assets/{sandbox-lifecycle-context-BrfabpuG.js → sandbox-lifecycle-context-CwjnToEe.js} +1 -1
  235. package/dist/client/assets/{schema-BWuVZGwp.js → schema-DVBa_MAN.js} +1 -1
  236. package/dist/client/assets/{scroll-area-m_BjZQNd.js → scroll-area-DRHarC_1.js} +1 -1
  237. package/dist/client/assets/{search-input-B9M1xiUR.js → search-input-CHV8xc4e.js} +1 -1
  238. package/dist/client/assets/{search-toggle-s-q01VSg.js → search-toggle-C48Q5Dw4.js} +1 -1
  239. package/dist/client/assets/{secret-picker-BTuH8aWz.js → secret-picker-BYFIGBnL.js} +1 -1
  240. package/dist/client/assets/{secrets-1V4jZN7g.js → secrets-D81SC9ri.js} +1 -1
  241. package/dist/client/assets/{sections-editor-DX4ixTgg.js → sections-editor-DPbRocOh.js} +1 -1
  242. package/dist/client/assets/{select-DC4TM20D.js → select-Cfp-vpJN.js} +1 -1
  243. package/dist/client/assets/{select-model-BWaa2-GY.js → select-model-Iau9tAbT.js} +1 -1
  244. package/dist/client/assets/{seo-editor-Bd3OOjX4.js → seo-editor-DuOP0tU_.js} +1 -1
  245. package/dist/client/assets/{separator-BEoe11dP.js → separator-4K_GV67Z.js} +1 -1
  246. package/dist/client/assets/{settings-tab-73EvDId-.js → settings-tab--CXf6ivv.js} +1 -1
  247. package/dist/client/assets/{sheet-gL2l7oL0.js → sheet-BA1BhLlr.js} +1 -1
  248. package/dist/client/assets/{shell-layout-CBc-iFqB.js → shell-layout-Cns9lUi4.js} +1 -1
  249. package/dist/client/assets/{skills-CELE5LtE.js → skills-Cg-DT6iV.js} +1 -1
  250. package/dist/client/assets/{sso-CxZR0IHJ.js → sso-CUdr-7CQ.js} +1 -1
  251. package/dist/client/assets/{suggestion-Ules5agL.js → suggestion-BlpEbXkf.js} +1 -1
  252. package/dist/client/assets/{switch-CL5hy8vw.js → switch-CQPn6TRL.js} +1 -1
  253. package/dist/client/assets/{synced-repos-BHKre5im.js → synced-repos-Dwj-iZL5.js} +1 -1
  254. package/dist/client/assets/{tab-icon-glyph-DR0rQ-bV.js → tab-icon-glyph-COOZpimV.js} +1 -1
  255. package/dist/client/assets/{table-WwEBhzp_.js → table-BaXr9rnW.js} +1 -1
  256. package/dist/client/assets/{tabs-WFH6vPjH.js → tabs-boN14fnC.js} +1 -1
  257. package/dist/client/assets/{task-board-CVGH6XO_.js → task-board-CfiWV1iu.js} +1 -1
  258. package/dist/client/assets/{task-route-D36p4AYB.js → task-route-ZyJZvQEP.js} +1 -1
  259. package/dist/client/assets/{task-status-CLw5rySP.js → task-status-CZe8FdJE.js} +1 -1
  260. package/dist/client/assets/{taskboard-analytics-DjMTJmAz.js → taskboard-analytics-CU05ehRX.js} +1 -1
  261. package/dist/client/assets/{tasks-CNLTzE3N.js → tasks-DpliXkxN.js} +1 -1
  262. package/dist/client/assets/tasks-Dqb81gsh.js +1 -0
  263. package/dist/client/assets/{textarea-CoQK2oyP.js → textarea-re22-64Y.js} +1 -1
  264. package/dist/client/assets/{thread-analytics-Dyt69XfV.js → thread-analytics-BBXLC8Mt.js} +1 -1
  265. package/dist/client/assets/thread-button-D-bmXoX1.js +1 -0
  266. package/dist/client/assets/{thread-intent-CXrPEeI-.js → thread-intent-DjddwZgX.js} +1 -1
  267. package/dist/client/assets/{thread-route-DKA9bRvS.js → thread-route-58igbRqf.js} +1 -1
  268. package/dist/client/assets/{thread-route-CPId0Ds_.js → thread-route-DXu3auHO.js} +1 -1
  269. package/dist/client/assets/{thread-sheet-body-DbO-EyYS.js → thread-sheet-body-D44ITTQU.js} +1 -1
  270. package/dist/client/assets/{toggle-group-CHfaqw3y.js → toggle-group-C96sHBVW.js} +1 -1
  271. package/dist/client/assets/{toolbar-icon-button-CJrzg1xS.js → toolbar-icon-button-BwLSK1SV.js} +1 -1
  272. package/dist/client/assets/{tooltip-BUwCxmad.js → tooltip-cYDDz2Pp.js} +1 -1
  273. package/dist/client/assets/{track-QsSY_R6p.js → track-DRQxhxbu.js} +1 -1
  274. package/dist/client/assets/{types-BM02pFks.js → types-DIHxpGG3.js} +1 -1
  275. package/dist/client/assets/{usage-stats-BZmwl_hY.js → usage-stats-BToxR0wR.js} +1 -1
  276. package/dist/client/assets/{use-ai-providers-OUZLuzjk.js → use-ai-providers-BaF1iqq_.js} +1 -1
  277. package/dist/client/assets/{use-automations-kRvu1WBi.js → use-automations-CRmgA2ID.js} +1 -1
  278. package/dist/client/assets/{use-autosave-BknRtqMo.js → use-autosave-CXF6_aFn.js} +1 -1
  279. package/dist/client/assets/{use-chat-layout-state-PWimkJCw.js → use-chat-layout-state-Cc2VHc6I.js} +1 -1
  280. package/dist/client/assets/{use-clock-tick-DK1jMfPk.js → use-clock-tick-ChrO8Wr8.js} +1 -1
  281. package/dist/client/assets/{use-connect-companion-BE7rc0a7.js → use-connect-companion-CR1Xr13y.js} +1 -1
  282. package/dist/client/assets/{use-connection-CDTsUGCD.js → use-connection-DfxY3Owk.js} +1 -1
  283. package/dist/client/assets/{use-copy-4XQ35auE.js → use-copy-BBTjUiXD.js} +1 -1
  284. package/dist/client/assets/use-create-virtual-mcp-eOn9ybNU.js +1 -0
  285. package/dist/client/assets/{use-date-fns-locale-DSD5AxHp.js → use-date-fns-locale-dUrJdjgT.js} +1 -1
  286. package/dist/client/assets/{use-debounced-autosave-BmsH_WeG.js → use-debounced-autosave-DomrC7JG.js} +1 -1
  287. package/dist/client/assets/{use-debounced-value-Ddzynl8d.js → use-debounced-value-DyppKzdq.js} +1 -1
  288. package/dist/client/assets/{use-deco-credits-BWRF6eDW.js → use-deco-credits-CFjGcaIq.js} +1 -1
  289. package/dist/client/assets/{use-decopilot-events-Coi59geF.js → use-decopilot-events-7cMuGUn_.js} +1 -1
  290. package/dist/client/assets/{use-delete-connection-BAe608Tj.js → use-delete-connection-QY7PVH-8.js} +1 -1
  291. package/dist/client/assets/{use-deployment-admin-C9A5ryiv.js → use-deployment-admin-BmAVlBQk.js} +1 -1
  292. package/dist/client/assets/{use-fast-preview-draft-url-D95FFIvg.js → use-fast-preview-draft-url-CAtuvvrG.js} +1 -1
  293. package/dist/client/assets/{use-file-configs-FESoyyAp.js → use-file-configs-CLIgCo9H.js} +1 -1
  294. package/dist/client/assets/{use-infinite-scroll-BOW8hicV.js → use-infinite-scroll-BBNiZIZb.js} +1 -1
  295. package/dist/client/assets/{use-join-requests-DtLE0NgC.js → use-join-requests-BPZN_x_r.js} +1 -1
  296. package/dist/client/assets/{use-main-panel-tabs-Bc5UEnVE.js → use-main-panel-tabs-BmwpMk5o.js} +1 -1
  297. package/dist/client/assets/{use-mcp-auth-status-DrjGrcBP.js → use-mcp-auth-status-BnOryspq.js} +1 -1
  298. package/dist/client/assets/{use-mcp-client-DjhhnAr3.js → use-mcp-client-D2VYpHPF.js} +1 -1
  299. package/dist/client/assets/{use-mcp-prompts-CPGSJM8z.js → use-mcp-prompts-DtbMED93.js} +1 -1
  300. package/dist/client/assets/{use-mcp-tools-CPwk0yw5.js → use-mcp-tools-BicoFNZe.js} +1 -1
  301. package/dist/client/assets/{use-members-CgpU7zdW.js → use-members-BuEaDeJm.js} +1 -1
  302. package/dist/client/assets/{use-mobile-Dd6KUtd1.js → use-mobile-UCEvtXfH.js} +1 -1
  303. package/dist/client/assets/{use-navigate-to-agent-Bbk9KV3t.js → use-navigate-to-agent-BZlsExbp.js} +1 -1
  304. package/dist/client/assets/use-new-blocks-editor-DSBgh7mx.js +1 -0
  305. package/dist/client/assets/{use-open-billing-url-C5p05V2D.js → use-open-billing-url-SUgaj5hP.js} +1 -1
  306. package/dist/client/assets/{use-org-auth-client-CGnd_KU_.js → use-org-auth-client-CY1uAtqK.js} +1 -1
  307. package/dist/client/assets/{use-org-fs-Cif2PgGI.js → use-org-fs-DUuc6Zxc.js} +1 -1
  308. package/dist/client/assets/{use-org-repo-syncs-Cf0jwZet.js → use-org-repo-syncs-W7zCKeFI.js} +1 -1
  309. package/dist/client/assets/{use-org-sso-DnQOloxF.js → use-org-sso-BxhvCAY_.js} +1 -1
  310. package/dist/client/assets/{use-organization-roles-BarJOEKw.js → use-organization-roles-B7z-gMaH.js} +1 -1
  311. package/dist/client/assets/{use-organization-settings-DSuZT_-Z.js → use-organization-settings-B4tP4hFm.js} +1 -1
  312. package/dist/client/assets/{use-panel-navigate-pf_bvwna.js → use-panel-navigate--QzQC3VZ.js} +1 -1
  313. package/dist/client/assets/{use-project-scope-B9gl4G0G.js → use-project-scope-BBHuYyAU.js} +1 -1
  314. package/dist/client/assets/{use-releases-Cqzas87I.js → use-releases-CFy4ROz7.js} +1 -1
  315. package/dist/client/assets/{use-reports-diagnostic-C9WXsFaU.js → use-reports-diagnostic-DAw3nLO7.js} +1 -1
  316. package/dist/client/assets/{use-secrets-DWoy_Ekl.js → use-secrets-BX9baefu.js} +1 -1
  317. package/dist/client/assets/{use-section-preview-base-B4B91XeI.js → use-section-preview-base-DiMdIa4C.js} +1 -1
  318. package/dist/client/assets/{use-session-runtime-BtoYTkvM.js → use-session-runtime-DFN8v9Uu.js} +1 -1
  319. package/dist/client/assets/{use-tags-oDh30HSX.js → use-tags-BtzhaZAL.js} +1 -1
  320. package/dist/client/assets/{use-task-board-analytics-B-_ejdir.js → use-task-board-analytics-DlTRreOu.js} +1 -1
  321. package/dist/client/assets/{use-task-board-events-D5YUKNR3.js → use-task-board-events-CkFoY4mj.js} +1 -1
  322. package/dist/client/assets/{use-task-metadata-EBJAZAt5.js → use-task-metadata-CVwRScr5.js} +1 -1
  323. package/dist/client/assets/{use-thread-analytics-23H9Sh0m.js → use-thread-analytics-BUhgXjvp.js} +1 -1
  324. package/dist/client/assets/{use-thread-outputs-CzHRXoWD.js → use-thread-outputs-DOsnMhNz.js} +1 -1
  325. package/dist/client/assets/useInfiniteQuery-BpXl9N7J.js +1 -0
  326. package/dist/client/assets/{useQueries-OOmL0OlS.js → useQueries-BRIObTwd.js} +1 -1
  327. package/dist/client/assets/useSuspenseInfiniteQuery-Dc8cFcZ0.js +1 -0
  328. package/dist/client/assets/{users-CSGmi7SW.js → users-BnkfBaAF.js} +1 -1
  329. package/dist/client/assets/{utils-R-urxMSv.js → utils-DpuKt6Cb.js} +1 -1
  330. package/dist/client/assets/{variant-calendar-V9WH2c0X.js → variant-calendar-BRsSo7Ye.js} +1 -1
  331. package/dist/client/assets/{variant-matcher-override-Be69fnd9.js → variant-matcher-override-C6K9_6nf.js} +1 -1
  332. package/dist/client/assets/{view-mode-toggle-hxQ2HfnS.js → view-mode-toggle-B8earrSa.js} +1 -1
  333. package/dist/client/assets/{virtual-mcp-B4NgbGmF.js → virtual-mcp-BMmjcaCV.js} +1 -1
  334. package/dist/client/index.html +2 -2
  335. package/dist/server/cli.js +1 -1
  336. package/dist/server/server.js +1 -1
  337. package/package.json +1 -1
  338. package/dist/client/assets/agent-app-CdSOzSAf.js +0 -1
  339. package/dist/client/assets/agent-deck-CepgSTaG.js +0 -1
  340. package/dist/client/assets/agent-library-DszZ1exI.js +0 -1
  341. package/dist/client/assets/agent-library-file-B9vfOl4A.js +0 -1
  342. package/dist/client/assets/agent-settings-Cui7mNtr.js +0 -1
  343. package/dist/client/assets/agent-site-editor-code-Y8Sm7eAb.js +0 -2
  344. package/dist/client/assets/agent-view-BOncsgwo.js +0 -1
  345. package/dist/client/assets/api-keys-DQSpTJNt.js +0 -1
  346. package/dist/client/assets/app-editor-BS446zS8.js +0 -1
  347. package/dist/client/assets/daily-pulse-Dus-woVV.js +0 -1
  348. package/dist/client/assets/flat-project-Y-2R_KpZ.js +0 -1
  349. package/dist/client/assets/home-DyM_cAvs.js +0 -1
  350. package/dist/client/assets/index-6WjGaIcE.css +0 -1
  351. package/dist/client/assets/library-CX4cu6RN.js +0 -1
  352. package/dist/client/assets/project-reports-C7tLohpM.js +0 -1
  353. package/dist/client/assets/project-tasks-mAIHHtBX.js +0 -1
  354. package/dist/client/assets/record-editor-oL03Wyei.js +0 -1
  355. package/dist/client/assets/reports-DPqSriQT.js +0 -1
  356. package/dist/client/assets/route-DRz2-z88.js +0 -1
  357. package/dist/client/assets/route-uDEu1bUn.js +0 -1
  358. package/dist/client/assets/tasks-C-PeRfKF.js +0 -1
  359. package/dist/client/assets/thread-button-CXr1OWYY.js +0 -1
  360. package/dist/client/assets/use-create-virtual-mcp-Cr7lRENh.js +0 -1
  361. package/dist/client/assets/use-new-blocks-editor-DdfQbotf.js +0 -1
  362. package/dist/client/assets/useInfiniteQuery-BzCTPJtn.js +0 -1
  363. package/dist/client/assets/useSuspenseInfiniteQuery-Cx1jk_4I.js +0 -1
@@ -1 +1 @@
1
- import{b as $,X as ie,o as re,at as le,as as ce,e as ne,q as W,t as q,K as J,j as i,ec as se,ed as oe,ee as U,aU as ge,au as de,av as ee,c as Y,r as X,a2 as me,V as te,bQ as ue,bR as fe,y as pe,B as xe,ad as he,n as Q,fn as je,aM as ze}from"./index-D3VyLkC3.js";import{u as Se}from"./use-org-auth-client-CGnd_KU_.js";import{u as ve}from"./use-debounced-autosave-BmsH_WeG.js";import{A as be}from"./avatar-C70_Ki0z.js";import{I as ae}from"./input-B-l5PYzO.js";import{C as Oe,V as ye,B as Ce}from"./review-settings-DL4Naz6f.js";import{D as _e}from"./domain-settings-CFO7Yfbv.js";import{A as Fe,a as Ae,b as De,c as we,g as Ne,d as Te,e as Ee,f as Le}from"./alert-dialog-BaW-BGF4.js";import{C as Pe}from"./capability-load-error-CI6r2eSt.js";import"./User01-DlDKGoyi.js";import"./switch-CL5hy8vw.js";import"./UserSquare-Cij4gM7j.js";import"./use-organization-settings-DSuZT_-Z.js";import"./schema-BWuVZGwp.js";import"./task-board-CVGH6XO_.js";import"./use-new-blocks-editor-DdfQbotf.js";import"./use-connection-CDTsUGCD.js";import"./use-mcp-client-DjhhnAr3.js";import"./auth-CABZOlQ0.js";import"./badge-D10nU5hm.js";import"./select-DC4TM20D.js";import"./index-DXhMSpJ7.js";import"./Check-BwZg9K6a.js";import"./ChevronUp-XuQjQLoK.js";const ke=e=>de({name:ee().min(1,e("settings.organizationForm.nameRequired")).max(255,e("settings.organizationForm.nameTooLong")),logo:ee().optional()});function Re(e){const t=Y.c(17),{value:s,onChange:p,name:g,disabled:l}=e,c=$(),d=X.useRef(null);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>d.current?.click(),t[0]=r):r=t[0];const m=r;let n;t[1]!==p||t[2]!==c?(n=Z=>{const z=Z.target.files?.[0];if(!z)return;if(z.size>2097152){q.error(c("settings.organizationForm.imageTooLarge"));return}const x=new FileReader;x.onerror=()=>q.error(c("settings.organizationForm.failedToReadImage")),x.onloadend=()=>{x.result&&p(x.result),d.current&&(d.current.value="")},x.readAsDataURL(z)},t[1]=p,t[2]=c,t[3]=n):n=t[3];const o=n;let a;t[4]!==c?(a=c("settings.organizationForm.uploadLogoLabel"),t[4]=c,t[5]=a):a=t[5];let u;t[6]!==l||t[7]!==o?(u=i.jsx("input",{ref:d,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:l}),t[6]=l,t[7]=o,t[8]=u):u=t[8];const h=s||void 0,j=g??"?";let f;t[9]!==h||t[10]!==j?(f=i.jsx(be,{url:h,fallback:j,shape:"square",size:"base"}),t[9]=h,t[10]=j,t[11]=f):f=t[11];let S;return t[12]!==l||t[13]!==a||t[14]!==u||t[15]!==f?(S=i.jsxs("button",{type:"button",onClick:m,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":a,children:[u,f]}),t[12]=l,t[13]=a,t[14]=u,t[15]=f,t[16]=S):S=t[16],S}function Ie(){const e=$(),{org:t}=ie(),s=Se(),p=re(),g=le({resolver:ce(ke(e)),values:{name:t.name??"",logo:t.logo??""}}),l=ne({mutationFn:async n=>{const o={name:n.name};n.logo&&(o.logo=n.logo);const a=await s.organization.update({data:o});if(a?.error)throw new Error(a.error.message||e("settings.organizationForm.failedToUpdateOrg"));return a},onSuccess:(n,o)=>{W("organization_settings_updated",{organization_id:t.id,fields:Object.keys(o)}),p.invalidateQueries({queryKey:J.organizations()}),p.invalidateQueries({queryKey:J.activeOrganization(t.slug)}),q.success(e("settings.organizationForm.updateSuccess"))},onError:(n,o)=>{W("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(o),error:n instanceof Error?n.message:String(n)}),q.error(n instanceof Error?n.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:c,flush:d}=ve({save:async()=>{const n=g.control._formState.dirtyFields;if(Object.keys(n).length===0||!await g.trigger())return;const a=g.getValues(),u=g.control._defaultValues;g.reset(a,{keepValues:!0});try{await l.mutateAsync(a)}catch{g.reset(u,{keepValues:!0})}}}),r=g.formState.errors,m=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(se,{children:i.jsxs(oe,{children:[i.jsx(U,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(Re,{value:g.watch("logo"),onChange:n=>{g.setValue("logo",n??"",{shouldDirty:!0}),d()},name:g.watch("name")})}),i.jsx(U,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(ge,{control:g.control,name:"name",render:({field:n})=>i.jsx(ae,{id:"org-name",...n,onChange:o=>{n.onChange(o),c()},onBlur:()=>{n.onBlur(),d()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(U,{title:e("settings.organizationForm.urlTitle"),description:e("settings.organizationForm.urlDescription"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-muted/40 overflow-hidden",children:[m&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:m}),i.jsx("span",{className:"flex-1 min-w-0 px-2 py-1.5 text-sm text-foreground truncate",children:t.slug})]})}),(r.name||r.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&i.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.logo&&i.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function Ve(){const e=Y.c(86),t=$(),{org:s}=ie(),[p,g]=X.useState(!1),[l,c]=X.useState(""),d=me();let r;e[0]!==s.id||e[1]!==d?(r=async()=>{await d.call("ORGANIZATION_DELETE",{id:s.id})},e[0]=s.id,e[1]=d,e[2]=r):r=e[2];let m;e[3]!==s.id||e[4]!==s.slug||e[5]!==t?(m=()=>{W("organization_deleted",{organization_id:s.id}),localStorage.getItem(te.lastOrgSlug())===s.slug&&localStorage.removeItem(te.lastOrgSlug()),ue()?.org===s.slug&&fe(),pe(),q.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=s.id,e[4]=s.slug,e[5]=t,e[6]=m):m=e[6];let n;e[7]!==t?(n=v=>{q.error(v instanceof Error?v.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=n):n=e[8];let o;e[9]!==r||e[10]!==m||e[11]!==n?(o={mutationFn:r,onSuccess:m,onError:n},e[9]=r,e[10]=m,e[11]=n,e[12]=o):o=e[12];const a=ne(o);let u;e[13]!==t?(u=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=u):u=e[14];let h;e[15]!==t?(h=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=h):h=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=j):j=e[18];let f;e[19]!==t?(f=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=f):f=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=()=>g(!0),e[21]=S):S=e[21];const Z=a.isPending;let z;e[22]!==t?(z=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=z):z=e[23];let x;e[24]!==a.isPending||e[25]!==z?(x=i.jsx(xe,{variant:"destructive",size:"sm",onClick:S,disabled:Z,children:z}),e[24]=a.isPending,e[25]=z,e[26]=x):x=e[26];let b;e[27]!==x||e[28]!==j||e[29]!==f?(b=i.jsx(oe,{className:"border-destructive/40",children:i.jsx(U,{title:j,description:f,action:x})}),e[27]=x,e[28]=j,e[29]=f,e[30]=b):b=e[30];let O;e[31]!==b||e[32]!==u||e[33]!==h?(O=i.jsx(se,{title:u,description:h,children:b}),e[31]=b,e[32]=u,e[33]=h,e[34]=O):O=e[34];let G;e[35]===Symbol.for("react.memo_cache_sentinel")?(G=v=>{g(v),v||c("")},e[35]=G):G=e[35];let y;e[36]!==t?(y=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=y):y=e[37];let C;e[38]!==y?(C=i.jsx(Fe,{children:y}),e[38]=y,e[39]=C):C=e[39];let _;e[40]!==s.name||e[41]!==t?(_=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:s.name}),e[40]=s.name,e[41]=t,e[42]=_):_=e[42];let F;e[43]!==_?(F=i.jsx("p",{children:_}),e[43]=_,e[44]=F):F=e[44];let A;e[45]!==s.name||e[46]!==t?(A=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:s.name}),e[45]=s.name,e[46]=t,e[47]=A):A=e[47];let D;e[48]!==A?(D=i.jsx("p",{className:"mt-3 mb-1.5",children:A}),e[48]=A,e[49]=D):D=e[49];let K;e[50]===Symbol.for("react.memo_cache_sentinel")?(K=v=>c(v.target.value),e[50]=K):K=e[50];let w;e[51]!==l||e[52]!==s.name?(w=i.jsx(ae,{value:l,onChange:K,placeholder:s.name,autoFocus:!0}),e[51]=l,e[52]=s.name,e[53]=w):w=e[53];let N;e[54]!==F||e[55]!==D||e[56]!==w?(N=i.jsx(Ae,{asChild:!0,children:i.jsxs("div",{children:[F,D,w]})}),e[54]=F,e[55]=D,e[56]=w,e[57]=N):N=e[57];let T;e[58]!==C||e[59]!==N?(T=i.jsxs(De,{children:[C,N]}),e[58]=C,e[59]=N,e[60]=T):T=e[60];let E;e[61]!==t?(E=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=E):E=e[62];let L;e[63]!==E?(L=i.jsx(we,{children:E}),e[63]=E,e[64]=L):L=e[64];let P;e[65]!==a?(P=()=>a.mutate(),e[65]=a,e[66]=P):P=e[66];const H=l!==s.name||a.isPending;let k;e[67]!==a.isPending||e[68]!==t?(k=a.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=a.isPending,e[68]=t,e[69]=k):k=e[69];let R;e[70]!==P||e[71]!==H||e[72]!==k?(R=i.jsx(Ne,{onClick:P,disabled:H,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:k}),e[70]=P,e[71]=H,e[72]=k,e[73]=R):R=e[73];let I;e[74]!==L||e[75]!==R?(I=i.jsxs(Te,{children:[L,R]}),e[74]=L,e[75]=R,e[76]=I):I=e[76];let V;e[77]!==T||e[78]!==I?(V=i.jsxs(Ee,{children:[T,I]}),e[77]=T,e[78]=I,e[79]=V):V=e[79];let B;e[80]!==p||e[81]!==V?(B=i.jsx(Le,{open:p,onOpenChange:G,children:V}),e[80]=p,e[81]=V,e[82]=B):B=e[82];let M;return e[83]!==O||e[84]!==B?(M=i.jsxs(i.Fragment,{children:[O,B]}),e[83]=O,e[84]=B,e[85]=M):M=e[85],M}function Be(){const e=Y.c(15),t=$(),{granted:s,loading:p,error:g}=he("org:manage");if(p){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(ze,{}),e[0]=o):o=e[0],o}if(g){let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(Pe,{}),e[1]=o):o=e[1],o}let l;e[2]!==t?(l=t("settings.orgGeneral.organization"),e[2]=t,e[3]=l):l=e[3];let c;e[4]!==l?(c=i.jsx(Q.Title,{children:l}),e[4]=l,e[5]=c):c=e[5];let d;e[6]!==s?(d=s&&i.jsxs(i.Fragment,{children:[i.jsx(Ie,{}),i.jsx(Oe,{}),i.jsx(ye,{})]}),e[6]=s,e[7]=d):d=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(Ce,{}),e[8]=r):r=e[8];let m;e[9]!==s?(m=s&&i.jsxs(i.Fragment,{children:[i.jsx(_e,{}),i.jsx(Ve,{})]}),e[9]=s,e[10]=m):m=e[10];let n;return e[11]!==c||e[12]!==d||e[13]!==m?(n=i.jsx(Q,{children:i.jsx(Q.Content,{children:i.jsx(Q.Container,{children:i.jsxs(je,{children:[c,d,r,m]})})})}),e[11]=c,e[12]=d,e[13]=m,e[14]=n):n=e[14],n}function dt(){const e=Y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(Be,{}),e[0]=t):t=e[0],t}export{dt as default};
1
+ import{b as $,X as ie,o as re,at as le,as as ce,e as ne,q as W,t as q,K as J,j as i,ec as se,ed as oe,ee as U,aU as ge,au as de,av as ee,c as Y,r as X,a2 as me,V as te,bQ as ue,bR as fe,y as pe,B as xe,ad as he,n as Q,fn as je,aM as ze}from"./index-DAhfV5vh.js";import{u as Se}from"./use-org-auth-client-CY1uAtqK.js";import{u as ve}from"./use-debounced-autosave-DomrC7JG.js";import{A as be}from"./avatar-BUy252-G.js";import{I as ae}from"./input-Uk8z-Ktf.js";import{C as Oe,V as ye,B as Ce}from"./review-settings-9KPdssy5.js";import{D as _e}from"./domain-settings-DoLockR6.js";import{A as Fe,a as Ae,b as De,c as we,g as Ne,d as Te,e as Ee,f as Le}from"./alert-dialog-BB87iWcS.js";import{C as Pe}from"./capability-load-error-BJHb8XrA.js";import"./User01-GD0yW4Qu.js";import"./switch-CQPn6TRL.js";import"./UserSquare-D6GqJl2I.js";import"./use-organization-settings-B4tP4hFm.js";import"./schema-DVBa_MAN.js";import"./task-board-CfiWV1iu.js";import"./use-new-blocks-editor-DSBgh7mx.js";import"./use-connection-DfxY3Owk.js";import"./use-mcp-client-D2VYpHPF.js";import"./auth-CqmWT_2g.js";import"./badge-DejmcZm9.js";import"./select-Cfp-vpJN.js";import"./index-IqSVG5fY.js";import"./Check-CkBscgA2.js";import"./ChevronUp-d9MFOW1T.js";const ke=e=>de({name:ee().min(1,e("settings.organizationForm.nameRequired")).max(255,e("settings.organizationForm.nameTooLong")),logo:ee().optional()});function Re(e){const t=Y.c(17),{value:s,onChange:p,name:g,disabled:l}=e,c=$(),d=X.useRef(null);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>d.current?.click(),t[0]=r):r=t[0];const m=r;let n;t[1]!==p||t[2]!==c?(n=Z=>{const z=Z.target.files?.[0];if(!z)return;if(z.size>2097152){q.error(c("settings.organizationForm.imageTooLarge"));return}const x=new FileReader;x.onerror=()=>q.error(c("settings.organizationForm.failedToReadImage")),x.onloadend=()=>{x.result&&p(x.result),d.current&&(d.current.value="")},x.readAsDataURL(z)},t[1]=p,t[2]=c,t[3]=n):n=t[3];const o=n;let a;t[4]!==c?(a=c("settings.organizationForm.uploadLogoLabel"),t[4]=c,t[5]=a):a=t[5];let u;t[6]!==l||t[7]!==o?(u=i.jsx("input",{ref:d,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:l}),t[6]=l,t[7]=o,t[8]=u):u=t[8];const h=s||void 0,j=g??"?";let f;t[9]!==h||t[10]!==j?(f=i.jsx(be,{url:h,fallback:j,shape:"square",size:"base"}),t[9]=h,t[10]=j,t[11]=f):f=t[11];let S;return t[12]!==l||t[13]!==a||t[14]!==u||t[15]!==f?(S=i.jsxs("button",{type:"button",onClick:m,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":a,children:[u,f]}),t[12]=l,t[13]=a,t[14]=u,t[15]=f,t[16]=S):S=t[16],S}function Ie(){const e=$(),{org:t}=ie(),s=Se(),p=re(),g=le({resolver:ce(ke(e)),values:{name:t.name??"",logo:t.logo??""}}),l=ne({mutationFn:async n=>{const o={name:n.name};n.logo&&(o.logo=n.logo);const a=await s.organization.update({data:o});if(a?.error)throw new Error(a.error.message||e("settings.organizationForm.failedToUpdateOrg"));return a},onSuccess:(n,o)=>{W("organization_settings_updated",{organization_id:t.id,fields:Object.keys(o)}),p.invalidateQueries({queryKey:J.organizations()}),p.invalidateQueries({queryKey:J.activeOrganization(t.slug)}),q.success(e("settings.organizationForm.updateSuccess"))},onError:(n,o)=>{W("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(o),error:n instanceof Error?n.message:String(n)}),q.error(n instanceof Error?n.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:c,flush:d}=ve({save:async()=>{const n=g.control._formState.dirtyFields;if(Object.keys(n).length===0||!await g.trigger())return;const a=g.getValues(),u=g.control._defaultValues;g.reset(a,{keepValues:!0});try{await l.mutateAsync(a)}catch{g.reset(u,{keepValues:!0})}}}),r=g.formState.errors,m=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(se,{children:i.jsxs(oe,{children:[i.jsx(U,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(Re,{value:g.watch("logo"),onChange:n=>{g.setValue("logo",n??"",{shouldDirty:!0}),d()},name:g.watch("name")})}),i.jsx(U,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(ge,{control:g.control,name:"name",render:({field:n})=>i.jsx(ae,{id:"org-name",...n,onChange:o=>{n.onChange(o),c()},onBlur:()=>{n.onBlur(),d()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(U,{title:e("settings.organizationForm.urlTitle"),description:e("settings.organizationForm.urlDescription"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-muted/40 overflow-hidden",children:[m&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:m}),i.jsx("span",{className:"flex-1 min-w-0 px-2 py-1.5 text-sm text-foreground truncate",children:t.slug})]})}),(r.name||r.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&i.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.logo&&i.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function Ve(){const e=Y.c(86),t=$(),{org:s}=ie(),[p,g]=X.useState(!1),[l,c]=X.useState(""),d=me();let r;e[0]!==s.id||e[1]!==d?(r=async()=>{await d.call("ORGANIZATION_DELETE",{id:s.id})},e[0]=s.id,e[1]=d,e[2]=r):r=e[2];let m;e[3]!==s.id||e[4]!==s.slug||e[5]!==t?(m=()=>{W("organization_deleted",{organization_id:s.id}),localStorage.getItem(te.lastOrgSlug())===s.slug&&localStorage.removeItem(te.lastOrgSlug()),ue()?.org===s.slug&&fe(),pe(),q.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=s.id,e[4]=s.slug,e[5]=t,e[6]=m):m=e[6];let n;e[7]!==t?(n=v=>{q.error(v instanceof Error?v.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=n):n=e[8];let o;e[9]!==r||e[10]!==m||e[11]!==n?(o={mutationFn:r,onSuccess:m,onError:n},e[9]=r,e[10]=m,e[11]=n,e[12]=o):o=e[12];const a=ne(o);let u;e[13]!==t?(u=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=u):u=e[14];let h;e[15]!==t?(h=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=h):h=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=j):j=e[18];let f;e[19]!==t?(f=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=f):f=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=()=>g(!0),e[21]=S):S=e[21];const Z=a.isPending;let z;e[22]!==t?(z=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=z):z=e[23];let x;e[24]!==a.isPending||e[25]!==z?(x=i.jsx(xe,{variant:"destructive",size:"sm",onClick:S,disabled:Z,children:z}),e[24]=a.isPending,e[25]=z,e[26]=x):x=e[26];let b;e[27]!==x||e[28]!==j||e[29]!==f?(b=i.jsx(oe,{className:"border-destructive/40",children:i.jsx(U,{title:j,description:f,action:x})}),e[27]=x,e[28]=j,e[29]=f,e[30]=b):b=e[30];let O;e[31]!==b||e[32]!==u||e[33]!==h?(O=i.jsx(se,{title:u,description:h,children:b}),e[31]=b,e[32]=u,e[33]=h,e[34]=O):O=e[34];let G;e[35]===Symbol.for("react.memo_cache_sentinel")?(G=v=>{g(v),v||c("")},e[35]=G):G=e[35];let y;e[36]!==t?(y=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=y):y=e[37];let C;e[38]!==y?(C=i.jsx(Fe,{children:y}),e[38]=y,e[39]=C):C=e[39];let _;e[40]!==s.name||e[41]!==t?(_=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:s.name}),e[40]=s.name,e[41]=t,e[42]=_):_=e[42];let F;e[43]!==_?(F=i.jsx("p",{children:_}),e[43]=_,e[44]=F):F=e[44];let A;e[45]!==s.name||e[46]!==t?(A=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:s.name}),e[45]=s.name,e[46]=t,e[47]=A):A=e[47];let D;e[48]!==A?(D=i.jsx("p",{className:"mt-3 mb-1.5",children:A}),e[48]=A,e[49]=D):D=e[49];let K;e[50]===Symbol.for("react.memo_cache_sentinel")?(K=v=>c(v.target.value),e[50]=K):K=e[50];let w;e[51]!==l||e[52]!==s.name?(w=i.jsx(ae,{value:l,onChange:K,placeholder:s.name,autoFocus:!0}),e[51]=l,e[52]=s.name,e[53]=w):w=e[53];let N;e[54]!==F||e[55]!==D||e[56]!==w?(N=i.jsx(Ae,{asChild:!0,children:i.jsxs("div",{children:[F,D,w]})}),e[54]=F,e[55]=D,e[56]=w,e[57]=N):N=e[57];let T;e[58]!==C||e[59]!==N?(T=i.jsxs(De,{children:[C,N]}),e[58]=C,e[59]=N,e[60]=T):T=e[60];let E;e[61]!==t?(E=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=E):E=e[62];let L;e[63]!==E?(L=i.jsx(we,{children:E}),e[63]=E,e[64]=L):L=e[64];let P;e[65]!==a?(P=()=>a.mutate(),e[65]=a,e[66]=P):P=e[66];const H=l!==s.name||a.isPending;let k;e[67]!==a.isPending||e[68]!==t?(k=a.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=a.isPending,e[68]=t,e[69]=k):k=e[69];let R;e[70]!==P||e[71]!==H||e[72]!==k?(R=i.jsx(Ne,{onClick:P,disabled:H,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:k}),e[70]=P,e[71]=H,e[72]=k,e[73]=R):R=e[73];let I;e[74]!==L||e[75]!==R?(I=i.jsxs(Te,{children:[L,R]}),e[74]=L,e[75]=R,e[76]=I):I=e[76];let V;e[77]!==T||e[78]!==I?(V=i.jsxs(Ee,{children:[T,I]}),e[77]=T,e[78]=I,e[79]=V):V=e[79];let B;e[80]!==p||e[81]!==V?(B=i.jsx(Le,{open:p,onOpenChange:G,children:V}),e[80]=p,e[81]=V,e[82]=B):B=e[82];let M;return e[83]!==O||e[84]!==B?(M=i.jsxs(i.Fragment,{children:[O,B]}),e[83]=O,e[84]=B,e[85]=M):M=e[85],M}function Be(){const e=Y.c(15),t=$(),{granted:s,loading:p,error:g}=he("org:manage");if(p){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(ze,{}),e[0]=o):o=e[0],o}if(g){let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(Pe,{}),e[1]=o):o=e[1],o}let l;e[2]!==t?(l=t("settings.orgGeneral.organization"),e[2]=t,e[3]=l):l=e[3];let c;e[4]!==l?(c=i.jsx(Q.Title,{children:l}),e[4]=l,e[5]=c):c=e[5];let d;e[6]!==s?(d=s&&i.jsxs(i.Fragment,{children:[i.jsx(Ie,{}),i.jsx(Oe,{}),i.jsx(ye,{})]}),e[6]=s,e[7]=d):d=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(Ce,{}),e[8]=r):r=e[8];let m;e[9]!==s?(m=s&&i.jsxs(i.Fragment,{children:[i.jsx(_e,{}),i.jsx(Ve,{})]}),e[9]=s,e[10]=m):m=e[10];let n;return e[11]!==c||e[12]!==d||e[13]!==m?(n=i.jsx(Q,{children:i.jsx(Q.Content,{children:i.jsx(Q.Container,{children:i.jsxs(je,{children:[c,d,r,m]})})})}),e[11]=c,e[12]=d,e[13]=m,e[14]=n):n=e[14],n}function dt(){const e=Y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(Be,{}),e[0]=t):t=e[0],t}export{dt as default};
@@ -0,0 +1 @@
1
+ import{c as T,l as z,j as s,X as U,a2 as ze,D as lt,r as G,b as H,I as rt,F as ot,B as Ne,H as it,G as at,L as F,J as q,x as He,n as B,h as ve,a6 as le,q as W,K as ct,m as mt,a as ke,ad as Re,Y as dt,u as ft}from"./index-DAhfV5vh.js";import{C as ut}from"./index-Laz3och2.js";import{t as Oe}from"./Tool01-CH2aHsGf.js";import{i as xt}from"./ZoomOut-Dvx_7Y9U.js";import{m as ht,A as we,J as pt,K as gt}from"./agent-icon-BUiQnNP8.js";import{u as jt,t as bt}from"./config-B_J6eren.js";import{r as Be,m as Ee,c as je,d as yt,e as Nt,t as vt,s as kt,f as wt,g as _t,h as St,i as $t,p as Ct,R as Te}from"./daily-pulse-BMbckFog.js";import{i as Fe,n as Ke}from"./ArrowUp-THfmrwlM.js";import{i as Tt}from"./DotsVertical-C2t5zhKy.js";import{C as At,a as It,b as Mt,c as Pt,d as Dt}from"./chart-HsGopGVn.js";import{D as zt,a as Ht,d as Rt,h as Ot,c as Bt,b as Et}from"./dialog-B30-8RI6.js";import{c as Ft}from"./use-decopilot-events-7cMuGUn_.js";import{A as Kt,a as Lt}from"./AreaChart-D9J1W_3A.js";import{C as Yt,Y as Wt}from"./CartesianChart-BWUtT14P.js";import{u as Le}from"./use-automations-CRmgA2ID.js";import{s as me}from"./use-project-scope-BBHuYyAU.js";import{b as de,c as Ye,a as We,d as Gt}from"./task-route-ZyJZvQEP.js";import{b as fe}from"./repository-binding-BjQg44s0.js";import{b as Ge}from"./input-Cxi1fFAz.js";import{D as qe,C as Ue}from"./chat-context-BaRraYAA.js";import{a as Je}from"./use-organization-settings-B4tP4hFm.js";import{R as qt,u as Ut,b as Jt,P as Vt}from"./project-feed-DUhzdphC.js";import{i as _e}from"./LinkBroken01-DN8kSYpX.js";import{C as Xt,a as Qt,b as Zt}from"./client-icons-Dot2-8Ng.js";import{i as es}from"./AlertCircle-BgzKIHBg.js";import{i as ts}from"./CheckCircle-Bokn_JKt.js";import{P as ss}from"./project-icon-rqB8fgDE.js";import{u as Ve}from"./use-navigate-to-agent-BZlsExbp.js";import{s as ns,r as ls}from"./project-profile-Cc4MG3QN.js";import{t as Ae}from"./format-time-CjIPQhCN.js";import{O as rs}from"./thread-button-D-bmXoX1.js";import{N as os}from"./new-project-dialog-CD-S7Uy7.js";import{P as is}from"./projects-empty-state-Dg9KTZEd.js";import{s as as}from"./Plus-DDqlhBDc.js";import{i as cs}from"./UserSquare-D6GqJl2I.js";import{E as ms}from"./empty-state-BtuSozdW.js";import{R as ds}from"./repository-import-picker-ZyzYgBKd.js";import{o as fs}from"./shell-layout-Cns9lUi4.js";import"./use-mobile-UCEvtXfH.js";import"./resizable-ByFftuKZ.js";import"./use-chat-layout-state-Cc2VHc6I.js";import"./use-file-configs-CLIgCo9H.js";import"./site-slug-DebpOoQq.js";import"./thread-route-58igbRqf.js";import"./use-panel-navigate--QzQC3VZ.js";import"./thread-intent-DjddwZgX.js";import"./use-mcp-client-D2VYpHPF.js";import"./auth-CqmWT_2g.js";import"./backoff-8mStPHYB.js";import"./task-board-CfiWV1iu.js";import"./schema-DVBa_MAN.js";import"./slugify-CEUa2lfQ.js";import"./XClose-75e7Vbaa.js";import"./icon-button-C6LsyxKS.js";import"./tooltip-cYDDz2Pp.js";import"./index-IqSVG5fY.js";import"./toolbar-icon-button-BwLSK1SV.js";import"./ArrowLeft-Bd0lzf25.js";import"./ShoppingBag01-Cl4z1_2H.js";import"./Building02-CSMMDKRZ.js";import"./Check-CkBscgA2.js";import"./ChevronUp-d9MFOW1T.js";import"./Copy01-C68wCYtl.js";import"./CreditCard01-B4oRpD46.js";import"./Image01-Duw-3ecX.js";import"./Palette-VX8lOEW0.js";import"./Key01-CqL4JhuL.js";import"./Link01-C-Mwe2eF.js";import"./LinkExternal01-DMM7FS6P.js";import"./Monitor01-Wyitf2St.js";import"./Sun-COvLf5Lc.js";import"./SearchMd-WaC9Elkv.js";import"./Trash01-DK8Y_gth.js";import"./Upload01-oF1C_3Ru.js";import"./User01-GD0yW4Qu.js";import"./Users01-DgVeXNsL.js";import"./X-YRTghwXC.js";import"./use-task-board-events-CkFoY4mj.js";import"./index-rIGGQh0Z.js";import"./index-BCW6nCJr.js";import"./gateway-client-DMn6uSTc.js";import"./form-HEFwQ86k.js";import"./label-CsA5aIjl.js";import"./input-Uk8z-Ktf.js";import"./utils-CVEq3hMx.js";import"./org-file-open-context-BFenNlZj.js";import"./autosend-CEQzRhvd.js";import"./chat-draft-CFEQOnWd.js";import"./use-session-runtime-DFN8v9Uu.js";import"./select-Cfp-vpJN.js";import"./usage-stats-BToxR0wR.js";import"./use-copy-BBTjUiXD.js";import"./markdown-DA7Pnev1.js";import"./location-DPIrGNp7.js";import"./tabs-boN14fnC.js";import"./use-deco-credits-CFjGcaIq.js";import"./use-ai-providers-BaF1iqq_.js";import"./toggle-group-C96sHBVW.js";import"./tool-namespace-DmnQIdtF.js";import"./use-open-billing-url-SUgaj5hP.js";import"./decopilot-DvJjDwc1.js";import"./checkbox-CNknzL68.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-BUy252-G.js";import"./download-app-dialog-BEeBKwQl.js";import"./use-is-desktop-app-BNujXJc_.js";import"./popover-VHHbgkVg.js";import"./drawer-Dx_eDva4.js";import"./index-C4Vjmkff.js";import"./input-C1SzE0r0.js";import"./suggestion-BlpEbXkf.js";import"./use-mcp-prompts-DtbMED93.js";import"./use-org-fs-DUuc6Zxc.js";import"./question-004-sINsf4GQ.js";import"./use-members-BuEaDeJm.js";import"./use-org-auth-client-CY1uAtqK.js";import"./feature-paywall-BpkcH4cr.js";import"./plan-ladder-DDzYift2.js";import"./add-connection-dialog-BHmJQXXQ.js";import"./collection-search-QrA0qPpv.js";import"./extract-connection-data-Ceomd2dy.js";import"./metadata-D72DunRR.js";import"./connection-DLraZ45i.js";import"./connection-card-ByBeHaTx.js";import"./useInfiniteQuery-BpXl9N7J.js";import"./infiniteQueryObserver-BlKY7V_o.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-DTJ53jik.js";import"./textarea-re22-64Y.js";import"./use-connection-DfxY3Owk.js";import"./connection-form-helpers-B37qd_wK.js";import"./authenticate-and-persist-oauth-B41Sx_s0.js";import"./mcp-oauth-Ig94NzNJ.js";import"./collection-tabs-BTTf3Im8.js";import"./badge-DejmcZm9.js";import"./use-infinite-scroll-BBNiZIZb.js";import"./useSuspenseInfiniteQuery-Dc8cFcZ0.js";import"./use-reports-diagnostic-DAw3nLO7.js";import"./companions-core-DzyeM-yJ.js";import"./github-repo-scope-ByTYKy_L.js";import"./mini-report-page-Bsz_Vl_A.js";import"./repository-picker-zKlkxI7H.js";import"./use-debounced-value-DyppKzdq.js";import"./get-initials-D-f_fDFw.js";import"./differenceInSeconds-C3x8sHUj.js";import"./sheet-BA1BhLlr.js";import"./use-clock-tick-ChrO8Wr8.js";import"./command-BeWosBD5.js";import"./index-D9Dp_srJ.js";import"./required-auth-layout-Ci_VyqXV.js";import"./use-org-sso-BxhvCAY_.js";function ne(t){const e=T.c(13),{label:l,count:n,action:o,children:i}=t;let r;e[0]!==n?(r=n!==void 0&&n>0&&s.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1];let c;e[2]!==l||e[3]!==r?(c=s.jsxs("h2",{className:"flex items-baseline gap-2 text-[0.9rem] font-medium tracking-tight text-foreground",children:[l,r]}),e[2]=l,e[3]=r,e[4]=c):c=e[4];let m;e[5]!==o||e[6]!==c?(m=s.jsxs("div",{className:"flex h-12 items-center justify-between gap-3 border-b border-border/70 px-5",children:[c,o]}),e[5]=o,e[6]=c,e[7]=m):m=e[7];let d;e[8]!==i?(d=s.jsx("ul",{className:"flex flex-col divide-y divide-border/70",children:i}),e[8]=i,e[9]=d):d=e[9];let a;return e[10]!==m||e[11]!==d?(a=s.jsxs("section",{className:"@container flex flex-col overflow-hidden rounded-2xl bg-card card-shadow",children:[m,d]}),e[10]=m,e[11]=d,e[12]=a):a=e[12],a}function K(t){const e=T.c(5),{children:l,className:n}=t;let o;e[0]!==n?(o=z("px-5 py-3.5 transition-colors hover:bg-accent/30",n),e[0]=n,e[1]=o):o=e[1];let i;return e[2]!==l||e[3]!==o?(i=s.jsx("li",{className:o,children:l}),e[2]=l,e[3]=o,e[4]=i):i=e[4],i}function us(t){const e=T.c(7),{main:l,aside:n}=t;let o;e[0]!==l?(o=s.jsx("div",{className:"flex min-w-0 flex-col gap-6",children:l}),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==n?(i=s.jsx("div",{className:"flex min-w-0 flex-col gap-6",children:n}),e[2]=n,e[3]=i):i=e[3];let r;return e[4]!==o||e[5]!==i?(r=s.jsx("div",{className:"@container",children:s.jsxs("div",{className:"grid grid-cols-1 items-start gap-6 @4xl:grid-cols-[minmax(0,1.35fr)_minmax(0,1fr)]",children:[o,i]})}),e[4]=o,e[5]=i,e[6]=r):r=e[6],r}function Se(){const t=T.c(3),{locator:e}=U(),l=ze();jt();let n;t[0]!==e||t[1]!==l?(n=bt(e,l),t[0]=e,t[1]=l,t[2]=n):n=t[2];const{data:o}=lt(n);return o.items}const xs=56,hs=16;function ps(t){const e=T.c(28),{series:l,className:n,label:o,height:i,stretch:r}=t,c=i===void 0?hs:i,m=r===void 0?!1:r,d=Math.max(...l);if(l.length<2||d<=0)return null;const a=m?l.length*8:xs,u=a/(l.length-1);let x;if(e[0]!==c||e[1]!==d||e[2]!==l||e[3]!==u){let k;e[5]!==c||e[6]!==d||e[7]!==u?(k=(w,S)=>({x:S*u,y:c-1-w/d*(c-2)}),e[5]=c,e[6]=d,e[7]=u,e[8]=k):k=e[8],x=l.map(k).map(gs).join(" "),e[0]=c,e[1]=d,e[2]=l,e[3]=u,e[4]=x}else x=e[4];const f=x,h=`0 0 ${a} ${c}`,p=m?void 0:a,j=m?"none":void 0,b=m?"w-full":"shrink-0 overflow-visible";let g;e[9]!==n||e[10]!==b?(g=z(b,n),e[9]=n,e[10]=b,e[11]=g):g=e[11];let y;e[12]!==c||e[13]!==f||e[14]!==m||e[15]!==a?(y=m&&s.jsx("polygon",{points:`0,${c} ${f} ${a},${c}`,fill:"currentColor",opacity:.12}),e[12]=c,e[13]=f,e[14]=m,e[15]=a,e[16]=y):y=e[16];let N;e[17]!==f?(N=s.jsx("polyline",{points:f,fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),e[17]=f,e[18]=N):N=e[18];let v;return e[19]!==c||e[20]!==o||e[21]!==N||e[22]!==h||e[23]!==p||e[24]!==j||e[25]!==g||e[26]!==y?(v=s.jsxs("svg",{viewBox:h,width:p,height:c,role:"img","aria-label":o,preserveAspectRatio:j,className:g,children:[y,N]}),e[19]=c,e[20]=o,e[21]=N,e[22]=h,e[23]=p,e[24]=j,e[25]=g,e[26]=y,e[27]=v):v=e[27],v}function gs(t){const{x:e,y:l}=t;return`${e.toFixed(1)},${l.toFixed(1)}`}const js=t=>String(Math.round(t));function Ie(t){const e=T.c(44),{series:l,className:n,label:o,height:i,formatValue:r}=t,c=i===void 0?64:i,m=r===void 0?js:r,d=`rhythm-fill-${G.useId()}`,a=Math.max(...l,0);if(l.length<2||a<=0)return null;let u;if(e[0]!==a||e[1]!==l){let D;e[3]!==a||e[4]!==l.length?(D=(R,L)=>({x:L/(l.length-1)*100,y:100-R/a*100}),e[3]=a,e[4]=l.length,e[5]=D):D=e[5],u=l.map(D).map(bs).join(" "),e[0]=a,e[1]=l,e[2]=u}else u=e[2];const x=u;let f;e[6]!==n?(f=z("flex items-stretch gap-2.5",n),e[6]=n,e[7]=f):f=e[7];let h;e[8]!==c?(h={height:c},e[8]=c,e[9]=h):h=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs("div",{className:"absolute inset-0 flex flex-col justify-between",children:[s.jsx("span",{className:"border-border/70 border-t border-dashed"}),s.jsx("span",{className:"border-border/50 border-t border-dashed"}),s.jsx("span",{className:"border-border border-t"})]}),e[10]=p):p=e[10];let j,b;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:.16}),b=s.jsx("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:0}),e[11]=j,e[12]=b):(j=e[11],b=e[12]);let g;e[13]!==d?(g=s.jsx("defs",{children:s.jsxs("linearGradient",{id:d,x1:"0",y1:"0",x2:"0",y2:"1",children:[j,b]})}),e[13]=d,e[14]=g):g=e[14];const y=`0,100 ${x} 100,100`,N=`url(#${d})`;let v;e[15]!==y||e[16]!==N?(v=s.jsx("polygon",{points:y,fill:N}),e[15]=y,e[16]=N,e[17]=v):v=e[17];let k;e[18]!==x?(k=s.jsx("polyline",{points:x,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),e[18]=x,e[19]=k):k=e[19];let _;e[20]!==o||e[21]!==v||e[22]!==k||e[23]!==g?(_=s.jsxs("div",{className:"relative min-w-0 flex-1",children:[p,s.jsxs("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",role:"img","aria-label":o,className:"absolute inset-0 h-full w-full text-foreground",children:[g,v,k]})]}),e[20]=o,e[21]=v,e[22]=k,e[23]=g,e[24]=_):_=e[24];let w;e[25]!==m||e[26]!==a?(w=m(a),e[25]=m,e[26]=a,e[27]=w):w=e[27];let S;e[28]!==w?(S=s.jsx("span",{children:w}),e[28]=w,e[29]=S):S=e[29];const $=a/2;let C;e[30]!==m||e[31]!==$?(C=m($),e[30]=m,e[31]=$,e[32]=C):C=e[32];let A;e[33]!==C?(A=s.jsx("span",{children:C}),e[33]=C,e[34]=A):A=e[34];let M;e[35]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("span",{children:"0"}),e[35]=M):M=e[35];let I;e[36]!==S||e[37]!==A?(I=s.jsxs("div",{className:"text-meta flex w-9 shrink-0 flex-col justify-between py-px text-right",children:[S,A,M]}),e[36]=S,e[37]=A,e[38]=I):I=e[38];let P;return e[39]!==_||e[40]!==I||e[41]!==f||e[42]!==h?(P=s.jsxs("div",{className:f,style:h,children:[_,I]}),e[39]=_,e[40]=I,e[41]=f,e[42]=h,e[43]=P):P=e[43],P}function bs(t){const{x:e,y:l}=t;return`${e.toFixed(2)},${l.toFixed(2)}`}function Y(t){return t<=0?"$0":t>=1e3?`$${(t/1e3).toFixed(1)}k`:t>=10?`$${Math.round(t)}`:`$${t.toFixed(2)}`}const he=G.forwardRef(function(e,l){const n=T.c(34);let o,i,r,c,m,d;n[0]!==e?({label:d,action:o,className:c,children:r,interactive:m,...i}=e,n[0]=e,n[1]=o,n[2]=i,n[3]=r,n[4]=c,n[5]=m,n[6]=d):(o=n[1],i=n[2],r=n[3],c=n[4],m=n[5],d=n[6]);const a=m&&"transition-colors hover:bg-accent/30";let u;n[7]!==c||n[8]!==a?(u=z("@container relative flex min-w-0 flex-col gap-3 rounded-2xl bg-card p-5 text-left card-shadow",a,c),n[7]=c,n[8]=a,n[9]=u):u=n[9];let x;n[10]!==i||n[11]!==m||n[12]!==d||n[13]!==l?(x=m&&s.jsx("button",{type:"button",ref:l,"aria-label":d,className:"absolute inset-0 z-0 cursor-pointer rounded-2xl",...i}),n[10]=i,n[11]=m,n[12]=d,n[13]=l,n[14]=x):x=n[14];const f=m&&"pointer-events-none";let h;n[15]!==f?(h=z("flex h-5 items-center justify-between gap-3",f),n[15]=f,n[16]=h):h=n[16];let p;n[17]!==d?(p=s.jsx("h3",{className:"truncate text-sm text-muted-foreground",children:d}),n[17]=d,n[18]=p):p=n[18];let j;n[19]!==o||n[20]!==m?(j=o&&s.jsx("div",{className:z(m&&"relative z-10 pointer-events-auto"),children:o}),n[19]=o,n[20]=m,n[21]=j):j=n[21];let b;n[22]!==h||n[23]!==p||n[24]!==j?(b=s.jsxs("div",{className:h,children:[p,j]}),n[22]=h,n[23]=p,n[24]=j,n[25]=b):b=n[25];let g;n[26]!==r||n[27]!==m?(g=m?s.jsx("div",{className:"pointer-events-none flex min-w-0 flex-1 flex-col gap-2",children:r}):r,n[26]=r,n[27]=m,n[28]=g):g=n[28];let y;return n[29]!==u||n[30]!==x||n[31]!==b||n[32]!==g?(y=s.jsxs("section",{className:u,children:[x,b,g]}),n[29]=u,n[30]=x,n[31]=b,n[32]=g,n[33]=y):y=n[33],y});function ce(t){const e=T.c(7),{value:l,caption:n}=t;let o;e[0]!==l?(o=s.jsx("span",{className:"tnum text-3xl font-semibold text-foreground leading-none",children:l}),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==n?(i=n&&s.jsx("span",{className:"min-w-0 truncate text-muted-foreground text-xs",children:n}),e[2]=n,e[3]=i):i=e[3];let r;return e[4]!==o||e[5]!==i?(r=s.jsxs("p",{className:"flex items-baseline gap-2.5",children:[o,i]}),e[4]=o,e[5]=i,e[6]=r):r=e[6],r}function be(t){const e=Math.floor(t.length/2),l=t.slice(0,e).reduce((i,r)=>i+r,0),o=t.slice(e).reduce((i,r)=>i+r,0)-l;return o===0?null:o}function ye(t){const e=T.c(11),{delta:l,format:n}=t;if(l===null)return null;const o=l>0,i=o?Fe:Ke,r=o?"text-success":"text-muted-foreground";let c;e[0]!==r?(c=z("inline-flex items-center gap-0.5 font-medium text-xs tabular-nums",r),e[0]=r,e[1]=c):c=e[1];let m;e[2]!==i?(m=s.jsx(i,{width:11,height:11,"aria-hidden":!0}),e[2]=i,e[3]=m):m=e[3];let d;e[4]!==l||e[5]!==n?(d=n(Math.abs(l)),e[4]=l,e[5]=n,e[6]=d):d=e[6];let a;return e[7]!==c||e[8]!==m||e[9]!==d?(a=s.jsxs("span",{className:c,children:[m,d]}),e[7]=c,e[8]=m,e[9]=d,e[10]=a):a=e[10],a}function ys(t){const e=T.c(14),{byProject:l,projectsById:n,orgSlug:o}=t;let i,r,c;if(e[0]!==l||e[1]!==o||e[2]!==n){c=Symbol.for("react.early_return_sentinel");e:{let d;e[6]!==n?(d=f=>({...f,project:n.get(f.projectId)}),e[6]=n,e[7]=d):d=e[7];const a=l.map(d).filter(vs);if(a.length===0){c=null;break e}const u=Math.max(...a.map(Ns));i="flex flex-col gap-4";let x;e[8]!==u||e[9]!==o?(x=f=>s.jsxs("li",{className:"flex items-center gap-4",children:[s.jsx(F,{to:q.root,params:{org:o,agentId:f.projectId},className:"w-36 shrink-0 truncate text-foreground text-sm hover:underline",children:f.project?.title}),s.jsx("div",{className:"h-2 min-w-0 flex-1 rounded-full bg-muted",children:s.jsx("div",{className:"h-full rounded-full bg-primary",style:{width:`${u>0?f.usd/u*100:0}%`}})}),s.jsx("span",{className:"w-16 shrink-0 text-right text-foreground text-sm tabular-nums",children:Y(f.usd)})]},f.projectId),e[8]=u,e[9]=o,e[10]=x):x=e[10],r=a.map(x)}e[0]=l,e[1]=o,e[2]=n,e[3]=i,e[4]=r,e[5]=c}else i=e[3],r=e[4],c=e[5];if(c!==Symbol.for("react.early_return_sentinel"))return c;let m;return e[11]!==i||e[12]!==r?(m=s.jsx("ul",{className:i,children:r}),e[11]=i,e[12]=r,e[13]=m):m=e[13],m}function Ns(t){return t.usd}function vs(t){return t.project}function ks(t){const e=T.c(25),{costSeriesByProject:l,projectsById:n,days:o}=t;let i,r,c,m;if(e[0]!==l||e[1]!==o||e[2]!==n){m=Symbol.for("react.early_return_sentinel");e:{if(i=[...l.keys()].filter(y=>n.has(y)),i.length===0){m=null;break e}r=Array.from({length:o},(y,N)=>{const v={day:N};for(const k of i)v[k]=l.get(k)?.[N]??0;return v}),c=Object.fromEntries(i.map((y,N)=>[y,{label:n.get(y)?.title??y,color:`var(--chart-${N%5+1})`}]))}e[0]=l,e[1]=o,e[2]=n,e[3]=i,e[4]=r,e[5]=c,e[6]=m}else i=e[3],r=e[4],c=e[5],m=e[6];if(m!==Symbol.for("react.early_return_sentinel"))return m;const d=c;let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a={top:8,right:-8,bottom:8,left:0},e[7]=a):a=e[7];let u;e[8]!==d||e[9]!==i?(u=s.jsx("defs",{children:i.map(y=>s.jsxs("linearGradient",{id:`cost-grad-${y}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0%",stopColor:d[y]?.color,stopOpacity:.2}),s.jsx("stop",{offset:"100%",stopColor:d[y]?.color,stopOpacity:0})]},y))}),e[8]=d,e[9]=i,e[10]=u):u=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Yt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[11]=x):x=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Wt,{orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},tickFormatter:Y,width:40,tickCount:4}),e[12]=f):f=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(At,{content:s.jsx(It,{indicator:"line",hideLabel:!0,formatter:ws})}),e[13]=h):h=e[13];let p;e[14]!==d||e[15]!==i?(p=i.map(y=>s.jsx(Kt,{type:"linear",dataKey:y,name:d[y]?.label,stroke:d[y]?.color,strokeWidth:2,fill:`url(#cost-grad-${y})`,dot:!1,activeDot:{r:4,fill:d[y]?.color,stroke:"var(--background)",strokeWidth:2},animationDuration:300},y)),e[14]=d,e[15]=i,e[16]=p):p=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Mt,{content:s.jsx(Pt,{})}),e[17]=j):j=e[17];let b;e[18]!==r||e[19]!==u||e[20]!==p?(b=s.jsxs(Lt,{data:r,margin:a,children:[u,x,f,h,p,j]}),e[18]=r,e[19]=u,e[20]=p,e[21]=b):b=e[21];let g;return e[22]!==d||e[23]!==b?(g=s.jsx(Dt,{config:d,className:"h-64 w-full",children:b}),e[22]=d,e[23]=b,e[24]=g):g=e[24],g}function ws(t,e,l){return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"h-2.5 w-2.5 shrink-0 rounded-[2px]",style:{background:l.color}}),s.jsxs("div",{className:"flex flex-1 items-center justify-between leading-none",children:[s.jsx("span",{className:"text-muted-foreground",children:e}),s.jsx("span",{className:"font-medium text-foreground tabular-nums",children:Y(Number(t))})]})]})}function _s(t){const e=T.c(44),{cost:l,costRhythm:n,costSeriesByProject:o,projectsById:i,orgSlug:r}=t,c=H();let m;e[0]!==c?(m=c("home.stats.costLabel"),e[0]=c,e[1]=m):m=e[1];let d;e[2]!==m?(d=s.jsx(Rt,{children:m}),e[2]=m,e[3]=d):d=e[3];let a;e[4]!==c?(a=c("home.stats.costWindow"),e[4]=c,e[5]=a):a=e[5];let u;e[6]!==a?(u=s.jsx(Ot,{children:a}),e[6]=a,e[7]=u):u=e[7];let x;e[8]!==d||e[9]!==u?(x=s.jsxs(Bt,{children:[d,u]}),e[8]=d,e[9]=u,e[10]=x):x=e[10];let f;e[11]!==l.total?(f=Y(l.total),e[11]=l.total,e[12]=f):f=e[12];let h;e[13]!==f?(h=s.jsx(ce,{value:f}),e[13]=f,e[14]=h):h=e[14];let p;e[15]!==n?(p=be(n),e[15]=n,e[16]=p):p=e[16];let j;e[17]!==p?(j=s.jsx(ye,{delta:p,format:Y}),e[17]=p,e[18]=j):j=e[18];let b;e[19]!==h||e[20]!==j?(b=s.jsxs("div",{className:"flex items-baseline gap-2",children:[h,j]}),e[19]=h,e[20]=j,e[21]=b):b=e[21];let g;e[22]!==n.length||e[23]!==o||e[24]!==i?(g=s.jsx(ks,{costSeriesByProject:o,projectsById:i,days:n.length}),e[22]=n.length,e[23]=o,e[24]=i,e[25]=g):g=e[25];let y;e[26]!==b||e[27]!==g?(y=s.jsxs("section",{className:"flex flex-col gap-4 rounded-xl border border-border p-4",children:[b,g]}),e[26]=b,e[27]=g,e[28]=y):y=e[28];let N;e[29]!==c?(N=c("home.stats.topProjects"),e[29]=c,e[30]=N):N=e[30];let v;e[31]!==N?(v=s.jsx("h4",{className:"text-muted-foreground text-sm",children:N}),e[31]=N,e[32]=v):v=e[32];let k;e[33]!==l.byProject||e[34]!==r||e[35]!==i?(k=s.jsx(ys,{byProject:l.byProject,projectsById:i,orgSlug:r}),e[33]=l.byProject,e[34]=r,e[35]=i,e[36]=k):k=e[36];let _;e[37]!==v||e[38]!==k?(_=s.jsxs("section",{className:"flex flex-col gap-4 rounded-xl border border-border p-4",children:[v,k]}),e[37]=v,e[38]=k,e[39]=_):_=e[39];let w;return e[40]!==y||e[41]!==_||e[42]!==x?(w=s.jsxs(Et,{className:"sm:max-w-3xl",children:[x,y,_]}),e[40]=y,e[41]=_,e[42]=x,e[43]=w):w=e[43],w}function Ss(t){const e=T.c(55),{cost:l,costRhythm:n,costSeriesByProject:o,runs:i,runsRhythm:r,automations:c,projectsById:m,orgSlug:d}=t,a=H(),[u,x]=G.useState(!1),f=Ft(),h=f&&"@4xl:grid-cols-[minmax(0,1.6fr)_minmax(0,1fr)_minmax(0,1fr)]";let p;e[0]!==h?(p=z("grid grid-cols-1 gap-4 @2xl:grid-cols-2",h),e[0]=h,e[1]=p):p=e[1];let j;e[2]!==l||e[3]!==u||e[4]!==n||e[5]!==o||e[6]!==d||e[7]!==m||e[8]!==f||e[9]!==a?(j=f&&s.jsxs(zt,{open:u,onOpenChange:x,children:[s.jsx(Ht,{asChild:!0,children:s.jsxs(he,{label:a("home.stats.costLabel"),className:"@2xl:col-span-2 @4xl:col-span-1",interactive:!0,action:s.jsxs(rt,{children:[s.jsx(ot,{asChild:!0,children:s.jsx(Ne,{variant:"ghost",size:"sm",className:"size-6 p-0","aria-label":a("home.stats.moreActions"),children:s.jsx(Tt,{size:14})})}),s.jsx(it,{align:"end",children:s.jsxs(at,{onClick:()=>x(!0),children:[s.jsx(ht,{size:16}),a("home.stats.viewDetails")]})})]}),children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx(ce,{value:Y(l.total)}),s.jsx(ye,{delta:be(n),format:Y})]}),s.jsx(Ie,{series:n,formatValue:Y,label:a("home.stats.costWindow"),height:96}),s.jsx("span",{className:"text-xs text-muted-foreground",children:a("home.stats.costWindow")})]})}),s.jsx(_s,{cost:l,costRhythm:n,costSeriesByProject:o,projectsById:m,orgSlug:d})]}),e[2]=l,e[3]=u,e[4]=n,e[5]=o,e[6]=d,e[7]=m,e[8]=f,e[9]=a,e[10]=j):j=e[10];let b;e[11]!==a?(b=a("home.stats.runsLabel"),e[11]=a,e[12]=b):b=e[12];const g=String(i.runs);let y;e[13]!==i.live||e[14]!==a?(y=i.live>0?s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-foreground",children:[s.jsxs("span",{className:"relative flex size-1.5",children:[s.jsx("span",{className:"absolute inline-flex size-1.5 animate-ping rounded-full bg-brand opacity-70"}),s.jsx("span",{className:"relative inline-flex size-1.5 rounded-full bg-brand"})]}),a("home.stats.liveNow",{count:i.live})]}):void 0,e[13]=i.live,e[14]=a,e[15]=y):y=e[15];let N;e[16]!==g||e[17]!==y?(N=s.jsx(ce,{value:g,caption:y}),e[16]=g,e[17]=y,e[18]=N):N=e[18];let v;e[19]!==r?(v=be(r),e[19]=r,e[20]=v):v=e[20];let k;e[21]!==v?(k=s.jsx(ye,{delta:v,format:$s}),e[21]=v,e[22]=k):k=e[22];let _;e[23]!==N||e[24]!==k?(_=s.jsxs("div",{className:"flex items-baseline gap-2",children:[N,k]}),e[23]=N,e[24]=k,e[25]=_):_=e[25];let w;e[26]!==r.length||e[27]!==a?(w=a("home.stats.runsWindow",{days:r.length}),e[26]=r.length,e[27]=a,e[28]=w):w=e[28];let S;e[29]!==r||e[30]!==w?(S=s.jsx(Ie,{series:r,label:w,height:96}),e[29]=r,e[30]=w,e[31]=S):S=e[31];let $;e[32]!==r.length||e[33]!==a?($=a("home.stats.runsWindow",{days:r.length}),e[32]=r.length,e[33]=a,e[34]=$):$=e[34];let C;e[35]!==$?(C=s.jsx("span",{className:"text-xs text-muted-foreground",children:$}),e[35]=$,e[36]=C):C=e[36];let A;e[37]!==_||e[38]!==S||e[39]!==C||e[40]!==b?(A=s.jsxs(he,{label:b,children:[_,S,C]}),e[37]=_,e[38]=S,e[39]=C,e[40]=b,e[41]=A):A=e[41];let M;e[42]!==a?(M=a("home.stats.automationsLabel"),e[42]=a,e[43]=M):M=e[43];let I;e[44]!==c||e[45]!==a?(I=c?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-baseline gap-5",children:[s.jsx(Me,{value:c.running,label:a("home.stats.running")}),s.jsx(Me,{value:c.paused,label:a("home.stats.paused"),muted:!0})]}),c.running+c.paused===0?s.jsx("p",{className:"text-muted-foreground text-xs leading-5",children:a("home.stats.noAutomations")}):null]}):s.jsx(ce,{value:"\\u2014"}),e[44]=c,e[45]=a,e[46]=I):I=e[46];let P;e[47]!==M||e[48]!==I?(P=s.jsx(he,{label:M,children:I}),e[47]=M,e[48]=I,e[49]=P):P=e[49];let D;return e[50]!==A||e[51]!==P||e[52]!==p||e[53]!==j?(D=s.jsx("div",{className:"@container mt-1",children:s.jsxs("div",{className:p,children:[j,A,P]})}),e[50]=A,e[51]=P,e[52]=p,e[53]=j,e[54]=D):D=e[54],D}function $s(t){return String(Math.round(t))}function Me(t){const e=T.c(10),{value:l,label:n,muted:o}=t,i=o?"text-muted-foreground":"text-foreground";let r;e[0]!==i?(r=z("tnum text-3xl font-semibold leading-none",i),e[0]=i,e[1]=r):r=e[1];let c;e[2]!==r||e[3]!==l?(c=s.jsx("span",{className:r,children:l}),e[2]=r,e[3]=l,e[4]=c):c=e[4];let m;e[5]!==n?(m=s.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[5]=n,e[6]=m):m=e[6];let d;return e[7]!==c||e[8]!==m?(d=s.jsxs("span",{className:"flex flex-col gap-1.5",children:[c,m]}),e[7]=c,e[8]=m,e[9]=d):d=e[9],d}function Cs(t){const e=Date.parse(t);if(Number.isNaN(e))return"";const l=Math.max(0,Math.floor((Date.now()-e)/6e4));if(l<60)return`${l}m`;const n=Math.floor(l/60);return n<24?`${n}h`:`${Math.floor(n/24)}d`}function Ts(t,e){if(!t)return"—";const l=Date.parse(t);return Number.isNaN(l)?"—":new Date(l).toLocaleString(e,{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}function pe(t){const e=T.c(7),{label:l,value:n}=t;let o;e[0]!==l?(o=s.jsx("h3",{className:"truncate text-muted-foreground text-xs",children:l}),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==n?(i=s.jsx("p",{className:"font-semibold text-base text-foreground leading-none tabular-nums",children:n}),e[2]=n,e[3]=i):i=e[3];let r;return e[4]!==o||e[5]!==i?(r=s.jsxs("section",{className:"flex min-w-[168px] flex-1 flex-col gap-1 rounded-lg border border-border bg-card px-3 py-2",children:[o,i]}),e[4]=o,e[5]=i,e[6]=r):r=e[6],r}function As(t){const e=T.c(16),{orgSlug:l,t:n}=t,o=Se();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={pageSize:1e3},e[0]=i):i=e[0];const r=fe(i);let c,m,d,a;if(e[1]!==r||e[2]!==l||e[3]!==n||e[4]!==o){const x=de(me(r)),f=je(o),h=new Map(o.map(Ms));c=ne,e[9]!==n?(m=n("agents.live.heading"),e[9]=n,e[10]=m):m=e[10],d=f.length,a=f.length===0?s.jsx(K,{children:s.jsx("p",{className:"text-muted-foreground text-sm",children:n("agents.live.none")})}):f.map(p=>{const j=h.get(p.taskId),b=j?Ye(j,x):null,g=j?.threads.reduce(Is,0)??0;return s.jsx(K,{className:"transition-colors hover:bg-accent/40",children:s.jsxs(F,{to:le.tasks,params:{org:l,taskKey:void 0},className:"flex min-w-0 items-center gap-3",children:[s.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary",children:s.jsx(Oe,{size:13,"aria-hidden":!0})}),s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:"truncate text-foreground text-sm",children:p.runTitle??p.taskTitle}),s.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 truncate text-muted-foreground text-xs",children:[b&&s.jsx(we,{icon:b.icon,name:b.title,size:"2xs"}),b?.title??n("agents.live.noProject")]})]}),g>0&&s.jsx("span",{className:"shrink-0 font-mono text-muted-foreground text-xs tabular-nums",children:Y(g)}),s.jsx("span",{className:"w-8 shrink-0 text-right font-mono text-muted-foreground text-xs tabular-nums",children:Cs(p.startedAt)})]})},p.threadId)}),e[1]=r,e[2]=l,e[3]=n,e[4]=o,e[5]=c,e[6]=m,e[7]=d,e[8]=a}else c=e[5],m=e[6],d=e[7],a=e[8];let u;return e[11]!==c||e[12]!==m||e[13]!==d||e[14]!==a?(u=s.jsx(c,{label:m,count:d,children:a}),e[11]=c,e[12]=m,e[13]=d,e[14]=a,e[15]=u):u=e[15],u}function Is(t,e){return t+(e.costUsd??0)}function Ms(t){return[t.id,t]}function Ps(t){const e=T.c(11),{orgSlug:l,locale:n,t:o}=t,i=Le().data;if(!i)return null;let r;e[0]!==o?(r=o("agents.schedules.heading"),e[0]=o,e[1]=r):r=e[1];let c;e[2]!==i||e[3]!==n||e[4]!==l||e[5]!==o?(c=i.length===0?s.jsx(K,{children:s.jsx("p",{className:"text-muted-foreground text-sm",children:o("agents.schedules.none")})}):i.map(d=>s.jsx(K,{className:"transition-colors hover:bg-accent/40",children:s.jsxs(F,{to:q.automation,params:{org:l,agentId:d.virtual_mcp_id,automationId:d.id},className:"flex min-w-0 items-center gap-3",children:[s.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:s.jsx(xt,{size:13,"aria-hidden":!0})}),s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:"truncate text-foreground text-sm",children:d.name}),s.jsx("span",{className:"truncate text-muted-foreground text-xs",children:o("agents.schedules.triggers",{count:d.trigger_count})})]}),s.jsx("span",{className:"shrink-0 font-mono text-muted-foreground text-xs",children:d.active?Ts(d.nearest_next_run_at,n):o("agents.schedules.paused")})]})},d.id)),e[2]=i,e[3]=n,e[4]=l,e[5]=o,e[6]=c):c=e[6];let m;return e[7]!==i.length||e[8]!==r||e[9]!==c?(m=s.jsx(ne,{label:r,count:i.length,children:c}),e[7]=i.length,e[8]=r,e[9]=c,e[10]=m):m=e[10],m}function Ds(t){const e=T.c(46),{orgSlug:l,locale:n}=t,o=H(),i=Se();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const c=fe(r);let m,d,a,u,x,f,h;if(e[1]!==c||e[2]!==o||e[3]!==i){const N=de(me(c));let v;e[11]!==i?(v=Be(i),e[11]=i,e[12]=v):v=e[12];const k=v;h="flex flex-col gap-5",u="flex flex-wrap gap-2";let _;e[13]!==o?(_=o("agents.tiles.running"),e[13]=o,e[14]=_):_=e[14];const w=String(k.live);e[15]!==w||e[16]!==_?(x=s.jsx(pe,{label:_,value:w}),e[15]=w,e[16]=_,e[17]=x):x=e[17];let S;e[18]!==o?(S=o("agents.tiles.runsToday"),e[18]=o,e[19]=S):S=e[19];const $=String(k.runs);e[20]!==S||e[21]!==$?(f=s.jsx(pe,{label:S,value:$}),e[20]=S,e[21]=$,e[22]=f):f=e[22],m=pe,e[23]!==o?(d=o("agents.tiles.cost"),e[23]=o,e[24]=d):d=e[24],a=Y(Ee(N,i).total),e[1]=c,e[2]=o,e[3]=i,e[4]=m,e[5]=d,e[6]=a,e[7]=u,e[8]=x,e[9]=f,e[10]=h}else m=e[4],d=e[5],a=e[6],u=e[7],x=e[8],f=e[9],h=e[10];let p;e[25]!==m||e[26]!==d||e[27]!==a?(p=s.jsx(m,{label:d,value:a}),e[25]=m,e[26]=d,e[27]=a,e[28]=p):p=e[28];let j;e[29]!==u||e[30]!==x||e[31]!==f||e[32]!==p?(j=s.jsxs("div",{className:u,children:[x,f,p]}),e[29]=u,e[30]=x,e[31]=f,e[32]=p,e[33]=j):j=e[33];let b;e[34]!==l||e[35]!==o?(b=s.jsx(As,{orgSlug:l,t:o}),e[34]=l,e[35]=o,e[36]=b):b=e[36];let g;e[37]!==n||e[38]!==l||e[39]!==o?(g=s.jsx(Ps,{orgSlug:l,locale:n,t:o}),e[37]=n,e[38]=l,e[39]=o,e[40]=g):g=e[40];let y;return e[41]!==b||e[42]!==g||e[43]!==h||e[44]!==j?(y=s.jsxs("div",{className:h,children:[j,b,g]}),e[41]=b,e[42]=g,e[43]=h,e[44]=j,e[45]=y):y=e[45],y}function zs(){const t=T.c(25),e=H(),{org:l}=U(),[n]=He();let o;t[0]!==e?(o=e("agents.title"),t[0]=e,t[1]=o):o=t[1];let i;t[2]!==o?(i=s.jsx(B.Title,{children:o}),t[2]=o,t[3]=i):i=t[3];let r;t[4]!==e?(r=e("agents.title"),t[4]=e,t[5]=r):r=t[5];let c;t[6]!==r?(c=s.jsx("h1",{className:"font-semibold text-foreground text-xl tracking-tight",children:r}),t[6]=r,t[7]=c):c=t[7];let m;t[8]!==e?(m=e("agents.subtitle"),t[8]=e,t[9]=m):m=t[9];let d;t[10]!==m?(d=s.jsx("p",{className:"text-muted-foreground text-sm",children:m}),t[10]=m,t[11]=d):d=t[11];let a;t[12]!==c||t[13]!==d?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[c,d]}),t[12]=c,t[13]=d,t[14]=a):a=t[14];let u;t[15]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"flex min-h-64 items-center justify-center",children:s.jsx(ve,{className:"size-5 text-muted-foreground"})}),t[15]=u):u=t[15];let x;t[16]!==l.slug||t[17]!==n.language?(x=s.jsx(G.Suspense,{fallback:u,children:s.jsx(Ds,{orgSlug:l.slug,locale:n.language})}),t[16]=l.slug,t[17]=n.language,t[18]=x):x=t[18];let f;t[19]!==a||t[20]!==x?(f=s.jsx(B.Content,{children:s.jsxs(B.Container,{width:"wide",className:"flex flex-col gap-6",children:[a,x]})}),t[19]=a,t[20]=x,t[21]=f):f=t[21];let h;return t[22]!==i||t[23]!==f?(h=s.jsxs(B,{children:[i,f]}),t[22]=i,t[23]=f,t[24]=h):h=t[24],h}const Hs=[{name:"Claude",Icon:Xt,size:[11,14],bg:"#D97757",fg:"#fff"},{name:"Cursor",Icon:Qt,size:[10,12],bg:"#000",fg:"#fff"},{name:"Codex",Icon:Zt,size:[10,12],bg:"#4F46E5",fg:"#fff"}];function Xe(t){const e=T.c(22),{dense:l}=t,n=l===void 0?!0:l,o=H(),{org:i}=U();let r;e[0]!==i.slug?(r={org:i.slug},e[0]=i.slug,e[1]=r):r=e[1];const c=n?"h-7 shrink-0 gap-x-2 whitespace-nowrap pl-3 pr-1.5":"flex-wrap gap-x-3 gap-y-2 py-1.5 pl-4 pr-2.5";let m;e[2]!==c?(m=z("group hidden max-w-full md:inline-flex items-center justify-center rounded-full border border-border bg-card text-sm transition-colors hover:bg-accent/60",c),e[2]=c,e[3]=m):m=e[3];let d;e[4]!==o?(d=o("home.orgHome.connectPill"),e[4]=o,e[5]=d):d=e[5];let a;e[6]!==d?(a=s.jsx("span",{className:"font-medium text-foreground",children:d}),e[6]=d,e[7]=a):a=e[7];let u;e[8]!==n?(u=Hs.map(b=>{const{name:g,Icon:y,size:N,bg:v,fg:k}=b;return s.jsx("span",{title:g,className:z("flex items-center justify-center rounded-full",n?"size-5":"size-6"),style:{backgroundColor:v,color:k},children:s.jsx(y,{size:n?N[0]:N[1]})},g)}),e[8]=n,e[9]=u):u=e[9];let x;e[10]!==u?(x=s.jsx("span",{"aria-hidden":"true",className:"flex items-center gap-1",children:u}),e[10]=u,e[11]=x):x=e[11];const f=n?"size-3":"size-3.5";let h;e[12]!==f?(h=z(f,"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"),e[12]=f,e[13]=h):h=e[13];let p;e[14]!==h?(p=s.jsx(_e,{className:h}),e[14]=h,e[15]=p):p=e[15];let j;return e[16]!==p||e[17]!==r||e[18]!==m||e[19]!==a||e[20]!==x?(j=s.jsxs(F,{to:"/$org/settings/connect",params:r,onClick:Rs,className:m,children:[a,x,p]}),e[16]=p,e[17]=r,e[18]=m,e[19]=a,e[20]=x,e[21]=j):j=e[21],j}function Rs(){return W("connect_clients_opened",{source:"org_home"})}function Qe(t){return t<12?"morning":t<18?"afternoon":"evening"}function Ze(t){const e=(t??"").trim().split(/\s+/)[0];return e||null}function Os(t){return t==="morning"?"overnight":"today"}function Bs(t,e){const l=new Date(e);return l.setHours(0,0,0,0),t==="morning"&&l.setHours(-6),l.getTime()}const Es=5;function Fs(t){const e=Date.parse(t);if(Number.isNaN(e))return"";const l=Math.max(0,Math.floor((Date.now()-e)/6e4));if(l<60)return`${l}m`;const n=Math.floor(l/60);return n<24?`${n}h`:`${Math.floor(n/24)}d`}function Ks(t){const e=T.c(18),{agents:l,orgSlug:n,projectId:o}=t,i=H();if(l.length===0)return null;let r,c,m,d;if(e[0]!==l||e[1]!==n||e[2]!==o||e[3]!==i){const u=l.slice(0,Es);r=ne,e[8]!==i?(c=i("home.running.heading"),e[8]=i,e[9]=c):c=e[9],m=l.length;let x;e[10]!==n||e[11]!==o?(x=f=>s.jsx(K,{className:"transition-colors hover:bg-accent/40",children:s.jsxs(F,{to:o?q.tasks:le.tasks,params:{org:n,agentId:o,taskKey:void 0},onClick:Ls,className:"flex min-w-0 items-center gap-2.5",children:[s.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary",children:s.jsx(Oe,{size:13,"aria-hidden":!0})}),s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:"truncate text-foreground text-sm",children:f.runTitle??f.taskTitle}),f.runTitle&&f.runTitle!==f.taskTitle&&s.jsx("span",{className:"truncate text-muted-foreground text-xs",children:f.taskTitle})]}),s.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:Fs(f.startedAt)})]})},f.threadId),e[10]=n,e[11]=o,e[12]=x):x=e[12],d=u.map(x),e[0]=l,e[1]=n,e[2]=o,e[3]=i,e[4]=r,e[5]=c,e[6]=m,e[7]=d}else r=e[4],c=e[5],m=e[6],d=e[7];let a;return e[13]!==r||e[14]!==c||e[15]!==m||e[16]!==d?(a=s.jsx(r,{label:c,count:m,children:d}),e[13]=r,e[14]=c,e[15]=m,e[16]=d,e[17]=a):a=e[17],a}function Ls(){return W("home_running_clicked")}function Ys(t,e,l,n,o,i){const r=[];if(i&&r.push(i),e>0){const c=t(e===1?"home.brief.changeOne":"home.brief.changeMany",{count:e});r.push(t(l==="overnight"?"home.brief.overnightShipped":"home.brief.todayShipped",{changes:c}))}return e===0&&n===0&&r.push(t(o>0?"home.brief.working":l==="overnight"?"home.brief.quietNight":"home.brief.quietDay")),r.push(n===0?t("home.brief.waitingNone"):t(n===1?"home.brief.waitingOne":"home.brief.waitingMany",{count:n})),r.join(" ")}function Ws(t,e){return e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long"})}function Gs(t){const e=T.c(15),{eyebrow:l,greeting:n,shipped:o,window:i,waiting:r,running:c,children:m}=t,d=H();let a;e[0]!==l?(a=s.jsx("p",{className:"text-sm text-muted-foreground",children:l}),e[0]=l,e[1]=a):a=e[1];const u=n??null;let x;e[2]!==c||e[3]!==o||e[4]!==d||e[5]!==u||e[6]!==r||e[7]!==i?(x=Ys(d,o,i,r,c,u),e[2]=c,e[3]=o,e[4]=d,e[5]=u,e[6]=r,e[7]=i,e[8]=x):x=e[8];let f;e[9]!==x?(f=s.jsx("h1",{className:"font-display max-w-[40ch] text-2xl leading-[1.22] text-foreground sm:text-[2.125rem] sm:leading-[1.18]",children:x}),e[9]=x,e[10]=f):f=e[10];let h;return e[11]!==m||e[12]!==a||e[13]!==f?(h=s.jsxs("div",{className:"flex flex-col gap-3.5",children:[a,f,m]}),e[11]=m,e[12]=a,e[13]=f,e[14]=h):h=e[14],h}const qs=5,Us={answer:{labelKey:"home.needsYou.reasonAnswer",actionKey:"home.needsYou.actionAnswer",blocking:!0,Icon:gt},review:{labelKey:"home.needsYou.reasonReview",actionKey:"home.needsYou.actionReview",blocking:!1,Icon:es},assigned:{labelKey:"home.needsYou.reasonAssigned",actionKey:"home.needsYou.actionOpen",blocking:!1,Icon:pt}};function Js(t,e){const l=[];t.reviewVerdicts.some(o=>o.verdict==="approved"&&o.verified)&&l.push(e("home.needsYou.evidenceReviewed")),(t.previewRoutes.length>0||t.threads.some(o=>o.hasPreview))&&l.push(e("home.needsYou.evidencePreview"));const n=t.threads.reduce((o,i)=>o+(i.costUsd??0),0);return n>0&&l.push(n<10?`$${n.toFixed(2)}`:`$${Math.round(n)}`),l}function Vs(t){const e=T.c(56),{task:l,index:n,orgSlug:o,projectId:i}=t,r=H();let c;e[0]!==n||e[1]!==l?(c=Ye(l,n),e[0]=n,e[1]=l,e[2]=c):c=e[2];const m=c,d=Us[yt(l)],a=m?.title;let u;e[3]!==r||e[4]!==a||e[5]!==l?(u=[a,...Js(l,r)].filter(Boolean),e[3]=r,e[4]=a,e[5]=l,e[6]=u):u=e[6];const x=u,f=i?q.tasks:le.tasks;let h;e[7]!==o||e[8]!==l?(h=We(o,l),e[7]=o,e[8]=l,e[9]=h):h=e[9];let p;e[10]!==o||e[11]!==i||e[12]!==h?(p={org:o,agentId:i,taskKey:h},e[10]=o,e[11]=i,e[12]=h,e[13]=p):p=e[13];const j=p,b=d.blocking?"text-warning":"text-muted-foreground";let g;e[14]!==b?(g=z("mt-0.5 flex size-5 shrink-0 items-center justify-center",b),e[14]=b,e[15]=g):g=e[15];let y;e[16]!==d.Icon?(y=s.jsx(d.Icon,{size:16,"aria-hidden":!0}),e[16]=d.Icon,e[17]=y):y=e[17];let N;e[18]!==g||e[19]!==y?(N=s.jsx("span",{className:g,children:y}),e[18]=g,e[19]=y,e[20]=N):N=e[20];let v;e[21]!==l.title?(v=s.jsx("span",{className:"text-sm font-medium text-foreground",children:l.title}),e[21]=l.title,e[22]=v):v=e[22];let k;e[23]!==m?(k=m&&s.jsx("span",{className:"flex size-3.5 shrink-0 items-center justify-center",children:s.jsx(ss,{icon:m.icon,name:m.title})}),e[23]=m,e[24]=k):k=e[24];const _=x.join(" · ");let w;e[25]!==_?(w=s.jsx("span",{className:"min-w-0 truncate",children:_}),e[25]=_,e[26]=w):w=e[26];let S;e[27]!==k||e[28]!==w?(S=s.jsxs("div",{className:"text-meta flex min-w-0 flex-wrap items-center gap-1.5",children:[k,w]}),e[27]=k,e[28]=w,e[29]=S):S=e[29];let $;e[30]!==v||e[31]!==S?($=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[v,S]}),e[30]=v,e[31]=S,e[32]=$):$=e[32];const C=d.blocking?"text-warning":"text-muted-foreground";let A;e[33]!==C?(A=z("hidden text-xs @lg:inline",C),e[33]=C,e[34]=A):A=e[34];let M;e[35]!==d.labelKey||e[36]!==r?(M=r(d.labelKey),e[35]=d.labelKey,e[36]=r,e[37]=M):M=e[37];let I;e[38]!==A||e[39]!==M?(I=s.jsx("span",{className:A,children:M}),e[38]=A,e[39]=M,e[40]=I):I=e[40];let P;e[41]!==d.actionKey||e[42]!==r?(P=r(d.actionKey),e[41]=d.actionKey,e[42]=r,e[43]=P):P=e[43];let D;e[44]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(_e,{size:13,"aria-hidden":!0}),e[44]=D):D=e[44];let O;e[45]!==P?(O=s.jsx(Ne,{asChild:!0,variant:"secondary",size:"sm",className:"pointer-events-none",children:s.jsxs("span",{children:[P,D]})}),e[45]=P,e[46]=O):O=e[46];let R;e[47]!==I||e[48]!==O?(R=s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[I,O]}),e[47]=I,e[48]=O,e[49]=R):R=e[49];let L;return e[50]!==j||e[51]!==$||e[52]!==R||e[53]!==N||e[54]!==f?(L=s.jsx(K,{className:"p-0",children:s.jsxs(F,{to:f,params:j,onClick:Xs,className:"flex items-start gap-3 px-5 py-3.5",children:[N,$,R]})}),e[50]=j,e[51]=$,e[52]=R,e[53]=N,e[54]=f,e[55]=L):L=e[55],L}function Xs(){return W("home_needs_you_clicked")}function Qs(t){const e=T.c(18),{tasks:l,index:n,orgSlug:o,projectId:i}=t,r=H();let c,m,d,a;if(e[0]!==n||e[1]!==o||e[2]!==i||e[3]!==r||e[4]!==l){const f=l.slice(0,qs),h=l.length-f.length;a="home-needs-you",c=ne,e[9]!==r?(m=r("home.needsYou.heading"),e[9]=r,e[10]=m):m=e[10],d=l.length===0?s.jsx(K,{children:s.jsxs("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(ts,{size:15,className:"shrink-0 text-success","aria-hidden":!0}),r("home.needsYou.allClear")]})}):s.jsxs(s.Fragment,{children:[f.map(p=>s.jsx(Vs,{task:p,index:n,orgSlug:o,projectId:i},p.id)),h>0&&s.jsx(K,{className:"py-2",children:s.jsx(F,{to:i?q.tasks:le.tasks,params:{org:o,agentId:i,taskKey:void 0},className:"text-xs text-muted-foreground hover:text-foreground hover:underline",children:r("home.needsYou.seeAll",{count:h})})})]}),e[0]=n,e[1]=o,e[2]=i,e[3]=r,e[4]=l,e[5]=c,e[6]=m,e[7]=d,e[8]=a}else c=e[5],m=e[6],d=e[7],a=e[8];let u;e[11]!==c||e[12]!==m||e[13]!==d?(u=s.jsx(c,{label:m,children:d}),e[11]=c,e[12]=m,e[13]=d,e[14]=u):u=e[14];let x;return e[15]!==a||e[16]!==u?(x=s.jsx("div",{"data-testid":a,children:u}),e[15]=a,e[16]=u,e[17]=x):x=e[17],x}const Zs={waiting:{labelKey:"home.projects.headlineWaiting",className:"text-foreground"},failed:{labelKey:"home.projects.headlineFailed",className:"text-destructive"},shipped:{labelKey:"home.projects.headlineShipped",className:"text-muted-foreground"},open:{labelKey:"home.projects.headlineOpen",className:"text-muted-foreground"}},Pe=6;function en(t){const e=T.c(10),{value:l,previous:n}=t,o=l-n;if(o===0)return null;const i=o>0?Fe:Ke,r=o>0?"text-success":"text-muted-foreground";let c;e[0]!==r?(c=z("inline-flex items-center text-xs tabular-nums",r),e[0]=r,e[1]=c):c=e[1];let m;e[2]!==i?(m=s.jsx(i,{width:11,height:11,"aria-hidden":!0}),e[2]=i,e[3]=m):m=e[3];let d;e[4]!==o?(d=Math.abs(o),e[4]=o,e[5]=d):d=e[5];let a;return e[6]!==c||e[7]!==m||e[8]!==d?(a=s.jsxs("span",{className:c,children:[m,d]}),e[6]=c,e[7]=m,e[8]=d,e[9]=a):a=e[9],a}function tn(t){const e=T.c(52),{project:l,summary:n,series:o}=t,i=H(),r=Ve();let c;e[0]!==l?(c=ns(ls(l).storeUrl),e[0]=l,e[1]=c):c=e[1];const m=c,d=n&&n.kind!=="quiet"?Zs[n.kind]:null,a=o.reduce(ln,0),u=Math.floor(o.length/2);let x;e[2]!==u||e[3]!==o?(x=o.slice(0,u).reduce(nn,0),e[2]=u,e[3]=o,e[4]=x):x=e[4];const f=x;let h;e[5]!==u||e[6]!==o?(h=o.slice(u).reduce(sn,0),e[5]=u,e[6]=o,e[7]=h):h=e[7];const p=h,j=l.title;let b;e[8]!==r||e[9]!==l.id?(b=()=>{W("org_home_project_clicked"),r(l.id)},e[8]=r,e[9]=l.id,e[10]=b):b=e[10];let g;e[11]!==l.icon||e[12]!==l.title?(g=s.jsx(we,{icon:l.icon,name:l.title,size:"xs"}),e[11]=l.icon,e[12]=l.title,e[13]=g):g=e[13];let y;e[14]!==l.title?(y=s.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:l.title}),e[14]=l.title,e[15]=y):y=e[15];let N;e[16]!==d||e[17]!==m||e[18]!==n||e[19]!==i?(N=d&&n?i(d.labelKey,{count:n.count}):m??i("home.projects.quiet"),e[16]=d,e[17]=m,e[18]=n,e[19]=i,e[20]=N):N=e[20];let v;e[21]!==N?(v=s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:N}),e[21]=N,e[22]=v):v=e[22];let k;e[23]!==y||e[24]!==v?(k=s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[y,v]}),e[23]=y,e[24]=v,e[25]=k):k=e[25];let _;e[26]!==l.title||e[27]!==i?(_=i("home.projects.rhythm",{name:l.title}),e[26]=l.title,e[27]=i,e[28]=_):_=e[28];let w;e[29]!==o||e[30]!==_?(w=s.jsx(ps,{series:o,className:"text-muted-foreground/60",label:_}),e[29]=o,e[30]=_,e[31]=w):w=e[31];const S=a>0?"text-foreground":"text-muted-foreground";let $;e[32]!==S?($=z("text-sm tabular-nums",S),e[32]=S,e[33]=$):$=e[33];let C;e[34]!==a||e[35]!==$?(C=s.jsx("span",{className:$,children:a}),e[34]=a,e[35]=$,e[36]=C):C=e[36];let A;e[37]!==p||e[38]!==f?(A=s.jsx(en,{value:p,previous:f}),e[37]=p,e[38]=f,e[39]=A):A=e[39];let M;e[40]!==C||e[41]!==A?(M=s.jsxs("span",{className:"flex w-10 shrink-0 flex-col items-end",children:[C,A]}),e[40]=C,e[41]=A,e[42]=M):M=e[42];let I;e[43]!==w||e[44]!==M?(I=s.jsxs("span",{className:"flex shrink-0 items-center gap-2.5",children:[w,M]}),e[43]=w,e[44]=M,e[45]=I):I=e[45];let P;return e[46]!==l.title||e[47]!==k||e[48]!==I||e[49]!==b||e[50]!==g?(P=s.jsx(K,{className:"transition-colors hover:bg-accent/40",children:s.jsxs("button",{type:"button","aria-label":j,onClick:b,className:"flex w-full min-w-0 items-center gap-3 text-left",children:[g,k,I]})}),e[46]=l.title,e[47]=k,e[48]=I,e[49]=b,e[50]=g,e[51]=P):P=e[51],P}function sn(t,e){return t+e}function nn(t,e){return t+e}function ln(t,e){return t+e}const rn=new Map,on=new Map;function et(t){const e=T.c(30),{projects:l,summaries:n,series:o}=t,i=n===void 0?rn:n,r=o===void 0?on:o,c=H(),{org:m}=U();let d,a,u,x,f,h;if(e[0]!==l||e[1]!==r||e[2]!==i||e[3]!==c){const b=[...l].sort(an).slice(0,Pe);a=l.length>Pe,d=ne,e[10]!==c?(u=c("home.projects.heading"),e[10]=c,e[11]=u):u=e[11],x=l.length;let g;e[12]!==c?(g=c("home.projects.shippedCaption"),e[12]=c,e[13]=g):g=e[13],e[14]!==g?(f=s.jsx("span",{className:"hidden whitespace-nowrap text-xs text-muted-foreground @[19rem]:inline",children:g}),e[14]=g,e[15]=f):f=e[15];let y;e[16]!==r||e[17]!==i?(y=N=>s.jsx(tn,{project:N,summary:i.get(N.id),series:r.get(N.id)??[]},N.id),e[16]=r,e[17]=i,e[18]=y):y=e[18],h=b.map(y),e[0]=l,e[1]=r,e[2]=i,e[3]=c,e[4]=d,e[5]=a,e[6]=u,e[7]=x,e[8]=f,e[9]=h}else d=e[4],a=e[5],u=e[6],x=e[7],f=e[8],h=e[9];let p;e[19]!==a||e[20]!==m||e[21]!==c?(p=a&&s.jsx(K,{className:"py-2",children:s.jsx(F,{to:"/$org/settings/projects",params:{org:m.slug},className:"text-xs text-muted-foreground hover:text-foreground hover:underline",children:c("home.projects.seeAll")})}),e[19]=a,e[20]=m,e[21]=c,e[22]=p):p=e[22];let j;return e[23]!==d||e[24]!==u||e[25]!==x||e[26]!==f||e[27]!==h||e[28]!==p?(j=s.jsxs(d,{label:u,count:x,action:f,children:[h,p]}),e[23]=d,e[24]=u,e[25]=x,e[26]=f,e[27]=h,e[28]=p,e[29]=j):j=e[29],j}function an(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function ge(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function cn(t){const e=ge(t.metadata)?t.metadata:{},l=ge(e.project)?e.project:{},n=ge(l.brief)?l.brief:null;if(!n)return null;const o=typeof n.text=="string"?n.text.trim():"",i=typeof n.generatedAt=="string"?n.generatedAt:"";return!o||!i||Number.isNaN(Date.parse(i))?null:{text:o,generatedAt:i}}const mn=new Set(["done","merged"]);function dn(t){const e=[...t].sort((i,r)=>(r.updatedAt??"").localeCompare(i.updatedAt??"")),l=e.find(i=>i.threads.some(r=>r.status==="failed"));if(l)return{title:l.title,kind:"failed",ago:Ae(l.updatedAt),more:0,id:l.id,keySeq:l.keySeq};const n=e.filter(i=>mn.has(i.status)),o=n[0];return o?{title:o.title,kind:"shipped",ago:Ae(o.updatedAt),more:n.length-1,id:o.id,keySeq:o.keySeq}:null}function fn(t){const e=T.c(17),{projects:l,index:n,tasks:o,orgSlug:i}=t,r=H(),c=Ve();let m,d;if(e[0]!==n||e[1]!==c||e[2]!==i||e[3]!==l||e[4]!==r||e[5]!==o){d=Symbol.for("react.early_return_sentinel");e:{const a=[];for(const p of l){const j=Gt(o,n,p.id),b=cn(p),g=dn(j);!b&&!g||a.push({project:p,written:b?.text??null,derived:g})}if(a.length===0){d=null;break e}let u;e[8]!==r?(u=r("home.whatMoved.heading"),e[8]=r,e[9]=u):u=e[9];let x;e[10]!==i?(x={org:i,taskKey:void 0},e[10]=i,e[11]=x):x=e[11];let f;e[12]!==r?(f=r("home.whatMoved.seeBoard"),e[12]=r,e[13]=f):f=e[13];let h;e[14]!==x||e[15]!==f?(h=s.jsx(F,{to:le.tasks,params:x,className:"text-xs text-muted-foreground hover:text-foreground hover:underline",children:f}),e[14]=x,e[15]=f,e[16]=h):h=e[16],m=s.jsx(ne,{label:u,action:h,children:a.map(p=>{const{project:j,written:b,derived:g}=p;return s.jsx(K,{children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("button",{type:"button",onClick:()=>{W("home_what_moved_clicked"),c(j.id)},className:"mt-0.5 shrink-0 rounded-md transition-opacity hover:opacity-80","aria-label":j.title,title:j.title,children:s.jsx(we,{icon:j.icon,name:j.title,size:"xs"})}),b?s.jsx(F,{to:q.tasks,params:{org:i,agentId:j.id,taskKey:void 0},onClick:xn,className:"min-w-0 flex-1 text-sm leading-6 text-foreground hover:underline",children:b}):g&&s.jsxs(F,{to:q.tasks,params:{org:i,agentId:j.id,taskKey:We(i,g)},onClick:un,className:"flex min-w-0 flex-1 flex-col gap-1",children:[s.jsx("span",{className:"text-sm leading-5 text-foreground hover:underline",children:g.title}),s.jsxs("span",{className:"text-meta flex flex-wrap items-center gap-1.5",children:[s.jsx("span",{className:z(g.kind==="failed"?"text-destructive":"text-success"),children:r(g.kind==="failed"?"home.whatMoved.statusFailed":"home.whatMoved.statusShipped")}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:j.title}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:g.ago}),g.more>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:r("home.whatMoved.andMore",{count:g.more})})]})]})]})]})},j.id)})})}e[0]=n,e[1]=c,e[2]=i,e[3]=l,e[4]=r,e[5]=o,e[6]=m,e[7]=d}else m=e[6],d=e[7];return d!==Symbol.for("react.early_return_sentinel")?d:m}function un(){return W("home_what_moved_clicked")}function xn(){return W("home_what_moved_clicked")}function hn(){const t=T.c(10),{org:e}=U(),l=ze();let n;t[0]!==e.id?(n=ct.orgHasSite(e.id),t[0]=e.id,t[1]=n):n=t[1];const o=!!e.id;let i;t[2]!==l?(i=()=>l.call("ORGANIZATION_HAS_SITE",{}),t[2]=l,t[3]=i):i=t[3];let r;t[4]!==n||t[5]!==o||t[6]!==i?(r={queryKey:n,staleTime:3e5,enabled:o,queryFn:i},t[4]=n,t[5]=o,t[6]=i,t[7]=r):r=t[7];const{data:c}=mt(r),m=c?.hasSite??!1;let d;return t[8]!==m?(d={hasSite:m},t[8]=m,t[9]=d):d=t[9],d}const pn="https://www.youtube.com/playlist?list=PLZ4WtTgnJfBw";function gn(t){const e=T.c(4),{className:l}=t;let n,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("path",{fill:"#FF0000",d:"M27.4 3.1c-.3-1.2-1.3-2.2-2.5-2.5C22.7 0 14 0 14 0S5.3 0 3.1.6C1.9.9.9 1.9.6 3.1.1 5.3 0 8 0 10s.1 4.7.6 6.9c.3 1.2 1.3 2.2 2.5 2.5C5.3 20 14 20 14 20s8.7 0 10.9-.6c1.2-.3 2.2-1.3 2.5-2.5.5-2.2.6-4.9.6-6.9s-.1-4.7-.6-6.9z"}),o=s.jsx("path",{fill:"#fff",d:"M11.2 14.3l7.3-4.3-7.3-4.3z"}),e[0]=n,e[1]=o):(n=e[0],o=e[1]);let i;return e[2]!==l?(i=s.jsxs("svg",{viewBox:"0 0 28 20",className:l,"aria-hidden":"true",focusable:"false",children:[n,o]}),e[2]=l,e[3]=i):i=e[3],i}function tt(){const t=T.c(27),e=H(),{hasSite:l}=hn();if(!l)return null;let n;t[0]!==e?(n=e("home.orgHome.trainingThumbnailAlt"),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o=s.jsx("img",{src:"/cms-training.jpg",alt:n,className:"size-full object-cover"}),t[2]=n,t[3]=o):o=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/20",children:s.jsx(gn,{className:"w-9"})}),t[4]=i):i=t[4];let r;t[5]!==o?(r=s.jsxs("div",{className:"relative aspect-video w-40 shrink-0 overflow-hidden rounded-lg",children:[o,i]}),t[5]=o,t[6]=r):r=t[6];let c;t[7]!==e?(c=e("home.orgHome.trainingEyebrow"),t[7]=e,t[8]=c):c=t[8];let m;t[9]!==c?(m=s.jsx("p",{className:"text-xs text-muted-foreground",children:c}),t[9]=c,t[10]=m):m=t[10];let d;t[11]!==e?(d=e("home.orgHome.trainingTitle"),t[11]=e,t[12]=d):d=t[12];let a;t[13]!==d?(a=s.jsx("h3",{className:"text-sm font-medium text-foreground",children:d}),t[13]=d,t[14]=a):a=t[14];let u;t[15]!==e?(u=e("home.orgHome.trainingDescription"),t[15]=e,t[16]=u):u=t[16];let x;t[17]!==u?(x=s.jsx("p",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:u}),t[17]=u,t[18]=x):x=t[18];let f;t[19]!==m||t[20]!==a||t[21]!==x?(f=s.jsxs("div",{className:"min-w-0 flex-1",children:[m,a,x]}),t[19]=m,t[20]=a,t[21]=x,t[22]=f):f=t[22];let h;t[23]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(_e,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"}),t[23]=h):h=t[23];let p;return t[24]!==f||t[25]!==r?(p=s.jsxs("a",{href:pn,target:"_blank",rel:"noreferrer",onClick:jn,className:"group card-shadow flex w-full items-center gap-4 rounded-2xl bg-card p-4 text-left transition-colors hover:bg-accent/30",children:[r,f,h]}),t[24]=f,t[25]=r,t[26]=p):p=t[26],p}function jn(){return W("cms_training_opened",{source:"org_home"})}const bn={morning:{named:"home.orgHome.greetingMorning",bare:"home.orgHome.greetingMorningBare"},afternoon:{named:"home.orgHome.greetingAfternoon",bare:"home.orgHome.greetingAfternoonBare"},evening:{named:"home.orgHome.greetingEvening",bare:"home.orgHome.greetingEveningBare"}};function yn(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex min-h-64 items-center justify-center",children:s.jsx(ve,{className:"size-5 text-muted-foreground"})}),t[0]=e):e=t[0],e}function Nn(t){const e=T.c(107),{canManageProjects:l,eyebrow:n,greeting:o,slot:i}=t,{org:r}=U(),{data:c}=ke.useSession();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={pageSize:1e3},e[0]=m):m=e[0];const d=fe(m),a=Se(),u=Le().data,{opens:x}=Nt(r.slug);let f,h,p,j,b,g,y,N,v,k,_,w,S,$,C;if(e[1]!==d||e[2]!==u||e[3]!==l||e[4]!==n||e[5]!==o||e[6]!==r.id||e[7]!==c?.user?.id||e[8]!==i||e[9]!==a){g=Symbol.for("react.early_return_sentinel");e:{let oe;if(e[25]!==r.id?(oe=E=>E.id!==r.id,e[25]=r.id,e[26]=oe):oe=e[26],p=me(d).filter(oe),p.length===0){let E;e[27]!==l?(E=s.jsx(is,{canCreate:l}),e[27]=l,e[28]=E):E=e[28],g=E;break e}h=de(p);const ue=c?.user?.id;let ie;e[29]!==ue||e[30]!==a?(ie=vt(a,ue),e[29]=ue,e[30]=a,e[31]=ie):ie=e[31],C=ie;let ae;e[32]!==i||e[33]!==a?(ae=kt(a,Bs(i,new Date)),e[32]=i,e[33]=a,e[34]=ae):ae=e[34];const xe=ae;j=new Map(p.map(E=>[E.id,wt(h,a,E.id,Te)]));const $e=Ee(h,a),st=new Map($e.byProject.slice(0,5).map(E=>{const{projectId:Ce}=E;return[Ce,_t(h,a,Ce)]}));$="flex flex-col gap-10";let te;e[35]!==i?(te=Os(i),e[35]=i,e[36]=te):te=e[36];const nt=C.length;let se;e[37]!==a?(se=je(a),e[37]=a,e[38]=se):se=e[38],e[39]!==n||e[40]!==o||e[41]!==xe||e[42]!==te||e[43]!==se.length||e[44]!==C.length?(b=s.jsx(Gs,{eyebrow:n,greeting:o,shipped:xe,window:te,waiting:nt,running:se.length}),e[39]=n,e[40]=o,e[41]=xe,e[42]=te,e[43]=se.length,e[44]=C.length,e[45]=b):b=e[45],f=Ss,y=$e,e[46]!==a?(N=St(a),e[46]=a,e[47]=N):N=e[47],v=st,e[48]!==a?(k=Be(a),e[48]=a,e[49]=k):k=e[49],e[50]!==a?(_=$t(a,Te),e[50]=a,e[51]=_):_=e[51],e[52]!==u?(w=u?{running:u.filter(wn).length,paused:u.filter(kn).length}:null,e[52]=u,e[53]=w):w=e[53],S=new Map(p.map(vn))}e[1]=d,e[2]=u,e[3]=l,e[4]=n,e[5]=o,e[6]=r.id,e[7]=c?.user?.id,e[8]=i,e[9]=a,e[10]=f,e[11]=h,e[12]=p,e[13]=j,e[14]=b,e[15]=g,e[16]=y,e[17]=N,e[18]=v,e[19]=k,e[20]=_,e[21]=w,e[22]=S,e[23]=$,e[24]=C}else f=e[10],h=e[11],p=e[12],j=e[13],b=e[14],g=e[15],y=e[16],N=e[17],v=e[18],k=e[19],_=e[20],w=e[21],S=e[22],$=e[23],C=e[24];if(g!==Symbol.for("react.early_return_sentinel"))return g;let A;e[54]!==f||e[55]!==r.slug||e[56]!==y||e[57]!==N||e[58]!==v||e[59]!==k||e[60]!==_||e[61]!==w||e[62]!==S?(A=s.jsx(f,{cost:y,costRhythm:N,costSeriesByProject:v,runs:k,runsRhythm:_,automations:w,projectsById:S,orgSlug:r.slug}),e[54]=f,e[55]=r.slug,e[56]=y,e[57]=N,e[58]=v,e[59]=k,e[60]=_,e[61]=w,e[62]=S,e[63]=A):A=e[63];let M;e[64]!==x||e[65]!==r.slug||e[66]!==p?(M=s.jsx(rs,{projects:p,orgSlug:r.slug,opens:x}),e[64]=x,e[65]=r.slug,e[66]=p,e[67]=M):M=e[67];let I;e[68]!==h||e[69]!==r.slug||e[70]!==C?(I=s.jsx(Qs,{tasks:C,index:h,orgSlug:r.slug}),e[68]=h,e[69]=r.slug,e[70]=C,e[71]=I):I=e[71];let P;e[72]!==h||e[73]!==r.slug||e[74]!==p||e[75]!==a?(P=s.jsx(fn,{projects:p,index:h,tasks:a,orgSlug:r.slug}),e[72]=h,e[73]=r.slug,e[74]=p,e[75]=a,e[76]=P):P=e[76];let D,O;e[77]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(tt,{}),O=s.jsx(qt,{}),e[77]=D,e[78]=O):(D=e[77],O=e[78]);let R;e[79]!==I||e[80]!==P?(R=s.jsxs(s.Fragment,{children:[I,P,D,O]}),e[79]=I,e[80]=P,e[81]=R):R=e[81];const L=c?.user?.id;let J;e[82]!==h||e[83]!==L||e[84]!==a?(J=Ct(h,a,L),e[82]=h,e[83]=L,e[84]=a,e[85]=J):J=e[85];let V;e[86]!==p||e[87]!==j||e[88]!==J?(V=s.jsx(et,{projects:p,summaries:J,series:j}),e[86]=p,e[87]=j,e[88]=J,e[89]=V):V=e[89];let X;e[90]!==a?(X=je(a),e[90]=a,e[91]=X):X=e[91];let Q;e[92]!==r.slug||e[93]!==X?(Q=s.jsx(Ks,{agents:X,orgSlug:r.slug}),e[92]=r.slug,e[93]=X,e[94]=Q):Q=e[94];let Z;e[95]!==V||e[96]!==Q?(Z=s.jsxs(s.Fragment,{children:[V,Q]}),e[95]=V,e[96]=Q,e[97]=Z):Z=e[97];let ee;e[98]!==R||e[99]!==Z?(ee=s.jsx(us,{main:R,aside:Z}),e[98]=R,e[99]=Z,e[100]=ee):ee=e[100];let re;return e[101]!==b||e[102]!==A||e[103]!==M||e[104]!==ee||e[105]!==$?(re=s.jsxs("div",{className:$,children:[b,A,M,ee]}),e[101]=b,e[102]=A,e[103]=M,e[104]=ee,e[105]=$,e[106]=re):re=e[106],re}function vn(t){return[t.id,t]}function kn(t){return!t.active}function wn(t){return t.active}function _n(){const t=T.c(25),e=H(),[l]=He(),n=Je("home_task_intake_enabled"),{data:o}=ke.useSession(),{granted:i}=Re("agents:manage");let r,c,m;if(t[0]!==l.language||t[1]!==o?.user?.name||t[2]!==e){const g=new Date,y=Ze(o?.user?.name);c=Qe(g.getHours());const N=bn[c];r=Ws(l.language,g),m=y?e(N.named,{name:y}):e(N.bare),t[0]=l.language,t[1]=o?.user?.name,t[2]=e,t[3]=r,t[4]=c,t[5]=m}else r=t[3],c=t[4],m=t[5];const d=m;let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Xe,{}),t[6]=a):a=t[6];let u;t[7]!==i?(u=i&&s.jsx(os,{source:"org_home_header"}),t[7]=i,t[8]=u):u=t[8];let x;t[9]!==u?(x=s.jsx(B.Actions,{secondary:a,children:u}),t[9]=u,t[10]=x):x=t[10];let f;t[11]!==n?(f=n&&s.jsx(G.Suspense,{fallback:null,children:s.jsx(qe,{children:s.jsx(Ue,{children:s.jsx(Ge,{homeTaskComposer:!0})})})}),t[11]=n,t[12]=f):f=t[12];let h;t[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(yn,{}),t[13]=h):h=t[13];let p;t[14]!==i||t[15]!==r||t[16]!==d||t[17]!==c?(p=s.jsx(G.Suspense,{fallback:h,children:s.jsx(Nn,{canManageProjects:i,eyebrow:r,greeting:d,slot:c})}),t[14]=i,t[15]=r,t[16]=d,t[17]=c,t[18]=p):p=t[18];let j;t[19]!==f||t[20]!==p?(j=s.jsx(B.Content,{children:s.jsxs(B.Container,{width:"wide",className:"flex min-h-full flex-col gap-10",children:[f,p]})}),t[19]=f,t[20]=p,t[21]=j):j=t[21];let b;return t[22]!==x||t[23]!==j?(b=s.jsxs(B,{children:[x,j]}),t[22]=x,t[23]=j,t[24]=b):b=t[24],b}const Sn={morning:{named:"home.orgHome.greetingMorning",bare:"home.orgHome.greetingMorningBare"},afternoon:{named:"home.orgHome.greetingAfternoon",bare:"home.orgHome.greetingAfternoonBare"},evening:{named:"home.orgHome.greetingEvening",bare:"home.orgHome.greetingEveningBare"}};function $n(){const t=T.c(8),e=H();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(cs,{className:"size-4 shrink-0 text-muted-foreground"}),t[0]=l):l=t[0];let n;t[1]!==e?(n=e("home.orgHome.searchPlaceholder"),t[1]=e,t[2]=n):n=t[2];let o;t[3]!==n?(o=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:n}),t[3]=n,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("kbd",{className:"shrink-0 rounded-md border border-border bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground",children:"⌘K"}),t[5]=i):i=t[5];let r;return t[6]!==o?(r=s.jsxs("button",{type:"button","data-testid":"org-home-search",onClick:Cn,className:"card-shadow flex w-full items-center gap-2 rounded-xl bg-card px-3 py-2.5 text-left transition-colors hover:bg-accent/60",children:[l,o,i]}),t[6]=o,t[7]=r):r=t[7],r}function Cn(){W("command_palette_opened",{source:"org_home_search"}),fs()}function De(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex min-h-64 items-center justify-center",children:s.jsx(ve,{className:"size-5 text-muted-foreground"})}),t[0]=e):e=t[0],e}function Tn(t){const e=T.c(28),{canManageAgents:l}=t,n=H(),{org:o}=U();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={pageSize:1e3},e[0]=i):i=e[0];const r=fe(i),c=Ut();let m,d,a;if(e[1]!==r||e[2]!==l||e[3]!==o||e[4]!==n||e[5]!==c){a=Symbol.for("react.early_return_sentinel");e:{let p;if(e[9]!==o?(p=j=>j.id!==o.id,e[9]=o,e[10]=p):p=e[10],m=me(r).filter(p),m.length===0){let j;e[11]!==n?(j=n("routes.agentsList.noAgentsYet"),e[11]=n,e[12]=j):j=e[12];let b;e[13]!==l||e[14]!==n?(b=n(l?"home.orgAgents.importToGetStarted":"routes.agentsList.askAdminToCreate"),e[13]=l,e[14]=n,e[15]=b):b=e[15];let g;e[16]!==j||e[17]!==b?(g=s.jsx("div",{className:"flex items-center justify-center py-10",children:s.jsx(ms,{actions:!1,image:null,title:j,description:b})}),e[16]=j,e[17]=b,e[18]=g):g=e[18],a=g;break e}d=Jt(de(m),c,null)}e[1]=r,e[2]=l,e[3]=o,e[4]=n,e[5]=c,e[6]=m,e[7]=d,e[8]=a}else m=e[6],d=e[7],a=e[8];if(a!==Symbol.for("react.early_return_sentinel"))return a;const u=d.length>0;let x;e[19]!==m?(x=s.jsx(et,{projects:m}),e[19]=m,e[20]=x):x=e[20];let f;e[21]!==m||e[22]!==u||e[23]!==c?(f=u&&s.jsx(Vt,{projects:m,tasks:c}),e[21]=m,e[22]=u,e[23]=c,e[24]=f):f=e[24];let h;return e[25]!==x||e[26]!==f?(h=s.jsxs("div",{className:"flex flex-col gap-12",children:[x,f]}),e[25]=x,e[26]=f,e[27]=h):h=e[27],h}function An(){const t=T.c(55),e=H(),l=Je("home_task_intake_enabled"),{data:n}=ke.useSession(),[o,i]=G.useState(!1),{granted:r}=Re("agents:manage");let c,m,d,a,u,x,f,h,p,j,b,g;if(t[0]!==r||t[1]!==n?.user?.name||t[2]!==e){const M=Ze(n?.user?.name),I=Sn[Qe(new Date().getHours())];let P;t[15]!==e?(P=O=>s.jsxs(Ne,{size:"sm",variant:"default",onClick:()=>{W("agent_create_clicked",{source:O,method:"github"}),i(!0)},children:[s.jsx(as,{size:14}),e("home.orgAgents.importFromGitHub")]}),t[15]=e,t[16]=P):P=t[16];const D=P;d=B,t[17]!==r||t[18]!==D?(g=r&&s.jsx(B.Actions,{children:D("org_home")}),t[17]=r,t[18]=D,t[19]=g):g=t[19],m=B.Content,c=B.Container,j="reading",b="flex flex-col gap-12",f="flex flex-col items-center gap-12 text-center",t[20]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Xe,{dense:!1}),p=s.jsx(tt,{}),t[20]=h,t[21]=p):(h=t[20],p=t[21]),x="flex w-full flex-col items-center gap-5",a="text-3xl font-medium tracking-tight text-foreground",u=M?e(I.named,{name:M}):e(I.bare),t[0]=r,t[1]=n?.user?.name,t[2]=e,t[3]=c,t[4]=m,t[5]=d,t[6]=a,t[7]=u,t[8]=x,t[9]=f,t[10]=h,t[11]=p,t[12]=j,t[13]=b,t[14]=g}else c=t[3],m=t[4],d=t[5],a=t[6],u=t[7],x=t[8],f=t[9],h=t[10],p=t[11],j=t[12],b=t[13],g=t[14];let y;t[22]!==a||t[23]!==u?(y=s.jsx("h2",{className:a,children:u}),t[22]=a,t[23]=u,t[24]=y):y=t[24];let N;t[25]!==l?(N=l?s.jsx(G.Suspense,{fallback:s.jsx(De,{}),children:s.jsx(qe,{children:s.jsx(Ue,{children:s.jsx(Ge,{homeTaskComposer:!0})})})}):s.jsx($n,{}),t[25]=l,t[26]=N):N=t[26];let v;t[27]!==N||t[28]!==x||t[29]!==y?(v=s.jsxs("div",{className:x,children:[y,N]}),t[27]=N,t[28]=x,t[29]=y,t[30]=v):v=t[30];let k;t[31]!==v||t[32]!==f||t[33]!==h||t[34]!==p?(k=s.jsxs("div",{className:f,children:[h,p,v]}),t[31]=v,t[32]=f,t[33]=h,t[34]=p,t[35]=k):k=t[35];let _;t[36]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(De,{}),t[36]=_):_=t[36];let w;t[37]!==r?(w=s.jsx(G.Suspense,{fallback:_,children:s.jsx(Tn,{canManageAgents:r})}),t[37]=r,t[38]=w):w=t[38];let S;t[39]!==c||t[40]!==k||t[41]!==w||t[42]!==j||t[43]!==b?(S=s.jsxs(c,{width:j,className:b,children:[k,w]}),t[39]=c,t[40]=k,t[41]=w,t[42]=j,t[43]=b,t[44]=S):S=t[44];let $;t[45]!==m||t[46]!==S?($=s.jsx(m,{children:S}),t[45]=m,t[46]=S,t[47]=$):$=t[47];let C;t[48]!==o?(C=s.jsx(ds,{open:o,onOpenChange:i}),t[48]=o,t[49]=C):C=t[49];let A;return t[50]!==d||t[51]!==$||t[52]!==C||t[53]!==g?(A=s.jsxs(d,{children:[g,$,C]}),t[50]=d,t[51]=$,t[52]=C,t[53]=g,t[54]=A):A=t[54],A}function In(){const t=T.c(4),e=dt();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const n=ft(l);if(!e){let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(An,{}),t[1]=i):i=t[1],i}let o;return t[2]!==n.view?(o=n.view==="agents"?s.jsx(zs,{}):s.jsx(_n,{}),t[2]=n.view,t[3]=o):o=t[3],o}function vo(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ut.Content,{children:s.jsx(In,{})}),t[0]=e):e=t[0],e}export{vo as default};
@@ -1 +1 @@
1
- import{c as f,j as p,B as h}from"./index-D3VyLkC3.js";import{T as j,a as v,b as T}from"./tooltip-BUwCxmad.js";function B(d){const t=f.c(19);let e,o,i,n,r,a;t[0]!==d?({label:o,tooltipSide:n,variant:r,size:a,children:e,...i}=d,t[0]=d,t[1]=e,t[2]=o,t[3]=i,t[4]=n,t[5]=r,t[6]=a):(e=t[1],o=t[2],i=t[3],n=t[4],r=t[5],a=t[6]);const m=n===void 0?"top":n,u=r===void 0?"ghost":r,x=a===void 0?"icon-sm":a;let s;t[7]!==e||t[8]!==o||t[9]!==i||t[10]!==x||t[11]!==u?(s=p.jsx(j,{asChild:!0,children:p.jsx(h,{"data-slot":"icon-button","aria-label":o,variant:u,size:x,...i,children:e})}),t[7]=e,t[8]=o,t[9]=i,t[10]=x,t[11]=u,t[12]=s):s=t[12];let l;t[13]!==o||t[14]!==m?(l=p.jsx(v,{side:m,children:o}),t[13]=o,t[14]=m,t[15]=l):l=t[15];let c;return t[16]!==s||t[17]!==l?(c=p.jsxs(T,{children:[s,l]}),t[16]=s,t[17]=l,t[18]=c):c=t[18],c}export{B as I};
1
+ import{c as f,j as p,B as h}from"./index-DAhfV5vh.js";import{T as j,a as v,b as T}from"./tooltip-cYDDz2Pp.js";function B(d){const t=f.c(19);let e,o,i,n,r,a;t[0]!==d?({label:o,tooltipSide:n,variant:r,size:a,children:e,...i}=d,t[0]=d,t[1]=e,t[2]=o,t[3]=i,t[4]=n,t[5]=r,t[6]=a):(e=t[1],o=t[2],i=t[3],n=t[4],r=t[5],a=t[6]);const m=n===void 0?"top":n,u=r===void 0?"ghost":r,x=a===void 0?"icon-sm":a;let s;t[7]!==e||t[8]!==o||t[9]!==i||t[10]!==x||t[11]!==u?(s=p.jsx(j,{asChild:!0,children:p.jsx(h,{"data-slot":"icon-button","aria-label":o,variant:u,size:x,...i,children:e})}),t[7]=e,t[8]=o,t[9]=i,t[10]=x,t[11]=u,t[12]=s):s=t[12];let l;t[13]!==o||t[14]!==m?(l=p.jsx(v,{side:m,children:o}),t[13]=o,t[14]=m,t[15]=l):l=t[15];let c;return t[16]!==s||t[17]!==l?(c=p.jsxs(T,{children:[s,l]}),t[16]=s,t[17]=l,t[18]=c):c=t[18],c}export{B as I};
@@ -1 +1 @@
1
- import{c as B,X as A,ay as le,l as L,j as r,E as ne,r as O,b as $,t as z,h as H,d as U,q as G,B as V}from"./index-D3VyLkC3.js";import{n as ae}from"./ArrowUp-BcguyIxa.js";import{c as oe,a as X,f as ie,u as ce,T as de,A as me,h as ue,b as fe,i as pe,j as xe}from"./chat-context-Crr9YCN0.js";import{s as he,g as Q,d as ge}from"./gateway-client-DqqeM3yS.js";import{c as F,T as be,a as ye,b as je}from"./tooltip-BUwCxmad.js";import{c as W,d as Y,b as Z,D as J,h as ve}from"./dialog-C_zHR8DK.js";import{d as we,b as Ne,a as Ce,D as Se}from"./drawer-CeyU31cS.js";import{C as Te}from"./collection-search-DZ1wZYuR.js";import{u as Pe}from"./use-mobile-Dd6KUtd1.js";import{u as ke}from"./use-mcp-client-DjhhnAr3.js";import{u as Ee,g as De}from"./use-mcp-prompts-CPGSJM8z.js";import{c as _e,P as Ie}from"./index-D-s3ZvIF.js";import{T as Me,c as Be,b as Oe,d as Le,H as Re}from"./input-DJjbA9M9.js";import{u as $e,a as Ae,S as Fe,M as q}from"./pair-qre124N2.js";import{a as ze}from"./use-panel-navigate-pf_bvwna.js";import{u as He}from"./thread-intent-CXrPEeI-.js";import{N as Ge}from"./decopilot-4kqD0JAa.js";import{i as qe}from"./LinkBroken01-cRHkOCv3.js";import{e as ee}from"./agent-icon-DebFssce.js";import{e as Ke}from"./use-decopilot-events-Coi59geF.js";import{u as Ue}from"./use-deco-credits-BWRF6eDW.js";import{F as Ve}from"./feature-paywall-DCy88YOr.js";import{i as Xe}from"./AlertCircle-O5yKT_wD.js";const K=3,te="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",Qe="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function se(t){const e=B.c(46),{item:l,onSelect:n,isLoading:s,isDisabled:a,variant:d}=t,o=d===void 0?"pill":d,{prompt:i}=l;let m;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const P=Q(i._meta);m=i.title??ge(i.name,P),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=m}else m=e[3];const c=m,u=i.description||null;if(o==="card"){let P;e[4]!==n||e[5]!==i?(P=()=>n(i),e[4]=n,e[5]=i,e[6]=P):P=e[6];const _=a||s,I=s&&"bg-accent/40",k=(a||s)&&"cursor-not-allowed opacity-50";let E;e[7]!==I||e[8]!==k?(E=L(Qe,"hover:bg-accent/60 text-foreground",I,k),e[7]=I,e[8]=k,e[9]=E):E=e[9];let h;e[10]!==c?(h=r.jsx("span",{className:"font-medium truncate capitalize",children:c}),e[10]=c,e[11]=h):h=e[11];let v;e[12]!==s?(v=s&&r.jsx(H,{size:"xs"}),e[12]=s,e[13]=v):v=e[13];let p;e[14]!==h||e[15]!==v?(p=r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h,v]}),e[14]=h,e[15]=v,e[16]=p):p=e[16];let D;e[17]!==u?(D=u&&r.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:u}),e[17]=u,e[18]=D):D=e[18];let M;return e[19]!==p||e[20]!==D||e[21]!==P||e[22]!==_||e[23]!==E?(M=r.jsxs("button",{type:"button",onClick:P,disabled:_,className:E,children:[p,D]}),e[19]=p,e[20]=D,e[21]=P,e[22]=_,e[23]=E,e[24]=M):M=e[24],M}let f;e[25]!==n||e[26]!==i?(f=()=>n(i),e[25]=n,e[26]=i,e[27]=f):f=e[27];const w=a||s,y=s&&"bg-muted/50",j=(a||s)&&"cursor-not-allowed opacity-50";let x;e[28]!==y||e[29]!==j?(x=L(te,"hover:bg-muted/70 hover:text-foreground",y,j),e[28]=y,e[29]=j,e[30]=x):x=e[30];let b;e[31]!==c?(b=r.jsx("span",{className:"capitalize",children:c}),e[31]=c,e[32]=b):b=e[32];let g;e[33]!==s?(g=s&&r.jsx(H,{size:"xs"}),e[33]=s,e[34]=g):g=e[34];let N;e[35]!==f||e[36]!==w||e[37]!==x||e[38]!==b||e[39]!==g?(N=r.jsx(be,{asChild:!0,children:r.jsxs("button",{type:"button",onClick:f,disabled:w,className:x,children:[b,g]})}),e[35]=f,e[36]=w,e[37]=x,e[38]=b,e[39]=g,e[40]=N):N=e[40];const C=u??c;let S;e[41]!==C?(S=r.jsx(ye,{side:"top",className:"max-w-xs",children:r.jsx("p",{className:"text-xs",children:C})}),e[41]=C,e[42]=S):S=e[42];let T;return e[43]!==N||e[44]!==S?(T=r.jsxs(je,{delayDuration:400,children:[N,S]}),e[43]=N,e[44]=S,e[45]=T):T=e[45],T}function We(t){const e=B.c(61),{items:l,open:n,onOpenChange:s,onSelect:a,loadingPrompt:d}=t,o=$(),[i,m]=O.useState(""),c=!!d;let u;e[0]!==l||e[1]!==i?(u=i.trim()?l.filter(h=>{const v=i.toLowerCase();return h.prompt.name.toLowerCase().includes(v)||(h.prompt.title??"").toLowerCase().includes(v)||(h.prompt.description??"").toLowerCase().includes(v)}):l,e[0]=l,e[1]=i,e[2]=u):u=e[2];const f=u,w=Pe();let y;e[3]!==f.length||e[4]!==i||e[5]!==o?(y=f.length===0&&r.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:o("chat.iceBreakers.noPromptsMatch",{search:i})}),e[3]=f.length,e[4]=i,e[5]=o,e[6]=y):y=e[6];let j;if(e[7]!==f||e[8]!==c||e[9]!==d?.name||e[10]!==s||e[11]!==a){let h;e[13]!==c||e[14]!==d?.name||e[15]!==s||e[16]!==a?(h=v=>r.jsx(se,{item:v,variant:"card",onSelect:p=>{s(!1),a(p)},isLoading:d?.name===v.prompt.name,isDisabled:c&&d?.name!==v.prompt.name},v.prompt.name),e[13]=c,e[14]=d?.name,e[15]=s,e[16]=a,e[17]=h):h=e[17],j=f.map(h),e[7]=f,e[8]=c,e[9]=d?.name,e[10]=s,e[11]=a,e[12]=j}else j=e[12];let x;e[18]!==y||e[19]!==j?(x=r.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[y,j]})}),e[18]=y,e[19]=j,e[20]=x):x=e[20];const b=x;let g;e[21]!==o?(g=o("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=o,e[22]=g):g=e[22];let N;e[23]===Symbol.for("react.memo_cache_sentinel")?(N=h=>{h.key==="Escape"&&m("")},e[23]=N):N=e[23];let C;e[24]!==i||e[25]!==g?(C=r.jsx(Te,{value:i,onChange:m,placeholder:g,onKeyDown:N}),e[24]=i,e[25]=g,e[26]=C):C=e[26];const S=C;if(w){let h;e[27]!==o?(h=o("chat.iceBreakers.allPromptsTitle"),e[27]=o,e[28]=h):h=e[28];let v;e[29]!==h?(v=r.jsx(we,{className:"sr-only",children:r.jsx(Ne,{children:h})}),e[29]=h,e[30]=v):v=e[30];let p;e[31]!==o?(p=o("chat.iceBreakers.promptsLabel"),e[31]=o,e[32]=p):p=e[32];let D;e[33]!==p?(D=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:p})}),e[33]=p,e[34]=D):D=e[34];let M;e[35]!==b||e[36]!==S||e[37]!==D||e[38]!==v?(M=r.jsxs(Ce,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[v,D,S,b]}),e[35]=b,e[36]=S,e[37]=D,e[38]=v,e[39]=M):M=e[39];let R;return e[40]!==s||e[41]!==n||e[42]!==M?(R=r.jsx(F,{delayDuration:400,children:r.jsx(Se,{open:n,onOpenChange:s,children:M})}),e[40]=s,e[41]=n,e[42]=M,e[43]=R):R=e[43],R}let T;e[44]!==o?(T=o("chat.iceBreakers.allPromptsTitle"),e[44]=o,e[45]=T):T=e[45];let P;e[46]!==T?(P=r.jsx(W,{className:"sr-only",children:r.jsx(Y,{children:T})}),e[46]=T,e[47]=P):P=e[47];let _;e[48]!==o?(_=o("chat.iceBreakers.promptsLabel"),e[48]=o,e[49]=_):_=e[49];let I;e[50]!==_?(I=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:_})}),e[50]=_,e[51]=I):I=e[51];let k;e[52]!==b||e[53]!==S||e[54]!==I||e[55]!==P?(k=r.jsxs(Z,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[P,I,S,b]}),e[52]=b,e[53]=S,e[54]=I,e[55]=P,e[56]=k):k=e[56];let E;return e[57]!==s||e[58]!==n||e[59]!==k?(E=r.jsx(F,{delayDuration:400,children:r.jsx(J,{open:n,onOpenChange:s,children:k})}),e[57]=s,e[58]=n,e[59]=k,e[60]=E):E=e[60],E}function Ye(t){const e=B.c(30),{items:l,onSelect:n,loadingPrompt:s,className:a}=t,d=$(),[o,i]=O.useState(!1);if(l.length===0)return null;let m,c,u,f,w;if(e[0]!==a||e[1]!==l||e[2]!==s||e[3]!==n||e[4]!==d){const b=l.slice(0,K),g=l.slice(K),N=!!s;let C;e[10]!==N||e[11]!==s?.name||e[12]!==n?(C=T=>r.jsx(se,{item:T,onSelect:n,isLoading:s?.name===T.prompt.name,isDisabled:N&&s?.name!==T.prompt.name},T.prompt.name),e[10]=N,e[11]=s?.name,e[12]=n,e[13]=C):C=e[13];const S=b.map(C);m=F,w=400,e[14]!==a?(c=L("w-full flex flex-wrap gap-2 justify-center",a),e[14]=a,e[15]=c):c=e[15],u=S,f=g.length>0&&r.jsx("button",{type:"button",disabled:N,onClick:()=>i(!0),className:L(te,"hover:bg-muted/70 hover:text-foreground",N&&"opacity-50 cursor-not-allowed"),children:d("chat.iceBreakers.moreButton",{count:g.length})}),e[0]=a,e[1]=l,e[2]=s,e[3]=n,e[4]=d,e[5]=m,e[6]=c,e[7]=u,e[8]=f,e[9]=w}else m=e[5],c=e[6],u=e[7],f=e[8],w=e[9];let y;e[16]!==c||e[17]!==u||e[18]!==f?(y=r.jsxs("div",{className:c,children:[u,f]}),e[16]=c,e[17]=u,e[18]=f,e[19]=y):y=e[19];let j;e[20]!==l||e[21]!==s||e[22]!==o||e[23]!==n?(j=r.jsx(We,{items:l,open:o,onOpenChange:i,onSelect:n,loadingPrompt:s}),e[20]=l,e[21]=s,e[22]=o,e[23]=n,e[24]=j):j=e[24];let x;return e[25]!==m||e[26]!==w||e[27]!==y||e[28]!==j?(x=r.jsxs(m,{delayDuration:w,children:[y,j]}),e[25]=m,e[26]=w,e[27]=y,e[28]=j,e[29]=x):x=e[29],x}function Ze(){return null}function Je(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function et(t){const e=B.c(31),{connectionId:l}=t,n=$(),{sendMessage:s}=X(),{org:a}=A();let d;e[0]!==l||e[1]!==a.id||e[2]!==a.slug?(d={connectionId:l,orgId:a.id,orgSlug:a.slug},e[0]=l,e[1]=a.id,e[2]=a.slug,e[3]=d):d=e[3];const o=ke(d);let i;e[4]!==o?(i={client:o,staleTime:6e4},e[4]=o,e[5]=i):i=e[5];const{data:m}=Ee(i);let c;e[6]!==m?.prompts?(c=m?.prompts??[],e[6]=m?.prompts,e[7]=c):c=e[7];const u=c;let f;e[8]!==u?(f=u.map(tt),e[8]=u,e[9]=f):f=e[9];const w=f;let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y={stage:"idle"},e[10]=y):y=e[10];const[j,x]=O.useReducer(Je,y),[b,g]=O.useState(null);let N;e[11]!==o||e[12]!==s||e[13]!==n?(N=async(p,D)=>{if(!o){z.error(n("chat.iceBreakers.mcpClientNotAvailable")),x({type:"RESET"});return}try{const M=await De(o,p.name,D);x({type:"RESET"});const R={type:"doc",content:[{type:"paragraph",content:[_e({id:p.name,name:he(p.name,Q(p._meta)),metadata:M.messages,char:"/",kind:"prompt",args:D}),{type:"text",text:" "}]}]};await s(R)}catch(M){console.error("[ice-breakers] Failed to fetch prompt:",M),z.error(n("chat.iceBreakers.failedToLoadPrompt")),x({type:"RESET"})}},e[11]=o,e[12]=s,e[13]=n,e[14]=N):N=e[14];const C=N;let S;e[15]!==C?(S=async p=>{if(p.arguments&&p.arguments.length>0){x({type:"SELECT_PROMPT",prompt:p}),g(p);return}x({type:"START_LOADING",prompt:p}),await C(p)},e[15]=C,e[16]=S):S=e[16];const T=S;let P;e[17]!==b||e[18]!==C?(P=async p=>{b&&(x({type:"START_LOADING",prompt:b,arguments:p}),g(null),await C(b,p))},e[17]=b,e[18]=C,e[19]=P):P=e[19];const _=P;if(w.length===0)return null;const I=j.stage==="loading"?j.prompt:null;let k;e[20]!==T||e[21]!==w||e[22]!==I?(k=r.jsx(Ye,{items:w,onSelect:T,loadingPrompt:I}),e[20]=T,e[21]=w,e[22]=I,e[23]=k):k=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{g(null),x({type:"RESET"})},e[24]=E):E=e[24];let h;e[25]!==b||e[26]!==_?(h=r.jsx(Ie,{prompt:b,setPrompt:E,onSubmit:_}),e[25]=b,e[26]=_,e[27]=h):h=e[27];let v;return e[28]!==k||e[29]!==h?(v=r.jsxs(r.Fragment,{children:[k,h]}),e[28]=k,e[29]=h,e[30]=v):v=e[30],v}function tt(t){return{prompt:t}}function st(t){const e=B.c(13),{className:l}=t,{selectedVirtualMcp:n}=oe(),{org:s}=A();let a;e[0]!==s.id?(a=le(s.id),e[0]=s.id,e[1]=a):a=e[1];const d=a.id,o=n?.id??d;let i;e[2]!==l?(i=L("w-full @container",l),e[2]=l,e[3]=i):i=e[3];const m=o??"default";let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx(Ze,{}),e[4]=c):c=e[4];let u;e[5]!==o?(u=r.jsx(et,{connectionId:o}),e[5]=o,e[6]=u):u=e[6];let f;e[7]!==m||e[8]!==u?(f=r.jsx(ne,{fallback:null,children:r.jsx(O.Suspense,{fallback:c,children:u},m)}),e[7]=m,e[8]=u,e[9]=f):f=e[9];let w;return e[10]!==i||e[11]!==f?(w=r.jsx("div",{className:i,children:f}),e[10]=i,e[11]=f,e[12]=w):w=e[12],w}function rt(t){let e=0;for(const l of t)for(const n of l.parts??[]){const s=n;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function lt(){const t=B.c(8),{openPanel:e}=ze(),l=He(),n=ie()?.messages??[],s=ce()?.taskId??null;let a;t[0]!==n?(a=rt(n),t[0]=n,t[1]=a):a=t[1];const d=a,o=O.useRef(null),i=O.useRef(null);let m,c;t[2]!==d||t[3]!==l||t[4]!==e||t[5]!==s?(m=()=>{if(!d||!s)return;const u=`${s}:${d}`;i.current!==u&&(i.current=u,l?.refreshThreadMetadata(s)),o.current!==s&&(o.current=s,e("site-editor"))},c=[d,s,e,l],t[2]=d,t[3]=l,t[4]=e,t[5]=s,t[6]=m,t[7]=c):(m=t[6],c=t[7]),O.useEffect(m,c)}function re(t){return`deco-credits-empty-dismissed:${t}`}function $t(t){try{return localStorage.getItem(re(t))==="1"}catch{return!1}}function nt(){const t=B.c(56),e=$(),{org:l}=A(),n=Ke("credits"),s=U(),{decoKeyId:a}=Ue(),[d,o]=O.useState(!0);let i;t[0]!==l.id?(i=()=>{G("credits_empty_state_dismissed",{organization_id:l.id}),o(!1);try{localStorage.setItem(re(l.id),"1")}catch{}},t[0]=l.id,t[1]=i):i=t[1];const m=i;let c,u;if(t[2]!==d||t[3]!==l.id?(c=()=>{d&&G("credits_empty_state_shown",{organization_id:l.id})},u=[d,l.id],t[2]=d,t[3]=l.id,t[4]=c,t[5]=u):(c=t[4],u=t[5]),O.useEffect(c,u),!d)return null;if(!n){let p;t[6]!==e?(p=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=p):p=t[7];let D;t[8]!==p?(D={title:p},t[8]=p,t[9]=D):D=t[9];let M;return t[10]!==m||t[11]!==D?(M=r.jsx(Ve,{feature:"chat",copy:D,onDismiss:m}),t[10]=m,t[11]=D,t[12]=M):M=t[12],M}let f;t[13]!==m?(f=p=>!p&&m(),t[13]=m,t[14]=f):f=t[14];let w;t[15]===Symbol.for("react.memo_cache_sentinel")?(w=r.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=w):w=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=r.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:r.jsx(ee,{size:20,className:"text-warning"})}),t[16]=y):y=t[16];let j;t[17]!==e?(j=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=j):j=t[18];let x;t[19]!==j?(x=r.jsx(Y,{className:"text-lg font-semibold",children:j}),t[19]=j,t[20]=x):x=t[20];let b;t[21]!==e?(b=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=b):b=t[22];let g;t[23]!==b?(g=r.jsx(ve,{className:"mt-2 text-[13px] leading-relaxed max-w-[320px] mx-auto",children:b}),t[23]=b,t[24]=g):g=t[24];let N;t[25]!==x||t[26]!==g?(N=r.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[w,r.jsxs(W,{className:"relative gap-3",children:[y,r.jsxs("div",{className:"text-center",children:[x,g]})]})]}),t[25]=x,t[26]=g,t[27]=N):N=t[27];let C;t[28]!==a||t[29]!==m?(C=a&&r.jsx("div",{className:"px-6 pb-5",children:r.jsx(Me,{source:"empty_state",onDone:m})}),t[28]=a,t[29]=m,t[30]=C):C=t[30];let S;t[31]!==m||t[32]!==s||t[33]!==l.slug?(S=()=>{s({to:"/$org/settings/ai-providers",params:{org:l.slug}}),m()},t[31]=m,t[32]=s,t[33]=l.slug,t[34]=S):S=t[34];let T;t[35]!==e?(T=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=T):T=t[36];let P;t[37]===Symbol.for("react.memo_cache_sentinel")?(P=r.jsx(qe,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=P):P=t[37];let _;t[38]!==S||t[39]!==T?(_=r.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:S,children:[T,P]}),t[38]=S,t[39]=T,t[40]=_):_=t[40];let I;t[41]!==e?(I=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=I):I=t[42];let k;t[43]!==m||t[44]!==I?(k=r.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:m,children:I}),t[43]=m,t[44]=I,t[45]=k):k=t[45];let E;t[46]!==_||t[47]!==k?(E=r.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[_,k]}),t[46]=_,t[47]=k,t[48]=E):E=t[48];let h;t[49]!==N||t[50]!==C||t[51]!==E?(h=r.jsxs(Z,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:at,children:[N,C,E]}),t[49]=N,t[50]=C,t[51]=E,t[52]=h):h=t[52];let v;return t[53]!==h||t[54]!==f?(v=r.jsx(J,{open:!0,onOpenChange:f,children:h}),t[53]=h,t[54]=f,t[55]=v):v=t[55],v}function at(t){return t.preventDefault()}function ot(t){const e=B.c(6),{balanceDollars:l}=t;let n;e[0]!==l?(n=l.toFixed(2),e[0]=l,e[1]=n):n=e[1];const s=n;let a,d;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=L("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),d=r.jsx(ee,{size:13,className:"text-success"}),e[2]=a,e[3]=d):(a=e[2],d=e[3]);let o;return e[4]!==s?(o=r.jsxs("div",{className:a,children:[d,r.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=o):o=e[5],o}function it(){const t=B.c(8),{org:e}=A(),l=U();let n;t[0]!==l||t[1]!==e.slug?(n=()=>l({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=l,t[1]=e.slug,t[2]=n):n=t[2];let s,a,d;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=L("inline-flex items-center gap-1.5 px-3 py-1 rounded-lg cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),a=r.jsx(Xe,{size:13,className:"text-warning"}),d=r.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=a,t[5]=d):(s=t[3],a=t[4],d=t[5]);let o;return t[6]!==n?(o=r.jsxs("button",{type:"button",onClick:n,className:s,children:[a,d]}),t[6]=n,t[7]=o):o=t[7],o}function ct(t){const e=B.c(7),{scrollRef:l,sentinelRef:n,hasMoreOlder:s,isFetchingOlder:a,fetchOlderMessages:d}=t;let o,i;e[0]!==d||e[1]!==s||e[2]!==a||e[3]!==l||e[4]!==n?(o=()=>{const m=n.current,c=l.current;if(!m||!c||!s)return;const u=new IntersectionObserver(async f=>{if(!f[0]?.isIntersecting||a||!s)return;const y=c.scrollHeight,j=c.scrollTop;await d(),requestAnimationFrame(()=>{const x=c.scrollHeight;c.scrollTop=j+(x-y)})},{root:c,rootMargin:"200px 0px 0px 0px"});return u.observe(m),()=>u.disconnect()},i=[l,n,s,a,d],e[0]=d,e[1]=s,e[2]=a,e[3]=l,e[4]=n,e[5]=o,e[6]=i):(o=e[5],i=e[6]),O.useEffect(o,i)}function dt(t){const e=B.c(5),{className:l,children:n}=t;let s;e[0]!==l?(s=L("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",l),e[0]=l,e[1]=s):s=e[1];let a;return e[2]!==n||e[3]!==s?(a=r.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=a):a=e[4],a}function mt(t){const e=B.c(5),{children:l,className:n}=t;let s;e[0]!==n?(s=L("flex-1 min-h-0 overflow-y-auto isolate",n),e[0]=n,e[1]=s):s=e[1];let a;return e[2]!==l||e[3]!==s?(a=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=a):a=e[4],a}function ut(t){const e=B.c(2),{children:l}=t;let n;return e[0]!==l?(n=r.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:l}),e[0]=l,e[1]=n):n=e[1],n}function ft(){const t=$(),{messages:e,status:l,hasMoreOlder:n,isFetchingOlder:s,fetchOlderMessages:a}=X(),{taskId:d}=fe();lt();const o=pe(d??""),i=xe(o),m=i.size===0?e:e.filter(g=>!i.has(g.id)),c=$e(m),u=c.at(-1),w=Le()*Re+16,y=O.useRef(null),j=O.useRef(null);ct({scrollRef:y,sentinelRef:j,hasMoreOlder:n,isFetchingOlder:s,fetchOlderMessages:a});const x=Ae({initial:!1}),b=g=>{y.current=g,x.scrollRef(g)};return r.jsx(Fe,{messages:e,children:r.jsxs("div",{className:"relative h-full w-full min-w-0",children:[r.jsx("div",{ref:b,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:w},children:r.jsxs("div",{ref:x.contentRef,className:"overflow-x-clip",children:[r.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[r.jsx("div",{ref:j,"aria-hidden":!0,className:"h-px"}),s&&r.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),c.slice(0,-1).map((g,N)=>r.jsx(q,{pair:g,isLastPair:!1,status:N===c.length-1?l:void 0},`pair-${g.user?.id??g.assistant?.id}`))]}),u&&r.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:r.jsx(q,{pair:u,isLastPair:!0,status:l},`pair-${u.user?.id??u.assistant?.id}`)})]})}),!x.isAtBottom&&r.jsx(V,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-md animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:w+8},onClick:()=>{x.scrollToBottom()},children:r.jsx(ae,{size:14})})]})})}function pt(t){const e=B.c(5),{children:l,className:n}=t;let s;e[0]!==n?(s=L("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",n),e[0]=n,e[1]=s):s=e[1];let a;return e[2]!==l||e[3]!==s?(a=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=a):a=e[4],a}const At=Object.assign(dt,{Main:mt,Messages:ft,EmptyState:ut,Footer:pt,Input:Oe,Provider:ue,ActiveTaskProvider:me,ThreadlessProvider:de,IceBreakers:st,NoAiProviderEmptyState:Ge,CreditsEmptyState:nt,CreditsEyebrow:ot,NoCreditsEyebrow:it,CreditsExhaustedBanner:Be});export{At as C,$t as w};
1
+ import{c as B,X as A,ay as le,l as L,j as r,E as ne,r as O,b as $,t as z,h as H,d as U,q as G,B as V}from"./index-DAhfV5vh.js";import{n as ae}from"./ArrowUp-THfmrwlM.js";import{c as oe,a as X,f as ie,u as ce,T as de,A as me,h as ue,b as fe,i as pe,j as xe}from"./chat-context-BaRraYAA.js";import{s as he,g as Q,d as ge}from"./gateway-client-DMn6uSTc.js";import{c as F,T as be,a as ye,b as je}from"./tooltip-cYDDz2Pp.js";import{c as W,d as Y,b as Z,D as J,h as ve}from"./dialog-B30-8RI6.js";import{d as we,b as Ne,a as Ce,D as Se}from"./drawer-Dx_eDva4.js";import{C as Te}from"./collection-search-QrA0qPpv.js";import{u as Pe}from"./use-mobile-UCEvtXfH.js";import{u as ke}from"./use-mcp-client-D2VYpHPF.js";import{u as Ee,g as De}from"./use-mcp-prompts-DtbMED93.js";import{c as _e,P as Ie}from"./index-BCW6nCJr.js";import{T as Me,c as Be,b as Oe,d as Le,H as Re}from"./input-Cxi1fFAz.js";import{u as $e,a as Ae,S as Fe,M as q}from"./pair-DyoXAxM8.js";import{a as ze}from"./use-panel-navigate--QzQC3VZ.js";import{u as He}from"./thread-intent-DjddwZgX.js";import{N as Ge}from"./decopilot-DvJjDwc1.js";import{i as qe}from"./LinkBroken01-DN8kSYpX.js";import{e as ee}from"./agent-icon-BUiQnNP8.js";import{e as Ke}from"./use-decopilot-events-7cMuGUn_.js";import{u as Ue}from"./use-deco-credits-CFjGcaIq.js";import{F as Ve}from"./feature-paywall-BpkcH4cr.js";import{i as Xe}from"./AlertCircle-BgzKIHBg.js";const K=3,te="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",Qe="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function se(t){const e=B.c(46),{item:l,onSelect:n,isLoading:s,isDisabled:a,variant:d}=t,o=d===void 0?"pill":d,{prompt:i}=l;let m;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const P=Q(i._meta);m=i.title??ge(i.name,P),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=m}else m=e[3];const c=m,u=i.description||null;if(o==="card"){let P;e[4]!==n||e[5]!==i?(P=()=>n(i),e[4]=n,e[5]=i,e[6]=P):P=e[6];const _=a||s,I=s&&"bg-accent/40",k=(a||s)&&"cursor-not-allowed opacity-50";let E;e[7]!==I||e[8]!==k?(E=L(Qe,"hover:bg-accent/60 text-foreground",I,k),e[7]=I,e[8]=k,e[9]=E):E=e[9];let h;e[10]!==c?(h=r.jsx("span",{className:"font-medium truncate capitalize",children:c}),e[10]=c,e[11]=h):h=e[11];let v;e[12]!==s?(v=s&&r.jsx(H,{size:"xs"}),e[12]=s,e[13]=v):v=e[13];let p;e[14]!==h||e[15]!==v?(p=r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h,v]}),e[14]=h,e[15]=v,e[16]=p):p=e[16];let D;e[17]!==u?(D=u&&r.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:u}),e[17]=u,e[18]=D):D=e[18];let M;return e[19]!==p||e[20]!==D||e[21]!==P||e[22]!==_||e[23]!==E?(M=r.jsxs("button",{type:"button",onClick:P,disabled:_,className:E,children:[p,D]}),e[19]=p,e[20]=D,e[21]=P,e[22]=_,e[23]=E,e[24]=M):M=e[24],M}let f;e[25]!==n||e[26]!==i?(f=()=>n(i),e[25]=n,e[26]=i,e[27]=f):f=e[27];const w=a||s,y=s&&"bg-muted/50",j=(a||s)&&"cursor-not-allowed opacity-50";let x;e[28]!==y||e[29]!==j?(x=L(te,"hover:bg-muted/70 hover:text-foreground",y,j),e[28]=y,e[29]=j,e[30]=x):x=e[30];let b;e[31]!==c?(b=r.jsx("span",{className:"capitalize",children:c}),e[31]=c,e[32]=b):b=e[32];let g;e[33]!==s?(g=s&&r.jsx(H,{size:"xs"}),e[33]=s,e[34]=g):g=e[34];let N;e[35]!==f||e[36]!==w||e[37]!==x||e[38]!==b||e[39]!==g?(N=r.jsx(be,{asChild:!0,children:r.jsxs("button",{type:"button",onClick:f,disabled:w,className:x,children:[b,g]})}),e[35]=f,e[36]=w,e[37]=x,e[38]=b,e[39]=g,e[40]=N):N=e[40];const C=u??c;let S;e[41]!==C?(S=r.jsx(ye,{side:"top",className:"max-w-xs",children:r.jsx("p",{className:"text-xs",children:C})}),e[41]=C,e[42]=S):S=e[42];let T;return e[43]!==N||e[44]!==S?(T=r.jsxs(je,{delayDuration:400,children:[N,S]}),e[43]=N,e[44]=S,e[45]=T):T=e[45],T}function We(t){const e=B.c(61),{items:l,open:n,onOpenChange:s,onSelect:a,loadingPrompt:d}=t,o=$(),[i,m]=O.useState(""),c=!!d;let u;e[0]!==l||e[1]!==i?(u=i.trim()?l.filter(h=>{const v=i.toLowerCase();return h.prompt.name.toLowerCase().includes(v)||(h.prompt.title??"").toLowerCase().includes(v)||(h.prompt.description??"").toLowerCase().includes(v)}):l,e[0]=l,e[1]=i,e[2]=u):u=e[2];const f=u,w=Pe();let y;e[3]!==f.length||e[4]!==i||e[5]!==o?(y=f.length===0&&r.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:o("chat.iceBreakers.noPromptsMatch",{search:i})}),e[3]=f.length,e[4]=i,e[5]=o,e[6]=y):y=e[6];let j;if(e[7]!==f||e[8]!==c||e[9]!==d?.name||e[10]!==s||e[11]!==a){let h;e[13]!==c||e[14]!==d?.name||e[15]!==s||e[16]!==a?(h=v=>r.jsx(se,{item:v,variant:"card",onSelect:p=>{s(!1),a(p)},isLoading:d?.name===v.prompt.name,isDisabled:c&&d?.name!==v.prompt.name},v.prompt.name),e[13]=c,e[14]=d?.name,e[15]=s,e[16]=a,e[17]=h):h=e[17],j=f.map(h),e[7]=f,e[8]=c,e[9]=d?.name,e[10]=s,e[11]=a,e[12]=j}else j=e[12];let x;e[18]!==y||e[19]!==j?(x=r.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[y,j]})}),e[18]=y,e[19]=j,e[20]=x):x=e[20];const b=x;let g;e[21]!==o?(g=o("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=o,e[22]=g):g=e[22];let N;e[23]===Symbol.for("react.memo_cache_sentinel")?(N=h=>{h.key==="Escape"&&m("")},e[23]=N):N=e[23];let C;e[24]!==i||e[25]!==g?(C=r.jsx(Te,{value:i,onChange:m,placeholder:g,onKeyDown:N}),e[24]=i,e[25]=g,e[26]=C):C=e[26];const S=C;if(w){let h;e[27]!==o?(h=o("chat.iceBreakers.allPromptsTitle"),e[27]=o,e[28]=h):h=e[28];let v;e[29]!==h?(v=r.jsx(we,{className:"sr-only",children:r.jsx(Ne,{children:h})}),e[29]=h,e[30]=v):v=e[30];let p;e[31]!==o?(p=o("chat.iceBreakers.promptsLabel"),e[31]=o,e[32]=p):p=e[32];let D;e[33]!==p?(D=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:p})}),e[33]=p,e[34]=D):D=e[34];let M;e[35]!==b||e[36]!==S||e[37]!==D||e[38]!==v?(M=r.jsxs(Ce,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[v,D,S,b]}),e[35]=b,e[36]=S,e[37]=D,e[38]=v,e[39]=M):M=e[39];let R;return e[40]!==s||e[41]!==n||e[42]!==M?(R=r.jsx(F,{delayDuration:400,children:r.jsx(Se,{open:n,onOpenChange:s,children:M})}),e[40]=s,e[41]=n,e[42]=M,e[43]=R):R=e[43],R}let T;e[44]!==o?(T=o("chat.iceBreakers.allPromptsTitle"),e[44]=o,e[45]=T):T=e[45];let P;e[46]!==T?(P=r.jsx(W,{className:"sr-only",children:r.jsx(Y,{children:T})}),e[46]=T,e[47]=P):P=e[47];let _;e[48]!==o?(_=o("chat.iceBreakers.promptsLabel"),e[48]=o,e[49]=_):_=e[49];let I;e[50]!==_?(I=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:_})}),e[50]=_,e[51]=I):I=e[51];let k;e[52]!==b||e[53]!==S||e[54]!==I||e[55]!==P?(k=r.jsxs(Z,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[P,I,S,b]}),e[52]=b,e[53]=S,e[54]=I,e[55]=P,e[56]=k):k=e[56];let E;return e[57]!==s||e[58]!==n||e[59]!==k?(E=r.jsx(F,{delayDuration:400,children:r.jsx(J,{open:n,onOpenChange:s,children:k})}),e[57]=s,e[58]=n,e[59]=k,e[60]=E):E=e[60],E}function Ye(t){const e=B.c(30),{items:l,onSelect:n,loadingPrompt:s,className:a}=t,d=$(),[o,i]=O.useState(!1);if(l.length===0)return null;let m,c,u,f,w;if(e[0]!==a||e[1]!==l||e[2]!==s||e[3]!==n||e[4]!==d){const b=l.slice(0,K),g=l.slice(K),N=!!s;let C;e[10]!==N||e[11]!==s?.name||e[12]!==n?(C=T=>r.jsx(se,{item:T,onSelect:n,isLoading:s?.name===T.prompt.name,isDisabled:N&&s?.name!==T.prompt.name},T.prompt.name),e[10]=N,e[11]=s?.name,e[12]=n,e[13]=C):C=e[13];const S=b.map(C);m=F,w=400,e[14]!==a?(c=L("w-full flex flex-wrap gap-2 justify-center",a),e[14]=a,e[15]=c):c=e[15],u=S,f=g.length>0&&r.jsx("button",{type:"button",disabled:N,onClick:()=>i(!0),className:L(te,"hover:bg-muted/70 hover:text-foreground",N&&"opacity-50 cursor-not-allowed"),children:d("chat.iceBreakers.moreButton",{count:g.length})}),e[0]=a,e[1]=l,e[2]=s,e[3]=n,e[4]=d,e[5]=m,e[6]=c,e[7]=u,e[8]=f,e[9]=w}else m=e[5],c=e[6],u=e[7],f=e[8],w=e[9];let y;e[16]!==c||e[17]!==u||e[18]!==f?(y=r.jsxs("div",{className:c,children:[u,f]}),e[16]=c,e[17]=u,e[18]=f,e[19]=y):y=e[19];let j;e[20]!==l||e[21]!==s||e[22]!==o||e[23]!==n?(j=r.jsx(We,{items:l,open:o,onOpenChange:i,onSelect:n,loadingPrompt:s}),e[20]=l,e[21]=s,e[22]=o,e[23]=n,e[24]=j):j=e[24];let x;return e[25]!==m||e[26]!==w||e[27]!==y||e[28]!==j?(x=r.jsxs(m,{delayDuration:w,children:[y,j]}),e[25]=m,e[26]=w,e[27]=y,e[28]=j,e[29]=x):x=e[29],x}function Ze(){return null}function Je(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function et(t){const e=B.c(31),{connectionId:l}=t,n=$(),{sendMessage:s}=X(),{org:a}=A();let d;e[0]!==l||e[1]!==a.id||e[2]!==a.slug?(d={connectionId:l,orgId:a.id,orgSlug:a.slug},e[0]=l,e[1]=a.id,e[2]=a.slug,e[3]=d):d=e[3];const o=ke(d);let i;e[4]!==o?(i={client:o,staleTime:6e4},e[4]=o,e[5]=i):i=e[5];const{data:m}=Ee(i);let c;e[6]!==m?.prompts?(c=m?.prompts??[],e[6]=m?.prompts,e[7]=c):c=e[7];const u=c;let f;e[8]!==u?(f=u.map(tt),e[8]=u,e[9]=f):f=e[9];const w=f;let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y={stage:"idle"},e[10]=y):y=e[10];const[j,x]=O.useReducer(Je,y),[b,g]=O.useState(null);let N;e[11]!==o||e[12]!==s||e[13]!==n?(N=async(p,D)=>{if(!o){z.error(n("chat.iceBreakers.mcpClientNotAvailable")),x({type:"RESET"});return}try{const M=await De(o,p.name,D);x({type:"RESET"});const R={type:"doc",content:[{type:"paragraph",content:[_e({id:p.name,name:he(p.name,Q(p._meta)),metadata:M.messages,char:"/",kind:"prompt",args:D}),{type:"text",text:" "}]}]};await s(R)}catch(M){console.error("[ice-breakers] Failed to fetch prompt:",M),z.error(n("chat.iceBreakers.failedToLoadPrompt")),x({type:"RESET"})}},e[11]=o,e[12]=s,e[13]=n,e[14]=N):N=e[14];const C=N;let S;e[15]!==C?(S=async p=>{if(p.arguments&&p.arguments.length>0){x({type:"SELECT_PROMPT",prompt:p}),g(p);return}x({type:"START_LOADING",prompt:p}),await C(p)},e[15]=C,e[16]=S):S=e[16];const T=S;let P;e[17]!==b||e[18]!==C?(P=async p=>{b&&(x({type:"START_LOADING",prompt:b,arguments:p}),g(null),await C(b,p))},e[17]=b,e[18]=C,e[19]=P):P=e[19];const _=P;if(w.length===0)return null;const I=j.stage==="loading"?j.prompt:null;let k;e[20]!==T||e[21]!==w||e[22]!==I?(k=r.jsx(Ye,{items:w,onSelect:T,loadingPrompt:I}),e[20]=T,e[21]=w,e[22]=I,e[23]=k):k=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{g(null),x({type:"RESET"})},e[24]=E):E=e[24];let h;e[25]!==b||e[26]!==_?(h=r.jsx(Ie,{prompt:b,setPrompt:E,onSubmit:_}),e[25]=b,e[26]=_,e[27]=h):h=e[27];let v;return e[28]!==k||e[29]!==h?(v=r.jsxs(r.Fragment,{children:[k,h]}),e[28]=k,e[29]=h,e[30]=v):v=e[30],v}function tt(t){return{prompt:t}}function st(t){const e=B.c(13),{className:l}=t,{selectedVirtualMcp:n}=oe(),{org:s}=A();let a;e[0]!==s.id?(a=le(s.id),e[0]=s.id,e[1]=a):a=e[1];const d=a.id,o=n?.id??d;let i;e[2]!==l?(i=L("w-full @container",l),e[2]=l,e[3]=i):i=e[3];const m=o??"default";let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx(Ze,{}),e[4]=c):c=e[4];let u;e[5]!==o?(u=r.jsx(et,{connectionId:o}),e[5]=o,e[6]=u):u=e[6];let f;e[7]!==m||e[8]!==u?(f=r.jsx(ne,{fallback:null,children:r.jsx(O.Suspense,{fallback:c,children:u},m)}),e[7]=m,e[8]=u,e[9]=f):f=e[9];let w;return e[10]!==i||e[11]!==f?(w=r.jsx("div",{className:i,children:f}),e[10]=i,e[11]=f,e[12]=w):w=e[12],w}function rt(t){let e=0;for(const l of t)for(const n of l.parts??[]){const s=n;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function lt(){const t=B.c(8),{openPanel:e}=ze(),l=He(),n=ie()?.messages??[],s=ce()?.taskId??null;let a;t[0]!==n?(a=rt(n),t[0]=n,t[1]=a):a=t[1];const d=a,o=O.useRef(null),i=O.useRef(null);let m,c;t[2]!==d||t[3]!==l||t[4]!==e||t[5]!==s?(m=()=>{if(!d||!s)return;const u=`${s}:${d}`;i.current!==u&&(i.current=u,l?.refreshThreadMetadata(s)),o.current!==s&&(o.current=s,e("site-editor"))},c=[d,s,e,l],t[2]=d,t[3]=l,t[4]=e,t[5]=s,t[6]=m,t[7]=c):(m=t[6],c=t[7]),O.useEffect(m,c)}function re(t){return`deco-credits-empty-dismissed:${t}`}function $t(t){try{return localStorage.getItem(re(t))==="1"}catch{return!1}}function nt(){const t=B.c(56),e=$(),{org:l}=A(),n=Ke("credits"),s=U(),{decoKeyId:a}=Ue(),[d,o]=O.useState(!0);let i;t[0]!==l.id?(i=()=>{G("credits_empty_state_dismissed",{organization_id:l.id}),o(!1);try{localStorage.setItem(re(l.id),"1")}catch{}},t[0]=l.id,t[1]=i):i=t[1];const m=i;let c,u;if(t[2]!==d||t[3]!==l.id?(c=()=>{d&&G("credits_empty_state_shown",{organization_id:l.id})},u=[d,l.id],t[2]=d,t[3]=l.id,t[4]=c,t[5]=u):(c=t[4],u=t[5]),O.useEffect(c,u),!d)return null;if(!n){let p;t[6]!==e?(p=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=p):p=t[7];let D;t[8]!==p?(D={title:p},t[8]=p,t[9]=D):D=t[9];let M;return t[10]!==m||t[11]!==D?(M=r.jsx(Ve,{feature:"chat",copy:D,onDismiss:m}),t[10]=m,t[11]=D,t[12]=M):M=t[12],M}let f;t[13]!==m?(f=p=>!p&&m(),t[13]=m,t[14]=f):f=t[14];let w;t[15]===Symbol.for("react.memo_cache_sentinel")?(w=r.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=w):w=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=r.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:r.jsx(ee,{size:20,className:"text-warning"})}),t[16]=y):y=t[16];let j;t[17]!==e?(j=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=j):j=t[18];let x;t[19]!==j?(x=r.jsx(Y,{className:"text-lg font-semibold",children:j}),t[19]=j,t[20]=x):x=t[20];let b;t[21]!==e?(b=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=b):b=t[22];let g;t[23]!==b?(g=r.jsx(ve,{className:"mt-2 text-[13px] leading-relaxed max-w-[320px] mx-auto",children:b}),t[23]=b,t[24]=g):g=t[24];let N;t[25]!==x||t[26]!==g?(N=r.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[w,r.jsxs(W,{className:"relative gap-3",children:[y,r.jsxs("div",{className:"text-center",children:[x,g]})]})]}),t[25]=x,t[26]=g,t[27]=N):N=t[27];let C;t[28]!==a||t[29]!==m?(C=a&&r.jsx("div",{className:"px-6 pb-5",children:r.jsx(Me,{source:"empty_state",onDone:m})}),t[28]=a,t[29]=m,t[30]=C):C=t[30];let S;t[31]!==m||t[32]!==s||t[33]!==l.slug?(S=()=>{s({to:"/$org/settings/ai-providers",params:{org:l.slug}}),m()},t[31]=m,t[32]=s,t[33]=l.slug,t[34]=S):S=t[34];let T;t[35]!==e?(T=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=T):T=t[36];let P;t[37]===Symbol.for("react.memo_cache_sentinel")?(P=r.jsx(qe,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=P):P=t[37];let _;t[38]!==S||t[39]!==T?(_=r.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:S,children:[T,P]}),t[38]=S,t[39]=T,t[40]=_):_=t[40];let I;t[41]!==e?(I=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=I):I=t[42];let k;t[43]!==m||t[44]!==I?(k=r.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:m,children:I}),t[43]=m,t[44]=I,t[45]=k):k=t[45];let E;t[46]!==_||t[47]!==k?(E=r.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[_,k]}),t[46]=_,t[47]=k,t[48]=E):E=t[48];let h;t[49]!==N||t[50]!==C||t[51]!==E?(h=r.jsxs(Z,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:at,children:[N,C,E]}),t[49]=N,t[50]=C,t[51]=E,t[52]=h):h=t[52];let v;return t[53]!==h||t[54]!==f?(v=r.jsx(J,{open:!0,onOpenChange:f,children:h}),t[53]=h,t[54]=f,t[55]=v):v=t[55],v}function at(t){return t.preventDefault()}function ot(t){const e=B.c(6),{balanceDollars:l}=t;let n;e[0]!==l?(n=l.toFixed(2),e[0]=l,e[1]=n):n=e[1];const s=n;let a,d;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=L("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),d=r.jsx(ee,{size:13,className:"text-success"}),e[2]=a,e[3]=d):(a=e[2],d=e[3]);let o;return e[4]!==s?(o=r.jsxs("div",{className:a,children:[d,r.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=o):o=e[5],o}function it(){const t=B.c(8),{org:e}=A(),l=U();let n;t[0]!==l||t[1]!==e.slug?(n=()=>l({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=l,t[1]=e.slug,t[2]=n):n=t[2];let s,a,d;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=L("inline-flex items-center gap-1.5 px-3 py-1 rounded-lg cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),a=r.jsx(Xe,{size:13,className:"text-warning"}),d=r.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=a,t[5]=d):(s=t[3],a=t[4],d=t[5]);let o;return t[6]!==n?(o=r.jsxs("button",{type:"button",onClick:n,className:s,children:[a,d]}),t[6]=n,t[7]=o):o=t[7],o}function ct(t){const e=B.c(7),{scrollRef:l,sentinelRef:n,hasMoreOlder:s,isFetchingOlder:a,fetchOlderMessages:d}=t;let o,i;e[0]!==d||e[1]!==s||e[2]!==a||e[3]!==l||e[4]!==n?(o=()=>{const m=n.current,c=l.current;if(!m||!c||!s)return;const u=new IntersectionObserver(async f=>{if(!f[0]?.isIntersecting||a||!s)return;const y=c.scrollHeight,j=c.scrollTop;await d(),requestAnimationFrame(()=>{const x=c.scrollHeight;c.scrollTop=j+(x-y)})},{root:c,rootMargin:"200px 0px 0px 0px"});return u.observe(m),()=>u.disconnect()},i=[l,n,s,a,d],e[0]=d,e[1]=s,e[2]=a,e[3]=l,e[4]=n,e[5]=o,e[6]=i):(o=e[5],i=e[6]),O.useEffect(o,i)}function dt(t){const e=B.c(5),{className:l,children:n}=t;let s;e[0]!==l?(s=L("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",l),e[0]=l,e[1]=s):s=e[1];let a;return e[2]!==n||e[3]!==s?(a=r.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=a):a=e[4],a}function mt(t){const e=B.c(5),{children:l,className:n}=t;let s;e[0]!==n?(s=L("flex-1 min-h-0 overflow-y-auto isolate",n),e[0]=n,e[1]=s):s=e[1];let a;return e[2]!==l||e[3]!==s?(a=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=a):a=e[4],a}function ut(t){const e=B.c(2),{children:l}=t;let n;return e[0]!==l?(n=r.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:l}),e[0]=l,e[1]=n):n=e[1],n}function ft(){const t=$(),{messages:e,status:l,hasMoreOlder:n,isFetchingOlder:s,fetchOlderMessages:a}=X(),{taskId:d}=fe();lt();const o=pe(d??""),i=xe(o),m=i.size===0?e:e.filter(g=>!i.has(g.id)),c=$e(m),u=c.at(-1),w=Le()*Re+16,y=O.useRef(null),j=O.useRef(null);ct({scrollRef:y,sentinelRef:j,hasMoreOlder:n,isFetchingOlder:s,fetchOlderMessages:a});const x=Ae({initial:!1}),b=g=>{y.current=g,x.scrollRef(g)};return r.jsx(Fe,{messages:e,children:r.jsxs("div",{className:"relative h-full w-full min-w-0",children:[r.jsx("div",{ref:b,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:w},children:r.jsxs("div",{ref:x.contentRef,className:"overflow-x-clip",children:[r.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[r.jsx("div",{ref:j,"aria-hidden":!0,className:"h-px"}),s&&r.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),c.slice(0,-1).map((g,N)=>r.jsx(q,{pair:g,isLastPair:!1,status:N===c.length-1?l:void 0},`pair-${g.user?.id??g.assistant?.id}`))]}),u&&r.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:r.jsx(q,{pair:u,isLastPair:!0,status:l},`pair-${u.user?.id??u.assistant?.id}`)})]})}),!x.isAtBottom&&r.jsx(V,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-md animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:w+8},onClick:()=>{x.scrollToBottom()},children:r.jsx(ae,{size:14})})]})})}function pt(t){const e=B.c(5),{children:l,className:n}=t;let s;e[0]!==n?(s=L("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",n),e[0]=n,e[1]=s):s=e[1];let a;return e[2]!==l||e[3]!==s?(a=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=a):a=e[4],a}const At=Object.assign(dt,{Main:mt,Messages:ft,EmptyState:ut,Footer:pt,Input:Oe,Provider:ue,ActiveTaskProvider:me,ThreadlessProvider:de,IceBreakers:st,NoAiProviderEmptyState:Ge,CreditsEmptyState:nt,CreditsEyebrow:ot,NoCreditsEyebrow:it,CreditsExhaustedBanner:Be});export{At as C,$t as w};
@@ -1,4 +1,4 @@
1
- import{c as fo,r as F,b as cc,as as Hf,j as R,h as Vf,B as cl,av as ul,au as jf,at as Wf,en as uc,eo as Kf,aR as Uf,ep as Kt,eq as _f,l as dc}from"./index-D3VyLkC3.js";import{d as qf,g as Jf}from"./gateway-client-DqqeM3yS.js";import{d as Gf,c as Yf,e as Xf,b as Qf,D as Zf}from"./dialog-C_zHR8DK.js";import{a as eh,F as th,b as nh,c as rh,d as ih,f as sh}from"./form-BGxoVGvb.js";import{I as oh}from"./input-B-l5PYzO.js";import{t as dl}from"./utils-CVEq3hMx.js";import{a as lh}from"./org-file-open-context-kIKkchjb.js";import{T as ah,a as ch,b as uh}from"./tooltip-BUwCxmad.js";function dh(t,e){const n={};for(const r of t?.arguments??[])n[r.name]=r.required?ul().min(1,e):ul();return jf(n)}function fh(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function yx(t){const e=fo.c(74),{prompt:n,setPrompt:r,onSubmit:i,defaultValues:s}=t,o=F.useId(),l=cc();let a,c;if(e[0]!==n||e[1]!==l){const ie=dh(n,l("chat.dialogPromptArguments.required"));c=Wf,a=Hf(ie),e[0]=n,e[1]=l,e[2]=a,e[3]=c}else a=e[2],c=e[3];let u;e[4]!==s||e[5]!==n?(u=n?fh(n,s):{},e[4]=s,e[5]=n,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]!==n?.arguments?(h=n?.arguments??[],e[10]=n?.arguments,e[11]=h):h=e[11];const p=h;let g;e[12]!==f||e[13]!==i||e[14]!==r?(g=async ie=>{await i(ie),r(null),f.reset()},e[12]=f,e[13]=i,e[14]=r,e[15]=g):g=e[15];const m=g;let y;e[16]!==f||e[17]!==r?(y=ie=>{ie||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=y):y=e[18];const b=y;if(!n)return null;let S;e[19]!==n._meta||e[20]!==n.name||e[21]!==n.title?(S=n.title||qf(n.name,Jf(n._meta)),e[19]=n._meta,e[20]=n.name,e[21]=n.title,e[22]=S):S=e[22];let C;e[23]!==S?(C=R.jsx(Gf,{children:R.jsx("span",{className:"capitalize",children:S})}),e[23]=S,e[24]=C):C=e[24];let T;e[25]!==n.description?(T=n.description&&R.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[25]=n.description,e[26]=T):T=e[26];let N;e[27]!==T||e[28]!==C?(N=R.jsxs(Yf,{children:[C,T]}),e[27]=T,e[28]=C,e[29]=N):N=e[29];let v;e[30]!==f||e[31]!==m?(v=ie=>{ie.stopPropagation(),f.handleSubmit(m)(ie)},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 ie;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==l?(ie=Le=>R.jsx(th,{control:f.control,name:Le.name,render:En=>{const{field:We}=En;return R.jsxs(nh,{children:[R.jsxs(rh,{className:"text-xs",children:[Le.name,Le.required?null:R.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",l("chat.dialogPromptArguments.optional")]})]}),R.jsx(ih,{children:R.jsx(oh,{...We,value:We.value??"",required:Le.required,placeholder:Le.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),R.jsx(sh,{})]})}},Le.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=l,e[41]=ie):ie=e[41],O=p.map(ie),e[33]=p,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=l,e[37]=O}else O=e[37];let P;e[42]!==b?(P=()=>b(!1),e[42]=b,e[43]=P):P=e[43];const _=f.formState.isSubmitting;let ne;e[44]!==l?(ne=l("chat.dialogPromptArguments.cancel"),e[44]=l,e[45]=ne):ne=e[45];let ce;e[46]!==f.formState.isSubmitting||e[47]!==P||e[48]!==ne?(ce=R.jsx(cl,{type:"button",variant:"ghost",onClick:P,disabled:_,children:ne}),e[46]=f.formState.isSubmitting,e[47]=P,e[48]=ne,e[49]=ce):ce=e[49];let H;e[50]!==f.formState.isSubmitting||e[51]!==l?(H=f.formState.isSubmitting?R.jsxs("span",{className:"flex items-center gap-2",children:[R.jsx(Vf,{size:"xs"}),l("chat.dialogPromptArguments.loading")]}):l("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=l,e[52]=H):H=e[52];let J;e[53]!==f.formState.isSubmitting||e[54]!==o||e[55]!==H?(J=R.jsx(cl,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:H}),e[53]=f.formState.isSubmitting,e[54]=o,e[55]=H,e[56]=J):J=e[56];let V;e[57]!==ce||e[58]!==J?(V=R.jsxs(Xf,{children:[ce,J]}),e[57]=ce,e[58]=J,e[59]=V):V=e[59];let re;e[60]!==o||e[61]!==v||e[62]!==O||e[63]!==V?(re=R.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:v,children:[O,V]}),e[60]=o,e[61]=v,e[62]=O,e[63]=V,e[64]=re):re=e[64];let Se;e[65]!==f||e[66]!==re?(Se=R.jsx(eh,{...f,children:re}),e[65]=f,e[66]=re,e[67]=Se):Se=e[67];let Pe;e[68]!==N||e[69]!==Se?(Pe=R.jsxs(Qf,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[N,Se]}),e[68]=N,e[69]=Se,e[70]=Pe):Pe=e[70];let ot;return e[71]!==b||e[72]!==Pe?(ot=R.jsx(Zf,{open:!0,onOpenChange:b,children:Pe}),e[71]=b,e[72]=Pe,e[73]=ot):ot=e[73],ot}var fl=Object.defineProperty,hh=(t,e)=>{let n={};for(var r in t)fl(n,r,{get:t[r],enumerable:!0});return fl(n,Symbol.toStringTag,{value:"Module"}),n};function se(t){this.content=t}se.prototype={constructor:se,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new se(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new se(n)},addToStart:function(t,e){return new se([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new se(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new se(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=se.from(t),t.size?new se(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=se.from(t),t.size?new se(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=se.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};se.from=function(t){if(t instanceof se)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new se(e)};function fc(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){let o=i.text,l=s.text,a=0;for(;o[a]==l[a];a++)n++;return a&&a<o.length&&a<l.length&&mc(o.charCodeAt(a-1))&&pc(o.charCodeAt(a))&&n--,n}if(i.content.size||s.content.size){let o=fc(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function hc(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){n-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:n,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--,n--,r--;return d&&f&&d<c.length&&mc(c.charCodeAt(d-1))&&pc(c.charCodeAt(d))&&(n++,r++),{a:n,b:r}}if(o.content.size||l.content.size){let c=hc(o.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}function pc(t){return t>=56320&&t<57344}function mc(t){return t>=55296&&t<56320}class k{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,l=0;l<n;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,i+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new k(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,n-o-1))),r.push(l),i+=l.nodeSize),o=a}return new k(r,i)}cutByIndex(e,n){return e==n?k.empty:e==0&&n==this.content.length?this:new k(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new k(i,s)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))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 n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return fc(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return hc(this,e,n,r)}findIndex(e){if(e==0)return xr(0,e);if(e==this.size)return xr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?xr(n+1,s):xr(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return k.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return k.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new k(n||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const Ji={index:0,offset:0};function xr(t,e){return Ji.index=t,Ji.offset=e,Ji}function Hr(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Hr(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Hr(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let $=class Es{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))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 n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Es.none;if(e instanceof Es)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};$.none=[];class Qn extends Error{}class M{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=yc(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new M(r,this.openStart,this.openEnd)}removeBetween(e,n){return new M(gc(this.content,e+this.openStart,n+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,n){if(!n)return M.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new M(k.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new M(e,r,i)}}M.empty=new M(k.empty,0,0);function gc(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:l}=t.findIndex(n);if(i==e||s.isText){if(l!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(gc(s.content,e-i-1,n-i-1)))}function yc(t,e,n,r,i,s){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=yc(a.content,e-l-1,n,o==0?r-1:0,o==t.childCount-1?i-1:0,a);return c&&t.replaceChild(o,a.copy(c))}function ph(t,e,n){if(n.openStart>t.depth)throw new Qn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Qn("Inconsistent open depths");return bc(t,e,n,0)}function bc(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=bc(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,l=o.content;return zt(o,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=mh(n,t);return zt(s,Sc(t,o,l,e,r))}else return zt(s,Vr(t,e,r))}function kc(t,e){if(!e.type.compatibleContent(t.type))throw new Qn("Cannot join "+e.type.name+" onto "+t.type.name)}function Ts(t,e,n){let r=t.node(n);return kc(r,e.node(n)),r}function $t(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function zn(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&($t(t.nodeAfter,r),s++));for(let l=s;l<o;l++)$t(i.child(l),r);e&&e.depth==n&&e.textOffset&&$t(e.nodeBefore,r)}function zt(t,e){if(!t.type.validContent(e))throw new Qn("Invalid content for node "+t.type.name);return t.copy(e)}function Sc(t,e,n,r,i){let s=t.depth>i&&Ts(t,e,i+1),o=r.depth>i&&Ts(n,r,i+1),l=[];return zn(null,t,i,l),s&&o&&e.index(i)==n.index(i)?(kc(s,o),$t(zt(s,Sc(t,e,n,r,i+1)),l)):(s&&$t(zt(s,Vr(t,e,i+1)),l),zn(e,n,i,l),o&&$t(zt(o,Vr(n,r,i+1)),l)),zn(r,null,i,l),new k(l)}function Vr(t,e,n){let r=[];if(zn(null,t,n,r),t.depth>n){let i=Ts(t,e,n+1);$t(zt(i,Vr(t,e,n+1)),r)}return zn(e,null,n,r),new k(r)}function mh(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(k.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Zn{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.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,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return $.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){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)&&(!n||n(this.node(r))))return new jr(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 n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(r.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new Zn(n,r,s)}static resolveCached(e,n){let r=hl.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else hl.set(e,r=new gh);let i=r.elts[r.i]=Zn.resolve(e,n);return r.i=(r.i+1)%yh,i}}class gh{constructor(){this.elts=[],this.i=0}}const yh=12,hl=new WeakMap;class jr{constructor(e,n,r){this.$from=e,this.$to=n,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 bh=Object.create(null);let Bt=class ws{constructor(e,n,r,i=$.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||k.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,n,r,i=0){this.content.nodesBetween(e,n,r,i,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,n,r,i){return this.content.textBetween(e,n,r,i)}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,n,r){return this.type==e&&Hr(this.attrs,n||e.defaultAttrs||bh)&&$.sameSet(this.marks,r||$.none)}copy(e=null){return e==this.content?this:new ws(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ws(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return M.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),l=i.start(o),c=i.node(o).content.cut(i.pos-l,s.pos-l);return new M(c,i.depth-o,s.depth-o)}replace(e,n,r){return ph(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Zn.resolveCached(this,e)}resolveNoCache(e){return Zn.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}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()+")"),xc(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=k.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=i;a<s;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);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=$.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!$.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=k.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Bt.prototype.text=void 0;class Wr extends Bt{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):xc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Wr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Wr(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function xc(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ut{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new kh(e,n);if(r.next==null)return Ut.empty;let i=Cc(r);r.next&&r.err("Unexpected trailing text");let s=wh(Th(i));return vh(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}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:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,l){let a=o.matchFragment(e,r);if(a&&(!n||a.validEnd))return k.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())&&i.indexOf(d)==-1){i.push(d);let f=s(d,l.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let l=i;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[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 n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
1
+ import{c as fo,r as F,b as cc,as as Hf,j as R,h as Vf,B as cl,av as ul,au as jf,at as Wf,en as uc,eo as Kf,aR as Uf,ep as Kt,eq as _f,l as dc}from"./index-DAhfV5vh.js";import{d as qf,g as Jf}from"./gateway-client-DMn6uSTc.js";import{d as Gf,c as Yf,e as Xf,b as Qf,D as Zf}from"./dialog-B30-8RI6.js";import{a as eh,F as th,b as nh,c as rh,d as ih,f as sh}from"./form-HEFwQ86k.js";import{I as oh}from"./input-Uk8z-Ktf.js";import{t as dl}from"./utils-CVEq3hMx.js";import{a as lh}from"./org-file-open-context-BFenNlZj.js";import{T as ah,a as ch,b as uh}from"./tooltip-cYDDz2Pp.js";function dh(t,e){const n={};for(const r of t?.arguments??[])n[r.name]=r.required?ul().min(1,e):ul();return jf(n)}function fh(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function yx(t){const e=fo.c(74),{prompt:n,setPrompt:r,onSubmit:i,defaultValues:s}=t,o=F.useId(),l=cc();let a,c;if(e[0]!==n||e[1]!==l){const ie=dh(n,l("chat.dialogPromptArguments.required"));c=Wf,a=Hf(ie),e[0]=n,e[1]=l,e[2]=a,e[3]=c}else a=e[2],c=e[3];let u;e[4]!==s||e[5]!==n?(u=n?fh(n,s):{},e[4]=s,e[5]=n,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]!==n?.arguments?(h=n?.arguments??[],e[10]=n?.arguments,e[11]=h):h=e[11];const p=h;let g;e[12]!==f||e[13]!==i||e[14]!==r?(g=async ie=>{await i(ie),r(null),f.reset()},e[12]=f,e[13]=i,e[14]=r,e[15]=g):g=e[15];const m=g;let y;e[16]!==f||e[17]!==r?(y=ie=>{ie||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=y):y=e[18];const b=y;if(!n)return null;let S;e[19]!==n._meta||e[20]!==n.name||e[21]!==n.title?(S=n.title||qf(n.name,Jf(n._meta)),e[19]=n._meta,e[20]=n.name,e[21]=n.title,e[22]=S):S=e[22];let C;e[23]!==S?(C=R.jsx(Gf,{children:R.jsx("span",{className:"capitalize",children:S})}),e[23]=S,e[24]=C):C=e[24];let T;e[25]!==n.description?(T=n.description&&R.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[25]=n.description,e[26]=T):T=e[26];let N;e[27]!==T||e[28]!==C?(N=R.jsxs(Yf,{children:[C,T]}),e[27]=T,e[28]=C,e[29]=N):N=e[29];let v;e[30]!==f||e[31]!==m?(v=ie=>{ie.stopPropagation(),f.handleSubmit(m)(ie)},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 ie;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==l?(ie=Le=>R.jsx(th,{control:f.control,name:Le.name,render:En=>{const{field:We}=En;return R.jsxs(nh,{children:[R.jsxs(rh,{className:"text-xs",children:[Le.name,Le.required?null:R.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",l("chat.dialogPromptArguments.optional")]})]}),R.jsx(ih,{children:R.jsx(oh,{...We,value:We.value??"",required:Le.required,placeholder:Le.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),R.jsx(sh,{})]})}},Le.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=l,e[41]=ie):ie=e[41],O=p.map(ie),e[33]=p,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=l,e[37]=O}else O=e[37];let P;e[42]!==b?(P=()=>b(!1),e[42]=b,e[43]=P):P=e[43];const _=f.formState.isSubmitting;let ne;e[44]!==l?(ne=l("chat.dialogPromptArguments.cancel"),e[44]=l,e[45]=ne):ne=e[45];let ce;e[46]!==f.formState.isSubmitting||e[47]!==P||e[48]!==ne?(ce=R.jsx(cl,{type:"button",variant:"ghost",onClick:P,disabled:_,children:ne}),e[46]=f.formState.isSubmitting,e[47]=P,e[48]=ne,e[49]=ce):ce=e[49];let H;e[50]!==f.formState.isSubmitting||e[51]!==l?(H=f.formState.isSubmitting?R.jsxs("span",{className:"flex items-center gap-2",children:[R.jsx(Vf,{size:"xs"}),l("chat.dialogPromptArguments.loading")]}):l("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=l,e[52]=H):H=e[52];let J;e[53]!==f.formState.isSubmitting||e[54]!==o||e[55]!==H?(J=R.jsx(cl,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:H}),e[53]=f.formState.isSubmitting,e[54]=o,e[55]=H,e[56]=J):J=e[56];let V;e[57]!==ce||e[58]!==J?(V=R.jsxs(Xf,{children:[ce,J]}),e[57]=ce,e[58]=J,e[59]=V):V=e[59];let re;e[60]!==o||e[61]!==v||e[62]!==O||e[63]!==V?(re=R.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:v,children:[O,V]}),e[60]=o,e[61]=v,e[62]=O,e[63]=V,e[64]=re):re=e[64];let Se;e[65]!==f||e[66]!==re?(Se=R.jsx(eh,{...f,children:re}),e[65]=f,e[66]=re,e[67]=Se):Se=e[67];let Pe;e[68]!==N||e[69]!==Se?(Pe=R.jsxs(Qf,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[N,Se]}),e[68]=N,e[69]=Se,e[70]=Pe):Pe=e[70];let ot;return e[71]!==b||e[72]!==Pe?(ot=R.jsx(Zf,{open:!0,onOpenChange:b,children:Pe}),e[71]=b,e[72]=Pe,e[73]=ot):ot=e[73],ot}var fl=Object.defineProperty,hh=(t,e)=>{let n={};for(var r in t)fl(n,r,{get:t[r],enumerable:!0});return fl(n,Symbol.toStringTag,{value:"Module"}),n};function se(t){this.content=t}se.prototype={constructor:se,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new se(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new se(n)},addToStart:function(t,e){return new se([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new se(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new se(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=se.from(t),t.size?new se(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=se.from(t),t.size?new se(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=se.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};se.from=function(t){if(t instanceof se)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new se(e)};function fc(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){let o=i.text,l=s.text,a=0;for(;o[a]==l[a];a++)n++;return a&&a<o.length&&a<l.length&&mc(o.charCodeAt(a-1))&&pc(o.charCodeAt(a))&&n--,n}if(i.content.size||s.content.size){let o=fc(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function hc(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){n-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:n,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--,n--,r--;return d&&f&&d<c.length&&mc(c.charCodeAt(d-1))&&pc(c.charCodeAt(d))&&(n++,r++),{a:n,b:r}}if(o.content.size||l.content.size){let c=hc(o.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}function pc(t){return t>=56320&&t<57344}function mc(t){return t>=55296&&t<56320}class k{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,l=0;l<n;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,i+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new k(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,n-o-1))),r.push(l),i+=l.nodeSize),o=a}return new k(r,i)}cutByIndex(e,n){return e==n?k.empty:e==0&&n==this.content.length?this:new k(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new k(i,s)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))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 n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return fc(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return hc(this,e,n,r)}findIndex(e){if(e==0)return xr(0,e);if(e==this.size)return xr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?xr(n+1,s):xr(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return k.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return k.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new k(n||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const Ji={index:0,offset:0};function xr(t,e){return Ji.index=t,Ji.offset=e,Ji}function Hr(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Hr(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Hr(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let $=class Es{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))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 n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Es.none;if(e instanceof Es)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};$.none=[];class Qn extends Error{}class M{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=yc(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new M(r,this.openStart,this.openEnd)}removeBetween(e,n){return new M(gc(this.content,e+this.openStart,n+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,n){if(!n)return M.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new M(k.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new M(e,r,i)}}M.empty=new M(k.empty,0,0);function gc(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:l}=t.findIndex(n);if(i==e||s.isText){if(l!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(gc(s.content,e-i-1,n-i-1)))}function yc(t,e,n,r,i,s){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=yc(a.content,e-l-1,n,o==0?r-1:0,o==t.childCount-1?i-1:0,a);return c&&t.replaceChild(o,a.copy(c))}function ph(t,e,n){if(n.openStart>t.depth)throw new Qn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Qn("Inconsistent open depths");return bc(t,e,n,0)}function bc(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=bc(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,l=o.content;return zt(o,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=mh(n,t);return zt(s,Sc(t,o,l,e,r))}else return zt(s,Vr(t,e,r))}function kc(t,e){if(!e.type.compatibleContent(t.type))throw new Qn("Cannot join "+e.type.name+" onto "+t.type.name)}function Ts(t,e,n){let r=t.node(n);return kc(r,e.node(n)),r}function $t(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function zn(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&($t(t.nodeAfter,r),s++));for(let l=s;l<o;l++)$t(i.child(l),r);e&&e.depth==n&&e.textOffset&&$t(e.nodeBefore,r)}function zt(t,e){if(!t.type.validContent(e))throw new Qn("Invalid content for node "+t.type.name);return t.copy(e)}function Sc(t,e,n,r,i){let s=t.depth>i&&Ts(t,e,i+1),o=r.depth>i&&Ts(n,r,i+1),l=[];return zn(null,t,i,l),s&&o&&e.index(i)==n.index(i)?(kc(s,o),$t(zt(s,Sc(t,e,n,r,i+1)),l)):(s&&$t(zt(s,Vr(t,e,i+1)),l),zn(e,n,i,l),o&&$t(zt(o,Vr(n,r,i+1)),l)),zn(r,null,i,l),new k(l)}function Vr(t,e,n){let r=[];if(zn(null,t,n,r),t.depth>n){let i=Ts(t,e,n+1);$t(zt(i,Vr(t,e,n+1)),r)}return zn(e,null,n,r),new k(r)}function mh(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(k.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Zn{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.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,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return $.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){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)&&(!n||n(this.node(r))))return new jr(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 n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(r.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new Zn(n,r,s)}static resolveCached(e,n){let r=hl.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else hl.set(e,r=new gh);let i=r.elts[r.i]=Zn.resolve(e,n);return r.i=(r.i+1)%yh,i}}class gh{constructor(){this.elts=[],this.i=0}}const yh=12,hl=new WeakMap;class jr{constructor(e,n,r){this.$from=e,this.$to=n,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 bh=Object.create(null);let Bt=class ws{constructor(e,n,r,i=$.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||k.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,n,r,i=0){this.content.nodesBetween(e,n,r,i,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,n,r,i){return this.content.textBetween(e,n,r,i)}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,n,r){return this.type==e&&Hr(this.attrs,n||e.defaultAttrs||bh)&&$.sameSet(this.marks,r||$.none)}copy(e=null){return e==this.content?this:new ws(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ws(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return M.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),l=i.start(o),c=i.node(o).content.cut(i.pos-l,s.pos-l);return new M(c,i.depth-o,s.depth-o)}replace(e,n,r){return ph(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Zn.resolveCached(this,e)}resolveNoCache(e){return Zn.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}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()+")"),xc(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=k.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=i;a<s;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);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=$.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!$.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=k.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Bt.prototype.text=void 0;class Wr extends Bt{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):xc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Wr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Wr(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function xc(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ut{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new kh(e,n);if(r.next==null)return Ut.empty;let i=Cc(r);r.next&&r.err("Unexpected trailing text");let s=wh(Th(i));return vh(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}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:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,l){let a=o.matchFragment(e,r);if(a&&(!n||a.validEnd))return k.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())&&i.indexOf(d)==-1){i.push(d);let f=s(d,l.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let l=i;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[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 n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
2
2
  `)}}Ut.empty=new Ut(!0);class kh{constructor(e,n){this.string=e,this.nodeTypes=n,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 Cc(t){let e=[];do e.push(Sh(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Sh(t){let e=[];do e.push(xh(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function xh(t){let e=Eh(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Ch(t,e);else break;return e}function pl(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Ch(t,e){let n=pl(t),r=n;return t.eat(",")&&(t.next!="}"?r=pl(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Mh(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function Eh(t){if(t.eat("(")){let e=Cc(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Mh(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Th(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function i(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(s(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=s(o.exprs[a],l);if(a==o.exprs.length-1)return c;i(c,l=n())}else if(o.type=="star"){let a=n();return r(l,a),i(s(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=n();return i(s(o.expr,l),a),i(s(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=n();i(s(o.expr,a),u),a=u}if(o.max==-1)i(s(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=n();r(a,u),i(s(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 Mc(t,e){return e-t}function ml(t,e){let n=[];return r(e),n.sort(Mc);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:l,to:a}=s[o];!l&&n.indexOf(a)==-1&&r(a)}}}function wh(t){let e=Object.create(null);return n(ml(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<i.length;u++)i[u][0]==l&&(c=i[u][1]);ml(t,a).forEach(u=>{c||i.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new Ut(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let l=i[o][1].sort(Mc);s.next.push({type:i[o][0],next:e[l.join(",")]||n(l)})}return s}}function vh(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let l=0;l<i.next.length;l++){let{type:a,next:c}=i.next[l];o.push(a.name),s&&!(a.isText||a.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Ec(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Tc(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function wc(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let i in t)t[i].validate&&t[i].validate(e[i])}function vc(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Nh(t,r,e[r]);return n}let gl=class Ac{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=vc(e,r.attrs),this.defaultAttrs=Ec(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==Ut.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:Tc(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Bt(this,this.computeAttrs(e),k.from(n),$.setFrom(r))}createChecked(e=null,n,r){return n=k.from(n),this.checkContent(n),new Bt(this,this.computeAttrs(e),n,$.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=k.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(k.empty,!0);return s?new Bt(this,e,n.append(s),$.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.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){wc(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 n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:$.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new Ac(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Ah(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class Nh{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Ah(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ri{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=vc(e,i.attrs),this.excluded=null;let s=Ec(this.attrs);this.instance=s?new $(this,s):null}create(e=null){return!e&&this.instance?this.instance:new $(this,Tc(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Ri(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){wc(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Nc{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=se.from(e.nodes),n.marks=se.from(e.marks||{}),this.nodes=gl.compile(this.spec.nodes,this),this.marks=Ri.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=Ut.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?yl(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:yl(this,o.split(" "))}this.nodeFromJSON=i=>Bt.fromJSON(this,i),this.markFromJSON=i=>$.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof gl){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(n,r,i)}text(e,n){let r=this.nodes.text;return new Wr(r,r.defaultAttrs,e,$.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function yl(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let l in t.marks){let a=t.marks[l];(i=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Oh(t){return t.tag!=null}function Dh(t){return t.style!=null}class He{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Oh(i))this.tags.push(i);else if(Dh(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new kl(this,n,!1);return r.addAll(e,$.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new kl(this,n,!0);return r.addAll(e,$.none,n.from,n.to),M.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(Ph(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],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)!=n))){if(o.getAttrs){let a=o.getAttrs(n);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let l=n[o];if((l.priority==null?50:l.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=Sl(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=Sl(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new He(e,He.schemaRules(e)))}}const Oc={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},Rh={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Dc={ol:!0,ul:!0},er=1,vs=2,Bn=4;function bl(t,e,n){return e!=null?(e?er:0)|(e==="full"?vs:0):t&&t.whitespace=="pre"?er|vs:n&~Bn}class Cr{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=$.none,this.match=s||(o&Bn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(k.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&er)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=k.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Oc.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class kl{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=bl(null,n.preserveWhitespace,0)|(r?Bn:0);i?s=new Cr(i.type,i.attrs,$.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new Cr(null,null,$.none,!0,null,o):s=new Cr(e.schema.topNodeType,null,$.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&vs?"full":this.localPreserveWS||(i.options&er)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="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(),n,!0),l[a]&&this.insertNode(o.text(l[a]),n,!/\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=i.content[i.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),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;Dc.hasOwnProperty(o)&&this.parser.normalizeLists&&Ih(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Rh.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);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(Oc.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=a&&a.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(s),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(s,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,n.attrs||null,r,n.preserveWhitespace);a&&(s=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];o!=l;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!i||i.length>c.length+l)&&(i=c,s=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)n=this.enterInner(i[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=$.none;for(let l of i.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):xl(l.type,e.type))&&(o=l.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=bl(e,s,o.options);o.options&Bn&&o.content.length==0&&(l|=Bn);let a=$.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):xl(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Cr(e,n,a,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=er)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=s?r.node(a-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function Ih(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Dc.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Ph(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Sl(t){let e={};for(let n in t)e[n]=t[n];return e}function xl(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=l=>{s.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||s.indexOf(u)<0&&o(u))return!0}};if(o(i.contentMatch))return!0}}class nt{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Mr(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let l=0,a=0;for(;l<s.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(s[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<s.length;)i=s.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,n);u&&(s.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){if(e.isText)return Mr(n).createTextNode(e.text);let{dom:r,contentDOM:i}=Lr(Mr(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Lr(Mr(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return typeof n=="string"?{dom:e.createTextNode(n)}:Lr(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new nt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Cl(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Cl(e.marks)}}function Cl(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Mr(t){return t.document||window.document}const Ml=new WeakMap;function Lh(t){let e=Ml.get(t);return e===void 0&&Ml.set(t,e=$h(t)),e}function $h(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function Lr(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=Lh(r))&&s.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=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let l,a=n?t.createElementNS(n,i):t.createElement(i),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(t.createTextNode(f));else{let{dom:h,contentDOM:p}=Lr(t,f,n,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const Rc=65535,Ic=Math.pow(2,16);function zh(t,e){return t+e*Ic}function El(t){return t&Rc}function Bh(t){return(t-(t&Rc))/Ic}const Pc=1,Lc=2,$r=4,$c=8;class As{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&$c)>0}get deletedBefore(){return(this.delInfo&(Pc|$r))>0}get deletedAfter(){return(this.delInfo&(Lc|$r))>0}get deletedAcross(){return(this.delInfo&$r)>0}}class xe{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&xe.empty)return xe.empty}recover(e){let n=0,r=El(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Bh(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=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?i:0);if(a>e)break;let c=this.ranges[l+s],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:n:n,h=a+i+(f<0?0:u);if(r)return h;let p=e==(n<0?a:d)?null:zh(l/3,e-a),g=e==a?Lc:e==d?Pc:$r;return(n<0?e!=a:e!=d)&&(g|=$c),new As(h,g,p)}i+=u-c}return r?e+i:new As(e+i,0,null)}touches(e,n){let r=0,i=El(n),s=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+s],u=a+c;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],l=o-(this.inverted?s:0),a=o+(this.inverted?0:s),c=this.ranges[i+n],u=this.ranges[i+r];e(l,l+c,a,a+u),s+=u-c}}invert(){return new xe(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?xe.empty:new xe(e<0?[0,-e,0]:[0,0,e])}}xe.empty=new xe([]);class tr{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new tr(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new tr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],l=o.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(s);if(a!=null&&a>s&&a<this.to){s=a,e=this._maps[a].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new As(e,i,null)}}const Gi=Object.create(null);class fe{getMap(){return xe.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Gi[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Gi)throw new RangeError("Duplicate use of step JSON ID "+e);return Gi[e]=n,n.prototype.jsonID=e,n}}class G{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new G(e,null)}static fail(e){return new G(null,e)}static fromReplace(e,n,r,i){try{return G.ok(e.replace(n,r,i))}catch(s){if(s instanceof Qn)return G.fail(s.message);throw s}}}function ho(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(ho(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return k.fromArray(r)}class mt extends fe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new M(ho(n.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return G.fromReplace(e,this.from,this.to,s)}invert(){return new De(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new mt(n.pos,r.pos,this.mark)}merge(e){return e instanceof mt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new mt(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new mt(n.from,n.to,e.markFromJSON(n.mark))}}fe.jsonID("addMark",mt);class De extends fe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new M(ho(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return G.fromReplace(e,this.from,this.to,r)}invert(){return new mt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new De(n.pos,r.pos,this.mark)}merge(e){return e instanceof De&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new De(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new De(n.from,n.to,e.markFromJSON(n.mark))}}fe.jsonID("removeMark",De);class gt extends fe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return G.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return G.fromReplace(e,this.pos,this.pos+1,new M(k.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new gt(this.pos,n.marks[i]);return new gt(this.pos,this.mark)}}return new _t(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new gt(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new gt(n.pos,e.markFromJSON(n.mark))}}fe.jsonID("addNodeMark",gt);class _t extends fe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return G.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return G.fromReplace(e,this.pos,this.pos+1,new M(k.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new gt(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new _t(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new _t(n.pos,e.markFromJSON(n.mark))}}fe.jsonID("removeNodeMark",_t);class q extends fe{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Ns(e,this.from,this.to)?G.fail("Structure replace would overwrite content"):G.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new xe([this.from,this.to-this.from,this.slice.size])}invert(e){return new q(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&q.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new q(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof q)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?M.empty:new M(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new q(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?M.empty:new M(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new q(e.from,this.to,n,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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new q(n.from,n.to,M.fromJSON(e,n.slice),!!n.structure)}}q.MAP_BIAS=1;fe.jsonID("replace",q);class ee extends fe{constructor(e,n,r,i,s,o,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Ns(e,this.from,this.gapFrom)||Ns(e,this.gapTo,this.to)))return G.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return G.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?G.fromReplace(e,this.from,this.to,r):G.fail("Content does not fit in gap")}getMap(){return new xe([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new ee(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new ee(n.pos,r.pos,i,s,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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ee(n.from,n.to,n.gapFrom,n.gapTo,M.fromJSON(e,n.slice),n.insert,!!n.structure)}}fe.jsonID("replaceAround",ee);function Ns(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Fh(t,e,n,r){let i=[],s=[],o,l;t.doc.nodesBetween(e,n,(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,n),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:i.push(o=new De(f,h,d[g])));l&&l.to==f?l.to=h:s.push(l=new mt(f,h,r))}}),i.forEach(a=>t.step(a)),s.forEach(a=>t.step(a))}function Hh(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(r instanceof Ri){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,n);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<i.length;h++){let p=i[h];p.step==s-1&&d.eq(i[h].style)&&(f=p)}f?(f.to=c,f.step=s):i.push({style:d,from:Math.max(l,e),to:c,step:s})}}}),i.forEach(o=>t.step(new De(o.from,o.to,o.style)))}function po(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<s.childCount;a++){let c=s.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new q(l,u,M.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new De(l,u,c.marks[f]));if(i&&c.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new M(k.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),o.push(new q(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(k.empty,!0);t.replace(l,l,new M(a,0,0))}for(let a=o.length-1;a>=0;a--)t.step(o[a])}function Vh(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Mn(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let o=t.$from.node(r),l=t.$from.index(r)+i,a=t.$to.indexAfter(r)-s;if(r<t.depth&&o.canReplace(l,a,n))return r;if(r==0||o.type.spec.isolating||!Vh(o,l,a))break;l&&(i=1),a<o.childCount&&(s=1)}return null}function jh(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),l=i.after(s+1),a=o,c=l,u=k.empty,d=0;for(let p=s,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,u=k.from(r.node(p).copy(u)),d++):a--;let f=k.empty,h=0;for(let p=s,g=!1;p>n;p--)g||i.after(p+1)<i.end(p)?(g=!0,f=k.from(i.node(p).copy(f)),h++):c++;t.step(new ee(a,c,o,l,new M(u.append(f),d,h),u.size-d,!0))}function mo(t,e,n=null,r=t){let i=Wh(t,e),s=i&&Kh(r,e);return s?i.map(Tl).concat({type:e,attrs:n}).concat(s.map(Tl)):null}function Tl(t){return{type:t,attrs:null}}function Wh(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function Kh(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<i;c++)a=a.matchType(n.child(c).type);return!a||!a.validEnd?null:o}function Uh(t,e,n){let r=k.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let l=n[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=k.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new ee(i,s,i,s,new M(r,0,0),n.length,!0))}function _h(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,l)=>{let a=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,a)&&qh(t.doc,t.mapping.slice(s).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&&Bc(t,o,l,s),po(t,t.mapping.slice(s).map(l,1),r,void 0,c===null);let u=t.mapping.slice(s),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return t.step(new ee(d,f,d+1,f-1,new M(k.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&zc(t,o,l,s),!1}})}function zc(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let a=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Bc(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`